summaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
authorQuincey Koziol <koziol@hdfgroup.org>2012-03-21 15:10:17 (GMT)
committerQuincey Koziol <koziol@hdfgroup.org>2012-03-21 15:10:17 (GMT)
commiteb89d7b53ab95623ab454186a602e1cafc7391f0 (patch)
treeceafe458b3011e38853e765352d3c7e59bbecce1 /tools
parent3e468e6ff65d540a439e99ea568a6bff7add7cea (diff)
downloadhdf5-eb89d7b53ab95623ab454186a602e1cafc7391f0.zip
hdf5-eb89d7b53ab95623ab454186a602e1cafc7391f0.tar.gz
hdf5-eb89d7b53ab95623ab454186a602e1cafc7391f0.tar.bz2
[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
Diffstat (limited to 'tools')
-rw-r--r--tools/CMakeLists.txt3
-rw-r--r--tools/Makefile.in3
-rw-r--r--tools/h5copy/CMakeLists.txt84
-rw-r--r--tools/h5copy/Makefile.in3
-rw-r--r--tools/h5copy/h5copy.c9
-rw-r--r--tools/h5copy/h5copygentest.c65
-rw-r--r--tools/h5copy/testfiles/h5copy_extlinks_src.out.ls3
-rw-r--r--tools/h5copy/testfiles/h5copy_misc1.out2
-rw-r--r--tools/h5copy/testfiles/h5copy_ref.out.ls3
-rw-r--r--tools/h5copy/testfiles/h5copytst.out.ls177
-rw-r--r--tools/h5copy/testh5copy.sh138
-rw-r--r--tools/h5diff/CMakeLists.txt262
-rw-r--r--tools/h5diff/Makefile.in3
-rw-r--r--tools/h5diff/h5diff_common.c263
-rw-r--r--tools/h5diff/h5diff_common.h5
-rw-r--r--tools/h5diff/h5diff_main.c30
-rw-r--r--tools/h5diff/h5diffgentest.c1148
-rw-r--r--tools/h5diff/ph5diff_main.c37
-rw-r--r--tools/h5diff/testfiles/compounds_array_vlen1.h5bin0 -> 26912 bytes
-rw-r--r--tools/h5diff/testfiles/compounds_array_vlen2.h5bin0 -> 26912 bytes
-rw-r--r--tools/h5diff/testfiles/h5diff_10.txt175
-rw-r--r--tools/h5diff/testfiles/h5diff_17.txt3
-rw-r--r--tools/h5diff/testfiles/h5diff_171.txt2
-rw-r--r--tools/h5diff/testfiles/h5diff_172.txt2
-rw-r--r--tools/h5diff/testfiles/h5diff_20.txt2
-rw-r--r--tools/h5diff/testfiles/h5diff_202.txt1
-rw-r--r--tools/h5diff/testfiles/h5diff_205.txt1
-rw-r--r--tools/h5diff/testfiles/h5diff_208.txt5
-rw-r--r--tools/h5diff/testfiles/h5diff_21.txt2
-rw-r--r--tools/h5diff/testfiles/h5diff_22.txt2
-rw-r--r--tools/h5diff/testfiles/h5diff_220.txt8
-rw-r--r--tools/h5diff/testfiles/h5diff_221.txt12
-rw-r--r--tools/h5diff/testfiles/h5diff_222.txt19
-rw-r--r--tools/h5diff/testfiles/h5diff_30.txt9
-rw-r--r--tools/h5diff/testfiles/h5diff_465.txt1
-rw-r--r--tools/h5diff/testfiles/h5diff_466.txt5
-rw-r--r--tools/h5diff/testfiles/h5diff_467.txt3
-rw-r--r--tools/h5diff/testfiles/h5diff_468.txt5
-rw-r--r--tools/h5diff/testfiles/h5diff_469.txt3
-rw-r--r--tools/h5diff/testfiles/h5diff_505.txt2
-rw-r--r--tools/h5diff/testfiles/h5diff_507.txt2
-rw-r--r--tools/h5diff/testfiles/h5diff_509.txt2
-rw-r--r--tools/h5diff/testfiles/h5diff_530.txt24
-rw-r--r--tools/h5diff/testfiles/h5diff_540.txt86
-rw-r--r--tools/h5diff/testfiles/h5diff_57.txt2
-rw-r--r--tools/h5diff/testfiles/h5diff_600.txt175
-rw-r--r--tools/h5diff/testfiles/h5diff_603.txt175
-rw-r--r--tools/h5diff/testfiles/h5diff_606.txt175
-rw-r--r--tools/h5diff/testfiles/h5diff_612.txt175
-rw-r--r--tools/h5diff/testfiles/h5diff_615.txt175
-rw-r--r--tools/h5diff/testfiles/h5diff_621.txt175
-rw-r--r--tools/h5diff/testfiles/h5diff_622.txt175
-rw-r--r--tools/h5diff/testfiles/h5diff_623.txt175
-rw-r--r--tools/h5diff/testfiles/h5diff_624.txt175
-rw-r--r--tools/h5diff/testfiles/h5diff_630.txt3
-rw-r--r--tools/h5diff/testfiles/h5diff_631.txt3
-rw-r--r--tools/h5diff/testfiles/h5diff_640.txt4
-rw-r--r--tools/h5diff/testfiles/h5diff_641.txt4
-rw-r--r--tools/h5diff/testfiles/h5diff_642.txt4
-rw-r--r--tools/h5diff/testfiles/h5diff_643.txt4
-rw-r--r--tools/h5diff/testfiles/h5diff_644.txt4
-rw-r--r--tools/h5diff/testfiles/h5diff_645.txt4
-rw-r--r--tools/h5diff/testfiles/h5diff_646.txt4
-rw-r--r--tools/h5diff/testfiles/h5diff_70.txt2
-rw-r--r--tools/h5diff/testfiles/h5diff_700.txt2
-rw-r--r--tools/h5diff/testfiles/h5diff_701.txt2
-rw-r--r--tools/h5diff/testfiles/h5diff_702.txt2
-rw-r--r--tools/h5diff/testfiles/h5diff_703.txt2
-rw-r--r--tools/h5diff/testfiles/h5diff_80.txt2
-rw-r--r--tools/h5diff/testfiles/h5diff_90.txt6
-rw-r--r--tools/h5diff/testfiles/h5diff_basic1.h5bin11432 -> 12248 bytes
-rw-r--r--tools/h5diff/testfiles/h5diff_comp_vl_strs.h5bin18536 -> 37952 bytes
-rw-r--r--tools/h5diff/testfiles/h5diff_dset_zero_dim_size1.h5bin0 -> 1672 bytes
-rw-r--r--tools/h5diff/testfiles/h5diff_dset_zero_dim_size2.h5bin0 -> 1672 bytes
-rwxr-xr-xtools/h5diff/testfiles/h5diff_enum_invalid_values.h5bin0 -> 2192 bytes
-rw-r--r--tools/h5diff/testfiles/non_comparables1.h5bin0 -> 6568 bytes
-rw-r--r--tools/h5diff/testfiles/non_comparables2.h5bin0 -> 6584 bytes
-rwxr-xr-xtools/h5diff/testh5diff.sh769
-rw-r--r--tools/h5dump/CMakeLists.txt739
-rw-r--r--tools/h5dump/Makefile.am3
-rw-r--r--tools/h5dump/Makefile.in17
-rw-r--r--tools/h5dump/h5dump.c6810
-rw-r--r--tools/h5dump/h5dump.h214
-rw-r--r--tools/h5dump/h5dump_ddl.c1932
-rw-r--r--tools/h5dump/h5dump_ddl.h50
-rw-r--r--tools/h5dump/h5dump_defines.h54
-rw-r--r--tools/h5dump/h5dump_extern.h112
-rw-r--r--tools/h5dump/h5dump_xml.c4456
-rw-r--r--tools/h5dump/h5dump_xml.h129
-rw-r--r--tools/h5dump/h5dumpgentest.c848
-rw-r--r--tools/h5dump/testh5dump.sh.in889
-rwxr-xr-xtools/h5dump/testh5dumpxml.sh.in7
-rw-r--r--tools/h5import/CMakeLists.txt58
-rwxr-xr-xtools/h5import/Makefile.in3
-rwxr-xr-xtools/h5import/h5import.c4382
-rwxr-xr-xtools/h5import/h5import.h179
-rwxr-xr-xtools/h5import/h5importtest.c94
-rwxr-xr-xtools/h5import/h5importtestutil.sh148
-rw-r--r--tools/h5import/testfiles/textpfe.h5 (renamed from tools/h5import/testfiles/test15.h5)bin2064 -> 2064 bytes
-rw-r--r--tools/h5import/testfiles/textpfe64.txt (renamed from tools/h5import/testfiles/in64.txt)0
-rw-r--r--tools/h5jam/CMakeLists.txt90
-rw-r--r--tools/h5jam/Makefile.in3
-rw-r--r--tools/h5jam/getub.c28
-rw-r--r--tools/h5jam/h5jam.c499
-rw-r--r--tools/h5jam/h5jamgentest.c24
-rw-r--r--tools/h5jam/h5unjam.c251
-rw-r--r--tools/h5jam/tellub.c26
-rw-r--r--tools/h5jam/testfiles/h5jam-help.txt24
-rw-r--r--tools/h5jam/testfiles/h5jam-ub-nohdf5.txt2
-rw-r--r--tools/h5jam/testfiles/h5unjam-help.txt27
-rw-r--r--tools/h5jam/testh5jam.sh.in315
-rw-r--r--tools/h5ls/CMakeLists.txt249
-rw-r--r--tools/h5ls/Makefile.in3
-rw-r--r--tools/h5ls/h5ls.c1142
-rw-r--r--tools/h5ls/testh5ls.sh.in209
-rw-r--r--tools/h5repack/CMakeLists.txt873
-rw-r--r--tools/h5repack/Makefile.in3
-rw-r--r--tools/h5repack/h5repack.c86
-rwxr-xr-xtools/h5repack/h5repack.sh.in353
-rw-r--r--tools/h5repack/h5repack_copy.c456
-rw-r--r--tools/h5repack/h5repack_filters.c7
-rw-r--r--tools/h5repack/h5repack_main.c68
-rw-r--r--tools/h5repack/h5repack_opttable.c15
-rw-r--r--tools/h5repack/h5repack_parse.c107
-rw-r--r--tools/h5repack/h5repack_refs.c442
-rw-r--r--tools/h5repack/h5repack_verify.c15
-rw-r--r--tools/h5repack/h5repacktst.c149
-rw-r--r--tools/h5repack/testfiles/h5repack_layout.h5bin29384 -> 27280 bytes
-rw-r--r--tools/h5repack/testh5repack_detect_szip.c4
-rw-r--r--tools/h5stat/CMakeLists.txt41
-rw-r--r--tools/h5stat/Makefile.in3
-rw-r--r--tools/h5stat/h5stat.c922
-rw-r--r--tools/h5stat/h5stat_gentest.c4
-rw-r--r--tools/h5stat/testh5stat.sh.in85
-rw-r--r--tools/lib/CMakeLists.txt19
-rw-r--r--tools/lib/Makefile.am2
-rw-r--r--tools/lib/Makefile.in14
-rw-r--r--tools/lib/h5diff.c263
-rw-r--r--tools/lib/h5diff.h24
-rw-r--r--tools/lib/h5diff_array.c573
-rw-r--r--tools/lib/h5diff_attr.c11
-rw-r--r--tools/lib/h5diff_dset.c85
-rw-r--r--tools/lib/h5diff_util.c33
-rw-r--r--tools/lib/h5tools.c2992
-rw-r--r--tools/lib/h5tools.h107
-rw-r--r--tools/lib/h5tools_dump.c3919
-rw-r--r--tools/lib/h5tools_dump.h85
-rw-r--r--tools/lib/h5tools_error.h7
-rw-r--r--tools/lib/h5tools_ref.c2
-rw-r--r--tools/lib/h5tools_str.c463
-rw-r--r--tools/lib/h5tools_str.h26
-rw-r--r--tools/lib/h5tools_type.c226
-rw-r--r--tools/lib/h5tools_utils.c242
-rw-r--r--tools/lib/h5tools_utils.h41
-rw-r--r--tools/lib/h5trav.c24
-rw-r--r--tools/lib/h5trav.h3
-rw-r--r--tools/lib/ph5diff.h34
-rw-r--r--tools/misc/CMakeLists.txt26
-rw-r--r--tools/misc/Makefile.in3
-rw-r--r--tools/misc/h5debug.c162
-rw-r--r--tools/misc/h5mkgrp.c8
-rw-r--r--tools/misc/testh5mkgrp.sh10
-rw-r--r--tools/testfiles/file_space.ddl9
-rw-r--r--tools/testfiles/filter_fail.ddl11
-rw-r--r--tools/testfiles/h5dump-help.txt (renamed from tools/testfiles/tnofilename.ddl)23
-rw-r--r--tools/testfiles/help-1.ls3
-rw-r--r--tools/testfiles/help-2.ls3
-rw-r--r--tools/testfiles/help-3.ls3
-rw-r--r--tools/testfiles/nosuchfile.ls3
-rw-r--r--tools/testfiles/packedbits.ddl3
-rw-r--r--tools/testfiles/tall-1.ddl3
-rw-r--r--tools/testfiles/tall-1.ls3
-rw-r--r--tools/testfiles/tall-2.ddl3
-rw-r--r--tools/testfiles/tall-2.ls3
-rw-r--r--tools/testfiles/tall-2A.ddl3
-rw-r--r--tools/testfiles/tall-2A.h5.xml96
-rw-r--r--tools/testfiles/tall-2B.ddl7
-rw-r--r--tools/testfiles/tall-3.ddl3
-rw-r--r--tools/testfiles/tall-4s.ddl3
-rw-r--r--tools/testfiles/tall-5s.ddl3
-rw-r--r--tools/testfiles/tall.h5.xml256
-rw-r--r--tools/testfiles/tallfilters.ddl7
-rw-r--r--tools/testfiles/tarray1.ddl3
-rw-r--r--tools/testfiles/tarray1.h5.xml14
-rw-r--r--tools/testfiles/tarray1.ls3
-rw-r--r--tools/testfiles/tarray1_big.ddl3
-rw-r--r--tools/testfiles/tarray2.ddl3
-rw-r--r--tools/testfiles/tarray2.h5.xml61
-rw-r--r--tools/testfiles/tarray3.ddl39
-rw-r--r--tools/testfiles/tarray3.h5.xml109
-rw-r--r--tools/testfiles/tarray4.ddl3
-rw-r--r--tools/testfiles/tarray5.ddl39
-rw-r--r--tools/testfiles/tarray6.ddl3
-rw-r--r--tools/testfiles/tarray6.h5bin6400 -> 6400 bytes
-rw-r--r--tools/testfiles/tarray6.h5.xml17
-rw-r--r--tools/testfiles/tarray7.ddl23
-rw-r--r--tools/testfiles/tarray7.h5.xml29
-rw-r--r--tools/testfiles/tarray8.ddl3
-rw-r--r--tools/testfiles/tattr-1.ddl15
-rw-r--r--tools/testfiles/tattr-2.ddl17
-rw-r--r--tools/testfiles/tattr-3.ddl18
-rw-r--r--tools/testfiles/tattr-4_be.ddl119
-rw-r--r--tools/testfiles/tattr.h5bin3024 -> 3024 bytes
-rw-r--r--tools/testfiles/tattr.h5.xml55
-rw-r--r--tools/testfiles/tattr2.ls450
-rw-r--r--tools/testfiles/tattr4_be.h5bin0 -> 3124 bytes
-rw-r--r--tools/testfiles/tattrreg.ddl3
-rw-r--r--tools/testfiles/tattrregR.ddl5
-rw-r--r--tools/testfiles/tattrreg_be.ls26
-rw-r--r--tools/testfiles/tattrreg_le.ls26
-rw-r--r--tools/testfiles/tbigdims.ddl3
-rw-r--r--tools/testfiles/tbitfields.h5.xml66
-rw-r--r--tools/testfiles/tboot1.ddl9
-rw-r--r--tools/testfiles/tboot2.ddl9
-rw-r--r--tools/testfiles/tchar1.ddl13
-rw-r--r--tools/testfiles/tchunked.ddl7
-rw-r--r--tools/testfiles/tcomp-1.ddl3
-rw-r--r--tools/testfiles/tcomp-1.ls3
-rw-r--r--tools/testfiles/tcomp-2.ddl3
-rw-r--r--tools/testfiles/tcomp-3.ddl3
-rw-r--r--tools/testfiles/tcomp-4.ddl3
-rw-r--r--tools/testfiles/tcompact.ddl5
-rw-r--r--tools/testfiles/tcompound.h5.xml157
-rw-r--r--tools/testfiles/tcompound2.h5.xml41
-rw-r--r--tools/testfiles/tcompound_complex.h5.xml51
-rw-r--r--tools/testfiles/tcontents.ddl3
-rw-r--r--tools/testfiles/tcontiguos.ddl5
-rw-r--r--tools/testfiles/tdatareg.ddl3
-rw-r--r--tools/testfiles/tdatareg.h5.xml123
-rw-r--r--tools/testfiles/tdataregR.ddl5
-rw-r--r--tools/testfiles/tdataregbe.ls3
-rw-r--r--tools/testfiles/tdataregle.ls3
-rw-r--r--tools/testfiles/tdeflate.ddl7
-rw-r--r--tools/testfiles/tdset-1.ddl3
-rw-r--r--tools/testfiles/tdset-1.ls3
-rw-r--r--tools/testfiles/tdset-2.ddl39
-rw-r--r--tools/testfiles/tdset-3s.ddl3
-rw-r--r--tools/testfiles/tdset.h5.xml903
-rw-r--r--tools/testfiles/tdset2.h5.xml549
-rw-r--r--tools/testfiles/tdset_idx.ls3
-rw-r--r--tools/testfiles/tempty-dtd-2.h5.xml50
-rw-r--r--tools/testfiles/tempty-dtd-uri.h5.xml48
-rw-r--r--tools/testfiles/tempty-dtd.h5.xml50
-rw-r--r--tools/testfiles/tempty-nons-2.h5.xml50
-rw-r--r--tools/testfiles/tempty-nons-uri.h5.xml48
-rw-r--r--tools/testfiles/tempty-nons.h5.xml50
-rw-r--r--tools/testfiles/tempty-ns-2.h5.xml50
-rw-r--r--tools/testfiles/tempty-ns.h5.xml50
-rw-r--r--tools/testfiles/tempty.ddl3
-rw-r--r--tools/testfiles/tempty.h5.xml50
-rw-r--r--tools/testfiles/tempty.ls3
-rw-r--r--tools/testfiles/tenum.h5.xml33
-rw-r--r--tools/testfiles/texternal.ddl5
-rw-r--r--tools/testfiles/textlink-1.ls3
-rw-r--r--tools/testfiles/textlink.ddl53
-rw-r--r--tools/testfiles/textlink.h5.xml5
-rw-r--r--tools/testfiles/textlinkfar.ddl22
-rw-r--r--tools/testfiles/textlinksrc-1-old.ls7
-rw-r--r--tools/testfiles/textlinksrc-1.ls7
-rw-r--r--tools/testfiles/textlinksrc-2-old.ls3
-rw-r--r--tools/testfiles/textlinksrc-2.ls3
-rw-r--r--tools/testfiles/textlinksrc-3-old.ls5
-rw-r--r--tools/testfiles/textlinksrc-3.ls5
-rw-r--r--tools/testfiles/textlinksrc-4.ls5
-rw-r--r--tools/testfiles/textlinksrc-5.ls3
-rw-r--r--tools/testfiles/textlinksrc-6-old.ls5
-rw-r--r--tools/testfiles/textlinksrc-6.ls5
-rw-r--r--tools/testfiles/textlinksrc-7-old.ls3
-rw-r--r--tools/testfiles/textlinksrc-7.ls3
-rw-r--r--tools/testfiles/textlinksrc-nodangle-1.ls3
-rw-r--r--tools/testfiles/textlinksrc-nodangle-2.ls5
-rw-r--r--tools/testfiles/textlinksrc.ddl22
-rw-r--r--tools/testfiles/textlinksrc.h5bin1104 -> 1224 bytes
-rw-r--r--tools/testfiles/tfamily.ddl3
-rw-r--r--tools/testfiles/tfill.ddl21
-rw-r--r--tools/testfiles/tfletcher32.ddl7
-rw-r--r--tools/testfiles/tfpformat.ddl17
-rw-r--r--tools/testfiles/tfpformat.h5.xml27
-rw-r--r--tools/testfiles/tgroup-1.ddl3
-rw-r--r--tools/testfiles/tgroup-1.ls3
-rw-r--r--tools/testfiles/tgroup-2.ddl3
-rw-r--r--tools/testfiles/tgroup-2.ls3
-rw-r--r--tools/testfiles/tgroup-3.ls3
-rw-r--r--tools/testfiles/tgroup.h5.xml5
-rw-r--r--tools/testfiles/tgroup.ls3
-rw-r--r--tools/testfiles/tgrp_comments.ddl3
-rw-r--r--tools/testfiles/tgrp_comments.ls3
-rw-r--r--tools/testfiles/thlink-1.ddl3
-rw-r--r--tools/testfiles/thlink-1.ls3
-rw-r--r--tools/testfiles/thlink-2.ddl3
-rw-r--r--tools/testfiles/thlink-3.ddl3
-rw-r--r--tools/testfiles/thlink-4.ddl3
-rw-r--r--tools/testfiles/thlink-5.ddl3
-rw-r--r--tools/testfiles/thlink.h5.xml19
-rw-r--r--tools/testfiles/thlinks-nodangle-1.ls3
-rw-r--r--tools/testfiles/thyperslab.ddl415
-rw-r--r--tools/testfiles/tindicesno.ddl3
-rw-r--r--tools/testfiles/tindicessub1.ddl3
-rw-r--r--tools/testfiles/tindicessub2.ddl3
-rw-r--r--tools/testfiles/tindicessub3.ddl3
-rw-r--r--tools/testfiles/tindicessub4.ddl3
-rw-r--r--tools/testfiles/tindicesyes.ddl3
-rw-r--r--tools/testfiles/tlarge_objname.ddl3
-rw-r--r--tools/testfiles/tlonglinks.ddl3
-rw-r--r--tools/testfiles/tloop-1.ddl3
-rw-r--r--tools/testfiles/tloop-1.ls3
-rw-r--r--tools/testfiles/tloop.h5.xml9
-rw-r--r--tools/testfiles/tloop2.h5.xml7
-rw-r--r--tools/testfiles/tmany.h5.xml401
-rw-r--r--tools/testfiles/tmulti.ddl3
-rw-r--r--tools/testfiles/tmultifile.ddl42
-rw-r--r--tools/testfiles/tmultifile.ls6
-rw-r--r--tools/testfiles/tname-amp.h5.xml130
-rw-r--r--tools/testfiles/tname-apos.h5.xml130
-rw-r--r--tools/testfiles/tname-gt.h5.xml130
-rw-r--r--tools/testfiles/tname-lt.h5.xml130
-rw-r--r--tools/testfiles/tname-quot.h5.xml130
-rw-r--r--tools/testfiles/tname-sp.h5.xml130
-rw-r--r--tools/testfiles/tnamed_dtype_attr.ddl5
-rw-r--r--tools/testfiles/tnamed_dtype_attr.h5.xml9
-rw-r--r--tools/testfiles/tnbit.ddl7
-rw-r--r--tools/testfiles/tnestcomp-1.ddl3
-rw-r--r--tools/testfiles/tnestcomp-1.ls3
-rw-r--r--tools/testfiles/tnestcomp-2.ls3
-rw-r--r--tools/testfiles/tnestcomp-3.ls3
-rw-r--r--tools/testfiles/tnestcomp-4.ls3
-rw-r--r--tools/testfiles/tnestedcomp.h5.xml24
-rw-r--r--tools/testfiles/tno-subset.ddl9
-rw-r--r--tools/testfiles/tno-subset.h5bin0 -> 1400 bytes
-rw-r--r--tools/testfiles/tnodata.h5.xml15
-rw-r--r--tools/testfiles/tnofilename-with-packed-bits.ddl101
-rw-r--r--tools/testfiles/tnullspace.ddl3
-rw-r--r--tools/testfiles/tobjref.h5.xml27
-rw-r--r--tools/testfiles/topaque.h5.xml9
-rw-r--r--tools/testfiles/torderattr1.ddl5
-rw-r--r--tools/testfiles/torderattr1.h5.xml13
-rw-r--r--tools/testfiles/torderattr2.ddl5
-rw-r--r--tools/testfiles/torderattr2.h5.xml13
-rw-r--r--tools/testfiles/torderattr3.ddl5
-rw-r--r--tools/testfiles/torderattr3.h5.xml13
-rw-r--r--tools/testfiles/torderattr4.ddl5
-rw-r--r--tools/testfiles/torderattr4.h5.xml13
-rw-r--r--tools/testfiles/tordergr1.ddl3
-rw-r--r--tools/testfiles/tordergr2.ddl3
-rw-r--r--tools/testfiles/tordergr3.ddl3
-rw-r--r--tools/testfiles/tordergr4.ddl3
-rw-r--r--tools/testfiles/tordergr5.ddl3
-rw-r--r--tools/testfiles/tpbitsArray.ddl14
-rw-r--r--tools/testfiles/tpbitsCharLengthExceeded.ddl18
-rw-r--r--tools/testfiles/tpbitsCharOffsetExceeded.ddl18
-rw-r--r--tools/testfiles/tpbitsCompound.ddl66
-rw-r--r--tools/testfiles/tpbitsIncomplete.ddl101
-rw-r--r--tools/testfiles/tpbitsIntLengthExceeded.ddl18
-rw-r--r--tools/testfiles/tpbitsIntOffsetExceeded.ddl18
-rw-r--r--tools/testfiles/tpbitsLengthExceeded.ddl101
-rw-r--r--tools/testfiles/tpbitsLengthPositive.ddl101
-rw-r--r--tools/testfiles/tpbitsLongLengthExceeded.ddl26
-rw-r--r--tools/testfiles/tpbitsLongOffsetExceeded.ddl26
-rw-r--r--tools/testfiles/tpbitsMax.ddl94
-rw-r--r--tools/testfiles/tpbitsMaxExceeded.ddl101
-rw-r--r--tools/testfiles/tpbitsOffsetExceeded.ddl101
-rw-r--r--tools/testfiles/tpbitsOffsetNegative.ddl101
-rw-r--r--tools/testfiles/tpbitsOverlapped.ddl50
-rw-r--r--tools/testfiles/tpbitsSigned.ddl28
-rw-r--r--tools/testfiles/tpbitsSigned2.ddl50
-rw-r--r--tools/testfiles/tpbitsSigned4.ddl28
-rw-r--r--tools/testfiles/tpbitsSignedInt.ddl28
-rw-r--r--tools/testfiles/tpbitsSignedInt4.ddl50
-rw-r--r--tools/testfiles/tpbitsSignedInt8.ddl34
-rw-r--r--tools/testfiles/tpbitsSignedIntWhole.ddl25
-rw-r--r--tools/testfiles/tpbitsSignedLong.ddl44
-rw-r--r--tools/testfiles/tpbitsSignedLong16.ddl67
-rw-r--r--tools/testfiles/tpbitsSignedLong8.ddl96
-rw-r--r--tools/testfiles/tpbitsSignedLongLong.ddl68
-rw-r--r--tools/testfiles/tpbitsSignedLongLong16.ddl196
-rw-r--r--tools/testfiles/tpbitsSignedLongLong32.ddl175
-rw-r--r--tools/testfiles/tpbitsSignedLongLongWhole.ddl121
-rw-r--r--tools/testfiles/tpbitsSignedLongLongWhole1.ddl175
-rw-r--r--tools/testfiles/tpbitsSignedLongLongWhole63.ddl172
-rw-r--r--tools/testfiles/tpbitsSignedLongWhole.ddl46
-rw-r--r--tools/testfiles/tpbitsSignedWhole.ddl17
-rw-r--r--tools/testfiles/tpbitsUnsigned.ddl28
-rw-r--r--tools/testfiles/tpbitsUnsigned2.ddl50
-rw-r--r--tools/testfiles/tpbitsUnsigned4.ddl28
-rw-r--r--tools/testfiles/tpbitsUnsignedInt.ddl28
-rw-r--r--tools/testfiles/tpbitsUnsignedInt4.ddl50
-rw-r--r--tools/testfiles/tpbitsUnsignedInt8.ddl34
-rw-r--r--tools/testfiles/tpbitsUnsignedIntWhole.ddl25
-rw-r--r--tools/testfiles/tpbitsUnsignedLong.ddl44
-rw-r--r--tools/testfiles/tpbitsUnsignedLong16.ddl67
-rw-r--r--tools/testfiles/tpbitsUnsignedLong8.ddl96
-rw-r--r--tools/testfiles/tpbitsUnsignedLongLong.ddl68
-rw-r--r--tools/testfiles/tpbitsUnsignedLongLong16.ddl196
-rw-r--r--tools/testfiles/tpbitsUnsignedLongLong32.ddl175
-rw-r--r--tools/testfiles/tpbitsUnsignedLongLongWhole.ddl176
-rw-r--r--tools/testfiles/tpbitsUnsignedLongLongWhole1.ddl175
-rw-r--r--tools/testfiles/tpbitsUnsignedLongLongWhole63.ddl172
-rw-r--r--tools/testfiles/tpbitsUnsignedLongWhole.ddl59
-rw-r--r--tools/testfiles/tpbitsUnsignedWhole.ddl17
-rw-r--r--tools/testfiles/tperror.ddl39
-rw-r--r--tools/testfiles/tqmarkfile.ddl83
-rw-r--r--tools/testfiles/tref-escapes-at.h5.xml142
-rw-r--r--tools/testfiles/tref-escapes.h5.xml72
-rw-r--r--tools/testfiles/tref.h5.xml27
-rw-r--r--tools/testfiles/treference.ddl279
-rw-r--r--tools/testfiles/tsaf.ddl3
-rw-r--r--tools/testfiles/tsaf.h5.xml6740
-rw-r--r--tools/testfiles/tsaf.ls3
-rw-r--r--tools/testfiles/tscaleoffset.ddl7
-rw-r--r--tools/testfiles/tshuffle.ddl7
-rw-r--r--tools/testfiles/tslink-1.ddl3
-rw-r--r--tools/testfiles/tslink-1.ls3
-rw-r--r--tools/testfiles/tslink-2.ddl3
-rw-r--r--tools/testfiles/tslink-D.ddl30
-rw-r--r--tools/testfiles/tslink.h5.xml5
-rw-r--r--tools/testfiles/tsoftlinks-1.ls3
-rw-r--r--tools/testfiles/tsoftlinks-2.ls3
-rw-r--r--tools/testfiles/tsoftlinks-3.ls3
-rw-r--r--tools/testfiles/tsoftlinks-4.ls3
-rw-r--r--tools/testfiles/tsoftlinks-5.ls3
-rw-r--r--tools/testfiles/tsoftlinks-nodangle-1.ls3
-rw-r--r--tools/testfiles/tsplit_file.ddl13
-rw-r--r--tools/testfiles/tstarfile.ddl89
-rw-r--r--tools/testfiles/tstr-1.ddl43
-rw-r--r--tools/testfiles/tstr-1.ls3
-rw-r--r--tools/testfiles/tstr-2.ddl73
-rw-r--r--tools/testfiles/tstr.h5.xml223
-rw-r--r--tools/testfiles/tstr2.h5.xml29
-rw-r--r--tools/testfiles/tstring-at.h5.xml9
-rw-r--r--tools/testfiles/tstring.ddl23
-rw-r--r--tools/testfiles/tstring.h5.xml9
-rw-r--r--tools/testfiles/tstring2.ddl7
-rw-r--r--tools/testfiles/tstringe.ddl23
-rw-r--r--tools/testfiles/tszip.ddl7
-rw-r--r--tools/testfiles/tudlink-1.ddl3
-rw-r--r--tools/testfiles/tudlink-1.ls3
-rw-r--r--tools/testfiles/tudlink-2.ddl3
-rw-r--r--tools/testfiles/tudlink.h5.xml5
-rw-r--r--tools/testfiles/tuserfilter.ddl20
-rw-r--r--tools/testfiles/tvldtypes1.ddl3
-rw-r--r--tools/testfiles/tvldtypes1.h5.xml27
-rw-r--r--tools/testfiles/tvldtypes1.ls3
-rw-r--r--tools/testfiles/tvldtypes2.ddl3
-rw-r--r--tools/testfiles/tvldtypes2.h5.xml13
-rw-r--r--tools/testfiles/tvldtypes2be.ls3
-rw-r--r--tools/testfiles/tvldtypes2le.ls3
-rw-r--r--tools/testfiles/tvldtypes3.ddl3
-rw-r--r--tools/testfiles/tvldtypes3.h5.xml14
-rw-r--r--tools/testfiles/tvldtypes4.ddl3
-rw-r--r--tools/testfiles/tvldtypes4.h5.xml19
-rw-r--r--tools/testfiles/tvldtypes5.ddl3
-rw-r--r--tools/testfiles/tvldtypes5.h5.xml20
-rw-r--r--tools/testfiles/tvlstr.ddl24
-rw-r--r--tools/testfiles/tvlstr.h5.xml15
-rw-r--r--tools/testfiles/tvms.ddl3
-rw-r--r--tools/testfiles/zerodim.ddl16
-rw-r--r--tools/testfiles/zerodim.h5bin0 -> 1528 bytes
457 files changed, 40118 insertions, 20403 deletions
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 $<TARGET_FILE:h5copygentest>)
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 $<TARGET_FILE:h5ls> -Svr ./testfiles/${file}.out.h5)
+ ADD_TEST (NAME H5COPY-h5ls_${file}-${filetest} COMMAND $<TARGET_FILE:h5ls> -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=$<TARGET_FILE:h5ls>"
-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 $<TARGET_FILE:h5copy> -i ${infile} -o ./testfiles/${outfile} ${vparam} ${sparam} ${srcname} ${dparam} ${dstname} ${ARGN})
+ ADD_TEST (NAME H5COPY-CMP-${testname} COMMAND $<TARGET_FILE:h5copy> -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=$<TARGET_FILE:h5copy>"
- -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 <stdlib.h>
#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 <h5copytst.h5> and object </simple> to file <./testfiles/h5copytst.out.h5> and object </g1/g2/simple>
+Copying file <./testfiles/h5copytst.h5> and object </simple> to file <./testfiles/h5copytst.out.h5> and object </g1/g2/simple>
Error in copy...Exiting
h5copy error: group </g1> 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: <details removed for portability>
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: <details removed for portability>
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: <details removed for portability>
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: <details removed for portability>
Type: 32-bit little-endian integer
/E/F/grp_dsets/compact Dataset {6/6}
- Location: 1:104936
+ Location: 1:103240
Links: 1
Storage: <details removed for portability>
Type: 32-bit little-endian integer
/E/F/grp_dsets/compound Dataset {2/2}
- Location: 1:105072
+ Location: 1:103376
Links: 1
Storage: <details removed for portability>
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: <details removed for portability>
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: <details removed for portability>
- 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: <details removed for portability>
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: <details removed for portability>
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: <details removed for portability>
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: <details removed for portability>
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: <details removed for portability>
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: <details removed for portability>
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: <details removed for portability>
- 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: <details removed for portability>
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: <details removed for portability>
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: <details removed for portability>
Type: 32-bit little-endian integer
/grp_dsets/compact Dataset {6/6}
- Location: 1:38496
+ Location: 1:36800
Links: 1
Storage: <details removed for portability>
Type: 32-bit little-endian integer
/grp_dsets/compound Dataset {2/2}
- Location: 1:38632
+ Location: 1:36936
Links: 1
Storage: <details removed for portability>
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: <details removed for portability>
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: <details removed for portability>
- 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: <details removed for portability>
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: <details removed for portability>
Type: 32-bit little-endian integer
/grp_dsets/simple_group Dataset {6/6}
- Location: 1:61640
+ Location: 1:59944
Links: 1
Storage: <details removed for portability>
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: <details removed for portability>
Type: 32-bit little-endian integer
/grp_nested/grp_dsets/compact Dataset {6/6}
- Location: 1:51752
+ Location: 1:50056
Links: 1
Storage: <details removed for portability>
Type: 32-bit little-endian integer
/grp_nested/grp_dsets/compound Dataset {2/2}
- Location: 1:51888
+ Location: 1:50192
Links: 1
Storage: <details removed for portability>
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: <details removed for portability>
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: <details removed for portability>
- 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: <details removed for portability>
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: <details removed for portability>
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: <details removed for portability>
Type: 32-bit little-endian integer
/grp_rename/compact Dataset {6/6}
- Location: 1:67488
+ Location: 1:65792
Links: 1
Storage: <details removed for portability>
Type: 32-bit little-endian integer
/grp_rename/compound Dataset {2/2}
- Location: 1:67624
+ Location: 1:65928
Links: 1
Storage: <details removed for portability>
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: <details removed for portability>
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: <details removed for portability>
Type: 32-bit little-endian integer
/grp_rename/grp_dsets/compact Dataset {6/6}
- Location: 1:80368
+ Location: 1:78672
Links: 1
Storage: <details removed for portability>
Type: 32-bit little-endian integer
/grp_rename/grp_dsets/compound Dataset {2/2}
- Location: 1:80504
+ Location: 1:78808
Links: 1
Storage: <details removed for portability>
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: <details removed for portability>
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: <details removed for portability>
- 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: <details removed for portability>
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: <details removed for portability>
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: <details removed for portability>
- 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: <details removed for portability>
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: <details removed for portability>
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: <details removed for portability>
- 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: <details removed for portability>
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: <details removed for portability>
Type: struct {
@@ -426,7 +423,7 @@ Opened "./testfiles/h5copytst.out.h5" with sec2 driver.
Storage: <details removed for portability>
Type: 32-bit little-endian integer
/simple_top Dataset {6/6}
- Location: 1:29680
+ Location: 1:27984
Links: 1
Storage: <details removed for portability>
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: <details removed for portability>/' >$actual
@@ -302,8 +369,8 @@ H5LSTEST()
# <none>
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()
# <none>
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()
# <none>
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()
# <none>
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 $<TARGET_FILE:h5diffgentest>)
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=$<TARGET_FILE:h5diff>"
@@ -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 $<TARGET_FILE:ph5diff> ${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};$<TARGET_FILE:ph5diff>"
+ -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 $<TARGET_FILE:h5diff> ${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 <string.h>
#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 <stdlib.h>
#include <assert.h>
+#include <memory.h>
#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 <stdlib.h>
#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<SDIM_DSET; i++)
+ {
+ wdata[i].i1 = i;
+ wdata[i].vl.p = malloc((i+1)*sizeof(cmpd2_t));
+ wdata[i].vl.len = i+1;
+ for(j=0; j<(i+1); j++)
+ {
+ ((cmpd2_t *)wdata[i].vl.p)[j].i2 = i*10 + diff;
+ ((cmpd2_t *)wdata[i].vl.p)[j].f2 = (float)(i*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 sub compound2 type */
+ tid_cmpd2 = H5Tcreate(H5T_COMPOUND, sizeof(cmpd2_t));
+
+ /* Insert fields */
+ ret = H5Tinsert(tid_cmpd2, "int2", HOFFSET(cmpd2_t, i2), H5T_NATIVE_INT);
+ assert(ret >= 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<SDIM_DSET; i++)
+ {
+ /* compound 1 data */
+ wdata[i].i1 = i;
+ wdata[i].vl.p = malloc((i+1)*sizeof(cmpd2_t));
+ wdata[i].vl.len = i+1;
+ for(j=0; j<(i+1); j++)
+ {
+ /* compound2 data */
+ ((cmpd2_t *)wdata[i].vl.p)[j].i2 = i*10 + diff;
+ for (k=0; k < SDIM_CMPD_ARRAY; k++)
+ {
+ /* compound 3 data */
+ ((cmpd2_t *)(wdata[i].vl.p))[j].cmpd3[k].i3 = k*10.5 + diff;
+ ((cmpd2_t *)(wdata[i].vl.p))[j].cmpd3[k].f3 = (float)(k*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 sub compound3 type */
+ tid_cmpd3 = H5Tcreate(H5T_COMPOUND, sizeof(cmpd3_t));
+
+ /* Insert fields */
+ ret = H5Tinsert(tid_cmpd3, "int3", HOFFSET(cmpd3_t, i3), H5T_NATIVE_INT);
+ assert(ret >= 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 <string.h>
#include <assert.h>
#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
--- /dev/null
+++ b/tools/h5diff/testfiles/compounds_array_vlen1.h5
Binary files 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
--- /dev/null
+++ b/tools/h5diff/testfiles/compounds_array_vlen2.h5
Binary files 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: </g1/fp19> and </g1/fp19>
+dataset: </g1/fp19> and </g1/fp19_COPY>
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: </g1/fp20> and </g1/fp20>
+dataset: </g1/fp20> and </g1/fp20_COPY>
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: </g2/dset2> is of class H5T_FLOAT and </g2/dset3> is of class H5T_INTEGER
-Not comparable: </g2/dset2> has sign H5T_SGN_ERROR and </g2/dset3> 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: </g2/dset5> has rank 2, dimensions [2x2], max dimensions [2x2]
and </g2/dset6> has rank 2, dimensions [3x2], max dimensions [3x2]
-Not comparable: </g2/dset5> has sign H5T_SGN_2 and </g2/dset6> 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: </dset1> or </dset1> is an empty dataset
+Not comparable: </dset2> or </dset2> is an empty dataset
+Not comparable: </dset2> has rank 2, dimensions [0x0], max dimensions [0x0]
+and </dset2> 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: </g1/dset1> is of class H5T_INTEGER and </g1/dset1> is of class H5T_STRING
+attribute: <attr of </g1/dset1>> and <attr of </g1/dset1>>
+3 differences found
+dataset: </g1/dset1> and </g1/dset1>
+3 differences found
+dataset: </g1/dset2> and </g1/dset2>
+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: <attr1> is of class H5T_INTEGER and <attr1> is of class H5T_STRING
+Not comparable: <attr2> has rank 1, dimensions [3], max dimensions [3]
+and <attr2> has rank 1, dimensions [4], max dimensions [4]
+Not comparable: <attr3> has rank 1, dimensions [3], max dimensions [3]
+and <attr3> has rank 2, dimensions [3x1], max dimensions [3x1]
+attribute: <attr4 of </g2/dset1>> and <attr4 of </g2/dset1>>
+3 differences found
+dataset: </g2/dset1> and </g2/dset1>
+6 differences found
+dataset: </g2/dset2> and </g2/dset2>
+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: </g1/dset1> is of class H5T_INTEGER and </g1/dset1> is of class H5T_STRING
+attribute: <attr of </g1/dset1>> and <attr of </g1/dset1>>
+3 differences found
+dataset: </g1/dset1> and </g1/dset1>
+3 differences found
+dataset: </g1/dset2> and </g1/dset2>
+3 differences found
+Not comparable: <attr1> is of class H5T_INTEGER and <attr1> is of class H5T_STRING
+Not comparable: <attr2> has rank 1, dimensions [3], max dimensions [3]
+and <attr2> has rank 1, dimensions [4], max dimensions [4]
+Not comparable: <attr3> has rank 1, dimensions [3], max dimensions [3]
+and <attr3> has rank 2, dimensions [3x1], max dimensions [3x1]
+attribute: <attr4 of </g2/dset1>> and <attr4 of </g2/dset1>>
+3 differences found
+dataset: </g2/dset1> and </g2/dset1>
+6 differences found
+dataset: </g2/dset2> and </g2/dset2>
+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: </dset1> and </dset2>
+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 </soft_link1> is a dangling link.
+obj2 </soft_link1> is a dangling link.
+dangling link: </soft_link1> and </soft_link1>
+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 </soft_link2> 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 </ext_link4> is a dangling link.
+obj2 </ext_link4> is a dangling link.
+dangling link: </ext_link4> and </ext_link4>
+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 </ext_link2> 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 : </group> and </group_copy>
0 differences found
-dataset: </Compound_dset1> and </Compound_dset1>
+dataset: </group/Compound_dset1> and </group_copy/Compound_dset1>
0 differences found
-dataset: </Compound_dset2> and </Compound_dset2>
+dataset: </group/Compound_dset2> and </group_copy/Compound_dset2>
0 differences found
-dataset: </Compound_dset3> and </Compound_dset3>
+dataset: </group/Compound_dset3> and </group_copy/Compound_dset3>
0 differences found
-dataset: </Compound_dset4> and </Compound_dset4>
+dataset: </group/Compound_dset4> and </group_copy/Compound_dset4>
0 differences found
-dataset: </Compound_dset5> and </Compound_dset5>
+dataset: </group/Compound_dset5> and </group_copy/Compound_dset5>
0 differences found
-dataset: </Compound_dset6> and </Compound_dset6>
+dataset: </group/Compound_dset6> and </group_copy/Compound_dset6>
0 differences found
-dataset: </Compound_dset7> and </Compound_dset7>
+dataset: </group/Compound_dset7> and </group_copy/Compound_dset7>
0 differences found
-dataset: </Compound_dset8> and </Compound_dset8>
+dataset: </group/Compound_dset8> and </group_copy/Compound_dset8>
0 differences found
-dataset: </Compound_dset9> and </Compound_dset9>
+dataset: </group/Compound_dset9> and </group_copy/Compound_dset9>
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: <attr1 of </>> and <attr1 of </>>
+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: </dset1> and </dset1>
+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: </dset2> and </dset2>
+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: </dset3> and </dset3>
+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: </dset4> and </dset4>
+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: </dset7a> has sign H5T_SGN_2 and </dset7b> 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: </g1/fp18> and </g1/fp18_COPY>
+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: </g1/fp18> and </g1/fp18_COPY>
+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 </g1> vlen3D of </g1> 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 </g1> vlen3D of </g1> 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 </g1> vlen3D of </g1> 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 </g1> vlen3D of </g1> 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 </g1> vlen3D of </g1> 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: </g1/dset4> and </g1/dset4>
group : </g2> and </g2>
0 differences found
dataset: </g2/dset1> and </g2/dset1>
-Not comparable: </g2/dset1> or </g2/dset1> is an empty dataset
0 differences found
dataset: </g2/dset2> and </g2/dset2>
0 differences found
@@ -47,10 +46,5 @@ dataset: </g2/dset7> and </g2/dset7>
dataset: </g2/dset8> and </g2/dset8>
0 differences found
dataset: </g2/dset9> and </g2/dset9>
-Not comparable: </g2/dset9> or </g2/dset9> 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
--- a/tools/h5diff/testfiles/h5diff_basic1.h5
+++ b/tools/h5diff/testfiles/h5diff_basic1.h5
Binary files 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
--- a/tools/h5diff/testfiles/h5diff_comp_vl_strs.h5
+++ b/tools/h5diff/testfiles/h5diff_comp_vl_strs.h5
Binary files 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
--- /dev/null
+++ b/tools/h5diff/testfiles/h5diff_dset_zero_dim_size1.h5
Binary files 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
--- /dev/null
+++ b/tools/h5diff/testfiles/h5diff_dset_zero_dim_size2.h5
Binary files 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
--- /dev/null
+++ b/tools/h5diff/testfiles/h5diff_enum_invalid_values.h5
Binary files differ
diff --git a/tools/h5diff/testfiles/non_comparables1.h5 b/tools/h5diff/testfiles/non_comparables1.h5
new file mode 100644
index 0000000..71b65c8
--- /dev/null
+++ b/tools/h5diff/testfiles/non_comparables1.h5
Binary files differ
diff --git a/tools/h5diff/testfiles/non_comparables2.h5 b/tools/h5diff/testfiles/non_comparables2.h5
new file mode 100644
index 0000000..188ceb9
--- /dev/null
+++ b/tools/h5diff/testfiles/non_comparables2.h5
Binary files 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 $<TARGET_FILE:h5dumpgentest>)
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 $<TARGET_FILE:h5dump> ${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=$<TARGET_FILE:h5dump>"
+ -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=$<TARGET_FILE:h5dump>"
@@ -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 $<TARGET_FILE:h5dump> -d /Dataset1 -s 0 -R -y -o ${PROJECT_BINARY_DIR}/${resultfile}.txt ${PROJECT_BINARY_DIR}/${targetfile}
+ COMMAND $<TARGET_FILE:h5dump> ${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=$<TARGET_FILE:h5dump>"
@@ -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=$<TARGET_FILE:h5dump>"
@@ -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 <stdlib.h>
#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 */
+#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"
-/** 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 */
-};
-
-/**
- ** 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,2503 +458,115 @@ table_list_free(void)
table_list.nalloc = table_list.nused = 0;
} /* end table_list_free() */
-
/*-------------------------------------------------------------------------
- * Function: print_datatype
- *
- * Purpose: print the datatype.
- *
- * Return: void
- *
- * Programmer: Ruey-Hsia Li
- *
- * Modifications: pvn, March 28, 2006
- * print information about type when a native match is not possible
- *
- *-------------------------------------------------------------------------
- */
-static void
-print_datatype(hid_t type,unsigned in_group)
-{
- 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);
-
- /* 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;
-
- default:
- printf("unknown datatype");
- h5tools_setstatus(EXIT_FAILURE);
- break;
- }
- } /* end else */
-}
-
-
-/*-------------------------------------------------------------------------
- * 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:
- *
- *-------------------------------------------------------------------------
- */
-static void
-dump_datatype(hid_t type)
-{
- indent += COL;
-
- indentation(indent);
- printf("%s %s ", dump_header_format->datatypebegin,
- dump_header_format->datatypeblockbegin);
-
- print_datatype(type,0);
-
- end_obj(dump_header_format->datatypeend,
- dump_header_format->datatypeblockend);
- indent -= COL;
-}
-
-/*-------------------------------------------------------------------------
- * Function: dump_dataspace
- *
- * Purpose: Dump the dataspace. Dataspace can be named dataspace,
- * array, or others.
- *
- * Return: void
- *
- * Programmer: Ruey-Hsia Li
- *
- * Modifications:
- *
- *-------------------------------------------------------------------------
- */
-static void
-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("%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;
-
- case H5S_NULL:
- /* null dataspace */
- HDfprintf(stdout, "%s %s",
- dump_header_format->dataspacedescriptionbegin, S_NULL);
- break;
-
- case H5S_NO_CLASS:
- default:
- printf("%s unknown dataspace %s\n", BEGIN, END);
- break;
- } /* end switch */
-
- end_obj(dump_header_format->dataspaceend,
- dump_header_format->dataspaceblockend);
-}
-
-
-/*-------------------------------------------------------------------------
- * 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
+ * Function: set_data_output_file
*
- *-------------------------------------------------------------------------
- */
-static herr_t
-dump_attr_cb(hid_t oid, const char *attr_name, const H5A_info_t UNUSED *info, void UNUSED *_op_data)
-{
- 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);
-
- H5Tclose(type);
- H5Sclose(space);
- H5Aclose(attr_id);
-
- indentation(indent);
- end_obj(dump_header_format->attributeend,dump_header_format->attributeblockend);
- }
-
- return ret;
-}
-
-/*-------------------------------------------------------------------------
- * Function: dump_selected_attr
- *
- * Purpose: dump the selected attribute
- *
- * Return: Success: SUCCEED
- *
- * Failure: FAIL
- *
- * Programmer: Ruey-Hsia Li
- *
- * Modifications:
- *
- *-------------------------------------------------------------------------
- */
-static herr_t
-dump_selected_attr(hid_t loc_id, const char *name)
-{
- 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;
- }
-
- /* Close object */
- if(H5Oclose(oid) < 0) {
- goto error;
- } /* end if */
-
- 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;
-}
-
-/*-------------------------------------------------------------------------
- * 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
-dump_all_cb(hid_t group, const char *name, const H5L_info_t *linfo, void UNUSED *op_data)
-{
- 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);
-
- 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) {
- 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("</%sDataset>\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;
-}
-
-/*-------------------------------------------------------------------------
- * Function: dump_named_datatype
- *
- * Purpose: Dump named 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:
- * Pedro Vicente, March 27, 2006
- * added display of attributes
- * Pedro Vicente, October 4, 2007, added parameters to H5Aiterate2() to allow for
- * other iteration orders
+ * pvn June, 1, 2006. Add a switch for binary output
*
*-------------------------------------------------------------------------
*/
-static void
-dump_named_datatype(hid_t tid, const char *name)
+static int
+set_data_output_file(const char *fname, int is_bin)
{
- H5O_info_t oinfo;
- unsigned attr_crt_order_flags;
- hid_t tcpl_id; /* datatype creation property list ID */
+ FILE *f; /* temporary holding place for the stream pointer
+ * so that rawdatastream is changed only when succeeded */
-
- 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);
-
- /* 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) {
- printf("%s \"%s\"\n", HARDLINK, found_obj->objname);
- goto done;
- }
+ if (rawdatastream && rawdatastream != stdout) {
+ if (HDfclose(rawdatastream))
+ HDperror("closing rawdatastream");
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( (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 */
-
- indent -= COL;
-
-done:
- end_obj(dump_header_format->datatypeend,
- dump_header_format->datatypeblockend);
-}
-
-/*-------------------------------------------------------------------------
- * 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
- *
- *-------------------------------------------------------------------------
- */
-static void
-dump_group(hid_t gid, const char *name)
-{
- 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);
+ rawdatastream = NULL;
}
- /* 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 */
-
- /* 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);
-
-
- }
-
- indent -= COL;
- indentation(indent);
- end_obj(dump_header_format->groupend, dump_header_format->groupblockend);
- free(tmp);
-}
-
-/*-------------------------------------------------------------------------
- * 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
- *
- *-------------------------------------------------------------------------
- */
-static void
-dump_dataset(hid_t did, const char *name, struct subset_t *sset)
-{
- 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);
- }
-
- 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 */
-
- }
-
- indent -= COL;
-
- H5Tclose(type);
- H5Sclose(space);
- H5Pclose(dcpl_id);
-
-
- indentation(indent);
- end_obj(dump_header_format->datasetend,dump_header_format->datasetblockend);
-}
-
-/*-------------------------------------------------------------------------
- * 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:
- *
- *-------------------------------------------------------------------------
- */
-static void
-dump_dims(hsize_t *s, int dims)
-{
- int i;
-
- for (i = 0; i < dims; i++) {
- printf(HSIZE_T_FORMAT, s[i]);
-
- if (i + 1 != dims)
- printf(", ");
- }
-}
-
-/*-------------------------------------------------------------------------
- * Function: dump_subsetting_header
- *
- * Purpose: Dump the subsetting header like specified in the DDL.
- *
- * Return: void
- *
- * Programmer: Bill Wendling
- * Tuesday, 27. February 2001
- *
- * Modifications:
- *
- *-------------------------------------------------------------------------
- */
-static void
-dump_subsetting_header(struct subset_t *sset, int dims)
-{
- 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);
-}
-
-/*-------------------------------------------------------------------------
- * 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;
+ /* binary output */
+ if (is_bin) {
+ if ((f = HDfopen(fname, "wb")) != NULL) {
+ rawdatastream = f;
+ return 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;
+ if ((f = HDfopen(fname, "w")) != NULL) {
+ rawdatastream = f;
+ return 0;
}
- 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);
+ return -1;
}
-
/*-------------------------------------------------------------------------
- * Function: dump_dcpl
- *
- * Purpose: prints several dataset create property list properties
- *
- * Return: void
+ * Function: set_output_file
*
- * Programmer: pvn
+ * Purpose: Open fname as the output file for raw output.
+ * Set rawoutstream as its file stream.
*
- * Modifications: pvn, March 28, 2008
- * Add a COMPRESSION ratio information for cases when filters are present
+ * Return: 0 -- succeeded
+ * negative -- failed
*
*-------------------------------------------------------------------------
*/
-static void
-dump_dcpl(hid_t dcpl_id,hid_t type_id, hid_t obj_id)
+static int
+set_output_file(const char *fname)
{
- 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; i<rank; i++)
- HDfprintf(stdout, ", %Hu", chsize[i]);
- printf(" %s\n", dump_header_format->dataspacedimend);
- 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);
+ FILE *f; /* temporary holding place for the stream pointer
+ * so that rawoutstream is changed only when succeeded */
- }
- else
- HDfprintf(stdout, "SIZE %Hu\n ", storage_size);
-
-
- H5Sclose(sid);
- H5Tclose(tid);
-
- }
+ if (rawoutstream && rawoutstream != stdout) {
+ if (HDfclose(rawoutstream))
+ HDperror("closing rawoutstream");
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; 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:
- indentation(indent + COL);
- printf("%s %s %s %d %s\n", DEFLATE, BEGIN, DEFLATE_LEVEL, cd_values[0], END);
- break;
- case H5Z_FILTER_SHUFFLE:
- indentation(indent + COL);
- printf("%s\n", SHUFFLE);
- break;
- case H5Z_FILTER_FLETCHER32:
- indentation(indent + COL);
- printf("%s\n", FLETCHER32);
- break;
- case H5Z_FILTER_SZIP:
- {
- szip_options_mask=cd_values[0];;
- szip_pixels_per_block=cd_values[1];
-
- indentation(indent + COL);
- printf("%s %s\n",SZIP, BEGIN);
-
- /*start indent */
- indent += COL;
- indentation(indent + COL);
- printf("PIXELS_PER_BLOCK %d\n", szip_pixels_per_block);
-
- indentation(indent + COL);
- if (szip_options_mask & H5_SZIP_CHIP_OPTION_MASK)
- printf("MODE %s\n", "HARDWARE");
- else if (szip_options_mask & H5_SZIP_ALLOW_K13_OPTION_MASK)
- printf("MODE %s\n", "K13");
-
- indentation(indent + COL);
- if (szip_options_mask & H5_SZIP_EC_OPTION_MASK)
- printf("CODING %s\n", "ENTROPY");
- else if (szip_options_mask & H5_SZIP_NN_OPTION_MASK)
- printf("CODING %s\n", "NEAREST NEIGHBOUR");
-
- indentation(indent + COL);
- if (szip_options_mask & H5_SZIP_LSB_OPTION_MASK)
- printf("BYTE_ORDER %s\n", "LSB");
- else if (szip_options_mask & H5_SZIP_MSB_OPTION_MASK)
- printf("BYTE_ORDER %s\n", "MSB");
-
- indentation(indent + COL);
- if (szip_options_mask & H5_SZIP_RAW_OPTION_MASK)
- printf("HEADER %s\n", "RAW");
-
- /*end indent */
- indent -= COL;
- indentation(indent + COL);
- printf("%s\n",END);
- }
- break;
- case H5Z_FILTER_NBIT:
- indentation(indent + COL);
- printf("%s\n", NBIT);
- break;
- case H5Z_FILTER_SCALEOFFSET:
- indentation(indent + COL);
- printf("%s %s %s %d %s\n", SCALEOFFSET, BEGIN, SCALEOFFSET_MINBIT, cd_values[0], END);
- break;
- default:
- indentation(indent + COL);
- if (H5Zfilter_avail(filtn))
- printf("%s %s\n", "USER_REGISTERED_FILTER", BEGIN);
- else
- printf("%s %s\n", "UNKNOWN_FILTER", BEGIN);
- /*start indent */
- indent += COL;
- indentation(indent + COL);
- printf("FILTER_ID %d\n", filtn);
- if (f_name[0]!='\0') {
- indentation(indent + COL);
- printf("COMMENT %s\n", f_name);
- }
- if (cd_nelmts) {
- indentation(indent + COL);
- printf("%s %s ","PARAMS", BEGIN);
- for (j=0; j<cd_nelmts; j++)
- printf("%d ", cd_values[j]);
- printf("%s\n", END);
- }
- break;
- }/*switch*/
- } /*i*/
- }/*nfilters*/
- else {
- indentation(indent + COL);
- printf("NONE\n");
- }
- indent -= COL;
- indentation(indent + COL);
- printf("%s\n",END);
-
- /*-------------------------------------------------------------------------
- * FILLVALUE
- *-------------------------------------------------------------------------
- */
- indentation(indent + COL);
- printf("%s %s\n", FILLVALUE, BEGIN);
- /*start indent */
- indent += COL;
- indentation(indent + COL);
- printf("FILL_TIME ");
- H5Pget_fill_time(dcpl_id, &ft);
- switch ( ft ) {
- case H5D_FILL_TIME_ALLOC:
- printf("%s", "H5D_FILL_TIME_ALLOC\n");
- break;
- case H5D_FILL_TIME_NEVER:
- printf("%s", "H5D_FILL_TIME_NEVER\n");
- break;
- case H5D_FILL_TIME_IFSET:
- printf("%s", "H5D_FILL_TIME_IFSET\n");
- break;
- default:
- assert(0);
- break;
+ rawoutstream = NULL;
}
- indentation(indent + COL);
- printf("%s ", "VALUE ");
- H5Pfill_value_defined(dcpl_id, &fvstatus);
- if (fvstatus == H5D_FILL_VALUE_UNDEFINED)
- printf("%s\n", "H5D_FILL_VALUE_UNDEFINED");
- else
- dump_fill_value(dcpl_id,type_id,obj_id);
- /* end indent */
- indent -= COL;
- indentation(indent + COL);
- printf("\n");
- indentation(indent + COL);
- printf("%s\n",END);
-
- /*-------------------------------------------------------------------------
- * ALLOCATION_TIME
- *-------------------------------------------------------------------------
- */
- indentation(indent + COL);
- printf("ALLOCATION_TIME %s\n",BEGIN);
- /*start indent */
- indent += COL;
- indentation(indent + COL);
- H5Pget_alloc_time(dcpl_id, &at);
- switch (at) {
- case H5D_ALLOC_TIME_EARLY:
- printf("%s", "H5D_ALLOC_TIME_EARLY\n");
- break;
- case H5D_ALLOC_TIME_INCR:
- printf("%s", "H5D_ALLOC_TIME_INCR\n");
- break;
- case H5D_ALLOC_TIME_LATE:
- printf("%s", "H5D_ALLOC_TIME_LATE\n");
- break;
- default:
- assert(0);
- break;
- }
- /* end indent */
- indent -= COL;
- indentation(indent + COL);
- printf("%s\n",END);
-}
-
-/*-------------------------------------------------------------------------
- * Function: dump_fcpl
- *
- * Purpose: prints file creation property list information
- *
- * Return: void
- *
- * Programmer: pvn
- *
- * Modifications:
- *
- *-------------------------------------------------------------------------
- */
-static void
-dump_fcpl(hid_t fid)
-{
- hid_t fcpl; /* file creation property list ID */
- hid_t fapl; /* file access 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 */
- hid_t fdriver; /* file driver */
- char dname[32]; /* buffer to store driver name */
- 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);
- fapl=h5_fileaccess();
- fdriver=H5Pget_driver(fapl);
- H5Pclose(fapl);
-
- /*-------------------------------------------------------------------------
- * SUPER_BLOCK
- *-------------------------------------------------------------------------
- */
- printf("%s %s\n",SUPER_BLOCK, BEGIN);
- indentation(indent + COL);
- printf("%s %u\n","SUPERBLOCK_VERSION", finfo.super.version);
- indentation(indent + COL);
- printf("%s %u\n","FREELIST_VERSION", finfo.free.version);
- indentation(indent + COL);
- printf("%s %u\n","SYMBOLTABLE_VERSION", 0); /* Retain this for backward compatibility, for now (QAK) */
- indentation(indent + COL);
- printf("%s %u\n","OBJECTHEADER_VERSION", finfo.sohm.version);
- indentation(indent + COL);
- HDfprintf(stdout,"%s %Hd\n","OFFSET_SIZE", (long long)off_size);
- indentation(indent + COL);
- HDfprintf(stdout,"%s %Hd\n","LENGTH_SIZE", (long long)len_size);
- indentation(indent + COL);
- printf("%s %u\n","BTREE_RANK", sym_ik);
- indentation(indent + COL);
- printf("%s %d\n","BTREE_LEAF", sym_lk);
-
- 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(indent + COL);
- printf("%s %s\n","FILE_DRIVER", dname);*/
- indentation(indent + COL);
- printf("%s %u\n","ISTORE_K", istore_ik);
-
- indentation(indent + COL);
- if(fs_strategy == H5F_FILE_SPACE_ALL_PERSIST)
- printf("%s %s\n", "FILE_SPACE_STRATEGY", "H5F_FILE_SPACE_ALL_PERSIST");
- else if(fs_strategy == H5F_FILE_SPACE_ALL)
- printf("%s %s\n", "FILE_SPACE_STRATEGY", "H5F_FILE_SPACE_ALL");
- else if(fs_strategy == H5F_FILE_SPACE_AGGR_VFD)
- printf("%s %s\n", "FILE_SPACE_STRATEGY", "H5F_FILE_SPACE_AGGR_VFD");
- else if(fs_strategy == H5F_FILE_SPACE_VFD)
- printf("%s %s\n", "FILE_SPACE_STRATEGY", "H5F_FILE_SPACE_VFD");
- else
- printf("%s %s\n", "FILE_SPACE_STRATEGY", "Unknown strategy");
- indentation(indent + COL);
- HDfprintf(stdout, "%s %Hu\n","FREE_SPACE_THRESHOLD", fs_threshold);
-
- printf("%s\n",END);
-
- /*-------------------------------------------------------------------------
- * USER_BLOCK
- *-------------------------------------------------------------------------
- */
- printf("USER_BLOCK %s\n",BEGIN);
- indentation(indent + COL);
- HDfprintf(stdout,"%s %Hu\n","USERBLOCK_SIZE", userblock);
- printf("%s\n",END);
-}
-
-/*-------------------------------------------------------------------------
- * Function: dump_fcontents
- *
- * Purpose: prints all objects
- *
- * Return: void
- *
- * Programmer: pvn
- *
- * Modifications:
- *
- *-------------------------------------------------------------------------
- */
-
-static void dump_fcontents(hid_t fid)
-{
- printf("%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)
- printf(" %-10s /#"H5_PRINTF_HADDR_FMT"\n", "datatype", type_table->objs[u].objno);
- }
+ if ((f = HDfopen(fname, "w")) != NULL) {
+ rawoutstream = f;
+ return 0;
}
- /* print objects in the files */
- h5trav_print(fid);
-
- printf(" %s\n",END);
+ return -1;
}
-
/*-------------------------------------------------------------------------
- * Function: set_output_file
+ * Function: set_error_file
*
- * Purpose: Open fname as the output file for dataset raw data.
- * Set rawdatastream as its file stream.
+ * Purpose: Open fname as the error output file for dataset raw error.
+ * Set rawerrorstream 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)
+set_error_file(const char *fname)
{
- 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;
-}
+ FILE *f; /* temporary holding place for the stream pointer
+ * so that rawerrorstream is changed only when succeeded */
+ if (rawerrorstream && rawerrorstream != stderr) {
+ if (HDfclose(rawerrorstream))
+ HDperror("closing rawerrorstream");
+ else
+ rawerrorstream = NULL;
+ }
+ if ((f = HDfopen(fname, "w")) != NULL) {
+ rawerrorstream = f;
+ return 0;
+ }
+
+ return -1;
+}
/*-------------------------------------------------------------------------
* Function: set_binary_form
@@ -3355,21 +586,20 @@ set_output_file(const char *fname, int is_bin)
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;
+ int bform = -1;
+
+ 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 bform;
}
/*-------------------------------------------------------------------------
@@ -3391,18 +621,16 @@ set_binary_form(const char *form)
static H5_index_t
set_sort_by(const char *form)
{
- H5_index_t idx_type = H5_INDEX_UNKNOWN;
+ 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;
+ 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;
- return idx_type;
+ return idx_type;
}
-
-
/*-------------------------------------------------------------------------
* Function: set_sort_order
*
@@ -3422,38 +650,14 @@ set_sort_by(const char *form)
static H5_iter_order_t
set_sort_order(const char *form)
{
- H5_iter_order_t iter_order = H5_ITER_UNKNOWN;
+ 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;
+ 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;
- 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);
+ return iter_order;
}
/*-------------------------------------------------------------------------
@@ -3480,20 +684,23 @@ 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;
+ unsigned int size_count = 0;
+ unsigned int i = 0;
+ unsigned int 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 (HDisdigit(*ptr)) {
if (!last_digit)
/* the last read character wasn't a digit */
size_count++;
last_digit = 1;
- } else {
+ }
+ else {
last_digit = 0;
}
@@ -3502,14 +709,14 @@ parse_hsize_list(const char *h_list, subset_d *d)
return;
/* allocate an array for the integers in the list */
- p_list = (hsize_t *)calloc(size_count, sizeof(hsize_t));
+ p_list = (hsize_t *)HDcalloc(size_count, sizeof(hsize_t));
for (ptr = h_list; i < size_count && ptr && *ptr && *ptr != ';' && *ptr != ']'; ptr++)
- if(isdigit(*ptr)) {
+ if(HDisdigit(*ptr)) {
/* we should have an integer now */
- p_list[i++] = (hsize_t)atof(ptr);
+ p_list[i++] = (hsize_t)HDatof(ptr);
- while (isdigit(*ptr))
+ while (HDisdigit(*ptr))
/* scroll to end of integer */
ptr++;
}
@@ -3541,425 +748,192 @@ parse_subset_params(char *dset)
struct subset_t *s = NULL;
register char *brace;
- if ((brace = strrchr(dset, '[')) != NULL) {
- char *slash = strrchr(dset, '/');
+ if (!disable_compact_subset && ((brace = HDstrrchr(dset, '[')) != NULL)) {
+ *brace++ = '\0';
- /* sanity check to make sure the [ isn't part of the dataset name */
- if (brace > slash) {
- *brace++ = '\0';
+ s = (struct subset_t *)HDcalloc(1, sizeof(struct subset_t));
+ parse_hsize_list(brace, &s->start);
- s = (struct subset_t *)calloc(1, sizeof(struct subset_t));
- parse_hsize_list(brace, &s->start);
+ while (*brace && *brace != ';')
+ brace++;
- while (*brace && *brace != ';')
- brace++;
+ if (*brace) brace++;
- if (*brace)
- brace++;
+ parse_hsize_list(brace, &s->stride);
- parse_hsize_list(brace, &s->stride);
+ while (*brace && *brace != ';')
+ brace++;
- while (*brace && *brace != ';')
- brace++;
+ if (*brace) brace++;
- if (*brace)
- brace++;
+ parse_hsize_list(brace, &s->count);
- parse_hsize_list(brace, &s->count);
+ while (*brace && *brace != ';')
+ brace++;
- while (*brace && *brace != ';')
- brace++;
+ if (*brace) brace++;
- if (*brace)
- brace++;
-
- parse_hsize_list(brace, &s->block);
- }
+ parse_hsize_list(brace, &s->block);
}
return s;
}
/*-------------------------------------------------------------------------
- * Function: handle_datasets
- *
- * Purpose: Handle the datasets from the command.
+ * Function: parse_mask_list
*
- * Return: void
+ * 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.
*
- * Programmer: Bill Wendling
- * Tuesday, 9. January 2001
+ * Return: Success: SUCCEED
*
- * Modifications:
- * Pedro Vicente, Tuesday, January 15, 2008
- * check for block overlap\
+ * Failure: FAIL
*
- * 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)
+static int
+parse_mask_list(const char *h_list)
{
- 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;
+ 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;
}
-
- /*-------------------------------------------------------------------------
- * 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
+ 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;
}
}
- 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);
- }
+ 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;
}
- 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 */
+ return SUCCEED;
}
+
/*-------------------------------------------------------------------------
- * Function: handle_datatypes
+ * Function: free_handler
*
- * Purpose: Handle the datatypes from the command.
+ * 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, 9. January 2001
+ * Tuesday, 20. February 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)
+free_handler(struct handler_t *hand, int len)
{
- 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 */
+ register int i;
+
+ if(hand) {
+ for (i = 0; i < len; i++) {
+ if(hand[i].obj) {
+ HDfree(hand[i].obj);
+ hand[i].obj=NULL;
+ }
- 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);
+ 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;
}
}
- 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);
+ HDfree(hand);
}
}
@@ -3986,17 +960,22 @@ handle_datatypes(hid_t fid, const char *type, void UNUSED * data, int pe, const
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;
+ struct handler_t *hand = NULL;
+ struct handler_t *last_dset = NULL;
+ int i;
+ int opt;
+ int last_was_dset = FALSE;
/* no arguments */
if (argc == 1) {
usage(h5tools_getprogname());
- leave(EXIT_FAILURE);
+ goto error;
}
/* this will be plenty big enough to hold the 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) {
+ goto error;
+ }
/* parse command line options */
while ((opt = get_option(argc, argv, s_opts, l_opts)) != EOF) {
@@ -4042,10 +1021,13 @@ parse_start:
break;
case 'V':
print_version(h5tools_getprogname());
- leave(EXIT_SUCCESS);
+ free_handler(hand, argc);
+ hand = NULL;
+ h5tools_setstatus(EXIT_SUCCESS);
+ goto done;
break;
case 'w':
- nCols = HDatoi(opt_arg);
+ h5tools_nCols = HDatoi(opt_arg);
last_was_dset = FALSE;
break;
case 'a':
@@ -4116,15 +1098,15 @@ parse_start:
case 'o':
if ( bin_output ) {
- if (set_output_file(opt_arg, 1) < 0) {
+ if (set_data_output_file(opt_arg, 1) < 0) {
usage(h5tools_getprogname());
- leave(EXIT_FAILURE);
+ goto error;
}
}
else {
- if (set_output_file(opt_arg, 0) < 0) {
+ if (set_data_output_file(opt_arg, 0) < 0) {
usage(h5tools_getprogname());
- leave(EXIT_FAILURE);
+ goto error;
}
}
@@ -4138,15 +1120,15 @@ parse_start:
if ( ( bin_form = set_binary_form(opt_arg)) < 0) {
/* failed to set binary form */
usage(h5tools_getprogname());
- leave(EXIT_FAILURE);
+ goto error;
}
}
bin_output = TRUE;
if (outfname!=NULL) {
- if (set_output_file(outfname, 1) < 0) {
+ if (set_data_output_file(outfname, 1) < 0) {
/* failed to set output file */
usage(h5tools_getprogname());
- leave(EXIT_FAILURE);
+ goto error;
}
last_was_dset = FALSE;
@@ -4157,7 +1139,7 @@ parse_start:
if ( ( sort_by = set_sort_by(opt_arg)) < 0) {
/* failed to set "sort by" form */
usage(h5tools_getprogname());
- leave(EXIT_FAILURE);
+ goto error;
}
break;
@@ -4165,8 +1147,20 @@ parse_start:
if ( ( sort_order = set_sort_order(opt_arg)) < 0) {
/* failed to set "sort order" form */
usage(h5tools_getprogname());
- leave(EXIT_FAILURE);
+ goto error;
+ }
+ break;
+
+ case 'M':
+ if (!last_was_dset) {
+ error_msg("option `-%c' can only be used after --dataset option\n", opt);
+ goto error;
+ }
+ if (parse_mask_list(opt_arg) != SUCCEED){
+ usage(h5tools_getprogname());
+ goto error;
}
+ display_packed_bits = TRUE;
break;
/** begin XML parameters **/
@@ -4174,42 +1168,45 @@ parse_start:
/* select XML output */
doxml = TRUE;
useschema = TRUE;
- dump_header_format = NULL;
+ h5tools_dump_header_format = NULL;
dump_function_table = &xml_function_table;
+ h5tools_nCols = 0;
break;
case 'u':
doxml = TRUE;
useschema = FALSE;
xmlnsprefix = "";
- dump_header_format = NULL;
+ 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;
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) {
+ if (!useschema) {
usage(h5tools_getprogname());
- leave(EXIT_FAILURE);
- }
- if (strcmp(opt_arg,":") == 0) {
+ goto error;
+ }
+ if (HDstrcmp(opt_arg,":") == 0) {
xmlnsprefix = "";
- } else {
+ }
+ else {
xmlnsprefix = opt_arg;
- }
+ }
+ h5tools_nCols = 0;
break;
/** end XML parameters **/
@@ -4221,9 +1218,8 @@ parse_start:
struct subset_t *s;
if (!last_was_dset) {
- error_msg("option `-%c' can only be used after --dataset option\n",
- opt);
- leave(EXIT_FAILURE);
+ error_msg("option `-%c' can only be used after --dataset option\n", opt);
+ goto error;
}
if (last_dset->subset_info) {
@@ -4232,8 +1228,9 @@ parse_start:
* the two.
*/
s = last_dset->subset_info;
- } else {
- last_dset->subset_info = s = (struct subset_t *)calloc(1, sizeof(struct subset_t));
+ }
+ else {
+ last_dset->subset_info = s = (struct subset_t *)HDcalloc(1, sizeof(struct subset_t));
}
/*
@@ -4249,11 +1246,36 @@ 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;
+ 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);
@@ -4270,13 +1292,19 @@ end_collect:
case 'E':
enable_error_stack = TRUE;
break;
+ case 'C':
+ disable_compact_subset = TRUE;
+ break;
case 'h':
usage(h5tools_getprogname());
- leave(EXIT_SUCCESS);
+ free_handler(hand, argc);
+ hand = NULL;
+ h5tools_setstatus(EXIT_SUCCESS);
+ goto done;
case '?':
default:
usage(h5tools_getprogname());
- leave(EXIT_FAILURE);
+ goto error;
}
}
@@ -4285,48 +1313,21 @@ parse_end:
if (argc <= opt_ind) {
error_msg("missing file name\n");
usage(h5tools_getprogname());
- leave(EXIT_FAILURE);
+ goto error;
}
+done:
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);
- }
+error:
+ if (hand) {
+ free_handler(hand, argc);
+ hand = NULL;
}
+ h5tools_setstatus(EXIT_FAILURE);
- free(hand);
+ return hand;
}
-
+
/*-------------------------------------------------------------------------
* Function: main
*
@@ -4369,19 +1370,23 @@ free_handler(struct handler_t *hand, int len)
int
main(int argc, const char *argv[])
{
- hid_t fid, gid;
- char *fname = NULL;
- void *edata;
+ 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;
+ struct handler_t *hand = NULL;
int i;
unsigned u;
+ void *edata;
+ void *tools_edata;
+ char *fname = NULL;
h5tools_setprogname(PROGRAMNAME);
h5tools_setstatus(EXIT_SUCCESS);
- dump_header_format = &standardformat;
+ h5tools_dump_header_format = &h5tools_standardformat;
dump_function_table = &ddl_function_table;
+ dump_indent = 0;
/* Disable error reporting */
H5Eget_auto2(H5E_DEFAULT, &func, &edata);
@@ -4389,2592 +1394,265 @@ main(int argc, const char *argv[])
/* Initialize h5tools lib */
h5tools_init();
- hand = parse_command_line(argc, argv);
+ /* 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;
+ }
if (bin_output && outfname == NULL) {
error_msg("binary output requires a file name, use -o <filename>\n");
- leave(EXIT_FAILURE);
+ h5tools_setstatus(EXIT_FAILURE);
+ goto done;
}
- if (enable_error_stack)
+ if (enable_error_stack) {
H5Eset_auto2(H5E_DEFAULT, func, edata);
+ H5Eset_auto2(H5tools_ERR_STACK_g, tools_func, tools_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);
+ 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 {
+ }
+ else {
if (xml_dtd_uri) {
- warn_msg("option \"%s\" only applies with XML: %s\n",
- "--xml-dtd", 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;
}
+ while(opt_ind < argc) {
+ fname = HDstrdup(argv[opt_ind++]);
- /* 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("<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n");
-
- /* alternative first element, depending on schema or DTD. */
- if (useschema) {
- if (strcmp(xmlnsprefix,"") == 0) {
- printf("<HDF5-File xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xsi:noNamespaceSchemaLocation=\"%s\">\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("<!DOCTYPE HDF5-File PUBLIC \"HDF5-File.dtd\" \"%s\">\n",
- xml_dtd_uri);
- printf("<HDF5-File>\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);
- }
+ fid = h5tools_fopen(fname, H5F_ACC_RDONLY, H5P_DEFAULT, driver, NULL, 0);
- if(display_all)
- {
- if((gid = H5Gopen2(fid, "/", H5P_DEFAULT)) < 0)
- {
- error_msg("unable to open root group\n");
+ if (fid < 0) {
+ error_msg("unable to open file \"%s\"\n", fname);
h5tools_setstatus(EXIT_FAILURE);
- }
- else
- {
-
- dump_function_table->dump_group_function(gid, "/" );
-
+ goto done;
}
- if(H5Gclose(gid) < 0)
- {
- error_msg("unable to close root group\n");
- h5tools_setstatus(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);
- }
- 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("</%sHDF5-File>\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 <empty>", 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;
+ /* 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 {
- 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 = "&quot;";
-static const char *amp = "&amp;";
-static const char *lt = "&lt;";
-static const char *gt = "&gt;";
-static const char *apos = "&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++;
+ /* 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;
}
- }
- *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 <DataType> 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("<!-- h5dump error: unknown committed type. -->\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;
}
- } else {
-
- switch (H5Tget_class(type)) {
- case H5T_INTEGER:
- indentation(indent);
- printf("<%sAtomicType>\n",xmlnsprefix);
- indent += COL;
- /* <hdf5:IntegerType ByteOrder="bo" Sign="torf" Size="bytes"/> */
- 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("</%sAtomicType>\n",xmlnsprefix);
- break;
-
- case H5T_FLOAT:
- /* <hdf5:FloatType ByteOrder="bo" Size="bytes"
- SignBitLocation="bytes"
- ExponentBits="eb" ExponentLocation="el"
- MantissaBits="mb" MantissaLocation="ml" /> */
- 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("</%sAtomicType>\n",xmlnsprefix);
- break;
-
- case H5T_TIME:
- indentation(indent);
- printf("<%sAtomicType>\n",xmlnsprefix);
- indent += COL;
- indentation(indent);
- printf("<%sTimeType />\n",xmlnsprefix);
- printf("<!-- H5T_TIME: not yet implemented -->");
- indent -= COL;
- indentation(indent);
- printf("</%sAtomicType>\n",xmlnsprefix);
- break;
-
- case H5T_STRING:
- /* <hdf5:StringType Cset="cs" StrSize="chars" StrPad="pad" /> */
- 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("</%sAtomicType>\n",xmlnsprefix);
- break;
-
- case H5T_BITFIELD:
- /* <hdf5:BitfieldType ByteOrder="bo" Size="bytes"/> */
- 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("</%sAtomicType>\n",xmlnsprefix);
- break;
+ group_table = table_list.tables[0].group_table;
+ dset_table = table_list.tables[0].dset_table;
+ type_table = table_list.tables[0].type_table;
- case H5T_OPAQUE:
- /* <hdf5:OpaqueType Tag="tag" Size="bytes" /> */
- 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("</%sAtomicType>\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 */
- /* <hdf5:Field FieldName="name" > */
- /* <hdf5:DataType > */
- 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("</%sDataType>\n",xmlnsprefix);
- indent -= COL;
-
- indentation(indent);
- printf("</%sField>\n",xmlnsprefix);
- }
- indent -= COL;
- indentation(indent);
- printf("</%sCompoundType>\n",xmlnsprefix);
+ /* 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 */
- 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("</%sReferenceType>\n",xmlnsprefix);
- indent -= COL;
- indentation(indent);
- printf("</%sAtomicType>\n",xmlnsprefix);
- break;
-
- case H5T_ENUM:
- /* <hdf5:EnumType Nelems="ne" >
- 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("</%sEnumType>\n",xmlnsprefix);
- indent -= COL;
- indentation(indent);
- printf("</%sAtomicType>\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("</%sDataType>\n",xmlnsprefix);
- indent -= COL;
- indentation(indent);
- printf("</%sVLType>\n",xmlnsprefix);
- H5Tclose(super);
-
- break;
+ /* start to dump - display file header information */
+ if (!doxml) {
+ begin_obj(h5tools_dump_header_format->filebegin, fname, h5tools_dump_header_format->fileblockbegin);
+ }
+ else {
+ HDfprintf(rawoutstream, "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n");
- 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]);
+ /* alternative first element, depending on schema or DTD. */
+ if (useschema) {
+ if (HDstrcmp(xmlnsprefix,"") == 0) {
+ HDfprintf(rawoutstream, "<HDF5-File xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xsi:noNamespaceSchemaLocation=\"%s\">\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);
}
- indent -= COL;
-
- indent += COL;
- indentation(indent);
- printf("<%sDataType>\n",xmlnsprefix);
- indent += COL;
- xml_print_datatype(super,0);
- indent -= COL;
- indentation(indent);
- printf("</%sDataType>\n",xmlnsprefix);
- indent -= COL;
- indentation(indent);
- printf("</%sArrayType>\n",xmlnsprefix);
- /* Close array base type */
- H5Tclose(super);
- break;
-
- default:
- printf("<!-- unknown datatype -->");
- 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);
+ }
+ else {
+ HDfprintf(rawoutstream, "<!DOCTYPE HDF5-File PUBLIC \"HDF5-File.dtd\" \"%s\">\n", xml_dtd_uri);
+ HDfprintf(rawoutstream, "<HDF5-File>\n");
}
- free(dtxid);
- } else {
- printf("<!-- h5dump error: unknown committed type. -->\n");
}
- indent -= COL;
- }
- else {
- printf("<%sDataType>\n", xmlnsprefix);
- indent += COL;
- xml_print_datatype(type, 0);
- indent -= COL;
- indentation(indent);
- printf("</%sDataType>\n", xmlnsprefix);
- indent -= COL;
- }
-}
-
-/*-------------------------------------------------------------------------
- * 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);
- break;
- case H5S_SIMPLE:
- /* simple dataspace */
- /* <hdf5:SimpleDataspace Ndims="nd"> */
- printf("<%sSimpleDataspace Ndims=\"%d\">\n",xmlnsprefix, ndims);
-
- /* print the <hdf5:Dimension> 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]);
- }
+ 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;
}
- indentation(indent + COL + COL);
- printf("</%sSimpleDataspace>\n", xmlnsprefix );
- 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);
- break;
-#endif /* TMP */
-
- case H5S_NO_CLASS:
- default:
- printf("<!-- unknown dataspace -->\n");
- }
- indentation(indent + COL);
- printf("</%sDataspace>\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);
+ if (display_bb)
+ dump_fcpl(fid);
}
- } 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("</%sDataFromFile>\n",xmlnsprefix);
- indentation(indent);
- printf("</%sData>\n", xmlnsprefix);
- indent -= COL;
-}
-
-/*-------------------------------------------------------------------------
- * 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);
- break;
-
- case H5T_TIME:
- indent += COL;
- indentation(indent);
- printf("<%sData>\n",xmlnsprefix);
- indentation(indent);
- printf("<!-- Time data not yet implemented. -->\n");
- indentation(indent);
- printf("<%sNoData/>\n",xmlnsprefix);
- indentation(indent);
- printf("<hdf5:Data>\n");
- printf("</%sData>\n",xmlnsprefix);
- indent -= COL;
- break;
-
- case H5T_COMPOUND:
- indentation(indent);
- printf("<!-- Note: format of compound data not specified -->\n");
- dump_function_table->dump_data_function(attr_id, ATTRIBUTE_DATA, NULL, 0);
- break;
-
- case H5T_REFERENCE:
- indentation(indent);
- printf("<%sData>\n",xmlnsprefix);
- indentation(indent);
- if (!H5Tequal(type, H5T_STD_REF_OBJ)) {
- printf("<!-- Note: Region references not supported -->\n");
- indentation(indent);
- printf("<%sNoData />\n",xmlnsprefix);
- } else {
- printf("<%sDataFromFile>\n",xmlnsprefix);
- xml_print_refs(attr_id, ATTRIBUTE_DATA);
- indentation(indent);
- printf("</%sDataFromFile>\n",xmlnsprefix);
- }
- indentation(indent);
- printf("</%sData>\n",xmlnsprefix);
- break;
-
- case H5T_VLEN:
- printf("<!-- Note: format of VL data not specified -->\n");
- dump_function_table->dump_data_function(attr_id, ATTRIBUTE_DATA, NULL, 0);
- break;
- default:
- indentation(indent);
- printf("<%sData>\n",xmlnsprefix);
- indentation(indent);
- printf("<!-- Unknown datatype: %d -->\n", H5Tget_class(type));
- indentation(indent);
- printf("<%sNoData/>\n",xmlnsprefix);
- indentation(indent);
- printf("</%sData>\n",xmlnsprefix);
- break;
+ if(display_all) {
+ if((gid = H5Gopen2(fid, "/", H5P_DEFAULT)) < 0) {
+ error_msg("unable to open root group\n");
+ h5tools_setstatus(EXIT_FAILURE);
+ }
+ else {
+ if (!doxml)
+ dump_indent += COL;
+ dump_function_table->dump_group_function(gid, "/" );
+ if (!doxml)
+ dump_indent -= COL;
+ HDfprintf(rawoutstream, "\n");
}
- } 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("</%sData>\n",xmlnsprefix);
- }
-
- H5Tclose(type);
- H5Sclose(space);
- H5Aclose(attr_id);
- indentation(indent);
- printf("</%sAttribute>\n", xmlnsprefix );
- return SUCCEED;
-
- } else {
- /* ?? failed */
- indentation(indent + COL);
- printf("<!-- h5dump error: unable to open attribute. -->\n");
- indentation(indent);
- printf("</%sAttribute>\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__);
+ if(H5Gclose(gid) < 0) {
+ error_msg("unable to close root group\n");
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("</%sNamedDataType>\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("</%sDataType>\n",xmlnsprefix);
-
- indent -= COL;
- indentation(indent);
- printf("</%sNamedDataType>\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';
- }
- }
-
- indentation(indent);
- indent += COL;
-
- 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(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);
- }
- 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);
- }
- found_obj->displayed = TRUE;
-
- /* 1. do all the attributes of the group */
-
- 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, dump_all_cb, NULL);
- else
- H5Literate(gid, H5_INDEX_NAME, sort_order, NULL, dump_all_cb, NULL);
-
-
}
- 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);
- /* 1. do all the attributes of the group */
-
- 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");
+ /* 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 */
- } /* 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);
+ for(i = 0; i < argc; i++) {
+ if(hand[i].func) {
+ hand[i].func(fid, hand[i].obj, hand[i].subset_info, 1, NULL);
}
}
+ HDfprintf(rawoutstream, "\n");
}
- /* 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);
- }
-
- indent -= COL;
- indentation(indent);
- if(isRoot)
- printf("</%sRootGroup>\n", xmlnsprefix);
- else
- printf("</%sGroup>\n" , xmlnsprefix);
- free(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, 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;
-
- 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;
- }
- }
- 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 *) 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) {
- 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++;
- }
-
- 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;
-}
-
-/*-------------------------------------------------------------------------
- * 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, 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;
- }
- /* 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;
-
- buf = malloc((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 = malloc((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 *) calloc(tsiz, sizeof(char));
-
- 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;
- }
- indentation(indent + COL);
-
- if (!onestring) {
- printf("NULL\n");
- }
+ if (!doxml) {
+ end_obj(h5tools_dump_header_format->fileend, h5tools_dump_header_format->fileblockend);
+ HDfprintf(rawoutstream, "\n");
+ }
else {
- char *t_onestring = xml_escape_the_string(onestring, (int) str_size);
- if (t_onestring) {
- printf("\"%s\"\n", t_onestring);
- free(t_onestring);
- }
- }
-
- bp += tsiz;
- }
-
- /* 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;
-}
-
-/*-------------------------------------------------------------------------
- * 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\" ");
- }
- 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");
- }
- 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");
- }
- printf("\" ");
-
- if (cd_values[0] & H5_SZIP_RAW_OPTION_MASK) {
- printf("Header=\"Raw\"");
- }
- printf("/>\n");
- } else {
- /* unknown option */
+ HDfprintf(rawoutstream, "</%sHDF5-File>\n", xmlnsprefix);
}
- }
-}
-
-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);
-
- printf("\"%s\"\n", t_path);
- free(t_path);
- }
- indentation(indent);
- printf("</%sDataFromFile>\n",xmlnsprefix);
- } else if (H5Tget_class(type) == H5T_STRING) {
- /* ????? */
- indentation(indent);
- printf("<!-- String fill values not yet implemented. -->\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("</%sDataFromFile>\n",xmlnsprefix);
- break;
- case H5T_FLOAT:
- indentation(indent);
- printf("<%sDataFromFile>\n",xmlnsprefix);
- indentation(indent);
- printf("\"%f\"\n",*(float *)buf);
- indentation(indent);
- printf("</%sDataFromFile>\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);
- }
- printf("\"\n");
- indentation(indent);
- printf("</%sDataFromFile>\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("</%sDataFromFile>\n",xmlnsprefix);
- break;
- case H5T_ARRAY:
- indentation(indent);
- printf("<!-- Array fill values not yet implemented. -->\n");
- indentation(indent);
- printf("<%sNoData />\n",xmlnsprefix);
- break;
- case H5T_TIME:
- indentation(indent);
- printf("<!-- Time fill not yet implemented. -->\n");
- indentation(indent);
- printf("<%sNoData />\n",xmlnsprefix);
- break;
- case H5T_COMPOUND:
- indentation(indent);
- printf("<!-- Compound fill not yet implemented. -->\n");
- indentation(indent);
- printf("<%sNoData />\n",xmlnsprefix);
- break;
- case H5T_VLEN:
- indentation(indent);
- printf("<!-- VL fill not yet implemented. -->\n");
- indentation(indent);
- printf("<%sNoData />\n",xmlnsprefix);
- break;
- default:
- indentation(indent);
- printf("<!-- Unknown fill datatype: %d -->\n", H5Tget_class(type));
- indentation(indent);
- printf("<%sNoData/>\n",xmlnsprefix);
- break;
- }
- }
- free(buf);
- indent -= COL;
- indentation(indent);
- printf("</%sData>\n",xmlnsprefix);
- indent -= COL;
-}
+ /* Free tables for objects */
+ table_list_free();
-/*-------------------------------------------------------------------------
- * 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(fid >=0)
+ if (H5Fclose(fid) < 0)
+ h5tools_setstatus(EXIT_FAILURE);
- indentation(indent);
- printf("<%sRequiredFilter>\n",xmlnsprefix);
- indent += COL;
- check_filters(dcpl);
- indent -= COL;
- indentation(indent);
- printf("</%sRequiredFilter>\n",xmlnsprefix);
-
- indent -= COL;
-
- indentation(indent);
- printf("</%sChunkedLayout>\n",xmlnsprefix);
- indent -= COL;
- indentation(indent);
- printf("</%sStorageLayout>\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("</%sStorageLayout>\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("</%sStorageLayout>\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);
- }
+ if(prefix)
+ HDfree(prefix);
+ if(fname)
+ HDfree(fname);
+ } /* end while */
- indent -= COL;
- indentation(indent);
- printf("</%sFillValue>\n",xmlnsprefix);
+ if(hand)
+ free_handler(hand, argc);
- indent -= COL;
- indentation(indent);
- printf("</%sFillValueInfo>\n",xmlnsprefix);
- indent -= COL;
+ /* To Do: clean up XML table */
- dump_function_table->dump_dataspace_function(space);
- dump_function_table->dump_datatype_function(type);
+ leave(h5tools_getstatus());
- indent += COL;
+done:
+ /* Free tables for objects */
+ table_list_free();
- 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");
+ if(fid >=0)
+ if (H5Fclose(fid) < 0)
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("<!-- Time data not yet implemented. -->\n");
- indentation(indent);
- printf("<%sNoData />\n",xmlnsprefix);
- indentation(indent);
- printf("<%sData>\n",xmlnsprefix);
- indent -= COL;
- break;
-
- case H5T_COMPOUND:
- indentation(indent);
- printf("<!-- Note: format of compound data not specified -->\n");
- dump_function_table->dump_data_function(did, DATASET_DATA, NULL, 0);
- break;
-
- case H5T_REFERENCE:
- indentation(indent);
- printf("<%sData>\n",xmlnsprefix);
- indentation(indent);
- if (!H5Tequal(type, H5T_STD_REF_OBJ)) {
- printf("<!-- Note: Region references not supported -->\n");
- indentation(indent);
- printf("<%sNoData />\n",xmlnsprefix);
- } else {
- printf("<%sDataFromFile>\n",xmlnsprefix);
- xml_print_refs(did, DATASET_DATA);
- indentation(indent);
- printf("</%sDataFromFile>\n",xmlnsprefix);
- }
- indentation(indent);
- printf("</%sData>\n",xmlnsprefix);
- break;
-
- case H5T_VLEN:
- printf("<!-- Note: format of VL data not specified -->\n");
- dump_function_table->dump_data_function(did, DATASET_DATA, NULL, 0);
- break;
- default:
- indentation(indent);
- printf("<%sData>\n",xmlnsprefix);
- indentation(indent);
- printf("<!-- Unknown datatype: %d -->\n", H5Tget_class(type));
- indentation(indent);
- printf("<%sNoData/>\n",xmlnsprefix);
- indentation(indent);
- printf("</%sData>\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("</%sData>\n",xmlnsprefix);
- }
-
- H5Tclose(type);
- H5Sclose(space);
- H5Pclose(dcpl);
- indentation(indent);
- printf("</%sDataset>\n", xmlnsprefix);
-}
-
-/*-------------------------------------------------------------------------
- * 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("</%sDataType>\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);
- }
-
- /* 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));
- }
+
+ 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("</%sEnumElement>\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("</%sEnumValue>\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<H5FD_MEM_NTYPES; H5_INC_ENUM(H5FD_mem_t,mt)) {
memb_fapl[mt] = H5P_DEFAULT;
- memb_map[mt] = mt;
+ memb_map[mt] = mt;
sprintf(sv[mt], "%%s-%c.h5", multi_letters[mt]);
memb_name[mt] = sv[mt];
memb_addr[mt] = MAX(mt-1,0)*(HADDR_MAX/10);
}
- if (H5Pset_fapl_multi(fapl, memb_map, memb_fapl, memb_name,
- memb_addr, FALSE) < 0)
+ if (H5Pset_fapl_multi(fapl, memb_map, memb_fapl, memb_name, memb_addr, FALSE) < 0)
return -1;
- } else if (!HDstrcmp(name, "family")) {
+ }
+ 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)
- return -1;
- } else if (!HDstrcmp(name, "log")) {
+ return -1;
+ }
+ else if (!HDstrcmp(name, "log")) {
long log_flags = H5FD_LOG_LOC_IO;
/* Log file access */
@@ -7073,11 +1754,13 @@ h5_fileaccess(void)
if (H5Pset_fapl_log(fapl, NULL, (unsigned)log_flags, 0) < 0)
return -1;
- } else if (!HDstrcmp(name, "direct")) {
+ }
+ else if (!HDstrcmp(name, "direct")) {
/* Substitute Direct I/O driver with sec2 driver temporarily because
* some output has sec2 driver as the standard. */
if (H5Pset_fapl_sec2(fapl)<0) return -1;
- } else {
+ }
+ else {
/* Unknown driver */
return -1;
}
@@ -7114,7 +1797,7 @@ init_prefix(char **prfx, size_t prfx_len)
*
*-------------------------------------------------------------------------
*/
-static void
+void
add_prefix(char **prfx, size_t *prfx_len, const char *name)
{
size_t new_len = HDstrlen(*prfx) + HDstrlen(name) + 2;
@@ -7129,106 +1812,3 @@ add_prefix(char **prfx, size_t *prfx_len, const char *name)
HDstrcat(HDstrcat(*prfx, "/"), name);
} /* end add_prefix */
-
-/*-------------------------------------------------------------------------
- * 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 */
- indent += 2*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);
- }
-
- indent -= 2*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.h b/tools/h5dump/h5dump.h
index e16705c..7d4f460 100644
--- a/tools/h5dump/h5dump.h
+++ b/tools/h5dump/h5dump.h
@@ -16,145 +16,97 @@
#define H5DUMP_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"
-#define H5DUMP_MAX_RANK H5S_MAX_RANK
+/**
+ ** 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;
-#define ATTRIBUTE_DATA 0
-#define DATASET_DATA 1
-#define ENUM_DATA 2
-#define COL 3
+/* 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;
-/* Strings for output */
-#define ATTRIBUTE "ATTRIBUTE"
-#define BLOCK "BLOCK"
-#define SUPER_BLOCK "SUPER_BLOCK"
-#define COMPRESSION "COMPRESSION"
-#define CONCATENATOR "//"
-#define COMPLEX "COMPLEX"
-#define COUNT "COUNT"
-#define CSET "CSET"
-#define CTYPE "CTYPE"
-#define DATA "DATA"
-#define DATASPACE "DATASPACE"
-#define EXTERNAL "EXTERNAL"
-#define FILENO "FILENO"
-#define HARDLINK "HARDLINK"
-#define NLINK "NLINK"
-#define OBJID "OBJECTID"
-#define OBJNO "OBJNO"
-#define S_SCALAR "SCALAR"
-#define S_SIMPLE "SIMPLE"
-#define S_NULL "NULL"
-#define SOFTLINK "SOFTLINK"
-#define EXTLINK "EXTERNAL_LINK"
-#define UDLINK "USERDEFINED_LINK"
-#define START "START"
-#define STRIDE "STRIDE"
-#define STRSIZE "STRSIZE"
-#define STRPAD "STRPAD"
-#define SUBSET "SUBSET"
-#define FILTERS "FILTERS"
-#define DEFLATE "COMPRESSION DEFLATE"
-#define DEFLATE_LEVEL "LEVEL"
-#define SHUFFLE "PREPROCESSING SHUFFLE"
-#define FLETCHER32 "CHECKSUM FLETCHER32"
-#define SZIP "COMPRESSION SZIP"
-#define NBIT "COMPRESSION NBIT"
-#define SCALEOFFSET "COMPRESSION SCALEOFFSET"
-#define SCALEOFFSET_MINBIT "MIN BITS"
-#define STORAGE_LAYOUT "STORAGE_LAYOUT"
-#define CONTIGUOUS "CONTIGUOUS"
-#define COMPACT "COMPACT"
-#define CHUNKED "CHUNKED"
-#define EXTERNAL_FILE "EXTERNAL_FILE"
-#define FILLVALUE "FILLVALUE"
-#define FILE_CONTENTS "FILE_CONTENTS"
+h5dump_table_list_t table_list = {0, 0, NULL};
+table_t *group_table = NULL, *dset_table = NULL, *type_table = NULL;
+int dump_indent = 0; /*how far in to indent the line */
-#define BEGIN "{"
-#define END "}"
+int unamedtype = 0; /* shared datatype with no name */
+hbool_t hit_elink = FALSE; /* whether we have traversed an external link */
+size_t prefix_len = 1024;
+char *prefix = NULL;
+const char *fp_format = NULL;
-typedef struct h5dump_header_t {
- const char *name;
- const char *filebegin;
- const char *fileend;
- const char *bootblockbegin;
- const char *bootblockend;
- const char *groupbegin;
- const char *groupend;
- const char *datasetbegin;
- const char *datasetend;
- const char *attributebegin;
- const char *attributeend;
- const char *datatypebegin;
- const char *datatypeend;
- const char *dataspacebegin;
- const char *dataspaceend;
- const char *databegin;
- const char *dataend;
- const char *softlinkbegin;
- const char *softlinkend;
- const char *extlinkbegin;
- const char *extlinkend;
- const char *udlinkbegin;
- const char *udlinkend;
- const char *subsettingbegin;
- const char *subsettingend;
- const char *startbegin;
- const char *startend;
- const char *stridebegin;
- const char *strideend;
- const char *countbegin;
- const char *countend;
- const char *blockbegin;
- const char *blockend;
+/* things to display or which are set via command line parameters */
+int display_all = TRUE;
+int display_oid = FALSE;
+int display_data = TRUE;
+int display_attr_data = TRUE;
+int display_char = FALSE; /*print 1-byte numbers as ASCII */
+int usingdasho = FALSE;
+int display_bb = FALSE; /*superblock */
+int display_dcpl = FALSE; /*dcpl */
+int display_fi = FALSE; /*file index */
+int display_ai = TRUE; /*array index */
+int display_escape = FALSE; /*escape non printable characters */
+int display_region = FALSE; /*print region reference data */
+int enable_error_stack= FALSE; /* re-enable error stack */
+int disable_compact_subset= FALSE; /* disable compact form of subset notation */
+int display_packed_bits = FALSE; /*print 1-8 byte numbers as packed bits*/
- const char *fileblockbegin;
- const char *fileblockend;
- const char *bootblockblockbegin;
- const char *bootblockblockend;
- const char *groupblockbegin;
- const char *groupblockend;
- const char *datasetblockbegin;
- const char *datasetblockend;
- const char *attributeblockbegin;
- const char *attributeblockend;
- const char *datatypeblockbegin;
- const char *datatypeblockend;
- const char *dataspaceblockbegin;
- const char *dataspaceblockend;
- const char *datablockbegin;
- const char *datablockend;
- const char *softlinkblockbegin;
- const char *softlinkblockend;
- const char *extlinkblockbegin;
- const char *extlinkblockend;
- const char *udlinkblockbegin;
- const char *udlinkblockend;
- const char *strblockbegin;
- const char *strblockend;
- const char *enumblockbegin;
- const char *enumblockend;
- const char *structblockbegin;
- const char *structblockend;
- const char *vlenblockbegin;
- const char *vlenblockend;
- const char *subsettingblockbegin;
- const char *subsettingblockend;
- const char *startblockbegin;
- const char *startblockend;
- const char *strideblockbegin;
- const char *strideblockend;
- const char *countblockbegin;
- const char *countblockend;
- const char *blockblockbegin;
- const char *blockblockend;
+/* sort parameters */
+H5_index_t sort_by = H5_INDEX_NAME; /*sort_by [creation_order | name] */
+H5_iter_order_t sort_order = H5_ITER_INC; /*sort_order [ascending | descending] */
- const char *dataspacedescriptionbegin;
- const char *dataspacedescriptionend;
- const char *dataspacedimbegin;
- const char *dataspacedimend;
+#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 */
+unsigned long long packed_mask[PACKED_BITS_MAX]; /* packed bits are restricted to 8*sizeof(llong) bytes */
-} h5dump_header_t;
+/* packed bits display parameters */
+int packed_offset[PACKED_BITS_MAX];
+int packed_length[PACKED_BITS_MAX];
+/*
+ * The global table is set to either ddl_function_table or
+ * xml_function_table in the initialization.
+ */
+const dump_functions *dump_function_table;
+
+#ifdef __cplusplus
+"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_H__ */
diff --git a/tools/h5dump/h5dump_ddl.c b/tools/h5dump/h5dump_ddl.c
new file mode 100644
index 0000000..b8deaf9
--- /dev/null
+++ b/tools/h5dump/h5dump_ddl.c
@@ -0,0 +1,1932 @@
+/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
+ * 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 <stdio.h>
+#include <stdlib.h>
+
+#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; i<data_loop; i++) {
+ if(display_packed_bits) {
+ ctx.need_prefix = TRUE;
+ h5tools_simple_prefix(rawoutstream, outputformat, &ctx, 0, 0);
+ /* Render the element */
+ h5tools_str_reset(&buffer);
+ packed_data_mask = packed_mask[i];
+ packed_data_offset = packed_offset[i];
+ packed_data_length = packed_length[i];
+ h5tools_print_packed_bits(&buffer, type);
+ h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_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;i<data_loop;i++) */
+ }
+ H5Tclose(type);
+
+ 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 */
+ }
+ 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);
+ 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);
+
+ 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 <stdio.h>
+#include <stdlib.h>
+
+#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, "</%sDataset>", 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 = "&quot;";
+static const char *amp = "&amp;";
+static const char *lt = "&lt;";
+static const char *gt = "&gt;";
+static const char *apos = "&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 <DataType> 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, "<!-- h5dump error: unknown committed type. -->");
+ 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++;
+
+ /* <hdf5:IntegerType ByteOrder="bo" Sign="torf" Size="bytes"/> */
+ 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, "</%sAtomicType>",xmlnsprefix);
+ h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0);
+ break;
+
+ case H5T_FLOAT:
+ /* <hdf5:FloatType ByteOrder="bo" Size="bytes"
+ SignBitLocation="bytes"
+ ExponentBits="eb" ExponentLocation="el"
+ MantissaBits="mb" MantissaLocation="ml" /> */
+ 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, "</%sAtomicType>",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, "<!-- H5T_TIME: not yet implemented -->");
+ 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, "</%sAtomicType>",xmlnsprefix);
+ h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0);
+ break;
+
+ case H5T_STRING:
+ /* <hdf5:StringType Cset="cs" StrSize="chars" StrPad="pad" /> */
+ 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, "</%sAtomicType>",xmlnsprefix);
+ h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0);
+ break;
+
+ case H5T_BITFIELD:
+ /* <hdf5:BitfieldType ByteOrder="bo" Size="bytes"/> */
+ 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, "</%sAtomicType>",xmlnsprefix);
+ h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0);
+ break;
+
+ case H5T_OPAQUE:
+ /* <hdf5:OpaqueType Tag="tag" Size="bytes" /> */
+
+ 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, "</%sAtomicType>",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 */
+ /* <hdf5:Field FieldName="name" > */
+ /* <hdf5:DataType > */
+ 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, "</%sDataType>",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, "</%sField>",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, "</%sCompoundType>",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, "</%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, "</%sAtomicType>",xmlnsprefix);
+ h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0);
+ break;
+
+ case H5T_ENUM:
+ /* <hdf5:EnumType Nelems="ne" > 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, "</%sEnumType>",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, "</%sAtomicType>",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, "</%sDataType>",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, "</%sVLType>",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, "</%sDataType>",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, "</%sArrayType>",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, "<!-- unknown datatype -->");
+ 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, "<!-- h5dump error: unknown committed type. -->");
+ 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, "</%sDataType>", 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 */
+ /* <hdf5:SimpleDataspace Ndims="nd"> */
+
+ 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 <hdf5:Dimension> 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, "</%sSimpleDataspace>", 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, "<!-- unknown dataspace -->");
+ 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, "</%sDataspace>", 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, "</%sDataFromFile>",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, "</%sData>", 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, "<!-- Time data not yet implemented. -->");
+ 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, "<hdf5:Data>");
+ 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--;
+ 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, "<!-- Note: format of compound data not specified -->");
+ 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, "<!-- Note: Region references not supported -->");
+ 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, "</%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, "</%sData>", 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, "<!-- Note: format of VL data not specified -->");
+ 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, "<!-- Unknown datatype: %d -->", 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, "</%sData>", 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, "</%sData>", 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, "</%sAttribute>", 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, "<!-- h5dump error: unable to open attribute. -->");
+ 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, "</%sAttribute>", 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, "</%sNamedDataType>", 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, "</%sDataType>",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, "</%sNamedDataType>",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, "</%sRootGroup>", xmlnsprefix);
+ else
+ h5tools_str_append(&buffer, "</%sGroup>", 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, "</%sDataFromFile>", 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, "<!-- String fill values not yet implemented. -->");
+ 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, "</%sDataFromFile>", 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, "</%sDataFromFile>", 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, "</%sDataFromFile>", 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, "</%sDataFromFile>", 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, "<!-- Array fill values not yet implemented. -->");
+ 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, "<!-- Time fill not yet implemented. -->");
+ 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, "<!-- Compound fill not yet implemented. -->");
+ 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, "<!-- VL fill not yet implemented. -->");
+ 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, "<!-- Unknown fill datatype: %d -->", 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, "</%sData>", 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, "</%sRequiredFilter>", 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);
+ 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, "</%sStorageLayout>", 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, "</%sStorageLayout>", 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, "</%sStorageLayout>", 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, "</%sFillValue>", 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, "</%sFillValueInfo>", 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, "<!-- Time data not yet implemented. -->");
+ 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, "<!-- Note: format of compound data not specified -->");
+ 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, "<!-- Note: Region references not supported -->");
+ 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, "</%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, "</%sData>", 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, "<!-- Note: format of VL data not specified -->");
+ 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, "<!-- Unknown datatype: %d -->", 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, "</%sData>", 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, "</%sData>", 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, "</%sDataset>", 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, "</%sDataType>",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, "</%sEnumElement>",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, "</%sEnumValue>",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<SPACE1_DIM1; i++) {
wdata[i].i=i*10;
wdata[i].f=(float)((i*20)/3.0);
- wdata[i].v.p=malloc((i+1)*sizeof(unsigned int));
+ wdata[i].v.p=HDmalloc((i+1)*sizeof(unsigned int));
wdata[i].v.len=i+1;
for(j=0; j<(i+1); j++)
((unsigned int *)wdata[i].v.p)[j]=i*10+j;
@@ -2666,34 +2672,34 @@ static void gent_vldatatypes3(void)
/* Insert fields */
ret = H5Tinsert(tid2, "i", HOFFSET(s1, i), H5T_NATIVE_INT);
- assert(ret >= 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<SPACE1_DIM1; i++) {
- wdata[i].p=malloc((i+1)*sizeof(s1));
+ wdata[i].p=HDmalloc((i+1)*sizeof(s1));
wdata[i].len=i+1;
for(j=0; j<(i+1); j++) {
((s1 *)wdata[i].p)[j].i=i*10+j;
@@ -2732,9 +2738,9 @@ static void gent_vldatatypes4(void)
/* Insert fields */
ret = H5Tinsert(tid2, "i", HOFFSET(s1, i), H5T_NATIVE_INT);
- assert(ret >= 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; j<i+5; j++)
((unsigned *)wdata[i].p)[j]=j*2;
} /* end else */
@@ -2791,37 +2797,37 @@ static void gent_vldatatypes5(void)
/* Create file */
fid1 = H5Fcreate(FILE43, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT);
- assert(fid1>0);
+ 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<SPACE1_DIM1; i++)
for(j=0; j<ARRAY1_DIM1; j++) {
- wdata[i][j].p=malloc((i+j+1)*sizeof(unsigned int));
+ wdata[i][j].p=HDmalloc((i+j+1)*sizeof(unsigned int));
wdata[i][j].len=i+j+1;
for(k=0; k<(i+j+1); k++)
((unsigned int *)wdata[i][j].p)[k]=i*100+j*10+k;
@@ -3244,28 +3250,28 @@ static void gent_array6(void)
/* 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);
}
static void gent_array7(void)
@@ -3285,7 +3291,7 @@ static void gent_array7(void)
/* Initialize array data to write */
for(i=0; i<SPACE1_DIM1; i++)
for(j=0; j<ARRAY1_DIM1; j++) {
- wdata[i][j].p=malloc((i+j+1)*(sizeof(unsigned int)*ARRAY1_DIM1));
+ wdata[i][j].p=HDmalloc((i+j+1)*(sizeof(unsigned int)*ARRAY1_DIM1));
wdata[i][j].len=i+j+1;
for(k=0; k<(i+j+1); k++)
for(l=0; l<ARRAY1_DIM1; l++)
@@ -3306,35 +3312,35 @@ static void gent_array7(void)
/* Close nested array 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 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<nelmts; i++, c++)
{
@@ -6256,7 +6296,7 @@ gent_bigdims(void)
goto out;
- free(buf);
+ HDfree(buf);
buf=NULL;
/* close */
@@ -6277,7 +6317,7 @@ gent_bigdims(void)
did = -1;
ret = H5Fclose(fid);
- assert(ret >= 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 $<TARGET_FILE:h5import> ${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 $<TARGET_FILE:h5import> ${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=$<TARGET_FILE:h5dump>"
-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=$<TARGET_FILE:h5dump>"
-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 $<TARGET_FILE:h5importtest>)
- 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 <string.h>
#include <ctype.h>
#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; j<in->rank;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; j<in->rank;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; j<in->rank;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; j<in->rank;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; j<in->rank;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; j<in->rank;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);
+ /* 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);
- }
-
- 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<NUM_KEYS; i++)
- if (!HDstrcmp(keytable[i], key)) return i;
- return -1;
+ for (i = 0; i < NUM_KEYS; i++)
+ if (!HDstrcmp(keytable[i], key))
+ return i;
+ return -1;
}
-static int
-parsePathInfo(struct path_info *path, char *temp)
+static int parsePathInfo(struct path_info *path, char *temp)
{
- 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) 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;
-
- 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";
+ int ival;
+ int i = 0;
- if ((in->sizeOfChunk =
- (hsize_t *) HDmalloc ((size_t) in->rank * sizeof(hsize_t))) == NULL)
- {
- (void) fprintf(stderr, "%s", err1);
- return (-1);
- }
+ 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";
- 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; i<in->rank; 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; i<in->rank; 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);
- }
- }
- return (0);
+ }
+
+ 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);
+ }
+
+ 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);
+ }
- in->outputArchitecture = kindex;
- return (0);
+ if ((kindex = OutputArchStrToInt(temp)) == -1) {
+ (void) HDfprintf(stderr, "%s", err2);
+ return (-1);
+ }
+
+ 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);
+ }
+
+ if ((kindex = OutputByteOrderStrToInt(temp)) == -1) {
+ (void) HDfprintf(stderr, "%s", err2);
+ return (-1);
+ }
- in->outputByteOrder = kindex;
- return (0);
+ 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; i<NUM_KEYS; i++)
- in->configOptionVector[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; j<in->rank;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 <infile> -c[onfig] <configfile> [<infile> -c[config] <configfile>...]", name);
- (void) fprintf(stdout, "\t\t\t\t -o[utfile] <outfile>\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 <infile> -c[onfig] <configfile> \
+ (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 <infile> -c[onfig] <configfile> [<infile> -c[config] <configfile>...]", name);
+ (void) HDfprintf(stdout, "\t\t\t\t -o[utfile] <outfile>\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 <infile> -c[onfig] <configfile> \
[<infile> -c[config] <confile2>...] -o[utfile] <outfile>\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 <infile(s)>:\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] <configfile>:\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 <configfile> is the name of the configuration file.\n");
- (void) fprintf(stdout, "\t (See Section \"CONFIGURATION FILE\")\n\n");
- (void) fprintf(stdout, "\t -o[utfile] <outfile>:\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 <outfile>. 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 <external-filename>: 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 <infile(s)>:\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] <configfile>:\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 <configfile> is the name of the configuration file.\n");
+ (void) HDfprintf(stdout, "\t (See Section \"CONFIGURATION FILE\")\n\n");
+ (void) HDfprintf(stdout, "\t -o[utfile] <outfile>:\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 <outfile>. 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 <external-filename>: 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 <infile> -c[onfig] <configfile> \
+ (void) HDfprintf(stdout, "\nUsage:\t%s -h[elp], OR\n", name);
+ (void) HDfprintf(stdout,
+ "\t%s <infile> -c[onfig] <configfile> \
[<infile> -c[config] <configfile>...] -o[utfile] <outfile> \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 <stdio.h>
#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/test15.h5 b/tools/h5import/testfiles/textpfe.h5
index 213051d..213051d 100644
--- a/tools/h5import/testfiles/test15.h5
+++ b/tools/h5import/testfiles/textpfe.h5
Binary files differ
diff --git a/tools/h5import/testfiles/in64.txt b/tools/h5import/testfiles/textpfe64.txt
index f6dd7f4..f6dd7f4 100644
--- a/tools/h5import/testfiles/in64.txt
+++ b/tools/h5import/testfiles/textpfe64.txt
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 $<TARGET_FILE:h5jamgentest>)
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 $<TARGET_FILE:h5jam> ${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=$<TARGET_FILE:h5jam>"
+ -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 $<TARGET_FILE:h5unjam> ${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=$<TARGET_FILE:h5unjam>"
+ -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=$<TARGET_FILE:h5dump>"
-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=$<TARGET_FILE:h5dump>"
-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 <in_file.h5> -u <in_user_file> [-o <out_file.h5>] [--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 <user_file>.\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 <user_file> 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 <HDF5 file>.\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 <in_file.h5> [-o <out_file.h5> ] [-u <out_user_file> | --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 <in_file.h5> -u <in_user_file> [-o <out_file.h5>] [--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 <user_file> cannot be HDF5 file, but it appears to be an HDF5 file.
+Try '-h' or '--help' for more information or see the <h5jam> 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 <in_file.h5> [-o <out_file.h5> ] [-u <out_user_file> | --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 $<TARGET_FILE:h5ls> ${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=$<TARGET_FILE:h5ls>"
-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+msize<H5Tget_precision(type)) {
@@ -710,14 +802,14 @@ display_float_type(hid_t type, int ind)
;
break;
}
- printf("\n%*s(internal padding bits are %s)", ind, "", pad_s);
+ h5tools_str_append(buffer, "\n%*s(internal padding bits are %s)", ind, "", pad_s);
}
return TRUE;
}
/*-------------------------------------------------------------------------
- * Function: display_cmpd_type
+ * Function: print_cmpd_type
*
* Purpose: Print info about a compound data type.
*
@@ -733,7 +825,7 @@ display_float_type(hid_t type, int ind)
*-------------------------------------------------------------------------
*/
static hbool_t
-display_cmpd_type(hid_t type, int ind)
+print_cmpd_type(h5tools_str_t *buffer, hid_t type, int ind)
{
char *name=NULL; /* member name */
size_t size; /* total size of type in bytes */
@@ -743,32 +835,32 @@ display_cmpd_type(hid_t type, int ind)
unsigned i; /* miscellaneous counters */
if (H5T_COMPOUND!=H5Tget_class(type)) return FALSE;
- printf("struct {");
+ h5tools_str_append(buffer, "struct {");
nmembs=H5Tget_nmembers(type);
for (i=0; i<nmembs; i++) {
/* Name and offset */
name = H5Tget_member_name(type, i);
- printf("\n%*s\"", ind+4, "");
- n = display_string(stdout, name, FALSE);
- printf("\"%*s +%-4lu ", MAX(0, 16-n), "",
+ h5tools_str_append(buffer, "\n%*s\"", ind+4, "");
+ n = print_string(buffer, name, FALSE);
+ h5tools_str_append(buffer, "\"%*s +%-4lu ", MAX(0, 16-n), "",
(unsigned long)H5Tget_member_offset(type, i));
- free(name);
+ HDfree(name);
/* Member's type */
subtype = H5Tget_member_type(type, i);
- display_type(subtype, ind+4);
+ print_type(buffer, subtype, ind+4);
H5Tclose(subtype);
}
size = H5Tget_size(type);
- printf("\n%*s} %lu byte%s",
- ind, "", (unsigned long)size, 1==size?"":"s");
+ h5tools_str_append(buffer, "\n%*s} %lu byte%s",
+ ind, "", (unsigned long)size, 1==size?"":"s");
return TRUE;
}
/*-------------------------------------------------------------------------
- * Function: display_enum_type
+ * Function: print_enum_type
*
* Purpose: Print info about an enumeration data type.
*
@@ -784,7 +876,7 @@ display_cmpd_type(hid_t type, int ind)
*-------------------------------------------------------------------------
*/
static hbool_t
-display_enum_type(hid_t type, int ind)
+print_enum_type(h5tools_str_t *buffer, hid_t type, int ind)
{
char **name=NULL; /* member names */
unsigned char *value=NULL; /* value array */
@@ -799,11 +891,11 @@ display_enum_type(hid_t type, int ind)
if (H5T_ENUM!=H5Tget_class(type)) return FALSE;
nmembs = H5Tget_nmembers(type);
- assert(nmembs>0);
+ 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<nmembs; i++) {
name[i] = H5Tget_member_name(type, i);
H5Tget_member_value(type, i, value+i*H5Tget_size(type));
@@ -837,43 +929,44 @@ display_enum_type(hid_t type, int ind)
/* Print members */
for (i=0; i<nmembs; i++) {
- printf("\n%*s", ind+4, "");
- nchars = display_string(stdout, name[i], TRUE);
- printf("%*s = ", MAX(0, 16-nchars), "");
+ h5tools_str_append(buffer, "\n%*s", ind+4, "");
+ nchars = print_string(buffer, name[i], TRUE);
+ h5tools_str_append(buffer, "%*s = ", MAX(0, 16-nchars), "");
if (native<0) {
- printf("0x");
+ h5tools_str_append(buffer, "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)));
+ 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)));
}
}
/* Release resources */
- for (i=0; i<nmembs; i++) free(name[i]);
- free(name);
- free(value);
+ for (i=0; i<nmembs; i++) HDfree(name[i]);
+ HDfree(name);
+ HDfree(value);
H5Tclose(super);
- if (0==nmembs) printf("\n%*s <empty>", ind+4, "");
- printf("\n%*s}", ind, "");
+ if (0==nmembs) h5tools_str_append(buffer, "\n%*s <empty>", 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<ndims; i++)
- HDfprintf(stdout, "%s%Hu" , i?",":"[", dims[i]);
- putchar(']');
+ h5tools_str_append(buffer, "%s" HSIZE_T_FORMAT , i?",":"[", dims[i]);
+ h5tools_str_append(buffer, "]");
- free(dims);
- } else {
- fputs(" [SCALAR]", stdout);
+ HDfree(dims);
+ }
+ else {
+ h5tools_str_append(buffer, " [SCALAR]\n", rawoutstream);
}
/* Print parent type */
- putchar(' ');
+ h5tools_str_append(buffer, " ");
super = H5Tget_super(type);
- display_type(super, ind+4);
+ print_type(buffer, super, ind+4);
H5Tclose(super);
return TRUE;
}
/*-------------------------------------------------------------------------
- * Function: display_bitfield_type
+ * Function: print_bitfield_type
*
* Purpose: Print information about a bitfield type.
*
@@ -1139,7 +1236,7 @@ display_array_type(hid_t type, int ind)
*-------------------------------------------------------------------------
*/
static hbool_t
-display_bitfield_type(hid_t type, int ind)
+print_bitfield_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 */
@@ -1160,15 +1257,15 @@ display_bitfield_type(hid_t type, int ind)
order_s = "";
}
- printf("%lu-bit%s bitfield",
+ h5tools_str_append(buffer, "%lu-bit%s bitfield",
(unsigned long)(8*H5Tget_size(type)), order_s);
- display_precision(type, ind);
+ print_precision(buffer, type, ind);
return TRUE;
}
-
+
/*-------------------------------------------------------------------------
- * Function: display_type
+ * Function: print_type
*
* Purpose: Prints a data type definition. The definition is printed
* without any leading space or trailing line-feed (although
@@ -1188,13 +1285,13 @@ display_bitfield_type(hid_t type, int ind)
*-------------------------------------------------------------------------
*/
static void
-display_type(hid_t type, int ind)
+print_type(h5tools_str_t *buffer, hid_t type, int ind)
{
H5T_class_t data_class = H5Tget_class(type);
/* Bad data type */
if (type<0) {
- printf("<ERROR>");
+ h5tools_str_append(buffer,"<ERROR>");
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; i<ndims; i++) {
- HDfprintf(stdout, "%s%Hu", i?", ":"", size[i]);
+ h5tools_str_append(&buffer, "%s" HSIZE_T_FORMAT, i?", ":"", size[i]);
nelmts *= size[i];
}
- puts("}");
+ h5tools_str_append(&buffer, "}\n");
+ h5tools_render_element(rawoutstream, info, &ctx, &buffer, &curr_pos, info->line_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; i<ndims; i++) {
- HDfprintf (stdout, "%s%Hu", i?", ":"", cur_size[i]);
+ h5tools_str_append(&buffer, "%s"HSIZE_T_FORMAT, i?", ":"", cur_size[i]);
if (max_size[i]==H5S_UNLIMITED) {
- HDfprintf (stdout, "/%s", "Inf");
- } else if (max_size[i]!=cur_size[i] || verbose_g>0) {
- 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; i<ndims; i++) {
- printf("%s%lu", i?", ":"", (unsigned long)(chsize[i]));
+ h5tools_str_append(&buffer, "%s"HSIZE_T_FORMAT, i?", ":"", chsize[i]);
total *= chsize[i];
}
- printf("} %lu bytes\n", (unsigned long)total);
+ h5tools_str_append(&buffer, "} "HSIZE_T_FORMAT" bytes\n", total);
}
/* Print total raw storage size */
total = H5Sget_simple_extent_npoints(space) * H5Tget_size(type);
used = H5Dget_storage_size(dset);
tclass = H5Tget_class(type);
- printf(" %-10s ", "Storage:");
+ h5tools_str_append(&buffer, " %-10s ", "Storage:");
switch (tclass)
{
case H5T_VLEN:
- printf("information not available");
+ h5tools_str_append(&buffer, "information not available");
break;
case H5T_REFERENCE:
if ( H5Tequal(type, H5T_STD_REF_DSETREG))
{
- printf("information not available");
+ h5tools_str_append(&buffer, "information not available");
}
break;
default:
- printf("%lu logical byte%s, %lu allocated byte%s",
- (unsigned long)total, 1==total?"":"s",
- (unsigned long)used, 1==used?"":"s");
+ h5tools_str_append(&buffer, HSIZE_T_FORMAT" logical byte%s, "HSIZE_T_FORMAT" allocated byte%s",
+ total, 1==total?"":"s",
+ used, 1==used?"":"s");
if (used>0)
{
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; i<max_len; i++) putchar('-');
- putchar('\n');
+ for (i=0; i<max_len; i++) h5tools_str_append(&buffer, "-");
+ h5tools_str_append(&buffer, "\n");
for (i=0, total=0; i<nf; i++) {
if (H5Pget_external(dcpl, (unsigned)i, sizeof(f_name), f_name, &f_offset, &f_size)<0) {
- HDfprintf(stdout,
- " #%03d %10Hu %10s %10s ***ERROR*** %s\n",
+ h5tools_str_append(&buffer,
+ " #%03d %10"HSIZE_T_FORMAT"u %10s %10s ***ERROR*** %s\n",
i, total, "", "",
i+1<nf?"Following addresses are incorrect":"");
- } else if (H5S_UNLIMITED==f_size) {
- HDfprintf(stdout, " #%03d %10Hu %10Hu %10s ",
+ }
+ else if (H5S_UNLIMITED==f_size) {
+ h5tools_str_append(&buffer, " #%03d %10"HSIZE_T_FORMAT"u %10"HSIZE_T_FORMAT"u %10s ",
i, total, (hsize_t)f_offset, "INF");
- display_string(stdout, f_name, TRUE);
- } else {
- HDfprintf(stdout, " #%03d %10Hu %10Hu %10Hu ",
+ print_string(&buffer, f_name, TRUE);
+ }
+ else {
+ h5tools_str_append(&buffer, " #%03d %10"HSIZE_T_FORMAT"u %10"HSIZE_T_FORMAT"u %10"HSIZE_T_FORMAT"u ",
i, total, (hsize_t)f_offset, f_size);
- display_string(stdout, f_name, TRUE);
+ print_string(&buffer, f_name, TRUE);
}
- putchar('\n');
+ h5tools_str_append(&buffer, "\n");
total += f_size;
}
- printf(" %4s %10s %10s %10s ",
+ h5tools_str_append(&buffer, " %4s %10s %10s %10s ",
"----", "----------", "----------", "----------");
for (i=0; i<max_len; i++)
- putchar('-');
- putchar('\n');
+ h5tools_str_append(&buffer, "-");
+ h5tools_str_append(&buffer, "\n");
} /* end if */
/* Print information about raw data filters */
@@ -1682,20 +1862,21 @@ dataset_list2(hid_t dset, const char UNUSED *name)
cd_values, sizeof(f_name), f_name, NULL);
f_name[sizeof(f_name) - 1] = '\0';
sprintf(s, "Filter-%d:", i);
- printf(" %-10s %s-%u %s {", s,
+ h5tools_str_append(&buffer, " %-10s %s-%u %s {", s,
(f_name[0] ? f_name : "method"),
(unsigned)filt_id,
((filt_flags & H5Z_FLAG_OPTIONAL) ? "OPT" : ""));
for(cd_num = 0; cd_num < cd_nelmts; cd_num++)
- printf("%s%u", (cd_num ? ", " : ""), cd_values[cd_num]);
- printf("}\n");
+ h5tools_str_append(&buffer, "%s%u", (cd_num ? ", " : ""), cd_values[cd_num]);
+ h5tools_str_append(&buffer, "}\n");
} /* end for */
} /* end if */
/* Print data type */
- printf(" %-10s ", "Type:");
- display_type(type, 15);
- printf("\n");
+ 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);
/* 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 $<TARGET_FILE:testh5repack_detect_szip>)
- 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 $<TARGET_FILE:h5repacktest>)
- 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=$<TARGET_FILE:h5repacktest>"
-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=$<TARGET_FILE:h5repack>"
-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=$<TARGET_FILE:h5dump>"
-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=$<TARGET_FILE:h5dump>"
-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 $<TARGET_FILE:testh5repack_detect_szip>)
+ 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 $<TARGET_FILE:h5repacktest>)
+ 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; i<travt->nobjs; 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<nmembers; j++) {
+ hid_t mtid = H5Tget_member_type( wtype_id, j );
+ H5T_class_t mtclass = H5Tget_class(mtid);
+ H5Tclose(mtid);
+
+ if (mtclass==H5T_REFERENCE) {
+ is_ref = 1;
+ break;
+ }
+ } /* for (j=0; i<nmembers; j++) */
+ } /* if (type_class == H5T_COMPOUND) */
+
+ if(is_ref) {
+ ; /* handled by copy_refs_attr() */
}
else {
/*-------------------------------------------------------------------------
@@ -522,9 +546,9 @@ int copy_attr(hid_t loc_in,
if(H5Aclose(attr_out) < 0)
goto error;
- /* Check if we have VL data in the attribute's datatype that must
+ /* Check if we have VL data and string in the attribute's datatype that must
* be reclaimed */
- if(TRUE == H5Tdetect_class(wtype_id, H5T_VLEN))
+ if (TRUE == h5tools_detect_vlen(wtype_id))
H5Dvlen_reclaim(wtype_id, space_id, H5P_DEFAULT, buf);
HDfree(buf);
buf = NULL;
@@ -554,13 +578,13 @@ int copy_attr(hid_t loc_in,
error:
H5E_BEGIN_TRY {
if(buf) {
- /* Check if we have VL data in the attribute's datatype that must
+ /* Check if we have VL data and string in the attribute's datatype that must
* be reclaimed */
- if(TRUE == H5Tdetect_class(wtype_id, H5T_VLEN))
+ if (TRUE == h5tools_detect_vlen(wtype_id))
H5Dvlen_reclaim(wtype_id, space_id, H5P_DEFAULT, buf);
/* Free buf */
- free(buf);
+ HDfree(buf);
} /* end if */
H5Tclose(ftype_id);
@@ -980,7 +1004,7 @@ static const char* get_sfilter(H5Z_filter_t filtn)
return "SOFF";
else {
error_msg("input error in filter type\n");
- exit(EXIT_FAILURE);
+ HDexit(EXIT_FAILURE);
}
}
diff --git a/tools/h5repack/h5repack.sh.in b/tools/h5repack/h5repack.sh.in
index 5a60227..c1cbba1 100755
--- a/tools/h5repack/h5repack.sh.in
+++ b/tools/h5repack/h5repack.sh.in
@@ -41,33 +41,11 @@ H5DUMP=../h5dump/h5dump # The h5dump tool name
H5DUMP_BIN=`pwd`/$H5DUMP # The path of the h5dump tool binary
GREP='grep'
+CP='cp'
H5DETECTSZIP=testh5repack_detect_szip
H5DETECTSZIP_BIN=`pwd`/$H5DETECTSZIP
-INFO_FILE=testfiles/h5repack.info
-
-FILE0=h5repack_fill.h5
-FILE1=h5repack_objs.h5
-FILE2=h5repack_attr.h5
-FILE3=h5repack_hlink.h5
-FILE4=h5repack_layout.h5
-FILE5=h5repack_early.h5
-FILE7=h5repack_szip.h5
-FILE8=h5repack_deflate.h5
-FILE9=h5repack_shuffle.h5
-FILE10=h5repack_fletcher.h5
-FILE11=h5repack_filters.h5
-FILE12=h5repack_nbit.h5
-FILE13=h5repack_soffset.h5
-FILE14=h5repack_layouto.h5 # A file with an older version of the layout message
- # (copy of test/tlayouto.h5)
-FILE15=h5repack_named_dtypes.h5
-FILE16=tfamily%05d.h5 # located in common testfiles folder
-FILE18=h5repack_layout2.h5
-FILE_REF=h5repack_refs.h5
-FILE_ATTR_REF=h5repack_attr_refs.h5
-
nerrors=0
verbose=yes
@@ -78,7 +56,96 @@ 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_H5REPACK_TESTFILES/h5repack_attr.h5
+$SRC_H5REPACK_TESTFILES/h5repack_attr_refs.h5
+$SRC_H5REPACK_TESTFILES/h5repack_deflate.h5
+$SRC_H5REPACK_TESTFILES/h5repack_early.h5
+$SRC_H5REPACK_TESTFILES/h5repack_ext.h5
+$SRC_H5REPACK_TESTFILES/h5repack_fill.h5
+$SRC_H5REPACK_TESTFILES/h5repack_filters.h5
+$SRC_H5REPACK_TESTFILES/h5repack_fletcher.h5
+$SRC_H5REPACK_TESTFILES/h5repack_hlink.h5
+$SRC_H5REPACK_TESTFILES/h5repack_layout.h5
+$SRC_H5REPACK_TESTFILES/h5repack_layouto.h5
+$SRC_H5REPACK_TESTFILES/h5repack_layout2.h5
+$SRC_H5REPACK_TESTFILES/h5repack_named_dtypes.h5
+$SRC_H5REPACK_TESTFILES/h5repack_nbit.h5
+$SRC_H5REPACK_TESTFILES/h5repack_objs.h5
+$SRC_H5REPACK_TESTFILES/h5repack_refs.h5
+$SRC_H5REPACK_TESTFILES/h5repack_shuffle.h5
+$SRC_H5REPACK_TESTFILES/h5repack_soffset.h5
+$SRC_H5REPACK_TESTFILES/h5repack_szip.h5
+$SRC_H5DIFF_TESTFILES/h5diff_attr1.h5
+$SRC_TOOLS_TESTFILES/tfamily00000.h5
+$SRC_TOOLS_TESTFILES/tfamily00001.h5
+$SRC_TOOLS_TESTFILES/tfamily00002.h5
+$SRC_TOOLS_TESTFILES/tfamily00003.h5
+$SRC_TOOLS_TESTFILES/tfamily00004.h5
+$SRC_TOOLS_TESTFILES/tfamily00005.h5
+$SRC_TOOLS_TESTFILES/tfamily00006.h5
+$SRC_TOOLS_TESTFILES/tfamily00007.h5
+$SRC_TOOLS_TESTFILES/tfamily00008.h5
+$SRC_TOOLS_TESTFILES/tfamily00009.h5
+$SRC_TOOLS_TESTFILES/tfamily00010.h5
+"
+
+LIST_OTHER_TEST_FILES="
+$SRC_H5REPACK_TESTFILES/h5repack_ext.bin
+$SRC_H5REPACK_TESTFILES/ublock.bin
+$SRC_H5REPACK_TESTFILES/h5repack.info
+$SRC_TOOLS_TESTFILES/h5repack_filters.h5.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".
@@ -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<len; i++)
@@ -509,7 +510,7 @@ obj_list_t* parse_layout(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");
@@ -526,7 +527,7 @@ obj_list_t* parse_layout(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;
}
@@ -535,9 +536,9 @@ obj_list_t* parse_layout(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("in parse layout, no characters after : in <%s>\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<len; i++)
@@ -590,10 +591,10 @@ obj_list_t* parse_layout(const char *str,
if (!isdigit(c) && c!='x'
&& c!='N' && c!='O' && c!='N' && c!='E'
){
- if (obj_list) free(obj_list);
+ if (obj_list) HDfree(obj_list);
error_msg("in parse layout, <%s> 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 <array_rank; j++)
+ array_size *= array_dims[j];
+ nelmts *= array_size;
+ }
+
+ if((attr_out = H5Acreate2(loc_out, name, ftype_id, space_id, H5P_DEFAULT, H5P_DEFAULT)) < 0)
goto error;
-
- /*-------------------------------------------------------------------------
- * object references are a special case
- * we cannot just copy the buffers, but instead we recreate the reference
- *-------------------------------------------------------------------------
- */
- if(H5Tequal(mtype_id, H5T_STD_REF_OBJ))
+ if (nelmts>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; i<nelems; i++) */
+ } else if (H5R_DSET_REG_REF_BUF_SIZE == msize) {
+
+ hdset_reg_ref_t ref_out;
+ for (i=0; i<(unsigned)nelmts; i++) {
+ hdset_reg_ref_t *ptr = (hdset_reg_ref_t *)((hvl_t *)buf)[i].p;
+ for (j=0; j<((hvl_t *)buf)[i].len; j++ ) {
+ if (update_ref_value(attr_id, H5R_DATASET_REGION, &(ptr[j]), fidout, &ref_out, travt)<0)
+ continue;
+ HDmemcpy(&(ptr[j]), &ref_out, msize);
+ }
+ } /* for (i=0; i<nelems; i++) */
+ }
+ } /* else if (is_ref_vlen) */
+ else if (is_ref_comp) {
+ /* handle ref fields in a compound */
+
+ buf = HDmalloc((unsigned)(nelmts * msize));
+ refbuf = buf; /* reuse the read buffer for write */
+
+ if(buf == NULL)
+ {
+ printf( "cannot read into memory\n" );
goto error;
- }
+ } /* end if */
- if(H5Aclose(attr_out) < 0)
- goto error;
+ if(H5Aread(attr_id, mtype_id, buf) < 0)
+ goto error;
- if(refbuf)
- HDfree(refbuf);
- if(buf)
- HDfree(buf);
- } /* H5T_STD_REF_DSETREG */
+ for (i=0; i<(unsigned)nelmts; i++) {
+ for (j=0; j<(unsigned)ref_comp_field_n; j++) {
+ if (ref_comp_size[j] == H5R_OBJ_REF_BUF_SIZE) {
+ int idx = i*msize+H5Tget_member_offset( mtype_id, (unsigned)ref_comp_index[j]);
+ hobj_ref_t ref_out;
+ if (update_ref_value(attr_id, H5R_OBJECT, (hobj_ref_t *)(((char *)buf)+idx), fidout, &ref_out, travt)<0)
+ continue;
+ HDmemcpy(((char *)buf)+idx, &ref_out, ref_comp_size[j]);
+ } /* if */
+ else if (ref_comp_size[j] == H5R_DSET_REG_REF_BUF_SIZE) {
+ int idx = i*msize+H5Tget_member_offset( mtype_id, (unsigned)ref_comp_index[j]);
+ hdset_reg_ref_t ref_out;
+ if (update_ref_value(attr_id, H5R_DATASET_REGION, (hdset_reg_ref_t *)(((char *)buf)+idx), fidout, &ref_out, travt)<0)
+ continue;
+ HDmemcpy(((char *)buf)+idx, &ref_out, ref_comp_size[j]);
+ } /* else if */
+ } /* j */
+ } /* i */
+ } /* else if (is_ref_comp) */
+
+ if(H5Awrite(attr_out, mtype_id, refbuf) < 0)
+ goto error;
+
+ if (is_ref_vlen && buf)
+ H5Dvlen_reclaim (mtype_id, space_id, H5P_DEFAULT, buf);
+ } /* if (nelmts) */
+
+ if (refbuf == buf)
+ refbuf = NULL; /* set it to NULL to avoid double free since buf and refbuf are the same. */
+
+ if(buf) {
+ HDfree(buf);
+ buf = NULL;
+ }
+
+ if(refbuf) {
+ HDfree(refbuf);
+ refbuf = NULL;
+ }
+
+ if (ref_comp_index) {
+ HDfree(ref_comp_index);
+ ref_comp_index = NULL;
+ }
+
+ if (ref_comp_size) {
+ HDfree(ref_comp_size);
+ ref_comp_size = NULL;
+ }
+
+ if(H5Aclose(attr_out) < 0)
+ goto error;
/*-------------------------------------------------------------------------
* close
@@ -679,11 +780,22 @@ static int copy_refs_attr(hid_t loc_in,
goto error;
if(H5Aclose(attr_id) < 0)
goto error;
- } /* u */
+ } /* for(u = 0; u < (unsigned)oinfo.num_attrs; u++) */
return 0;
error:
+ if(refbuf)
+ HDfree(refbuf);
+ if(buf)
+ HDfree(buf);
+
+ if (ref_comp_index)
+ HDfree(ref_comp_index);
+
+ if (ref_comp_size)
+ HDfree(ref_comp_size);
+
H5E_BEGIN_TRY {
H5Tclose(ftype_id);
H5Tclose(mtype_id);
@@ -710,7 +822,7 @@ MapIdToName(hid_t refobj_id, trav_table_t *travt)
/* linear search */
for(u = 0; u < travt->nobjs; 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
--- a/tools/h5repack/testfiles/h5repack_layout.h5
+++ b/tools/h5repack/testfiles/h5repack_layout.h5
Binary files 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 <stdio.h>
#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 $<TARGET_FILE:h5stat_gentest>)
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 $<TARGET_FILE:h5stat> ${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=$<TARGET_FILE:h5stat>"
@@ -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 <stdlib.h>
#include <string.h>
-#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 <ndims; u++)
@@ -696,7 +726,7 @@ hsize_t diff_datum(void *_mem1,
obj2,
container1_id,
container2_id,
- ph, NULL);
+ ph, members);
}
H5Tclose(memb_type);
}
@@ -730,9 +760,9 @@ hsize_t diff_datum(void *_mem1,
hid_t region1_id;
hid_t region2_id;
- if ((obj1_id = H5Rdereference(container1_id, H5R_DATASET_REGION, _mem1))<0)
+ if ((obj1_id = H5Rdereference2(container1_id, H5P_DEFAULT, H5R_DATASET_REGION, _mem1))<0)
ret= -1;
- if ((obj2_id = H5Rdereference(container2_id, H5R_DATASET_REGION, _mem2))<0)
+ if ((obj2_id = H5Rdereference2(container2_id, H5P_DEFAULT, H5R_DATASET_REGION, _mem2))<0)
ret= -1;
if ((region1_id = H5Rget_region(container1_id, H5R_DATASET_REGION, _mem1))<0)
ret= -1;
@@ -781,9 +811,9 @@ hsize_t diff_datum(void *_mem1,
return 0;
}
- if((obj1_id = H5Rdereference(container1_id, H5R_OBJECT, _mem1)) < 0)
+ if((obj1_id = H5Rdereference2(container1_id, H5P_DEFAULT, H5R_OBJECT, _mem1)) < 0)
ret = -1;
- if((obj2_id = H5Rdereference(container2_id, H5R_OBJECT, _mem2)) < 0)
+ if((obj2_id = H5Rdereference2(container2_id, H5P_DEFAULT, H5R_OBJECT, _mem2)) < 0)
ret = -1;
if(ret == -1) {
options->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; i<members->n; i++)
+ for (i=0; i<members->n; 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<rank1; i++)
{
if (maxdim1 && maxdim2)
diff --git a/tools/lib/h5diff_util.c b/tools/lib/h5diff_util.c
index 6d340d9..0d476b6 100644
--- a/tools/lib/h5diff_util.c
+++ b/tools/lib/h5diff_util.c
@@ -35,24 +35,27 @@ print_dimensions (int rank, hsize_t *dims)
{
int i;
- if ( rank > 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 <stdlib.h>
#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,2224 +1040,6 @@ 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.
- *
- * 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 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;
- 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");
-
- /* 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;
- 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;
-}
-
-/*-------------------------------------------------------------------------
- * 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;
- 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);
-
- 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_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
- 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 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<empty>");
-
- 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
@@ -3597,7 +1052,7 @@ init_acc_pos(h5tools_context_t *ctx, hsize_t *dims)
{
int i;
- assert(ctx->ndims);
+ HDassert(ctx->ndims);
ctx->acc[ctx->ndims - 1] = 1;
for (i = (ctx->ndims - 2); i >= 0; i--) {
@@ -3616,8 +1071,8 @@ init_acc_pos(h5tools_context_t *ctx, hsize_t *dims)
* Failure: FAIL
*-------------------------------------------------------------------------
*/
-static
-int do_bin_output(FILE *stream, hid_t container, hsize_t nelmts, hid_t tid, void *_mem)
+int
+do_bin_output(FILE *stream, FILE *err_stream, hid_t container, hsize_t nelmts, hid_t tid, void *_mem)
{
HERR_INIT(int, SUCCEED)
unsigned char *mem = (unsigned char*)_mem;
@@ -3629,7 +1084,7 @@ int do_bin_output(FILE *stream, hid_t container, hsize_t nelmts, hid_t tid, void
for (i = 0; i < nelmts; i++) {
if (render_bin_output(stream, container, tid, mem + i * size) < 0) {
- printf("\nError in writing binary stream\n");
+ HDfprintf(err_stream,"\nError in writing binary stream\n");
return FAIL;
}
}
@@ -3647,7 +1102,7 @@ CATCH
* 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 <matzke@llnl.gov>
+ * Thursday, July 23, 1998
+ *
+ * Purpose: A library for displaying the values of a dataset in a human
+ * readable format.
+ */
+
+#include <stdio.h>
+#include <stdlib.h>
+
+#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<empty>");
+
+ 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; j<cd_nelmts; j++)
+ h5tools_str_append(&buffer, "%d ", cd_values[j]);
+ 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);
+ 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 <list_of_fields> */
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 <list_of_fields> */
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 <stdio.h>
#include <stdlib.h>
+#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 $<TARGET_FILE:h5repart_gentest>)
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 $<TARGET_FILE:h5mkgrp> ${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=$<TARGET_FILE:h5ls>"
-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 $<TARGET_FILE:h5mkgrp> ${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=$<TARGET_FILE:h5ls>"
-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 <filename> <Symbol table node address> <address of local heap>\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 <filename> <Symbol table node address> <address of local heap>\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 <filename> <B-tree node address> <address of local heap>\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 <filename> <B-tree node address> <address of local heap>\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 <filename> <B-tree node address> <# 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 <filename> <B-tree node address> <# 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 <filename> <internal node address> <v2 B-tree header address> <number of records> <depth>\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 <filename> <internal node address> <v2 B-tree header address> <number of records> <depth>\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 <filename> <leaf node address> <v2 B-tree header address> <number of records>\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 <filename> <leaf node address> <v2 B-tree header address> <number of records>\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 <filename> <direct block address> <heap header address> <size of direct block>\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 <filename> <direct block address> <heap header address> <size of direct block>\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 <filename> <indirect block address> <heap header address> <number of rows>\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 <filename> <indirect block address> <heap header address> <number of rows>\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 <filename> <serialized sections address> <free space header address> <client address>\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 <filename> <serialized sections address> <free space header address> <client address>\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 <filename> <shared message list address> <list format version> <number of mesages in list>\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 <filename> <shared message list address> <list format version> <number of mesages in list>\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 <filename> <Extensible Array header address> <object header address>\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 <filename> <Extensible Array header address> <object header address>\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 <filename> <index block address> <array header address> <object header address\n");
+ HDfprintf(stderr, "ERROR: Need extensible array header address and object header address containing the layout message in order to dump index block\n");
+ HDfprintf(stderr, "Extensible array index block usage:\n");
+ HDfprintf(stderr, "\th5debug <filename> <index block address> <array header address> <object header address\n");
HDexit(4);
} /* end if */
@@ -572,9 +572,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, super block index and object header address containing the layout message in order to dump super block\n");
- fprintf(stderr, "Extensible array super block usage:\n");
- fprintf(stderr, "\th5debug <filename> <super block address> <array header address> <super block index> <object header address>\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 <filename> <super block address> <array header address> <super block index> <object header address>\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 <filename> <data block address> <array header address> <# of elements in data block> <object header address\n");
+ HDfprintf(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");
+ HDfprintf(stderr, "Extensible array data block usage:\n");
+ HDfprintf(stderr, "\th5debug <filename> <data block address> <array header address> <# of elements in data block> <object header address\n");
HDexit(4);
} /* end if */
@@ -604,11 +604,11 @@ main(int argc, char *argv[])
const H5FA_class_t *cls = get_H5FA_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, "Fixed array header block usage:\n");
- fprintf(stderr, "\th5debug <filename> <Fixed Array header address> <object header address>\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 <filename> <Fixed Array header address> <object header address>\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 <filename> <data block address> <array header address> <object header address>\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 <filename> <data block address> <array header address> <object header address>\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/tnofilename.ddl b/tools/testfiles/h5dump-help.txt
index 0e78217..f04ed48 100644
--- a/tools/testfiles/tnofilename.ddl
+++ b/tools/testfiles/h5dump-help.txt
@@ -1,7 +1,4 @@
-#############################
-Expected output for 'h5dump '
-#############################
-usage: h5dump [OPTIONS] file
+usage: h5dump [OPTIONS] files
OPTIONS
-h, --help Print a usage message and exit
-n, --contents Print a list of the file contents and exit
@@ -28,6 +25,12 @@ usage: h5dump [OPTIONS] file
-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
@@ -37,6 +40,8 @@ usage: h5dump [OPTIONS] file
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.
@@ -74,7 +79,7 @@ usage: h5dump [OPTIONS] file
1) Attribute foo of the group /bar_none in file quux.h5
- h5dump -a /bar_none/foo quux.h5
+ h5dump -a /bar_none/foo quux.h5
2) Selecting a subset from dataset /foo in file quux.h5
@@ -85,3 +90,11 @@ usage: h5dump [OPTIONS] file
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'
-#############################
<?xml version="1.0" encoding="UTF-8"?>
-<hdf5:HDF5-File xmlns:hdf5="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">
+<hdf5:HDF5-File xmlns:hdf5="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">
<hdf5:RootGroup OBJ-XID="xid_96" H5Path="/">
<hdf5:Attribute Name="attr1">
<hdf5:Dataspace>
@@ -17,7 +14,16 @@ Expected output for 'h5dump --xml -A tall.h5'
</hdf5:DataType>
<hdf5:Data>
<hdf5:DataFromFile>
- 97 98 99 100 101 102 103 104 105 0
+ 97
+ 98
+ 99
+ 100
+ 101
+ 102
+ 103
+ 104
+ 105
+ 0
</hdf5:DataFromFile>
</hdf5:Data>
</hdf5:Attribute>
@@ -35,8 +41,10 @@ Expected output for 'h5dump --xml -A tall.h5'
</hdf5:DataType>
<hdf5:Data>
<hdf5:DataFromFile>
- 0 1
- 2 3
+ 0
+ 1
+ 2
+ 3
</hdf5:DataFromFile>
</hdf5:Data>
</hdf5:Attribute>
@@ -46,9 +54,9 @@ Expected output for 'h5dump --xml -A tall.h5'
<hdf5:StorageLayout>
<hdf5:ContiguousLayout/>
</hdf5:StorageLayout>
- <hdf5:FillValueInfo FillTime="FillIfSet" AllocationTime="Late">
+ <hdf5:FillValueInfo FillTime="FillIfSet" AllocationTime="Late">
<hdf5:FillValue>
- <hdf5:NoFill/>
+ <hdf5:NoFill/>
</hdf5:FillValue>
</hdf5:FillValueInfo>
<hdf5:Dataspace>
@@ -75,8 +83,33 @@ Expected output for 'h5dump --xml -A tall.h5'
</hdf5:DataType>
<hdf5:Data>
<hdf5:DataFromFile>
- 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
</hdf5:DataFromFile>
</hdf5:Data>
</hdf5:Attribute>
@@ -93,8 +126,33 @@ Expected output for 'h5dump --xml -A tall.h5'
</hdf5:DataType>
<hdf5:Data>
<hdf5:DataFromFile>
- 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
</hdf5:DataFromFile>
</hdf5:Data>
</hdf5:Attribute>
@@ -106,9 +164,9 @@ Expected output for 'h5dump --xml -A tall.h5'
<hdf5:StorageLayout>
<hdf5:ContiguousLayout/>
</hdf5:StorageLayout>
- <hdf5:FillValueInfo FillTime="FillIfSet" AllocationTime="Late">
+ <hdf5:FillValueInfo FillTime="FillIfSet" AllocationTime="Late">
<hdf5:FillValue>
- <hdf5:NoFill/>
+ <hdf5:NoFill/>
</hdf5:FillValue>
</hdf5:FillValueInfo>
<hdf5:Dataspace>
@@ -138,9 +196,9 @@ Expected output for 'h5dump --xml -A tall.h5'
<hdf5:StorageLayout>
<hdf5:ContiguousLayout/>
</hdf5:StorageLayout>
- <hdf5:FillValueInfo FillTime="FillIfSet" AllocationTime="Late">
+ <hdf5:FillValueInfo FillTime="FillIfSet" AllocationTime="Late">
<hdf5:FillValue>
- <hdf5:NoFill/>
+ <hdf5:NoFill/>
</hdf5:FillValue>
</hdf5:FillValueInfo>
<hdf5:Dataspace>
@@ -161,9 +219,9 @@ Expected output for 'h5dump --xml -A tall.h5'
<hdf5:StorageLayout>
<hdf5:ContiguousLayout/>
</hdf5:StorageLayout>
- <hdf5:FillValueInfo FillTime="FillIfSet" AllocationTime="Late">
+ <hdf5:FillValueInfo FillTime="FillIfSet" AllocationTime="Late">
<hdf5:FillValue>
- <hdf5:NoFill/>
+ <hdf5:NoFill/>
</hdf5:FillValue>
</hdf5:FillValueInfo>
<hdf5:Dataspace>
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'
-#############################
<?xml version="1.0" encoding="UTF-8"?>
-<hdf5:HDF5-File xmlns:hdf5="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">
+<hdf5:HDF5-File xmlns:hdf5="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">
<hdf5:RootGroup OBJ-XID="xid_96" H5Path="/">
<hdf5:Attribute Name="attr1">
<hdf5:Dataspace>
@@ -17,7 +14,16 @@ Expected output for 'h5dump --xml tall.h5'
</hdf5:DataType>
<hdf5:Data>
<hdf5:DataFromFile>
- 97 98 99 100 101 102 103 104 105 0
+ 97
+ 98
+ 99
+ 100
+ 101
+ 102
+ 103
+ 104
+ 105
+ 0
</hdf5:DataFromFile>
</hdf5:Data>
</hdf5:Attribute>
@@ -35,8 +41,10 @@ Expected output for 'h5dump --xml tall.h5'
</hdf5:DataType>
<hdf5:Data>
<hdf5:DataFromFile>
- 0 1
- 2 3
+ 0
+ 1
+ 2
+ 3
</hdf5:DataFromFile>
</hdf5:Data>
</hdf5:Attribute>
@@ -46,9 +54,9 @@ Expected output for 'h5dump --xml tall.h5'
<hdf5:StorageLayout>
<hdf5:ContiguousLayout/>
</hdf5:StorageLayout>
- <hdf5:FillValueInfo FillTime="FillIfSet" AllocationTime="Late">
+ <hdf5:FillValueInfo FillTime="FillIfSet" AllocationTime="Late">
<hdf5:FillValue>
- <hdf5:NoFill/>
+ <hdf5:NoFill/>
</hdf5:FillValue>
</hdf5:FillValueInfo>
<hdf5:Dataspace>
@@ -75,8 +83,33 @@ Expected output for 'h5dump --xml tall.h5'
</hdf5:DataType>
<hdf5:Data>
<hdf5:DataFromFile>
- 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
</hdf5:DataFromFile>
</hdf5:Data>
</hdf5:Attribute>
@@ -93,23 +126,138 @@ Expected output for 'h5dump --xml tall.h5'
</hdf5:DataType>
<hdf5:Data>
<hdf5:DataFromFile>
- 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
</hdf5:DataFromFile>
</hdf5:Data>
</hdf5:Attribute>
<hdf5:Data>
<hdf5:DataFromFile>
- 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
</hdf5:DataFromFile>
</hdf5:Data>
</hdf5:Dataset>
@@ -117,9 +265,9 @@ Expected output for 'h5dump --xml tall.h5'
<hdf5:StorageLayout>
<hdf5:ContiguousLayout/>
</hdf5:StorageLayout>
- <hdf5:FillValueInfo FillTime="FillIfSet" AllocationTime="Late">
+ <hdf5:FillValueInfo FillTime="FillIfSet" AllocationTime="Late">
<hdf5:FillValue>
- <hdf5:NoFill/>
+ <hdf5:NoFill/>
</hdf5:FillValue>
</hdf5:FillValueInfo>
<hdf5:Dataspace>
@@ -134,7 +282,26 @@ Expected output for 'h5dump --xml tall.h5'
</hdf5:DataType>
<hdf5:Data>
<hdf5:DataFromFile>
- 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
</hdf5:DataFromFile>
</hdf5:Data>
</hdf5:Dataset>
@@ -151,9 +318,9 @@ Expected output for 'h5dump --xml tall.h5'
<hdf5:StorageLayout>
<hdf5:ContiguousLayout/>
</hdf5:StorageLayout>
- <hdf5:FillValueInfo FillTime="FillIfSet" AllocationTime="Late">
+ <hdf5:FillValueInfo FillTime="FillIfSet" AllocationTime="Late">
<hdf5:FillValue>
- <hdf5:NoFill/>
+ <hdf5:NoFill/>
</hdf5:FillValue>
</hdf5:FillValueInfo>
<hdf5:Dataspace>
@@ -168,7 +335,16 @@ Expected output for 'h5dump --xml tall.h5'
</hdf5:DataType>
<hdf5:Data>
<hdf5:DataFromFile>
- 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
</hdf5:DataFromFile>
</hdf5:Data>
</hdf5:Dataset>
@@ -176,9 +352,9 @@ Expected output for 'h5dump --xml tall.h5'
<hdf5:StorageLayout>
<hdf5:ContiguousLayout/>
</hdf5:StorageLayout>
- <hdf5:FillValueInfo FillTime="FillIfSet" AllocationTime="Late">
+ <hdf5:FillValueInfo FillTime="FillIfSet" AllocationTime="Late">
<hdf5:FillValue>
- <hdf5:NoFill/>
+ <hdf5:NoFill/>
</hdf5:FillValue>
</hdf5:FillValueInfo>
<hdf5:Dataspace>
@@ -194,9 +370,21 @@ Expected output for 'h5dump --xml tall.h5'
</hdf5:DataType>
<hdf5:Data>
<hdf5:DataFromFile>
- 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
</hdf5:DataFromFile>
</hdf5:Data>
</hdf5:Dataset>
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'
-#############################
<?xml version="1.0" encoding="UTF-8"?>
-<hdf5:HDF5-File xmlns:hdf5="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">
+<hdf5:HDF5-File xmlns:hdf5="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">
<hdf5:RootGroup OBJ-XID="xid_928" H5Path="/">
<hdf5:Dataset Name="Dataset1" OBJ-XID="xid_976" H5Path= "/Dataset1" Parents="xid_928" H5ParentPaths="/">
<hdf5:StorageLayout>
<hdf5:ContiguousLayout/>
</hdf5:StorageLayout>
- <hdf5:FillValueInfo FillTime="FillIfSet" AllocationTime="Late">
+ <hdf5:FillValueInfo FillTime="FillIfSet" AllocationTime="Late">
<hdf5:FillValue>
- <hdf5:NoFill/>
+ <hdf5:NoFill/>
</hdf5:FillValue>
</hdf5:FillValueInfo>
<hdf5:Dataspace>
@@ -30,7 +27,10 @@ Expected output for 'h5dump --xml tarray1.h5'
</hdf5:DataType>
<hdf5:Data>
<hdf5:DataFromFile>
- 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
</hdf5:DataFromFile>
</hdf5:Data>
</hdf5:Dataset>
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'
-#############################
<?xml version="1.0" encoding="UTF-8"?>
-<hdf5:HDF5-File xmlns:hdf5="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">
+<hdf5:HDF5-File xmlns:hdf5="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">
<hdf5:RootGroup OBJ-XID="xid_928" H5Path="/">
<hdf5:Dataset Name="Dataset1" OBJ-XID="xid_976" H5Path= "/Dataset1" Parents="xid_928" H5ParentPaths="/">
<hdf5:StorageLayout>
<hdf5:ContiguousLayout/>
</hdf5:StorageLayout>
- <hdf5:FillValueInfo FillTime="FillIfSet" AllocationTime="Late">
+ <hdf5:FillValueInfo FillTime="FillIfSet" AllocationTime="Late">
<hdf5:FillValue>
- <hdf5:NoFill/>
+ <hdf5:NoFill/>
</hdf5:FillValue>
</hdf5:FillValueInfo>
<hdf5:Dataspace>
@@ -32,54 +29,10 @@ Expected output for 'h5dump --xml tarray2.h5'
</hdf5:DataType>
<hdf5:Data>
<hdf5:DataFromFile>
- 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
</hdf5:DataFromFile>
</hdf5:Data>
</hdf5:Dataset>
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'
-#############################
<?xml version="1.0" encoding="UTF-8"?>
-<hdf5:HDF5-File xmlns:hdf5="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">
+<hdf5:HDF5-File xmlns:hdf5="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">
<hdf5:RootGroup OBJ-XID="xid_928" H5Path="/">
<hdf5:Dataset Name="Dataset1" OBJ-XID="xid_976" H5Path= "/Dataset1" Parents="xid_928" H5ParentPaths="/">
<hdf5:StorageLayout>
<hdf5:ContiguousLayout/>
</hdf5:StorageLayout>
- <hdf5:FillValueInfo FillTime="FillIfSet" AllocationTime="Late">
+ <hdf5:FillValueInfo FillTime="FillIfSet" AllocationTime="Late">
<hdf5:FillValue>
- <hdf5:NoFill/>
+ <hdf5:NoFill/>
</hdf5:FillValue>
</hdf5:FillValueInfo>
<hdf5:Dataspace>
@@ -36,90 +33,22 @@ Expected output for 'h5dump --xml tarray3.h5'
</hdf5:DataType>
<hdf5:Data>
<hdf5:DataFromFile>
- 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
</hdf5:DataFromFile>
</hdf5:Data>
</hdf5:Dataset>
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
--- a/tools/testfiles/tarray6.h5
+++ b/tools/testfiles/tarray6.h5
Binary files 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'
-#############################
<?xml version="1.0" encoding="UTF-8"?>
-<hdf5:HDF5-File xmlns:hdf5="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">
+<hdf5:HDF5-File xmlns:hdf5="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">
<hdf5:RootGroup OBJ-XID="xid_928" H5Path="/">
<hdf5:Dataset Name="Dataset1" OBJ-XID="xid_976" H5Path= "/Dataset1" Parents="xid_928" H5ParentPaths="/">
<hdf5:StorageLayout>
<hdf5:ContiguousLayout/>
</hdf5:StorageLayout>
- <hdf5:FillValueInfo FillTime="FillIfSet" AllocationTime="Late">
+ <hdf5:FillValueInfo FillTime="FillIfSet" AllocationTime="Late">
<hdf5:FillValue>
- <hdf5:NoFill/>
+ <hdf5:NoFill/>
</hdf5:FillValue>
</hdf5:FillValueInfo>
<hdf5:Dataspace>
@@ -34,10 +31,10 @@ Expected output for 'h5dump --xml tarray6.h5'
</hdf5:DataType>
<hdf5:Data>
<hdf5:DataFromFile>
- 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
</hdf5:DataFromFile>
</hdf5:Data>
</hdf5:Dataset>
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'
-#############################
<?xml version="1.0" encoding="UTF-8"?>
-<hdf5:HDF5-File xmlns:hdf5="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">
+<hdf5:HDF5-File xmlns:hdf5="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">
<hdf5:RootGroup OBJ-XID="xid_928" H5Path="/">
<hdf5:Dataset Name="Dataset1" OBJ-XID="xid_976" H5Path= "/Dataset1" Parents="xid_928" H5ParentPaths="/">
<hdf5:StorageLayout>
<hdf5:ContiguousLayout/>
</hdf5:StorageLayout>
- <hdf5:FillValueInfo FillTime="FillIfSet" AllocationTime="Late">
+ <hdf5:FillValueInfo FillTime="FillIfSet" AllocationTime="Late">
<hdf5:FillValue>
- <hdf5:NoFill/>
+ <hdf5:NoFill/>
</hdf5:FillValue>
</hdf5:FillValueInfo>
<hdf5:Dataspace>
@@ -39,10 +36,22 @@ Expected output for 'h5dump --xml tarray7.h5'
</hdf5:DataType>
<hdf5:Data>
<hdf5:DataFromFile>
- 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
</hdf5:DataFromFile>
</hdf5:Data>
</hdf5:Dataset>
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
--- a/tools/testfiles/tattr.h5
+++ b/tools/testfiles/tattr.h5
Binary files 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'
-#############################
<?xml version="1.0" encoding="UTF-8"?>
-<hdf5:HDF5-File xmlns:hdf5="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">
+<hdf5:HDF5-File xmlns:hdf5="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">
<hdf5:RootGroup OBJ-XID="xid_928" H5Path="/">
- <hdf5:Attribute Name="attr1">
+ <hdf5:Attribute Name="/attr1">
<hdf5:Dataspace>
<hdf5:SimpleDataspace Ndims="1">
<hdf5:Dimension DimSize="24" MaxDimSize="24"/>
@@ -17,8 +14,30 @@ Expected output for 'h5dump --xml tattr.h5'
</hdf5:DataType>
<hdf5:Data>
<hdf5:DataFromFile>
- 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
</hdf5:DataFromFile>
</hdf5:Data>
</hdf5:Attribute>
@@ -35,7 +54,16 @@ Expected output for 'h5dump --xml tattr.h5'
</hdf5:DataType>
<hdf5:Data>
<hdf5:DataFromFile>
- 1 2 3 4 5 6 7 8 9 10
+ 1
+ 2
+ 3
+ 4
+ 5
+ 6
+ 7
+ 8
+ 9
+ 10
</hdf5:DataFromFile>
</hdf5:Data>
</hdf5:Attribute>
@@ -52,7 +80,16 @@ Expected output for 'h5dump --xml tattr.h5'
</hdf5:DataType>
<hdf5:Data>
<hdf5:DataFromFile>
- 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
</hdf5:DataFromFile>
</hdf5:Data>
</hdf5:Attribute>
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
--- /dev/null
+++ b/tools/testfiles/tattr4_be.h5
Binary files 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'
-#############################
<?xml version="1.0" encoding="UTF-8"?>
-<hdf5:HDF5-File xmlns:hdf5="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">
+<hdf5:HDF5-File xmlns:hdf5="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">
<hdf5:RootGroup OBJ-XID="xid_696" H5Path="/">
<hdf5:Group Name="typetests" OBJ-XID="xid_1344" H5Path="/typetests" Parents="xid_696" H5ParentPaths="/" >
<hdf5:Dataset Name="bitfield_1" OBJ-XID="xid_1720" H5Path= "/typetests/bitfield_1" Parents="xid_1344" H5ParentPaths="/typetests">
<hdf5:StorageLayout>
<hdf5:ContiguousLayout/>
</hdf5:StorageLayout>
- <hdf5:FillValueInfo FillTime="FillIfSet" AllocationTime="Late">
+ <hdf5:FillValueInfo FillTime="FillIfSet" AllocationTime="Late">
<hdf5:FillValue>
- <hdf5:NoFill/>
+ <hdf5:NoFill/>
</hdf5:FillValue>
</hdf5:FillValueInfo>
<hdf5:Dataspace>
@@ -26,9 +23,38 @@ Expected output for 'h5dump --xml tbitfields.h5'
</hdf5:DataType>
<hdf5:Data>
<hdf5:DataFromFile>
- 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
</hdf5:DataFromFile>
</hdf5:Data>
</hdf5:Dataset>
@@ -36,9 +62,9 @@ Expected output for 'h5dump --xml tbitfields.h5'
<hdf5:StorageLayout>
<hdf5:ContiguousLayout/>
</hdf5:StorageLayout>
- <hdf5:FillValueInfo FillTime="FillIfSet" AllocationTime="Late">
+ <hdf5:FillValueInfo FillTime="FillIfSet" AllocationTime="Late">
<hdf5:FillValue>
- <hdf5:NoFill/>
+ <hdf5:NoFill/>
</hdf5:FillValue>
</hdf5:FillValueInfo>
<hdf5:Dataspace>
@@ -53,8 +79,22 @@ Expected output for 'h5dump --xml tbitfields.h5'
</hdf5:DataType>
<hdf5:Data>
<hdf5:DataFromFile>
- 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
</hdf5:DataFromFile>
</hdf5:Data>
</hdf5:Dataset>
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'
-#############################
<?xml version="1.0" encoding="UTF-8"?>
-<hdf5:HDF5-File xmlns:hdf5="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">
+<hdf5:HDF5-File xmlns:hdf5="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">
<hdf5:RootGroup OBJ-XID="xid_696" H5Path="/">
<hdf5:NamedDataType Name="#6632" OBJ-XID="xid_18446744073709551614" Parents="xid_696" H5ParentPaths="/">
<hdf5:DataType>
@@ -28,9 +25,9 @@ Expected output for 'h5dump --xml tcompound.h5'
<hdf5:StorageLayout>
<hdf5:ContiguousLayout/>
</hdf5:StorageLayout>
- <hdf5:FillValueInfo FillTime="FillIfSet" AllocationTime="Late">
+ <hdf5:FillValueInfo FillTime="FillIfSet" AllocationTime="Late">
<hdf5:FillValue>
- <hdf5:NoFill/>
+ <hdf5:NoFill/>
</hdf5:FillValue>
</hdf5:FillValueInfo>
<hdf5:Dataspace>
@@ -66,7 +63,11 @@ Expected output for 'h5dump --xml tcompound.h5'
<!-- Note: format of compound data not specified -->
<hdf5:Data>
<hdf5:DataFromFile>
- 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
</hdf5:DataFromFile>
</hdf5:Data>
</hdf5:Dataset>
@@ -75,9 +76,9 @@ Expected output for 'h5dump --xml tcompound.h5'
<hdf5:StorageLayout>
<hdf5:ContiguousLayout/>
</hdf5:StorageLayout>
- <hdf5:FillValueInfo FillTime="FillIfSet" AllocationTime="Late">
+ <hdf5:FillValueInfo FillTime="FillIfSet" AllocationTime="Late">
<hdf5:FillValue>
- <hdf5:NoFill/>
+ <hdf5:NoFill/>
</hdf5:FillValue>
</hdf5:FillValueInfo>
<hdf5:Dataspace>
@@ -89,7 +90,11 @@ Expected output for 'h5dump --xml tcompound.h5'
<!-- Note: format of compound data not specified -->
<hdf5:Data>
<hdf5:DataFromFile>
- 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
</hdf5:DataFromFile>
</hdf5:Data>
</hdf5:Dataset>
@@ -97,9 +102,9 @@ Expected output for 'h5dump --xml tcompound.h5'
<hdf5:StorageLayout>
<hdf5:ContiguousLayout/>
</hdf5:StorageLayout>
- <hdf5:FillValueInfo FillTime="FillIfSet" AllocationTime="Late">
+ <hdf5:FillValueInfo FillTime="FillIfSet" AllocationTime="Late">
<hdf5:FillValue>
- <hdf5:NoFill/>
+ <hdf5:NoFill/>
</hdf5:FillValue>
</hdf5:FillValueInfo>
<hdf5:Dataspace>
@@ -112,96 +117,24 @@ Expected output for 'h5dump --xml tcompound.h5'
<!-- Note: format of compound data not specified -->
<hdf5:Data>
<hdf5:DataFromFile>
- 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
</hdf5:DataFromFile>
</hdf5:Data>
</hdf5:Dataset>
@@ -209,9 +142,9 @@ Expected output for 'h5dump --xml tcompound.h5'
<hdf5:StorageLayout>
<hdf5:ContiguousLayout/>
</hdf5:StorageLayout>
- <hdf5:FillValueInfo FillTime="FillIfSet" AllocationTime="Late">
+ <hdf5:FillValueInfo FillTime="FillIfSet" AllocationTime="Late">
<hdf5:FillValue>
- <hdf5:NoFill/>
+ <hdf5:NoFill/>
</hdf5:FillValue>
</hdf5:FillValueInfo>
<hdf5:Dataspace>
@@ -223,7 +156,11 @@ Expected output for 'h5dump --xml tcompound.h5'
<!-- Note: format of compound data not specified -->
<hdf5:Data>
<hdf5:DataFromFile>
- 0 3 1 4 2 5 3 6 4 7
+ 0 3
+ 1 4
+ 2 5
+ 3 6
+ 4 7
</hdf5:DataFromFile>
</hdf5:Data>
</hdf5:Dataset>
@@ -253,9 +190,9 @@ Expected output for 'h5dump --xml tcompound.h5'
<hdf5:StorageLayout>
<hdf5:ContiguousLayout/>
</hdf5:StorageLayout>
- <hdf5:FillValueInfo FillTime="FillIfSet" AllocationTime="Late">
+ <hdf5:FillValueInfo FillTime="FillIfSet" AllocationTime="Late">
<hdf5:FillValue>
- <hdf5:NoFill/>
+ <hdf5:NoFill/>
</hdf5:FillValue>
</hdf5:FillValueInfo>
<hdf5:Dataspace>
@@ -267,7 +204,11 @@ Expected output for 'h5dump --xml tcompound.h5'
<!-- Note: format of compound data not specified -->
<hdf5:Data>
<hdf5:DataFromFile>
- 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
</hdf5:DataFromFile>
</hdf5:Data>
</hdf5:Dataset>
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'
-#############################
<?xml version="1.0" encoding="UTF-8"?>
-<hdf5:HDF5-File xmlns:hdf5="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">
+<hdf5:HDF5-File xmlns:hdf5="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">
<hdf5:RootGroup OBJ-XID="xid_696" H5Path="/">
<hdf5:NamedDataType Name="#9560" OBJ-XID="xid_18446744073709551614" Parents="xid_696" H5ParentPaths="/">
<hdf5:DataType>
@@ -34,7 +31,7 @@ Expected output for 'h5dump --xml tcompound2.h5'
</hdf5:StorageLayout>
<hdf5:FillValueInfo FillTime="FillIfSet" AllocationTime="Incremental">
<hdf5:FillValue>
- <hdf5:NoFill/>
+ <hdf5:NoFill/>
</hdf5:FillValue>
</hdf5:FillValueInfo>
<hdf5:Dataspace>
@@ -70,7 +67,12 @@ Expected output for 'h5dump --xml tcompound2.h5'
<!-- Note: format of compound data not specified -->
<hdf5:Data>
<hdf5:DataFromFile>
- 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
</hdf5:DataFromFile>
</hdf5:Data>
</hdf5:Dataset>
@@ -85,7 +87,7 @@ Expected output for 'h5dump --xml tcompound2.h5'
</hdf5:StorageLayout>
<hdf5:FillValueInfo FillTime="FillIfSet" AllocationTime="Incremental">
<hdf5:FillValue>
- <hdf5:NoFill/>
+ <hdf5:NoFill/>
</hdf5:FillValue>
</hdf5:FillValueInfo>
<hdf5:Dataspace>
@@ -97,7 +99,12 @@ Expected output for 'h5dump --xml tcompound2.h5'
<!-- Note: format of compound data not specified -->
<hdf5:Data>
<hdf5:DataFromFile>
- 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
</hdf5:DataFromFile>
</hdf5:Data>
</hdf5:Dataset>
@@ -111,7 +118,7 @@ Expected output for 'h5dump --xml tcompound2.h5'
</hdf5:StorageLayout>
<hdf5:FillValueInfo FillTime="FillIfSet" AllocationTime="Incremental">
<hdf5:FillValue>
- <hdf5:NoFill/>
+ <hdf5:NoFill/>
</hdf5:FillValue>
</hdf5:FillValueInfo>
<hdf5:Dataspace>
@@ -123,7 +130,12 @@ Expected output for 'h5dump --xml tcompound2.h5'
<!-- Note: format of compound data not specified -->
<hdf5:Data>
<hdf5:DataFromFile>
- 0 0 1 1 2 2 3 3 4 4 5 5
+ 0 0
+ 1 1
+ 2 2
+ 3 3
+ 4 4
+ 5 5
</hdf5:DataFromFile>
</hdf5:Data>
</hdf5:Dataset>
@@ -159,7 +171,7 @@ Expected output for 'h5dump --xml tcompound2.h5'
</hdf5:StorageLayout>
<hdf5:FillValueInfo FillTime="FillIfSet" AllocationTime="Incremental">
<hdf5:FillValue>
- <hdf5:NoFill/>
+ <hdf5:NoFill/>
</hdf5:FillValue>
</hdf5:FillValueInfo>
<hdf5:Dataspace>
@@ -171,7 +183,12 @@ Expected output for 'h5dump --xml tcompound2.h5'
<!-- Note: format of compound data not specified -->
<hdf5:Data>
<hdf5:DataFromFile>
- 0 0 1 1 2 2 3 3 4 4 5 5
+ 0 0
+ 1 1
+ 2 2
+ 3 3
+ 4 4
+ 5 5
</hdf5:DataFromFile>
</hdf5:Data>
</hdf5:Dataset>
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'
-#############################
<?xml version="1.0" encoding="UTF-8"?>
-<hdf5:HDF5-File xmlns:hdf5="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">
+<hdf5:HDF5-File xmlns:hdf5="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">
<hdf5:RootGroup OBJ-XID="xid_928" H5Path="/">
<hdf5:Dataset Name="CompoundComplex" OBJ-XID="xid_976" H5Path= "/CompoundComplex" Parents="xid_928" H5ParentPaths="/">
<hdf5:StorageLayout>
<hdf5:ContiguousLayout/>
</hdf5:StorageLayout>
- <hdf5:FillValueInfo FillTime="FillOnAlloc" AllocationTime="Late">
+ <hdf5:FillValueInfo FillTime="FillOnAlloc" AllocationTime="Late">
<hdf5:FillValue>
- <hdf5:Data>
- <!-- Compound fill not yet implemented. -->
- <hdf5:NoData />
- </hdf5:Data>
+ <hdf5:Data>
+ <!-- Compound fill not yet implemented. -->
+ <hdf5:NoData />
+ </hdf5:Data>
</hdf5:FillValue>
</hdf5:FillValueInfo>
<hdf5:Dataspace>
@@ -93,36 +90,12 @@ Expected output for 'h5dump --xml tcompound_complex.h5'
<!-- Note: format of compound data not specified -->
<hdf5:Data>
<hdf5:DataFromFile>
- 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
</hdf5:DataFromFile>
</hdf5:Data>
</hdf5:Dataset>
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'
-#############################
<?xml version="1.0" encoding="UTF-8"?>
-<hdf5:HDF5-File xmlns:hdf5="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">
+<hdf5:HDF5-File xmlns:hdf5="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">
<hdf5:RootGroup OBJ-XID="xid_696" H5Path="/">
<hdf5:Dataset Name="Dataset1" OBJ-XID="xid_1284" H5Path= "/Dataset1" Parents="xid_696" H5ParentPaths="/">
<hdf5:StorageLayout>
<hdf5:ContiguousLayout/>
</hdf5:StorageLayout>
- <hdf5:FillValueInfo FillTime="FillIfSet" AllocationTime="Late">
+ <hdf5:FillValueInfo FillTime="FillIfSet" AllocationTime="Late">
<hdf5:FillValue>
- <hdf5:NoFill/>
+ <hdf5:NoFill/>
</hdf5:FillValue>
</hdf5:FillValueInfo>
<hdf5:Dataspace>
@@ -34,9 +31,9 @@ Expected output for 'h5dump --xml tdatareg.h5'
<hdf5:StorageLayout>
<hdf5:ContiguousLayout/>
</hdf5:StorageLayout>
- <hdf5:FillValueInfo FillTime="FillIfSet" AllocationTime="Late">
+ <hdf5:FillValueInfo FillTime="FillIfSet" AllocationTime="Late">
<hdf5:FillValue>
- <hdf5:NoFill/>
+ <hdf5:NoFill/>
</hdf5:FillValue>
</hdf5:FillValueInfo>
<hdf5:Dataspace>
@@ -52,16 +49,106 @@ Expected output for 'h5dump --xml tdatareg.h5'
</hdf5:DataType>
<hdf5:Data>
<hdf5:DataFromFile>
- 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
</hdf5:DataFromFile>
</hdf5:Data>
</hdf5:Dataset>
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'
-#############################
<?xml version="1.0" encoding="UTF-8"?>
-<hdf5:HDF5-File xmlns:hdf5="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">
+<hdf5:HDF5-File xmlns:hdf5="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">
<hdf5:RootGroup OBJ-XID="xid_928" H5Path="/">
<hdf5:Dataset Name="dset1" OBJ-XID="xid_976" H5Path= "/dset1" Parents="xid_928" H5ParentPaths="/">
<hdf5:StorageLayout>
<hdf5:ContiguousLayout/>
</hdf5:StorageLayout>
- <hdf5:FillValueInfo FillTime="FillIfSet" AllocationTime="Late">
+ <hdf5:FillValueInfo FillTime="FillIfSet" AllocationTime="Late">
<hdf5:FillValue>
- <hdf5:NoFill/>
+ <hdf5:NoFill/>
</hdf5:FillValue>
</hdf5:FillValueInfo>
<hdf5:Dataspace>
@@ -26,16 +23,206 @@ Expected output for 'h5dump --xml tdset.h5'
</hdf5:DataType>
<hdf5:Data>
<hdf5:DataFromFile>
- 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
</hdf5:DataFromFile>
</hdf5:Data>
</hdf5:Dataset>
@@ -43,9 +230,9 @@ Expected output for 'h5dump --xml tdset.h5'
<hdf5:StorageLayout>
<hdf5:ContiguousLayout/>
</hdf5:StorageLayout>
- <hdf5:FillValueInfo FillTime="FillIfSet" AllocationTime="Late">
+ <hdf5:FillValueInfo FillTime="FillIfSet" AllocationTime="Late">
<hdf5:FillValue>
- <hdf5:NoFill/>
+ <hdf5:NoFill/>
</hdf5:FillValue>
</hdf5:FillValueInfo>
<hdf5:Dataspace>
@@ -61,86 +248,606 @@ Expected output for 'h5dump --xml tdset.h5'
</hdf5:DataType>
<hdf5:Data>
<hdf5:DataFromFile>
- 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
</hdf5:DataFromFile>
</hdf5:Data>
</hdf5:Dataset>
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'
-#############################
<?xml version="1.0" encoding="UTF-8"?>
-<hdf5:HDF5-File xmlns:hdf5="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">
+<hdf5:HDF5-File xmlns:hdf5="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">
<hdf5:RootGroup OBJ-XID="xid_696" H5Path="/">
<hdf5:Dataset Name="dset1" OBJ-XID="xid_744" H5Path= "/dset1" Parents="xid_696" H5ParentPaths="/">
<hdf5:StorageLayout>
@@ -15,7 +12,7 @@ Expected output for 'h5dump --xml tdset2.h5'
</hdf5:StorageLayout>
<hdf5:FillValueInfo FillTime="FillIfSet" AllocationTime="Incremental">
<hdf5:FillValue>
- <hdf5:NoFill/>
+ <hdf5:NoFill/>
</hdf5:FillValue>
</hdf5:FillValueInfo>
<hdf5:Dataspace>
@@ -31,16 +28,206 @@ Expected output for 'h5dump --xml tdset2.h5'
</hdf5:DataType>
<hdf5:Data>
<hdf5:DataFromFile>
- 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
</hdf5:DataFromFile>
</hdf5:Data>
</hdf5:Dataset>
@@ -55,7 +242,7 @@ Expected output for 'h5dump --xml tdset2.h5'
</hdf5:StorageLayout>
<hdf5:FillValueInfo FillTime="FillIfSet" AllocationTime="Incremental">
<hdf5:FillValue>
- <hdf5:NoFill/>
+ <hdf5:NoFill/>
</hdf5:FillValue>
</hdf5:FillValueInfo>
<hdf5:Dataspace>
@@ -71,36 +258,306 @@ Expected output for 'h5dump --xml tdset2.h5'
</hdf5:DataType>
<hdf5:Data>
<hdf5:DataFromFile>
- 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
</hdf5:DataFromFile>
</hdf5:Data>
</hdf5:Dataset>
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'
-#############################
<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE HDF5-File PUBLIC "HDF5-File.dtd" "http://www.hdfgroup.org/DTDs/HDF5-File.dtd">
+<!DOCTYPE HDF5-File PUBLIC "HDF5-File.dtd" "http://www.hdfgroup.org/HDF5/XML/schema/HDF5-File.dtd">
<HDF5-File>
<RootGroup OBJ-XID="xid_928" H5Path="/">
<Dataset Name="Dataset1.0" OBJ-XID="xid_976" H5Path= "/Dataset1.0" Parents="xid_928" H5ParentPaths="/">
<StorageLayout>
<ContiguousLayout/>
</StorageLayout>
- <FillValueInfo FillTime="FillIfSet" AllocationTime="Late">
+ <FillValueInfo FillTime="FillIfSet" AllocationTime="Late">
<FillValue>
- <NoFill/>
+ <NoFill/>
</FillValue>
</FillValueInfo>
<Dataspace>
@@ -31,7 +28,10 @@ Expected output for 'h5dump --xml -u tempty.h5'
<!-- Note: format of VL data not specified -->
<Data>
<DataFromFile>
-
+
+
+
+
</DataFromFile>
</Data>
</Dataset>
@@ -39,9 +39,9 @@ Expected output for 'h5dump --xml -u tempty.h5'
<StorageLayout>
<ContiguousLayout/>
</StorageLayout>
- <FillValueInfo FillTime="FillIfSet" AllocationTime="Late">
+ <FillValueInfo FillTime="FillIfSet" AllocationTime="Late">
<FillValue>
- <NoFill/>
+ <NoFill/>
</FillValue>
</FillValueInfo>
<Dataspace>
@@ -56,7 +56,10 @@ Expected output for 'h5dump --xml -u tempty.h5'
</DataType>
<Data>
<DataFromFile>
- 0 0 0 0
+ 0
+ 0
+ 0
+ 0
</DataFromFile>
</Data>
</Dataset>
@@ -64,9 +67,9 @@ Expected output for 'h5dump --xml -u tempty.h5'
<StorageLayout>
<ContiguousLayout/>
</StorageLayout>
- <FillValueInfo FillTime="FillIfSet" AllocationTime="Late">
+ <FillValueInfo FillTime="FillIfSet" AllocationTime="Late">
<FillValue>
- <NoFill/>
+ <NoFill/>
</FillValue>
</FillValueInfo>
<Dataspace>
@@ -81,7 +84,10 @@ Expected output for 'h5dump --xml -u tempty.h5'
</DataType>
<Data>
<DataFromFile>
- 0 0 0 0
+ 0
+ 0
+ 0
+ 0
</DataFromFile>
</Data>
</Dataset>
@@ -89,9 +95,9 @@ Expected output for 'h5dump --xml -u tempty.h5'
<StorageLayout>
<ContiguousLayout/>
</StorageLayout>
- <FillValueInfo FillTime="FillIfSet" AllocationTime="Late">
+ <FillValueInfo FillTime="FillIfSet" AllocationTime="Late">
<FillValue>
- <NoFill/>
+ <NoFill/>
</FillValue>
</FillValueInfo>
<Dataspace>
@@ -111,7 +117,10 @@ Expected output for 'h5dump --xml -u tempty.h5'
</DataType>
<Data>
<DataFromFile>
- 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
</DataFromFile>
</Data>
</Dataset>
@@ -119,9 +128,9 @@ Expected output for 'h5dump --xml -u tempty.h5'
<StorageLayout>
<ContiguousLayout/>
</StorageLayout>
- <FillValueInfo FillTime="FillIfSet" AllocationTime="Late">
+ <FillValueInfo FillTime="FillIfSet" AllocationTime="Late">
<FillValue>
- <NoFill/>
+ <NoFill/>
</FillValue>
</FillValueInfo>
<Dataspace>
@@ -157,7 +166,10 @@ Expected output for 'h5dump --xml -u tempty.h5'
<!-- Note: format of compound data not specified -->
<Data>
<DataFromFile>
- 0 0 0 0 0 0 0 0 0 0 0 0
+ 0 0 0
+ 0 0 0
+ 0 0 0
+ 0 0 0
</DataFromFile>
</Data>
</Dataset>
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'
-#############################
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE HDF5-File PUBLIC "HDF5-File.dtd" "http://somewhere.net">
<HDF5-File>
@@ -9,9 +6,9 @@ Expected output for 'h5dump --xml --use-dtd --xml-dtd=http://somewhere.net tempt
<StorageLayout>
<ContiguousLayout/>
</StorageLayout>
- <FillValueInfo FillTime="FillIfSet" AllocationTime="Late">
+ <FillValueInfo FillTime="FillIfSet" AllocationTime="Late">
<FillValue>
- <NoFill/>
+ <NoFill/>
</FillValue>
</FillValueInfo>
<Dataspace>
@@ -31,7 +28,10 @@ Expected output for 'h5dump --xml --use-dtd --xml-dtd=http://somewhere.net tempt
<!-- Note: format of VL data not specified -->
<Data>
<DataFromFile>
-
+
+
+
+
</DataFromFile>
</Data>
</Dataset>
@@ -39,9 +39,9 @@ Expected output for 'h5dump --xml --use-dtd --xml-dtd=http://somewhere.net tempt
<StorageLayout>
<ContiguousLayout/>
</StorageLayout>
- <FillValueInfo FillTime="FillIfSet" AllocationTime="Late">
+ <FillValueInfo FillTime="FillIfSet" AllocationTime="Late">
<FillValue>
- <NoFill/>
+ <NoFill/>
</FillValue>
</FillValueInfo>
<Dataspace>
@@ -56,7 +56,10 @@ Expected output for 'h5dump --xml --use-dtd --xml-dtd=http://somewhere.net tempt
</DataType>
<Data>
<DataFromFile>
- 0 0 0 0
+ 0
+ 0
+ 0
+ 0
</DataFromFile>
</Data>
</Dataset>
@@ -64,9 +67,9 @@ Expected output for 'h5dump --xml --use-dtd --xml-dtd=http://somewhere.net tempt
<StorageLayout>
<ContiguousLayout/>
</StorageLayout>
- <FillValueInfo FillTime="FillIfSet" AllocationTime="Late">
+ <FillValueInfo FillTime="FillIfSet" AllocationTime="Late">
<FillValue>
- <NoFill/>
+ <NoFill/>
</FillValue>
</FillValueInfo>
<Dataspace>
@@ -81,7 +84,10 @@ Expected output for 'h5dump --xml --use-dtd --xml-dtd=http://somewhere.net tempt
</DataType>
<Data>
<DataFromFile>
- 0 0 0 0
+ 0
+ 0
+ 0
+ 0
</DataFromFile>
</Data>
</Dataset>
@@ -89,9 +95,9 @@ Expected output for 'h5dump --xml --use-dtd --xml-dtd=http://somewhere.net tempt
<StorageLayout>
<ContiguousLayout/>
</StorageLayout>
- <FillValueInfo FillTime="FillIfSet" AllocationTime="Late">
+ <FillValueInfo FillTime="FillIfSet" AllocationTime="Late">
<FillValue>
- <NoFill/>
+ <NoFill/>
</FillValue>
</FillValueInfo>
<Dataspace>
@@ -111,7 +117,10 @@ Expected output for 'h5dump --xml --use-dtd --xml-dtd=http://somewhere.net tempt
</DataType>
<Data>
<DataFromFile>
- 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
</DataFromFile>
</Data>
</Dataset>
@@ -119,9 +128,9 @@ Expected output for 'h5dump --xml --use-dtd --xml-dtd=http://somewhere.net tempt
<StorageLayout>
<ContiguousLayout/>
</StorageLayout>
- <FillValueInfo FillTime="FillIfSet" AllocationTime="Late">
+ <FillValueInfo FillTime="FillIfSet" AllocationTime="Late">
<FillValue>
- <NoFill/>
+ <NoFill/>
</FillValue>
</FillValueInfo>
<Dataspace>
@@ -157,7 +166,10 @@ Expected output for 'h5dump --xml --use-dtd --xml-dtd=http://somewhere.net tempt
<!-- Note: format of compound data not specified -->
<Data>
<DataFromFile>
- 0 0 0 0 0 0 0 0 0 0 0 0
+ 0 0 0
+ 0 0 0
+ 0 0 0
+ 0 0 0
</DataFromFile>
</Data>
</Dataset>
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'
-#############################
<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE HDF5-File PUBLIC "HDF5-File.dtd" "http://www.hdfgroup.org/DTDs/HDF5-File.dtd">
+<!DOCTYPE HDF5-File PUBLIC "HDF5-File.dtd" "http://www.hdfgroup.org/HDF5/XML/schema/HDF5-File.dtd">
<HDF5-File>
<RootGroup OBJ-XID="xid_928" H5Path="/">
<Dataset Name="Dataset1.0" OBJ-XID="xid_976" H5Path= "/Dataset1.0" Parents="xid_928" H5ParentPaths="/">
<StorageLayout>
<ContiguousLayout/>
</StorageLayout>
- <FillValueInfo FillTime="FillIfSet" AllocationTime="Late">
+ <FillValueInfo FillTime="FillIfSet" AllocationTime="Late">
<FillValue>
- <NoFill/>
+ <NoFill/>
</FillValue>
</FillValueInfo>
<Dataspace>
@@ -31,7 +28,10 @@ Expected output for 'h5dump --xml --use-dtd tempty.h5'
<!-- Note: format of VL data not specified -->
<Data>
<DataFromFile>
-
+
+
+
+
</DataFromFile>
</Data>
</Dataset>
@@ -39,9 +39,9 @@ Expected output for 'h5dump --xml --use-dtd tempty.h5'
<StorageLayout>
<ContiguousLayout/>
</StorageLayout>
- <FillValueInfo FillTime="FillIfSet" AllocationTime="Late">
+ <FillValueInfo FillTime="FillIfSet" AllocationTime="Late">
<FillValue>
- <NoFill/>
+ <NoFill/>
</FillValue>
</FillValueInfo>
<Dataspace>
@@ -56,7 +56,10 @@ Expected output for 'h5dump --xml --use-dtd tempty.h5'
</DataType>
<Data>
<DataFromFile>
- 0 0 0 0
+ 0
+ 0
+ 0
+ 0
</DataFromFile>
</Data>
</Dataset>
@@ -64,9 +67,9 @@ Expected output for 'h5dump --xml --use-dtd tempty.h5'
<StorageLayout>
<ContiguousLayout/>
</StorageLayout>
- <FillValueInfo FillTime="FillIfSet" AllocationTime="Late">
+ <FillValueInfo FillTime="FillIfSet" AllocationTime="Late">
<FillValue>
- <NoFill/>
+ <NoFill/>
</FillValue>
</FillValueInfo>
<Dataspace>
@@ -81,7 +84,10 @@ Expected output for 'h5dump --xml --use-dtd tempty.h5'
</DataType>
<Data>
<DataFromFile>
- 0 0 0 0
+ 0
+ 0
+ 0
+ 0
</DataFromFile>
</Data>
</Dataset>
@@ -89,9 +95,9 @@ Expected output for 'h5dump --xml --use-dtd tempty.h5'
<StorageLayout>
<ContiguousLayout/>
</StorageLayout>
- <FillValueInfo FillTime="FillIfSet" AllocationTime="Late">
+ <FillValueInfo FillTime="FillIfSet" AllocationTime="Late">
<FillValue>
- <NoFill/>
+ <NoFill/>
</FillValue>
</FillValueInfo>
<Dataspace>
@@ -111,7 +117,10 @@ Expected output for 'h5dump --xml --use-dtd tempty.h5'
</DataType>
<Data>
<DataFromFile>
- 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
</DataFromFile>
</Data>
</Dataset>
@@ -119,9 +128,9 @@ Expected output for 'h5dump --xml --use-dtd tempty.h5'
<StorageLayout>
<ContiguousLayout/>
</StorageLayout>
- <FillValueInfo FillTime="FillIfSet" AllocationTime="Late">
+ <FillValueInfo FillTime="FillIfSet" AllocationTime="Late">
<FillValue>
- <NoFill/>
+ <NoFill/>
</FillValue>
</FillValueInfo>
<Dataspace>
@@ -157,7 +166,10 @@ Expected output for 'h5dump --xml --use-dtd tempty.h5'
<!-- Note: format of compound data not specified -->
<Data>
<DataFromFile>
- 0 0 0 0 0 0 0 0 0 0 0 0
+ 0 0 0
+ 0 0 0
+ 0 0 0
+ 0 0 0
</DataFromFile>
</Data>
</Dataset>
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'
-#############################
<?xml version="1.0" encoding="UTF-8"?>
-<HDF5-File xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="http://www.hdfgroup.org/DTDs/HDF5-File.xsd">
+<HDF5-File xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="http://www.hdfgroup.org/HDF5/XML/schema/HDF5-File.xsd">
<RootGroup OBJ-XID="xid_928" H5Path="/">
<Dataset Name="Dataset1.0" OBJ-XID="xid_976" H5Path= "/Dataset1.0" Parents="xid_928" H5ParentPaths="/">
<StorageLayout>
<ContiguousLayout/>
</StorageLayout>
- <FillValueInfo FillTime="FillIfSet" AllocationTime="Late">
+ <FillValueInfo FillTime="FillIfSet" AllocationTime="Late">
<FillValue>
- <NoFill/>
+ <NoFill/>
</FillValue>
</FillValueInfo>
<Dataspace>
@@ -30,7 +27,10 @@ Expected output for 'h5dump --xml --xml-ns=: tempty.h5'
<!-- Note: format of VL data not specified -->
<Data>
<DataFromFile>
-
+
+
+
+
</DataFromFile>
</Data>
</Dataset>
@@ -38,9 +38,9 @@ Expected output for 'h5dump --xml --xml-ns=: tempty.h5'
<StorageLayout>
<ContiguousLayout/>
</StorageLayout>
- <FillValueInfo FillTime="FillIfSet" AllocationTime="Late">
+ <FillValueInfo FillTime="FillIfSet" AllocationTime="Late">
<FillValue>
- <NoFill/>
+ <NoFill/>
</FillValue>
</FillValueInfo>
<Dataspace>
@@ -55,7 +55,10 @@ Expected output for 'h5dump --xml --xml-ns=: tempty.h5'
</DataType>
<Data>
<DataFromFile>
- 0 0 0 0
+ 0
+ 0
+ 0
+ 0
</DataFromFile>
</Data>
</Dataset>
@@ -63,9 +66,9 @@ Expected output for 'h5dump --xml --xml-ns=: tempty.h5'
<StorageLayout>
<ContiguousLayout/>
</StorageLayout>
- <FillValueInfo FillTime="FillIfSet" AllocationTime="Late">
+ <FillValueInfo FillTime="FillIfSet" AllocationTime="Late">
<FillValue>
- <NoFill/>
+ <NoFill/>
</FillValue>
</FillValueInfo>
<Dataspace>
@@ -80,7 +83,10 @@ Expected output for 'h5dump --xml --xml-ns=: tempty.h5'
</DataType>
<Data>
<DataFromFile>
- 0 0 0 0
+ 0
+ 0
+ 0
+ 0
</DataFromFile>
</Data>
</Dataset>
@@ -88,9 +94,9 @@ Expected output for 'h5dump --xml --xml-ns=: tempty.h5'
<StorageLayout>
<ContiguousLayout/>
</StorageLayout>
- <FillValueInfo FillTime="FillIfSet" AllocationTime="Late">
+ <FillValueInfo FillTime="FillIfSet" AllocationTime="Late">
<FillValue>
- <NoFill/>
+ <NoFill/>
</FillValue>
</FillValueInfo>
<Dataspace>
@@ -110,7 +116,10 @@ Expected output for 'h5dump --xml --xml-ns=: tempty.h5'
</DataType>
<Data>
<DataFromFile>
- 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
</DataFromFile>
</Data>
</Dataset>
@@ -118,9 +127,9 @@ Expected output for 'h5dump --xml --xml-ns=: tempty.h5'
<StorageLayout>
<ContiguousLayout/>
</StorageLayout>
- <FillValueInfo FillTime="FillIfSet" AllocationTime="Late">
+ <FillValueInfo FillTime="FillIfSet" AllocationTime="Late">
<FillValue>
- <NoFill/>
+ <NoFill/>
</FillValue>
</FillValueInfo>
<Dataspace>
@@ -156,7 +165,10 @@ Expected output for 'h5dump --xml --xml-ns=: tempty.h5'
<!-- Note: format of compound data not specified -->
<Data>
<DataFromFile>
- 0 0 0 0 0 0 0 0 0 0 0 0
+ 0 0 0
+ 0 0 0
+ 0 0 0
+ 0 0 0
</DataFromFile>
</Data>
</Dataset>
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'
-#############################
<?xml version="1.0" encoding="UTF-8"?>
<HDF5-File xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="http://somewhere.net">
<RootGroup OBJ-XID="xid_928" H5Path="/">
@@ -8,9 +5,9 @@ Expected output for 'h5dump --xml --xml-ns=: --xml-dtd=http://somewhere.net temp
<StorageLayout>
<ContiguousLayout/>
</StorageLayout>
- <FillValueInfo FillTime="FillIfSet" AllocationTime="Late">
+ <FillValueInfo FillTime="FillIfSet" AllocationTime="Late">
<FillValue>
- <NoFill/>
+ <NoFill/>
</FillValue>
</FillValueInfo>
<Dataspace>
@@ -30,7 +27,10 @@ Expected output for 'h5dump --xml --xml-ns=: --xml-dtd=http://somewhere.net temp
<!-- Note: format of VL data not specified -->
<Data>
<DataFromFile>
-
+
+
+
+
</DataFromFile>
</Data>
</Dataset>
@@ -38,9 +38,9 @@ Expected output for 'h5dump --xml --xml-ns=: --xml-dtd=http://somewhere.net temp
<StorageLayout>
<ContiguousLayout/>
</StorageLayout>
- <FillValueInfo FillTime="FillIfSet" AllocationTime="Late">
+ <FillValueInfo FillTime="FillIfSet" AllocationTime="Late">
<FillValue>
- <NoFill/>
+ <NoFill/>
</FillValue>
</FillValueInfo>
<Dataspace>
@@ -55,7 +55,10 @@ Expected output for 'h5dump --xml --xml-ns=: --xml-dtd=http://somewhere.net temp
</DataType>
<Data>
<DataFromFile>
- 0 0 0 0
+ 0
+ 0
+ 0
+ 0
</DataFromFile>
</Data>
</Dataset>
@@ -63,9 +66,9 @@ Expected output for 'h5dump --xml --xml-ns=: --xml-dtd=http://somewhere.net temp
<StorageLayout>
<ContiguousLayout/>
</StorageLayout>
- <FillValueInfo FillTime="FillIfSet" AllocationTime="Late">
+ <FillValueInfo FillTime="FillIfSet" AllocationTime="Late">
<FillValue>
- <NoFill/>
+ <NoFill/>
</FillValue>
</FillValueInfo>
<Dataspace>
@@ -80,7 +83,10 @@ Expected output for 'h5dump --xml --xml-ns=: --xml-dtd=http://somewhere.net temp
</DataType>
<Data>
<DataFromFile>
- 0 0 0 0
+ 0
+ 0
+ 0
+ 0
</DataFromFile>
</Data>
</Dataset>
@@ -88,9 +94,9 @@ Expected output for 'h5dump --xml --xml-ns=: --xml-dtd=http://somewhere.net temp
<StorageLayout>
<ContiguousLayout/>
</StorageLayout>
- <FillValueInfo FillTime="FillIfSet" AllocationTime="Late">
+ <FillValueInfo FillTime="FillIfSet" AllocationTime="Late">
<FillValue>
- <NoFill/>
+ <NoFill/>
</FillValue>
</FillValueInfo>
<Dataspace>
@@ -110,7 +116,10 @@ Expected output for 'h5dump --xml --xml-ns=: --xml-dtd=http://somewhere.net temp
</DataType>
<Data>
<DataFromFile>
- 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
</DataFromFile>
</Data>
</Dataset>
@@ -118,9 +127,9 @@ Expected output for 'h5dump --xml --xml-ns=: --xml-dtd=http://somewhere.net temp
<StorageLayout>
<ContiguousLayout/>
</StorageLayout>
- <FillValueInfo FillTime="FillIfSet" AllocationTime="Late">
+ <FillValueInfo FillTime="FillIfSet" AllocationTime="Late">
<FillValue>
- <NoFill/>
+ <NoFill/>
</FillValue>
</FillValueInfo>
<Dataspace>
@@ -156,7 +165,10 @@ Expected output for 'h5dump --xml --xml-ns=: --xml-dtd=http://somewhere.net temp
<!-- Note: format of compound data not specified -->
<Data>
<DataFromFile>
- 0 0 0 0 0 0 0 0 0 0 0 0
+ 0 0 0
+ 0 0 0
+ 0 0 0
+ 0 0 0
</DataFromFile>
</Data>
</Dataset>
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'
-#############################
<?xml version="1.0" encoding="UTF-8"?>
-<HDF5-File xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="http://www.hdfgroup.org/DTDs/HDF5-File.xsd">
+<HDF5-File xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="http://www.hdfgroup.org/HDF5/XML/schema/HDF5-File.xsd">
<RootGroup OBJ-XID="xid_928" H5Path="/">
<Dataset Name="Dataset1.0" OBJ-XID="xid_976" H5Path= "/Dataset1.0" Parents="xid_928" H5ParentPaths="/">
<StorageLayout>
<ContiguousLayout/>
</StorageLayout>
- <FillValueInfo FillTime="FillIfSet" AllocationTime="Late">
+ <FillValueInfo FillTime="FillIfSet" AllocationTime="Late">
<FillValue>
- <NoFill/>
+ <NoFill/>
</FillValue>
</FillValueInfo>
<Dataspace>
@@ -30,7 +27,10 @@ Expected output for 'h5dump --xml -X : tempty.h5'
<!-- Note: format of VL data not specified -->
<Data>
<DataFromFile>
-
+
+
+
+
</DataFromFile>
</Data>
</Dataset>
@@ -38,9 +38,9 @@ Expected output for 'h5dump --xml -X : tempty.h5'
<StorageLayout>
<ContiguousLayout/>
</StorageLayout>
- <FillValueInfo FillTime="FillIfSet" AllocationTime="Late">
+ <FillValueInfo FillTime="FillIfSet" AllocationTime="Late">
<FillValue>
- <NoFill/>
+ <NoFill/>
</FillValue>
</FillValueInfo>
<Dataspace>
@@ -55,7 +55,10 @@ Expected output for 'h5dump --xml -X : tempty.h5'
</DataType>
<Data>
<DataFromFile>
- 0 0 0 0
+ 0
+ 0
+ 0
+ 0
</DataFromFile>
</Data>
</Dataset>
@@ -63,9 +66,9 @@ Expected output for 'h5dump --xml -X : tempty.h5'
<StorageLayout>
<ContiguousLayout/>
</StorageLayout>
- <FillValueInfo FillTime="FillIfSet" AllocationTime="Late">
+ <FillValueInfo FillTime="FillIfSet" AllocationTime="Late">
<FillValue>
- <NoFill/>
+ <NoFill/>
</FillValue>
</FillValueInfo>
<Dataspace>
@@ -80,7 +83,10 @@ Expected output for 'h5dump --xml -X : tempty.h5'
</DataType>
<Data>
<DataFromFile>
- 0 0 0 0
+ 0
+ 0
+ 0
+ 0
</DataFromFile>
</Data>
</Dataset>
@@ -88,9 +94,9 @@ Expected output for 'h5dump --xml -X : tempty.h5'
<StorageLayout>
<ContiguousLayout/>
</StorageLayout>
- <FillValueInfo FillTime="FillIfSet" AllocationTime="Late">
+ <FillValueInfo FillTime="FillIfSet" AllocationTime="Late">
<FillValue>
- <NoFill/>
+ <NoFill/>
</FillValue>
</FillValueInfo>
<Dataspace>
@@ -110,7 +116,10 @@ Expected output for 'h5dump --xml -X : tempty.h5'
</DataType>
<Data>
<DataFromFile>
- 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
</DataFromFile>
</Data>
</Dataset>
@@ -118,9 +127,9 @@ Expected output for 'h5dump --xml -X : tempty.h5'
<StorageLayout>
<ContiguousLayout/>
</StorageLayout>
- <FillValueInfo FillTime="FillIfSet" AllocationTime="Late">
+ <FillValueInfo FillTime="FillIfSet" AllocationTime="Late">
<FillValue>
- <NoFill/>
+ <NoFill/>
</FillValue>
</FillValueInfo>
<Dataspace>
@@ -156,7 +165,10 @@ Expected output for 'h5dump --xml -X : tempty.h5'
<!-- Note: format of compound data not specified -->
<Data>
<DataFromFile>
- 0 0 0 0 0 0 0 0 0 0 0 0
+ 0 0 0
+ 0 0 0
+ 0 0 0
+ 0 0 0
</DataFromFile>
</Data>
</Dataset>
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'
-#############################
<?xml version="1.0" encoding="UTF-8"?>
-<thing:HDF5-File xmlns:thing="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">
+<thing:HDF5-File xmlns:thing="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">
<thing:RootGroup OBJ-XID="xid_928" H5Path="/">
<thing:Dataset Name="Dataset1.0" OBJ-XID="xid_976" H5Path= "/Dataset1.0" Parents="xid_928" H5ParentPaths="/">
<thing:StorageLayout>
<thing:ContiguousLayout/>
</thing:StorageLayout>
- <thing:FillValueInfo FillTime="FillIfSet" AllocationTime="Late">
+ <thing:FillValueInfo FillTime="FillIfSet" AllocationTime="Late">
<thing:FillValue>
- <thing:NoFill/>
+ <thing:NoFill/>
</thing:FillValue>
</thing:FillValueInfo>
<thing:Dataspace>
@@ -30,7 +27,10 @@ Expected output for 'h5dump --xml --xml-ns=thing: tempty.h5'
<!-- Note: format of VL data not specified -->
<thing:Data>
<thing:DataFromFile>
-
+
+
+
+
</thing:DataFromFile>
</thing:Data>
</thing:Dataset>
@@ -38,9 +38,9 @@ Expected output for 'h5dump --xml --xml-ns=thing: tempty.h5'
<thing:StorageLayout>
<thing:ContiguousLayout/>
</thing:StorageLayout>
- <thing:FillValueInfo FillTime="FillIfSet" AllocationTime="Late">
+ <thing:FillValueInfo FillTime="FillIfSet" AllocationTime="Late">
<thing:FillValue>
- <thing:NoFill/>
+ <thing:NoFill/>
</thing:FillValue>
</thing:FillValueInfo>
<thing:Dataspace>
@@ -55,7 +55,10 @@ Expected output for 'h5dump --xml --xml-ns=thing: tempty.h5'
</thing:DataType>
<thing:Data>
<thing:DataFromFile>
- 0 0 0 0
+ 0
+ 0
+ 0
+ 0
</thing:DataFromFile>
</thing:Data>
</thing:Dataset>
@@ -63,9 +66,9 @@ Expected output for 'h5dump --xml --xml-ns=thing: tempty.h5'
<thing:StorageLayout>
<thing:ContiguousLayout/>
</thing:StorageLayout>
- <thing:FillValueInfo FillTime="FillIfSet" AllocationTime="Late">
+ <thing:FillValueInfo FillTime="FillIfSet" AllocationTime="Late">
<thing:FillValue>
- <thing:NoFill/>
+ <thing:NoFill/>
</thing:FillValue>
</thing:FillValueInfo>
<thing:Dataspace>
@@ -80,7 +83,10 @@ Expected output for 'h5dump --xml --xml-ns=thing: tempty.h5'
</thing:DataType>
<thing:Data>
<thing:DataFromFile>
- 0 0 0 0
+ 0
+ 0
+ 0
+ 0
</thing:DataFromFile>
</thing:Data>
</thing:Dataset>
@@ -88,9 +94,9 @@ Expected output for 'h5dump --xml --xml-ns=thing: tempty.h5'
<thing:StorageLayout>
<thing:ContiguousLayout/>
</thing:StorageLayout>
- <thing:FillValueInfo FillTime="FillIfSet" AllocationTime="Late">
+ <thing:FillValueInfo FillTime="FillIfSet" AllocationTime="Late">
<thing:FillValue>
- <thing:NoFill/>
+ <thing:NoFill/>
</thing:FillValue>
</thing:FillValueInfo>
<thing:Dataspace>
@@ -110,7 +116,10 @@ Expected output for 'h5dump --xml --xml-ns=thing: tempty.h5'
</thing:DataType>
<thing:Data>
<thing:DataFromFile>
- 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
</thing:DataFromFile>
</thing:Data>
</thing:Dataset>
@@ -118,9 +127,9 @@ Expected output for 'h5dump --xml --xml-ns=thing: tempty.h5'
<thing:StorageLayout>
<thing:ContiguousLayout/>
</thing:StorageLayout>
- <thing:FillValueInfo FillTime="FillIfSet" AllocationTime="Late">
+ <thing:FillValueInfo FillTime="FillIfSet" AllocationTime="Late">
<thing:FillValue>
- <thing:NoFill/>
+ <thing:NoFill/>
</thing:FillValue>
</thing:FillValueInfo>
<thing:Dataspace>
@@ -156,7 +165,10 @@ Expected output for 'h5dump --xml --xml-ns=thing: tempty.h5'
<!-- Note: format of compound data not specified -->
<thing:Data>
<thing:DataFromFile>
- 0 0 0 0 0 0 0 0 0 0 0 0
+ 0 0 0
+ 0 0 0
+ 0 0 0
+ 0 0 0
</thing:DataFromFile>
</thing:Data>
</thing:Dataset>
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'
-#############################
<?xml version="1.0" encoding="UTF-8"?>
-<thing:HDF5-File xmlns:thing="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">
+<thing:HDF5-File xmlns:thing="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">
<thing:RootGroup OBJ-XID="xid_928" H5Path="/">
<thing:Dataset Name="Dataset1.0" OBJ-XID="xid_976" H5Path= "/Dataset1.0" Parents="xid_928" H5ParentPaths="/">
<thing:StorageLayout>
<thing:ContiguousLayout/>
</thing:StorageLayout>
- <thing:FillValueInfo FillTime="FillIfSet" AllocationTime="Late">
+ <thing:FillValueInfo FillTime="FillIfSet" AllocationTime="Late">
<thing:FillValue>
- <thing:NoFill/>
+ <thing:NoFill/>
</thing:FillValue>
</thing:FillValueInfo>
<thing:Dataspace>
@@ -30,7 +27,10 @@ Expected output for 'h5dump --xml -X thing: tempty.h5'
<!-- Note: format of VL data not specified -->
<thing:Data>
<thing:DataFromFile>
-
+
+
+
+
</thing:DataFromFile>
</thing:Data>
</thing:Dataset>
@@ -38,9 +38,9 @@ Expected output for 'h5dump --xml -X thing: tempty.h5'
<thing:StorageLayout>
<thing:ContiguousLayout/>
</thing:StorageLayout>
- <thing:FillValueInfo FillTime="FillIfSet" AllocationTime="Late">
+ <thing:FillValueInfo FillTime="FillIfSet" AllocationTime="Late">
<thing:FillValue>
- <thing:NoFill/>
+ <thing:NoFill/>
</thing:FillValue>
</thing:FillValueInfo>
<thing:Dataspace>
@@ -55,7 +55,10 @@ Expected output for 'h5dump --xml -X thing: tempty.h5'
</thing:DataType>
<thing:Data>
<thing:DataFromFile>
- 0 0 0 0
+ 0
+ 0
+ 0
+ 0
</thing:DataFromFile>
</thing:Data>
</thing:Dataset>
@@ -63,9 +66,9 @@ Expected output for 'h5dump --xml -X thing: tempty.h5'
<thing:StorageLayout>
<thing:ContiguousLayout/>
</thing:StorageLayout>
- <thing:FillValueInfo FillTime="FillIfSet" AllocationTime="Late">
+ <thing:FillValueInfo FillTime="FillIfSet" AllocationTime="Late">
<thing:FillValue>
- <thing:NoFill/>
+ <thing:NoFill/>
</thing:FillValue>
</thing:FillValueInfo>
<thing:Dataspace>
@@ -80,7 +83,10 @@ Expected output for 'h5dump --xml -X thing: tempty.h5'
</thing:DataType>
<thing:Data>
<thing:DataFromFile>
- 0 0 0 0
+ 0
+ 0
+ 0
+ 0
</thing:DataFromFile>
</thing:Data>
</thing:Dataset>
@@ -88,9 +94,9 @@ Expected output for 'h5dump --xml -X thing: tempty.h5'
<thing:StorageLayout>
<thing:ContiguousLayout/>
</thing:StorageLayout>
- <thing:FillValueInfo FillTime="FillIfSet" AllocationTime="Late">
+ <thing:FillValueInfo FillTime="FillIfSet" AllocationTime="Late">
<thing:FillValue>
- <thing:NoFill/>
+ <thing:NoFill/>
</thing:FillValue>
</thing:FillValueInfo>
<thing:Dataspace>
@@ -110,7 +116,10 @@ Expected output for 'h5dump --xml -X thing: tempty.h5'
</thing:DataType>
<thing:Data>
<thing:DataFromFile>
- 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
</thing:DataFromFile>
</thing:Data>
</thing:Dataset>
@@ -118,9 +127,9 @@ Expected output for 'h5dump --xml -X thing: tempty.h5'
<thing:StorageLayout>
<thing:ContiguousLayout/>
</thing:StorageLayout>
- <thing:FillValueInfo FillTime="FillIfSet" AllocationTime="Late">
+ <thing:FillValueInfo FillTime="FillIfSet" AllocationTime="Late">
<thing:FillValue>
- <thing:NoFill/>
+ <thing:NoFill/>
</thing:FillValue>
</thing:FillValueInfo>
<thing:Dataspace>
@@ -156,7 +165,10 @@ Expected output for 'h5dump --xml -X thing: tempty.h5'
<!-- Note: format of compound data not specified -->
<thing:Data>
<thing:DataFromFile>
- 0 0 0 0 0 0 0 0 0 0 0 0
+ 0 0 0
+ 0 0 0
+ 0 0 0
+ 0 0 0
</thing:DataFromFile>
</thing:Data>
</thing:Dataset>
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'
-#############################
<?xml version="1.0" encoding="UTF-8"?>
-<hdf5:HDF5-File xmlns:hdf5="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">
+<hdf5:HDF5-File xmlns:hdf5="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">
<hdf5:RootGroup OBJ-XID="xid_928" H5Path="/">
<hdf5:Dataset Name="Dataset1.0" OBJ-XID="xid_976" H5Path= "/Dataset1.0" Parents="xid_928" H5ParentPaths="/">
<hdf5:StorageLayout>
<hdf5:ContiguousLayout/>
</hdf5:StorageLayout>
- <hdf5:FillValueInfo FillTime="FillIfSet" AllocationTime="Late">
+ <hdf5:FillValueInfo FillTime="FillIfSet" AllocationTime="Late">
<hdf5:FillValue>
- <hdf5:NoFill/>
+ <hdf5:NoFill/>
</hdf5:FillValue>
</hdf5:FillValueInfo>
<hdf5:Dataspace>
@@ -30,7 +27,10 @@ Expected output for 'h5dump --xml tempty.h5'
<!-- Note: format of VL data not specified -->
<hdf5:Data>
<hdf5:DataFromFile>
-
+
+
+
+
</hdf5:DataFromFile>
</hdf5:Data>
</hdf5:Dataset>
@@ -38,9 +38,9 @@ Expected output for 'h5dump --xml tempty.h5'
<hdf5:StorageLayout>
<hdf5:ContiguousLayout/>
</hdf5:StorageLayout>
- <hdf5:FillValueInfo FillTime="FillIfSet" AllocationTime="Late">
+ <hdf5:FillValueInfo FillTime="FillIfSet" AllocationTime="Late">
<hdf5:FillValue>
- <hdf5:NoFill/>
+ <hdf5:NoFill/>
</hdf5:FillValue>
</hdf5:FillValueInfo>
<hdf5:Dataspace>
@@ -55,7 +55,10 @@ Expected output for 'h5dump --xml tempty.h5'
</hdf5:DataType>
<hdf5:Data>
<hdf5:DataFromFile>
- 0 0 0 0
+ 0
+ 0
+ 0
+ 0
</hdf5:DataFromFile>
</hdf5:Data>
</hdf5:Dataset>
@@ -63,9 +66,9 @@ Expected output for 'h5dump --xml tempty.h5'
<hdf5:StorageLayout>
<hdf5:ContiguousLayout/>
</hdf5:StorageLayout>
- <hdf5:FillValueInfo FillTime="FillIfSet" AllocationTime="Late">
+ <hdf5:FillValueInfo FillTime="FillIfSet" AllocationTime="Late">
<hdf5:FillValue>
- <hdf5:NoFill/>
+ <hdf5:NoFill/>
</hdf5:FillValue>
</hdf5:FillValueInfo>
<hdf5:Dataspace>
@@ -80,7 +83,10 @@ Expected output for 'h5dump --xml tempty.h5'
</hdf5:DataType>
<hdf5:Data>
<hdf5:DataFromFile>
- 0 0 0 0
+ 0
+ 0
+ 0
+ 0
</hdf5:DataFromFile>
</hdf5:Data>
</hdf5:Dataset>
@@ -88,9 +94,9 @@ Expected output for 'h5dump --xml tempty.h5'
<hdf5:StorageLayout>
<hdf5:ContiguousLayout/>
</hdf5:StorageLayout>
- <hdf5:FillValueInfo FillTime="FillIfSet" AllocationTime="Late">
+ <hdf5:FillValueInfo FillTime="FillIfSet" AllocationTime="Late">
<hdf5:FillValue>
- <hdf5:NoFill/>
+ <hdf5:NoFill/>
</hdf5:FillValue>
</hdf5:FillValueInfo>
<hdf5:Dataspace>
@@ -110,7 +116,10 @@ Expected output for 'h5dump --xml tempty.h5'
</hdf5:DataType>
<hdf5:Data>
<hdf5:DataFromFile>
- 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
</hdf5:DataFromFile>
</hdf5:Data>
</hdf5:Dataset>
@@ -118,9 +127,9 @@ Expected output for 'h5dump --xml tempty.h5'
<hdf5:StorageLayout>
<hdf5:ContiguousLayout/>
</hdf5:StorageLayout>
- <hdf5:FillValueInfo FillTime="FillIfSet" AllocationTime="Late">
+ <hdf5:FillValueInfo FillTime="FillIfSet" AllocationTime="Late">
<hdf5:FillValue>
- <hdf5:NoFill/>
+ <hdf5:NoFill/>
</hdf5:FillValue>
</hdf5:FillValueInfo>
<hdf5:Dataspace>
@@ -156,7 +165,10 @@ Expected output for 'h5dump --xml tempty.h5'
<!-- Note: format of compound data not specified -->
<hdf5:Data>
<hdf5:DataFromFile>
- 0 0 0 0 0 0 0 0 0 0 0 0
+ 0 0 0
+ 0 0 0
+ 0 0 0
+ 0 0 0
</hdf5:DataFromFile>
</hdf5:Data>
</hdf5:Dataset>
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'
-#############################
<?xml version="1.0" encoding="UTF-8"?>
-<hdf5:HDF5-File xmlns:hdf5="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">
+<hdf5:HDF5-File xmlns:hdf5="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">
<hdf5:RootGroup OBJ-XID="xid_928" H5Path="/">
<hdf5:NamedDataType Name="enum normal" OBJ-XID="xid_976" H5Path="/enum normal" Parents="xid_928" H5ParentPaths="/">
<hdf5:DataType>
@@ -52,9 +49,9 @@ green
<hdf5:StorageLayout>
<hdf5:ContiguousLayout/>
</hdf5:StorageLayout>
- <hdf5:FillValueInfo FillTime="FillIfSet" AllocationTime="Late">
+ <hdf5:FillValueInfo FillTime="FillIfSet" AllocationTime="Late">
<hdf5:FillValue>
- <hdf5:NoFill/>
+ <hdf5:NoFill/>
</hdf5:FillValue>
</hdf5:FillValueInfo>
<hdf5:Dataspace>
@@ -65,10 +62,26 @@ green
<hdf5:NamedDataTypePtr OBJ-XID="xid_976" H5Path="/enum normal" />
<hdf5:Data>
<hdf5:DataFromFile>
- 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
</hdf5:DataFromFile>
</hdf5:Data>
</hdf5:Dataset>
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'
-#############################
<?xml version="1.0" encoding="UTF-8"?>
-<hdf5:HDF5-File xmlns:hdf5="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">
+<hdf5:HDF5-File xmlns:hdf5="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">
<hdf5:RootGroup OBJ-XID="xid_96" H5Path="/">
<hdf5:ExternalLink LinkName="extlink1" OBJ-XID="xid_18446744073709551614" H5SourcePath="/extlink1" TargetFilename="filename" TargetPath="objname" Parents="xid_96" H5ParentPaths="/" />
<hdf5:ExternalLink LinkName="extlink2" OBJ-XID="xid_18446744073709551613" H5SourcePath="/extlink2" TargetFilename="anotherfile" TargetPath="anotherobj" Parents="xid_96" H5ParentPaths="/" />
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
--- a/tools/testfiles/textlinksrc.h5
+++ b/tools/testfiles/textlinksrc.h5
Binary files 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'
-#############################
<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE HDF5-File PUBLIC "HDF5-File.dtd" "http://www.hdfgroup.org/DTDs/HDF5-File.dtd">
+<!DOCTYPE HDF5-File PUBLIC "HDF5-File.dtd" "http://www.hdfgroup.org/HDF5/XML/schema/HDF5-File.dtd">
<HDF5-File>
<RootGroup OBJ-XID="xid_96" H5Path="/">
<Dataset Name="double" OBJ-XID="xid_800" H5Path= "/double" Parents="xid_96" H5ParentPaths="/">
<StorageLayout>
<ContiguousLayout/>
</StorageLayout>
- <FillValueInfo FillTime="FillIfSet" AllocationTime="Late">
+ <FillValueInfo FillTime="FillIfSet" AllocationTime="Late">
<FillValue>
- <NoFill/>
+ <NoFill/>
</FillValue>
</FillValueInfo>
<Dataspace>
@@ -26,7 +23,12 @@ Expected output for 'h5dump -u -m %.7f tfpformat.h5'
</DataType>
<Data>
<DataFromFile>
- -0.1234567 0.1234567 0.0000000 0.0000000 0.0000000 0.0000000
+ -0.1234567
+ 0.1234567
+ 0.0000000
+ 0.0000000
+ 0.0000000
+ 0.0000000
</DataFromFile>
</Data>
</Dataset>
@@ -34,9 +36,9 @@ Expected output for 'h5dump -u -m %.7f tfpformat.h5'
<StorageLayout>
<ContiguousLayout/>
</StorageLayout>
- <FillValueInfo FillTime="FillIfSet" AllocationTime="Late">
+ <FillValueInfo FillTime="FillIfSet" AllocationTime="Late">
<FillValue>
- <NoFill/>
+ <NoFill/>
</FillValue>
</FillValueInfo>
<Dataspace>
@@ -51,7 +53,12 @@ Expected output for 'h5dump -u -m %.7f tfpformat.h5'
</DataType>
<Data>
<DataFromFile>
- -0.1234567 0.1234567 0.0000000 0.0000000 0.0000000 0.0000000
+ -0.1234567
+ 0.1234567
+ 0.0000000
+ 0.0000000
+ 0.0000000
+ 0.0000000
</DataFromFile>
</Data>
</Dataset>
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'
-#############################
<?xml version="1.0" encoding="UTF-8"?>
-<hdf5:HDF5-File xmlns:hdf5="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">
+<hdf5:HDF5-File xmlns:hdf5="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">
<hdf5:RootGroup OBJ-XID="xid_696" H5Path="/">
<hdf5:Group Name="g1" OBJ-XID="xid_1344" H5Path="/g1" Parents="xid_696" H5ParentPaths="/" >
<hdf5:Group Name="g1.1" OBJ-XID="xid_3616" H5Path="/g1/g1.1" Parents="xid_1344" H5ParentPaths="/g1" >
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'
-#############################
<?xml version="1.0" encoding="UTF-8"?>
-<hdf5:HDF5-File xmlns:hdf5="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">
+<hdf5:HDF5-File xmlns:hdf5="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">
<hdf5:RootGroup OBJ-XID="xid_96" H5Path="/">
<hdf5:Dataset Name="dset1" OBJ-XID="xid_808" H5Path= "/dset1" Parents="xid_96" H5ParentPaths="/">
<hdf5:StorageLayout>
<hdf5:ContiguousLayout/>
</hdf5:StorageLayout>
- <hdf5:FillValueInfo FillTime="FillIfSet" AllocationTime="Late">
+ <hdf5:FillValueInfo FillTime="FillIfSet" AllocationTime="Late">
<hdf5:FillValue>
- <hdf5:NoFill/>
+ <hdf5:NoFill/>
</hdf5:FillValue>
</hdf5:FillValueInfo>
<hdf5:Dataspace>
@@ -25,7 +22,11 @@ Expected output for 'h5dump --xml thlink.h5'
</hdf5:DataType>
<hdf5:Data>
<hdf5:DataFromFile>
- 0 1 2 3 4
+ 0
+ 1
+ 2
+ 3
+ 4
</hdf5:DataFromFile>
</hdf5:Data>
</hdf5:Dataset>
@@ -40,10 +41,10 @@ Expected output for 'h5dump --xml thlink.h5'
</hdf5:Group>
</hdf5:Group>
<hdf5:Group Name="g2" OBJ-XID="xid_2000-3" H5Path="/g1/g1.1" Parents="xid_96" H5ParentPaths="/">
- <hdf5:GroupPtr OBJ-XID="xid_2000" H5Path="/g1/g1.1" Parents="xid_96" H5ParentPaths="/" />
+ <hdf5:GroupPtr OBJ-XID="xid_2000" H5Path="/g1/g1.1" Parents="xid_96" H5ParentPaths="/" />
</hdf5:Group>
<hdf5:Group Name="g3" OBJ-XID="xid_96-4" H5Path="/" Parents="xid_96" H5ParentPaths="/">
- <hdf5:GroupPtr OBJ-XID="xid_96" H5Path="/" Parents="xid_96" H5ParentPaths="/" />
+ <hdf5:GroupPtr OBJ-XID="xid_96" H5Path="/" Parents="xid_96" H5ParentPaths="/" />
</hdf5:Group>
</hdf5:RootGroup>
</hdf5:HDF5-File>
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'
-#############################
<?xml version="1.0" encoding="UTF-8"?>
-<hdf5:HDF5-File xmlns:hdf5="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">
+<hdf5:HDF5-File xmlns:hdf5="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">
<hdf5:RootGroup OBJ-XID="xid_696" H5Path="/">
<hdf5:Group Name="g1" OBJ-XID="xid_1344" H5Path="/g1" Parents="xid_696" H5ParentPaths="/" >
<hdf5:Group Name="g1.1" OBJ-XID="xid_2320" H5Path="/g1/g1.1" Parents="xid_1344" H5ParentPaths="/g1" >
<hdf5:Group Name="g2.1" OBJ-XID="xid_1344-1" H5Path="/g1" Parents="xid_2320" H5ParentPaths="/g1/g1.1">
- <hdf5:GroupPtr OBJ-XID="xid_1344" H5Path="/g1" Parents="xid_2320" H5ParentPaths="/g1/g1.1" />
+ <hdf5:GroupPtr OBJ-XID="xid_1344" H5Path="/g1" Parents="xid_2320" H5ParentPaths="/g1/g1.1" />
</hdf5:Group>
</hdf5:Group>
</hdf5:Group>
<hdf5:Group Name="g2" OBJ-XID="xid_2320-2" H5Path="/g1/g1.1" Parents="xid_696" H5ParentPaths="/">
- <hdf5:GroupPtr OBJ-XID="xid_2320" H5Path="/g1/g1.1" Parents="xid_696" H5ParentPaths="/" />
+ <hdf5:GroupPtr OBJ-XID="xid_2320" H5Path="/g1/g1.1" Parents="xid_696" H5ParentPaths="/" />
</hdf5:Group>
</hdf5:RootGroup>
</hdf5:HDF5-File>
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'
-#############################
<?xml version="1.0" encoding="UTF-8"?>
-<hdf5:HDF5-File xmlns:hdf5="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">
+<hdf5:HDF5-File xmlns:hdf5="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">
<hdf5:RootGroup OBJ-XID="xid_696" H5Path="/">
<hdf5:Group Name="g1" OBJ-XID="xid_1344" H5Path="/g1" Parents="xid_696" H5ParentPaths="/" >
<hdf5:Group Name="g1.1" OBJ-XID="xid_2320" H5Path="/g1/g1.1" Parents="xid_1344" H5ParentPaths="/g1" >
@@ -10,7 +7,7 @@ Expected output for 'h5dump --xml tloop2.h5'
</hdf5:Group>
</hdf5:Group>
<hdf5:Group Name="g2" OBJ-XID="xid_2320-1" H5Path="/g1/g1.1" Parents="xid_696" H5ParentPaths="/">
- <hdf5:GroupPtr OBJ-XID="xid_2320" H5Path="/g1/g1.1" Parents="xid_696" H5ParentPaths="/" />
+ <hdf5:GroupPtr OBJ-XID="xid_2320" H5Path="/g1/g1.1" Parents="xid_696" H5ParentPaths="/" />
</hdf5:Group>
</hdf5:RootGroup>
</hdf5:HDF5-File>
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'
-#############################
<?xml version="1.0" encoding="UTF-8"?>
-<hdf5:HDF5-File xmlns:hdf5="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">
+<hdf5:HDF5-File xmlns:hdf5="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">
<hdf5:RootGroup OBJ-XID="xid_96" H5Path="/">
<hdf5:Group Name="g1" OBJ-XID="xid_800" H5Path="/g1" Parents="xid_96" H5ParentPaths="/" >
<hdf5:Group Name="g1.1" OBJ-XID="xid_1832" H5Path="/g1/g1.1" Parents="xid_800" H5ParentPaths="/g1" >
@@ -16,7 +13,7 @@ Expected output for 'h5dump --xml tmany.h5'
</hdf5:StorageLayout>
<hdf5:FillValueInfo FillTime="FillIfSet" AllocationTime="Incremental">
<hdf5:FillValue>
- <hdf5:NoFill/>
+ <hdf5:NoFill/>
</hdf5:FillValue>
</hdf5:FillValueInfo>
<hdf5:Dataspace>
@@ -86,7 +83,16 @@ Expected output for 'h5dump --xml tmany.h5'
</hdf5:DataType>
<hdf5:Data>
<hdf5:DataFromFile>
- 97 98 99 100 101 102 103 104 105 0
+ 97
+ 98
+ 99
+ 100
+ 101
+ 102
+ 103
+ 104
+ 105
+ 0
</hdf5:DataFromFile>
</hdf5:Data>
</hdf5:Attribute>
@@ -104,8 +110,10 @@ Expected output for 'h5dump --xml tmany.h5'
</hdf5:DataType>
<hdf5:Data>
<hdf5:DataFromFile>
- 0 1
- 2 3
+ 0
+ 1
+ 2
+ 3
</hdf5:DataFromFile>
</hdf5:Data>
</hdf5:Attribute>
@@ -122,145 +130,28 @@ Expected output for 'h5dump --xml tmany.h5'
</hdf5:DataType>
<hdf5:Data>
<hdf5:DataFromFile>
- 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
</hdf5:DataFromFile>
</hdf5:Data>
</hdf5:Attribute>
<!-- Note: format of compound data not specified -->
<hdf5:Data>
<hdf5:DataFromFile>
- 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
</hdf5:DataFromFile>
</hdf5:Data>
</hdf5:Dataset>
@@ -279,9 +170,9 @@ Expected output for 'h5dump --xml tmany.h5'
<hdf5:StorageLayout>
<hdf5:ContiguousLayout/>
</hdf5:StorageLayout>
- <hdf5:FillValueInfo FillTime="FillIfSet" AllocationTime="Late">
+ <hdf5:FillValueInfo FillTime="FillIfSet" AllocationTime="Late">
<hdf5:FillValue>
- <hdf5:NoFill/>
+ <hdf5:NoFill/>
</hdf5:FillValue>
</hdf5:FillValueInfo>
<hdf5:Dataspace>
@@ -297,16 +188,106 @@ Expected output for 'h5dump --xml tmany.h5'
</hdf5:DataType>
<hdf5:Data>
<hdf5:DataFromFile>
- 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
</hdf5:DataFromFile>
</hdf5:Data>
</hdf5:Dataset>
@@ -324,9 +305,9 @@ Expected output for 'h5dump --xml tmany.h5'
<hdf5:StorageLayout>
<hdf5:ContiguousLayout/>
</hdf5:StorageLayout>
- <hdf5:FillValueInfo FillTime="FillIfSet" AllocationTime="Late">
+ <hdf5:FillValueInfo FillTime="FillIfSet" AllocationTime="Late">
<hdf5:FillValue>
- <hdf5:NoFill/>
+ <hdf5:NoFill/>
</hdf5:FillValue>
</hdf5:FillValueInfo>
<hdf5:Dataspace>
@@ -342,16 +323,106 @@ Expected output for 'h5dump --xml tmany.h5'
</hdf5:DataType>
<hdf5:Data>
<hdf5:DataFromFile>
- 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
</hdf5:DataFromFile>
</hdf5:Data>
</hdf5:Dataset>
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'
-#############################
<?xml version="1.0" encoding="UTF-8"?>
-<hdf5:HDF5-File xmlns:hdf5="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">
+<hdf5:HDF5-File xmlns:hdf5="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">
<hdf5:RootGroup OBJ-XID="xid_696" H5Path="/">
<hdf5:Attribute Name="attr1&amp;withamp">
<hdf5:Dataspace>
@@ -17,7 +14,16 @@ Expected output for 'h5dump --xml tname-amp.h5'
</hdf5:DataType>
<hdf5:Data>
<hdf5:DataFromFile>
- 97 98 99 100 101 102 103 104 105 0
+ 97
+ 98
+ 99
+ 100
+ 101
+ 102
+ 103
+ 104
+ 105
+ 0
</hdf5:DataFromFile>
</hdf5:Data>
</hdf5:Attribute>
@@ -26,9 +32,9 @@ Expected output for 'h5dump --xml tname-amp.h5'
<hdf5:StorageLayout>
<hdf5:ContiguousLayout/>
</hdf5:StorageLayout>
- <hdf5:FillValueInfo FillTime="FillIfSet" AllocationTime="Late">
+ <hdf5:FillValueInfo FillTime="FillIfSet" AllocationTime="Late">
<hdf5:FillValue>
- <hdf5:NoFill/>
+ <hdf5:NoFill/>
</hdf5:FillValue>
</hdf5:FillValueInfo>
<hdf5:Dataspace>
@@ -44,16 +50,106 @@ Expected output for 'h5dump --xml tname-amp.h5'
</hdf5:DataType>
<hdf5:Data>
<hdf5:DataFromFile>
- 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
</hdf5:DataFromFile>
</hdf5:Data>
</hdf5:Dataset>
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'
-#############################
<?xml version="1.0" encoding="UTF-8"?>
-<hdf5:HDF5-File xmlns:hdf5="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">
+<hdf5:HDF5-File xmlns:hdf5="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">
<hdf5:RootGroup OBJ-XID="xid_696" H5Path="/">
<hdf5:Attribute Name="attr1&apos;withapos">
<hdf5:Dataspace>
@@ -17,7 +14,16 @@ Expected output for 'h5dump --xml tname-apos.h5'
</hdf5:DataType>
<hdf5:Data>
<hdf5:DataFromFile>
- 97 98 99 100 101 102 103 104 105 0
+ 97
+ 98
+ 99
+ 100
+ 101
+ 102
+ 103
+ 104
+ 105
+ 0
</hdf5:DataFromFile>
</hdf5:Data>
</hdf5:Attribute>
@@ -26,9 +32,9 @@ Expected output for 'h5dump --xml tname-apos.h5'
<hdf5:StorageLayout>
<hdf5:ContiguousLayout/>
</hdf5:StorageLayout>
- <hdf5:FillValueInfo FillTime="FillIfSet" AllocationTime="Late">
+ <hdf5:FillValueInfo FillTime="FillIfSet" AllocationTime="Late">
<hdf5:FillValue>
- <hdf5:NoFill/>
+ <hdf5:NoFill/>
</hdf5:FillValue>
</hdf5:FillValueInfo>
<hdf5:Dataspace>
@@ -44,16 +50,106 @@ Expected output for 'h5dump --xml tname-apos.h5'
</hdf5:DataType>
<hdf5:Data>
<hdf5:DataFromFile>
- 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
</hdf5:DataFromFile>
</hdf5:Data>
</hdf5:Dataset>
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'
-#############################
<?xml version="1.0" encoding="UTF-8"?>
-<hdf5:HDF5-File xmlns:hdf5="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">
+<hdf5:HDF5-File xmlns:hdf5="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">
<hdf5:RootGroup OBJ-XID="xid_696" H5Path="/">
<hdf5:Attribute Name="attr1&gt;withgt">
<hdf5:Dataspace>
@@ -17,7 +14,16 @@ Expected output for 'h5dump --xml tname-gt.h5'
</hdf5:DataType>
<hdf5:Data>
<hdf5:DataFromFile>
- 97 98 99 100 101 102 103 104 105 0
+ 97
+ 98
+ 99
+ 100
+ 101
+ 102
+ 103
+ 104
+ 105
+ 0
</hdf5:DataFromFile>
</hdf5:Data>
</hdf5:Attribute>
@@ -26,9 +32,9 @@ Expected output for 'h5dump --xml tname-gt.h5'
<hdf5:StorageLayout>
<hdf5:ContiguousLayout/>
</hdf5:StorageLayout>
- <hdf5:FillValueInfo FillTime="FillIfSet" AllocationTime="Late">
+ <hdf5:FillValueInfo FillTime="FillIfSet" AllocationTime="Late">
<hdf5:FillValue>
- <hdf5:NoFill/>
+ <hdf5:NoFill/>
</hdf5:FillValue>
</hdf5:FillValueInfo>
<hdf5:Dataspace>
@@ -44,16 +50,106 @@ Expected output for 'h5dump --xml tname-gt.h5'
</hdf5:DataType>
<hdf5:Data>
<hdf5:DataFromFile>
- 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
</hdf5:DataFromFile>
</hdf5:Data>
</hdf5:Dataset>
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'
-#############################
<?xml version="1.0" encoding="UTF-8"?>
-<hdf5:HDF5-File xmlns:hdf5="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">
+<hdf5:HDF5-File xmlns:hdf5="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">
<hdf5:RootGroup OBJ-XID="xid_696" H5Path="/">
<hdf5:Attribute Name="attr1&lt;withlt">
<hdf5:Dataspace>
@@ -17,7 +14,16 @@ Expected output for 'h5dump --xml tname-lt.h5'
</hdf5:DataType>
<hdf5:Data>
<hdf5:DataFromFile>
- 97 98 99 100 101 102 103 104 105 0
+ 97
+ 98
+ 99
+ 100
+ 101
+ 102
+ 103
+ 104
+ 105
+ 0
</hdf5:DataFromFile>
</hdf5:Data>
</hdf5:Attribute>
@@ -26,9 +32,9 @@ Expected output for 'h5dump --xml tname-lt.h5'
<hdf5:StorageLayout>
<hdf5:ContiguousLayout/>
</hdf5:StorageLayout>
- <hdf5:FillValueInfo FillTime="FillIfSet" AllocationTime="Late">
+ <hdf5:FillValueInfo FillTime="FillIfSet" AllocationTime="Late">
<hdf5:FillValue>
- <hdf5:NoFill/>
+ <hdf5:NoFill/>
</hdf5:FillValue>
</hdf5:FillValueInfo>
<hdf5:Dataspace>
@@ -44,16 +50,106 @@ Expected output for 'h5dump --xml tname-lt.h5'
</hdf5:DataType>
<hdf5:Data>
<hdf5:DataFromFile>
- 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
</hdf5:DataFromFile>
</hdf5:Data>
</hdf5:Dataset>
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'
-#############################
<?xml version="1.0" encoding="UTF-8"?>
-<hdf5:HDF5-File xmlns:hdf5="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">
+<hdf5:HDF5-File xmlns:hdf5="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">
<hdf5:RootGroup OBJ-XID="xid_696" H5Path="/">
<hdf5:Attribute Name="attr1&quot;withquot">
<hdf5:Dataspace>
@@ -17,7 +14,16 @@ Expected output for 'h5dump --xml tname-quot.h5'
</hdf5:DataType>
<hdf5:Data>
<hdf5:DataFromFile>
- 97 98 99 100 101 102 103 104 105 0
+ 97
+ 98
+ 99
+ 100
+ 101
+ 102
+ 103
+ 104
+ 105
+ 0
</hdf5:DataFromFile>
</hdf5:Data>
</hdf5:Attribute>
@@ -26,9 +32,9 @@ Expected output for 'h5dump --xml tname-quot.h5'
<hdf5:StorageLayout>
<hdf5:ContiguousLayout/>
</hdf5:StorageLayout>
- <hdf5:FillValueInfo FillTime="FillIfSet" AllocationTime="Late">
+ <hdf5:FillValueInfo FillTime="FillIfSet" AllocationTime="Late">
<hdf5:FillValue>
- <hdf5:NoFill/>
+ <hdf5:NoFill/>
</hdf5:FillValue>
</hdf5:FillValueInfo>
<hdf5:Dataspace>
@@ -44,16 +50,106 @@ Expected output for 'h5dump --xml tname-quot.h5'
</hdf5:DataType>
<hdf5:Data>
<hdf5:DataFromFile>
- 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
</hdf5:DataFromFile>
</hdf5:Data>
</hdf5:Dataset>
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'
-#############################
<?xml version="1.0" encoding="UTF-8"?>
-<hdf5:HDF5-File xmlns:hdf5="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">
+<hdf5:HDF5-File xmlns:hdf5="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">
<hdf5:RootGroup OBJ-XID="xid_696" H5Path="/">
<hdf5:Attribute Name="attr1 withspace">
<hdf5:Dataspace>
@@ -17,7 +14,16 @@ Expected output for 'h5dump --xml tname-sp.h5'
</hdf5:DataType>
<hdf5:Data>
<hdf5:DataFromFile>
- 97 98 99 100 101 102 103 104 105 0
+ 97
+ 98
+ 99
+ 100
+ 101
+ 102
+ 103
+ 104
+ 105
+ 0
</hdf5:DataFromFile>
</hdf5:Data>
</hdf5:Attribute>
@@ -26,9 +32,9 @@ Expected output for 'h5dump --xml tname-sp.h5'
<hdf5:StorageLayout>
<hdf5:ContiguousLayout/>
</hdf5:StorageLayout>
- <hdf5:FillValueInfo FillTime="FillIfSet" AllocationTime="Late">
+ <hdf5:FillValueInfo FillTime="FillIfSet" AllocationTime="Late">
<hdf5:FillValue>
- <hdf5:NoFill/>
+ <hdf5:NoFill/>
</hdf5:FillValue>
</hdf5:FillValueInfo>
<hdf5:Dataspace>
@@ -44,16 +50,106 @@ Expected output for 'h5dump --xml tname-sp.h5'
</hdf5:DataType>
<hdf5:Data>
<hdf5:DataFromFile>
- 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
</hdf5:DataFromFile>
</hdf5:Data>
</hdf5:Dataset>
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'
-#############################
<?xml version="1.0" encoding="UTF-8"?>
-<hdf5:HDF5-File xmlns:hdf5="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">
+<hdf5:HDF5-File xmlns:hdf5="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">
<hdf5:RootGroup OBJ-XID="xid_96" H5Path="/">
<hdf5:Dataset Name="Dataset" OBJ-XID="xid_1256" H5Path= "/Dataset" Parents="xid_96" H5ParentPaths="/">
<hdf5:StorageLayout>
<hdf5:ContiguousLayout/>
</hdf5:StorageLayout>
- <hdf5:FillValueInfo FillTime="FillIfSet" AllocationTime="Late">
+ <hdf5:FillValueInfo FillTime="FillIfSet" AllocationTime="Late">
<hdf5:FillValue>
- <hdf5:NoFill/>
+ <hdf5:NoFill/>
</hdf5:FillValue>
</hdf5:FillValueInfo>
<hdf5:Dataspace>
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'
-#############################
<?xml version="1.0" encoding="UTF-8"?>
-<hdf5:HDF5-File xmlns:hdf5="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">
+<hdf5:HDF5-File xmlns:hdf5="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">
<hdf5:RootGroup OBJ-XID="xid_696" H5Path="/">
<hdf5:Dataset Name="ArrayOfStructures" OBJ-XID="xid_744" H5Path= "/ArrayOfStructures" Parents="xid_696" H5ParentPaths="/">
<hdf5:StorageLayout>
<hdf5:ContiguousLayout/>
</hdf5:StorageLayout>
- <hdf5:FillValueInfo FillTime="FillIfSet" AllocationTime="Late">
+ <hdf5:FillValueInfo FillTime="FillIfSet" AllocationTime="Late">
<hdf5:FillValue>
- <hdf5:NoFill/>
+ <hdf5:NoFill/>
</hdf5:FillValue>
</hdf5:FillValueInfo>
<hdf5:Dataspace>
@@ -71,11 +68,16 @@ Expected output for 'h5dump --xml tnestedcomp.h5'
<!-- Note: format of compound data not specified -->
<hdf5:Data>
<hdf5:DataFromFile>
- 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
</hdf5:DataFromFile>
</hdf5:Data>
</hdf5:Dataset>
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
--- /dev/null
+++ b/tools/testfiles/tno-subset.h5
Binary files 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'
-#############################
<?xml version="1.0" encoding="UTF-8"?>
-<hdf5:HDF5-File xmlns:hdf5="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">
+<hdf5:HDF5-File xmlns:hdf5="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">
<hdf5:RootGroup OBJ-XID="xid_696" H5Path="/">
<hdf5:Dataset Name="dset1" OBJ-XID="xid_744" H5Path= "/dset1" Parents="xid_696" H5ParentPaths="/">
<hdf5:StorageLayout>
<hdf5:ContiguousLayout/>
</hdf5:StorageLayout>
- <hdf5:FillValueInfo FillTime="FillIfSet" AllocationTime="Late">
+ <hdf5:FillValueInfo FillTime="FillIfSet" AllocationTime="Late">
<hdf5:FillValue>
- <hdf5:NoFill/>
+ <hdf5:NoFill/>
</hdf5:FillValue>
</hdf5:FillValueInfo>
<hdf5:Dataspace>
@@ -25,7 +22,11 @@ Expected output for 'h5dump --xml tnodata.h5'
</hdf5:DataType>
<hdf5:Data>
<hdf5:DataFromFile>
- 0 0 0 0 0
+ 0
+ 0
+ 0
+ 0
+ 0
</hdf5:DataFromFile>
</hdf5:Data>
</hdf5:Dataset>
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/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'
-#############################
<?xml version="1.0" encoding="UTF-8"?>
-<hdf5:HDF5-File xmlns:hdf5="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">
+<hdf5:HDF5-File xmlns:hdf5="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">
<hdf5:RootGroup OBJ-XID="xid_696" H5Path="/">
<hdf5:Dataset Name="Dataset3" OBJ-XID="xid_2348" H5Path= "/Dataset3" Parents="xid_696" H5ParentPaths="/">
<hdf5:StorageLayout>
<hdf5:ContiguousLayout/>
</hdf5:StorageLayout>
- <hdf5:FillValueInfo FillTime="FillIfSet" AllocationTime="Late">
+ <hdf5:FillValueInfo FillTime="FillIfSet" AllocationTime="Late">
<hdf5:FillValue>
- <hdf5:NoFill/>
+ <hdf5:NoFill/>
</hdf5:FillValue>
</hdf5:FillValueInfo>
<hdf5:Dataspace>
@@ -39,9 +36,9 @@ Expected output for 'h5dump --xml tobjref.h5'
<hdf5:StorageLayout>
<hdf5:ContiguousLayout/>
</hdf5:StorageLayout>
- <hdf5:FillValueInfo FillTime="FillIfSet" AllocationTime="Late">
+ <hdf5:FillValueInfo FillTime="FillIfSet" AllocationTime="Late">
<hdf5:FillValue>
- <hdf5:NoFill/>
+ <hdf5:NoFill/>
</hdf5:FillValue>
</hdf5:FillValueInfo>
<hdf5:Dataspace>
@@ -56,7 +53,10 @@ Expected output for 'h5dump --xml tobjref.h5'
</hdf5:DataType>
<hdf5:Data>
<hdf5:DataFromFile>
- 0 3 6 9
+ 0
+ 3
+ 6
+ 9
</hdf5:DataFromFile>
</hdf5:Data>
</hdf5:Dataset>
@@ -64,9 +64,9 @@ Expected output for 'h5dump --xml tobjref.h5'
<hdf5:StorageLayout>
<hdf5:ContiguousLayout/>
</hdf5:StorageLayout>
- <hdf5:FillValueInfo FillTime="FillIfSet" AllocationTime="Late">
+ <hdf5:FillValueInfo FillTime="FillIfSet" AllocationTime="Late">
<hdf5:FillValue>
- <hdf5:NoFill/>
+ <hdf5:NoFill/>
</hdf5:FillValue>
</hdf5:FillValueInfo>
<hdf5:Dataspace>
@@ -81,7 +81,10 @@ Expected output for 'h5dump --xml tobjref.h5'
</hdf5:DataType>
<hdf5:Data>
<hdf5:DataFromFile>
- 0 0 0 0
+ 0
+ 0
+ 0
+ 0
</hdf5:DataFromFile>
</hdf5:Data>
</hdf5:Dataset>
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'
-#############################
<?xml version="1.0" encoding="UTF-8"?>
-<hdf5:HDF5-File xmlns:hdf5="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">
+<hdf5:HDF5-File xmlns:hdf5="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">
<hdf5:RootGroup OBJ-XID="xid_696" H5Path="/">
<hdf5:Dataset Name="opaque test" OBJ-XID="xid_744" H5Path= "/opaque test" Parents="xid_696" H5ParentPaths="/">
<hdf5:StorageLayout>
<hdf5:ContiguousLayout/>
</hdf5:StorageLayout>
- <hdf5:FillValueInfo FillTime="FillIfSet" AllocationTime="Late">
+ <hdf5:FillValueInfo FillTime="FillIfSet" AllocationTime="Late">
<hdf5:FillValue>
- <hdf5:NoFill/>
+ <hdf5:NoFill/>
</hdf5:FillValue>
</hdf5:FillValueInfo>
<hdf5:Dataspace>
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'
-#############################
<?xml version="1.0" encoding="UTF-8"?>
-<hdf5:HDF5-File xmlns:hdf5="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">
+<hdf5:HDF5-File xmlns:hdf5="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">
<hdf5:RootGroup OBJ-XID="xid_96" H5Path="/">
<hdf5:Attribute Name="a">
<hdf5:Dataspace>
@@ -47,9 +44,9 @@ Expected output for 'h5dump --xml -H --sort_by=name --sort_order=ascending torde
<hdf5:StorageLayout>
<hdf5:ContiguousLayout/>
</hdf5:StorageLayout>
- <hdf5:FillValueInfo FillTime="FillIfSet" AllocationTime="Late">
+ <hdf5:FillValueInfo FillTime="FillIfSet" AllocationTime="Late">
<hdf5:FillValue>
- <hdf5:NoFill/>
+ <hdf5:NoFill/>
</hdf5:FillValue>
</hdf5:FillValueInfo>
<hdf5:Dataspace>
@@ -107,9 +104,9 @@ Expected output for 'h5dump --xml -H --sort_by=name --sort_order=ascending torde
<hdf5:StorageLayout>
<hdf5:ContiguousLayout/>
</hdf5:StorageLayout>
- <hdf5:FillValueInfo FillTime="FillIfSet" AllocationTime="Late">
+ <hdf5:FillValueInfo FillTime="FillIfSet" AllocationTime="Late">
<hdf5:FillValue>
- <hdf5:NoFill/>
+ <hdf5:NoFill/>
</hdf5:FillValue>
</hdf5:FillValueInfo>
<hdf5:Dataspace>
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'
-#############################
<?xml version="1.0" encoding="UTF-8"?>
-<hdf5:HDF5-File xmlns:hdf5="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">
+<hdf5:HDF5-File xmlns:hdf5="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">
<hdf5:RootGroup OBJ-XID="xid_96" H5Path="/">
<hdf5:Attribute Name="c">
<hdf5:Dataspace>
@@ -143,9 +140,9 @@ Expected output for 'h5dump --xml -H --sort_by=name --sort_order=descending tord
<hdf5:StorageLayout>
<hdf5:ContiguousLayout/>
</hdf5:StorageLayout>
- <hdf5:FillValueInfo FillTime="FillIfSet" AllocationTime="Late">
+ <hdf5:FillValueInfo FillTime="FillIfSet" AllocationTime="Late">
<hdf5:FillValue>
- <hdf5:NoFill/>
+ <hdf5:NoFill/>
</hdf5:FillValue>
</hdf5:FillValueInfo>
<hdf5:Dataspace>
@@ -203,9 +200,9 @@ Expected output for 'h5dump --xml -H --sort_by=name --sort_order=descending tord
<hdf5:StorageLayout>
<hdf5:ContiguousLayout/>
</hdf5:StorageLayout>
- <hdf5:FillValueInfo FillTime="FillIfSet" AllocationTime="Late">
+ <hdf5:FillValueInfo FillTime="FillIfSet" AllocationTime="Late">
<hdf5:FillValue>
- <hdf5:NoFill/>
+ <hdf5:NoFill/>
</hdf5:FillValue>
</hdf5:FillValueInfo>
<hdf5:Dataspace>
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'
-#############################
<?xml version="1.0" encoding="UTF-8"?>
-<hdf5:HDF5-File xmlns:hdf5="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">
+<hdf5:HDF5-File xmlns:hdf5="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">
<hdf5:RootGroup OBJ-XID="xid_96" H5Path="/">
<hdf5:Attribute Name="a">
<hdf5:Dataspace>
@@ -47,9 +44,9 @@ Expected output for 'h5dump --xml -H --sort_by=creation_order --sort_order=ascen
<hdf5:StorageLayout>
<hdf5:ContiguousLayout/>
</hdf5:StorageLayout>
- <hdf5:FillValueInfo FillTime="FillIfSet" AllocationTime="Late">
+ <hdf5:FillValueInfo FillTime="FillIfSet" AllocationTime="Late">
<hdf5:FillValue>
- <hdf5:NoFill/>
+ <hdf5:NoFill/>
</hdf5:FillValue>
</hdf5:FillValueInfo>
<hdf5:Dataspace>
@@ -107,9 +104,9 @@ Expected output for 'h5dump --xml -H --sort_by=creation_order --sort_order=ascen
<hdf5:StorageLayout>
<hdf5:ContiguousLayout/>
</hdf5:StorageLayout>
- <hdf5:FillValueInfo FillTime="FillIfSet" AllocationTime="Late">
+ <hdf5:FillValueInfo FillTime="FillIfSet" AllocationTime="Late">
<hdf5:FillValue>
- <hdf5:NoFill/>
+ <hdf5:NoFill/>
</hdf5:FillValue>
</hdf5:FillValueInfo>
<hdf5:Dataspace>
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'
-#############################
<?xml version="1.0" encoding="UTF-8"?>
-<hdf5:HDF5-File xmlns:hdf5="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">
+<hdf5:HDF5-File xmlns:hdf5="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">
<hdf5:RootGroup OBJ-XID="xid_96" H5Path="/">
<hdf5:Attribute Name="c">
<hdf5:Dataspace>
@@ -143,9 +140,9 @@ Expected output for 'h5dump --xml -H --sort_by=creation_order --sort_order=desce
<hdf5:StorageLayout>
<hdf5:ContiguousLayout/>
</hdf5:StorageLayout>
- <hdf5:FillValueInfo FillTime="FillIfSet" AllocationTime="Late">
+ <hdf5:FillValueInfo FillTime="FillIfSet" AllocationTime="Late">
<hdf5:FillValue>
- <hdf5:NoFill/>
+ <hdf5:NoFill/>
</hdf5:FillValue>
</hdf5:FillValueInfo>
<hdf5:Dataspace>
@@ -203,9 +200,9 @@ Expected output for 'h5dump --xml -H --sort_by=creation_order --sort_order=desce
<hdf5:StorageLayout>
<hdf5:ContiguousLayout/>
</hdf5:StorageLayout>
- <hdf5:FillValueInfo FillTime="FillIfSet" AllocationTime="Late">
+ <hdf5:FillValueInfo FillTime="FillIfSet" AllocationTime="Late">
<hdf5:FillValue>
- <hdf5:NoFill/>
+ <hdf5:NoFill/>
</hdf5:FillValue>
</hdf5:FillValueInfo>
<hdf5:Dataspace>
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'
-#############################
<?xml version="1.0" encoding="UTF-8"?>
-<hdf5:HDF5-File xmlns:hdf5="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">
+<hdf5:HDF5-File xmlns:hdf5="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">
<hdf5:RootGroup OBJ-XID="xid_696" H5Path="/">
<hdf5:Group Name="Group1" OBJ-XID="xid_1344" H5Path="/Group1" Parents="xid_696" H5ParentPaths="/" >
<hdf5:Dataset Name="Dataset space" OBJ-XID="xid_3716" H5Path= "/Group1/Dataset space" Parents="xid_1344" H5ParentPaths="/Group1">
<hdf5:StorageLayout>
<hdf5:ContiguousLayout/>
</hdf5:StorageLayout>
- <hdf5:FillValueInfo FillTime="FillIfSet" AllocationTime="Late">
+ <hdf5:FillValueInfo FillTime="FillIfSet" AllocationTime="Late">
<hdf5:FillValue>
- <hdf5:NoFill/>
+ <hdf5:NoFill/>
</hdf5:FillValue>
</hdf5:FillValueInfo>
<hdf5:Dataspace>
@@ -26,7 +23,10 @@ Expected output for 'h5dump --xml tref-escapes-at.h5'
</hdf5:DataType>
<hdf5:Data>
<hdf5:DataFromFile>
- 0 0 0 0
+ 0
+ 0
+ 0
+ 0
</hdf5:DataFromFile>
</hdf5:Data>
</hdf5:Dataset>
@@ -34,9 +34,9 @@ Expected output for 'h5dump --xml tref-escapes-at.h5'
<hdf5:StorageLayout>
<hdf5:ContiguousLayout/>
</hdf5:StorageLayout>
- <hdf5:FillValueInfo FillTime="FillIfSet" AllocationTime="Late">
+ <hdf5:FillValueInfo FillTime="FillIfSet" AllocationTime="Late">
<hdf5:FillValue>
- <hdf5:NoFill/>
+ <hdf5:NoFill/>
</hdf5:FillValue>
</hdf5:FillValueInfo>
<hdf5:Dataspace>
@@ -51,7 +51,10 @@ Expected output for 'h5dump --xml tref-escapes-at.h5'
</hdf5:DataType>
<hdf5:Data>
<hdf5:DataFromFile>
- 0 3 6 9
+ 0
+ 3
+ 6
+ 9
</hdf5:DataFromFile>
</hdf5:Data>
</hdf5:Dataset>
@@ -59,9 +62,9 @@ Expected output for 'h5dump --xml tref-escapes-at.h5'
<hdf5:StorageLayout>
<hdf5:ContiguousLayout/>
</hdf5:StorageLayout>
- <hdf5:FillValueInfo FillTime="FillIfSet" AllocationTime="Late">
+ <hdf5:FillValueInfo FillTime="FillIfSet" AllocationTime="Late">
<hdf5:FillValue>
- <hdf5:NoFill/>
+ <hdf5:NoFill/>
</hdf5:FillValue>
</hdf5:FillValueInfo>
<hdf5:Dataspace>
@@ -76,7 +79,10 @@ Expected output for 'h5dump --xml tref-escapes-at.h5'
</hdf5:DataType>
<hdf5:Data>
<hdf5:DataFromFile>
- 0 0 0 0
+ 0
+ 0
+ 0
+ 0
</hdf5:DataFromFile>
</hdf5:Data>
</hdf5:Dataset>
@@ -84,9 +90,9 @@ Expected output for 'h5dump --xml tref-escapes-at.h5'
<hdf5:StorageLayout>
<hdf5:ContiguousLayout/>
</hdf5:StorageLayout>
- <hdf5:FillValueInfo FillTime="FillIfSet" AllocationTime="Late">
+ <hdf5:FillValueInfo FillTime="FillIfSet" AllocationTime="Late">
<hdf5:FillValue>
- <hdf5:NoFill/>
+ <hdf5:NoFill/>
</hdf5:FillValue>
</hdf5:FillValueInfo>
<hdf5:Dataspace>
@@ -101,7 +107,10 @@ Expected output for 'h5dump --xml tref-escapes-at.h5'
</hdf5:DataType>
<hdf5:Data>
<hdf5:DataFromFile>
- 0 0 0 0
+ 0
+ 0
+ 0
+ 0
</hdf5:DataFromFile>
</hdf5:Data>
</hdf5:Dataset>
@@ -109,9 +118,9 @@ Expected output for 'h5dump --xml tref-escapes-at.h5'
<hdf5:StorageLayout>
<hdf5:ContiguousLayout/>
</hdf5:StorageLayout>
- <hdf5:FillValueInfo FillTime="FillIfSet" AllocationTime="Late">
+ <hdf5:FillValueInfo FillTime="FillIfSet" AllocationTime="Late">
<hdf5:FillValue>
- <hdf5:NoFill/>
+ <hdf5:NoFill/>
</hdf5:FillValue>
</hdf5:FillValueInfo>
<hdf5:Dataspace>
@@ -126,7 +135,10 @@ Expected output for 'h5dump --xml tref-escapes-at.h5'
</hdf5:DataType>
<hdf5:Data>
<hdf5:DataFromFile>
- 0 0 0 0
+ 0
+ 0
+ 0
+ 0
</hdf5:DataFromFile>
</hdf5:Data>
</hdf5:Dataset>
@@ -134,9 +146,9 @@ Expected output for 'h5dump --xml tref-escapes-at.h5'
<hdf5:StorageLayout>
<hdf5:ContiguousLayout/>
</hdf5:StorageLayout>
- <hdf5:FillValueInfo FillTime="FillIfSet" AllocationTime="Late">
+ <hdf5:FillValueInfo FillTime="FillIfSet" AllocationTime="Late">
<hdf5:FillValue>
- <hdf5:NoFill/>
+ <hdf5:NoFill/>
</hdf5:FillValue>
</hdf5:FillValueInfo>
<hdf5:Dataspace>
@@ -151,7 +163,10 @@ Expected output for 'h5dump --xml tref-escapes-at.h5'
</hdf5:DataType>
<hdf5:Data>
<hdf5:DataFromFile>
- 0 0 0 0
+ 0
+ 0
+ 0
+ 0
</hdf5:DataFromFile>
</hdf5:Data>
</hdf5:Dataset>
@@ -159,9 +174,9 @@ Expected output for 'h5dump --xml tref-escapes-at.h5'
<hdf5:StorageLayout>
<hdf5:ContiguousLayout/>
</hdf5:StorageLayout>
- <hdf5:FillValueInfo FillTime="FillIfSet" AllocationTime="Late">
+ <hdf5:FillValueInfo FillTime="FillIfSet" AllocationTime="Late">
<hdf5:FillValue>
- <hdf5:NoFill/>
+ <hdf5:NoFill/>
</hdf5:FillValue>
</hdf5:FillValueInfo>
<hdf5:Dataspace>
@@ -176,7 +191,10 @@ Expected output for 'h5dump --xml tref-escapes-at.h5'
</hdf5:DataType>
<hdf5:Data>
<hdf5:DataFromFile>
- 0 0 0 0
+ 0
+ 0
+ 0
+ 0
</hdf5:DataFromFile>
</hdf5:Data>
</hdf5:Dataset>
@@ -185,9 +203,9 @@ Expected output for 'h5dump --xml tref-escapes-at.h5'
<hdf5:StorageLayout>
<hdf5:ContiguousLayout/>
</hdf5:StorageLayout>
- <hdf5:FillValueInfo FillTime="FillIfSet" AllocationTime="Late">
+ <hdf5:FillValueInfo FillTime="FillIfSet" AllocationTime="Late">
<hdf5:FillValue>
- <hdf5:NoFill/>
+ <hdf5:NoFill/>
</hdf5:FillValue>
</hdf5:FillValueInfo>
<hdf5:Dataspace>
@@ -213,11 +231,11 @@ Expected output for 'h5dump --xml tref-escapes-at.h5'
</hdf5:ReferenceType>
</hdf5:AtomicType>
</hdf5:DataType>
- <hdf5:Data>
- <hdf5:DataFromFile>
- "/Group1/Dataset&amp;amp"
- </hdf5:DataFromFile>
- </hdf5:Data>
+ <hdf5:Data>
+ <hdf5:DataFromFile>
+ "/Group1/Dataset&amp;amp"
+ </hdf5:DataFromFile>
+ </hdf5:Data>
</hdf5:Attribute>
<hdf5:Attribute Name="reftoapos">
<hdf5:Dataspace>
@@ -232,11 +250,11 @@ Expected output for 'h5dump --xml tref-escapes-at.h5'
</hdf5:ReferenceType>
</hdf5:AtomicType>
</hdf5:DataType>
- <hdf5:Data>
- <hdf5:DataFromFile>
- "/Group1/Dataset&apos;apos"
- </hdf5:DataFromFile>
- </hdf5:Data>
+ <hdf5:Data>
+ <hdf5:DataFromFile>
+ "/Group1/Dataset&apos;apos"
+ </hdf5:DataFromFile>
+ </hdf5:Data>
</hdf5:Attribute>
<hdf5:Attribute Name="reftogt">
<hdf5:Dataspace>
@@ -251,11 +269,11 @@ Expected output for 'h5dump --xml tref-escapes-at.h5'
</hdf5:ReferenceType>
</hdf5:AtomicType>
</hdf5:DataType>
- <hdf5:Data>
- <hdf5:DataFromFile>
- "/Group1/Dataset&gt;gt"
- </hdf5:DataFromFile>
- </hdf5:Data>
+ <hdf5:Data>
+ <hdf5:DataFromFile>
+ "/Group1/Dataset&gt;gt"
+ </hdf5:DataFromFile>
+ </hdf5:Data>
</hdf5:Attribute>
<hdf5:Attribute Name="reftolt">
<hdf5:Dataspace>
@@ -270,11 +288,11 @@ Expected output for 'h5dump --xml tref-escapes-at.h5'
</hdf5:ReferenceType>
</hdf5:AtomicType>
</hdf5:DataType>
- <hdf5:Data>
- <hdf5:DataFromFile>
- "/Group1/Dataset&lt;lt"
- </hdf5:DataFromFile>
- </hdf5:Data>
+ <hdf5:Data>
+ <hdf5:DataFromFile>
+ "/Group1/Dataset&lt;lt"
+ </hdf5:DataFromFile>
+ </hdf5:Data>
</hdf5:Attribute>
<hdf5:Attribute Name="reftoquote">
<hdf5:Dataspace>
@@ -289,11 +307,11 @@ Expected output for 'h5dump --xml tref-escapes-at.h5'
</hdf5:ReferenceType>
</hdf5:AtomicType>
</hdf5:DataType>
- <hdf5:Data>
- <hdf5:DataFromFile>
- "/Group1/Dataset\"quote"
- </hdf5:DataFromFile>
- </hdf5:Data>
+ <hdf5:Data>
+ <hdf5:DataFromFile>
+ "/Group1/Dataset\"quote"
+ </hdf5:DataFromFile>
+ </hdf5:Data>
</hdf5:Attribute>
<hdf5:Attribute Name="reftoslash">
<hdf5:Dataspace>
@@ -308,11 +326,11 @@ Expected output for 'h5dump --xml tref-escapes-at.h5'
</hdf5:ReferenceType>
</hdf5:AtomicType>
</hdf5:DataType>
- <hdf5:Data>
- <hdf5:DataFromFile>
- "/Group1/Dataset\\slash"
- </hdf5:DataFromFile>
- </hdf5:Data>
+ <hdf5:Data>
+ <hdf5:DataFromFile>
+ "/Group1/Dataset\\slash"
+ </hdf5:DataFromFile>
+ </hdf5:Data>
</hdf5:Attribute>
<hdf5:Attribute Name="reftospace">
<hdf5:Dataspace>
@@ -327,11 +345,11 @@ Expected output for 'h5dump --xml tref-escapes-at.h5'
</hdf5:ReferenceType>
</hdf5:AtomicType>
</hdf5:DataType>
- <hdf5:Data>
- <hdf5:DataFromFile>
- "/Group1/Dataset space"
- </hdf5:DataFromFile>
- </hdf5:Data>
+ <hdf5:Data>
+ <hdf5:DataFromFile>
+ "/Group1/Dataset space"
+ </hdf5:DataFromFile>
+ </hdf5:Data>
</hdf5:Attribute>
<hdf5:Data>
<hdf5:DataFromFile>
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'
-#############################
<?xml version="1.0" encoding="UTF-8"?>
-<hdf5:HDF5-File xmlns:hdf5="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">
+<hdf5:HDF5-File xmlns:hdf5="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">
<hdf5:RootGroup OBJ-XID="xid_696" H5Path="/">
<hdf5:Group Name="Group1" OBJ-XID="xid_1344" H5Path="/Group1" Parents="xid_696" H5ParentPaths="/" >
<hdf5:Dataset Name="Dataset space" OBJ-XID="xid_1720" H5Path= "/Group1/Dataset space" Parents="xid_1344" H5ParentPaths="/Group1">
<hdf5:StorageLayout>
<hdf5:ContiguousLayout/>
</hdf5:StorageLayout>
- <hdf5:FillValueInfo FillTime="FillIfSet" AllocationTime="Late">
+ <hdf5:FillValueInfo FillTime="FillIfSet" AllocationTime="Late">
<hdf5:FillValue>
- <hdf5:NoFill/>
+ <hdf5:NoFill/>
</hdf5:FillValue>
</hdf5:FillValueInfo>
<hdf5:Dataspace>
@@ -26,7 +23,10 @@ Expected output for 'h5dump --xml tref-escapes.h5'
</hdf5:DataType>
<hdf5:Data>
<hdf5:DataFromFile>
- 0 0 0 0
+ 0
+ 0
+ 0
+ 0
</hdf5:DataFromFile>
</hdf5:Data>
</hdf5:Dataset>
@@ -34,9 +34,9 @@ Expected output for 'h5dump --xml tref-escapes.h5'
<hdf5:StorageLayout>
<hdf5:ContiguousLayout/>
</hdf5:StorageLayout>
- <hdf5:FillValueInfo FillTime="FillIfSet" AllocationTime="Late">
+ <hdf5:FillValueInfo FillTime="FillIfSet" AllocationTime="Late">
<hdf5:FillValue>
- <hdf5:NoFill/>
+ <hdf5:NoFill/>
</hdf5:FillValue>
</hdf5:FillValueInfo>
<hdf5:Dataspace>
@@ -51,7 +51,10 @@ Expected output for 'h5dump --xml tref-escapes.h5'
</hdf5:DataType>
<hdf5:Data>
<hdf5:DataFromFile>
- 0 3 6 9
+ 0
+ 3
+ 6
+ 9
</hdf5:DataFromFile>
</hdf5:Data>
</hdf5:Dataset>
@@ -59,9 +62,9 @@ Expected output for 'h5dump --xml tref-escapes.h5'
<hdf5:StorageLayout>
<hdf5:ContiguousLayout/>
</hdf5:StorageLayout>
- <hdf5:FillValueInfo FillTime="FillIfSet" AllocationTime="Late">
+ <hdf5:FillValueInfo FillTime="FillIfSet" AllocationTime="Late">
<hdf5:FillValue>
- <hdf5:NoFill/>
+ <hdf5:NoFill/>
</hdf5:FillValue>
</hdf5:FillValueInfo>
<hdf5:Dataspace>
@@ -76,7 +79,10 @@ Expected output for 'h5dump --xml tref-escapes.h5'
</hdf5:DataType>
<hdf5:Data>
<hdf5:DataFromFile>
- 0 0 0 0
+ 0
+ 0
+ 0
+ 0
</hdf5:DataFromFile>
</hdf5:Data>
</hdf5:Dataset>
@@ -84,9 +90,9 @@ Expected output for 'h5dump --xml tref-escapes.h5'
<hdf5:StorageLayout>
<hdf5:ContiguousLayout/>
</hdf5:StorageLayout>
- <hdf5:FillValueInfo FillTime="FillIfSet" AllocationTime="Late">
+ <hdf5:FillValueInfo FillTime="FillIfSet" AllocationTime="Late">
<hdf5:FillValue>
- <hdf5:NoFill/>
+ <hdf5:NoFill/>
</hdf5:FillValue>
</hdf5:FillValueInfo>
<hdf5:Dataspace>
@@ -101,7 +107,10 @@ Expected output for 'h5dump --xml tref-escapes.h5'
</hdf5:DataType>
<hdf5:Data>
<hdf5:DataFromFile>
- 0 0 0 0
+ 0
+ 0
+ 0
+ 0
</hdf5:DataFromFile>
</hdf5:Data>
</hdf5:Dataset>
@@ -109,9 +118,9 @@ Expected output for 'h5dump --xml tref-escapes.h5'
<hdf5:StorageLayout>
<hdf5:ContiguousLayout/>
</hdf5:StorageLayout>
- <hdf5:FillValueInfo FillTime="FillIfSet" AllocationTime="Late">
+ <hdf5:FillValueInfo FillTime="FillIfSet" AllocationTime="Late">
<hdf5:FillValue>
- <hdf5:NoFill/>
+ <hdf5:NoFill/>
</hdf5:FillValue>
</hdf5:FillValueInfo>
<hdf5:Dataspace>
@@ -126,7 +135,10 @@ Expected output for 'h5dump --xml tref-escapes.h5'
</hdf5:DataType>
<hdf5:Data>
<hdf5:DataFromFile>
- 0 0 0 0
+ 0
+ 0
+ 0
+ 0
</hdf5:DataFromFile>
</hdf5:Data>
</hdf5:Dataset>
@@ -134,9 +146,9 @@ Expected output for 'h5dump --xml tref-escapes.h5'
<hdf5:StorageLayout>
<hdf5:ContiguousLayout/>
</hdf5:StorageLayout>
- <hdf5:FillValueInfo FillTime="FillIfSet" AllocationTime="Late">
+ <hdf5:FillValueInfo FillTime="FillIfSet" AllocationTime="Late">
<hdf5:FillValue>
- <hdf5:NoFill/>
+ <hdf5:NoFill/>
</hdf5:FillValue>
</hdf5:FillValueInfo>
<hdf5:Dataspace>
@@ -151,7 +163,10 @@ Expected output for 'h5dump --xml tref-escapes.h5'
</hdf5:DataType>
<hdf5:Data>
<hdf5:DataFromFile>
- 0 0 0 0
+ 0
+ 0
+ 0
+ 0
</hdf5:DataFromFile>
</hdf5:Data>
</hdf5:Dataset>
@@ -159,9 +174,9 @@ Expected output for 'h5dump --xml tref-escapes.h5'
<hdf5:StorageLayout>
<hdf5:ContiguousLayout/>
</hdf5:StorageLayout>
- <hdf5:FillValueInfo FillTime="FillIfSet" AllocationTime="Late">
+ <hdf5:FillValueInfo FillTime="FillIfSet" AllocationTime="Late">
<hdf5:FillValue>
- <hdf5:NoFill/>
+ <hdf5:NoFill/>
</hdf5:FillValue>
</hdf5:FillValueInfo>
<hdf5:Dataspace>
@@ -176,7 +191,10 @@ Expected output for 'h5dump --xml tref-escapes.h5'
</hdf5:DataType>
<hdf5:Data>
<hdf5:DataFromFile>
- 0 0 0 0
+ 0
+ 0
+ 0
+ 0
</hdf5:DataFromFile>
</hdf5:Data>
</hdf5:Dataset>
@@ -185,9 +203,9 @@ Expected output for 'h5dump --xml tref-escapes.h5'
<hdf5:StorageLayout>
<hdf5:ContiguousLayout/>
</hdf5:StorageLayout>
- <hdf5:FillValueInfo FillTime="FillIfSet" AllocationTime="Late">
+ <hdf5:FillValueInfo FillTime="FillIfSet" AllocationTime="Late">
<hdf5:FillValue>
- <hdf5:NoFill/>
+ <hdf5:NoFill/>
</hdf5:FillValue>
</hdf5:FillValueInfo>
<hdf5:Dataspace>
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'
-#############################
<?xml version="1.0" encoding="UTF-8"?>
-<hdf5:HDF5-File xmlns:hdf5="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">
+<hdf5:HDF5-File xmlns:hdf5="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">
<hdf5:RootGroup OBJ-XID="xid_696" H5Path="/">
<hdf5:Group Name="Group1" OBJ-XID="xid_1344" H5Path="/Group1" Parents="xid_696" H5ParentPaths="/" >
<hdf5:Dataset Name="Dataset1" OBJ-XID="xid_1720" H5Path= "/Group1/Dataset1" Parents="xid_1344" H5ParentPaths="/Group1">
<hdf5:StorageLayout>
<hdf5:ContiguousLayout/>
</hdf5:StorageLayout>
- <hdf5:FillValueInfo FillTime="FillIfSet" AllocationTime="Late">
+ <hdf5:FillValueInfo FillTime="FillIfSet" AllocationTime="Late">
<hdf5:FillValue>
- <hdf5:NoFill/>
+ <hdf5:NoFill/>
</hdf5:FillValue>
</hdf5:FillValueInfo>
<hdf5:Dataspace>
@@ -26,7 +23,10 @@ Expected output for 'h5dump --xml tref.h5'
</hdf5:DataType>
<hdf5:Data>
<hdf5:DataFromFile>
- 0 3 6 9
+ 0
+ 3
+ 6
+ 9
</hdf5:DataFromFile>
</hdf5:Data>
</hdf5:Dataset>
@@ -34,9 +34,9 @@ Expected output for 'h5dump --xml tref.h5'
<hdf5:StorageLayout>
<hdf5:ContiguousLayout/>
</hdf5:StorageLayout>
- <hdf5:FillValueInfo FillTime="FillIfSet" AllocationTime="Late">
+ <hdf5:FillValueInfo FillTime="FillIfSet" AllocationTime="Late">
<hdf5:FillValue>
- <hdf5:NoFill/>
+ <hdf5:NoFill/>
</hdf5:FillValue>
</hdf5:FillValueInfo>
<hdf5:Dataspace>
@@ -51,7 +51,10 @@ Expected output for 'h5dump --xml tref.h5'
</hdf5:DataType>
<hdf5:Data>
<hdf5:DataFromFile>
- 0 0 0 0
+ 0
+ 0
+ 0
+ 0
</hdf5:DataFromFile>
</hdf5:Data>
</hdf5:Dataset>
@@ -60,9 +63,9 @@ Expected output for 'h5dump --xml tref.h5'
<hdf5:StorageLayout>
<hdf5:ContiguousLayout/>
</hdf5:StorageLayout>
- <hdf5:FillValueInfo FillTime="FillIfSet" AllocationTime="Late">
+ <hdf5:FillValueInfo FillTime="FillIfSet" AllocationTime="Late">
<hdf5:FillValue>
- <hdf5:NoFill/>
+ <hdf5:NoFill/>
</hdf5:FillValue>
</hdf5:FillValueInfo>
<hdf5:Dataspace>
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'
-#############################
<?xml version="1.0" encoding="UTF-8"?>
-<hdf5:HDF5-File xmlns:hdf5="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">
+<hdf5:HDF5-File xmlns:hdf5="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">
<hdf5:RootGroup OBJ-XID="xid_696" H5Path="/">
<hdf5:Dataset Name=".DSL_METADATA" OBJ-XID="xid_744" H5Path= "/.DSL_METADATA" Parents="xid_696" H5ParentPaths="/">
<hdf5:StorageLayout>
@@ -14,7 +11,7 @@ Expected output for 'h5dump --xml tsaf.h5'
</hdf5:StorageLayout>
<hdf5:FillValueInfo FillTime="FillIfSet" AllocationTime="Incremental">
<hdf5:FillValue>
- <hdf5:NoFill/>
+ <hdf5:NoFill/>
</hdf5:FillValue>
</hdf5:FillValueInfo>
<hdf5:Dataspace>
@@ -29,281 +26,5925 @@ Expected output for 'h5dump --xml tsaf.h5'
</hdf5:DataType>
<hdf5:Data>
<hdf5:DataFromFile>
- 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
</hdf5:DataFromFile>
</hdf5:Data>
</hdf5:Dataset>
@@ -313,9 +5954,9 @@ Expected output for 'h5dump --xml tsaf.h5'
<hdf5:StorageLayout>
<hdf5:ContiguousLayout/>
</hdf5:StorageLayout>
- <hdf5:FillValueInfo FillTime="FillIfSet" AllocationTime="Late">
+ <hdf5:FillValueInfo FillTime="FillIfSet" AllocationTime="Late">
<hdf5:FillValue>
- <hdf5:NoFill/>
+ <hdf5:NoFill/>
</hdf5:FillValue>
</hdf5:FillValueInfo>
<hdf5:Dataspace>
@@ -606,7 +6247,7 @@ Expected output for 'h5dump --xml tsaf.h5'
</hdf5:StorageLayout>
<hdf5:FillValueInfo FillTime="FillIfSet" AllocationTime="Incremental">
<hdf5:FillValue>
- <hdf5:NoFill/>
+ <hdf5:NoFill/>
</hdf5:FillValue>
</hdf5:FillValueInfo>
<hdf5:Dataspace>
@@ -670,12 +6311,30 @@ Expected output for 'h5dump --xml tsaf.h5'
<!-- Note: format of compound data not specified -->
<hdf5:Data>
<hdf5:DataFromFile>
- -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
</hdf5:DataFromFile>
</hdf5:Data>
</hdf5:Dataset>
@@ -689,7 +6348,7 @@ Expected output for 'h5dump --xml tsaf.h5'
</hdf5:StorageLayout>
<hdf5:FillValueInfo FillTime="FillIfSet" AllocationTime="Incremental">
<hdf5:FillValue>
- <hdf5:NoFill/>
+ <hdf5:NoFill/>
</hdf5:FillValue>
</hdf5:FillValueInfo>
<hdf5:Dataspace>
@@ -823,8 +6482,11 @@ Expected output for 'h5dump --xml tsaf.h5'
<!-- Note: format of compound data not specified -->
<hdf5:Data>
<hdf5:DataFromFile>
- "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
</hdf5:DataFromFile>
</hdf5:Data>
</hdf5:Dataset>
@@ -838,7 +6500,7 @@ Expected output for 'h5dump --xml tsaf.h5'
</hdf5:StorageLayout>
<hdf5:FillValueInfo FillTime="FillIfSet" AllocationTime="Incremental">
<hdf5:FillValue>
- <hdf5:NoFill/>
+ <hdf5:NoFill/>
</hdf5:FillValue>
</hdf5:FillValueInfo>
<hdf5:Dataspace>
@@ -1042,15 +6704,30 @@ Expected output for 'h5dump --xml tsaf.h5'
<!-- Note: format of compound data not specified -->
<hdf5:Data>
<hdf5:DataFromFile>
- 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
</hdf5:DataFromFile>
</hdf5:Data>
</hdf5:Dataset>
@@ -1064,7 +6741,7 @@ Expected output for 'h5dump --xml tsaf.h5'
</hdf5:StorageLayout>
<hdf5:FillValueInfo FillTime="FillIfSet" AllocationTime="Incremental">
<hdf5:FillValue>
- <hdf5:NoFill/>
+ <hdf5:NoFill/>
</hdf5:FillValue>
</hdf5:FillValueInfo>
<hdf5:Dataspace>
@@ -1340,7 +7017,7 @@ Expected output for 'h5dump --xml tsaf.h5'
</hdf5:StorageLayout>
<hdf5:FillValueInfo FillTime="FillIfSet" AllocationTime="Incremental">
<hdf5:FillValue>
- <hdf5:NoFill/>
+ <hdf5:NoFill/>
</hdf5:FillValue>
</hdf5:FillValueInfo>
<hdf5:Dataspace>
@@ -1595,7 +7272,7 @@ Expected output for 'h5dump --xml tsaf.h5'
</hdf5:StorageLayout>
<hdf5:FillValueInfo FillTime="FillIfSet" AllocationTime="Incremental">
<hdf5:FillValue>
- <hdf5:NoFill/>
+ <hdf5:NoFill/>
</hdf5:FillValue>
</hdf5:FillValueInfo>
<hdf5:Dataspace>
@@ -1734,30 +7411,30 @@ Expected output for 'h5dump --xml tsaf.h5'
<!-- Note: format of compound data not specified -->
<hdf5:Data>
<hdf5:DataFromFile>
- 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
</hdf5:DataFromFile>
</hdf5:Data>
</hdf5:Dataset>
@@ -1771,7 +7448,7 @@ Expected output for 'h5dump --xml tsaf.h5'
</hdf5:StorageLayout>
<hdf5:FillValueInfo FillTime="FillIfSet" AllocationTime="Incremental">
<hdf5:FillValue>
- <hdf5:NoFill/>
+ <hdf5:NoFill/>
</hdf5:FillValue>
</hdf5:FillValueInfo>
<hdf5:Dataspace>
@@ -2026,11 +7703,16 @@ Expected output for 'h5dump --xml tsaf.h5'
<!-- Note: format of compound data not specified -->
<hdf5:Data>
<hdf5:DataFromFile>
- 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'
</hdf5:StorageLayout>
<hdf5:FillValueInfo FillTime="FillIfSet" AllocationTime="Incremental">
<hdf5:FillValue>
- <hdf5:NoFill/>
+ <hdf5:NoFill/>
</hdf5:FillValue>
</hdf5:FillValueInfo>
<hdf5:Dataspace>
@@ -2230,15 +7912,15 @@ Expected output for 'h5dump --xml tsaf.h5'
<!-- Note: format of compound data not specified -->
<hdf5:Data>
<hdf5:DataFromFile>
- 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
</hdf5:DataFromFile>
</hdf5:Data>
</hdf5:Dataset>
@@ -2246,9 +7928,9 @@ Expected output for 'h5dump --xml tsaf.h5'
<hdf5:StorageLayout>
<hdf5:ContiguousLayout/>
</hdf5:StorageLayout>
- <hdf5:FillValueInfo FillTime="FillIfSet" AllocationTime="Late">
+ <hdf5:FillValueInfo FillTime="FillIfSet" AllocationTime="Late">
<hdf5:FillValue>
- <hdf5:NoFill/>
+ <hdf5:NoFill/>
</hdf5:FillValue>
</hdf5:FillValueInfo>
<hdf5:Dataspace>
@@ -2263,8 +7945,42 @@ Expected output for 'h5dump --xml tsaf.h5'
</hdf5:DataType>
<hdf5:Data>
<hdf5:DataFromFile>
- 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
</hdf5:DataFromFile>
</hdf5:Data>
</hdf5:Dataset>
@@ -2272,9 +7988,9 @@ Expected output for 'h5dump --xml tsaf.h5'
<hdf5:StorageLayout>
<hdf5:ContiguousLayout/>
</hdf5:StorageLayout>
- <hdf5:FillValueInfo FillTime="FillIfSet" AllocationTime="Late">
+ <hdf5:FillValueInfo FillTime="FillIfSet" AllocationTime="Late">
<hdf5:FillValue>
- <hdf5:NoFill/>
+ <hdf5:NoFill/>
</hdf5:FillValue>
</hdf5:FillValueInfo>
<hdf5:Dataspace>
@@ -2289,9 +8005,42 @@ Expected output for 'h5dump --xml tsaf.h5'
</hdf5:DataType>
<hdf5:Data>
<hdf5:DataFromFile>
- 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
</hdf5:DataFromFile>
</hdf5:Data>
</hdf5:Dataset>
@@ -2299,9 +8048,9 @@ Expected output for 'h5dump --xml tsaf.h5'
<hdf5:StorageLayout>
<hdf5:ContiguousLayout/>
</hdf5:StorageLayout>
- <hdf5:FillValueInfo FillTime="FillIfSet" AllocationTime="Late">
+ <hdf5:FillValueInfo FillTime="FillIfSet" AllocationTime="Late">
<hdf5:FillValue>
- <hdf5:NoFill/>
+ <hdf5:NoFill/>
</hdf5:FillValue>
</hdf5:FillValueInfo>
<hdf5:Dataspace>
@@ -2316,7 +8065,11 @@ Expected output for 'h5dump --xml tsaf.h5'
</hdf5:DataType>
<hdf5:Data>
<hdf5:DataFromFile>
- 4 3 2 1 0
+ 4
+ 3
+ 2
+ 1
+ 0
</hdf5:DataFromFile>
</hdf5:Data>
</hdf5:Dataset>
@@ -2324,9 +8077,9 @@ Expected output for 'h5dump --xml tsaf.h5'
<hdf5:StorageLayout>
<hdf5:ContiguousLayout/>
</hdf5:StorageLayout>
- <hdf5:FillValueInfo FillTime="FillIfSet" AllocationTime="Late">
+ <hdf5:FillValueInfo FillTime="FillIfSet" AllocationTime="Late">
<hdf5:FillValue>
- <hdf5:NoFill/>
+ <hdf5:NoFill/>
</hdf5:FillValue>
</hdf5:FillValueInfo>
<hdf5:Dataspace>
@@ -2341,7 +8094,8 @@ Expected output for 'h5dump --xml tsaf.h5'
</hdf5:DataType>
<hdf5:Data>
<hdf5:DataFromFile>
- 45 55
+ 45
+ 55
</hdf5:DataFromFile>
</hdf5:Data>
</hdf5:Dataset>
@@ -2349,9 +8103,9 @@ Expected output for 'h5dump --xml tsaf.h5'
<hdf5:StorageLayout>
<hdf5:ContiguousLayout/>
</hdf5:StorageLayout>
- <hdf5:FillValueInfo FillTime="FillIfSet" AllocationTime="Late">
+ <hdf5:FillValueInfo FillTime="FillIfSet" AllocationTime="Late">
<hdf5:FillValue>
- <hdf5:NoFill/>
+ <hdf5:NoFill/>
</hdf5:FillValue>
</hdf5:FillValueInfo>
<hdf5:Dataspace>
@@ -2366,7 +8120,18 @@ Expected output for 'h5dump --xml tsaf.h5'
</hdf5:DataType>
<hdf5:Data>
<hdf5:DataFromFile>
- 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
</hdf5:DataFromFile>
</hdf5:Data>
</hdf5:Dataset>
@@ -2374,9 +8139,9 @@ Expected output for 'h5dump --xml tsaf.h5'
<hdf5:StorageLayout>
<hdf5:ContiguousLayout/>
</hdf5:StorageLayout>
- <hdf5:FillValueInfo FillTime="FillIfSet" AllocationTime="Late">
+ <hdf5:FillValueInfo FillTime="FillIfSet" AllocationTime="Late">
<hdf5:FillValue>
- <hdf5:NoFill/>
+ <hdf5:NoFill/>
</hdf5:FillValue>
</hdf5:FillValueInfo>
<hdf5:Dataspace>
@@ -2391,7 +8156,11 @@ Expected output for 'h5dump --xml tsaf.h5'
</hdf5:DataType>
<hdf5:Data>
<hdf5:DataFromFile>
- 100 150 150 100 75
+ 100
+ 150
+ 150
+ 100
+ 75
</hdf5:DataFromFile>
</hdf5:Data>
</hdf5:Dataset>
@@ -2399,9 +8168,9 @@ Expected output for 'h5dump --xml tsaf.h5'
<hdf5:StorageLayout>
<hdf5:ContiguousLayout/>
</hdf5:StorageLayout>
- <hdf5:FillValueInfo FillTime="FillIfSet" AllocationTime="Late">
+ <hdf5:FillValueInfo FillTime="FillIfSet" AllocationTime="Late">
<hdf5:FillValue>
- <hdf5:NoFill/>
+ <hdf5:NoFill/>
</hdf5:FillValue>
</hdf5:FillValueInfo>
<hdf5:Dataspace>
@@ -2416,7 +8185,13 @@ Expected output for 'h5dump --xml tsaf.h5'
</hdf5:DataType>
<hdf5:Data>
<hdf5:DataFromFile>
- 75 95 120 80 115 85 110
+ 75
+ 95
+ 120
+ 80
+ 115
+ 85
+ 110
</hdf5:DataFromFile>
</hdf5:Data>
</hdf5:Dataset>
@@ -2430,7 +8205,7 @@ Expected output for 'h5dump --xml tsaf.h5'
</hdf5:StorageLayout>
<hdf5:FillValueInfo FillTime="FillIfSet" AllocationTime="Incremental">
<hdf5:FillValue>
- <hdf5:NoFill/>
+ <hdf5:NoFill/>
</hdf5:FillValue>
</hdf5:FillValueInfo>
<hdf5:Dataspace>
@@ -2445,7 +8220,25 @@ Expected output for 'h5dump --xml tsaf.h5'
</hdf5:DataType>
<hdf5:Data>
<hdf5:DataFromFile>
- 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
</hdf5:DataFromFile>
</hdf5:Data>
</hdf5:Dataset>
@@ -2459,7 +8252,7 @@ Expected output for 'h5dump --xml tsaf.h5'
</hdf5:StorageLayout>
<hdf5:FillValueInfo FillTime="FillIfSet" AllocationTime="Incremental">
<hdf5:FillValue>
- <hdf5:NoFill/>
+ <hdf5:NoFill/>
</hdf5:FillValue>
</hdf5:FillValueInfo>
<hdf5:Dataspace>
@@ -2488,7 +8281,16 @@ Expected output for 'h5dump --xml tsaf.h5'
<!-- Note: format of compound data not specified -->
<hdf5:Data>
<hdf5:DataFromFile>
- 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
</hdf5:DataFromFile>
</hdf5:Data>
</hdf5:Dataset>
@@ -2496,9 +8298,9 @@ Expected output for 'h5dump --xml tsaf.h5'
<hdf5:StorageLayout>
<hdf5:ContiguousLayout/>
</hdf5:StorageLayout>
- <hdf5:FillValueInfo FillTime="FillIfSet" AllocationTime="Late">
+ <hdf5:FillValueInfo FillTime="FillIfSet" AllocationTime="Late">
<hdf5:FillValue>
- <hdf5:NoFill/>
+ <hdf5:NoFill/>
</hdf5:FillValue>
</hdf5:FillValueInfo>
<hdf5:Dataspace>
@@ -2513,7 +8315,15 @@ Expected output for 'h5dump --xml tsaf.h5'
</hdf5:DataType>
<hdf5:Data>
<hdf5:DataFromFile>
- 1 2 3 5 6 7 9 10 11
+ 1
+ 2
+ 3
+ 5
+ 6
+ 7
+ 9
+ 10
+ 11
</hdf5:DataFromFile>
</hdf5:Data>
</hdf5:Dataset>
@@ -2521,9 +8331,9 @@ Expected output for 'h5dump --xml tsaf.h5'
<hdf5:StorageLayout>
<hdf5:ContiguousLayout/>
</hdf5:StorageLayout>
- <hdf5:FillValueInfo FillTime="FillIfSet" AllocationTime="Late">
+ <hdf5:FillValueInfo FillTime="FillIfSet" AllocationTime="Late">
<hdf5:FillValue>
- <hdf5:NoFill/>
+ <hdf5:NoFill/>
</hdf5:FillValue>
</hdf5:FillValueInfo>
<hdf5:Dataspace>
@@ -2538,7 +8348,10 @@ Expected output for 'h5dump --xml tsaf.h5'
</hdf5:DataType>
<hdf5:Data>
<hdf5:DataFromFile>
- 1 2 4 5
+ 1
+ 2
+ 4
+ 5
</hdf5:DataFromFile>
</hdf5:Data>
</hdf5:Dataset>
@@ -2546,9 +8359,9 @@ Expected output for 'h5dump --xml tsaf.h5'
<hdf5:StorageLayout>
<hdf5:ContiguousLayout/>
</hdf5:StorageLayout>
- <hdf5:FillValueInfo FillTime="FillIfSet" AllocationTime="Late">
+ <hdf5:FillValueInfo FillTime="FillIfSet" AllocationTime="Late">
<hdf5:FillValue>
- <hdf5:NoFill/>
+ <hdf5:NoFill/>
</hdf5:FillValue>
</hdf5:FillValueInfo>
<hdf5:Dataspace>
@@ -2563,7 +8376,13 @@ Expected output for 'h5dump --xml tsaf.h5'
</hdf5:DataType>
<hdf5:Data>
<hdf5:DataFromFile>
- 9 10 11 13 14 16 17
+ 9
+ 10
+ 11
+ 13
+ 14
+ 16
+ 17
</hdf5:DataFromFile>
</hdf5:Data>
</hdf5:Dataset>
@@ -2571,9 +8390,9 @@ Expected output for 'h5dump --xml tsaf.h5'
<hdf5:StorageLayout>
<hdf5:ContiguousLayout/>
</hdf5:StorageLayout>
- <hdf5:FillValueInfo FillTime="FillIfSet" AllocationTime="Late">
+ <hdf5:FillValueInfo FillTime="FillIfSet" AllocationTime="Late">
<hdf5:FillValue>
- <hdf5:NoFill/>
+ <hdf5:NoFill/>
</hdf5:FillValue>
</hdf5:FillValueInfo>
<hdf5:Dataspace>
@@ -2588,7 +8407,10 @@ Expected output for 'h5dump --xml tsaf.h5'
</hdf5:DataType>
<hdf5:Data>
<hdf5:DataFromFile>
- 7 8 9 11
+ 7
+ 8
+ 9
+ 11
</hdf5:DataFromFile>
</hdf5:Data>
</hdf5:Dataset>
@@ -2596,9 +8418,9 @@ Expected output for 'h5dump --xml tsaf.h5'
<hdf5:StorageLayout>
<hdf5:ContiguousLayout/>
</hdf5:StorageLayout>
- <hdf5:FillValueInfo FillTime="FillIfSet" AllocationTime="Late">
+ <hdf5:FillValueInfo FillTime="FillIfSet" AllocationTime="Late">
<hdf5:FillValue>
- <hdf5:NoFill/>
+ <hdf5:NoFill/>
</hdf5:FillValue>
</hdf5:FillValueInfo>
<hdf5:Dataspace>
@@ -2613,7 +8435,11 @@ Expected output for 'h5dump --xml tsaf.h5'
</hdf5:DataType>
<hdf5:Data>
<hdf5:DataFromFile>
- 9 10 11 13 14
+ 9
+ 10
+ 11
+ 13
+ 14
</hdf5:DataFromFile>
</hdf5:Data>
</hdf5:Dataset>
@@ -2621,9 +8447,9 @@ Expected output for 'h5dump --xml tsaf.h5'
<hdf5:StorageLayout>
<hdf5:ContiguousLayout/>
</hdf5:StorageLayout>
- <hdf5:FillValueInfo FillTime="FillIfSet" AllocationTime="Late">
+ <hdf5:FillValueInfo FillTime="FillIfSet" AllocationTime="Late">
<hdf5:FillValue>
- <hdf5:NoFill/>
+ <hdf5:NoFill/>
</hdf5:FillValue>
</hdf5:FillValueInfo>
<hdf5:Dataspace>
@@ -2638,7 +8464,9 @@ Expected output for 'h5dump --xml tsaf.h5'
</hdf5:DataType>
<hdf5:Data>
<hdf5:DataFromFile>
- 7 8 9
+ 7
+ 8
+ 9
</hdf5:DataFromFile>
</hdf5:Data>
</hdf5:Dataset>
@@ -2646,9 +8474,9 @@ Expected output for 'h5dump --xml tsaf.h5'
<hdf5:StorageLayout>
<hdf5:ContiguousLayout/>
</hdf5:StorageLayout>
- <hdf5:FillValueInfo FillTime="FillIfSet" AllocationTime="Late">
+ <hdf5:FillValueInfo FillTime="FillIfSet" AllocationTime="Late">
<hdf5:FillValue>
- <hdf5:NoFill/>
+ <hdf5:NoFill/>
</hdf5:FillValue>
</hdf5:FillValueInfo>
<hdf5:Dataspace>
@@ -2663,7 +8491,10 @@ Expected output for 'h5dump --xml tsaf.h5'
</hdf5:DataType>
<hdf5:Data>
<hdf5:DataFromFile>
- 13 14 16 17
+ 13
+ 14
+ 16
+ 17
</hdf5:DataFromFile>
</hdf5:Data>
</hdf5:Dataset>
@@ -2671,9 +8502,9 @@ Expected output for 'h5dump --xml tsaf.h5'
<hdf5:StorageLayout>
<hdf5:ContiguousLayout/>
</hdf5:StorageLayout>
- <hdf5:FillValueInfo FillTime="FillIfSet" AllocationTime="Late">
+ <hdf5:FillValueInfo FillTime="FillIfSet" AllocationTime="Late">
<hdf5:FillValue>
- <hdf5:NoFill/>
+ <hdf5:NoFill/>
</hdf5:FillValue>
</hdf5:FillValueInfo>
<hdf5:Dataspace>
@@ -2696,9 +8527,9 @@ Expected output for 'h5dump --xml tsaf.h5'
<hdf5:StorageLayout>
<hdf5:ContiguousLayout/>
</hdf5:StorageLayout>
- <hdf5:FillValueInfo FillTime="FillIfSet" AllocationTime="Late">
+ <hdf5:FillValueInfo FillTime="FillIfSet" AllocationTime="Late">
<hdf5:FillValue>
- <hdf5:NoFill/>
+ <hdf5:NoFill/>
</hdf5:FillValue>
</hdf5:FillValueInfo>
<hdf5:Dataspace>
@@ -2713,7 +8544,16 @@ Expected output for 'h5dump --xml tsaf.h5'
</hdf5:DataType>
<hdf5:Data>
<hdf5:DataFromFile>
- 3 4 7 8 11 12 14 15 17 18
+ 3
+ 4
+ 7
+ 8
+ 11
+ 12
+ 14
+ 15
+ 17
+ 18
</hdf5:DataFromFile>
</hdf5:Data>
</hdf5:Dataset>
@@ -2721,9 +8561,9 @@ Expected output for 'h5dump --xml tsaf.h5'
<hdf5:StorageLayout>
<hdf5:ContiguousLayout/>
</hdf5:StorageLayout>
- <hdf5:FillValueInfo FillTime="FillIfSet" AllocationTime="Late">
+ <hdf5:FillValueInfo FillTime="FillIfSet" AllocationTime="Late">
<hdf5:FillValue>
- <hdf5:NoFill/>
+ <hdf5:NoFill/>
</hdf5:FillValue>
</hdf5:FillValueInfo>
<hdf5:Dataspace>
@@ -2738,7 +8578,10 @@ Expected output for 'h5dump --xml tsaf.h5'
</hdf5:DataType>
<hdf5:Data>
<hdf5:DataFromFile>
- 3 6 10 12
+ 3
+ 6
+ 10
+ 12
</hdf5:DataFromFile>
</hdf5:Data>
</hdf5:Dataset>
@@ -2746,9 +8589,9 @@ Expected output for 'h5dump --xml tsaf.h5'
<hdf5:StorageLayout>
<hdf5:ContiguousLayout/>
</hdf5:StorageLayout>
- <hdf5:FillValueInfo FillTime="FillIfSet" AllocationTime="Late">
+ <hdf5:FillValueInfo FillTime="FillIfSet" AllocationTime="Late">
<hdf5:FillValue>
- <hdf5:NoFill/>
+ <hdf5:NoFill/>
</hdf5:FillValue>
</hdf5:FillValueInfo>
<hdf5:Dataspace>
@@ -2763,7 +8606,9 @@ Expected output for 'h5dump --xml tsaf.h5'
</hdf5:DataType>
<hdf5:Data>
<hdf5:DataFromFile>
- 9 10 11
+ 9
+ 10
+ 11
</hdf5:DataFromFile>
</hdf5:Data>
</hdf5:Dataset>
@@ -2771,9 +8616,9 @@ Expected output for 'h5dump --xml tsaf.h5'
<hdf5:StorageLayout>
<hdf5:ContiguousLayout/>
</hdf5:StorageLayout>
- <hdf5:FillValueInfo FillTime="FillIfSet" AllocationTime="Late">
+ <hdf5:FillValueInfo FillTime="FillIfSet" AllocationTime="Late">
<hdf5:FillValue>
- <hdf5:NoFill/>
+ <hdf5:NoFill/>
</hdf5:FillValue>
</hdf5:FillValueInfo>
<hdf5:Dataspace>
@@ -2788,7 +8633,11 @@ Expected output for 'h5dump --xml tsaf.h5'
</hdf5:DataType>
<hdf5:Data>
<hdf5:DataFromFile>
- 1 5 9 13 16
+ 1
+ 5
+ 9
+ 13
+ 16
</hdf5:DataFromFile>
</hdf5:Data>
</hdf5:Dataset>
@@ -2796,9 +8645,9 @@ Expected output for 'h5dump --xml tsaf.h5'
<hdf5:StorageLayout>
<hdf5:ContiguousLayout/>
</hdf5:StorageLayout>
- <hdf5:FillValueInfo FillTime="FillIfSet" AllocationTime="Late">
+ <hdf5:FillValueInfo FillTime="FillIfSet" AllocationTime="Late">
<hdf5:FillValue>
- <hdf5:NoFill/>
+ <hdf5:NoFill/>
</hdf5:FillValue>
</hdf5:FillValueInfo>
<hdf5:Dataspace>
@@ -2813,7 +8662,11 @@ Expected output for 'h5dump --xml tsaf.h5'
</hdf5:DataType>
<hdf5:Data>
<hdf5:DataFromFile>
- 4 8 12 15 18
+ 4
+ 8
+ 12
+ 15
+ 18
</hdf5:DataFromFile>
</hdf5:Data>
</hdf5:Dataset>
@@ -2821,9 +8674,9 @@ Expected output for 'h5dump --xml tsaf.h5'
<hdf5:StorageLayout>
<hdf5:ContiguousLayout/>
</hdf5:StorageLayout>
- <hdf5:FillValueInfo FillTime="FillIfSet" AllocationTime="Late">
+ <hdf5:FillValueInfo FillTime="FillIfSet" AllocationTime="Late">
<hdf5:FillValue>
- <hdf5:NoFill/>
+ <hdf5:NoFill/>
</hdf5:FillValue>
</hdf5:FillValueInfo>
<hdf5:Dataspace>
@@ -2838,7 +8691,22 @@ Expected output for 'h5dump --xml tsaf.h5'
</hdf5:DataType>
<hdf5:Data>
<hdf5:DataFromFile>
- 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
</hdf5:DataFromFile>
</hdf5:Data>
</hdf5:Dataset>
@@ -2846,9 +8714,9 @@ Expected output for 'h5dump --xml tsaf.h5'
<hdf5:StorageLayout>
<hdf5:ContiguousLayout/>
</hdf5:StorageLayout>
- <hdf5:FillValueInfo FillTime="FillIfSet" AllocationTime="Late">
+ <hdf5:FillValueInfo FillTime="FillIfSet" AllocationTime="Late">
<hdf5:FillValue>
- <hdf5:NoFill/>
+ <hdf5:NoFill/>
</hdf5:FillValue>
</hdf5:FillValueInfo>
<hdf5:Dataspace>
@@ -2863,7 +8731,15 @@ Expected output for 'h5dump --xml tsaf.h5'
</hdf5:DataType>
<hdf5:Data>
<hdf5:DataFromFile>
- 9 10 13 10 14 13 10 11 14
+ 9
+ 10
+ 13
+ 10
+ 14
+ 13
+ 10
+ 11
+ 14
</hdf5:DataFromFile>
</hdf5:Data>
</hdf5:Dataset>
@@ -2871,9 +8747,9 @@ Expected output for 'h5dump --xml tsaf.h5'
<hdf5:StorageLayout>
<hdf5:ContiguousLayout/>
</hdf5:StorageLayout>
- <hdf5:FillValueInfo FillTime="FillIfSet" AllocationTime="Late">
+ <hdf5:FillValueInfo FillTime="FillIfSet" AllocationTime="Late">
<hdf5:FillValue>
- <hdf5:NoFill/>
+ <hdf5:NoFill/>
</hdf5:FillValue>
</hdf5:FillValueInfo>
<hdf5:Dataspace>
@@ -2888,7 +8764,10 @@ Expected output for 'h5dump --xml tsaf.h5'
</hdf5:DataType>
<hdf5:Data>
<hdf5:DataFromFile>
- 13 14 17 16
+ 13
+ 14
+ 17
+ 16
</hdf5:DataFromFile>
</hdf5:Data>
</hdf5:Dataset>
@@ -2896,9 +8775,9 @@ Expected output for 'h5dump --xml tsaf.h5'
<hdf5:StorageLayout>
<hdf5:ContiguousLayout/>
</hdf5:StorageLayout>
- <hdf5:FillValueInfo FillTime="FillIfSet" AllocationTime="Late">
+ <hdf5:FillValueInfo FillTime="FillIfSet" AllocationTime="Late">
<hdf5:FillValue>
- <hdf5:NoFill/>
+ <hdf5:NoFill/>
</hdf5:FillValue>
</hdf5:FillValueInfo>
<hdf5:Dataspace>
@@ -2913,7 +8792,22 @@ Expected output for 'h5dump --xml tsaf.h5'
</hdf5:DataType>
<hdf5:Data>
<hdf5:DataFromFile>
- 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
</hdf5:DataFromFile>
</hdf5:Data>
</hdf5:Dataset>
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'
-#############################
<?xml version="1.0" encoding="UTF-8"?>
-<hdf5:HDF5-File xmlns:hdf5="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">
+<hdf5:HDF5-File xmlns:hdf5="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">
<hdf5:RootGroup OBJ-XID="xid_696" H5Path="/">
<hdf5:SoftLink LinkName="slink1" OBJ-XID="xid_18446744073709551614" H5SourcePath="/slink1" TargetPath="somevalue" Parents="xid_696" H5ParentPaths="/" />
<hdf5:SoftLink LinkName="slink2" OBJ-XID="xid_18446744073709551613" H5SourcePath="/slink2" TargetPath="linkvalue" Parents="xid_696" H5ParentPaths="/" />
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'
-#############################
<?xml version="1.0" encoding="UTF-8"?>
-<hdf5:HDF5-File xmlns:hdf5="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">
+<hdf5:HDF5-File xmlns:hdf5="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">
<hdf5:RootGroup OBJ-XID="xid_696" H5Path="/">
<hdf5:Dataset Name="comp1" OBJ-XID="xid_2520" H5Path= "/comp1" Parents="xid_696" H5ParentPaths="/">
<hdf5:StorageLayout>
<hdf5:ContiguousLayout/>
</hdf5:StorageLayout>
- <hdf5:FillValueInfo FillTime="FillIfSet" AllocationTime="Late">
+ <hdf5:FillValueInfo FillTime="FillIfSet" AllocationTime="Late">
<hdf5:FillValue>
- <hdf5:NoFill/>
+ <hdf5:NoFill/>
</hdf5:FillValue>
</hdf5:FillValueInfo>
<hdf5:Dataspace>
@@ -52,186 +49,24 @@ Expected output for 'h5dump --xml tstr.h5'
<!-- Note: format of compound data not specified -->
<hdf5:Data>
<hdf5:DataFromFile>
- 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"
</hdf5:DataFromFile>
</hdf5:Data>
</hdf5:Dataset>
@@ -239,9 +74,9 @@ Expected output for 'h5dump --xml tstr.h5'
<hdf5:StorageLayout>
<hdf5:ContiguousLayout/>
</hdf5:StorageLayout>
- <hdf5:FillValueInfo FillTime="FillIfSet" AllocationTime="Late">
+ <hdf5:FillValueInfo FillTime="FillIfSet" AllocationTime="Late">
<hdf5:FillValue>
- <hdf5:NoFill/>
+ <hdf5:NoFill/>
</hdf5:FillValue>
</hdf5:FillValueInfo>
<hdf5:Dataspace>
@@ -276,9 +111,9 @@ Expected output for 'h5dump --xml tstr.h5'
<hdf5:StorageLayout>
<hdf5:ContiguousLayout/>
</hdf5:StorageLayout>
- <hdf5:FillValueInfo FillTime="FillIfSet" AllocationTime="Late">
+ <hdf5:FillValueInfo FillTime="FillIfSet" AllocationTime="Late">
<hdf5:FillValue>
- <hdf5:NoFill/>
+ <hdf5:NoFill/>
</hdf5:FillValue>
</hdf5:FillValueInfo>
<hdf5:Dataspace>
@@ -320,9 +155,9 @@ Expected output for 'h5dump --xml tstr.h5'
<hdf5:StorageLayout>
<hdf5:ContiguousLayout/>
</hdf5:StorageLayout>
- <hdf5:FillValueInfo FillTime="FillIfSet" AllocationTime="Late">
+ <hdf5:FillValueInfo FillTime="FillIfSet" AllocationTime="Late">
<hdf5:FillValue>
- <hdf5:NoFill/>
+ <hdf5:NoFill/>
</hdf5:FillValue>
</hdf5:FillValueInfo>
<hdf5:Dataspace>
@@ -371,9 +206,9 @@ Expected output for 'h5dump --xml tstr.h5'
<hdf5:StorageLayout>
<hdf5:ContiguousLayout/>
</hdf5:StorageLayout>
- <hdf5:FillValueInfo FillTime="FillIfSet" AllocationTime="Late">
+ <hdf5:FillValueInfo FillTime="FillIfSet" AllocationTime="Late">
<hdf5:FillValue>
- <hdf5:NoFill/>
+ <hdf5:NoFill/>
</hdf5:FillValue>
</hdf5:FillValueInfo>
<hdf5:Dataspace>
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'
-#############################
<?xml version="1.0" encoding="UTF-8"?>
-<hdf5:HDF5-File xmlns:hdf5="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">
+<hdf5:HDF5-File xmlns:hdf5="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">
<hdf5:RootGroup OBJ-XID="xid_696" H5Path="/">
<hdf5:Group Name="g1" OBJ-XID="xid_1344" H5Path="/g1" Parents="xid_696" H5ParentPaths="/" >
<hdf5:Dataset Name="dset1" OBJ-XID="xid_1720" H5Path= "/g1/dset1" Parents="xid_1344" H5ParentPaths="/g1">
<hdf5:StorageLayout>
<hdf5:ContiguousLayout/>
</hdf5:StorageLayout>
- <hdf5:FillValueInfo FillTime="FillIfSet" AllocationTime="Late">
+ <hdf5:FillValueInfo FillTime="FillIfSet" AllocationTime="Late">
<hdf5:FillValue>
- <hdf5:NoFill/>
+ <hdf5:NoFill/>
</hdf5:FillValue>
</hdf5:FillValueInfo>
<hdf5:Dataspace>
@@ -64,9 +61,9 @@ Expected output for 'h5dump --xml tstr2.h5'
<hdf5:StorageLayout>
<hdf5:ContiguousLayout/>
</hdf5:StorageLayout>
- <hdf5:FillValueInfo FillTime="FillIfSet" AllocationTime="Late">
+ <hdf5:FillValueInfo FillTime="FillIfSet" AllocationTime="Late">
<hdf5:FillValue>
- <hdf5:NoFill/>
+ <hdf5:NoFill/>
</hdf5:FillValue>
</hdf5:FillValueInfo>
<hdf5:Dataspace>
@@ -100,9 +97,9 @@ Expected output for 'h5dump --xml tstr2.h5'
<hdf5:StorageLayout>
<hdf5:ContiguousLayout/>
</hdf5:StorageLayout>
- <hdf5:FillValueInfo FillTime="FillIfSet" AllocationTime="Late">
+ <hdf5:FillValueInfo FillTime="FillIfSet" AllocationTime="Late">
<hdf5:FillValue>
- <hdf5:NoFill/>
+ <hdf5:NoFill/>
</hdf5:FillValue>
</hdf5:FillValueInfo>
<hdf5:Dataspace>
@@ -136,9 +133,9 @@ Expected output for 'h5dump --xml tstr2.h5'
<hdf5:StorageLayout>
<hdf5:ContiguousLayout/>
</hdf5:StorageLayout>
- <hdf5:FillValueInfo FillTime="FillIfSet" AllocationTime="Late">
+ <hdf5:FillValueInfo FillTime="FillIfSet" AllocationTime="Late">
<hdf5:FillValue>
- <hdf5:NoFill/>
+ <hdf5:NoFill/>
</hdf5:FillValue>
</hdf5:FillValueInfo>
<hdf5:Dataspace>
@@ -172,9 +169,9 @@ Expected output for 'h5dump --xml tstr2.h5'
<hdf5:StorageLayout>
<hdf5:ContiguousLayout/>
</hdf5:StorageLayout>
- <hdf5:FillValueInfo FillTime="FillIfSet" AllocationTime="Late">
+ <hdf5:FillValueInfo FillTime="FillIfSet" AllocationTime="Late">
<hdf5:FillValue>
- <hdf5:NoFill/>
+ <hdf5:NoFill/>
</hdf5:FillValue>
</hdf5:FillValueInfo>
<hdf5:Dataspace>
@@ -208,9 +205,9 @@ Expected output for 'h5dump --xml tstr2.h5'
<hdf5:StorageLayout>
<hdf5:ContiguousLayout/>
</hdf5:StorageLayout>
- <hdf5:FillValueInfo FillTime="FillIfSet" AllocationTime="Late">
+ <hdf5:FillValueInfo FillTime="FillIfSet" AllocationTime="Late">
<hdf5:FillValue>
- <hdf5:NoFill/>
+ <hdf5:NoFill/>
</hdf5:FillValue>
</hdf5:FillValueInfo>
<hdf5:Dataspace>
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'
-#############################
<?xml version="1.0" encoding="UTF-8"?>
-<hdf5:HDF5-File xmlns:hdf5="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">
+<hdf5:HDF5-File xmlns:hdf5="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">
<hdf5:RootGroup OBJ-XID="xid_696" H5Path="/">
<hdf5:Dataset Name="dset1" OBJ-XID="xid_744" H5Path= "/dset1" Parents="xid_696" H5ParentPaths="/">
<hdf5:StorageLayout>
<hdf5:ContiguousLayout/>
</hdf5:StorageLayout>
- <hdf5:FillValueInfo FillTime="FillIfSet" AllocationTime="Late">
+ <hdf5:FillValueInfo FillTime="FillIfSet" AllocationTime="Late">
<hdf5:FillValue>
- <hdf5:NoFill/>
+ <hdf5:NoFill/>
</hdf5:FillValue>
</hdf5:FillValueInfo>
<hdf5:Dataspace>
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'
-#############################
<?xml version="1.0" encoding="UTF-8"?>
-<hdf5:HDF5-File xmlns:hdf5="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">
+<hdf5:HDF5-File xmlns:hdf5="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">
<hdf5:RootGroup OBJ-XID="xid_928" H5Path="/">
<hdf5:Dataset Name="dset1" OBJ-XID="xid_976" H5Path= "/dset1" Parents="xid_928" H5ParentPaths="/">
<hdf5:StorageLayout>
<hdf5:ContiguousLayout/>
</hdf5:StorageLayout>
- <hdf5:FillValueInfo FillTime="FillIfSet" AllocationTime="Late">
+ <hdf5:FillValueInfo FillTime="FillIfSet" AllocationTime="Late">
<hdf5:FillValue>
- <hdf5:NoFill/>
+ <hdf5:NoFill/>
</hdf5:FillValue>
</hdf5:FillValueInfo>
<hdf5:Dataspace>
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'
-#############################
<?xml version="1.0" encoding="UTF-8"?>
-<hdf5:HDF5-File xmlns:hdf5="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">
+<hdf5:HDF5-File xmlns:hdf5="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">
<hdf5:RootGroup OBJ-XID="xid_96" H5Path="/">
<hdf5:UserDefined LinkName="udlink1" OBJ-XID="xid_18446744073709551614" H5SourcePath="/udlink1" LinkClass="187" Parents="xid_96" H5ParentPaths="/" />
<hdf5:UserDefined LinkName="udlink2" OBJ-XID="xid_18446744073709551613" H5SourcePath="/udlink2" LinkClass="187" Parents="xid_96" H5ParentPaths="/" />
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'
-#############################
<?xml version="1.0" encoding="UTF-8"?>
-<hdf5:HDF5-File xmlns:hdf5="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">
+<hdf5:HDF5-File xmlns:hdf5="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">
<hdf5:RootGroup OBJ-XID="xid_928" H5Path="/">
<hdf5:Dataset Name="Dataset1.0" OBJ-XID="xid_976" H5Path= "/Dataset1.0" Parents="xid_928" H5ParentPaths="/">
<hdf5:StorageLayout>
<hdf5:ContiguousLayout/>
</hdf5:StorageLayout>
- <hdf5:FillValueInfo FillTime="FillIfSet" AllocationTime="Late">
+ <hdf5:FillValueInfo FillTime="FillIfSet" AllocationTime="Late">
<hdf5:FillValue>
- <hdf5:NoFill/>
+ <hdf5:NoFill/>
</hdf5:FillValue>
</hdf5:FillValueInfo>
<hdf5:Dataspace>
@@ -30,7 +27,10 @@ Expected output for 'h5dump --xml tvldtypes1.h5'
<!-- Note: format of VL data not specified -->
<hdf5:Data>
<hdf5:DataFromFile>
- 0 10 11 20 21 22 30 31 32 33
+ 0
+ 10 11
+ 20 21 22
+ 30 31 32 33
</hdf5:DataFromFile>
</hdf5:Data>
</hdf5:Dataset>
@@ -38,9 +38,9 @@ Expected output for 'h5dump --xml tvldtypes1.h5'
<hdf5:StorageLayout>
<hdf5:ContiguousLayout/>
</hdf5:StorageLayout>
- <hdf5:FillValueInfo FillTime="FillIfSet" AllocationTime="Late">
+ <hdf5:FillValueInfo FillTime="FillIfSet" AllocationTime="Late">
<hdf5:FillValue>
- <hdf5:NoFill/>
+ <hdf5:NoFill/>
</hdf5:FillValue>
</hdf5:FillValueInfo>
<hdf5:Dataspace>
@@ -60,7 +60,10 @@ Expected output for 'h5dump --xml tvldtypes1.h5'
<!-- Note: format of VL data not specified -->
<hdf5:Data>
<hdf5:DataFromFile>
- 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
</hdf5:DataFromFile>
</hdf5:Data>
</hdf5:Dataset>
@@ -68,9 +71,9 @@ Expected output for 'h5dump --xml tvldtypes1.h5'
<hdf5:StorageLayout>
<hdf5:ContiguousLayout/>
</hdf5:StorageLayout>
- <hdf5:FillValueInfo FillTime="FillIfSet" AllocationTime="Late">
+ <hdf5:FillValueInfo FillTime="FillIfSet" AllocationTime="Late">
<hdf5:FillValue>
- <hdf5:NoFill/>
+ <hdf5:NoFill/>
</hdf5:FillValue>
</hdf5:FillValueInfo>
<hdf5:Dataspace>
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'
-#############################
<?xml version="1.0" encoding="UTF-8"?>
-<hdf5:HDF5-File xmlns:hdf5="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">
+<hdf5:HDF5-File xmlns:hdf5="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">
<hdf5:RootGroup OBJ-XID="xid_928" H5Path="/">
<hdf5:Dataset Name="Dataset1" OBJ-XID="xid_976" H5Path= "/Dataset1" Parents="xid_928" H5ParentPaths="/">
<hdf5:StorageLayout>
<hdf5:ContiguousLayout/>
</hdf5:StorageLayout>
- <hdf5:FillValueInfo FillTime="FillIfSet" AllocationTime="Late">
+ <hdf5:FillValueInfo FillTime="FillIfSet" AllocationTime="Late">
<hdf5:FillValue>
- <hdf5:NoFill/>
+ <hdf5:NoFill/>
</hdf5:FillValue>
</hdf5:FillValueInfo>
<hdf5:Dataspace>
@@ -34,7 +31,9 @@ Expected output for 'h5dump --xml tvldtypes2.h5'
<!-- Note: format of VL data not specified -->
<hdf5:Data>
<hdf5:DataFromFile>
- 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
</hdf5:DataFromFile>
</hdf5:Data>
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'
-#############################
<?xml version="1.0" encoding="UTF-8"?>
-<hdf5:HDF5-File xmlns:hdf5="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">
+<hdf5:HDF5-File xmlns:hdf5="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">
<hdf5:RootGroup OBJ-XID="xid_928" H5Path="/">
<hdf5:Dataset Name="Dataset1" OBJ-XID="xid_976" H5Path= "/Dataset1" Parents="xid_928" H5ParentPaths="/">
<hdf5:StorageLayout>
<hdf5:ContiguousLayout/>
</hdf5:StorageLayout>
- <hdf5:FillValueInfo FillTime="FillIfSet" AllocationTime="Late">
+ <hdf5:FillValueInfo FillTime="FillIfSet" AllocationTime="Late">
<hdf5:FillValue>
- <hdf5:NoFill/>
+ <hdf5:NoFill/>
</hdf5:FillValue>
</hdf5:FillValueInfo>
<hdf5:Dataspace>
@@ -50,7 +47,10 @@ Expected output for 'h5dump --xml tvldtypes3.h5'
<!-- Note: format of compound data not specified -->
<hdf5:Data>
<hdf5:DataFromFile>
- 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
</hdf5:DataFromFile>
</hdf5:Data>
</hdf5:Dataset>
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'
-#############################
<?xml version="1.0" encoding="UTF-8"?>
-<hdf5:HDF5-File xmlns:hdf5="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">
+<hdf5:HDF5-File xmlns:hdf5="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">
<hdf5:RootGroup OBJ-XID="xid_928" H5Path="/">
<hdf5:Dataset Name="Dataset1" OBJ-XID="xid_976" H5Path= "/Dataset1" Parents="xid_928" H5ParentPaths="/">
<hdf5:StorageLayout>
<hdf5:ContiguousLayout/>
</hdf5:StorageLayout>
- <hdf5:FillValueInfo FillTime="FillOnAlloc" AllocationTime="Late">
+ <hdf5:FillValueInfo FillTime="FillOnAlloc" AllocationTime="Late">
<hdf5:FillValue>
- <hdf5:Data>
- <!-- VL fill not yet implemented. -->
- <hdf5:NoData />
- </hdf5:Data>
+ <hdf5:Data>
+ <!-- VL fill not yet implemented. -->
+ <hdf5:NoData />
+ </hdf5:Data>
</hdf5:FillValue>
</hdf5:FillValueInfo>
<hdf5:Dataspace>
@@ -46,7 +43,9 @@ Expected output for 'h5dump --xml tvldtypes4.h5'
<!-- Note: format of VL data not specified -->
<hdf5:Data>
<hdf5:DataFromFile>
- 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
</hdf5:DataFromFile>
</hdf5:Data>
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'
-#############################
<?xml version="1.0" encoding="UTF-8"?>
-<hdf5:HDF5-File xmlns:hdf5="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">
+<hdf5:HDF5-File xmlns:hdf5="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">
<hdf5:RootGroup OBJ-XID="xid_928" H5Path="/">
<hdf5:Dataset Name="Dataset" OBJ-XID="xid_976" H5Path= "/Dataset" Parents="xid_928" H5ParentPaths="/">
<hdf5:StorageLayout>
<hdf5:ContiguousLayout/>
</hdf5:StorageLayout>
- <hdf5:FillValueInfo FillTime="FillOnAlloc" AllocationTime="Late">
+ <hdf5:FillValueInfo FillTime="FillOnAlloc" AllocationTime="Late">
<hdf5:FillValue>
- <hdf5:Data>
- <!-- VL fill not yet implemented. -->
- <hdf5:NoData />
- </hdf5:Data>
+ <hdf5:Data>
+ <!-- VL fill not yet implemented. -->
+ <hdf5:NoData />
+ </hdf5:Data>
</hdf5:FillValue>
</hdf5:FillValueInfo>
<hdf5:Dataspace>
@@ -33,7 +30,10 @@ Expected output for 'h5dump --xml tvldtypes5.h5'
<!-- Note: format of VL data not specified -->
<hdf5:Data>
<hdf5:DataFromFile>
- 0 2 4 6 8 0 2 4 6 8 10 12
+ 0 2 4 6 8
+
+ 0 2 4 6 8 10 12
+
</hdf5:DataFromFile>
</hdf5:Data>
</hdf5:Dataset>
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'
-#############################
<?xml version="1.0" encoding="UTF-8"?>
-<hdf5:HDF5-File xmlns:hdf5="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">
+<hdf5:HDF5-File xmlns:hdf5="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">
<hdf5:RootGroup OBJ-XID="xid_96" H5Path="/">
<hdf5:Attribute Name="test_scalar">
<hdf5:Dataspace>
@@ -19,12 +16,12 @@ Expected output for 'h5dump --xml tvlstr.h5'
<hdf5:StorageLayout>
<hdf5:ContiguousLayout/>
</hdf5:StorageLayout>
- <hdf5:FillValueInfo FillTime="FillOnAlloc" AllocationTime="Late">
+ <hdf5:FillValueInfo FillTime="FillOnAlloc" AllocationTime="Late">
<hdf5:FillValue>
- <hdf5:Data>
- <!-- String fill values not yet implemented. -->
- <hdf5:NoData />
- </hdf5:Data>
+ <hdf5:Data>
+ <!-- String fill values not yet implemented. -->
+ <hdf5:NoData />
+ </hdf5:Data>
</hdf5:FillValue>
</hdf5:FillValueInfo>
<hdf5:Dataspace>
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
--- /dev/null
+++ b/tools/testfiles/zerodim.h5
Binary files differ