summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--.gitattributes2
-rw-r--r--.github/workflows/pr-check.yml2
-rw-r--r--MANIFEST18
-rw-r--r--Makefile.am16
-rw-r--r--c++/src/H5PropList.cpp1
-rw-r--r--config/cmake/HDF5_Process_Flex_Files.cmake95
-rw-r--r--config/cmake/libhdf5.pc.in14
-rw-r--r--configure.ac5
-rw-r--r--doxygen/Doxyfile.in2
-rw-r--r--hl/src/H5LTanalyze.c4
-rw-r--r--hl/src/H5LTanalyze.l4
-rw-r--r--java/examples/datasets/H5Ex_D_Alloc.java11
-rw-r--r--java/examples/datasets/H5Ex_D_Checksum.java15
-rw-r--r--java/examples/datasets/H5Ex_D_Chunk.java17
-rw-r--r--java/examples/datasets/H5Ex_D_Compact.java17
-rw-r--r--java/examples/datasets/H5Ex_D_External.java15
-rw-r--r--java/examples/datasets/H5Ex_D_FillValue.java9
-rw-r--r--java/examples/datasets/H5Ex_D_Gzip.java15
-rw-r--r--java/examples/datasets/H5Ex_D_Hyperslab.java15
-rw-r--r--java/examples/datasets/H5Ex_D_Nbit.java17
-rw-r--r--java/examples/datasets/H5Ex_D_ReadWrite.java11
-rw-r--r--java/examples/datasets/H5Ex_D_Shuffle.java15
-rw-r--r--java/examples/datasets/H5Ex_D_Sofloat.java15
-rw-r--r--java/examples/datasets/H5Ex_D_Soint.java15
-rw-r--r--java/examples/datasets/H5Ex_D_Szip.java15
-rw-r--r--java/examples/datasets/H5Ex_D_Transform.java15
-rw-r--r--java/examples/datasets/H5Ex_D_UnlimitedAdd.java21
-rw-r--r--java/examples/datasets/H5Ex_D_UnlimitedGzip.java23
-rw-r--r--java/examples/datasets/H5Ex_D_UnlimitedMod.java21
-rw-r--r--java/examples/datasets/JavaDatasetExample.sh.in11
-rw-r--r--java/examples/datatypes/H5Ex_T_Array.java19
-rw-r--r--java/examples/datatypes/H5Ex_T_ArrayAttribute.java25
-rw-r--r--java/examples/datatypes/H5Ex_T_Bit.java13
-rw-r--r--java/examples/datatypes/H5Ex_T_BitAttribute.java19
-rw-r--r--java/examples/datatypes/H5Ex_T_Commit.java13
-rw-r--r--java/examples/datatypes/H5Ex_T_Compound.java23
-rw-r--r--java/examples/datatypes/H5Ex_T_CompoundAttribute.java29
-rw-r--r--java/examples/datatypes/H5Ex_T_Float.java13
-rw-r--r--java/examples/datatypes/H5Ex_T_FloatAttribute.java19
-rw-r--r--java/examples/datatypes/H5Ex_T_Integer.java13
-rw-r--r--java/examples/datatypes/H5Ex_T_IntegerAttribute.java19
-rw-r--r--java/examples/datatypes/H5Ex_T_ObjectReference.java25
-rw-r--r--java/examples/datatypes/H5Ex_T_ObjectReferenceAttribute.java29
-rw-r--r--java/examples/datatypes/H5Ex_T_Opaque.java19
-rw-r--r--java/examples/datatypes/H5Ex_T_OpaqueAttribute.java23
-rw-r--r--java/examples/datatypes/H5Ex_T_String.java21
-rw-r--r--java/examples/datatypes/H5Ex_T_StringAttribute.java27
-rw-r--r--java/examples/datatypes/H5Ex_T_VLString.java15
-rw-r--r--java/examples/datatypes/JavaDatatypeExample.sh.in11
-rw-r--r--java/examples/groups/H5Ex_G_Compact.java7
-rw-r--r--java/examples/groups/H5Ex_G_Corder.java9
-rw-r--r--java/examples/groups/H5Ex_G_Create.java5
-rw-r--r--java/examples/groups/H5Ex_G_Intermediate.java7
-rw-r--r--java/examples/groups/H5Ex_G_Iterate.java3
-rw-r--r--java/examples/groups/H5Ex_G_Phase.java11
-rw-r--r--java/examples/groups/H5Ex_G_Traverse.java3
-rw-r--r--java/examples/groups/H5Ex_G_Visit.java3
-rw-r--r--java/examples/groups/JavaGroupExample.sh.in12
-rw-r--r--java/examples/intro/H5_CreateAttribute.java9
-rw-r--r--java/examples/intro/H5_CreateDataset.java7
-rw-r--r--java/examples/intro/H5_CreateFile.java3
-rw-r--r--java/examples/intro/H5_CreateGroup.java5
-rw-r--r--java/examples/intro/H5_CreateGroupAbsoluteRelative.java9
-rw-r--r--java/examples/intro/H5_CreateGroupDataset.java17
-rw-r--r--java/examples/intro/H5_ReadWrite.java7
-rw-r--r--java/examples/intro/JavaIntroExample.sh.in11
-rw-r--r--java/src/Makefile.am2
-rw-r--r--java/src/hdf/hdf5lib/CMakeLists.txt2
-rw-r--r--java/src/hdf/hdf5lib/H5.java3202
-rw-r--r--java/src/hdf/hdf5lib/HDF5Constants.java957
-rw-r--r--java/src/hdf/hdf5lib/HDF5GroupInfo.java21
-rw-r--r--java/src/hdf/hdf5lib/HDFArray.java681
-rw-r--r--java/src/hdf/hdf5lib/callbacks/Callbacks.java1
-rw-r--r--java/src/hdf/hdf5lib/callbacks/H5A_iterate_cb.java26
-rw-r--r--java/src/hdf/hdf5lib/callbacks/H5A_iterate_t.java5
-rw-r--r--java/src/hdf/hdf5lib/callbacks/H5D_append_cb.java23
-rw-r--r--java/src/hdf/hdf5lib/callbacks/H5D_append_t.java5
-rw-r--r--java/src/hdf/hdf5lib/callbacks/H5D_iterate_cb.java25
-rw-r--r--java/src/hdf/hdf5lib/callbacks/H5D_iterate_t.java5
-rw-r--r--java/src/hdf/hdf5lib/callbacks/H5E_walk_cb.java23
-rw-r--r--java/src/hdf/hdf5lib/callbacks/H5E_walk_t.java5
-rw-r--r--java/src/hdf/hdf5lib/callbacks/H5L_iterate_opdata_t.java5
-rw-r--r--java/src/hdf/hdf5lib/callbacks/H5L_iterate_t.java26
-rw-r--r--java/src/hdf/hdf5lib/callbacks/H5O_iterate_opdata_t.java5
-rw-r--r--java/src/hdf/hdf5lib/callbacks/H5O_iterate_t.java26
-rw-r--r--java/src/hdf/hdf5lib/callbacks/H5P_cls_close_func_cb.java22
-rw-r--r--java/src/hdf/hdf5lib/callbacks/H5P_cls_close_func_t.java5
-rw-r--r--java/src/hdf/hdf5lib/callbacks/H5P_cls_copy_func_cb.java23
-rw-r--r--java/src/hdf/hdf5lib/callbacks/H5P_cls_copy_func_t.java5
-rw-r--r--java/src/hdf/hdf5lib/callbacks/H5P_cls_create_func_cb.java22
-rw-r--r--java/src/hdf/hdf5lib/callbacks/H5P_cls_create_func_t.java5
-rw-r--r--java/src/hdf/hdf5lib/callbacks/H5P_iterate_cb.java23
-rw-r--r--java/src/hdf/hdf5lib/callbacks/H5P_iterate_t.java5
-rw-r--r--java/src/hdf/hdf5lib/callbacks/H5P_prp_close_func_cb.java23
-rw-r--r--java/src/hdf/hdf5lib/callbacks/H5P_prp_compare_func_cb.java23
-rw-r--r--java/src/hdf/hdf5lib/callbacks/H5P_prp_copy_func_cb.java23
-rw-r--r--java/src/hdf/hdf5lib/callbacks/H5P_prp_create_func_cb.java23
-rw-r--r--java/src/hdf/hdf5lib/callbacks/H5P_prp_delete_func_cb.java24
-rw-r--r--java/src/hdf/hdf5lib/callbacks/H5P_prp_get_func_cb.java24
-rw-r--r--java/src/hdf/hdf5lib/callbacks/H5P_prp_set_func_cb.java24
-rw-r--r--java/src/hdf/hdf5lib/exceptions/HDF5Exception.java3
-rw-r--r--java/src/hdf/hdf5lib/exceptions/HDF5IdException.java (renamed from java/src/hdf/hdf5lib/exceptions/HDF5AtomException.java)12
-rw-r--r--java/src/hdf/hdf5lib/exceptions/HDF5LibraryException.java8
-rw-r--r--java/src/hdf/hdf5lib/exceptions/HDF5ReferenceException.java6
-rw-r--r--java/src/hdf/hdf5lib/structs/H5AC_cache_config_t.java249
-rw-r--r--java/src/hdf/hdf5lib/structs/H5A_info_t.java18
-rw-r--r--java/src/hdf/hdf5lib/structs/H5E_error2_t.java28
-rw-r--r--java/src/hdf/hdf5lib/structs/H5FD_hdfs_fapl_t.java20
-rw-r--r--java/src/hdf/hdf5lib/structs/H5FD_ros3_fapl_t.java7
-rw-r--r--java/src/hdf/hdf5lib/structs/H5F_info2_t.java45
-rw-r--r--java/src/hdf/hdf5lib/structs/H5G_info_t.java18
-rw-r--r--java/src/hdf/hdf5lib/structs/H5L_info_t.java16
-rw-r--r--java/src/hdf/hdf5lib/structs/H5O_hdr_info_t.java56
-rw-r--r--java/src/hdf/hdf5lib/structs/H5O_info_t.java45
-rw-r--r--java/src/hdf/hdf5lib/structs/H5O_native_info_t.java18
-rw-r--r--java/src/hdf/hdf5lib/structs/H5O_token_t.java15
-rw-r--r--java/src/hdf/hdf5lib/structs/H5_ih_info_t.java14
-rw-r--r--java/src/jni/CMakeLists.txt1
-rw-r--r--java/src/jni/exceptionImp.c37
-rw-r--r--java/src/jni/exceptionImp.h7
-rw-r--r--java/src/jni/h5Constants.c387
-rw-r--r--java/src/jni/h5Imp.h7
-rw-r--r--java/src/jni/h5aImp.c4
-rw-r--r--java/src/jni/h5aImp.h7
-rw-r--r--java/src/jni/h5dImp.c5
-rw-r--r--java/src/jni/h5dImp.h7
-rw-r--r--java/src/jni/h5eImp.c1
-rw-r--r--java/src/jni/h5eImp.h7
-rw-r--r--java/src/jni/h5fImp.h7
-rw-r--r--java/src/jni/h5gImp.h7
-rw-r--r--java/src/jni/h5iImp.h7
-rw-r--r--java/src/jni/h5jni.h28
-rw-r--r--java/src/jni/h5lImp.c1
-rw-r--r--java/src/jni/h5lImp.h7
-rw-r--r--java/src/jni/h5oImp.c1
-rw-r--r--java/src/jni/h5oImp.h7
-rw-r--r--java/src/jni/h5pACPLImp.c1
-rw-r--r--java/src/jni/h5pACPLImp.h7
-rw-r--r--java/src/jni/h5pDAPLImp.c1
-rw-r--r--java/src/jni/h5pDAPLImp.h7
-rw-r--r--java/src/jni/h5pDCPLImp.c1
-rw-r--r--java/src/jni/h5pDCPLImp.h7
-rw-r--r--java/src/jni/h5pDXPLImp.c1
-rw-r--r--java/src/jni/h5pDXPLImp.h7
-rw-r--r--java/src/jni/h5pFAPLImp.c71
-rw-r--r--java/src/jni/h5pFAPLImp.h33
-rw-r--r--java/src/jni/h5pFCPLImp.c1
-rw-r--r--java/src/jni/h5pFCPLImp.h7
-rw-r--r--java/src/jni/h5pGAPLImp.c1
-rw-r--r--java/src/jni/h5pGAPLImp.h7
-rw-r--r--java/src/jni/h5pGCPLImp.c1
-rw-r--r--java/src/jni/h5pGCPLImp.h7
-rw-r--r--java/src/jni/h5pImp.h7
-rw-r--r--java/src/jni/h5pLAPLImp.c1
-rw-r--r--java/src/jni/h5pLAPLImp.h7
-rw-r--r--java/src/jni/h5pLCPLImp.c1
-rw-r--r--java/src/jni/h5pLCPLImp.h7
-rw-r--r--java/src/jni/h5pOCPLImp.c1
-rw-r--r--java/src/jni/h5pOCPLImp.h7
-rw-r--r--java/src/jni/h5pOCpyPLImp.c1
-rw-r--r--java/src/jni/h5pOCpyPLImp.h7
-rw-r--r--java/src/jni/h5pStrCPLImp.c1
-rw-r--r--java/src/jni/h5pStrCPLImp.h7
-rw-r--r--java/src/jni/h5plImp.c1
-rw-r--r--java/src/jni/h5plImp.h7
-rw-r--r--java/src/jni/h5rImp.h7
-rw-r--r--java/src/jni/h5sImp.c383
-rw-r--r--java/src/jni/h5sImp.h66
-rw-r--r--java/src/jni/h5tImp.h7
-rw-r--r--java/src/jni/h5util.c1254
-rw-r--r--java/src/jni/h5util.h20
-rw-r--r--java/src/jni/h5vlImp.c1
-rw-r--r--java/src/jni/h5vlImp.h7
-rw-r--r--java/src/jni/h5zImp.h7
-rw-r--r--java/src/jni/nativeData.h7
-rw-r--r--java/test/CMakeLists.txt15
-rw-r--r--java/test/Makefile.am3
-rw-r--r--java/test/TestAll.java7
-rw-r--r--java/test/TestH5.java248
-rw-r--r--java/test/TestH5A.java115
-rw-r--r--java/test/TestH5Arw.java449
-rw-r--r--java/test/TestH5D.java43
-rw-r--r--java/test/TestH5Dparams.java1
-rw-r--r--java/test/TestH5Dplist.java9
-rw-r--r--java/test/TestH5Drw.java378
-rw-r--r--java/test/TestH5E.java1
-rw-r--r--java/test/TestH5Edefault.java85
-rw-r--r--java/test/TestH5Eparams.java1
-rw-r--r--java/test/TestH5Eregister.java1
-rw-r--r--java/test/TestH5F.java19
-rw-r--r--java/test/TestH5Fbasic.java17
-rw-r--r--java/test/TestH5Fparams.java13
-rw-r--r--java/test/TestH5Fswmr.java13
-rw-r--r--java/test/TestH5G.java31
-rw-r--r--java/test/TestH5Gbasic.java17
-rw-r--r--java/test/TestH5Giterate.java7
-rw-r--r--java/test/TestH5Lbasic.java3
-rw-r--r--java/test/TestH5Lcreate.java19
-rw-r--r--java/test/TestH5Lparams.java1
-rw-r--r--java/test/TestH5Obasic.java55
-rw-r--r--java/test/TestH5Ocopy.java41
-rw-r--r--java/test/TestH5Ocreate.java27
-rw-r--r--java/test/TestH5Oparams.java1
-rw-r--r--java/test/TestH5P.java31
-rw-r--r--java/test/TestH5PData.java11
-rw-r--r--java/test/TestH5PL.java11
-rw-r--r--java/test/TestH5Pfapl.java61
-rw-r--r--java/test/TestH5Pfaplhdfs.java11
-rw-r--r--java/test/TestH5Pfapls3.java11
-rw-r--r--java/test/TestH5Plist.java33
-rw-r--r--java/test/TestH5Pvirtual.java27
-rw-r--r--java/test/TestH5R.java118
-rw-r--r--java/test/TestH5Rref.java561
-rw-r--r--java/test/TestH5S.java21
-rw-r--r--java/test/TestH5Sbasic.java153
-rw-r--r--java/test/TestH5T.java23
-rw-r--r--java/test/TestH5Tbasic.java13
-rw-r--r--java/test/TestH5Tparams.java1
-rw-r--r--java/test/TestH5VL.java53
-rw-r--r--java/test/TestH5Z.java1
-rw-r--r--java/test/junit.sh.in76
-rw-r--r--java/test/testfiles/JUnit-TestH5.txt6
-rw-r--r--java/test/testfiles/JUnit-TestH5Arw.txt13
-rw-r--r--java/test/testfiles/JUnit-TestH5Drw.txt13
-rw-r--r--java/test/testfiles/JUnit-TestH5Pfapl.txt3
-rw-r--r--java/test/testfiles/JUnit-TestH5Rref.txt10
-rw-r--r--java/test/testfiles/JUnit-TestH5Sbasic.txt16
-rw-r--r--src/CMakeLists.txt31
-rw-r--r--src/H5.c37
-rw-r--r--src/H5ACmpio.c17
-rw-r--r--src/H5Abtree2.c12
-rw-r--r--src/H5Adense.c16
-rw-r--r--src/H5Adeprec.c12
-rw-r--r--src/H5Aint.c27
-rw-r--r--src/H5Amodule.h40
-rw-r--r--src/H5Apublic.h56
-rw-r--r--src/H5B.c19
-rw-r--r--src/H5B2.c3
-rw-r--r--src/H5B2cache.c30
-rw-r--r--src/H5B2dbg.c20
-rw-r--r--src/H5B2hdr.c3
-rw-r--r--src/H5B2int.c122
-rw-r--r--src/H5B2internal.c12
-rw-r--r--src/H5B2leaf.c23
-rw-r--r--src/H5B2stat.c2
-rw-r--r--src/H5B2test.c6
-rw-r--r--src/H5Bcache.c9
-rw-r--r--src/H5Bdbg.c11
-rw-r--r--src/H5C.c211
-rw-r--r--src/H5CX.c2
-rw-r--r--src/H5Cdbg.c51
-rw-r--r--src/H5D.c290
-rw-r--r--src/H5Dbtree.c9
-rw-r--r--src/H5Dbtree2.c21
-rw-r--r--src/H5Dchunk.c178
-rw-r--r--src/H5Dcompact.c6
-rw-r--r--src/H5Dcontig.c6
-rw-r--r--src/H5Ddbg.c3
-rw-r--r--src/H5Ddeprec.c10
-rw-r--r--src/H5Dearray.c12
-rw-r--r--src/H5Defl.c5
-rw-r--r--src/H5Dfarray.c12
-rw-r--r--src/H5Dfill.c56
-rw-r--r--src/H5Dint.c60
-rw-r--r--src/H5Dio.c2
-rw-r--r--src/H5Dmodule.h38
-rw-r--r--src/H5Dmpio.c32
-rw-r--r--src/H5Dnone.c4
-rw-r--r--src/H5Doh.c2
-rw-r--r--src/H5Dpkg.h1
-rw-r--r--src/H5Dpublic.h1561
-rw-r--r--src/H5Dscatgath.c197
-rw-r--r--src/H5Dsingle.c4
-rw-r--r--src/H5Dtest.c2
-rw-r--r--src/H5Dvirtual.c16
-rw-r--r--src/H5E.c220
-rw-r--r--src/H5EA.c25
-rw-r--r--src/H5EAcache.c46
-rw-r--r--src/H5EAdbg.c39
-rw-r--r--src/H5EAdblkpage.c7
-rw-r--r--src/H5EAdblock.c9
-rw-r--r--src/H5EAhdr.c16
-rw-r--r--src/H5EAiblock.c34
-rw-r--r--src/H5EAint.c4
-rw-r--r--src/H5EAstat.c9
-rw-r--r--src/H5EAtest.c2
-rw-r--r--src/H5ESpublic.h83
-rw-r--r--src/H5Edeprec.c19
-rw-r--r--src/H5Eint.c39
-rw-r--r--src/H5Emodule.h29
-rw-r--r--src/H5Eprivate.h13
-rw-r--r--src/H5Epublic.h797
-rw-r--r--src/H5F.c214
-rw-r--r--src/H5FA.c3
-rw-r--r--src/H5FAcache.c22
-rw-r--r--src/H5FAdbg.c23
-rw-r--r--src/H5FAhdr.c4
-rw-r--r--src/H5FAint.c2
-rw-r--r--src/H5FAstat.c6
-rw-r--r--src/H5FD.c62
-rw-r--r--src/H5FDcore.c68
-rw-r--r--src/H5FDdirect.c300
-rw-r--r--src/H5FDfamily.c618
-rw-r--r--src/H5FDhdfs.c1
-rw-r--r--src/H5FDint.c44
-rw-r--r--src/H5FDlog.c565
-rw-r--r--src/H5FDlog.h405
-rw-r--r--src/H5FDmirror.c889
-rw-r--r--src/H5FDmirror.h291
-rw-r--r--src/H5FDmirror_priv.h317
-rw-r--r--src/H5FDmpi.h8
-rw-r--r--src/H5FDmpio.c128
-rw-r--r--src/H5FDmpio.h225
-rw-r--r--src/H5FDmulti.c893
-rw-r--r--src/H5FDmulti.h219
-rw-r--r--src/H5FDprivate.h1
-rw-r--r--src/H5FDpublic.h90
-rw-r--r--src/H5FDros3.c598
-rw-r--r--src/H5FDros3.h14
-rw-r--r--src/H5FDs3comms.c1067
-rw-r--r--src/H5FDsec2.c250
-rw-r--r--src/H5FDspace.c14
-rw-r--r--src/H5FDsplitter.c767
-rw-r--r--src/H5FDsplitter.h14
-rw-r--r--src/H5FDstdio.c140
-rw-r--r--src/H5FDstdio.h16
-rw-r--r--src/H5FDtest.c3
-rw-r--r--src/H5FDvfd_swmr.c3
-rw-r--r--src/H5FDwindows.h30
-rw-r--r--src/H5FL.c2
-rw-r--r--src/H5FS.c11
-rw-r--r--src/H5FScache.c12
-rw-r--r--src/H5FSdbg.c21
-rw-r--r--src/H5FSint.c2
-rw-r--r--src/H5FSsection.c156
-rw-r--r--src/H5Faccum.c8
-rw-r--r--src/H5Fcwfs.c2
-rw-r--r--src/H5Fdbg.c14
-rw-r--r--src/H5Fdeprec.c6
-rw-r--r--src/H5Fefc.c2
-rw-r--r--src/H5Ffake.c2
-rw-r--r--src/H5Fint.c49
-rw-r--r--src/H5Fio.c18
-rw-r--r--src/H5Fmodule.h30
-rw-r--r--src/H5Fmount.c127
-rw-r--r--src/H5Fprivate.h1
-rw-r--r--src/H5Fquery.c1
-rw-r--r--src/H5Fsfile.c30
-rw-r--r--src/H5Fspace.c2
-rw-r--r--src/H5Fsuper.c14
-rw-r--r--src/H5Fsuper_cache.c14
-rw-r--r--src/H5Gbtree2.c154
-rw-r--r--src/H5Gcompact.c20
-rw-r--r--src/H5Gdense.c169
-rw-r--r--src/H5Gdeprec.c2
-rw-r--r--src/H5Gent.c18
-rw-r--r--src/H5Gint.c7
-rw-r--r--src/H5Glink.c48
-rw-r--r--src/H5Gloc.c17
-rw-r--r--src/H5Gmodule.h91
-rw-r--r--src/H5Gname.c1
-rw-r--r--src/H5Gnode.c102
-rw-r--r--src/H5Goh.c2
-rw-r--r--src/H5Groot.c4
-rw-r--r--src/H5Gstab.c39
-rw-r--r--src/H5Gtest.c2
-rw-r--r--src/H5Gtraverse.c15
-rw-r--r--src/H5HF.c65
-rw-r--r--src/H5HFbtree2.c18
-rw-r--r--src/H5HFcache.c48
-rw-r--r--src/H5HFdbg.c122
-rw-r--r--src/H5HFdblock.c47
-rw-r--r--src/H5HFdtable.c73
-rw-r--r--src/H5HFhdr.c255
-rw-r--r--src/H5HFhuge.c97
-rw-r--r--src/H5HFiblock.c121
-rw-r--r--src/H5HFiter.c133
-rw-r--r--src/H5HFman.c41
-rw-r--r--src/H5HFpkg.h134
-rw-r--r--src/H5HFprivate.h17
-rw-r--r--src/H5HFsection.c434
-rw-r--r--src/H5HFspace.c42
-rw-r--r--src/H5HFstat.c2
-rw-r--r--src/H5HFtest.c21
-rw-r--r--src/H5HFtiny.c86
-rw-r--r--src/H5HG.c2
-rw-r--r--src/H5HGcache.c4
-rw-r--r--src/H5HGdbg.c3
-rw-r--r--src/H5HGquery.c2
-rw-r--r--src/H5HL.c8
-rw-r--r--src/H5HLcache.c10
-rw-r--r--src/H5HLdbg.c11
-rw-r--r--src/H5HLdblk.c2
-rw-r--r--src/H5HLint.c2
-rw-r--r--src/H5HLprfx.c2
-rw-r--r--src/H5HP.c72
-rw-r--r--src/H5I.c1860
-rw-r--r--src/H5Idbg.c205
-rw-r--r--src/H5Iint.c1790
-rw-r--r--src/H5Imodule.h2
-rw-r--r--src/H5Ipkg.h60
-rw-r--r--src/H5Iprivate.h6
-rw-r--r--src/H5Ipublic.h752
-rw-r--r--src/H5Itest.c10
-rw-r--r--src/H5Lexternal.c15
-rw-r--r--src/H5Lmodule.h2
-rw-r--r--src/H5M.c4
-rw-r--r--src/H5MFdbg.c26
-rw-r--r--src/H5MM.c17
-rw-r--r--src/H5MMpublic.h5
-rw-r--r--src/H5MP.c30
-rw-r--r--src/H5MPtest.c20
-rw-r--r--src/H5Mmodule.h45
-rw-r--r--src/H5Mpublic.h363
-rw-r--r--src/H5Oainfo.c75
-rw-r--r--src/H5Oalloc.c27
-rw-r--r--src/H5Oattr.c152
-rw-r--r--src/H5Oattribute.c11
-rw-r--r--src/H5Obogus.c40
-rw-r--r--src/H5Obtreek.c62
-rw-r--r--src/H5Ocache.c9
-rw-r--r--src/H5Ocache_image.c41
-rw-r--r--src/H5Ochunk.c2
-rw-r--r--src/H5Ocont.c2
-rw-r--r--src/H5Odbg.c25
-rw-r--r--src/H5Odeprec.c31
-rw-r--r--src/H5Odrvinfo.c64
-rw-r--r--src/H5Odtype.c183
-rw-r--r--src/H5Oefl.c74
-rw-r--r--src/H5Ofill.c180
-rw-r--r--src/H5Oflush.c18
-rw-r--r--src/H5Ofsinfo.c231
-rw-r--r--src/H5Oginfo.c63
-rw-r--r--src/H5Oint.c55
-rw-r--r--src/H5Olayout.c54
-rw-r--r--src/H5Olinfo.c65
-rw-r--r--src/H5Olink.c70
-rw-r--r--src/H5Omessage.c34
-rw-r--r--src/H5Omtime.c92
-rw-r--r--src/H5Oname.c55
-rw-r--r--src/H5Onull.c1
-rw-r--r--src/H5Opline.c133
-rw-r--r--src/H5Orefcount.c99
-rw-r--r--src/H5Osdspace.c132
-rw-r--r--src/H5Oshared.c9
-rw-r--r--src/H5Oshmesg.c41
-rw-r--r--src/H5Ostab.c18
-rw-r--r--src/H5Ounknown.c2
-rw-r--r--src/H5P.c30
-rw-r--r--src/H5Pdapl.c96
-rw-r--r--src/H5Pdcpl.c130
-rw-r--r--src/H5Pdeprec.c8
-rw-r--r--src/H5Pdxpl.c71
-rw-r--r--src/H5Pencdec.c2
-rw-r--r--src/H5Pfapl.c96
-rw-r--r--src/H5Pfcpl.c115
-rw-r--r--src/H5Pfmpl.c14
-rw-r--r--src/H5Pgcpl.c18
-rw-r--r--src/H5Pint.c22
-rw-r--r--src/H5Plapl.c40
-rw-r--r--src/H5Plcpl.c18
-rw-r--r--src/H5Pmapl.c8
-rw-r--r--src/H5Pmodule.h5
-rw-r--r--src/H5Pocpl.c125
-rw-r--r--src/H5Pocpypl.c18
-rw-r--r--src/H5Pstrcpl.c6
-rw-r--r--src/H5Ptest.c6
-rw-r--r--src/H5S.c95
-rw-r--r--src/H5SM.c22
-rw-r--r--src/H5SMbtree2.c6
-rw-r--r--src/H5ST.c779
-rw-r--r--src/H5STprivate.h63
-rw-r--r--src/H5Sall.c2
-rw-r--r--src/H5Sdbg.c1
-rw-r--r--src/H5Sdeprec.c1
-rw-r--r--src/H5Shyper.c56
-rw-r--r--src/H5Smpio.c28
-rw-r--r--src/H5Snone.c2
-rw-r--r--src/H5Spkg.h8
-rw-r--r--src/H5Spoint.c46
-rw-r--r--src/H5Sprivate.h3
-rw-r--r--src/H5Spublic.h1298
-rw-r--r--src/H5Sselect.c143
-rw-r--r--src/H5Stest.c2
-rw-r--r--src/H5T.c66
-rw-r--r--src/H5Tarray.c12
-rw-r--r--src/H5Tcompound.c18
-rw-r--r--src/H5Tconv.c164
-rw-r--r--src/H5Tcset.c8
-rw-r--r--src/H5Tdbg.c22
-rw-r--r--src/H5Tdeprec.c2
-rw-r--r--src/H5Tenum.c57
-rw-r--r--src/H5Tfields.c13
-rw-r--r--src/H5Tfixed.c9
-rw-r--r--src/H5Tfloat.c4
-rw-r--r--src/H5Tmodule.h4
-rw-r--r--src/H5Tnative.c26
-rw-r--r--src/H5Toffset.c20
-rw-r--r--src/H5Toh.c2
-rw-r--r--src/H5Topaque.c4
-rw-r--r--src/H5Torder.c14
-rw-r--r--src/H5Tpad.c8
-rw-r--r--src/H5Tpkg.h2
-rw-r--r--src/H5Tprecis.c12
-rw-r--r--src/H5Tprivate.h4
-rw-r--r--src/H5Tref.c70
-rw-r--r--src/H5Tstrpad.c8
-rw-r--r--src/H5Tvisit.c2
-rw-r--r--src/H5Tvlen.c10
-rw-r--r--src/H5VLconnector.h117
-rw-r--r--src/H5VLint.c293
-rw-r--r--src/H5VLmodule.h4
-rw-r--r--src/H5VLnative.c36
-rw-r--r--src/H5VLnative.h21
-rw-r--r--src/H5VLnative_blob.c2
-rw-r--r--src/H5VLnative_dataset.c23
-rw-r--r--src/H5VLnative_file.c21
-rw-r--r--src/H5VLnative_object.c2
-rw-r--r--src/H5VLpassthru.c3
-rw-r--r--src/H5VLprivate.h16
-rw-r--r--src/H5VLpublic.h335
-rw-r--r--src/H5VM.c77
-rw-r--r--src/H5WB.c6
-rw-r--r--src/H5Z.c145
-rw-r--r--src/H5Zdeflate.c32
-rw-r--r--src/H5Zfletcher32.c39
-rw-r--r--src/H5Zmodule.h8
-rw-r--r--src/H5Znbit.c361
-rw-r--r--src/H5Zprivate.h2
-rw-r--r--src/H5Zpublic.h680
-rw-r--r--src/H5Zscaleoffset.c589
-rw-r--r--src/H5Zshuffle.c60
-rw-r--r--src/H5Zszip.c58
-rw-r--r--src/H5Ztrans.c378
-rw-r--r--src/H5err.txt27
-rw-r--r--src/H5private.h34
-rw-r--r--src/H5public.h234
-rw-r--r--src/H5system.c421
-rw-r--r--src/H5trace.c65
-rw-r--r--src/Makefile.am6
-rw-r--r--src/hdf5.h1
-rw-r--r--src/uthash.h1184
-rw-r--r--test/CMakeLists.txt1
-rw-r--r--test/Makefile.am5
-rw-r--r--test/SWMR_UseCase_UG.txt4
-rw-r--r--test/big.c6
-rw-r--r--test/chunk_info.c17
-rw-r--r--test/dsets.c116
-rw-r--r--test/dtypes.c80
-rw-r--r--test/earray.c29
-rw-r--r--test/error_test.c121
-rw-r--r--test/farray.c12
-rw-r--r--test/fheap.c1853
-rw-r--r--test/fillval.c18
-rw-r--r--test/filter_plugin1_dsets.c16
-rw-r--r--test/filter_plugin2_dsets.c18
-rw-r--r--test/filter_plugin3_dsets.c16
-rw-r--r--test/filter_plugin4_groups.c18
-rw-r--r--test/freespace.c15
-rw-r--r--test/gen_new_array.c2
-rw-r--r--test/gen_new_fill.c2
-rw-r--r--test/gen_new_group.c2
-rw-r--r--test/gen_new_mtime.c2
-rw-r--r--test/gen_new_super.c2
-rw-r--r--test/gen_old_array.c2
-rw-r--r--test/gen_old_group.c2
-rw-r--r--test/gen_old_layout.c2
-rw-r--r--test/gen_old_mtime.c2
-rw-r--r--test/gen_plist.c2
-rw-r--r--test/gen_sizes_lheap.c2
-rw-r--r--test/gen_specmetaread.c2
-rw-r--r--test/gen_udlinks.c2
-rw-r--r--test/h5test.c65
-rw-r--r--test/hyperslab.c4
-rw-r--r--test/links_env.c4
-rw-r--r--test/mf.c100
-rw-r--r--test/mount.c54
-rw-r--r--test/mtime.c4
-rw-r--r--test/ntypes.c228
-rw-r--r--test/null_vol_connector.c3
-rw-r--r--test/null_vol_connector.h6
-rw-r--r--test/pool.c14
-rw-r--r--test/reserved.c6
-rw-r--r--test/ros3.c105
-rw-r--r--test/s3comms.c118
-rw-r--r--test/set_extent.c10
-rw-r--r--test/space_overflow.c2
-rw-r--r--test/stab.c10
-rw-r--r--test/swmr_addrem_writer.c20
-rw-r--r--test/swmr_generator.c30
-rw-r--r--test/swmr_remove_writer.c20
-rw-r--r--test/swmr_sparse_writer.c20
-rw-r--r--test/swmr_start_write.c10
-rw-r--r--test/swmr_writer.c16
-rw-r--r--test/tarray.c46
-rw-r--r--test/tattr.c57
-rw-r--r--test/tchecksum.c2
-rw-r--r--test/tcoords.c20
-rw-r--r--test/testerror.sh.in6
-rw-r--r--test/testexternal_env.sh.in8
-rw-r--r--test/testflushrefresh.sh.in16
-rw-r--r--test/testframe.c12
-rw-r--r--test/testhdf5.c1
-rw-r--r--test/testhdf5.h1
-rw-r--r--test/testlinks_env.sh.in4
-rw-r--r--test/testmeta.c4
-rw-r--r--test/testvds_env.sh.in4
-rw-r--r--test/testvfdswmr.sh.in69
-rw-r--r--test/tfile.c21
-rw-r--r--test/tid.c382
-rw-r--r--test/tselect.c229
-rw-r--r--test/ttst.c391
-rw-r--r--test/tunicode.c8
-rw-r--r--test/tvlstr.c25
-rw-r--r--test/tvltypes.c144
-rw-r--r--test/twriteorder.c20
-rw-r--r--test/unlink.c6
-rw-r--r--test/use_append_chunk.c10
-rw-r--r--test/use_append_chunk_mirror.c10
-rw-r--r--test/use_append_mchunks.c20
-rw-r--r--test/use_common.c14
-rw-r--r--test/use_disable_mdc_flushes.c10
-rw-r--r--test/vds.c2
-rw-r--r--test/vds_env.c2
-rw-r--r--test/vfd.c370
-rw-r--r--test/vfd_swmr_dsetops_writer.c1835
-rw-r--r--test/vol.c21
-rw-r--r--testpar/t_2Gio.c19
-rw-r--r--testpar/t_bigio.c130
-rw-r--r--testpar/t_cache.c28
-rw-r--r--testpar/t_cache_image.c380
-rw-r--r--testpar/t_dset.c73
-rw-r--r--testpar/t_file.c55
-rw-r--r--testpar/t_filters_parallel.c134
-rw-r--r--testpar/t_mdset.c153
-rw-r--r--testpar/t_pread.c52
-rw-r--r--testpar/t_prop.c189
-rw-r--r--testpar/t_shapesame.c34
-rw-r--r--testpar/testphdf5.c5
-rw-r--r--testpar/testphdf5.h14
-rw-r--r--tools/lib/h5diff.c10
-rw-r--r--tools/lib/h5diff_attr.c51
-rw-r--r--tools/lib/h5diff_util.c4
-rw-r--r--tools/lib/h5tools.c10
-rw-r--r--tools/lib/h5tools.h7
-rw-r--r--tools/lib/h5tools_dump.c19
-rw-r--r--tools/lib/h5tools_ref.c2
-rw-r--r--tools/lib/h5tools_str.c4
-rw-r--r--tools/lib/h5tools_str.h2
-rw-r--r--tools/lib/h5tools_utils.c3
-rw-r--r--tools/lib/h5trav.c4
-rw-r--r--tools/lib/h5trav.h3
-rw-r--r--tools/libtest/h5tools_test_utils.c11
-rw-r--r--tools/src/h5copy/h5copy.c4
-rw-r--r--tools/src/h5dump/h5dump.h6
-rw-r--r--tools/src/h5dump/h5dump_ddl.c6
-rw-r--r--tools/src/h5dump/h5dump_ddl.h6
-rw-r--r--tools/src/h5dump/h5dump_defines.h6
-rw-r--r--tools/src/h5dump/h5dump_extern.h6
-rw-r--r--tools/src/h5dump/h5dump_xml.h6
-rw-r--r--tools/src/h5import/h5import.h6
-rw-r--r--tools/src/h5repack/h5repack.h6
-rw-r--r--tools/src/h5stat/h5stat.c84
-rw-r--r--tools/src/misc/CMakeLists.txt22
-rw-r--r--tools/src/misc/Makefile.am3
-rw-r--r--tools/src/misc/h5clear.c2
-rw-r--r--tools/src/misc/h5debug.c2
-rw-r--r--tools/src/misc/h5delete.c66
-rw-r--r--tools/src/misc/h5repart.c10
-rw-r--r--tools/test/h5dump/errfiles/tall-1.err2
-rw-r--r--tools/test/h5dump/errfiles/tall-2A.err2
-rw-r--r--tools/test/h5dump/errfiles/tall-2A0.err2
-rw-r--r--tools/test/h5dump/errfiles/tall-2B.err2
-rw-r--r--tools/test/h5dump/errfiles/textlink.err4
-rw-r--r--tools/test/h5dump/errfiles/textlinkfar.err18
-rw-r--r--tools/test/h5dump/errfiles/textlinksrc.err18
-rw-r--r--tools/test/h5dump/errfiles/torderlinks1.err2
-rw-r--r--tools/test/h5dump/errfiles/torderlinks2.err2
-rw-r--r--tools/test/h5repack/testfiles/h5repack_layout.h5-dset2_chunk_20x10-errstk.tst2
-rw-r--r--utils/mirror_vfd/mirror_remote.h2
680 files changed, 34501 insertions, 19123 deletions
diff --git a/.gitattributes b/.gitattributes
index 2ad5b6e..e01442a 100644
--- a/.gitattributes
+++ b/.gitattributes
@@ -365,6 +365,7 @@ m4/ax_check_rqrd_class.m4 -text
m4/ax_java_check_class.m4 -text
m4/ax_java_options.m4 -text
m4/ax_jni_include_dir.m4 -text
+m4/ax_prog_doxygen.m4 -text
m4/ax_prog_jar.m4 -text
m4/ax_prog_java.m4 -text
m4/ax_prog_java_cc.m4 -text
@@ -784,6 +785,7 @@ tools/testfiles/tints4dimsStride2.ddl -text
tools/testfiles/tintsattrs.h5 -text svneol=unset#application/x-hdf
tools/testfiles/tlarge_objname.h5 -text
tools/testfiles/tldouble.h5 -text
+tools/testfiles/tldouble_scalar.h5 -text
tools/testfiles/tlonglinks.h5 -text
tools/testfiles/tloop.h5 -text
tools/testfiles/tloop2.h5 -text
diff --git a/.github/workflows/pr-check.yml b/.github/workflows/pr-check.yml
index b50bf59..eeb807d 100644
--- a/.github/workflows/pr-check.yml
+++ b/.github/workflows/pr-check.yml
@@ -3,7 +3,7 @@ name: hdf5 dev CI
# Controls when the action will run. Triggers the workflow on push or pull request
on:
pull_request:
- branches: [ develop, hdf5_1_12, hdf5_1_10, hdf5_1_8 ]
+ branches: [ develop, hdf5_1_12, hdf5_1_10, hdf5_1_8, feature/vfd_swmr ]
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
diff --git a/MANIFEST b/MANIFEST
index 6071746..133180b 100644
--- a/MANIFEST
+++ b/MANIFEST
@@ -793,6 +793,7 @@
./src/H5FDlog.h
./src/H5FDmirror.c
./src/H5FDmirror.h
+./src/H5FDmirror_priv.h
./src/H5FDmodule.h
./src/H5FDmpi.c
./src/H5FDmpi.h
@@ -897,6 +898,8 @@
./src/H5HP.c
./src/H5HPprivate.h
./src/H5I.c
+./src/H5Idbg.c
+./src/H5Iint.c
./src/H5Imodule.h
./src/H5Ipkg.h
./src/H5Iprivate.h
@@ -1049,8 +1052,6 @@
./src/H5SMpkg.h
./src/H5SMprivate.h
./src/H5SMtest.c
-./src/H5ST.c
-./src/H5STprivate.h
./src/H5T.c
./src/H5Tarray.c
./src/H5Tbit.c
@@ -1130,6 +1131,7 @@
./src/Makefile.am
./src/hdf5.h
./src/libhdf5.settings.in
+./src/uthash.h
./test/AtomicWriterReader.txt
./test/H5srcdir.h
@@ -1362,7 +1364,6 @@
./test/tskiplist.c
./test/tsohm.c
./test/ttime.c
-./test/ttst.c
./test/ttsafe.c
./test/ttsafe.h
./test/ttsafe_acreate.c
@@ -1771,6 +1772,7 @@
./tools/src/misc/Makefile.am
./tools/src/misc/h5clear.c
./tools/src/misc/h5debug.c
+./tools/src/misc/h5delete.c
./tools/src/misc/h5mkgrp.c
./tools/src/misc/h5repart.c
./tools/test/misc/Makefile.am
@@ -3259,7 +3261,6 @@
./java/src/hdf/hdf5lib/callbacks/H5P_iterate_cb.java
./java/src/hdf/hdf5lib/callbacks/H5P_iterate_t.java
-./java/src/hdf/hdf5lib/exceptions/HDF5AtomException.java
./java/src/hdf/hdf5lib/exceptions/HDF5AttributeException.java
./java/src/hdf/hdf5lib/exceptions/HDF5BtreeException.java
./java/src/hdf/hdf5lib/exceptions/HDF5DataFiltersException.java
@@ -3273,6 +3274,7 @@
./java/src/hdf/hdf5lib/exceptions/HDF5FunctionArgumentException.java
./java/src/hdf/hdf5lib/exceptions/HDF5FunctionEntryExitException.java
./java/src/hdf/hdf5lib/exceptions/HDF5HeapException.java
+./java/src/hdf/hdf5lib/exceptions/HDF5IdException.java
./java/src/hdf/hdf5lib/exceptions/HDF5InternalErrorException.java
./java/src/hdf/hdf5lib/exceptions/HDF5JavaException.java
./java/src/hdf/hdf5lib/exceptions/HDF5LibraryException.java
@@ -3432,9 +3434,11 @@
./java/test/junit.sh.in
./java/test/testfiles/JUnit-TestH5.txt
./java/test/testfiles/JUnit-TestH5A.txt
+./java/test/testfiles/JUnit-TestH5Arw.txt
./java/test/testfiles/JUnit-TestH5Dparams.txt
./java/test/testfiles/JUnit-TestH5D.txt
./java/test/testfiles/JUnit-TestH5Dplist.txt
+./java/test/testfiles/JUnit-TestH5Drw.txt
./java/test/testfiles/JUnit-TestH5E.txt
./java/test/testfiles/JUnit-TestH5Edefault.txt
./java/test/testfiles/JUnit-TestH5Eparams.txt
@@ -3462,6 +3466,7 @@
./java/test/testfiles/JUnit-TestH5Pvirtual.txt
./java/test/testfiles/JUnit-TestH5PL.txt
./java/test/testfiles/JUnit-TestH5R.txt
+./java/test/testfiles/JUnit-TestH5Rref.txt
./java/test/testfiles/JUnit-TestH5Sbasic.txt
./java/test/testfiles/JUnit-TestH5S.txt
./java/test/testfiles/JUnit-TestH5Tparams.txt
@@ -3472,9 +3477,11 @@
./java/test/h5ex_g_iterate.orig
./java/test/TestH5.java
./java/test/TestH5A.java
+./java/test/TestH5Arw.java
./java/test/TestH5Dparams.java
./java/test/TestH5D.java
./java/test/TestH5Dplist.java
+./java/test/TestH5Drw.java
./java/test/TestH5E.java
./java/test/TestH5Edefault.java
./java/test/TestH5Eparams.java
@@ -3502,6 +3509,7 @@
./java/test/TestH5Pvirtual.java
./java/test/TestH5PL.java
./java/test/TestH5R.java
+./java/test/TestH5Rref.java
./java/test/TestH5Sbasic.java
./java/test/TestH5S.java
./java/test/TestH5Tparams.java
@@ -3542,7 +3550,6 @@
./config/cmake/HDFCompilerFlags.cmake
./config/cmake/HDFCXXCompilerFlags.cmake
./config/cmake/HDFFortranCompilerFlags.cmake
-./config/cmake/HDF5_Process_Flex_Files.cmake
./config/cmake/HDF5Macros.cmake
./config/cmake/HDF5PluginMacros.cmake
./config/cmake/HDF5PluginCache.cmake
@@ -3550,7 +3557,6 @@
./config/cmake/jrunTest.cmake
./config/cmake/jvolTest.cmake
./config/cmake/libh5cc.in
-./config/cmake/libhdf5.pc.in
./config/cmake/libhdf5.settings.cmake.in
./config/cmake/mccacheinit.cmake
./config/cmake/patch.xml
diff --git a/Makefile.am b/Makefile.am
index cc38972..8518114 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -35,6 +35,9 @@
include $(top_srcdir)/config/commence.am
+# include Doxygen rules (requires autoconf-archive >2016-03-20)
+@DX_RULES@
+
# Define subdirectories to build.
## Automake understands that `make distclean' should recurse into
## conditional subdirectories even if `make all' does not.
@@ -187,15 +190,10 @@ check-all-install:
trace:
@(cd src && $(MAKE) $(AM_MAKEFLAGS) $@) || exit 1;
-# Run doxygen across source files.
-# Currently, only invoke doxygen in the src directory.
-doxygen:
- @echo Invoking doxygen
- for d in src; do \
- if test $$d != .; then \
- (cd $$d && $(MAKE) $(AM_MAKEFLAGS) $@) || exit 1; \
- fi; \
- done
+# doxygen support
+if BUILD_DOXYGEN_CONDITIONAL
+doxygen: doxygen-doc
+endif
# Run tests with different Virtual File Drivers.
# Currently, only invoke check-vfd in the test directory.
diff --git a/c++/src/H5PropList.cpp b/c++/src/H5PropList.cpp
index 3df403b..8b45f79 100644
--- a/c++/src/H5PropList.cpp
+++ b/c++/src/H5PropList.cpp
@@ -154,6 +154,7 @@ PropList::PropList(const hid_t plist_id) : IdComponent()
case H5I_UNINIT:
case H5I_MAP:
case H5I_SPACE_SEL_ITER:
+ case H5I_EVENTSET:
default:
id = H5P_DEFAULT;
break;
diff --git a/config/cmake/HDF5_Process_Flex_Files.cmake b/config/cmake/HDF5_Process_Flex_Files.cmake
deleted file mode 100644
index ca5ace7..0000000
--- a/config/cmake/HDF5_Process_Flex_Files.cmake
+++ /dev/null
@@ -1,95 +0,0 @@
-#
-# Copyright by The HDF Group.
-# All rights reserved.
-#
-# This file is part of HDF5. The full HDF5 copyright notice, including
-# terms governing use, modification, and redistribution, is contained in
-# the COPYING file, which can be found at the root of the source code
-# distribution tree, or in https://www.hdfgroup.org/licenses.
-# If you do not have access to either file, you may request a copy from
-# help@hdfgroup.org.
-#
-# post process flex/bison files
-
-message (STATUS "File: ${GEN_DIR} ${FILE_PARSE} ${FILE_ANALYZE}")
-
-if (FILE_PARSE)
- # fix H5LTparse.c to declare H5LTyyparse return type as an hid_t
- # instead of int. Currently the generated function H5LTyyparse is
- # generated with a return value of type int, which is a mapping to the
- # flex yyparse function. The return value in the HL library should be
- # an hid_t.
- # I propose to not use flex to generate this function, but for now I am
- # adding a perl command to find and replace this function declaration in
- # H5LTparse.c.
- file (READ ${GEN_DIR}/${FILE_PARSE}.c TEST_STREAM)
- string (REGEX REPLACE "int yyparse" "hid_t yyparse" TEST_STREAM "${TEST_STREAM}")
- string (REGEX REPLACE "int\nyyparse" "hid_t\nyyparse" TEST_STREAM "${TEST_STREAM}")
- string (REGEX REPLACE "int H5LTyyparse" "hid_t H5LTyyparse" TEST_STREAM "${TEST_STREAM}")
- file (WRITE ${FILE_PARSE}.c "${TEST_STREAM}")
- message (STATUS "replacing signature in H5LTparse.c")
-
- # Add code that disables warnings in the flex/bison-generated code.
- #
- # Note that the GCC pragmas did not exist until gcc 4.2. Earlier versions
- # will simply ignore them, but we want to avoid those warnings.
- file (READ ${FILE_PARSE}.c TEST_STREAM)
- file (WRITE ${FILE_PARSE}.c "
-#if __GNUC__ >= 4 && __GNUC_MINOR__ >=2\n
-#pragma GCC diagnostic ignored \"-Wconversion\"\n
-#pragma GCC diagnostic ignored \"-Wimplicit-function-declaration\"\n
-#pragma GCC diagnostic ignored \"-Wlarger-than=\"\n
-#pragma GCC diagnostic ignored \"-Wmissing-prototypes\"\n
-#pragma GCC diagnostic ignored \"-Wnested-externs\"\n
-#pragma GCC diagnostic ignored \"-Wold-style-definition\"\n
-#pragma GCC diagnostic ignored \"-Wsign-compare\"\n
-#pragma GCC diagnostic ignored \"-Wsign-conversion\"\n
-#pragma GCC diagnostic ignored \"-Wstrict-prototypes\"\n
-#pragma GCC diagnostic ignored \"-Wswitch-default\"\n
-#pragma GCC diagnostic ignored \"-Wunused-function\"\n
-#pragma GCC diagnostic ignored \"-Wunused-macros\"\n
-#pragma GCC diagnostic ignored \"-Wunused-parameter\"\n
-#pragma GCC diagnostic ignored \"-Wredundant-decls\"\n
-#elif defined __SUNPRO_CC\n
-#pragma disable_warn\n
-#elif defined _MSC_VER\n
-#pragma warning(push, 1)\n
-#endif\n
- ")
- file (APPEND ${FILE_PARSE}.c "${TEST_STREAM}")
- message (STATUS "processed pragma in ${FILE_PARSE}")
- file (READ ${GEN_DIR}/${FILE_PARSE}.h TEST_STREAM)
- file (WRITE ${FILE_PARSE}.h "${TEST_STREAM}")
-endif ()
-
-if (FILE_ANALYZE)
- # Add code that disables warnings in the flex/bison-generated code.
- #
- # Note that the GCC pragmas did not exist until gcc 4.2. Earlier versions
- # will simply ignore them, but we want to avoid those warnings.
- file (READ ${GEN_DIR}/${FILE_ANALYZE} TEST_STREAM)
- file (WRITE ${FILE_ANALYZE} "
-#if __GNUC__ >= 4 && __GNUC_MINOR__ >=2\n
-#pragma GCC diagnostic ignored \"-Wconversion\"\n
-#pragma GCC diagnostic ignored \"-Wimplicit-function-declaration\"\n
-#pragma GCC diagnostic ignored \"-Wlarger-than=\"\n
-#pragma GCC diagnostic ignored \"-Wmissing-prototypes\"\n
-#pragma GCC diagnostic ignored \"-Wnested-externs\"\n
-#pragma GCC diagnostic ignored \"-Wold-style-definition\"\n
-#pragma GCC diagnostic ignored \"-Wsign-compare\"\n
-#pragma GCC diagnostic ignored \"-Wsign-conversion\"\n
-#pragma GCC diagnostic ignored \"-Wstrict-prototypes\"\n
-#pragma GCC diagnostic ignored \"-Wswitch-default\"\n
-#pragma GCC diagnostic ignored \"-Wunused-function\"\n
-#pragma GCC diagnostic ignored \"-Wunused-macros\"\n
-#pragma GCC diagnostic ignored \"-Wunused-parameter\"\n
-#pragma GCC diagnostic ignored \"-Wredundant-decls\"\n
-#elif defined __SUNPRO_CC\n
-#pragma disable_warn\n
-#elif defined _MSC_VER\n
-#pragma warning(push, 1)\n
-#endif\n
- ")
- file (APPEND ${FILE_ANALYZE} "${TEST_STREAM}")
- message (STATUS "processed pragma in ${FILE_ANALYZE}")
-endif ()
diff --git a/config/cmake/libhdf5.pc.in b/config/cmake/libhdf5.pc.in
deleted file mode 100644
index 4a2ebaa..0000000
--- a/config/cmake/libhdf5.pc.in
+++ /dev/null
@@ -1,14 +0,0 @@
-prefix=@_PKG_CONFIG_PREFIX@
-exec_prefix=@_PKG_CONFIG_EXEC_PREFIX@
-libdir=@_PKG_CONFIG_LIBDIR@
-includedir=@_PKG_CONFIG_INCLUDEDIR@
-
-Name: @_PKG_CONFIG_LIBNAME@
-Description: HDF5 (Hierarchical Data Format 5) Software Library
-Version: @_PKG_CONFIG_VERSION@
-
-Cflags: -I${includedir}
-Libs: -L${libdir} @_PKG_CONFIG_SH_LIBS@
-Requires: @_PKG_CONFIG_REQUIRES@
-Libs.private: @_PKG_CONFIG_LIBS_PRIVATE@ @_PKG_CONFIG_LIBS@
-Requires.private: @_PKG_CONFIG_REQUIRES_PRIVATE@
diff --git a/configure.ac b/configure.ac
index 7fa32e5..d6dc7b3 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1126,6 +1126,7 @@ if test "X$HDF5_DOXYGEN" = "Xyes"; then
AC_SUBST([DOXYGEN_EXTERNAL_SEARCH])
AC_SUBST([DOXYGEN_SEARCHENGINE_URL])
+# SRCDIR Environment variables used inside doxygen macro for the source location:
DOXYGEN_PACKAGE=${PACKAGE_NAME}
DOXYGEN_VERSION_STRING=${PACKAGE_VERSION}
DOXYGEN_INCLUDE_ALIASES='$(SRCDIR)/doxygen/aliases'
@@ -1135,7 +1136,7 @@ if test "X$HDF5_DOXYGEN" = "Xyes"; then
DOXYGEN_OPTIMIZE_OUTPUT_FOR_C=YES
DOXYGEN_MACRO_EXPANSION=YES
DOXYGEN_OUTPUT_DIRECTORY=hdf5lib_docs
- DOXYGEN_EXAMPLES_DIRECTORY='$(SRCDIR)/doxygen/examples'
+ DOXYGEN_EXAMPLES_DIRECTORY='$(SRCDIR)/doxygen/examples $(SRCDIR)/src $(SRCDIR)/examples $(SRCDIR)/test'
DOXYGEN_LAYOUT_FILE='$(SRCDIR)/doxygen/hdf5doxy_layout.xml'
DOXYGEN_HTML_HEADER='$(SRCDIR)/doxygen/hdf5_header.html'
DOXYGEN_HTML_FOOTER='$(SRCDIR)/doxygen/hdf5_footer.html'
@@ -1145,7 +1146,7 @@ if test "X$HDF5_DOXYGEN" = "Xyes"; then
DOXYGEN_EXTERNAL_SEARCH=NO
DOXYGEN_SEARCHENGINE_URL=
- DX_INIT_DOXYGEN([HDF5], [../doxygen/Doxyfile], [hdf5lib_docs])
+ DX_INIT_DOXYGEN([HDF5], [./doxygen/Doxyfile], [hdf5lib_docs])
else
AC_MSG_RESULT([no])
diff --git a/doxygen/Doxyfile.in b/doxygen/Doxyfile.in
index b1cb955..29f3028 100644
--- a/doxygen/Doxyfile.in
+++ b/doxygen/Doxyfile.in
@@ -917,7 +917,7 @@ EXCLUDE_SYMBOLS =
# that contain example code fragments that are included (see the \include
# command).
-EXAMPLE_PATH = ../src ../examples ../test @DOXYGEN_EXAMPLES_DIRECTORY@
+EXAMPLE_PATH = @DOXYGEN_EXAMPLES_DIRECTORY@
# If the value of the EXAMPLE_PATH tag contains directories, you can use the
# EXAMPLE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp and
diff --git a/hl/src/H5LTanalyze.c b/hl/src/H5LTanalyze.c
index 65da9d0..875a37a 100644
--- a/hl/src/H5LTanalyze.c
+++ b/hl/src/H5LTanalyze.c
@@ -916,7 +916,7 @@ char *yytext;
#include "H5LTparse.h"
static char *trim_quotes(const char *);
-int my_yyinput(char *, int);
+static int my_yyinput(char *, int);
#undef YY_INPUT
#define YY_INPUT(b, r, ms) (r=my_yyinput(b, ms))
#define token(x) (int)x
@@ -2554,7 +2554,7 @@ trim_quotes(const char *quoted)
return trimmed;
}
-int my_yyinput(char *buf, int max_size)
+static int my_yyinput(char *buf, int max_size)
{
int ret;
diff --git a/hl/src/H5LTanalyze.l b/hl/src/H5LTanalyze.l
index fd1cbe5..5006612 100644
--- a/hl/src/H5LTanalyze.l
+++ b/hl/src/H5LTanalyze.l
@@ -27,7 +27,7 @@
#include "H5LTparse.h"
static char *trim_quotes(const char *);
-int my_yyinput(char *, int);
+static int my_yyinput(char *, int);
#undef YY_INPUT
#define YY_INPUT(b, r, ms) (r=my_yyinput(b, ms))
#define token(x) (int)x
@@ -144,7 +144,7 @@ trim_quotes(const char *quoted)
return trimmed;
}
-int my_yyinput(char *buf, int max_size)
+static int my_yyinput(char *buf, int max_size)
{
int ret;
diff --git a/java/examples/datasets/H5Ex_D_Alloc.java b/java/examples/datasets/H5Ex_D_Alloc.java
index dd7e7ae..4e10c23 100644
--- a/java/examples/datasets/H5Ex_D_Alloc.java
+++ b/java/examples/datasets/H5Ex_D_Alloc.java
@@ -1,6 +1,5 @@
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* 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 *
@@ -65,11 +64,11 @@ public class H5Ex_D_Alloc {
}
private static void allocation() {
- long file_id = -1;
- long filespace_id = -1;
- long dataset_id1 = -1;
- long dataset_id2 = -1;
- long dcpl_id = -1;
+ long file_id = HDF5Constants.H5I_INVALID_HID;
+ long filespace_id = HDF5Constants.H5I_INVALID_HID;
+ long dataset_id1 = HDF5Constants.H5I_INVALID_HID;
+ long dataset_id2 = HDF5Constants.H5I_INVALID_HID;
+ long dcpl_id = HDF5Constants.H5I_INVALID_HID;
long[] dims = { DIM_X, DIM_Y };
int[][] dset_data = new int[DIM_X][DIM_Y];
int space_status = 0;
diff --git a/java/examples/datasets/H5Ex_D_Checksum.java b/java/examples/datasets/H5Ex_D_Checksum.java
index 9dcfdb3..781dd68 100644
--- a/java/examples/datasets/H5Ex_D_Checksum.java
+++ b/java/examples/datasets/H5Ex_D_Checksum.java
@@ -1,6 +1,5 @@
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* 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 *
@@ -93,10 +92,10 @@ public class H5Ex_D_Checksum {
}
private static void writeChecksum() {
- long file_id = -1;
- long filespace_id = -1;
- long dataset_id = -1;
- long dcpl_id = -1;
+ long file_id = HDF5Constants.H5I_INVALID_HID;
+ long filespace_id = HDF5Constants.H5I_INVALID_HID;
+ long dataset_id = HDF5Constants.H5I_INVALID_HID;
+ long dcpl_id = HDF5Constants.H5I_INVALID_HID;
long[] dims = { DIM_X, DIM_Y };
long[] chunk_dims = { CHUNK_X, CHUNK_Y };
int[][] dset_data = new int[DIM_X][DIM_Y];
@@ -193,9 +192,9 @@ public class H5Ex_D_Checksum {
}
private static void readChecksum() {
- long file_id = -1;
- long dataset_id = -1;
- long dcpl_id = -1;
+ long file_id = HDF5Constants.H5I_INVALID_HID;
+ long dataset_id = HDF5Constants.H5I_INVALID_HID;
+ long dcpl_id = HDF5Constants.H5I_INVALID_HID;
int[][] dset_data = new int[DIM_X][DIM_Y];
// Open an existing file.
diff --git a/java/examples/datasets/H5Ex_D_Chunk.java b/java/examples/datasets/H5Ex_D_Chunk.java
index 3afa53c..2ddf293 100644
--- a/java/examples/datasets/H5Ex_D_Chunk.java
+++ b/java/examples/datasets/H5Ex_D_Chunk.java
@@ -1,6 +1,5 @@
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* 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 *
@@ -66,10 +65,10 @@ public class H5Ex_D_Chunk {
}
private static void writeChunk() {
- long file_id = -1;
- long filespace_id = -1;
- long dataset_id = -1;
- long dcpl_id = -1;
+ long file_id = HDF5Constants.H5I_INVALID_HID;
+ long filespace_id = HDF5Constants.H5I_INVALID_HID;
+ long dataset_id = HDF5Constants.H5I_INVALID_HID;
+ long dcpl_id = HDF5Constants.H5I_INVALID_HID;
long[] dims = { DIM_X, DIM_Y };
long[] chunk_dims = { CHUNK_X, CHUNK_Y };
int[][] dset_data = new int[DIM_X][DIM_Y];
@@ -201,10 +200,10 @@ public class H5Ex_D_Chunk {
}
private static void readChunk() {
- long file_id = -1;
- long filespace_id = -1;
- long dataset_id = -1;
- long dcpl_id = -1;
+ long file_id = HDF5Constants.H5I_INVALID_HID;
+ long filespace_id = HDF5Constants.H5I_INVALID_HID;
+ long dataset_id = HDF5Constants.H5I_INVALID_HID;
+ long dcpl_id = HDF5Constants.H5I_INVALID_HID;
int[][] dset_data = new int[DIM_X][DIM_Y];
// Open an existing file.
diff --git a/java/examples/datasets/H5Ex_D_Compact.java b/java/examples/datasets/H5Ex_D_Compact.java
index 347c05c..0abf8da 100644
--- a/java/examples/datasets/H5Ex_D_Compact.java
+++ b/java/examples/datasets/H5Ex_D_Compact.java
@@ -1,6 +1,5 @@
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* 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 *
@@ -60,10 +59,10 @@ public class H5Ex_D_Compact {
}
private static void writeCompact() {
- long file_id = -1;
- long filespace_id = -1;
- long dataset_id = -1;
- long dcpl_id = -1;
+ long file_id = HDF5Constants.H5I_INVALID_HID;
+ long filespace_id = HDF5Constants.H5I_INVALID_HID;
+ long dataset_id = HDF5Constants.H5I_INVALID_HID;
+ long dcpl_id = HDF5Constants.H5I_INVALID_HID;
long[] dims = { DIM_X, DIM_Y };
int[][] dset_data = new int[DIM_X][DIM_Y];
@@ -163,10 +162,10 @@ public class H5Ex_D_Compact {
}
private static void readCompact() {
- long file_id = -1;
- long filespace_id = -1;
- long dataset_id = -1;
- long dcpl_id = -1;
+ long file_id = HDF5Constants.H5I_INVALID_HID;
+ long filespace_id = HDF5Constants.H5I_INVALID_HID;
+ long dataset_id = HDF5Constants.H5I_INVALID_HID;
+ long dcpl_id = HDF5Constants.H5I_INVALID_HID;
int[][] dset_data = new int[DIM_X][DIM_Y];
// Open file and dataset using the default properties.
diff --git a/java/examples/datasets/H5Ex_D_External.java b/java/examples/datasets/H5Ex_D_External.java
index 5cf03af..9c3787f 100644
--- a/java/examples/datasets/H5Ex_D_External.java
+++ b/java/examples/datasets/H5Ex_D_External.java
@@ -1,6 +1,5 @@
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* 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 *
@@ -34,10 +33,10 @@ public class H5Ex_D_External {
private static final int NAME_BUF_SIZE = 32;
private static void writeExternal() {
- long file_id = -1;
- long dcpl_id = -1;
- long filespace_id = -1;
- long dataset_id = -1;
+ long file_id = HDF5Constants.H5I_INVALID_HID;
+ long dcpl_id = HDF5Constants.H5I_INVALID_HID;
+ long filespace_id = HDF5Constants.H5I_INVALID_HID;
+ long dataset_id = HDF5Constants.H5I_INVALID_HID;
long[] dims = { DIM_X, DIM_Y };
int[][] dset_data = new int[DIM_X][DIM_Y];
@@ -138,9 +137,9 @@ public class H5Ex_D_External {
}
private static void readExternal() {
- long file_id = -1;
- long dcpl_id = -1;
- long dataset_id = -1;
+ long file_id = HDF5Constants.H5I_INVALID_HID;
+ long dcpl_id = HDF5Constants.H5I_INVALID_HID;
+ long dataset_id = HDF5Constants.H5I_INVALID_HID;
int[][] dset_data = new int[DIM_X][DIM_Y];
String[] Xname = new String[1];
diff --git a/java/examples/datasets/H5Ex_D_FillValue.java b/java/examples/datasets/H5Ex_D_FillValue.java
index a19c026..3526993 100644
--- a/java/examples/datasets/H5Ex_D_FillValue.java
+++ b/java/examples/datasets/H5Ex_D_FillValue.java
@@ -1,6 +1,5 @@
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* 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 *
@@ -40,10 +39,10 @@ public class H5Ex_D_FillValue {
private static final int FILLVAL = 99;
private static void fillValue() {
- long file_id = -1;
- long dcpl_id = -1;
- long dataspace_id = -1;
- long dataset_id = -1;
+ long file_id = HDF5Constants.H5I_INVALID_HID;
+ long dcpl_id = HDF5Constants.H5I_INVALID_HID;
+ long dataspace_id = HDF5Constants.H5I_INVALID_HID;
+ long dataset_id = HDF5Constants.H5I_INVALID_HID;
long[] dims = { DIM_X, DIM_Y };
long[] extdims = { EDIM_X, EDIM_Y };
long[] chunk_dims = { CHUNK_X, CHUNK_Y };
diff --git a/java/examples/datasets/H5Ex_D_Gzip.java b/java/examples/datasets/H5Ex_D_Gzip.java
index 67d15bb..404ff05 100644
--- a/java/examples/datasets/H5Ex_D_Gzip.java
+++ b/java/examples/datasets/H5Ex_D_Gzip.java
@@ -1,6 +1,5 @@
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* 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 *
@@ -95,10 +94,10 @@ public class H5Ex_D_Gzip {
}
private static void writeGzip() {
- long file_id = -1;
- long filespace_id = -1;
- long dataset_id = -1;
- long dcpl_id = -1;
+ long file_id = HDF5Constants.H5I_INVALID_HID;
+ long filespace_id = HDF5Constants.H5I_INVALID_HID;
+ long dataset_id = HDF5Constants.H5I_INVALID_HID;
+ long dcpl_id = HDF5Constants.H5I_INVALID_HID;
long[] dims = { DIM_X, DIM_Y };
long[] chunk_dims = { CHUNK_X, CHUNK_Y };
int[][] dset_data = new int[DIM_X][DIM_Y];
@@ -196,9 +195,9 @@ public class H5Ex_D_Gzip {
}
private static void readGzip() {
- long file_id = -1;
- long dataset_id = -1;
- long dcpl_id = -1;
+ long file_id = HDF5Constants.H5I_INVALID_HID;
+ long dataset_id = HDF5Constants.H5I_INVALID_HID;
+ long dcpl_id = HDF5Constants.H5I_INVALID_HID;
int[][] dset_data = new int[DIM_X][DIM_Y];
// Open an existing file.
diff --git a/java/examples/datasets/H5Ex_D_Hyperslab.java b/java/examples/datasets/H5Ex_D_Hyperslab.java
index 57dfa6a..fa3473f 100644
--- a/java/examples/datasets/H5Ex_D_Hyperslab.java
+++ b/java/examples/datasets/H5Ex_D_Hyperslab.java
@@ -1,6 +1,5 @@
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* 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 *
@@ -34,9 +33,9 @@ public class H5Ex_D_Hyperslab {
private static final int RANK = 2;
private static void writeHyperslab() {
- long file_id = -1;
- long filespace_id = -1;
- long dataset_id = -1;
+ long file_id = HDF5Constants.H5I_INVALID_HID;
+ long filespace_id = HDF5Constants.H5I_INVALID_HID;
+ long dataset_id = HDF5Constants.H5I_INVALID_HID;
long[] dims = { DIM_X, DIM_Y };
int[][] dset_data = new int[DIM_X][DIM_Y];
@@ -142,10 +141,10 @@ public class H5Ex_D_Hyperslab {
}
private static void readHyperslab() {
- long file_id = -1;
- long filespace_id = -1;
- long dataset_id = -1;
- long dcpl_id = -1;
+ long file_id = HDF5Constants.H5I_INVALID_HID;
+ long filespace_id = HDF5Constants.H5I_INVALID_HID;
+ long dataset_id = HDF5Constants.H5I_INVALID_HID;
+ long dcpl_id = HDF5Constants.H5I_INVALID_HID;
int[][] dset_data = new int[DIM_X][DIM_Y];
// Open an existing file.
diff --git a/java/examples/datasets/H5Ex_D_Nbit.java b/java/examples/datasets/H5Ex_D_Nbit.java
index d995a02..35d23a9 100644
--- a/java/examples/datasets/H5Ex_D_Nbit.java
+++ b/java/examples/datasets/H5Ex_D_Nbit.java
@@ -1,6 +1,5 @@
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* 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 *
@@ -96,11 +95,11 @@ public class H5Ex_D_Nbit {
}
private static void writeData() throws Exception {
- long file_id = -1;
- long filespace_id = -1;
- long dataset_id = -1;
- long dtype_id = -1;
- long dcpl_id = -1;
+ long file_id = HDF5Constants.H5I_INVALID_HID;
+ long filespace_id = HDF5Constants.H5I_INVALID_HID;
+ long dataset_id = HDF5Constants.H5I_INVALID_HID;
+ long dtype_id = HDF5Constants.H5I_INVALID_HID;
+ long dcpl_id = HDF5Constants.H5I_INVALID_HID;
long[] dims = { DIM_X, DIM_Y };
long[] chunk_dims = { CHUNK_X, CHUNK_Y };
int[][] dset_data = new int[DIM_X][DIM_Y];
@@ -157,9 +156,9 @@ public class H5Ex_D_Nbit {
}
private static void readData() throws Exception {
- long file_id = -1;
- long dataset_id = -1;
- long dcpl_id = -1;
+ long file_id = HDF5Constants.H5I_INVALID_HID;
+ long dataset_id = HDF5Constants.H5I_INVALID_HID;
+ long dcpl_id = HDF5Constants.H5I_INVALID_HID;
int[][] dset_data = new int[DIM_X][DIM_Y];
// Open an existing file.
diff --git a/java/examples/datasets/H5Ex_D_ReadWrite.java b/java/examples/datasets/H5Ex_D_ReadWrite.java
index 3f6e9ac..db930d3 100644
--- a/java/examples/datasets/H5Ex_D_ReadWrite.java
+++ b/java/examples/datasets/H5Ex_D_ReadWrite.java
@@ -1,6 +1,5 @@
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* 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 *
@@ -32,9 +31,9 @@ public class H5Ex_D_ReadWrite {
private static final int RANK = 2;
private static void WriteDataset() {
- long file_id = -1;
- long filespace_id = -1;
- long dataset_id = -1;
+ long file_id = HDF5Constants.H5I_INVALID_HID;
+ long filespace_id = HDF5Constants.H5I_INVALID_HID;
+ long dataset_id = HDF5Constants.H5I_INVALID_HID;
long[] dims = { DIM_X, DIM_Y };
int[][] dset_data = new int[DIM_X][DIM_Y];
@@ -109,8 +108,8 @@ public class H5Ex_D_ReadWrite {
}
private static void ReadDataset() {
- long file_id = -1;
- long dataset_id = -1;
+ long file_id = HDF5Constants.H5I_INVALID_HID;
+ long dataset_id = HDF5Constants.H5I_INVALID_HID;
int[][] dset_data = new int[DIM_X][DIM_Y];
// Open file using the default properties.
diff --git a/java/examples/datasets/H5Ex_D_Shuffle.java b/java/examples/datasets/H5Ex_D_Shuffle.java
index 9677e75..1dd7c6a 100644
--- a/java/examples/datasets/H5Ex_D_Shuffle.java
+++ b/java/examples/datasets/H5Ex_D_Shuffle.java
@@ -1,6 +1,5 @@
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* 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 *
@@ -122,10 +121,10 @@ public class H5Ex_D_Shuffle {
}
private static void writeShuffle() {
- long file_id = -1;
- long filespace_id = -1;
- long dataset_id = -1;
- long dcpl_id = -1;
+ long file_id = HDF5Constants.H5I_INVALID_HID;
+ long filespace_id = HDF5Constants.H5I_INVALID_HID;
+ long dataset_id = HDF5Constants.H5I_INVALID_HID;
+ long dcpl_id = HDF5Constants.H5I_INVALID_HID;
long[] dims = { DIM_X, DIM_Y };
long[] chunk_dims = { CHUNK_X, CHUNK_Y };
int[][] dset_data = new int[DIM_X][DIM_Y];
@@ -229,9 +228,9 @@ public class H5Ex_D_Shuffle {
}
private static void readShuffle() {
- long file_id = -1;
- long dataset_id = -1;
- long dcpl_id = -1;
+ long file_id = HDF5Constants.H5I_INVALID_HID;
+ long dataset_id = HDF5Constants.H5I_INVALID_HID;
+ long dcpl_id = HDF5Constants.H5I_INVALID_HID;
int[][] dset_data = new int[DIM_X][DIM_Y];
// Open an existing file.
diff --git a/java/examples/datasets/H5Ex_D_Sofloat.java b/java/examples/datasets/H5Ex_D_Sofloat.java
index 5818371..a42aba4 100644
--- a/java/examples/datasets/H5Ex_D_Sofloat.java
+++ b/java/examples/datasets/H5Ex_D_Sofloat.java
@@ -1,6 +1,5 @@
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* 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 *
@@ -96,10 +95,10 @@ public class H5Ex_D_Sofloat {
}
private static void writeData() {
- long file_id = -1;
- long filespace_id = -1;
- long dataset_id = -1;
- long dcpl_id = -1;
+ long file_id = HDF5Constants.H5I_INVALID_HID;
+ long filespace_id = HDF5Constants.H5I_INVALID_HID;
+ long dataset_id = HDF5Constants.H5I_INVALID_HID;
+ long dcpl_id = HDF5Constants.H5I_INVALID_HID;
long[] dims = { DIM_X, DIM_Y };
long[] chunk_dims = { CHUNK_X, CHUNK_Y };
double[][] dset_data = new double[DIM_X][DIM_Y];
@@ -213,9 +212,9 @@ public class H5Ex_D_Sofloat {
}
private static void readData() {
- long file_id = -1;
- long dataset_id = -1;
- long dcpl_id = -1;
+ long file_id = HDF5Constants.H5I_INVALID_HID;
+ long dataset_id = HDF5Constants.H5I_INVALID_HID;
+ long dcpl_id = HDF5Constants.H5I_INVALID_HID;
double[][] dset_data = new double[DIM_X][DIM_Y];
// Open file using the default properties.
diff --git a/java/examples/datasets/H5Ex_D_Soint.java b/java/examples/datasets/H5Ex_D_Soint.java
index 3f5f170..dd7664f 100644
--- a/java/examples/datasets/H5Ex_D_Soint.java
+++ b/java/examples/datasets/H5Ex_D_Soint.java
@@ -1,6 +1,5 @@
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* 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 *
@@ -96,10 +95,10 @@ public class H5Ex_D_Soint {
}
private static void writeData() {
- long file_id = -1;
- long filespace_id = -1;
- long dataset_id = -1;
- long dcpl_id = -1;
+ long file_id = HDF5Constants.H5I_INVALID_HID;
+ long filespace_id = HDF5Constants.H5I_INVALID_HID;
+ long dataset_id = HDF5Constants.H5I_INVALID_HID;
+ long dcpl_id = HDF5Constants.H5I_INVALID_HID;
long[] dims = { DIM_X, DIM_Y };
long[] chunk_dims = { CHUNK_X, CHUNK_Y };
int[][] dset_data = new int[DIM_X][DIM_Y];
@@ -195,9 +194,9 @@ public class H5Ex_D_Soint {
}
private static void readData() {
- long file_id = -1;
- long dataset_id = -1;
- long dcpl_id = -1;
+ long file_id = HDF5Constants.H5I_INVALID_HID;
+ long dataset_id = HDF5Constants.H5I_INVALID_HID;
+ long dcpl_id = HDF5Constants.H5I_INVALID_HID;
int[][] dset_data = new int[DIM_X][DIM_Y];
// Open file using the default properties.
diff --git a/java/examples/datasets/H5Ex_D_Szip.java b/java/examples/datasets/H5Ex_D_Szip.java
index 57ba873..3fdc712 100644
--- a/java/examples/datasets/H5Ex_D_Szip.java
+++ b/java/examples/datasets/H5Ex_D_Szip.java
@@ -1,6 +1,5 @@
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* 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 *
@@ -95,10 +94,10 @@ public class H5Ex_D_Szip {
}
private static void writeSzip() {
- long file_id = -1;
- long filespace_id = -1;
- long dataset_id = -1;
- long dcpl_id = -1;
+ long file_id = HDF5Constants.H5I_INVALID_HID;
+ long filespace_id = HDF5Constants.H5I_INVALID_HID;
+ long dataset_id = HDF5Constants.H5I_INVALID_HID;
+ long dcpl_id = HDF5Constants.H5I_INVALID_HID;
long[] dims = { DIM_X, DIM_Y };
long[] chunk_dims = { CHUNK_X, CHUNK_Y };
int[][] dset_data = new int[DIM_X][DIM_Y];
@@ -196,9 +195,9 @@ public class H5Ex_D_Szip {
}
private static void readSzip() {
- long file_id = -1;
- long dataset_id = -1;
- long dcpl_id = -1;
+ long file_id = HDF5Constants.H5I_INVALID_HID;
+ long dataset_id = HDF5Constants.H5I_INVALID_HID;
+ long dcpl_id = HDF5Constants.H5I_INVALID_HID;
int[][] dset_data = new int[DIM_X][DIM_Y];
// Open an existing file.
diff --git a/java/examples/datasets/H5Ex_D_Transform.java b/java/examples/datasets/H5Ex_D_Transform.java
index 04bfa2e..069e80b 100644
--- a/java/examples/datasets/H5Ex_D_Transform.java
+++ b/java/examples/datasets/H5Ex_D_Transform.java
@@ -1,6 +1,5 @@
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* 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 *
@@ -36,10 +35,10 @@ public class H5Ex_D_Transform {
private static String RTRANSFORM = "x-1";
private static void writeData() {
- long file_id = -1;
- long filespace_id = -1;
- long dataset_id = -1;
- long dxpl_id = -1;
+ long file_id = HDF5Constants.H5I_INVALID_HID;
+ long filespace_id = HDF5Constants.H5I_INVALID_HID;
+ long dataset_id = HDF5Constants.H5I_INVALID_HID;
+ long dxpl_id = HDF5Constants.H5I_INVALID_HID;
long[] dims = { DIM_X, DIM_Y };
int[][] dset_data = new int[DIM_X][DIM_Y];
@@ -144,9 +143,9 @@ public class H5Ex_D_Transform {
private static void readData() {
- long file_id = -1;
- long dataset_id = -1;
- long dxpl_id = -1;
+ long file_id = HDF5Constants.H5I_INVALID_HID;
+ long dataset_id = HDF5Constants.H5I_INVALID_HID;
+ long dxpl_id = HDF5Constants.H5I_INVALID_HID;
int[][] dset_data = new int[DIM_X][DIM_Y];
// Open an existing file using the default properties.
diff --git a/java/examples/datasets/H5Ex_D_UnlimitedAdd.java b/java/examples/datasets/H5Ex_D_UnlimitedAdd.java
index 925023a..c82b2d6 100644
--- a/java/examples/datasets/H5Ex_D_UnlimitedAdd.java
+++ b/java/examples/datasets/H5Ex_D_UnlimitedAdd.java
@@ -1,6 +1,5 @@
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* 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 *
@@ -39,10 +38,10 @@ public class H5Ex_D_UnlimitedAdd {
private static final int NDIMS = 2;
private static void writeUnlimited() {
- long file_id = -1;
- long dcpl_id = -1;
- long dataspace_id = -1;
- long dataset_id = -1;
+ long file_id = HDF5Constants.H5I_INVALID_HID;
+ long dcpl_id = HDF5Constants.H5I_INVALID_HID;
+ long dataspace_id = HDF5Constants.H5I_INVALID_HID;
+ long dataset_id = HDF5Constants.H5I_INVALID_HID;
long[] dims = { DIM_X, DIM_Y };
long[] chunk_dims = { CHUNK_X, CHUNK_Y };
long[] maxdims = { HDF5Constants.H5S_UNLIMITED, HDF5Constants.H5S_UNLIMITED };
@@ -143,9 +142,9 @@ public class H5Ex_D_UnlimitedAdd {
}
private static void extendUnlimited() {
- long file_id = -1;
- long dataspace_id = -1;
- long dataset_id = -1;
+ long file_id = HDF5Constants.H5I_INVALID_HID;
+ long dataspace_id = HDF5Constants.H5I_INVALID_HID;
+ long dataset_id = HDF5Constants.H5I_INVALID_HID;
long[] dims = { DIM_X, DIM_Y };
long[] extdims = { EDIM_X, EDIM_Y };
long[] start = { 0, 0 };
@@ -293,9 +292,9 @@ public class H5Ex_D_UnlimitedAdd {
}
private static void readUnlimited() {
- long file_id = -1;
- long dataspace_id = -1;
- long dataset_id = -1;
+ long file_id = HDF5Constants.H5I_INVALID_HID;
+ long dataspace_id = HDF5Constants.H5I_INVALID_HID;
+ long dataset_id = HDF5Constants.H5I_INVALID_HID;
long[] dims = { DIM_X, DIM_Y };
int[][] dset_data;
diff --git a/java/examples/datasets/H5Ex_D_UnlimitedGzip.java b/java/examples/datasets/H5Ex_D_UnlimitedGzip.java
index 40ddc60..675b1ba 100644
--- a/java/examples/datasets/H5Ex_D_UnlimitedGzip.java
+++ b/java/examples/datasets/H5Ex_D_UnlimitedGzip.java
@@ -1,6 +1,5 @@
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* 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 *
@@ -99,10 +98,10 @@ public class H5Ex_D_UnlimitedGzip {
}
private static void writeUnlimited() {
- long file_id = -1;
- long dcpl_id = -1;
- long dataspace_id = -1;
- long dataset_id = -1;
+ long file_id = HDF5Constants.H5I_INVALID_HID;
+ long dcpl_id = HDF5Constants.H5I_INVALID_HID;
+ long dataspace_id = HDF5Constants.H5I_INVALID_HID;
+ long dataset_id = HDF5Constants.H5I_INVALID_HID;
long[] dims = { DIM_X, DIM_Y };
long[] chunk_dims = { CHUNK_X, CHUNK_Y };
long[] maxdims = { HDF5Constants.H5S_UNLIMITED, HDF5Constants.H5S_UNLIMITED };
@@ -200,9 +199,9 @@ public class H5Ex_D_UnlimitedGzip {
}
private static void extendUnlimited() {
- long file_id = -1;
- long dataspace_id = -1;
- long dataset_id = -1;
+ long file_id = HDF5Constants.H5I_INVALID_HID;
+ long dataspace_id = HDF5Constants.H5I_INVALID_HID;
+ long dataset_id = HDF5Constants.H5I_INVALID_HID;
long[] dims = { DIM_X, DIM_Y };
long[] extdims = { EDIM_X, EDIM_Y };
long[] start = { 0, 0 };
@@ -350,10 +349,10 @@ public class H5Ex_D_UnlimitedGzip {
}
private static void readUnlimited() {
- long file_id = -1;
- long dataspace_id = -1;
- long dataset_id = -1;
- long dcpl_id = -1;
+ long file_id = HDF5Constants.H5I_INVALID_HID;
+ long dataspace_id = HDF5Constants.H5I_INVALID_HID;
+ long dataset_id = HDF5Constants.H5I_INVALID_HID;
+ long dcpl_id = HDF5Constants.H5I_INVALID_HID;
long[] dims = { DIM_X, DIM_Y };
int[][] dset_data;
diff --git a/java/examples/datasets/H5Ex_D_UnlimitedMod.java b/java/examples/datasets/H5Ex_D_UnlimitedMod.java
index 0476bc1..273ac3e 100644
--- a/java/examples/datasets/H5Ex_D_UnlimitedMod.java
+++ b/java/examples/datasets/H5Ex_D_UnlimitedMod.java
@@ -1,6 +1,5 @@
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* 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 *
@@ -39,10 +38,10 @@ public class H5Ex_D_UnlimitedMod {
private static final int NDIMS = 2;
private static void writeUnlimited() {
- long file_id = -1;
- long dcpl_id = -1;
- long dataspace_id = -1;
- long dataset_id = -1;
+ long file_id = HDF5Constants.H5I_INVALID_HID;
+ long dcpl_id = HDF5Constants.H5I_INVALID_HID;
+ long dataspace_id = HDF5Constants.H5I_INVALID_HID;
+ long dataset_id = HDF5Constants.H5I_INVALID_HID;
long[] dims = { DIM_X, DIM_Y };
long[] chunk_dims = { CHUNK_X, CHUNK_Y };
long[] maxdims = { HDF5Constants.H5S_UNLIMITED, HDF5Constants.H5S_UNLIMITED };
@@ -143,9 +142,9 @@ public class H5Ex_D_UnlimitedMod {
}
private static void extendUnlimited() {
- long file_id = -1;
- long dataspace_id = -1;
- long dataset_id = -1;
+ long file_id = HDF5Constants.H5I_INVALID_HID;
+ long dataspace_id = HDF5Constants.H5I_INVALID_HID;
+ long dataset_id = HDF5Constants.H5I_INVALID_HID;
long[] dims = { DIM_X, DIM_Y };
long[] extdims = { EDIM_X, EDIM_Y };
int[][] dset_data;
@@ -279,9 +278,9 @@ public class H5Ex_D_UnlimitedMod {
}
private static void readUnlimited() {
- long file_id = -1;
- long dataspace_id = -1;
- long dataset_id = -1;
+ long file_id = HDF5Constants.H5I_INVALID_HID;
+ long dataspace_id = HDF5Constants.H5I_INVALID_HID;
+ long dataset_id = HDF5Constants.H5I_INVALID_HID;
long[] dims = { DIM_X, DIM_Y };
int[][] dset_data;
diff --git a/java/examples/datasets/JavaDatasetExample.sh.in b/java/examples/datasets/JavaDatasetExample.sh.in
index 0aa3da5..f29739a 100644
--- a/java/examples/datasets/JavaDatasetExample.sh.in
+++ b/java/examples/datasets/JavaDatasetExample.sh.in
@@ -1,7 +1,6 @@
#! /bin/sh
#
# 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
@@ -15,6 +14,7 @@
top_builddir=@top_builddir@
top_srcdir=@top_srcdir@
srcdir=@srcdir@
+IS_DARWIN="@H5_IS_DARWIN@"
USE_FILTER_SZIP="@USE_FILTER_SZIP@"
USE_FILTER_DEFLATE="@USE_FILTER_DEFLATE@"
@@ -36,8 +36,8 @@ nerrors=0
# where the libs exist
HDFLIB_HOME="$top_srcdir/java/lib"
-BLDLIBDIR="$top_builddir/hdf5/lib"
BLDDIR="."
+BLDLIBDIR="$BLDDIR/testlibs"
HDFTEST_HOME="$top_srcdir/java/examples/datasets"
JARFILE=jar@PACKAGE_TARNAME@-@PACKAGE_VERSION@.jar
TESTJARFILE=jar@PACKAGE_TARNAME@datasets.jar
@@ -113,6 +113,13 @@ COPY_LIBFILES_TO_BLDLIBDIR()
fi
fi
done
+ if [ "$IS_DARWIN" = "yes" ]; then
+ (cd $BLDLIBDIR; \
+ install_name_tool -add_rpath @loader_path libhdf5_java.dylib; \
+ exist_path=` otool -l libhdf5_java.dylib | grep libhdf5 | grep -v java | awk '{print $2}'`; \
+ echo $exist_path; \
+ install_name_tool -change $exist_path @rpath/libhdf5.dylib libhdf5_java.dylib)
+ fi
# copy jar files. Used -f to make sure get a new copy
for tstfile in $COPY_JARTESTFILES
do
diff --git a/java/examples/datatypes/H5Ex_T_Array.java b/java/examples/datatypes/H5Ex_T_Array.java
index 30eb360..3939b38 100644
--- a/java/examples/datatypes/H5Ex_T_Array.java
+++ b/java/examples/datatypes/H5Ex_T_Array.java
@@ -1,6 +1,5 @@
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* 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 *
@@ -34,11 +33,11 @@ public class H5Ex_T_Array {
private static final int NDIMS = 2;
private static void CreateDataset() {
- long file_id = -1;
- long filetype_id = -1;
- long memtype_id = -1;
- long dataspace_id = -1;
- long dataset_id = -1;
+ long file_id = HDF5Constants.H5I_INVALID_HID;
+ long filetype_id = HDF5Constants.H5I_INVALID_HID;
+ long memtype_id = HDF5Constants.H5I_INVALID_HID;
+ long dataspace_id = HDF5Constants.H5I_INVALID_HID;
+ long dataset_id = HDF5Constants.H5I_INVALID_HID;
long[] dims = { DIM0 };
long[] adims = { ADIM0, ADIM1 };
int[][][] dset_data = new int[DIM0][ADIM0][ADIM1];
@@ -152,10 +151,10 @@ public class H5Ex_T_Array {
}
private static void ReadDataset() {
- long file_id = -1;
- long filetype_id = -1;
- long memtype_id = -1;
- long dataset_id = -1;
+ long file_id = HDF5Constants.H5I_INVALID_HID;
+ long filetype_id = HDF5Constants.H5I_INVALID_HID;
+ long memtype_id = HDF5Constants.H5I_INVALID_HID;
+ long dataset_id = HDF5Constants.H5I_INVALID_HID;
long[] dims = { DIM0 };
long[] adims = { ADIM0, ADIM1 };
int[][][] dset_data;
diff --git a/java/examples/datatypes/H5Ex_T_ArrayAttribute.java b/java/examples/datatypes/H5Ex_T_ArrayAttribute.java
index 26d7fb6..c4c4bc4 100644
--- a/java/examples/datatypes/H5Ex_T_ArrayAttribute.java
+++ b/java/examples/datatypes/H5Ex_T_ArrayAttribute.java
@@ -1,6 +1,5 @@
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* 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 *
@@ -35,12 +34,12 @@ public class H5Ex_T_ArrayAttribute {
private static final int NDIMS = 2;
private static void CreateDataset() {
- long file_id = -1;
- long filetype_id = -1;
- long memtype_id = -1;
- long dataspace_id = -1;
- long dataset_id = -1;
- long attribute_id = -1;
+ long file_id = HDF5Constants.H5I_INVALID_HID;
+ long filetype_id = HDF5Constants.H5I_INVALID_HID;
+ long memtype_id = HDF5Constants.H5I_INVALID_HID;
+ long dataspace_id = HDF5Constants.H5I_INVALID_HID;
+ long dataset_id = HDF5Constants.H5I_INVALID_HID;
+ long attribute_id = HDF5Constants.H5I_INVALID_HID;
long[] dims = { DIM0 };
long[] adims = { ADIM0, ADIM1 };
int[][][] dset_data = new int[DIM0][ADIM0][ADIM1];
@@ -84,7 +83,7 @@ public class H5Ex_T_ArrayAttribute {
dataset_id = H5.H5Dcreate(file_id, DATASETNAME, HDF5Constants.H5T_STD_I32LE, dataspace_id,
HDF5Constants.H5P_DEFAULT, HDF5Constants.H5P_DEFAULT, HDF5Constants.H5P_DEFAULT);
H5.H5Sclose(dataspace_id);
- dataspace_id = -1;
+ dataspace_id = HDF5Constants.H5I_INVALID_HID;
}
}
catch (Exception e) {
@@ -175,11 +174,11 @@ public class H5Ex_T_ArrayAttribute {
}
private static void ReadDataset() {
- long file_id = -1;
- long filetype_id = -1;
- long memtype_id = -1;
- long dataset_id = -1;
- long attribute_id = -1;
+ long file_id = HDF5Constants.H5I_INVALID_HID;
+ long filetype_id = HDF5Constants.H5I_INVALID_HID;
+ long memtype_id = HDF5Constants.H5I_INVALID_HID;
+ long dataset_id = HDF5Constants.H5I_INVALID_HID;
+ long attribute_id = HDF5Constants.H5I_INVALID_HID;
long[] dims = { DIM0 };
long[] adims = { ADIM0, ADIM1 };
int[][][] dset_data;
diff --git a/java/examples/datatypes/H5Ex_T_Bit.java b/java/examples/datatypes/H5Ex_T_Bit.java
index 30acda4..45d4e8a 100644
--- a/java/examples/datatypes/H5Ex_T_Bit.java
+++ b/java/examples/datatypes/H5Ex_T_Bit.java
@@ -1,6 +1,5 @@
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* 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 *
@@ -32,9 +31,9 @@ public class H5Ex_T_Bit {
private static final int RANK = 2;
private static void CreateDataset() {
- long file_id = -1;
- long dataspace_id = -1;
- long dataset_id = -1;
+ long file_id = HDF5Constants.H5I_INVALID_HID;
+ long dataspace_id = HDF5Constants.H5I_INVALID_HID;
+ long dataset_id = HDF5Constants.H5I_INVALID_HID;
long[] dims = { DIM0, DIM1 };
int[][] dset_data = new int[DIM0][DIM1];
@@ -116,9 +115,9 @@ public class H5Ex_T_Bit {
}
private static void ReadDataset() {
- long file_id = -1;
- long dataspace_id = -1;
- long dataset_id = -1;
+ long file_id = HDF5Constants.H5I_INVALID_HID;
+ long dataspace_id = HDF5Constants.H5I_INVALID_HID;
+ long dataset_id = HDF5Constants.H5I_INVALID_HID;
long[] dims = { DIM0, DIM1 };
int[][] dset_data;
diff --git a/java/examples/datatypes/H5Ex_T_BitAttribute.java b/java/examples/datatypes/H5Ex_T_BitAttribute.java
index 2059dd5..9b33ca5 100644
--- a/java/examples/datatypes/H5Ex_T_BitAttribute.java
+++ b/java/examples/datatypes/H5Ex_T_BitAttribute.java
@@ -1,6 +1,5 @@
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* 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 *
@@ -33,10 +32,10 @@ public class H5Ex_T_BitAttribute {
private static final int RANK = 2;
private static void CreateDataset() {
- long file_id = -1;
- long dataspace_id = -1;
- long dataset_id = -1;
- long attribute_id = -1;
+ long file_id = HDF5Constants.H5I_INVALID_HID;
+ long dataspace_id = HDF5Constants.H5I_INVALID_HID;
+ long dataset_id = HDF5Constants.H5I_INVALID_HID;
+ long attribute_id = HDF5Constants.H5I_INVALID_HID;
long[] dims = { DIM0, DIM1 };
int[][] dset_data = new int[DIM0][DIM1];
@@ -66,7 +65,7 @@ public class H5Ex_T_BitAttribute {
dataset_id = H5.H5Dcreate(file_id, DATASETNAME, HDF5Constants.H5T_STD_I32LE, dataspace_id,
HDF5Constants.H5P_DEFAULT, HDF5Constants.H5P_DEFAULT, HDF5Constants.H5P_DEFAULT);
H5.H5Sclose(dataspace_id);
- dataspace_id = -1;
+ dataspace_id = HDF5Constants.H5I_INVALID_HID;
}
}
catch (Exception e) {
@@ -139,10 +138,10 @@ public class H5Ex_T_BitAttribute {
}
private static void ReadDataset() {
- long file_id = -1;
- long dataspace_id = -1;
- long dataset_id = -1;
- long attribute_id = -1;
+ long file_id = HDF5Constants.H5I_INVALID_HID;
+ long dataspace_id = HDF5Constants.H5I_INVALID_HID;
+ long dataset_id = HDF5Constants.H5I_INVALID_HID;
+ long attribute_id = HDF5Constants.H5I_INVALID_HID;
long[] dims = { DIM0, DIM1 };
int[][] dset_data;
diff --git a/java/examples/datatypes/H5Ex_T_Commit.java b/java/examples/datatypes/H5Ex_T_Commit.java
index 35caa6b..62db5ea 100644
--- a/java/examples/datatypes/H5Ex_T_Commit.java
+++ b/java/examples/datatypes/H5Ex_T_Commit.java
@@ -1,6 +1,5 @@
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* 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 *
@@ -101,9 +100,9 @@ public class H5Ex_T_Commit {
}
private static void CreateDataType() {
- long file_id = -1;
- long strtype_id = -1;
- long filetype_id = -1;
+ long file_id = HDF5Constants.H5I_INVALID_HID;
+ long strtype_id = HDF5Constants.H5I_INVALID_HID;
+ long filetype_id = HDF5Constants.H5I_INVALID_HID;
Sensor_Datatype datatypes = new Sensor_Datatype();
// Create a new file using default properties.
try {
@@ -183,9 +182,9 @@ public class H5Ex_T_Commit {
}
private static void ReadDataType() {
- long file_id = -1;
- long typeclass_id = -1;
- long filetype_id = -1;
+ long file_id = HDF5Constants.H5I_INVALID_HID;
+ long typeclass_id = HDF5Constants.H5I_INVALID_HID;
+ long filetype_id = HDF5Constants.H5I_INVALID_HID;
// Open an existing file.
try {
diff --git a/java/examples/datatypes/H5Ex_T_Compound.java b/java/examples/datatypes/H5Ex_T_Compound.java
index 61e79c7..8c83ebb 100644
--- a/java/examples/datatypes/H5Ex_T_Compound.java
+++ b/java/examples/datatypes/H5Ex_T_Compound.java
@@ -1,6 +1,5 @@
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* 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 *
@@ -122,12 +121,12 @@ public class H5Ex_T_Compound {
}
private static void CreateDataset() {
- long file_id = -1;
- long strtype_id = -1;
- long memtype_id = -1;
- long filetype_id = -1;
- long dataspace_id = -1;
- long dataset_id = -1;
+ long file_id = HDF5Constants.H5I_INVALID_HID;
+ long strtype_id = HDF5Constants.H5I_INVALID_HID;
+ long memtype_id = HDF5Constants.H5I_INVALID_HID;
+ long filetype_id = HDF5Constants.H5I_INVALID_HID;
+ long dataspace_id = HDF5Constants.H5I_INVALID_HID;
+ long dataset_id = HDF5Constants.H5I_INVALID_HID;
long[] dims = { DIM0 };
Sensor[] object_data = new Sensor[DIM0];
byte[] dset_data = null;
@@ -286,11 +285,11 @@ public class H5Ex_T_Compound {
}
private static void ReadDataset() {
- long file_id = -1;
- long strtype_id = -1;
- long memtype_id = -1;
- long dataspace_id = -1;
- long dataset_id = -1;
+ long file_id = HDF5Constants.H5I_INVALID_HID;
+ long strtype_id = HDF5Constants.H5I_INVALID_HID;
+ long memtype_id = HDF5Constants.H5I_INVALID_HID;
+ long dataspace_id = HDF5Constants.H5I_INVALID_HID;
+ long dataset_id = HDF5Constants.H5I_INVALID_HID;
long[] dims = { DIM0 };
Sensor[] object_data2;
byte[] dset_data;
diff --git a/java/examples/datatypes/H5Ex_T_CompoundAttribute.java b/java/examples/datatypes/H5Ex_T_CompoundAttribute.java
index 4294b4a..58d2fb7 100644
--- a/java/examples/datatypes/H5Ex_T_CompoundAttribute.java
+++ b/java/examples/datatypes/H5Ex_T_CompoundAttribute.java
@@ -1,6 +1,5 @@
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* 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 *
@@ -125,13 +124,13 @@ public class H5Ex_T_CompoundAttribute {
}
private static void CreateDataset() {
- long file_id = -1;
- long strtype_id = -1;
- long memtype_id = -1;
- long filetype_id = -1;
- long dataspace_id = -1;
- long dataset_id = -1;
- long attribute_id = -1;
+ long file_id = HDF5Constants.H5I_INVALID_HID;
+ long strtype_id = HDF5Constants.H5I_INVALID_HID;
+ long memtype_id = HDF5Constants.H5I_INVALID_HID;
+ long filetype_id = HDF5Constants.H5I_INVALID_HID;
+ long dataspace_id = HDF5Constants.H5I_INVALID_HID;
+ long dataset_id = HDF5Constants.H5I_INVALID_HID;
+ long attribute_id = HDF5Constants.H5I_INVALID_HID;
long[] dims = { DIM0 };
Sensor[] object_data = new Sensor[DIM0];
byte[] dset_data = null;
@@ -205,7 +204,7 @@ public class H5Ex_T_CompoundAttribute {
dataset_id = H5.H5Dcreate(file_id, DATASETNAME, HDF5Constants.H5T_STD_I32LE, dataspace_id,
HDF5Constants.H5P_DEFAULT, HDF5Constants.H5P_DEFAULT, HDF5Constants.H5P_DEFAULT);
H5.H5Sclose(dataspace_id);
- dataspace_id = -1;
+ dataspace_id = HDF5Constants.H5I_INVALID_HID;
}
}
catch (Exception e) {
@@ -310,12 +309,12 @@ public class H5Ex_T_CompoundAttribute {
}
private static void ReadDataset() {
- long file_id = -1;
- long strtype_id = -1;
- long memtype_id = -1;
- long dataspace_id = -1;
- long dataset_id = -1;
- long attribute_id = -1;
+ long file_id = HDF5Constants.H5I_INVALID_HID;
+ long strtype_id = HDF5Constants.H5I_INVALID_HID;
+ long memtype_id = HDF5Constants.H5I_INVALID_HID;
+ long dataspace_id = HDF5Constants.H5I_INVALID_HID;
+ long dataset_id = HDF5Constants.H5I_INVALID_HID;
+ long attribute_id = HDF5Constants.H5I_INVALID_HID;
long[] dims = { DIM0 };
Sensor[] object_data2;
byte[] dset_data;
diff --git a/java/examples/datatypes/H5Ex_T_Float.java b/java/examples/datatypes/H5Ex_T_Float.java
index e469d63..e8da7f6 100644
--- a/java/examples/datatypes/H5Ex_T_Float.java
+++ b/java/examples/datatypes/H5Ex_T_Float.java
@@ -1,6 +1,5 @@
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* 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 *
@@ -36,9 +35,9 @@ public class H5Ex_T_Float {
private static final int RANK = 2;
private static void CreateDataset() {
- long file_id = -1;
- long dataspace_id = -1;
- long dataset_id = -1;
+ long file_id = HDF5Constants.H5I_INVALID_HID;
+ long dataspace_id = HDF5Constants.H5I_INVALID_HID;
+ long dataset_id = HDF5Constants.H5I_INVALID_HID;
long[] dims = { DIM0, DIM1 };
double[][] dset_data = new double[DIM0][DIM1];
@@ -120,9 +119,9 @@ public class H5Ex_T_Float {
}
private static void ReadDataset() {
- long file_id = -1;
- long dataspace_id = -1;
- long dataset_id = -1;
+ long file_id = HDF5Constants.H5I_INVALID_HID;
+ long dataspace_id = HDF5Constants.H5I_INVALID_HID;
+ long dataset_id = HDF5Constants.H5I_INVALID_HID;
long[] dims = { DIM0, DIM1 };
double[][] dset_data;
diff --git a/java/examples/datatypes/H5Ex_T_FloatAttribute.java b/java/examples/datatypes/H5Ex_T_FloatAttribute.java
index b6c92be..eb8e1f8 100644
--- a/java/examples/datatypes/H5Ex_T_FloatAttribute.java
+++ b/java/examples/datatypes/H5Ex_T_FloatAttribute.java
@@ -1,6 +1,5 @@
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* 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 *
@@ -37,10 +36,10 @@ public class H5Ex_T_FloatAttribute {
private static final int RANK = 2;
private static void CreateDataset() {
- long file_id = -1;
- long dataspace_id = -1;
- long dataset_id = -1;
- long attribute_id = -1;
+ long file_id = HDF5Constants.H5I_INVALID_HID;
+ long dataspace_id = HDF5Constants.H5I_INVALID_HID;
+ long dataset_id = HDF5Constants.H5I_INVALID_HID;
+ long attribute_id = HDF5Constants.H5I_INVALID_HID;
long[] dims = { DIM0, DIM1 };
double[][] dset_data = new double[DIM0][DIM1];
@@ -66,7 +65,7 @@ public class H5Ex_T_FloatAttribute {
dataset_id = H5.H5Dcreate(file_id, DATASETNAME, HDF5Constants.H5T_STD_I32LE, dataspace_id,
HDF5Constants.H5P_DEFAULT, HDF5Constants.H5P_DEFAULT, HDF5Constants.H5P_DEFAULT);
H5.H5Sclose(dataspace_id);
- dataspace_id = -1;
+ dataspace_id = HDF5Constants.H5I_INVALID_HID;
}
}
catch (Exception e) {
@@ -139,10 +138,10 @@ public class H5Ex_T_FloatAttribute {
}
private static void ReadDataset() {
- long file_id = -1;
- long dataspace_id = -1;
- long dataset_id = -1;
- long attribute_id = -1;
+ long file_id = HDF5Constants.H5I_INVALID_HID;
+ long dataspace_id = HDF5Constants.H5I_INVALID_HID;
+ long dataset_id = HDF5Constants.H5I_INVALID_HID;
+ long attribute_id = HDF5Constants.H5I_INVALID_HID;
long[] dims = { DIM0, DIM1 };
double[][] dset_data;
diff --git a/java/examples/datatypes/H5Ex_T_Integer.java b/java/examples/datatypes/H5Ex_T_Integer.java
index f0b3755..bb8e0cb 100644
--- a/java/examples/datatypes/H5Ex_T_Integer.java
+++ b/java/examples/datatypes/H5Ex_T_Integer.java
@@ -1,6 +1,5 @@
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* 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 *
@@ -34,9 +33,9 @@ public class H5Ex_T_Integer {
private static final int RANK = 2;
private static void CreateDataset() {
- long file_id = -1;
- long dataspace_id = -1;
- long dataset_id = -1;
+ long file_id = HDF5Constants.H5I_INVALID_HID;
+ long dataspace_id = HDF5Constants.H5I_INVALID_HID;
+ long dataset_id = HDF5Constants.H5I_INVALID_HID;
long[] dims = { DIM0, DIM1 };
int[][] dset_data = new int[DIM0][DIM1];
@@ -117,9 +116,9 @@ public class H5Ex_T_Integer {
}
private static void ReadDataset() {
- long file_id = -1;
- long dataspace_id = -1;
- long dataset_id = -1;
+ long file_id = HDF5Constants.H5I_INVALID_HID;
+ long dataspace_id = HDF5Constants.H5I_INVALID_HID;
+ long dataset_id = HDF5Constants.H5I_INVALID_HID;
long[] dims = { DIM0, DIM1 };
int[][] dset_data;
diff --git a/java/examples/datatypes/H5Ex_T_IntegerAttribute.java b/java/examples/datatypes/H5Ex_T_IntegerAttribute.java
index 8c85c63..b0df5e4 100644
--- a/java/examples/datatypes/H5Ex_T_IntegerAttribute.java
+++ b/java/examples/datatypes/H5Ex_T_IntegerAttribute.java
@@ -1,6 +1,5 @@
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* 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 *
@@ -35,10 +34,10 @@ public class H5Ex_T_IntegerAttribute {
private static final int RANK = 2;
private static void CreateDataset() {
- long file_id = -1;
- long dataspace_id = -1;
- long dataset_id = -1;
- long attribute_id = -1;
+ long file_id = HDF5Constants.H5I_INVALID_HID;
+ long dataspace_id = HDF5Constants.H5I_INVALID_HID;
+ long dataset_id = HDF5Constants.H5I_INVALID_HID;
+ long attribute_id = HDF5Constants.H5I_INVALID_HID;
long[] dims = { DIM0, DIM1 };
int[][] dset_data = new int[DIM0][DIM1];
@@ -64,7 +63,7 @@ public class H5Ex_T_IntegerAttribute {
dataset_id = H5.H5Dcreate(file_id, DATASETNAME, HDF5Constants.H5T_STD_I32LE, dataspace_id,
HDF5Constants.H5P_DEFAULT, HDF5Constants.H5P_DEFAULT, HDF5Constants.H5P_DEFAULT);
H5.H5Sclose(dataspace_id);
- dataspace_id = -1;
+ dataspace_id = HDF5Constants.H5I_INVALID_HID;
}
}
catch (Exception e) {
@@ -137,10 +136,10 @@ public class H5Ex_T_IntegerAttribute {
}
private static void ReadDataset() {
- long file_id = -1;
- long dataspace_id = -1;
- long dataset_id = -1;
- long attribute_id = -1;
+ long file_id = HDF5Constants.H5I_INVALID_HID;
+ long dataspace_id = HDF5Constants.H5I_INVALID_HID;
+ long dataset_id = HDF5Constants.H5I_INVALID_HID;
+ long attribute_id = HDF5Constants.H5I_INVALID_HID;
long[] dims = { DIM0, DIM1 };
int[][] dset_data;
diff --git a/java/examples/datatypes/H5Ex_T_ObjectReference.java b/java/examples/datatypes/H5Ex_T_ObjectReference.java
index 97f02af..38536b8 100644
--- a/java/examples/datatypes/H5Ex_T_ObjectReference.java
+++ b/java/examples/datatypes/H5Ex_T_ObjectReference.java
@@ -1,6 +1,5 @@
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* 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 *
@@ -65,11 +64,11 @@ public class H5Ex_T_ObjectReference {
}
private static void writeObjRef() {
- long file_id = -1;
- long dataspace_id = -1;
- long filespace_id = -1;
- long group_id = -1;
- long dataset_id = -1;
+ long file_id = HDF5Constants.H5I_INVALID_HID;
+ long dataspace_id = HDF5Constants.H5I_INVALID_HID;
+ long filespace_id = HDF5Constants.H5I_INVALID_HID;
+ long group_id = HDF5Constants.H5I_INVALID_HID;
+ long dataset_id = HDF5Constants.H5I_INVALID_HID;
long[] dims = { DIM0 };
byte[][] dset_data = new byte[DIM0][8];
@@ -90,9 +89,9 @@ public class H5Ex_T_ObjectReference {
HDF5Constants.H5P_DEFAULT, HDF5Constants.H5P_DEFAULT, HDF5Constants.H5P_DEFAULT);
if (dataset_id >= 0)
H5.H5Dclose(dataset_id);
- dataset_id = -1;
+ dataset_id = HDF5Constants.H5I_INVALID_HID;
H5.H5Sclose(dataspace_id);
- dataspace_id = -1;
+ dataspace_id = HDF5Constants.H5I_INVALID_HID;
}
}
catch (Exception e) {
@@ -106,7 +105,7 @@ public class H5Ex_T_ObjectReference {
HDF5Constants.H5P_DEFAULT);
if (group_id >= 0)
H5.H5Gclose(group_id);
- group_id = -1;
+ group_id = HDF5Constants.H5I_INVALID_HID;
}
catch (Exception e) {
e.printStackTrace();
@@ -187,11 +186,11 @@ public class H5Ex_T_ObjectReference {
}
private static void readObjRef() {
- long file_id = -1;
- long dataset_id = -1;
- long dataspace_id = -1;
+ long file_id = HDF5Constants.H5I_INVALID_HID;
+ long dataset_id = HDF5Constants.H5I_INVALID_HID;
+ long dataspace_id = HDF5Constants.H5I_INVALID_HID;
int object_type = -1;
- long object_id = -1;
+ long object_id = HDF5Constants.H5I_INVALID_HID;
long[] dims = { DIM0 };
byte[][] dset_data;
diff --git a/java/examples/datatypes/H5Ex_T_ObjectReferenceAttribute.java b/java/examples/datatypes/H5Ex_T_ObjectReferenceAttribute.java
index b1cab7c..b38b0a0 100644
--- a/java/examples/datatypes/H5Ex_T_ObjectReferenceAttribute.java
+++ b/java/examples/datatypes/H5Ex_T_ObjectReferenceAttribute.java
@@ -1,6 +1,5 @@
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* 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 *
@@ -67,11 +66,11 @@ public class H5Ex_T_ObjectReferenceAttribute {
}
private static void CreateDataset() {
- long file_id = -1;
- long dataspace_id = -1;
- long group_id = -1;
- long dataset_id = -1;
- long attribute_id = -1;
+ long file_id = HDF5Constants.H5I_INVALID_HID;
+ long dataspace_id = HDF5Constants.H5I_INVALID_HID;
+ long group_id = HDF5Constants.H5I_INVALID_HID;
+ long dataset_id = HDF5Constants.H5I_INVALID_HID;
+ long attribute_id = HDF5Constants.H5I_INVALID_HID;
long[] dims = { DIM0 };
byte[][] dset_data = new byte[DIM0][8];
@@ -92,9 +91,9 @@ public class H5Ex_T_ObjectReferenceAttribute {
HDF5Constants.H5P_DEFAULT, HDF5Constants.H5P_DEFAULT, HDF5Constants.H5P_DEFAULT);
if (dataset_id >= 0)
H5.H5Dclose(dataset_id);
- dataset_id = -1;
+ dataset_id = HDF5Constants.H5I_INVALID_HID;
H5.H5Sclose(dataspace_id);
- dataspace_id = -1;
+ dataspace_id = HDF5Constants.H5I_INVALID_HID;
}
}
catch (Exception e) {
@@ -108,7 +107,7 @@ public class H5Ex_T_ObjectReferenceAttribute {
HDF5Constants.H5P_DEFAULT);
if (group_id >= 0)
H5.H5Gclose(group_id);
- group_id = -1;
+ group_id = HDF5Constants.H5I_INVALID_HID;
}
catch (Exception e) {
e.printStackTrace();
@@ -139,7 +138,7 @@ public class H5Ex_T_ObjectReferenceAttribute {
dataset_id = H5.H5Dcreate(file_id, DATASETNAME, HDF5Constants.H5T_STD_I32LE, dataspace_id,
HDF5Constants.H5P_DEFAULT, HDF5Constants.H5P_DEFAULT, HDF5Constants.H5P_DEFAULT);
H5.H5Sclose(dataspace_id);
- dataspace_id = -1;
+ dataspace_id = HDF5Constants.H5I_INVALID_HID;
}
}
catch (Exception e) {
@@ -212,12 +211,12 @@ public class H5Ex_T_ObjectReferenceAttribute {
}
private static void ReadDataset() {
- long file_id = -1;
- long dataspace_id = -1;
- long dataset_id = -1;
- long attribute_id = -1;
+ long file_id = HDF5Constants.H5I_INVALID_HID;
+ long dataspace_id = HDF5Constants.H5I_INVALID_HID;
+ long dataset_id = HDF5Constants.H5I_INVALID_HID;
+ long attribute_id = HDF5Constants.H5I_INVALID_HID;
int object_type = -1;
- long object_id = -1;
+ long object_id = HDF5Constants.H5I_INVALID_HID;
long[] dims = { DIM0 };
byte[][] dset_data;
diff --git a/java/examples/datatypes/H5Ex_T_Opaque.java b/java/examples/datatypes/H5Ex_T_Opaque.java
index 1d9ab1b..e851fb2 100644
--- a/java/examples/datatypes/H5Ex_T_Opaque.java
+++ b/java/examples/datatypes/H5Ex_T_Opaque.java
@@ -1,6 +1,5 @@
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* 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 *
@@ -32,10 +31,10 @@ public class H5Ex_T_Opaque {
private static final int RANK = 1;
private static void CreateDataset() {
- long file_id = -1;
- long dataspace_id = -1;
- long datatype_id = -1;
- long dataset_id = -1;
+ long file_id = HDF5Constants.H5I_INVALID_HID;
+ long dataspace_id = HDF5Constants.H5I_INVALID_HID;
+ long datatype_id = HDF5Constants.H5I_INVALID_HID;
+ long dataset_id = HDF5Constants.H5I_INVALID_HID;
long[] dims = { DIM0 };
byte[] dset_data = new byte[DIM0 * LEN];
byte[] str_data = { 'O', 'P', 'A', 'Q', 'U', 'E' };
@@ -138,11 +137,11 @@ public class H5Ex_T_Opaque {
}
private static void ReadDataset() {
- long file_id = -1;
- long datatype_id = -1;
- long dataspace_id = -1;
- long dataset_id = -1;
- long type_len = -1;
+ long file_id = HDF5Constants.H5I_INVALID_HID;
+ long datatype_id = HDF5Constants.H5I_INVALID_HID;
+ long dataspace_id = HDF5Constants.H5I_INVALID_HID;
+ long dataset_id = HDF5Constants.H5I_INVALID_HID;
+ long type_len = HDF5Constants.H5I_INVALID_HID;
long[] dims = { DIM0 };
byte[] dset_data;
String tag_name = null;
diff --git a/java/examples/datatypes/H5Ex_T_OpaqueAttribute.java b/java/examples/datatypes/H5Ex_T_OpaqueAttribute.java
index 8955d77..3e16ab4 100644
--- a/java/examples/datatypes/H5Ex_T_OpaqueAttribute.java
+++ b/java/examples/datatypes/H5Ex_T_OpaqueAttribute.java
@@ -1,6 +1,5 @@
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* 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 *
@@ -33,11 +32,11 @@ public class H5Ex_T_OpaqueAttribute {
private static final int RANK = 1;
private static void CreateDataset() {
- long file_id = -1;
- long dataspace_id = -1;
- long datatype_id = -1;
- long dataset_id = -1;
- long attribute_id = -1;
+ long file_id = HDF5Constants.H5I_INVALID_HID;
+ long dataspace_id = HDF5Constants.H5I_INVALID_HID;
+ long datatype_id = HDF5Constants.H5I_INVALID_HID;
+ long dataset_id = HDF5Constants.H5I_INVALID_HID;
+ long attribute_id = HDF5Constants.H5I_INVALID_HID;
long[] dims = { DIM0 };
byte[] dset_data = new byte[DIM0 * LEN];
byte[] str_data = { 'O', 'P', 'A', 'Q', 'U', 'E' };
@@ -65,7 +64,7 @@ public class H5Ex_T_OpaqueAttribute {
dataset_id = H5.H5Dcreate(file_id, DATASETNAME, HDF5Constants.H5T_STD_I32LE, dataspace_id,
HDF5Constants.H5P_DEFAULT, HDF5Constants.H5P_DEFAULT, HDF5Constants.H5P_DEFAULT);
H5.H5Sclose(dataspace_id);
- dataspace_id = -1;
+ dataspace_id = HDF5Constants.H5I_INVALID_HID;
}
}
catch (Exception e) {
@@ -158,11 +157,11 @@ public class H5Ex_T_OpaqueAttribute {
}
private static void ReadDataset() {
- long file_id = -1;
- long datatype_id = -1;
- long dataspace_id = -1;
- long dataset_id = -1;
- long attribute_id = -1;
+ long file_id = HDF5Constants.H5I_INVALID_HID;
+ long datatype_id = HDF5Constants.H5I_INVALID_HID;
+ long dataspace_id = HDF5Constants.H5I_INVALID_HID;
+ long dataset_id = HDF5Constants.H5I_INVALID_HID;
+ long attribute_id = HDF5Constants.H5I_INVALID_HID;
long type_len = -1;
long[] dims = { DIM0 };
byte[] dset_data;
diff --git a/java/examples/datatypes/H5Ex_T_String.java b/java/examples/datatypes/H5Ex_T_String.java
index f91d866..e497bd8 100644
--- a/java/examples/datatypes/H5Ex_T_String.java
+++ b/java/examples/datatypes/H5Ex_T_String.java
@@ -1,6 +1,5 @@
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* 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 *
@@ -32,11 +31,11 @@ public class H5Ex_T_String {
private static final int RANK = 1;
private static void CreateDataset() {
- long file_id = -1;
- long memtype_id = -1;
- long filetype_id = -1;
- long dataspace_id = -1;
- long dataset_id = -1;
+ long file_id = HDF5Constants.H5I_INVALID_HID;
+ long memtype_id = HDF5Constants.H5I_INVALID_HID;
+ long filetype_id = HDF5Constants.H5I_INVALID_HID;
+ long dataspace_id = HDF5Constants.H5I_INVALID_HID;
+ long dataset_id = HDF5Constants.H5I_INVALID_HID;
long[] dims = { DIM0 };
byte[][] dset_data = new byte[DIM0][SDIM];
StringBuffer[] str_data = { new StringBuffer("Parting"), new StringBuffer("is such"),
@@ -156,11 +155,11 @@ public class H5Ex_T_String {
}
private static void ReadDataset() {
- long file_id = -1;
- long filetype_id = -1;
- long memtype_id = -1;
- long dataspace_id = -1;
- long dataset_id = -1;
+ long file_id = HDF5Constants.H5I_INVALID_HID;
+ long filetype_id = HDF5Constants.H5I_INVALID_HID;
+ long memtype_id = HDF5Constants.H5I_INVALID_HID;
+ long dataspace_id = HDF5Constants.H5I_INVALID_HID;
+ long dataset_id = HDF5Constants.H5I_INVALID_HID;
long sdim = 0;
long[] dims = { DIM0 };
byte[][] dset_data;
diff --git a/java/examples/datatypes/H5Ex_T_StringAttribute.java b/java/examples/datatypes/H5Ex_T_StringAttribute.java
index 7fe46c8..700f6a9 100644
--- a/java/examples/datatypes/H5Ex_T_StringAttribute.java
+++ b/java/examples/datatypes/H5Ex_T_StringAttribute.java
@@ -1,6 +1,5 @@
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* 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 *
@@ -33,12 +32,12 @@ public class H5Ex_T_StringAttribute {
private static final int RANK = 1;
private static void CreateDataset() {
- long file_id = -1;
- long memtype_id = -1;
- long filetype_id = -1;
- long dataspace_id = -1;
- long dataset_id = -1;
- long attribute_id = -1;
+ long file_id = HDF5Constants.H5I_INVALID_HID;
+ long memtype_id = HDF5Constants.H5I_INVALID_HID;
+ long filetype_id = HDF5Constants.H5I_INVALID_HID;
+ long dataspace_id = HDF5Constants.H5I_INVALID_HID;
+ long dataset_id = HDF5Constants.H5I_INVALID_HID;
+ long attribute_id = HDF5Constants.H5I_INVALID_HID;
long[] dims = { DIM0 };
byte[][] dset_data = new byte[DIM0][SDIM];
StringBuffer[] str_data = { new StringBuffer("Parting"), new StringBuffer("is such"),
@@ -80,7 +79,7 @@ public class H5Ex_T_StringAttribute {
dataset_id = H5.H5Dcreate(file_id, DATASETNAME, HDF5Constants.H5T_STD_I32LE, dataspace_id,
HDF5Constants.H5P_DEFAULT, HDF5Constants.H5P_DEFAULT, HDF5Constants.H5P_DEFAULT);
H5.H5Sclose(dataspace_id);
- dataspace_id = -1;
+ dataspace_id = HDF5Constants.H5I_INVALID_HID;
}
}
catch (Exception e) {
@@ -179,12 +178,12 @@ public class H5Ex_T_StringAttribute {
}
private static void ReadDataset() {
- long file_id = -1;
- long filetype_id = -1;
- long memtype_id = -1;
- long dataspace_id = -1;
- long dataset_id = -1;
- long attribute_id = -1;
+ long file_id = HDF5Constants.H5I_INVALID_HID;
+ long filetype_id = HDF5Constants.H5I_INVALID_HID;
+ long memtype_id = HDF5Constants.H5I_INVALID_HID;
+ long dataspace_id = HDF5Constants.H5I_INVALID_HID;
+ long dataset_id = HDF5Constants.H5I_INVALID_HID;
+ long attribute_id = HDF5Constants.H5I_INVALID_HID;
long sdim = 0;
long[] dims = { DIM0 };
byte[][] dset_data;
diff --git a/java/examples/datatypes/H5Ex_T_VLString.java b/java/examples/datatypes/H5Ex_T_VLString.java
index e1c9bd5..8a29e60 100644
--- a/java/examples/datatypes/H5Ex_T_VLString.java
+++ b/java/examples/datatypes/H5Ex_T_VLString.java
@@ -1,6 +1,5 @@
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* 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 *
@@ -26,10 +25,10 @@ public class H5Ex_T_VLString
private static String DATASETNAME = "DS1";
private static void createDataset() {
- long file_id = -1;
- long type_id = -1;
- long dataspace_id = -1;
- long dataset_id = -1;
+ long file_id = HDF5Constants.H5I_INVALID_HID;
+ long type_id = HDF5Constants.H5I_INVALID_HID;
+ long dataspace_id = HDF5Constants.H5I_INVALID_HID;
+ long dataset_id = HDF5Constants.H5I_INVALID_HID;
int rank = 1;
String[] str_data = { "Parting", "is such", "sweet", "sorrow." };
long[] dims = { str_data.length };
@@ -93,9 +92,9 @@ public class H5Ex_T_VLString
}
private static void readDataset() {
- long file_id = -1;
- long type_id = -1;
- long dataset_id = -1;
+ long file_id = HDF5Constants.H5I_INVALID_HID;
+ long type_id = HDF5Constants.H5I_INVALID_HID;
+ long dataset_id = HDF5Constants.H5I_INVALID_HID;
String[] str_data = { "", "", "", "" };
try {
diff --git a/java/examples/datatypes/JavaDatatypeExample.sh.in b/java/examples/datatypes/JavaDatatypeExample.sh.in
index 481d6e7..e26d8c0 100644
--- a/java/examples/datatypes/JavaDatatypeExample.sh.in
+++ b/java/examples/datatypes/JavaDatatypeExample.sh.in
@@ -1,7 +1,6 @@
#! /bin/sh
#
# 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
@@ -15,6 +14,7 @@
top_builddir=@top_builddir@
top_srcdir=@top_srcdir@
srcdir=@srcdir@
+IS_DARWIN="@H5_IS_DARWIN@"
TESTNAME=EX_Datatypes
EXIT_SUCCESS=0
@@ -33,8 +33,8 @@ nerrors=0
# where the libs exist
HDFLIB_HOME="$top_srcdir/java/lib"
-BLDLIBDIR="$top_builddir/hdf5/lib"
BLDDIR="."
+BLDLIBDIR="$BLDDIR/testlibs"
HDFTEST_HOME="$top_srcdir/java/examples/datatypes"
JARFILE=jar@PACKAGE_TARNAME@-@PACKAGE_VERSION@.jar
TESTJARFILE=jar@PACKAGE_TARNAME@datatypes.jar
@@ -110,6 +110,13 @@ COPY_LIBFILES_TO_BLDLIBDIR()
fi
fi
done
+ if [ "$IS_DARWIN" = "yes" ]; then
+ (cd $BLDLIBDIR; \
+ install_name_tool -add_rpath @loader_path libhdf5_java.dylib; \
+ exist_path=` otool -l libhdf5_java.dylib | grep libhdf5 | grep -v java | awk '{print $2}'`; \
+ echo $exist_path; \
+ install_name_tool -change $exist_path @rpath/libhdf5.dylib libhdf5_java.dylib)
+ fi
# copy jar files. Used -f to make sure get a new copy
for tstfile in $COPY_JARTESTFILES
do
diff --git a/java/examples/groups/H5Ex_G_Compact.java b/java/examples/groups/H5Ex_G_Compact.java
index 6078c6c..313c9c7 100644
--- a/java/examples/groups/H5Ex_G_Compact.java
+++ b/java/examples/groups/H5Ex_G_Compact.java
@@ -1,6 +1,5 @@
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* 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 *
@@ -60,9 +59,9 @@ public class H5Ex_G_Compact {
}
public static void CreateGroup() {
- long file_id = -1;
- long group_id = -1;
- long fapl_id = -1;
+ long file_id = HDF5Constants.H5I_INVALID_HID;
+ long group_id = HDF5Constants.H5I_INVALID_HID;
+ long fapl_id = HDF5Constants.H5I_INVALID_HID;
H5G_info_t ginfo;
long size;
diff --git a/java/examples/groups/H5Ex_G_Corder.java b/java/examples/groups/H5Ex_G_Corder.java
index 74f70ba..5df850e 100644
--- a/java/examples/groups/H5Ex_G_Corder.java
+++ b/java/examples/groups/H5Ex_G_Corder.java
@@ -1,6 +1,5 @@
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* 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 *
@@ -25,10 +24,10 @@ public class H5Ex_G_Corder {
private static String FILE = "H5Ex_G_Corder.h5";
private static void CreateGroup() throws Exception {
- long file_id = -1;
- long group_id = -1;
- long subgroup_id = -1;
- long gcpl_id = -1;
+ long file_id = HDF5Constants.H5I_INVALID_HID;
+ long group_id = HDF5Constants.H5I_INVALID_HID;
+ long subgroup_id = HDF5Constants.H5I_INVALID_HID;
+ long gcpl_id = HDF5Constants.H5I_INVALID_HID;
int status;
H5G_info_t ginfo;
int i;
diff --git a/java/examples/groups/H5Ex_G_Create.java b/java/examples/groups/H5Ex_G_Create.java
index f653987..9304538 100644
--- a/java/examples/groups/H5Ex_G_Create.java
+++ b/java/examples/groups/H5Ex_G_Create.java
@@ -1,6 +1,5 @@
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* 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 *
@@ -25,8 +24,8 @@ public class H5Ex_G_Create {
private static String GROUPNAME = "G1";
private static void CreateGroup() {
- long file_id = -1;
- long group_id = -1;
+ long file_id = HDF5Constants.H5I_INVALID_HID;
+ long group_id = HDF5Constants.H5I_INVALID_HID;
// Create a new file using default properties.
try {
diff --git a/java/examples/groups/H5Ex_G_Intermediate.java b/java/examples/groups/H5Ex_G_Intermediate.java
index 6109e9a..ad0290c 100644
--- a/java/examples/groups/H5Ex_G_Intermediate.java
+++ b/java/examples/groups/H5Ex_G_Intermediate.java
@@ -1,6 +1,5 @@
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* 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 *
@@ -31,9 +30,9 @@ public class H5Ex_G_Intermediate {
private void CreateGroup() throws Exception {
- long file_id = -1;
- long group_id = -1;
- long gcpl_id = -1;
+ long file_id = HDF5Constants.H5I_INVALID_HID;
+ long group_id = HDF5Constants.H5I_INVALID_HID;
+ long gcpl_id = HDF5Constants.H5I_INVALID_HID;
try {
// Create a new file_id using the default properties.
diff --git a/java/examples/groups/H5Ex_G_Iterate.java b/java/examples/groups/H5Ex_G_Iterate.java
index 71361f8..6caecac 100644
--- a/java/examples/groups/H5Ex_G_Iterate.java
+++ b/java/examples/groups/H5Ex_G_Iterate.java
@@ -1,6 +1,5 @@
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* 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 *
@@ -58,7 +57,7 @@ public class H5Ex_G_Iterate {
}
private static void do_iterate() {
- long file_id = -1;
+ long file_id = HDF5Constants.H5I_INVALID_HID;
// Open a file using default properties.
try {
diff --git a/java/examples/groups/H5Ex_G_Phase.java b/java/examples/groups/H5Ex_G_Phase.java
index 7824123..67a2f53 100644
--- a/java/examples/groups/H5Ex_G_Phase.java
+++ b/java/examples/groups/H5Ex_G_Phase.java
@@ -1,6 +1,5 @@
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* 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 *
@@ -60,11 +59,11 @@ public class H5Ex_G_Phase {
}
private static void CreateGroup() {
- long file_id = -1;
- long group_id = -1;
- long subgroup_id = -1;
- long fapl_id = -1;
- long gcpl_id = -1;
+ long file_id = HDF5Constants.H5I_INVALID_HID;
+ long group_id = HDF5Constants.H5I_INVALID_HID;
+ long subgroup_id = HDF5Constants.H5I_INVALID_HID;
+ long fapl_id = HDF5Constants.H5I_INVALID_HID;
+ long gcpl_id = HDF5Constants.H5I_INVALID_HID;
H5G_info_t ginfo;
String name = "G0"; // Name of subgroup_id
int i;
diff --git a/java/examples/groups/H5Ex_G_Traverse.java b/java/examples/groups/H5Ex_G_Traverse.java
index 76ed6c8..c5b6373 100644
--- a/java/examples/groups/H5Ex_G_Traverse.java
+++ b/java/examples/groups/H5Ex_G_Traverse.java
@@ -1,6 +1,5 @@
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* 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 *
@@ -43,7 +42,7 @@ public class H5Ex_G_Traverse {
public static H5L_iterate_t iter_cb = new H5L_iter_callbackT();
private static void OpenGroup() {
- long file_id = -1;
+ long file_id = HDF5Constants.H5I_INVALID_HID;
H5O_info_t infobuf;
opdata od = new opdata();
diff --git a/java/examples/groups/H5Ex_G_Visit.java b/java/examples/groups/H5Ex_G_Visit.java
index c479259..790be80 100644
--- a/java/examples/groups/H5Ex_G_Visit.java
+++ b/java/examples/groups/H5Ex_G_Visit.java
@@ -1,6 +1,5 @@
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* 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 *
@@ -47,7 +46,7 @@ public class H5Ex_G_Visit {
private void VisitGroup() throws Exception {
- long file_id = -1;
+ long file_id = HDF5Constants.H5I_INVALID_HID;
try {
// Open file
diff --git a/java/examples/groups/JavaGroupExample.sh.in b/java/examples/groups/JavaGroupExample.sh.in
index 34cf643..3b0e9d1 100644
--- a/java/examples/groups/JavaGroupExample.sh.in
+++ b/java/examples/groups/JavaGroupExample.sh.in
@@ -14,6 +14,7 @@
top_builddir=@top_builddir@
top_srcdir=@top_srcdir@
srcdir=@srcdir@
+IS_DARWIN="@H5_IS_DARWIN@"
TESTNAME=EX_Groups
EXIT_SUCCESS=0
@@ -32,9 +33,9 @@ nerrors=0
# where the libs exist
HDFLIB_HOME="$top_srcdir/java/lib"
-BLDLIBDIR="$top_builddir/hdf5/lib"
-BLDITERDIR="./groups"
BLDDIR="."
+BLDLIBDIR="$BLDDIR/testlibs"
+BLDITERDIR="./groups"
HDFTEST_HOME="$top_srcdir/java/examples/groups"
JARFILE=jar@PACKAGE_TARNAME@-@PACKAGE_VERSION@.jar
TESTJARFILE=jar@PACKAGE_TARNAME@groups.jar
@@ -104,6 +105,13 @@ COPY_LIBFILES_TO_BLDLIBDIR()
fi
fi
done
+ if [ "$IS_DARWIN" = "yes" ]; then
+ (cd $BLDLIBDIR; \
+ install_name_tool -add_rpath @loader_path libhdf5_java.dylib; \
+ exist_path=` otool -l libhdf5_java.dylib | grep libhdf5 | grep -v java | awk '{print $2}'`; \
+ echo $exist_path; \
+ install_name_tool -change $exist_path @rpath/libhdf5.dylib libhdf5_java.dylib)
+ fi
# copy jar files. Used -f to make sure get a new copy
for tstfile in $COPY_JARTESTFILES
do
diff --git a/java/examples/intro/H5_CreateAttribute.java b/java/examples/intro/H5_CreateAttribute.java
index 22b03ad..949a770 100644
--- a/java/examples/intro/H5_CreateAttribute.java
+++ b/java/examples/intro/H5_CreateAttribute.java
@@ -1,6 +1,5 @@
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* 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 *
@@ -28,10 +27,10 @@ public class H5_CreateAttribute {
private static String DATASETATTRIBUTE = "Units";
private static void CreateDatasetAttribute() {
- long file_id = -1;
- long dataspace_id = -1;
- long dataset_id = -1;
- long attribute_id = -1;
+ long file_id = HDF5Constants.H5I_INVALID_HID;
+ long dataspace_id = HDF5Constants.H5I_INVALID_HID;
+ long dataset_id = HDF5Constants.H5I_INVALID_HID;
+ long attribute_id = HDF5Constants.H5I_INVALID_HID;
long[] dims1 = { DIM_X, DIM_Y };
long[] dims = { 2 };
int[] attr_data = { 100, 200 };
diff --git a/java/examples/intro/H5_CreateDataset.java b/java/examples/intro/H5_CreateDataset.java
index 7b56e83..f938be2 100644
--- a/java/examples/intro/H5_CreateDataset.java
+++ b/java/examples/intro/H5_CreateDataset.java
@@ -1,6 +1,5 @@
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* 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 *
@@ -27,9 +26,9 @@ public class H5_CreateDataset {
private static final int DIM_Y = 6;
private static void CreateDataset() {
- long file_id = -1;
- long dataspace_id = -1;
- long dataset_id = -1;
+ long file_id = HDF5Constants.H5I_INVALID_HID;
+ long dataspace_id = HDF5Constants.H5I_INVALID_HID;
+ long dataset_id = HDF5Constants.H5I_INVALID_HID;
long[] dims = { DIM_X, DIM_Y };
// Create a new file using default properties.
diff --git a/java/examples/intro/H5_CreateFile.java b/java/examples/intro/H5_CreateFile.java
index 367e61f..d48ba6c 100644
--- a/java/examples/intro/H5_CreateFile.java
+++ b/java/examples/intro/H5_CreateFile.java
@@ -1,6 +1,5 @@
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* 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 *
@@ -24,7 +23,7 @@ public class H5_CreateFile {
static final String FILENAME = "H5_CreateFile.h5";
private static void CreateFile() {
- long file_id = -1;
+ long file_id = HDF5Constants.H5I_INVALID_HID;
// Create a new file using default properties.
try {
diff --git a/java/examples/intro/H5_CreateGroup.java b/java/examples/intro/H5_CreateGroup.java
index 54f6252..c0bb954 100644
--- a/java/examples/intro/H5_CreateGroup.java
+++ b/java/examples/intro/H5_CreateGroup.java
@@ -1,6 +1,5 @@
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* 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 *
@@ -25,8 +24,8 @@ public class H5_CreateGroup {
private static String GROUPNAME = "MyGroup";
private static void CreateGroup() {
- long file_id = -1;
- long group_id = -1;
+ long file_id = HDF5Constants.H5I_INVALID_HID;
+ long group_id = HDF5Constants.H5I_INVALID_HID;
// Create a new file using default properties.
try {
diff --git a/java/examples/intro/H5_CreateGroupAbsoluteRelative.java b/java/examples/intro/H5_CreateGroupAbsoluteRelative.java
index b9c35d7..f2c6168 100644
--- a/java/examples/intro/H5_CreateGroupAbsoluteRelative.java
+++ b/java/examples/intro/H5_CreateGroupAbsoluteRelative.java
@@ -1,6 +1,5 @@
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* 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 *
@@ -27,10 +26,10 @@ public class H5_CreateGroupAbsoluteRelative {
private static String GROUPNAME_B = "GroupB";
private static void CreateGroupAbsoluteAndRelative() {
- long file_id = -1;
- long group1_id = -1;
- long group2_id = -1;
- long group3_id = -1;
+ long file_id = HDF5Constants.H5I_INVALID_HID;
+ long group1_id = HDF5Constants.H5I_INVALID_HID;
+ long group2_id = HDF5Constants.H5I_INVALID_HID;
+ long group3_id = HDF5Constants.H5I_INVALID_HID;
// Create a new file using default properties.
try {
diff --git a/java/examples/intro/H5_CreateGroupDataset.java b/java/examples/intro/H5_CreateGroupDataset.java
index 191a21a..f1d1cba 100644
--- a/java/examples/intro/H5_CreateGroupDataset.java
+++ b/java/examples/intro/H5_CreateGroupDataset.java
@@ -1,6 +1,5 @@
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* 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 *
@@ -32,12 +31,12 @@ public class H5_CreateGroupDataset {
private static final int DIM2_Y = 10;
private static void h5_crtgrpd() {
- long file_id = -1;
- long dataspace_id = -1;
- long dataset_id = -1;
- long group_id = -1;
- long group1_id = -1;
- long group2_id = -1;
+ long file_id = HDF5Constants.H5I_INVALID_HID;
+ long dataspace_id = HDF5Constants.H5I_INVALID_HID;
+ long dataset_id = HDF5Constants.H5I_INVALID_HID;
+ long group_id = HDF5Constants.H5I_INVALID_HID;
+ long group1_id = HDF5Constants.H5I_INVALID_HID;
+ long group2_id = HDF5Constants.H5I_INVALID_HID;
int[][] dset1_data = new int[DIM1_X][DIM1_Y];
int[][] dset2_data = new int[DIM2_X][DIM2_Y];
long[] dims1 = { DIM1_X, DIM1_Y };
@@ -108,7 +107,7 @@ public class H5_CreateGroupDataset {
try {
if (dataspace_id >= 0)
H5.H5Sclose(dataspace_id);
- dataspace_id = -1;
+ dataspace_id = HDF5Constants.H5I_INVALID_HID;
}
catch (Exception e) {
e.printStackTrace();
@@ -118,7 +117,7 @@ public class H5_CreateGroupDataset {
try {
if (dataset_id >= 0)
H5.H5Dclose(dataset_id);
- dataset_id = -1;
+ dataset_id = HDF5Constants.H5I_INVALID_HID;
}
catch (Exception e) {
e.printStackTrace();
diff --git a/java/examples/intro/H5_ReadWrite.java b/java/examples/intro/H5_ReadWrite.java
index 812ac77..67e1ac5 100644
--- a/java/examples/intro/H5_ReadWrite.java
+++ b/java/examples/intro/H5_ReadWrite.java
@@ -1,6 +1,5 @@
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* 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 *
@@ -27,9 +26,9 @@ public class H5_ReadWrite {
private static final int DIM_Y = 6;
private static void ReadWriteDataset() {
- long file_id = -1;
- long dataspace_id = -1;
- long dataset_id = -1;
+ long file_id = HDF5Constants.H5I_INVALID_HID;
+ long dataspace_id = HDF5Constants.H5I_INVALID_HID;
+ long dataset_id = HDF5Constants.H5I_INVALID_HID;
long[] dims = { DIM_X, DIM_Y };
int[][] dset_data = new int[DIM_X][DIM_Y];
diff --git a/java/examples/intro/JavaIntroExample.sh.in b/java/examples/intro/JavaIntroExample.sh.in
index 4eac31d..db741e5 100644
--- a/java/examples/intro/JavaIntroExample.sh.in
+++ b/java/examples/intro/JavaIntroExample.sh.in
@@ -1,7 +1,6 @@
#! /bin/sh
#
# 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
@@ -15,6 +14,7 @@
top_builddir=@top_builddir@
top_srcdir=@top_srcdir@
srcdir=@srcdir@
+IS_DARWIN="@H5_IS_DARWIN@"
TESTNAME=EX_Intro
EXIT_SUCCESS=0
@@ -33,8 +33,8 @@ nerrors=0
# where the libs exist
HDFLIB_HOME="$top_srcdir/java/lib"
-BLDLIBDIR="$top_builddir/hdf5/lib"
BLDDIR="."
+BLDLIBDIR="$BLDDIR/testlibs"
HDFTEST_HOME="$top_srcdir/java/examples/intro"
JARFILE=jar@PACKAGE_TARNAME@-@PACKAGE_VERSION@.jar
TESTJARFILE=jar@PACKAGE_TARNAME@intro.jar
@@ -99,6 +99,13 @@ COPY_LIBFILES_TO_BLDLIBDIR()
fi
fi
done
+ if [ "$IS_DARWIN" = "yes" ]; then
+ (cd $BLDLIBDIR; \
+ install_name_tool -add_rpath @loader_path libhdf5_java.dylib; \
+ exist_path=` otool -l libhdf5_java.dylib | grep libhdf5 | grep -v java | awk '{print $2}'`; \
+ echo $exist_path; \
+ install_name_tool -change $exist_path @rpath/libhdf5.dylib libhdf5_java.dylib)
+ fi
# copy jar files. Used -f to make sure get a new copy
for tstfile in $COPY_JARTESTFILES
do
diff --git a/java/src/Makefile.am b/java/src/Makefile.am
index 98630e6..a0abb32 100644
--- a/java/src/Makefile.am
+++ b/java/src/Makefile.am
@@ -69,7 +69,7 @@ hdf5_java_JAVA = \
${pkgpath}/callbacks/H5P_prp_set_func_cb.java \
${pkgpath}/callbacks/H5P_iterate_cb.java \
${pkgpath}/callbacks/H5P_iterate_t.java \
- ${pkgpath}/exceptions/HDF5AtomException.java \
+ ${pkgpath}/exceptions/HDF5IdException.java \
${pkgpath}/exceptions/HDF5AttributeException.java \
${pkgpath}/exceptions/HDF5BtreeException.java \
${pkgpath}/exceptions/HDF5DataFiltersException.java \
diff --git a/java/src/hdf/hdf5lib/CMakeLists.txt b/java/src/hdf/hdf5lib/CMakeLists.txt
index f3d9b8d..5651031 100644
--- a/java/src/hdf/hdf5lib/CMakeLists.txt
+++ b/java/src/hdf/hdf5lib/CMakeLists.txt
@@ -42,7 +42,7 @@ set (HDF5_JAVA_HDF_HDF5_CALLBACKS_SOURCES
set (HDF5_JAVA_HDF_HDF5_EXCEPTIONS_SOURCES
exceptions/HDF5Exception.java
- exceptions/HDF5AtomException.java
+ exceptions/HDF5IdException.java
exceptions/HDF5AttributeException.java
exceptions/HDF5BtreeException.java
exceptions/HDF5DataFiltersException.java
diff --git a/java/src/hdf/hdf5lib/H5.java b/java/src/hdf/hdf5lib/H5.java
index 3d0b308..aef0ba1 100644
--- a/java/src/hdf/hdf5lib/H5.java
+++ b/java/src/hdf/hdf5lib/H5.java
@@ -241,10 +241,14 @@ public class H5 implements java.io.Serializable {
*/
public final static int LIB_VERSION[] = { 1, 13, 0 };
+ /**
+ * add system property to load library by path
+ */
public final static String H5PATH_PROPERTY_KEY = "hdf.hdf5lib.H5.hdf5lib";
- // add system property to load library by name from library path, via
- // System.loadLibrary()
+ /**
+ * add system property to load library by name from library path, via System.loadLibrary()
+ */
public final static String H5_LIBRARY_NAME_PROPERTY_KEY = "hdf.hdf5lib.H5.loadLibraryName";
private static String s_libraryName;
private static boolean isLibraryLoaded = false;
@@ -257,6 +261,9 @@ public class H5 implements java.io.Serializable {
loadH5Lib();
}
+ /**
+ * load native library
+ */
public static void loadH5Lib() {
// Make sure that the library is loaded only once
if (isLibraryLoaded)
@@ -468,6 +475,35 @@ public class H5 implements java.io.Serializable {
**/
public synchronized static native int H5get_libversion(int[] libversion) throws HDF5LibraryException;
+ /**
+ * H5set_free_list_limits
+ * Sets limits on the different kinds of free lists. Setting a value
+ * of -1 for a limit means no limit of that type. These limits are global
+ * for the entire library. Each "global" limit only applies to free lists
+ * of that type, so if an application sets a limit of 1 MB on each of the
+ * global lists, up to 3 MB of total storage might be allocated (1MB on
+ * each of regular, array and block type lists).
+ *
+ * The settings for block free lists are duplicated to factory free lists.
+ * Factory free list limits cannot be set independently currently.
+ *
+ * @param reg_global_lim
+ * The limit on all "regular" free list memory used
+ * @param reg_list_lim
+ * The limit on memory used in each "regular" free list
+ * @param arr_global_lim
+ * The limit on all "array" free list memory used
+ * @param arr_list_lim
+ * The limit on memory used in each "array" free list
+ * @param blk_global_lim
+ * The limit on all "block" free list memory used
+ * @param blk_list_lim
+ * The limit on memory used in each "block" free list
+ * @return a non-negative value if successful, along with the version information.
+ *
+ * @exception HDF5LibraryException
+ * - Error from the HDF-5 Library.
+ */
public synchronized static native int H5set_free_list_limits(int reg_global_lim, int reg_list_lim,
int arr_global_lim, int arr_list_lim, int blk_global_lim, int blk_list_lim) throws HDF5LibraryException;
@@ -476,8 +512,8 @@ public class H5 implements java.io.Serializable {
*
* @param file_export_name
* The file name to export data into.
- * @param file_name
- * The name of the HDF5 file containing the dataset.
+ * @param file_id
+ * The identifier of the HDF5 file containing the dataset.
* @param object_path
* The full path of the dataset to be exported.
* @param binary_order
@@ -489,10 +525,31 @@ public class H5 implements java.io.Serializable {
* @exception HDF5LibraryException
* - Error from the HDF-5 Library.
**/
- public synchronized static native void H5export_dataset(String file_export_name, String file_name,
+ public synchronized static native void H5export_dataset(String file_export_name, long file_id,
String object_path, int binary_order) throws HDF5LibraryException;
/**
+ * H5export_attribute is a utility function to save data in a file.
+ *
+ * @param file_export_name
+ * The file name to export data into.
+ * @param dataset_id
+ * The identifier of the dataset containing the attribute.
+ * @param attribute_name
+ * The attribute to be exported.
+ * @param binary_order
+ * 99 - export data as text.
+ * 1 - export data as binary Native Order.
+ * 2 - export data as binary Little Endian.
+ * 3 - export data as binary Big Endian.
+ *
+ * @exception HDF5LibraryException
+ * - Error from the HDF-5 Library.
+ **/
+ public synchronized static native void H5export_attribute(String file_export_name, long dataset_id,
+ String attribute_name, int binary_order) throws HDF5LibraryException;
+
+ /**
* H5is_library_threadsafe Checks to see if the library was built with thread-safety enabled.
*
* @return true if hdf5 library implements threadsafe
@@ -1016,7 +1073,7 @@ public class H5 implements java.io.Serializable {
/**
* H5Aread reads an attribute, specified with attr_id. The attribute's memory datatype is specified with
- * mem_type_id. The entire attribute is read into buf from the file.
+ * mem_type_id. The entire attribute is read into buffer from the file.
*
* @param attr_id
* IN: Identifier of an attribute to read.
@@ -1037,11 +1094,47 @@ public class H5 implements java.io.Serializable {
public synchronized static native int H5Aread(long attr_id, long mem_type_id, byte[] obj, boolean isCriticalPinning)
throws HDF5LibraryException, NullPointerException;
+ /**
+ * H5Aread reads an attribute, specified with attr_id. The attribute's memory datatype is specified with
+ * mem_type_id. The entire attribute is read into buffer from the file.
+ *
+ * @param attr_id
+ * IN: Identifier of an attribute to read.
+ * @param mem_type_id
+ * IN: Identifier of the attribute datatype (in memory).
+ * @param buf
+ * Buffer to store data read from the file.
+ *
+ * @return a non-negative value if successful
+ *
+ * @exception HDF5LibraryException
+ * - Error from the HDF-5 Library.
+ * @exception NullPointerException
+ * - data buffer is null.
+ **/
public synchronized static int H5Aread(long attr_id, long mem_type_id, byte[] buf) throws HDF5LibraryException, NullPointerException
{
return H5Aread(attr_id, mem_type_id, buf, true);
}
+ /**
+ * H5Aread reads an attribute, specified with attr_id. The attribute's memory datatype is specified with
+ * mem_type_id. The entire attribute is read into buffer from the file.
+ *
+ * @param attr_id
+ * IN: Identifier of an attribute to read.
+ * @param mem_type_id
+ * IN: Identifier of the attribute datatype (in memory).
+ * @param obj
+ * Buffer to store data read from the file.
+ *
+ * @return a non-negative value if successful
+ *
+ * @exception HDF5LibraryException
+ * - Error from the HDF-5 Library.
+ * @exception NullPointerException
+ * - data buffer is null.
+ **/
public synchronized static int H5Aread(long attr_id, long mem_type_id, Object obj) throws HDF5Exception, HDF5LibraryException, NullPointerException
{
return H5Aread(attr_id, mem_type_id, obj, true);
@@ -1141,63 +1234,343 @@ public class H5 implements java.io.Serializable {
return status;
}
+ /**
+ * H5Aread reads an attribute, specified with attr_id. The attribute's memory datatype is specified with
+ * mem_type_id. The entire attribute is read into buffer of double from the file.
+ *
+ * @param attr_id
+ * IN: Identifier of an attribute to read.
+ * @param mem_type_id
+ * IN: Identifier of the attribute datatype (in memory).
+ * @param buf
+ * Buffer of double to store data read from the file.
+ * @param isCriticalPinning
+ * request lock on data reference.
+ *
+ * @return a non-negative value if successful
+ *
+ * @exception HDF5LibraryException
+ * - Error from the HDF-5 Library.
+ * @exception NullPointerException
+ * - data buffer is null.
+ **/
public synchronized static native int H5Aread_double(long attr_id, long mem_type_id, double[] buf, boolean isCriticalPinning)
throws HDF5LibraryException, NullPointerException;
+ /**
+ * H5Aread reads an attribute, specified with attr_id. The attribute's memory datatype is specified with
+ * mem_type_id. The entire attribute is read into buffer of double from the file.
+ *
+ * @param attr_id
+ * IN: Identifier of an attribute to read.
+ * @param mem_type_id
+ * IN: Identifier of the attribute datatype (in memory).
+ * @param buf
+ * Buffer of double to store data read from the file.
+ *
+ * @return a non-negative value if successful
+ *
+ * @exception HDF5LibraryException
+ * - Error from the HDF-5 Library.
+ * @exception NullPointerException
+ * - data buffer is null.
+ **/
public synchronized static int H5Aread_double(long attr_id, long mem_type_id, double[] buf)
throws HDF5LibraryException, NullPointerException
{
return H5Aread_double(attr_id, mem_type_id, buf, true);
}
+ /**
+ * H5Aread reads an attribute, specified with attr_id. The attribute's memory datatype is specified with
+ * mem_type_id. The entire attribute is read into buffer of float from the file.
+ *
+ * @param attr_id
+ * IN: Identifier of an attribute to read.
+ * @param mem_type_id
+ * IN: Identifier of the attribute datatype (in memory).
+ * @param buf
+ * Buffer of float to store data read from the file.
+ * @param isCriticalPinning
+ * request lock on data reference.
+ *
+ * @return a non-negative value if successful
+ *
+ * @exception HDF5LibraryException
+ * - Error from the HDF-5 Library.
+ * @exception NullPointerException
+ * - data buffer is null.
+ **/
public synchronized static native int H5Aread_float(long attr_id, long mem_type_id, float[] buf, boolean isCriticalPinning)
throws HDF5LibraryException, NullPointerException;
+ /**
+ * H5Aread reads an attribute, specified with attr_id. The attribute's memory datatype is specified with
+ * mem_type_id. The entire attribute is read into buffer of float from the file.
+ *
+ * @param attr_id
+ * IN: Identifier of an attribute to read.
+ * @param mem_type_id
+ * IN: Identifier of the attribute datatype (in memory).
+ * @param buf
+ * Buffer of float to store data read from the file.
+ *
+ * @return a non-negative value if successful
+ *
+ * @exception HDF5LibraryException
+ * - Error from the HDF-5 Library.
+ * @exception NullPointerException
+ * - data buffer is null.
+ **/
public synchronized static int H5Aread_float(long attr_id, long mem_type_id, float[] buf)
throws HDF5LibraryException, NullPointerException
{
return H5Aread_float(attr_id, mem_type_id, buf, true);
}
+ /**
+ * H5Aread reads an attribute, specified with attr_id. The attribute's memory datatype is specified with
+ * mem_type_id. The entire attribute is read into buffer of int from the file.
+ *
+ * @param attr_id
+ * IN: Identifier of an attribute to read.
+ * @param mem_type_id
+ * IN: Identifier of the attribute datatype (in memory).
+ * @param buf
+ * Buffer of int to store data read from the file.
+ * @param isCriticalPinning
+ * request lock on data reference.
+ *
+ * @return a non-negative value if successful
+ *
+ * @exception HDF5LibraryException
+ * - Error from the HDF-5 Library.
+ * @exception NullPointerException
+ * - data buffer is null.
+ **/
public synchronized static native int H5Aread_int(long attr_id, long mem_type_id, int[] buf, boolean isCriticalPinning)
throws HDF5LibraryException, NullPointerException;
+ /**
+ * H5Aread reads an attribute, specified with attr_id. The attribute's memory datatype is specified with
+ * mem_type_id. The entire attribute is read into buffer of int from the file.
+ *
+ * @param attr_id
+ * IN: Identifier of an attribute to read.
+ * @param mem_type_id
+ * IN: Identifier of the attribute datatype (in memory).
+ * @param buf
+ * Buffer of int to store data read from the file.
+ *
+ * @return a non-negative value if successful
+ *
+ * @exception HDF5LibraryException
+ * - Error from the HDF-5 Library.
+ * @exception NullPointerException
+ * - data buffer is null.
+ **/
public synchronized static int H5Aread_int(long attr_id, long mem_type_id, int[] buf)
throws HDF5LibraryException, NullPointerException
{
return H5Aread_int(attr_id, mem_type_id, buf, true);
}
+ /**
+ * H5Aread reads an attribute, specified with attr_id. The attribute's memory datatype is specified with
+ * mem_type_id. The entire attribute is read into buffer of long from the file.
+ *
+ * @param attr_id
+ * IN: Identifier of an attribute to read.
+ * @param mem_type_id
+ * IN: Identifier of the attribute datatype (in memory).
+ * @param buf
+ * Buffer of long to store data read from the file.
+ * @param isCriticalPinning
+ * request lock on data reference.
+ *
+ * @return a non-negative value if successful
+ *
+ * @exception HDF5LibraryException
+ * - Error from the HDF-5 Library.
+ * @exception NullPointerException
+ * - data buffer is null.
+ **/
public synchronized static native int H5Aread_long(long attr_id, long mem_type_id, long[] buf, boolean isCriticalPinning)
throws HDF5LibraryException, NullPointerException;
+ /**
+ * H5Aread reads an attribute, specified with attr_id. The attribute's memory datatype is specified with
+ * mem_type_id. The entire attribute is read into buffer of long from the file.
+ *
+ * @param attr_id
+ * IN: Identifier of an attribute to read.
+ * @param mem_type_id
+ * IN: Identifier of the attribute datatype (in memory).
+ * @param buf
+ * Buffer of long to store data read from the file.
+ *
+ * @return a non-negative value if successful
+ *
+ * @exception HDF5LibraryException
+ * - Error from the HDF-5 Library.
+ * @exception NullPointerException
+ * - data buffer is null.
+ **/
public synchronized static int H5Aread_long(long attr_id, long mem_type_id, long[] buf)
throws HDF5LibraryException, NullPointerException
{
return H5Aread_long(attr_id, mem_type_id, buf, true);
}
+ /**
+ * H5Aread reads an attribute, specified with attr_id. The attribute's memory datatype is specified with
+ * mem_type_id. The entire attribute is read into buffer of String from the file.
+ *
+ * @param attr_id
+ * IN: Identifier of an attribute to read.
+ * @param mem_type_id
+ * IN: Identifier of the attribute datatype (in memory).
+ * @param buf
+ * Buffer of String to store data read from the file.
+ *
+ * @return a non-negative value if successful
+ *
+ * @exception HDF5LibraryException
+ * - Error from the HDF-5 Library.
+ * @exception NullPointerException
+ * - data buffer is null.
+ **/
public synchronized static native int H5Aread_reg_ref(long attr_id, long mem_type_id, String[] buf)
throws HDF5LibraryException, NullPointerException;
+ /**
+ * H5Aread reads an attribute, specified with attr_id. The attribute's memory datatype is specified with
+ * mem_type_id. The entire attribute is read into buffer of short from the file.
+ *
+ * @param attr_id
+ * IN: Identifier of an attribute to read.
+ * @param mem_type_id
+ * IN: Identifier of the attribute datatype (in memory).
+ * @param buf
+ * Buffer of short to store data read from the file.
+ * @param isCriticalPinning
+ * request lock on data reference.
+ *
+ * @return a non-negative value if successful
+ *
+ * @exception HDF5LibraryException
+ * - Error from the HDF-5 Library.
+ * @exception NullPointerException
+ * - data buffer is null.
+ **/
public synchronized static native int H5Aread_short(long attr_id, long mem_type_id, short[] buf, boolean isCriticalPinning)
throws HDF5LibraryException, NullPointerException;
+ /**
+ * H5Aread reads an attribute, specified with attr_id. The attribute's memory datatype is specified with
+ * mem_type_id. The entire attribute is read into buffer of shortfrom the file.
+ *
+ * @param attr_id
+ * IN: Identifier of an attribute to read.
+ * @param mem_type_id
+ * IN: Identifier of the attribute datatype (in memory).
+ * @param buf
+ * Buffer of short to store data read from the file.
+ *
+ * @return a non-negative value if successful
+ *
+ * @exception HDF5LibraryException
+ * - Error from the HDF-5 Library.
+ * @exception NullPointerException
+ * - data buffer is null.
+ **/
public synchronized static int H5Aread_short(long attr_id, long mem_type_id, short[] buf)
throws HDF5LibraryException, NullPointerException
{
return H5Aread_short(attr_id, mem_type_id, buf, true);
}
+ /**
+ * H5Aread reads an attribute, specified with attr_id. The attribute's memory datatype is specified with
+ * mem_type_id. The entire attribute is read into buffer of variable-lenght from the file.
+ *
+ * @param attr_id
+ * IN: Identifier of an attribute to read.
+ * @param mem_type_id
+ * IN: Identifier of the attribute datatype (in memory).
+ * @param buf
+ * Buffer of variable-lenght to store data read from the file.
+ *
+ * @return a non-negative value if successful
+ *
+ * @exception HDF5LibraryException
+ * - Error from the HDF-5 Library.
+ * @exception NullPointerException
+ * - data buffer is null.
+ **/
public synchronized static native int H5AreadVL(long attr_id, long mem_type_id, Object[] buf)
throws HDF5LibraryException, NullPointerException;
+ /**
+ * H5Aread reads an attribute, specified with attr_id. The attribute's memory datatype is specified with
+ * mem_type_id. The entire attribute is read into buffer of String from the file.
+ *
+ * @param attr_id
+ * IN: Identifier of an attribute to read.
+ * @param mem_type_id
+ * IN: Identifier of the attribute datatype (in memory).
+ * @param buf
+ * Buffer of String to store data read from the file.
+ *
+ * @return a non-negative value if successful
+ *
+ * @exception HDF5LibraryException
+ * - Error from the HDF-5 Library.
+ * @exception NullPointerException
+ * - data buffer is null.
+ **/
public synchronized static native int H5Aread_string(long attr_id, long mem_type_id, String[] buf)
throws HDF5LibraryException, NullPointerException;
+ /**
+ * H5Aread reads an attribute, specified with attr_id. The attribute's memory datatype is specified with
+ * mem_type_id. The entire attribute is read into buffer of variable-lenght strings from the file.
+ *
+ * @param attr_id
+ * IN: Identifier of an attribute to read.
+ * @param mem_type_id
+ * IN: Identifier of the attribute datatype (in memory).
+ * @param buf
+ * Buffer of variable-lenght strings to store data read from the file.
+ *
+ * @return a non-negative value if successful
+ *
+ * @exception HDF5LibraryException
+ * - Error from the HDF-5 Library.
+ * @exception NullPointerException
+ * - data buffer is null.
+ **/
public synchronized static native int H5Aread_VLStrings(long attr_id, long mem_type_id, Object[] buf)
throws HDF5LibraryException, NullPointerException;
+ /**
+ * H5Aread reads an attribute, specified with attr_id. The attribute's memory datatype is specified with
+ * mem_type_id. The entire attribute is read into buffer of string from the file.
+ *
+ * @param attr_id
+ * IN: Identifier of an attribute to read.
+ * @param mem_type_id
+ * IN: Identifier of the attribute datatype (in memory).
+ * @param buf
+ * Buffer of string to store data read from the file.
+ *
+ * @return a non-negative value if successful
+ *
+ * @exception HDF5LibraryException
+ * - Error from the HDF-5 Library.
+ * @exception NullPointerException
+ * - data buffer is null.
+ **/
public synchronized static native int H5AreadComplex(long attr_id, long mem_type_id, String[] buf)
throws HDF5LibraryException, NullPointerException;
@@ -1270,12 +1643,48 @@ public class H5 implements java.io.Serializable {
public synchronized static native int H5Awrite(long attr_id, long mem_type_id, byte[] buf, boolean isCriticalPinning)
throws HDF5LibraryException, NullPointerException;
+ /**
+ * H5Awrite writes an attribute, specified with attr_id. The attribute's memory datatype is specified with
+ * mem_type_id. The entire attribute is written from buf to the file.
+ *
+ * @param attr_id
+ * IN: Identifier of an attribute to write.
+ * @param mem_type_id
+ * IN: Identifier of the attribute datatype (in memory).
+ * @param buf
+ * IN: Buffer with data to be written to the file.
+ *
+ * @return a non-negative value if successful
+ *
+ * @exception HDF5LibraryException
+ * - Error from the HDF-5 Library.
+ * @exception NullPointerException
+ * - data is null.
+ **/
public synchronized static int H5Awrite(long attr_id, long mem_type_id, byte[] buf)
throws HDF5LibraryException, NullPointerException
{
return H5Awrite(attr_id, mem_type_id, buf, true);
}
+ /**
+ * H5Awrite writes an attribute, specified with attr_id. The attribute's memory datatype is specified with
+ * mem_type_id. The entire attribute is written from buf to the file.
+ *
+ * @param attr_id
+ * IN: Identifier of an attribute to write.
+ * @param mem_type_id
+ * IN: Identifier of the attribute datatype (in memory).
+ * @param obj
+ * IN: Buffer with data to be written to the file.
+ *
+ * @return a non-negative value if successful
+ *
+ * @exception HDF5LibraryException
+ * - Error from the HDF-5 Library.
+ * @exception NullPointerException
+ * - data is null.
+ **/
public synchronized static int H5Awrite(long attr_id, long mem_type_id, Object obj)
throws HDF5Exception, HDF5LibraryException, NullPointerException
{
@@ -1353,60 +1762,286 @@ public class H5 implements java.io.Serializable {
return status;
}
+ /**
+ * H5Awrite writes an attribute, specified with attr_id. The attribute's memory datatype is specified with
+ * mem_type_id. The entire attribute is written from buffer of double to the file.
+ *
+ * @param attr_id
+ * IN: Identifier of an attribute to write.
+ * @param mem_type_id
+ * IN: Identifier of the attribute datatype (in memory).
+ * @param buf
+ * IN: Buffer of double with data to be written to the file.
+ * @param isCriticalPinning
+ * IN: request lock on data reference.
+ *
+ * @return a non-negative value if successful
+ *
+ * @exception HDF5LibraryException
+ * - Error from the HDF-5 Library.
+ * @exception NullPointerException
+ * - data is null.
+ **/
public synchronized static native int H5Awrite_double(long attr_id, long mem_type_id, double[] buf, boolean isCriticalPinning)
throws HDF5LibraryException, NullPointerException;
+ /**
+ * H5Awrite writes an attribute, specified with attr_id. The attribute's memory datatype is specified with
+ * mem_type_id. The entire attribute is written from buffer of double to the file.
+ *
+ * @param attr_id
+ * IN: Identifier of an attribute to write.
+ * @param mem_type_id
+ * IN: Identifier of the attribute datatype (in memory).
+ * @param buf
+ * IN: Buffer of double with data to be written to the file.
+ *
+ * @return a non-negative value if successful
+ *
+ * @exception HDF5LibraryException
+ * - Error from the HDF-5 Library.
+ * @exception NullPointerException
+ * - data is null.
+ **/
public synchronized static int H5Awrite_double(long attr_id, long mem_type_id, double[] buf)
throws HDF5LibraryException, NullPointerException
{
return H5Awrite_double(attr_id, mem_type_id, buf, true);
}
+ /**
+ * H5Awrite writes an attribute, specified with attr_id. The attribute's memory datatype is specified with
+ * mem_type_id. The entire attribute is written from buffer of float to the file.
+ *
+ * @param attr_id
+ * IN: Identifier of an attribute to write.
+ * @param mem_type_id
+ * IN: Identifier of the attribute datatype (in memory).
+ * @param buf
+ * IN: Buffer of float with data to be written to the file.
+ * @param isCriticalPinning
+ * IN: request lock on data reference.
+ *
+ * @return a non-negative value if successful
+ *
+ * @exception HDF5LibraryException
+ * - Error from the HDF-5 Library.
+ * @exception NullPointerException
+ * - data is null.
+ **/
public synchronized static native int H5Awrite_float(long attr_id, long mem_type_id, float[] buf, boolean isCriticalPinning)
throws HDF5LibraryException, NullPointerException;
+ /**
+ * H5Awrite writes an attribute, specified with attr_id. The attribute's memory datatype is specified with
+ * mem_type_id. The entire attribute is written from buffer of float to the file.
+ *
+ * @param attr_id
+ * IN: Identifier of an attribute to write.
+ * @param mem_type_id
+ * IN: Identifier of the attribute datatype (in memory).
+ * @param buf
+ * IN: Buffer of float with data to be written to the file.
+ *
+ * @return a non-negative value if successful
+ *
+ * @exception HDF5LibraryException
+ * - Error from the HDF-5 Library.
+ * @exception NullPointerException
+ * - data is null.
+ **/
public synchronized static int H5Awrite_float(long attr_id, long mem_type_id, float[] buf)
throws HDF5LibraryException, NullPointerException
{
return H5Awrite_float(attr_id, mem_type_id, buf, true);
}
+ /**
+ * H5Awrite writes an attribute, specified with attr_id. The attribute's memory datatype is specified with
+ * mem_type_id. The entire attribute is written from buffer of int to the file.
+ *
+ * @param attr_id
+ * IN: Identifier of an attribute to write.
+ * @param mem_type_id
+ * IN: Identifier of the attribute datatype (in memory).
+ * @param buf
+ * IN: Buffer of int with data to be written to the file.
+ * @param isCriticalPinning
+ * IN: request lock on data reference.
+ *
+ * @return a non-negative value if successful
+ *
+ * @exception HDF5LibraryException
+ * - Error from the HDF-5 Library.
+ * @exception NullPointerException
+ * - data is null.
+ **/
public synchronized static native int H5Awrite_int(long attr_id, long mem_type_id, int[] buf, boolean isCriticalPinning)
throws HDF5LibraryException, NullPointerException;
+ /**
+ * H5Awrite writes an attribute, specified with attr_id. The attribute's memory datatype is specified with
+ * mem_type_id. The entire attribute is written from buffer of int to the file.
+ *
+ * @param attr_id
+ * IN: Identifier of an attribute to write.
+ * @param mem_type_id
+ * IN: Identifier of the attribute datatype (in memory).
+ * @param buf
+ * IN: Buffer of int with data to be written to the file.
+ *
+ * @return a non-negative value if successful
+ *
+ * @exception HDF5LibraryException
+ * - Error from the HDF-5 Library.
+ * @exception NullPointerException
+ * - data is null.
+ **/
public synchronized static int H5Awrite_int(long attr_id, long mem_type_id, int[] buf)
throws HDF5LibraryException, NullPointerException
{
return H5Awrite_int(attr_id, mem_type_id, buf, true);
}
+ /**
+ * H5Awrite writes an attribute, specified with attr_id. The attribute's memory datatype is specified with
+ * mem_type_id. The entire attribute is written from buffer of long to the file.
+ *
+ * @param attr_id
+ * IN: Identifier of an attribute to write.
+ * @param mem_type_id
+ * IN: Identifier of the attribute datatype (in memory).
+ * @param buf
+ * IN: Buffer of long with data to be written to the file.
+ * @param isCriticalPinning
+ * IN: request lock on data reference.
+ *
+ * @return a non-negative value if successful
+ *
+ * @exception HDF5LibraryException
+ * - Error from the HDF-5 Library.
+ * @exception NullPointerException
+ * - data is null.
+ **/
public synchronized static native int H5Awrite_long(long attr_id, long mem_type_id, long[] buf, boolean isCriticalPinning)
throws HDF5LibraryException, NullPointerException;
+ /**
+ * H5Awrite writes an attribute, specified with attr_id. The attribute's memory datatype is specified with
+ * mem_type_id. The entire attribute is written from buffer of long to the file.
+ *
+ * @param attr_id
+ * IN: Identifier of an attribute to write.
+ * @param mem_type_id
+ * IN: Identifier of the attribute datatype (in memory).
+ * @param buf
+ * IN: Buffer of long with data to be written to the file.
+ *
+ * @return a non-negative value if successful
+ *
+ * @exception HDF5LibraryException
+ * - Error from the HDF-5 Library.
+ * @exception NullPointerException
+ * - data is null.
+ **/
public synchronized static int H5Awrite_long(long attr_id, long mem_type_id, long[] buf)
throws HDF5LibraryException, NullPointerException
{
return H5Awrite_long(attr_id, mem_type_id, buf, true);
}
+ /**
+ * H5Awrite writes an attribute, specified with attr_id. The attribute's memory datatype is specified with
+ * mem_type_id. The entire attribute is written from buffer of short to the file.
+ *
+ * @param attr_id
+ * IN: Identifier of an attribute to write.
+ * @param mem_type_id
+ * IN: Identifier of the attribute datatype (in memory).
+ * @param buf
+ * IN: Buffer of short with data to be written to the file.
+ * @param isCriticalPinning
+ * IN: request lock on data reference.
+ *
+ * @return a non-negative value if successful
+ *
+ * @exception HDF5LibraryException
+ * - Error from the HDF-5 Library.
+ * @exception NullPointerException
+ * - data is null.
+ **/
public synchronized static native int H5Awrite_short(long attr_id, long mem_type_id, short[] buf, boolean isCriticalPinning)
throws HDF5LibraryException, NullPointerException;
+ /**
+ * H5Awrite writes an attribute, specified with attr_id. The attribute's memory datatype is specified with
+ * mem_type_id. The entire attribute is written from buffer of short to the file.
+ *
+ * @param attr_id
+ * IN: Identifier of an attribute to write.
+ * @param mem_type_id
+ * IN: Identifier of the attribute datatype (in memory).
+ * @param buf
+ * IN: Buffer of short with data to be written to the file.
+ *
+ * @return a non-negative value if successful
+ *
+ * @exception HDF5LibraryException
+ * - Error from the HDF-5 Library.
+ * @exception NullPointerException
+ * - data is null.
+ **/
public synchronized static int H5Awrite_short(long attr_id, long mem_type_id, short[] buf)
throws HDF5LibraryException, NullPointerException
{
return H5Awrite_short(attr_id, mem_type_id, buf, true);
}
+ /**
+ * H5Awrite writes an attribute, specified with attr_id. The attribute's memory datatype is specified with
+ * mem_type_id. The entire attribute is written from buffer of string to the file.
+ *
+ * @param attr_id
+ * IN: Identifier of an attribute to write.
+ * @param mem_type_id
+ * IN: Identifier of the attribute datatype (in memory).
+ * @param buf
+ * IN: Buffer of string with data to be written to the file.
+ *
+ * @return a non-negative value if successful
+ *
+ * @exception HDF5LibraryException
+ * - Error from the HDF-5 Library.
+ * @exception NullPointerException
+ * - data is null.
+ **/
public synchronized static native int H5Awrite_string(long attr_id, long mem_type_id, String[] buf)
throws HDF5LibraryException, NullPointerException;
+ /**
+ * H5Awrite writes an attribute, specified with attr_id. The attribute's memory datatype is specified with
+ * mem_type_id. The entire attribute is written from buffer of variable-lenght to the file.
+ *
+ * @param attr_id
+ * IN: Identifier of an attribute to write.
+ * @param mem_type_id
+ * IN: Identifier of the attribute datatype (in memory).
+ * @param buf
+ * IN: Buffer of variable-lenght with data to be written to the file.
+ *
+ * @return a non-negative value if successful
+ *
+ * @exception HDF5LibraryException
+ * - Error from the HDF-5 Library.
+ * @exception NullPointerException
+ * - data is null.
+ **/
public synchronized static native int H5AwriteVL(long attr_id, long mem_type_id, Object[] buf)
throws HDF5LibraryException, NullPointerException;
/**
* H5Awrite_VLStrings writes a variable length String dataset, specified by its identifier attr_id, from
- * the application memory buffer buf into the file.
+ * the application memory buffer buffer of variable-lenght strings into the file.
*
* ---- contributed by Rosetta Biosoftware
*
@@ -1415,7 +2050,7 @@ public class H5 implements java.io.Serializable {
* @param mem_type_id
* Identifier of the memory datatype.
* @param buf
- * Buffer with data to be written to the file.
+ * Buffer of variable-lenght strings with data to be written to the file.
*
* @return a non-negative value if successful
*
@@ -1922,12 +2557,60 @@ public class H5 implements java.io.Serializable {
long file_space_id, long xfer_plist_id, byte[] obj, boolean isCriticalPinning) throws HDF5LibraryException,
NullPointerException;
+ /**
+ * H5Dread reads a (partial) dataset, specified by its identifier dataset_id, from the file into the application
+ * memory buffer buf.
+ *
+ * @param dataset_id
+ * Identifier of the dataset read from.
+ * @param mem_type_id
+ * Identifier of the memory datatype.
+ * @param mem_space_id
+ * Identifier of the memory dataspace.
+ * @param file_space_id
+ * Identifier of the dataset's dataspace in the file.
+ * @param xfer_plist_id
+ * Identifier of a transfer property list for this I/O operation.
+ * @param buf
+ * Buffer to store data read from the file.
+ *
+ * @return a non-negative value if successful
+ *
+ * @exception HDF5LibraryException
+ * - Error from the HDF-5 Library.
+ * @exception NullPointerException
+ * - data buffer is null.
+ **/
public synchronized static int H5Dread(long dataset_id, long mem_type_id, long mem_space_id, long file_space_id,
long xfer_plist_id, byte[] buf) throws HDF5LibraryException, NullPointerException
{
return H5Dread(dataset_id, mem_type_id, mem_space_id, file_space_id, xfer_plist_id, buf, true);
}
+ /**
+ * H5Dread reads a (partial) dataset, specified by its identifier dataset_id, from the file into the application
+ * memory buffer buf.
+ *
+ * @param dataset_id
+ * Identifier of the dataset read from.
+ * @param mem_type_id
+ * Identifier of the memory datatype.
+ * @param mem_space_id
+ * Identifier of the memory dataspace.
+ * @param file_space_id
+ * Identifier of the dataset's dataspace in the file.
+ * @param xfer_plist_id
+ * Identifier of a transfer property list for this I/O operation.
+ * @param obj
+ * Buffer to store data read from the file.
+ *
+ * @return a non-negative value if successful
+ *
+ * @exception HDF5LibraryException
+ * - Error from the HDF-5 Library.
+ * @exception NullPointerException
+ * - data buffer is null.
+ **/
public synchronized static int H5Dread(long dataset_id, long mem_type_id, long mem_space_id, long file_space_id,
long xfer_plist_id, Object obj) throws HDF5Exception, HDF5LibraryException, NullPointerException
{
@@ -2043,65 +2726,411 @@ public class H5 implements java.io.Serializable {
return status;
}
+ /**
+ * H5Dread reads a (partial) dataset, specified by its identifier dataset_id, from the file into the application
+ * memory buffer of type double.
+ *
+ * @param dataset_id
+ * Identifier of the dataset read from.
+ * @param mem_type_id
+ * Identifier of the memory datatype.
+ * @param mem_space_id
+ * Identifier of the memory dataspace.
+ * @param file_space_id
+ * Identifier of the dataset's dataspace in the file.
+ * @param xfer_plist_id
+ * Identifier of a transfer property list for this I/O operation.
+ * @param buf
+ * Buffer of type double to store data read from the file.
+ * @param isCriticalPinning
+ * request lock on data reference.
+ *
+ * @return a non-negative value if successful
+ *
+ * @exception HDF5LibraryException
+ * - Error from the HDF-5 Library.
+ * @exception NullPointerException
+ * - data buffer is null.
+ **/
public synchronized static native int H5Dread_double(long dataset_id, long mem_type_id, long mem_space_id,
long file_space_id, long xfer_plist_id, double[] buf, boolean isCriticalPinning)
throws HDF5LibraryException, NullPointerException;
+ /**
+ * H5Dread reads a (partial) dataset, specified by its identifier dataset_id, from the file into the application
+ * memory buffer of type double.
+ *
+ * @param dataset_id
+ * Identifier of the dataset read from.
+ * @param mem_type_id
+ * Identifier of the memory datatype.
+ * @param mem_space_id
+ * Identifier of the memory dataspace.
+ * @param file_space_id
+ * Identifier of the dataset's dataspace in the file.
+ * @param xfer_plist_id
+ * Identifier of a transfer property list for this I/O operation.
+ * @param buf
+ * Buffer of double to store data read from the file.
+ *
+ * @return a non-negative value if successful
+ *
+ * @exception HDF5LibraryException
+ * - Error from the HDF-5 Library.
+ * @exception NullPointerException
+ * - data buffer is null.
+ **/
public synchronized static int H5Dread_double(long dataset_id, long mem_type_id, long mem_space_id,
long file_space_id, long xfer_plist_id, double[] buf) throws HDF5LibraryException, NullPointerException
{
return H5Dread_double(dataset_id, mem_type_id, mem_space_id, file_space_id, xfer_plist_id, buf, true);
}
+ /**
+ * H5Dread reads a (partial) dataset, specified by its identifier dataset_id, from the file into the application
+ * memory buffer of float.
+ *
+ * @param dataset_id
+ * Identifier of the dataset read from.
+ * @param mem_type_id
+ * Identifier of the memory datatype.
+ * @param mem_space_id
+ * Identifier of the memory dataspace.
+ * @param file_space_id
+ * Identifier of the dataset's dataspace in the file.
+ * @param xfer_plist_id
+ * Identifier of a transfer property list for this I/O operation.
+ * @param buf
+ * Buffer of float to store data read from the file.
+ * @param isCriticalPinning
+ * request lock on data reference.
+ *
+ * @return a non-negative value if successful
+ *
+ * @exception HDF5LibraryException
+ * - Error from the HDF-5 Library.
+ * @exception NullPointerException
+ * - data buffer is null.
+ **/
public synchronized static native int H5Dread_float(long dataset_id, long mem_type_id, long mem_space_id,
long file_space_id, long xfer_plist_id, float[] buf, boolean isCriticalPinning)
throws HDF5LibraryException, NullPointerException;
+ /**
+ * H5Dread reads a (partial) dataset, specified by its identifier dataset_id, from the file into the application
+ * memory buffer of float.
+ *
+ * @param dataset_id
+ * Identifier of the dataset read from.
+ * @param mem_type_id
+ * Identifier of the memory datatype.
+ * @param mem_space_id
+ * Identifier of the memory dataspace.
+ * @param file_space_id
+ * Identifier of the dataset's dataspace in the file.
+ * @param xfer_plist_id
+ * Identifier of a transfer property list for this I/O operation.
+ * @param buf
+ * Buffer of float to store data read from the file.
+ *
+ * @return a non-negative value if successful
+ *
+ * @exception HDF5LibraryException
+ * - Error from the HDF-5 Library.
+ * @exception NullPointerException
+ * - data buffer is null.
+ **/
public synchronized static int H5Dread_float(long dataset_id, long mem_type_id, long mem_space_id,
long file_space_id, long xfer_plist_id, float[] buf) throws HDF5LibraryException, NullPointerException
{
return H5Dread_float(dataset_id, mem_type_id, mem_space_id, file_space_id, xfer_plist_id, buf, true);
}
+ /**
+ * H5Dread reads a (partial) dataset, specified by its identifier dataset_id, from the file into the application
+ * memory buffer of int.
+ *
+ * @param dataset_id
+ * Identifier of the dataset read from.
+ * @param mem_type_id
+ * Identifier of the memory datatype.
+ * @param mem_space_id
+ * Identifier of the memory dataspace.
+ * @param file_space_id
+ * Identifier of the dataset's dataspace in the file.
+ * @param xfer_plist_id
+ * Identifier of a transfer property list for this I/O operation.
+ * @param buf
+ * Buffer of int to store data read from the file.
+ * @param isCriticalPinning
+ * request lock on data reference.
+ *
+ * @return a non-negative value if successful
+ *
+ * @exception HDF5LibraryException
+ * - Error from the HDF-5 Library.
+ * @exception NullPointerException
+ * - data buffer is null.
+ **/
public synchronized static native int H5Dread_int(long dataset_id, long mem_type_id, long mem_space_id,
long file_space_id, long xfer_plist_id, int[] buf, boolean isCriticalPinning) throws HDF5LibraryException,
NullPointerException;
+ /**
+ * H5Dread reads a (partial) dataset, specified by its identifier dataset_id, from the file into the application
+ * memory buffer of int.
+ *
+ * @param dataset_id
+ * Identifier of the dataset read from.
+ * @param mem_type_id
+ * Identifier of the memory datatype.
+ * @param mem_space_id
+ * Identifier of the memory dataspace.
+ * @param file_space_id
+ * Identifier of the dataset's dataspace in the file.
+ * @param xfer_plist_id
+ * Identifier of a transfer property list for this I/O operation.
+ * @param buf
+ * Buffer of int to store data read from the file.
+ *
+ * @return a non-negative value if successful
+ *
+ * @exception HDF5LibraryException
+ * - Error from the HDF-5 Library.
+ * @exception NullPointerException
+ * - data buffer is null.
+ **/
public synchronized static int H5Dread_int(long dataset_id, long mem_type_id, long mem_space_id,
long file_space_id, long xfer_plist_id, int[] buf) throws HDF5LibraryException, NullPointerException
{
return H5Dread_int(dataset_id, mem_type_id, mem_space_id, file_space_id, xfer_plist_id, buf, true);
}
+ /**
+ * H5Dread reads a (partial) dataset, specified by its identifier dataset_id, from the file into the application
+ * memory buffer of long.
+ *
+ * @param dataset_id
+ * Identifier of the dataset read from.
+ * @param mem_type_id
+ * Identifier of the memory datatype.
+ * @param mem_space_id
+ * Identifier of the memory dataspace.
+ * @param file_space_id
+ * Identifier of the dataset's dataspace in the file.
+ * @param xfer_plist_id
+ * Identifier of a transfer property list for this I/O operation.
+ * @param buf
+ * Buffer of long to store data read from the file.
+ * @param isCriticalPinning
+ * request lock on data reference.
+ *
+ * @return a non-negative value if successful
+ *
+ * @exception HDF5LibraryException
+ * - Error from the HDF-5 Library.
+ * @exception NullPointerException
+ * - data buffer is null.
+ **/
public synchronized static native int H5Dread_long(long dataset_id, long mem_type_id, long mem_space_id,
long file_space_id, long xfer_plist_id, long[] buf, boolean isCriticalPinning) throws HDF5LibraryException,
NullPointerException;
+ /**
+ * H5Dread reads a (partial) dataset, specified by its identifier dataset_id, from the file into the application
+ * memory buffer of long.
+ *
+ * @param dataset_id
+ * Identifier of the dataset read from.
+ * @param mem_type_id
+ * Identifier of the memory datatype.
+ * @param mem_space_id
+ * Identifier of the memory dataspace.
+ * @param file_space_id
+ * Identifier of the dataset's dataspace in the file.
+ * @param xfer_plist_id
+ * Identifier of a transfer property list for this I/O operation.
+ * @param buf
+ * Buffer of long to store data read from the file.
+ *
+ * @return a non-negative value if successful
+ *
+ * @exception HDF5LibraryException
+ * - Error from the HDF-5 Library.
+ * @exception NullPointerException
+ * - data buffer is null.
+ **/
public synchronized static int H5Dread_long(long dataset_id, long mem_type_id, long mem_space_id,
long file_space_id, long xfer_plist_id, long[] buf) throws HDF5LibraryException, NullPointerException
{
return H5Dread_long(dataset_id, mem_type_id, mem_space_id, file_space_id, xfer_plist_id, buf, true);
}
+ /**
+ * H5Dread reads a (partial) dataset, specified by its identifier dataset_id, from the file into the application
+ * memory buffer of string.
+ *
+ * @param dataset_id
+ * Identifier of the dataset read from.
+ * @param mem_type_id
+ * Identifier of the memory datatype.
+ * @param mem_space_id
+ * Identifier of the memory dataspace.
+ * @param file_space_id
+ * Identifier of the dataset's dataspace in the file.
+ * @param xfer_plist_id
+ * Identifier of a transfer property list for this I/O operation.
+ * @param buf
+ * Buffer of string to store data read from the file.
+ *
+ * @return a non-negative value if successful
+ *
+ * @exception HDF5LibraryException
+ * - Error from the HDF-5 Library.
+ * @exception NullPointerException
+ * - data buffer is null.
+ **/
public synchronized static native int H5Dread_reg_ref(long dataset_id, long mem_type_id, long mem_space_id,
long file_space_id, long xfer_plist_id, String[] buf) throws HDF5LibraryException, NullPointerException;
+ /**
+ * H5Dread reads a (partial) dataset, specified by its identifier dataset_id, from the file into the application
+ * memory buffer of short.
+ *
+ * @param dataset_id
+ * Identifier of the dataset read from.
+ * @param mem_type_id
+ * Identifier of the memory datatype.
+ * @param mem_space_id
+ * Identifier of the memory dataspace.
+ * @param file_space_id
+ * Identifier of the dataset's dataspace in the file.
+ * @param xfer_plist_id
+ * Identifier of a transfer property list for this I/O operation.
+ * @param buf
+ * Buffer of short to store data read from the file.
+ * @param isCriticalPinning
+ * request lock on data reference.
+ *
+ * @return a non-negative value if successful
+ *
+ * @exception HDF5LibraryException
+ * - Error from the HDF-5 Library.
+ * @exception NullPointerException
+ * - data buffer is null.
+ **/
public synchronized static native int H5Dread_short(long dataset_id, long mem_type_id, long mem_space_id,
long file_space_id, long xfer_plist_id, short[] buf, boolean isCriticalPinning)
throws HDF5LibraryException, NullPointerException;
+ /**
+ * H5Dread reads a (partial) dataset, specified by its identifier dataset_id, from the file into the application
+ * memory buffer of short.
+ *
+ * @param dataset_id
+ * Identifier of the dataset read from.
+ * @param mem_type_id
+ * Identifier of the memory datatype.
+ * @param mem_space_id
+ * Identifier of the memory dataspace.
+ * @param file_space_id
+ * Identifier of the dataset's dataspace in the file.
+ * @param xfer_plist_id
+ * Identifier of a transfer property list for this I/O operation.
+ * @param buf
+ * Buffer of short to store data read from the file.
+ *
+ * @return a non-negative value if successful
+ *
+ * @exception HDF5LibraryException
+ * - Error from the HDF-5 Library.
+ * @exception NullPointerException
+ * - data buffer is null.
+ **/
public synchronized static int H5Dread_short(long dataset_id, long mem_type_id, long mem_space_id,
long file_space_id, long xfer_plist_id, short[] buf) throws HDF5LibraryException, NullPointerException
{
return H5Dread_short(dataset_id, mem_type_id, mem_space_id, file_space_id, xfer_plist_id, buf, true);
}
+ /**
+ * H5Dread reads a (partial) dataset, specified by its identifier dataset_id, from the file into the application
+ * memory buffer of variable-lenght.
+ *
+ * @param dataset_id
+ * Identifier of the dataset read from.
+ * @param mem_type_id
+ * Identifier of the memory datatype.
+ * @param mem_space_id
+ * Identifier of the memory dataspace.
+ * @param file_space_id
+ * Identifier of the dataset's dataspace in the file.
+ * @param xfer_plist_id
+ * Identifier of a transfer property list for this I/O operation.
+ * @param buf
+ * Buffer of variable-lenght to store data read from the file.
+ *
+ * @return a non-negative value if successful
+ *
+ * @exception HDF5LibraryException
+ * - Error from the HDF-5 Library.
+ * @exception NullPointerException
+ * - data buffer is null.
+ **/
public synchronized static native int H5DreadVL(long dataset_id, long mem_type_id, long mem_space_id,
long file_space_id, long xfer_plist_id, Object[] buf) throws HDF5LibraryException, NullPointerException;
+ /**
+ * H5Dread reads a (partial) dataset, specified by its identifier dataset_id, from the file into the application
+ * memory buffer of string.
+ *
+ * @param dataset_id
+ * Identifier of the dataset read from.
+ * @param mem_type_id
+ * Identifier of the memory datatype.
+ * @param mem_space_id
+ * Identifier of the memory dataspace.
+ * @param file_space_id
+ * Identifier of the dataset's dataspace in the file.
+ * @param xfer_plist_id
+ * Identifier of a transfer property list for this I/O operation.
+ * @param buf
+ * Buffer of string to store data read from the file.
+ *
+ * @return a non-negative value if successful
+ *
+ * @exception HDF5LibraryException
+ * - Error from the HDF-5 Library.
+ * @exception NullPointerException
+ * - data buffer is null.
+ **/
public synchronized static native int H5Dread_string(long dataset_id, long mem_type_id, long mem_space_id,
long file_space_id, long xfer_plist_id, String[] buf) throws HDF5LibraryException, NullPointerException;
+ /**
+ * H5Dread reads a (partial) dataset, specified by its identifier dataset_id, from the file into the application
+ * memory buffer of variable-lenght strings.
+ *
+ * @param dataset_id
+ * Identifier of the dataset read from.
+ * @param mem_type_id
+ * Identifier of the memory datatype.
+ * @param mem_space_id
+ * Identifier of the memory dataspace.
+ * @param file_space_id
+ * Identifier of the dataset's dataspace in the file.
+ * @param xfer_plist_id
+ * Identifier of a transfer property list for this I/O operation.
+ * @param buf
+ * Buffer of variable-lenght strings to store data read from the file.
+ *
+ * @return a non-negative value if successful
+ *
+ * @exception HDF5LibraryException
+ * - Error from the HDF-5 Library.
+ * @exception NullPointerException
+ * - data buffer is null.
+ **/
public synchronized static native int H5Dread_VLStrings(long dataset_id, long mem_type_id, long mem_space_id,
long file_space_id, long xfer_plist_id, Object[] buf) throws HDF5LibraryException, NullPointerException;
@@ -2170,7 +3199,7 @@ public class H5 implements java.io.Serializable {
/**
* H5Dwrite writes a (partial) dataset, specified by its identifier dataset_id, from the application memory buffer
- * buf into the file.
+ * into the file.
*
* @param dataset_id
* Identifier of the dataset read from.
@@ -2198,12 +3227,60 @@ public class H5 implements java.io.Serializable {
long file_space_id, long xfer_plist_id, byte[] buf, boolean isCriticalPinning) throws HDF5LibraryException,
NullPointerException;
+ /**
+ * H5Dwrite writes a (partial) dataset, specified by its identifier dataset_id, from the application memory buffer
+ * into the file.
+ *
+ * @param dataset_id
+ * Identifier of the dataset read from.
+ * @param mem_type_id
+ * Identifier of the memory datatype.
+ * @param mem_space_id
+ * Identifier of the memory dataspace.
+ * @param file_space_id
+ * Identifier of the dataset's dataspace in the file.
+ * @param xfer_plist_id
+ * Identifier of a transfer property list for this I/O operation.
+ * @param buf
+ * Buffer with data to be written to the file.
+ *
+ * @return a non-negative value if successful
+ *
+ * @exception HDF5LibraryException
+ * - Error from the HDF-5 Library.
+ * @exception NullPointerException
+ * - name is null.
+ **/
public synchronized static int H5Dwrite(long dataset_id, long mem_type_id, long mem_space_id, long file_space_id,
long xfer_plist_id, byte[] buf) throws HDF5LibraryException, NullPointerException
{
return H5Dwrite(dataset_id, mem_type_id, mem_space_id, file_space_id, xfer_plist_id, buf, true);
}
+ /**
+ * H5Dwrite writes a (partial) dataset, specified by its identifier dataset_id, from the application memory buffer
+ * into the file.
+ *
+ * @param dataset_id
+ * Identifier of the dataset read from.
+ * @param mem_type_id
+ * Identifier of the memory datatype.
+ * @param mem_space_id
+ * Identifier of the memory dataspace.
+ * @param file_space_id
+ * Identifier of the dataset's dataspace in the file.
+ * @param xfer_plist_id
+ * Identifier of a transfer property list for this I/O operation.
+ * @param obj
+ * Buffer with data to be written to the file.
+ *
+ * @return a non-negative value if successful
+ *
+ * @exception HDF5LibraryException
+ * - Error from the HDF-5 Library.
+ * @exception NullPointerException
+ * - name is null.
+ **/
public synchronized static int H5Dwrite(long dataset_id, long mem_type_id, long mem_space_id, long file_space_id,
long xfer_plist_id, Object obj) throws HDF5Exception, HDF5LibraryException, NullPointerException
{
@@ -2299,59 +3376,357 @@ public class H5 implements java.io.Serializable {
return status;
}
+ /**
+ * H5Dwrite writes a (partial) dataset, specified by its identifier dataset_id, from the application memory buffer
+ * into the file.
+ *
+ * @param dataset_id
+ * Identifier of the dataset read from.
+ * @param mem_type_id
+ * Identifier of the memory datatype.
+ * @param mem_space_id
+ * Identifier of the memory dataspace.
+ * @param file_space_id
+ * Identifier of the dataset's dataspace in the file.
+ * @param xfer_plist_id
+ * Identifier of a transfer property list for this I/O operation.
+ * @param buf
+ * Buffer of double with data to be written to the file.
+ * @param isCriticalPinning
+ * request lock on data reference.
+ *
+ * @return a non-negative value if successful
+ *
+ * @exception HDF5LibraryException
+ * - Error from the HDF-5 Library.
+ * @exception NullPointerException
+ * - name is null.
+ **/
public synchronized static native int H5Dwrite_double(long dataset_id, long mem_type_id, long mem_space_id,
long file_space_id, long xfer_plist_id, double[] buf, boolean isCriticalPinning)
throws HDF5LibraryException, NullPointerException;
+ /**
+ * H5Dwrite writes a (partial) dataset, specified by its identifier dataset_id, from the application memory buffer
+ * into the file.
+ *
+ * @param dataset_id
+ * Identifier of the dataset read from.
+ * @param mem_type_id
+ * Identifier of the memory datatype.
+ * @param mem_space_id
+ * Identifier of the memory dataspace.
+ * @param file_space_id
+ * Identifier of the dataset's dataspace in the file.
+ * @param xfer_plist_id
+ * Identifier of a transfer property list for this I/O operation.
+ * @param buf
+ * Buffer of double with data to be written to the file.
+ *
+ * @return a non-negative value if successful
+ *
+ * @exception HDF5LibraryException
+ * - Error from the HDF-5 Library.
+ * @exception NullPointerException
+ * - name is null.
+ **/
public synchronized static int H5Dwrite_double(long dataset_id, long mem_type_id, long mem_space_id,
long file_space_id, long xfer_plist_id, double[] buf) throws HDF5LibraryException, NullPointerException
{
return H5Dwrite_double(dataset_id, mem_type_id, mem_space_id, file_space_id, xfer_plist_id, buf, true);
}
+ /**
+ * H5Dwrite writes a (partial) dataset, specified by its identifier dataset_id, from the application memory buffer
+ * into the file.
+ *
+ * @param dataset_id
+ * Identifier of the dataset read from.
+ * @param mem_type_id
+ * Identifier of the memory datatype.
+ * @param mem_space_id
+ * Identifier of the memory dataspace.
+ * @param file_space_id
+ * Identifier of the dataset's dataspace in the file.
+ * @param xfer_plist_id
+ * Identifier of a transfer property list for this I/O operation.
+ * @param buf
+ * Buffer of float with data to be written to the file.
+ * @param isCriticalPinning
+ * request lock on data reference.
+ *
+ * @return a non-negative value if successful
+ *
+ * @exception HDF5LibraryException
+ * - Error from the HDF-5 Library.
+ * @exception NullPointerException
+ * - name is null.
+ **/
public synchronized static native int H5Dwrite_float(long dataset_id, long mem_type_id, long mem_space_id,
long file_space_id, long xfer_plist_id, float[] buf, boolean isCriticalPinning)
throws HDF5LibraryException, NullPointerException;
+ /**
+ * H5Dwrite writes a (partial) dataset, specified by its identifier dataset_id, from the application memory buffer
+ * into the file.
+ *
+ * @param dataset_id
+ * Identifier of the dataset read from.
+ * @param mem_type_id
+ * Identifier of the memory datatype.
+ * @param mem_space_id
+ * Identifier of the memory dataspace.
+ * @param file_space_id
+ * Identifier of the dataset's dataspace in the file.
+ * @param xfer_plist_id
+ * Identifier of a transfer property list for this I/O operation.
+ * @param buf
+ * Buffer of float with data to be written to the file.
+ *
+ * @return a non-negative value if successful
+ *
+ * @exception HDF5LibraryException
+ * - Error from the HDF-5 Library.
+ * @exception NullPointerException
+ * - name is null.
+ **/
public synchronized static int H5Dwrite_float(long dataset_id, long mem_type_id, long mem_space_id,
long file_space_id, long xfer_plist_id, float[] buf) throws HDF5LibraryException, NullPointerException
{
return H5Dwrite_float(dataset_id, mem_type_id, mem_space_id, file_space_id, xfer_plist_id, buf, true);
}
+ /**
+ * H5Dwrite writes a (partial) dataset, specified by its identifier dataset_id, from the application memory buffer
+ * into the file.
+ *
+ * @param dataset_id
+ * Identifier of the dataset read from.
+ * @param mem_type_id
+ * Identifier of the memory datatype.
+ * @param mem_space_id
+ * Identifier of the memory dataspace.
+ * @param file_space_id
+ * Identifier of the dataset's dataspace in the file.
+ * @param xfer_plist_id
+ * Identifier of a transfer property list for this I/O operation.
+ * @param buf
+ * Buffer of int with data to be written to the file.
+ * @param isCriticalPinning
+ * request lock on data reference.
+ *
+ * @return a non-negative value if successful
+ *
+ * @exception HDF5LibraryException
+ * - Error from the HDF-5 Library.
+ * @exception NullPointerException
+ * - name is null.
+ **/
public synchronized static native int H5Dwrite_int(long dataset_id, long mem_type_id, long mem_space_id,
long file_space_id, long xfer_plist_id, int[] buf, boolean isCriticalPinning) throws HDF5LibraryException,
NullPointerException;
+ /**
+ * H5Dwrite writes a (partial) dataset, specified by its identifier dataset_id, from the application memory buffer
+ * into the file.
+ *
+ * @param dataset_id
+ * Identifier of the dataset read from.
+ * @param mem_type_id
+ * Identifier of the memory datatype.
+ * @param mem_space_id
+ * Identifier of the memory dataspace.
+ * @param file_space_id
+ * Identifier of the dataset's dataspace in the file.
+ * @param xfer_plist_id
+ * Identifier of a transfer property list for this I/O operation.
+ * @param buf
+ * Buffer of int with data to be written to the file.
+ *
+ * @return a non-negative value if successful
+ *
+ * @exception HDF5LibraryException
+ * - Error from the HDF-5 Library.
+ * @exception NullPointerException
+ * - name is null.
+ **/
public synchronized static int H5Dwrite_int(long dataset_id, long mem_type_id, long mem_space_id,
long file_space_id, long xfer_plist_id, int[] buf) throws HDF5LibraryException, NullPointerException
{
return H5Dwrite_int(dataset_id, mem_type_id, mem_space_id, file_space_id, xfer_plist_id, buf, true);
}
+ /**
+ * H5Dwrite writes a (partial) dataset, specified by its identifier dataset_id, from the application memory buffer
+ * into the file.
+ *
+ * @param dataset_id
+ * Identifier of the dataset read from.
+ * @param mem_type_id
+ * Identifier of the memory datatype.
+ * @param mem_space_id
+ * Identifier of the memory dataspace.
+ * @param file_space_id
+ * Identifier of the dataset's dataspace in the file.
+ * @param xfer_plist_id
+ * Identifier of a transfer property list for this I/O operation.
+ * @param buf
+ * Buffer of long with data to be written to the file.
+ * @param isCriticalPinning
+ * request lock on data reference.
+ *
+ * @return a non-negative value if successful
+ *
+ * @exception HDF5LibraryException
+ * - Error from the HDF-5 Library.
+ * @exception NullPointerException
+ * - name is null.
+ **/
public synchronized static native int H5Dwrite_long(long dataset_id, long mem_type_id, long mem_space_id,
long file_space_id, long xfer_plist_id, long[] buf, boolean isCriticalPinning) throws HDF5LibraryException,
NullPointerException;
+ /**
+ * H5Dwrite writes a (partial) dataset, specified by its identifier dataset_id, from the application memory buffer
+ * into the file.
+ *
+ * @param dataset_id
+ * Identifier of the dataset read from.
+ * @param mem_type_id
+ * Identifier of the memory datatype.
+ * @param mem_space_id
+ * Identifier of the memory dataspace.
+ * @param file_space_id
+ * Identifier of the dataset's dataspace in the file.
+ * @param xfer_plist_id
+ * Identifier of a transfer property list for this I/O operation.
+ * @param buf
+ * Buffer of long with data to be written to the file.
+ *
+ * @return a non-negative value if successful
+ *
+ * @exception HDF5LibraryException
+ * - Error from the HDF-5 Library.
+ * @exception NullPointerException
+ * - name is null.
+ **/
public synchronized static int H5Dwrite_long(long dataset_id, long mem_type_id, long mem_space_id,
long file_space_id, long xfer_plist_id, long[] buf) throws HDF5LibraryException, NullPointerException
{
return H5Dwrite_long(dataset_id, mem_type_id, mem_space_id, file_space_id, xfer_plist_id, buf, true);
}
+ /**
+ * H5Dwrite writes a (partial) dataset, specified by its identifier dataset_id, from the application memory buffer
+ * into the file.
+ *
+ * @param dataset_id
+ * Identifier of the dataset read from.
+ * @param mem_type_id
+ * Identifier of the memory datatype.
+ * @param mem_space_id
+ * Identifier of the memory dataspace.
+ * @param file_space_id
+ * Identifier of the dataset's dataspace in the file.
+ * @param xfer_plist_id
+ * Identifier of a transfer property list for this I/O operation.
+ * @param buf
+ * Buffer of short with data to be written to the file.
+ * @param isCriticalPinning
+ * request lock on data reference.
+ *
+ * @return a non-negative value if successful
+ *
+ * @exception HDF5LibraryException
+ * - Error from the HDF-5 Library.
+ * @exception NullPointerException
+ * - name is null.
+ **/
public synchronized static native int H5Dwrite_short(long dataset_id, long mem_type_id, long mem_space_id,
long file_space_id, long xfer_plist_id, short[] buf, boolean isCriticalPinning)
throws HDF5LibraryException, NullPointerException;
+ /**
+ * H5Dwrite writes a (partial) dataset, specified by its identifier dataset_id, from the application memory buffer
+ * into the file.
+ *
+ * @param dataset_id
+ * Identifier of the dataset read from.
+ * @param mem_type_id
+ * Identifier of the memory datatype.
+ * @param mem_space_id
+ * Identifier of the memory dataspace.
+ * @param file_space_id
+ * Identifier of the dataset's dataspace in the file.
+ * @param xfer_plist_id
+ * Identifier of a transfer property list for this I/O operation.
+ * @param buf
+ * Buffer of short with data to be written to the file.
+ *
+ * @return a non-negative value if successful
+ *
+ * @exception HDF5LibraryException
+ * - Error from the HDF-5 Library.
+ * @exception NullPointerException
+ * - name is null.
+ **/
public synchronized static int H5Dwrite_short(long dataset_id, long mem_type_id, long mem_space_id,
long file_space_id, long xfer_plist_id, short[] buf) throws HDF5LibraryException, NullPointerException
{
return H5Dwrite_short(dataset_id, mem_type_id, mem_space_id, file_space_id, xfer_plist_id, buf, true);
}
+ /**
+ * H5Dwrite writes a (partial) dataset, specified by its identifier dataset_id, from the application memory buffer
+ * into the file.
+ *
+ * @param dataset_id
+ * Identifier of the dataset read from.
+ * @param mem_type_id
+ * Identifier of the memory datatype.
+ * @param mem_space_id
+ * Identifier of the memory dataspace.
+ * @param file_space_id
+ * Identifier of the dataset's dataspace in the file.
+ * @param xfer_plist_id
+ * Identifier of a transfer property list for this I/O operation.
+ * @param buf
+ * Buffer of string with data to be written to the file.
+ *
+ * @return a non-negative value if successful
+ *
+ * @exception HDF5LibraryException
+ * - Error from the HDF-5 Library.
+ * @exception NullPointerException
+ * - name is null.
+ **/
public synchronized static native int H5Dwrite_string(long dataset_id, long mem_type_id, long mem_space_id,
long file_space_id, long xfer_plist_id, String[] buf) throws HDF5LibraryException, NullPointerException;
+ /**
+ * H5Dwrite writes a (partial) dataset, specified by its identifier dataset_id, from the application memory buffer
+ * into the file.
+ *
+ * @param dataset_id
+ * Identifier of the dataset read from.
+ * @param mem_type_id
+ * Identifier of the memory datatype.
+ * @param mem_space_id
+ * Identifier of the memory dataspace.
+ * @param file_space_id
+ * Identifier of the dataset's dataspace in the file.
+ * @param xfer_plist_id
+ * Identifier of a transfer property list for this I/O operation.
+ * @param buf
+ * Buffer of variable-length with data to be written to the file.
+ *
+ * @return a non-negative value if successful
+ *
+ * @exception HDF5LibraryException
+ * - Error from the HDF-5 Library.
+ * @exception NullPointerException
+ * - name is null.
+ **/
public synchronized static native int H5DwriteVL(long dataset_id, long mem_type_id, long mem_space_id,
long file_space_id, long xfer_plist_id, Object[] buf) throws HDF5LibraryException, NullPointerException;
@@ -2628,7 +4003,7 @@ public class H5 implements java.io.Serializable {
/**
- * H5Epush2 pushes a new error record onto the error stack specified by estack_id.
+ * H5Epush pushes a new error record onto the error stack specified by estack_id.
*
* @param stack_id
* IN: Error stack identifier.
@@ -2657,6 +4032,31 @@ public class H5 implements java.io.Serializable {
{
H5Epush2(stack_id, file, func, line, cls_id, maj_id, min_id, msg);
}
+ /**
+ * H5Epush2 pushes a new error record onto the error stack specified by estack_id.
+ *
+ * @param stack_id
+ * IN: Error stack identifier.
+ * @param file
+ * IN: Name of the file in which the error was detected.
+ * @param func
+ * IN: Name of the function in which the error was detected.
+ * @param line
+ * IN: Line number within the file at which the error was detected.
+ * @param cls_id
+ * IN: Error class identifier.
+ * @param maj_id
+ * IN: Major error identifier.
+ * @param min_id
+ * IN: Minor error identifier.
+ * @param msg
+ * IN: Error description string.
+ *
+ * @exception HDF5LibraryException
+ * - Error from the HDF-5 Library.
+ * @exception NullPointerException
+ * - file, func, or msg is null.
+ **/
public synchronized static native void H5Epush2(long stack_id, String file, String func, int line,
long cls_id, long maj_id, long min_id, String msg) throws HDF5LibraryException, NullPointerException;
@@ -2714,6 +4114,24 @@ public class H5 implements java.io.Serializable {
{
H5Ewalk2(stack_id, direction, func, client_data);
}
+ /**
+ * H5Ewalk2 walks the error stack specified by estack_id for the current thread and calls the
+ * function specified in func for each error along the way.
+ *
+ * @param stack_id
+ * IN: Error stack identifier.
+ * @param direction
+ * IN: Direction in which the error stack is to be walked.
+ * @param func
+ * IN: Function to be called for each error encountered.
+ * @param client_data
+ * IN: Data to be passed with func.
+ *
+ * @exception HDF5LibraryException
+ * - Error from the HDF-5 Library.
+ * @exception NullPointerException
+ * - func is null.
+ **/
public synchronized static native void H5Ewalk2(long stack_id, long direction, H5E_walk_cb func, H5E_walk_t client_data)
throws HDF5LibraryException, NullPointerException;
@@ -2950,6 +4368,19 @@ public class H5 implements java.io.Serializable {
private synchronized static native long _H5Fget_create_plist(long file_id) throws HDF5LibraryException;
+ /**
+ * H5Fget_filesize retrieves the file size of the HDF5 file. This function
+ * is called after an existing file is opened in order
+ * to learn the true size of the underlying file.
+ *
+ * @param file_id
+ * IN: File identifier for a currently-open HDF5 file
+ *
+ * @return the file size of the HDF5 file
+ *
+ * @exception HDF5LibraryException
+ * - Error from the HDF-5 Library.
+ **/
public synchronized static native long H5Fget_filesize(long file_id) throws HDF5LibraryException;
/**
@@ -3598,37 +5029,118 @@ public class H5 implements java.io.Serializable {
return H5Gget_obj_info_all(loc_id, name, objNames, objTypes, null, null, tokens, HDF5Constants.H5_INDEX_NAME);
}
- public synchronized static int H5Gget_obj_info_all(long loc_id, String name, String[] oname, int[] otype,
+ /**
+ * retrieves information of all objects under the group (name) located in the file or group specified by loc_id.
+ *
+ * @param loc_id
+ * IN: File or group identifier
+ * @param name
+ * IN: Name of group for which information is to be retrieved
+ * @param objNames
+ * OUT: Names of all objects under the group, name.
+ * @param objTypes
+ * OUT: Types of all objects under the group, name.
+ * @param ltype
+ * OUT: Link type
+ * @param tokens
+ * OUT: Object token of all objects under the group, name.
+ * @param indx_type
+ * IN: Index type for iterate
+ *
+ * @return the number of items found
+ *
+ * @exception HDF5LibraryException
+ * - Error from the HDF-5 Library.
+ * @exception NullPointerException
+ * - name is null.
+ */
+ public synchronized static int H5Gget_obj_info_all(long loc_id, String name, String[] objNames, int[] objTypes,
int[] ltype, H5O_token_t[] tokens, int indx_type) throws HDF5LibraryException, NullPointerException {
- return H5Gget_obj_info_full(loc_id, name, oname, otype, ltype, null, tokens, indx_type, -1);
+ return H5Gget_obj_info_full(loc_id, name, objNames, objTypes, ltype, null, tokens, indx_type, -1);
}
- public synchronized static int H5Gget_obj_info_all(long loc_id, String name, String[] oname, int[] otype,
+ /**
+ * retrieves information of all objects under the group (name) located in the file or group specified by loc_id.
+ *
+ * @param loc_id
+ * IN: File or group identifier
+ * @param name
+ * IN: Name of group for which information is to be retrieved
+ * @param objNames
+ * OUT: Names of all objects under the group, name.
+ * @param objTypes
+ * OUT: Types of all objects under the group, name.
+ * @param ltype
+ * OUT: Link type
+ * @param fno
+ * OUT: File number
+ * @param tokens
+ * OUT: Object token of all objects under the group, name.
+ * @param indx_type
+ * IN: Index type for iterate
+ *
+ * @return the number of items found
+ *
+ * @exception HDF5LibraryException
+ * - Error from the HDF-5 Library.
+ * @exception NullPointerException
+ * - name is null.
+ */
+ public synchronized static int H5Gget_obj_info_all(long loc_id, String name, String[] objNames, int[] objTypes,
int[] ltype, long[] fno, H5O_token_t[] tokens, int indx_type) throws HDF5LibraryException, NullPointerException {
- return H5Gget_obj_info_full(loc_id, name, oname, otype, ltype, fno, tokens, indx_type, -1);
+ return H5Gget_obj_info_full(loc_id, name, objNames, objTypes, ltype, fno, tokens, indx_type, -1);
}
- public synchronized static int H5Gget_obj_info_full(long loc_id, String name, String[] oname, int[] otype,
+ /**
+ * retrieves information of all objects under the group (name) located in the file or group specified by loc_id.
+ *
+ * @param loc_id
+ * IN: File or group identifier
+ * @param name
+ * IN: Name of group for which information is to be retrieved
+ * @param objNames
+ * OUT: Names of all objects under the group, name.
+ * @param objTypes
+ * OUT: Types of all objects under the group, name.
+ * @param ltype
+ * OUT: Link type
+ * @param fno
+ * OUT: File number
+ * @param tokens
+ * OUT: Object token of all objects under the group, name.
+ * @param indx_type
+ * IN: Index type for iterate
+ * @param indx_order
+ * IN: Index order for iterate
+ *
+ * @return the number of items found
+ *
+ * @exception HDF5LibraryException
+ * - Error from the HDF-5 Library.
+ * @exception NullPointerException
+ * - name is null.
+ */
+ public synchronized static int H5Gget_obj_info_full(long loc_id, String name, String[] objNames, int[] objTypes,
int[] ltype, long[] fno, H5O_token_t[] tokens, int indx_type, int indx_order) throws HDF5LibraryException,
NullPointerException {
- if (oname == null) {
+ if (objNames == null) {
throw new NullPointerException("H5Gget_obj_info_full(): name array is null");
}
- if (otype == null) {
+ if (objTypes == null) {
throw new NullPointerException("H5Gget_obj_info_full(): object type array is null");
}
- if (oname.length == 0) {
+ if (objNames.length == 0) {
throw new HDF5LibraryException("H5Gget_obj_info_full(): array size is zero");
}
- if (oname.length != otype.length) {
+ if (objNames.length != objTypes.length) {
throw new HDF5LibraryException("H5Gget_obj_info_full(): name and type array sizes are different");
}
if (ltype == null)
- ltype = new int[otype.length];
+ ltype = new int[objTypes.length];
if (fno == null)
fno = new long[tokens.length];
@@ -3639,15 +5151,15 @@ public class H5 implements java.io.Serializable {
if (indx_order < 0)
indx_order = HDF5Constants.H5_ITER_INC;
- log.trace("H5Gget_obj_info_full: oname_len={}", oname.length);
- int status = H5Gget_obj_info_full(loc_id, name, oname, otype, ltype, fno, tokens, oname.length, indx_type,
+ log.trace("H5Gget_obj_info_full: objNames_len={}", objNames.length);
+ int status = H5Gget_obj_info_full(loc_id, name, objNames, objTypes, ltype, fno, tokens, objNames.length, indx_type,
indx_order);
- for (int indx = 0; indx < oname.length; indx++)
- log.trace("H5Gget_obj_info_full: oname={}", oname[indx]);
+ for (int indx = 0; indx < objNames.length; indx++)
+ log.trace("H5Gget_obj_info_full: objNames={}", objNames[indx]);
return status;
}
- private synchronized static native int H5Gget_obj_info_full(long loc_id, String name, String[] oname, int[] otype,
+ private synchronized static native int H5Gget_obj_info_full(long loc_id, String name, String[] objNames, int[] objTypes,
int[] ltype, long[] fno, H5O_token_t[] tokens, int n, int indx_type, int indx_order) throws HDF5LibraryException,
NullPointerException;
@@ -3663,9 +5175,9 @@ public class H5 implements java.io.Serializable {
* @param idx
* IN: the index of the object to iterate.
* @param oname
- * the name of the object [OUT]
+ * OUT: the name of the object
* @param type
- * the type of the object [OUT]
+ * OUT: the type of the object
*
* @return non-negative if successful, -1 if not.
*
@@ -3866,13 +5378,40 @@ public class H5 implements java.io.Serializable {
// //
// ////////////////////////////////////////////////////////////
+ /**
+ * H5Iget_file_id obtains the file ID specified by the identifier, obj_id.
+ *
+ * @param obj_id
+ * IN: Identifier of the object.
+ *
+ * @return the file ID.
+ *
+ * @exception HDF5LibraryException
+ * - Error from the HDF-5 Library.
+ **/
public synchronized static native long H5Iget_file_id(long obj_id) throws HDF5LibraryException;
+ /**
+ * H5Iget_name_long retrieves the name of an object specified by the identifier, obj_id.
+ * @deprecated
+ *
+ * @param obj_id
+ * IN: Identifier of the object.
+ * @param name
+ * OUT: Attribute name buffer.
+ * @param size
+ * IN: Maximum length of the name to retrieve.
+ *
+ * @return the length of the name retrieved.
+ *
+ * @exception HDF5LibraryException
+ * - Error from the HDF-5 Library.
+ **/
@Deprecated
public synchronized static native long H5Iget_name_long(long obj_id, String[] name, long size)
throws HDF5LibraryException, NullPointerException;
/**
- * H5Iget_name_str retrieves the name of an object specified by the identifier, obj_id.
+ * H5Iget_name retrieves the name of an object specified by the identifier, obj_id.
*
* @param obj_id
* IN: Identifier of the object.
@@ -3885,10 +5424,44 @@ public class H5 implements java.io.Serializable {
public synchronized static native String H5Iget_name(long obj_id)
throws HDF5LibraryException;
+ /**
+ * H5Iget_ref obtains the number of references outstanding specified by the identifier, obj_id.
+ *
+ * @param obj_id
+ * IN: Identifier of the object.
+ *
+ * @return the reference count.
+ *
+ * @exception HDF5LibraryException
+ * - Error from the HDF-5 Library.
+ **/
public synchronized static native int H5Iget_ref(long obj_id) throws HDF5LibraryException, NullPointerException;
+ /**
+ * H5Idec_ref decrements the reference count specified by the identifier, obj_id.
+ * If the reference count for an ID reaches zero, the object will be closed.
+ *
+ * @param obj_id
+ * IN: Identifier of the object.
+ *
+ * @return the reference count.
+ *
+ * @exception HDF5LibraryException
+ * - Error from the HDF-5 Library.
+ **/
public synchronized static native int H5Idec_ref(long obj_id) throws HDF5LibraryException, NullPointerException;
+ /**
+ * H5Iinc_ref increments the reference count specified by the identifier, obj_id.
+ *
+ * @param obj_id
+ * IN: Identifier of the object.
+ *
+ * @return the reference count.
+ *
+ * @exception HDF5LibraryException
+ * - Error from the HDF-5 Library.
+ **/
public synchronized static native int H5Iinc_ref(long obj_id) throws HDF5LibraryException, NullPointerException;
/**
@@ -5179,7 +6752,7 @@ public class H5 implements java.io.Serializable {
return id;
}
- public synchronized static native long _H5Oopen_by_idx(long loc_id, String group_name,
+ private synchronized static native long _H5Oopen_by_idx(long loc_id, String group_name,
int idx_type, int order, long n, long lapl_id) throws HDF5LibraryException, NullPointerException;
/**
@@ -5210,8 +6783,30 @@ public class H5 implements java.io.Serializable {
**/
public synchronized static native void H5Orefresh(long object_id) throws HDF5LibraryException;
+ /**
+ * H5Odisable_mdc_flushes corks an object, keeping dirty entries associated with the object in the metadata cache.
+ *
+ * @param object_id
+ * IN: Identifier of the object to be corked.
+ **/
public synchronized static native void H5Odisable_mdc_flushes(long object_id);
+ /**
+ * H5Oenable_mdc_flushes uncorks an object, keeping dirty entries associated with the object in the metadata cache.
+ *
+ * @param object_id
+ * IN: Identifier of the object to be uncorked.
+ **/
public synchronized static native void H5Oenable_mdc_flushes(long object_id);
+ /**
+ * H5Oare_mdc_flushes_disabled retrieve the object's "cork" status.
+ *
+ * @param object_id
+ * IN: Identifier of the object to be flushed.
+ *
+ * @return the cork status
+ * TRUE if mdc flushes for the object is disabled
+ * FALSE if mdc flushes for the object is not disabled
+ **/
public synchronized static native boolean H5Oare_mdc_flushes_disabled(long object_id);
// /////// unimplemented ////////
@@ -5364,6 +6959,7 @@ public class H5 implements java.io.Serializable {
* IN: First property object to be compared
* @param plid2
* IN: Second property object to be compared
+ *
* @return positive value if equal; zero if unequal, a negative value if failed
*
* @exception HDF5LibraryException
@@ -5371,6 +6967,19 @@ public class H5 implements java.io.Serializable {
*/
public synchronized static native int H5Pequal(long plid1, long plid2) throws HDF5LibraryException;
+ /**
+ * H5Pequal determines if two property lists or classes are equal
+ *
+ * @param plid1
+ * IN: First property object to be compared
+ * @param plid2
+ * IN: Second property object to be compared
+ *
+ * @return TRUE if equal, FALSE if unequal
+ *
+ * @exception HDF5LibraryException
+ * - Error from the HDF-5 Library.
+ */
public static boolean H5P_equal(long plid1, long plid2) throws HDF5LibraryException {
if (H5Pequal(plid1, plid2) == 1)
return true;
@@ -5456,7 +7065,7 @@ public class H5 implements java.io.Serializable {
return _H5Pclose_class(plid);
}
- public synchronized static native int _H5Pclose_class(long plid) throws HDF5LibraryException;
+ private synchronized static native int _H5Pclose_class(long plid) throws HDF5LibraryException;
/**
* H5Pclose terminates access to a property list.
@@ -5524,6 +7133,19 @@ public class H5 implements java.io.Serializable {
// Define property list iteration function type
// typedef herr_t (*H5P_iterate_t)(hid_t id, const char *name, void *iter_data);
+ /**
+ * H5Pcreate_class_nocb creates an new property class with no callback functions.
+ *
+ * @param parent_class
+ * IN: Identifier of the parent property class.
+ * @param name
+ * IN: Name of the property class.
+ *
+ * @return a property list identifier if successful
+ *
+ * @exception HDF5LibraryException
+ * - Error from the HDF-5 Library.
+ **/
public static long H5Pcreate_class_nocb(long parent_class, String name) throws HDF5LibraryException {
long id = _H5Pcreate_class_nocb(parent_class, name);
if (id > 0) {
@@ -5550,17 +7172,69 @@ public class H5 implements java.io.Serializable {
// private synchronized static native long _H5Pcreate_class(long parent_class, String name, H5P_cls_create_func_cb create_op, H5P_cls_create_func_t create_data,
// H5P_cls_copy_func_cb copy_op, H5P_cls_copy_func_t copy_data, H5P_cls_close_func_cb close_op, H5P_cls_close_func_t close_data) throws HDF5LibraryException;
+ /**
+ * H5Pregister2_nocb registers a property list with no callback functions.
+ *
+ * @param plist_class
+ * IN: Identifier of the property list.
+ * @param name
+ * IN: Name of the property.
+ * @param size
+ * IN: Size the property value.
+ * @param def_value
+ * IN: Defaul value of the property
+ *
+ * @exception HDF5LibraryException
+ * - Error from the HDF-5 Library.
+ **/
public synchronized static native void H5Pregister2_nocb(long plist_class, String name, long size, byte[] def_value) throws HDF5LibraryException;
// public synchronized static native void H5Pregister2(long plist_class, String name, long size, byte[] def_value, H5P_prp_create_func_cb prp_create, H5P_prp_set_func_cb prp_set,
// H5P_prp_get_func_cb prp_get, H5P_prp_delete_func_cb prp_delete, H5P_prp_copy_func_cb prp_copy, H5P_prp_compare_func_cb prp_cmp, H5P_prp_close_func_cb prp_close) throws HDF5LibraryException;
+ /**
+ * H5Pinsert2_nocb inserts a property list with no callback functions.
+ *
+ * @param plist
+ * IN: Identifier of the property list.
+ * @param name
+ * IN: Name of the property.
+ * @param size
+ * IN: Size the property value.
+ * @param value
+ * IN: Defaul value of the property
+ *
+ * @exception HDF5LibraryException
+ * - Error from the HDF-5 Library.
+ **/
public synchronized static native void H5Pinsert2_nocb(long plist, String name, long size, byte[] value) throws HDF5LibraryException;
// public synchronized static native void H5Pinsert2(long plist, String name, long size, byte[] value, H5P_prp_set_func_cb prp_set, H5P_prp_get_func_cb prp_get,
// H5P_prp_delete_func_cb prp_delete, H5P_prp_copy_func_cb prp_copy, H5P_prp_compare_func_cb prp_cmp, H5P_prp_close_func_cb prp_close) throws HDF5LibraryException;
+ /**
+ * H5Piterate iterates over the properties in a property list or class
+ *
+ * @param plist
+ * IN: ID of property object to iterate over
+ * @param idx
+ * IN/OUT: index of the property to begin with
+ * @param op
+ * IN: function to be called with each property iterated over.
+ * @param op_data
+ * IN: iteration data from user
+ *
+ * @return
+ * the return value of the last call to op if it was non-zero,
+ * zero if all properties have been processed
+ *
+ * @exception HDF5LibraryException
+ * - Error from the HDF-5 Library.
+ * @exception NullPointerException
+ * - size is null.
+ *
+ **/
public synchronized static native int H5Piterate(long plist, int[] idx, H5P_iterate_cb op, H5P_iterate_t op_data) throws HDF5LibraryException;
// /////// Object creation property list (OCPL) routines ///////
@@ -5573,7 +7247,7 @@ public class H5 implements java.io.Serializable {
* @param attributes
* The maximun and minimum no. of attributes to be stored.
*
- * <pre>
+ * <pre>
* attributes[0] = The maximum number of attributes to be stored in compact storage
* attributes[1] = The minimum number of attributes to be stored in dense storage
* </pre>
@@ -5673,6 +7347,51 @@ public class H5 implements java.io.Serializable {
public synchronized static native void H5Pset_obj_track_times(long ocpl_id, boolean track_times)
throws HDF5LibraryException;
+ /**
+ * H5Pmodify_filter modifies the specified FILTER in the transient or permanent output filter pipeline
+ * depending on whether PLIST is a dataset creation or dataset
+ * transfer property list. The FLAGS argument specifies certain
+ * general properties of the filter and is documented below.
+ * The CD_VALUES is an array of CD_NELMTS integers which are
+ * auxiliary data for the filter. The integer vlues will be
+ * stored in the dataset object header as part of the filter
+ * information.
+ *<p>
+ * The FLAGS argument is a bit vector of the following fields:
+ *<p>
+ * H5Z_FLAG_OPTIONAL(0x0001)
+ * If this bit is set then the filter is optional. If the
+ * filter fails during an H5Dwrite() operation then the filter
+ * is just excluded from the pipeline for the chunk for which it
+ * failed; the filter will not participate in the pipeline
+ * during an H5Dread() of the chunk. If this bit is clear and
+ * the filter fails then the entire I/O operation fails.
+ * If this bit is set but encoding is disabled for a filter,
+ * attempting to write will generate an error.
+ *<p>
+ * Note: This function currently supports only the permanent filter
+ * pipeline. That is, PLIST_ID must be a dataset creation
+ * property list.
+ *
+ * @param plist
+ * IN: Property list identifier.
+ * @param filter
+ * IN: Filter to be modified to the pipeline.
+ * @param flags
+ * IN: Bit vector specifying certain general properties of the filter.
+ * @param cd_nelmts
+ * IN: Number of elements in cd_values
+ * @param cd_values
+ * IN: Auxiliary data for the filter.
+ *
+ * @return a non-negative value if successful
+ *
+ * @exception HDF5LibraryException
+ * - Error from the HDF-5 Library.
+ * @exception NullPointerException
+ * - name or an array is null.
+ *
+ **/
public synchronized static native int H5Pmodify_filter(long plist, long filter, int flags, long cd_nelmts,
int[] cd_values) throws HDF5LibraryException, NullPointerException;
@@ -5844,9 +7563,37 @@ public class H5 implements java.io.Serializable {
throws HDF5LibraryException, NullPointerException;
+ /**
+ * H5Pall_filters_avail query to verify that all the filters set
+ * in the dataset creation property list are available currently.
+ *
+ * @param dcpl_id
+ * IN: Property list identifier.
+ *
+ * @return
+ * TRUE if all filters available
+ * FALSE if one or more filters not currently available.
+ *
+ * @exception HDF5LibraryException
+ * - Error from the HDF-5 Library.
+ **/
public synchronized static native boolean H5Pall_filters_avail(long dcpl_id) throws HDF5LibraryException,
NullPointerException;
+ /**
+ * H5Premove_filter deletes a filter from the dataset creation property list;
+ * deletes all filters if filter is H5Z_FILTER_NONE
+ *
+ * @param obj_id
+ * IN: Property list identifier.
+ * @param filter
+ * IN: Filter identifier.
+ *
+ * @return a non-negative value and the size of the user block; if successful
+ *
+ * @exception HDF5LibraryException
+ * - Error from the HDF-5 Library.
+ **/
public synchronized static native int H5Premove_filter(long obj_id, long filter) throws HDF5LibraryException;
/**
@@ -5864,6 +7611,18 @@ public class H5 implements java.io.Serializable {
**/
public synchronized static native int H5Pset_deflate(long plist, int level) throws HDF5LibraryException;
+ /**
+ * H5Pset_fletcher32 sets Fletcher32 checksum of EDC for a dataset creation
+ * property list or group creation property list.
+ *
+ * @param plist
+ * IN: Property list identifier.
+ *
+ * @return a non-negative value and the size of the user block; if successful
+ *
+ * @exception HDF5LibraryException
+ * - Error from the HDF-5 Library.
+ **/
public synchronized static native int H5Pset_fletcher32(long plist) throws HDF5LibraryException,
NullPointerException;
@@ -6334,11 +8093,35 @@ public class H5 implements java.io.Serializable {
*/
public synchronized static native long H5Pget_driver(long plid) throws HDF5LibraryException;
- public synchronized static native long H5Pget_family_offset(long fapl_id) throws HDF5LibraryException,
- NullPointerException;
+ /**
+ * H5Pget_family_offset gets offset for family driver.
+ *
+ * @param fapl_id
+ * IN: File access property list identifier
+ *
+ * @return the offset.
+ *
+ * @exception HDF5LibraryException
+ * - Error from the HDF-5 Library.
+ *
+ **/
+ public synchronized static native long H5Pget_family_offset(long fapl_id) throws HDF5LibraryException;
- public synchronized static native int H5Pset_family_offset(long fapl_id, long offset) throws HDF5LibraryException,
- NullPointerException;
+ /**
+ * H5Pset_family_offset sets the offset for family driver.
+ *
+ * @param fapl_id
+ * IN: File access property list identifier
+ * @param offset
+ * IN: the offset value
+ *
+ * @return a non-negative value if successful
+ *
+ * @exception HDF5LibraryException
+ * - Error from the HDF-5 Library.
+ *
+ **/
+ public synchronized static native int H5Pset_family_offset(long fapl_id, long offset) throws HDF5LibraryException;
/**
* Retrieves the maximum possible number of elements in the meta data cache and the maximum possible number of bytes
@@ -6389,9 +8172,8 @@ public class H5 implements java.io.Serializable {
double rdcc_w0) throws HDF5LibraryException;
/**
- * H5Pget_mdc_config gets the initial metadata cache configuration contained in a file access property list and
- * loads it into the instance of H5AC_cache_config_t pointed to by the config_ptr parameter. This configuration is
- * used when the file is opened.
+ * H5Pget_mdc_config gets the initial metadata cache configuration contained in a file access property list.
+ * This configuration is used when the file is opened.
*
* @param plist_id
* IN: Identifier of the file access property list.
@@ -6403,6 +8185,19 @@ public class H5 implements java.io.Serializable {
**/
public synchronized static native H5AC_cache_config_t H5Pget_mdc_config(long plist_id) throws HDF5LibraryException;
+ /**
+ * H5Pset_mdc_config sets the initial metadata cache configuration contained in a file access property list and
+ * loads it into the instance of H5AC_cache_config_t pointed to by the config_ptr parameter. This configuration is
+ * used when the file is opened.
+ *
+ * @param plist_id
+ * IN: Identifier of the file access property list.
+ * @param config_ptr
+ * IN: H5AC_cache_config_t, the initial metadata cache configuration.
+ *
+ * @exception HDF5LibraryException
+ * - Error from the HDF-5 Library.
+ **/
public synchronized static native void H5Pset_mdc_config(long plist_id, H5AC_cache_config_t config_ptr)
throws HDF5LibraryException;
@@ -6437,10 +8232,35 @@ public class H5 implements java.io.Serializable {
public synchronized static native int H5Pset_gc_references(long fapl_id, boolean gc_ref)
throws HDF5LibraryException;
- public synchronized static native int H5Pget_fclose_degree(long plist_id) throws HDF5LibraryException,
+ /**
+ * H5Pget_fclose_degree returns the degree for the file close behavior for a file access
+ * property list.
+ *
+ * @param fapl_id
+ * IN File access property list
+ *
+ * @return the degree for the file close behavior
+ *
+ * @exception HDF5LibraryException
+ * - Error from the HDF-5 Library.
+ **/
+ public synchronized static native int H5Pget_fclose_degree(long fapl_id) throws HDF5LibraryException,
NullPointerException;
- public synchronized static native int H5Pset_fclose_degree(long plist, int degree) throws HDF5LibraryException,
+ /**
+ * H5Pset_fclose_degree sets the degree for the file close behavior.
+ *
+ * @param fapl_id
+ * IN File access property list
+ * @param degree
+ * IN the degree for the file close behavior
+ *
+ * @return non-negative if successful
+ *
+ * @exception HDF5LibraryException
+ * - Error from the HDF-5 Library.
+ **/
+ public synchronized static native int H5Pset_fclose_degree(long fapl_id, int degree) throws HDF5LibraryException,
NullPointerException;
/**
@@ -6471,8 +8291,40 @@ public class H5 implements java.io.Serializable {
**/
public synchronized static native void H5Pset_meta_block_size(long fapl_id, long size) throws HDF5LibraryException;
+ /**
+ * H5Pget_sieve_buf_size retrieves the current settings for the data sieve buffer size
+ * property from a file access property list.
+ *
+ * @param fapl_id
+ * IN: Identifier for property list to query.
+ *
+ * @return a non-negative value and the size of the user block; if successful
+ *
+ * @exception HDF5LibraryException
+ * - Error from the HDF-5 Library.
+ **/
public synchronized static native long H5Pget_sieve_buf_size(long fapl_id) throws HDF5LibraryException;
+ /**
+ * H5Pset_sieve_buf_size Sets the maximum size of the data seive buffer used for file
+ * drivers which are capable of using data sieving. The data sieve
+ * buffer is used when performing I/O on datasets in the file. Using a
+ * buffer which is large anough to hold several pieces of the dataset
+ * being read in for hyperslab selections boosts performance by quite a
+ * bit.
+ * <p>
+ * The default value is set to 64KB, indicating that file I/O for raw data
+ * reads and writes will occur in at least 64KB blocks. Setting the value to 0
+ * with this function will turn off the data sieving
+ *
+ * @param fapl_id
+ * IN: Identifier of property list to modify.
+ * @param size
+ * IN: maximum size of the data seive buffer.
+ *
+ * @exception HDF5LibraryException
+ * - Error from the HDF-5 Library.
+ **/
public synchronized static native void H5Pset_sieve_buf_size(long fapl_id, long size) throws HDF5LibraryException;
/**
@@ -6687,6 +8539,55 @@ public class H5 implements java.io.Serializable {
public synchronized static native void H5Pset_evict_on_close(long fapl_id, boolean evict_on_close)
throws HDF5LibraryException;
+ /**
+ * H5Pget_use_file_locking retrieves whether we are using file locking.
+ *
+ * @param fapl_id
+ * IN: File access property list identifier
+ *
+ * @return indication if file locking is used.
+ *
+ * @exception HDF5LibraryException
+ * - Error from the HDF-5 Library.
+ *
+ **/
+ public synchronized static native boolean H5Pget_use_file_locking(long fapl_id)
+ throws HDF5LibraryException;
+
+ /**
+ * H5Pget_use_file_locking retrieves whether we ignore file locks when they are disabled.
+ *
+ * @param fapl_id
+ * IN: File access property list identifier
+ *
+ * @return indication if file locking is ignored.
+ *
+ * @exception HDF5LibraryException
+ * - Error from the HDF-5 Library.
+ *
+ **/
+ public synchronized static native boolean H5Pget_ignore_disabled_file_locking(long fapl_id)
+ throws HDF5LibraryException;
+
+ /**
+ * H5Pset_file_locking sets parameters related to file locking.
+ *
+ * @param fapl_id
+ * IN: File access property list identifier
+ *
+ * @param use_file_locking
+ * IN: Whether the library will use file locking when opening files (mainly for SWMR semantics).
+ *
+ * @param ignore_when_disabled
+ * IN: Whether file locking will be ignored when disabled on a file system (useful for Lustre).
+ *
+ * @exception HDF5LibraryException
+ * - Error from the HDF-5 Library.
+ *
+ **/
+ public synchronized static native void H5Pset_file_locking(long fapl_id, boolean use_file_locking, boolean ignore_when_disabled)
+ throws HDF5LibraryException;
+
// ///// unimplemented /////
// herr_t H5Pset_vol(hid_t plist_id, hid_t new_vol_id, const void *new_vol_info);
// herr_t H5Pget_vol_id(hid_t plist_id, hid_t *vol_id);
@@ -6767,6 +8668,25 @@ public class H5 implements java.io.Serializable {
public synchronized static native int H5Pset_chunk(long plist, int ndims, byte[] dim) throws HDF5LibraryException,
NullPointerException, IllegalArgumentException;
+ /**
+ * H5Pset_chunk sets the size of the chunks used to store a chunked layout dataset.
+ *
+ * @param plist
+ * IN: Identifier for property list to query.
+ * @param ndims
+ * IN: The number of dimensions of each chunk.
+ * @param dim
+ * IN: An array containing the size of each chunk.
+ *
+ * @return a non-negative value if successful
+ *
+ * @exception HDF5Exception
+ * - Error from the HDF-5 Library.
+ * @exception NullPointerException
+ * - dims array is null.
+ * @exception IllegalArgumentException
+ * - dims &lt;=0
+ **/
public synchronized static int H5Pset_chunk(long plist, int ndims, long[] dim) throws HDF5Exception,
NullPointerException, IllegalArgumentException {
if (dim == null) {
@@ -7002,9 +8922,37 @@ public class H5 implements java.io.Serializable {
**/
public synchronized static native int H5Pget_external_count(long plist) throws HDF5LibraryException;
+ /**
+ * H5Pset_szip Sets up the use of the szip filter.
+ *
+ * @param plist
+ * IN: Dataset creation property list identifier.
+ * @param options_mask
+ * IN: Bit vector specifying certain general properties of the filter.
+ * @param pixels_per_block
+ * IN: Number of pixels in blocks
+ *
+ * @return a non-negative value if successful; otherwise returns a negative value.
+ *
+ * @exception HDF5LibraryException
+ * - Error from the HDF-5 Library.
+ *
+ **/
public synchronized static native int H5Pset_szip(long plist, int options_mask, int pixels_per_block)
throws HDF5LibraryException, NullPointerException;
+ /**
+ * H5Pset_shuffle Sets up the use of the shuffle filter.
+ *
+ * @param plist_id
+ * IN: Dataset creation property list identifier.
+ *
+ * @return a non-negative value if successful; otherwise returns a negative value.
+ *
+ * @exception HDF5LibraryException
+ * - Error from the HDF-5 Library.
+ *
+ **/
public synchronized static native int H5Pset_shuffle(long plist_id) throws HDF5LibraryException,
NullPointerException;
@@ -7132,20 +9080,91 @@ public class H5 implements java.io.Serializable {
return retVal;
}
+ /**
+ * H5Pset_fill_value checks if the fill value is defined for a dataset creation property list.
+ *
+ * @param plist_id
+ * IN: Property list identifier.
+ * @param status
+ * IN: The fill value setting:
+ * H5D_FILL_VALUE_UNDEFINED
+ * H5D_FILL_VALUE_DEFAULT
+ * H5D_FILL_VALUE_USER_DEFINED
+ * H5D_FILL_VALUE_ERROR
+ *
+ * @return a non-negative value if successful
+ *
+ * @exception HDF5Exception
+ * - Error converting data array
+ **/
public synchronized static native int H5Pfill_value_defined(long plist_id, int[] status)
throws HDF5LibraryException, NullPointerException;
+ /**
+ * H5Pset_alloc_time Gets space allocation time for dataset during creation.
+ *
+ * @param plist_id
+ * IN: Dataset creation property list identifier.
+ * @param alloc_time
+ * OUT: allocation time.
+ *
+ * @return a non-negative value if successful; otherwise returns a negative value.
+ *
+ * @exception HDF5LibraryException
+ * - Error from the HDF-5 Library.
+ *
+ **/
public synchronized static native int H5Pget_alloc_time(long plist_id, int[] alloc_time)
throws HDF5LibraryException, NullPointerException;
+ /**
+ * H5Pset_alloc_time Sets space allocation time for dataset during creation.
+ *
+ * @param plist_id
+ * IN: Dataset creation property list identifier.
+ * @param alloc_time
+ * IN: allocation time.
+ *
+ * @return a non-negative value if successful; otherwise returns a negative value.
+ *
+ * @exception HDF5LibraryException
+ * - Error from the HDF-5 Library.
+ *
+ **/
public synchronized static native int H5Pset_alloc_time(long plist_id, int alloc_time) throws HDF5LibraryException,
NullPointerException;
- public synchronized static native int H5Pget_fill_time(long plist_id, int[] fill_time) throws HDF5LibraryException,
- NullPointerException;
+ /**
+ * H5Pset_fill_time Gets fill value writing time.
+ *
+ * @param plist_id
+ * IN: Dataset creation property list identifier.
+ * @param fill_time
+ * OUT: fill time.
+ *
+ * @return a non-negative value if successful; otherwise returns a negative value.
+ *
+ * @exception HDF5LibraryException
+ * - Error from the HDF-5 Library.
+ *
+ **/
+ public synchronized static native int H5Pget_fill_time(long plist_id, int[] fill_time) throws HDF5LibraryException;
- public synchronized static native int H5Pset_fill_time(long plist_id, int fill_time) throws HDF5LibraryException,
- NullPointerException;
+ /**
+ * H5Pset_fill_time Sets the fill value writing time.
+ *
+ * @param plist_id
+ * IN: Dataset creation property list identifier.
+ * @param fill_time
+ * IN: fill time.
+ *
+ * @return a non-negative value if successful; otherwise returns a negative value.
+ *
+ * @exception HDF5LibraryException
+ * - Error from the HDF-5 Library.
+ *
+ **/
+ public synchronized static native int H5Pset_fill_time(long plist_id, int fill_time) throws HDF5LibraryException;
/**
* H5Pset_chunk_opts Sets the edge chunk option in a dataset creation property list.
@@ -7445,6 +9464,20 @@ public class H5 implements java.io.Serializable {
public synchronized static native int H5Pget_buffer(long plist, byte[] tconv, byte[] bkg)
throws HDF5LibraryException, IllegalArgumentException;
+ /**
+ * H5Pget_buffer_size gets type conversion and background buffer size, in bytes, if successful;
+ * otherwise 0 on failure.
+ *
+ * @param plist
+ * Identifier for the dataset transfer property list.
+ *
+ * @return buffer size, in bytes, if successful; otherwise 0 on failure
+ *
+ * @exception HDF5LibraryException
+ * - Error from the HDF-5 Library.
+ * @exception IllegalArgumentException
+ * - plist is invalid.
+ **/
public synchronized static native long H5Pget_buffer_size(long plist)
throws HDF5LibraryException, IllegalArgumentException;
@@ -7475,11 +9508,33 @@ public class H5 implements java.io.Serializable {
public synchronized static native void H5Pset_buffer_size(long plist, long size) throws HDF5LibraryException,
IllegalArgumentException;
- public synchronized static native int H5Pget_edc_check(long plist) throws HDF5LibraryException,
- NullPointerException;
+ /**
+ * H5Pget_edc_check gets the error-detecting algorithm in use.
+ *
+ * @param plist
+ * Identifier for the dataset transfer property list.
+ *
+ * @return the error-detecting algorithm
+ *
+ * @exception HDF5LibraryException
+ * - Error from the HDF-5 Library.
+ **/
+ public synchronized static native int H5Pget_edc_check(long plist) throws HDF5LibraryException;
- public synchronized static native int H5Pset_edc_check(long plist, int check) throws HDF5LibraryException,
- NullPointerException;
+ /**
+ * H5Pset_edc_check sets the error-detecting algorithm.
+ *
+ * @param plist
+ * Identifier for the dataset transfer property list.
+ * @param check
+ * the error-detecting algorithm to use.
+ *
+ * @return non-negative if succeed
+ *
+ * @exception HDF5LibraryException
+ * - Error from the HDF-5 Library.
+ **/
+ public synchronized static native int H5Pset_edc_check(long plist, int check) throws HDF5LibraryException;
/**
* H5Pget_btree_ratio Get the B-tree split ratios for a dataset transfer property list.
@@ -7524,9 +9579,46 @@ public class H5 implements java.io.Serializable {
public synchronized static native int H5Pset_btree_ratios(long plist_id, double left, double middle, double right)
throws HDF5LibraryException;
+ /**
+ * H5Pget_hyper_vector_size reads values previously set with H5Pset_hyper_vector_size.
+ *
+ * @param dxpl_id
+ * IN: Dataset transfer property list identifier.
+ * @param vector_size
+ * OUT: hyper vector size.
+ *
+ * @return a non-negative value if successful; otherwise returns a negative value.
+ *
+ * @exception HDF5LibraryException
+ * - Error from the HDF-5 Library.
+ *
+ **/
public synchronized static native int H5Pget_hyper_vector_size(long dxpl_id, long[] vector_size)
throws HDF5LibraryException, NullPointerException;
+ /**
+ * H5Pset_hyper_vector_size sets the number of
+ * "I/O vectors" (offset and length pairs) which are to be
+ * accumulated in memory before being issued to the lower levels
+ * of the library for reading or writing the actual data.
+ * Increasing the number should give better performance, but use
+ * more memory during hyperslab I/O. The vector size must be
+ * greater than 1.
+ *,p.
+ * The default is to use 1024 vectors for I/O during hyperslab
+ * reading/writing.
+ *
+ * @param dxpl_id
+ * IN: Dataset transfer property list identifier.
+ * @param vector_size
+ * IN: hyper vestor size.
+ *
+ * @return a non-negative value if successful; otherwise returns a negative value.
+ *
+ * @exception HDF5LibraryException
+ * - Error from the HDF-5 Library.
+ *
+ **/
public synchronized static native int H5Pset_hyper_vector_size(long dxpl_id, long vector_size)
throws HDF5LibraryException, NullPointerException;
@@ -7724,8 +9816,32 @@ public class H5 implements java.io.Serializable {
// /////// String creation property list (STRCPL) routines ///////
+ /**
+ * H5Pget_char_encoding gets the character encoding of the string.
+ *
+ * @param plist_id
+ * IN: the property list identifier
+ *
+ * @return Returns the character encoding of the string.
+ *
+ * @exception HDF5LibraryException
+ * - Error from the HDF-5 Library.
+ *
+ **/
public synchronized static native int H5Pget_char_encoding(long plist_id) throws HDF5LibraryException;
+ /**
+ * H5Pset_char_encoding sets the character encoding of the string.
+ *
+ * @param plist_id
+ * IN: the property list identifier
+ * @param encoding
+ * IN: the character encoding of the string
+ *
+ * @exception HDF5LibraryException
+ * - Error from the HDF-5 Library.
+ *
+ **/
public synchronized static native void H5Pset_char_encoding(long plist_id, int encoding)
throws HDF5LibraryException;
@@ -7915,20 +10031,51 @@ public class H5 implements java.io.Serializable {
// /////// file drivers property list routines ///////
+ /**
+ * H5Pget_fapl_core retrieve H5FD_CORE I/O settings.
+ *
+ * @param fapl_id
+ * IN: File access property list identifier
+ * @param increment
+ * OUT: how much to grow the memory each time
+ * @param backing_store
+ * OUT: write to file name on flush setting
+ *
+ * @exception HDF5LibraryException
+ * - Error from the HDF-5 Library.
+ *
+ **/
public synchronized static native void H5Pget_fapl_core(long fapl_id, long[] increment, boolean[] backing_store)
throws HDF5LibraryException, NullPointerException;
+ /**
+ * H5Pset_fapl_core modifies the file access property list to use the H5FD_CORE driver.
+ *
+ * @param fapl_id
+ * IN: File access property list identifier
+ * @param increment
+ * IN: how much to grow the memory each time
+ * @param backing_store
+ * IN: write to file name on flush setting
+ *
+ * @return a non-negative value if successful; otherwise returns a negative value.
+ *
+ * @exception HDF5LibraryException
+ * - Error from the HDF-5 Library.
+ *
+ **/
public synchronized static native int H5Pset_fapl_core(long fapl_id, long increment, boolean backing_store)
throws HDF5LibraryException, NullPointerException;
/**
- * H5Pget_fapl_direct Retrieve direct I/O settings.
+ * H5Pget_fapl_direct queries properties set by the H5Pset_fapl_direct.
*
* @param fapl_id
* IN: File access property list identifier
* @param info
- * OUT: Returned property list information info[0] = alignment Required memory alignment boundary info[1]
- * = block_size File system block size info[2] = cbuf_size Copy buffer size
+ * OUT: Returned property list information
+ * info[0] = increment -how much to grow the memory each time
+ * info[1] = backing_store - write to file name on flush setting
*
* @return a non-negative value if successful; otherwise returns a negative value.
*
@@ -7959,14 +10106,72 @@ public class H5 implements java.io.Serializable {
public synchronized static native int H5Pset_fapl_direct(long fapl_id, long alignment, long block_size,
long cbuf_size) throws HDF5LibraryException;
+ /**
+ * H5Pget_fapl_family Returns information about the family file access property list.
+ *
+ * @param fapl_id
+ * IN: File access property list identifier
+ * @param memb_size
+ * OUT: the size in bytes of each file member (used only when creating a new file)
+ * @param memb_fapl_id
+ * OUT: the file access property list to be used for each family member
+ *
+ * @return a non-negative value if successful; otherwise returns a negative value.
+ *
+ * @exception HDF5LibraryException
+ * - Error from the HDF-5 Library.
+ *
+ **/
public synchronized static native int H5Pget_fapl_family(long fapl_id, long[] memb_size, long[] memb_fapl_id)
throws HDF5LibraryException, NullPointerException;
+ /**
+ * H5Pset_fapl_family Sets up use of the direct I/O driver.
+ *
+ * @param fapl_id
+ * IN: File access property list identifier
+ * @param memb_size
+ * IN: the size in bytes of each file member (used only when creating a new file)
+ * @param memb_fapl_id
+ * IN: the file access property list to be used for each family member
+ *
+ * @return a non-negative value if successful; otherwise returns a negative value.
+ *
+ * @exception HDF5LibraryException
+ * - Error from the HDF-5 Library.
+ *
+ **/
public synchronized static native int H5Pset_fapl_family(long fapl_id, long memb_size, long memb_fapl_id)
throws HDF5LibraryException, NullPointerException;
+ /**
+ * H5Pset_fapl_hdfs Modify the file access property list to use the H5FD_HDFS driver.
+ *
+ * @param fapl_id
+ * IN: File access property list identifier
+ * @param fapl_conf
+ * IN: the properties of the hdfs driver
+ *
+ * @return a non-negative value if successful; otherwise returns a negative value.
+ *
+ * @exception HDF5LibraryException
+ * - Error from the HDF-5 Library.
+ *
+ **/
public synchronized static native int H5Pset_fapl_hdfs(long fapl_id, H5FD_hdfs_fapl_t fapl_conf) throws HDF5LibraryException, NullPointerException;
+ /**
+ * H5Pget_fapl_hdfs gets the properties hdfs I/O driver.
+ *
+ * @param fapl_id
+ * IN: File access property list identifier
+ *
+ * @return the properties of the hdfs driver.
+ *
+ * @exception HDF5LibraryException
+ * - Error from the HDF-5 Library.
+ *
+ **/
public synchronized static native H5FD_hdfs_fapl_t H5Pget_fapl_hdfs(long fapl_id) throws HDF5LibraryException, NullPointerException;
/**
@@ -8044,17 +10249,99 @@ public class H5 implements java.io.Serializable {
public synchronized static native void H5Pset_fapl_log(long fapl_id, String logfile, long flags, long buf_size)
throws HDF5LibraryException, NullPointerException;
+ /**
+ * H5Pset_fapl_sec2 Sets up use of the sec2 I/O driver.
+ *
+ * @param fapl_id
+ * IN: File access property list identifier
+ *
+ * @return a non-negative value if successful; otherwise returns a negative value.
+ *
+ * @exception HDF5LibraryException
+ * - Error from the HDF-5 Library.
+ *
+ **/
public synchronized static native int H5Pset_fapl_sec2(long fapl_id) throws HDF5LibraryException, NullPointerException;
+ /**
+ * H5Pset_fapl_split Sets up use of the split I/O driver. Makes the multi driver act like the
+ * old split driver which stored meta data in one file and raw
+ * data in another file
+ *
+ * @param fapl_id
+ * IN: File access property list identifier
+ * @param meta_ext
+ * IN: meta filename extension
+ * @param meta_plist_id
+ * IN: File access property list identifier for metadata
+ * @param raw_ext
+ * IN: raw data filename extension
+ * @param raw_plist_id
+ * IN: File access property list identifier raw data
+ *
+ * @exception HDF5LibraryException
+ * - Error from the HDF-5 Library.
+ *
+ **/
public synchronized static native void H5Pset_fapl_split(long fapl_id, String meta_ext, long meta_plist_id,
String raw_ext, long raw_plist_id) throws HDF5LibraryException, NullPointerException;
+ /**
+ * H5Pset_fapl_stdio Sets up use of the stdio I/O driver.
+ *
+ * @param fapl_id
+ * IN: File access property list identifier
+ *
+ * @return a non-negative value if successful; otherwise returns a negative value.
+ *
+ * @exception HDF5LibraryException
+ * - Error from the HDF-5 Library.
+ *
+ **/
public synchronized static native int H5Pset_fapl_stdio(long fapl_id) throws HDF5LibraryException, NullPointerException;
+ /**
+ * H5Pset_fapl_windows Sets up use of the windows I/O driver.
+ *
+ * @param fapl_id
+ * IN: File access property list identifier
+ *
+ * @return a non-negative value if successful; otherwise returns a negative value.
+ *
+ * @exception HDF5LibraryException
+ * - Error from the HDF-5 Library.
+ *
+ **/
public synchronized static native int H5Pset_fapl_windows(long fapl_id) throws HDF5LibraryException, NullPointerException;
+ /**
+ * H5Pset_fapl_ros3 Modify the file access property list to use the H5FD_ROS3 driver.
+ *
+ * @param fapl_id
+ * IN: File access property list identifier
+ * @param fapl_conf
+ * IN: the properties of the ros3 driver
+ *
+ * @return a non-negative value if successful; otherwise returns a negative value.
+ *
+ * @exception HDF5LibraryException
+ * - Error from the HDF-5 Library.
+ *
+ **/
public synchronized static native int H5Pset_fapl_ros3(long fapl_id, H5FD_ros3_fapl_t fapl_conf) throws HDF5LibraryException, NullPointerException;
+ /**
+ * H5Pget_fapl_ros3 gets the properties of the ros3 I/O driver.
+ *
+ * @param fapl_id
+ * IN: File access property list identifier
+ *
+ * @return the properties of the ros3 driver.
+ *
+ * @exception HDF5LibraryException
+ * - Error from the HDF-5 Library.
+ *
+ **/
public synchronized static native H5FD_ros3_fapl_t H5Pget_fapl_ros3(long fapl_id) throws HDF5LibraryException, NullPointerException;
// /////// unimplemented ////////
@@ -8762,50 +11049,7 @@ public class H5 implements java.io.Serializable {
// //
// ////////////////////////////////////////////////////////////
- /**
- * H5Sclose releases a dataspace.
- *
- * @param space_id
- * Identifier of dataspace to release.
- *
- * @return a non-negative value if successful
- *
- * @exception HDF5LibraryException
- * - Error from the HDF-5 Library.
- **/
- public static int H5Sclose(long space_id) throws HDF5LibraryException {
- if (space_id < 0)
- return 0; // throw new HDF5LibraryException("Negative ID");;
-
- log.trace("OPEN_IDS: H5Sclose remove {}", space_id);
- OPEN_IDS.remove(space_id);
- log.trace("OPEN_IDS: {}", OPEN_IDS.size());
- return _H5Sclose(space_id);
- }
-
- private synchronized static native int _H5Sclose(long space_id) throws HDF5LibraryException;
-
- /**
- * H5Scopy creates a new dataspace which is an exact copy of the dataspace identified by space_id.
- *
- * @param space_id
- * Identifier of dataspace to copy.
- * @return a dataspace identifier if successful
- *
- * @exception HDF5LibraryException
- * - Error from the HDF-5 Library.
- **/
- public static long H5Scopy(long space_id) throws HDF5LibraryException {
- long id = _H5Scopy(space_id);
- if (id > 0) {
- log.trace("OPEN_IDS: H5Scopy add {}", id);
- OPEN_IDS.add(id);
- log.trace("OPEN_IDS: {}", OPEN_IDS.size());
- }
- return id;
- }
-
- private synchronized static native long _H5Scopy(long space_id) throws HDF5LibraryException;
+ /**************** Operations on dataspaces ********************/
/**
* H5Screate creates a new dataspace of a particular type.
@@ -8862,19 +11106,96 @@ public class H5 implements java.io.Serializable {
throws HDF5Exception, NullPointerException;
/**
- * H5Sdecode reconstructs the HDF5 data space object and returns a new object handle for it.
+ * H5Sset_extent_simple sets or resets the size of an existing dataspace.
*
- * @param buf
- * IN: Buffer for the data space object to be decoded.
+ * @param space_id
+ * Dataspace identifier.
+ * @param rank
+ * Rank, or dimensionality, of the dataspace.
+ * @param current_size
+ * Array containing current size of dataspace.
+ * @param maximum_size
+ * Array containing maximum size of dataspace.
*
- * @return a new object handle
+ * @return a dataspace identifier if successful
*
* @exception HDF5LibraryException
* - Error from the HDF-5 Library.
- * @exception NullPointerException
- * - buf is null.
**/
- public synchronized static native long H5Sdecode(byte[] buf) throws HDF5LibraryException, NullPointerException;
+ public synchronized static native long H5Sset_extent_simple(long space_id, int rank, long[] current_size,
+ long[] maximum_size) throws HDF5LibraryException, NullPointerException;
+
+ /**
+ * H5Sset_extent_simple sets or resets the size of an existing dataspace.
+ *
+ * @param space_id
+ * Dataspace identifier.
+ * @param rank
+ * Rank, or dimensionality, of the dataspace.
+ * @param current_size
+ * Array containing current size of dataspace.
+ * @param maximum_size
+ * Array containing maximum size of dataspace.
+ *
+ * @return a dataspace identifier if successful
+ *
+ * @exception HDF5LibraryException
+ * - Error from the HDF-5 Library.
+ **/
+ public synchronized static long H5Sset_extent_simple(long space_id, int rank, byte[] current_size,
+ byte[] maximum_size) throws HDF5LibraryException, NullPointerException {
+ ByteBuffer csbb = ByteBuffer.wrap(current_size);
+ long[] lacs = (csbb.asLongBuffer()).array();
+ ByteBuffer maxsbb = ByteBuffer.wrap(maximum_size);
+ long[] lamaxs = (maxsbb.asLongBuffer()).array();
+
+ return H5Sset_extent_simple(space_id, rank, lacs, lamaxs);
+ }
+
+ /**
+ * H5Scopy creates a new dataspace which is an exact copy of the dataspace identified by space_id.
+ *
+ * @param space_id
+ * Identifier of dataspace to copy.
+ * @return a dataspace identifier if successful
+ *
+ * @exception HDF5LibraryException
+ * - Error from the HDF-5 Library.
+ **/
+ public static long H5Scopy(long space_id) throws HDF5LibraryException {
+ long id = _H5Scopy(space_id);
+ if (id > 0) {
+ log.trace("OPEN_IDS: H5Scopy add {}", id);
+ OPEN_IDS.add(id);
+ log.trace("OPEN_IDS: {}", OPEN_IDS.size());
+ }
+ return id;
+ }
+
+ private synchronized static native long _H5Scopy(long space_id) throws HDF5LibraryException;
+
+ /**
+ * H5Sclose releases a dataspace.
+ *
+ * @param space_id
+ * Identifier of dataspace to release.
+ *
+ * @return a non-negative value if successful
+ *
+ * @exception HDF5LibraryException
+ * - Error from the HDF-5 Library.
+ **/
+ public static int H5Sclose(long space_id) throws HDF5LibraryException {
+ if (space_id < 0)
+ return 0; // throw new HDF5LibraryException("Negative ID");;
+
+ log.trace("OPEN_IDS: H5Sclose remove {}", space_id);
+ OPEN_IDS.remove(space_id);
+ log.trace("OPEN_IDS: {}", OPEN_IDS.size());
+ return _H5Sclose(space_id);
+ }
+
+ private synchronized static native int _H5Sclose(long space_id) throws HDF5LibraryException;
/**
* H5Sencode converts a data space description into binary form in a buffer.
@@ -8890,154 +11211,139 @@ public class H5 implements java.io.Serializable {
public synchronized static native byte[] H5Sencode(long obj_id) throws HDF5LibraryException, NullPointerException;
/**
- * H5Sextent_copy copies the extent from source_space_id to dest_space_id. This action may change the type of the
- * dataspace.
+ * H5Sdecode reconstructs the HDF5 data space object and returns a new object handle for it.
*
- * @param dest_space_id
- * IN: The identifier for the dataspace from which the extent is copied.
- * @param source_space_id
- * IN: The identifier for the dataspace to which the extent is copied.
+ * @param buf
+ * IN: Buffer for the data space object to be decoded.
*
- * @return a non-negative value if successful
+ * @return a new object handle
*
* @exception HDF5LibraryException
* - Error from the HDF-5 Library.
+ * @exception NullPointerException
+ * - buf is null.
**/
- public synchronized static native int H5Sextent_copy(long dest_space_id, long source_space_id)
- throws HDF5LibraryException;
+ public synchronized static native long H5Sdecode(byte[] buf) throws HDF5LibraryException, NullPointerException;
/**
- * H5Sextent_equal determines whether the dataspace extents of two dataspaces, space1_id and space2_id, are equal.
+ * H5Sget_simple_extent_npoints determines the number of elements in a dataspace.
*
- * @param first_space_id
- * IN: The identifier for the first dataspace.
- * @param second_space_id
- * IN: The identifier for the seconddataspace.
+ * @param space_id
+ * ID of the dataspace object to query
+ * @return the number of elements in the dataspace if successful
*
- * @return true if successful, else false
+ * @exception HDF5LibraryException
+ * - Error from the HDF-5 Library.
+ **/
+ public synchronized static native long H5Sget_simple_extent_npoints(long space_id) throws HDF5LibraryException;
+
+ /**
+ * H5Sget_simple_extent_ndims determines the dimensionality (or rank) of a dataspace.
+ *
+ * @param space_id
+ * IN: Identifier of the dataspace
+ *
+ * @return the number of dimensions in the dataspace if successful
*
* @exception HDF5LibraryException
* - Error from the HDF-5 Library.
**/
- public synchronized static native boolean H5Sextent_equal(long first_space_id, long second_space_id)
- throws HDF5LibraryException;
+ public synchronized static native int H5Sget_simple_extent_ndims(long space_id) throws HDF5LibraryException;
/**
- * H5Sget_select_bounds retrieves the coordinates of the bounding box containing the current selection and places
- * them into user-supplied buffers.
- * <P>
- * The start and end buffers must be large enough to hold the dataspace rank number of coordinates.
+ * H5Sget_simple_extent_dims returns the size and maximum sizes of each dimension of a dataspace through the dims
+ * and maxdims parameters.
*
- * @param spaceid
- * Identifier of dataspace to release.
- * @param start
- * coordinates of lowest corner of bounding box.
- * @param end
- * coordinates of highest corner of bounding box.
+ * @param space_id
+ * IN: Identifier of the dataspace object to query
+ * @param dims
+ * OUT: Pointer to array to store the size of each dimension.
+ * @param maxdims
+ * OUT: Pointer to array to store the maximum size of each dimension.
*
- * @return a non-negative value if successful,with start and end initialized.
+ * @return the number of dimensions in the dataspace if successful
*
* @exception HDF5LibraryException
* - Error from the HDF-5 Library.
* @exception NullPointerException
- * - start or end is null.
+ * - dims or maxdims is null.
**/
- public synchronized static native int H5Sget_select_bounds(long spaceid, long[] start, long[] end)
+ public synchronized static native int H5Sget_simple_extent_dims(long space_id, long[] dims, long[] maxdims)
throws HDF5LibraryException, NullPointerException;
/**
- * H5Sget_select_elem_npoints returns the number of element points in the current dataspace selection.
+ * H5Sis_simple determines whether a dataspace is a simple dataspace.
*
- * @param spaceid
- * Identifier of dataspace to release.
+ * @param space_id
+ * Identifier of the dataspace to query
*
- * @return a non-negative value if successful
+ * @return true if is a simple dataspace
*
* @exception HDF5LibraryException
* - Error from the HDF-5 Library.
**/
- public synchronized static native long H5Sget_select_elem_npoints(long spaceid) throws HDF5LibraryException;
+ public synchronized static native boolean H5Sis_simple(long space_id) throws HDF5LibraryException;
/**
- * H5Sget_select_elem_pointlist returns an array of of element points in the current dataspace selection. The point
- * coordinates have the same dimensionality (rank) as the dataspace they are located within, one coordinate per
- * point.
+ * H5Sget_simple_extent_type queries a dataspace to determine the current class of a dataspace.
*
- * @param spaceid
- * Identifier of dataspace to release.
- * @param startpoint
- * first point to retrieve
- * @param numpoints
- * number of points to retrieve
- * @param buf
- * returns points startblock to startblock+num-1, each points is <i>rank</i> longs.
+ * @param space_id
+ * Dataspace identifier.
*
- * @return a non-negative value if successful
+ * @return a dataspace class name if successful
*
* @exception HDF5LibraryException
* - Error from the HDF-5 Library.
- * @exception NullPointerException
- * - buf is null.
**/
- public synchronized static native int H5Sget_select_elem_pointlist(long spaceid, long startpoint, long numpoints,
- long[] buf) throws HDF5LibraryException, NullPointerException;
+ public synchronized static native int H5Sget_simple_extent_type(long space_id) throws HDF5LibraryException;
/**
- * H5Sget_select_hyper_blocklist returns an array of hyperslab blocks. The block coordinates have the same
- * dimensionality (rank) as the dataspace they are located within. The list of blocks is formatted as follows:
- *
- * <pre>
- * &lt;"start" coordinate&gt;, immediately followed by
- * &lt;"opposite" corner coordinate&gt;, followed by
- * the next "start" and "opposite" coordinates,
- * etc.
- * until all of the selected blocks have been listed.
- * </pre>
+ * H5Sset_extent_none removes the extent from a dataspace and sets the type to H5S_NONE.
*
- * @param spaceid
- * Identifier of dataspace to release.
- * @param startblock
- * first block to retrieve
- * @param numblocks
- * number of blocks to retrieve
- * @param buf
- * returns blocks startblock to startblock+num-1, each block is <i>rank</i> * 2 (corners) longs.
+ * @param space_id
+ * The identifier for the dataspace from which the extent is to be removed.
*
* @return a non-negative value if successful
*
* @exception HDF5LibraryException
* - Error from the HDF-5 Library.
- * @exception NullPointerException
- * - buf is null.
**/
- public synchronized static native int H5Sget_select_hyper_blocklist(long spaceid, long startblock, long numblocks,
- long[] buf) throws HDF5LibraryException, NullPointerException;
+ public synchronized static native int H5Sset_extent_none(long space_id) throws HDF5LibraryException;
/**
- * H5Sget_select_hyper_nblocks returns the number of hyperslab blocks in the current dataspace selection.
+ * H5Sextent_copy copies the extent from source_space_id to dest_space_id. This action may change the type of the
+ * dataspace.
*
- * @param spaceid
- * Identifier of dataspace to release.
+ * @param dest_space_id
+ * IN: The identifier for the dataspace from which the extent is copied.
+ * @param source_space_id
+ * IN: The identifier for the dataspace to which the extent is copied.
*
* @return a non-negative value if successful
*
* @exception HDF5LibraryException
* - Error from the HDF-5 Library.
**/
- public synchronized static native long H5Sget_select_hyper_nblocks(long spaceid) throws HDF5LibraryException;
+ public synchronized static native int H5Sextent_copy(long dest_space_id, long source_space_id)
+ throws HDF5LibraryException;
/**
- * H5Sget_select_npoints determines the number of elements in the current selection of a dataspace.
+ * H5Sextent_equal determines whether the dataspace extents of two dataspaces, space1_id and space2_id, are equal.
*
- * @param space_id
- * IN: Identifier of the dataspace object to query
+ * @param first_space_id
+ * IN: The identifier for the first dataspace.
+ * @param second_space_id
+ * IN: The identifier for the seconddataspace.
*
- * @return the number of elements in the selection if successful
+ * @return true if successful, else false
*
* @exception HDF5LibraryException
* - Error from the HDF-5 Library.
**/
- public synchronized static native long H5Sget_select_npoints(long space_id) throws HDF5LibraryException;
+ public synchronized static native boolean H5Sextent_equal(long first_space_id, long second_space_id)
+ throws HDF5LibraryException;
+
+ /***************** Operations on dataspace selections *****************/
/**
* H5Sget_select_type retrieves the type of selection currently defined for the dataspace space_id.
@@ -9053,76 +11359,118 @@ public class H5 implements java.io.Serializable {
public synchronized static native int H5Sget_select_type(long space_id) throws HDF5LibraryException;
/**
- * H5Sget_simple_extent_dims returns the size and maximum sizes of each dimension of a dataspace through the dims
- * and maxdims parameters.
+ * H5Sget_select_npoints determines the number of elements in the current selection of a dataspace.
*
* @param space_id
* IN: Identifier of the dataspace object to query
- * @param dims
- * OUT: Pointer to array to store the size of each dimension.
- * @param maxdims
- * OUT: Pointer to array to store the maximum size of each dimension.
*
- * @return the number of dimensions in the dataspace if successful
+ * @return the number of elements in the selection if successful
*
* @exception HDF5LibraryException
* - Error from the HDF-5 Library.
- * @exception NullPointerException
- * - dims or maxdims is null.
**/
- public synchronized static native int H5Sget_simple_extent_dims(long space_id, long[] dims, long[] maxdims)
- throws HDF5LibraryException, NullPointerException;
+ public synchronized static native long H5Sget_select_npoints(long space_id) throws HDF5LibraryException;
/**
- * H5Sget_simple_extent_ndims determines the dimensionality (or rank) of a dataspace.
+ * H5Sselect_copy copies all the selection information (including offset) from the source
+ * dataspace to the destination dataspace.
+ * @param dst_id ID of the destination dataspace
+ * @param src_id ID of the source dataspace
+ *
+ * @exception HDF5LibraryException
+ * - Error from the HDF-5 Library.
+ **/
+ public synchronized static native void H5Sselect_copy(long dst_id, long src_id) throws HDF5LibraryException;
+
+ /**
+ * H5Sselect_valid verifies that the selection for the dataspace.
*
* @param space_id
- * IN: Identifier of the dataspace
+ * The identifier for the dataspace in which the selection is being reset.
*
- * @return the number of dimensions in the dataspace if successful
+ * @return true if the selection is contained within the extent and FALSE if it is not or is an error.
*
* @exception HDF5LibraryException
* - Error from the HDF-5 Library.
**/
- public synchronized static native int H5Sget_simple_extent_ndims(long space_id) throws HDF5LibraryException;
+ public synchronized static native boolean H5Sselect_valid(long space_id) throws HDF5LibraryException;
/**
- * H5Sget_simple_extent_npoints determines the number of elements in a dataspace.
+ * H5Sselect_adjust moves a selection by subtracting an offset from it.
*
* @param space_id
- * ID of the dataspace object to query
- * @return the number of elements in the dataspace if successful
+ * ID of dataspace to adjust
+ * @param offset
+ * Offset to subtract
*
* @exception HDF5LibraryException
* - Error from the HDF-5 Library.
+ * @exception NullPointerException
+ * - offset is null.
**/
- public synchronized static native long H5Sget_simple_extent_npoints(long space_id) throws HDF5LibraryException;
+ public synchronized static native void H5Sselect_adjust(long space_id, long[][] offset)
+ throws HDF5LibraryException, NullPointerException;
/**
- * H5Sget_simple_extent_type queries a dataspace to determine the current class of a dataspace.
+ * H5Sget_select_bounds retrieves the coordinates of the bounding box containing the current selection and places
+ * them into user-supplied buffers.
+ * <P>
+ * The start and end buffers must be large enough to hold the dataspace rank number of coordinates.
*
* @param space_id
- * Dataspace identifier.
+ * Identifier of dataspace to release.
+ * @param start
+ * coordinates of lowest corner of bounding box.
+ * @param end
+ * coordinates of highest corner of bounding box.
*
- * @return a dataspace class name if successful
+ * @return a non-negative value if successful,with start and end initialized.
*
* @exception HDF5LibraryException
* - Error from the HDF-5 Library.
+ * @exception NullPointerException
+ * - start or end is null.
**/
- public synchronized static native int H5Sget_simple_extent_type(long space_id) throws HDF5LibraryException;
+ public synchronized static native int H5Sget_select_bounds(long space_id, long[] start, long[] end)
+ throws HDF5LibraryException, NullPointerException;
/**
- * H5Sis_simple determines whether a dataspace is a simple dataspace.
+ * H5Sselect_shape_same checks to see if the current selection in the dataspaces are the same
+ * dimensionality and shape.
+ * This is primarily used for reading the entire selection in one swoop.
+ *
+ * @param space1_id ID of 1st Dataspace pointer to compare
+ * @param space2_id ID of 2nd Dataspace pointer to compare
+ *
+ * @return true if the selection is the same dimensionality and shape;
+ * false otherwise
+ *
+ * @exception HDF5LibraryException
+ * - Error from the HDF-5 Library.
+ **/
+ public synchronized static native boolean H5Sselect_shape_same(long space1_id, long space2_id) throws HDF5LibraryException;
+
+ /**
+ * H5Sselect_intersect_block checks to see if the current selection in the
+ * dataspace intersects with the block given.
*
* @param space_id
- * Identifier of the dataspace to query
+ * ID of dataspace pointer to compare
+ * @param start
+ * Starting coordinate of block
+ * @param end
+ * Opposite ("ending") coordinate of block
*
- * @return true if is a simple dataspace
+ * @return a TRUE if the current selection in the dataspace intersects with the block given
+ * FALSE otherwise
*
* @exception HDF5LibraryException
* - Error from the HDF-5 Library.
+ * @exception NullPointerException
+ * - offset is null.
**/
- public synchronized static native boolean H5Sis_simple(long space_id) throws HDF5LibraryException;
+ public synchronized static native boolean H5Sselect_intersect_block(long space_id, long[] start, long[] end)
+ throws HDF5LibraryException, NullPointerException;
/**
* H5Soffset_simple sets the offset of a simple dataspace space_id.
@@ -9142,6 +11490,21 @@ public class H5 implements java.io.Serializable {
public synchronized static native int H5Soffset_simple(long space_id, byte[] offset) throws HDF5LibraryException,
NullPointerException;
+ /**
+ * H5Soffset_simple sets the offset of a simple dataspace space_id.
+ *
+ * @param space_id
+ * IN: The identifier for the dataspace object to reset.
+ * @param offset
+ * IN: The offset at which to position the selection.
+ *
+ * @return a non-negative value if successful
+ *
+ * @exception HDF5LibraryException
+ * - Error from the HDF-5 Library.
+ * @exception NullPointerException
+ * - offset array is null.
+ **/
public synchronized static int H5Soffset_simple(long space_id, long[] offset) throws HDF5Exception,
NullPointerException {
if (offset == null) {
@@ -9172,6 +11535,18 @@ public class H5 implements java.io.Serializable {
public synchronized static native int H5Sselect_all(long space_id) throws HDF5LibraryException;
/**
+ * H5Sselect_none resets the selection region for the dataspace space_id to include no elements.
+ *
+ * @param space_id
+ * IN: The identifier of the dataspace to be reset.
+ * @return a non-negative value if successful
+ *
+ * @exception HDF5LibraryException
+ * - Error from the HDF-5 Library.
+ **/
+ public synchronized static native int H5Sselect_none(long space_id) throws HDF5LibraryException;
+
+ /**
* H5Sselect_elements selects array elements to be included in the selection for the space_id dataspace.
*
* @param space_id
@@ -9229,6 +11604,43 @@ public class H5 implements java.io.Serializable {
}
/**
+ * H5Sget_select_elem_npoints returns the number of element points in the current dataspace selection.
+ *
+ * @param spaceid
+ * Identifier of dataspace to release.
+ *
+ * @return a non-negative value if successful
+ *
+ * @exception HDF5LibraryException
+ * - Error from the HDF-5 Library.
+ **/
+ public synchronized static native long H5Sget_select_elem_npoints(long spaceid) throws HDF5LibraryException;
+
+ /**
+ * H5Sget_select_elem_pointlist returns an array of of element points in the current dataspace selection. The point
+ * coordinates have the same dimensionality (rank) as the dataspace they are located within, one coordinate per
+ * point.
+ *
+ * @param spaceid
+ * Identifier of dataspace to release.
+ * @param startpoint
+ * first point to retrieve
+ * @param numpoints
+ * number of points to retrieve
+ * @param buf
+ * returns points startblock to startblock+num-1, each points is <i>rank</i> longs.
+ *
+ * @return a non-negative value if successful
+ *
+ * @exception HDF5LibraryException
+ * - Error from the HDF-5 Library.
+ * @exception NullPointerException
+ * - buf is null.
+ **/
+ public synchronized static native int H5Sget_select_elem_pointlist(long spaceid, long startpoint, long numpoints,
+ long[] buf) throws HDF5LibraryException, NullPointerException;
+
+ /**
* H5Sselect_hyperslab selects a hyperslab region to add to the current selected region for the dataspace specified
* by space_id. The start, stride, count, and block arrays must be the same size as the rank of the dataspace.
*
@@ -9268,76 +11680,118 @@ public class H5 implements java.io.Serializable {
return H5Sselect_hyperslab(space_id, op, lastart, lastride, lacount, lablock);
}
- public synchronized static native int H5Sselect_hyperslab(long space_id, int op, long[] start, long[] stride,
- long[] count, long[] block) throws HDF5LibraryException, NullPointerException, IllegalArgumentException;
-
/**
- * H5Sselect_none resets the selection region for the dataspace space_id to include no elements.
+ * H5Sselect_hyperslab selects a hyperslab region to add to the current selected region for the dataspace specified
+ * by space_id. The start, stride, count, and block arrays must be the same size as the rank of the dataspace.
*
* @param space_id
- * IN: The identifier of the dataspace to be reset.
+ * IN: Identifier of dataspace selection to modify
+ * @param op
+ * IN: Operation to perform on current selection.
+ * @param start
+ * IN: Offset of start of hyperslab
+ * @param stride
+ * IN: Hyperslab stride.
+ * @param count
+ * IN: Number of blocks included in hyperslab.
+ * @param block
+ * IN: Size of block in hyperslab.
+ *
* @return a non-negative value if successful
*
* @exception HDF5LibraryException
* - Error from the HDF-5 Library.
+ * @exception NullPointerException
+ * - an input array is null.
+ * @exception IllegalArgumentException
+ * - an input array is invalid.
**/
- public synchronized static native int H5Sselect_none(long space_id) throws HDF5LibraryException;
+ public synchronized static native int H5Sselect_hyperslab(long space_id, int op, long[] start, long[] stride,
+ long[] count, long[] block) throws HDF5LibraryException, NullPointerException, IllegalArgumentException;
+
/**
- * H5Sselect_valid verifies that the selection for the dataspace.
+ * H5Scombine_hyperslab combines a hyperslab selection with the current selection for a dataspace,
+ * creating a new dataspace to return the generated selection.
+ * If the current selection is not a hyperslab, it is freed and the hyperslab
+ * parameters passed in are combined with the H5S_SEL_ALL hyperslab (ie. a
+ * selection composing the entire current extent). If STRIDE or BLOCK is
+ * NULL, they are assumed to be set to all '1'.
*
* @param space_id
- * The identifier for the dataspace in which the selection is being reset.
+ * IN: Dataspace ID of selection to use
+ * @param op
+ * IN: Operation to perform on current selection.
+ * @param start
+ * IN: Offset of start of hyperslab
+ * @param stride
+ * IN: Hyperslab stride.
+ * @param count
+ * IN: Number of blocks included in hyperslab.
+ * @param block
+ * IN: Size of block in hyperslab.
*
- * @return true if the selection is contained within the extent and FALSE if it is not or is an error.
+ * @return a dataspace ID on success / H5I_INVALID_HID on failure
+ *
+ * @exception HDF5LibraryException
+ * - Error from the HDF-5 Library.
+ * @exception NullPointerException
+ * - an input array is null.
+ * @exception IllegalArgumentException
+ * - an input array is invalid.
+ **/
+ public synchronized static native long H5Scombine_hyperslab(long space_id, int op, long[] start, long[] stride,
+ long[] count, long[] block) throws HDF5LibraryException, NullPointerException, IllegalArgumentException;
+
+ /**
+ * H5Smodify_select refine an existing hyperslab selection with an operation, using a second
+ * hyperslab. The first selection is modified to contain the result of
+ * space1 operated on by space2.
+ *
+ * @param space1_id
+ * ID of the destination dataspace
+ * @param op
+ * Operation to perform on current selection.
+ * @param space2_id
+ * ID of the source dataspace
*
* @exception HDF5LibraryException
* - Error from the HDF-5 Library.
**/
- public synchronized static native boolean H5Sselect_valid(long space_id) throws HDF5LibraryException;
+ public synchronized static native void H5Smodify_select(long space1_id, int op, long space2_id) throws HDF5LibraryException;
/**
- * H5Sset_extent_none removes the extent from a dataspace and sets the type to H5S_NONE.
+ * H5Scombine_select combines two existing hyperslab selections with an operation, returning
+ * a new dataspace with the resulting selection. The dataspace extent from
+ * space1 is copied for the dataspace extent of the newly created dataspace.
*
- * @param space_id
- * The identifier for the dataspace from which the extent is to be removed.
+ * @param space1_id
+ * ID of the first dataspace
+ * @param op
+ * Operation to perform on current selection.
+ * @param space2_id
+ * ID of the second dataspace
*
- * @return a non-negative value if successful
+ * @return a dataspace ID on success / H5I_INVALID_HID on failure
*
* @exception HDF5LibraryException
* - Error from the HDF-5 Library.
**/
- public synchronized static native int H5Sset_extent_none(long space_id) throws HDF5LibraryException;
+ public synchronized static native long H5Scombine_select(long space1_id, int op, long space2_id) throws HDF5LibraryException;
/**
- * H5Sset_extent_simple sets or resets the size of an existing dataspace.
+ * H5Sis_regular_hyperslab retrieves a regular hyperslab selection for the dataspace specified
+ * by space_id.
*
* @param space_id
- * Dataspace identifier.
- * @param rank
- * Rank, or dimensionality, of the dataspace.
- * @param current_size
- * Array containing current size of dataspace.
- * @param maximum_size
- * Array containing maximum size of dataspace.
+ * IN: Identifier of dataspace selection to query
*
- * @return a dataspace identifier if successful
+ * @return a TRUE/FALSE for hyperslab selection if successful
*
* @exception HDF5LibraryException
* - Error from the HDF-5 Library.
**/
- public synchronized static native long H5Sset_extent_simple(long space_id, int rank, long[] current_size,
- long[] maximum_size) throws HDF5LibraryException, NullPointerException;
-
- public synchronized static long H5Sset_extent_simple(long space_id, int rank, byte[] current_size,
- byte[] maximum_size) throws HDF5LibraryException, NullPointerException {
- ByteBuffer csbb = ByteBuffer.wrap(current_size);
- long[] lacs = (csbb.asLongBuffer()).array();
- ByteBuffer maxsbb = ByteBuffer.wrap(maximum_size);
- long[] lamaxs = (maxsbb.asLongBuffer()).array();
-
- return H5Sset_extent_simple(space_id, rank, lacs, lamaxs);
- }
+ public synchronized static native boolean H5Sis_regular_hyperslab(long space_id) throws HDF5LibraryException;
/**
* H5Sget_regular_hyperslab determines if a hyperslab selection is regular for the dataspace specified
@@ -9363,33 +11817,82 @@ public class H5 implements java.io.Serializable {
**/
public synchronized static native void H5Sget_regular_hyperslab(long space_id, long[] start, long[] stride, long[] count, long[] block) throws HDF5LibraryException, NullPointerException, IllegalArgumentException;
+ /**
+ * H5Sget_select_hyper_nblocks returns the number of hyperslab blocks in the current dataspace selection.
+ *
+ * @param spaceid
+ * Identifier of dataspace to release.
+ *
+ * @return a non-negative value if successful
+ *
+ * @exception HDF5LibraryException
+ * - Error from the HDF-5 Library.
+ **/
+ public synchronized static native long H5Sget_select_hyper_nblocks(long spaceid) throws HDF5LibraryException;
+
/**
- * H5Sis_regular_hyperslab retrieves a regular hyperslab selection for the dataspace specified
- * by space_id.
+ * H5Sget_select_hyper_blocklist returns an array of hyperslab blocks. The block coordinates have the same
+ * dimensionality (rank) as the dataspace they are located within. The list of blocks is formatted as follows:
*
- * @param space_id
- * IN: Identifier of dataspace selection to query
+ * <pre>
+ * &lt;"start" coordinate&gt;, immediately followed by
+ * &lt;"opposite" corner coordinate&gt;, followed by
+ * the next "start" and "opposite" coordinates,
+ * etc.
+ * until all of the selected blocks have been listed.
+ * </pre>
*
- * @return a TRUE/FALSE for hyperslab selection if successful
+ * @param spaceid
+ * Identifier of dataspace to release.
+ * @param startblock
+ * first block to retrieve
+ * @param numblocks
+ * number of blocks to retrieve
+ * @param buf
+ * returns blocks startblock to startblock+num-1, each block is <i>rank</i> * 2 (corners) longs.
+ *
+ * @return a non-negative value if successful
*
* @exception HDF5LibraryException
* - Error from the HDF-5 Library.
+ * @exception NullPointerException
+ * - buf is null.
**/
- public synchronized static native boolean H5Sis_regular_hyperslab(long space_id) throws HDF5LibraryException;
+ public synchronized static native int H5Sget_select_hyper_blocklist(long spaceid, long startblock, long numblocks,
+ long[] buf) throws HDF5LibraryException, NullPointerException;
- // /////// unimplemented ////////
- // #ifdef NEW_HYPERSLAB_API
- // hid_t H5Scombine_hyperslab(hid_t space_id, H5S_seloper_t op,
- // const hsize_t start[],
- // const hsize_t _stride[],
- // const hsize_t count[],
- // const hsize_t _block[]);
- // herr_t H5Sselect_select(hid_t space1_id, H5S_seloper_t op,
- // hid_t space2_id);
- // hid_t H5Scombine_select(hid_t space1_id, H5S_seloper_t op,
- // hid_t space2_id);
- // #endif /* NEW_HYPERSLAB_API */
- // herr_t H5Sselect_copy(hid_t dst_id, hid_t src_id);
+ /**
+ * H5Sselect_project_intersection projects the intersection of the selections of src_space_id and
+ * src_intersect_space_id within the selection of src_space_id as a
+ * selection within the selection of dst_space_id.
+ *
+ * @param src_space_id
+ * Selection that is mapped to dst_space_id, and intersected with src_intersect_space_id
+ * @param dst_space_id
+ * Selection that is mapped to src_space_id
+ * @param src_intersect_space_id
+ * Selection whose intersection with src_space_id is projected to dst_space_id to obtain the result
+ *
+ * @return a dataspace with a selection equal to the intersection of
+ * src_intersect_space_id and src_space_id projected from src_space to dst_space on success
+ *
+ * @exception HDF5LibraryException
+ * - Error from the HDF-5 Library.
+ **/
+ public synchronized static native long H5Sselect_project_intersection(long src_space_id, long dst_space_id,
+ long src_intersect_space_id) throws HDF5LibraryException;
+
+
+ // /////// unimplemented ////////
+ ///// Operations on dataspace selections /////
+
+ //
+ ///// Operations on dataspace selection iterators /////
+ //public synchronized static native H5Ssel_iter_create(hid_t spaceid, size_t elmt_size, unsigned flags);
+ //public synchronized static native H5Ssel_iter_get_seq_list(hid_t sel_iter_id, size_t maxseq, size_t maxbytes, size_t *nseq,
+ // size_t *nbytes, hsize_t *off, size_t *len);
+ //public synchronized static native H5Ssel_iter_reset(hid_t sel_iter_id, hid_t space_id);
+ //public synchronized static native H5Ssel_iter_close(hid_t sel_iter_id);
@@ -9737,6 +12240,23 @@ public class H5 implements java.io.Serializable {
return H5Tenum_insert_int(type, name, value);
}
+ /**
+ * H5Tenum_insert inserts a new enumeration datatype member into an enumeration datatype.
+ *
+ * @param type
+ * IN: Identifier of datatype.
+ * @param name
+ * IN: The name of the member
+ * @param value
+ * IN: The value of the member, data of the correct type
+ *
+ * @return a non-negative value if successful
+ *
+ * @exception HDF5LibraryException
+ * - Error from the HDF-5 Library.
+ * @exception NullPointerException
+ * - name is null.
+ **/
public static int H5Tenum_insert(long type, String name, int value) throws HDF5LibraryException,
NullPointerException {
int[] val = { value };
@@ -10893,15 +13413,128 @@ public class H5 implements java.io.Serializable {
// ////////////////////////////////////////////////////////////
/// VOL Connector Functionality
+ /**
+ * H5VLregister_connector_by_name registers a new VOL connector as a member of the virtual object layer class.
+ *
+ * @param connector_name
+ * IN: name of the connector.
+ * @param vipl_id
+ * IN: VOL initialization property list which must be
+ * created with H5Pcreate(H5P_VOL_INITIALIZE) (or H5P_DEFAULT).
+ *
+ * @return a VOL connector ID
+ *
+ * @exception HDF5LibraryException
+ * - Error from the HDF-5 Library.
+ **/
public synchronized static native long H5VLregister_connector_by_name(String connector_name, long vipl_id);
+ /**
+ * H5VLregister_connector_by_value registers a new VOL connector as a member of the virtual object layer class.
+ *
+ * @param connector_value
+ * IN: value of the connector.
+ * @param vipl_id
+ * IN: VOL initialization property list which must be
+ * created with H5Pcreate(H5P_VOL_INITIALIZE) (or H5P_DEFAULT).
+ *
+ * @return a VOL connector ID
+ *
+ * @exception HDF5LibraryException
+ * - Error from the HDF-5 Library.
+ **/
public synchronized static native long H5VLregister_connector_by_value(int connector_value, long vipl_id);
+ /**
+ * H5VLis_connector_registered_by_name tests whether a VOL class has been registered.
+ *
+ * @param name
+ * IN: name of the connector.
+ *
+ * @return true if a VOL connector with that name has been registered
+ *
+ * @exception HDF5LibraryException
+ * - Error from the HDF-5 Library.
+ **/
public synchronized static native boolean H5VLis_connector_registered_by_name(String name);
+ /**
+ * H5VLis_connector_registered_by_value tests whether a VOL class has been registered.
+ *
+ * @param connector_value
+ * IN: value of the connector.
+ *
+ * @return true if a VOL connector with that value has been registered
+ *
+ * @exception HDF5LibraryException
+ * - Error from the HDF-5 Library.
+ **/
public synchronized static native boolean H5VLis_connector_registered_by_value(int connector_value);
+ /**
+ * H5VLget_connector_id retrieves the ID for a registered VOL connector for a given object.
+ *
+ * @param object_id
+ * IN: Identifier of the object.
+ *
+ * @return a VOL connector ID
+ *
+ * @exception HDF5LibraryException
+ * - Error from the HDF-5 Library.
+ **/
public synchronized static native long H5VLget_connector_id(long object_id);
+ /**
+ * H5VLget_connector_id_by_name retrieves the ID for a registered VOL connector.
+ *
+ * @param name
+ * IN: name of the connector.
+ *
+ * @return a VOL connector ID
+ *
+ * @exception HDF5LibraryException
+ * - Error from the HDF-5 Library.
+ **/
public synchronized static native long H5VLget_connector_id_by_name(String name);
+ /**
+ * H5VLget_connector_id_by_value retrieves the ID for a registered VOL connector.
+ *
+ * @param connector_value
+ * IN: value of the connector.
+ *
+ * @return a VOL connector ID
+ *
+ * @exception HDF5LibraryException
+ * - Error from the HDF-5 Library.
+ **/
public synchronized static native long H5VLget_connector_id_by_value(int connector_value);
+ /**
+ * H5VLget_connector_name returns the connector name for the VOL associated with the
+ * object or file ID.
+ *
+ * @param object_id
+ * IN: Identifier of the object.
+ *
+ * @return the connector name
+ *
+ * @exception HDF5LibraryException
+ * - Error from the HDF-5 Library.
+ **/
public synchronized static native String H5VLget_connector_name(long object_id);
+ /**
+ * H5VLclose closes a VOL connector ID.
+ *
+ * @param connector_id
+ * IN: Identifier of the connector.
+ *
+ * @exception HDF5LibraryException
+ * - Error from the HDF-5 Library.
+ **/
public synchronized static native void H5VLclose(long connector_id);
+ /**
+ * H5VLunregister_connector removes a VOL connector ID from the library.
+ *
+ * @param connector_id
+ * IN: Identifier of the connector.
+ *
+ * @exception HDF5LibraryException
+ * - Error from the HDF-5 Library.
+ **/
public synchronized static native void H5VLunregister_connector(long connector_id);
// /////// unimplemented ////////
@@ -10914,11 +13547,44 @@ public class H5 implements java.io.Serializable {
// //
// ////////////////////////////////////////////////////////////
- public synchronized static native int H5Zfilter_avail(int filter) throws HDF5LibraryException, NullPointerException;
+ /**
+ * H5Zfilter_avail checks if a filter is available.
+ *
+ * @param filter
+ * IN: filter number.
+ *
+ * @return a non-negative(TRUE/FALSE) value if successful
+ *
+ * @exception HDF5LibraryException
+ * - Error from the HDF-5 Library.
+ **/
+ public synchronized static native int H5Zfilter_avail(int filter) throws HDF5LibraryException;
+ /**
+ * H5Zget_filter_info gets information about a pipeline data filter.
+ *
+ * @param filter
+ * IN: filter number.
+ *
+ * @return the filter information flags
+ *
+ * @exception HDF5LibraryException
+ * - Error from the HDF-5 Library.
+ **/
public synchronized static native int H5Zget_filter_info(int filter) throws HDF5LibraryException;
- public synchronized static native int H5Zunregister(int filter) throws HDF5LibraryException, NullPointerException;
+ /**
+ * H5Zunregister unregisters a filter.
+ *
+ * @param filter
+ * IN: filter number.
+ *
+ * @return a non-negative value if successful
+ *
+ * @exception HDF5LibraryException
+ * - Error from the HDF-5 Library.
+ **/
+ public synchronized static native int H5Zunregister(int filter) throws HDF5LibraryException;
// /////// unimplemented ////////
diff --git a/java/src/hdf/hdf5lib/HDF5Constants.java b/java/src/hdf/hdf5lib/HDF5Constants.java
index 5801655..4125907 100644
--- a/java/src/hdf/hdf5lib/HDF5Constants.java
+++ b/java/src/hdf/hdf5lib/HDF5Constants.java
@@ -35,260 +35,650 @@ public class HDF5Constants {
// Get the HDF5 constants from the library //
// /////////////////////////////////////////////////////////////////////////
- public static final long H5_QUARTER_HADDR_MAX = H5_QUARTER_HADDR_MAX();
+ //public static final long H5_QUARTER_HADDR_MAX = H5_QUARTER_HADDR_MAX();
+ /** Special parameters for szip compression */
public static final int H5_SZIP_MAX_PIXELS_PER_BLOCK = H5_SZIP_MAX_PIXELS_PER_BLOCK();
+ /** Special parameters for szip compression */
public static final int H5_SZIP_NN_OPTION_MASK = H5_SZIP_NN_OPTION_MASK();
+ /** Special parameters for szip compression */
public static final int H5_SZIP_EC_OPTION_MASK = H5_SZIP_EC_OPTION_MASK();
+ /** Special parameters for szip compression */
public static final int H5_SZIP_ALLOW_K13_OPTION_MASK = H5_SZIP_ALLOW_K13_OPTION_MASK();
+ /** Special parameters for szip compression */
public static final int H5_SZIP_CHIP_OPTION_MASK = H5_SZIP_CHIP_OPTION_MASK();
+ /** indices on links, unknown index type */
public static final int H5_INDEX_UNKNOWN = H5_INDEX_UNKNOWN();
+ /** indices on links, index on names */
public static final int H5_INDEX_NAME = H5_INDEX_NAME();
+ /** indices on links, index on creation order */
public static final int H5_INDEX_CRT_ORDER = H5_INDEX_CRT_ORDER();
+ /** indices on links, number of indices defined */
public static final int H5_INDEX_N = H5_INDEX_N();
+ /** Common iteration orders, Unknown order */
public static final int H5_ITER_UNKNOWN = H5_ITER_UNKNOWN();
+ /** Common iteration orders, Increasing order */
public static final int H5_ITER_INC = H5_ITER_INC();
+ /** Common iteration orders, Decreasing order */
public static final int H5_ITER_DEC = H5_ITER_DEC();
+ /** Common iteration orders, No particular order, whatever is fastest */
public static final int H5_ITER_NATIVE = H5_ITER_NATIVE();
+ /** Common iteration orders, Number of iteration orders */
public static final int H5_ITER_N = H5_ITER_N();
+ /** */
public static final int H5AC_CURR_CACHE_CONFIG_VERSION = H5AC_CURR_CACHE_CONFIG_VERSION();
+ /** */
public static final int H5AC_MAX_TRACE_FILE_NAME_LEN = H5AC_MAX_TRACE_FILE_NAME_LEN();
+ /** */
public static final int H5AC_METADATA_WRITE_STRATEGY_PROCESS_ZERO_ONLY = H5AC_METADATA_WRITE_STRATEGY_PROCESS_ZERO_ONLY();
+ /** */
public static final int H5AC_METADATA_WRITE_STRATEGY_DISTRIBUTED = H5AC_METADATA_WRITE_STRATEGY_DISTRIBUTED();
+ /** */
public static final int H5C_incr_off = H5C_incr_off();
+ /** */
public static final int H5C_incr_threshold = H5C_incr_threshold();
+ /** */
public static final int H5C_flash_incr_off = H5C_flash_incr_off();
+ /** */
public static final int H5C_flash_incr_add_space = H5C_flash_incr_add_space();
+ /** */
public static final int H5C_decr_off = H5C_decr_off();
+ /** */
public static final int H5C_decr_threshold = H5C_decr_threshold();
+ /** */
public static final int H5C_decr_age_out = H5C_decr_age_out();
+ /** */
public static final int H5C_decr_age_out_with_threshold = H5C_decr_age_out_with_threshold();
+ /** */
public static final int H5D_CHUNK_IDX_BTREE = H5D_CHUNK_IDX_BTREE();
+ /** */
public static final int H5D_ALLOC_TIME_DEFAULT = H5D_ALLOC_TIME_DEFAULT();
+ /** */
public static final int H5D_ALLOC_TIME_EARLY = H5D_ALLOC_TIME_EARLY();
+ /** */
public static final int H5D_ALLOC_TIME_ERROR = H5D_ALLOC_TIME_ERROR();
+ /** */
public static final int H5D_ALLOC_TIME_INCR = H5D_ALLOC_TIME_INCR();
+ /** */
public static final int H5D_ALLOC_TIME_LATE = H5D_ALLOC_TIME_LATE();
+ /** */
public static final int H5D_FILL_TIME_ERROR = H5D_FILL_TIME_ERROR();
+ /** */
public static final int H5D_FILL_TIME_ALLOC = H5D_FILL_TIME_ALLOC();
+ /** */
public static final int H5D_FILL_TIME_NEVER = H5D_FILL_TIME_NEVER();
+ /** */
public static final int H5D_FILL_TIME_IFSET = H5D_FILL_TIME_IFSET();
+ /** */
public static final int H5D_FILL_VALUE_DEFAULT = H5D_FILL_VALUE_DEFAULT();
+ /** */
public static final int H5D_FILL_VALUE_ERROR = H5D_FILL_VALUE_ERROR();
+ /** */
public static final int H5D_FILL_VALUE_UNDEFINED = H5D_FILL_VALUE_UNDEFINED();
+ /** */
public static final int H5D_FILL_VALUE_USER_DEFINED = H5D_FILL_VALUE_USER_DEFINED();
+ /** */
public static final int H5D_LAYOUT_ERROR = H5D_LAYOUT_ERROR();
+ /** */
public static final int H5D_CHUNKED = H5D_CHUNKED();
+ /** */
public static final int H5D_COMPACT = H5D_COMPACT();
+ /** */
public static final int H5D_CONTIGUOUS = H5D_CONTIGUOUS();
+ /** */
public static final int H5D_VIRTUAL = H5D_VIRTUAL();
+ /** */
public static final int H5D_NLAYOUTS = H5D_NLAYOUTS();
+ /** */
public static final int H5D_SPACE_STATUS_ALLOCATED = H5D_SPACE_STATUS_ALLOCATED();
+ /** */
public static final int H5D_SPACE_STATUS_ERROR = H5D_SPACE_STATUS_ERROR();
+ /** */
public static final int H5D_SPACE_STATUS_NOT_ALLOCATED = H5D_SPACE_STATUS_NOT_ALLOCATED();
+ /** */
public static final int H5D_SPACE_STATUS_PART_ALLOCATED = H5D_SPACE_STATUS_PART_ALLOCATED();
+ /** */
public static final int H5D_VDS_ERROR = H5D_VDS_ERROR();
+ /** */
public static final int H5D_VDS_FIRST_MISSING = H5D_VDS_FIRST_MISSING();
+ /** */
public static final int H5D_VDS_LAST_AVAILABLE = H5D_VDS_LAST_AVAILABLE();
+ /** */
public static final int H5D_CHUNK_DONT_FILTER_PARTIAL_CHUNKS = H5D_CHUNK_DONT_FILTER_PARTIAL_CHUNKS();
+ /** Different kinds of error information - H5E_type_t */
public static final int H5E_MAJOR = H5E_MAJOR();
+ /** Different kinds of error information - H5E_type_t */
public static final int H5E_MINOR = H5E_MINOR();
+ /** Minor error codes - Object header related errors - Alignment error */
public static final long H5E_ALIGNMENT = H5E_ALIGNMENT();
+ /** Minor error codes - Resource errors - Object already exists */
public static final long H5E_ALREADYEXISTS = H5E_ALREADYEXISTS();
+ /** Minor error codes - Function entry/exit interface - Object already initialized */
public static final long H5E_ALREADYINIT = H5E_ALREADYINIT();
+ /** Major error codes - Invalid arguments to routine */
public static final long H5E_ARGS = H5E_ARGS();
- public static final long H5E_ATOM = H5E_ATOM();
+ /** Major error codes - Object ID */
+ public static final long H5E_ID = H5E_ID();
+ /** Major error codes - Attribute */
public static final long H5E_ATTR = H5E_ATTR();
- public static final long H5E_BADATOM = H5E_BADATOM();
+ /** Minor error codes - Object ID related errors - Unable to find ID information (already closed?) */
+ public static final long H5E_BADID = H5E_BADID();
+ /** Minor error codes - File accessibility errors - Bad file ID accessed */
public static final long H5E_BADFILE = H5E_BADFILE();
+ /** Minor error codes - Object ID related errors - Unable to find ID group information */
public static final long H5E_BADGROUP = H5E_BADGROUP();
+ /** Minor error codes - Object header related errors - Iteration failed */
+ public static final long H5E_BADITER = H5E_BADITER();
+ /** Minor error codes - Object header related errors - Unrecognized message */
public static final long H5E_BADMESG = H5E_BADMESG();
+ /** Minor error codes - Argument errors - Out of range */
public static final long H5E_BADRANGE = H5E_BADRANGE();
+ /** Minor error codes - Dataspace errors - Invalid selection */
public static final long H5E_BADSELECT = H5E_BADSELECT();
+ /** Datatype conversion errors - Bad size for object */
public static final long H5E_BADSIZE = H5E_BADSIZE();
+ /** Minor error codes - Argument errors - Inappropriate type */
public static final long H5E_BADTYPE = H5E_BADTYPE();
+ /** Minor error codes - Argument errors - Bad value */
public static final long H5E_BADVALUE = H5E_BADVALUE();
+ /** Major error codes - B-Tree node */
public static final long H5E_BTREE = H5E_BTREE();
+ /** Major error codes - Object cache */
public static final long H5E_CACHE = H5E_CACHE();
+ /** I/O pipeline errors - Callback failed */
public static final long H5E_CALLBACK = H5E_CALLBACK();
+ /** I/O pipeline errors - Error from filter 'can apply' callback */
public static final long H5E_CANAPPLY = H5E_CANAPPLY();
- // public static final long H5E_CANTALLOC = H5E_CANTALLOC();
+ /** Minor error codes - Resource errors - Can't allocate space */
+ public static final long H5E_CANTALLOC = H5E_CANTALLOC();
+ /** Minor error codes - Dataspace errors - Can't append object */
+ public static final long H5E_CANTAPPEND = H5E_CANTAPPEND();
+ /** Minor error codes - Heap errors - Can't attach object */
+ public static final long H5E_CANTATTACH = H5E_CANTATTACH();
+ /** Minor error codes - Cache related errors - Unable to mark metadata as clean */
+ public static final long H5E_CANTCLEAN = H5E_CANTCLEAN();
+ /** Minor error codes - Dataspace errors - Can't clip hyperslab region */
public static final long H5E_CANTCLIP = H5E_CANTCLIP();
+ /** Minor error codes - File accessibility errors - Unable to close file */
public static final long H5E_CANTCLOSEFILE = H5E_CANTCLOSEFILE();
+ /** Minor error codes - Group related errors - Can't close object */
+ public static final long H5E_CANTCLOSEOBJ = H5E_CANTCLOSEOBJ();
+ /** Minor error codes - Dataspace errors - Can't compare objects */
+ public static final long H5E_CANTCOMPARE = H5E_CANTCOMPARE();
+ /** Minor error codes - Heap errors - Can't compute value */
+ public static final long H5E_CANTCOMPUTE = H5E_CANTCOMPUTE();
+ /** Datatype conversion errors - Can't convert datatypes */
public static final long H5E_CANTCONVERT = H5E_CANTCONVERT();
+ /** Minor error codes - Resource errors - Unable to copy object */
public static final long H5E_CANTCOPY = H5E_CANTCOPY();
+ /** Minor error codes - Cache related errors - Unable to cork an object */
+ public static final long H5E_CANTCORK = H5E_CANTCORK();
+ /** Minor error codes - Dataspace errors - Can't count elements */
public static final long H5E_CANTCOUNT = H5E_CANTCOUNT();
+ /** Minor error codes - File accessibility errors - Unable to create file */
public static final long H5E_CANTCREATE = H5E_CANTCREATE();
+ /** Minor error codes - Object ID related errors - Unable to decrement reference count */
public static final long H5E_CANTDEC = H5E_CANTDEC();
+ /** Minor error codes - B-tree related errors - Unable to decode value */
public static final long H5E_CANTDECODE = H5E_CANTDECODE();
+ /** Minor error codes - Object header related errors - Can't delete message */
public static final long H5E_CANTDELETE = H5E_CANTDELETE();
+ /** Minor error codes - File accessibility errors - Unable to delete file */
public static final long H5E_CANTDELETEFILE = H5E_CANTDELETEFILE();
+ /** Minor error codes - Cache related errors - Unable to create a flush dependency */
+ public static final long H5E_CANTDEPEND = H5E_CANTDEPEND();
+ /** Minor error codes - Cache related errors - Unable to mark metadata as dirty */
+ public static final long H5E_CANTDIRTY = H5E_CANTDIRTY();
+ /** Minor error codes - B-tree related errors - Unable to encode value */
public static final long H5E_CANTENCODE = H5E_CANTENCODE();
+ /** Minor error codes - Cache related errors - Unable to expunge a metadata cache entry */
+ public static final long H5E_CANTEXPUNGE = H5E_CANTEXPUNGE();
+ /** Minor error codes - Heap errors - Can't extend heap's space */
+ public static final long H5E_CANTEXTEND = H5E_CANTEXTEND();
+ /** I/O pipeline errors - Filter operation failed */
+ public static final long H5E_CANTFILTER = H5E_CANTFILTER();
+ /** Minor error codes - Cache related errors - Unable to flush data from cache */
public static final long H5E_CANTFLUSH = H5E_CANTFLUSH();
+ /** Minor error codes - Resource errors - Unable to free object */
public static final long H5E_CANTFREE = H5E_CANTFREE();
+ /** Minor error codes - Parallel MPI - Can't gather data */
+ public static final long H5E_CANTGATHER = H5E_CANTGATHER();
+ /** Minor error codes - Resource errors - Unable to garbage collect */
+ public static final long H5E_CANTGC = H5E_CANTGC();
+ /** Minor error codes - Property list errors - Can't get value */
public static final long H5E_CANTGET = H5E_CANTGET();
+ /** Minor error codes - Resource errors - Unable to compute size */
+ public static final long H5E_CANTGETSIZE = H5E_CANTGETSIZE();
+ /** Minor error codes - Object ID related errors - Unable to increment reference count */
public static final long H5E_CANTINC = H5E_CANTINC();
+ /** Minor error codes - Function entry/exit interface - Unable to initialize object */
public static final long H5E_CANTINIT = H5E_CANTINIT();
+ /** Minor error codes - Cache related errors - Unable to insert metadata into cache */
+ public static final long H5E_CANTINS = H5E_CANTINS();
+ /** Minor error codes - B-tree related errors - Unable to insert object */
public static final long H5E_CANTINSERT = H5E_CANTINSERT();
+ /** Minor error codes - B-tree related errors - Unable to list node */
public static final long H5E_CANTLIST = H5E_CANTLIST();
+ /** Minor error codes - Cache related errors - Unable to load metadata into cache */
public static final long H5E_CANTLOAD = H5E_CANTLOAD();
+ /** Minor error codes - Resource errors - Unable to lock object */
public static final long H5E_CANTLOCK = H5E_CANTLOCK();
+ /** Minor error codes - File accessibility errors Unable to lock file */
+ public static final long H5E_CANTLOCKFILE = H5E_CANTLOCKFILE();
+ /** Minor error codes - Cache related errors - Unable to mark a pinned entry as clean */
+ public static final long H5E_CANTMARKCLEAN = H5E_CANTMARKCLEAN();
+ /** Minor error codes - Cache related errors - Unable to mark a pinned entry as dirty */
+ public static final long H5E_CANTMARKDIRTY = H5E_CANTMARKDIRTY();
+ /** Minor error codes - Cache related errors - Unable to mark an entry as unserialized */
+ public static final long H5E_CANTMARKSERIALIZED = H5E_CANTMARKSERIALIZED();
+ /** Minor error codes - Cache related errors - Unable to mark an entry as serialized */
+ public static final long H5E_CANTMARKUNSERIALIZED = H5E_CANTMARKUNSERIALIZED();
+ /** Minor error codes - Free space errors - Can't merge objects */
+ public static final long H5E_CANTMERGE = H5E_CANTMERGE();
+ /** Minor error codes - B-tree related errors - Unable to modify record */
+ public static final long H5E_CANTMODIFY = H5E_CANTMODIFY();
+ /** Minor error codes - Link related errors - Can't move object */
+ public static final long H5E_CANTMOVE = H5E_CANTMOVE();
+ /** Minor error codes - Dataspace errors - Can't move to next iterator location */
public static final long H5E_CANTNEXT = H5E_CANTNEXT();
+ /** Minor error codes - Cache related errors - Unable to notify object about action */
+ public static final long H5E_CANTNOTIFY = H5E_CANTNOTIFY();
+ /** Minor error codes - File accessibility errors - Unable to open file */
public static final long H5E_CANTOPENFILE = H5E_CANTOPENFILE();
+ /** Minor error codes - Group related errors - Can't open object */
public static final long H5E_CANTOPENOBJ = H5E_CANTOPENOBJ();
- // public static final long H5E_CANTRECV = H5E_CANTRECV();
+ /** Minor error codes - Heap errors - Can't operate on object */
+ public static final long H5E_CANTOPERATE = H5E_CANTOPERATE();
+ /** Minor error codes - Object header related errors - Can't pack messages */
+ public static final long H5E_CANTPACK = H5E_CANTPACK();
+ /** Minor error codes - Cache related errors - Unable to pin cache entry */
+ public static final long H5E_CANTPIN = H5E_CANTPIN();
+ /** Minor error codes - Cache related errors - Unable to protect metadata */
+ public static final long H5E_CANTPROTECT = H5E_CANTPROTECT();
+ /** Minor error codes - Parallel MPI - Can't receive data */
+ public static final long H5E_CANTRECV = H5E_CANTRECV();
+ /** Minor error codes - B-tree related errors - Unable to redistribute records */
+ public static final long H5E_CANTREDISTRIBUTE = H5E_CANTREDISTRIBUTE();
+ /** Minor error codes - Object ID related errors - Unable to register new ID */
public static final long H5E_CANTREGISTER = H5E_CANTREGISTER();
+ /** Minor error codes - Function entry/exit interface - Unable to release object */
public static final long H5E_CANTRELEASE = H5E_CANTRELEASE();
+ /** Minor error codes - B-tree related errors - Unable to remove object */
+ public static final long H5E_CANTREMOVE = H5E_CANTREMOVE();
+ /** Minor error codes - Object header related errors - Unable to rename object */
+ public static final long H5E_CANTRENAME = H5E_CANTRENAME();
+ /** Minor error codes - Object header related errors - Can't reset object */
+ public static final long H5E_CANTRESET = H5E_CANTRESET();
+ /** Minor error codes - Cache related errors - Unable to resize a metadata cache entry */
+ public static final long H5E_CANTRESIZE = H5E_CANTRESIZE();
+ /** Minor error codes - Heap errors - Can't restore condition */
+ public static final long H5E_CANTRESTORE = H5E_CANTRESTORE();
+ /** Minor error codes - Free space errors - Can't revive object */
+ public static final long H5E_CANTREVIVE = H5E_CANTREVIVE();
+ /** Minor error codes - Free space errors - Can't shrink container */
+ public static final long H5E_CANTSHRINK = H5E_CANTSHRINK();
+ /** Minor error codes - Dataspace errors - Can't select hyperslab */
public static final long H5E_CANTSELECT = H5E_CANTSELECT();
+ /** Minor error codes - Cache related errors - Unable to serialize data from cache */
+ public static final long H5E_CANTSERIALIZE = H5E_CANTSERIALIZE();
+ /** Minor error codes - Property list errors - Can't set value */
public static final long H5E_CANTSET = H5E_CANTSET();
+ /** Minor error codes - Link related errors - Can't sort objects */
+ public static final long H5E_CANTSORT = H5E_CANTSORT();
+ /** Minor error codes - B-tree related errors - Unable to split node */
public static final long H5E_CANTSPLIT = H5E_CANTSPLIT();
+ /** Minor error codes - B-tree related errors - Unable to swap records */
+ public static final long H5E_CANTSWAP = H5E_CANTSWAP();
+ /** Minor error codes - Cache related errors - Unable to tag metadata in the cache */
+ public static final long H5E_CANTTAG = H5E_CANTTAG();
+ /** Minor error codes - Cache related errors - Unable to uncork an object */
+ public static final long H5E_CANTUNCORK = H5E_CANTUNCORK();
+ /** Minor error codes - Cache related errors - Unable to destroy a flush dependency */
+ public static final long H5E_CANTUNDEPEND = H5E_CANTUNDEPEND();
+ /** Minor error codes - Resource errors - Unable to unlock object */
public static final long H5E_CANTUNLOCK = H5E_CANTUNLOCK();
+ /** Minor error codes - File accessibility errors Unable to unlock file */
+ public static final long H5E_CANTUNLOCKFILE = H5E_CANTUNLOCKFILE();
+ /** Minor error codes - Cache related errors - Unable to un-pin cache entry */
+ public static final long H5E_CANTUNPIN = H5E_CANTUNPIN();
+ /** Minor error codes - Cache related errors - Unable to unprotect metadata */
+ public static final long H5E_CANTUNPROTECT = H5E_CANTUNPROTECT();
+ /** Minor error codes - Cache related errors - Unable to mark metadata as unserialized */
+ public static final long H5E_CANTUNSERIALIZE = H5E_CANTUNSERIALIZE();
+ /** Minor error codes - Heap errors - Can't update object */
+ public static final long H5E_CANTUPDATE = H5E_CANTUPDATE();
+ /** Generic low-level file I/O errors - Close failed */
public static final long H5E_CLOSEERROR = H5E_CLOSEERROR();
+ /** Minor error codes - Group related errors - Name component is too long */
public static final long H5E_COMPLEN = H5E_COMPLEN();
+ /** Major error codes - API Context */
+ public static final long H5E_CONTEXT = H5E_CONTEXT();
+ /** Major error codes - Dataset */
public static final long H5E_DATASET = H5E_DATASET();
+ /** Major error codes - Dataspace */
public static final long H5E_DATASPACE = H5E_DATASPACE();
+ /** Major error codes - Datatype */
public static final long H5E_DATATYPE = H5E_DATATYPE();
+ /** Value for the default error stack */
public static final long H5E_DEFAULT = H5E_DEFAULT();
+ /** Minor error codes - Property list errors - Duplicate class name in parent class */
public static final long H5E_DUPCLASS = H5E_DUPCLASS();
+ /** Major error codes - Extensible Array */
+ public static final long H5E_EARRAY = H5E_EARRAY();
+ /** Major error codes - External file list */
public static final long H5E_EFL = H5E_EFL();
+ /** Major error codes - Error API */
+ public static final long H5E_ERROR = H5E_ERROR();
+ /** Minor error codes - B-tree related errors - Object already exists */
public static final long H5E_EXISTS = H5E_EXISTS();
+ /** Major error codes - Fixed Array */
+ public static final long H5E_FARRAY = H5E_FARRAY();
+ /** Generic low-level file I/O errors - File control (fcntl) failed */
public static final long H5E_FCNTL = H5E_FCNTL();
+ /** Major error codes - File accessibility */
public static final long H5E_FILE = H5E_FILE();
+ /** Minor error codes - File accessibility errors - File already exists */
public static final long H5E_FILEEXISTS = H5E_FILEEXISTS();
+ /** Minor error codes - File accessibility errors - File already open */
public static final long H5E_FILEOPEN = H5E_FILEOPEN();
+ /** Major error codes - Free Space Manager */
+ public static final long H5E_FSPACE = H5E_FSPACE();
+ /** Major error codes - Function entry/exit */
public static final long H5E_FUNC = H5E_FUNC();
+ /** Major error codes - Heap */
public static final long H5E_HEAP = H5E_HEAP();
+ /** Minor error codes - Dataspace errors - Internal states are inconsistent */
+ public static final long H5E_INCONSISTENTSTATE = H5E_INCONSISTENTSTATE();
+ /** Major error codes - Internal error (too specific to document in detail) */
public static final long H5E_INTERNAL = H5E_INTERNAL();
+ /** Major error codes - Low-level I/O */
public static final long H5E_IO = H5E_IO();
+ /** Major error codes - Links */
public static final long H5E_LINK = H5E_LINK();
+ /** Minor error codes - Object header related errors - Bad object header link count */
public static final long H5E_LINKCOUNT = H5E_LINKCOUNT();
+ /** Minor error codes - Cache related errors - Failure in the cache logging framework */
+ public static final long H5E_LOGGING = H5E_LOGGING();
+ /** Major error codes - Map */
+ public static final long H5E_MAP = H5E_MAP();
+ /** Minor error codes - File accessibility errors - File mount error */
public static final long H5E_MOUNT = H5E_MOUNT();
+ /** Minor error codes - Parallel MPI - Some MPI function failed */
public static final long H5E_MPI = H5E_MPI();
+ /** Minor error codes - Parallel MPI - MPI Error String */
public static final long H5E_MPIERRSTR = H5E_MPIERRSTR();
+ /** Minor error codes - Link related errors - Too many soft links in path */
+ public static final long H5E_NLINKS = H5E_NLINKS();
+ /** Minor error codes - Parallel MPI - Can't perform independent IO */
+ public static final long H5E_NO_INDEPENDENT = H5E_NO_INDEPENDENT();
+ /** I/O pipeline errors - Filter present but encoding disabled */
+ public static final long H5E_NOENCODER = H5E_NOENCODER();
+ /** I/O pipeline errors - Requested filter is not available */
public static final long H5E_NOFILTER = H5E_NOFILTER();
+ /** Minor error codes - Object ID related errors - Out of IDs for group */
public static final long H5E_NOIDS = H5E_NOIDS();
+ /** Major error codes - No error */
public static final long H5E_NONE_MAJOR = H5E_NONE_MAJOR();
+ /** No error */
public static final long H5E_NONE_MINOR = H5E_NONE_MINOR();
+ /** Minor error codes - Resource errors - No space available for allocation */
public static final long H5E_NOSPACE = H5E_NOSPACE();
+ /** Minor error codes - Cache related errors - Metadata not currently cached */
public static final long H5E_NOTCACHED = H5E_NOTCACHED();
+ /** Minor error codes - B-tree related errors - Object not found */
public static final long H5E_NOTFOUND = H5E_NOTFOUND();
+ /** Minor error codes - File accessibility errors - Not an HDF5 file */
public static final long H5E_NOTHDF5 = H5E_NOTHDF5();
+ /** Minor error codes - Link related errors - Link class not registered */
+ public static final long H5E_NOTREGISTERED = H5E_NOTREGISTERED();
+ /** Minor error codes - Resource errors - Object is already open */
+ public static final long H5E_OBJOPEN = H5E_OBJOPEN();
+ /** Major error codes - Object header */
public static final long H5E_OHDR = H5E_OHDR();
+ /** Minor error codes - Plugin errors - Can't open directory or file */
+ public static final long H5E_OPENERROR = H5E_OPENERROR();
+ /** Generic low-level file I/O errors - Address overflowed */
public static final long H5E_OVERFLOW = H5E_OVERFLOW();
+ /** Major error codes - Page Buffering */
+ public static final long H5E_PAGEBUF = H5E_PAGEBUF();
+ /** Minor error codes - Group related errors - Problem with path to object */
+ public static final long H5E_PATH = H5E_PATH();
+ /** Major error codes - Data filters */
public static final long H5E_PLINE = H5E_PLINE();
+ /** Major error codes - Property lists */
public static final long H5E_PLIST = H5E_PLIST();
+ /** Major error codes - Plugin for dynamically loaded library */
+ public static final long H5E_PLUGIN = H5E_PLUGIN();
+ /** Minor error codes - Cache related errors - Protected metadata error */
public static final long H5E_PROTECT = H5E_PROTECT();
+ /** Generic low-level file I/O errors - Read failed */
public static final long H5E_READERROR = H5E_READERROR();
+ /** Major error codes - References */
public static final long H5E_REFERENCE = H5E_REFERENCE();
+ /** Major error codes - Resource unavailable */
public static final long H5E_RESOURCE = H5E_RESOURCE();
+ /** Major error codes - Reference Counted Strings */
public static final long H5E_RS = H5E_RS();
+ /** Generic low-level file I/O errors - Seek failed */
public static final long H5E_SEEKERROR = H5E_SEEKERROR();
+ /** Minor error codes - Property list errors - Disallowed operation */
+ public static final long H5E_SETDISALLOWED = H5E_SETDISALLOWED();
+ /** I/O pipeline errors - Error from filter 'set local' callback */
public static final long H5E_SETLOCAL = H5E_SETLOCAL();
+ /** Major error codes - Skip Lists */
+ public static final long H5E_SLIST = H5E_SLIST();
+ /** Major error codes - Shared Object Header Messages */
+ public static final long H5E_SOHM = H5E_SOHM();
+ /** Major error codes - Data storage */
public static final long H5E_STORAGE = H5E_STORAGE();
+ /** Major error codes - Symbol table */
public static final long H5E_SYM = H5E_SYM();
+ /** Minor error codes - System level errors - System error message */
+ public static final long H5E_SYSERRSTR = H5E_SYSERRSTR();
+ /** Minor error codes - Cache related errors - Internal error detected */
+ public static final long H5E_SYSTEM = H5E_SYSTEM();
+ /** Minor error codes - Link related errors - Link traversal failure */
+ public static final long H5E_TRAVERSE = H5E_TRAVERSE();
+ /** Minor error codes - File accessibility errors - File has been truncated */
public static final long H5E_TRUNCATED = H5E_TRUNCATED();
+ /** Major error codes - Ternary Search Trees */
public static final long H5E_TST = H5E_TST();
+ /** Minor error codes - Argument errors - Information is uinitialized */
public static final long H5E_UNINITIALIZED = H5E_UNINITIALIZED();
+ /** Minor error codes - Argument errors - Feature is unsupported */
public static final long H5E_UNSUPPORTED = H5E_UNSUPPORTED();
+ /** Minor error codes - Object header related errors - Wrong version number */
public static final long H5E_VERSION = H5E_VERSION();
+ /** Major error codes - Virtual File Layer */
public static final long H5E_VFL = H5E_VFL();
+ /** Major error codes - Virtual Object Layer */
public static final long H5E_VOL = H5E_VOL();
+ /** Error stack traversal direction - begin at API function, end deep */
public static final long H5E_WALK_DOWNWARD = H5E_WALK_DOWNWARD();
+ /** Error stack traversal direction - begin deep, end at API function */
public static final long H5E_WALK_UPWARD = H5E_WALK_UPWARD();
+ /** Generic low-level file I/O errors - Write failed */
public static final long H5E_WRITEERROR = H5E_WRITEERROR();
+ /** */
private static final int H5ES_STATUS_IN_PROGRESS = H5ES_STATUS_IN_PROGRESS();
+ /** */
private static final int H5ES_STATUS_SUCCEED = H5ES_STATUS_SUCCEED();
+ /** */
private static final int H5ES_STATUS_FAIL = H5ES_STATUS_FAIL();
- private static final int H5ES_STATUS_CANCELED = H5ES_STATUS_CANCELED();
+ /** */
public static final int H5F_ACC_CREAT = H5F_ACC_CREAT();
+ /** */
public static final int H5F_ACC_EXCL = H5F_ACC_EXCL();
+ /** */
public static final int H5F_ACC_RDONLY = H5F_ACC_RDONLY();
+ /** */
public static final int H5F_ACC_RDWR = H5F_ACC_RDWR();
+ /** */
public static final int H5F_ACC_TRUNC = H5F_ACC_TRUNC();
+ /** */
public static final int H5F_ACC_DEFAULT = H5F_ACC_DEFAULT();
+ /** */
public static final int H5F_ACC_SWMR_READ = H5F_ACC_SWMR_READ();
+ /** */
public static final int H5F_ACC_SWMR_WRITE = H5F_ACC_SWMR_WRITE();
+ /** */
public static final int H5F_CLOSE_DEFAULT = H5F_CLOSE_DEFAULT();
+ /** */
public static final int H5F_CLOSE_SEMI = H5F_CLOSE_SEMI();
+ /** */
public static final int H5F_CLOSE_STRONG = H5F_CLOSE_STRONG();
+ /** */
public static final int H5F_CLOSE_WEAK = H5F_CLOSE_WEAK();
+ /** */
public static final int H5F_LIBVER_ERROR = H5F_LIBVER_ERROR();
+ /** */
public static final int H5F_LIBVER_EARLIEST = H5F_LIBVER_EARLIEST();
+ /** */
public static final int H5F_LIBVER_V18 = H5F_LIBVER_V18();
+ /** */
public static final int H5F_LIBVER_V110 = H5F_LIBVER_V110();
+ /** */
public static final int H5F_LIBVER_V112 = H5F_LIBVER_V112();
+ /** */
public static final int H5F_LIBVER_V114 = H5F_LIBVER_V114();
+ /** */
public static final int H5F_LIBVER_NBOUNDS = H5F_LIBVER_NBOUNDS();
+ /** */
public static final int H5F_LIBVER_LATEST = H5F_LIBVER_LATEST();
+ /** */
public static final int H5F_OBJ_ALL = H5F_OBJ_ALL();
+ /** */
public static final int H5F_OBJ_ATTR = H5F_OBJ_ATTR();
+ /** */
public static final int H5F_OBJ_DATASET = H5F_OBJ_DATASET();
+ /** */
public static final int H5F_OBJ_DATATYPE = H5F_OBJ_DATATYPE();
+ /** */
public static final int H5F_OBJ_FILE = H5F_OBJ_FILE();
+ /** */
public static final int H5F_OBJ_GROUP = H5F_OBJ_GROUP();
+ /** */
public static final int H5F_OBJ_LOCAL = H5F_OBJ_LOCAL();
+ /** */
public static final int H5F_SCOPE_GLOBAL = H5F_SCOPE_GLOBAL();
+ /** */
public static final int H5F_SCOPE_LOCAL = H5F_SCOPE_LOCAL();
+ /** */
public static final int H5F_UNLIMITED = H5F_UNLIMITED();
+ /** */
public static final int H5F_FSPACE_STRATEGY_FSM_AGGR = H5F_FSPACE_STRATEGY_FSM_AGGR();
+ /** */
public static final int H5F_FSPACE_STRATEGY_AGGR = H5F_FSPACE_STRATEGY_AGGR();
+ /** */
public static final int H5F_FSPACE_STRATEGY_PAGE = H5F_FSPACE_STRATEGY_PAGE();
+ /** */
public static final int H5F_FSPACE_STRATEGY_NONE = H5F_FSPACE_STRATEGY_NONE();
+ /** */
public static final int H5F_FSPACE_STRATEGY_NTYPES = H5F_FSPACE_STRATEGY_NTYPES();
+ /** */
public static final long H5FD_CORE = H5FD_CORE();
+ /** */
public static final long H5FD_DIRECT = H5FD_DIRECT();
+ /** */
public static final long H5FD_FAMILY = H5FD_FAMILY();
+ /** */
public static final long H5FD_LOG = H5FD_LOG();
+ /** */
public static final long H5FD_MPIO = H5FD_MPIO();
+ /** */
public static final long H5FD_MULTI = H5FD_MULTI();
+ /** */
public static final long H5FD_SEC2 = H5FD_SEC2();
+ /** */
public static final long H5FD_STDIO = H5FD_STDIO();
+ /** */
public static final long H5FD_WINDOWS = H5FD_WINDOWS();
+ /** */
public static final long H5FD_ROS3 = H5FD_ROS3();
+ /** */
public static final long H5FD_HDFS = H5FD_HDFS();
+ /** */
public static final int H5FD_LOG_LOC_READ = H5FD_LOG_LOC_READ();
+ /** */
public static final int H5FD_LOG_LOC_WRITE = H5FD_LOG_LOC_WRITE();
+ /** */
public static final int H5FD_LOG_LOC_SEEK = H5FD_LOG_LOC_SEEK();
+ /** */
public static final int H5FD_LOG_LOC_IO = H5FD_LOG_LOC_IO();
+ /** */
public static final int H5FD_LOG_FILE_READ = H5FD_LOG_FILE_READ();
+ /** */
public static final int H5FD_LOG_FILE_WRITE = H5FD_LOG_FILE_WRITE();
+ /** */
public static final int H5FD_LOG_FILE_IO = H5FD_LOG_FILE_IO();
+ /** */
public static final int H5FD_LOG_FLAVOR = H5FD_LOG_FLAVOR();
+ /** */
public static final int H5FD_LOG_NUM_READ = H5FD_LOG_NUM_READ();
+ /** */
public static final int H5FD_LOG_NUM_WRITE = H5FD_LOG_NUM_WRITE();
+ /** */
public static final int H5FD_LOG_NUM_SEEK = H5FD_LOG_NUM_SEEK();
+ /** */
public static final int H5FD_LOG_NUM_TRUNCATE = H5FD_LOG_NUM_TRUNCATE();
+ /** */
public static final int H5FD_LOG_NUM_IO = H5FD_LOG_NUM_IO();
+ /** */
public static final int H5FD_LOG_TIME_OPEN = H5FD_LOG_TIME_OPEN();
+ /** */
public static final int H5FD_LOG_TIME_STAT = H5FD_LOG_TIME_STAT();
+ /** */
public static final int H5FD_LOG_TIME_READ = H5FD_LOG_TIME_READ();
+ /** */
public static final int H5FD_LOG_TIME_WRITE = H5FD_LOG_TIME_WRITE();
+ /** */
public static final int H5FD_LOG_TIME_SEEK = H5FD_LOG_TIME_SEEK();
+ /** */
public static final int H5FD_LOG_TIME_CLOSE = H5FD_LOG_TIME_CLOSE();
+ /** */
public static final int H5FD_LOG_TIME_IO = H5FD_LOG_TIME_IO();
+ /** */
public static final int H5FD_LOG_ALLOC = H5FD_LOG_ALLOC();
+ /** */
public static final int H5FD_LOG_ALL = H5FD_LOG_ALL();
+ /** */
public static final int H5FD_MEM_NOLIST = H5FD_MEM_NOLIST();
+ /** */
public static final int H5FD_MEM_DEFAULT = H5FD_MEM_DEFAULT();
+ /** */
public static final int H5FD_MEM_SUPER = H5FD_MEM_SUPER();
+ /** */
public static final int H5FD_MEM_BTREE = H5FD_MEM_BTREE();
+ /** */
public static final int H5FD_MEM_DRAW = H5FD_MEM_DRAW();
+ /** */
public static final int H5FD_MEM_GHEAP = H5FD_MEM_GHEAP();
+ /** */
public static final int H5FD_MEM_LHEAP = H5FD_MEM_LHEAP();
+ /** */
public static final int H5FD_MEM_OHDR = H5FD_MEM_OHDR();
+ /** */
public static final int H5FD_MEM_NTYPES = H5FD_MEM_NTYPES();
+ /** */
public static final long H5FD_DEFAULT_HADDR_SIZE = H5FD_DEFAULT_HADDR_SIZE();
+ /** */
public static final long H5FD_MEM_DEFAULT_SIZE = H5FD_MEM_DEFAULT_SIZE();
+ /** */
public static final long H5FD_MEM_DEFAULT_SUPER_SIZE = H5FD_MEM_DEFAULT_SUPER_SIZE();
+ /** */
public static final long H5FD_MEM_DEFAULT_BTREE_SIZE = H5FD_MEM_DEFAULT_BTREE_SIZE();
+ /** */
public static final long H5FD_MEM_DEFAULT_DRAW_SIZE = H5FD_MEM_DEFAULT_DRAW_SIZE();
+ /** */
public static final long H5FD_MEM_DEFAULT_GHEAP_SIZE = H5FD_MEM_DEFAULT_GHEAP_SIZE();
+ /** */
public static final long H5FD_MEM_DEFAULT_LHEAP_SIZE = H5FD_MEM_DEFAULT_LHEAP_SIZE();
+ /** */
public static final long H5FD_MEM_DEFAULT_OHDR_SIZE = H5FD_MEM_DEFAULT_OHDR_SIZE();
// public static final int H5G_DATASET = H5G_DATASET();
@@ -308,405 +698,802 @@ public class HDF5Constants {
// public static final int H5G_TYPE = H5G_TYPE();
// public static final int H5G_UNKNOWN = H5G_UNKNOWN();
+ /** */
public static final int H5G_STORAGE_TYPE_UNKNOWN = H5G_STORAGE_TYPE_UNKNOWN();
+ /** */
public static final int H5G_STORAGE_TYPE_SYMBOL_TABLE = H5G_STORAGE_TYPE_SYMBOL_TABLE();
+ /** */
public static final int H5G_STORAGE_TYPE_COMPACT = H5G_STORAGE_TYPE_COMPACT();
+ /** */
public static final int H5G_STORAGE_TYPE_DENSE = H5G_STORAGE_TYPE_DENSE();
+ /** */
public static final int H5I_ATTR = H5I_ATTR();
+ /** */
public static final int H5I_BADID = H5I_BADID();
+ /** */
public static final int H5I_DATASET = H5I_DATASET();
+ /** */
public static final int H5I_DATASPACE = H5I_DATASPACE();
+ /** */
public static final int H5I_DATATYPE = H5I_DATATYPE();
+ /** */
public static final int H5I_ERROR_CLASS = H5I_ERROR_CLASS();
+ /** */
public static final int H5I_ERROR_MSG = H5I_ERROR_MSG();
+ /** */
public static final int H5I_ERROR_STACK = H5I_ERROR_STACK();
+ /** */
public static final int H5I_FILE = H5I_FILE();
+ /** */
public static final int H5I_GENPROP_CLS = H5I_GENPROP_CLS();
+ /** */
public static final int H5I_GENPROP_LST = H5I_GENPROP_LST();
+ /** */
public static final int H5I_GROUP = H5I_GROUP();
+ /** */
public static final int H5I_INVALID_HID = H5I_INVALID_HID();
+ /** */
public static final int H5I_NTYPES = H5I_NTYPES();
+ /** */
public static final int H5I_UNINIT = H5I_UNINIT();
+ /** */
public static final int H5I_VFL = H5I_VFL();
+ /** */
public static final int H5I_VOL = H5I_VOL();
+ /** */
public static final int H5L_TYPE_ERROR = H5L_TYPE_ERROR();
+ /** */
public static final int H5L_TYPE_HARD = H5L_TYPE_HARD();
+ /** */
public static final int H5L_TYPE_SOFT = H5L_TYPE_SOFT();
+ /** */
public static final int H5L_TYPE_EXTERNAL = H5L_TYPE_EXTERNAL();
+ /** */
public static final int H5L_TYPE_MAX = H5L_TYPE_MAX();
+ /** */
public static final int H5O_COPY_SHALLOW_HIERARCHY_FLAG = H5O_COPY_SHALLOW_HIERARCHY_FLAG();
+ /** */
public static final int H5O_COPY_EXPAND_SOFT_LINK_FLAG = H5O_COPY_EXPAND_SOFT_LINK_FLAG();
+ /** */
public static final int H5O_COPY_EXPAND_EXT_LINK_FLAG = H5O_COPY_EXPAND_EXT_LINK_FLAG();
+ /** */
public static final int H5O_COPY_EXPAND_REFERENCE_FLAG = H5O_COPY_EXPAND_REFERENCE_FLAG();
+ /** */
public static final int H5O_COPY_WITHOUT_ATTR_FLAG = H5O_COPY_WITHOUT_ATTR_FLAG();
+ /** */
public static final int H5O_COPY_PRESERVE_NULL_FLAG = H5O_COPY_PRESERVE_NULL_FLAG();
+ /** */
public static final int H5O_INFO_BASIC = H5O_INFO_BASIC();
+ /** */
public static final int H5O_INFO_TIME = H5O_INFO_TIME();
+ /** */
public static final int H5O_INFO_NUM_ATTRS = H5O_INFO_NUM_ATTRS();
+ /** */
public static final int H5O_INFO_ALL = H5O_INFO_ALL();
+ /** */
public static final int H5O_NATIVE_INFO_HDR = H5O_NATIVE_INFO_HDR();
+ /** */
public static final int H5O_NATIVE_INFO_META_SIZE = H5O_NATIVE_INFO_META_SIZE();
+ /** */
public static final int H5O_NATIVE_INFO_ALL = H5O_NATIVE_INFO_ALL();
+ /** */
public static final int H5O_SHMESG_NONE_FLAG = H5O_SHMESG_NONE_FLAG();
+ /** */
public static final int H5O_SHMESG_SDSPACE_FLAG = H5O_SHMESG_SDSPACE_FLAG();
+ /** */
public static final int H5O_SHMESG_DTYPE_FLAG = H5O_SHMESG_DTYPE_FLAG();
+ /** */
public static final int H5O_SHMESG_FILL_FLAG = H5O_SHMESG_FILL_FLAG();
+ /** */
public static final int H5O_SHMESG_PLINE_FLAG = H5O_SHMESG_PLINE_FLAG();
+ /** */
public static final int H5O_SHMESG_ATTR_FLAG = H5O_SHMESG_ATTR_FLAG();
+ /** */
public static final int H5O_SHMESG_ALL_FLAG = H5O_SHMESG_ALL_FLAG();
+ /** */
public static final int H5O_TYPE_UNKNOWN = H5O_TYPE_UNKNOWN();
+ /** */
public static final int H5O_TYPE_GROUP = H5O_TYPE_GROUP();
+ /** */
public static final int H5O_TYPE_DATASET = H5O_TYPE_DATASET();
+ /** */
public static final int H5O_TYPE_NAMED_DATATYPE = H5O_TYPE_NAMED_DATATYPE();
+ /** */
public static final int H5O_TYPE_NTYPES = H5O_TYPE_NTYPES();
+ /** */
public static final int H5O_MAX_TOKEN_SIZE = H5O_MAX_TOKEN_SIZE();
+ /** */
public static final H5O_token_t H5O_TOKEN_UNDEF = H5O_TOKEN_UNDEF();
+ /** */
public static final long H5P_ROOT = H5P_ROOT();
+ /** */
public static final long H5P_OBJECT_CREATE = H5P_OBJECT_CREATE();
+ /** */
public static final long H5P_FILE_CREATE = H5P_FILE_CREATE();
+ /** */
public static final long H5P_FILE_ACCESS = H5P_FILE_ACCESS();
+ /** */
public static final long H5P_DATASET_CREATE = H5P_DATASET_CREATE();
+ /** */
public static final long H5P_DATASET_ACCESS = H5P_DATASET_ACCESS();
+ /** */
public static final long H5P_DATASET_XFER = H5P_DATASET_XFER();
+ /** */
public static final long H5P_FILE_MOUNT = H5P_FILE_MOUNT();
+ /** */
public static final long H5P_GROUP_CREATE = H5P_GROUP_CREATE();
+ /** */
public static final long H5P_GROUP_ACCESS = H5P_GROUP_ACCESS();
+ /** */
public static final long H5P_DATATYPE_CREATE = H5P_DATATYPE_CREATE();
+ /** */
public static final long H5P_DATATYPE_ACCESS = H5P_DATATYPE_ACCESS();
+ /** */
public static final long H5P_STRING_CREATE = H5P_STRING_CREATE();
+ /** */
public static final long H5P_ATTRIBUTE_CREATE = H5P_ATTRIBUTE_CREATE();
+ /** */
public static final long H5P_ATTRIBUTE_ACCESS = H5P_ATTRIBUTE_ACCESS();
+ /** */
public static final long H5P_OBJECT_COPY = H5P_OBJECT_COPY();
+ /** */
public static final long H5P_LINK_CREATE = H5P_LINK_CREATE();
+ /** */
public static final long H5P_LINK_ACCESS = H5P_LINK_ACCESS();
+ /** */
public static final long H5P_VOL_INITIALIZE = H5P_VOL_INITIALIZE();
+ /** */
public static final long H5P_FILE_CREATE_DEFAULT = H5P_FILE_CREATE_DEFAULT();
+ /** */
public static final long H5P_FILE_ACCESS_DEFAULT = H5P_FILE_ACCESS_DEFAULT();
+ /** */
public static final long H5P_DATASET_CREATE_DEFAULT = H5P_DATASET_CREATE_DEFAULT();
+ /** */
public static final long H5P_DATASET_ACCESS_DEFAULT = H5P_DATASET_ACCESS_DEFAULT();
+ /** */
public static final long H5P_DATASET_XFER_DEFAULT = H5P_DATASET_XFER_DEFAULT();
+ /** */
public static final long H5P_FILE_MOUNT_DEFAULT = H5P_FILE_MOUNT_DEFAULT();
+ /** */
public static final long H5P_GROUP_CREATE_DEFAULT = H5P_GROUP_CREATE_DEFAULT();
+ /** */
public static final long H5P_GROUP_ACCESS_DEFAULT = H5P_GROUP_ACCESS_DEFAULT();
+ /** */
public static final long H5P_DATATYPE_CREATE_DEFAULT = H5P_DATATYPE_CREATE_DEFAULT();
+ /** */
public static final long H5P_DATATYPE_ACCESS_DEFAULT = H5P_DATATYPE_ACCESS_DEFAULT();
+ /** */
public static final long H5P_ATTRIBUTE_CREATE_DEFAULT = H5P_ATTRIBUTE_CREATE_DEFAULT();
+ /** */
public static final long H5P_ATTRIBUTE_ACCESS_DEFAULT = H5P_ATTRIBUTE_ACCESS_DEFAULT();
+ /** */
public static final long H5P_OBJECT_COPY_DEFAULT = H5P_OBJECT_COPY_DEFAULT();
+ /** */
public static final long H5P_LINK_CREATE_DEFAULT = H5P_LINK_CREATE_DEFAULT();
+ /** */
public static final long H5P_LINK_ACCESS_DEFAULT = H5P_LINK_ACCESS_DEFAULT();
+ /** */
public static final long H5P_VOL_INITIALIZE_DEFAULT = H5P_VOL_INITIALIZE_DEFAULT();
+ /** */
public static final int H5P_CRT_ORDER_TRACKED = H5P_CRT_ORDER_TRACKED();
+ /** */
public static final int H5P_CRT_ORDER_INDEXED = H5P_CRT_ORDER_INDEXED();
+ /** */
public static final long H5P_DEFAULT = H5P_DEFAULT();
+ /** */
public static final int H5PL_TYPE_ERROR = H5PL_TYPE_ERROR();
+ /** */
public static final int H5PL_TYPE_FILTER = H5PL_TYPE_FILTER();
+ /** */
public static final int H5PL_TYPE_VOL = H5PL_TYPE_VOL();
+ /** */
public static final int H5PL_TYPE_NONE = H5PL_TYPE_NONE();
+ /** */
public static final int H5PL_FILTER_PLUGIN = H5PL_FILTER_PLUGIN();
+ /** */
public static final int H5PL_VOL_PLUGIN = H5PL_VOL_PLUGIN();
+ /** */
public static final int H5PL_ALL_PLUGIN = H5PL_ALL_PLUGIN();
+ /** */
public static final int H5R_ATTR = H5R_ATTR();
+ /** */
public static final int H5R_BADTYPE = H5R_BADTYPE();
+ /** */
public static final int H5R_DATASET_REGION = H5R_DATASET_REGION();
+ /** */
public static final int H5R_DATASET_REGION1 = H5R_DATASET_REGION1();
+ /** */
public static final int H5R_DATASET_REGION2 = H5R_DATASET_REGION2();
+ /** */
public static final int H5R_MAXTYPE = H5R_MAXTYPE();
+ /** */
public static final int H5R_REF_BUF_SIZE = H5R_REF_BUF_SIZE();
+ /** */
public static final int H5R_OBJ_REF_BUF_SIZE = H5R_OBJ_REF_BUF_SIZE();
+ /** */
public static final int H5R_OBJECT = H5R_OBJECT();
+ /** */
public static final int H5R_OBJECT1 = H5R_OBJECT1();
+ /** */
public static final int H5R_OBJECT2 = H5R_OBJECT2();
+ /** Define atomic datatypes */
public static final int H5S_ALL = H5S_ALL();
+ /** Define user-level maximum number of dimensions */
public static final int H5S_MAX_RANK = H5S_MAX_RANK();
+ /** Different types of dataspaces - error */
public static final int H5S_NO_CLASS = H5S_NO_CLASS();
+ /** Different types of dataspaces - null dataspace */
public static final int H5S_NULL = H5S_NULL();
+ /** Different types of dataspaces - scalar variable */
public static final int H5S_SCALAR = H5S_SCALAR();
+ /** Enumerated type for the type of selection - Entire extent selected */
public static final int H5S_SEL_ALL = H5S_SEL_ALL();
+ /** Enumerated type for the type of selection - Error */
public static final int H5S_SEL_ERROR = H5S_SEL_ERROR();
+ /** Enumerated type for the type of selection - Hyperslab selected */
public static final int H5S_SEL_HYPERSLABS = H5S_SEL_HYPERSLABS();
+ /** Enumerated type for the type of selection - LAST */
public static final int H5S_SEL_N = H5S_SEL_N();
+ /** Enumerated type for the type of selection - Nothing selected */
public static final int H5S_SEL_NONE = H5S_SEL_NONE();
+ /** Enumerated type for the type of selection - Points / elements selected */
public static final int H5S_SEL_POINTS = H5S_SEL_POINTS();
+ /** Different ways of combining selections - Binary "and" operation for hyperslabs */
public static final int H5S_SELECT_AND = H5S_SELECT_AND();
+ /** Different ways of combining selections - Append elements to end of point selection */
public static final int H5S_SELECT_APPEND = H5S_SELECT_APPEND();
+ /** Different ways of combining selections - Invalid upper bound on selection operations */
public static final int H5S_SELECT_INVALID = H5S_SELECT_INVALID();
+ /** Different ways of combining selections - error */
public static final int H5S_SELECT_NOOP = H5S_SELECT_NOOP();
+ /** Different ways of combining selections - Binary "not" operation for hyperslabs */
public static final int H5S_SELECT_NOTA = H5S_SELECT_NOTA();
+ /** Different ways of combining selections - Binary "not" operation for hyperslabs */
public static final int H5S_SELECT_NOTB = H5S_SELECT_NOTB();
+ /** Different ways of combining selections - Binary "or" operation for hyperslabs */
public static final int H5S_SELECT_OR = H5S_SELECT_OR();
+ /** Different ways of combining selections - Prepend elements to beginning of point selection */
public static final int H5S_SELECT_PREPEND = H5S_SELECT_PREPEND();
+ /** Different ways of combining selections - Select "set" operation */
public static final int H5S_SELECT_SET = H5S_SELECT_SET();
+ /** Different ways of combining selections - Binary "xor" operation for hyperslabs */
public static final int H5S_SELECT_XOR = H5S_SELECT_XOR();
+ /** Different types of dataspaces - simple dataspace */
public static final int H5S_SIMPLE = H5S_SIMPLE();
+ /** Define atomic datatypes */
public static final int H5S_UNLIMITED = H5S_UNLIMITED();
+
+ /** */
public static final long H5T_ALPHA_B16 = H5T_ALPHA_B16();
+ /** */
public static final long H5T_ALPHA_B32 = H5T_ALPHA_B32();
+ /** */
public static final long H5T_ALPHA_B64 = H5T_ALPHA_B64();
+ /** */
public static final long H5T_ALPHA_B8 = H5T_ALPHA_B8();
+ /** */
public static final long H5T_ALPHA_F32 = H5T_ALPHA_F32();
+ /** */
public static final long H5T_ALPHA_F64 = H5T_ALPHA_F64();
+ /** */
public static final long H5T_ALPHA_I16 = H5T_ALPHA_I16();
+ /** */
public static final long H5T_ALPHA_I32 = H5T_ALPHA_I32();
+ /** */
public static final long H5T_ALPHA_I64 = H5T_ALPHA_I64();
+ /** */
public static final long H5T_ALPHA_I8 = H5T_ALPHA_I8();
+ /** */
public static final long H5T_ALPHA_U16 = H5T_ALPHA_U16();
+ /** */
public static final long H5T_ALPHA_U32 = H5T_ALPHA_U32();
+ /** */
public static final long H5T_ALPHA_U64 = H5T_ALPHA_U64();
+ /** */
public static final long H5T_ALPHA_U8 = H5T_ALPHA_U8();
+ /** */
public static final int H5T_ARRAY = H5T_ARRAY();
+ /** */
public static final int H5T_BITFIELD = H5T_BITFIELD();
+ /** */
public static final int H5T_BKG_NO = H5T_BKG_NO();
+ /** */
public static final int H5T_BKG_YES = H5T_BKG_YES();
+ /** */
public static final long H5T_C_S1 = H5T_C_S1();
+ /** */
public static final int H5T_COMPOUND = H5T_COMPOUND();
+ /** */
public static final int H5T_CONV_CONV = H5T_CONV_CONV();
+ /** */
public static final int H5T_CONV_FREE = H5T_CONV_FREE();
+ /** */
public static final int H5T_CONV_INIT = H5T_CONV_INIT();
+ /** */
public static final int H5T_CSET_ERROR = H5T_CSET_ERROR();
+ /** */
public static final int H5T_CSET_ASCII = H5T_CSET_ASCII();
+ /** */
public static final int H5T_CSET_UTF8 = H5T_CSET_UTF8();
+ /** */
public static final int H5T_CSET_RESERVED_10 = H5T_CSET_RESERVED_10();
+ /** */
public static final int H5T_CSET_RESERVED_11 = H5T_CSET_RESERVED_11();
+ /** */
public static final int H5T_CSET_RESERVED_12 = H5T_CSET_RESERVED_12();
+ /** */
public static final int H5T_CSET_RESERVED_13 = H5T_CSET_RESERVED_13();
+ /** */
public static final int H5T_CSET_RESERVED_14 = H5T_CSET_RESERVED_14();
+ /** */
public static final int H5T_CSET_RESERVED_15 = H5T_CSET_RESERVED_15();
+ /** */
public static final int H5T_CSET_RESERVED_2 = H5T_CSET_RESERVED_2();
+ /** */
public static final int H5T_CSET_RESERVED_3 = H5T_CSET_RESERVED_3();
+ /** */
public static final int H5T_CSET_RESERVED_4 = H5T_CSET_RESERVED_4();
+ /** */
public static final int H5T_CSET_RESERVED_5 = H5T_CSET_RESERVED_5();
+ /** */
public static final int H5T_CSET_RESERVED_6 = H5T_CSET_RESERVED_6();
+ /** */
public static final int H5T_CSET_RESERVED_7 = H5T_CSET_RESERVED_7();
+ /** */
public static final int H5T_CSET_RESERVED_8 = H5T_CSET_RESERVED_8();
+ /** */
public static final int H5T_CSET_RESERVED_9 = H5T_CSET_RESERVED_9();
+ /** */
public static final int H5T_DIR_ASCEND = H5T_DIR_ASCEND();
+ /** */
public static final int H5T_DIR_DEFAULT = H5T_DIR_DEFAULT();
+ /** */
public static final int H5T_DIR_DESCEND = H5T_DIR_DESCEND();
+ /** */
public static final int H5T_ENUM = H5T_ENUM();
+ /** */
public static final int H5T_FLOAT = H5T_FLOAT();
+ /** */
public static final long H5T_FORTRAN_S1 = H5T_FORTRAN_S1();
+ /** */
public static final long H5T_IEEE_F32BE = H5T_IEEE_F32BE();
+ /** */
public static final long H5T_IEEE_F32LE = H5T_IEEE_F32LE();
+ /** */
public static final long H5T_IEEE_F64BE = H5T_IEEE_F64BE();
+ /** */
public static final long H5T_IEEE_F64LE = H5T_IEEE_F64LE();
+ /** */
public static final int H5T_INTEGER = H5T_INTEGER();
+ /** */
public static final long H5T_INTEL_B16 = H5T_INTEL_B16();
+ /** */
public static final long H5T_INTEL_B32 = H5T_INTEL_B32();
+ /** */
public static final long H5T_INTEL_B64 = H5T_INTEL_B64();
+ /** */
public static final long H5T_INTEL_B8 = H5T_INTEL_B8();
+ /** */
public static final long H5T_INTEL_F32 = H5T_INTEL_F32();
+ /** */
public static final long H5T_INTEL_F64 = H5T_INTEL_F64();
+ /** */
public static final long H5T_INTEL_I16 = H5T_INTEL_I16();
+ /** */
public static final long H5T_INTEL_I32 = H5T_INTEL_I32();
+ /** */
public static final long H5T_INTEL_I64 = H5T_INTEL_I64();
+ /** */
public static final long H5T_INTEL_I8 = H5T_INTEL_I8();
+ /** */
public static final long H5T_INTEL_U16 = H5T_INTEL_U16();
+ /** */
public static final long H5T_INTEL_U32 = H5T_INTEL_U32();
+ /** */
public static final long H5T_INTEL_U64 = H5T_INTEL_U64();
+ /** */
public static final long H5T_INTEL_U8 = H5T_INTEL_U8();
+ /** */
public static final long H5T_MIPS_B16 = H5T_MIPS_B16();
+ /** */
public static final long H5T_MIPS_B32 = H5T_MIPS_B32();
+ /** */
public static final long H5T_MIPS_B64 = H5T_MIPS_B64();
+ /** */
public static final long H5T_MIPS_B8 = H5T_MIPS_B8();
+ /** */
public static final long H5T_MIPS_F32 = H5T_MIPS_F32();
+ /** */
public static final long H5T_MIPS_F64 = H5T_MIPS_F64();
+ /** */
public static final long H5T_MIPS_I16 = H5T_MIPS_I16();
+ /** */
public static final long H5T_MIPS_I32 = H5T_MIPS_I32();
+ /** */
public static final long H5T_MIPS_I64 = H5T_MIPS_I64();
+ /** */
public static final long H5T_MIPS_I8 = H5T_MIPS_I8();
+ /** */
public static final long H5T_MIPS_U16 = H5T_MIPS_U16();
+ /** */
public static final long H5T_MIPS_U32 = H5T_MIPS_U32();
+ /** */
public static final long H5T_MIPS_U64 = H5T_MIPS_U64();
+ /** */
public static final long H5T_MIPS_U8 = H5T_MIPS_U8();
+ /** */
public static final long H5T_NATIVE_B16 = H5T_NATIVE_B16();
+ /** */
public static final long H5T_NATIVE_B32 = H5T_NATIVE_B32();
+ /** */
public static final long H5T_NATIVE_B64 = H5T_NATIVE_B64();
+ /** */
public static final long H5T_NATIVE_B8 = H5T_NATIVE_B8();
+ /** */
public static final long H5T_NATIVE_CHAR = H5T_NATIVE_CHAR();
+ /** */
public static final long H5T_NATIVE_DOUBLE = H5T_NATIVE_DOUBLE();
+ /** */
public static final long H5T_NATIVE_FLOAT = H5T_NATIVE_FLOAT();
+ /** */
public static final long H5T_NATIVE_HADDR = H5T_NATIVE_HADDR();
+ /** */
public static final long H5T_NATIVE_HBOOL = H5T_NATIVE_HBOOL();
+ /** */
public static final long H5T_NATIVE_HERR = H5T_NATIVE_HERR();
+ /** */
public static final long H5T_NATIVE_HSIZE = H5T_NATIVE_HSIZE();
+ /** */
public static final long H5T_NATIVE_HSSIZE = H5T_NATIVE_HSSIZE();
+ /** */
public static final long H5T_NATIVE_INT = H5T_NATIVE_INT();
+ /** */
public static final long H5T_NATIVE_INT_FAST16 = H5T_NATIVE_INT_FAST16();
+ /** */
public static final long H5T_NATIVE_INT_FAST32 = H5T_NATIVE_INT_FAST32();
+ /** */
public static final long H5T_NATIVE_INT_FAST64 = H5T_NATIVE_INT_FAST64();
+ /** */
public static final long H5T_NATIVE_INT_FAST8 = H5T_NATIVE_INT_FAST8();
+ /** */
public static final long H5T_NATIVE_INT_LEAST16 = H5T_NATIVE_INT_LEAST16();
+ /** */
public static final long H5T_NATIVE_INT_LEAST32 = H5T_NATIVE_INT_LEAST32();
+ /** */
public static final long H5T_NATIVE_INT_LEAST64 = H5T_NATIVE_INT_LEAST64();
+ /** */
public static final long H5T_NATIVE_INT_LEAST8 = H5T_NATIVE_INT_LEAST8();
+ /** */
public static final long H5T_NATIVE_INT16 = H5T_NATIVE_INT16();
+ /** */
public static final long H5T_NATIVE_INT32 = H5T_NATIVE_INT32();
+ /** */
public static final long H5T_NATIVE_INT64 = H5T_NATIVE_INT64();
+ /** */
public static final long H5T_NATIVE_INT8 = H5T_NATIVE_INT8();
+ /** */
public static final long H5T_NATIVE_LDOUBLE = H5T_NATIVE_LDOUBLE();
+ /** */
public static final long H5T_NATIVE_LLONG = H5T_NATIVE_LLONG();
+ /** */
public static final long H5T_NATIVE_LONG = H5T_NATIVE_LONG();
+ /** */
public static final long H5T_NATIVE_OPAQUE = H5T_NATIVE_OPAQUE();
+ /** */
public static final long H5T_NATIVE_SCHAR = H5T_NATIVE_SCHAR();
+ /** */
public static final long H5T_NATIVE_SHORT = H5T_NATIVE_SHORT();
+ /** */
public static final long H5T_NATIVE_UCHAR = H5T_NATIVE_UCHAR();
+ /** */
public static final long H5T_NATIVE_UINT = H5T_NATIVE_UINT();
+ /** */
public static final long H5T_NATIVE_UINT_FAST16 = H5T_NATIVE_UINT_FAST16();
+ /** */
public static final long H5T_NATIVE_UINT_FAST32 = H5T_NATIVE_UINT_FAST32();
+ /** */
public static final long H5T_NATIVE_UINT_FAST64 = H5T_NATIVE_UINT_FAST64();
+ /** */
public static final long H5T_NATIVE_UINT_FAST8 = H5T_NATIVE_UINT_FAST8();
+ /** */
public static final long H5T_NATIVE_UINT_LEAST16 = H5T_NATIVE_UINT_LEAST16();
+ /** */
public static final long H5T_NATIVE_UINT_LEAST32 = H5T_NATIVE_UINT_LEAST32();
+ /** */
public static final long H5T_NATIVE_UINT_LEAST64 = H5T_NATIVE_UINT_LEAST64();
+ /** */
public static final long H5T_NATIVE_UINT_LEAST8 = H5T_NATIVE_UINT_LEAST8();
+ /** */
public static final long H5T_NATIVE_UINT16 = H5T_NATIVE_UINT16();
+ /** */
public static final long H5T_NATIVE_UINT32 = H5T_NATIVE_UINT32();
+ /** */
public static final long H5T_NATIVE_UINT64 = H5T_NATIVE_UINT64();
+ /** */
public static final long H5T_NATIVE_UINT8 = H5T_NATIVE_UINT8();
+ /** */
public static final long H5T_NATIVE_ULLONG = H5T_NATIVE_ULLONG();
+ /** */
public static final long H5T_NATIVE_ULONG = H5T_NATIVE_ULONG();
+ /** */
public static final long H5T_NATIVE_USHORT = H5T_NATIVE_USHORT();
+ /** */
public static final int H5T_NCLASSES = H5T_NCLASSES();
+ /** */
public static final int H5T_NO_CLASS = H5T_NO_CLASS();
+ /** */
public static final int H5T_NORM_ERROR = H5T_NORM_ERROR();
+ /** */
public static final int H5T_NORM_IMPLIED = H5T_NORM_IMPLIED();
+ /** */
public static final int H5T_NORM_MSBSET = H5T_NORM_MSBSET();
+ /** */
public static final int H5T_NORM_NONE = H5T_NORM_NONE();
+ /** */
public static final int H5T_NPAD = H5T_NPAD();
+ /** */
public static final int H5T_NSGN = H5T_NSGN();
+ /** */
public static final int H5T_OPAQUE = H5T_OPAQUE();
+ /** */
public static final int H5T_OPAQUE_TAG_MAX = H5T_OPAQUE_TAG_MAX(); /* 1.6.5 */
+ /** */
public static final int H5T_ORDER_BE = H5T_ORDER_BE();
+ /** */
public static final int H5T_ORDER_ERROR = H5T_ORDER_ERROR();
+ /** */
public static final int H5T_ORDER_LE = H5T_ORDER_LE();
+ /** */
public static final int H5T_ORDER_NONE = H5T_ORDER_NONE();
+ /** */
public static final int H5T_ORDER_VAX = H5T_ORDER_VAX();
+ /** */
public static final int H5T_PAD_BACKGROUND = H5T_PAD_BACKGROUND();
+ /** */
public static final int H5T_PAD_ERROR = H5T_PAD_ERROR();
+ /** */
public static final int H5T_PAD_ONE = H5T_PAD_ONE();
+ /** */
public static final int H5T_PAD_ZERO = H5T_PAD_ZERO();
+ /** */
public static final int H5T_PERS_DONTCARE = H5T_PERS_DONTCARE();
+ /** */
public static final int H5T_PERS_HARD = H5T_PERS_HARD();
+ /** */
public static final int H5T_PERS_SOFT = H5T_PERS_SOFT();
+ /** */
public static final int H5T_REFERENCE = H5T_REFERENCE();
+ /** */
public static final int H5T_SGN_2 = H5T_SGN_2();
+ /** */
public static final int H5T_SGN_ERROR = H5T_SGN_ERROR();
+ /** */
public static final int H5T_SGN_NONE = H5T_SGN_NONE();
+ /** */
public static final long H5T_STD_B16BE = H5T_STD_B16BE();
+ /** */
public static final long H5T_STD_B16LE = H5T_STD_B16LE();
+ /** */
public static final long H5T_STD_B32BE = H5T_STD_B32BE();
+ /** */
public static final long H5T_STD_B32LE = H5T_STD_B32LE();
+ /** */
public static final long H5T_STD_B64BE = H5T_STD_B64BE();
+ /** */
public static final long H5T_STD_B64LE = H5T_STD_B64LE();
+ /** */
public static final long H5T_STD_B8BE = H5T_STD_B8BE();
+ /** */
public static final long H5T_STD_B8LE = H5T_STD_B8LE();
+ /** */
public static final long H5T_STD_I16BE = H5T_STD_I16BE();
+ /** */
public static final long H5T_STD_I16LE = H5T_STD_I16LE();
+ /** */
public static final long H5T_STD_I32BE = H5T_STD_I32BE();
+ /** */
public static final long H5T_STD_I32LE = H5T_STD_I32LE();
+ /** */
public static final long H5T_STD_I64BE = H5T_STD_I64BE();
+ /** */
public static final long H5T_STD_I64LE = H5T_STD_I64LE();
+ /** */
public static final long H5T_STD_I8BE = H5T_STD_I8BE();
+ /** */
public static final long H5T_STD_I8LE = H5T_STD_I8LE();
+ /** */
public static final long H5T_STD_REF_DSETREG = H5T_STD_REF_DSETREG();
+ /** */
public static final long H5T_STD_REF_OBJ = H5T_STD_REF_OBJ();
+ /** */
public static final long H5T_STD_REF = H5T_STD_REF();
+ /** */
public static final long H5T_STD_U16BE = H5T_STD_U16BE();
+ /** */
public static final long H5T_STD_U16LE = H5T_STD_U16LE();
+ /** */
public static final long H5T_STD_U32BE = H5T_STD_U32BE();
+ /** */
public static final long H5T_STD_U32LE = H5T_STD_U32LE();
+ /** */
public static final long H5T_STD_U64BE = H5T_STD_U64BE();
+ /** */
public static final long H5T_STD_U64LE = H5T_STD_U64LE();
+ /** */
public static final long H5T_STD_U8BE = H5T_STD_U8BE();
+ /** */
public static final long H5T_STD_U8LE = H5T_STD_U8LE();
+ /** */
public static final int H5T_STR_ERROR = H5T_STR_ERROR();
+ /** */
public static final int H5T_STR_NULLPAD = H5T_STR_NULLPAD();
+ /** */
public static final int H5T_STR_NULLTERM = H5T_STR_NULLTERM();
+ /** */
public static final int H5T_STR_RESERVED_10 = H5T_STR_RESERVED_10();
+ /** */
public static final int H5T_STR_RESERVED_11 = H5T_STR_RESERVED_11();
+ /** */
public static final int H5T_STR_RESERVED_12 = H5T_STR_RESERVED_12();
+ /** */
public static final int H5T_STR_RESERVED_13 = H5T_STR_RESERVED_13();
+ /** */
public static final int H5T_STR_RESERVED_14 = H5T_STR_RESERVED_14();
+ /** */
public static final int H5T_STR_RESERVED_15 = H5T_STR_RESERVED_15();
+ /** */
public static final int H5T_STR_RESERVED_3 = H5T_STR_RESERVED_3();
+ /** */
public static final int H5T_STR_RESERVED_4 = H5T_STR_RESERVED_4();
+ /** */
public static final int H5T_STR_RESERVED_5 = H5T_STR_RESERVED_5();
+ /** */
public static final int H5T_STR_RESERVED_6 = H5T_STR_RESERVED_6();
+ /** */
public static final int H5T_STR_RESERVED_7 = H5T_STR_RESERVED_7();
+ /** */
public static final int H5T_STR_RESERVED_8 = H5T_STR_RESERVED_8();
+ /** */
public static final int H5T_STR_RESERVED_9 = H5T_STR_RESERVED_9();
+ /** */
public static final int H5T_STR_SPACEPAD = H5T_STR_SPACEPAD();
+ /** */
public static final int H5T_STRING = H5T_STRING();
+ /** */
public static final int H5T_TIME = H5T_TIME();
+ /** */
public static final long H5T_UNIX_D32BE = H5T_UNIX_D32BE();
+ /** */
public static final long H5T_UNIX_D32LE = H5T_UNIX_D32LE();
+ /** */
public static final long H5T_UNIX_D64BE = H5T_UNIX_D64BE();
+ /** */
public static final long H5T_UNIX_D64LE = H5T_UNIX_D64LE();
+ /** */
public static final long H5T_VARIABLE = H5T_VARIABLE();
+ /** */
public static final int H5T_VLEN = H5T_VLEN();
+ /** */
public static final int H5T_VL_T = H5T_VL_T();
+ /** */
public static final int H5VL_CAP_FLAG_NONE = H5VL_CAP_FLAG_NONE();
+ /** */
public static final int H5VL_CAP_FLAG_THREADSAFE = H5VL_CAP_FLAG_THREADSAFE();
+ /** */
public static final long H5VL_NATIVE = H5VL_NATIVE();
+ /** */
public static final String H5VL_NATIVE_NAME = H5VL_NATIVE_NAME();
+ /** */
public static final int H5VL_NATIVE_VALUE = H5VL_NATIVE_VALUE();
+ /** */
public static final int H5VL_NATIVE_VERSION = H5VL_NATIVE_VERSION();
+ /** */
public static final int H5_VOL_INVALID = H5_VOL_INVALID();
+ /** */
public static final int H5_VOL_NATIVE = H5_VOL_NATIVE();
+ /** */
public static final int H5_VOL_RESERVED = H5_VOL_RESERVED();
+ /** */
public static final int H5_VOL_MAX = H5_VOL_MAX();
+ /** Return values for filter callback function */
public static final int H5Z_CB_CONT = H5Z_CB_CONT();
+ /** Return values for filter callback function */
public static final int H5Z_CB_ERROR = H5Z_CB_ERROR();
+ /** Return values for filter callback function */
public static final int H5Z_CB_FAIL = H5Z_CB_FAIL();
+ /** Return values for filter callback function */
public static final int H5Z_CB_NO = H5Z_CB_NO();
+ /** Values to decide if EDC is enabled for reading data */
public static final int H5Z_DISABLE_EDC = H5Z_DISABLE_EDC();
+ /** Values to decide if EDC is enabled for reading data */
public static final int H5Z_ENABLE_EDC = H5Z_ENABLE_EDC();
+ /** Values to decide if EDC is enabled for reading data */
public static final int H5Z_ERROR_EDC = H5Z_ERROR_EDC();
+ /** Filter IDs - deflation like gzip */
public static final int H5Z_FILTER_DEFLATE = H5Z_FILTER_DEFLATE();
+ /** Filter IDs - no filter */
public static final int H5Z_FILTER_ERROR = H5Z_FILTER_ERROR();
+ /** Filter IDs - fletcher32 checksum of EDC */
public static final int H5Z_FILTER_FLETCHER32 = H5Z_FILTER_FLETCHER32();
+ /** Filter IDs - maximum filter id */
public static final int H5Z_FILTER_MAX = H5Z_FILTER_MAX();
+ /** Filter IDs - nbit compression */
public static final int H5Z_FILTER_NBIT = H5Z_FILTER_NBIT();
+ /** Filter IDs - reserved indefinitely */
public static final int H5Z_FILTER_NONE = H5Z_FILTER_NONE();
+ /** Filter IDs - filter ids below this value are reserved for library use */
public static final int H5Z_FILTER_RESERVED = H5Z_FILTER_RESERVED();
+ /** Filter IDs - scale+offset compression */
public static final int H5Z_FILTER_SCALEOFFSET = H5Z_FILTER_SCALEOFFSET();
+ /** Filter IDs - shuffle the data */
public static final int H5Z_FILTER_SHUFFLE = H5Z_FILTER_SHUFFLE();
+ /** Filter IDs - szip compression */
public static final int H5Z_FILTER_SZIP = H5Z_FILTER_SZIP();
+ /** Flags for filter definition (stored)
+ * definition flag mask */
public static final int H5Z_FLAG_DEFMASK = H5Z_FLAG_DEFMASK();
+ /** Additional flags for filter invocation (not stored)
+ * invocation flag mask */
public static final int H5Z_FLAG_INVMASK = H5Z_FLAG_INVMASK();
+ /** Flags for filter definition (stored)
+ * filter is mandatory */
public static final int H5Z_FLAG_MANDATORY = H5Z_FLAG_MANDATORY();
+ /** Flags for filter definition (stored)
+ * filter is optional */
public static final int H5Z_FLAG_OPTIONAL = H5Z_FLAG_OPTIONAL();
+ /** Additional flags for filter invocation (not stored)
+ * reverse direction; read */
public static final int H5Z_FLAG_REVERSE = H5Z_FLAG_REVERSE();
+ /** Additional flags for filter invocation (not stored)
+ * skip EDC filters for read */
public static final int H5Z_FLAG_SKIP_EDC = H5Z_FLAG_SKIP_EDC();
+ /** Symbol to remove all filters in H5Premove_filter */
+ public static final int H5Z_FILTER_ALL = H5Z_FILTER_ALL();
+ /** Maximum number of filters allowed in a pipeline */
public static final int H5Z_MAX_NFILTERS = H5Z_MAX_NFILTERS();
+ /** Values to decide if EDC is enabled for reading data */
public static final int H5Z_NO_EDC = H5Z_NO_EDC();
+ /** Bit flags for H5Zget_filter_info */
public static final int H5Z_FILTER_CONFIG_ENCODE_ENABLED = H5Z_FILTER_CONFIG_ENCODE_ENABLED();
+ /** Bit flags for H5Zget_filter_info */
public static final int H5Z_FILTER_CONFIG_DECODE_ENABLED = H5Z_FILTER_CONFIG_DECODE_ENABLED();
+ /** Special parameters for ScaleOffset filter*/
public static final int H5Z_SO_INT_MINBITS_DEFAULT = H5Z_SO_INT_MINBITS_DEFAULT();
+ /** Special parameters for ScaleOffset filter*/
public static final int H5Z_SO_FLOAT_DSCALE = H5Z_SO_FLOAT_DSCALE();
+ /** Special parameters for ScaleOffset filter*/
public static final int H5Z_SO_FLOAT_ESCALE = H5Z_SO_FLOAT_ESCALE();
+ /** Special parameters for ScaleOffset filter*/
public static final int H5Z_SO_INT = H5Z_SO_INT();
+ /** shuffle filter - Number of parameters that users can set */
public static final int H5Z_SHUFFLE_USER_NPARMS = H5Z_SHUFFLE_USER_NPARMS();
+ /** shuffle filter - Total number of parameters for filter */
public static final int H5Z_SHUFFLE_TOTAL_NPARMS = H5Z_SHUFFLE_TOTAL_NPARMS();
+ /** szip filter - Number of parameters that users can set */
public static final int H5Z_SZIP_USER_NPARMS = H5Z_SZIP_USER_NPARMS();
+ /** szip filter - Total number of parameters for filter */
public static final int H5Z_SZIP_TOTAL_NPARMS = H5Z_SZIP_TOTAL_NPARMS();
+ /** szip filter - "User" parameter for option mask */
public static final int H5Z_SZIP_PARM_MASK = H5Z_SZIP_PARM_MASK();
+ /** szip filter - "User" parameter for pixels-per-block */
public static final int H5Z_SZIP_PARM_PPB = H5Z_SZIP_PARM_PPB();
+ /** szip filter - "Local" parameter for bits-per-pixel */
public static final int H5Z_SZIP_PARM_BPP = H5Z_SZIP_PARM_BPP();
+ /** szip filter - "Local" parameter for pixels-per-scanline */
public static final int H5Z_SZIP_PARM_PPS = H5Z_SZIP_PARM_PPS();
+ /** nbit filter - Number of parameters that users can set */
public static final int H5Z_NBIT_USER_NPARMS = H5Z_NBIT_USER_NPARMS();
+ /** scale offset filter - Number of parameters that users can set */
public static final int H5Z_SCALEOFFSET_USER_NPARMS = H5Z_SCALEOFFSET_USER_NPARMS();
- public static final int H5Z_FILTER_ALL = H5Z_FILTER_ALL();
// /////////////////////////////////////////////////////////////////////////
// List of private native variables to get constant values from C //
@@ -831,16 +1618,18 @@ public class HDF5Constants {
private static native final long H5E_ARGS();
- private static native final long H5E_ATOM();
+ private static native final long H5E_ID();
private static native final long H5E_ATTR();
- private static native final long H5E_BADATOM();
+ private static native final long H5E_BADID();
private static native final long H5E_BADFILE();
private static native final long H5E_BADGROUP();
+ private static native final long H5E_BADITER();
+
private static native final long H5E_BADMESG();
private static native final long H5E_BADRANGE();
@@ -861,15 +1650,30 @@ public class HDF5Constants {
private static native final long H5E_CANAPPLY();
- // private static native final long H5E_CANTALLOC();
+ private static native final long H5E_CANTALLOC();
+
+ private static native final long H5E_CANTAPPEND();
+
+ private static native final long H5E_CANTATTACH();
+
+ private static native final long H5E_CANTCLEAN();
+
private static native final long H5E_CANTCLIP();
private static native final long H5E_CANTCLOSEFILE();
+ private static native final long H5E_CANTCLOSEOBJ();
+
+ private static native final long H5E_CANTCOMPARE();
+
+ private static native final long H5E_CANTCOMPUTE();
+
private static native final long H5E_CANTCONVERT();
private static native final long H5E_CANTCOPY();
+ private static native final long H5E_CANTCORK();
+
private static native final long H5E_CANTCOUNT();
private static native final long H5E_CANTCREATE();
@@ -882,18 +1686,36 @@ public class HDF5Constants {
private static native final long H5E_CANTDELETEFILE();
+ private static native final long H5E_CANTDEPEND();
+
+ private static native final long H5E_CANTDIRTY();
+
private static native final long H5E_CANTENCODE();
+ private static native final long H5E_CANTEXPUNGE();
+
+ private static native final long H5E_CANTEXTEND();
+
+ private static native final long H5E_CANTFILTER();
+
private static native final long H5E_CANTFLUSH();
private static native final long H5E_CANTFREE();
+ private static native final long H5E_CANTGATHER();
+
+ private static native final long H5E_CANTGC();
+
private static native final long H5E_CANTGET();
+ private static native final long H5E_CANTGETSIZE();
+
private static native final long H5E_CANTINC();
private static native final long H5E_CANTINIT();
+ private static native final long H5E_CANTINS();
+
private static native final long H5E_CANTINSERT();
private static native final long H5E_CANTLIST();
@@ -902,29 +1724,96 @@ public class HDF5Constants {
private static native final long H5E_CANTLOCK();
+ private static native final long H5E_CANTLOCKFILE();
+
+ private static native final long H5E_CANTMARKCLEAN();
+
+ private static native final long H5E_CANTMARKDIRTY();
+
+ private static native final long H5E_CANTMARKSERIALIZED();
+
+ private static native final long H5E_CANTMARKUNSERIALIZED();
+
+ private static native final long H5E_CANTMERGE();
+
+ private static native final long H5E_CANTMOVE();
+
+ private static native final long H5E_CANTMODIFY();
+
private static native final long H5E_CANTNEXT();
+ private static native final long H5E_CANTNOTIFY();
+
private static native final long H5E_CANTOPENFILE();
private static native final long H5E_CANTOPENOBJ();
- // private static native final long H5E_CANTRECV();
+ private static native final long H5E_CANTOPERATE();
+
+ private static native final long H5E_CANTPACK();
+
+ private static native final long H5E_CANTPIN();
+
+ private static native final long H5E_CANTPROTECT();
+
+ private static native final long H5E_CANTRECV();
+
+ private static native final long H5E_CANTREDISTRIBUTE();
+
private static native final long H5E_CANTREGISTER();
private static native final long H5E_CANTRELEASE();
+ private static native final long H5E_CANTREMOVE();
+
+ private static native final long H5E_CANTRENAME();
+
+ private static native final long H5E_CANTRESET();
+
+ private static native final long H5E_CANTRESIZE();
+
+ private static native final long H5E_CANTRESTORE();
+
+ private static native final long H5E_CANTREVIVE();
+
+ private static native final long H5E_CANTSHRINK();
+
private static native final long H5E_CANTSELECT();
private static native final long H5E_CANTSET();
+ private static native final long H5E_CANTSERIALIZE();
+
+ private static native final long H5E_CANTSORT();
+
private static native final long H5E_CANTSPLIT();
+ private static native final long H5E_CANTSWAP();
+
+ private static native final long H5E_CANTTAG();
+
+ private static native final long H5E_CANTUNCORK();
+
+ private static native final long H5E_CANTUNDEPEND();
+
private static native final long H5E_CANTUNLOCK();
+ private static native final long H5E_CANTUNLOCKFILE();
+
+ private static native final long H5E_CANTUNPIN();
+
+ private static native final long H5E_CANTUNPROTECT();
+
+ private static native final long H5E_CANTUNSERIALIZE();
+
+ private static native final long H5E_CANTUPDATE();
+
private static native final long H5E_CLOSEERROR();
private static native final long H5E_COMPLEN();
+ private static native final long H5E_CONTEXT();
+
private static native final long H5E_DATASET();
private static native final long H5E_DATASPACE();
@@ -935,10 +1824,16 @@ public class HDF5Constants {
private static native final long H5E_DUPCLASS();
+ private static native final long H5E_EARRAY();
+
private static native final long H5E_EFL();
+ private static native final long H5E_ERROR();
+
private static native final long H5E_EXISTS();
+ private static native final long H5E_FARRAY();
+
private static native final long H5E_FCNTL();
private static native final long H5E_FILE();
@@ -947,10 +1842,14 @@ public class HDF5Constants {
private static native final long H5E_FILEOPEN();
+ private static native final long H5E_FSPACE();
+
private static native final long H5E_FUNC();
private static native final long H5E_HEAP();
+ private static native final long H5E_INCONSISTENTSTATE();
+
private static native final long H5E_INTERNAL();
private static native final long H5E_IO();
@@ -959,8 +1858,12 @@ public class HDF5Constants {
private static native final long H5E_LINKCOUNT();
+ private static native final long H5E_LOGGING();
+
private static native final int H5E_MAJOR();
+ private static native final long H5E_MAP();
+
private static native final int H5E_MINOR();
private static native final long H5E_MOUNT();
@@ -969,6 +1872,12 @@ public class HDF5Constants {
private static native final long H5E_MPIERRSTR();
+ private static native final long H5E_NLINKS();
+
+ private static native final long H5E_NO_INDEPENDENT();
+
+ private static native final long H5E_NOENCODER();
+
private static native final long H5E_NOFILTER();
private static native final long H5E_NOIDS();
@@ -985,14 +1894,26 @@ public class HDF5Constants {
private static native final long H5E_NOTHDF5();
+ private static native final long H5E_NOTREGISTERED();
+
+ private static native final long H5E_OBJOPEN();
+
private static native final long H5E_OHDR();
+ private static native final long H5E_OPENERROR();
+
private static native final long H5E_OVERFLOW();
+ private static native final long H5E_PAGEBUF();
+
+ private static native final long H5E_PATH();
+
private static native final long H5E_PLINE();
private static native final long H5E_PLIST();
+ private static native final long H5E_PLUGIN();
+
private static native final long H5E_PROTECT();
private static native final long H5E_READERROR();
@@ -1005,12 +1926,24 @@ public class HDF5Constants {
private static native final long H5E_SEEKERROR();
+ private static native final long H5E_SETDISALLOWED();
+
private static native final long H5E_SETLOCAL();
+ private static native final long H5E_SLIST();
+
+ private static native final long H5E_SOHM();
+
private static native final long H5E_STORAGE();
private static native final long H5E_SYM();
+ private static native final long H5E_SYSERRSTR();
+
+ private static native final long H5E_SYSTEM();
+
+ private static native final long H5E_TRAVERSE();
+
private static native final long H5E_TRUNCATED();
private static native final long H5E_TST();
@@ -1037,8 +1970,6 @@ public class HDF5Constants {
private static native final int H5ES_STATUS_FAIL();
- private static native final int H5ES_STATUS_CANCELED();
-
private static native final int H5F_ACC_CREAT();
private static native final int H5F_ACC_EXCL();
diff --git a/java/src/hdf/hdf5lib/HDF5GroupInfo.java b/java/src/hdf/hdf5lib/HDF5GroupInfo.java
index 44b41bb..4c31af7 100644
--- a/java/src/hdf/hdf5lib/HDF5GroupInfo.java
+++ b/java/src/hdf/hdf5lib/HDF5GroupInfo.java
@@ -41,6 +41,8 @@ public class HDF5GroupInfo {
long mtime;
int linklen;
+ /** Container for the information reported about an HDF5 Object
+ * from the H5Gget_obj_info() method */
public HDF5GroupInfo() {
fileno = new long[2];
objno = new long[2];
@@ -88,27 +90,44 @@ public class HDF5GroupInfo {
linklen = 0;
}
- /* accessors */
+ /** fileno accessors
+ * @return the file number if successful
+ */
public long[] getFileno() {
return fileno;
}
+ /** accessors
+ * @return the object number if successful
+ */
public long[] getObjno() {
return objno;
}
+ /** accessors
+ * @return type of group if successful
+ */
public int getType() {
return type;
}
+ /** accessors
+ * @return the number of links in the group if successful
+ */
public int getNlink() {
return nlink;
}
+ /** accessors
+ * @return the modified time value if successful
+ */
public long getMtime() {
return mtime;
}
+ /** accessors
+ * @return a length of link name if successful
+ */
public int getLinklen() {
return linklen;
}
diff --git a/java/src/hdf/hdf5lib/HDFArray.java b/java/src/hdf/hdf5lib/HDFArray.java
index 0c2cd73..bb9357e 100644
--- a/java/src/hdf/hdf5lib/HDFArray.java
+++ b/java/src/hdf/hdf5lib/HDFArray.java
@@ -11,28 +11,25 @@
* help@hdfgroup.org. *
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
-
package hdf.hdf5lib;
import hdf.hdf5lib.exceptions.HDF5Exception;
import hdf.hdf5lib.exceptions.HDF5JavaException;
+import java.util.Arrays;
/**
* This is a class for handling multidimensional arrays for HDF.
* <p>
- * The purpose is to allow the storage and retrieval of arbitrary array types
- * containing scientific data.
+ * The purpose is to allow the storage and retrieval of arbitrary array types containing scientific data.
* <p>
- * The methods support the conversion of an array to and from Java to a
- * one-dimensional array of bytes suitable for I/O by the C library.
+ * The methods support the conversion of an array to and from Java to a one-dimensional array of bytes suitable for I/O
+ * by the C library.
* <p>
- * This class heavily uses the <a
- * href="./hdf.hdf5lib.HDFNativeData.html">HDFNativeData</a> class to
- * convert between Java and C representations.
+ * This class heavily uses the <a href="./hdf.hdf5lib.HDFNativeData.html">HDFNativeData</a> class to convert between
+ * Java and C representations.
*/
public class HDFArray {
-
private Object _theArray = null;
private ArrayDescriptor _desc = null;
private byte[] _barray = null;
@@ -40,31 +37,27 @@ public class HDFArray {
// public HDFArray() {}
/**
- * The input must be a Java Array (possibly multidimensional) of primitive
- * numbers or sub-classes of Number.
+ * The input must be a Java Array (possibly multidimensional) of primitive numbers or sub-classes of Number.
* <p>
- * The input is analysed to determine the number of dimensions and size of
- * each dimension, as well as the type of the elements.
+ * The input is analysed to determine the number of dimensions and size of each dimension, as well as the type of
+ * the elements.
* <p>
* The description is saved in private variables, and used to convert data.
*
* @param anArray
- * The array object.
- *
+ * The array object.
* @exception hdf.hdf5lib.exceptions.HDF5Exception
- * object is not an array.
+ * object is not an array.
*/
- public HDFArray(Object anArray) throws HDF5Exception {
-
+ public HDFArray(Object anArray) throws HDF5Exception
+ {
if (anArray == null) {
- HDF5JavaException ex = new HDF5JavaException(
- "HDFArray: array is null?: ");
+ HDF5JavaException ex = new HDF5JavaException("HDFArray: array is null?: ");
}
Class tc = anArray.getClass();
if (tc.isArray() == false) {
/* exception: not an array */
- HDF5JavaException ex = new HDF5JavaException(
- "HDFArray: not an array?: ");
+ HDF5JavaException ex = new HDF5JavaException("HDFArray: not an array?: ");
throw (ex);
}
_theArray = anArray;
@@ -72,8 +65,7 @@ public class HDFArray {
/* extra error checking -- probably not needed */
if (_desc == null) {
- HDF5JavaException ex = new HDF5JavaException(
- "HDFArray: internal error: array description failed?: ");
+ HDF5JavaException ex = new HDF5JavaException("HDFArray: internal error: array description failed?: ");
throw (ex);
}
}
@@ -81,49 +73,48 @@ public class HDFArray {
/**
* Allocate a one-dimensional array of bytes sufficient to store the array.
*
- * @return A one-D array of bytes, filled with zeroes. The bytes are
- * sufficient to hold the data of the Array passed to the
- * constructor.
+ * @return A one-D array of bytes, filled with zeroes. The bytes are sufficient to hold the data of the Array passed
+ * to the constructor.
* @exception hdf.hdf5lib.exceptions.HDF5JavaException
- * Allocation failed.
+ * Allocation failed.
*/
- public byte[] emptyBytes() throws HDF5JavaException {
+ public byte[] emptyBytes()
+ throws HDF5JavaException
+ {
byte[] b = null;
- if ((ArrayDescriptor.dims == 1) && (ArrayDescriptor.NT == 'B')) {
+ if ((ArrayDescriptor.dims == 1)
+ && (ArrayDescriptor.NT == 'B')) {
b = (byte[]) _theArray;
}
else {
b = new byte[ArrayDescriptor.totalSize];
}
if (b == null) {
- HDF5JavaException ex = new HDF5JavaException(
- "HDFArray: emptyBytes: allocation failed");
+ HDF5JavaException ex = new HDF5JavaException("HDFArray: emptyBytes: allocation failed");
throw (ex);
}
return (b);
}
/**
- * Given a Java array of numbers, convert it to a one-dimensional array of
- * bytes in correct native order.
+ * Given a Java array of numbers, convert it to a one-dimensional array of bytes in correct native order.
*
- * @return A one-D array of bytes, constructed from the Array passed to the
- * constructor.
+ * @return A one-D array of bytes, constructed from the Array passed to the constructor.
* @exception hdf.hdf5lib.exceptions.HDF5JavaException
- * the object not an array or other internal error.
+ * the object not an array or other internal error.
*/
- public byte[] byteify() throws HDF5JavaException {
-
+ public byte[] byteify()
+ throws HDF5JavaException
+ {
if (_barray != null) {
return _barray;
}
if (_theArray == null) {
/* exception: not an array */
- HDF5JavaException ex = new HDF5JavaException(
- "HDFArray: byteify not an array?: ");
+ HDF5JavaException ex = new HDF5JavaException("HDFArray: byteify not an array?: ");
throw (ex);
}
@@ -140,73 +131,53 @@ public class HDFArray {
byte[] therow;
if (ArrayDescriptor.NT == 'I') {
- therow = HDFNativeData.intToByte(0,
- ArrayDescriptor.dimlen[1], (int[]) _theArray);
+ therow = HDFNativeData.intToByte(0, ArrayDescriptor.dimlen[1], (int[]) _theArray);
}
else if (ArrayDescriptor.NT == 'S') {
- therow = HDFNativeData.shortToByte(0,
- ArrayDescriptor.dimlen[1], (short[]) _theArray);
+ therow = HDFNativeData.shortToByte(0, ArrayDescriptor.dimlen[1], (short[]) _theArray);
}
else if (ArrayDescriptor.NT == 'F') {
- therow = HDFNativeData.floatToByte(0,
- ArrayDescriptor.dimlen[1], (float[]) _theArray);
+ therow = HDFNativeData.floatToByte(0, ArrayDescriptor.dimlen[1], (float[]) _theArray);
}
else if (ArrayDescriptor.NT == 'J') {
- therow = HDFNativeData.longToByte(0,
- ArrayDescriptor.dimlen[1], (long[]) _theArray);
+ therow = HDFNativeData.longToByte(0, ArrayDescriptor.dimlen[1], (long[]) _theArray);
}
else if (ArrayDescriptor.NT == 'D') {
- therow = HDFNativeData
- .doubleToByte(0, ArrayDescriptor.dimlen[1],
- (double[]) _theArray);
+ therow = HDFNativeData.doubleToByte(0, ArrayDescriptor.dimlen[1], (double[]) _theArray);
}
else if (ArrayDescriptor.NT == 'L') {
if (ArrayDescriptor.className.equals("java.lang.Byte")) {
therow = ByteObjToByte((Byte[]) _theArray);
}
- else if (ArrayDescriptor.className
- .equals("java.lang.Integer")) {
+ else if (ArrayDescriptor.className.equals("java.lang.Integer")) {
therow = IntegerToByte((Integer[]) _theArray);
}
- else if (ArrayDescriptor.className
- .equals("java.lang.Short")) {
+ else if (ArrayDescriptor.className.equals("java.lang.Short")) {
therow = ShortToByte((Short[]) _theArray);
}
- else if (ArrayDescriptor.className
- .equals("java.lang.Float")) {
+ else if (ArrayDescriptor.className.equals("java.lang.Float")) {
therow = FloatObjToByte((Float[]) _theArray);
}
- else if (ArrayDescriptor.className
- .equals("java.lang.Double")) {
+ else if (ArrayDescriptor.className.equals("java.lang.Double")) {
therow = DoubleObjToByte((Double[]) _theArray);
}
- else if (ArrayDescriptor.className
- .equals("java.lang.Long")) {
+ else if (ArrayDescriptor.className.equals("java.lang.Long")) {
therow = LongObjToByte((Long[]) _theArray);
}
else {
- HDF5JavaException ex = new HDF5JavaException(
- "HDFArray: unknown type of Object?");
+ HDF5JavaException ex = new HDF5JavaException("HDFArray: unknown type of Object?");
throw (ex);
}
}
else {
- HDF5JavaException ex = new HDF5JavaException(
- "HDFArray: unknown type of data?");
+ HDF5JavaException ex = new HDF5JavaException("HDFArray: unknown type of data?");
throw (ex);
}
- System
- .arraycopy(
- therow,
- 0,
- _barray,
- 0,
- (ArrayDescriptor.dimlen[1] * ArrayDescriptor.NTsize));
+ System.arraycopy(therow, 0, _barray, 0, (ArrayDescriptor.dimlen[1] * ArrayDescriptor.NTsize));
return _barray;
}
catch (OutOfMemoryError err) {
- HDF5JavaException ex = new HDF5JavaException(
- "HDFArray: byteify array too big?");
+ HDF5JavaException ex = new HDF5JavaException("HDFArray: byteify array too big?");
throw (ex);
}
}
@@ -216,8 +187,7 @@ public class HDFArray {
_barray = new byte[ArrayDescriptor.totalSize];
}
catch (OutOfMemoryError err) {
- HDF5JavaException ex = new HDF5JavaException(
- "HDFArray: byteify array too big?");
+ HDF5JavaException ex = new HDF5JavaException("HDFArray: byteify array too big?");
throw (ex);
}
@@ -240,8 +210,7 @@ public class HDFArray {
else {
/* check range of index */
if (index > (ArrayDescriptor.dimlen[i] - 1)) {
- throw new java.lang.IndexOutOfBoundsException(
- "HDFArray: byteify index OOB?");
+ throw new java.lang.IndexOutOfBoundsException("HDFArray: byteify index OOB?");
}
oo = java.lang.reflect.Array.get(oo, index);
ArrayDescriptor.currentindex[i] = index;
@@ -253,242 +222,187 @@ public class HDFArray {
byte arow[];
try {
if (ArrayDescriptor.NT == 'J') {
- arow = HDFNativeData
- .longToByte(
- 0,
- ArrayDescriptor.dimlen[ArrayDescriptor.dims],
- (long[]) ArrayDescriptor.objs[ArrayDescriptor.dims - 1]);
- arow = HDFNativeData
- .longToByte(
- 0,
- ArrayDescriptor.dimlen[ArrayDescriptor.dims],
- (long[]) ArrayDescriptor.objs[ArrayDescriptor.dims - 1]);
+ arow = HDFNativeData.longToByte(0, ArrayDescriptor.dimlen[ArrayDescriptor.dims],
+ (long[]) ArrayDescriptor.objs[ArrayDescriptor.dims - 1]);
+ arow = HDFNativeData.longToByte(0, ArrayDescriptor.dimlen[ArrayDescriptor.dims],
+ (long[]) ArrayDescriptor.objs[ArrayDescriptor.dims - 1]);
}
else if (ArrayDescriptor.NT == 'I') {
- arow = HDFNativeData
- .intToByte(
- 0,
- ArrayDescriptor.dimlen[ArrayDescriptor.dims],
- (int[]) ArrayDescriptor.objs[ArrayDescriptor.dims - 1]);
+ arow = HDFNativeData.intToByte(0, ArrayDescriptor.dimlen[ArrayDescriptor.dims],
+ (int[]) ArrayDescriptor.objs[ArrayDescriptor.dims - 1]);
}
else if (ArrayDescriptor.NT == 'S') {
- arow = HDFNativeData
- .shortToByte(
- 0,
- ArrayDescriptor.dimlen[ArrayDescriptor.dims],
- (short[]) ArrayDescriptor.objs[ArrayDescriptor.dims - 1]);
+ arow = HDFNativeData.shortToByte(0, ArrayDescriptor.dimlen[ArrayDescriptor.dims],
+ (short[]) ArrayDescriptor.objs[ArrayDescriptor.dims - 1]);
}
else if (ArrayDescriptor.NT == 'B') {
arow = (byte[]) ArrayDescriptor.objs[ArrayDescriptor.dims - 1];
}
else if (ArrayDescriptor.NT == 'F') {
/* 32 bit float */
- arow = HDFNativeData
- .floatToByte(
- 0,
- ArrayDescriptor.dimlen[ArrayDescriptor.dims],
- (float[]) ArrayDescriptor.objs[ArrayDescriptor.dims - 1]);
+ arow = HDFNativeData.floatToByte(0, ArrayDescriptor.dimlen[ArrayDescriptor.dims],
+ (float[]) ArrayDescriptor.objs[ArrayDescriptor.dims - 1]);
}
else if (ArrayDescriptor.NT == 'D') {
/* 64 bit float */
- arow = HDFNativeData
- .doubleToByte(
- 0,
- ArrayDescriptor.dimlen[ArrayDescriptor.dims],
- (double[]) ArrayDescriptor.objs[ArrayDescriptor.dims - 1]);
+ arow = HDFNativeData.doubleToByte(0, ArrayDescriptor.dimlen[ArrayDescriptor.dims],
+ (double[]) ArrayDescriptor.objs[ArrayDescriptor.dims - 1]);
}
else if (ArrayDescriptor.NT == 'L') {
if (ArrayDescriptor.className.equals("java.lang.Byte")) {
arow = ByteObjToByte((Byte[]) ArrayDescriptor.objs[ArrayDescriptor.dims - 1]);
}
- else if (ArrayDescriptor.className
- .equals("java.lang.Integer")) {
+ else if (ArrayDescriptor.className.equals("java.lang.Integer")) {
arow = IntegerToByte((Integer[]) ArrayDescriptor.objs[ArrayDescriptor.dims - 1]);
}
- else if (ArrayDescriptor.className
- .equals("java.lang.Short")) {
+ else if (ArrayDescriptor.className.equals("java.lang.Short")) {
arow = ShortToByte((Short[]) ArrayDescriptor.objs[ArrayDescriptor.dims - 1]);
}
- else if (ArrayDescriptor.className
- .equals("java.lang.Float")) {
+ else if (ArrayDescriptor.className.equals("java.lang.Float")) {
arow = FloatObjToByte((Float[]) ArrayDescriptor.objs[ArrayDescriptor.dims - 1]);
}
- else if (ArrayDescriptor.className
- .equals("java.lang.Double")) {
+ else if (ArrayDescriptor.className.equals("java.lang.Double")) {
arow = DoubleObjToByte((Double[]) ArrayDescriptor.objs[ArrayDescriptor.dims - 1]);
}
else if (ArrayDescriptor.className.equals("java.lang.Long")) {
arow = LongObjToByte((Long[]) ArrayDescriptor.objs[ArrayDescriptor.dims - 1]);
}
else {
- HDF5JavaException ex = new HDF5JavaException(
- "HDFArray: byteify Object type not implemented?");
+ HDF5JavaException ex = new HDF5JavaException("HDFArray: byteify Object type not implemented?");
throw (ex);
}
}
else {
- HDF5JavaException ex = new HDF5JavaException(
- "HDFArray: byteify unknown type not implemented?");
+ HDF5JavaException ex = new HDF5JavaException("HDFArray: byteify unknown type not implemented?");
throw (ex);
}
- System
- .arraycopy(
- arow,
- 0,
- _barray,
- n,
- (ArrayDescriptor.dimlen[ArrayDescriptor.dims] * ArrayDescriptor.NTsize));
+ System.arraycopy(arow, 0, _barray, n,
+ (ArrayDescriptor.dimlen[ArrayDescriptor.dims] * ArrayDescriptor.NTsize));
n += ArrayDescriptor.bytetoindex[ArrayDescriptor.dims - 1];
}
catch (OutOfMemoryError err) {
- HDF5JavaException ex = new HDF5JavaException(
- "HDFArray: byteify array too big?");
+ HDF5JavaException ex = new HDF5JavaException("HDFArray: byteify array too big?");
throw (ex);
}
}
/* assert: the whole array is completed--currentindex should == len - 1 */
-
/* error checks */
-
if (n < ArrayDescriptor.totalSize) {
- throw new java.lang.InternalError(new String(
- "HDFArray::byteify: Panic didn't complete all input data: n= "
- + n + " size = " + ArrayDescriptor.totalSize));
+ throw new java.lang.InternalError(new String("HDFArray::byteify: Panic didn't complete all input data: n= "
+ + n + " size = " + ArrayDescriptor.totalSize));
}
for (i = 0; i < ArrayDescriptor.dims; i++) {
if (ArrayDescriptor.currentindex[i] != ArrayDescriptor.dimlen[i] - 1) {
throw new java.lang.InternalError(new String(
- "Panic didn't complete all data: currentindex[" + i
- + "] = " + ArrayDescriptor.currentindex[i]
- + " (should be "
- + (ArrayDescriptor.dimlen[i] - 1) + " ?)"));
+ "Panic didn't complete all data: currentindex[" + i + "] = " + ArrayDescriptor.currentindex[i]
+ + " (should be " + (ArrayDescriptor.dimlen[i] - 1) + " ?)"));
}
}
return _barray;
}
/**
- * Given a one-dimensional array of bytes representing numbers, convert it
- * to a java array of the shape and size passed to the constructor.
+ * Given a one-dimensional array of bytes representing numbers, convert it to a java array of the shape and size
+ * passed to the constructor.
*
* @param bytes
- * The bytes to construct the Array.
- * @return An Array (possibly multidimensional) of primitive or number
- * objects.
- * @exception hdf.hdf5lib.exceptions.HDF5JavaException
- * the object not an array or other internal error.
+ * The bytes to construct the Array.
+ * @return
+ * An Array (possibly multidimensional) of primitive or number objects.
+ * @exception
+ * hdf.hdf5lib.exceptions.HDF5JavaException the object not an array or other internal error.
*/
- public Object arrayify(byte[] bytes) throws HDF5JavaException {
-
+ public Object arrayify(byte[] bytes) throws HDF5JavaException
+ {
if (_theArray == null) {
/* exception: not an array */
- HDF5JavaException ex = new HDF5JavaException(
- "arrayify: not an array?: ");
+ HDF5JavaException ex = new HDF5JavaException("arrayify: not an array?: ");
throw (ex);
}
if (java.lang.reflect.Array.getLength(bytes) != ArrayDescriptor.totalSize) {
/* exception: array not right size */
- HDF5JavaException ex = new HDF5JavaException(
- "arrayify: array is wrong size?: ");
+ HDF5JavaException ex = new HDF5JavaException("arrayify: array is wrong size?: ");
throw (ex);
}
_barray = bytes; /* hope that the bytes are correct.... */
+
if (ArrayDescriptor.dims == 1) {
/* special case */
/* 2 data copies here! */
try {
if (ArrayDescriptor.NT == 'I') {
int[] x = HDFNativeData.byteToInt(_barray);
- System.arraycopy(x, 0, _theArray, 0,
- ArrayDescriptor.dimlen[1]);
+ System.arraycopy(x, 0, _theArray, 0, ArrayDescriptor.dimlen[1]);
return _theArray;
}
else if (ArrayDescriptor.NT == 'S') {
short[] x = HDFNativeData.byteToShort(_barray);
- System.arraycopy(x, 0, _theArray, 0,
- ArrayDescriptor.dimlen[1]);
+ System.arraycopy(x, 0, _theArray, 0, ArrayDescriptor.dimlen[1]);
return _theArray;
}
else if (ArrayDescriptor.NT == 'F') {
float x[] = HDFNativeData.byteToFloat(_barray);
- System.arraycopy(x, 0, _theArray, 0,
- ArrayDescriptor.dimlen[1]);
+ System.arraycopy(x, 0, _theArray, 0, ArrayDescriptor.dimlen[1]);
return _theArray;
}
else if (ArrayDescriptor.NT == 'J') {
long x[] = HDFNativeData.byteToLong(_barray);
- System.arraycopy(x, 0, _theArray, 0,
- ArrayDescriptor.dimlen[1]);
+ System.arraycopy(x, 0, _theArray, 0, ArrayDescriptor.dimlen[1]);
return _theArray;
}
else if (ArrayDescriptor.NT == 'D') {
double x[] = HDFNativeData.byteToDouble(_barray);
- System.arraycopy(x, 0, _theArray, 0,
- ArrayDescriptor.dimlen[1]);
+ System.arraycopy(x, 0, _theArray, 0, ArrayDescriptor.dimlen[1]);
return _theArray;
}
else if (ArrayDescriptor.NT == 'B') {
- System.arraycopy(_barray, 0, _theArray, 0,
- ArrayDescriptor.dimlen[1]);
+ System.arraycopy(_barray, 0, _theArray, 0, ArrayDescriptor.dimlen[1]);
return _theArray;
}
else if (ArrayDescriptor.NT == 'L') {
if (ArrayDescriptor.className.equals("java.lang.Byte")) {
Byte I[] = ByteToByteObj(_barray);
- System.arraycopy(I, 0, _theArray, 0,
- ArrayDescriptor.dimlen[1]);
+ System.arraycopy(I, 0, _theArray, 0, ArrayDescriptor.dimlen[1]);
return _theArray;
}
- else if (ArrayDescriptor.className
- .equals("java.lang.Integer")) {
+ else if (ArrayDescriptor.className.equals("java.lang.Integer")) {
Integer I[] = ByteToInteger(_barray);
- System.arraycopy(I, 0, _theArray, 0,
- ArrayDescriptor.dimlen[1]);
+ System.arraycopy(I, 0, _theArray, 0, ArrayDescriptor.dimlen[1]);
return _theArray;
}
- else if (ArrayDescriptor.className
- .equals("java.lang.Short")) {
+ else if (ArrayDescriptor.className.equals("java.lang.Short")) {
Short I[] = ByteToShort(_barray);
- System.arraycopy(I, 0, _theArray, 0,
- ArrayDescriptor.dimlen[1]);
+ System.arraycopy(I, 0, _theArray, 0, ArrayDescriptor.dimlen[1]);
return _theArray;
}
- else if (ArrayDescriptor.className
- .equals("java.lang.Float")) {
+ else if (ArrayDescriptor.className.equals("java.lang.Float")) {
Float I[] = ByteToFloatObj(_barray);
- System.arraycopy(I, 0, _theArray, 0,
- ArrayDescriptor.dimlen[1]);
+ System.arraycopy(I, 0, _theArray, 0, ArrayDescriptor.dimlen[1]);
return _theArray;
}
- else if (ArrayDescriptor.className
- .equals("java.lang.Double")) {
+ else if (ArrayDescriptor.className.equals("java.lang.Double")) {
Double I[] = ByteToDoubleObj(_barray);
- System.arraycopy(I, 0, _theArray, 0,
- ArrayDescriptor.dimlen[1]);
+ System.arraycopy(I, 0, _theArray, 0, ArrayDescriptor.dimlen[1]);
return _theArray;
}
else if (ArrayDescriptor.className.equals("java.lang.Long")) {
Long I[] = ByteToLongObj(_barray);
- System.arraycopy(I, 0, _theArray, 0,
- ArrayDescriptor.dimlen[1]);
+ System.arraycopy(I, 0, _theArray, 0, ArrayDescriptor.dimlen[1]);
return _theArray;
}
else {
- HDF5JavaException ex = new HDF5JavaException(
- "arrayify: Object type not implemented yet...");
+ HDF5JavaException ex = new HDF5JavaException("arrayify: Object type not implemented yet...");
throw (ex);
}
}
else {
- HDF5JavaException ex = new HDF5JavaException(
- "arrayify: unknown type not implemented yet...");
+ HDF5JavaException ex = new HDF5JavaException("arrayify: unknown type not implemented yet...");
throw (ex);
}
}
catch (OutOfMemoryError err) {
- HDF5JavaException ex = new HDF5JavaException(
- "HDFArray: arrayify array too big?");
+ HDF5JavaException ex = new HDF5JavaException("HDFArray: arrayify array too big?");
throw (ex);
}
}
@@ -496,8 +410,54 @@ public class HDFArray {
Object oo = _theArray;
int n = 0; /* the current byte */
+ int m = 0; /* the current array index */
int index = 0;
int i;
+ Object flattenedArray = null;
+
+ switch (ArrayDescriptor.NT) {
+ case 'J':
+ flattenedArray = (Object) HDFNativeData.byteToLong(_barray);
+ break;
+ case 'S':
+ flattenedArray = (Object) HDFNativeData.byteToShort(_barray);
+ break;
+ case 'I':
+ flattenedArray = (Object) HDFNativeData.byteToInt(_barray);
+ break;
+ case 'F':
+ flattenedArray = (Object) HDFNativeData.byteToFloat(_barray);
+ break;
+ case 'D':
+ flattenedArray = (Object) HDFNativeData.byteToDouble(_barray);
+ break;
+ case 'B':
+ flattenedArray = (Object) _barray;
+ break;
+ case 'L':
+ {
+ if (ArrayDescriptor.className.equals("java.lang.Byte"))
+ flattenedArray = (Object) ByteToByteObj(_barray);
+ else if (ArrayDescriptor.className.equals("java.lang.Short"))
+ flattenedArray = (Object) ByteToShort(_barray);
+ else if (ArrayDescriptor.className.equals("java.lang.Integer"))
+ flattenedArray = (Object) ByteToInteger(_barray);
+ else if (ArrayDescriptor.className.equals("java.lang.Long"))
+ flattenedArray = (Object) ByteToLongObj(_barray);
+ else if (ArrayDescriptor.className.equals("java.lang.Float"))
+ flattenedArray = (Object) ByteToFloatObj(_barray);
+ else if (ArrayDescriptor.className.equals("java.lang.Double"))
+ flattenedArray = (Object) ByteToDoubleObj(_barray);
+ else {
+ HDF5JavaException ex = new HDF5JavaException("HDFArray: unsupported Object type: " + ArrayDescriptor.NT);
+ throw (ex);
+ }
+ } // end of statement for arrays of boxed objects
+ default:
+ HDF5JavaException ex = new HDF5JavaException("HDFArray: unknown or unsupported type: " + ArrayDescriptor.NT);
+ throw (ex);
+ } // end of switch statement for arrays of primitives
+
while (n < ArrayDescriptor.totalSize) {
oo = ArrayDescriptor.objs[0];
index = n / ArrayDescriptor.bytetoindex[0];
@@ -524,222 +484,86 @@ public class HDFArray {
/* array-ify */
try {
- if (ArrayDescriptor.NT == 'J') {
- long[] arow = HDFNativeData.byteToLong(n,
- ArrayDescriptor.dimlen[ArrayDescriptor.dims],
- _barray);
- java.lang.reflect.Array
- .set(
- ArrayDescriptor.objs[ArrayDescriptor.dims - 2],
- (ArrayDescriptor.currentindex[ArrayDescriptor.dims - 1]),
- arow);
- n += ArrayDescriptor.bytetoindex[ArrayDescriptor.dims - 1];
- ArrayDescriptor.currentindex[ArrayDescriptor.dims - 1]++;
- }
- else if (ArrayDescriptor.NT == 'I') {
- int[] arow = HDFNativeData.byteToInt(n,
- ArrayDescriptor.dimlen[ArrayDescriptor.dims],
- _barray);
- java.lang.reflect.Array
- .set(
- ArrayDescriptor.objs[ArrayDescriptor.dims - 2],
- (ArrayDescriptor.currentindex[ArrayDescriptor.dims - 1]),
- arow);
-
- n += ArrayDescriptor.bytetoindex[ArrayDescriptor.dims - 1];
- ArrayDescriptor.currentindex[ArrayDescriptor.dims - 1]++;
- }
- else if (ArrayDescriptor.NT == 'S') {
- short[] arow = HDFNativeData.byteToShort(n,
- ArrayDescriptor.dimlen[ArrayDescriptor.dims],
- _barray);
- java.lang.reflect.Array
- .set(
- ArrayDescriptor.objs[ArrayDescriptor.dims - 2],
- (ArrayDescriptor.currentindex[ArrayDescriptor.dims - 1]),
- arow);
-
- n += ArrayDescriptor.bytetoindex[ArrayDescriptor.dims - 1];
- ArrayDescriptor.currentindex[ArrayDescriptor.dims - 1]++;
- }
- else if (ArrayDescriptor.NT == 'B') {
- System.arraycopy(_barray, n,
- ArrayDescriptor.objs[ArrayDescriptor.dims - 1], 0,
- ArrayDescriptor.dimlen[ArrayDescriptor.dims]);
- n += ArrayDescriptor.bytetoindex[ArrayDescriptor.dims - 1];
- }
- else if (ArrayDescriptor.NT == 'F') {
- float arow[] = HDFNativeData.byteToFloat(n,
- ArrayDescriptor.dimlen[ArrayDescriptor.dims],
- _barray);
- java.lang.reflect.Array
- .set(
- ArrayDescriptor.objs[ArrayDescriptor.dims - 2],
- (ArrayDescriptor.currentindex[ArrayDescriptor.dims - 1]),
- arow);
-
- n += ArrayDescriptor.bytetoindex[ArrayDescriptor.dims - 1];
- ArrayDescriptor.currentindex[ArrayDescriptor.dims - 1]++;
- }
- else if (ArrayDescriptor.NT == 'D') {
- double[] arow = HDFNativeData.byteToDouble(n,
- ArrayDescriptor.dimlen[ArrayDescriptor.dims],
- _barray);
- java.lang.reflect.Array
- .set(
- ArrayDescriptor.objs[ArrayDescriptor.dims - 2],
- (ArrayDescriptor.currentindex[ArrayDescriptor.dims - 1]),
- arow);
-
- n += ArrayDescriptor.bytetoindex[ArrayDescriptor.dims - 1];
- ArrayDescriptor.currentindex[ArrayDescriptor.dims - 1]++;
- }
- else if (ArrayDescriptor.NT == 'L') {
- if (ArrayDescriptor.className.equals("java.lang.Byte")) {
- Byte I[] = ByteToByteObj(n,
- ArrayDescriptor.dimlen[ArrayDescriptor.dims],
- _barray);
- java.lang.reflect.Array
- .set(
- ArrayDescriptor.objs[ArrayDescriptor.dims - 2],
- (ArrayDescriptor.currentindex[ArrayDescriptor.dims - 1]),
- I);
-
- n += ArrayDescriptor.bytetoindex[ArrayDescriptor.dims - 1];
- ArrayDescriptor.currentindex[ArrayDescriptor.dims - 1]++;
- }
- else if (ArrayDescriptor.className
- .equals("java.lang.Integer")) {
- Integer I[] = ByteToInteger(n,
- ArrayDescriptor.dimlen[ArrayDescriptor.dims],
- _barray);
- java.lang.reflect.Array
- .set(
- ArrayDescriptor.objs[ArrayDescriptor.dims - 2],
- (ArrayDescriptor.currentindex[ArrayDescriptor.dims - 1]),
- I);
-
- n += ArrayDescriptor.bytetoindex[ArrayDescriptor.dims - 1];
- ArrayDescriptor.currentindex[ArrayDescriptor.dims - 1]++;
- }
- else if (ArrayDescriptor.className
- .equals("java.lang.Short")) {
- Short I[] = ByteToShort(n,
- ArrayDescriptor.dimlen[ArrayDescriptor.dims],
- _barray);
- java.lang.reflect.Array
- .set(
- ArrayDescriptor.objs[ArrayDescriptor.dims - 2],
- (ArrayDescriptor.currentindex[ArrayDescriptor.dims - 1]),
- I);
-
- n += ArrayDescriptor.bytetoindex[ArrayDescriptor.dims - 1];
- ArrayDescriptor.currentindex[ArrayDescriptor.dims - 1]++;
- }
- else if (ArrayDescriptor.className
- .equals("java.lang.Float")) {
- Float I[] = ByteToFloatObj(n,
- ArrayDescriptor.dimlen[ArrayDescriptor.dims],
- _barray);
- java.lang.reflect.Array
- .set(
- ArrayDescriptor.objs[ArrayDescriptor.dims - 2],
- (ArrayDescriptor.currentindex[ArrayDescriptor.dims - 1]),
- I);
-
- n += ArrayDescriptor.bytetoindex[ArrayDescriptor.dims - 1];
- ArrayDescriptor.currentindex[ArrayDescriptor.dims - 1]++;
- }
- else if (ArrayDescriptor.className
- .equals("java.lang.Double")) {
- Double I[] = ByteToDoubleObj(n,
- ArrayDescriptor.dimlen[ArrayDescriptor.dims],
- _barray);
- java.lang.reflect.Array
- .set(
- ArrayDescriptor.objs[ArrayDescriptor.dims - 2],
- (ArrayDescriptor.currentindex[ArrayDescriptor.dims - 1]),
- I);
-
- n += ArrayDescriptor.bytetoindex[ArrayDescriptor.dims - 1];
- ArrayDescriptor.currentindex[ArrayDescriptor.dims - 1]++;
- }
- else if (ArrayDescriptor.className.equals("java.lang.Long")) {
- Long I[] = ByteToLongObj(n,
- ArrayDescriptor.dimlen[ArrayDescriptor.dims],
- _barray);
- java.lang.reflect.Array
- .set(
- ArrayDescriptor.objs[ArrayDescriptor.dims - 2],
- (ArrayDescriptor.currentindex[ArrayDescriptor.dims - 1]),
- I);
-
- n += ArrayDescriptor.bytetoindex[ArrayDescriptor.dims - 1];
- ArrayDescriptor.currentindex[ArrayDescriptor.dims - 1]++;
- }
- else {
- HDF5JavaException ex = new HDF5JavaException(
- "HDFArray: unsupported Object type: "
- + ArrayDescriptor.NT);
- throw (ex);
- }
- }
- else {
- HDF5JavaException ex = new HDF5JavaException(
- "HDFArray: unknown or unsupported type: "
- + ArrayDescriptor.NT);
- throw (ex);
- }
+ Object arow = null;
+ int mm = m + ArrayDescriptor.dimlen[ArrayDescriptor.dims];
+ switch (ArrayDescriptor.NT) {
+ case 'B':
+ arow = (Object) Arrays.copyOfRange((byte[]) flattenedArray, m, mm);
+ break;
+ case 'S':
+ arow = (Object) Arrays.copyOfRange((short[]) flattenedArray, m, mm);
+ break;
+ case 'I':
+ arow = (Object) Arrays.copyOfRange((int[]) flattenedArray, m, mm);
+ break;
+ case 'J':
+ arow = (Object) Arrays.copyOfRange((long[]) flattenedArray, m, mm);
+ break;
+ case 'F':
+ arow = (Object) Arrays.copyOfRange((float[]) flattenedArray, m, mm);
+ break;
+ case 'D':
+ arow = (Object) Arrays.copyOfRange((double[]) flattenedArray, m, mm);
+ break;
+ case 'L':
+ {
+ if (ArrayDescriptor.className.equals("java.lang.Byte"))
+ arow = (Object) Arrays.copyOfRange((Byte[]) flattenedArray, m, mm);
+ else if (ArrayDescriptor.className.equals("java.lang.Short"))
+ arow = (Object) Arrays.copyOfRange((Short[]) flattenedArray, m, mm);
+ else if (ArrayDescriptor.className.equals("java.lang.Integer"))
+ arow = (Object) Arrays.copyOfRange((Integer[]) flattenedArray, m, mm);
+ else if (ArrayDescriptor.className.equals("java.lang.Long"))
+ arow = (Object) Arrays.copyOfRange((Long[]) flattenedArray, m, mm);
+ else if (ArrayDescriptor.className.equals("java.lang.Float"))
+ arow = (Object) Arrays.copyOfRange((Float[]) flattenedArray, m, mm);
+ else if (ArrayDescriptor.className.equals("java.lang.Double"))
+ arow = (Object) Arrays.copyOfRange((Double[]) flattenedArray, m, mm);
+ else {
+ HDF5JavaException ex = new HDF5JavaException("HDFArray: unsupported Object type: " + ArrayDescriptor.NT);
+ throw (ex);
+ }
+ } // end of statement for arrays of boxed numerics
+ } // end of switch statement for arrays of primitives
+
+ java.lang.reflect.Array.set(ArrayDescriptor.objs[ArrayDescriptor.dims - 2],
+ (ArrayDescriptor.currentindex[ArrayDescriptor.dims - 1]), arow);
+ n += ArrayDescriptor.bytetoindex[ArrayDescriptor.dims - 1];
+ ArrayDescriptor.currentindex[ArrayDescriptor.dims - 1]++;
+ m = mm;
}
catch (OutOfMemoryError err) {
- HDF5JavaException ex = new HDF5JavaException(
- "HDFArray: arrayify array too big?");
+ HDF5JavaException ex = new HDF5JavaException("HDFArray: arrayify array too big?");
throw (ex);
}
-
}
/* assert: the whole array is completed--currentindex should == len - 1 */
-
/* error checks */
-
if (n < ArrayDescriptor.totalSize) {
- throw new java.lang.InternalError(new String(
- "HDFArray::arrayify Panic didn't complete all input data: n= "
- + n + " size = " + ArrayDescriptor.totalSize));
+ throw new java.lang.InternalError(new String("HDFArray::arrayify Panic didn't complete all input data: n= "
+ + n + " size = " + ArrayDescriptor.totalSize));
}
for (i = 0; i <= ArrayDescriptor.dims - 2; i++) {
if (ArrayDescriptor.currentindex[i] != ArrayDescriptor.dimlen[i] - 1) {
- throw new java.lang.InternalError(new String(
- "HDFArray::arrayify Panic didn't complete all data: currentindex["
- + i + "] = " + ArrayDescriptor.currentindex[i]
- + " (should be "
- + (ArrayDescriptor.dimlen[i] - 1) + "?"));
- }
- }
- if (ArrayDescriptor.NT != 'B') {
- if (ArrayDescriptor.currentindex[ArrayDescriptor.dims - 1] != ArrayDescriptor.dimlen[ArrayDescriptor.dims - 1]) {
- throw new java.lang.InternalError(new String(
- "HDFArray::arrayify Panic didn't complete all data: currentindex["
- + i + "] = " + ArrayDescriptor.currentindex[i]
- + " (should be " + (ArrayDescriptor.dimlen[i])
+ throw new java.lang.InternalError(
+ new String("HDFArray::arrayify Panic didn't complete all data: currentindex[" + i + "] = "
+ + ArrayDescriptor.currentindex[i] + " (should be " + (ArrayDescriptor.dimlen[i] - 1)
+ "?"));
}
}
- else {
- if (ArrayDescriptor.currentindex[ArrayDescriptor.dims - 1] != (ArrayDescriptor.dimlen[ArrayDescriptor.dims - 1] - 1)) {
- throw new java.lang.InternalError(new String(
- "HDFArray::arrayify Panic didn't complete all data: currentindex["
- + i + "] = " + ArrayDescriptor.currentindex[i]
- + " (should be "
- + (ArrayDescriptor.dimlen[i] - 1) + "?"));
- }
+ if (ArrayDescriptor.currentindex[ArrayDescriptor.dims - 1] != ArrayDescriptor.dimlen[ArrayDescriptor.dims
+ - 1]) {
+ throw new java.lang.InternalError(
+ new String("HDFArray::arrayify Panic didn't complete all data: currentindex[" + i + "] = "
+ + ArrayDescriptor.currentindex[i] + " (should be " + (ArrayDescriptor.dimlen[i]) + "?"));
}
return _theArray;
}
- private byte[] IntegerToByte(Integer in[]) {
+ private byte[] IntegerToByte(Integer in[])
+ {
int nelems = java.lang.reflect.Array.getLength(in);
int[] out = new int[nelems];
@@ -749,7 +573,8 @@ public class HDFArray {
return HDFNativeData.intToByte(0, nelems, out);
}
- private Integer[] ByteToInteger(byte[] bin) {
+ private Integer[] ByteToInteger(byte[] bin)
+ {
int in[] = HDFNativeData.byteToInt(bin);
int nelems = java.lang.reflect.Array.getLength(in);
Integer[] out = new Integer[nelems];
@@ -760,7 +585,8 @@ public class HDFArray {
return out;
}
- private Integer[] ByteToInteger(int start, int len, byte[] bin) {
+ private Integer[] ByteToInteger(int start, int len, byte[] bin)
+ {
int in[] = HDFNativeData.byteToInt(start, len, bin);
int nelems = java.lang.reflect.Array.getLength(in);
Integer[] out = new Integer[nelems];
@@ -771,7 +597,8 @@ public class HDFArray {
return out;
}
- private byte[] ShortToByte(Short in[]) {
+ private byte[] ShortToByte(Short in[])
+ {
int nelems = java.lang.reflect.Array.getLength(in);
short[] out = new short[nelems];
@@ -781,7 +608,8 @@ public class HDFArray {
return HDFNativeData.shortToByte(0, nelems, out);
}
- private Short[] ByteToShort(byte[] bin) {
+ private Short[] ByteToShort(byte[] bin)
+ {
short in[] = HDFNativeData.byteToShort(bin);
int nelems = java.lang.reflect.Array.getLength((Object) in);
Short[] out = new Short[nelems];
@@ -792,7 +620,8 @@ public class HDFArray {
return out;
}
- private Short[] ByteToShort(int start, int len, byte[] bin) {
+ private Short[] ByteToShort(int start, int len, byte[] bin)
+ {
short in[] = (short[]) HDFNativeData.byteToShort(start, len, bin);
int nelems = java.lang.reflect.Array.getLength((Object) in);
Short[] out = new Short[nelems];
@@ -803,7 +632,8 @@ public class HDFArray {
return out;
}
- private byte[] ByteObjToByte(Byte in[]) {
+ private byte[] ByteObjToByte(Byte in[])
+ {
int nelems = java.lang.reflect.Array.getLength((Object) in);
byte[] out = new byte[nelems];
@@ -813,7 +643,8 @@ public class HDFArray {
return out;
}
- private Byte[] ByteToByteObj(byte[] bin) {
+ private Byte[] ByteToByteObj(byte[] bin)
+ {
int nelems = java.lang.reflect.Array.getLength((Object) bin);
Byte[] out = new Byte[nelems];
@@ -823,7 +654,8 @@ public class HDFArray {
return out;
}
- private Byte[] ByteToByteObj(int start, int len, byte[] bin) {
+ private Byte[] ByteToByteObj(int start, int len, byte[] bin)
+ {
Byte[] out = new Byte[len];
for (int i = 0; i < len; i++) {
@@ -832,7 +664,8 @@ public class HDFArray {
return out;
}
- private byte[] FloatObjToByte(Float in[]) {
+ private byte[] FloatObjToByte(Float in[])
+ {
int nelems = java.lang.reflect.Array.getLength((Object) in);
float[] out = new float[nelems];
@@ -842,7 +675,8 @@ public class HDFArray {
return HDFNativeData.floatToByte(0, nelems, out);
}
- private Float[] ByteToFloatObj(byte[] bin) {
+ private Float[] ByteToFloatObj(byte[] bin)
+ {
float in[] = (float[]) HDFNativeData.byteToFloat(bin);
int nelems = java.lang.reflect.Array.getLength((Object) in);
Float[] out = new Float[nelems];
@@ -853,7 +687,8 @@ public class HDFArray {
return out;
}
- private Float[] ByteToFloatObj(int start, int len, byte[] bin) {
+ private Float[] ByteToFloatObj(int start, int len, byte[] bin)
+ {
float in[] = (float[]) HDFNativeData.byteToFloat(start, len, bin);
int nelems = java.lang.reflect.Array.getLength((Object) in);
Float[] out = new Float[nelems];
@@ -864,7 +699,8 @@ public class HDFArray {
return out;
}
- private byte[] DoubleObjToByte(Double in[]) {
+ private byte[] DoubleObjToByte(Double in[])
+ {
int nelems = java.lang.reflect.Array.getLength((Object) in);
double[] out = new double[nelems];
@@ -874,7 +710,8 @@ public class HDFArray {
return HDFNativeData.doubleToByte(0, nelems, out);
}
- private Double[] ByteToDoubleObj(byte[] bin) {
+ private Double[] ByteToDoubleObj(byte[] bin)
+ {
double in[] = (double[]) HDFNativeData.byteToDouble(bin);
int nelems = java.lang.reflect.Array.getLength((Object) in);
Double[] out = new Double[nelems];
@@ -885,7 +722,8 @@ public class HDFArray {
return out;
}
- private Double[] ByteToDoubleObj(int start, int len, byte[] bin) {
+ private Double[] ByteToDoubleObj(int start, int len, byte[] bin)
+ {
double in[] = (double[]) HDFNativeData.byteToDouble(start, len, bin);
int nelems = java.lang.reflect.Array.getLength((Object) in);
Double[] out = new Double[nelems];
@@ -896,7 +734,8 @@ public class HDFArray {
return out;
}
- private byte[] LongObjToByte(Long in[]) {
+ private byte[] LongObjToByte(Long in[])
+ {
int nelems = java.lang.reflect.Array.getLength((Object) in);
long[] out = new long[nelems];
@@ -906,7 +745,8 @@ public class HDFArray {
return HDFNativeData.longToByte(0, nelems, out);
}
- private Long[] ByteToLongObj(byte[] bin) {
+ private Long[] ByteToLongObj(byte[] bin)
+ {
long in[] = (long[]) HDFNativeData.byteToLong(bin);
int nelems = java.lang.reflect.Array.getLength((Object) in);
Long[] out = new Long[nelems];
@@ -917,7 +757,8 @@ public class HDFArray {
return out;
}
- private Long[] ByteToLongObj(int start, int len, byte[] bin) {
+ private Long[] ByteToLongObj(int start, int len, byte[] bin)
+ {
long in[] = (long[]) HDFNativeData.byteToLong(start, len, bin);
int nelems = java.lang.reflect.Array.getLength((Object) in);
Long[] out = new Long[nelems];
@@ -930,13 +771,11 @@ public class HDFArray {
}
/**
- * This private class is used by HDFArray to discover the shape and type of an
- * arbitrary array.
+ * This private class is used by HDFArray to discover the shape and type of an arbitrary array.
* <p>
* We use java.lang.reflection here.
*/
class ArrayDescriptor {
-
static String theType = "";
static Class theClass = null;
static int[] dimlen = null;
@@ -944,19 +783,19 @@ class ArrayDescriptor {
static int[] currentindex = null;
static int[] bytetoindex = null;
static int totalSize = 0;
+ static int totalElements = 0;
static Object[] objs = null;
static char NT = ' '; /* must be B,S,I,L,F,D, else error */
static int NTsize = 0;
static int dims = 0;
static String className;
- public ArrayDescriptor(Object anArray) throws HDF5Exception {
-
+ public ArrayDescriptor(Object anArray) throws HDF5Exception
+ {
Class tc = anArray.getClass();
if (tc.isArray() == false) {
/* exception: not an array */
- HDF5Exception ex = new HDF5JavaException(
- "ArrayDescriptor: not an array?: ");
+ HDF5Exception ex = new HDF5JavaException("ArrayDescriptor: not an array?: ");
throw (ex);
}
@@ -1028,16 +867,14 @@ class ArrayDescriptor {
NT = 'L';
className = "java.lang.String";
NTsize = 1;
- throw new HDF5JavaException(new String(
- "ArrayDesciptor: Warning: String array not fully supported yet"));
+ throw new HDF5JavaException(new String("ArrayDesciptor: Warning: String array not fully supported yet"));
}
else {
/*
* exception: not a numeric type
*/
- throw new HDF5JavaException(new String(
- "ArrayDesciptor: Error: array is not numeric (type is "
- + css + ") ?"));
+ throw new HDF5JavaException(
+ new String("ArrayDesciptor: Error: array is not numeric (type is " + css + ") ?"));
}
/* fill in the table */
@@ -1052,6 +889,7 @@ class ArrayDescriptor {
dimlen[0] = 1;
dimstart[0] = 0;
currentindex[0] = 0;
+ int elements = 1;
int i;
for (i = 1; i <= dims; i++) {
dimlen[i] = java.lang.reflect.Array.getLength((Object) o);
@@ -1059,7 +897,9 @@ class ArrayDescriptor {
objs[i] = o;
dimstart[i] = 0;
currentindex[i] = 0;
+ elements *= dimlen[i];
}
+ totalElements = elements;
int j;
int dd;
@@ -1078,20 +918,19 @@ class ArrayDescriptor {
/**
* Debug dump
*/
- public void dumpInfo() {
+ public void dumpInfo()
+ {
System.out.println("Type: " + theType);
System.out.println("Class: " + theClass);
System.out.println("NT: " + NT + " NTsize: " + NTsize);
System.out.println("Array has " + dims + " dimensions (" + totalSize
- + " bytes)");
+ + " bytes, " + totalElements + " elements)");
int i;
for (i = 0; i <= dims; i++) {
Class tc = objs[i].getClass();
String ss = tc.toString();
- System.out.println(i + ": start " + dimstart[i] + ": len "
- + dimlen[i] + " current " + currentindex[i]
- + " bytetoindex " + bytetoindex[i] + " object " + objs[i]
- + " otype " + ss);
+ System.out.println(i + ": start " + dimstart[i] + ": len " + dimlen[i] + " current " + currentindex[i]
+ + " bytetoindex " + bytetoindex[i] + " object " + objs[i] + " otype " + ss);
}
}
}
diff --git a/java/src/hdf/hdf5lib/callbacks/Callbacks.java b/java/src/hdf/hdf5lib/callbacks/Callbacks.java
index e2033fa..11fa465 100644
--- a/java/src/hdf/hdf5lib/callbacks/Callbacks.java
+++ b/java/src/hdf/hdf5lib/callbacks/Callbacks.java
@@ -1,6 +1,5 @@
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* 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 *
diff --git a/java/src/hdf/hdf5lib/callbacks/H5A_iterate_cb.java b/java/src/hdf/hdf5lib/callbacks/H5A_iterate_cb.java
index da59567..6c68f36 100644
--- a/java/src/hdf/hdf5lib/callbacks/H5A_iterate_cb.java
+++ b/java/src/hdf/hdf5lib/callbacks/H5A_iterate_cb.java
@@ -1,6 +1,5 @@
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* 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 *
@@ -15,7 +14,28 @@ package hdf.hdf5lib.callbacks;
import hdf.hdf5lib.structs.H5A_info_t;
-//Information class for link callback(for H5Aiterate)
+/**
+ * Information class for link callback for H5Aiterate.
+ *
+ */
public interface H5A_iterate_cb extends Callbacks {
- int callback(long group, String name, H5A_info_t info, H5A_iterate_t op_data);
+ /**
+ * application callback for each attribute
+ *
+ * @param loc_id the ID for the group or dataset being iterated over
+ * @param name the name of the current attribute about the object
+ * @param info the attribute's "info" struct
+ * @param op_data the operator data passed in to H5Aiterate
+ *
+ * @return operation status
+ * A. Zero causes the iterator to continue, returning zero when all
+ * attributes have been processed.
+ * B. Positive causes the iterator to immediately return that positive
+ * value, indicating short-circuit success. The iterator can be
+ * restarted at the next attribute.
+ * C. Negative causes the iterator to immediately return that value,
+ * indicating failure. The iterator can be restarted at the next
+ * attribute.
+ */
+ int callback(long loc_id, String name, H5A_info_t info, H5A_iterate_t op_data);
}
diff --git a/java/src/hdf/hdf5lib/callbacks/H5A_iterate_t.java b/java/src/hdf/hdf5lib/callbacks/H5A_iterate_t.java
index d229dd4..d612db3 100644
--- a/java/src/hdf/hdf5lib/callbacks/H5A_iterate_t.java
+++ b/java/src/hdf/hdf5lib/callbacks/H5A_iterate_t.java
@@ -1,6 +1,5 @@
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* 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 *
@@ -13,6 +12,10 @@
package hdf.hdf5lib.callbacks;
+/**
+ * Data class for link callback for H5Aiterate.
+ *
+ */
public interface H5A_iterate_t {
/** public ArrayList iterdata = new ArrayList();
* Any derived interfaces must define the single public variable as above.
diff --git a/java/src/hdf/hdf5lib/callbacks/H5D_append_cb.java b/java/src/hdf/hdf5lib/callbacks/H5D_append_cb.java
index a163f11..cf7ada6 100644
--- a/java/src/hdf/hdf5lib/callbacks/H5D_append_cb.java
+++ b/java/src/hdf/hdf5lib/callbacks/H5D_append_cb.java
@@ -1,6 +1,5 @@
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* 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 *
@@ -13,7 +12,27 @@
package hdf.hdf5lib.callbacks;
-//Information class for link callback(for H5Pset/get_append_flush)
+/**
+ * Information class for link callback for H5Pset/get_append_flush.
+ *
+ */
public interface H5D_append_cb extends Callbacks {
+ /**
+ * application callback for each dataset access property list
+ *
+ * @param dataset_id the ID for the dataset being iterated over
+ * @param cur_dims the dimension sizes for determining boundary
+ * @param op_data the operator data passed in to H5Pset/get_append_flush
+ *
+ * @return operation status
+ * A. Zero causes the iterator to continue, returning zero when all
+ * attributes have been processed.
+ * B. Positive causes the iterator to immediately return that positive
+ * value, indicating short-circuit success. The iterator can be
+ * restarted at the next attribute.
+ * C. Negative causes the iterator to immediately return that value,
+ * indicating failure. The iterator can be restarted at the next
+ * attribute.
+ */
int callback(long dataset_id, long[] cur_dims, H5D_append_t op_data);
}
diff --git a/java/src/hdf/hdf5lib/callbacks/H5D_append_t.java b/java/src/hdf/hdf5lib/callbacks/H5D_append_t.java
index 4df25de..7fdb454 100644
--- a/java/src/hdf/hdf5lib/callbacks/H5D_append_t.java
+++ b/java/src/hdf/hdf5lib/callbacks/H5D_append_t.java
@@ -1,6 +1,5 @@
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* 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 *
@@ -13,6 +12,10 @@
package hdf.hdf5lib.callbacks;
+/**
+ * Data class for link callback for H5Dappend.
+ *
+ */
public interface H5D_append_t {
/** public ArrayList iterdata = new ArrayList();
* Any derived interfaces must define the single public variable as above.
diff --git a/java/src/hdf/hdf5lib/callbacks/H5D_iterate_cb.java b/java/src/hdf/hdf5lib/callbacks/H5D_iterate_cb.java
index 8f5b64e..54c12e3 100644
--- a/java/src/hdf/hdf5lib/callbacks/H5D_iterate_cb.java
+++ b/java/src/hdf/hdf5lib/callbacks/H5D_iterate_cb.java
@@ -1,6 +1,5 @@
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* 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 *
@@ -13,7 +12,29 @@
package hdf.hdf5lib.callbacks;
-//Information class for link callback(for H5Diterate)
+/**
+ * Information class for link callback for H5Diterate.
+ *
+ */
public interface H5D_iterate_cb extends Callbacks {
+ /**
+ * application callback for each dataset element
+ *
+ * @param elem the pointer to the element in memory containing the current point
+ * @param elem_type the datatype ID for the elements stored in elem
+ * @param ndim the number of dimensions for POINT array
+ * @param point the array containing the location of the element within the original dataspace
+ * @param op_data the operator data passed in to H5Diterate
+ *
+ * @return operation status
+ * A. Zero causes the iterator to continue, returning zero when all
+ * attributes have been processed.
+ * B. Positive causes the iterator to immediately return that positive
+ * value, indicating short-circuit success. The iterator can be
+ * restarted at the next attribute.
+ * C. Negative causes the iterator to immediately return that value,
+ * indicating failure. The iterator can be restarted at the next
+ * attribute.
+ */
int callback(byte[] elem, long elem_type, int ndim, long[] point, H5D_iterate_t op_data);
}
diff --git a/java/src/hdf/hdf5lib/callbacks/H5D_iterate_t.java b/java/src/hdf/hdf5lib/callbacks/H5D_iterate_t.java
index 36194f9..305cf98 100644
--- a/java/src/hdf/hdf5lib/callbacks/H5D_iterate_t.java
+++ b/java/src/hdf/hdf5lib/callbacks/H5D_iterate_t.java
@@ -1,6 +1,5 @@
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* 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 *
@@ -13,6 +12,10 @@
package hdf.hdf5lib.callbacks;
+/**
+ * Data class for link callback for H5Diterate.
+ *
+ */
public interface H5D_iterate_t {
/** public ArrayList iterdata = new ArrayList();
* Any derived interfaces must define the single public variable as above.
diff --git a/java/src/hdf/hdf5lib/callbacks/H5E_walk_cb.java b/java/src/hdf/hdf5lib/callbacks/H5E_walk_cb.java
index 5b888b8..5722195 100644
--- a/java/src/hdf/hdf5lib/callbacks/H5E_walk_cb.java
+++ b/java/src/hdf/hdf5lib/callbacks/H5E_walk_cb.java
@@ -1,6 +1,5 @@
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* 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 *
@@ -15,7 +14,27 @@ package hdf.hdf5lib.callbacks;
import hdf.hdf5lib.structs.H5E_error2_t;
-//Information class for link callback(for H5Ewalk)
+/**
+ * Information class for link callback for H5Ewalk.
+ *
+ */
public interface H5E_walk_cb extends Callbacks {
+ /**
+ * application callback for each error stack element
+ *
+ * @param nidx the index of the current error stack element
+ * @param info the error stack "info" struct
+ * @param op_data the operator data passed in to H5Ewalk
+ *
+ * @return operation status
+ * A. Zero causes the iterator to continue, returning zero when all
+ * attributes have been processed.
+ * B. Positive causes the iterator to immediately return that positive
+ * value, indicating short-circuit success. The iterator can be
+ * restarted at the next attribute.
+ * C. Negative causes the iterator to immediately return that value,
+ * indicating failure. The iterator can be restarted at the next
+ * attribute.
+ */
int callback(int nidx, H5E_error2_t info, H5E_walk_t op_data);
}
diff --git a/java/src/hdf/hdf5lib/callbacks/H5E_walk_t.java b/java/src/hdf/hdf5lib/callbacks/H5E_walk_t.java
index 72b56d5..5bf0c8b 100644
--- a/java/src/hdf/hdf5lib/callbacks/H5E_walk_t.java
+++ b/java/src/hdf/hdf5lib/callbacks/H5E_walk_t.java
@@ -1,6 +1,5 @@
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* 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 *
@@ -13,6 +12,10 @@
package hdf.hdf5lib.callbacks;
+/**
+ * Data class for link callback for H5Ewalk.
+ *
+ */
public interface H5E_walk_t {
/** public ArrayList iterdata = new ArrayList();
* Any derived interfaces must define the single public variable as above.
diff --git a/java/src/hdf/hdf5lib/callbacks/H5L_iterate_opdata_t.java b/java/src/hdf/hdf5lib/callbacks/H5L_iterate_opdata_t.java
index 0b20422..d89fd2a 100644
--- a/java/src/hdf/hdf5lib/callbacks/H5L_iterate_opdata_t.java
+++ b/java/src/hdf/hdf5lib/callbacks/H5L_iterate_opdata_t.java
@@ -1,6 +1,5 @@
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* 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 *
@@ -13,6 +12,10 @@
package hdf.hdf5lib.callbacks;
+/**
+ * Data class for link callback for H5Lvisit/H5Lvisit_by_name.
+ *
+ */
public interface H5L_iterate_opdata_t {
}
diff --git a/java/src/hdf/hdf5lib/callbacks/H5L_iterate_t.java b/java/src/hdf/hdf5lib/callbacks/H5L_iterate_t.java
index 31bff6e..53635bf 100644
--- a/java/src/hdf/hdf5lib/callbacks/H5L_iterate_t.java
+++ b/java/src/hdf/hdf5lib/callbacks/H5L_iterate_t.java
@@ -1,6 +1,5 @@
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* 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 *
@@ -15,7 +14,28 @@ package hdf.hdf5lib.callbacks;
import hdf.hdf5lib.structs.H5L_info_t;
-// Information class for link callback (for H5Lvisit/H5Lvisit_by_name).
+/**
+ * Information class for link callback for H5Lvisit/H5Lvisit_by_name.
+ *
+ */
public interface H5L_iterate_t extends Callbacks {
- int callback(long group, String name, H5L_info_t info, H5L_iterate_opdata_t op_data);
+ /**
+ * application callback for each group
+ *
+ * @param loc_id the ID for the group being iterated over
+ * @param name the name of the current link
+ * @param info the link's "info" struct
+ * @param op_data the operator data passed in to H5Literate
+ *
+ * @return operation status
+ * A. Zero causes the iterator to continue, returning zero when all
+ * attributes have been processed.
+ * B. Positive causes the iterator to immediately return that positive
+ * value, indicating short-circuit success. The iterator can be
+ * restarted at the next attribute.
+ * C. Negative causes the iterator to immediately return that value,
+ * indicating failure. The iterator can be restarted at the next
+ * attribute.
+ */
+ int callback(long loc_id, String name, H5L_info_t info, H5L_iterate_opdata_t op_data);
}
diff --git a/java/src/hdf/hdf5lib/callbacks/H5O_iterate_opdata_t.java b/java/src/hdf/hdf5lib/callbacks/H5O_iterate_opdata_t.java
index 6f2b3cc..fd643b4 100644
--- a/java/src/hdf/hdf5lib/callbacks/H5O_iterate_opdata_t.java
+++ b/java/src/hdf/hdf5lib/callbacks/H5O_iterate_opdata_t.java
@@ -1,6 +1,5 @@
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* 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 *
@@ -13,6 +12,10 @@
package hdf.hdf5lib.callbacks;
+/**
+ * Data class for link callback for H5Ovisit/H5Ovisit_by_name.
+ *
+ */
public interface H5O_iterate_opdata_t {
}
diff --git a/java/src/hdf/hdf5lib/callbacks/H5O_iterate_t.java b/java/src/hdf/hdf5lib/callbacks/H5O_iterate_t.java
index 45d7746..ecf868c 100644
--- a/java/src/hdf/hdf5lib/callbacks/H5O_iterate_t.java
+++ b/java/src/hdf/hdf5lib/callbacks/H5O_iterate_t.java
@@ -1,6 +1,5 @@
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* 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 *
@@ -15,7 +14,28 @@ package hdf.hdf5lib.callbacks;
import hdf.hdf5lib.structs.H5O_info_t;
-// Information class for link callback(for H5Ovisit/H5Ovisit_by_name)
+/**
+ * Information class for link callback for H5Ovisit/H5Ovisit_by_name.
+ *
+ */
public interface H5O_iterate_t extends Callbacks {
- int callback(long group, String name, H5O_info_t info, H5O_iterate_opdata_t op_data);
+ /**
+ * application callback for each group
+ *
+ * @param loc_id the ID for the group or dataset being iterated over
+ * @param name the name of the current object
+ * @param info the object's "info" struct
+ * @param op_data the operator data passed in to H5Oiterate
+ *
+ * @return operation status
+ * A. Zero causes the iterator to continue, returning zero when all
+ * attributes have been processed.
+ * B. Positive causes the iterator to immediately return that positive
+ * value, indicating short-circuit success. The iterator can be
+ * restarted at the next attribute.
+ * C. Negative causes the iterator to immediately return that value,
+ * indicating failure. The iterator can be restarted at the next
+ * attribute.
+ */
+ int callback(long loc_id, String name, H5O_info_t info, H5O_iterate_opdata_t op_data);
}
diff --git a/java/src/hdf/hdf5lib/callbacks/H5P_cls_close_func_cb.java b/java/src/hdf/hdf5lib/callbacks/H5P_cls_close_func_cb.java
index d5c2474..0a09a94 100644
--- a/java/src/hdf/hdf5lib/callbacks/H5P_cls_close_func_cb.java
+++ b/java/src/hdf/hdf5lib/callbacks/H5P_cls_close_func_cb.java
@@ -1,6 +1,5 @@
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* 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 *
@@ -13,7 +12,26 @@
package hdf.hdf5lib.callbacks;
-//Information class for link callback(for H5Pcreate_class)
+/**
+ * Information class for link callback for H5Pcreate_class.
+ *
+ */
public interface H5P_cls_close_func_cb extends Callbacks {
+ /**
+ * application callback for each property list
+ *
+ * @param prop_id the ID for the property list class being iterated over
+ * @param close_data the function to call when a property list is closed
+ *
+ * @return operation status
+ * A. Zero causes the iterator to continue, returning zero when all
+ * attributes have been processed.
+ * B. Positive causes the iterator to immediately return that positive
+ * value, indicating short-circuit success. The iterator can be
+ * restarted at the next attribute.
+ * C. Negative causes the iterator to immediately return that value,
+ * indicating failure. The iterator can be restarted at the next
+ * attribute.
+ */
int callback(long prop_id, H5P_cls_close_func_t close_data);
}
diff --git a/java/src/hdf/hdf5lib/callbacks/H5P_cls_close_func_t.java b/java/src/hdf/hdf5lib/callbacks/H5P_cls_close_func_t.java
index 918e05b..11e3a99 100644
--- a/java/src/hdf/hdf5lib/callbacks/H5P_cls_close_func_t.java
+++ b/java/src/hdf/hdf5lib/callbacks/H5P_cls_close_func_t.java
@@ -1,6 +1,5 @@
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* 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 *
@@ -13,6 +12,10 @@
package hdf.hdf5lib.callbacks;
+/**
+ * Data class for link callback for H5Pcreate_class.
+ *
+ */
public interface H5P_cls_close_func_t {
/** public ArrayList iterdata = new ArrayList();
* Any derived interfaces must define the single public variable as above.
diff --git a/java/src/hdf/hdf5lib/callbacks/H5P_cls_copy_func_cb.java b/java/src/hdf/hdf5lib/callbacks/H5P_cls_copy_func_cb.java
index d01185a..53f86be 100644
--- a/java/src/hdf/hdf5lib/callbacks/H5P_cls_copy_func_cb.java
+++ b/java/src/hdf/hdf5lib/callbacks/H5P_cls_copy_func_cb.java
@@ -1,6 +1,5 @@
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* 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 *
@@ -13,7 +12,27 @@
package hdf.hdf5lib.callbacks;
-//Information class for link callback(for H5Pcreate_class)
+/**
+ * Information class for link callback for H5Pcreate_class
+ *
+ */
public interface H5P_cls_copy_func_cb extends Callbacks {
+ /**
+ * application callback for each property list
+ *
+ * @param new_prop_id the ID for the property list copy
+ * @param old_prop_id the ID for the property list class being copied
+ * @param copy_data the function to call when each property list in this class is copied
+ *
+ * @return operation status
+ * A. Zero causes the iterator to continue, returning zero when all
+ * attributes have been processed.
+ * B. Positive causes the iterator to immediately return that positive
+ * value, indicating short-circuit success. The iterator can be
+ * restarted at the next attribute.
+ * C. Negative causes the iterator to immediately return that value,
+ * indicating failure. The iterator can be restarted at the next
+ * attribute.
+ */
int callback(long new_prop_id, long old_prop_id, H5P_cls_copy_func_t copy_data);
}
diff --git a/java/src/hdf/hdf5lib/callbacks/H5P_cls_copy_func_t.java b/java/src/hdf/hdf5lib/callbacks/H5P_cls_copy_func_t.java
index 0357959..78e5282 100644
--- a/java/src/hdf/hdf5lib/callbacks/H5P_cls_copy_func_t.java
+++ b/java/src/hdf/hdf5lib/callbacks/H5P_cls_copy_func_t.java
@@ -1,6 +1,5 @@
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* 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 *
@@ -13,6 +12,10 @@
package hdf.hdf5lib.callbacks;
+/**
+ * Data class for link callback for H5Pcreate_class.
+ *
+ */
public interface H5P_cls_copy_func_t {
/** public ArrayList iterdata = new ArrayList();
* Any derived interfaces must define the single public variable as above.
diff --git a/java/src/hdf/hdf5lib/callbacks/H5P_cls_create_func_cb.java b/java/src/hdf/hdf5lib/callbacks/H5P_cls_create_func_cb.java
index 7eb633b..8f4e782 100644
--- a/java/src/hdf/hdf5lib/callbacks/H5P_cls_create_func_cb.java
+++ b/java/src/hdf/hdf5lib/callbacks/H5P_cls_create_func_cb.java
@@ -1,6 +1,5 @@
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* 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 *
@@ -13,7 +12,26 @@
package hdf.hdf5lib.callbacks;
-//Information class for link callback(for H5Pcreate_class)
+/**
+ * Information class for link callback for H5Pcreate_class.
+ *
+ */
public interface H5P_cls_create_func_cb extends Callbacks {
+ /**
+ * application callback for each property list
+ *
+ * @param prop_id the ID for the property list class being iterated over
+ * @param create_data the function to call when each property list in this class is created
+ *
+ * @return operation status
+ * A. Zero causes the iterator to continue, returning zero when all
+ * attributes have been processed.
+ * B. Positive causes the iterator to immediately return that positive
+ * value, indicating short-circuit success. The iterator can be
+ * restarted at the next attribute.
+ * C. Negative causes the iterator to immediately return that value,
+ * indicating failure. The iterator can be restarted at the next
+ * attribute.
+ */
int callback(long prop_id, H5P_cls_create_func_t create_data);
}
diff --git a/java/src/hdf/hdf5lib/callbacks/H5P_cls_create_func_t.java b/java/src/hdf/hdf5lib/callbacks/H5P_cls_create_func_t.java
index a217f18..d919d97 100644
--- a/java/src/hdf/hdf5lib/callbacks/H5P_cls_create_func_t.java
+++ b/java/src/hdf/hdf5lib/callbacks/H5P_cls_create_func_t.java
@@ -1,6 +1,5 @@
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* 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 *
@@ -13,6 +12,10 @@
package hdf.hdf5lib.callbacks;
+/**
+ * Data class for link callback for H5Pcreate_class.
+ *
+ */
public interface H5P_cls_create_func_t {
/** public ArrayList iterdata = new ArrayList();
* Any derived interfaces must define the single public variable as above.
diff --git a/java/src/hdf/hdf5lib/callbacks/H5P_iterate_cb.java b/java/src/hdf/hdf5lib/callbacks/H5P_iterate_cb.java
index a133512..db98a67 100644
--- a/java/src/hdf/hdf5lib/callbacks/H5P_iterate_cb.java
+++ b/java/src/hdf/hdf5lib/callbacks/H5P_iterate_cb.java
@@ -1,6 +1,5 @@
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* 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 *
@@ -13,7 +12,27 @@
package hdf.hdf5lib.callbacks;
-//Information class for link callback(for H5Piterate)
+/**
+ * Information class for link callback for H5Piterate.
+ *
+ */
public interface H5P_iterate_cb extends Callbacks {
+ /**
+ * application callback for each property list
+ *
+ * @param plist the ID for the property list being iterated over
+ * @param name the name of the current property list
+ * @param op_data the operator data passed in to H5Piterate
+ *
+ * @return operation status
+ * A. Zero causes the iterator to continue, returning zero when all
+ * attributes have been processed.
+ * B. Positive causes the iterator to immediately return that positive
+ * value, indicating short-circuit success. The iterator can be
+ * restarted at the next attribute.
+ * C. Negative causes the iterator to immediately return that value,
+ * indicating failure. The iterator can be restarted at the next
+ * attribute.
+ */
int callback(long plist, String name, H5P_iterate_t op_data);
}
diff --git a/java/src/hdf/hdf5lib/callbacks/H5P_iterate_t.java b/java/src/hdf/hdf5lib/callbacks/H5P_iterate_t.java
index 5c25187..0035619 100644
--- a/java/src/hdf/hdf5lib/callbacks/H5P_iterate_t.java
+++ b/java/src/hdf/hdf5lib/callbacks/H5P_iterate_t.java
@@ -1,6 +1,5 @@
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* 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 *
@@ -13,6 +12,10 @@
package hdf.hdf5lib.callbacks;
+/**
+ * Data class for link callback for H5Piterate.
+ *
+ */
public interface H5P_iterate_t {
/** public ArrayList iterdata = new ArrayList();
* Any derived interfaces must define the single public variable as above.
diff --git a/java/src/hdf/hdf5lib/callbacks/H5P_prp_close_func_cb.java b/java/src/hdf/hdf5lib/callbacks/H5P_prp_close_func_cb.java
index d332ffc..1aa7ce4 100644
--- a/java/src/hdf/hdf5lib/callbacks/H5P_prp_close_func_cb.java
+++ b/java/src/hdf/hdf5lib/callbacks/H5P_prp_close_func_cb.java
@@ -1,6 +1,5 @@
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* 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 *
@@ -13,7 +12,27 @@
package hdf.hdf5lib.callbacks;
-//Information class for link callback(for H5Pregister2)
+/**
+ * Information class for link callback for H5Pregister2.
+ *
+ */
public interface H5P_prp_close_func_cb extends Callbacks {
+ /**
+ * application callback for each property list
+ *
+ * @param name the name of the property being closed
+ * @param size the size of the property value
+ * @param value the value of the property being closed
+ *
+ * @return operation status
+ * A. Zero causes the iterator to continue, returning zero when all
+ * attributes have been processed.
+ * B. Positive causes the iterator to immediately return that positive
+ * value, indicating short-circuit success. The iterator can be
+ * restarted at the next attribute.
+ * C. Negative causes the iterator to immediately return that value,
+ * indicating failure. The iterator can be restarted at the next
+ * attribute.
+ */
int callback(String name, long size, byte[] value);
}
diff --git a/java/src/hdf/hdf5lib/callbacks/H5P_prp_compare_func_cb.java b/java/src/hdf/hdf5lib/callbacks/H5P_prp_compare_func_cb.java
index dfb2cd3..49cef7d 100644
--- a/java/src/hdf/hdf5lib/callbacks/H5P_prp_compare_func_cb.java
+++ b/java/src/hdf/hdf5lib/callbacks/H5P_prp_compare_func_cb.java
@@ -1,6 +1,5 @@
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* 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 *
@@ -13,7 +12,27 @@
package hdf.hdf5lib.callbacks;
-//Information class for link callback(for H5Pregister2)
+/**
+ * Information class for link callback for H5Pregister2.
+ *
+ */
public interface H5P_prp_compare_func_cb extends Callbacks {
+ /**
+ * application callback for each property list
+ *
+ * @param value1 the value of the first property being compared
+ * @param value2 the value of the second property being compared
+ * @param size the size of the property value
+ *
+ * @return operation status
+ * A. Zero causes the iterator to continue, returning zero when all
+ * attributes have been processed.
+ * B. Positive causes the iterator to immediately return that positive
+ * value, indicating short-circuit success. The iterator can be
+ * restarted at the next attribute.
+ * C. Negative causes the iterator to immediately return that value,
+ * indicating failure. The iterator can be restarted at the next
+ * attribute.
+ */
int callback(byte[] value1, byte[] value2, long size);
}
diff --git a/java/src/hdf/hdf5lib/callbacks/H5P_prp_copy_func_cb.java b/java/src/hdf/hdf5lib/callbacks/H5P_prp_copy_func_cb.java
index 9a4456e..f4924ee 100644
--- a/java/src/hdf/hdf5lib/callbacks/H5P_prp_copy_func_cb.java
+++ b/java/src/hdf/hdf5lib/callbacks/H5P_prp_copy_func_cb.java
@@ -1,6 +1,5 @@
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* 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 *
@@ -13,7 +12,27 @@
package hdf.hdf5lib.callbacks;
-//Information class for link callback(for H5Pregister2)
+/**
+ * Information class for link callback for H5Pregister2.
+ *
+ */
public interface H5P_prp_copy_func_cb extends Callbacks {
+ /**
+ * application callback for each property list
+ *
+ * @param name the name of the property being copied
+ * @param size the size of the property value
+ * @param value the value of the property being copied
+ *
+ * @return operation status
+ * A. Zero causes the iterator to continue, returning zero when all
+ * attributes have been processed.
+ * B. Positive causes the iterator to immediately return that positive
+ * value, indicating short-circuit success. The iterator can be
+ * restarted at the next attribute.
+ * C. Negative causes the iterator to immediately return that value,
+ * indicating failure. The iterator can be restarted at the next
+ * attribute.
+ */
int callback(String name, long size, byte[] value);
}
diff --git a/java/src/hdf/hdf5lib/callbacks/H5P_prp_create_func_cb.java b/java/src/hdf/hdf5lib/callbacks/H5P_prp_create_func_cb.java
index 53f4bdd..bce024b 100644
--- a/java/src/hdf/hdf5lib/callbacks/H5P_prp_create_func_cb.java
+++ b/java/src/hdf/hdf5lib/callbacks/H5P_prp_create_func_cb.java
@@ -1,6 +1,5 @@
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* 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 *
@@ -13,7 +12,27 @@
package hdf.hdf5lib.callbacks;
-//Information class for link callback(for H5Pregister2)
+/**
+ * Information class for link callback for H5Pregister2.
+ *
+ */
public interface H5P_prp_create_func_cb extends Callbacks {
+ /**
+ * application callback for each property list
+ *
+ * @param name the name of the property list being created
+ * @param size the size of the property value
+ * @param value the initial value for the property being created
+ *
+ * @return operation status
+ * A. Zero causes the iterator to continue, returning zero when all
+ * attributes have been processed.
+ * B. Positive causes the iterator to immediately return that positive
+ * value, indicating short-circuit success. The iterator can be
+ * restarted at the next attribute.
+ * C. Negative causes the iterator to immediately return that value,
+ * indicating failure. The iterator can be restarted at the next
+ * attribute.
+ */
int callback(String name, long size, byte[] value);
}
diff --git a/java/src/hdf/hdf5lib/callbacks/H5P_prp_delete_func_cb.java b/java/src/hdf/hdf5lib/callbacks/H5P_prp_delete_func_cb.java
index 44e8ac3..8c5dccc 100644
--- a/java/src/hdf/hdf5lib/callbacks/H5P_prp_delete_func_cb.java
+++ b/java/src/hdf/hdf5lib/callbacks/H5P_prp_delete_func_cb.java
@@ -1,6 +1,5 @@
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* 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 *
@@ -13,7 +12,28 @@
package hdf.hdf5lib.callbacks;
-//Information class for link callback(for H5Pregister2)
+/**
+ * Information class for link callback for H5Pregister2.
+ *
+ */
public interface H5P_prp_delete_func_cb extends Callbacks {
+ /**
+ * application callback for each property list
+ *
+ * @param prop_id the ID of the property list the property is deleted from
+ * @param name the name of the property being deleted
+ * @param size the size of the property value
+ * @param value the value of the property being deleted
+ *
+ * @return operation status
+ * A. Zero causes the iterator to continue, returning zero when all
+ * attributes have been processed.
+ * B. Positive causes the iterator to immediately return that positive
+ * value, indicating short-circuit success. The iterator can be
+ * restarted at the next attribute.
+ * C. Negative causes the iterator to immediately return that value,
+ * indicating failure. The iterator can be restarted at the next
+ * attribute.
+ */
int callback(long prop_id, String name, long size, byte[] value);
}
diff --git a/java/src/hdf/hdf5lib/callbacks/H5P_prp_get_func_cb.java b/java/src/hdf/hdf5lib/callbacks/H5P_prp_get_func_cb.java
index 5117bd2..0f3457f 100644
--- a/java/src/hdf/hdf5lib/callbacks/H5P_prp_get_func_cb.java
+++ b/java/src/hdf/hdf5lib/callbacks/H5P_prp_get_func_cb.java
@@ -1,6 +1,5 @@
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* 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 *
@@ -13,7 +12,28 @@
package hdf.hdf5lib.callbacks;
-//Information class for link callback(for H5Pregister2)
+/**
+ * Information class for link callback for H5Pregister2.
+ *
+ */
public interface H5P_prp_get_func_cb extends Callbacks {
+ /**
+ * application callback for each property list
+ *
+ * @param prop_id the ID for the property list being queried
+ * @param name the name of the property being queried
+ * @param size the size of the property value
+ * @param value the value being retrieved for the property
+ *
+ * @return operation status
+ * A. Zero causes the iterator to continue, returning zero when all
+ * attributes have been processed.
+ * B. Positive causes the iterator to immediately return that positive
+ * value, indicating short-circuit success. The iterator can be
+ * restarted at the next attribute.
+ * C. Negative causes the iterator to immediately return that value,
+ * indicating failure. The iterator can be restarted at the next
+ * attribute.
+ */
int callback(long prop_id, String name, long size, byte[] value);
}
diff --git a/java/src/hdf/hdf5lib/callbacks/H5P_prp_set_func_cb.java b/java/src/hdf/hdf5lib/callbacks/H5P_prp_set_func_cb.java
index ef01fc9..a55ca3a 100644
--- a/java/src/hdf/hdf5lib/callbacks/H5P_prp_set_func_cb.java
+++ b/java/src/hdf/hdf5lib/callbacks/H5P_prp_set_func_cb.java
@@ -1,6 +1,5 @@
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* 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 *
@@ -13,7 +12,28 @@
package hdf.hdf5lib.callbacks;
-//Information class for link callback(for H5Pregister2)
+/**
+ * Information class for link callback for H5Pregister2.
+ *
+ */
public interface H5P_prp_set_func_cb extends Callbacks {
+ /**
+ * application callback for each property list
+ *
+ * @param prop_id the ID for the property list being modified
+ * @param name the name of the property being modified
+ * @param size the size of the property value
+ * @param value the value being set for the property
+ *
+ * @return operation status
+ * A. Zero causes the iterator to continue, returning zero when all
+ * attributes have been processed.
+ * B. Positive causes the iterator to immediately return that positive
+ * value, indicating short-circuit success. The iterator can be
+ * restarted at the next attribute.
+ * C. Negative causes the iterator to immediately return that value,
+ * indicating failure. The iterator can be restarted at the next
+ * attribute.
+ */
int callback(long prop_id, String name, long size, byte[] value);
}
diff --git a/java/src/hdf/hdf5lib/exceptions/HDF5Exception.java b/java/src/hdf/hdf5lib/exceptions/HDF5Exception.java
index 70e4160..0c23af1 100644
--- a/java/src/hdf/hdf5lib/exceptions/HDF5Exception.java
+++ b/java/src/hdf/hdf5lib/exceptions/HDF5Exception.java
@@ -31,6 +31,9 @@ package hdf.hdf5lib.exceptions;
*
*/
public class HDF5Exception extends RuntimeException {
+ /**
+ * the specified detail message of this exception
+ */
protected String detailMessage;
/**
diff --git a/java/src/hdf/hdf5lib/exceptions/HDF5AtomException.java b/java/src/hdf/hdf5lib/exceptions/HDF5IdException.java
index ee1b21f..04ee0bc 100644
--- a/java/src/hdf/hdf5lib/exceptions/HDF5AtomException.java
+++ b/java/src/hdf/hdf5lib/exceptions/HDF5IdException.java
@@ -16,26 +16,26 @@ package hdf.hdf5lib.exceptions;
/**
* The class HDF5LibraryException returns errors raised by the HDF5 library.
* <p>
- * This sub-class represents HDF-5 major error code <b>H5E_ATOM</b>
+ * This sub-class represents HDF-5 major error code <b>H5E_ID</b>
*/
-public class HDF5AtomException extends HDF5LibraryException {
+public class HDF5IdException extends HDF5LibraryException {
/**
- * Constructs an <code>HDF5AtomException</code> with no specified detail
+ * Constructs an <code>HDF5IdException</code> with no specified detail
* message.
*/
- public HDF5AtomException() {
+ public HDF5IdException() {
super();
}
/**
- * Constructs an <code>HDF5AtomException</code> with the specified detail
+ * Constructs an <code>HDF5IdException</code> with the specified detail
* message.
*
* @param s
* the detail message.
*/
- public HDF5AtomException(String s) {
+ public HDF5IdException(String s) {
super(s);
}
diff --git a/java/src/hdf/hdf5lib/exceptions/HDF5LibraryException.java b/java/src/hdf/hdf5lib/exceptions/HDF5LibraryException.java
index 5192eb7..532355e 100644
--- a/java/src/hdf/hdf5lib/exceptions/HDF5LibraryException.java
+++ b/java/src/hdf/hdf5lib/exceptions/HDF5LibraryException.java
@@ -30,7 +30,9 @@ import hdf.hdf5lib.HDF5Constants;
@SuppressWarnings("serial")
public class HDF5LibraryException extends HDF5Exception {
+ /** major error number of the first error on the HDF5 library error stack. */
private final long majorErrorNumber;
+ /** minor error number of the first error on the HDF5 library error stack. */
private final long minorErrorNumber;
/**
@@ -201,14 +203,14 @@ public class HDF5LibraryException extends HDF5Exception {
else if (err_code == HDF5Constants.H5E_CANTRELEASE) {
return "Can't release object";
}
- else if (err_code == HDF5Constants.H5E_BADATOM) {
- return "Can't find atom information";
+ else if (err_code == HDF5Constants.H5E_BADID) {
+ return "Can't find ID information";
}
else if (err_code == HDF5Constants.H5E_BADGROUP) {
return "Can't find group information";
}
else if (err_code == HDF5Constants.H5E_CANTREGISTER) {
- return "Can't register new atom";
+ return "Can't register new ID";
}
else if (err_code == HDF5Constants.H5E_CANTINC) {
return "Can't increment reference count";
diff --git a/java/src/hdf/hdf5lib/exceptions/HDF5ReferenceException.java b/java/src/hdf/hdf5lib/exceptions/HDF5ReferenceException.java
index 9a5392b..0701244 100644
--- a/java/src/hdf/hdf5lib/exceptions/HDF5ReferenceException.java
+++ b/java/src/hdf/hdf5lib/exceptions/HDF5ReferenceException.java
@@ -13,6 +13,12 @@
package hdf.hdf5lib.exceptions;
+/**
+ * The class HDF5LibraryException returns errors raised by the HDF5 library.
+ * <p>
+ * This sub-class represents HDF-5 major error code <b>H5E_REFERENCE</b>
+ */
+
public class HDF5ReferenceException extends HDF5LibraryException {
/**
* Constructs an <code>HDF5ReferenceException</code> with no specified
diff --git a/java/src/hdf/hdf5lib/structs/H5AC_cache_config_t.java b/java/src/hdf/hdf5lib/structs/H5AC_cache_config_t.java
index 082cb56..cf84532 100644
--- a/java/src/hdf/hdf5lib/structs/H5AC_cache_config_t.java
+++ b/java/src/hdf/hdf5lib/structs/H5AC_cache_config_t.java
@@ -1,6 +1,5 @@
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* 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 *
@@ -15,44 +14,276 @@ package hdf.hdf5lib.structs;
import java.io.Serializable;
-//Information struct for H5Pget_mdc_config/H5Pset_mdc_config
+/**
+ * Information struct for H5Pget_mdc_config/H5Pset_mdc_config
+ *
+ */
public class H5AC_cache_config_t implements Serializable{
private static final long serialVersionUID = -6748085696476149972L;
- // general configuration fields:
+ // general configuration fields
+ /**
+ * version: Integer field containing the version number of this version
+ * of the H5AC_cache_config_t structure. Any instance of
+ * H5AC_cache_config_t passed to the cache must have a known
+ * version number, or an error will be flagged.
+ */
public int version;
+ /**
+ * rpt_fcn_enabled: Boolean field used to enable and disable the default
+ * reporting function. This function is invoked every time the
+ * automatic cache resize code is run, and reports on its activities.
+ *
+ * This is a debugging function, and should normally be turned off.
+ */
public boolean rpt_fcn_enabled;
+ /**
+ * open_trace_file: Boolean field indicating whether the trace_file_name
+ * field should be used to open a trace file for the cache.
+ *
+ * *** DEPRECATED *** Use H5Fstart/stop logging functions instead
+ */
public boolean open_trace_file;
+ /**
+ * close_trace_file: Boolean field indicating whether the current trace
+ * file (if any) should be closed.
+ *
+ * *** DEPRECATED *** Use H5Fstart/stop logging functions instead
+ */
public boolean close_trace_file;
+ /**
+ * trace_file_name: Full path of the trace file to be opened if the
+ * open_trace_file field is TRUE.
+ *
+ * *** DEPRECATED *** Use H5Fstart/stop logging functions instead
+ */
public String trace_file_name;
+ /**
+ * evictions_enabled: Boolean field used to either report the current
+ * evictions enabled status of the cache, or to set the cache's
+ * evictions enabled status.
+ */
public boolean evictions_enabled;
+ /**
+ * set_initial_size: Boolean flag indicating whether the size of the
+ * initial size of the cache is to be set to the value given in
+ * the initial_size field. If set_initial_size is FALSE, the
+ * initial_size field is ignored.
+ */
public boolean set_initial_size;
+ /**
+ * initial_size: If enabled, this field contain the size the cache is
+ * to be set to upon receipt of this structure. Needless to say,
+ * initial_size must lie in the closed interval [min_size, max_size].
+ */
public long initial_size;
+ /**
+ * min_clean_fraction: double in the range 0 to 1 indicating the fraction
+ * of the cache that is to be kept clean. This field is only used
+ * in parallel mode. Typical values are 0.1 to 0.5.
+ */
public double min_clean_fraction;
+ /**
+ * max_size: Maximum size to which the cache can be adjusted. The
+ * supplied value must fall in the closed interval
+ * [MIN_MAX_CACHE_SIZE, MAX_MAX_CACHE_SIZE]. Also, max_size must
+ * be greater than or equal to min_size.
+ */
public long max_size;
+ /**
+ * min_size: Minimum size to which the cache can be adjusted. The
+ * supplied value must fall in the closed interval
+ * [H5C__MIN_MAX_CACHE_SIZE, H5C__MAX_MAX_CACHE_SIZE]. Also, min_size
+ * must be less than or equal to max_size.
+ */
public long min_size;
+ /**
+ * epoch_length: Number of accesses on the cache over which to collect
+ * hit rate stats before running the automatic cache resize code,
+ * if it is enabled.
+ */
public long epoch_length;
- // size increase control fields:
- public int incr_mode; // H5C_cache_incr_mode
+ // size increase control fields
+ /**
+ * incr_mode: Instance of the H5C_cache_incr_mode enumerated type whose
+ * value indicates how we determine whether the cache size should be
+ * increased. At present there are two possible values.
+ */
+ public int incr_mode;
+ /**
+ * lower_hr_threshold: Lower hit rate threshold. If the increment mode
+ * (incr_mode) is H5C_incr__threshold and the hit rate drops below the
+ * value supplied in this field in an epoch, increment the cache size by
+ * size_increment. Note that cache size may not be incremented above
+ * max_size, and that the increment may be further restricted by the
+ * max_increment field if it is enabled.
+ */
public double lower_hr_threshold;
+ /**
+ * increment: Double containing the multiplier used to derive the new
+ * cache size from the old if a cache size increment is triggered.
+ * The increment must be greater than 1.0, and should not exceed 2.0.
+ */
public double increment;
+ /**
+ * apply_max_increment: Boolean flag indicating whether the max_increment
+ * field should be used to limit the maximum cache size increment.
+ */
public boolean apply_max_increment;
+ /**
+ * max_increment: If enabled by the apply_max_increment field described
+ * above, this field contains the maximum number of bytes by which the
+ * cache size can be increased in a single re-size.
+ */
public long max_increment;
- public int flash_incr_mode; // H5C_cache_flash_incr_mode
+ /**
+ * flash_incr_mode: Instance of the H5C_cache_flash_incr_mode enumerated
+ * type whose value indicates whether and by which algorithm we should
+ * make flash increases in the size of the cache to accommodate insertion
+ * of large entries and large increases in the size of a single entry.
+ */
+ public int flash_incr_mode;
+ /**
+ * flash_multiple: Double containing the multiple described above in the
+ * H5C_flash_incr__add_space section of the discussion of the
+ * flash_incr_mode section. This field is ignored unless flash_incr_mode
+ * is H5C_flash_incr__add_space.
+ */
public double flash_multiple;
+ /**
+ * flash_threshold: Double containing the factor by which current max cache
+ * size is multiplied to obtain the size threshold for the add_space flash
+ * increment algorithm. The field is ignored unless flash_incr_mode is
+ * H5C_flash_incr__add_space.
+ */
public double flash_threshold;
- // size decrease control fields:
- public int decr_mode; // H5C_cache_decr_mode
+ // size decrease control fields
+ /**
+ * decr_mode: Instance of the H5C_cache_decr_mode enumerated type whose
+ * value indicates how we determine whether the cache size should be
+ * decreased. At present there are four possibilities.
+ */
+ public int decr_mode;
+ /**
+ * upper_hr_threshold: Upper hit rate threshold. The use of this field
+ * varies according to the current decr_mode.
+ */
public double upper_hr_threshold;
+ /**
+ * decrement: This field is only used when the decr_mode is
+ * H5C_decr__threshold.
+ */
public double decrement;
+ /**
+ * apply_max_decrement: Boolean flag used to determine whether decrements
+ * in cache size are to be limited by the max_decrement field.
+ */
public boolean apply_max_decrement;
+ /**
+ * max_decrement: Maximum number of bytes by which the cache size can be
+ * decreased in a single re-size. Note that decrements may also be
+ * restricted by the min_size of the cache, and (in age out modes) by
+ * the empty_reserve field.
+ */
public long max_decrement;
+ /**
+ * epochs_before_eviction: Integer field used in H5C_decr__age_out and
+ * H5C_decr__age_out_with_threshold decrement modes.
+ */
public int epochs_before_eviction;
+ /**
+ * apply_empty_reserve: Boolean field controlling whether the empty_reserve
+ * field is to be used in computing the new cache size when the
+ * decr_mode is H5C_decr__age_out or H5C_decr__age_out_with_threshold.
+ */
public boolean apply_empty_reserve;
+ /**
+ * empty_reserve: To avoid a constant racheting down of cache size by small
+ * amounts in the H5C_decr__age_out and H5C_decr__age_out_with_threshold
+ * modes, this field allows one to require that any cache size
+ * reductions leave the specified fraction of unused space in the cache.
+ */
public double empty_reserve;
- // parallel configuration fields:
+ // parallel configuration fields
+ /**
+ * dirty_bytes_threshold: Threshold of dirty byte creation used to
+ * synchronize updates between caches.
+ */
public long dirty_bytes_threshold;
+ /**
+ * metadata_write_strategy: Integer field containing a code indicating the
+ * desired metadata write strategy.
+ */
public int metadata_write_strategy;
+ /** H5AC_cache_config_t is a public structure intended for use in public APIs.
+ * At least in its initial incarnation, it is basically a copy of struct
+ * H5C_auto_size_ctl_t, minus the report_fcn field, and plus the
+ * dirty_bytes_threshold field.
+ *
+ * @param version: Integer field containing the version number of this version
+ * @param rpt_fcn_enabled: Boolean field used to enable and disable the default reporting function.
+ * @param open_trace_file: Boolean field indicating whether the trace_file_name
+ * field should be used to open a trace file for the cache.
+ * @param close_trace_file: Boolean field indicating whether the current trace
+ * file (if any) should be closed.
+ * @param trace_file_name: Full path of the trace file to be opened if the
+ * open_trace_file field is TRUE.
+ * @param evictions_enabled: Boolean field used to either report or set the current
+ * evictions enabled status of the cache.
+ * @param set_initial_size: Boolean flag indicating whether the size of the
+ * initial size of the cache is to be set to the value given in
+ * the initial_size field.
+ * @param initial_size: If enabled, this field contain the size the cache is
+ * to be set to upon receipt of this structure.
+ * @param min_clean_fraction: double in the range 0 to 1 indicating the fraction
+ * of the cache that is to be kept clean.
+ * @param max_size: Maximum size to which the cache can be adjusted.
+ * @param min_size: Minimum size to which the cache can be adjusted.
+ * @param epoch_length: Number of accesses on the cache over which to collect
+ * hit rate stats before running the automatic cache resize code.
+ * @param incr_mode: Instance of the H5C_cache_incr_mode enumerated type.
+ * @param lower_hr_threshold: Lower hit rate threshold.
+ * @param increment: Double containing the multiplier used to derive the new
+ * cache size from the old if a cache size increment is triggered.
+ * @param apply_max_increment: Boolean flag indicating whether the max_increment
+ * field should be used to limit the maximum cache size increment.
+ * @param max_increment: If enabled by the apply_max_increment field described
+ * above, this field contains the maximum number of bytes by which the
+ * cache size can be increased in a single re-size.
+ * @param flash_incr_mode: Instance of the H5C_cache_flash_incr_mode enumerated
+ * type whose value indicates whether and by which algorithm we should
+ * make flash increases in the size of the cache to accommodate insertion
+ * of large entries and large increases in the size of a single entry.
+ * @param flash_multiple: Double containing the multiple described above in the
+ * H5C_flash_incr__add_space section of the discussion of the
+ * flash_incr_mode section.
+ * @param flash_threshold: Double containing the factor by which current max cache
+ * size is multiplied to obtain the size threshold for the add_space flash
+ * increment algorithm.
+ * @param decr_mode: Instance of the H5C_cache_decr_mode enumerated type whose
+ * value indicates how we determine whether the cache size should be
+ * decreased.
+ * @param upper_hr_threshold: Upper hit rate threshold. The use of this field
+ * varies according to the current decr_mode.
+ * @param decrement: This field is only used when the decr_mode is
+ * H5C_decr__threshold.
+ * @param apply_max_decrement: Boolean flag used to determine whether decrements
+ * in cache size are to be limited by the max_decrement field.
+ * @param max_decrement: Maximum number of bytes by which the cache size can be
+ * decreased in a single re-size.
+ * @param epochs_before_eviction: Integer field used in H5C_decr__age_out and
+ * H5C_decr__age_out_with_threshold decrement modes.
+ * @param apply_empty_reserve: Boolean field controlling whether the empty_reserve
+ * field is to be used in computing the new cache size when the
+ * decr_mode is H5C_decr__age_out or H5C_decr__age_out_with_threshold.
+ * @param empty_reserve: To avoid a constant racheting down of cache size by small
+ * amounts in the H5C_decr__age_out and H5C_decr__age_out_with_threshold
+ * modes.
+ * @param dirty_bytes_threshold: Threshold of dirty byte creation used to
+ * synchronize updates between caches.
+ * @param metadata_write_strategy: Integer field containing a code indicating the
+ * desired metadata write strategy.
+ */
public H5AC_cache_config_t (int version, boolean rpt_fcn_enabled, boolean open_trace_file,
boolean close_trace_file, String trace_file_name, boolean evictions_enabled,
boolean set_initial_size, long initial_size, double min_clean_fraction, long max_size,
diff --git a/java/src/hdf/hdf5lib/structs/H5A_info_t.java b/java/src/hdf/hdf5lib/structs/H5A_info_t.java
index 334ac24..f2c10f0 100644
--- a/java/src/hdf/hdf5lib/structs/H5A_info_t.java
+++ b/java/src/hdf/hdf5lib/structs/H5A_info_t.java
@@ -1,6 +1,5 @@
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* 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 *
@@ -15,13 +14,20 @@ package hdf.hdf5lib.structs;
import java.io.Serializable;
-//Information struct for Attribute (For H5Aget_info/H5Aget_info_by_idx/H5Aget_info_by_name)
+/**
+ * Information struct for Attribute (For H5Aget_info/H5Aget_info_by_idx/H5Aget_info_by_name)
+ *
+ */
public class H5A_info_t implements Serializable{
private static final long serialVersionUID = 2791443594041667613L;
- public boolean corder_valid; // Indicate if creation order is valid
- public long corder; // Creation order of attribute
- public int cset; // Character set of attribute name
- public long data_size; // Size of raw data
+ /** Indicate if creation order is valid */
+ public boolean corder_valid;
+ /** Creation order of attribute */
+ public long corder;
+ /** Character set of attribute name */
+ public int cset;
+ /** Size of raw data */
+ public long data_size;
H5A_info_t(boolean corder_valid, long corder, int cset, long data_size) {
this.corder_valid = corder_valid;
diff --git a/java/src/hdf/hdf5lib/structs/H5E_error2_t.java b/java/src/hdf/hdf5lib/structs/H5E_error2_t.java
index f0a0158..5981fc7 100644
--- a/java/src/hdf/hdf5lib/structs/H5E_error2_t.java
+++ b/java/src/hdf/hdf5lib/structs/H5E_error2_t.java
@@ -1,6 +1,5 @@
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* 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 *
@@ -15,17 +14,26 @@ package hdf.hdf5lib.structs;
import java.io.Serializable;
-//Information struct for Attribute (For H5Ewalk)
+/**
+ * Information struct for Attribute (For H5Ewalk)
+ *
+ */
public class H5E_error2_t implements Serializable{
private static final long serialVersionUID = 279144359041667613L;
-
- public long cls_id; //class ID
- public long maj_num; //major error ID
- public long min_num; //minor error number
- public int line; //line in file where error occurs
- public String func_name; //function in which error occurred
- public String file_name; //file in which error occurred
- public String desc; //optional supplied description
+ /** class ID */
+ public long cls_id;
+ /** major error ID */
+ public long maj_num;
+ /** minor error number */
+ public long min_num;
+ /** line in file where error occurs */
+ public int line;
+ /** function in which error occurred */
+ public String func_name;
+ /** file in which error occurred */
+ public String file_name;
+ /** optional supplied description */
+ public String desc;
H5E_error2_t(long cls_id, long maj_num, long min_num, int line, String func_name, String file_name, String desc) {
this.cls_id = cls_id;
diff --git a/java/src/hdf/hdf5lib/structs/H5FD_hdfs_fapl_t.java b/java/src/hdf/hdf5lib/structs/H5FD_hdfs_fapl_t.java
index 9fcff2e..5da4abd 100644
--- a/java/src/hdf/hdf5lib/structs/H5FD_hdfs_fapl_t.java
+++ b/java/src/hdf/hdf5lib/structs/H5FD_hdfs_fapl_t.java
@@ -16,7 +16,7 @@ package hdf.hdf5lib.structs;
import java.io.Serializable;
-/*
+/**
* Java representation of the HDFS VFD file access property list (fapl)
* structure.
*
@@ -26,15 +26,31 @@ import java.io.Serializable;
public class H5FD_hdfs_fapl_t implements Serializable {
private static final long serialVersionUID = 2072473407027648309L;
+ /** Version number of the H5FD_hdfs_fapl_t structure. */
private int version;
+ /** Name of "Name Node" to access as the HDFS server. */
private String namenode_name;
+ /** Port number to use to connect with Name Node. */
private int namenode_port;
+ /** Username to use when accessing file. */
private String user_name;
+ /** Path to the location of the Kerberos authentication cache. */
private String kerberos_ticket_cache;
+ /** Size (in bytes) of the file read stream buffer. */
private int stream_buffer_size;
- /*
+ /**
* Create a fapl_t structure with the specified components.
+ * @param namenode_name
+ * Name of "Name Node" to access as the HDFS server.
+ * @param namenode_port
+ * Port number to use to connect with Name Node.
+ * @param user_name
+ * Username to use when accessing file.
+ * @param kerberos_ticket_cache
+ * Path to the location of the Kerberos authentication cache.
+ * @param stream_buffer_size
+ * Size (in bytes) of the file read stream buffer.
*/
public H5FD_hdfs_fapl_t(
String namenode_name,
diff --git a/java/src/hdf/hdf5lib/structs/H5FD_ros3_fapl_t.java b/java/src/hdf/hdf5lib/structs/H5FD_ros3_fapl_t.java
index a899e10..39f5424 100644
--- a/java/src/hdf/hdf5lib/structs/H5FD_ros3_fapl_t.java
+++ b/java/src/hdf/hdf5lib/structs/H5FD_ros3_fapl_t.java
@@ -16,7 +16,7 @@ package hdf.hdf5lib.structs;
import java.io.Serializable;
-/*
+/**
* Java representation of the ROS3 VFD file access property list (fapl)
* structure.
*
@@ -46,10 +46,15 @@ import java.io.Serializable;
public class H5FD_ros3_fapl_t implements Serializable {
private static final long serialVersionUID = 8985533001471224030L;
+ /** Version number of the H5FD_ros3_fapl_t structure */
private int version;
+ /** Flag TRUE or FALSE whether or not requests are to be authenticated with the AWS4 algorithm. */
private boolean authenticate;
+ /** region "aws region" for authenticating request */
private String aws_region;
+ /** id "secret id" or "access id" for authenticating request */
private String secret_id;
+ /** key "secret key" or "access key" for authenticating request */
private String secret_key;
/**
diff --git a/java/src/hdf/hdf5lib/structs/H5F_info2_t.java b/java/src/hdf/hdf5lib/structs/H5F_info2_t.java
index 6f5f595..f951bb4 100644
--- a/java/src/hdf/hdf5lib/structs/H5F_info2_t.java
+++ b/java/src/hdf/hdf5lib/structs/H5F_info2_t.java
@@ -1,6 +1,5 @@
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* 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 *
@@ -15,19 +14,43 @@ package hdf.hdf5lib.structs;
import java.io.Serializable;
-//Information struct for object (for H5Fget_info)
+/**
+ * Information struct for object (for H5Fget_info)
+ *
+ */
public class H5F_info2_t implements Serializable{
private static final long serialVersionUID = 4691681162544054518L;
- public int super_version; // Superblock version #
- public long super_size; // Superblock size
- public long super_ext_size; // Superblock extension size
- public int free_version; // Version # of file free space management
- public long free_meta_size; // Free space manager metadata size
- public long free_tot_space; // Amount of free space in the file
- public int sohm_version; // Version # of shared object header info
- public long sohm_hdr_size; // Shared object header message header size
- public H5_ih_info_t sohm_msgs_info; // Shared object header message index & heap size
+ /** Superblock version number */
+ public int super_version;
+ /** Superblock size */
+ public long super_size;
+ /** Superblock extension size */
+ public long super_ext_size;
+ /** Version number of file free space management */
+ public int free_version;
+ /** Free space manager metadata size */
+ public long free_meta_size;
+ /** Amount of free space in the file */
+ public long free_tot_space;
+ /** Version number of shared object header info */
+ public int sohm_version;
+ /** Shared object header message header size */
+ public long sohm_hdr_size;
+ /** Shared object header message index and heap size */
+ public H5_ih_info_t sohm_msgs_info;
+ /**
+ * Constructor fot current "global" information about file
+ * @param super_version: Superblock version number
+ * @param super_size: Superblock size
+ * @param super_ext_size: Superblock extension size
+ * @param free_version: Version number of file free space management
+ * @param free_meta_size: Free space manager metadata size
+ * @param free_tot_space: Amount of free space in the file
+ * @param sohm_version: Version number of shared object header info
+ * @param sohm_hdr_size: Shared object header message header size
+ * @param sohm_msgs_info: Shared object header message index and heap size
+ */
public H5F_info2_t (int super_version, long super_size, long super_ext_size,
int free_version, long free_meta_size, long free_tot_space,
int sohm_version, long sohm_hdr_size, H5_ih_info_t sohm_msgs_info)
diff --git a/java/src/hdf/hdf5lib/structs/H5G_info_t.java b/java/src/hdf/hdf5lib/structs/H5G_info_t.java
index e9f0aac..e79f859 100644
--- a/java/src/hdf/hdf5lib/structs/H5G_info_t.java
+++ b/java/src/hdf/hdf5lib/structs/H5G_info_t.java
@@ -1,6 +1,5 @@
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* 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 *
@@ -15,11 +14,18 @@ package hdf.hdf5lib.structs;
import java.io.Serializable;
-//Information struct for group (for H5Gget_info/H5Gget_info_by_name/H5Gget_info_by_idx)
+/**
+ * Information struct for group (for H5Gget_info/H5Gget_info_by_name/H5Gget_info_by_idx)
+ *
+ */
public class H5G_info_t implements Serializable{
private static final long serialVersionUID = -3746463015312132912L;
- public int storage_type; // Type of storage for links in group
- public long nlinks; // Number of links in group
- public long max_corder; // Current max. creation order value for group
- public boolean mounted; // Whether group has a file mounted on it
+ /** Type of storage for links in group */
+ public int storage_type;
+ /** Number of links in group */
+ public long nlinks;
+ /** Current max. creation order value for group */
+ public long max_corder;
+ /** Whether group has a file mounted on it */
+ public boolean mounted;
}
diff --git a/java/src/hdf/hdf5lib/structs/H5L_info_t.java b/java/src/hdf/hdf5lib/structs/H5L_info_t.java
index 4a1545b..a3011c0 100644
--- a/java/src/hdf/hdf5lib/structs/H5L_info_t.java
+++ b/java/src/hdf/hdf5lib/structs/H5L_info_t.java
@@ -1,6 +1,5 @@
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* 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 *
@@ -17,17 +16,26 @@ import java.io.Serializable;
import hdf.hdf5lib.HDF5Constants;
-// Information struct for link (for H5Lget_info/H5Lget_info_by_idx)
+/**
+ * Information struct for link (for H5Lget_info/H5Lget_info_by_idx)
+ *
+ */
public class H5L_info_t implements Serializable {
private static final long serialVersionUID = -4754320605310155033L;
+ /** Type of link */
public int type;
+ /** Indicate if creation order is valid */
public boolean corder_valid;
+ /** Creation order */
public long corder;
+ /** Character set of link name */
public int cset;
+ /** Character set of link name */
public H5O_token_t token;
+ /** Size of a soft link or user-defined link value */
public long val_size;
- // Constructor for using object token portion of C union
+ /** Constructor for using object token portion of C union */
H5L_info_t (int type, boolean corder_valid, long corder,
int cset, H5O_token_t token)
{
@@ -39,7 +47,7 @@ public class H5L_info_t implements Serializable {
this.val_size = -1;
}
- // Constructor for using val_size portion of C union
+ /** Constructor for using val_size portion of C union */
H5L_info_t (int type, boolean corder_valid, long corder,
int cset, long val_size)
{
diff --git a/java/src/hdf/hdf5lib/structs/H5O_hdr_info_t.java b/java/src/hdf/hdf5lib/structs/H5O_hdr_info_t.java
index 596337d..2475dd9 100644
--- a/java/src/hdf/hdf5lib/structs/H5O_hdr_info_t.java
+++ b/java/src/hdf/hdf5lib/structs/H5O_hdr_info_t.java
@@ -1,6 +1,5 @@
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* 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 *
@@ -15,19 +14,32 @@ package hdf.hdf5lib.structs;
import java.io.Serializable;
-// Information struct for object header metadata (for H5Oget_info/H5Oget_info_by_name/H5Oget_info_by_idx)
+/**
+ * Information struct for object header metadata (for H5Oget_info/H5Oget_info_by_name/H5Oget_info_by_idx)
+ *
+ */
public class H5O_hdr_info_t implements Serializable {
private static final long serialVersionUID = 7883826382952577189L;
- public int version; /* Version number of header format in file */
- public int nmesgs; /* Number of object header messages */
- public int nchunks; /* Number of object header chunks */
- public int flags; /* Object header status flags */
- public long space_total; /* Total space for storing object header in file */
- public long space_meta; /* Space within header for object header metadata information */
- public long space_mesg; /* Space within header for actual message information */
- public long space_free; /* Free space within object header */
- public long mesg_present; /* Flags to indicate presence of message type in header */
- public long mesg_shared; /* Flags to indicate message type is shared in header */
+ /** Version number of header format in file */
+ public int version;
+ /** Number of object header messages */
+ public int nmesgs;
+ /** Number of object header chunks */
+ public int nchunks;
+ /** Object header status flags */
+ public int flags;
+ /** Total space for storing object header in file */
+ public long space_total;
+ /** Space within header for object header metadata information */
+ public long space_meta;
+ /** Space within header for actual message information */
+ public long space_mesg;
+ /** Free space within object header */
+ public long space_free;
+ /** Flags to indicate presence of message type in header */
+ public long mesg_present;
+ /** Flags to indicate message type is shared in header */
+ public long mesg_shared;
H5O_hdr_info_t (int version, int nmesgs, int nchunks, int flags,
long space_total, long space_meta, long space_mesg, long space_free,
@@ -56,25 +68,25 @@ public class H5O_hdr_info_t implements Serializable {
H5O_hdr_info_t info = (H5O_hdr_info_t) o;
if (this.version != info.version)
- return false;
+ return false;
if (this.nmesgs != info.nmesgs)
- return false;
+ return false;
if (this.nchunks != info.nchunks)
- return false;
+ return false;
if (this.flags != info.flags)
- return false;
+ return false;
if (this.space_total != info.space_total)
- return false;
+ return false;
if (this.space_meta != info.space_meta)
- return false;
+ return false;
if (this.space_mesg != info.space_mesg)
- return false;
+ return false;
if (this.space_free != info.space_free)
- return false;
+ return false;
if (this.mesg_present != info.mesg_present)
- return false;
+ return false;
if (this.mesg_shared != info.mesg_shared)
- return false;
+ return false;
return true;
}
diff --git a/java/src/hdf/hdf5lib/structs/H5O_info_t.java b/java/src/hdf/hdf5lib/structs/H5O_info_t.java
index 7bf1336..d2208d2 100644
--- a/java/src/hdf/hdf5lib/structs/H5O_info_t.java
+++ b/java/src/hdf/hdf5lib/structs/H5O_info_t.java
@@ -1,6 +1,5 @@
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* 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 *
@@ -15,19 +14,43 @@ package hdf.hdf5lib.structs;
import java.io.Serializable;
-// Information struct for object (for H5Oget_info/H5Oget_info_by_name/H5Oget_info_by_idx)
+/**
+ * Information struct for object (for H5Oget_info/H5Oget_info_by_name/H5Oget_info_by_idx)
+ *
+ */
public class H5O_info_t implements Serializable {
private static final long serialVersionUID = 4691681163544054518L;
- public long fileno; /* File number that object is located in */
- public H5O_token_t token; /* Object token in file */
- public int type; /* Basic object type (group, dataset, etc.) */
- public int rc; /* Reference count of object */
- public long atime; /* Access time */
- public long mtime; /* Modification time */
- public long ctime; /* Change time */
- public long btime; /* Birth time */
- public long num_attrs; /* # of attributes attached to object */
+ /** File number that object is located in */
+ public long fileno;
+ /** Object token in file */
+ public H5O_token_t token;
+ /** Basic object type (group, dataset, etc.) */
+ public int type;
+ /** Reference count of object */
+ public int rc;
+ /** Access time */
+ public long atime;
+ /** Modification time */
+ public long mtime;
+ /** Change time */
+ public long ctime;
+ /** Birth time */
+ public long btime;
+ /** Number of attributes attached to object */
+ public long num_attrs;
+ /** Constructor for data model information struct for objects
+ *
+ * @param fileno: File number that object is located in
+ * @param token: Object token in file
+ * @param type: Basic object type
+ * @param rc: Reference count of object
+ * @param atime: Access time
+ * @param mtime: Modification time
+ * @param ctime: Change time
+ * @param btime: Birth time
+ * @param num_attrs: Number of attributes attached to object
+ */
public H5O_info_t (long fileno, H5O_token_t token, int type,
int rc, long atime, long mtime, long ctime, long btime, long num_attrs)
{
diff --git a/java/src/hdf/hdf5lib/structs/H5O_native_info_t.java b/java/src/hdf/hdf5lib/structs/H5O_native_info_t.java
index f859ca4..70e5231 100644
--- a/java/src/hdf/hdf5lib/structs/H5O_native_info_t.java
+++ b/java/src/hdf/hdf5lib/structs/H5O_native_info_t.java
@@ -1,6 +1,5 @@
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* 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 *
@@ -15,15 +14,20 @@ package hdf.hdf5lib.structs;
import java.io.Serializable;
-// Information struct for native HDF5 object info, such as object header metadata (for H5Oget_info/H5Oget_info_by_name/H5Oget_info_by_idx).
+/**
+ * Information struct for native HDF5 object info, such as object header metadata (for H5Oget_info/H5Oget_info_by_name/H5Oget_info_by_idx).
+ *
+ */
public class H5O_native_info_t implements Serializable {
private static final long serialVersionUID = 7883826382952577189L;
-
- public H5O_hdr_info_t hdr_info; /* Object header information */
+ /** Object header information */
+ public H5O_hdr_info_t hdr_info;
/* Extra metadata storage for obj & attributes */
- public H5_ih_info_t obj_info; /* v1/v2 B-tree & local/fractal heap for groups, B-tree for chunked datasets */
- public H5_ih_info_t attr_info; /* v2 B-tree & heap for attributes */
+ /** v1/v2 B-tree and local/fractal heap for groups, B-tree for chunked datasets */
+ public H5_ih_info_t obj_info;
+ /** v2 B-tree and heap for attributes */
+ public H5_ih_info_t attr_info;
H5O_native_info_t (H5O_hdr_info_t oheader_info, H5_ih_info_t obj_info, H5_ih_info_t attr_info)
{
@@ -45,7 +49,7 @@ public class H5O_native_info_t implements Serializable {
if (!this.hdr_info.equals(info.hdr_info)
|| !this.obj_info.equals(info.obj_info)
|| !this.attr_info.equals(info.attr_info))
- return false;
+ return false;
return true;
}
diff --git a/java/src/hdf/hdf5lib/structs/H5O_token_t.java b/java/src/hdf/hdf5lib/structs/H5O_token_t.java
index 24612bb..f0bb978 100644
--- a/java/src/hdf/hdf5lib/structs/H5O_token_t.java
+++ b/java/src/hdf/hdf5lib/structs/H5O_token_t.java
@@ -17,15 +17,28 @@ import java.util.Arrays;
import hdf.hdf5lib.HDF5Constants;
-// Object token, which is a unique and permanent identifier, for an HDF5 object within a container.
+/**
+ * Object token, which is a unique and permanent identifier, for an HDF5 object within a container.
+ *
+ */
public class H5O_token_t implements Serializable {
private static final long serialVersionUID = -4754320605310155032L;
+ /**
+ * Tokens are unique and permanent identifiers that are
+ * used to reference HDF5 objects in a container.
+ * Use basic byte array to store the dat
+ */
public byte[] data;
H5O_token_t (byte[] data) {
this.data = data;
}
+ /**
+ * Check if token data is undefined
+ *
+ * @return true if token data is undefined
+ */
public boolean isUndefined() {
return this.equals(HDF5Constants.H5O_TOKEN_UNDEF);
}
diff --git a/java/src/hdf/hdf5lib/structs/H5_ih_info_t.java b/java/src/hdf/hdf5lib/structs/H5_ih_info_t.java
index db89c9a..0c6111b 100644
--- a/java/src/hdf/hdf5lib/structs/H5_ih_info_t.java
+++ b/java/src/hdf/hdf5lib/structs/H5_ih_info_t.java
@@ -1,6 +1,5 @@
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* 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 *
@@ -15,10 +14,15 @@ package hdf.hdf5lib.structs;
import java.io.Serializable;
-//Information struct for group (for H5Gget_info/H5Gget_info_by_name/H5Gget_info_by_idx)
+/**
+ * Information struct for group (for H5Gget_info/H5Gget_info_by_name/H5Gget_info_by_idx)
+ *
+ */
public class H5_ih_info_t implements Serializable {
private static final long serialVersionUID = -142238015615462707L;
- public long index_size; /* btree and/or list */
+ /** btree and/or list size of index */
+ public long index_size;
+ /** btree and/or list size of hp */
public long heap_size;
H5_ih_info_t (long index_size, long heap_size)
@@ -38,9 +42,9 @@ public class H5_ih_info_t implements Serializable {
H5_ih_info_t info = (H5_ih_info_t) o;
if (this.index_size != info.index_size)
- return false;
+ return false;
if (this.heap_size != info.heap_size)
- return false;
+ return false;
return true;
}
diff --git a/java/src/jni/CMakeLists.txt b/java/src/jni/CMakeLists.txt
index d137747..ab306ef 100644
--- a/java/src/jni/CMakeLists.txt
+++ b/java/src/jni/CMakeLists.txt
@@ -45,6 +45,7 @@ set (HDF5_JAVA_JNI_CHDRS
${HDF5_JAVA_JNI_SOURCE_DIR}/h5fImp.h
${HDF5_JAVA_JNI_SOURCE_DIR}/h5gImp.h
${HDF5_JAVA_JNI_SOURCE_DIR}/h5iImp.h
+ ${HDF5_JAVA_JNI_SOURCE_DIR}/h5Imp.h
${HDF5_JAVA_JNI_SOURCE_DIR}/h5jni.h
${HDF5_JAVA_JNI_SOURCE_DIR}/h5lImp.h
${HDF5_JAVA_JNI_SOURCE_DIR}/h5oImp.h
diff --git a/java/src/jni/exceptionImp.c b/java/src/jni/exceptionImp.c
index e62caee..3ccb6ef 100644
--- a/java/src/jni/exceptionImp.c
+++ b/java/src/jni/exceptionImp.c
@@ -262,12 +262,25 @@ done:
* exception.
*/
jboolean
-h5outOfMemory(JNIEnv *env, const char *functName)
+h5outOfMemory(JNIEnv *env, const char *message)
{
- return H5JNIErrorClass(env, functName, "java/lang/OutOfMemoryError");
+ return H5JNIErrorClass(env, message, "java/lang/OutOfMemoryError");
} /* end h5outOfMemory() */
/*
+ * Create and throw an 'AssertionError'
+ *
+ * Note: This routine never returns from the 'throw',
+ * and the Java native method immediately raises the
+ * exception.
+ */
+jboolean
+h5assertion(JNIEnv *env, const char *message)
+{
+ return H5JNIErrorClass(env, message, "java/lang/AssertionError");
+} /* end h5assertion() */
+
+/*
* A fatal error in a JNI call
* Create and throw an 'InternalError'
*
@@ -276,9 +289,9 @@ h5outOfMemory(JNIEnv *env, const char *functName)
* exception.
*/
jboolean
-h5JNIFatalError(JNIEnv *env, const char *functName)
+h5JNIFatalError(JNIEnv *env, const char *message)
{
- return H5JNIErrorClass(env, functName, "java/lang/InternalError");
+ return H5JNIErrorClass(env, message, "java/lang/InternalError");
} /* end h5JNIFatalError() */
/*
@@ -290,9 +303,9 @@ h5JNIFatalError(JNIEnv *env, const char *functName)
* exception.
*/
jboolean
-h5nullArgument(JNIEnv *env, const char *functName)
+h5nullArgument(JNIEnv *env, const char *message)
{
- return H5JNIErrorClass(env, functName, "java/lang/NullPointerException");
+ return H5JNIErrorClass(env, message, "java/lang/NullPointerException");
} /* end h5nullArgument() */
/*
@@ -304,9 +317,9 @@ h5nullArgument(JNIEnv *env, const char *functName)
* exception.
*/
jboolean
-h5badArgument(JNIEnv *env, const char *functName)
+h5badArgument(JNIEnv *env, const char *message)
{
- return H5JNIErrorClass(env, functName, "java/lang/IllegalArgumentException");
+ return H5JNIErrorClass(env, message, "java/lang/IllegalArgumentException");
} /* end h5badArgument() */
/*
@@ -318,9 +331,9 @@ h5badArgument(JNIEnv *env, const char *functName)
* exception.
*/
jboolean
-h5unimplemented(JNIEnv *env, const char *functName)
+h5unimplemented(JNIEnv *env, const char *message)
{
- return H5JNIErrorClass(env, functName, "java/lang/UnsupportedOperationException");
+ return H5JNIErrorClass(env, message, "java/lang/UnsupportedOperationException");
} /* end h5unimplemented() */
/* h5raiseException(). This routine is called to generate
@@ -442,8 +455,8 @@ defineHDF5LibraryException(hid_t maj_num)
return "hdf/hdf5lib/exceptions/HDF5LowLevelIOException";
else if (H5E_FUNC == err_num)
return "hdf/hdf5lib/exceptions/HDF5FunctionEntryExitException";
- else if (H5E_ATOM == err_num)
- return "hdf/hdf5lib/exceptions/HDF5AtomException";
+ else if (H5E_ID == err_num)
+ return "hdf/hdf5lib/exceptions/HDF5IdException";
else if (H5E_CACHE == err_num)
return "hdf/hdf5lib/exceptions/HDF5MetaDataCacheException";
else if (H5E_BTREE == err_num)
diff --git a/java/src/jni/exceptionImp.h b/java/src/jni/exceptionImp.h
index 4b81605..38469df 100644
--- a/java/src/jni/exceptionImp.h
+++ b/java/src/jni/exceptionImp.h
@@ -1,6 +1,5 @@
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* 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 *
@@ -14,8 +13,8 @@
#include <jni.h>
/* Header for class hdf_hdf5lib_H5_exception */
-#ifndef _Included_hdf_hdf5lib_H5_exception
-#define _Included_hdf_hdf5lib_H5_exception
+#ifndef Included_hdf_hdf5lib_H5_exception
+#define Included_hdf_hdf5lib_H5_exception
#ifdef __cplusplus
extern "C" {
@@ -68,4 +67,4 @@ JNIEXPORT jlong JNICALL Java_hdf_hdf5lib_exceptions_HDF5LibraryException__1getMi
} /* end extern "C" */
#endif /* __cplusplus */
-#endif /* _Included_hdf_hdf5lib_H5_exception */
+#endif /* Included_hdf_hdf5lib_H5_exception */
diff --git a/java/src/jni/h5Constants.c b/java/src/jni/h5Constants.c
index 7c6405d..7354e95 100644
--- a/java/src/jni/h5Constants.c
+++ b/java/src/jni/h5Constants.c
@@ -330,9 +330,9 @@ Java_hdf_hdf5lib_HDF5Constants_H5E_1ARGS(JNIEnv *env, jclass cls)
return H5E_ARGS;
}
JNIEXPORT jlong JNICALL
-Java_hdf_hdf5lib_HDF5Constants_H5E_1ATOM(JNIEnv *env, jclass cls)
+Java_hdf_hdf5lib_HDF5Constants_H5E_1ID(JNIEnv *env, jclass cls)
{
- return H5E_ATOM;
+ return H5E_ID;
}
JNIEXPORT jlong JNICALL
Java_hdf_hdf5lib_HDF5Constants_H5E_1ATTR(JNIEnv *env, jclass cls)
@@ -340,9 +340,9 @@ Java_hdf_hdf5lib_HDF5Constants_H5E_1ATTR(JNIEnv *env, jclass cls)
return H5E_ATTR;
}
JNIEXPORT jlong JNICALL
-Java_hdf_hdf5lib_HDF5Constants_H5E_1BADATOM(JNIEnv *env, jclass cls)
+Java_hdf_hdf5lib_HDF5Constants_H5E_1BADID(JNIEnv *env, jclass cls)
{
- return H5E_BADATOM;
+ return H5E_BADID;
}
JNIEXPORT jlong JNICALL
Java_hdf_hdf5lib_HDF5Constants_H5E_1BADFILE(JNIEnv *env, jclass cls)
@@ -355,6 +355,11 @@ Java_hdf_hdf5lib_HDF5Constants_H5E_1BADGROUP(JNIEnv *env, jclass cls)
return H5E_BADGROUP;
}
JNIEXPORT jlong JNICALL
+Java_hdf_hdf5lib_HDF5Constants_H5E_1BADITER(JNIEnv *env, jclass cls)
+{
+ return H5E_BADITER;
+}
+JNIEXPORT jlong JNICALL
Java_hdf_hdf5lib_HDF5Constants_H5E_1BADMESG(JNIEnv *env, jclass cls)
{
return H5E_BADMESG;
@@ -404,8 +409,26 @@ Java_hdf_hdf5lib_HDF5Constants_H5E_1CANAPPLY(JNIEnv *env, jclass cls)
{
return H5E_CANAPPLY;
}
-/*JNIEXPORT jlong JNICALL
-Java_hdf_hdf5lib_HDF5Constants_H5E_1CANTALLOC(JNIEnv *env, jclass cls) { return H5E_CANTALLOC; }*/
+JNIEXPORT jlong JNICALL
+Java_hdf_hdf5lib_HDF5Constants_H5E_1CANTALLOC(JNIEnv *env, jclass cls)
+{
+ return H5E_CANTALLOC;
+}
+JNIEXPORT jlong JNICALL
+Java_hdf_hdf5lib_HDF5Constants_H5E_1CANTAPPEND(JNIEnv *env, jclass cls)
+{
+ return H5E_CANTAPPEND;
+}
+JNIEXPORT jlong JNICALL
+Java_hdf_hdf5lib_HDF5Constants_H5E_1CANTATTACH(JNIEnv *env, jclass cls)
+{
+ return H5E_CANTATTACH;
+}
+JNIEXPORT jlong JNICALL
+Java_hdf_hdf5lib_HDF5Constants_H5E_1CANTCLEAN(JNIEnv *env, jclass cls)
+{
+ return H5E_CANTCLEAN;
+}
JNIEXPORT jlong JNICALL
Java_hdf_hdf5lib_HDF5Constants_H5E_1CANTCLIP(JNIEnv *env, jclass cls)
{
@@ -417,6 +440,21 @@ Java_hdf_hdf5lib_HDF5Constants_H5E_1CANTCLOSEFILE(JNIEnv *env, jclass cls)
return H5E_CANTCLOSEFILE;
}
JNIEXPORT jlong JNICALL
+Java_hdf_hdf5lib_HDF5Constants_H5E_1CANTCLOSEOBJ(JNIEnv *env, jclass cls)
+{
+ return H5E_CANTCLOSEOBJ;
+}
+JNIEXPORT jlong JNICALL
+Java_hdf_hdf5lib_HDF5Constants_H5E_1CANTCOMPARE(JNIEnv *env, jclass cls)
+{
+ return H5E_CANTCOMPARE;
+}
+JNIEXPORT jlong JNICALL
+Java_hdf_hdf5lib_HDF5Constants_H5E_1CANTCOMPUTE(JNIEnv *env, jclass cls)
+{
+ return H5E_CANTCOMPUTE;
+}
+JNIEXPORT jlong JNICALL
Java_hdf_hdf5lib_HDF5Constants_H5E_1CANTCONVERT(JNIEnv *env, jclass cls)
{
return H5E_CANTCONVERT;
@@ -427,6 +465,11 @@ Java_hdf_hdf5lib_HDF5Constants_H5E_1CANTCOPY(JNIEnv *env, jclass cls)
return H5E_CANTCOPY;
}
JNIEXPORT jlong JNICALL
+Java_hdf_hdf5lib_HDF5Constants_H5E_1CANTCORK(JNIEnv *env, jclass cls)
+{
+ return H5E_CANTCORK;
+}
+JNIEXPORT jlong JNICALL
Java_hdf_hdf5lib_HDF5Constants_H5E_1CANTCOUNT(JNIEnv *env, jclass cls)
{
return H5E_CANTCOUNT;
@@ -457,11 +500,36 @@ Java_hdf_hdf5lib_HDF5Constants_H5E_1CANTDELETEFILE(JNIEnv *env, jclass cls)
return H5E_CANTDELETEFILE;
}
JNIEXPORT jlong JNICALL
+Java_hdf_hdf5lib_HDF5Constants_H5E_1CANTDEPEND(JNIEnv *env, jclass cls)
+{
+ return H5E_CANTDEPEND;
+}
+JNIEXPORT jlong JNICALL
+Java_hdf_hdf5lib_HDF5Constants_H5E_1CANTDIRTY(JNIEnv *env, jclass cls)
+{
+ return H5E_CANTDIRTY;
+}
+JNIEXPORT jlong JNICALL
+Java_hdf_hdf5lib_HDF5Constants_H5E_1CANTFILTER(JNIEnv *env, jclass cls)
+{
+ return H5E_CANTFILTER;
+}
+JNIEXPORT jlong JNICALL
Java_hdf_hdf5lib_HDF5Constants_H5E_1CANTENCODE(JNIEnv *env, jclass cls)
{
return H5E_CANTENCODE;
}
JNIEXPORT jlong JNICALL
+Java_hdf_hdf5lib_HDF5Constants_H5E_1CANTEXPUNGE(JNIEnv *env, jclass cls)
+{
+ return H5E_CANTEXPUNGE;
+}
+JNIEXPORT jlong JNICALL
+Java_hdf_hdf5lib_HDF5Constants_H5E_1CANTEXTEND(JNIEnv *env, jclass cls)
+{
+ return H5E_CANTEXTEND;
+}
+JNIEXPORT jlong JNICALL
Java_hdf_hdf5lib_HDF5Constants_H5E_1CANTFLUSH(JNIEnv *env, jclass cls)
{
return H5E_CANTFLUSH;
@@ -472,11 +540,26 @@ Java_hdf_hdf5lib_HDF5Constants_H5E_1CANTFREE(JNIEnv *env, jclass cls)
return H5E_CANTFREE;
}
JNIEXPORT jlong JNICALL
+Java_hdf_hdf5lib_HDF5Constants_H5E_1CANTGATHER(JNIEnv *env, jclass cls)
+{
+ return H5E_CANTGATHER;
+}
+JNIEXPORT jlong JNICALL
+Java_hdf_hdf5lib_HDF5Constants_H5E_1CANTGC(JNIEnv *env, jclass cls)
+{
+ return H5E_CANTGC;
+}
+JNIEXPORT jlong JNICALL
Java_hdf_hdf5lib_HDF5Constants_H5E_1CANTGET(JNIEnv *env, jclass cls)
{
return H5E_CANTGET;
}
JNIEXPORT jlong JNICALL
+Java_hdf_hdf5lib_HDF5Constants_H5E_1CANTGETSIZE(JNIEnv *env, jclass cls)
+{
+ return H5E_CANTGETSIZE;
+}
+JNIEXPORT jlong JNICALL
Java_hdf_hdf5lib_HDF5Constants_H5E_1CANTINC(JNIEnv *env, jclass cls)
{
return H5E_CANTINC;
@@ -487,6 +570,11 @@ Java_hdf_hdf5lib_HDF5Constants_H5E_1CANTINIT(JNIEnv *env, jclass cls)
return H5E_CANTINIT;
}
JNIEXPORT jlong JNICALL
+Java_hdf_hdf5lib_HDF5Constants_H5E_1CANTINS(JNIEnv *env, jclass cls)
+{
+ return H5E_CANTINS;
+}
+JNIEXPORT jlong JNICALL
Java_hdf_hdf5lib_HDF5Constants_H5E_1CANTINSERT(JNIEnv *env, jclass cls)
{
return H5E_CANTINSERT;
@@ -507,11 +595,56 @@ Java_hdf_hdf5lib_HDF5Constants_H5E_1CANTLOCK(JNIEnv *env, jclass cls)
return H5E_CANTLOCK;
}
JNIEXPORT jlong JNICALL
+Java_hdf_hdf5lib_HDF5Constants_H5E_1CANTLOCKFILE(JNIEnv *env, jclass cls)
+{
+ return H5E_CANTLOCKFILE;
+}
+JNIEXPORT jlong JNICALL
+Java_hdf_hdf5lib_HDF5Constants_H5E_1CANTMARKCLEAN(JNIEnv *env, jclass cls)
+{
+ return H5E_CANTMARKCLEAN;
+}
+JNIEXPORT jlong JNICALL
+Java_hdf_hdf5lib_HDF5Constants_H5E_1CANTMARKDIRTY(JNIEnv *env, jclass cls)
+{
+ return H5E_CANTMARKDIRTY;
+}
+JNIEXPORT jlong JNICALL
+Java_hdf_hdf5lib_HDF5Constants_H5E_1CANTMARKSERIALIZED(JNIEnv *env, jclass cls)
+{
+ return H5E_CANTMARKSERIALIZED;
+}
+JNIEXPORT jlong JNICALL
+Java_hdf_hdf5lib_HDF5Constants_H5E_1CANTMARKUNSERIALIZED(JNIEnv *env, jclass cls)
+{
+ return H5E_CANTMARKUNSERIALIZED;
+}
+JNIEXPORT jlong JNICALL
+Java_hdf_hdf5lib_HDF5Constants_H5E_1CANTMERGE(JNIEnv *env, jclass cls)
+{
+ return H5E_CANTMERGE;
+}
+JNIEXPORT jlong JNICALL
+Java_hdf_hdf5lib_HDF5Constants_H5E_1CANTMODIFY(JNIEnv *env, jclass cls)
+{
+ return H5E_CANTMODIFY;
+}
+JNIEXPORT jlong JNICALL
+Java_hdf_hdf5lib_HDF5Constants_H5E_1CANTMOVE(JNIEnv *env, jclass cls)
+{
+ return H5E_CANTMOVE;
+}
+JNIEXPORT jlong JNICALL
Java_hdf_hdf5lib_HDF5Constants_H5E_1CANTNEXT(JNIEnv *env, jclass cls)
{
return H5E_CANTNEXT;
}
JNIEXPORT jlong JNICALL
+Java_hdf_hdf5lib_HDF5Constants_H5E_1CANTNOTIFY(JNIEnv *env, jclass cls)
+{
+ return H5E_CANTNOTIFY;
+}
+JNIEXPORT jlong JNICALL
Java_hdf_hdf5lib_HDF5Constants_H5E_1CANTOPENFILE(JNIEnv *env, jclass cls)
{
return H5E_CANTOPENFILE;
@@ -521,8 +654,36 @@ Java_hdf_hdf5lib_HDF5Constants_H5E_1CANTOPENOBJ(JNIEnv *env, jclass cls)
{
return H5E_CANTOPENOBJ;
}
-/*JNIEXPORT jlong JNICALL
-Java_hdf_hdf5lib_HDF5Constants_H5E_1CANTRECV(JNIEnv *env, jclass cls) { return H5E_CANTRECV; }*/
+JNIEXPORT jlong JNICALL
+Java_hdf_hdf5lib_HDF5Constants_H5E_1CANTOPERATE(JNIEnv *env, jclass cls)
+{
+ return H5E_CANTOPERATE;
+}
+JNIEXPORT jlong JNICALL
+Java_hdf_hdf5lib_HDF5Constants_H5E_1CANTPACK(JNIEnv *env, jclass cls)
+{
+ return H5E_CANTPACK;
+}
+JNIEXPORT jlong JNICALL
+Java_hdf_hdf5lib_HDF5Constants_H5E_1CANTPIN(JNIEnv *env, jclass cls)
+{
+ return H5E_CANTPIN;
+}
+JNIEXPORT jlong JNICALL
+Java_hdf_hdf5lib_HDF5Constants_H5E_1CANTPROTECT(JNIEnv *env, jclass cls)
+{
+ return H5E_CANTPROTECT;
+}
+JNIEXPORT jlong JNICALL
+Java_hdf_hdf5lib_HDF5Constants_H5E_1CANTRECV(JNIEnv *env, jclass cls)
+{
+ return H5E_CANTRECV;
+}
+JNIEXPORT jlong JNICALL
+Java_hdf_hdf5lib_HDF5Constants_H5E_1CANTREDISTRIBUTE(JNIEnv *env, jclass cls)
+{
+ return H5E_CANTREDISTRIBUTE;
+}
JNIEXPORT jlong JNICALL
Java_hdf_hdf5lib_HDF5Constants_H5E_1CANTREGISTER(JNIEnv *env, jclass cls)
{
@@ -534,6 +695,41 @@ Java_hdf_hdf5lib_HDF5Constants_H5E_1CANTRELEASE(JNIEnv *env, jclass cls)
return H5E_CANTRELEASE;
}
JNIEXPORT jlong JNICALL
+Java_hdf_hdf5lib_HDF5Constants_H5E_1CANTREMOVE(JNIEnv *env, jclass cls)
+{
+ return H5E_CANTREMOVE;
+}
+JNIEXPORT jlong JNICALL
+Java_hdf_hdf5lib_HDF5Constants_H5E_1CANTRENAME(JNIEnv *env, jclass cls)
+{
+ return H5E_CANTRENAME;
+}
+JNIEXPORT jlong JNICALL
+Java_hdf_hdf5lib_HDF5Constants_H5E_1CANTRESET(JNIEnv *env, jclass cls)
+{
+ return H5E_CANTRESET;
+}
+JNIEXPORT jlong JNICALL
+Java_hdf_hdf5lib_HDF5Constants_H5E_1CANTRESIZE(JNIEnv *env, jclass cls)
+{
+ return H5E_CANTRESIZE;
+}
+JNIEXPORT jlong JNICALL
+Java_hdf_hdf5lib_HDF5Constants_H5E_1CANTRESTORE(JNIEnv *env, jclass cls)
+{
+ return H5E_CANTRESTORE;
+}
+JNIEXPORT jlong JNICALL
+Java_hdf_hdf5lib_HDF5Constants_H5E_1CANTREVIVE(JNIEnv *env, jclass cls)
+{
+ return H5E_CANTREVIVE;
+}
+JNIEXPORT jlong JNICALL
+Java_hdf_hdf5lib_HDF5Constants_H5E_1CANTSHRINK(JNIEnv *env, jclass cls)
+{
+ return H5E_CANTSHRINK;
+}
+JNIEXPORT jlong JNICALL
Java_hdf_hdf5lib_HDF5Constants_H5E_1CANTSELECT(JNIEnv *env, jclass cls)
{
return H5E_CANTSELECT;
@@ -544,16 +740,71 @@ Java_hdf_hdf5lib_HDF5Constants_H5E_1CANTSET(JNIEnv *env, jclass cls)
return H5E_CANTSET;
}
JNIEXPORT jlong JNICALL
+Java_hdf_hdf5lib_HDF5Constants_H5E_1CANTSERIALIZE(JNIEnv *env, jclass cls)
+{
+ return H5E_CANTSERIALIZE;
+}
+JNIEXPORT jlong JNICALL
+Java_hdf_hdf5lib_HDF5Constants_H5E_1CANTSORT(JNIEnv *env, jclass cls)
+{
+ return H5E_CANTSORT;
+}
+JNIEXPORT jlong JNICALL
Java_hdf_hdf5lib_HDF5Constants_H5E_1CANTSPLIT(JNIEnv *env, jclass cls)
{
return H5E_CANTSPLIT;
}
JNIEXPORT jlong JNICALL
+Java_hdf_hdf5lib_HDF5Constants_H5E_1CANTSWAP(JNIEnv *env, jclass cls)
+{
+ return H5E_CANTSWAP;
+}
+JNIEXPORT jlong JNICALL
+Java_hdf_hdf5lib_HDF5Constants_H5E_1CANTTAG(JNIEnv *env, jclass cls)
+{
+ return H5E_CANTTAG;
+}
+JNIEXPORT jlong JNICALL
+Java_hdf_hdf5lib_HDF5Constants_H5E_1CANTUNCORK(JNIEnv *env, jclass cls)
+{
+ return H5E_CANTUNCORK;
+}
+JNIEXPORT jlong JNICALL
+Java_hdf_hdf5lib_HDF5Constants_H5E_1CANTUNDEPEND(JNIEnv *env, jclass cls)
+{
+ return H5E_CANTUNDEPEND;
+}
+JNIEXPORT jlong JNICALL
Java_hdf_hdf5lib_HDF5Constants_H5E_1CANTUNLOCK(JNIEnv *env, jclass cls)
{
return H5E_CANTUNLOCK;
}
JNIEXPORT jlong JNICALL
+Java_hdf_hdf5lib_HDF5Constants_H5E_1CANTUNLOCKFILE(JNIEnv *env, jclass cls)
+{
+ return H5E_CANTUNLOCKFILE;
+}
+JNIEXPORT jlong JNICALL
+Java_hdf_hdf5lib_HDF5Constants_H5E_1CANTUNPIN(JNIEnv *env, jclass cls)
+{
+ return H5E_CANTUNPIN;
+}
+JNIEXPORT jlong JNICALL
+Java_hdf_hdf5lib_HDF5Constants_H5E_1CANTUNPROTECT(JNIEnv *env, jclass cls)
+{
+ return H5E_CANTUNPROTECT;
+}
+JNIEXPORT jlong JNICALL
+Java_hdf_hdf5lib_HDF5Constants_H5E_1CANTUNSERIALIZE(JNIEnv *env, jclass cls)
+{
+ return H5E_CANTUNSERIALIZE;
+}
+JNIEXPORT jlong JNICALL
+Java_hdf_hdf5lib_HDF5Constants_H5E_1CANTUPDATE(JNIEnv *env, jclass cls)
+{
+ return H5E_CANTUPDATE;
+}
+JNIEXPORT jlong JNICALL
Java_hdf_hdf5lib_HDF5Constants_H5E_1CLOSEERROR(JNIEnv *env, jclass cls)
{
return H5E_CLOSEERROR;
@@ -564,6 +815,11 @@ Java_hdf_hdf5lib_HDF5Constants_H5E_1COMPLEN(JNIEnv *env, jclass cls)
return H5E_COMPLEN;
}
JNIEXPORT jlong JNICALL
+Java_hdf_hdf5lib_HDF5Constants_H5E_1CONTEXT(JNIEnv *env, jclass cls)
+{
+ return H5E_CONTEXT;
+}
+JNIEXPORT jlong JNICALL
Java_hdf_hdf5lib_HDF5Constants_H5E_1DATASET(JNIEnv *env, jclass cls)
{
return H5E_DATASET;
@@ -589,16 +845,31 @@ Java_hdf_hdf5lib_HDF5Constants_H5E_1DUPCLASS(JNIEnv *env, jclass cls)
return H5E_DUPCLASS;
}
JNIEXPORT jlong JNICALL
+Java_hdf_hdf5lib_HDF5Constants_H5E_1EARRAY(JNIEnv *env, jclass cls)
+{
+ return H5E_EARRAY;
+}
+JNIEXPORT jlong JNICALL
Java_hdf_hdf5lib_HDF5Constants_H5E_1EFL(JNIEnv *env, jclass cls)
{
return H5E_EFL;
}
JNIEXPORT jlong JNICALL
+Java_hdf_hdf5lib_HDF5Constants_H5E_1ERROR(JNIEnv *env, jclass cls)
+{
+ return H5E_ERROR;
+}
+JNIEXPORT jlong JNICALL
Java_hdf_hdf5lib_HDF5Constants_H5E_1EXISTS(JNIEnv *env, jclass cls)
{
return H5E_EXISTS;
}
JNIEXPORT jlong JNICALL
+Java_hdf_hdf5lib_HDF5Constants_H5E_1FARRAY(JNIEnv *env, jclass cls)
+{
+ return H5E_FARRAY;
+}
+JNIEXPORT jlong JNICALL
Java_hdf_hdf5lib_HDF5Constants_H5E_1FCNTL(JNIEnv *env, jclass cls)
{
return H5E_FCNTL;
@@ -619,6 +890,11 @@ Java_hdf_hdf5lib_HDF5Constants_H5E_1FILEOPEN(JNIEnv *env, jclass cls)
return H5E_FILEOPEN;
}
JNIEXPORT jlong JNICALL
+Java_hdf_hdf5lib_HDF5Constants_H5E_1FSPACE(JNIEnv *env, jclass cls)
+{
+ return H5E_FSPACE;
+}
+JNIEXPORT jlong JNICALL
Java_hdf_hdf5lib_HDF5Constants_H5E_1FUNC(JNIEnv *env, jclass cls)
{
return H5E_FUNC;
@@ -629,6 +905,11 @@ Java_hdf_hdf5lib_HDF5Constants_H5E_1HEAP(JNIEnv *env, jclass cls)
return H5E_HEAP;
}
JNIEXPORT jlong JNICALL
+Java_hdf_hdf5lib_HDF5Constants_H5E_1INCONSISTENTSTATE(JNIEnv *env, jclass cls)
+{
+ return H5E_INCONSISTENTSTATE;
+}
+JNIEXPORT jlong JNICALL
Java_hdf_hdf5lib_HDF5Constants_H5E_1INTERNAL(JNIEnv *env, jclass cls)
{
return H5E_INTERNAL;
@@ -648,11 +929,21 @@ Java_hdf_hdf5lib_HDF5Constants_H5E_1LINKCOUNT(JNIEnv *env, jclass cls)
{
return H5E_LINKCOUNT;
}
+JNIEXPORT jlong JNICALL
+Java_hdf_hdf5lib_HDF5Constants_H5E_1LOGGING(JNIEnv *env, jclass cls)
+{
+ return H5E_LOGGING;
+}
JNIEXPORT jint JNICALL
Java_hdf_hdf5lib_HDF5Constants_H5E_1MAJOR(JNIEnv *env, jclass cls)
{
return H5E_MAJOR;
}
+JNIEXPORT jlong JNICALL
+Java_hdf_hdf5lib_HDF5Constants_H5E_1MAP(JNIEnv *env, jclass cls)
+{
+ return H5E_MAP;
+}
JNIEXPORT jint JNICALL
Java_hdf_hdf5lib_HDF5Constants_H5E_1MINOR(JNIEnv *env, jclass cls)
{
@@ -674,6 +965,21 @@ Java_hdf_hdf5lib_HDF5Constants_H5E_1MPIERRSTR(JNIEnv *env, jclass cls)
return H5E_MPIERRSTR;
}
JNIEXPORT jlong JNICALL
+Java_hdf_hdf5lib_HDF5Constants_H5E_1NLINKS(JNIEnv *env, jclass cls)
+{
+ return H5E_NLINKS;
+}
+JNIEXPORT jlong JNICALL
+Java_hdf_hdf5lib_HDF5Constants_H5E_1NO_1INDEPENDENT(JNIEnv *env, jclass cls)
+{
+ return H5E_NO_INDEPENDENT;
+}
+JNIEXPORT jlong JNICALL
+Java_hdf_hdf5lib_HDF5Constants_H5E_1NOENCODER(JNIEnv *env, jclass cls)
+{
+ return H5E_NOENCODER;
+}
+JNIEXPORT jlong JNICALL
Java_hdf_hdf5lib_HDF5Constants_H5E_1NOFILTER(JNIEnv *env, jclass cls)
{
return H5E_NOFILTER;
@@ -714,16 +1020,41 @@ Java_hdf_hdf5lib_HDF5Constants_H5E_1NOTHDF5(JNIEnv *env, jclass cls)
return H5E_NOTHDF5;
}
JNIEXPORT jlong JNICALL
+Java_hdf_hdf5lib_HDF5Constants_H5E_1NOTREGISTERED(JNIEnv *env, jclass cls)
+{
+ return H5E_NOTREGISTERED;
+}
+JNIEXPORT jlong JNICALL
+Java_hdf_hdf5lib_HDF5Constants_H5E_1OBJOPEN(JNIEnv *env, jclass cls)
+{
+ return H5E_OBJOPEN;
+}
+JNIEXPORT jlong JNICALL
Java_hdf_hdf5lib_HDF5Constants_H5E_1OHDR(JNIEnv *env, jclass cls)
{
return H5E_OHDR;
}
JNIEXPORT jlong JNICALL
+Java_hdf_hdf5lib_HDF5Constants_H5E_1OPENERROR(JNIEnv *env, jclass cls)
+{
+ return H5E_OPENERROR;
+}
+JNIEXPORT jlong JNICALL
Java_hdf_hdf5lib_HDF5Constants_H5E_1OVERFLOW(JNIEnv *env, jclass cls)
{
return H5E_OVERFLOW;
}
JNIEXPORT jlong JNICALL
+Java_hdf_hdf5lib_HDF5Constants_H5E_1PAGEBUF(JNIEnv *env, jclass cls)
+{
+ return H5E_PAGEBUF;
+}
+JNIEXPORT jlong JNICALL
+Java_hdf_hdf5lib_HDF5Constants_H5E_1PATH(JNIEnv *env, jclass cls)
+{
+ return H5E_PATH;
+}
+JNIEXPORT jlong JNICALL
Java_hdf_hdf5lib_HDF5Constants_H5E_1PLINE(JNIEnv *env, jclass cls)
{
return H5E_PLINE;
@@ -734,6 +1065,11 @@ Java_hdf_hdf5lib_HDF5Constants_H5E_1PLIST(JNIEnv *env, jclass cls)
return H5E_PLIST;
}
JNIEXPORT jlong JNICALL
+Java_hdf_hdf5lib_HDF5Constants_H5E_1PLUGIN(JNIEnv *env, jclass cls)
+{
+ return H5E_PLUGIN;
+}
+JNIEXPORT jlong JNICALL
Java_hdf_hdf5lib_HDF5Constants_H5E_1PROTECT(JNIEnv *env, jclass cls)
{
return H5E_PROTECT;
@@ -764,11 +1100,26 @@ Java_hdf_hdf5lib_HDF5Constants_H5E_1SEEKERROR(JNIEnv *env, jclass cls)
return H5E_SEEKERROR;
}
JNIEXPORT jlong JNICALL
+Java_hdf_hdf5lib_HDF5Constants_H5E_1SETDISALLOWED(JNIEnv *env, jclass cls)
+{
+ return H5E_SETDISALLOWED;
+}
+JNIEXPORT jlong JNICALL
Java_hdf_hdf5lib_HDF5Constants_H5E_1SETLOCAL(JNIEnv *env, jclass cls)
{
return H5E_SETLOCAL;
}
JNIEXPORT jlong JNICALL
+Java_hdf_hdf5lib_HDF5Constants_H5E_1SLIST(JNIEnv *env, jclass cls)
+{
+ return H5E_SLIST;
+}
+JNIEXPORT jlong JNICALL
+Java_hdf_hdf5lib_HDF5Constants_H5E_1SOHM(JNIEnv *env, jclass cls)
+{
+ return H5E_SOHM;
+}
+JNIEXPORT jlong JNICALL
Java_hdf_hdf5lib_HDF5Constants_H5E_1STORAGE(JNIEnv *env, jclass cls)
{
return H5E_STORAGE;
@@ -779,6 +1130,21 @@ Java_hdf_hdf5lib_HDF5Constants_H5E_1SYM(JNIEnv *env, jclass cls)
return H5E_SYM;
}
JNIEXPORT jlong JNICALL
+Java_hdf_hdf5lib_HDF5Constants_H5E_1SYSERRSTR(JNIEnv *env, jclass cls)
+{
+ return H5E_SYSERRSTR;
+}
+JNIEXPORT jlong JNICALL
+Java_hdf_hdf5lib_HDF5Constants_H5E_1SYSTEM(JNIEnv *env, jclass cls)
+{
+ return H5E_SYSTEM;
+}
+JNIEXPORT jlong JNICALL
+Java_hdf_hdf5lib_HDF5Constants_H5E_1TRAVERSE(JNIEnv *env, jclass cls)
+{
+ return H5E_TRAVERSE;
+}
+JNIEXPORT jlong JNICALL
Java_hdf_hdf5lib_HDF5Constants_H5E_1TRUNCATED(JNIEnv *env, jclass cls)
{
return H5E_TRUNCATED;
@@ -844,11 +1210,6 @@ Java_hdf_hdf5lib_HDF5Constants_H5ES_1STATUS_1FAIL(JNIEnv *env, jclass cls)
{
return H5ES_STATUS_FAIL;
}
-JNIEXPORT jlong JNICALL
-Java_hdf_hdf5lib_HDF5Constants_H5ES_1STATUS_1CANCELED(JNIEnv *env, jclass cls)
-{
- return H5ES_STATUS_CANCELED;
-}
/* Java does not have unsigned native types */
H5_GCC_DIAG_OFF("sign-conversion")
diff --git a/java/src/jni/h5Imp.h b/java/src/jni/h5Imp.h
index 226a2fe..8ab7662 100644
--- a/java/src/jni/h5Imp.h
+++ b/java/src/jni/h5Imp.h
@@ -1,6 +1,5 @@
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* 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 *
@@ -14,8 +13,8 @@
#include <jni.h>
/* Header for class hdf_hdf5lib_H5_H5 */
-#ifndef _Included_hdf_hdf5lib_H5_H5
-#define _Included_hdf_hdf5lib_H5_H5
+#ifndef Included_hdf_hdf5lib_H5_H5
+#define Included_hdf_hdf5lib_H5_H5
#ifdef __cplusplus
extern "C" {
@@ -83,4 +82,4 @@ JNIEXPORT jboolean JNICALL Java_hdf_hdf5lib_H5_H5is_1library_1threadsafe(JNIEnv
} /* end extern "C" */
#endif /* __cplusplus */
-#endif /* _Included_hdf_hdf5lib_H5_H5 */
+#endif /* Included_hdf_hdf5lib_H5_H5 */
diff --git a/java/src/jni/h5aImp.c b/java/src/jni/h5aImp.c
index c365144..6bf86d0 100644
--- a/java/src/jni/h5aImp.c
+++ b/java/src/jni/h5aImp.c
@@ -1133,7 +1133,7 @@ H5AreadVL_asstr(JNIEnv *env, hid_t aid, hid_t tid, jobjectArray buf)
for (i = 0; i < (size_t)n; i++) {
h5str.s[0] = '\0';
- if (!h5str_sprintf(ENVONLY, &h5str, aid, tid, &(((char *)readBuf)[i * typeSize]), typeSize, 0))
+ if (!h5str_sprintf(ENVONLY, &h5str, aid, tid, &(((char *)readBuf)[i * typeSize]), 0))
CHECK_JNI_EXCEPTION(ENVONLY, JNI_FALSE);
if (NULL == (jstr = ENVPTR->NewStringUTF(ENVONLY, h5str.s)))
@@ -1425,7 +1425,7 @@ Java_hdf_hdf5lib_H5_H5Aread_1reg_1ref(JNIEnv *env, jclass clss, jlong attr_id, j
for (i = 0; i < n; i++) {
h5str.s[0] = '\0';
- if (!h5str_sprintf(ENVONLY, &h5str, (hid_t)attr_id, (hid_t)mem_type_id, (void *)&ref_data[i], 0, 0))
+ if (!h5str_sprintf(ENVONLY, &h5str, (hid_t)attr_id, (hid_t)mem_type_id, (void *)&ref_data[i], 0))
CHECK_JNI_EXCEPTION(ENVONLY, JNI_FALSE);
if (NULL == (jstr = ENVPTR->NewStringUTF(ENVONLY, h5str.s)))
diff --git a/java/src/jni/h5aImp.h b/java/src/jni/h5aImp.h
index 7615946..aee0e40 100644
--- a/java/src/jni/h5aImp.h
+++ b/java/src/jni/h5aImp.h
@@ -1,6 +1,5 @@
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* 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 *
@@ -14,8 +13,8 @@
#include <jni.h>
/* Header for class hdf_hdf5lib_H5_H5A */
-#ifndef _Included_hdf_hdf5lib_H5_H5A
-#define _Included_hdf_hdf5lib_H5_H5A
+#ifndef Included_hdf_hdf5lib_H5_H5A
+#define Included_hdf_hdf5lib_H5_H5A
#ifdef __cplusplus
extern "C" {
@@ -376,4 +375,4 @@ JNIEXPORT jint JNICALL Java_hdf_hdf5lib_H5_H5Aiterate_1by_1name(JNIEnv *, jclass
} /* end extern "C" */
#endif /* __cplusplus */
-#endif /* _Included_hdf_hdf5lib_H5_H5A */
+#endif /* Included_hdf_hdf5lib_H5_H5A */
diff --git a/java/src/jni/h5dImp.c b/java/src/jni/h5dImp.c
index f8f2325..73b252a 100644
--- a/java/src/jni/h5dImp.c
+++ b/java/src/jni/h5dImp.c
@@ -1290,7 +1290,7 @@ H5DreadVL_asstr(JNIEnv *env, hid_t did, hid_t tid, hid_t mem_sid, hid_t file_sid
for (i = 0; i < (size_t)n; i++) {
h5str.s[0] = '\0';
- if (!h5str_sprintf(ENVONLY, &h5str, did, tid, &(((char *)readBuf)[i * typeSize]), typeSize, 0))
+ if (!h5str_sprintf(ENVONLY, &h5str, did, tid, &(((char *)readBuf)[i * typeSize]), 0))
CHECK_JNI_EXCEPTION(ENVONLY, JNI_FALSE);
if (NULL == (jstr = ENVPTR->NewStringUTF(ENVONLY, h5str.s)))
@@ -1669,8 +1669,7 @@ Java_hdf_hdf5lib_H5_H5Dread_1reg_1ref(JNIEnv *env, jclass clss, jlong dataset_id
for (i = 0; i < n; i++) {
h5str.s[0] = '\0';
- if (!h5str_sprintf(ENVONLY, &h5str, (hid_t)dataset_id, (hid_t)mem_type_id, (void *)&ref_data[i], 0,
- 0))
+ if (!h5str_sprintf(ENVONLY, &h5str, (hid_t)dataset_id, (hid_t)mem_type_id, (void *)&ref_data[i], 0))
CHECK_JNI_EXCEPTION(ENVONLY, JNI_FALSE);
if (NULL == (jstr = ENVPTR->NewStringUTF(ENVONLY, h5str.s)))
diff --git a/java/src/jni/h5dImp.h b/java/src/jni/h5dImp.h
index c1ed065..e339dad 100644
--- a/java/src/jni/h5dImp.h
+++ b/java/src/jni/h5dImp.h
@@ -1,6 +1,5 @@
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* 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 *
@@ -14,8 +13,8 @@
#include <jni.h>
/* Header for class hdf_hdf5lib_H5_H5D */
-#ifndef _Included_hdf_hdf5lib_H5_H5D
-#define _Included_hdf_hdf5lib_H5_H5D
+#ifndef Included_hdf_hdf5lib_H5_H5D
+#define Included_hdf_hdf5lib_H5_H5D
#ifdef __cplusplus
extern "C" {
@@ -323,4 +322,4 @@ JNIEXPORT void JNICALL Java_hdf_hdf5lib_H5_H5Drefresh(JNIEnv *, jclass, jlong);
} /* end extern "C" */
#endif /* __cplusplus */
-#endif /* _Included_hdf_hdf5lib_H5_H5D */
+#endif /* Included_hdf_hdf5lib_H5_H5D */
diff --git a/java/src/jni/h5eImp.c b/java/src/jni/h5eImp.c
index 7d7a2cf..5bdeae8 100644
--- a/java/src/jni/h5eImp.c
+++ b/java/src/jni/h5eImp.c
@@ -1,6 +1,5 @@
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* 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 *
diff --git a/java/src/jni/h5eImp.h b/java/src/jni/h5eImp.h
index d849b92..95e43fa 100644
--- a/java/src/jni/h5eImp.h
+++ b/java/src/jni/h5eImp.h
@@ -1,6 +1,5 @@
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* 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 *
@@ -14,8 +13,8 @@
#include <jni.h>
/* Header for class hdf_hdf5lib_H5_H5E */
-#ifndef _Included_hdf_hdf5lib_H5_H5E
-#define _Included_hdf_hdf5lib_H5_H5E
+#ifndef Included_hdf_hdf5lib_H5_H5E
+#define Included_hdf_hdf5lib_H5_H5E
#ifdef __cplusplus
extern "C" {
@@ -145,4 +144,4 @@ JNIEXPORT void JNICALL Java_hdf_hdf5lib_H5_H5Ewalk2(JNIEnv *, jclass, jlong, jlo
} /* end extern "C" */
#endif /* __cplusplus */
-#endif /* _Included_hdf_hdf5lib_H5_H5E */
+#endif /* Included_hdf_hdf5lib_H5_H5E */
diff --git a/java/src/jni/h5fImp.h b/java/src/jni/h5fImp.h
index ed90ee9..bf2f199 100644
--- a/java/src/jni/h5fImp.h
+++ b/java/src/jni/h5fImp.h
@@ -1,6 +1,5 @@
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* 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 *
@@ -14,8 +13,8 @@
#include <jni.h>
/* Header for class hdf_hdf5lib_H5_H5F */
-#ifndef _Included_hdf_hdf5lib_H5_H5F
-#define _Included_hdf_hdf5lib_H5_H5F
+#ifndef Included_hdf_hdf5lib_H5_H5F
+#define Included_hdf_hdf5lib_H5_H5F
#ifdef __cplusplus
extern "C" {
@@ -237,4 +236,4 @@ JNIEXPORT void JNICALL Java_hdf_hdf5lib_H5_H5Fset_1libver_1bounds(JNIEnv *, jcla
} /* end extern "C" */
#endif /* __cplusplus */
-#endif /* _Included_hdf_hdf5lib_H5_H5F */
+#endif /* Included_hdf_hdf5lib_H5_H5F */
diff --git a/java/src/jni/h5gImp.h b/java/src/jni/h5gImp.h
index 393d5d8..b7130ed 100644
--- a/java/src/jni/h5gImp.h
+++ b/java/src/jni/h5gImp.h
@@ -1,6 +1,5 @@
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* 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 *
@@ -14,8 +13,8 @@
#include <jni.h>
/* Header for class hdf_hdf5lib_H5_H5G */
-#ifndef _Included_hdf_hdf5lib_H5_H5G
-#define _Included_hdf_hdf5lib_H5_H5G
+#ifndef Included_hdf_hdf5lib_H5_H5G
+#define Included_hdf_hdf5lib_H5_H5G
#ifdef __cplusplus
extern "C" {
@@ -97,4 +96,4 @@ JNIEXPORT void JNICALL Java_hdf_hdf5lib_H5_H5Grefresh(JNIEnv *, jclass, jlong);
} /* end extern "C" */
#endif /* __cplusplus */
-#endif /* _Included_hdf_hdf5lib_H5_H5G */
+#endif /* Included_hdf_hdf5lib_H5_H5G */
diff --git a/java/src/jni/h5iImp.h b/java/src/jni/h5iImp.h
index eff5048..08d5fa1 100644
--- a/java/src/jni/h5iImp.h
+++ b/java/src/jni/h5iImp.h
@@ -1,6 +1,5 @@
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* 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 *
@@ -14,8 +13,8 @@
#include <jni.h>
/* Header for class hdf_hdf5lib_H5_H5I */
-#ifndef _Included_hdf_hdf5lib_H5_H5I
-#define _Included_hdf_hdf5lib_H5_H5I
+#ifndef Included_hdf_hdf5lib_H5_H5I
+#define Included_hdf_hdf5lib_H5_H5I
#ifdef __cplusplus
extern "C" {
@@ -131,4 +130,4 @@ JNIEXPORT void JNICALL Java_hdf_hdf5lib_H5_H5Idestroy_1type(JNIEnv *, jclass, ji
} /* end extern "C" */
#endif /* __cplusplus */
-#endif /* _Included_hdf_hdf5lib_H5_H5I */
+#endif /* Included_hdf_hdf5lib_H5_H5I */
diff --git a/java/src/jni/h5jni.h b/java/src/jni/h5jni.h
index fb6f22a..2c93846 100644
--- a/java/src/jni/h5jni.h
+++ b/java/src/jni/h5jni.h
@@ -1,6 +1,5 @@
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* 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 *
@@ -22,8 +21,8 @@
#include <string.h>
#include "H5private.h"
-#ifndef _Included_h5jni
-#define _Included_h5jni
+#ifndef Included_h5jni
+#define Included_h5jni
#ifdef __cplusplus
#define ENVPTR (env)
@@ -267,9 +266,10 @@ extern jboolean h5JNIFatalError(JNIEnv *env, const char *);
extern jboolean h5nullArgument(JNIEnv *env, const char *);
extern jboolean h5badArgument(JNIEnv *env, const char *);
extern jboolean h5outOfMemory(JNIEnv *env, const char *);
+extern jboolean h5assertion(JNIEnv *env, const char *);
+extern jboolean h5unimplemented(JNIEnv *env, const char *);
extern jboolean h5libraryError(JNIEnv *env);
extern jboolean h5raiseException(JNIEnv *env, const char *, const char *);
-extern jboolean h5unimplemented(JNIEnv *env, const char *functName);
/*
* The following macros are to facilitate immediate cleanup+return
@@ -305,21 +305,27 @@ extern jboolean h5unimplemented(JNIEnv *env, const char *functName);
goto done; \
} while (0)
-#define H5_LIBRARY_ERROR(env) \
+#define H5_ASSERTION_ERROR(env, message) \
do { \
- h5libraryError(env); \
+ h5assertion(env, message); \
goto done; \
} while (0)
-#define H5_RAISE_EXCEPTION(env, message, exception) \
+#define H5_UNIMPLEMENTED(env, message) \
do { \
- h5raiseException(env, message, exception); \
+ h5unimplemented(env, message); \
goto done; \
} while (0)
-#define H5_UNIMPLEMENTED(env, message) \
+#define H5_LIBRARY_ERROR(env) \
do { \
- h5unimplemented(env, message); \
+ h5libraryError(env); \
+ goto done; \
+ } while (0)
+
+#define H5_RAISE_EXCEPTION(env, message, exception) \
+ do { \
+ h5raiseException(env, message, exception); \
goto done; \
} while (0)
@@ -338,4 +344,4 @@ extern jobject create_H5O_token_t(JNIEnv *env, const H5O_token_t *token, hbool_t
} /* end extern "C" */
#endif /* __cplusplus */
-#endif /* _Included_h5jni */
+#endif /* Included_h5jni */
diff --git a/java/src/jni/h5lImp.c b/java/src/jni/h5lImp.c
index fabd920..43db4e9 100644
--- a/java/src/jni/h5lImp.c
+++ b/java/src/jni/h5lImp.c
@@ -1,6 +1,5 @@
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* 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 *
diff --git a/java/src/jni/h5lImp.h b/java/src/jni/h5lImp.h
index 2e949fe..85aff03 100644
--- a/java/src/jni/h5lImp.h
+++ b/java/src/jni/h5lImp.h
@@ -1,6 +1,5 @@
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* 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 *
@@ -14,8 +13,8 @@
#include <jni.h>
/* Header for class hdf_hdf5lib_H5_H5_H5L */
-#ifndef _Included_hdf_hdf5lib_H5_H5L
-#define _Included_hdf_hdf5lib_H5_H5L
+#ifndef Included_hdf_hdf5lib_H5_H5L
+#define Included_hdf_hdf5lib_H5_H5L
#ifdef __cplusplus
extern "C" {
@@ -171,4 +170,4 @@ JNIEXPORT void JNICALL Java_hdf_hdf5lib_H5_H5Lunregister(JNIEnv *, jclass, jint)
} /* end extern "C" */
#endif /* __cplusplus */
-#endif /* _Included_hdf_hdf5lib_H5_H5L */
+#endif /* Included_hdf_hdf5lib_H5_H5L */
diff --git a/java/src/jni/h5oImp.c b/java/src/jni/h5oImp.c
index e06ad79..3037bc6 100644
--- a/java/src/jni/h5oImp.c
+++ b/java/src/jni/h5oImp.c
@@ -1,6 +1,5 @@
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* 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 *
diff --git a/java/src/jni/h5oImp.h b/java/src/jni/h5oImp.h
index e6675be..a7d7f31 100644
--- a/java/src/jni/h5oImp.h
+++ b/java/src/jni/h5oImp.h
@@ -1,6 +1,5 @@
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* 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 *
@@ -14,8 +13,8 @@
#include <jni.h>
/* Header for class hdf_hdf5lib_H5_H5_H5O */
-#ifndef _Included_hdf_hdf5lib_H5_H5O
-#define _Included_hdf_hdf5lib_H5_H5O
+#ifndef Included_hdf_hdf5lib_H5_H5O
+#define Included_hdf_hdf5lib_H5_H5O
#ifdef __cplusplus
extern "C" {
@@ -218,4 +217,4 @@ JNIEXPORT jboolean JNICALL Java_hdf_hdf5lib_H5_H5Oare_1mdc_1flushes_1disabled(JN
} /* end extern "C" */
#endif /* __cplusplus */
-#endif /* _Included_hdf_hdf5lib_H5_H5O */
+#endif /* Included_hdf_hdf5lib_H5_H5O */
diff --git a/java/src/jni/h5pACPLImp.c b/java/src/jni/h5pACPLImp.c
index 611016f..6290e0e 100644
--- a/java/src/jni/h5pACPLImp.c
+++ b/java/src/jni/h5pACPLImp.c
@@ -1,6 +1,5 @@
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* 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 *
diff --git a/java/src/jni/h5pACPLImp.h b/java/src/jni/h5pACPLImp.h
index 21c0cc6..15fcf33 100644
--- a/java/src/jni/h5pACPLImp.h
+++ b/java/src/jni/h5pACPLImp.h
@@ -1,6 +1,5 @@
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* 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 *
@@ -11,8 +10,8 @@
* help@hdfgroup.org. *
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
-#ifndef _Included_hdf_hdf5lib_H5_H5PACPL
-#define _Included_hdf_hdf5lib_H5_H5PACPL
+#ifndef Included_hdf_hdf5lib_H5_H5PACPL
+#define Included_hdf_hdf5lib_H5_H5PACPL
#include <jni.h>
@@ -24,4 +23,4 @@ extern "C" {
} /* end extern "C" */
#endif /* __cplusplus */
-#endif /* _Included_hdf_hdf5lib_H5_H5PACPL */
+#endif /* Included_hdf_hdf5lib_H5_H5PACPL */
diff --git a/java/src/jni/h5pDAPLImp.c b/java/src/jni/h5pDAPLImp.c
index 430fc79..82802b9 100644
--- a/java/src/jni/h5pDAPLImp.c
+++ b/java/src/jni/h5pDAPLImp.c
@@ -1,6 +1,5 @@
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* 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 *
diff --git a/java/src/jni/h5pDAPLImp.h b/java/src/jni/h5pDAPLImp.h
index a15e964..bf11fef 100644
--- a/java/src/jni/h5pDAPLImp.h
+++ b/java/src/jni/h5pDAPLImp.h
@@ -1,6 +1,5 @@
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* 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 *
@@ -11,8 +10,8 @@
* help@hdfgroup.org. *
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
-#ifndef _Included_hdf_hdf5lib_H5_H5PDAPL
-#define _Included_hdf_hdf5lib_H5_H5PDAPL
+#ifndef Included_hdf_hdf5lib_H5_H5PDAPL
+#define Included_hdf_hdf5lib_H5_H5PDAPL
#include <jni.h>
@@ -94,4 +93,4 @@ JNIEXPORT jlong JNICALL Java_hdf_hdf5lib_H5_H5Pget_1virtual_1printf_1gap(JNIEnv
} /* end extern "C" */
#endif /* __cplusplus */
-#endif /* _Included_hdf_hdf5lib_H5_H5PDAPL */
+#endif /* Included_hdf_hdf5lib_H5_H5PDAPL */
diff --git a/java/src/jni/h5pDCPLImp.c b/java/src/jni/h5pDCPLImp.c
index 9e8b2b6..760a5a8 100644
--- a/java/src/jni/h5pDCPLImp.c
+++ b/java/src/jni/h5pDCPLImp.c
@@ -1,6 +1,5 @@
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* 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 *
diff --git a/java/src/jni/h5pDCPLImp.h b/java/src/jni/h5pDCPLImp.h
index 6adcbe4..46d1cc3 100644
--- a/java/src/jni/h5pDCPLImp.h
+++ b/java/src/jni/h5pDCPLImp.h
@@ -1,6 +1,5 @@
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* 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 *
@@ -11,8 +10,8 @@
* help@hdfgroup.org. *
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
-#ifndef _Included_hdf_hdf5lib_H5_H5PDCPL
-#define _Included_hdf_hdf5lib_H5_H5PDCPL
+#ifndef Included_hdf_hdf5lib_H5_H5PDCPL
+#define Included_hdf_hdf5lib_H5_H5PDCPL
#include <jni.h>
@@ -321,4 +320,4 @@ JNIEXPORT jstring JNICALL Java_hdf_hdf5lib_H5_H5Pget_1virtual_1prefix(JNIEnv *,
} /* end extern "C" */
#endif /* __cplusplus */
-#endif /* _Included_hdf_hdf5lib_H5_H5PDCPL */
+#endif /* Included_hdf_hdf5lib_H5_H5PDCPL */
diff --git a/java/src/jni/h5pDXPLImp.c b/java/src/jni/h5pDXPLImp.c
index 8b930dc..c555d53 100644
--- a/java/src/jni/h5pDXPLImp.c
+++ b/java/src/jni/h5pDXPLImp.c
@@ -1,6 +1,5 @@
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* 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 *
diff --git a/java/src/jni/h5pDXPLImp.h b/java/src/jni/h5pDXPLImp.h
index 8d2df68..21c40c4 100644
--- a/java/src/jni/h5pDXPLImp.h
+++ b/java/src/jni/h5pDXPLImp.h
@@ -1,6 +1,5 @@
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* 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 *
@@ -11,8 +10,8 @@
* help@hdfgroup.org. *
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
-#ifndef _Included_hdf_hdf5lib_H5_H5PDXPL
-#define _Included_hdf_hdf5lib_H5_H5PDXPL
+#ifndef Included_hdf_hdf5lib_H5_H5PDXPL
+#define Included_hdf_hdf5lib_H5_H5PDXPL
#include <jni.h>
@@ -182,4 +181,4 @@ JNIEXPORT jint JNICALL Java_hdf_hdf5lib_H5_H5Pget_1btree_1ratios(JNIEnv *, jclas
} /* end extern "C" */
#endif /* __cplusplus */
-#endif /* _Included_hdf_hdf5lib_H5_H5PDXPL */
+#endif /* Included_hdf_hdf5lib_H5_H5PDXPL */
diff --git a/java/src/jni/h5pFAPLImp.c b/java/src/jni/h5pFAPLImp.c
index 46adc30..ad85aae 100644
--- a/java/src/jni/h5pFAPLImp.c
+++ b/java/src/jni/h5pFAPLImp.c
@@ -1,6 +1,5 @@
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* 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 *
@@ -1364,6 +1363,76 @@ done:
/*
* Class: hdf_hdf5lib_H5
+ * Method: H5Pset_file_locking
+ * Signature: (JZZ)V
+ */
+JNIEXPORT void JNICALL
+Java_hdf_hdf5lib_H5_H5Pset_1file_1locking(JNIEnv *env, jclass clss, jlong fapl_id, jboolean use_file_locking,
+ jboolean ignore_when_disabled)
+{
+ hbool_t use_file_locking_val = TRUE;
+ hbool_t ignore_when_disabled_val = TRUE;
+
+ UNUSED(clss);
+
+ use_file_locking_val = (use_file_locking == JNI_TRUE) ? TRUE : FALSE;
+ ignore_when_disabled_val = (ignore_when_disabled == JNI_TRUE) ? TRUE : FALSE;
+
+ if (H5Pset_file_locking((hid_t)fapl_id, use_file_locking_val, ignore_when_disabled_val) < 0)
+ H5_LIBRARY_ERROR(ENVONLY);
+
+done:
+ return;
+} /* end Java_hdf_hdf5lib_H5_H5Pset_1file_1locking */
+
+/*
+ * Class: hdf_hdf5lib_H5
+ * Method: H5Pget_use_file_locking
+ * Signature: (J)Z
+ */
+JNIEXPORT jboolean JNICALL
+Java_hdf_hdf5lib_H5_H5Pget_1use_1file_1locking(JNIEnv *env, jclass clss, jlong fapl_id)
+{
+ hbool_t use_file_locking_val = TRUE;
+ hbool_t unused = TRUE;
+ jboolean bval = JNI_FALSE;
+
+ UNUSED(clss);
+
+ if (H5Pget_file_locking((hid_t)fapl_id, &use_file_locking_val, &unused) < 0)
+ H5_LIBRARY_ERROR(ENVONLY);
+
+ bval = (use_file_locking_val == TRUE) ? JNI_TRUE : JNI_FALSE;
+
+done:
+ return bval;
+} /* end Java_hdf_hdf5lib_H5_H5Pget_1use_1file_1locking */
+
+/*
+ * Class: hdf_hdf5lib_H5
+ * Method: H5Pget_ignore_disabled_file_locking
+ * Signature: (J)Z
+ */
+JNIEXPORT jboolean JNICALL
+Java_hdf_hdf5lib_H5_H5Pget_1ignore_1disabled_1file_1locking(JNIEnv *env, jclass clss, jlong fapl_id)
+{
+ hbool_t ignore_when_disabled_val = TRUE;
+ hbool_t unused = TRUE;
+ jboolean bval = JNI_FALSE;
+
+ UNUSED(clss);
+
+ if (H5Pget_file_locking((hid_t)fapl_id, &unused, &ignore_when_disabled_val) < 0)
+ H5_LIBRARY_ERROR(ENVONLY);
+
+ bval = (ignore_when_disabled_val == TRUE) ? JNI_TRUE : JNI_FALSE;
+
+done:
+ return bval;
+} /* end Java_hdf_hdf5lib_H5_H5Pget_1ignore_1disabled_1file_1locking */
+
+/*
+ * Class: hdf_hdf5lib_H5
* Method: H5Pset_metadata_read_attempts
* Signature: (JJ)V
*/
diff --git a/java/src/jni/h5pFAPLImp.h b/java/src/jni/h5pFAPLImp.h
index 25b0eee..3c5988f 100644
--- a/java/src/jni/h5pFAPLImp.h
+++ b/java/src/jni/h5pFAPLImp.h
@@ -1,6 +1,5 @@
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* 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 *
@@ -11,8 +10,8 @@
* help@hdfgroup.org. *
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
-#ifndef _Included_hdf_hdf5lib_H5_H5PFAPL
-#define _Included_hdf_hdf5lib_H5_H5PFAPL
+#ifndef Included_hdf_hdf5lib_H5_H5PFAPL
+#define Included_hdf_hdf5lib_H5_H5PFAPL
#include <jni.h>
@@ -331,6 +330,32 @@ JNIEXPORT jboolean JNICALL Java_hdf_hdf5lib_H5_H5Pget_1evict_1on_1close(JNIEnv *
/*
* Class: hdf_hdf5lib_H5
+ * Method: H5Pset_file_locking
+ * Signature: (JZZ)V
+ */
+JNIEXPORT void JNICALL Java_hdf_hdf5lib_H5_H5Pset_1file_1locking(JNIEnv *env, jclass clss, jlong fapl_id,
+ jboolean use_file_locking,
+ jboolean ignore_when_disabled);
+
+/*
+ * Class: hdf_hdf5lib_H5
+ * Method: H5Pget_use_file_locking
+ * Signature: (J)Z
+ */
+JNIEXPORT jboolean JNICALL Java_hdf_hdf5lib_H5_H5Pget_1use_1file_1locking(JNIEnv *env, jclass clss,
+ jlong fapl_id);
+
+/*
+ * Class: hdf_hdf5lib_H5
+ * Method: H5Pget_ignore_disabled_file_locking
+ * Signature: (J)Z
+ */
+JNIEXPORT jboolean JNICALL Java_hdf_hdf5lib_H5_H5Pget_1ignore_1disabled_1file_1locking(JNIEnv *env,
+ jclass clss,
+ jlong fapl_id);
+
+/*
+ * Class: hdf_hdf5lib_H5
* Method: H5Pset_metadata_read_attempts
* Signature: (JJ)V
*/
@@ -451,4 +476,4 @@ JNIEXPORT jint JNICALL Java_hdf_hdf5lib_H5_H5Pget_1libver_1bounds(JNIEnv *, jcla
} /* end extern "C" */
#endif /* __cplusplus */
-#endif /* _Included_hdf_hdf5lib_H5_H5PFAPL */
+#endif /* Included_hdf_hdf5lib_H5_H5PFAPL */
diff --git a/java/src/jni/h5pFCPLImp.c b/java/src/jni/h5pFCPLImp.c
index fe12760..ded3248 100644
--- a/java/src/jni/h5pFCPLImp.c
+++ b/java/src/jni/h5pFCPLImp.c
@@ -1,6 +1,5 @@
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* 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 *
diff --git a/java/src/jni/h5pFCPLImp.h b/java/src/jni/h5pFCPLImp.h
index 7799e49..94411d6 100644
--- a/java/src/jni/h5pFCPLImp.h
+++ b/java/src/jni/h5pFCPLImp.h
@@ -1,6 +1,5 @@
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* 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 *
@@ -11,8 +10,8 @@
* help@hdfgroup.org. *
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
-#ifndef _Included_hdf_hdf5lib_H5_H5PFCPL
-#define _Included_hdf_hdf5lib_H5_H5PFCPL
+#ifndef Included_hdf_hdf5lib_H5_H5PFCPL
+#define Included_hdf_hdf5lib_H5_H5PFCPL
#include <jni.h>
@@ -171,4 +170,4 @@ JNIEXPORT jint JNICALL Java_hdf_hdf5lib_H5_H5Pget_1shared_1mesg_1phase_1change(J
} /* end extern "C" */
#endif /* __cplusplus */
-#endif /* _Included_hdf_hdf5lib_H5_H5PFCPL */
+#endif /* Included_hdf_hdf5lib_H5_H5PFCPL */
diff --git a/java/src/jni/h5pGAPLImp.c b/java/src/jni/h5pGAPLImp.c
index c43609d..b92e180 100644
--- a/java/src/jni/h5pGAPLImp.c
+++ b/java/src/jni/h5pGAPLImp.c
@@ -1,6 +1,5 @@
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* 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 *
diff --git a/java/src/jni/h5pGAPLImp.h b/java/src/jni/h5pGAPLImp.h
index db95f5d..9091ff8 100644
--- a/java/src/jni/h5pGAPLImp.h
+++ b/java/src/jni/h5pGAPLImp.h
@@ -1,6 +1,5 @@
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* 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 *
@@ -11,8 +10,8 @@
* help@hdfgroup.org. *
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
-#ifndef _Included_hdf_hdf5lib_H5_H5PGAPL
-#define _Included_hdf_hdf5lib_H5_H5PGAPL
+#ifndef Included_hdf_hdf5lib_H5_H5PGAPL
+#define Included_hdf_hdf5lib_H5_H5PGAPL
#include <jni.h>
@@ -24,4 +23,4 @@ extern "C" {
} /* end extern "C" */
#endif /* __cplusplus */
-#endif /* _Included_hdf_hdf5lib_H5_H5PGAPL */
+#endif /* Included_hdf_hdf5lib_H5_H5PGAPL */
diff --git a/java/src/jni/h5pGCPLImp.c b/java/src/jni/h5pGCPLImp.c
index 46d102f..2ba140d 100644
--- a/java/src/jni/h5pGCPLImp.c
+++ b/java/src/jni/h5pGCPLImp.c
@@ -1,6 +1,5 @@
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* 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 *
diff --git a/java/src/jni/h5pGCPLImp.h b/java/src/jni/h5pGCPLImp.h
index a1b8b28..5090c3a 100644
--- a/java/src/jni/h5pGCPLImp.h
+++ b/java/src/jni/h5pGCPLImp.h
@@ -1,6 +1,5 @@
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* 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 *
@@ -11,8 +10,8 @@
* help@hdfgroup.org. *
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
-#ifndef _Included_hdf_hdf5lib_H5_H5PGCPL
-#define _Included_hdf_hdf5lib_H5_H5PGCPL
+#ifndef Included_hdf_hdf5lib_H5_H5PGCPL
+#define Included_hdf_hdf5lib_H5_H5PGCPL
#include <jni.h>
@@ -80,4 +79,4 @@ JNIEXPORT jint JNICALL Java_hdf_hdf5lib_H5_H5Pget_1link_1phase_1change(JNIEnv *,
} /* end extern "C" */
#endif /* __cplusplus */
-#endif /* _Included_hdf_hdf5lib_H5_H5PGCPL */
+#endif /* Included_hdf_hdf5lib_H5_H5PGCPL */
diff --git a/java/src/jni/h5pImp.h b/java/src/jni/h5pImp.h
index 49d36a6..189e9d7 100644
--- a/java/src/jni/h5pImp.h
+++ b/java/src/jni/h5pImp.h
@@ -1,6 +1,5 @@
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* 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 *
@@ -13,8 +12,8 @@
/* Header for class hdf_hdf5lib_H5_H5_H5P */
-#ifndef _Included_hdf_hdf5lib_H5_H5P
-#define _Included_hdf_hdf5lib_H5_H5P
+#ifndef Included_hdf_hdf5lib_H5_H5P
+#define Included_hdf_hdf5lib_H5_H5P
#include <jni.h>
@@ -211,4 +210,4 @@ JNIEXPORT jint JNICALL Java_hdf_hdf5lib_H5__1H5Pclose_1class(JNIEnv *, jclass, j
} /* end extern "C" */
#endif /* __cplusplus */
-#endif /* _Included_hdf_hdf5lib_H5_H5P */
+#endif /* Included_hdf_hdf5lib_H5_H5P */
diff --git a/java/src/jni/h5pLAPLImp.c b/java/src/jni/h5pLAPLImp.c
index 8b5afa2..1db495c 100644
--- a/java/src/jni/h5pLAPLImp.c
+++ b/java/src/jni/h5pLAPLImp.c
@@ -1,6 +1,5 @@
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* 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 *
diff --git a/java/src/jni/h5pLAPLImp.h b/java/src/jni/h5pLAPLImp.h
index 204901d..8ddc8d2 100644
--- a/java/src/jni/h5pLAPLImp.h
+++ b/java/src/jni/h5pLAPLImp.h
@@ -1,6 +1,5 @@
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* 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 *
@@ -11,8 +10,8 @@
* help@hdfgroup.org. *
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
-#ifndef _Included_hdf_hdf5lib_H5_H5PLAPL
-#define _Included_hdf_hdf5lib_H5_H5PLAPL
+#ifndef Included_hdf_hdf5lib_H5_H5PLAPL
+#define Included_hdf_hdf5lib_H5_H5PLAPL
#include <jni.h>
@@ -88,4 +87,4 @@ JNIEXPORT jint JNICALL Java_hdf_hdf5lib_H5_H5Pget_1elink_1acc_1flags(JNIEnv *, j
} /* end extern "C" */
#endif /* __cplusplus */
-#endif /* _Included_hdf_hdf5lib_H5_H5PLAPL */
+#endif /* Included_hdf_hdf5lib_H5_H5PLAPL */
diff --git a/java/src/jni/h5pLCPLImp.c b/java/src/jni/h5pLCPLImp.c
index 455936b..b5eebd1 100644
--- a/java/src/jni/h5pLCPLImp.c
+++ b/java/src/jni/h5pLCPLImp.c
@@ -1,6 +1,5 @@
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* 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 *
diff --git a/java/src/jni/h5pLCPLImp.h b/java/src/jni/h5pLCPLImp.h
index b744815..4cdf6cd 100644
--- a/java/src/jni/h5pLCPLImp.h
+++ b/java/src/jni/h5pLCPLImp.h
@@ -1,6 +1,5 @@
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* 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 *
@@ -11,8 +10,8 @@
* help@hdfgroup.org. *
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
-#ifndef _Included_hdf_hdf5lib_H5_H5PLCPL
-#define _Included_hdf_hdf5lib_H5_H5PLCPL
+#ifndef Included_hdf_hdf5lib_H5_H5PLCPL
+#define Included_hdf_hdf5lib_H5_H5PLCPL
#include <jni.h>
@@ -24,4 +23,4 @@ extern "C" {
} /* end extern "C" */
#endif /* __cplusplus */
-#endif /* _Included_hdf_hdf5lib_H5_H5PLCPL */
+#endif /* Included_hdf_hdf5lib_H5_H5PLCPL */
diff --git a/java/src/jni/h5pOCPLImp.c b/java/src/jni/h5pOCPLImp.c
index 6cf62d7..bdcba46 100644
--- a/java/src/jni/h5pOCPLImp.c
+++ b/java/src/jni/h5pOCPLImp.c
@@ -1,6 +1,5 @@
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* 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 *
diff --git a/java/src/jni/h5pOCPLImp.h b/java/src/jni/h5pOCPLImp.h
index ccc4c78..94d397b 100644
--- a/java/src/jni/h5pOCPLImp.h
+++ b/java/src/jni/h5pOCPLImp.h
@@ -1,6 +1,5 @@
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* 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 *
@@ -11,8 +10,8 @@
* help@hdfgroup.org. *
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
-#ifndef _Included_hdf_hdf5lib_H5_H5POCPL
-#define _Included_hdf_hdf5lib_H5_H5POCPL
+#ifndef Included_hdf_hdf5lib_H5_H5POCPL
+#define Included_hdf_hdf5lib_H5_H5POCPL
#include <jni.h>
@@ -81,4 +80,4 @@ JNIEXPORT jint JNICALL Java_hdf_hdf5lib_H5_H5Pget_1attr_1creation_1order(JNIEnv
} /* end extern "C" */
#endif /* __cplusplus */
-#endif /* _Included_hdf_hdf5lib_H5_H5POCPL */
+#endif /* Included_hdf_hdf5lib_H5_H5POCPL */
diff --git a/java/src/jni/h5pOCpyPLImp.c b/java/src/jni/h5pOCpyPLImp.c
index 9cf18fd..b525b68 100644
--- a/java/src/jni/h5pOCpyPLImp.c
+++ b/java/src/jni/h5pOCpyPLImp.c
@@ -1,6 +1,5 @@
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* 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 *
diff --git a/java/src/jni/h5pOCpyPLImp.h b/java/src/jni/h5pOCpyPLImp.h
index 82369b3..50ee972 100644
--- a/java/src/jni/h5pOCpyPLImp.h
+++ b/java/src/jni/h5pOCpyPLImp.h
@@ -1,6 +1,5 @@
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* 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 *
@@ -11,8 +10,8 @@
* help@hdfgroup.org. *
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
-#ifndef _Included_hdf_hdf5lib_H5_H5POCpyPL
-#define _Included_hdf_hdf5lib_H5_H5POCpyPL
+#ifndef Included_hdf_hdf5lib_H5_H5POCpyPL
+#define Included_hdf_hdf5lib_H5_H5POCpyPL
#include <jni.h>
@@ -54,4 +53,4 @@ JNIEXPORT jint JNICALL Java_hdf_hdf5lib_H5_H5Pget_1copy_1object(JNIEnv *, jclass
} /* end extern "C" */
#endif /* __cplusplus */
-#endif /* _Included_hdf_hdf5lib_H5_H5POCpyPL */
+#endif /* Included_hdf_hdf5lib_H5_H5POCpyPL */
diff --git a/java/src/jni/h5pStrCPLImp.c b/java/src/jni/h5pStrCPLImp.c
index 33dbdd7..a056e3a 100644
--- a/java/src/jni/h5pStrCPLImp.c
+++ b/java/src/jni/h5pStrCPLImp.c
@@ -1,6 +1,5 @@
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* 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 *
diff --git a/java/src/jni/h5pStrCPLImp.h b/java/src/jni/h5pStrCPLImp.h
index 01cde89..c0a7ec2 100644
--- a/java/src/jni/h5pStrCPLImp.h
+++ b/java/src/jni/h5pStrCPLImp.h
@@ -1,6 +1,5 @@
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* 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 *
@@ -11,8 +10,8 @@
* help@hdfgroup.org. *
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
-#ifndef _Included_hdf_hdf5lib_H5_H5PStrCPL
-#define _Included_hdf_hdf5lib_H5_H5PStrCPL
+#ifndef Included_hdf_hdf5lib_H5_H5PStrCPL
+#define Included_hdf_hdf5lib_H5_H5PStrCPL
#include <jni.h>
@@ -38,4 +37,4 @@ JNIEXPORT jint JNICALL Java_hdf_hdf5lib_H5_H5Pget_1char_1encoding(JNIEnv *, jcla
} /* end extern "C" */
#endif /* __cplusplus */
-#endif /* _Included_hdf_hdf5lib_H5_H5PStrCPL */
+#endif /* Included_hdf_hdf5lib_H5_H5PStrCPL */
diff --git a/java/src/jni/h5plImp.c b/java/src/jni/h5plImp.c
index bef1242..9193028 100644
--- a/java/src/jni/h5plImp.c
+++ b/java/src/jni/h5plImp.c
@@ -1,6 +1,5 @@
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* 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 *
diff --git a/java/src/jni/h5plImp.h b/java/src/jni/h5plImp.h
index 228d512..410a34f 100644
--- a/java/src/jni/h5plImp.h
+++ b/java/src/jni/h5plImp.h
@@ -1,6 +1,5 @@
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* 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 *
@@ -14,8 +13,8 @@
#include <jni.h>
/* Header for class hdf_hdf5lib_H5_H5PL */
-#ifndef _Included_hdf_hdf5lib_H5_H5PL
-#define _Included_hdf_hdf5lib_H5_H5PL
+#ifndef Included_hdf_hdf5lib_H5_H5PL
+#define Included_hdf_hdf5lib_H5_H5PL
#ifdef __cplusplus
extern "C" {
@@ -88,4 +87,4 @@ JNIEXPORT jint JNICALL Java_hdf_hdf5lib_H5_H5PLsize(JNIEnv *, jclass);
} /* end extern "C" */
#endif /* __cplusplus */
-#endif /* _Included_hdf_hdf5lib_H5_H5PL */
+#endif /* Included_hdf_hdf5lib_H5_H5PL */
diff --git a/java/src/jni/h5rImp.h b/java/src/jni/h5rImp.h
index 94e7911..cdfdd8e 100644
--- a/java/src/jni/h5rImp.h
+++ b/java/src/jni/h5rImp.h
@@ -1,6 +1,5 @@
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* 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 *
@@ -14,8 +13,8 @@
#include <jni.h>
/* Header for class hdf_hdf5lib_H5_H5R */
-#ifndef _Included_hdf_hdf5lib_H5_H5R
-#define _Included_hdf_hdf5lib_H5_H5R
+#ifndef Included_hdf_hdf5lib_H5_H5R
+#define Included_hdf_hdf5lib_H5_H5R
#ifdef __cplusplus
extern "C" {
@@ -175,4 +174,4 @@ JNIEXPORT jlong JNICALL Java_hdf_hdf5lib_H5_H5Rget_1name(JNIEnv *, jclass, jlong
} /* end extern "C" */
#endif /* __cplusplus */
-#endif /* _Included_hdf_hdf5lib_H5_H5R */
+#endif /* Included_hdf_hdf5lib_H5_H5R */
diff --git a/java/src/jni/h5sImp.c b/java/src/jni/h5sImp.c
index cbce1ea..c3a8460 100644
--- a/java/src/jni/h5sImp.c
+++ b/java/src/jni/h5sImp.c
@@ -1340,6 +1340,389 @@ done:
return;
} /* end Java_hdf_hdf5lib_H5_H5Sget_1regular_1hyperslab */
+/*
+ * Class: hdf_hdf5lib_H5
+ * Method: H5Sselect_copy
+ * Signature: (JJ)V
+ */
+JNIEXPORT void JNICALL
+Java_hdf_hdf5lib_H5_H5Sselect_1copy(JNIEnv *env, jclass clss, jlong dst_id, jlong src_id)
+{
+ herr_t status = FAIL;
+
+ UNUSED(clss);
+
+ if ((status = H5Sselect_copy((hid_t)dst_id, (hid_t)src_id)) < 0)
+ H5_LIBRARY_ERROR(ENVONLY);
+
+done:
+ return;
+} /* end Java_hdf_hdf5lib_H5_H5Sselect_1copy */
+
+/*
+ * Class: hdf_hdf5lib_H5
+ * Method: H5Sselect_shape_same
+ * Signature: (JJ)Z
+ */
+JNIEXPORT jboolean JNICALL
+Java_hdf_hdf5lib_H5_H5Sselect_1shape_1same(JNIEnv *env, jclass clss, jlong space1_id, jlong space2_id)
+{
+ htri_t bval = JNI_FALSE;
+
+ UNUSED(clss);
+
+ if ((bval = H5Sselect_shape_same((hid_t)space1_id, (hid_t)space2_id)) < 0)
+ H5_LIBRARY_ERROR(ENVONLY);
+
+ bval = (bval > 0) ? JNI_TRUE : JNI_FALSE;
+
+done:
+ return (jboolean)bval;
+} /* end Java_hdf_hdf5lib_H5_H5Sselect_1shape_1same */
+
+/*
+ * Class: hdf_hdf5lib_H5
+ * Method: H5Sselect_adjust
+ * Signature: (J[J)V
+ */
+JNIEXPORT void JNICALL
+Java_hdf_hdf5lib_H5_H5Sselect_1adjust(JNIEnv *env, jclass clss, jlong space_id, jlongArray offset)
+{
+ jboolean isCopy;
+ hssize_t *offst = NULL;
+ jlong * offsetP = NULL;
+ jsize offset_rank = -1;
+ int i, rank = -1;
+ herr_t status = FAIL;
+
+ UNUSED(clss);
+
+ if (space_id < 0)
+ H5_BAD_ARGUMENT_ERROR(ENVONLY, "H5Sselect_adjust: invalid dataspace ID");
+
+ if ((rank = H5Sget_simple_extent_ndims(space_id)) < 0)
+ H5_LIBRARY_ERROR(ENVONLY);
+
+ if (NULL == offset) {
+ offsetP = NULL;
+ offst = (hssize_t *)offsetP;
+ }
+ else {
+ if ((offset_rank = ENVPTR->GetArrayLength(ENVONLY, offset)) < 0) {
+ CHECK_JNI_EXCEPTION(ENVONLY, JNI_TRUE);
+ H5_BAD_ARGUMENT_ERROR(ENVONLY, "H5Sselect_adjust: offset length < 0");
+ }
+
+ if (offset_rank != rank)
+ H5_BAD_ARGUMENT_ERROR(ENVONLY, "H5Sselect_adjust: offset rank doesn't match dataspace rank!");
+
+ PIN_LONG_ARRAY(ENVONLY, offset, offsetP, &isCopy, "H5Sselect_adjust: offset not pinned");
+
+ if (NULL == (offst = (hssize_t *)HDmalloc((size_t)offset_rank * sizeof(hsize_t))))
+ H5_OUT_OF_MEMORY_ERROR(ENVONLY, "H5Sselect_adjust: failed to allocate offset buffer");
+ }
+
+ if ((status = H5Sselect_adjust(space_id, (hssize_t *)offst)) < 0)
+ H5_LIBRARY_ERROR(ENVONLY);
+
+ for (i = 0; i < offset_rank; i++) {
+ offsetP[i] = (jlong)offst[i];
+ } /* end for */
+
+done:
+ if (offst)
+ HDfree(offst);
+ if (offsetP)
+ UNPIN_LONG_ARRAY(ENVONLY, offset, offsetP, (status < 0) ? JNI_ABORT : 0);
+
+ return;
+} /* end Java_hdf_hdf5lib_H5_H5Sselect_1adjust */
+
+/*
+ * Class: hdf_hdf5lib_H5
+ * Method: H5Sselect_intersect_block
+ * Signature: (J[J[J)Z
+ */
+JNIEXPORT jboolean JNICALL
+Java_hdf_hdf5lib_H5_H5Sselect_1intersect_1block(JNIEnv *env, jclass clss, jlong space_id, jlongArray start,
+ jlongArray end)
+{
+ htri_t bval = JNI_FALSE;
+ jboolean isCopy;
+ hsize_t *strt = NULL, *nd = NULL;
+ jlong * startP = NULL, *endP = NULL;
+ jsize start_rank = -1, end_rank = -1;
+ int i, rank = -1;
+
+ UNUSED(clss);
+
+ if (space_id < 0)
+ H5_BAD_ARGUMENT_ERROR(ENVONLY, "H5Sselect_intersect_block: invalid dataspace ID");
+
+ if ((rank = H5Sget_simple_extent_ndims(space_id)) < 0)
+ H5_LIBRARY_ERROR(ENVONLY);
+
+ if (NULL == start) {
+ startP = NULL;
+ strt = (hsize_t *)startP;
+ }
+ else {
+ if ((start_rank = ENVPTR->GetArrayLength(ENVONLY, start)) < 0) {
+ CHECK_JNI_EXCEPTION(ENVONLY, JNI_TRUE);
+ H5_BAD_ARGUMENT_ERROR(ENVONLY, "H5Sselect_intersect_block: start length < 0");
+ }
+
+ if (start_rank != rank)
+ H5_BAD_ARGUMENT_ERROR(ENVONLY,
+ "H5Sselect_intersect_block: start rank doesn't match dataspace rank!");
+
+ PIN_LONG_ARRAY(ENVONLY, start, startP, &isCopy, "H5Sselect_intersect_block: start not pinned");
+
+ if (NULL == (strt = (hsize_t *)HDmalloc((size_t)start_rank * sizeof(hsize_t))))
+ H5_OUT_OF_MEMORY_ERROR(ENVONLY, "H5Sselect_intersect_block: failed to allocate start buffer");
+ }
+
+ if (NULL == end) {
+ endP = NULL;
+ nd = (hsize_t *)endP;
+ }
+ else {
+ if ((end_rank = ENVPTR->GetArrayLength(ENVONLY, end)) < 0) {
+ CHECK_JNI_EXCEPTION(ENVONLY, JNI_TRUE);
+ H5_BAD_ARGUMENT_ERROR(ENVONLY, "H5Sselect_intersect_block: end array length < 0");
+ }
+
+ if (end_rank != rank)
+ H5_BAD_ARGUMENT_ERROR(ENVONLY,
+ "H5Sselect_intersect_block: end rank doesn't match dataspace rank!");
+
+ PIN_LONG_ARRAY(ENVONLY, end, endP, &isCopy, "H5Sselect_intersect_block: end not pinned");
+
+ if (NULL == (nd = (hsize_t *)HDmalloc((size_t)end_rank * sizeof(hsize_t))))
+ H5_OUT_OF_MEMORY_ERROR(ENVONLY, "H5Sselect_intersect_block: failed to allocate end buffer");
+ }
+
+ if ((bval = H5Sselect_intersect_block(space_id, (hsize_t *)strt, (hsize_t *)nd)) < 0)
+ H5_LIBRARY_ERROR(ENVONLY);
+
+ bval = (bval > 0) ? JNI_TRUE : JNI_FALSE;
+
+ for (i = 0; i < start_rank; i++) {
+ startP[i] = (jlong)strt[i];
+ endP[i] = (jlong)nd[i];
+ } /* end for */
+
+done:
+ if (strt)
+ HDfree(strt);
+ if (startP)
+ UNPIN_LONG_ARRAY(ENVONLY, start, startP, (bval < 0) ? JNI_ABORT : 0);
+ if (nd)
+ HDfree(nd);
+ if (endP)
+ UNPIN_LONG_ARRAY(ENVONLY, end, endP, (bval < 0) ? JNI_ABORT : 0);
+
+ return (jboolean)bval;
+} /* end Java_hdf_hdf5lib_H5_H5Sselect_1intersect_1block */
+
+/*
+ * Class: hdf_hdf5lib_H5
+ * Method: H5Sselect_project_intersection
+ * Signature: (JJJ)J
+ */
+JNIEXPORT jlong JNICALL
+Java_hdf_hdf5lib_H5_H5Sselect_1project_1intersection(JNIEnv *env, jclass clss, jlong src_space_id,
+ jlong dst_space_id, jlong src_intersect_space_id)
+{
+ hid_t sid = H5I_INVALID_HID;
+
+ UNUSED(clss);
+
+ if ((sid = H5Sselect_project_intersection(src_space_id, dst_space_id, src_intersect_space_id)) < 0)
+ H5_LIBRARY_ERROR(ENVONLY);
+
+done:
+
+ return (jlong)sid;
+} /* end Java_hdf_hdf5lib_H5_H5Sselect_1project_1intersection */
+
+/*
+ * Class: hdf_hdf5lib_H5
+ * Method: H5Scombine_hyperslab
+ * Signature: (JI[J[J[J[J)J
+ */
+JNIEXPORT jlong JNICALL
+Java_hdf_hdf5lib_H5_H5Scombine_1hyperslab(JNIEnv *env, jclass clss, jlong space_id, jint op, jlongArray start,
+ jlongArray stride, jlongArray count, jlongArray block)
+{
+ jboolean isCopy;
+ hsize_t *strt = NULL, *strd = NULL, *cnt = NULL, *blk = NULL;
+ hsize_t *lp = NULL;
+ jlong * startP = NULL, *strideP = NULL, *countP = NULL, *blockP = NULL;
+ jlong * jlp = NULL;
+ jsize start_rank, stride_rank, count_rank, block_rank;
+ int i;
+ hid_t sid = H5I_INVALID_HID;
+
+ UNUSED(clss);
+
+ if (NULL == start)
+ H5_NULL_ARGUMENT_ERROR(ENVONLY, "H5Scombine_hyperslab: start is NULL");
+ if (NULL == count)
+ H5_NULL_ARGUMENT_ERROR(ENVONLY, "H5Scombine_hyperslab: count is NULL");
+
+ if ((start_rank = ENVPTR->GetArrayLength(ENVONLY, start)) < 0) {
+ CHECK_JNI_EXCEPTION(ENVONLY, JNI_TRUE);
+ H5_BAD_ARGUMENT_ERROR(ENVONLY, "H5Scombine_hyperslab: start array length < 0");
+ }
+ if ((count_rank = ENVPTR->GetArrayLength(ENVONLY, count)) < 0) {
+ CHECK_JNI_EXCEPTION(ENVONLY, JNI_TRUE);
+ H5_BAD_ARGUMENT_ERROR(ENVONLY, "H5Scombine_hyperslab: count array length < 0");
+ }
+
+ if (start_rank != count_rank)
+ H5_BAD_ARGUMENT_ERROR(ENVONLY, "H5Scombine_hyperslab: count and start have different rank!");
+
+ PIN_LONG_ARRAY(ENVONLY, start, startP, &isCopy, "H5Scombine_hyperslab: start not pinned");
+
+ if (NULL == (strt = lp = (hsize_t *)HDmalloc((size_t)start_rank * sizeof(hsize_t))))
+ H5_OUT_OF_MEMORY_ERROR(ENVONLY, "H5Scombine_hyperslab: failed to allocate start buffer");
+
+ jlp = (jlong *)startP;
+ for (i = 0; i < start_rank; i++) {
+ *lp = (hsize_t)*jlp;
+ lp++;
+ jlp++;
+ } /* end if */
+
+ PIN_LONG_ARRAY(ENVONLY, count, countP, &isCopy, "H5Scombine_hyperslab: count not pinned");
+
+ if (NULL == (cnt = lp = (hsize_t *)HDmalloc((size_t)count_rank * sizeof(hsize_t))))
+ H5_OUT_OF_MEMORY_ERROR(ENVONLY, "H5Scombine_hyperslab: failed to allocate count buffer");
+
+ jlp = (jlong *)countP;
+ for (i = 0; i < count_rank; i++) {
+ *lp = (hsize_t)*jlp;
+ lp++;
+ jlp++;
+ } /* end if */
+
+ if (NULL == stride) {
+ strideP = NULL;
+ strd = (hsize_t *)strideP;
+ }
+ else {
+ if ((stride_rank = ENVPTR->GetArrayLength(ENVONLY, stride)) < 0) {
+ CHECK_JNI_EXCEPTION(ENVONLY, JNI_TRUE);
+ H5_BAD_ARGUMENT_ERROR(ENVONLY, "H5Scombine_hyperslab: stride array length < 0");
+ }
+
+ if (stride_rank != start_rank)
+ H5_BAD_ARGUMENT_ERROR(ENVONLY, "H5Scombine_hyperslab: stride and start have different rank!");
+
+ PIN_LONG_ARRAY(ENVONLY, stride, strideP, &isCopy, "H5Scombine_hyperslab: stride not pinned");
+
+ if (NULL == (strd = lp = (hsize_t *)HDmalloc((size_t)stride_rank * sizeof(hsize_t))))
+ H5_OUT_OF_MEMORY_ERROR(ENVONLY, "H5Scombine_hyperslab: failed to allocate stride buffer");
+
+ jlp = (jlong *)strideP;
+ for (i = 0; i < stride_rank; i++) {
+ *lp = (hsize_t)*jlp;
+ lp++;
+ jlp++;
+ } /* end if */
+ }
+
+ if (NULL == block) {
+ blockP = NULL;
+ blk = (hsize_t *)blockP;
+ }
+ else {
+ if ((block_rank = ENVPTR->GetArrayLength(ENVONLY, block)) < 0) {
+ CHECK_JNI_EXCEPTION(ENVONLY, JNI_TRUE);
+ H5_BAD_ARGUMENT_ERROR(ENVONLY, "H5Scombine_hyperslab: block array length < 0");
+ }
+
+ if (block_rank != start_rank)
+ H5_BAD_ARGUMENT_ERROR(ENVONLY, "H5Scombine_hyperslab: block and start have different rank!");
+
+ PIN_LONG_ARRAY(ENVONLY, block, blockP, &isCopy, "H5Scombine_hyperslab: block not pinned");
+
+ if (NULL == (blk = lp = (hsize_t *)HDmalloc((size_t)block_rank * sizeof(hsize_t))))
+ H5_OUT_OF_MEMORY_ERROR(ENVONLY, "H5Scombine_hyperslab: failed to allocate block buffer");
+
+ jlp = (jlong *)blockP;
+ for (i = 0; i < block_rank; i++) {
+ *lp = (hsize_t)*jlp;
+ lp++;
+ jlp++;
+ } /* end for */
+ }
+
+ if ((sid = H5Scombine_hyperslab(space_id, (H5S_seloper_t)op, (const hsize_t *)strt, (const hsize_t *)strd,
+ (const hsize_t *)cnt, (const hsize_t *)blk)) < 0)
+ H5_LIBRARY_ERROR(ENVONLY);
+
+done:
+ if (blk)
+ HDfree(blk);
+ if (blockP)
+ UNPIN_LONG_ARRAY(ENVONLY, block, blockP, JNI_ABORT);
+ if (strd)
+ HDfree(strd);
+ if (strideP)
+ UNPIN_LONG_ARRAY(ENVONLY, stride, strideP, JNI_ABORT);
+ if (cnt)
+ HDfree(cnt);
+ if (countP)
+ UNPIN_LONG_ARRAY(ENVONLY, count, countP, JNI_ABORT);
+ if (strt)
+ HDfree(strt);
+ if (startP)
+ UNPIN_LONG_ARRAY(ENVONLY, start, startP, JNI_ABORT);
+
+ return (jlong)sid;
+} /* end Java_hdf_hdf5lib_H5_H5Sselect_1hyperslab */
+
+/*
+ * Class: hdf_hdf5lib_H5
+ * Method: H5Smodify_select
+ * Signature: (JIJ)V
+ */
+JNIEXPORT void JNICALL
+Java_hdf_hdf5lib_H5_H5Smodify_1select(JNIEnv *env, jclass clss, jlong space1_id, jint op, jlong space2_id)
+{
+ herr_t status = FAIL;
+
+ UNUSED(clss);
+
+ if ((status = H5Smodify_select((hid_t)space1_id, (H5S_seloper_t)op, (hid_t)space2_id)) < 0)
+ H5_LIBRARY_ERROR(ENVONLY);
+
+done:
+ return;
+} /* end Java_hdf_hdf5lib_H5_H5Smodify_1select */
+
+/*
+ * Class: hdf_hdf5lib_H5
+ * Method: H5Scombine_select
+ * Signature: (JIJ)J
+ */
+JNIEXPORT jlong JNICALL
+Java_hdf_hdf5lib_H5_H5Scombine_1select(JNIEnv *env, jclass clss, jlong space1_id, jint op, jlong space2_id)
+{
+ hid_t sid = H5I_INVALID_HID;
+
+ UNUSED(clss);
+
+ if ((sid = H5Scombine_select((hid_t)space1_id, (H5S_seloper_t)op, (hid_t)space2_id)) < 0)
+ H5_LIBRARY_ERROR(ENVONLY);
+
+done:
+
+ return (jlong)sid;
+} /* end Java_hdf_hdf5lib_H5_H5Scombine_1select */
+
#ifdef __cplusplus
} /* end extern "C" */
#endif /* __cplusplus */
diff --git a/java/src/jni/h5sImp.h b/java/src/jni/h5sImp.h
index aa8fc60..a758d5a 100644
--- a/java/src/jni/h5sImp.h
+++ b/java/src/jni/h5sImp.h
@@ -1,6 +1,5 @@
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* 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 *
@@ -14,8 +13,8 @@
#include <jni.h>
/* Header for class hdf_hdf5lib_H5_H5S */
-#ifndef _Included_hdf_hdf5lib_H5_H5S
-#define _Included_hdf_hdf5lib_H5_H5S
+#ifndef Included_hdf_hdf5lib_H5_H5S
+#define Included_hdf_hdf5lib_H5_H5S
#ifdef __cplusplus
extern "C" {
@@ -259,8 +258,67 @@ JNIEXPORT jboolean JNICALL Java_hdf_hdf5lib_H5_H5Sis_1regular_1hyperslab(JNIEnv
JNIEXPORT void JNICALL Java_hdf_hdf5lib_H5_H5Sget_1regular_1hyperslab(JNIEnv *, jclass, jlong, jlongArray,
jlongArray, jlongArray, jlongArray);
+/*
+ * Class: hdf_hdf5lib_H5
+ * Method: H5Sselect_copy
+ * Signature: (JJ)V
+ */
+JNIEXPORT void JNICALL Java_hdf_hdf5lib_H5_H5Sselect_1copy(JNIEnv *, jclass, jlong, jlong);
+
+/*
+ * Class: hdf_hdf5lib_H5
+ * Method: H5Sselect_shape_same
+ * Signature: (JJ)Z
+ */
+JNIEXPORT jboolean JNICALL Java_hdf_hdf5lib_H5_H5Sselect_1shape_1same(JNIEnv *, jclass, jlong, jlong);
+
+/*
+ * Class: hdf_hdf5lib_H5
+ * Method: H5Sselect_adjust
+ * Signature: (J[J)V
+ */
+JNIEXPORT void JNICALL Java_hdf_hdf5lib_H5_H5Sselect_1adjust(JNIEnv *, jclass, jlong, jlongArray);
+
+/*
+ * Class: hdf_hdf5lib_H5
+ * Method: H5Sselect_intersect_block
+ * Signature: (J[J[J)Z
+ */
+JNIEXPORT jboolean JNICALL Java_hdf_hdf5lib_H5_H5Sselect_1intersect_1block(JNIEnv *, jclass, jlong,
+ jlongArray, jlongArray);
+
+/*
+ * Class: hdf_hdf5lib_H5
+ * Method: H5Sselect_project_intersection
+ * Signature: (JJJ)J
+ */
+JNIEXPORT jlong JNICALL Java_hdf_hdf5lib_H5_H5Sselect_1project_1intersection(JNIEnv *, jclass, jlong, jlong,
+ jlong);
+
+/*
+ * Class: hdf_hdf5lib_H5
+ * Method: H5Scombine_hyperslab
+ * Signature: (JI[J[J[J[J)J
+ */
+JNIEXPORT jlong JNICALL Java_hdf_hdf5lib_H5_H5Scombine_1hyperslab(JNIEnv *, jclass, jlong, jint, jlongArray,
+ jlongArray, jlongArray, jlongArray);
+
+/*
+ * Class: hdf_hdf5lib_H5
+ * Method: H5Smodify_select
+ * Signature: (JIJ)V
+ */
+JNIEXPORT void JNICALL Java_hdf_hdf5lib_H5_H5Smodify_1select(JNIEnv *, jclass, jlong, jint, jlong);
+
+/*
+ * Class: hdf_hdf5lib_H5
+ * Method: H5Scombine_select
+ * Signature: (JIJ)J
+ */
+JNIEXPORT jlong JNICALL Java_hdf_hdf5lib_H5_H5Scombine_1select(JNIEnv *, jclass, jlong, jint, jlong);
+
#ifdef __cplusplus
} /* end extern "C" */
#endif /* __cplusplus */
-#endif /* _Included_hdf_hdf5lib_H5_H5S */
+#endif /* Included_hdf_hdf5lib_H5_H5S */
diff --git a/java/src/jni/h5tImp.h b/java/src/jni/h5tImp.h
index 3769cf3..e671456 100644
--- a/java/src/jni/h5tImp.h
+++ b/java/src/jni/h5tImp.h
@@ -1,6 +1,5 @@
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* 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 *
@@ -14,8 +13,8 @@
#include <jni.h>
/* Header for class hdf_hdf5lib_H5_H5T */
-#ifndef _Included_hdf_hdf5lib_H5_H5T
-#define _Included_hdf_hdf5lib_H5_H5T
+#ifndef Included_hdf_hdf5lib_H5_H5T
+#define Included_hdf_hdf5lib_H5_H5T
#ifdef __cplusplus
extern "C" {
@@ -506,4 +505,4 @@ JNIEXPORT void JNICALL Java_hdf_hdf5lib_H5_H5Trefresh(JNIEnv *, jclass, jlong);
} /* end extern "C" */
#endif /* __cplusplus */
-#endif /* _Included_hdf_hdf5lib_H5_H5T */
+#endif /* Included_hdf_hdf5lib_H5_H5T */
diff --git a/java/src/jni/h5util.c b/java/src/jni/h5util.c
index 3d47fde..6281481 100644
--- a/java/src/jni/h5util.c
+++ b/java/src/jni/h5util.c
@@ -28,8 +28,6 @@ extern "C" {
#include "hdf5.h"
#include "h5util.h"
-#define SKIP_UNUSED_DUMP_ROUTINES
-
/* size of hyperslab buffer when a dataset is bigger than H5TOOLS_MALLOCSIZE */
hsize_t H5TOOLS_BUFSIZE = (32 * 1024 * 1024); /* 32 MB */
int H5TOOLS_TEXT_BLOCK = 16; /* Number of elements on a line in a text export file */
@@ -54,18 +52,21 @@ void * edata;
/* Local Prototypes */
/********************/
-#ifndef SKIP_UNUSED_DUMP_ROUTINES
-static int h5str_dump_region_blocks(JNIEnv *env, h5str_t *str, hid_t region, hid_t region_obj);
-static int h5str_dump_region_points(JNIEnv *env, h5str_t *str, hid_t region, hid_t region_obj);
-#endif
+int h5str_region_dataset(JNIEnv *env, h5str_t *out_str, H5R_ref_t *ref_vp, int expand_data);
+
+static int h5str_dump_region_blocks(JNIEnv *env, h5str_t *str, hid_t region, hid_t region_obj,
+ int expand_data);
+static int h5str_dump_region_points(JNIEnv *env, h5str_t *str, hid_t region, hid_t region_obj,
+ int expand_data);
+static int h5str_dump_region_attribute(JNIEnv *env, h5str_t *str, hid_t region_id);
static int h5str_is_zero(const void *_mem, size_t size);
static hid_t h5str_get_native_type(hid_t type);
static hid_t h5str_get_little_endian_type(hid_t type);
static hid_t h5str_get_big_endian_type(hid_t type);
static htri_t h5str_detect_vlen(hid_t tid);
static htri_t h5str_detect_vlen_str(hid_t tid);
-static int h5tools_dump_simple_data(JNIEnv *env, FILE *stream, hid_t container, hid_t type, void *_mem,
- hsize_t nelmts);
+static int h5str_dump_simple_data(JNIEnv *env, FILE *stream, hid_t container, hid_t type, void *_mem,
+ hsize_t nelmts);
static int h5str_render_bin_output(FILE *stream, hid_t container, hid_t tid, void *_mem,
hsize_t block_nelmts);
static int render_bin_output_region_data_blocks(FILE *stream, hid_t region_id, hid_t container, int ndims,
@@ -185,13 +186,14 @@ h5str_convert(JNIEnv *env, char **in_str, hid_t container, hid_t tid, void *out_
H5T_class_t tclass = H5T_NO_CLASS;
const char delimiter[] = " ," H5_COMPOUND_BEGIN_INDICATOR H5_COMPOUND_END_INDICATOR
H5_ARRAY_BEGIN_INDICATOR H5_ARRAY_END_INDICATOR H5_VLEN_BEGIN_INDICATOR H5_VLEN_END_INDICATOR;
- size_t typeSize = 0;
- hid_t mtid = H5I_INVALID_HID;
- char * this_str = NULL;
- char * token;
- char * cptr = NULL;
- int n;
- size_t retVal = 0;
+
+ size_t retVal = 0;
+ size_t typeSize = 0;
+ hid_t mtid = H5I_INVALID_HID;
+ char * this_str = NULL;
+ char * cptr = NULL;
+ char * token;
+ int n;
if (!in_str)
H5_NULL_ARGUMENT_ERROR(ENVONLY, "h5str_convert: in_str is NULL");
@@ -239,7 +241,7 @@ h5str_convert(JNIEnv *env, char **in_str, hid_t container, hid_t tid, void *out_
case sizeof(long double): {
long double tmp_ldouble = 0.0;
- sscanf(token, "%Lf", &tmp_ldouble);
+ sscanf(token, "%Lg", &tmp_ldouble);
HDmemcpy(cptr, &tmp_ldouble, sizeof(long double));
break;
}
@@ -644,27 +646,27 @@ done:
*
* Purpose: Object reference -- show the name of the referenced object.
*
- * Return: Nothing
+ * Return: SUCCEED or FAIL
*-------------------------------------------------------------------------
*/
-void
-h5str_sprint_reference(JNIEnv *env, h5str_t *out_str, hid_t container, void *ref_p)
+int
+h5str_sprint_reference(JNIEnv *env, h5str_t *out_str, void *ref_p)
{
- ssize_t buf_size;
- char * ref_name = NULL;
- const H5R_ref_t *ref_vp = (H5R_ref_t *)ref_p;
+ ssize_t buf_size;
+ char * ref_name = NULL;
+ H5R_ref_t *ref_vp = (H5R_ref_t *)ref_p;
- UNUSED(container);
+ int ret_value = FAIL;
if (!h5str_append(out_str, " \""))
- CHECK_JNI_EXCEPTION(ENVONLY, JNI_FALSE);
+ H5_ASSERTION_ERROR(ENVONLY, "Unable to append string.");
buf_size = H5Rget_file_name(ref_vp, NULL, 0);
if (buf_size) {
ref_name = (char *)HDmalloc(sizeof(char) * (size_t)buf_size + 1);
if (H5Rget_file_name(ref_vp, ref_name, buf_size + 1) >= 0) {
ref_name[buf_size] = '\0';
if (!h5str_append(out_str, ref_name))
- CHECK_JNI_EXCEPTION(ENVONLY, JNI_FALSE);
+ H5_ASSERTION_ERROR(ENVONLY, "Unable to append string.");
}
HDfree(ref_name);
ref_name = NULL;
@@ -676,7 +678,7 @@ h5str_sprint_reference(JNIEnv *env, h5str_t *out_str, hid_t container, void *ref
if (H5Rget_obj_name(ref_vp, H5P_DEFAULT, ref_name, buf_size + 1) >= 0) {
ref_name[buf_size] = '\0';
if (!h5str_append(out_str, ref_name))
- CHECK_JNI_EXCEPTION(ENVONLY, JNI_FALSE);
+ H5_ASSERTION_ERROR(ENVONLY, "Unable to append string.");
}
HDfree(ref_name);
ref_name = NULL;
@@ -689,17 +691,61 @@ h5str_sprint_reference(JNIEnv *env, h5str_t *out_str, hid_t container, void *ref
if (H5Rget_attr_name(ref_vp, ref_name, buf_size + 1) >= 0) {
ref_name[buf_size] = '\0';
if (!h5str_append(out_str, ref_name))
- CHECK_JNI_EXCEPTION(ENVONLY, JNI_FALSE);
+ H5_ASSERTION_ERROR(ENVONLY, "Unable to append string.");
}
HDfree(ref_name);
ref_name = NULL;
}
}
if (!h5str_append(out_str, "\""))
- CHECK_JNI_EXCEPTION(ENVONLY, JNI_FALSE);
+ H5_ASSERTION_ERROR(ENVONLY, "Unable to append string.");
+
+ ret_value = SUCCEED;
done:
if (ref_name)
HDfree(ref_name);
+
+ return ret_value;
+} /* h5str_sprint_reference */
+
+int
+h5str_region_dataset(JNIEnv *env, h5str_t *out_str, H5R_ref_t *ref_vp, int expand_data)
+{
+ hid_t new_obj_id = H5I_INVALID_HID;
+ hid_t new_obj_sid = H5I_INVALID_HID;
+ H5S_sel_type region_type;
+
+ int ret_value = FAIL;
+
+ if ((new_obj_id = H5Ropen_object(ref_vp, H5P_DEFAULT, H5P_DEFAULT)) < 0) {
+ ret_value = SUCCEED; /* An uncreated region is a valid state */
+ goto done;
+ }
+
+ if ((new_obj_sid = H5Ropen_region(ref_vp, H5P_DEFAULT, H5P_DEFAULT)) < 0)
+ H5_LIBRARY_ERROR(ENVONLY);
+
+ if ((region_type = H5Sget_select_type(new_obj_sid)) > H5S_SEL_ERROR) {
+ if (H5S_SEL_POINTS == region_type) {
+ if (h5str_dump_region_points(ENVONLY, out_str, new_obj_sid, new_obj_id, expand_data) < 0)
+ CHECK_JNI_EXCEPTION(ENVONLY, JNI_FALSE);
+ }
+ else if (H5S_SEL_HYPERSLABS == region_type) {
+ if (h5str_dump_region_blocks(ENVONLY, out_str, new_obj_sid, new_obj_id, expand_data) < 0)
+ CHECK_JNI_EXCEPTION(ENVONLY, JNI_FALSE);
+ }
+ }
+
+ ret_value = SUCCEED;
+done:
+ if (new_obj_sid >= 0)
+ if (H5Sclose(new_obj_sid) < 0)
+ H5_LIBRARY_ERROR(ENVONLY);
+ if (new_obj_id >= 0)
+ if (H5Dclose(new_obj_id) < 0)
+ H5_LIBRARY_ERROR(ENVONLY);
+
+ return ret_value;
}
/*
@@ -710,8 +756,7 @@ done:
* FAILURE: 0
*/
size_t
-h5str_sprintf(JNIEnv *env, h5str_t *out_str, hid_t container, hid_t tid, void *in_buf, size_t in_buf_len,
- int expand_data)
+h5str_sprintf(JNIEnv *env, h5str_t *out_str, hid_t container, hid_t tid, void *in_buf, int expand_data)
{
unsigned char *ucptr = (unsigned char *)in_buf;
static char fmt_llong[8], fmt_ullong[8];
@@ -719,7 +764,6 @@ h5str_sprintf(JNIEnv *env, h5str_t *out_str, hid_t container, hid_t tid, void *i
size_t typeSize = 0;
H5T_sign_t nsign = H5T_SGN_ERROR;
hid_t mtid = H5I_INVALID_HID;
- hid_t obj = H5I_INVALID_HID;
char * cptr = (char *)in_buf;
char * this_str = NULL;
int n;
@@ -734,8 +778,6 @@ h5str_sprintf(JNIEnv *env, h5str_t *out_str, hid_t container, hid_t tid, void *i
H5_LIBRARY_ERROR(ENVONLY);
if (!(typeSize = H5Tget_size(tid)))
H5_LIBRARY_ERROR(ENVONLY);
- if (!(nsign = H5Tget_sign(tid)))
- H5_LIBRARY_ERROR(ENVONLY);
/* Build default formats for long long types */
if (!fmt_llong[0]) {
@@ -744,7 +786,6 @@ h5str_sprintf(JNIEnv *env, h5str_t *out_str, hid_t container, hid_t tid, void *i
if (HDsnprintf(fmt_ullong, sizeof(fmt_ullong), "%%%su", H5_PRINTF_LL_WIDTH) < 0)
H5_JNI_FATAL_ERROR(ENVONLY, "h5str_sprintf: HDsnprintf failure");
} /* end if */
-
switch (tclass) {
case H5T_FLOAT: {
switch (typeSize) {
@@ -784,7 +825,7 @@ h5str_sprintf(JNIEnv *env, h5str_t *out_str, hid_t container, hid_t tid, void *i
if (NULL == (this_str = (char *)HDmalloc(27)))
H5_OUT_OF_MEMORY_ERROR(ENVONLY, "h5str_sprintf: failed to allocate string buffer");
- if (HDsprintf(this_str, "%Lf", tmp_ldouble) < 0)
+ if (HDsprintf(this_str, "%Lg", tmp_ldouble) < 0)
H5_JNI_FATAL_ERROR(ENVONLY, "h5str_sprintf: HDsprintf failure");
break;
@@ -805,6 +846,8 @@ h5str_sprintf(JNIEnv *env, h5str_t *out_str, hid_t container, hid_t tid, void *i
htri_t is_variable;
char * tmp_str;
+ typeSize = 0;
+
if ((is_variable = H5Tis_variable_str(tid)) < 0)
H5_LIBRARY_ERROR(ENVONLY);
@@ -1003,7 +1046,7 @@ h5str_sprintf(JNIEnv *env, h5str_t *out_str, hid_t container, hid_t tid, void *i
H5_LIBRARY_ERROR(ENVONLY);
if (!h5str_append(out_str, H5_COMPOUND_BEGIN_INDICATOR))
- CHECK_JNI_EXCEPTION(ENVONLY, JNI_FALSE);
+ H5_ASSERTION_ERROR(ENVONLY, "Unable to append string.");
for (i = 0; i < (unsigned)n; i++) {
offset = H5Tget_member_offset(tid, i);
@@ -1011,12 +1054,12 @@ h5str_sprintf(JNIEnv *env, h5str_t *out_str, hid_t container, hid_t tid, void *i
if ((mtid = H5Tget_member_type(tid, i)) < 0)
H5_LIBRARY_ERROR(ENVONLY);
- if (!h5str_sprintf(ENVONLY, out_str, container, mtid, &cptr[offset], in_buf_len, expand_data))
+ if (!h5str_sprintf(ENVONLY, out_str, container, mtid, &cptr[offset], expand_data))
CHECK_JNI_EXCEPTION(ENVONLY, JNI_FALSE);
if ((i + 1) < (unsigned)n)
if (!h5str_append(out_str, ", "))
- CHECK_JNI_EXCEPTION(ENVONLY, JNI_FALSE);
+ H5_ASSERTION_ERROR(ENVONLY, "Unable to append string.");
if (H5Tclose(mtid) < 0)
H5_LIBRARY_ERROR(ENVONLY);
@@ -1024,7 +1067,7 @@ h5str_sprintf(JNIEnv *env, h5str_t *out_str, hid_t container, hid_t tid, void *i
}
if (!h5str_append(out_str, H5_COMPOUND_END_INDICATOR))
- CHECK_JNI_EXCEPTION(ENVONLY, JNI_FALSE);
+ H5_ASSERTION_ERROR(ENVONLY, "Unable to append string.");
break;
}
@@ -1034,7 +1077,7 @@ h5str_sprintf(JNIEnv *env, h5str_t *out_str, hid_t container, hid_t tid, void *i
if (H5Tenum_nameof(tid, cptr, enum_name, sizeof enum_name) >= 0) {
if (!h5str_append(out_str, enum_name))
- CHECK_JNI_EXCEPTION(ENVONLY, JNI_FALSE);
+ H5_ASSERTION_ERROR(ENVONLY, "Unable to append string.");
}
else {
size_t i;
@@ -1057,124 +1100,112 @@ h5str_sprintf(JNIEnv *env, h5str_t *out_str, hid_t container, hid_t tid, void *i
}
case H5T_REFERENCE: {
- if (h5str_is_zero(cptr, typeSize)) {
- if (!h5str_append(out_str, "NULL"))
- CHECK_JNI_EXCEPTION(ENVONLY, JNI_FALSE);
- break;
- }
+ /* H5T_STD_REF */
+ hid_t new_obj_id = H5I_INVALID_HID;
+ H5O_type_t obj_type = -1; /* Object type */
+ H5R_type_t ref_type; /* Reference type */
- if (H5Tequal(tid, H5T_STD_REF)) {
- H5O_type_t obj_type = -1; /* Object type */
- H5R_type_t ref_type; /* Reference type */
- const H5R_ref_t *ref_vp = (H5R_ref_t *)cptr;
+ H5R_ref_t *ref_vp = (H5R_ref_t *)cptr;
- ref_type = H5Rget_type(ref_vp);
- H5Rget_obj_type3(ref_vp, H5P_DEFAULT, &obj_type);
+ ref_type = H5Rget_type(ref_vp);
+ if (!h5str_is_zero(ref_vp, H5Tget_size(H5T_STD_REF))) {
switch (ref_type) {
- case H5R_OBJECT1: {
- /* Object references -- show the type and OID of the referenced object. */
- H5O_info2_t oi;
-
- if ((obj = H5Ropen_object(ref_vp, H5P_DEFAULT, H5P_DEFAULT)) >= 0) {
- H5Oget_info3(obj, &oi, H5O_INFO_BASIC);
- if (H5Oclose(obj) < 0)
- CHECK_JNI_EXCEPTION(ENVONLY, JNI_FALSE);
+ case H5R_OBJECT1:
+ if (H5Rget_obj_type3(ref_vp, H5P_DEFAULT, &obj_type) >= 0) {
+ switch (obj_type) {
+ case H5O_TYPE_DATASET:
+ if (h5str_region_dataset(ENVONLY, out_str, ref_vp, expand_data) < 0)
+ CHECK_JNI_EXCEPTION(ENVONLY, JNI_FALSE);
+ break;
+
+ case H5O_TYPE_GROUP:
+ case H5O_TYPE_NAMED_DATATYPE:
+ case H5O_TYPE_MAP:
+ case H5O_TYPE_UNKNOWN:
+ case H5O_TYPE_NTYPES:
+ default: {
+ /* Object references -- show the type and OID of the referenced object. */
+ H5O_info2_t oi;
+ char * obj_tok_str = NULL;
+ if ((new_obj_id = H5Ropen_object(ref_vp, H5P_DEFAULT, H5P_DEFAULT)) >=
+ 0) {
+ H5Oget_info3(new_obj_id, &oi, H5O_INFO_BASIC);
+ H5Otoken_to_str(new_obj_id, &oi.token, &obj_tok_str);
+ if (H5Dclose(new_obj_id) < 0)
+ H5_LIBRARY_ERROR(ENVONLY);
+ }
+ else
+ H5_LIBRARY_ERROR(ENVONLY);
+
+ if (NULL == (this_str = (char *)HDmalloc(14)))
+ H5_OUT_OF_MEMORY_ERROR(
+ ENVONLY, "h5str_sprintf: failed to allocate string buffer");
+ if (HDsprintf(this_str, "%u-", (unsigned)oi.type) < 0)
+ H5_JNI_FATAL_ERROR(ENVONLY, "h5str_sprintf: HDsprintf failure");
+ if (!h5str_append(out_str, this_str))
+ H5_ASSERTION_ERROR(ENVONLY, "Unable to append string.");
+ HDfree(this_str);
+ this_str = NULL;
+
+ /* Print OID */
+ {
+ char *token_str;
+
+ H5Otoken_to_str(tid, &oi.token, &token_str);
+
+ if (NULL == (this_str = (char *)HDmalloc(64 + strlen(token_str) + 1)))
+ H5_OUT_OF_MEMORY_ERROR(
+ ENVONLY, "h5str_sprintf: failed to allocate string buffer");
+ if (HDsprintf(this_str, "%lu:%s", oi.fileno, token_str) < 0)
+ H5_JNI_FATAL_ERROR(ENVONLY, "h5str_sprintf: HDsprintf failure");
+
+ H5free_memory(token_str);
+ }
+ } break;
+ } /* end switch */
}
else
- CHECK_JNI_EXCEPTION(ENVONLY, JNI_FALSE);
-
- if (NULL == (this_str = (char *)HDmalloc(14)))
- H5_OUT_OF_MEMORY_ERROR(ENVONLY,
- "h5str_sprintf: failed to allocate string buffer");
- if (HDsprintf(this_str, "%u-", (unsigned)oi.type) < 0)
- H5_JNI_FATAL_ERROR(ENVONLY, "h5str_sprintf: HDsprintf failure");
- if (!h5str_append(out_str, this_str))
- CHECK_JNI_EXCEPTION(ENVONLY, JNI_FALSE);
- HDfree(this_str);
- this_str = NULL;
-
- switch (obj_type) {
- case H5O_TYPE_GROUP:
- if (!h5str_append(out_str, H5_TOOLS_GROUP))
- CHECK_JNI_EXCEPTION(ENVONLY, JNI_FALSE);
- break;
-
- case H5O_TYPE_DATASET:
- if (!h5str_append(out_str, H5_TOOLS_DATASET))
- CHECK_JNI_EXCEPTION(ENVONLY, JNI_FALSE);
- break;
-
- case H5O_TYPE_NAMED_DATATYPE:
- if (!h5str_append(out_str, H5_TOOLS_DATATYPE))
- CHECK_JNI_EXCEPTION(ENVONLY, JNI_FALSE);
- break;
-
- case H5O_TYPE_MAP:
- case H5O_TYPE_UNKNOWN:
- case H5O_TYPE_NTYPES:
- default:
- break;
- } /* end switch */
- H5Oclose(obj);
- h5str_sprint_reference(ENVONLY, out_str, container, ref_vp);
-
- /* Print OID */
- {
- char *token_str;
-
- H5Otoken_to_str(tid, &oi.token, &token_str);
-
- if (NULL == (this_str = (char *)HDmalloc(64 + strlen(token_str) + 1)))
- H5_OUT_OF_MEMORY_ERROR(ENVONLY,
- "h5str_sprintf: failed to allocate string buffer");
- if (HDsprintf(this_str, "%lu:%s", oi.fileno, token_str) < 0)
- H5_JNI_FATAL_ERROR(ENVONLY, "h5str_sprintf: HDsprintf failure");
-
- H5free_memory(token_str);
- }
-
- }
-
- break;
+ H5_LIBRARY_ERROR(ENVONLY);
+ break;
case H5R_DATASET_REGION1:
- if (!h5str_append(out_str, H5_TOOLS_DATASET))
+ if (h5str_region_dataset(ENVONLY, out_str, ref_vp, expand_data) < 0)
CHECK_JNI_EXCEPTION(ENVONLY, JNI_FALSE);
- h5str_sprint_reference(ENVONLY, out_str, container, (void *)cptr);
break;
case H5R_OBJECT2:
- switch (obj_type) {
- case H5O_TYPE_GROUP:
- if (!h5str_append(out_str, H5_TOOLS_GROUP))
- CHECK_JNI_EXCEPTION(ENVONLY, JNI_FALSE);
- break;
-
- case H5O_TYPE_DATASET:
- if (!h5str_append(out_str, H5_TOOLS_DATASET))
- CHECK_JNI_EXCEPTION(ENVONLY, JNI_FALSE);
- break;
-
- case H5O_TYPE_NAMED_DATATYPE:
- if (!h5str_append(out_str, H5_TOOLS_DATATYPE))
- CHECK_JNI_EXCEPTION(ENVONLY, JNI_FALSE);
- break;
-
- case H5O_TYPE_MAP:
- case H5O_TYPE_UNKNOWN:
- case H5O_TYPE_NTYPES:
- default:
- break;
- } /* end switch */
- h5str_sprint_reference(ENVONLY, out_str, container, (void *)cptr);
+ if (H5Rget_obj_type3(ref_vp, H5P_DEFAULT, &obj_type) >= 0) {
+ switch (obj_type) {
+ case H5O_TYPE_GROUP:
+ break;
+
+ case H5O_TYPE_DATASET:
+ if (h5str_region_dataset(ENVONLY, out_str, ref_vp, expand_data) < 0)
+ CHECK_JNI_EXCEPTION(ENVONLY, JNI_FALSE);
+ break;
+
+ case H5O_TYPE_NAMED_DATATYPE:
+ break;
+
+ case H5O_TYPE_MAP:
+ case H5O_TYPE_UNKNOWN:
+ case H5O_TYPE_NTYPES:
+ default:
+ break;
+ } /* end switch */
+ }
+ else
+ H5_ASSERTION_ERROR(ENVONLY, "h5str_sprintf: H5R_OBJECT2 failed");
break;
case H5R_DATASET_REGION2:
- if (!h5str_append(out_str, H5_TOOLS_DATASET))
+ if (h5str_region_dataset(ENVONLY, out_str, ref_vp, expand_data) < 0)
CHECK_JNI_EXCEPTION(ENVONLY, JNI_FALSE);
- h5str_sprint_reference(ENVONLY, out_str, container, (void *)cptr);
break;
case H5R_ATTR:
- if (!h5str_append(out_str, H5_TOOLS_ATTRIBUTE))
- CHECK_JNI_EXCEPTION(ENVONLY, JNI_FALSE);
- h5str_sprint_reference(ENVONLY, out_str, container, (void *)cptr);
+ if ((new_obj_id = H5Ropen_attr(ref_vp, H5P_DEFAULT, H5P_DEFAULT)) >= 0) {
+ if (h5str_dump_region_attribute(ENVONLY, out_str, new_obj_id) < 0)
+ CHECK_JNI_EXCEPTION(ENVONLY, JNI_FALSE);
+ if (H5Aclose(new_obj_id) < 0)
+ H5_LIBRARY_ERROR(ENVONLY);
+ }
break;
case H5R_BADTYPE:
case H5R_MAXTYPE:
@@ -1182,14 +1213,9 @@ h5str_sprintf(JNIEnv *env, h5str_t *out_str, hid_t container, hid_t tid, void *i
break;
} /* end switch */
}
- else if (H5Tequal(tid, H5T_STD_REF_DSETREG)) {
- /* (H5R_DSET_REG_REF_BUF_SIZE == typeSize) */
- H5_LIBRARY_ERROR(ENVONLY);
- }
- else if (H5Tequal(tid, H5T_STD_REF_OBJ)) {
- /* (H5R_OBJ_REF_BUF_SIZE == typeSize) */
+
+ if (H5Rdestroy(ref_vp) < 0)
H5_LIBRARY_ERROR(ENVONLY);
- }
break;
}
@@ -1200,7 +1226,7 @@ h5str_sprintf(JNIEnv *env, h5str_t *out_str, hid_t container, hid_t tid, void *i
int rank = 0;
if (!h5str_append(out_str, H5_ARRAY_BEGIN_INDICATOR))
- CHECK_JNI_EXCEPTION(ENVONLY, JNI_FALSE);
+ H5_ASSERTION_ERROR(ENVONLY, "Unable to append string.");
if ((mtid = H5Tget_super(tid)) < 0)
H5_LIBRARY_ERROR(ENVONLY);
@@ -1218,17 +1244,16 @@ h5str_sprintf(JNIEnv *env, h5str_t *out_str, hid_t container, hid_t tid, void *i
total_elmts *= dims[i];
for (i = 0; i < total_elmts; i++) {
- if (!h5str_sprintf(ENVONLY, out_str, container, mtid, &(cptr[i * baseSize]), in_buf_len,
- expand_data))
+ if (!h5str_sprintf(ENVONLY, out_str, container, mtid, &(cptr[i * baseSize]), expand_data))
CHECK_JNI_EXCEPTION(ENVONLY, JNI_FALSE);
if ((i + 1) < total_elmts)
if (!h5str_append(out_str, ", "))
- CHECK_JNI_EXCEPTION(ENVONLY, JNI_FALSE);
+ H5_ASSERTION_ERROR(ENVONLY, "Unable to append string.");
}
if (!h5str_append(out_str, H5_ARRAY_END_INDICATOR))
- CHECK_JNI_EXCEPTION(ENVONLY, JNI_FALSE);
+ H5_ASSERTION_ERROR(ENVONLY, "Unable to append string.");
if (H5Tclose(mtid) < 0)
H5_LIBRARY_ERROR(ENVONLY);
@@ -1249,20 +1274,20 @@ h5str_sprintf(JNIEnv *env, h5str_t *out_str, hid_t container, hid_t tid, void *i
H5_LIBRARY_ERROR(ENVONLY);
if (!h5str_append(out_str, H5_VLEN_BEGIN_INDICATOR))
- CHECK_JNI_EXCEPTION(ENVONLY, JNI_FALSE);
+ H5_ASSERTION_ERROR(ENVONLY, "Unable to append string.");
for (i = 0; i < (unsigned)vl_buf->len; i++) {
if (!h5str_sprintf(ENVONLY, out_str, container, mtid, &(((char *)vl_buf->p)[i * baseSize]),
- vl_buf->len, expand_data))
+ expand_data))
CHECK_JNI_EXCEPTION(ENVONLY, JNI_FALSE);
if ((i + 1) < (unsigned)vl_buf->len)
if (!h5str_append(out_str, ", "))
- CHECK_JNI_EXCEPTION(ENVONLY, JNI_FALSE);
+ H5_ASSERTION_ERROR(ENVONLY, "Unable to append string.");
}
if (!h5str_append(out_str, H5_VLEN_END_INDICATOR))
- CHECK_JNI_EXCEPTION(ENVONLY, JNI_FALSE);
+ H5_ASSERTION_ERROR(ENVONLY, "Unable to append string.");
if (H5Tclose(mtid) < 0)
H5_LIBRARY_ERROR(ENVONLY);
@@ -1304,7 +1329,7 @@ h5str_sprintf(JNIEnv *env, h5str_t *out_str, hid_t container, hid_t tid, void *i
if (this_str) {
if (!h5str_append(out_str, this_str))
- CHECK_JNI_EXCEPTION(ENVONLY, JNI_FALSE);
+ H5_ASSERTION_ERROR(ENVONLY, "Unable to append string.");
HDfree(this_str);
this_str = NULL;
@@ -1405,12 +1430,12 @@ h5str_print_region_data_blocks(JNIEnv *env, hid_t region_id, h5str_t *str, int n
for (numindex = 0; numindex < numelem; numindex++) {
if (!h5str_sprintf(ENVONLY, str, region_id, type_id, ((char *)region_buf + numindex * type_size),
- 0, 1))
+ 1))
CHECK_JNI_EXCEPTION(ENVONLY, JNI_FALSE);
if (numindex + 1 < numelem)
if (!h5str_append(str, ", "))
- CHECK_JNI_EXCEPTION(ENVONLY, JNI_FALSE);
+ H5_ASSERTION_ERROR(ENVONLY, "Unable to append string.");
} /* end for (jndx = 0; jndx < numelem; jndx++, region_elmtno++, ctx.cur_elmt++) */
} /* end for (blkndx = 0; blkndx < nblocks; blkndx++) */
@@ -1434,7 +1459,7 @@ done:
} /* end h5str_print_region_data_blocks */
int
-h5str_dump_region_blocks_data(JNIEnv *env, h5str_t *str, hid_t region, hid_t region_id)
+h5str_dump_region_blocks(JNIEnv *env, h5str_t *str, hid_t region_space, hid_t region_id, int expand_data)
{
hssize_t nblocks;
hsize_t alloc_size;
@@ -1443,32 +1468,34 @@ h5str_dump_region_blocks_data(JNIEnv *env, h5str_t *str, hid_t region, hid_t reg
hid_t type_id = H5I_INVALID_HID;
int ndims = -1;
int ret_value = FAIL;
+ int i;
+ char tmp_str[256];
/*
* This function fails if the region does not have blocks.
*/
H5E_BEGIN_TRY
{
- nblocks = H5Sget_select_hyper_nblocks(region);
+ nblocks = H5Sget_select_hyper_nblocks(region_space);
}
H5E_END_TRY;
- if (nblocks < 0)
- H5_LIBRARY_ERROR(ENVONLY);
-
- if ((ndims = H5Sget_simple_extent_ndims(region)) < 0)
+ if (nblocks <= 0) {
+ ret_value = SUCCEED;
+ goto done;
+ }
+ if ((ndims = H5Sget_simple_extent_ndims(region_space)) < 0)
H5_LIBRARY_ERROR(ENVONLY);
/* Print block information */
alloc_size = (hsize_t)nblocks * (hsize_t)ndims * 2 * (hsize_t)sizeof(ptdata[0]);
- if (alloc_size == (hsize_t)((size_t)alloc_size)) {
- if (NULL == (ptdata = (hsize_t *)HDmalloc((size_t)alloc_size)))
- H5_OUT_OF_MEMORY_ERROR(ENVONLY,
- "h5str_dump_region_blocks_data: failed to allocate region block buffer");
+ if (NULL == (ptdata = (hsize_t *)HDmalloc((size_t)alloc_size)))
+ H5_OUT_OF_MEMORY_ERROR(ENVONLY, "h5str_dump_region_blocks: failed to allocate region block buffer");
- if (H5Sget_select_hyper_blocklist(region, (hsize_t)0, (hsize_t)nblocks, ptdata) < 0)
- H5_LIBRARY_ERROR(ENVONLY);
+ if (H5Sget_select_hyper_blocklist(region_space, (hsize_t)0, (hsize_t)nblocks, ptdata) < 0)
+ H5_LIBRARY_ERROR(ENVONLY);
+ if (expand_data) {
if ((dtype = H5Dget_type(region_id)) < 0)
H5_LIBRARY_ERROR(ENVONLY);
@@ -1477,69 +1504,19 @@ h5str_dump_region_blocks_data(JNIEnv *env, h5str_t *str, hid_t region, hid_t reg
if (h5str_print_region_data_blocks(ENVONLY, region_id, str, ndims, type_id, nblocks, ptdata) < 0)
CHECK_JNI_EXCEPTION(ENVONLY, JNI_FALSE);
- } /* if (alloc_size == (hsize_t)((size_t)alloc_size)) */
-
- ret_value = SUCCEED;
-
-done:
- if (type_id >= 0)
- H5Tclose(type_id);
- if (dtype >= 0)
- H5Tclose(dtype);
- if (ptdata)
- HDfree(ptdata);
-
- return ret_value;
-} /* end h5str_dump_region_blocks_data */
-
-#ifndef SKIP_UNUSED_DUMP_ROUTINES
-static int
-h5str_dump_region_blocks(JNIEnv *env, h5str_t *str, hid_t region, hid_t region_id)
-{
- hssize_t nblocks;
- hsize_t alloc_size;
- hsize_t *ptdata = NULL;
- char tmp_str[256];
- int ndims = -1;
- int ret_value = FAIL;
-
- UNUSED(region_id);
-
- /*
- * This function fails if the region does not have blocks.
- */
- H5E_BEGIN_TRY
- {
- nblocks = H5Sget_select_hyper_nblocks(region);
}
- H5E_END_TRY;
-
- if (nblocks < 0)
- H5_LIBRARY_ERROR(ENVONLY);
-
- if ((ndims = H5Sget_simple_extent_ndims(region)) < 0)
- H5_LIBRARY_ERROR(ENVONLY);
-
- /* Print block information */
- alloc_size = (hsize_t)nblocks * (hsize_t)ndims * 2 * (hsize_t)sizeof(ptdata[0]);
- if (alloc_size == (hsize_t)((size_t)alloc_size)) {
- int i;
-
- if (NULL == (ptdata = (hsize_t *)HDmalloc((size_t)alloc_size)))
- H5_OUT_OF_MEMORY_ERROR(ENVONLY,
- "h5str_dump_region_blocks: failed to allocate region block buffer");
-
- if (H5Sget_select_hyper_blocklist(region, (hsize_t)0, (hsize_t)nblocks, ptdata) < 0)
- H5_LIBRARY_ERROR(ENVONLY);
+ else {
+ if (!h5str_append(str, " REGION_TYPE BLOCK"))
+ H5_ASSERTION_ERROR(ENVONLY, "Unable to append string.");
if (!h5str_append(str, " {"))
- CHECK_JNI_EXCEPTION(ENVONLY, JNI_FALSE);
+ H5_ASSERTION_ERROR(ENVONLY, "Unable to append string.");
for (i = 0; i < nblocks; i++) {
int j;
if (!h5str_append(str, " "))
- CHECK_JNI_EXCEPTION(ENVONLY, JNI_FALSE);
+ H5_ASSERTION_ERROR(ENVONLY, "Unable to append string.");
/* Start coordinates and opposite corner */
for (j = 0; j < ndims; j++) {
@@ -1549,7 +1526,7 @@ h5str_dump_region_blocks(JNIEnv *env, h5str_t *str, hid_t region, hid_t region_i
H5_JNI_FATAL_ERROR(ENVONLY, "h5str_dump_region_blocks: HDsprintf failure");
if (!h5str_append(str, tmp_str))
- CHECK_JNI_EXCEPTION(ENVONLY, JNI_FALSE);
+ H5_ASSERTION_ERROR(ENVONLY, "Unable to append string.");
}
for (j = 0; j < ndims; j++) {
@@ -1560,28 +1537,30 @@ h5str_dump_region_blocks(JNIEnv *env, h5str_t *str, hid_t region, hid_t region_i
H5_JNI_FATAL_ERROR(ENVONLY, "h5str_dump_region_blocks: HDsprintf failure");
if (!h5str_append(str, tmp_str))
- CHECK_JNI_EXCEPTION(ENVONLY, JNI_FALSE);
+ H5_ASSERTION_ERROR(ENVONLY, "Unable to append string.");
}
if (!h5str_append(str, ") "))
- CHECK_JNI_EXCEPTION(ENVONLY, JNI_FALSE);
+ H5_ASSERTION_ERROR(ENVONLY, "Unable to append string.");
tmp_str[0] = '\0';
}
if (!h5str_append(str, " }"))
- CHECK_JNI_EXCEPTION(ENVONLY, JNI_FALSE);
- } /* if (alloc_size == (hsize_t)((size_t)alloc_size)) */
-
+ H5_ASSERTION_ERROR(ENVONLY, "Unable to append string.");
+ }
ret_value = SUCCEED;
done:
+ if (type_id >= 0)
+ H5Tclose(type_id);
+ if (dtype >= 0)
+ H5Tclose(dtype);
if (ptdata)
HDfree(ptdata);
return ret_value;
} /* end h5str_dump_region_blocks */
-#endif
/*-------------------------------------------------------------------------
* Purpose: Print the data values from a dataset referenced by region points.
@@ -1634,12 +1613,12 @@ h5str_print_region_data_points(JNIEnv *env, hid_t region_space, hid_t region_id,
if (H5Sget_simple_extent_dims(mem_space, total_size, NULL) < 0)
H5_LIBRARY_ERROR(ENVONLY);
- if (!h5str_sprintf(ENVONLY, str, region_id, type_id, ((char *)region_buf + jndx * type_size), 0, 1))
+ if (!h5str_sprintf(ENVONLY, str, region_id, type_id, ((char *)region_buf + jndx * type_size), 1))
CHECK_JNI_EXCEPTION(ENVONLY, JNI_FALSE);
if (jndx + 1 < (size_t)npoints)
if (!h5str_append(str, ", "))
- CHECK_JNI_EXCEPTION(ENVONLY, JNI_FALSE);
+ H5_ASSERTION_ERROR(ENVONLY, "Unable to append string.");
} /* end for (jndx = 0; jndx < npoints; jndx++, elmtno++) */
ret_value = SUCCEED;
@@ -1656,146 +1635,96 @@ done:
} /* end h5str_print_region_data_points */
int
-h5str_dump_region_points_data(JNIEnv *env, h5str_t *str, hid_t region, hid_t region_id)
+h5str_dump_region_points(JNIEnv *env, h5str_t *str, hid_t region_space, hid_t region_id, int expand_data)
{
- hssize_t npoints;
hsize_t alloc_size;
+ hssize_t npoints = -1;
hsize_t *ptdata = NULL;
hid_t dtype = H5I_INVALID_HID;
hid_t type_id = H5I_INVALID_HID;
int ndims = -1;
int ret_value = FAIL;
+ int i;
+ char tmp_str[256];
/*
* This function fails if the region does not have points.
*/
H5E_BEGIN_TRY
{
- npoints = H5Sget_select_elem_npoints(region);
+ npoints = H5Sget_select_elem_npoints(region_space);
}
H5E_END_TRY;
- if (npoints < 0)
- H5_LIBRARY_ERROR(ENVONLY);
-
- if ((ndims = H5Sget_simple_extent_ndims(region)) < 0)
+ if (npoints <= 0) {
+ ret_value = SUCCEED;
+ goto done;
+ }
+ if ((ndims = H5Sget_simple_extent_ndims(region_space)) < 0)
H5_LIBRARY_ERROR(ENVONLY);
/* Print point information */
- if (npoints > 0) {
- alloc_size = (hsize_t)npoints * (hsize_t)ndims * (hsize_t)sizeof(ptdata[0]);
- if (alloc_size == (hsize_t)((size_t)alloc_size)) {
- if (NULL == (ptdata = (hsize_t *)HDmalloc((size_t)alloc_size)))
- H5_OUT_OF_MEMORY_ERROR(
- ENVONLY, "h5str_dump_region_points_data: failed to allocate region point data buffer");
-
- if (H5Sget_select_elem_pointlist(region, (hsize_t)0, (hsize_t)npoints, ptdata) < 0)
- H5_LIBRARY_ERROR(ENVONLY);
-
- if ((dtype = H5Dget_type(region_id)) < 0)
- H5_LIBRARY_ERROR(ENVONLY);
-
- if ((type_id = H5Tget_native_type(dtype, H5T_DIR_DEFAULT)) < 0)
- H5_LIBRARY_ERROR(ENVONLY);
-
- if (h5str_print_region_data_points(ENVONLY, region, region_id, str, ndims, type_id, npoints,
- ptdata) < 0)
- CHECK_JNI_EXCEPTION(ENVONLY, JNI_FALSE);
- }
- }
-
- ret_value = SUCCEED;
-
-done:
- if (type_id >= 0)
- H5Tclose(type_id);
- if (dtype >= 0)
- H5Tclose(dtype);
- if (ptdata)
- HDfree(ptdata);
-
- return ret_value;
-} /* end h5str_dump_region_points_data */
-
-#ifndef SKIP_UNUSED_DUMP_ROUTINES
-static int
-h5str_dump_region_points(JNIEnv *env, h5str_t *str, hid_t region, hid_t region_id)
-{
- hssize_t npoints;
- hsize_t alloc_size;
- hsize_t *ptdata = NULL;
- char tmp_str[256];
- int ndims = -1;
- int ret_value = FAIL;
-
- UNUSED(region_id);
-
- /*
- * This function fails if the region does not have points.
- */
- H5E_BEGIN_TRY
- {
- npoints = H5Sget_select_elem_npoints(region);
- }
- H5E_END_TRY;
-
- if (npoints < 0)
- H5_LIBRARY_ERROR(ENVONLY);
+ alloc_size = (hsize_t)npoints * (hsize_t)ndims * (hsize_t)sizeof(ptdata[0]);
+ if (NULL == (ptdata = (hsize_t *)HDmalloc((size_t)alloc_size)))
+ H5_OUT_OF_MEMORY_ERROR(ENVONLY,
+ "h5str_dump_region_points: failed to allocate region point data buffer");
- if ((ndims = H5Sget_simple_extent_ndims(region)) < 0)
+ if (H5Sget_select_elem_pointlist(region_space, (hsize_t)0, (hsize_t)npoints, ptdata) < 0)
H5_LIBRARY_ERROR(ENVONLY);
- /* Print point information */
- if (npoints > 0) {
- int i;
-
- alloc_size = (hsize_t)npoints * (hsize_t)ndims * (hsize_t)sizeof(ptdata[0]);
- if (alloc_size == (hsize_t)((size_t)alloc_size)) {
- if (NULL == (ptdata = (hsize_t *)HDmalloc((size_t)alloc_size)))
- H5_OUT_OF_MEMORY_ERROR(ENVONLY,
- "h5str_dump_region_points: failed to allocate region point buffer");
+ if (expand_data) {
+ if ((dtype = H5Dget_type(region_id)) < 0)
+ H5_LIBRARY_ERROR(ENVONLY);
- if (H5Sget_select_elem_pointlist(region, (hsize_t)0, (hsize_t)npoints, ptdata) < 0)
- H5_LIBRARY_ERROR(ENVONLY);
+ if ((type_id = H5Tget_native_type(dtype, H5T_DIR_DEFAULT)) < 0)
+ H5_LIBRARY_ERROR(ENVONLY);
- if (!h5str_append(str, " {"))
- CHECK_JNI_EXCEPTION(ENVONLY, JNI_FALSE);
+ if (h5str_print_region_data_points(ENVONLY, region_space, region_id, str, ndims, type_id, npoints,
+ ptdata) < 0)
+ CHECK_JNI_EXCEPTION(ENVONLY, JNI_FALSE);
+ }
+ else {
+ if (!h5str_append(str, " REGION_TYPE POINT"))
+ H5_ASSERTION_ERROR(ENVONLY, "Unable to append string.");
- for (i = 0; i < npoints; i++) {
- int j;
+ if (!h5str_append(str, " {"))
+ H5_ASSERTION_ERROR(ENVONLY, "Unable to append string.");
- if (!h5str_append(str, " "))
- CHECK_JNI_EXCEPTION(ENVONLY, JNI_FALSE);
+ for (i = 0; i < npoints; i++) {
+ int j;
- for (j = 0; j < ndims; j++) {
- tmp_str[0] = '\0';
+ if (!h5str_append(str, " "))
+ H5_ASSERTION_ERROR(ENVONLY, "Unable to append string.");
- if (HDsprintf(tmp_str, "%s%lu", j ? "," : "(", (unsigned long)(ptdata[i * ndims + j])) <
- 0)
- H5_JNI_FATAL_ERROR(ENVONLY, "h5str_dump_region_points: HDsprintf failure");
+ for (j = 0; j < ndims; j++) {
+ tmp_str[0] = '\0';
- if (!h5str_append(str, tmp_str))
- CHECK_JNI_EXCEPTION(ENVONLY, JNI_FALSE);
- } /* end for (j = 0; j < ndims; j++) */
+ if (HDsprintf(tmp_str, "%s%lu", j ? "," : "(", (unsigned long)(ptdata[i * ndims + j])) < 0)
+ H5_JNI_FATAL_ERROR(ENVONLY, "h5str_dump_region_points: HDsprintf failure");
- if (!h5str_append(str, ") "))
- CHECK_JNI_EXCEPTION(ENVONLY, JNI_FALSE);
- } /* end for (i = 0; i < npoints; i++) */
+ if (!h5str_append(str, tmp_str))
+ H5_ASSERTION_ERROR(ENVONLY, "Unable to append string.");
+ } /* end for (j = 0; j < ndims; j++) */
- if (!h5str_append(str, " }"))
- CHECK_JNI_EXCEPTION(ENVONLY, JNI_FALSE);
- } /* end if (alloc_size == (hsize_t)((size_t) alloc_size)) */
- } /* end if (npoints > 0) */
+ if (!h5str_append(str, ") "))
+ H5_ASSERTION_ERROR(ENVONLY, "Unable to append string.");
+ } /* end for (i = 0; i < npoints; i++) */
+ if (!h5str_append(str, " }"))
+ H5_ASSERTION_ERROR(ENVONLY, "Unable to append string.");
+ }
ret_value = SUCCEED;
done:
+ if (type_id >= 0)
+ H5Tclose(type_id);
+ if (dtype >= 0)
+ H5Tclose(dtype);
if (ptdata)
HDfree(ptdata);
return ret_value;
} /* end h5str_dump_region_points */
-#endif
static int
h5str_is_zero(const void *_mem, size_t size)
@@ -2312,47 +2241,31 @@ h5str_render_bin_output(FILE *stream, hid_t container, hid_t tid, void *_mem, hs
}
case H5T_REFERENCE: {
- if (H5Tequal(tid, H5T_STD_REF)) {
- hid_t region_id = H5I_INVALID_HID;
- hid_t region_space = H5I_INVALID_HID;
- H5S_sel_type region_type;
-
- /* Region data */
- for (block_index = 0; block_index < block_nelmts; block_index++) {
- mem = ((unsigned char *)_mem) + block_index * size;
- if ((region_id = H5Ropen_object((const H5R_ref_t *)mem, H5P_DEFAULT, H5P_DEFAULT)) < 0)
- continue;
- else {
- if ((region_space =
- H5Ropen_region((const H5R_ref_t *)mem, H5P_DEFAULT, H5P_DEFAULT)) >= 0) {
- if (!h5str_is_zero(mem, H5Tget_size(H5T_STD_REF))) {
- region_type = H5Sget_select_type(region_space);
- if (region_type == H5S_SEL_POINTS)
- ret_value = render_bin_output_region_points(stream, region_space,
- region_id, container);
- else
- ret_value = render_bin_output_region_blocks(stream, region_space,
- region_id, container);
- }
- H5Sclose(region_space);
- } /* end if (region_space >= 0) */
- H5Dclose(region_id);
- }
+ hid_t region_id = H5I_INVALID_HID;
+ hid_t region_space = H5I_INVALID_HID;
+ H5S_sel_type region_type;
- if ((region_type = H5Sget_select_type(region_space)) < 0) {
- H5Sclose(region_space);
- H5Dclose(region_id);
- continue;
+ /* Region data */
+ for (block_index = 0; block_index < block_nelmts; block_index++) {
+ mem = ((unsigned char *)_mem) + block_index * size;
+ if ((region_id = H5Ropen_object((H5R_ref_t *)mem, H5P_DEFAULT, H5P_DEFAULT)) < 0)
+ continue;
+ if ((region_space = H5Ropen_region((H5R_ref_t *)mem, H5P_DEFAULT, H5P_DEFAULT)) >= 0) {
+ if (!h5str_is_zero(mem, H5Tget_size(H5T_STD_REF))) {
+ region_type = H5Sget_select_type(region_space);
+ if (region_type == H5S_SEL_POINTS)
+ ret_value =
+ render_bin_output_region_points(stream, region_space, region_id, container);
+ else if (region_type == H5S_SEL_HYPERSLABS)
+ ret_value =
+ render_bin_output_region_blocks(stream, region_space, region_id, container);
}
- if (ret_value < 0)
- break;
- }
- }
- else if (H5Tequal(tid, H5T_STD_REF_DSETREG)) {
- ;
- }
- else if (H5Tequal(tid, H5T_STD_REF_OBJ)) {
- ;
+ H5Sclose(region_space);
+ } /* end if (region_space >= 0) */
+ H5Dclose(region_id);
+
+ if (ret_value < 0)
+ break;
}
break;
@@ -2723,6 +2636,109 @@ done:
return ret_value;
} /* end render_bin_output_region_points */
+/*-------------------------------------------------------------------------
+ * Purpose: Print some values from an attribute referenced by object reference.
+ *
+ * Parameters Description:
+ * FILE *buffer is the string into which to render
+ *-------------------------------------------------------------------------
+ */
+static int
+h5str_dump_region_attribute(JNIEnv *env, h5str_t *str, hid_t region_id)
+{
+ int ret_value = SUCCEED;
+ hid_t atype = H5I_INVALID_HID;
+ hid_t type_id = H5I_INVALID_HID;
+ hid_t region_space = H5I_INVALID_HID;
+ hsize_t total_size[H5S_MAX_RANK]; /* total size of dataset*/
+ size_t i; /* counter */
+ size_t size; /* datum size */
+ int sndims; /* rank of dataspace */
+ hsize_t p_nelmts; /* total selected elmts */
+ hsize_t alloc_size;
+
+ unsigned char *buf = NULL; /* buffer for raw data */
+
+ /* VL data special information */
+ unsigned int vl_data = 0; /* contains VL datatypes */
+
+ if ((region_space = H5Aget_space(region_id)) < 0) {
+ ret_value = FAIL;
+ goto done;
+ }
+
+ if ((sndims = H5Sget_simple_extent_ndims(region_space)) < 0) {
+ ret_value = FAIL;
+ goto done;
+ }
+
+ /* Assume entire data space to be read */
+ H5Sget_simple_extent_dims(region_space, total_size, NULL);
+ p_nelmts = 1;
+
+ for (i = 0; i < sndims; i++)
+ p_nelmts *= total_size[i];
+
+ if ((atype = H5Aget_type(region_id)) < 0) {
+ ret_value = FAIL;
+ goto done;
+ }
+ if ((type_id = H5Tget_native_type(atype, H5T_DIR_DEFAULT)) < 0) {
+ ret_value = FAIL;
+ goto done;
+ }
+
+ /* Check if we have VL data in the dataset's datatype */
+ if (h5str_detect_vlen(type_id) == TRUE)
+ vl_data = TRUE;
+
+ if (!(size = H5Tget_size(type_id))) {
+ ret_value = FAIL;
+ goto done;
+ }
+
+ alloc_size = p_nelmts * size;
+ HDassert(alloc_size == (hsize_t)((size_t)alloc_size)); /*check for overflow*/
+ if (NULL != (buf = (unsigned char *)HDmalloc((size_t)alloc_size))) {
+ /* Read the data */
+ if (H5Aread(region_id, type_id, buf) >= 0) {
+
+ for (i = 0; i < p_nelmts; i++) {
+ size_t bytes_in = 0; /* # of bytes to write */
+ void * memref = buf + i * size;
+
+ if (!(bytes_in = h5str_sprintf(ENVONLY, str, region_id, type_id, memref, 1)))
+ CHECK_JNI_EXCEPTION(ENVONLY, JNI_FALSE);
+
+ if ((i < p_nelmts - 1) && (bytes_in > 0)) {
+ if (!h5str_append(str, ", "))
+ H5_ASSERTION_ERROR(ENVONLY, "Unable to append string.");
+ }
+ }
+
+ /* Reclaim any VL memory, if necessary */
+ if (vl_data) {
+ if (H5Treclaim(type_id, region_space, H5P_DEFAULT, buf) < 0)
+ H5_LIBRARY_ERROR(ENVONLY);
+ }
+ }
+ else
+ H5_LIBRARY_ERROR(ENVONLY);
+ }
+
+done:
+ if (buf)
+ HDfree(buf);
+ if (region_space >= 0)
+ H5Sclose(region_space);
+ if (type_id >= 0)
+ H5Tclose(type_id);
+ if (atype >= 0)
+ H5Tclose(type_id);
+
+ return ret_value;
+}
+
int
h5str_dump_simple_dset(JNIEnv *env, FILE *stream, hid_t dset, int binary_order)
{
@@ -2739,11 +2755,11 @@ h5str_dump_simple_dset(JNIEnv *env, FILE *stream, hid_t dset, int binary_order)
size_t p_type_nbytes; /* size of memory type */
/* Stripmine info */
- unsigned char *sm_buf = NULL; /* buffer for raw data */
- 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 = H5I_INVALID_HID; /* stripmine data space */
+ void * sm_buf = NULL; /* buffer for raw data */
+ 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 = H5I_INVALID_HID; /* stripmine data space */
/* Hyperslab info */
hsize_t hs_offset[H5S_MAX_RANK]; /* starting offset */
@@ -2763,142 +2779,168 @@ h5str_dump_simple_dset(JNIEnv *env, FILE *stream, hid_t dset, int binary_order)
if ((f_type = H5Dget_type(dset)) < 0)
H5_LIBRARY_ERROR(ENVONLY);
- switch (binary_order) {
- case 1: {
- if ((p_type = h5str_get_native_type(f_type)) < 0)
- CHECK_JNI_EXCEPTION(ENVONLY, JNI_FALSE);
+ if ((f_space = H5Dget_space(dset)) < 0)
+ H5_LIBRARY_ERROR(ENVONLY);
- break;
- }
+ if ((ndims = H5Sget_simple_extent_ndims(f_space)) < 0)
+ H5_LIBRARY_ERROR(ENVONLY);
- case 2: {
- if ((p_type = h5str_get_little_endian_type(f_type)) < 0)
- CHECK_JNI_EXCEPTION(ENVONLY, JNI_FALSE);
+ if (H5Sget_simple_extent_dims(f_space, total_size, NULL) < 0)
+ H5_LIBRARY_ERROR(ENVONLY);
- break;
- }
+ if (H5Tequal(f_type, H5T_STD_REF_DSETREG)) {
+ p_nelmts = H5Sget_simple_extent_npoints(f_space);
+ if (NULL ==
+ (sm_buf = (H5R_ref_t *)HDcalloc(MAX(sizeof(unsigned), sizeof(H5R_ref_t)), (size_t)p_nelmts)))
+ H5_OUT_OF_MEMORY_ERROR(ENVONLY, "h5str_dump_simple_mem: failed to allocate sm_buf");
- case 3: {
- if ((p_type = h5str_get_big_endian_type(f_type)) < 0)
- CHECK_JNI_EXCEPTION(ENVONLY, JNI_FALSE);
+ /* Read the data */
+ if (H5Dread(dset, H5T_STD_REF, H5S_ALL, H5S_ALL, H5P_DEFAULT, sm_buf) < 0)
+ H5_LIBRARY_ERROR(ENVONLY);
- break;
+ if (binary_order == 99) {
+ if (h5str_dump_simple_data(ENVONLY, stream, dset, H5T_STD_REF, sm_buf, p_nelmts) < 0)
+ CHECK_JNI_EXCEPTION(ENVONLY, JNI_FALSE);
}
-
- default: {
- if ((p_type = H5Tcopy(f_type)) < 0)
- H5_LIBRARY_ERROR(ENVONLY);
-
- break;
+ else {
+ if (h5str_render_bin_output(stream, dset, H5T_STD_REF, sm_buf, p_nelmts) < 0)
+ CHECK_JNI_EXCEPTION(ENVONLY, JNI_FALSE);
}
}
+ else {
+ switch (binary_order) {
+ case 1: {
+ if ((p_type = h5str_get_native_type(f_type)) < 0)
+ CHECK_JNI_EXCEPTION(ENVONLY, JNI_FALSE);
- if ((f_space = H5Dget_space(dset)) < 0)
- H5_LIBRARY_ERROR(ENVONLY);
+ break;
+ }
- if ((ndims = H5Sget_simple_extent_ndims(f_space)) < 0)
- H5_LIBRARY_ERROR(ENVONLY);
+ case 2: {
+ if ((p_type = h5str_get_little_endian_type(f_type)) < 0)
+ CHECK_JNI_EXCEPTION(ENVONLY, JNI_FALSE);
- if ((size_t)ndims <= (sizeof(sm_size) / sizeof(sm_size[0]))) {
- if (H5Sget_simple_extent_dims(f_space, total_size, NULL) < 0)
- H5_LIBRARY_ERROR(ENVONLY);
+ break;
+ }
- /* Calculate the number of elements we're going to print */
- p_nelmts = 1;
+ case 3: {
+ if ((p_type = h5str_get_big_endian_type(f_type)) < 0)
+ CHECK_JNI_EXCEPTION(ENVONLY, JNI_FALSE);
- if (ndims > 0) {
- for (i = 0; i < (size_t)ndims; i++)
- p_nelmts *= total_size[i];
- } /* end if */
+ break;
+ }
+
+ default: {
+ if ((p_type = H5Tcopy(f_type)) < 0)
+ H5_LIBRARY_ERROR(ENVONLY);
- if (p_nelmts > 0) {
- /* Check if we have VL data in the dataset's datatype */
- if (h5str_detect_vlen(p_type) != 0)
- vl_data = 1;
+ break;
+ }
+ }
- /*
- * 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)))
+ if ((size_t)ndims <= (sizeof(sm_size) / sizeof(sm_size[0]))) {
+ if (H5Sget_simple_extent_dims(f_space, total_size, NULL) < 0)
H5_LIBRARY_ERROR(ENVONLY);
+ /* Calculate the number of elements we're going to print */
+ p_nelmts = 1;
+
if (ndims > 0) {
- for (i = (size_t)ndims; i > 0; --i) {
- hsize_t size = H5TOOLS_BUFSIZE / sm_nbytes;
- if (size == 0) /* datum size > H5TOOLS_BUFSIZE */
- size = 1;
- sm_size[i - 1] = (((total_size[i - 1]) < (size)) ? (total_size[i - 1]) : (size));
- sm_nbytes *= sm_size[i - 1];
+ for (i = 0; i < (size_t)ndims; i++)
+ p_nelmts *= total_size[i];
+ } /* end if */
+
+ if (p_nelmts > 0) {
+ /* Check if we have VL data in the dataset's datatype */
+ if (h5str_detect_vlen(p_type) != 0)
+ vl_data = 1;
+
+ /*
+ * 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)))
+ H5_LIBRARY_ERROR(ENVONLY);
+
+ if (ndims > 0) {
+ for (i = (size_t)ndims; i > 0; --i) {
+ hsize_t size = H5TOOLS_BUFSIZE / sm_nbytes;
+ if (size == 0) /* datum size > H5TOOLS_BUFSIZE */
+ size = 1;
+ sm_size[i - 1] = (((total_size[i - 1]) < (size)) ? (total_size[i - 1]) : (size));
+ sm_nbytes *= sm_size[i - 1];
+ }
}
- }
- if (sm_nbytes > 0) {
- if (NULL == (sm_buf = (unsigned char *)HDmalloc((size_t)sm_nbytes)))
- H5_OUT_OF_MEMORY_ERROR(ENVONLY, "h5str_dump_simple_dset: failed to allocate sm_buf");
+ if (sm_nbytes > 0) {
+ if (NULL == (sm_buf = (unsigned char *)HDmalloc((size_t)sm_nbytes)))
+ H5_OUT_OF_MEMORY_ERROR(ENVONLY, "h5str_dump_simple_dset: failed to allocate sm_buf");
- sm_nelmts = sm_nbytes / p_type_nbytes;
+ sm_nelmts = sm_nbytes / p_type_nbytes;
- if ((sm_space = H5Screate_simple(1, &sm_nelmts, NULL)) < 0)
- H5_LIBRARY_ERROR(ENVONLY);
+ if ((sm_space = H5Screate_simple(1, &sm_nelmts, NULL)) < 0)
+ H5_LIBRARY_ERROR(ENVONLY);
- /* 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 (ndims > 0) {
- for (i = 0, hs_nelmts = 1; i < (size_t)ndims; i++) {
- hs_size[i] = (((total_size[i] - hs_offset[i]) < (sm_size[i]))
- ? (total_size[i] - hs_offset[i])
- : (sm_size[i]));
- hs_nelmts *= hs_size[i];
- }
+ /* 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 (ndims > 0) {
+ for (i = 0, hs_nelmts = 1; i < (size_t)ndims; i++) {
+ hs_size[i] = (((total_size[i] - hs_offset[i]) < (sm_size[i]))
+ ? (total_size[i] - hs_offset[i])
+ : (sm_size[i]));
+ hs_nelmts *= hs_size[i];
+ }
- if (H5Sselect_hyperslab(f_space, H5S_SELECT_SET, hs_offset, NULL, hs_size, NULL) < 0)
- H5_LIBRARY_ERROR(ENVONLY);
+ if (H5Sselect_hyperslab(f_space, H5S_SELECT_SET, hs_offset, NULL, hs_size, NULL) <
+ 0)
+ H5_LIBRARY_ERROR(ENVONLY);
- if (H5Sselect_hyperslab(sm_space, H5S_SELECT_SET, zero, NULL, &hs_nelmts, NULL) < 0)
- H5_LIBRARY_ERROR(ENVONLY);
- }
- else {
- if (H5Sselect_all(f_space) < 0)
- H5_LIBRARY_ERROR(ENVONLY);
+ if (H5Sselect_hyperslab(sm_space, H5S_SELECT_SET, zero, NULL, &hs_nelmts, NULL) <
+ 0)
+ H5_LIBRARY_ERROR(ENVONLY);
+ }
+ else {
+ if (H5Sselect_all(f_space) < 0)
+ H5_LIBRARY_ERROR(ENVONLY);
- if (H5Sselect_all(sm_space) < 0)
- H5_LIBRARY_ERROR(ENVONLY);
+ if (H5Sselect_all(sm_space) < 0)
+ H5_LIBRARY_ERROR(ENVONLY);
- hs_nelmts = 1;
- }
+ hs_nelmts = 1;
+ }
- /* Read the data */
- if (H5Dread(dset, p_type, sm_space, f_space, H5P_DEFAULT, sm_buf) < 0)
- H5_LIBRARY_ERROR(ENVONLY);
+ /* Read the data */
+ if (H5Dread(dset, p_type, sm_space, f_space, H5P_DEFAULT, sm_buf) < 0)
+ H5_LIBRARY_ERROR(ENVONLY);
- if (binary_order == 99) {
- if (h5tools_dump_simple_data(ENVONLY, stream, dset, p_type, sm_buf, hs_nelmts) < 0)
- CHECK_JNI_EXCEPTION(ENVONLY, JNI_FALSE);
- }
- else {
- if (h5str_render_bin_output(stream, dset, p_type, sm_buf, hs_nelmts) < 0)
- CHECK_JNI_EXCEPTION(ENVONLY, JNI_FALSE);
- }
+ if (binary_order == 99) {
+ if (h5str_dump_simple_data(ENVONLY, stream, dset, p_type, sm_buf, hs_nelmts) < 0)
+ CHECK_JNI_EXCEPTION(ENVONLY, JNI_FALSE);
+ }
+ else {
+ if (h5str_render_bin_output(stream, dset, p_type, sm_buf, hs_nelmts) < 0)
+ CHECK_JNI_EXCEPTION(ENVONLY, JNI_FALSE);
+ }
- /* Reclaim any VL memory, if necessary */
- if (vl_data) {
- if (H5Treclaim(p_type, sm_space, H5P_DEFAULT, sm_buf) < 0)
- H5_LIBRARY_ERROR(ENVONLY);
- }
+ /* Reclaim any VL memory, if necessary */
+ if (vl_data) {
+ if (H5Treclaim(p_type, sm_space, H5P_DEFAULT, sm_buf) < 0)
+ H5_LIBRARY_ERROR(ENVONLY);
+ }
- /* Calculate the next hyperslab offset */
- for (i = (size_t)ndims, carry = 1; i > 0 && carry; --i) {
- hs_offset[i - 1] += hs_size[i - 1];
+ /* Calculate the next hyperslab offset */
+ for (i = (size_t)ndims, carry = 1; i > 0 && carry; --i) {
+ 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;
+ if (hs_offset[i - 1] == total_size[i - 1])
+ hs_offset[i - 1] = 0;
+ else
+ carry = 0;
+ }
}
}
}
@@ -2922,6 +2964,148 @@ done:
return ret_value;
} /* end h5str_dump_simple_dset */
+int
+h5str_dump_simple_mem(JNIEnv *env, FILE *stream, hid_t attr_id, int binary_order)
+{
+ hid_t f_space = H5I_INVALID_HID; /* file data space */
+ hsize_t alloc_size;
+ int ndims; /* rank of dataspace */
+ unsigned i; /* counters */
+ hsize_t total_size[H5S_MAX_RANK]; /* total size of dataset*/
+ hsize_t p_nelmts; /* total selected elmts */
+
+ void * sm_buf = NULL; /* buffer for raw data */
+ hsize_t sm_size[H5S_MAX_RANK]; /* stripmine size */
+
+ int ret_value = 0;
+
+ /* VL data special information */
+ unsigned int vl_data = 0; /* contains VL datatypes */
+ hid_t p_type = H5I_INVALID_HID;
+ hid_t f_type = H5I_INVALID_HID;
+
+ if (attr_id < 0)
+ H5_BAD_ARGUMENT_ERROR(ENVONLY, "h5str_dump_simple_mem: attr ID < 0");
+
+ if ((f_type = H5Aget_type(attr_id)) < 0)
+ H5_LIBRARY_ERROR(ENVONLY);
+
+ if (H5I_INVALID_HID == (f_space = H5Aget_space(attr_id)))
+ H5_LIBRARY_ERROR(ENVONLY);
+
+ if ((ndims = H5Sget_simple_extent_ndims(f_space)) < 0)
+ H5_LIBRARY_ERROR(ENVONLY);
+
+ if (H5Sget_simple_extent_dims(f_space, total_size, NULL) < 0)
+ H5_LIBRARY_ERROR(ENVONLY);
+
+ if (H5Tequal(f_type, H5T_STD_REF_DSETREG)) {
+ p_nelmts = H5Sget_simple_extent_npoints(f_space);
+ if (NULL ==
+ (sm_buf = (H5R_ref_t *)HDcalloc(MAX(sizeof(unsigned), sizeof(H5R_ref_t)), (size_t)p_nelmts)))
+ H5_OUT_OF_MEMORY_ERROR(ENVONLY, "h5str_dump_simple_mem: failed to allocate sm_buf");
+
+ /* Read the data */
+ if (H5Aread(attr_id, H5T_STD_REF, sm_buf) < 0)
+ H5_LIBRARY_ERROR(ENVONLY);
+
+ if (binary_order == 99) {
+ if (h5str_dump_simple_data(ENVONLY, stream, attr_id, H5T_STD_REF, sm_buf, p_nelmts) < 0)
+ CHECK_JNI_EXCEPTION(ENVONLY, JNI_FALSE);
+ }
+ else {
+ if (h5str_render_bin_output(stream, attr_id, H5T_STD_REF, sm_buf, p_nelmts) < 0)
+ CHECK_JNI_EXCEPTION(ENVONLY, JNI_FALSE);
+ }
+ }
+ else {
+ switch (binary_order) {
+ case 1: {
+ if ((p_type = h5str_get_native_type(f_type)) < 0)
+ CHECK_JNI_EXCEPTION(ENVONLY, JNI_FALSE);
+
+ break;
+ }
+
+ case 2: {
+ if ((p_type = h5str_get_little_endian_type(f_type)) < 0)
+ CHECK_JNI_EXCEPTION(ENVONLY, JNI_FALSE);
+
+ break;
+ }
+
+ case 3: {
+ if ((p_type = h5str_get_big_endian_type(f_type)) < 0)
+ CHECK_JNI_EXCEPTION(ENVONLY, JNI_FALSE);
+
+ break;
+ }
+
+ default: {
+ if ((p_type = H5Tcopy(f_type)) < 0)
+ H5_LIBRARY_ERROR(ENVONLY);
+
+ break;
+ }
+ }
+
+ if ((size_t)ndims <= (sizeof(sm_size) / sizeof(sm_size[0]))) {
+ if (H5Sget_simple_extent_dims(f_space, total_size, NULL) < 0)
+ H5_LIBRARY_ERROR(ENVONLY);
+ /* Calculate the number of elements we're going to print */
+ p_nelmts = 1;
+
+ if (ndims > 0) {
+ for (i = 0; i < (size_t)ndims; i++)
+ p_nelmts *= total_size[i];
+ } /* end if */
+
+ if (p_nelmts > 0) {
+ /* Check if we have VL data in the dataset's datatype */
+ if (h5str_detect_vlen(p_type) != 0)
+ vl_data = 1;
+
+ alloc_size = p_nelmts * H5Tget_size(p_type);
+ if (NULL == (sm_buf = (unsigned char *)HDmalloc((size_t)alloc_size)))
+ H5_OUT_OF_MEMORY_ERROR(ENVONLY, "h5str_dump_simple_mem: failed to allocate sm_buf");
+
+ /* Read the data */
+ if (H5Aread(attr_id, p_type, sm_buf) < 0)
+ H5_LIBRARY_ERROR(ENVONLY);
+
+ if (binary_order == 99) {
+ if (h5str_dump_simple_data(ENVONLY, stream, attr_id, p_type, sm_buf, p_nelmts) < 0)
+ CHECK_JNI_EXCEPTION(ENVONLY, JNI_FALSE);
+ }
+ else {
+ if (h5str_render_bin_output(stream, attr_id, p_type, sm_buf, p_nelmts) < 0)
+ CHECK_JNI_EXCEPTION(ENVONLY, JNI_FALSE);
+ }
+
+ /* Reclaim any VL memory, if necessary */
+ if (vl_data) {
+ if (H5Treclaim(p_type, f_space, H5P_DEFAULT, sm_buf) < 0)
+ H5_LIBRARY_ERROR(ENVONLY);
+ }
+ }
+ }
+ }
+
+ ret_value = SUCCEED;
+
+done:
+ if (sm_buf)
+ HDfree(sm_buf);
+ if (f_space >= 0)
+ H5Sclose(f_space);
+ if (p_type >= 0)
+ H5Tclose(p_type);
+ if (f_type >= 0)
+ H5Tclose(f_type);
+
+ return ret_value;
+}
+
htri_t
H5Tdetect_variable_str(hid_t tid)
{
@@ -2948,7 +3132,7 @@ H5Tdetect_variable_str(hid_t tid)
} /* end H5Tdetect_variable_str */
static int
-h5tools_dump_simple_data(JNIEnv *env, FILE *stream, hid_t container, hid_t type, void *_mem, hsize_t nelmts)
+h5str_dump_simple_data(JNIEnv *env, FILE *stream, hid_t container, hid_t type, void *_mem, hsize_t nelmts)
{
unsigned char *mem = (unsigned char *)_mem;
h5str_t buffer; /* string into which to render */
@@ -2968,38 +3152,37 @@ h5tools_dump_simple_data(JNIEnv *env, FILE *stream, hid_t container, hid_t type,
h5str_new(&buffer, 32 * size);
if (!buffer.s)
- H5_OUT_OF_MEMORY_ERROR(ENVONLY, "h5tools_dump_simple_data: failed to allocate buffer");
+ H5_OUT_OF_MEMORY_ERROR(ENVONLY, "h5str_dump_simple_data: failed to allocate buffer");
- if (!(bytes_in = h5str_sprintf(ENVONLY, &buffer, container, type, memref, 0, 1)))
+ if (!(bytes_in = h5str_sprintf(ENVONLY, &buffer, container, type, memref, 1)))
CHECK_JNI_EXCEPTION(ENVONLY, JNI_FALSE);
- if (i > 0) {
+ if ((i > 0) && (bytes_in > 0)) {
if (HDfprintf(stream, ", ") < 0)
- H5_JNI_FATAL_ERROR(ENVONLY, "h5tools_dump_simple_data: HDfprintf failure");
+ H5_JNI_FATAL_ERROR(ENVONLY, "h5str_dump_simple_data: HDfprintf failure");
if (line_count >= H5TOOLS_TEXT_BLOCK) {
line_count = 0;
if (HDfprintf(stream, "\n") < 0)
- H5_JNI_FATAL_ERROR(ENVONLY, "h5tools_dump_simple_data: HDfprintf failure");
+ H5_JNI_FATAL_ERROR(ENVONLY, "h5str_dump_simple_data: HDfprintf failure");
}
}
-
if (HDfprintf(stream, "%s", buffer.s) < 0)
- H5_JNI_FATAL_ERROR(ENVONLY, "h5tools_dump_simple_data: HDfprintf failure");
+ H5_JNI_FATAL_ERROR(ENVONLY, "h5str_dump_simple_data: HDfprintf failure");
h5str_free(&buffer);
} /* end for (i = 0; i < nelmts... */
if (HDfprintf(stream, "\n") < 0)
- H5_JNI_FATAL_ERROR(ENVONLY, "h5tools_dump_simple_data: HDfprintf failure");
+ H5_JNI_FATAL_ERROR(ENVONLY, "h5str_dump_simple_data: HDfprintf failure");
done:
if (buffer.s)
h5str_free(&buffer);
return ret_value;
-} /* end h5tools_dump_simple_data */
+} /* end h5str_dump_simple_data */
/*
* Utility Java APIs
@@ -3053,7 +3236,7 @@ Java_hdf_hdf5lib_H5_H5AreadComplex(JNIEnv *env, jclass clss, jlong attr_id, jlon
for (i = 0; i < (size_t)n; i++) {
h5str.s[0] = '\0';
- if (!h5str_sprintf(ENVONLY, &h5str, attr_id, mem_type_id, readBuf + (i * size), 0, 0))
+ if (!h5str_sprintf(ENVONLY, &h5str, attr_id, mem_type_id, readBuf + (i * size), 0))
CHECK_JNI_EXCEPTION(ENVONLY, JNI_FALSE);
if (NULL == (jstr = ENVPTR->NewStringUTF(ENVONLY, h5str.s)))
@@ -3554,18 +3737,16 @@ done:
/*
* Class: hdf_hdf5lib_H5
* Method: H5export_dataset
- * Signature: (Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;I)V
+ * Signature: (Ljava/lang/String;JLjava/lang/String;I)V
*/
JNIEXPORT void JNICALL
-Java_hdf_hdf5lib_H5_H5export_1dataset(JNIEnv *env, jclass clss, jstring file_export_name, jstring file_name,
+Java_hdf_hdf5lib_H5_H5export_1dataset(JNIEnv *env, jclass clss, jstring file_export_name, jlong file_id,
jstring object_path, jint binary_order)
{
const char *file_export = NULL;
const char *object_name = NULL;
- const char *fileName = NULL;
jboolean isCopy;
herr_t ret_val = FAIL;
- hid_t file_id = H5I_INVALID_HID;
hid_t dataset_id = H5I_INVALID_HID;
FILE * stream = NULL;
@@ -3574,17 +3755,9 @@ Java_hdf_hdf5lib_H5_H5export_1dataset(JNIEnv *env, jclass clss, jstring file_exp
if (NULL == file_export_name)
H5_NULL_ARGUMENT_ERROR(ENVONLY, "H5export_dataset: file_export_name is NULL");
- if (NULL == file_name)
- H5_NULL_ARGUMENT_ERROR(ENVONLY, "H5export_dataset: file_name is NULL");
-
if (NULL == object_path)
H5_NULL_ARGUMENT_ERROR(ENVONLY, "H5export_dataset: object_path is NULL");
- PIN_JAVA_STRING(ENVONLY, file_name, fileName, NULL, "H5export_dataset: file name not pinned");
-
- if ((file_id = H5Fopen(fileName, (unsigned)H5F_ACC_RDWR, (hid_t)H5P_DEFAULT)) < 0)
- H5_LIBRARY_ERROR(ENVONLY);
-
PIN_JAVA_STRING(ENVONLY, object_path, object_name, &isCopy, "H5export_dataset: object_path not pinned");
if ((dataset_id = H5Dopen2(file_id, object_name, H5P_DEFAULT)) < 0)
@@ -3597,7 +3770,7 @@ Java_hdf_hdf5lib_H5_H5export_1dataset(JNIEnv *env, jclass clss, jstring file_exp
H5_JNI_FATAL_ERROR(ENVONLY, "HDfopen failed");
if ((ret_val = h5str_dump_simple_dset(ENVONLY, stream, dataset_id, binary_order)) < 0)
- H5_JNI_FATAL_ERROR(ENVONLY, "h5str_dump_simple_dset failed");
+ H5_ASSERTION_ERROR(ENVONLY, "h5str_dump_simple_dset failed");
if (stream) {
HDfclose(stream);
@@ -3611,14 +3784,65 @@ done:
UNPIN_JAVA_STRING(ENVONLY, file_export_name, file_export);
if (object_name)
UNPIN_JAVA_STRING(ENVONLY, object_path, object_name);
- if (fileName)
- UNPIN_JAVA_STRING(ENVONLY, file_name, fileName);
if (dataset_id >= 0)
H5Dclose(dataset_id);
- if (file_id >= 0)
- H5Fclose(file_id);
} /* end Java_hdf_hdf5lib_H5_H5export_1dataset */
+/*
+ * Class: hdf_hdf5lib_H5
+ * Method: H5export_attribute
+ * Signature: (Ljava/lang/String;JLjava/lang/String;I)V
+ */
+JNIEXPORT void JNICALL
+Java_hdf_hdf5lib_H5_H5export_1attribute(JNIEnv *env, jclass clss, jstring file_export_name, jlong dset_id,
+ jstring attribute_name, jint binary_order)
+{
+ const char *file_export = NULL;
+ const char *object_name = NULL;
+ jboolean isCopy;
+ herr_t ret_val = FAIL;
+ hid_t attr_id = H5I_INVALID_HID;
+ FILE * stream = NULL;
+
+ UNUSED(clss);
+
+ if (NULL == file_export_name)
+ H5_NULL_ARGUMENT_ERROR(ENVONLY, "H5export_dataset: file_export_name is NULL");
+
+ if (NULL == attribute_name)
+ H5_NULL_ARGUMENT_ERROR(ENVONLY, "H5export_dataset: object_path is NULL");
+
+ PIN_JAVA_STRING(ENVONLY, attribute_name, object_name, &isCopy,
+ "H5export_dataset: object_path not pinned");
+
+ if ((attr_id = H5Aopen(dset_id, object_name, H5P_DEFAULT)) < 0)
+ H5_LIBRARY_ERROR(ENVONLY);
+
+ PIN_JAVA_STRING(ENVONLY, file_export_name, file_export, NULL,
+ "H5export_dataset: file_export name not pinned");
+
+ if (NULL == (stream = HDfopen(file_export, "w+")))
+ H5_JNI_FATAL_ERROR(ENVONLY, "HDfopen failed");
+
+ if ((ret_val = h5str_dump_simple_mem(ENVONLY, stream, attr_id, binary_order)) < 0)
+ H5_ASSERTION_ERROR(ENVONLY, "h5str_dump_simple_dset failed");
+
+ if (stream) {
+ HDfclose(stream);
+ stream = NULL;
+ }
+
+done:
+ if (stream)
+ HDfclose(stream);
+ if (file_export)
+ UNPIN_JAVA_STRING(ENVONLY, file_export_name, file_export);
+ if (object_name)
+ UNPIN_JAVA_STRING(ENVONLY, attribute_name, object_name);
+ if (attr_id >= 0)
+ H5Aclose(attr_id);
+} /* end Java_hdf_hdf5lib_H5_H5export_1attribute */
+
#ifdef __cplusplus
}
#endif
diff --git a/java/src/jni/h5util.h b/java/src/jni/h5util.h
index 4b79eda..6c568e1 100644
--- a/java/src/jni/h5util.h
+++ b/java/src/jni/h5util.h
@@ -41,13 +41,12 @@ extern void h5str_resize(h5str_t *str, size_t new_len);
extern char * h5str_append(h5str_t *str, const char *cstr);
extern size_t h5str_convert(JNIEnv *env, char **in_str, hid_t container, hid_t tid, void *out_buf,
size_t out_buf_offset);
-extern void h5str_sprint_reference(JNIEnv *env, h5str_t *out_str, hid_t container, void *ref_p);
+extern int h5str_sprint_reference(JNIEnv *env, h5str_t *out_str, void *ref_p);
extern size_t h5str_sprintf(JNIEnv *env, h5str_t *out_str, hid_t container, hid_t tid, void *in_buf,
- size_t in_buf_len, int expand_data);
+ int expand_data);
extern void h5str_array_free(char **strs, size_t len);
extern int h5str_dump_simple_dset(JNIEnv *env, FILE *stream, hid_t dset, int binary_order);
-extern int h5str_dump_region_blocks_data(JNIEnv *env, h5str_t *str, hid_t region, hid_t region_obj);
-extern int h5str_dump_region_points_data(JNIEnv *env, h5str_t *str, hid_t region, hid_t region_obj);
+extern int h5str_dump_simple_mem(JNIEnv *env, FILE *stream, hid_t attr, int binary_order);
extern htri_t H5Tdetect_variable_str(hid_t tid);
@@ -107,9 +106,16 @@ JNIEXPORT jint JNICALL Java_hdf_hdf5lib_H5_H5Gget_1obj_1info_1max(JNIEnv *, jcla
/*
* Class: hdf_hdf5lib_H5
* Method: H5export_dataset
- * Signature: (Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;I)V
+ * Signature: (Ljava/lang/String;JLjava/lang/String;I)V
*/
-JNIEXPORT void JNICALL Java_hdf_hdf5lib_H5_H5export_1dataset(JNIEnv *, jclass, jstring, jstring, jstring,
- jint);
+JNIEXPORT void JNICALL Java_hdf_hdf5lib_H5_H5export_1dataset(JNIEnv *, jclass, jstring, jlong, jstring, jint);
+
+/*
+ * Class: hdf_hdf5lib_H5
+ * Method: H5export_attribute
+ * Signature: (Ljava/lang/String;JLjava/lang/String;I)V
+ */
+JNIEXPORT void JNICALL Java_hdf_hdf5lib_H5_H5export_1attribute(JNIEnv *, jclass, jstring, jlong, jstring,
+ jint);
#endif /* H5UTIL_H__ */
diff --git a/java/src/jni/h5vlImp.c b/java/src/jni/h5vlImp.c
index 9b48d21..40f8863 100644
--- a/java/src/jni/h5vlImp.c
+++ b/java/src/jni/h5vlImp.c
@@ -1,6 +1,5 @@
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* 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 *
diff --git a/java/src/jni/h5vlImp.h b/java/src/jni/h5vlImp.h
index 70c5006..a17807f 100644
--- a/java/src/jni/h5vlImp.h
+++ b/java/src/jni/h5vlImp.h
@@ -1,6 +1,5 @@
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* 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 *
@@ -14,8 +13,8 @@
#include <jni.h>
/* Header for class hdf_hdf5lib_H5_H5VL */
-#ifndef _Included_hdf_hdf5lib_H5_H5VL
-#define _Included_hdf_hdf5lib_H5_H5VL
+#ifndef Included_hdf_hdf5lib_H5_H5VL
+#define Included_hdf_hdf5lib_H5_H5VL
#ifdef __cplusplus
extern "C" {
@@ -98,4 +97,4 @@ JNIEXPORT void JNICALL Java_hdf_hdf5lib_H5_H5VLunregister_1connector(JNIEnv *, j
} /* end extern "C" */
#endif /* __cplusplus */
-#endif /* _Included_hdf_hdf5lib_H5_H5VL */
+#endif /* Included_hdf_hdf5lib_H5_H5VL */
diff --git a/java/src/jni/h5zImp.h b/java/src/jni/h5zImp.h
index 924776c..3092ae6 100644
--- a/java/src/jni/h5zImp.h
+++ b/java/src/jni/h5zImp.h
@@ -1,6 +1,5 @@
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* 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 *
@@ -14,8 +13,8 @@
#include <jni.h>
/* Header for class hdf_hdf5lib_H5_H5Z */
-#ifndef _Included_hdf_hdf5lib_H5_H5Z
-#define _Included_hdf_hdf5lib_H5_H5Z
+#ifndef Included_hdf_hdf5lib_H5_H5Z
+#define Included_hdf_hdf5lib_H5_H5Z
#ifdef __cplusplus
extern "C" {
@@ -47,4 +46,4 @@ JNIEXPORT jint JNICALL Java_hdf_hdf5lib_H5_H5Zget_1filter_1info(JNIEnv *, jclass
} /* end extern "C" */
#endif /* __cplusplus */
-#endif /* _Included_hdf_hdf5lib_H5_H5Z */
+#endif /* Included_hdf_hdf5lib_H5_H5Z */
diff --git a/java/src/jni/nativeData.h b/java/src/jni/nativeData.h
index 398dfc9..9bf313f 100644
--- a/java/src/jni/nativeData.h
+++ b/java/src/jni/nativeData.h
@@ -1,6 +1,5 @@
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* 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 *
@@ -14,8 +13,8 @@
#include <jni.h>
/* Header for class hdf_hdf5lib_HDFNativeData */
-#ifndef _Included_hdf_hdf5lib_HDFNativeData
-#define _Included_hdf_hdf5lib_HDFNativeData
+#ifndef Included_hdf_hdf5lib_HDFNativeData
+#define Included_hdf_hdf5lib_HDFNativeData
#ifdef __cplusplus
extern "C" {
@@ -98,4 +97,4 @@ JNIEXPORT jbyteArray JNICALL Java_hdf_hdf5lib_HDFNativeData_byteToByte__B(JNIEnv
} /* end extern "C" */
#endif /* __cplusplus */
-#endif /* _Included_hdf_hdf5lib_HDFNativeData */
+#endif /* Included_hdf_hdf5lib_HDFNativeData */
diff --git a/java/test/CMakeLists.txt b/java/test/CMakeLists.txt
index 66991c4..ffaf5f5 100644
--- a/java/test/CMakeLists.txt
+++ b/java/test/CMakeLists.txt
@@ -23,16 +23,19 @@ set (HDF5_JAVA_TEST_SOURCES
TestH5Dparams
TestH5D
TestH5Dplist
+ TestH5Drw
TestH5Lparams
TestH5Lbasic
TestH5Lcreate
TestH5R
+ TestH5Rref
TestH5P
TestH5PData
TestH5Pfapl
TestH5Pvirtual
TestH5Plist
TestH5A
+ TestH5Arw
TestH5Oparams
TestH5Obasic
TestH5Ocreate
@@ -93,6 +96,12 @@ HDFTEST_COPY_FILE("${PROJECT_SOURCE_DIR}/h5ex_g_iterate.orig" "${PROJECT_BINARY_
HDFTEST_COPY_FILE("${PROJECT_SOURCE_DIR}/h5ex_g_iterate.orig" "${PROJECT_BINARY_DIR}/h5ex_g_iterateL2.hdf" "${HDF5_JAVA_TEST_LIB_TARGET}_files")
HDFTEST_COPY_FILE("${PROJECT_SOURCE_DIR}/h5ex_g_iterate.orig" "${PROJECT_BINARY_DIR}/h5ex_g_iterateO1.hdf" "${HDF5_JAVA_TEST_LIB_TARGET}_files")
HDFTEST_COPY_FILE("${PROJECT_SOURCE_DIR}/h5ex_g_iterate.orig" "${PROJECT_BINARY_DIR}/h5ex_g_iterateO2.hdf" "${HDF5_JAVA_TEST_LIB_TARGET}_files")
+HDFTEST_COPY_FILE("${HDF5_TOOLS_DIR}/testfiles/trefer_reg.h5" "${PROJECT_BINARY_DIR}/trefer_reg.h5" "${HDF5_JAVA_TEST_LIB_TARGET}_files")
+HDFTEST_COPY_FILE("${HDF5_TOOLS_DIR}/testfiles/trefer_attr.h5" "${PROJECT_BINARY_DIR}/trefer_attr.h5" "${HDF5_JAVA_TEST_LIB_TARGET}_files")
+HDFTEST_COPY_FILE("${HDF5_TOOLS_DIR}/testfiles/tdatareg.h5" "${PROJECT_BINARY_DIR}/tdatareg.h5" "${HDF5_JAVA_TEST_LIB_TARGET}_files")
+HDFTEST_COPY_FILE("${HDF5_TOOLS_DIR}/testfiles/tattrreg.h5" "${PROJECT_BINARY_DIR}/tattrreg.h5" "${HDF5_JAVA_TEST_LIB_TARGET}_files")
+HDFTEST_COPY_FILE("${HDF5_TOOLS_DIR}/testfiles/tintsattrs.h5" "${PROJECT_BINARY_DIR}/tintsattrs.h5" "${HDF5_JAVA_TEST_LIB_TARGET}_files")
+HDFTEST_COPY_FILE("${HDF5_TOOLS_DIR}/testfiles/tfloatsattrs.h5" "${PROJECT_BINARY_DIR}/tfloatsattrs.h5" "${HDF5_JAVA_TEST_LIB_TARGET}_files")
add_custom_target(${HDF5_JAVA_TEST_LIB_TARGET}_files ALL COMMENT "Copying files needed by ${HDF5_JAVA_TEST_LIB_TARGET} tests" DEPENDS ${${HDF5_JAVA_TEST_LIB_TARGET}_files_list})
@@ -208,6 +217,12 @@ if (HDF5_TEST_JAVA AND HDF5_TEST_SERIAL)
HDFTEST_COPY_FILE("${PROJECT_SOURCE_DIR}/h5ex_g_iterate.orig" "${PROJECT_BINARY_DIR}/${voltest}/h5ex_g_iterateL2.hdf" "${HDF5_JAVA_TEST_LIB_TARGET}_${voltest}_files")
HDFTEST_COPY_FILE("${PROJECT_SOURCE_DIR}/h5ex_g_iterate.orig" "${PROJECT_BINARY_DIR}/${voltest}/h5ex_g_iterateO1.hdf" "${HDF5_JAVA_TEST_LIB_TARGET}_${voltest}_files")
HDFTEST_COPY_FILE("${PROJECT_SOURCE_DIR}/h5ex_g_iterate.orig" "${PROJECT_BINARY_DIR}/${voltest}/h5ex_g_iterateO2.hdf" "${HDF5_JAVA_TEST_LIB_TARGET}_${voltest}_files")
+ HDFTEST_COPY_FILE("${HDF5_TOOLS_DIR}/testfiles/trefer_reg.h5" "${PROJECT_BINARY_DIR}/${voltest}/trefer_reg.h5" "${HDF5_JAVA_TEST_LIB_TARGET}_${voltest}_files")
+ HDFTEST_COPY_FILE("${HDF5_TOOLS_DIR}/testfiles/trefer_attr.h5" "${PROJECT_BINARY_DIR}/${voltest}/trefer_attr.h5" "${HDF5_JAVA_TEST_LIB_TARGET}_${voltest}_files")
+ HDFTEST_COPY_FILE("${HDF5_TOOLS_DIR}/testfiles/tdatareg.h5" "${PROJECT_BINARY_DIR}/${voltest}/tdatareg.h5" "${HDF5_JAVA_TEST_LIB_TARGET}_${voltest}_files")
+ HDFTEST_COPY_FILE("${HDF5_TOOLS_DIR}/testfiles/tattrreg.h5" "${PROJECT_BINARY_DIR}/${voltest}/tattrreg.h5" "${HDF5_JAVA_TEST_LIB_TARGET}_${voltest}_files")
+ HDFTEST_COPY_FILE("${HDF5_TOOLS_DIR}/testfiles/tintsattrs.h5" "${PROJECT_BINARY_DIR}/${voltest}/tintsattrs.h5" "${HDF5_JAVA_TEST_LIB_TARGET}_${voltest}_files")
+ HDFTEST_COPY_FILE("${HDF5_TOOLS_DIR}/testfiles/tfloatsattrs.h5" "${PROJECT_BINARY_DIR}/${voltest}/tfloatsattrs.h5" "${HDF5_JAVA_TEST_LIB_TARGET}_${voltest}_files")
add_custom_target(${HDF5_JAVA_TEST_LIB_TARGET}_${voltest}_files ALL COMMENT "Copying files needed by ${HDF5_JAVA_TEST_LIB_TARGET} tests" DEPENDS ${${HDF5_JAVA_TEST_LIB_TARGET}_${voltest}_files_list})
diff --git a/java/test/Makefile.am b/java/test/Makefile.am
index 83b4188..ac3b619 100644
--- a/java/test/Makefile.am
+++ b/java/test/Makefile.am
@@ -52,11 +52,13 @@ noinst_JAVA = \
TestH5T.java \
TestH5Dparams.java \
TestH5D.java \
+ TestH5Drw.java \
TestH5Dplist.java \
TestH5Lparams.java \
TestH5Lbasic.java \
TestH5Lcreate.java \
TestH5R.java \
+ TestH5Rref.java \
TestH5P.java \
TestH5PData.java \
TestH5Pfapl.java \
@@ -65,6 +67,7 @@ noinst_JAVA = \
TestH5Pvirtual.java \
TestH5Plist.java \
TestH5A.java \
+ TestH5Arw.java \
TestH5Oparams.java \
TestH5Obasic.java \
TestH5Ocreate.java \
diff --git a/java/test/TestAll.java b/java/test/TestAll.java
index a59e990..16414e4 100644
--- a/java/test/TestAll.java
+++ b/java/test/TestAll.java
@@ -1,6 +1,5 @@
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* 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 *
@@ -23,12 +22,12 @@ import org.junit.runners.Suite;
TestH5Gbasic.class, TestH5G.class, TestH5Giterate.class,
TestH5Sbasic.class, TestH5S.class,
TestH5Tparams.class, TestH5Tbasic.class, TestH5T.class,
- TestH5Dparams.class, TestH5D.class, TestH5Dplist.class,
+ TestH5Dparams.class, TestH5D.class, TestH5Dplist.class, TestH5Drw.class,
TestH5Lparams.class, TestH5Lbasic.class, TestH5Lcreate.class,
- TestH5R.class,
+ TestH5R.class, TestH5Rref.class,
TestH5P.class, TestH5PData.class, TestH5Pfapl.class, TestH5Pvirtual.class, TestH5Plist.class,
TestH5Pfapls3.class, TestH5Pfaplhdfs.class,
- TestH5A.class,
+ TestH5A.class, TestH5Arw.class,
TestH5Oparams.class, TestH5Obasic.class, TestH5Ocopy.class, TestH5Ocreate.class,
TestH5PL.class, TestH5Z.class
})
diff --git a/java/test/TestH5.java b/java/test/TestH5.java
index 717d323..1f298f3 100644
--- a/java/test/TestH5.java
+++ b/java/test/TestH5.java
@@ -1,6 +1,5 @@
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* 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 *
@@ -32,6 +31,7 @@ import java.io.StreamTokenizer;
import hdf.hdf5lib.H5;
import hdf.hdf5lib.HDF5Constants;
+import hdf.hdf5lib.exceptions.HDF5Exception;
import hdf.hdf5lib.exceptions.HDF5LibraryException;
import org.junit.After;
@@ -47,22 +47,25 @@ import org.junit.rules.TestName;
*/
public class TestH5 {
@Rule public TestName testname = new TestName();
- @Before
- public void showTestName() {
- System.out.print(testname.getMethodName());
- }
- @After
- public void nextTestName() {
- System.out.println();
- }
private static final String H5_FILE = "testData.h5";
private static final String EXPORT_FILE = "testExport.txt";
+ private static final String H5_REGION_FILE = "trefer_reg.h5";
+ private static final String EXPORT_REGION_FILE = "testExportReg.txt";
+ private static final String H5_ATTR_FILE = "trefer_attr.h5";
+ private static final String EXPORT_ATTR_FILE = "testExportAttr.txt";
+ private static final String H5_DREG_FILE = "tdatareg.h5";
+ private static final String EXPORT_DREG_FILE = "testExportDReg.txt";
+ private static final String H5_AREG_FILE = "tattrreg.h5";
+ private static final String EXPORT_AREG_FILE = "testExportAReg.txt";
private static final int DIM_X = 4;
private static final int DIM_Y = 6;
+ private static final int DIM_BLKS = 36;
+ private static final int DIM_PNTS = 10;
+ private static final int DIM_ATTR = 12;
private static final int RANK = 2;
- long H5fid = -1;
- long H5dsid = -1;
- long H5did = -1;
+ long H5fid = HDF5Constants.H5I_INVALID_HID;
+ long H5dsid = HDF5Constants.H5I_INVALID_HID;
+ long H5did = HDF5Constants.H5I_INVALID_HID;
long[] H5dims = { DIM_X, DIM_Y };
private final void _deleteFile(String filename) {
@@ -78,7 +81,7 @@ public class TestH5 {
}
private final long _createDataset(long fid, long dsid, String name, long dapl) {
- long did = -1;
+ long did = HDF5Constants.H5I_INVALID_HID;
try {
did = H5.H5Dcreate(fid, name, HDF5Constants.H5T_STD_I32LE, dsid,
HDF5Constants.H5P_DEFAULT, HDF5Constants.H5P_DEFAULT, dapl);
@@ -115,22 +118,65 @@ public class TestH5 {
}
}
- public final void _closeH5File() throws HDF5LibraryException {
+ private final void _closeH5File() {
if (H5did >= 0)
try {H5.H5Dclose(H5did);} catch (Exception ex) {}
if (H5dsid > 0)
try {H5.H5Sclose(H5dsid);} catch (Exception ex) {}
if (H5fid > 0)
try {H5.H5Fclose(H5fid);} catch (Exception ex) {}
- H5fid = -1;
- H5dsid = -1;
- H5did = -1;
+ H5fid = HDF5Constants.H5I_INVALID_HID;
+ H5dsid = HDF5Constants.H5I_INVALID_HID;
+ H5did = HDF5Constants.H5I_INVALID_HID;
+ }
+
+ public void _openH5File(String filename, String dsetname) {
+ try {
+ H5fid = H5.H5Fopen(filename,
+ HDF5Constants.H5F_ACC_RDONLY, HDF5Constants.H5P_DEFAULT);
+ }
+ catch (Throwable err) {
+ err.printStackTrace();
+ fail("TestH5._openH5file: " + err);
+ }
+ assertTrue("TestH5._openH5file: H5.H5Fopen: ", H5fid >= 0);
+ try {
+ H5did = H5.H5Dopen(H5fid, dsetname, HDF5Constants.H5P_DEFAULT);
+ }
+ catch (Throwable err) {
+ err.printStackTrace();
+ fail("TestH5._openH5file: " + err);
+ }
+ assertTrue("TestH5._openH5file: H5.H5Dopen: ", H5did >= 0);
+ try {
+ H5dsid = H5.H5Dget_space(H5did);
+ }
+ catch (Throwable err) {
+ err.printStackTrace();
+ fail("TestH5._openH5file: " + err);
+ }
+ assertTrue("TestH5._openH5file: H5.H5Screate_simple: ",H5dsid > 0);
}
public final void _deleteH5file() {
+ _closeH5File();
_deleteFile(H5_FILE);
}
+ @After
+ public void closeH5File() throws HDF5LibraryException {
+ _closeH5File();
+ assertTrue("H5 open ids is 0", H5.getOpenIDCount()==0);
+ System.out.println();
+ }
+
+ @Before
+ public void verifyCount()
+ throws NullPointerException, HDF5Exception {
+ assertTrue("H5 open ids is 0", H5.getOpenIDCount()==0);
+ System.out.print(testname.getMethodName());
+ }
+
/**
* Test method for {@link hdf.hdf5lib.H5#J2C(int)}.
* NOTE:
@@ -374,8 +420,10 @@ public class TestH5 {
_closeH5File();
+ _openH5File(H5_FILE, "/dset");
+
try {
- H5.H5export_dataset(EXPORT_FILE, H5_FILE, "/dset", 99);
+ H5.H5export_dataset(EXPORT_FILE, H5fid, "/dset", 99);
}
catch (HDF5LibraryException err) {
err.printStackTrace();
@@ -411,4 +459,168 @@ public class TestH5 {
}
_deleteH5file();
}
+
+ @Test
+ public void testH5export_region() {
+ int[] dset_data_expect = {66, 69, 72, 75, 78, 81, 96, 99, 102, 105, 108,
+ 111, 126, 129, 132, 135, 138, 141, 156, 159, 162, 165, 168, 171,
+ 186, 189, 192, 195, 198, 201, 216, 219, 222, 225, 228, 231,
+ 207, 66, 252, 48, 84, 96, 12, 14, 213, 99};
+ int[] dset_indata = new int[DIM_BLKS+DIM_PNTS];
+ String objName = "/Dataset1";
+
+ _openH5File(H5_REGION_FILE, objName);
+
+ try {
+ H5.H5export_dataset(EXPORT_REGION_FILE, H5fid, objName, 99);
+ }
+ catch (HDF5LibraryException err) {
+ err.printStackTrace();
+ fail("H5export_dataset failed: " + err);
+ }
+
+ File file = new File(EXPORT_REGION_FILE);
+
+ try {
+ Reader reader = new FileReader(EXPORT_REGION_FILE);
+ StreamTokenizer streamTokenizer = new StreamTokenizer(reader);
+ int indx = 0;
+ while(streamTokenizer.nextToken() != StreamTokenizer.TT_EOF){
+ if(streamTokenizer.ttype == StreamTokenizer.TT_NUMBER) {
+ dset_indata[indx] = (int)streamTokenizer.nval;
+ indx++;
+ }
+ }
+ reader.close();
+ }
+ catch (IOException err) {
+ err.printStackTrace();
+ fail("read file failed: " + err);
+ }
+ for(int row = 0; row < DIM_X; row++)
+ assertTrue("testH5export_region: <"+row+">"+dset_indata[row], dset_indata[row]==dset_data_expect[row]);
+ }
+
+ @Test
+ public void testH5export_attribute() {
+ int[] dset_data_expect = {0, 3, 6, 9, 1, 4, 7, 10, 2, 5, 8, 11};
+ int[] dset_indata = new int[DIM_ATTR];
+ String objName = "/Dataset3";
+
+ _openH5File(H5_ATTR_FILE, objName);
+
+ try {
+ H5.H5export_dataset(EXPORT_ATTR_FILE, H5did, objName, 99);
+ }
+ catch (HDF5LibraryException err) {
+ err.printStackTrace();
+ fail("H5export_dataset failed: " + err);
+ }
+
+ File file = new File(EXPORT_ATTR_FILE);
+
+ try {
+ Reader reader = new FileReader(EXPORT_ATTR_FILE);
+ StreamTokenizer streamTokenizer = new StreamTokenizer(reader);
+ int indx = 0;
+ int jndx = 0;
+ while(streamTokenizer.nextToken() != StreamTokenizer.TT_EOF){
+ if(streamTokenizer.ttype == StreamTokenizer.TT_NUMBER) {
+ dset_indata[indx] = (int)streamTokenizer.nval;
+ indx++;
+ }
+ }
+ reader.close();
+ }
+ catch (IOException err) {
+ err.printStackTrace();
+ fail("read file failed: " + err);
+ }
+ for(int row = 0; row < DIM_X; row++)
+ assertTrue("testH5export_attribute: <"+row+">"+dset_indata[row], dset_indata[row]==dset_data_expect[row]);
+ }
+
+ @Test
+ public void testH5export_regdataset() {
+ int[] dset_data_expect = {66, 69, 72, 75, 78, 81, 96, 99, 102, 105, 108,
+ 111, 126, 129, 132, 135, 138, 141, 156, 159, 162, 165, 168, 171,
+ 186, 189, 192, 195, 198, 201, 216, 219, 222, 225, 228, 231,
+ 207, 66, 252, 48, 84, 96, 12, 14, 213, 99};
+ int[] dset_indata = new int[DIM_BLKS+DIM_PNTS];
+ String objName = "/Dataset1";
+
+ _openH5File(H5_DREG_FILE, objName);
+
+ try {
+ H5.H5export_dataset(EXPORT_DREG_FILE, H5fid, objName, 99);
+ }
+ catch (HDF5LibraryException err) {
+ err.printStackTrace();
+ fail("H5export_dataset failed: " + err);
+ }
+
+ File file = new File(EXPORT_DREG_FILE);
+
+ try {
+ Reader reader = new FileReader(EXPORT_DREG_FILE);
+ StreamTokenizer streamTokenizer = new StreamTokenizer(reader);
+ int indx = 0;
+ while(streamTokenizer.nextToken() != StreamTokenizer.TT_EOF){
+ if(streamTokenizer.ttype == StreamTokenizer.TT_NUMBER) {
+ dset_indata[indx] = (int)streamTokenizer.nval;
+ indx++;
+ }
+ }
+ reader.close();
+ }
+ catch (IOException err) {
+ err.printStackTrace();
+ fail("read file failed: " + err);
+ }
+ for(int row = 0; row < DIM_X; row++)
+ assertTrue("testH5export_regdataset: <"+row+">"+dset_indata[row], dset_indata[row]==dset_data_expect[row]);
+ }
+
+ @Test
+ public void testH5export_attrdataset() {
+ int[] dset_data_expect = {66, 69, 72, 75, 78, 81, 96, 99, 102, 105, 108,
+ 111, 126, 129, 132, 135, 138, 141, 156, 159, 162, 165, 168, 171,
+ 186, 189, 192, 195, 198, 201, 216, 219, 222, 225, 228, 231,
+ 207, 66, 252, 48, 84, 96, 12, 14, 213, 99};
+ int[] dset_indata = new int[DIM_BLKS+DIM_PNTS];
+ String dsetName = "/Dataset1";
+ String objName = "Attribute1";
+
+ _openH5File(H5_AREG_FILE, dsetName);
+
+ try {
+ H5.H5export_attribute(EXPORT_AREG_FILE, H5did, objName, 99);
+ }
+ catch (HDF5LibraryException err) {
+ err.printStackTrace();
+ fail("H5export_attribute failed: " + err);
+ }
+
+ File file = new File(EXPORT_AREG_FILE);
+
+ try {
+ Reader reader = new FileReader(EXPORT_AREG_FILE);
+ StreamTokenizer streamTokenizer = new StreamTokenizer(reader);
+ int indx = 0;
+ int jndx = 0;
+ while(streamTokenizer.nextToken() != StreamTokenizer.TT_EOF){
+ if(streamTokenizer.ttype == StreamTokenizer.TT_NUMBER) {
+ dset_indata[indx] = (int)streamTokenizer.nval;
+ indx++;
+ }
+ }
+ reader.close();
+ }
+ catch (IOException err) {
+ err.printStackTrace();
+ fail("read file failed: " + err);
+ }
+ for(int row = 0; row < DIM_X; row++)
+ assertTrue("testH5export_attrdataset: <"+row+">"+dset_indata[row], dset_indata[row]==dset_data_expect[row]);
+ }
}
diff --git a/java/test/TestH5A.java b/java/test/TestH5A.java
index cff03f9..f2134d2 100644
--- a/java/test/TestH5A.java
+++ b/java/test/TestH5A.java
@@ -1,6 +1,5 @@
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* 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 *
@@ -43,14 +42,14 @@ public class TestH5A {
private static final String H5_FILE = "testA.h5";
private static final int DIM_X = 4;
private static final int DIM_Y = 6;
- long H5fid = -1;
- long H5dsid = -1;
- long H5did = -1;
+ long H5fid = HDF5Constants.H5I_INVALID_HID;
+ long H5dsid = HDF5Constants.H5I_INVALID_HID;
+ long H5did = HDF5Constants.H5I_INVALID_HID;
long[] H5dims = { DIM_X, DIM_Y };
- long type_id = -1;
- long space_id = -1;
- long lapl_id = -1;
- long aapl_id = -1;
+ long type_id = HDF5Constants.H5I_INVALID_HID;
+ long space_id = HDF5Constants.H5I_INVALID_HID;
+ long lapl_id = HDF5Constants.H5I_INVALID_HID;
+ long aapl_id = HDF5Constants.H5I_INVALID_HID;
private final void _deleteFile(String filename) {
File file = new File(filename);
@@ -61,7 +60,7 @@ public class TestH5A {
}
private final long _createDataset(long fid, long dsid, String name, long dapl) {
- long did = -1;
+ long did = HDF5Constants.H5I_INVALID_HID;
try {
did = H5.H5Dcreate(fid, name, HDF5Constants.H5T_STD_I32BE, dsid,
HDF5Constants.H5P_DEFAULT, HDF5Constants.H5P_DEFAULT, dapl);
@@ -132,7 +131,7 @@ public class TestH5A {
@Test
public void testH5Acreate2() {
- long attr_id = -1;
+ long attr_id = HDF5Constants.H5I_INVALID_HID;
try {
attr_id = H5.H5Acreate(H5did, "dset", type_id, space_id, HDF5Constants.H5P_DEFAULT, HDF5Constants.H5P_DEFAULT);
assertTrue("testH5Acreate2", attr_id >= 0);
@@ -160,8 +159,8 @@ public class TestH5A {
@Test
public void testH5Aopen() {
String attr_name = "dset";
- long attribute_id = -1;
- long attr_id = -1;
+ long attribute_id = HDF5Constants.H5I_INVALID_HID;
+ long attr_id = HDF5Constants.H5I_INVALID_HID;
try {
attr_id = H5.H5Acreate(H5did, attr_name, type_id, space_id,
@@ -197,8 +196,8 @@ public class TestH5A {
int idx_type = HDF5Constants.H5_INDEX_CRT_ORDER;
int order = HDF5Constants.H5_ITER_INC;
long n = 0;
- long attr_id = -1;
- long attribute_id = -1;
+ long attr_id = HDF5Constants.H5I_INVALID_HID;
+ long attribute_id = HDF5Constants.H5I_INVALID_HID;
try {
attr_id = H5.H5Acreate(H5did, "file", type_id, space_id,
@@ -256,7 +255,7 @@ public class TestH5A {
public void testH5Acreate_by_name() {
String obj_name = ".";
String attr_name = "DATASET";
- long attribute_id = -1;
+ long attribute_id = HDF5Constants.H5I_INVALID_HID;
boolean bool_val = false;
try {
@@ -288,7 +287,7 @@ public class TestH5A {
long loc_id = H5fid;
String old_attr_name = "old";
String new_attr_name = "new";
- long attr_id = -1;
+ long attr_id = HDF5Constants.H5I_INVALID_HID;
int ret_val = -1;
boolean bool_val = false;
@@ -326,7 +325,7 @@ public class TestH5A {
String obj_name = ".";
String old_attr_name = "old";
String new_attr_name = "new";
- long attr_id = -1;
+ long attr_id = HDF5Constants.H5I_INVALID_HID;
int ret_val = -1;
boolean bool_val = false;
@@ -368,7 +367,7 @@ public class TestH5A {
String obj_name = ".";
String attr_name = "DATASET1";
String ret_name = null;
- long attribute_id = -1;
+ long attribute_id = HDF5Constants.H5I_INVALID_HID;
try {
attribute_id = H5.H5Acreate_by_name(H5fid, obj_name, attr_name,
@@ -398,8 +397,8 @@ public class TestH5A {
int idx_type = HDF5Constants.H5_INDEX_NAME;
int order = HDF5Constants.H5_ITER_INC;
int n = 0;
- long attr1_id = -1;
- long attr2_id = -1;
+ long attr1_id = HDF5Constants.H5I_INVALID_HID;
+ long attr2_id = HDF5Constants.H5I_INVALID_HID;
try {
attr1_id = H5.H5Acreate_by_name(loc_id, obj_name, attr_name,
@@ -435,8 +434,8 @@ public class TestH5A {
@Test
public void testH5Aget_storage_size() {
- long attr_id = -1;
- long attr_size = -1;
+ long attr_id = HDF5Constants.H5I_INVALID_HID;
+ long attr_size = HDF5Constants.H5I_INVALID_HID;
try {
attr_id = H5.H5Acreate(H5did, "dset", type_id, space_id,
@@ -458,8 +457,8 @@ public class TestH5A {
@Test
public void testH5Aget_info() {
H5A_info_t attr_info = null;
- long attribute_id = -1;
- long attr_id = -1;
+ long attribute_id = HDF5Constants.H5I_INVALID_HID;
+ long attr_id = HDF5Constants.H5I_INVALID_HID;
try {
attr_id = H5.H5Acreate(H5did, "dset", type_id, space_id,
@@ -490,8 +489,8 @@ public class TestH5A {
@Test
public void testH5Aget_info1() {
H5A_info_t attr_info = null;
- long attribute_id = -1;
- long attr_id = -1;
+ long attribute_id = HDF5Constants.H5I_INVALID_HID;
+ long attr_id = HDF5Constants.H5I_INVALID_HID;
int order = HDF5Constants.H5_ITER_INC;
try {
@@ -526,8 +525,8 @@ public class TestH5A {
@Test
public void testH5Aget_info_by_idx() {
- long attr_id = -1;
- long attr2_id = -1;;
+ long attr_id = HDF5Constants.H5I_INVALID_HID;
+ long attr2_id = HDF5Constants.H5I_INVALID_HID;;
H5A_info_t attr_info = null;
try {
@@ -582,7 +581,7 @@ public class TestH5A {
@Test
public void testH5Aget_info_by_name() {
- long attr_id = -1;
+ long attr_id = HDF5Constants.H5I_INVALID_HID;
H5A_info_t attr_info = null;
String obj_name = ".";
String attr_name = "DATASET";
@@ -607,7 +606,7 @@ public class TestH5A {
@Test
public void testH5Adelete_by_name() {
- long attr_id = -1;
+ long attr_id = HDF5Constants.H5I_INVALID_HID;
int ret_val = -1;
boolean bool_val = false;
boolean exists = false;
@@ -650,8 +649,8 @@ public class TestH5A {
@Test
public void testH5Aexists() {
boolean exists = false;
- long attr_id = -1;
- long attribute_id = -1;
+ long attr_id = HDF5Constants.H5I_INVALID_HID;
+ long attribute_id = HDF5Constants.H5I_INVALID_HID;
try {
exists = H5.H5Aexists(H5fid, "None");
@@ -689,10 +688,10 @@ public class TestH5A {
@Test
public void testH5Adelete_by_idx_order() {
boolean exists = false;
- long attr1_id = -1;
- long attr2_id = -1;
- long attr3_id = -1;
- long attr4_id = -1;
+ long attr1_id = HDF5Constants.H5I_INVALID_HID;
+ long attr2_id = HDF5Constants.H5I_INVALID_HID;
+ long attr3_id = HDF5Constants.H5I_INVALID_HID;
+ long attr4_id = HDF5Constants.H5I_INVALID_HID;
try {
attr1_id = H5.H5Acreate_by_name(H5fid, ".", "attribute1",
@@ -731,9 +730,9 @@ public class TestH5A {
@Test
public void testH5Adelete_by_idx_name1() {
boolean exists = false;
- long attr1_id = -1;
- long attr2_id = -1;
- long attr3_id = -1;
+ long attr1_id = HDF5Constants.H5I_INVALID_HID;
+ long attr2_id = HDF5Constants.H5I_INVALID_HID;
+ long attr3_id = HDF5Constants.H5I_INVALID_HID;
try {
attr1_id = H5.H5Acreate_by_name(H5fid, ".", "attribute1",
@@ -766,10 +765,10 @@ public class TestH5A {
@Test
public void testH5Adelete_by_idx_name2() {
boolean exists = false;
- long attr1_id = -1;
- long attr2_id = -1;
- long attr3_id = -1;
- long attr4_id = -1;
+ long attr1_id = HDF5Constants.H5I_INVALID_HID;
+ long attr2_id = HDF5Constants.H5I_INVALID_HID;
+ long attr3_id = HDF5Constants.H5I_INVALID_HID;
+ long attr4_id = HDF5Constants.H5I_INVALID_HID;
try {
attr1_id = H5.H5Acreate_by_name(H5fid, ".", "attribute1",
@@ -821,8 +820,8 @@ public class TestH5A {
public void testH5Aopen_by_name() {
String obj_name = ".";
String attr_name = "DATASET";
- long attribute_id = -1;
- long aid = -1;
+ long attribute_id = HDF5Constants.H5I_INVALID_HID;
+ long aid = HDF5Constants.H5I_INVALID_HID;
try {
attribute_id = H5.H5Acreate_by_name(H5fid, obj_name, attr_name,
@@ -856,9 +855,9 @@ public class TestH5A {
@Test
public void testH5Awrite_readVL() {
String attr_name = "VLdata";
- long attr_id = -1;
- long atype_id = -1;
- long aspace_id = -1;
+ long attr_id = HDF5Constants.H5I_INVALID_HID;
+ long atype_id = HDF5Constants.H5I_INVALID_HID;
+ long aspace_id = HDF5Constants.H5I_INVALID_HID;
String[] str_data = { "Parting", "is such", "sweet", "sorrow." };
long[] dims = { str_data.length };
long lsize = 1;
@@ -923,8 +922,8 @@ public class TestH5A {
public void testH5Aget_create_plist() {
String attr_name = "DATASET1";
int char_encoding = 0;
- long plist_id = -1;
- long attribute_id = -1;
+ long plist_id = HDF5Constants.H5I_INVALID_HID;
+ long attribute_id = HDF5Constants.H5I_INVALID_HID;
try {
plist_id = H5.H5Pcreate(HDF5Constants.H5P_ATTRIBUTE_CREATE);
@@ -984,10 +983,10 @@ public class TestH5A {
@Test
public void testH5Aiterate() {
- long attr1_id = -1;
- long attr2_id = -1;
- long attr3_id = -1;
- long attr4_id = -1;
+ long attr1_id = HDF5Constants.H5I_INVALID_HID;
+ long attr2_id = HDF5Constants.H5I_INVALID_HID;
+ long attr3_id = HDF5Constants.H5I_INVALID_HID;
+ long attr4_id = HDF5Constants.H5I_INVALID_HID;
class idata {
public String attr_name = null;
@@ -1052,10 +1051,10 @@ public class TestH5A {
@Test
public void testH5Aiterate_by_name() {
- long attr1_id = -1;
- long attr2_id = -1;
- long attr3_id = -1;
- long attr4_id = -1;
+ long attr1_id = HDF5Constants.H5I_INVALID_HID;
+ long attr2_id = HDF5Constants.H5I_INVALID_HID;
+ long attr3_id = HDF5Constants.H5I_INVALID_HID;
+ long attr4_id = HDF5Constants.H5I_INVALID_HID;
class idata {
public String attr_name = null;
diff --git a/java/test/TestH5Arw.java b/java/test/TestH5Arw.java
new file mode 100644
index 0000000..282b736
--- /dev/null
+++ b/java/test/TestH5Arw.java
@@ -0,0 +1,449 @@
+/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
+ * Copyright by The HDF Group. *
+ * All rights reserved. *
+ * *
+ * This file is part of HDF5. The full HDF5 copyright notice, including *
+ * terms governing use, modification, and redistribution, is contained in *
+ * the COPYING file, which can be found at the root of the source code *
+ * distribution tree, or in https://www.hdfgroup.org/licenses. *
+ * If you do not have access to either file, you may request a copy from *
+ * help@hdfgroup.org. *
+ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
+
+package test;
+
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertTrue;
+import static org.junit.Assert.fail;
+
+import java.io.File;
+
+import hdf.hdf5lib.H5;
+import hdf.hdf5lib.HDF5Constants;
+import hdf.hdf5lib.HDFNativeData;
+import hdf.hdf5lib.callbacks.H5A_iterate_cb;
+import hdf.hdf5lib.callbacks.H5A_iterate_t;
+import hdf.hdf5lib.exceptions.HDF5Exception;
+import hdf.hdf5lib.exceptions.HDF5LibraryException;
+
+import org.junit.After;
+import org.junit.Before;
+import org.junit.Rule;
+import org.junit.Test;
+import org.junit.rules.TestName;
+
+public class TestH5Arw {
+ @Rule public TestName testname = new TestName();
+ private static final String H5_INTS_FILE = "tintsattrs.h5";
+ private static final String H5_FLTS_FILE = "tfloatsattrs.h5";
+ private static final int DIM_X = 8;
+ private static final int DIM8_Y = 8;
+ private static final int DIM16_Y = 16;
+ private static final int DIM32_Y = 32;
+ private static final int DIM64_Y = 64;
+ private static final int DIM128_Y = 128;
+ private static final String DATASETU08 = "DU08BITS";
+ private static final String DATASETS08 = "DS08BITS";
+ private static final String DATASETU16 = "DU16BITS";
+ private static final String DATASETS16 = "DS16BITS";
+ private static final String DATASETU32 = "DU32BITS";
+ private static final String DATASETS32 = "DS32BITS";
+ private static final String DATASETU64 = "DU64BITS";
+ private static final String DATASETS64 = "DS64BITS";
+ private static final String DATASETF32 = "DS32BITS";
+ private static final String DATASETF64 = "DS64BITS";
+ private static final String DATASETF128 = "DS128BITS";
+ private static final int RANK = 2;
+ long H5fid = HDF5Constants.H5I_INVALID_HID;
+ long H5aid = HDF5Constants.H5I_INVALID_HID;
+ long H5did = HDF5Constants.H5I_INVALID_HID;
+
+ private final void _closeH5file() throws HDF5LibraryException {
+ if (H5aid >= 0)
+ try {H5.H5Aclose(H5aid);} catch (Exception ex) {}
+ if (H5did >= 0)
+ try {H5.H5Dclose(H5did);} catch (Exception ex) {}
+ if (H5fid > 0)
+ try {H5.H5Fclose(H5fid);} catch (Exception ex) {}
+ }
+
+ public void openH5file(String filename, String dsetname) {
+ try {
+ H5fid = H5.H5Fopen(filename,
+ HDF5Constants.H5F_ACC_RDONLY, HDF5Constants.H5P_DEFAULT);
+ }
+ catch (Throwable err) {
+ err.printStackTrace();
+ fail("TestH5Arw._openH5file: " + err);
+ }
+ assertTrue("TestH5Arw._openH5file: H5.H5Fopen: ", H5fid >= 0);
+ try {
+ H5did = H5.H5Dopen(H5fid, dsetname, HDF5Constants.H5P_DEFAULT);
+ }
+ catch (Throwable err) {
+ err.printStackTrace();
+ fail("TestH5Arw._openH5file: " + err);
+ }
+ assertTrue("TestH5Arw._openH5file: H5.H5Dopen: ", H5did >= 0);
+ try {
+ H5aid = H5.H5Aopen(H5did, dsetname, HDF5Constants.H5P_DEFAULT);
+ }
+ catch (Throwable err) {
+ err.printStackTrace();
+ fail("TestH5Arw._openH5file: " + err);
+ }
+ assertTrue("TestH5Arw._openH5file: H5.H5Aopen: ", H5aid >= 0);
+ }
+
+ @After
+ public void closeH5file() throws HDF5LibraryException {
+ if (H5aid >= 0)
+ try {H5.H5Aclose(H5aid);} catch (Exception ex) {}
+ if (H5did >= 0)
+ try {H5.H5Aclose(H5did);} catch (Exception ex) {}
+ if (H5fid > 0)
+ try {H5.H5Fclose(H5fid);} catch (Exception ex) {}
+ H5fid = HDF5Constants.H5I_INVALID_HID;
+ H5did = HDF5Constants.H5I_INVALID_HID;
+ H5aid = HDF5Constants.H5I_INVALID_HID;
+ System.out.println();
+ }
+
+ @Before
+ public void verifyCount()
+ throws NullPointerException, HDF5Exception {
+ assertTrue("H5 open ids is 0", H5.getOpenIDCount()==0);
+ System.out.print(testname.getMethodName());
+ }
+
+ @Test
+ public void testH5Aread_8bit_ints() {
+ byte[][] attr_data = new byte[DIM_X][DIM8_Y];
+
+ try {
+ openH5file(H5_INTS_FILE, DATASETU08);
+ }
+ catch (Throwable err) {
+ err.printStackTrace();
+ fail("testH5Aread_8bit_ints: openH5file: " + err);
+ }
+
+ // Read data.
+ try {
+ H5.H5Aread(H5aid, HDF5Constants.H5T_NATIVE_UINT8, attr_data);
+ }
+ catch (Exception err) {
+ err.printStackTrace();
+ fail("testH5Aread_8bit_ints: H5Aread: " + err);
+ }
+
+ // End access to the attribute and release resources used by it.
+ try {
+ H5.H5Aclose(H5aid);
+ }
+ catch (Exception err) {
+ err.printStackTrace();
+ }
+
+ // End access to the dataset and release resources used by it.
+ try {
+ H5.H5Dclose(H5did);
+ }
+ catch (Exception err) {
+ err.printStackTrace();
+ }
+
+ // Open an existing dataset.
+ try {
+ H5did = H5.H5Dopen(H5fid, DATASETS08, HDF5Constants.H5P_DEFAULT);
+ }
+ catch (Exception err) {
+ err.printStackTrace();
+ fail("testH5Aread_8bit_ints: H5Dopen: " + err);
+ }
+
+ // Open an existing attribute.
+ try {
+ H5aid = H5.H5Aopen(H5did, DATASETS08, HDF5Constants.H5P_DEFAULT);
+ }
+ catch (Exception err) {
+ err.printStackTrace();
+ fail("testH5Aread_8bit_ints: H5Aopen: " + err);
+ }
+
+ // Read data.
+ try {
+ H5.H5Aread(H5aid, HDF5Constants.H5T_NATIVE_INT8, attr_data);
+ }
+ catch (Exception err) {
+ err.printStackTrace();
+ fail("testH5Aread_8bit_ints: H5Aread: " + err);
+ }
+ }
+
+ @Test
+ public void testH5Aread_16bit_ints() {
+ short[][] attr_data = new short[DIM_X][DIM16_Y];
+
+ try {
+ openH5file(H5_INTS_FILE, DATASETU16);
+ }
+ catch (Throwable err) {
+ err.printStackTrace();
+ fail("testH5Aread_16bit_ints: openH5file: " + err);
+ }
+
+ // Read data.
+ try {
+ H5.H5Aread(H5aid, HDF5Constants.H5T_NATIVE_UINT16, attr_data);
+ }
+ catch (Exception err) {
+ err.printStackTrace();
+ fail("testH5Aread_16bit_ints: H5Aread: " + err);
+ }
+
+ // End access to the attribute and release resources used by it.
+ try {
+ H5.H5Aclose(H5aid);
+ }
+ catch (Exception err) {
+ err.printStackTrace();
+ }
+
+ // End access to the dataset and release resources used by it.
+ try {
+ H5.H5Dclose(H5did);
+ }
+ catch (Exception err) {
+ err.printStackTrace();
+ }
+
+ // Open an existing dataset.
+ try {
+ H5did = H5.H5Dopen(H5fid, DATASETS16, HDF5Constants.H5P_DEFAULT);
+ }
+ catch (Exception err) {
+ err.printStackTrace();
+ fail("testH5Aread_16bit_ints: H5Dopen: " + err);
+ }
+
+ // Open an existing attribute.
+ try {
+ H5aid = H5.H5Aopen(H5did, DATASETS16, HDF5Constants.H5P_DEFAULT);
+ }
+ catch (Exception err) {
+ err.printStackTrace();
+ fail("testH5Aread_16bit_ints: H5Aopen: " + err);
+ }
+
+ // Read data.
+ try {
+ H5.H5Aread(H5aid, HDF5Constants.H5T_NATIVE_INT16, attr_data);
+ }
+ catch (Exception err) {
+ err.printStackTrace();
+ fail("testH5Aread_16bit_ints: H5Aread: " + err);
+ }
+ }
+
+ @Test
+ public void testH5Aread_32bit_ints() {
+ int[][] attr_data = new int[DIM_X][DIM16_Y];
+
+ try {
+ openH5file(H5_INTS_FILE, DATASETU32);
+ }
+ catch (Throwable err) {
+ err.printStackTrace();
+ fail("testH5Aread_32bit_ints: openH5file: " + err);
+ }
+
+ // Read data.
+ try {
+ H5.H5Aread(H5aid, HDF5Constants.H5T_NATIVE_UINT32, attr_data);
+ }
+ catch (Exception err) {
+ err.printStackTrace();
+ fail("testH5Aread_32bit_ints: H5Aread: " + err);
+ }
+
+ // End access to the attribute and release resources used by it.
+ try {
+ H5.H5Aclose(H5aid);
+ }
+ catch (Exception err) {
+ err.printStackTrace();
+ }
+
+ // End access to the dataset and release resources used by it.
+ try {
+ H5.H5Dclose(H5did);
+ }
+ catch (Exception err) {
+ err.printStackTrace();
+ }
+
+ // Open an existing dataset.
+ try {
+ H5did = H5.H5Dopen(H5fid, DATASETS32, HDF5Constants.H5P_DEFAULT);
+ }
+ catch (Exception err) {
+ err.printStackTrace();
+ fail("testH5Aread_32bit_ints: H5Dopen: " + err);
+ }
+
+ // Open an existing attribute.
+ try {
+ H5aid = H5.H5Aopen(H5did, DATASETS32, HDF5Constants.H5P_DEFAULT);
+ }
+ catch (Exception err) {
+ err.printStackTrace();
+ fail("testH5Aread_32bit_ints: H5Aopen: " + err);
+ }
+
+ // Read data.
+ try {
+ H5.H5Aread(H5aid, HDF5Constants.H5T_NATIVE_INT32, attr_data);
+ }
+ catch (Exception err) {
+ err.printStackTrace();
+ fail("testH5Aread_32bit_ints: H5Aread: " + err);
+ }
+ }
+
+ @Test
+ public void testH5Aread_64bit_ints() {
+ long[][] attr_data = new long[DIM_X][DIM64_Y];
+
+ try {
+ openH5file(H5_INTS_FILE, DATASETU64);
+ }
+ catch (Throwable err) {
+ err.printStackTrace();
+ fail("testH5Aread_64bit_ints: openH5file: " + err);
+ }
+
+ // Read data.
+ try {
+ H5.H5Aread(H5aid, HDF5Constants.H5T_NATIVE_UINT64, attr_data);
+ }
+ catch (Exception err) {
+ err.printStackTrace();
+ fail("testH5Aread_64bit_ints: H5Aread: " + err);
+ }
+
+ // End access to the attribute and release resources used by it.
+ try {
+ H5.H5Aclose(H5aid);
+ }
+ catch (Exception err) {
+ err.printStackTrace();
+ }
+
+ // End access to the dataset and release resources used by it.
+ try {
+ H5.H5Dclose(H5did);
+ }
+ catch (Exception err) {
+ err.printStackTrace();
+ }
+
+ // Open an existing dataset.
+ try {
+ H5did = H5.H5Dopen(H5fid, DATASETS64, HDF5Constants.H5P_DEFAULT);
+ }
+ catch (Exception err) {
+ err.printStackTrace();
+ fail("testH5Aread_64bit_ints: H5Dopen: " + err);
+ }
+
+ // Open an existing attribute.
+ try {
+ H5aid = H5.H5Aopen(H5did, DATASETS64, HDF5Constants.H5P_DEFAULT);
+ }
+ catch (Exception err) {
+ err.printStackTrace();
+ fail("testH5Aread_64bit_ints: H5Aopen: " + err);
+ }
+
+ // Read data.
+ try {
+ H5.H5Aread(H5aid, HDF5Constants.H5T_NATIVE_INT64, attr_data);
+ }
+ catch (Exception err) {
+ err.printStackTrace();
+ fail("testH5Aread_64bit_ints: H5Aread: " + err);
+ }
+ }
+
+ @Test
+ public void testH5Aread_32bit_floats() {
+ float[][] attr_data = new float[DIM_X][DIM32_Y];
+
+ try {
+ openH5file(H5_FLTS_FILE, DATASETF32);
+ }
+ catch (Throwable err) {
+ err.printStackTrace();
+ fail("testH5Aread_32bit_floats: openH5file: " + err);
+ }
+
+ // Read data.
+ try {
+ H5.H5Aread(H5aid, HDF5Constants.H5T_NATIVE_FLOAT, attr_data);
+ }
+ catch (Exception err) {
+ err.printStackTrace();
+ fail("testH5Aread_32bit_floats: H5Aread: " + err);
+ }
+ for (int i = 0; i < DIM_X; i++)
+ assertTrue("testH5Aread_32bit_floats - H5.H5Aread: ", attr_data[i][0] == (32 - i));
+ }
+
+ @Test
+ public void testH5Aread_64bit_floats() {
+ double[][] attr_data = new double[DIM_X][DIM64_Y];
+
+ try {
+ openH5file(H5_FLTS_FILE, DATASETF64);
+ }
+ catch (Throwable err) {
+ err.printStackTrace();
+ fail("testH5Aread_64bit_floats: openH5file: " + err);
+ }
+
+ // Read data.
+ try {
+ H5.H5Aread(H5aid, HDF5Constants.H5T_NATIVE_DOUBLE, attr_data);
+ }
+ catch (Exception err) {
+ err.printStackTrace();
+ fail("testH5Aread_64bit_floats: H5Aread: " + err);
+ }
+ for (int i = 0; i < DIM_X; i++)
+ assertTrue("testH5Aread_64bit_floats - H5.H5Aread: ", attr_data[i][0] == (64 - i));
+ }
+
+ @Test
+ public void testH5Aread_128bit_floats() {
+ byte[][][] attr_data = new byte[DIM_X][DIM128_Y][8];
+
+ try {
+ openH5file(H5_FLTS_FILE, DATASETF128);
+ }
+ catch (Throwable err) {
+ err.printStackTrace();
+ fail("testH5Aread_128bit_floats: openH5file: " + err);
+ }
+
+ // Read data.
+ try {
+ H5.H5Aread(H5aid, HDF5Constants.H5T_NATIVE_LDOUBLE, attr_data);
+ }
+ catch (Exception err) {
+ err.printStackTrace();
+ fail("testH5Aread_128bit_floats: H5Aread: " + err);
+ }
+ }
+
+}
diff --git a/java/test/TestH5D.java b/java/test/TestH5D.java
index 21f0879..dac3a9c 100644
--- a/java/test/TestH5D.java
+++ b/java/test/TestH5D.java
@@ -1,6 +1,5 @@
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* 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 *
@@ -39,13 +38,13 @@ public class TestH5D {
private static final int DIM_X = 4;
private static final int DIM_Y = 6;
private static final int RANK = 2;
- long H5fid = -1;
- long H5faplid = -1;
- long H5dsid = -1;
- long H5dtid = -1;
- long H5did = -1;
- long H5did0 = -1;
- long H5dcpl_id = -1;
+ long H5fid = HDF5Constants.H5I_INVALID_HID;
+ long H5faplid = HDF5Constants.H5I_INVALID_HID;
+ long H5dsid = HDF5Constants.H5I_INVALID_HID;
+ long H5dtid = HDF5Constants.H5I_INVALID_HID;
+ long H5did = HDF5Constants.H5I_INVALID_HID;
+ long H5did0 = HDF5Constants.H5I_INVALID_HID;
+ long H5dcpl_id = HDF5Constants.H5I_INVALID_HID;
long[] H5dims = { DIM_X, DIM_Y };
// Values for the status of space allocation
@@ -195,10 +194,10 @@ public class TestH5D {
try {H5.H5Fclose(H5fid);} catch (Exception ex) {}
}
- private final void _openH5file(String name, long dapl) {
+ private final void _openH5file(String filename, String dsetname, long dapl) {
try {
- H5fid = H5.H5Fopen(H5_FILE,
- HDF5Constants.H5F_ACC_RDWR, HDF5Constants.H5P_DEFAULT);
+ H5fid = H5.H5Fopen(filename,
+ HDF5Constants.H5F_ACC_RDONLY, HDF5Constants.H5P_DEFAULT);
}
catch (Throwable err) {
err.printStackTrace();
@@ -206,7 +205,7 @@ public class TestH5D {
}
assertTrue("TestH5D._openH5file: H5.H5Fopen: ",H5fid >= 0);
try {
- H5did = H5.H5Dopen(H5fid, name, dapl);
+ H5did = H5.H5Dopen(H5fid, dsetname, dapl);
}
catch (Throwable err) {
err.printStackTrace();
@@ -268,7 +267,7 @@ public class TestH5D {
@Test
public void testH5Dcreate() {
- long dataset_id = -1;
+ long dataset_id = HDF5Constants.H5I_INVALID_HID;
try {
dataset_id = H5.H5Dcreate(H5fid, "dset",
HDF5Constants.H5T_STD_I32BE, H5dsid,
@@ -292,7 +291,7 @@ public class TestH5D {
@Test
public void testH5Dcreate_anon() {
- long dataset_id = -1;
+ long dataset_id = HDF5Constants.H5I_INVALID_HID;
try {
dataset_id = H5.H5Dcreate_anon(H5fid, HDF5Constants.H5T_STD_I32BE,
H5dsid, HDF5Constants.H5P_DEFAULT, HDF5Constants.H5P_DEFAULT);
@@ -315,12 +314,12 @@ public class TestH5D {
@Test
public void testH5Dopen() {
- long dataset_id = -1;
+ long dataset_id = HDF5Constants.H5I_INVALID_HID;
_createDataset(H5fid, H5dsid, "dset", HDF5Constants.H5P_DEFAULT);
try {
H5.H5Dclose(H5did);
- H5did = -1;
+ H5did = HDF5Constants.H5I_INVALID_HID;
dataset_id = H5.H5Dopen(H5fid, "dset", HDF5Constants.H5P_DEFAULT);
}
catch (Exception err) {
@@ -388,8 +387,8 @@ public class TestH5D {
@Test
public void testH5Dget_access_plist() {
- long dapl_id = -1;
- long test_dapl_id = -1;
+ long dapl_id = HDF5Constants.H5I_INVALID_HID;
+ long test_dapl_id = HDF5Constants.H5I_INVALID_HID;
int[] mdc_nelmts1 = {0};
int[] mdc_nelmts2 = {0};
long[] rdcc_nelmts1 = {0};
@@ -500,7 +499,7 @@ public class TestH5D {
@Test(expected = HDF5LibraryException.class)
public void testH5Dget_space_closed() throws Throwable {
- long dataset_id = -1;
+ long dataset_id = HDF5Constants.H5I_INVALID_HID;
try {
dataset_id = H5.H5Dcreate(H5fid, "dset",
HDF5Constants.H5T_STD_I32BE, H5dsid,
@@ -518,7 +517,7 @@ public class TestH5D {
@Test
public void testH5Dget_space() {
- long dataspace_id = -1;
+ long dataspace_id = HDF5Constants.H5I_INVALID_HID;
_createDataset(H5fid, H5dsid, "dset", HDF5Constants.H5P_DEFAULT);
try {
@@ -542,7 +541,7 @@ public class TestH5D {
@Test(expected = HDF5LibraryException.class)
public void testH5Dget_type_closed() throws Throwable {
- long dataset_id = -1;
+ long dataset_id = HDF5Constants.H5I_INVALID_HID;
try {
dataset_id = H5.H5Dcreate(H5fid, "dset",
HDF5Constants.H5T_STD_I32BE, H5dsid,
@@ -560,7 +559,7 @@ public class TestH5D {
@Test
public void testH5Dget_type() {
- long datatype_id = -1;
+ long datatype_id = HDF5Constants.H5I_INVALID_HID;
_createDataset(H5fid, H5dsid, "dset", HDF5Constants.H5P_DEFAULT);
try {
diff --git a/java/test/TestH5Dparams.java b/java/test/TestH5Dparams.java
index 66f0d83..3661139 100644
--- a/java/test/TestH5Dparams.java
+++ b/java/test/TestH5Dparams.java
@@ -1,6 +1,5 @@
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* 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 *
diff --git a/java/test/TestH5Dplist.java b/java/test/TestH5Dplist.java
index 97ce084..774b9dd 100644
--- a/java/test/TestH5Dplist.java
+++ b/java/test/TestH5Dplist.java
@@ -1,6 +1,5 @@
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* 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 *
@@ -42,10 +41,10 @@ public class TestH5Dplist {
private static final int NDIMS = 2;
private static final int FILLVAL = 99;
private static final int RANK = 2;
- long H5fid = -1;
- long H5dsid = -1;
- long H5did = -1;
- long H5dcpl_id = -1;
+ long H5fid = HDF5Constants.H5I_INVALID_HID;
+ long H5dsid = HDF5Constants.H5I_INVALID_HID;
+ long H5did = HDF5Constants.H5I_INVALID_HID;
+ long H5dcpl_id = HDF5Constants.H5I_INVALID_HID;
long[] H5dims = { DIM_X, DIM_Y };
long[] H5extdims = { EDIM_X, EDIM_Y };
long[] H5chunk_dims = { CHUNK_X, CHUNK_Y };
diff --git a/java/test/TestH5Drw.java b/java/test/TestH5Drw.java
new file mode 100644
index 0000000..69fb9d7
--- /dev/null
+++ b/java/test/TestH5Drw.java
@@ -0,0 +1,378 @@
+/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
+ * Copyright by The HDF Group. *
+ * All rights reserved. *
+ * *
+ * This file is part of HDF5. The full HDF5 copyright notice, including *
+ * terms governing use, modification, and redistribution, is contained in *
+ * the COPYING file, which can be found at the root of the source code *
+ * distribution tree, or in https://www.hdfgroup.org/licenses. *
+ * If you do not have access to either file, you may request a copy from *
+ * help@hdfgroup.org. *
+ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
+
+package test;
+
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertTrue;
+import static org.junit.Assert.fail;
+
+import java.io.File;
+
+import hdf.hdf5lib.H5;
+import hdf.hdf5lib.HDF5Constants;
+import hdf.hdf5lib.HDFNativeData;
+import hdf.hdf5lib.callbacks.H5D_iterate_cb;
+import hdf.hdf5lib.callbacks.H5D_iterate_t;
+import hdf.hdf5lib.exceptions.HDF5Exception;
+import hdf.hdf5lib.exceptions.HDF5LibraryException;
+
+import org.junit.After;
+import org.junit.Before;
+import org.junit.Rule;
+import org.junit.Test;
+import org.junit.rules.TestName;
+
+public class TestH5Drw {
+ @Rule public TestName testname = new TestName();
+ private static final String H5_INTS_FILE = "tintsattrs.h5";
+ private static final String H5_FLTS_FILE = "tfloatsattrs.h5";
+ private static final int DIM_X = 8;
+ private static final int DIM8_Y = 8;
+ private static final int DIM16_Y = 16;
+ private static final int DIM32_Y = 32;
+ private static final int DIM64_Y = 64;
+ private static final int DIM128_Y = 128;
+ private static final String DATASETU08 = "DU08BITS";
+ private static final String DATASETS08 = "DS08BITS";
+ private static final String DATASETU16 = "DU16BITS";
+ private static final String DATASETS16 = "DS16BITS";
+ private static final String DATASETU32 = "DU32BITS";
+ private static final String DATASETS32 = "DS32BITS";
+ private static final String DATASETU64 = "DU64BITS";
+ private static final String DATASETS64 = "DS64BITS";
+ private static final String DATASETF32 = "DS32BITS";
+ private static final String DATASETF64 = "DS64BITS";
+ private static final String DATASETF128 = "DS128BITS";
+ private static final int RANK = 2;
+ long H5fid = HDF5Constants.H5I_INVALID_HID;
+ long H5did = HDF5Constants.H5I_INVALID_HID;
+
+ private final void _closeH5file() throws HDF5LibraryException {
+ if (H5did >= 0)
+ try {H5.H5Dclose(H5did);} catch (Exception ex) {}
+ if (H5fid > 0)
+ try {H5.H5Fclose(H5fid);} catch (Exception ex) {}
+ }
+
+ public void openH5file(String filename, String dsetname) {
+ try {
+ H5fid = H5.H5Fopen(filename,
+ HDF5Constants.H5F_ACC_RDONLY, HDF5Constants.H5P_DEFAULT);
+ }
+ catch (Throwable err) {
+ err.printStackTrace();
+ fail("TestH5Drw._openH5file: " + err);
+ }
+ assertTrue("TestH5Drw._openH5file: H5.H5Fopen: ", H5fid >= 0);
+ try {
+ H5did = H5.H5Dopen(H5fid, dsetname, HDF5Constants.H5P_DEFAULT);
+ }
+ catch (Throwable err) {
+ err.printStackTrace();
+ fail("TestH5Drw._openH5file: " + err);
+ }
+ assertTrue("TestH5Drw._openH5file: H5.H5Dopen: ", H5did >= 0);
+ }
+
+ @After
+ public void closeH5file() throws HDF5LibraryException {
+ if (H5did >= 0)
+ try {H5.H5Dclose(H5did);} catch (Exception ex) {}
+ if (H5fid > 0)
+ try {H5.H5Fclose(H5fid);} catch (Exception ex) {}
+ H5fid = HDF5Constants.H5I_INVALID_HID;
+ H5did = HDF5Constants.H5I_INVALID_HID;
+ System.out.println();
+ }
+
+ @Before
+ public void verifyCount()
+ throws NullPointerException, HDF5Exception {
+ assertTrue("H5 open ids is 0", H5.getOpenIDCount()==0);
+ System.out.print(testname.getMethodName());
+ }
+
+ @Test
+ public void testH5Dread_8bit_ints() {
+ byte[][] dset_data = new byte[DIM_X][DIM8_Y];
+
+ try {
+ openH5file(H5_INTS_FILE, DATASETU08);
+ }
+ catch (Throwable err) {
+ err.printStackTrace();
+ fail("testH5Dread_8bit_ints: openH5file: " + err);
+ }
+
+ // Read data.
+ try {
+ H5.H5Dread(H5did, HDF5Constants.H5T_NATIVE_UINT8, HDF5Constants.H5S_ALL, HDF5Constants.H5S_ALL,
+ HDF5Constants.H5P_DEFAULT, dset_data);
+ }
+ catch (Exception err) {
+ err.printStackTrace();
+ fail("testH5Dread_8bit_ints: H5Dread: " + err);
+ }
+
+ // End access to the dataset and release resources used by it.
+ try {
+ H5.H5Dclose(H5did);
+ }
+ catch (Exception err) {
+ err.printStackTrace();
+ }
+
+ // Open an existing dataset.
+ try {
+ H5did = H5.H5Dopen(H5fid, DATASETS08, HDF5Constants.H5P_DEFAULT);
+ }
+ catch (Exception err) {
+ err.printStackTrace();
+ fail("testH5Dread_8bit_ints: H5Dopen: " + err);
+ }
+
+ // Read data.
+ try {
+ H5.H5Dread(H5did, HDF5Constants.H5T_NATIVE_INT8, HDF5Constants.H5S_ALL, HDF5Constants.H5S_ALL,
+ HDF5Constants.H5P_DEFAULT, dset_data);
+ }
+ catch (Exception err) {
+ err.printStackTrace();
+ fail("testH5Dread_8bit_ints: H5Dread: " + err);
+ }
+ }
+
+ @Test
+ public void testH5Dread_16bit_ints() {
+ short[][] dset_data = new short[DIM_X][DIM16_Y];
+
+ try {
+ openH5file(H5_INTS_FILE, DATASETU16);
+ }
+ catch (Throwable err) {
+ err.printStackTrace();
+ fail("testH5Dread_16bit_ints: openH5file: " + err);
+ }
+
+ // Read data.
+ try {
+ H5.H5Dread(H5did, HDF5Constants.H5T_NATIVE_UINT16, HDF5Constants.H5S_ALL, HDF5Constants.H5S_ALL,
+ HDF5Constants.H5P_DEFAULT, dset_data);
+ }
+ catch (Exception err) {
+ err.printStackTrace();
+ fail("testH5Dread_16bit_ints: H5Dread: " + err);
+ }
+
+ // End access to the dataset and release resources used by it.
+ try {
+ H5.H5Dclose(H5did);
+ }
+ catch (Exception err) {
+ err.printStackTrace();
+ }
+
+ // Open an existing dataset.
+ try {
+ H5did = H5.H5Dopen(H5fid, DATASETS16, HDF5Constants.H5P_DEFAULT);
+ }
+ catch (Exception err) {
+ err.printStackTrace();
+ fail("testH5Dread_16bit_ints: H5Dopen: " + err);
+ }
+
+ // Read data.
+ try {
+ H5.H5Dread(H5did, HDF5Constants.H5T_NATIVE_INT16, HDF5Constants.H5S_ALL, HDF5Constants.H5S_ALL,
+ HDF5Constants.H5P_DEFAULT, dset_data);
+ }
+ catch (Exception err) {
+ err.printStackTrace();
+ fail("testH5Dread_16bit_ints: H5Dread: " + err);
+ }
+ }
+
+ @Test
+ public void testH5Dread_32bit_ints() {
+ int[][] dset_data = new int[DIM_X][DIM16_Y];
+
+ try {
+ openH5file(H5_INTS_FILE, DATASETU32);
+ }
+ catch (Throwable err) {
+ err.printStackTrace();
+ fail("testH5Dread_32bit_ints: openH5file: " + err);
+ }
+
+ // Read data.
+ try {
+ H5.H5Dread(H5did, HDF5Constants.H5T_NATIVE_UINT32, HDF5Constants.H5S_ALL, HDF5Constants.H5S_ALL,
+ HDF5Constants.H5P_DEFAULT, dset_data);
+ }
+ catch (Exception err) {
+ err.printStackTrace();
+ fail("testH5Dread_32bit_ints: H5Dread: " + err);
+ }
+
+ // End access to the dataset and release resources used by it.
+ try {
+ H5.H5Dclose(H5did);
+ }
+ catch (Exception err) {
+ err.printStackTrace();
+ }
+
+ // Open an existing dataset.
+ try {
+ H5did = H5.H5Dopen(H5fid, DATASETS32, HDF5Constants.H5P_DEFAULT);
+ }
+ catch (Exception err) {
+ err.printStackTrace();
+ fail("testH5Dread_32bit_ints: H5Dopen: " + err);
+ }
+
+ // Read data.
+ try {
+ H5.H5Dread(H5did, HDF5Constants.H5T_NATIVE_INT32, HDF5Constants.H5S_ALL, HDF5Constants.H5S_ALL,
+ HDF5Constants.H5P_DEFAULT, dset_data);
+ }
+ catch (Exception err) {
+ err.printStackTrace();
+ fail("testH5Dread_32bit_ints: H5Dread: " + err);
+ }
+ }
+
+ @Test
+ public void testH5Dread_64bit_ints() {
+ long[][] dset_data = new long[DIM_X][DIM64_Y];
+
+ try {
+ openH5file(H5_INTS_FILE, DATASETU64);
+ }
+ catch (Throwable err) {
+ err.printStackTrace();
+ fail("testH5Dread_64bit_ints: openH5file: " + err);
+ }
+
+ // Read data.
+ try {
+ H5.H5Dread(H5did, HDF5Constants.H5T_NATIVE_UINT64, HDF5Constants.H5S_ALL, HDF5Constants.H5S_ALL,
+ HDF5Constants.H5P_DEFAULT, dset_data);
+ }
+ catch (Exception err) {
+ err.printStackTrace();
+ fail("testH5Dread_64bit_ints: H5Dread: " + err);
+ }
+
+ // End access to the dataset and release resources used by it.
+ try {
+ H5.H5Dclose(H5did);
+ }
+ catch (Exception err) {
+ err.printStackTrace();
+ }
+
+ // Open an existing dataset.
+ try {
+ H5did = H5.H5Dopen(H5fid, DATASETS64, HDF5Constants.H5P_DEFAULT);
+ }
+ catch (Exception err) {
+ err.printStackTrace();
+ fail("testH5Dread_64bit_ints: H5Dopen: " + err);
+ }
+
+ // Read data.
+ try {
+ H5.H5Dread(H5did, HDF5Constants.H5T_NATIVE_INT64, HDF5Constants.H5S_ALL, HDF5Constants.H5S_ALL,
+ HDF5Constants.H5P_DEFAULT, dset_data);
+ }
+ catch (Exception err) {
+ err.printStackTrace();
+ fail("testH5Dread_64bit_ints: H5Dread: " + err);
+ }
+ }
+
+ @Test
+ public void testH5Dread_32bit_floats() {
+ float[][] dset_data = new float[DIM_X][DIM32_Y];
+
+ try {
+ openH5file(H5_FLTS_FILE, DATASETF32);
+ }
+ catch (Throwable err) {
+ err.printStackTrace();
+ fail("testH5Dread_32bit_floats: openH5file: " + err);
+ }
+
+ // Read data.
+ try {
+ H5.H5Dread(H5did, HDF5Constants.H5T_NATIVE_FLOAT, HDF5Constants.H5S_ALL, HDF5Constants.H5S_ALL,
+ HDF5Constants.H5P_DEFAULT, dset_data);
+ }
+ catch (Exception err) {
+ err.printStackTrace();
+ fail("testH5Dread_32bit_floats: H5Dread: " + err);
+ }
+ for (int i = 0; i < DIM_X; i++)
+ assertTrue("testH5Dread_32bit_floats - H5.H5Dread: ", dset_data[i][0] == (32 - i));
+ }
+
+ @Test
+ public void testH5Dread_64bit_floats() {
+ double[][] dset_data = new double[DIM_X][DIM64_Y];
+
+ try {
+ openH5file(H5_FLTS_FILE, DATASETF64);
+ }
+ catch (Throwable err) {
+ err.printStackTrace();
+ fail("testH5Dread_64bit_floats: openH5file: " + err);
+ }
+
+ // Read data.
+ try {
+ H5.H5Dread(H5did, HDF5Constants.H5T_NATIVE_DOUBLE, HDF5Constants.H5S_ALL, HDF5Constants.H5S_ALL,
+ HDF5Constants.H5P_DEFAULT, dset_data);
+ }
+ catch (Exception err) {
+ err.printStackTrace();
+ fail("testH5Dread_64bit_floats: H5Dread: " + err);
+ }
+ for (int i = 0; i < DIM_X; i++)
+ assertTrue("testH5Dread_64bit_floats - H5.H5Dread: ", dset_data[i][0] == (64 - i));
+ }
+
+ @Test
+ public void testH5Dread_128bit_floats() {
+ byte[][][] dset_data = new byte[DIM_X][DIM128_Y][8];
+
+ try {
+ openH5file(H5_FLTS_FILE, DATASETF128);
+ }
+ catch (Throwable err) {
+ err.printStackTrace();
+ fail("testH5Dread_128bit_floats: openH5file: " + err);
+ }
+
+ // Read data.
+ try {
+ H5.H5Dread(H5did, HDF5Constants.H5T_NATIVE_LDOUBLE, HDF5Constants.H5S_ALL, HDF5Constants.H5S_ALL,
+ HDF5Constants.H5P_DEFAULT, dset_data);
+ }
+ catch (Exception err) {
+ err.printStackTrace();
+ fail("testH5Dread_128bit_floats: H5Dread: " + err);
+ }
+ }
+
+}
diff --git a/java/test/TestH5E.java b/java/test/TestH5E.java
index 68cd933..cad0a06 100644
--- a/java/test/TestH5E.java
+++ b/java/test/TestH5E.java
@@ -1,6 +1,5 @@
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* 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 *
diff --git a/java/test/TestH5Edefault.java b/java/test/TestH5Edefault.java
index 2f05c75..9e93cea 100644
--- a/java/test/TestH5Edefault.java
+++ b/java/test/TestH5Edefault.java
@@ -1,6 +1,5 @@
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* 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 *
@@ -58,27 +57,27 @@ public class TestH5Edefault {
@Ignore
public void testH5Eprint() {
- /*
- * If HDF5_VOL_CONNECTOR is set, this might not be the
- * native connector and the error stack might be different.
- * Only check for the specific error stack if the native
- * connector is being used.
- */
- String connector = System.getenv("HDF5_VOL_CONNECTOR");
- if (connector == null) {
- try {
- H5.H5Fopen("test", HDF5Constants.H5F_ACC_RDWR, HDF5Constants.H5P_DEFAULT);
- }
- catch (Throwable err) {
- }
- try {
- H5.H5Eprint2(HDF5Constants.H5E_DEFAULT, null);
- }
- catch (Throwable err) {
- err.printStackTrace();
- fail("H5.H5Eprint: " + err);
- }
- }
+ /*
+ * If HDF5_VOL_CONNECTOR is set, this might not be the
+ * native connector and the error stack might be different.
+ * Only check for the specific error stack if the native
+ * connector is being used.
+ */
+ String connector = System.getenv("HDF5_VOL_CONNECTOR");
+ if (connector == null) {
+ try {
+ H5.H5Fopen("test", HDF5Constants.H5F_ACC_RDWR, HDF5Constants.H5P_DEFAULT);
+ }
+ catch (Throwable err) {
+ }
+ try {
+ H5.H5Eprint2(HDF5Constants.H5E_DEFAULT, null);
+ }
+ catch (Throwable err) {
+ err.printStackTrace();
+ fail("H5.H5Eprint: " + err);
+ }
+ }
}
@Test
@@ -439,27 +438,27 @@ public class TestH5Edefault {
@Ignore
public void testH5EprintInt() {
- /*
- * If HDF5_VOL_CONNECTOR is set, this might not be the
- * native connector and the error stack might be different.
- * Only check for the specific error stack if the native
- * connector is being used.
- */
- String connector = System.getenv("HDF5_VOL_CONNECTOR");
- if (connector == null) {
- try {
- H5.H5Fopen("test", HDF5Constants.H5F_ACC_RDWR, HDF5Constants.H5P_DEFAULT);
- }
- catch (Throwable err) {
- }
- try {
- H5.H5Eprint2(HDF5Constants.H5E_DEFAULT, null);
- }
- catch (Throwable err) {
- err.printStackTrace();
- fail("H5.H5EprintInt: " + err);
- }
- }
+ /*
+ * If HDF5_VOL_CONNECTOR is set, this might not be the
+ * native connector and the error stack might be different.
+ * Only check for the specific error stack if the native
+ * connector is being used.
+ */
+ String connector = System.getenv("HDF5_VOL_CONNECTOR");
+ if (connector == null) {
+ try {
+ H5.H5Fopen("test", HDF5Constants.H5F_ACC_RDWR, HDF5Constants.H5P_DEFAULT);
+ }
+ catch (Throwable err) {
+ }
+ try {
+ H5.H5Eprint2(HDF5Constants.H5E_DEFAULT, null);
+ }
+ catch (Throwable err) {
+ err.printStackTrace();
+ fail("H5.H5EprintInt: " + err);
+ }
+ }
}
@Test
diff --git a/java/test/TestH5Eparams.java b/java/test/TestH5Eparams.java
index e74475f..e55f1fc 100644
--- a/java/test/TestH5Eparams.java
+++ b/java/test/TestH5Eparams.java
@@ -1,6 +1,5 @@
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* 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 *
diff --git a/java/test/TestH5Eregister.java b/java/test/TestH5Eregister.java
index 99f8303..99e8e5f 100644
--- a/java/test/TestH5Eregister.java
+++ b/java/test/TestH5Eregister.java
@@ -1,6 +1,5 @@
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* 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 *
diff --git a/java/test/TestH5F.java b/java/test/TestH5F.java
index 3ef4635..16786b9 100644
--- a/java/test/TestH5F.java
+++ b/java/test/TestH5F.java
@@ -1,6 +1,5 @@
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* 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 *
@@ -49,7 +48,7 @@ public class TestH5F {
HDF5Constants.H5F_OBJ_DATASET, HDF5Constants.H5F_OBJ_GROUP,
HDF5Constants.H5F_OBJ_DATATYPE, HDF5Constants.H5F_OBJ_ATTR,
HDF5Constants.H5F_OBJ_ALL };
- long H5fid = -1;
+ long H5fid = HDF5Constants.H5I_INVALID_HID;
private final void _deleteFile(String filename) {
File file = new File(filename);
@@ -74,7 +73,7 @@ public class TestH5F {
public void deleteH5file() throws HDF5LibraryException {
if (H5fid > 0) {
try {H5.H5Fclose(H5fid);} catch (Exception ex) {}
- H5fid = -1;
+ H5fid = HDF5Constants.H5I_INVALID_HID;
}
_deleteFile(H5_FILE);
System.out.println();
@@ -82,7 +81,7 @@ public class TestH5F {
@Test
public void testH5Fget_create_plist() {
- long plist = -1;
+ long plist = HDF5Constants.H5I_INVALID_HID;
try {
plist = H5.H5Fget_create_plist(H5fid);
@@ -106,7 +105,7 @@ public class TestH5F {
@Test
public void testH5Fget_access_plist() {
- long plist = -1;
+ long plist = HDF5Constants.H5I_INVALID_HID;
try {
plist = H5.H5Fget_access_plist(H5fid);
@@ -134,7 +133,7 @@ public class TestH5F {
if (H5fid > 0) {
try {H5.H5Fclose(H5fid);} catch (Exception ex) {}
- H5fid = -1;
+ H5fid = HDF5Constants.H5I_INVALID_HID;
}
try {
@@ -159,7 +158,7 @@ public class TestH5F {
if (H5fid > 0) {
try {H5.H5Fclose(H5fid);} catch (Exception ex) {}
- H5fid = -1;
+ H5fid = HDF5Constants.H5I_INVALID_HID;
}
try {
@@ -182,8 +181,8 @@ public class TestH5F {
public void testH5Fget_fileno_same() {
long fileno1 = 0;
long fileno2 = 0;
- long fid1 = -1;
- long fid2 = -1;
+ long fid1 = HDF5Constants.H5I_INVALID_HID;
+ long fid2 = HDF5Constants.H5I_INVALID_HID;
try {
fid1 = H5.H5Fcreate(H5_FILE2, HDF5Constants.H5F_ACC_TRUNC,
@@ -213,7 +212,7 @@ public class TestH5F {
public void testH5Fget_fileno_diff() {
long fileno1 = 0;
long fileno2 = 0;
- long fid2 = -1;
+ long fid2 = HDF5Constants.H5I_INVALID_HID;
try {
fid2 = H5.H5Fcreate(H5_FILE2, HDF5Constants.H5F_ACC_TRUNC,
diff --git a/java/test/TestH5Fbasic.java b/java/test/TestH5Fbasic.java
index 225e311..4f3d928 100644
--- a/java/test/TestH5Fbasic.java
+++ b/java/test/TestH5Fbasic.java
@@ -1,6 +1,5 @@
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* 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 *
@@ -35,7 +34,7 @@ public class TestH5Fbasic {
@Rule public TestName testname = new TestName();
private static final String H5_FILE = "testFb.h5";
private static final String TXT_FILE = "testFb.txt";
- long H5fid = -1;
+ long H5fid = HDF5Constants.H5I_INVALID_HID;
private final void _deleteFile(String filename) {
File file = new File(filename);
@@ -90,7 +89,7 @@ public class TestH5Fbasic {
@Test(expected = HDF5LibraryException.class)
public void testH5Fopen_read_only() throws Throwable {
- long fid = -1;
+ long fid = HDF5Constants.H5I_INVALID_HID;
try {
fid = H5.H5Fopen(H5_FILE, HDF5Constants.H5F_ACC_RDWR,
@@ -125,8 +124,8 @@ public class TestH5Fbasic {
@Test(expected = HDF5LibraryException.class)
public void testH5Freopen_closed() throws Throwable {
- long fid = -1;
- long fid2 = -1;
+ long fid = HDF5Constants.H5I_INVALID_HID;
+ long fid2 = HDF5Constants.H5I_INVALID_HID;
try {
fid = H5.H5Fopen(H5_FILE, HDF5Constants.H5F_ACC_RDWR,
@@ -148,8 +147,8 @@ public class TestH5Fbasic {
@Test
public void testH5Freopen() {
- long fid = -1;
- long fid2 = -1;
+ long fid = HDF5Constants.H5I_INVALID_HID;
+ long fid2 = HDF5Constants.H5I_INVALID_HID;
try {
fid = H5.H5Fopen(H5_FILE, HDF5Constants.H5F_ACC_RDWR,
@@ -182,7 +181,7 @@ public class TestH5Fbasic {
@Test
public void testH5Fclose() {
- long fid = -1;
+ long fid = HDF5Constants.H5I_INVALID_HID;
try {
fid = H5.H5Fopen(H5_FILE, HDF5Constants.H5F_ACC_RDWR,
@@ -202,7 +201,7 @@ public class TestH5Fbasic {
@Test(expected = HDF5LibraryException.class)
public void testH5Fclose_twice() throws Throwable {
- long fid = -1;
+ long fid = HDF5Constants.H5I_INVALID_HID;
try {
fid = H5.H5Fopen(H5_FILE, HDF5Constants.H5F_ACC_RDWR,
diff --git a/java/test/TestH5Fparams.java b/java/test/TestH5Fparams.java
index 85bfdf5..0376485 100644
--- a/java/test/TestH5Fparams.java
+++ b/java/test/TestH5Fparams.java
@@ -1,6 +1,5 @@
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* 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 *
@@ -105,7 +104,7 @@ public class TestH5Fparams {
@Test
public void testH5Fcreate() {
- long fid = -1;
+ long fid = HDF5Constants.H5I_INVALID_HID;
File file = null;
try {
@@ -132,7 +131,7 @@ public class TestH5Fparams {
@Test
public void testH5Fflush_global() {
- long fid = -1;
+ long fid = HDF5Constants.H5I_INVALID_HID;
try {
fid = H5.H5Fcreate("test.h5", HDF5Constants.H5F_ACC_TRUNC,
@@ -158,7 +157,7 @@ public class TestH5Fparams {
@Test
public void testH5Fflush_local() {
- long fid = -1;
+ long fid = HDF5Constants.H5I_INVALID_HID;
try {
fid = H5.H5Fcreate("test.h5", HDF5Constants.H5F_ACC_TRUNC,
@@ -184,7 +183,7 @@ public class TestH5Fparams {
@Test
public void testH5Fget_info() {
- long fid = -1;
+ long fid = HDF5Constants.H5I_INVALID_HID;
try {
try {
@@ -215,7 +214,7 @@ public class TestH5Fparams {
@Ignore//(expected = HDF5FunctionArgumentException.class)
public void testH5Fset_libver_bounds_invalidlow() throws Throwable {
- long fid = -1;
+ long fid = HDF5Constants.H5I_INVALID_HID;
try {
try {
@@ -234,7 +233,7 @@ public class TestH5Fparams {
@Ignore//(expected = HDF5FunctionArgumentException.class)
public void testH5Fset_libver_bounds_invalidhigh() throws Throwable {
- long fid = -1;
+ long fid = HDF5Constants.H5I_INVALID_HID;
try {
try {
diff --git a/java/test/TestH5Fswmr.java b/java/test/TestH5Fswmr.java
index 6a7ccfa..1ec78fe 100644
--- a/java/test/TestH5Fswmr.java
+++ b/java/test/TestH5Fswmr.java
@@ -1,6 +1,5 @@
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* 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 *
@@ -33,9 +32,9 @@ public class TestH5Fswmr {
@Rule public TestName testname = new TestName();
private static final String H5_FILE = "testswmr.h5";
- long H5fid = -1;
- long H5fapl = -1;
- long H5fcpl = -1;
+ long H5fid = HDF5Constants.H5I_INVALID_HID;
+ long H5fapl = HDF5Constants.H5I_INVALID_HID;
+ long H5fcpl = HDF5Constants.H5I_INVALID_HID;
private final void _deleteFile(String filename) {
File file = new File(filename);
@@ -63,15 +62,15 @@ public class TestH5Fswmr {
public void deleteH5file() throws HDF5LibraryException {
if (H5fapl > 0) {
try {H5.H5Pclose(H5fapl);} catch (Exception ex) {}
- H5fapl = -1;
+ H5fapl = HDF5Constants.H5I_INVALID_HID;
}
if (H5fcpl > 0) {
try {H5.H5Pclose(H5fcpl);} catch (Exception ex) {}
- H5fcpl = -1;
+ H5fcpl = HDF5Constants.H5I_INVALID_HID;
}
if (H5fid > 0) {
try {H5.H5Fclose(H5fid);} catch (Exception ex) {}
- H5fid = -1;
+ H5fid = HDF5Constants.H5I_INVALID_HID;
}
_deleteFile(H5_FILE);
System.out.println();
diff --git a/java/test/TestH5G.java b/java/test/TestH5G.java
index abd9642..edf2cbe 100644
--- a/java/test/TestH5G.java
+++ b/java/test/TestH5G.java
@@ -1,6 +1,5 @@
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* 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 *
@@ -39,11 +38,11 @@ public class TestH5G {
private static final String[] GROUPS = { "/G1", "/G1/G11", "/G1/G12",
"/G1/G11/G111", "/G1/G11/G112", "/G1/G11/G113", "/G1/G11/G114" };
private static final String[] GROUPS2 = { "/G1", "/G1/G14", "/G1/G12", "/G1/G13", "/G1/G11"};
- long H5fid = -1;
- long H5fid2 = -1;
+ long H5fid = HDF5Constants.H5I_INVALID_HID;
+ long H5fid2 = HDF5Constants.H5I_INVALID_HID;
private final long _createGroup(long fid, String name) {
- long gid = -1;
+ long gid = HDF5Constants.H5I_INVALID_HID;
try {
gid = H5.H5Gcreate(fid, name, HDF5Constants.H5P_DEFAULT,
HDF5Constants.H5P_DEFAULT, HDF5Constants.H5P_DEFAULT);
@@ -58,8 +57,8 @@ public class TestH5G {
}
private final long _createGroup2(long fid, String name) {
- long gid = -1;
- long gcpl = -1;
+ long gid = HDF5Constants.H5I_INVALID_HID;
+ long gcpl = HDF5Constants.H5I_INVALID_HID;
try {
gcpl = H5.H5Pcreate(HDF5Constants.H5P_GROUP_CREATE); //create gcpl
}
@@ -92,12 +91,12 @@ public class TestH5G {
}
private final long _openGroup(long fid, String name) {
- long gid = -1;
+ long gid = HDF5Constants.H5I_INVALID_HID;
try {
gid = H5.H5Gopen(fid, name, HDF5Constants.H5P_DEFAULT);
}
catch (Throwable err) {
- gid = -1;
+ gid = HDF5Constants.H5I_INVALID_HID;
err.printStackTrace();
fail("H5.H5Gopen: " + err);
}
@@ -134,7 +133,7 @@ public class TestH5G {
assertTrue("TestH5G.createH5file: H5.H5Fcreate: ", H5fid > 0);
assertTrue("TestH5G.createH5file: H5.H5Fcreate: ", H5fid2 > 0);
- long gid = -1;
+ long gid = HDF5Constants.H5I_INVALID_HID;
for (int i = 0; i < GROUPS.length; i++) {
gid = _createGroup(H5fid, GROUPS[i]);
@@ -165,7 +164,7 @@ public class TestH5G {
@Test
public void testH5Gopen() {
- long gid = -1;
+ long gid = HDF5Constants.H5I_INVALID_HID;
for (int i = 0; i < GROUPS.length; i++) {
try {
gid = H5.H5Gopen(H5fid, GROUPS[i], HDF5Constants.H5P_DEFAULT);
@@ -185,8 +184,8 @@ public class TestH5G {
@Test
public void testH5Gget_create_plist() {
- long gid = -1;
- long pid = -1;
+ long gid = HDF5Constants.H5I_INVALID_HID;
+ long pid = HDF5Constants.H5I_INVALID_HID;
for (int i = 0; i < GROUPS.length; i++) {
try {
@@ -325,7 +324,7 @@ public class TestH5G {
int names_found = 0;
try {
names_found = H5.H5Gget_obj_info_all(gid, null, objNames, objTypes, lnkTypes,
- objTokens, HDF5Constants.H5_INDEX_NAME);
+ objTokens, HDF5Constants.H5_INDEX_NAME);
}
catch (Throwable err) {
err.printStackTrace();
@@ -366,7 +365,7 @@ public class TestH5G {
int names_found = 0;
try {
names_found = H5.H5Gget_obj_info_all(gid, null, objNames, objTypes, lnkTypes,
- objTokens, HDF5Constants.H5_INDEX_NAME);
+ objTokens, HDF5Constants.H5_INDEX_NAME);
}
catch (Throwable err) {
err.printStackTrace();
@@ -401,7 +400,7 @@ public class TestH5G {
int names_found = 0;
try {
names_found = H5.H5Gget_obj_info_max(gid, objNames, objTypes, lnkTypes,
- objTokens, groups_max_size);
+ objTokens, groups_max_size);
}
catch (Throwable err) {
err.printStackTrace();
@@ -432,7 +431,7 @@ public class TestH5G {
int names_found = 0;
try {
names_found = H5.H5Gget_obj_info_max(gid, objNames, objTypes, lnkTypes,
- objTokens, groups_max_size);
+ objTokens, groups_max_size);
}
catch (Throwable err) {
err.printStackTrace();
diff --git a/java/test/TestH5Gbasic.java b/java/test/TestH5Gbasic.java
index aea417e..6e2e450 100644
--- a/java/test/TestH5Gbasic.java
+++ b/java/test/TestH5Gbasic.java
@@ -1,6 +1,5 @@
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* 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 *
@@ -33,10 +32,10 @@ import org.junit.rules.TestName;
public class TestH5Gbasic {
@Rule public TestName testname = new TestName();
private static final String H5_FILE = "testGb.h5";
- long H5fid = -1;
+ long H5fid = HDF5Constants.H5I_INVALID_HID;
private final long _createGroup(long fid, String name) {
- long gid = -1;
+ long gid = HDF5Constants.H5I_INVALID_HID;
try {
gid = H5.H5Gcreate(fid, name, HDF5Constants.H5P_DEFAULT,
HDF5Constants.H5P_DEFAULT, HDF5Constants.H5P_DEFAULT);
@@ -85,7 +84,7 @@ public class TestH5Gbasic {
@Test(expected = NullPointerException.class)
public void testH5Gcreate_null() throws Throwable {
- long gid = -1;
+ long gid = HDF5Constants.H5I_INVALID_HID;
// it should fail because the group name is null
gid = H5.H5Gcreate(H5fid, null, HDF5Constants.H5P_DEFAULT,
@@ -102,7 +101,7 @@ public class TestH5Gbasic {
@Test
public void testH5Gcreate() {
- long gid = -1;
+ long gid = HDF5Constants.H5I_INVALID_HID;
try {
gid = H5.H5Gcreate(H5fid, "/testH5Gcreate",
HDF5Constants.H5P_DEFAULT, HDF5Constants.H5P_DEFAULT,
@@ -145,7 +144,7 @@ public class TestH5Gbasic {
@Test
public void testH5Gcreate_anon() {
- long gid = -1;
+ long gid = HDF5Constants.H5I_INVALID_HID;
try {
gid = H5.H5Gcreate_anon(H5fid, HDF5Constants.H5P_DEFAULT,
HDF5Constants.H5P_DEFAULT);
@@ -161,7 +160,7 @@ public class TestH5Gbasic {
@Test(expected = NullPointerException.class)
public void testH5Gopen_null() throws Throwable {
- long gid = -1;
+ long gid = HDF5Constants.H5I_INVALID_HID;
gid = H5.H5Gopen(H5fid, null, HDF5Constants.H5P_DEFAULT);
@@ -175,7 +174,7 @@ public class TestH5Gbasic {
@Test(expected = HDF5LibraryException.class)
public void testH5Gopen_not_exists() throws Throwable {
- long gid = -1;
+ long gid = HDF5Constants.H5I_INVALID_HID;
gid = H5.H5Gopen(H5fid, "Never_created", HDF5Constants.H5P_DEFAULT);
@@ -209,7 +208,7 @@ public class TestH5Gbasic {
@Test
public void testH5Gget_create_plist() {
- long pid = -1;
+ long pid = HDF5Constants.H5I_INVALID_HID;
long gid = _createGroup(H5fid, "/testH5Gcreate");
assertTrue(gid > 0);
diff --git a/java/test/TestH5Giterate.java b/java/test/TestH5Giterate.java
index af210ca..388d2ac 100644
--- a/java/test/TestH5Giterate.java
+++ b/java/test/TestH5Giterate.java
@@ -1,6 +1,5 @@
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* 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 *
@@ -31,15 +30,15 @@ import org.junit.rules.TestName;
public class TestH5Giterate {
@Rule public TestName testname = new TestName();
private static final String H5_FILE = "h5ex_g_iterate.hdf";
- long H5fid = -1;
+ long H5fid = HDF5Constants.H5I_INVALID_HID;
private final long _openGroup(long fid, String name) {
- long gid = -1;
+ long gid = HDF5Constants.H5I_INVALID_HID;
try {
gid = H5.H5Gopen(fid, name, HDF5Constants.H5P_DEFAULT);
}
catch (Throwable err) {
- gid = -1;
+ gid = HDF5Constants.H5I_INVALID_HID;
err.printStackTrace();
fail("H5.H5Gcreate: " + err);
}
diff --git a/java/test/TestH5Lbasic.java b/java/test/TestH5Lbasic.java
index bc4d65c..a28fc3d 100644
--- a/java/test/TestH5Lbasic.java
+++ b/java/test/TestH5Lbasic.java
@@ -1,6 +1,5 @@
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* 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 *
@@ -35,7 +34,7 @@ import org.junit.rules.TestName;
public class TestH5Lbasic {
@Rule public TestName testname = new TestName();
private static final String H5_FILE = "h5ex_g_iterateL1.hdf";
- long H5fid = -1;
+ long H5fid = HDF5Constants.H5I_INVALID_HID;
@Before
public void openH5file()
diff --git a/java/test/TestH5Lcreate.java b/java/test/TestH5Lcreate.java
index de29c1e..44af2e5 100644
--- a/java/test/TestH5Lcreate.java
+++ b/java/test/TestH5Lcreate.java
@@ -1,6 +1,5 @@
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* 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 *
@@ -41,13 +40,13 @@ public class TestH5Lcreate {
private static final String H5_FILE = "testL.h5";
private static final int DIM_X = 4;
private static final int DIM_Y = 6;
- long H5fcpl = -1;
- long H5fid = -1;
- long H5dsid = -1;
- long H5did1 = -1;
- long H5did2 = -1;
- long H5gcpl = -1;
- long H5gid = -1;
+ long H5fcpl = HDF5Constants.H5I_INVALID_HID;
+ long H5fid = HDF5Constants.H5I_INVALID_HID;
+ long H5dsid = HDF5Constants.H5I_INVALID_HID;
+ long H5did1 = HDF5Constants.H5I_INVALID_HID;
+ long H5did2 = HDF5Constants.H5I_INVALID_HID;
+ long H5gcpl = HDF5Constants.H5I_INVALID_HID;
+ long H5gid = HDF5Constants.H5I_INVALID_HID;
long[] H5dims = { DIM_X, DIM_Y };
private final void _deleteFile(String filename) {
@@ -64,7 +63,7 @@ public class TestH5Lcreate {
}
private final long _createDataset(long fid, long dsid, String name, long dapl) {
- long did = -1;
+ long did = HDF5Constants.H5I_INVALID_HID;
try {
did = H5.H5Dcreate(fid, name,
HDF5Constants.H5T_STD_I32BE, dsid,
@@ -80,7 +79,7 @@ public class TestH5Lcreate {
}
private final long _createGroup(long fid, String name) {
- long gid = -1;
+ long gid = HDF5Constants.H5I_INVALID_HID;
try {
H5gcpl = HDF5Constants.H5P_DEFAULT;
gid = H5.H5Gcreate(fid, name, HDF5Constants.H5P_DEFAULT,
diff --git a/java/test/TestH5Lparams.java b/java/test/TestH5Lparams.java
index 2ce1eca..30ee242 100644
--- a/java/test/TestH5Lparams.java
+++ b/java/test/TestH5Lparams.java
@@ -1,6 +1,5 @@
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* 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 *
diff --git a/java/test/TestH5Obasic.java b/java/test/TestH5Obasic.java
index 89474c4..350b7aa 100644
--- a/java/test/TestH5Obasic.java
+++ b/java/test/TestH5Obasic.java
@@ -1,6 +1,5 @@
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* 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 *
@@ -41,7 +40,7 @@ public class TestH5Obasic {
private static final String H5_FILE = "h5ex_g_iterateO1.hdf";
private static H5O_token_t H5la_ds1 = null;
private static H5O_token_t H5la_l1 = null;
- long H5fid = -1;
+ long H5fid = HDF5Constants.H5I_INVALID_HID;
@Before
public void openH5file()
@@ -69,7 +68,7 @@ public class TestH5Obasic {
@Test(expected = HDF5LibraryException.class)
public void testH5Oopen_not_exists() throws Throwable {
- long oid = -1;
+ long oid = HDF5Constants.H5I_INVALID_HID;
oid = H5.H5Oopen(H5fid, "Never_created", HDF5Constants.H5P_DEFAULT);
@@ -78,7 +77,7 @@ public class TestH5Obasic {
@Test
public void testH5Oget_info_dataset() {
- long oid = -1;
+ long oid = HDF5Constants.H5I_INVALID_HID;
H5O_info_t obj_info = null;
try {
@@ -96,7 +95,7 @@ public class TestH5Obasic {
@Test
public void testH5Oget_info_hardlink() {
- long oid = -1;
+ long oid = HDF5Constants.H5I_INVALID_HID;
H5O_info_t obj_info = null;
try {
oid = H5.H5Oopen(H5fid, "L1", HDF5Constants.H5P_DEFAULT);
@@ -113,7 +112,7 @@ public class TestH5Obasic {
@Test
public void testH5Oget_info_group() {
- long oid = -1;
+ long oid = HDF5Constants.H5I_INVALID_HID;
H5O_info_t obj_info = null;
try {
oid = H5.H5Oopen(H5fid, "G1", HDF5Constants.H5P_DEFAULT);
@@ -130,7 +129,7 @@ public class TestH5Obasic {
@Test
public void testH5Oget_info_datatype() {
- long oid = -1;
+ long oid = HDF5Constants.H5I_INVALID_HID;
H5O_info_t obj_info = null;
try {
oid = H5.H5Oopen(H5fid, "DT1", HDF5Constants.H5P_DEFAULT);
@@ -234,7 +233,7 @@ public class TestH5Obasic {
@Test
public void testH5Oget_info_by_idx_n0() {
- long oid = -1;
+ long oid = HDF5Constants.H5I_INVALID_HID;
H5O_info_t obj_info = null;
try {
oid = H5.H5Oopen(H5fid, "DS1", HDF5Constants.H5P_DEFAULT);
@@ -260,7 +259,7 @@ public class TestH5Obasic {
@Test
public void testH5Oget_info_by_idx_n3() {
- long oid = -1;
+ long oid = HDF5Constants.H5I_INVALID_HID;
H5O_info_t obj_info = null;
try {
oid = H5.H5Oopen(H5fid, "L1", HDF5Constants.H5P_DEFAULT);
@@ -286,7 +285,7 @@ public class TestH5Obasic {
@Test
public void testH5Oget_native_info_dataset() {
- long oid = -1;
+ long oid = HDF5Constants.H5I_INVALID_HID;
H5O_native_info_t native_info = null;
try {
@@ -306,7 +305,7 @@ public class TestH5Obasic {
@Test
public void testH5Oget_native_info_hardlink() {
- long oid = -1;
+ long oid = HDF5Constants.H5I_INVALID_HID;
H5O_native_info_t native_info = null;
try {
@@ -326,7 +325,7 @@ public class TestH5Obasic {
@Test
public void testH5Oget_native_info_group() {
- long oid = -1;
+ long oid = HDF5Constants.H5I_INVALID_HID;
H5O_native_info_t native_info = null;
try {
@@ -346,7 +345,7 @@ public class TestH5Obasic {
@Test
public void testH5Oget_native_info_datatype() {
- long oid = -1;
+ long oid = HDF5Constants.H5I_INVALID_HID;
H5O_native_info_t native_info = null;
try {
@@ -376,10 +375,10 @@ public class TestH5Obasic {
@Test
public void testH5Oget_native_info_by_name_dataset() {
- H5O_native_info_t native_info = null;
+ H5O_native_info_t native_info = null;
try {
- native_info = H5.H5Oget_native_info_by_name(H5fid, "DS1", HDF5Constants.H5P_DEFAULT);
+ native_info = H5.H5Oget_native_info_by_name(H5fid, "DS1", HDF5Constants.H5P_DEFAULT);
}
catch (Throwable err) {
err.printStackTrace();
@@ -393,10 +392,10 @@ public class TestH5Obasic {
@Test
public void testH5Oget_native_info_by_name_hardlink() {
- H5O_native_info_t native_info = null;
+ H5O_native_info_t native_info = null;
try {
- native_info = H5.H5Oget_native_info_by_name(H5fid, "L1", HDF5Constants.H5P_DEFAULT);
+ native_info = H5.H5Oget_native_info_by_name(H5fid, "L1", HDF5Constants.H5P_DEFAULT);
}
catch (Throwable err) {
err.printStackTrace();
@@ -410,10 +409,10 @@ public class TestH5Obasic {
@Test
public void testH5Oget_native_info_by_name_group() {
- H5O_native_info_t native_info = null;
+ H5O_native_info_t native_info = null;
try {
- native_info = H5.H5Oget_native_info_by_name(H5fid, "G1", HDF5Constants.H5P_DEFAULT);
+ native_info = H5.H5Oget_native_info_by_name(H5fid, "G1", HDF5Constants.H5P_DEFAULT);
}
catch (Throwable err) {
err.printStackTrace();
@@ -427,10 +426,10 @@ public class TestH5Obasic {
@Test
public void testH5Oget_native_info_by_name_datatype() {
- H5O_native_info_t native_info = null;
+ H5O_native_info_t native_info = null;
try {
- native_info = H5.H5Oget_native_info_by_name(H5fid, "DT1", HDF5Constants.H5P_DEFAULT);
+ native_info = H5.H5Oget_native_info_by_name(H5fid, "DT1", HDF5Constants.H5P_DEFAULT);
}
catch (Throwable err) {
err.printStackTrace();
@@ -464,7 +463,7 @@ public class TestH5Obasic {
@Test
public void testH5Oget_native_info_by_idx_n0() {
- long oid = -1;
+ long oid = HDF5Constants.H5I_INVALID_HID;
H5O_native_info_t native_info = null;
H5O_hdr_info_t ohdr;
H5_ih_info_t oinfo;
@@ -486,7 +485,7 @@ public class TestH5Obasic {
try {H5.H5Oclose(oid);} catch (Exception ex) {}
try {
- native_info = H5.H5Oget_native_info_by_idx(H5fid, "/", HDF5Constants.H5_INDEX_NAME, HDF5Constants.H5_ITER_INC, 0, HDF5Constants.H5P_DEFAULT);
+ native_info = H5.H5Oget_native_info_by_idx(H5fid, "/", HDF5Constants.H5_INDEX_NAME, HDF5Constants.H5_ITER_INC, 0, HDF5Constants.H5P_DEFAULT);
}
catch (Throwable err) {
err.printStackTrace();
@@ -503,7 +502,7 @@ public class TestH5Obasic {
@Test
public void testH5Oget_native_info_by_idx_n3() {
- long oid = -1;
+ long oid = HDF5Constants.H5I_INVALID_HID;
H5O_native_info_t native_info = null;
H5O_hdr_info_t ohdr;
H5_ih_info_t oinfo;
@@ -525,7 +524,7 @@ public class TestH5Obasic {
try {H5.H5Oclose(oid);} catch (Exception ex) {}
try {
- native_info = H5.H5Oget_native_info_by_idx(H5fid, "/", HDF5Constants.H5_INDEX_NAME, HDF5Constants.H5_ITER_INC, 3, HDF5Constants.H5P_DEFAULT);
+ native_info = H5.H5Oget_native_info_by_idx(H5fid, "/", HDF5Constants.H5_INDEX_NAME, HDF5Constants.H5_ITER_INC, 3, HDF5Constants.H5P_DEFAULT);
}
catch (Throwable err) {
err.printStackTrace();
@@ -630,7 +629,7 @@ public class TestH5Obasic {
@Test
public void testH5Oopen_by_token() {
- long oid = -1;
+ long oid = HDF5Constants.H5I_INVALID_HID;
H5O_info_t obj_info = null;
try {
try {
@@ -668,7 +667,7 @@ public class TestH5Obasic {
@Test
public void testH5Oopen_by_idx_n0() {
- long oid = -1;
+ long oid = HDF5Constants.H5I_INVALID_HID;
H5O_info_t obj_info = null;
try {
try {
@@ -706,7 +705,7 @@ public class TestH5Obasic {
@Test
public void testH5Oopen_by_idx_n3() {
- long oid = -1;
+ long oid = HDF5Constants.H5I_INVALID_HID;
H5O_info_t obj_info = null;
try {
try {
diff --git a/java/test/TestH5Ocopy.java b/java/test/TestH5Ocopy.java
index 4888e76..b3b1acd 100644
--- a/java/test/TestH5Ocopy.java
+++ b/java/test/TestH5Ocopy.java
@@ -1,6 +1,5 @@
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* 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 *
@@ -36,13 +35,13 @@ public class TestH5Ocopy {
private static final String FILENAME = "testRefsattribute.h5";
private static final int DIM_X = 4;
private static final int DIM_Y = 6;
- long H5fid = -1;
- long H5dsid = -1;
- long H5did1 = -1;
- long H5did2 = -1;
- long H5gcpl = -1;
- long H5gid = -1;
- long H5dsid2 = -1;
+ long H5fid = HDF5Constants.H5I_INVALID_HID;
+ long H5dsid = HDF5Constants.H5I_INVALID_HID;
+ long H5did1 = HDF5Constants.H5I_INVALID_HID;
+ long H5did2 = HDF5Constants.H5I_INVALID_HID;
+ long H5gcpl = HDF5Constants.H5I_INVALID_HID;
+ long H5gid = HDF5Constants.H5I_INVALID_HID;
+ long H5dsid2 = HDF5Constants.H5I_INVALID_HID;
long[] dims = { 2 };
private final void _deleteFile(String filename) {
@@ -59,7 +58,7 @@ public class TestH5Ocopy {
}
private final long _createDataset(long fid, long dsid, String name, long dapl) {
- long did = -1;
+ long did = HDF5Constants.H5I_INVALID_HID;
try {
did = H5.H5Dcreate(fid, name,
HDF5Constants.H5T_STD_I32BE, dsid,
@@ -75,7 +74,7 @@ public class TestH5Ocopy {
}
private final long _createGroup(long fid, String name) {
- long gid = -1;
+ long gid = HDF5Constants.H5I_INVALID_HID;
try {
H5gcpl = HDF5Constants.H5P_DEFAULT;
gid = H5.H5Gcreate(fid, name, HDF5Constants.H5P_DEFAULT,
@@ -136,10 +135,10 @@ public class TestH5Ocopy {
@Test
public void testH5OcopyRefsAttr() {
- long ocp_plist_id = -1;
+ long ocp_plist_id = HDF5Constants.H5I_INVALID_HID;
byte rbuf0[]=null , rbuf1[] = null;
byte[] dset_data = new byte[16];
- long attribute_id = -1;
+ long attribute_id = HDF5Constants.H5I_INVALID_HID;
try {
@@ -184,9 +183,9 @@ public class TestH5Ocopy {
public void testH5OcopyRefsDatasettodiffFile() {
byte rbuf1[] = null;
byte[] dset_data = new byte[16];
- long ocp_plist_id = -1;
- long dataset_id = -1;
- long H5fid2 = -1;
+ long ocp_plist_id = HDF5Constants.H5I_INVALID_HID;
+ long dataset_id = HDF5Constants.H5I_INVALID_HID;
+ long H5fid2 = HDF5Constants.H5I_INVALID_HID;
try {
rbuf1 = H5.H5Rcreate(H5fid, "DS2", HDF5Constants.H5R_OBJECT, -1);
@@ -244,9 +243,9 @@ public class TestH5Ocopy {
public void testH5OcopyRefsDatasettosameFile() {
byte rbuf0[]=null , rbuf1[] = null;
byte[] dset_data = new byte[16];
- long ocp_plist_id = -1;
- long dataset_id = -1;
- long did = -1;
+ long ocp_plist_id = HDF5Constants.H5I_INVALID_HID;
+ long dataset_id = HDF5Constants.H5I_INVALID_HID;
+ long did = HDF5Constants.H5I_INVALID_HID;
int obj_type = -1;
byte[] read_data = new byte[16];
@@ -328,9 +327,9 @@ public class TestH5Ocopy {
// @Test(expected = HDF5LibraryException.class)
// public void testH5OcopyInvalidRef() throws Throwable {
// final long _pid_ = HDF5Constants.H5P_DEFAULT;
-// long sid = -1;
-// long did = -1;
-// long aid = -1;
+// long sid = HDF5Constants.H5I_INVALID_HID;
+// long did = HDF5Constants.H5I_INVALID_HID;
+// long aid = HDF5Constants.H5I_INVALID_HID;
//
// try {
// sid = H5.H5Screate_simple(1, new long[] {1}, null);
diff --git a/java/test/TestH5Ocreate.java b/java/test/TestH5Ocreate.java
index 959e990..78ea744 100644
--- a/java/test/TestH5Ocreate.java
+++ b/java/test/TestH5Ocreate.java
@@ -1,6 +1,5 @@
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* 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 *
@@ -41,13 +40,13 @@ public class TestH5Ocreate {
private static final String H5_FILE = "testO.h5";
private static final int DIM_X = 4;
private static final int DIM_Y = 6;
- long H5fcpl = -1;
- long H5fid = -1;
- long H5dsid = -1;
- long H5did1 = -1;
- long H5did2 = -1;
- long H5gcpl = -1;
- long H5gid = -1;
+ long H5fcpl = HDF5Constants.H5I_INVALID_HID;
+ long H5fid = HDF5Constants.H5I_INVALID_HID;
+ long H5dsid = HDF5Constants.H5I_INVALID_HID;
+ long H5did1 = HDF5Constants.H5I_INVALID_HID;
+ long H5did2 = HDF5Constants.H5I_INVALID_HID;
+ long H5gcpl = HDF5Constants.H5I_INVALID_HID;
+ long H5gid = HDF5Constants.H5I_INVALID_HID;
long[] H5dims = { DIM_X, DIM_Y };
private final void _deleteFile(String filename) {
@@ -64,7 +63,7 @@ public class TestH5Ocreate {
}
private final long _createDataset(long fid, long dsid, String name, long dapl) {
- long did = -1;
+ long did = HDF5Constants.H5I_INVALID_HID;
try {
did = H5.H5Dcreate(fid, name,
HDF5Constants.H5T_STD_I32BE, dsid,
@@ -80,7 +79,7 @@ public class TestH5Ocreate {
}
private final long _createGroup(long fid, String name) {
- long gid = -1;
+ long gid = HDF5Constants.H5I_INVALID_HID;
try {
H5gcpl = HDF5Constants.H5P_DEFAULT;
gid = H5.H5Gcreate(fid, name, HDF5Constants.H5P_DEFAULT,
@@ -293,7 +292,7 @@ public class TestH5Ocreate {
@Test
public void testH5Olink() {
- long oid = -1;
+ long oid = HDF5Constants.H5I_INVALID_HID;
H5O_info_t obj_info = null;
H5O_info_t dst_obj_info = null;
try {
@@ -380,7 +379,7 @@ public class TestH5Ocreate {
@Test
public void testH5Ocomment() {
- long oid = -1;
+ long oid = HDF5Constants.H5I_INVALID_HID;
String obj_comment = null;
try {
oid = H5.H5Oopen(H5fid, "DS1", HDF5Constants.H5P_DEFAULT);
@@ -405,7 +404,7 @@ public class TestH5Ocreate {
@Test
public void testH5Ocomment_clear() {
- long oid = -1;
+ long oid = HDF5Constants.H5I_INVALID_HID;
String obj_comment = null;
try {
oid = H5.H5Oopen(H5fid, "DS1", HDF5Constants.H5P_DEFAULT);
@@ -506,7 +505,7 @@ public class TestH5Ocreate {
@Test
public void testH5Oinc_dec_count() {
- long oid = -1;
+ long oid = HDF5Constants.H5I_INVALID_HID;
H5O_info_t obj_info = null;
try {
try {
diff --git a/java/test/TestH5Oparams.java b/java/test/TestH5Oparams.java
index 1ad31cb..5cbabe1 100644
--- a/java/test/TestH5Oparams.java
+++ b/java/test/TestH5Oparams.java
@@ -1,6 +1,5 @@
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* 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 *
diff --git a/java/test/TestH5P.java b/java/test/TestH5P.java
index 786c330..3879128 100644
--- a/java/test/TestH5P.java
+++ b/java/test/TestH5P.java
@@ -1,6 +1,5 @@
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* 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 *
@@ -41,20 +40,20 @@ public class TestH5P {
private static final int DIM_X = 4;
private static final int DIM_Y = 6;
long[] H5dims = { DIM_X, DIM_Y };
- long H5fid = -1;
- long H5dsid = -1;
- long H5did = -1;
- long lapl_id = -1;
- long fapl_id = -1;
- long fcpl_id = -1;
- long ocpl_id = -1;
- long ocp_plist_id = -1;
- long lcpl_id = -1;
- long plapl_id = -1;
- long plist_id = -1;
- long gapl_id = -1;
- long gcpl_id = -1;
- long acpl_id = -1;
+ long H5fid = HDF5Constants.H5I_INVALID_HID;
+ long H5dsid = HDF5Constants.H5I_INVALID_HID;
+ long H5did = HDF5Constants.H5I_INVALID_HID;
+ long lapl_id = HDF5Constants.H5I_INVALID_HID;
+ long fapl_id = HDF5Constants.H5I_INVALID_HID;
+ long fcpl_id = HDF5Constants.H5I_INVALID_HID;
+ long ocpl_id = HDF5Constants.H5I_INVALID_HID;
+ long ocp_plist_id = HDF5Constants.H5I_INVALID_HID;
+ long lcpl_id = HDF5Constants.H5I_INVALID_HID;
+ long plapl_id = HDF5Constants.H5I_INVALID_HID;
+ long plist_id = HDF5Constants.H5I_INVALID_HID;
+ long gapl_id = HDF5Constants.H5I_INVALID_HID;
+ long gcpl_id = HDF5Constants.H5I_INVALID_HID;
+ long acpl_id = HDF5Constants.H5I_INVALID_HID;
private final void _deleteFile(String filename) {
File file = new File(filename);
@@ -65,7 +64,7 @@ public class TestH5P {
}
private final long _createDataset(long fid, long dsid, String name, long dapl) {
- long did = -1;
+ long did = HDF5Constants.H5I_INVALID_HID;
try {
did = H5.H5Dcreate(fid, name, HDF5Constants.H5T_STD_I32BE, dsid,
HDF5Constants.H5P_DEFAULT, HDF5Constants.H5P_DEFAULT, dapl);
diff --git a/java/test/TestH5PData.java b/java/test/TestH5PData.java
index 82864cd..8b04629 100644
--- a/java/test/TestH5PData.java
+++ b/java/test/TestH5PData.java
@@ -1,6 +1,5 @@
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* 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 *
@@ -37,10 +36,10 @@ public class TestH5PData {
private static final String H5_FILE = "testPD.h5";
private static final int DIM_X = 12;
private static final int DIM_Y = 18;
- long H5fid = -1;
- long H5dsid = -1;
- long H5did = -1;
- long plist_id = -1;
+ long H5fid = HDF5Constants.H5I_INVALID_HID;
+ long H5dsid = HDF5Constants.H5I_INVALID_HID;
+ long H5did = HDF5Constants.H5I_INVALID_HID;
+ long plist_id = HDF5Constants.H5I_INVALID_HID;
long[] H5dims = { DIM_X, DIM_Y };
double windchillF[][] =
{{36.0, 31.0, 25.0, 19.0, 13.0, 7.0, 1.0, -5.0, -11.0, -16.0, -22.0, -28.0, -34.0, -40.0, -46.0, -52.0, -57.0, -63.0},
@@ -66,7 +65,7 @@ public class TestH5PData {
}
private final long _createFloatDataset(long fid, long dsid, String name, long dapl) {
- long did = -1;
+ long did = HDF5Constants.H5I_INVALID_HID;
try {
did = H5.H5Dcreate(fid, name, HDF5Constants.H5T_NATIVE_FLOAT, dsid,
HDF5Constants.H5P_DEFAULT, HDF5Constants.H5P_DEFAULT, dapl);
diff --git a/java/test/TestH5PL.java b/java/test/TestH5PL.java
index 98665dc..d44cc0b 100644
--- a/java/test/TestH5PL.java
+++ b/java/test/TestH5PL.java
@@ -1,6 +1,5 @@
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* 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 *
@@ -147,11 +146,11 @@ public class TestH5PL {
@Ignore
public void TestH5PLdlopen() {
- long file_id = -1;
- long filespace_id = -1;
- long dataset_id = -1;
- long fapl_id = -1;
- long dcpl_id = -1;
+ long file_id = HDF5Constants.H5I_INVALID_HID;
+ long filespace_id = HDF5Constants.H5I_INVALID_HID;
+ long dataset_id = HDF5Constants.H5I_INVALID_HID;
+ long fapl_id = HDF5Constants.H5I_INVALID_HID;
+ long dcpl_id = HDF5Constants.H5I_INVALID_HID;
try {
int[] cd_values = {9, 0, 0, 0};
int[] libversion = {0, 0, 0};
diff --git a/java/test/TestH5Pfapl.java b/java/test/TestH5Pfapl.java
index e1f5200..cc674e2 100644
--- a/java/test/TestH5Pfapl.java
+++ b/java/test/TestH5Pfapl.java
@@ -1,6 +1,5 @@
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* 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 *
@@ -47,17 +46,17 @@ public class TestH5Pfapl {
private static final int DIM_Y = 6;
private static final int DIMF_X = 12;
private static final int DIMF_Y = 18;
- long H5fid = -1;
- long H5dsid = -1;
- long H5did = -1;
- long H5Fdsid = -1;
- long H5Fdid = -1;
+ long H5fid = HDF5Constants.H5I_INVALID_HID;
+ long H5dsid = HDF5Constants.H5I_INVALID_HID;
+ long H5did = HDF5Constants.H5I_INVALID_HID;
+ long H5Fdsid = HDF5Constants.H5I_INVALID_HID;
+ long H5Fdid = HDF5Constants.H5I_INVALID_HID;
long[] H5dims = { DIM_X, DIM_Y };
- long fapl_id = -1;
- long plapl_id = -1;
- long dapl_id = -1;
- long plist_id = -1;
- long btplist_id = -1;
+ long fapl_id = HDF5Constants.H5I_INVALID_HID;
+ long plapl_id = HDF5Constants.H5I_INVALID_HID;
+ long dapl_id = HDF5Constants.H5I_INVALID_HID;
+ long plist_id = HDF5Constants.H5I_INVALID_HID;
+ long btplist_id = HDF5Constants.H5I_INVALID_HID;
long[] H5Fdims = { DIMF_X, DIMF_Y };
double windchillF[][] =
{{36.0, 31.0, 25.0, 19.0, 13.0, 7.0, 1.0, -5.0, -11.0, -16.0, -22.0, -28.0, -34.0, -40.0, -46.0, -52.0, -57.0, -63.0},
@@ -130,7 +129,7 @@ public class TestH5Pfapl {
}
private final long _createDataset(long fid, long dsid, String name, long dapl) {
- long did = -1;
+ long did = HDF5Constants.H5I_INVALID_HID;
try {
did = H5.H5Dcreate(fid, name, HDF5Constants.H5T_STD_I32BE, dsid,
HDF5Constants.H5P_DEFAULT, HDF5Constants.H5P_DEFAULT, dapl);
@@ -385,7 +384,7 @@ public class TestH5Pfapl {
@Test
public void testH5Pget_elink_fapl() {
- long ret_val_id = -1;
+ long ret_val_id = HDF5Constants.H5I_INVALID_HID;
try {
ret_val_id = H5.H5Pget_elink_fapl(plapl_id);
assertTrue("H5Pget_elink_fapl", ret_val_id >= 0);
@@ -403,7 +402,7 @@ public class TestH5Pfapl {
@Test
public void testH5P_elink_fapl() {
- long ret_val_id = -1;
+ long ret_val_id = HDF5Constants.H5I_INVALID_HID;
try {
H5.H5Pset_elink_fapl(plapl_id, fapl_id );
ret_val_id = H5.H5Pget_elink_fapl(plapl_id);
@@ -421,7 +420,7 @@ public class TestH5Pfapl {
@Test
public void testH5P_elink_file_cache_size() {
- long elink_fapl_id = -1;
+ long elink_fapl_id = HDF5Constants.H5I_INVALID_HID;
int efc_size = 0;
try {
H5.H5Pset_elink_fapl(plapl_id, fapl_id );
@@ -1398,4 +1397,36 @@ public class TestH5Pfapl {
fail("H5P_evict_on_close: " + err);
}
}
+
+ @Test
+ public void testH5P_file_locking() {
+ boolean use_file_locking = false;
+ boolean ignore_disabled_file_locking = false;
+ try {
+ // false values (usually not the default)
+ H5.H5Pset_file_locking(fapl_id, false, false);
+ use_file_locking = H5.H5Pget_use_file_locking(fapl_id);
+ ignore_disabled_file_locking = H5.H5Pget_ignore_disabled_file_locking(fapl_id);
+ assertFalse("H5P_file_locking", use_file_locking);
+ assertFalse("H5P_file_locking", ignore_disabled_file_locking);
+
+ // true values (typically the default)
+ H5.H5Pset_file_locking(fapl_id, true, true);
+ use_file_locking = H5.H5Pget_use_file_locking(fapl_id);
+ ignore_disabled_file_locking = H5.H5Pget_ignore_disabled_file_locking(fapl_id);
+ assertTrue("H5P_file_locking", use_file_locking);
+ assertTrue("H5P_file_locking", ignore_disabled_file_locking);
+ }
+ catch (HDF5PropertyListInterfaceException err) {
+ // parallel is not supported
+ if (err.getMinorErrorNumber() != HDF5Constants.H5E_UNSUPPORTED) {
+ err.printStackTrace();
+ fail("H5P_test_file_locking: " + err);
+ }
+ }
+ catch (Throwable err) {
+ err.printStackTrace();
+ fail("H5P_test_file_locking: " + err);
+ }
+ }
}
diff --git a/java/test/TestH5Pfaplhdfs.java b/java/test/TestH5Pfaplhdfs.java
index 398a4d4..d922666 100644
--- a/java/test/TestH5Pfaplhdfs.java
+++ b/java/test/TestH5Pfaplhdfs.java
@@ -1,6 +1,5 @@
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* 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 *
@@ -34,11 +33,11 @@ import org.junit.rules.TestName;
public class TestH5Pfaplhdfs {
@Rule public TestName testname = new TestName();
- long fapl_id = -1;
- long plapl_id = -1;
- long dapl_id = -1;
- long plist_id = -1;
- long btplist_id = -1;
+ long fapl_id = HDF5Constants.H5I_INVALID_HID;
+ long plapl_id = HDF5Constants.H5I_INVALID_HID;
+ long dapl_id = HDF5Constants.H5I_INVALID_HID;
+ long plist_id = HDF5Constants.H5I_INVALID_HID;
+ long btplist_id = HDF5Constants.H5I_INVALID_HID;
@Before
public void createFileAccess() throws NullPointerException, HDF5Exception
diff --git a/java/test/TestH5Pfapls3.java b/java/test/TestH5Pfapls3.java
index a55856c..dda2716 100644
--- a/java/test/TestH5Pfapls3.java
+++ b/java/test/TestH5Pfapls3.java
@@ -1,6 +1,5 @@
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* 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 *
@@ -34,11 +33,11 @@ import org.junit.rules.TestName;
public class TestH5Pfapls3 {
@Rule public TestName testname = new TestName();
- long fapl_id = -1;
- long plapl_id = -1;
- long dapl_id = -1;
- long plist_id = -1;
- long btplist_id = -1;
+ long fapl_id = HDF5Constants.H5I_INVALID_HID;
+ long plapl_id = HDF5Constants.H5I_INVALID_HID;
+ long dapl_id = HDF5Constants.H5I_INVALID_HID;
+ long plist_id = HDF5Constants.H5I_INVALID_HID;
+ long btplist_id = HDF5Constants.H5I_INVALID_HID;
@Before
public void createFileAccess() throws NullPointerException, HDF5Exception
diff --git a/java/test/TestH5Plist.java b/java/test/TestH5Plist.java
index 7c43693..0d53071 100644
--- a/java/test/TestH5Plist.java
+++ b/java/test/TestH5Plist.java
@@ -1,6 +1,5 @@
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* 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 *
@@ -85,7 +84,7 @@ public class TestH5Plist {
PROP3_NAME,
PROP4_NAME};
- long plist_class_id = -1;
+ long plist_class_id = HDF5Constants.H5I_INVALID_HID;
@Before
public void createPropClass()throws NullPointerException, HDF5Exception
@@ -114,9 +113,9 @@ public class TestH5Plist {
@Test
public void testH5P_genprop_basic_class() {
int status = -1;
- long cid1 = -1; // Generic Property class ID
- long cid2 = -1; // Generic Property class ID
- long cid3 = -1; // Generic Property class ID
+ long cid1 = HDF5Constants.H5I_INVALID_HID; // Generic Property class ID
+ long cid2 = HDF5Constants.H5I_INVALID_HID; // Generic Property class ID
+ long cid3 = HDF5Constants.H5I_INVALID_HID; // Generic Property class ID
String name = null; // Name of class
try {
@@ -162,7 +161,7 @@ public class TestH5Plist {
// Close parent class
try {
H5.H5Pclose_class(cid2);
- cid2 = -1;
+ cid2 = HDF5Constants.H5I_INVALID_HID;
}
catch (Throwable err) {
err.printStackTrace();
@@ -172,7 +171,7 @@ public class TestH5Plist {
// Close class
try {
H5.H5Pclose_class(plist_class_id);
- plist_class_id = -1;
+ plist_class_id = HDF5Constants.H5I_INVALID_HID;
}
catch (Throwable err) {
err.printStackTrace();
@@ -242,7 +241,7 @@ public class TestH5Plist {
// Close parent class's parent
try {
H5.H5Pclose_class(cid3);
- cid3 = -1;
+ cid3 = HDF5Constants.H5I_INVALID_HID;
}
catch (Throwable err) {
err.printStackTrace();
@@ -252,7 +251,7 @@ public class TestH5Plist {
// Close parent class's parent
try {
H5.H5Pclose_class(cid2);
- cid2 = -1;
+ cid2 = HDF5Constants.H5I_INVALID_HID;
}
catch (Throwable err) {
err.printStackTrace();
@@ -262,7 +261,7 @@ public class TestH5Plist {
// Close parent class's parent
try {
H5.H5Pclose_class(cid1);
- cid1 = -1;
+ cid1 = HDF5Constants.H5I_INVALID_HID;
}
catch (Throwable err) {
err.printStackTrace();
@@ -634,7 +633,7 @@ public class TestH5Plist {
@Test
public void testH5P_genprop_basic_list_prop() {
boolean status = false;
- long lid1 = -1; // Generic Property list ID
+ long lid1 = HDF5Constants.H5I_INVALID_HID; // Generic Property list ID
long nprops = -1; // Number of properties in class
try {
@@ -760,7 +759,7 @@ public class TestH5Plist {
// @Test
// public void testH5P_genprop_class_callback() {
// class cdata {
-// public long cls_id = -1;
+// public long cls_id = HDF5Constants.H5I_INVALID_HID;
// public int cls_count = -1;
// cdata(long id, int count) {
// this.cls_id = id;
@@ -813,11 +812,11 @@ public class TestH5Plist {
// }
// H5P_cls_close_func_cb cls_close_cb = new H5P_cls_close_callback();
//
-// long cid1 = -1; // Generic Property class ID
-// long cid2 = -1; // Generic Property class ID
-// long lid1 = -1; // Generic Property list ID
-// long lid2 = -1; // Generic Property list ID
-// long lid3 = -1; // Generic Property list ID
+// long cid1 = HDF5Constants.H5I_INVALID_HID; // Generic Property class ID
+// long cid2 = HDF5Constants.H5I_INVALID_HID; // Generic Property class ID
+// long lid1 = HDF5Constants.H5I_INVALID_HID; // Generic Property list ID
+// long lid2 = HDF5Constants.H5I_INVALID_HID; // Generic Property list ID
+// long lid3 = HDF5Constants.H5I_INVALID_HID; // Generic Property list ID
// long nprops = -1; // Number of properties in class
//
// try {
diff --git a/java/test/TestH5Pvirtual.java b/java/test/TestH5Pvirtual.java
index 4c9a763..0478356 100644
--- a/java/test/TestH5Pvirtual.java
+++ b/java/test/TestH5Pvirtual.java
@@ -1,6 +1,5 @@
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* 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 *
@@ -52,13 +51,13 @@ public class TestH5Pvirtual {
private static final int fill_value = -1;
long[] H5dims = { DIM_Y };
long[] VDSH5dims = { VDSDIM_X, VDSDIM_Y };
- long H5fid = -1;
- long H5dsid = -1;
- long H5dssid = -1;
- long H5dvsid = -1;
- long H5did = -1;
- long H5dcplid = -1;
- long H5dapl_id = -1;
+ long H5fid = HDF5Constants.H5I_INVALID_HID;
+ long H5dsid = HDF5Constants.H5I_INVALID_HID;
+ long H5dssid = HDF5Constants.H5I_INVALID_HID;
+ long H5dvsid = HDF5Constants.H5I_INVALID_HID;
+ long H5did = HDF5Constants.H5I_INVALID_HID;
+ long H5dcplid = HDF5Constants.H5I_INVALID_HID;
+ long H5dapl_id = HDF5Constants.H5I_INVALID_HID;
private final void _deleteFile(String filename) {
File file = new File(filename);
@@ -69,8 +68,8 @@ public class TestH5Pvirtual {
}
private final long _createDataset(long fid, long dsid, String name, long dcpl, long dapl) {
- long did = -1;
- long space_id = -1;
+ long did = HDF5Constants.H5I_INVALID_HID;
+ long space_id = HDF5Constants.H5I_INVALID_HID;
long[] start = {0, 0};
long[] stride = null;
long[] count = {1, 1};
@@ -100,9 +99,9 @@ public class TestH5Pvirtual {
int[] dset_data = new int[DIM_Y];
// Create source files and datasets
for (int i=0; i < 3; i++) {
- long space_id = -1;
- long dset_id = -1;
- long file_id = -1;
+ long space_id = HDF5Constants.H5I_INVALID_HID;
+ long dset_id = HDF5Constants.H5I_INVALID_HID;
+ long file_id = HDF5Constants.H5I_INVALID_HID;
for (int j = 0; j < DIM_Y; j++) dset_data[j] = i+1;
try {
@@ -265,7 +264,7 @@ public class TestH5Pvirtual {
@Test
public void testH5Pget_selection_source_dataset() throws Throwable {
- long src_space = -1;
+ long src_space = HDF5Constants.H5I_INVALID_HID;
long src_selection = -1;
H5did = _createDataset(H5fid, H5dsid, "VDS", H5dcplid, H5dapl_id);
diff --git a/java/test/TestH5R.java b/java/test/TestH5R.java
index a51c7b6..031b8e4 100644
--- a/java/test/TestH5R.java
+++ b/java/test/TestH5R.java
@@ -1,6 +1,5 @@
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* 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 *
@@ -39,11 +38,11 @@ public class TestH5R {
private static final String H5_FILE = "testH5R.h5";
private static final int DIM_X = 4;
private static final int DIM_Y = 6;
- long H5fid = -1;
- long H5dsid = -1;
- long H5did = -1;
- long H5gid = -1;
- long H5did2 = -1;
+ long H5fid = HDF5Constants.H5I_INVALID_HID;
+ long H5dsid = HDF5Constants.H5I_INVALID_HID;
+ long H5did = HDF5Constants.H5I_INVALID_HID;
+ long H5gid = HDF5Constants.H5I_INVALID_HID;
+ long H5did2 = HDF5Constants.H5I_INVALID_HID;
long[] H5dims = { DIM_X, DIM_Y };
int[][] dset_data = new int[DIM_X][DIM_Y];
int FILLVAL = 99;
@@ -62,7 +61,7 @@ public class TestH5R {
}
private final long _createDataset(long fid, long dsid, String name, long dapl) {
- long did = -1;
+ long did = HDF5Constants.H5I_INVALID_HID;
try {
did = H5.H5Dcreate(fid, name,
HDF5Constants.H5T_STD_I32BE, dsid,
@@ -78,7 +77,7 @@ public class TestH5R {
}
private final long _createGroup(long fid, String name) {
- long gid = -1;
+ long gid = HDF5Constants.H5I_INVALID_HID;
try {
gid = H5.H5Gcreate(fid, name, HDF5Constants.H5P_DEFAULT,
HDF5Constants.H5P_DEFAULT, HDF5Constants.H5P_DEFAULT);
@@ -150,109 +149,6 @@ public class TestH5R {
System.out.println();
}
- // Test v1.8 APIs params
- /*
- * @Ignore public void testH5Rget_name() { long loc_id = H5fid; int ref_type =
- * HDF5Constants.H5R_OBJECT; long ret_val = -1; byte[] ref = null; String[] name = {""}; String
- * objName = "/dset";
- *
- * try { ref = H5.H5Rcreate(H5fid, objName, ref_type, -1); } catch (Throwable err) {
- * err.printStackTrace(); fail("H5.H5Rget_name:H5Rcreate " + err); }
- *
- * try { ret_val = H5.H5Rget_name(loc_id, ref_type, ref, name, 16); } catch (Throwable err) {
- * err.printStackTrace(); fail("H5.H5Rget_name: " + err); }
- *
- * assertTrue("testH5Rget_name: H5Rget_name", ret_val>0); assertTrue("The name of the object: ",
- * objName.equals(name[0])); }
- *
- * @Ignore public void testH5Rget_obj_type2() { int ref_type=HDF5Constants.H5R_OBJECT; byte[]
- * ref=null;
- *
- * String objName = "/dset"; int obj_type = -1;
- *
- * try { ref = H5.H5Rcreate(H5fid, objName, ref_type, -1); } catch(Throwable err) {
- * err.printStackTrace(); }
- *
- * try { obj_type = H5.H5Rget_obj_type(H5fid, HDF5Constants.H5R_OBJECT, ref); } catch (Throwable
- * err) { err.printStackTrace(); fail("H5.H5Rget_obj_type2: " + err); } assertEquals(obj_type,
- * HDF5Constants.H5O_TYPE_DATASET); }
- *
- * @Ignore public void testH5Rcreate_refobj() { byte[] ref = null;
- *
- * try { ref = H5.H5Rcreate(H5fid, "/dset", HDF5Constants.H5R_OBJECT, -1); } catch (Throwable err) {
- * err.printStackTrace(); fail("H5.H5Rcreate: " + err); } assertNotNull(ref); }
- *
- * @Ignore public void testH5Rcreate_regionrefobj() { byte[] ref = null; try { ref =
- * H5.H5Rcreate(H5fid, "/dset", HDF5Constants.H5R_DATASET_REGION, H5dsid); } catch (Throwable err) {
- * err.printStackTrace(); fail("H5.H5Rcreate: " + err); } assertNotNull(ref); }
- *
- * @Ignore public void testH5Rdereference() { byte[] ref1 = null; byte[] ref2 = null; long
- * dataset_id = -1; long group_id = -1; try { //Create reference on dataset ref1 =
- * H5.H5Rcreate(H5fid, "/dset", HDF5Constants.H5R_DATASET_REGION, H5dsid); dataset_id=
- * H5.H5Rdereference(H5fid, HDF5Constants.H5P_DEFAULT, HDF5Constants.H5R_DATASET_REGION, ref1);
- *
- * //Create reference on group ref2 = H5.H5Rcreate(H5gid, "/Group1", HDF5Constants.H5R_OBJECT, -1);
- * group_id= H5.H5Rdereference(H5gid, HDF5Constants.H5P_DEFAULT, HDF5Constants.H5R_OBJECT, ref2);
- * assertNotNull(ref1); assertNotNull(ref2); assertTrue(dataset_id >= 0); assertTrue(group_id >= 0);
- * } catch (Throwable err) { err.printStackTrace(); fail("TestH5Rdereference " + err); } finally {
- * try {H5.H5Dclose(dataset_id);} catch (Exception ex) {} try {H5.H5Gclose(group_id);} catch
- * (Exception ex) {} } }
- *
- * @Ignore public void testH5Rget_region() { byte[] ref = null; long dsid = -1; try { ref =
- * H5.H5Rcreate(H5fid, "/dset", HDF5Constants.H5R_DATASET_REGION, H5dsid); dsid =
- * H5.H5Rget_region(H5fid, HDF5Constants.H5R_DATASET_REGION, ref); assertNotNull(ref);
- * assertTrue(dsid >= 0); } catch (Throwable err) { err.printStackTrace();
- * fail("TestH5Rget_region: " + err); } finally { try {H5.H5Sclose(dsid);} catch (Exception ex) {} }
- * }
- *
- * @Ignore//(expected = IllegalArgumentException.class) public void testH5Rget_name_Invalidreftype()
- * throws Throwable { byte[] ref = null; String[] name = {""}; ref = H5.H5Rcreate(H5fid, "/dset",
- * HDF5Constants.H5R_OBJECT, -1); H5.H5Rget_name(H5fid, HDF5Constants.H5R_DATASET_REGION, ref, name,
- * 16); }
- *
- * @Ignore//(expected = NullPointerException.class) public void testH5Rget_name_NULLreference()
- * throws Throwable { byte[] ref = null; String[] name = {""}; H5.H5Rget_name(H5fid,
- * HDF5Constants.H5R_OBJECT, ref, name, 16); }
- *
- * @Ignore//(expected = HDF5LibraryException.class) public void
- * testH5Rget_obj_type2_Invalidreftype() throws Throwable { byte[] ref = null; ref =
- * H5.H5Rcreate(H5fid, "/dset", HDF5Constants.H5R_OBJECT, -1); H5.H5Rget_obj_type(H5fid,
- * HDF5Constants.H5R_DATASET_REGION, ref); }
- *
- * @Ignore//(expected = HDF5LibraryException.class) public void testH5Rcreate_InvalidObjectName()
- * throws Throwable { byte[] ref=H5.H5Rcreate(H5fid, "/GROUPS", HDF5Constants.H5R_OBJECT, -1); }
- *
- * @Ignore//(expected = HDF5LibraryException.class) public void testH5Rcreate_Invalidspace_id()
- * throws Throwable { byte[] ref=H5.H5Rcreate(H5fid, "/dset", HDF5Constants.H5R_DATASET_REGION, -1);
- * }
- *
- * @Ignore//(expected = IllegalArgumentException.class) public void testH5Rcreate_Invalidreftype()
- * throws Throwable { byte[] ref=H5.H5Rcreate(H5fid, "/dset", HDF5Constants.H5R_BADTYPE, -1); }
- *
- * @Ignore//(expected = IllegalArgumentException.class) public void
- * testH5Rgetregion_Invalidreftype() throws Throwable { byte[] ref = null; ref = H5.H5Rcreate(H5fid,
- * "/dset", HDF5Constants.H5R_OBJECT, H5dsid); H5.H5Rget_region(H5fid,
- * HDF5Constants.H5R_DATASET_REGION, ref); }
- *
- * @Ignore//(expected = IllegalArgumentException.class) public void
- * testH5Rgetregion_Badreferencetype() throws Throwable { byte[] ref = null; ref =
- * H5.H5Rcreate(H5fid, "/dset", HDF5Constants.H5R_OBJECT, H5dsid); H5.H5Rget_region(H5fid,
- * HDF5Constants.H5R_OBJECT, ref); }
- *
- * @Ignore//(expected = NullPointerException.class) public void testH5Rgetregion_Nullreference()
- * throws Throwable { byte[] ref = null; H5.H5Rget_region(H5fid, HDF5Constants.H5R_DATASET_REGION,
- * ref); }
- *
- * @Ignore//(expected = NullPointerException.class) public void testH5Rdereference_Nullreference()
- * throws Throwable { byte[] ref = null; H5.H5Rdereference(H5did2, HDF5Constants.H5P_DEFAULT,
- * HDF5Constants.H5R_OBJECT, ref); }
- *
- * @Ignore//(expected = IllegalArgumentException.class) public void
- * testH5Rdereference_Invalidreference() throws Throwable { byte[] ref1 = null; byte[] ref2 = null;
- * ref1 = H5.H5Rcreate(H5fid, "/dset", HDF5Constants.H5R_DATASET_REGION, H5dsid); ref2 =
- * H5.H5Rcreate(H5gid, "/Group1", HDF5Constants.H5R_OBJECT, -1); H5.H5Rdereference(H5gid,
- * HDF5Constants.H5P_DEFAULT, HDF5Constants.H5R_OBJECT, ref1); }
- */
// Test v1.12 APIs params
@Test
diff --git a/java/test/TestH5Rref.java b/java/test/TestH5Rref.java
new file mode 100644
index 0000000..cbdabdd
--- /dev/null
+++ b/java/test/TestH5Rref.java
@@ -0,0 +1,561 @@
+/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
+ * Copyright by The HDF Group. *
+ * All rights reserved. *
+ * *
+ * This file is part of HDF5. The full HDF5 copyright notice, including *
+ * terms governing use, modification, and redistribution, is contained in *
+ * the COPYING file, which can be found at the root of the source code *
+ * distribution tree, or in https://www.hdfgroup.org/licenses. *
+ * If you do not have access to either file, you may request a copy from *
+ * help@hdfgroup.org. *
+ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
+
+package test;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertTrue;
+import static org.junit.Assert.fail;
+
+import java.io.File;
+
+import hdf.hdf5lib.H5;
+import hdf.hdf5lib.HDF5Constants;
+import hdf.hdf5lib.exceptions.HDF5Exception;
+import hdf.hdf5lib.exceptions.HDF5LibraryException;
+import hdf.hdf5lib.exceptions.HDF5FunctionArgumentException;
+
+import org.junit.After;
+import org.junit.Before;
+import org.junit.Ignore;
+import org.junit.Rule;
+import org.junit.Test;
+import org.junit.rules.TestName;
+
+public class TestH5Rref {
+ @Rule public TestName testname = new TestName();
+ private static final String H5_DREG_FILE = "trefer_reg.h5";
+ private static final String H5_AREG_FILE = "trefer_attr.h5";
+ long H5fid = HDF5Constants.H5I_INVALID_HID;
+ long H5dsid = HDF5Constants.H5I_INVALID_HID;
+ long H5did = HDF5Constants.H5I_INVALID_HID;
+
+ private boolean byteArrayCheck(final byte[] array) {
+ for (byte b : array) {
+ if (b != 0) {
+ return false;
+ }
+ }
+ return true;
+ }
+
+ public void openH5file(String filename, String dsetname) {
+ try {
+ H5fid = H5.H5Fopen(filename,
+ HDF5Constants.H5F_ACC_RDONLY, HDF5Constants.H5P_DEFAULT);
+ }
+ catch (Throwable err) {
+ err.printStackTrace();
+ fail("TestH5R._openH5file: " + err);
+ }
+ assertTrue("TestH5R._openH5file: H5.H5Fopen: ", H5fid >= 0);
+ try {
+ H5did = H5.H5Dopen(H5fid, dsetname, HDF5Constants.H5P_DEFAULT);
+ }
+ catch (Throwable err) {
+ err.printStackTrace();
+ fail("TestH5R._openH5file: " + err);
+ }
+ assertTrue("TestH5R._openH5file: H5.H5Dopen: ", H5did >= 0);
+ try {
+ H5dsid = H5.H5Dget_space(H5did);
+ }
+ catch (Throwable err) {
+ err.printStackTrace();
+ fail("TestH5R._openH5file: " + err);
+ }
+ assertTrue("TestH5R._openH5file: H5.H5Screate_simple: ",H5dsid > 0);
+ }
+
+ @After
+ public void closeH5file() throws HDF5LibraryException {
+ if (H5did >= 0)
+ try {H5.H5Dclose(H5did);} catch (Exception ex) {}
+ if (H5dsid > 0)
+ try {H5.H5Sclose(H5dsid);} catch (Exception ex) {}
+ if (H5fid > 0)
+ try {H5.H5Fclose(H5fid);} catch (Exception ex) {}
+ H5fid = HDF5Constants.H5I_INVALID_HID;
+ H5dsid = HDF5Constants.H5I_INVALID_HID;
+ H5did = HDF5Constants.H5I_INVALID_HID;
+ System.out.println();
+ }
+
+ @Before
+ public void verifyCount()
+ throws NullPointerException, HDF5Exception {
+ assertTrue("H5 open ids is 0", H5.getOpenIDCount()==0);
+ System.out.print(testname.getMethodName());
+ }
+
+ // Test v1.12 APIs params
+
+ @Test
+ public void testH5Rget_object() {
+ int ref_type = HDF5Constants.H5R_OBJECT1;
+ long f_type = HDF5Constants.H5I_INVALID_HID;
+ int obj_type = -1;
+ int ndims = 1;
+ long ret_val = -1;
+ byte[][] refbuf = null;
+ String name = "";
+ String objName = "/DS_NA";
+
+ try {
+ openH5file(H5_DREG_FILE, objName);
+ }
+ catch (Throwable err) {
+ err.printStackTrace();
+ fail("testH5Rget_object: openH5file: " + err);
+ }
+ try {
+ f_type = H5.H5Dget_type(H5did);
+ int result = H5.H5Tget_class(f_type);
+ assertTrue("testH5Rget_object: H5Tget_class", result > 0);
+ String class_name = H5.H5Tget_class_name(result);
+ assertTrue("testH5Rget_object: H5Tget_class", class_name.compareTo("H5T_REFERENCE")==0);
+ }
+ catch (Throwable err) {
+ err.printStackTrace();
+ fail("testH5Rget_object: " + err);
+ }
+ finally {
+ try {H5.H5Tclose(f_type);} catch (Exception ex) {}
+ }
+ try {
+ ndims = H5.H5Sget_simple_extent_ndims(H5dsid);
+ }
+ catch (Throwable err) {
+ err.printStackTrace();
+ fail("testH5Rget_object: H5Sget_simple_extent_ndims: " + err);
+ }
+ refbuf = new byte[ndims][HDF5Constants.H5R_REF_BUF_SIZE];
+ // Read the reference from the dataset.
+ try {
+ H5.H5Dread(H5did, HDF5Constants.H5T_STD_REF,
+ HDF5Constants.H5S_ALL, HDF5Constants.H5S_ALL,
+ HDF5Constants.H5P_DEFAULT, refbuf);
+ }
+ catch (Exception err) {
+ err.printStackTrace();
+ fail("testH5Rget_object: H5Dread: " + err);
+ }
+
+ for (int i = 0; i < ndims; i++) {
+ try {
+ ret_val = H5.H5Rget_type(refbuf[i]);
+ assertTrue("testH5Rget_object: H5Rget_type["+i+"]="+ret_val, ret_val == ref_type);
+ if (!byteArrayCheck(refbuf[i])) {
+ try {
+ obj_type = H5.H5Rget_obj_type3(refbuf[i], HDF5Constants.H5P_DEFAULT);
+ assertEquals(obj_type, HDF5Constants.H5O_TYPE_DATASET);
+ }
+ catch (Throwable err2) {
+ err2.printStackTrace();
+ fail("testH5Rget_object: H5.H5Rget_obj_type3: " + err2);
+ }
+ }
+ }
+ catch (Throwable err) {
+ err.printStackTrace();
+ fail("testH5Rget_object: H5Rget_type: " + err);
+ }
+ finally {
+ H5.H5Rdestroy(refbuf[i]);
+ }
+ }
+ }
+
+ @Test
+ public void testH5Rget_obj_type3() {
+ long f_type = HDF5Constants.H5I_INVALID_HID;
+ int ref_type = HDF5Constants.H5R_DATASET_REGION2;
+ int obj_type = -1;
+ int ndims = 1;
+ long ret_val = -1;
+ byte[][] refbuf = null;
+ String objName = "/Dataset1";
+
+ try {
+ openH5file(H5_DREG_FILE, objName);
+ }
+ catch (Throwable err) {
+ err.printStackTrace();
+ fail("testH5Rget_obj_type3: openH5file: " + err);
+ }
+ try {
+ f_type = H5.H5Dget_type(H5did);
+ int result = H5.H5Tget_class(f_type);
+ assertTrue("testH5Rget_obj_type3: H5Tget_class", result > 0);
+ String class_name = H5.H5Tget_class_name(result);
+ assertTrue("testH5Rget_obj_type3: H5Tget_class="+class_name, class_name.compareTo("H5T_REFERENCE")==0);
+ }
+ catch (Throwable err) {
+ err.printStackTrace();
+ fail("testH5Rget_obj_type3: " + err);
+ }
+ finally {
+ try {H5.H5Tclose(f_type);} catch (Exception ex) {}
+ }
+ try {
+ ndims = H5.H5Sget_simple_extent_ndims(H5dsid);
+ }
+ catch (Throwable err) {
+ err.printStackTrace();
+ fail("testH5Rget_obj_type3: H5Sget_simple_extent_ndims: " + err);
+ }
+ refbuf = new byte[ndims][HDF5Constants.H5R_REF_BUF_SIZE];
+ // Read the reference from the dataset.
+ try {
+ H5.H5Dread(H5did, HDF5Constants.H5T_STD_REF,
+ HDF5Constants.H5S_ALL, HDF5Constants.H5S_ALL,
+ HDF5Constants.H5P_DEFAULT, refbuf);
+ }
+ catch (Exception err) {
+ err.printStackTrace();
+ fail("testH5Rget_obj_type3: H5Dread: " + err);
+ }
+
+ for (int i = 0; i < ndims; i++) {
+ try {
+ ret_val = H5.H5Rget_type(refbuf[i]);
+ assertTrue("testH5Rget_obj_type3: H5Rget_type["+i+"]="+ret_val, ret_val == ref_type);
+ if (!byteArrayCheck(refbuf[i])) {
+ try {
+ obj_type = H5.H5Rget_obj_type3(refbuf[i], HDF5Constants.H5P_DEFAULT);
+ assertEquals(obj_type, HDF5Constants.H5O_TYPE_DATASET);
+ }
+ catch (Throwable err2) {
+ err2.printStackTrace();
+ fail("testH5Rget_obj_type3: H5.H5Rget_obj_type3: " + err2);
+ }
+ }
+ }
+ catch (Throwable err) {
+ err.printStackTrace();
+ fail("testH5Rget_obj_type3: H5Rget_type: " + err);
+ }
+ finally {
+ H5.H5Rdestroy(refbuf[i]);
+ }
+ }
+ }
+
+ @Test
+ public void testH5Rget_region_dataset() {
+ long f_type = HDF5Constants.H5I_INVALID_HID;
+ long loc_id = HDF5Constants.H5I_INVALID_HID;
+ long loc_sid = HDF5Constants.H5I_INVALID_HID;
+ int ref_type = HDF5Constants.H5R_DATASET_REGION2;
+ int ndims = 1;
+ long ret_val = -1;
+ byte[][] refbuf = null;
+ String name = "";
+ String objName = "/Dataset1";
+
+ try {
+ openH5file(H5_DREG_FILE, objName);
+ }
+ catch (Throwable err) {
+ err.printStackTrace();
+ fail("testH5Rget_region_dataset: openH5file: " + err);
+ }
+ try {
+ f_type = H5.H5Dget_type(H5did);
+ int result = H5.H5Tget_class(f_type);
+ assertTrue("testH5Rget_region_dataset: H5Tget_class", result > 0);
+ String class_name = H5.H5Tget_class_name(result);
+ assertTrue("testH5Rget_region_dataset: H5Tget_class="+class_name, class_name.compareTo("H5T_REFERENCE")==0);
+ }
+ catch (Throwable err) {
+ err.printStackTrace();
+ fail("testH5Rget_region_dataset: " + err);
+ }
+ finally {
+ try {H5.H5Tclose(f_type);} catch (Exception ex) {}
+ }
+ try {
+ ndims = H5.H5Sget_simple_extent_ndims(H5dsid);
+ }
+ catch (Throwable err) {
+ err.printStackTrace();
+ fail("testH5Rget_region_dataset: H5Sget_simple_extent_ndims: " + err);
+ }
+ refbuf = new byte[ndims][HDF5Constants.H5R_REF_BUF_SIZE];
+ // Read the reference from the dataset.
+ try {
+ H5.H5Dread(H5did, HDF5Constants.H5T_STD_REF,
+ HDF5Constants.H5S_ALL, HDF5Constants.H5S_ALL,
+ HDF5Constants.H5P_DEFAULT, refbuf);
+ }
+ catch (Exception err) {
+ err.printStackTrace();
+ fail("testH5Rget_obj_type3: H5Dread: " + err);
+ }
+ for (int i = 0; i < ndims; i++) {
+ try {
+ ret_val = H5.H5Rget_type(refbuf[i]);
+ assertTrue("testH5Rget_region_dataset: H5Rget_type["+i+"]="+ret_val, ret_val == ref_type);
+ try {
+ loc_id = H5.H5Ropen_object(refbuf[i], HDF5Constants.H5P_DEFAULT, HDF5Constants.H5P_DEFAULT);
+ assertTrue(loc_id >= 0);
+ boolean regionzero = byteArrayCheck(refbuf[i]);
+ if (i > 1)
+ assertTrue(regionzero);
+ else {
+ try {
+ loc_sid = H5.H5Ropen_region(refbuf[i], HDF5Constants.H5P_DEFAULT, HDF5Constants.H5P_DEFAULT);
+ assertTrue(loc_sid >= 0);
+ int region_type = -1;
+ try {
+ int reg_ndims = H5.H5Sget_simple_extent_ndims(loc_sid);
+ region_type = H5.H5Sget_select_type(loc_sid);
+ if (i == 1)
+ assertTrue(region_type == HDF5Constants.H5S_SEL_POINTS);
+ else
+ assertTrue(region_type == HDF5Constants.H5S_SEL_HYPERSLABS);
+ if (region_type == HDF5Constants.H5S_SEL_POINTS) {
+ long reg_npoints = H5.H5Sget_select_elem_npoints(loc_sid);
+ // Coordinates for get point selection
+ long getcoord[] = new long[reg_ndims * (int)reg_npoints];
+ // Known coordinates for point selection
+ long coord[][] = {{6,9},{2,2},{8,4},{1,6},{2,8},{3,2},
+ {0,4},{9,0},{7,1},{3,3}};
+ try {
+ H5.H5Sget_select_elem_pointlist(loc_sid, 0, reg_npoints, getcoord);
+ assertTrue("H5.H5Sget_select_elem_pointlist", coord[0][0] == getcoord[0]);
+ assertTrue("H5.H5Sget_select_elem_pointlist", coord[0][1] == getcoord[1]);
+ assertTrue("H5.H5Sget_select_elem_pointlist", coord[1][0] == getcoord[2]);
+ assertTrue("H5.H5Sget_select_elem_pointlist", coord[1][1] == getcoord[3]);
+ assertTrue("H5.H5Sget_select_elem_pointlist", coord[2][0] == getcoord[4]);
+ assertTrue("H5.H5Sget_select_elem_pointlist", coord[2][1] == getcoord[5]);
+ }
+ catch (Throwable err3) {
+ err3.printStackTrace();
+ fail("H5.H5Sget_select_elem_pointlist: " + err3);
+ }
+ }
+ else if (region_type == HDF5Constants.H5S_SEL_HYPERSLABS) {
+ long reg_nblocks = H5.H5Sget_select_hyper_nblocks(loc_sid);
+ assertTrue("H5Sget_select_hyper_nblocks", reg_nblocks == 1);
+ // Coordinates for get block selection
+ long getblocks[] = new long[reg_ndims * (int)reg_nblocks * 2];
+ long start[] = {2,2};
+ long block[] = {8,8};
+ try {
+ H5.H5Sget_select_hyper_blocklist(loc_sid, 0, reg_nblocks, getblocks);
+ assertTrue("H5.H5Sget_select_hyper_blocklist", start[0] == getblocks[0]);
+ assertTrue("H5.H5Sget_select_hyper_blocklist", start[1] == getblocks[1]);
+ assertTrue("H5.H5Sget_select_hyper_blocklist", (block[0]-1) == getblocks[2]);
+ assertTrue("H5.H5Sget_select_hyper_blocklist", (block[1]-1) == getblocks[3]);
+ }
+ catch (Throwable err3) {
+ err3.printStackTrace();
+ fail("H5.H5Sget_select_hyper_blocklist: " + err3);
+ }
+ }
+ }
+ catch (Throwable err2) {
+ err2.printStackTrace();
+ fail("testH5Rget_region_dataset: H5Sget_select_type: " + err2);
+ }
+ }
+ catch (Throwable err1) {
+ err1.printStackTrace();
+ fail("testH5Rget_region_dataset: " + err1);
+ }
+ finally {
+ try {H5.H5Sclose(loc_sid);} catch (Exception ex) {}
+ }
+ }
+ }
+ catch (Throwable err0) {
+ err0.printStackTrace();
+ fail("testH5Rget_region_dataset: " + err0);
+ }
+ finally {
+ try {H5.H5Dclose(loc_id);} catch (Exception ex) {}
+ }
+ }
+ catch (Throwable err) {
+ err.printStackTrace();
+ fail("testH5Rget_region_dataset: H5Rget_type: " + err);
+ }
+ finally {
+ H5.H5Rdestroy(refbuf[i]);
+ }
+ } //for (int i = 0; i < ndims; i++)
+ }
+
+ @Test
+ public void testH5Rget_region_attribute() {
+ long f_type = HDF5Constants.H5I_INVALID_HID;
+ long loc_id = HDF5Constants.H5I_INVALID_HID;
+ long loc_sid = HDF5Constants.H5I_INVALID_HID;
+ int ref_type = HDF5Constants.H5R_ATTR;
+ int obj_type = -1;
+ int ndims = 1;
+ long ret_val = -1;
+ byte[][] refbuf = null;
+ String objName = "/Dataset3";
+
+ try {
+ openH5file(H5_AREG_FILE, objName);
+ }
+ catch (Throwable err) {
+ err.printStackTrace();
+ fail("testH5Rget_region_attribute: openH5file: " + err);
+ }
+ try {
+ f_type = H5.H5Dget_type(H5did);
+ int result = H5.H5Tget_class(f_type);
+ assertTrue("testH5Rget_region_attribute: H5Tget_class", result > 0);
+ String class_name = H5.H5Tget_class_name(result);
+ assertTrue("testH5Rget_region_attribute: H5Tget_class="+class_name, class_name.compareTo("H5T_REFERENCE")==0);
+ }
+ catch (Throwable err) {
+ err.printStackTrace();
+ fail("testH5Rget_region_attribute: " + err);
+ }
+ finally {
+ try {H5.H5Tclose(f_type);} catch (Exception ex) {}
+ }
+ try {
+ ndims = H5.H5Sget_simple_extent_ndims(H5dsid);
+ }
+ catch (Throwable err) {
+ err.printStackTrace();
+ fail("testH5Rget_region_attribute: H5Sget_simple_extent_ndims: " + err);
+ }
+ refbuf = new byte[ndims][HDF5Constants.H5R_REF_BUF_SIZE];
+ // Read the reference from the dataset.
+ try {
+ H5.H5Dread(H5did, HDF5Constants.H5T_STD_REF,
+ HDF5Constants.H5S_ALL, HDF5Constants.H5S_ALL,
+ HDF5Constants.H5P_DEFAULT, refbuf);
+ }
+ catch (Exception err) {
+ err.printStackTrace();
+ fail("testH5Rget_region_attribute: H5Dread: " + err);
+ }
+
+ for (int i = 0; i < ndims; i++) {
+ try {
+ ret_val = H5.H5Rget_type(refbuf[i]);
+ assertTrue("testH5Rget_region_attribute: H5Rget_type["+i+"]="+ret_val, ret_val == ref_type);
+ try {
+ loc_id = H5.H5Ropen_attr(refbuf[i], HDF5Constants.H5P_DEFAULT, HDF5Constants.H5P_DEFAULT);
+ assertTrue(loc_id >= 0);
+ if (!byteArrayCheck(refbuf[i])) {
+ try {
+ loc_sid = H5.H5Aget_space(loc_id);
+ assertTrue(loc_sid >= 0);
+ }
+ catch (Throwable err1) {
+ err1.printStackTrace();
+ fail("testH5Rget_region_attribute: " + err1);
+ }
+ finally {
+ try {H5.H5Sclose(loc_sid);} catch (Exception ex) {}
+ }
+ }
+ }
+ catch (Throwable err0) {
+ err0.printStackTrace();
+ fail("testH5Rget_region_attribute: " + err0);
+ }
+ finally {
+ try {H5.H5Aclose(loc_id);} catch (Exception ex) {}
+ }
+ }
+ catch (Throwable err) {
+ err.printStackTrace();
+ fail("testH5Rget_region_attribute: H5Rget_type: " + err);
+ }
+ finally {
+ H5.H5Rdestroy(refbuf[i]);
+ }
+ }
+ }
+
+
+// These tests need to be updated with new APIs
+// @Test//
+// public void testH5Rget_group() {
+// long loc_id = H5fid;
+// int ref_type = HDF5Constants.H5R_OBJECT2;
+// long ret_val = -1;
+// byte[] ref = null;
+// String name = "";
+// String objName = "/dset";
+//
+// try {
+// ref = H5.H5Rcreate_object(H5fid, objName, HDF5Constants.H5P_DEFAULT);
+// }
+// catch (Throwable err) {
+// err.printStackTrace();
+// fail("testH5Rget_object: H5Rcreate_object " + err);
+// }
+// try {
+// dataset_id= H5.H5Rdereference(H5fid, HDF5Constants.H5P_DEFAULT, HDF5Constants.H5R_DATASET_REGION, ref1);
+//
+// //Create reference on group
+// ref2 = H5.H5Rcreate(H5gid, "/Group1", HDF5Constants.H5R_OBJECT, -1);
+// group_id= H5.H5Rdereference(H5gid, HDF5Constants.H5P_DEFAULT, HDF5Constants.H5R_OBJECT, ref2);
+// assertNotNull(ref1);
+// assertNotNull(ref2);
+// assertTrue(dataset_id >= 0);
+// assertTrue(group_id >= 0);
+// }
+// catch (Throwable err) {
+// err.printStackTrace();
+// fail("TestH5Rdereference " + err);
+// }
+// finally {
+// try {H5.H5Dclose(dataset_id);} catch (Exception ex) {}
+// try {H5.H5Gclose(group_id);} catch (Exception ex) {}
+// }
+// }
+
+// @Test//
+// public void testH5Rget_attr() {
+// long loc_id = H5fid;
+// int ref_type = HDF5Constants.H5R_OBJECT2;
+// long ret_val = -1;
+// byte[] ref = null;
+// String name = "";
+// String objName = "/dset";
+//
+// try {
+// ref = H5.H5Rcreate_object(H5fid, objName, HDF5Constants.H5P_DEFAULT);
+// }
+// catch (Throwable err) {
+// err.printStackTrace();
+// fail("testH5Rget_object: H5Rcreate_object " + err);
+// }
+// try {
+// dsid = H5.H5Rget_region(H5fid, HDF5Constants.H5R_DATASET_REGION, ref);
+// assertNotNull(ref);
+// assertTrue(dsid >= 0);
+// }
+// catch (Throwable err) {
+// err.printStackTrace();
+// fail("TestH5Rget_region: " + err);
+// }
+// finally {
+// try {H5.H5Sclose(dsid);} catch (Exception ex) {}
+// }
+// }
+
+}
diff --git a/java/test/TestH5S.java b/java/test/TestH5S.java
index 03943a4..7eeed7a 100644
--- a/java/test/TestH5S.java
+++ b/java/test/TestH5S.java
@@ -1,6 +1,5 @@
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* 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 *
@@ -30,7 +29,7 @@ import org.junit.rules.TestName;
public class TestH5S {
@Rule public TestName testname = new TestName();
- long H5sid = -1;
+ long H5sid = HDF5Constants.H5I_INVALID_HID;
int H5rank = 2;
long H5dims[] = {5, 5};
long H5maxdims[] = {10, 10};
@@ -181,7 +180,7 @@ public class TestH5S {
@Test
public void testH5Scopy() {
- long sid = -1;
+ long sid = HDF5Constants.H5I_INVALID_HID;
int read_rank = -1;
try {
@@ -201,7 +200,7 @@ public class TestH5S {
@Test
public void testH5Sextent_copy() {
- long sid = -1;
+ long sid = HDF5Constants.H5I_INVALID_HID;
int class_type = -1;
try {
@@ -222,7 +221,7 @@ public class TestH5S {
@Test
public void testH5Sextent_equal() {
- long sid = -1;
+ long sid = HDF5Constants.H5I_INVALID_HID;
boolean result = false;
try {
@@ -252,8 +251,8 @@ public class TestH5S {
@Test
public void testH5Sencode_decode_null_dataspace() {
- long sid = -1;
- long decoded_sid = -1;
+ long sid = HDF5Constants.H5I_INVALID_HID;
+ long decoded_sid = HDF5Constants.H5I_INVALID_HID;
byte[] null_sbuf = null;
boolean result = false;
@@ -299,8 +298,8 @@ public class TestH5S {
@Test
public void testH5Sencode_decode_scalar_dataspace() {
- long sid = -1;
- long decoded_sid = -1;
+ long sid = HDF5Constants.H5I_INVALID_HID;
+ long decoded_sid = HDF5Constants.H5I_INVALID_HID;
byte[] scalar_sbuf = null;
boolean result = false;
int iresult = -1;
@@ -470,7 +469,7 @@ public class TestH5S {
@Test
public void testH5Sget_select_hyper() {
- long space1 = -1;
+ long space1 = HDF5Constants.H5I_INVALID_HID;
long start[] = {0,0};
long stride[] = {1,1};
long count[] = {1,1};
@@ -508,7 +507,7 @@ public class TestH5S {
@Test
public void testH5Sget_select_valid() {
- long space1 = -1;
+ long space1 = HDF5Constants.H5I_INVALID_HID;
long start[] = {1,0};
long stride[] = {1,1};
long count[] = {2,3};
diff --git a/java/test/TestH5Sbasic.java b/java/test/TestH5Sbasic.java
index 3f626dd..548ac95 100644
--- a/java/test/TestH5Sbasic.java
+++ b/java/test/TestH5Sbasic.java
@@ -1,6 +1,5 @@
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* 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 *
@@ -56,7 +55,7 @@ public class TestH5Sbasic {
@Test
public void testH5Screate_scalar() {
- long sid = -1;
+ long sid = HDF5Constants.H5I_INVALID_HID;
int class_type = -1;
try {
sid = H5.H5Screate(HDF5Constants.H5S_SCALAR);
@@ -75,7 +74,7 @@ public class TestH5Sbasic {
@Test
public void testH5Screate_null() {
- long sid = -1;
+ long sid = HDF5Constants.H5I_INVALID_HID;
int class_type = -1;
try {
sid = H5.H5Screate(HDF5Constants.H5S_NULL);
@@ -125,7 +124,7 @@ public class TestH5Sbasic {
@Test
public void testH5Screate_simple() {
- long sid = -1;
+ long sid = HDF5Constants.H5I_INVALID_HID;
int class_type = -1;
int rank = 2;
long dims[] = {5, 5};
@@ -148,7 +147,7 @@ public class TestH5Sbasic {
@Test
public void testH5Screate_simple_unlimted() {
- long sid = -1;
+ long sid = HDF5Constants.H5I_INVALID_HID;
int class_type = -1;
int rank = 2;
long dims[] = {5, 5};
@@ -171,7 +170,7 @@ public class TestH5Sbasic {
@Test
public void testH5Screate_simple_unlimted_1d() {
- long sid = -1;
+ long sid = HDF5Constants.H5I_INVALID_HID;
int class_type = -1;
int rank = 1;
long dims[] = {5};
@@ -194,7 +193,7 @@ public class TestH5Sbasic {
@Test
public void testH5Screate_simple_max_default() {
- long sid = -1;
+ long sid = HDF5Constants.H5I_INVALID_HID;
int rank = 2;
long dims[] = {5, 5};
@@ -213,7 +212,7 @@ public class TestH5Sbasic {
@Test
public void testH5Screate_simple_extent() {
- long sid = -1;
+ long sid = HDF5Constants.H5I_INVALID_HID;
int rank = 2;
long dims[] = {5, 5};
long maxdims[] = {10, 10};
@@ -242,4 +241,142 @@ public class TestH5Sbasic {
H5.H5Sdecode(null);
}
+ @Test(expected = IllegalArgumentException.class)
+ public void testH5Sget_regular_hyperslab_invalid() throws Throwable {
+ long q_start[] = new long[2];
+ long q_stride[] = new long[2];
+ long q_count[] = new long[2];
+ long q_block[] = new long[2];
+
+ H5.H5Sget_regular_hyperslab(-1, q_start, q_stride, q_count, q_block);
+ }
+
+ @Test(expected = hdf.hdf5lib.exceptions.HDF5FunctionArgumentException.class)
+ public void testH5Sselect_copy_invalid() throws Throwable {
+ H5.H5Sselect_copy(-1, -1);
+ }
+
+ @Test(expected = hdf.hdf5lib.exceptions.HDF5DataspaceInterfaceException.class)
+ public void testH5Sselect_shape_same_invalid() throws Throwable {
+ H5.H5Sselect_shape_same(-1, -1);
+ }
+
+ @Test(expected = IllegalArgumentException.class)
+ public void testH5Sselect_adjust_invalid() throws Throwable {
+ long offset[][] = {{0,1},{2,4},{5,6}};
+ H5.H5Sselect_adjust(-1, offset);
+ }
+
+ @Test(expected = IllegalArgumentException.class)
+ public void testH5Sselect_adjust_rank_offset() throws Throwable {
+ long sid = HDF5Constants.H5I_INVALID_HID;
+ long offset[][] = {{0,1},{2,4},{5,6}};
+
+ try {
+ sid = H5.H5Screate(HDF5Constants.H5S_SIMPLE);
+ assertTrue("H5.H5Screate_simple_extent",sid > 0);
+ H5.H5Sselect_adjust(sid, offset);
+ }
+ finally {
+ try {H5.H5Sclose(sid);} catch (Exception ex) {}
+ }
+ }
+
+ @Test(expected = IllegalArgumentException.class)
+ public void testH5Sselect_intersect_block_invalid() throws Throwable {
+ long start[] = new long[2];
+ long end[] = new long[2];
+ H5.H5Sselect_intersect_block(-1, start, end);
+ }
+
+ @Test(expected = IllegalArgumentException.class)
+ public void testH5Sselect_intersect_block_rank_start() throws Throwable {
+ long sid = HDF5Constants.H5I_INVALID_HID;
+ long start[] = new long[2];
+ long end[] = null;
+
+ try {
+ sid = H5.H5Screate(HDF5Constants.H5S_SIMPLE);
+ assertTrue("H5.H5Screate_simple_extent",sid > 0);
+ H5.H5Sselect_intersect_block(sid, start, end);
+ }
+ finally {
+ try {H5.H5Sclose(sid);} catch (Exception ex) {}
+ }
+ }
+
+ @Test(expected = IllegalArgumentException.class)
+ public void testH5Sselect_intersect_block_rank_end() throws Throwable {
+ long sid = HDF5Constants.H5I_INVALID_HID;
+ long start[] = null;
+ long end[] = new long[2];
+
+ try {
+ sid = H5.H5Screate(HDF5Constants.H5S_SIMPLE);
+ assertTrue("H5.H5Screate_simple_extent",sid > 0);
+ H5.H5Sselect_intersect_block(sid, start, end);
+ }
+ finally {
+ try {H5.H5Sclose(sid);} catch (Exception ex) {}
+ }
+ }
+
+ @Test(expected = hdf.hdf5lib.exceptions.HDF5DataspaceInterfaceException.class)
+ public void testH5Sselect_project_intersection_invalid() throws Throwable {
+ H5.H5Sselect_project_intersection(-1, -1, -1);
+ }
+
+ @Test(expected = hdf.hdf5lib.exceptions.HDF5FunctionArgumentException.class)
+ public void testH5Scombine_hyperslab_invalid() throws Throwable {
+ long start[] = new long[2];
+ long count[] = new long[2];
+ H5.H5Scombine_hyperslab(-1, 0, start, null, count, null);
+ }
+
+ @Test(expected = NullPointerException.class)
+ public void testH5Scombine_hyperslab_null_start() throws Throwable {
+ long sid = HDF5Constants.H5I_INVALID_HID;
+ long start[] = null;
+ long stride[] = null;
+ long count[] = new long[2];
+ long block[] = null;
+
+ try {
+ sid = H5.H5Screate(HDF5Constants.H5S_SIMPLE);
+ assertTrue("H5.H5Screate_simple_extent",sid > 0);
+ H5.H5Scombine_hyperslab(sid, 0, start, stride, count, block);
+ }
+ finally {
+ try {H5.H5Sclose(sid);} catch (Exception ex) {}
+ }
+ }
+
+ @Test(expected = NullPointerException.class)
+ public void testH5Scombine_hyperslab_null_count() throws Throwable {
+ long sid = HDF5Constants.H5I_INVALID_HID;
+ long start[] = new long[2];
+ long stride[] = null;
+ long count[] = null;
+ long block[] = null;
+
+ try {
+ sid = H5.H5Screate(HDF5Constants.H5S_SIMPLE);
+ assertTrue("H5.H5Screate_simple_extent",sid > 0);
+ H5.H5Scombine_hyperslab(sid, 0, start, stride, count, block);
+ }
+ finally {
+ try {H5.H5Sclose(sid);} catch (Exception ex) {}
+ }
+ }
+
+ @Test(expected = hdf.hdf5lib.exceptions.HDF5FunctionArgumentException.class)
+ public void testH5Smodify_select_invalid() throws Throwable {
+ H5.H5Smodify_select(-1, 0, -1);
+ }
+
+ @Test(expected = hdf.hdf5lib.exceptions.HDF5FunctionArgumentException.class)
+ public void testH5Scombine_select_invalid() throws Throwable {
+ H5.H5Scombine_select(-1, 0, -1);
+ }
+
}
diff --git a/java/test/TestH5T.java b/java/test/TestH5T.java
index 18b5985..ed4e2a9 100644
--- a/java/test/TestH5T.java
+++ b/java/test/TestH5T.java
@@ -1,6 +1,5 @@
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* 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 *
@@ -33,8 +32,8 @@ import org.junit.rules.TestName;
public class TestH5T {
@Rule public TestName testname = new TestName();
private static final String H5_FILE = "testT.h5";
- long H5fid = -1;
- long H5strdid = -1;
+ long H5fid = HDF5Constants.H5I_INVALID_HID;
+ long H5strdid = HDF5Constants.H5I_INVALID_HID;
private final void _deleteFile(String filename) {
File file = null;
@@ -129,7 +128,7 @@ public class TestH5T {
@Test
public void testH5Tarray_create() {
- long filetype_id = -1;
+ long filetype_id = HDF5Constants.H5I_INVALID_HID;
long[] adims = { 3, 5 };
try {
@@ -148,7 +147,7 @@ public class TestH5T {
@Test
public void testH5Tget_array_ndims() {
- long filetype_id = -1;
+ long filetype_id = HDF5Constants.H5I_INVALID_HID;
int ndims = 0;
long[] adims = { 3, 5 };
@@ -176,7 +175,7 @@ public class TestH5T {
@Test
public void testH5Tget_array_dims() {
- long filetype_id = -1;
+ long filetype_id = HDF5Constants.H5I_INVALID_HID;
int ndims = 0;
long[] adims = { 3, 5 };
long[] rdims = new long[2];
@@ -207,7 +206,7 @@ public class TestH5T {
@Test
public void testH5Tenum_functions() {
- long filetype_id =-1;
+ long filetype_id = HDF5Constants.H5I_INVALID_HID;
String enum_type ="Enum_type";
byte[] enum_val = new byte[1];
String enum_name = null;
@@ -275,7 +274,7 @@ public class TestH5T {
@Test
public void testH5Tenum_create_functions() {
- long filetype_id = -1;
+ long filetype_id = HDF5Constants.H5I_INVALID_HID;
byte[] enum_val = new byte[1];
// Create a enumerate datatype
@@ -315,7 +314,7 @@ public class TestH5T {
@Test
public void testH5Topaque_functions() {
- long filetype_id = -1;
+ long filetype_id = HDF5Constants.H5I_INVALID_HID;
String opaque_name = null;
// Create a opaque datatype
@@ -345,7 +344,7 @@ public class TestH5T {
@Test
public void testH5Tvlen_create() {
- long filetype_id = -1;
+ long filetype_id = HDF5Constants.H5I_INVALID_HID;
try {
filetype_id = H5.H5Tvlen_create(HDF5Constants.H5T_C_S1);
@@ -368,7 +367,7 @@ public class TestH5T {
@Test
public void testH5Tis_variable_str() {
- long filetype_id = -1;
+ long filetype_id = HDF5Constants.H5I_INVALID_HID;
try {
filetype_id = H5.H5Tcopy(HDF5Constants.H5T_C_S1);
@@ -399,7 +398,7 @@ public class TestH5T {
@Test
public void testH5Tcompound_functions() {
- long filetype_id =-1;
+ long filetype_id = HDF5Constants.H5I_INVALID_HID;
// Create a compound datatype
try {
diff --git a/java/test/TestH5Tbasic.java b/java/test/TestH5Tbasic.java
index 6dbc6e3..7aac2ab 100644
--- a/java/test/TestH5Tbasic.java
+++ b/java/test/TestH5Tbasic.java
@@ -1,6 +1,5 @@
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* 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 *
@@ -40,7 +39,7 @@ public class TestH5Tbasic {
@Test
public void testH5Tcopy() {
- long H5strdid = -1;
+ long H5strdid = HDF5Constants.H5I_INVALID_HID;
try {
H5strdid = H5.H5Tcopy(HDF5Constants.H5T_C_S1);
assertTrue("H5.H5Tcopy",H5strdid > 0);
@@ -57,7 +56,7 @@ public class TestH5Tbasic {
@Test
public void testH5Tequal() {
- long H5strdid = -1;
+ long H5strdid = HDF5Constants.H5I_INVALID_HID;
try {
H5strdid = H5.H5Tcopy(HDF5Constants.H5T_C_S1);
assertTrue("H5.H5Tcopy",H5strdid > 0);
@@ -76,7 +75,7 @@ public class TestH5Tbasic {
@Test
public void testH5Tequal_not() {
- long H5strdid = -1;
+ long H5strdid = HDF5Constants.H5I_INVALID_HID;
try {
H5strdid = H5.H5Tcopy(HDF5Constants.H5T_STD_U64LE);
assertTrue("H5.H5Tcopy",H5strdid > 0);
@@ -98,8 +97,8 @@ public class TestH5Tbasic {
String[] strs = {"a1234","b1234"};
int srcLen = 5;
int dstLen = 10;
- long srcId = -1;
- long dstId = -1;
+ long srcId = HDF5Constants.H5I_INVALID_HID;
+ long dstId = HDF5Constants.H5I_INVALID_HID;
int dimSize = strs.length;
byte[] buf = new byte[dimSize*dstLen];
@@ -131,7 +130,7 @@ public class TestH5Tbasic {
@Test
public void testH5Torder_size() {
- long H5strdid = -1;
+ long H5strdid = HDF5Constants.H5I_INVALID_HID;
try {
// Fixed length string
H5strdid = H5.H5Tcopy(HDF5Constants.H5T_C_S1);
diff --git a/java/test/TestH5Tparams.java b/java/test/TestH5Tparams.java
index 4180de5..92a034c 100644
--- a/java/test/TestH5Tparams.java
+++ b/java/test/TestH5Tparams.java
@@ -1,6 +1,5 @@
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* 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 *
diff --git a/java/test/TestH5VL.java b/java/test/TestH5VL.java
index 554c1f7..4253d20 100644
--- a/java/test/TestH5VL.java
+++ b/java/test/TestH5VL.java
@@ -1,6 +1,5 @@
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* 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 *
@@ -72,28 +71,28 @@ public class TestH5VL {
@Test
public void testH5VLget_connector_id() {
- String H5_FILE = "testFvl.h5";
+ String H5_FILE = "testFvl.h5";
long H5fid = H5.H5Fcreate(H5_FILE, HDF5Constants.H5F_ACC_TRUNC,
HDF5Constants.H5P_DEFAULT, HDF5Constants.H5P_DEFAULT);
- try {
- long native_id = H5.H5VLget_connector_id(H5fid);
- assertTrue("H5.H5VLget_connector_id", native_id >= 0);
-
- /*
- * If HDF5_VOL_CONNECTOR is set, this might not be the
- * native connector. Only check for the native connector
- * if this isn't set.
- */
- String connector = System.getenv("HDF5_VOL_CONNECTOR");
- if (connector == null)
- assertEquals(HDF5Constants.H5VL_NATIVE, native_id);
- }
- catch (Throwable err) {
- err.printStackTrace();
- fail("H5.H5VLget_connector_id " + err);
- }
+ try {
+ long native_id = H5.H5VLget_connector_id(H5fid);
+ assertTrue("H5.H5VLget_connector_id", native_id >= 0);
+
+ /*
+ * If HDF5_VOL_CONNECTOR is set, this might not be the
+ * native connector. Only check for the native connector
+ * if this isn't set.
+ */
+ String connector = System.getenv("HDF5_VOL_CONNECTOR");
+ if (connector == null)
+ assertEquals(HDF5Constants.H5VL_NATIVE, native_id);
+ }
+ catch (Throwable err) {
+ err.printStackTrace();
+ fail("H5.H5VLget_connector_id " + err);
+ }
finally {
if (H5fid > 0) {
try {H5.H5Fclose(H5fid);} catch (Exception ex) {}
@@ -139,14 +138,14 @@ public class TestH5VL {
try {
String native_name = H5.H5VLget_connector_name(H5fid);
- /*
- * If HDF5_VOL_CONNECTOR is set, this might not be the
- * native connector. Only check for the native connector
- * if this isn't set.
- */
- String connector = System.getenv("HDF5_VOL_CONNECTOR");
- if (connector == null)
- assertTrue("H5.H5VLget_connector_name H5VL_NATIVE", native_name.compareToIgnoreCase(HDF5Constants.H5VL_NATIVE_NAME)==0);
+ /*
+ * If HDF5_VOL_CONNECTOR is set, this might not be the
+ * native connector. Only check for the native connector
+ * if this isn't set.
+ */
+ String connector = System.getenv("HDF5_VOL_CONNECTOR");
+ if (connector == null)
+ assertTrue("H5.H5VLget_connector_name H5VL_NATIVE", native_name.compareToIgnoreCase(HDF5Constants.H5VL_NATIVE_NAME)==0);
}
catch (Throwable err) {
err.printStackTrace();
diff --git a/java/test/TestH5Z.java b/java/test/TestH5Z.java
index 696642b..fde8f1a 100644
--- a/java/test/TestH5Z.java
+++ b/java/test/TestH5Z.java
@@ -1,6 +1,5 @@
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* 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 *
diff --git a/java/test/junit.sh.in b/java/test/junit.sh.in
index 8da3384..39db296 100644
--- a/java/test/junit.sh.in
+++ b/java/test/junit.sh.in
@@ -45,6 +45,8 @@ HDFLIB_HOME="$top_srcdir/java/lib"
BLDDIR="."
BLDLIBDIR="$BLDDIR/testlibs"
HDFTEST_HOME="$top_srcdir/java/test"
+TOOLS_TESTFILES="$top_srcdir/tools/testfiles"
+
JARFILE=jar@PACKAGE_TARNAME@-@PACKAGE_VERSION@.jar
TESTJARFILE=jar@PACKAGE_TARNAME@test.jar
test -d $BLDLIBDIR || mkdir -p $BLDLIBDIR
@@ -88,10 +90,12 @@ $HDFTEST_HOME/testfiles/JUnit-TestH5T.txt
$HDFTEST_HOME/testfiles/JUnit-TestH5Dparams.txt
$HDFTEST_HOME/testfiles/JUnit-TestH5D.txt
$HDFTEST_HOME/testfiles/JUnit-TestH5Dplist.txt
+$HDFTEST_HOME/testfiles/JUnit-TestH5Drw.txt
$HDFTEST_HOME/testfiles/JUnit-TestH5Lparams.txt
$HDFTEST_HOME/testfiles/JUnit-TestH5Lbasic.txt
$HDFTEST_HOME/testfiles/JUnit-TestH5Lcreate.txt
$HDFTEST_HOME/testfiles/JUnit-TestH5R.txt
+$HDFTEST_HOME/testfiles/JUnit-TestH5Rref.txt
$HDFTEST_HOME/testfiles/JUnit-TestH5P.txt
$HDFTEST_HOME/testfiles/JUnit-TestH5PData.txt
$HDFTEST_HOME/testfiles/JUnit-TestH5Pfapl.txt
@@ -100,6 +104,7 @@ $HDFTEST_HOME/testfiles/JUnit-TestH5Pfaplhdfs.txt
$HDFTEST_HOME/testfiles/JUnit-TestH5Pvirtual.txt
$HDFTEST_HOME/testfiles/JUnit-TestH5Plist.txt
$HDFTEST_HOME/testfiles/JUnit-TestH5A.txt
+$HDFTEST_HOME/testfiles/JUnit-TestH5Arw.txt
$HDFTEST_HOME/testfiles/JUnit-TestH5Oparams.txt
$HDFTEST_HOME/testfiles/JUnit-TestH5Obasic.txt
$HDFTEST_HOME/testfiles/JUnit-TestH5Ocreate.txt
@@ -145,7 +150,7 @@ COPY_LIBFILES_TO_BLDLIBDIR()
fi
fi
done
- if [ "$IS_DARWIN" = "yes" ]; then
+ if [ "$IS_DARWIN" = "yes" ]; then
(cd testlibs; \
install_name_tool -add_rpath @loader_path libhdf5_java.dylib; \
exist_path=` otool -l libhdf5_java.dylib | grep libhdf5 | grep -v java | awk '{print $2}'`; \
@@ -247,6 +252,12 @@ COPY_DATAFILES_TO_BLDDIR()
$CP -f $HDFTEST_HOME/h5ex_g_iterate.orig $BLDDIR/h5ex_g_iterateL2.hdf
$CP -f $HDFTEST_HOME/h5ex_g_iterate.orig $BLDDIR/h5ex_g_iterateO1.hdf
$CP -f $HDFTEST_HOME/h5ex_g_iterate.orig $BLDDIR/h5ex_g_iterateO2.hdf
+ $CP -f $TOOLS_TESTFILES/trefer_reg.h5 $BLDDIR/trefer_reg.h5
+ $CP -f $TOOLS_TESTFILES/trefer_attr.h5 $BLDDIR/trefer_attr.h5
+ $CP -f $TOOLS_TESTFILES/tdatareg.h5 $BLDDIR/tdatareg.h5
+ $CP -f $TOOLS_TESTFILES/tattrreg.h5 $BLDDIR/tattrreg.h5
+ $CP -f $TOOLS_TESTFILES/tintsattrs.h5 $BLDDIR/tintsattrs.h5
+ $CP -f $TOOLS_TESTFILES/tfloatsattrs.h5 $BLDDIR/tfloatsattrs.h5
}
CLEAN_DATAFILES_AND_BLDDIR()
@@ -662,6 +673,27 @@ else
test yes = "$verbose" && $DIFF JUnit-TestH5D.txt JUnit-TestH5D.out |sed 's/^/ /'
fi
+echo "$JAVAEXE $JAVAEXEFLAGS -Xmx1024M -Dorg.slf4j.simpleLogger.defaultLog=trace -Djava.library.path=$BLDLIBDIR -cp $CLASSPATH -ea org.junit.runner.JUnitCore test.TestH5Drw"
+TESTING JUnit-TestH5Drw
+($RUNSERIAL $JAVAEXE $JAVAEXEFLAGS -Xmx1024M -Dorg.slf4j.simpleLogger.defaultLog=trace -Djava.library.path=$BLDLIBDIR -cp $CLASSPATH -ea org.junit.runner.JUnitCore test.TestH5Drw > JUnit-TestH5Drw.ext)
+
+# 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)/' \
+ -e 's/Time: [0-9]*[\.,[0-9]*]*/Time: XXXX/' \
+ -e 's/v[1-9]*\.[0-9]*\./version (number)\./' \
+ -e 's/[1-9]*\.[0-9]*\.[0-9]*[^)]*/version (number)/' \
+ JUnit-TestH5Drw.ext > JUnit-TestH5Drw.out
+
+if diff JUnit-TestH5Drw.out JUnit-TestH5Drw.txt > /dev/null; then
+ echo " PASSED JUnit-TestH5Drw"
+else
+ echo "**FAILED** JUnit-TestH5Drw"
+ echo " Expected result differs from actual result"
+ nerrors="`expr $nerrors + 1`"
+ test yes = "$verbose" && $DIFF JUnit-TestH5Drw.txt JUnit-TestH5Drw.out |sed 's/^/ /'
+fi
+
echo "$JAVAEXE $JAVAEXEFLAGS -Xmx1024M -Dorg.slf4j.simpleLogger.defaultLog=trace -Djava.library.path=$BLDLIBDIR -cp $CLASSPATH -ea org.junit.runner.JUnitCore test.TestH5Dplist"
TESTING JUnit-TestH5Dplist
($RUNSERIAL $JAVAEXE $JAVAEXEFLAGS -Xmx1024M -Dorg.slf4j.simpleLogger.defaultLog=trace -Djava.library.path=$BLDLIBDIR -cp $CLASSPATH -ea org.junit.runner.JUnitCore test.TestH5Dplist > JUnit-TestH5Dplist.ext)
@@ -767,6 +799,27 @@ else
test yes = "$verbose" && $DIFF JUnit-TestH5R.txt JUnit-TestH5R.out |sed 's/^/ /'
fi
+echo "$JAVAEXE $JAVAEXEFLAGS -Xmx1024M -Dorg.slf4j.simpleLogger.defaultLog=trace -Djava.library.path=$BLDLIBDIR -cp $CLASSPATH -ea org.junit.runner.JUnitCore test.TestH5Rref"
+TESTING JUnit-TestH5Rref
+($RUNSERIAL $JAVAEXE $JAVAEXEFLAGS -Xmx1024M -Dorg.slf4j.simpleLogger.defaultLog=trace -Djava.library.path=$BLDLIBDIR -cp $CLASSPATH -ea org.junit.runner.JUnitCore test.TestH5Rref > JUnit-TestH5Rref.ext)
+
+# 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)/' \
+ -e 's/Time: [0-9]*[\.,[0-9]*]*/Time: XXXX/' \
+ -e 's/v[1-9]*\.[0-9]*\./version (number)\./' \
+ -e 's/[1-9]*\.[0-9]*\.[0-9]*[^)]*/version (number)/' \
+ JUnit-TestH5Rref.ext > JUnit-TestH5Rref.out
+
+if diff JUnit-TestH5Rref.out JUnit-TestH5Rref.txt > /dev/null; then
+ echo " PASSED JUnit-TestH5Rref"
+else
+ echo "**FAILED** JUnit-TestH5Rref"
+ echo " Expected result differs from actual result"
+ nerrors="`expr $nerrors + 1`"
+ test yes = "$verbose" && $DIFF JUnit-TestH5Rref.txt JUnit-TestH5Rref.out |sed 's/^/ /'
+fi
+
echo "$JAVAEXE $JAVAEXEFLAGS -Xmx1024M -Dorg.slf4j.simpleLogger.defaultLog=trace -Djava.library.path=$BLDLIBDIR -cp $CLASSPATH -ea org.junit.runner.JUnitCore test.TestH5P"
TESTING JUnit-TestH5P
($RUNSERIAL $JAVAEXE $JAVAEXEFLAGS -Xmx1024M -Dorg.slf4j.simpleLogger.defaultLog=trace -Djava.library.path=$BLDLIBDIR -cp $CLASSPATH -ea org.junit.runner.JUnitCore test.TestH5P > JUnit-TestH5P.ext)
@@ -893,6 +946,27 @@ else
test yes = "$verbose" && $DIFF JUnit-TestH5A.txt JUnit-TestH5A.out |sed 's/^/ /'
fi
+echo "$JAVAEXE $JAVAEXEFLAGS -Xmx1024M -Dorg.slf4j.simpleLogger.defaultLog=trace -Djava.library.path=$BLDLIBDIR -cp $CLASSPATH -ea org.junit.runner.JUnitCore test.TestH5Arw"
+TESTING JUnit-TestH5Arw
+($RUNSERIAL $JAVAEXE $JAVAEXEFLAGS -Xmx1024M -Dorg.slf4j.simpleLogger.defaultLog=trace -Djava.library.path=$BLDLIBDIR -cp $CLASSPATH -ea org.junit.runner.JUnitCore test.TestH5Arw > JUnit-TestH5Arw.ext)
+
+# 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)/' \
+ -e 's/Time: [0-9]*[\.,[0-9]*]*/Time: XXXX/' \
+ -e 's/v[1-9]*\.[0-9]*\./version (number)\./' \
+ -e 's/[1-9]*\.[0-9]*\.[0-9]*[^)]*/version (number)/' \
+ JUnit-TestH5Arw.ext > JUnit-TestH5Arw.out
+
+if diff JUnit-TestH5Arw.out JUnit-TestH5Arw.txt > /dev/null; then
+ echo " PASSED JUnit-TestH5Arw"
+else
+ echo "**FAILED** JUnit-TestH5Arw"
+ echo " Expected result differs from actual result"
+ nerrors="`expr $nerrors + 1`"
+ test yes = "$verbose" && $DIFF JUnit-TestH5Arw.txt JUnit-TestH5Arw.out |sed 's/^/ /'
+fi
+
echo "$JAVAEXE $JAVAEXEFLAGS -Xmx1024M -Dorg.slf4j.simpleLogger.defaultLog=trace -Djava.library.path=$BLDLIBDIR -cp $CLASSPATH -ea org.junit.runner.JUnitCore test.TestH5Oparams"
TESTING JUnit-TestH5Oparams
($RUNSERIAL $JAVAEXE $JAVAEXEFLAGS -Xmx1024M -Dorg.slf4j.simpleLogger.defaultLog=trace -Djava.library.path=$BLDLIBDIR -cp $CLASSPATH -ea org.junit.runner.JUnitCore test.TestH5Oparams > JUnit-TestH5Oparams.ext)
diff --git a/java/test/testfiles/JUnit-TestH5.txt b/java/test/testfiles/JUnit-TestH5.txt
index 4bab633..fb50a57 100644
--- a/java/test/testfiles/JUnit-TestH5.txt
+++ b/java/test/testfiles/JUnit-TestH5.txt
@@ -1,10 +1,14 @@
JUnit version 4.11
+.testH5export_region
.testH5get_libversion_null_param
.testJ2C
.testH5export_dataset
.testIsSerializable
+.testH5export_attrdataset
.testH5garbage_collect
.testH5error_off
+.testH5export_regdataset
+.testH5export_attribute
.serializeToDisk
.testH5open
.testH5check_version
@@ -13,5 +17,5 @@ JUnit version 4.11
Time: XXXX
-OK (11 tests)
+OK (15 tests)
diff --git a/java/test/testfiles/JUnit-TestH5Arw.txt b/java/test/testfiles/JUnit-TestH5Arw.txt
new file mode 100644
index 0000000..49d3b1c
--- /dev/null
+++ b/java/test/testfiles/JUnit-TestH5Arw.txt
@@ -0,0 +1,13 @@
+JUnit version 4.11
+.testH5Aread_128bit_floats
+.testH5Aread_64bit_floats
+.testH5Aread_8bit_ints
+.testH5Aread_32bit_ints
+.testH5Aread_64bit_ints
+.testH5Aread_32bit_floats
+.testH5Aread_16bit_ints
+
+Time: XXXX
+
+OK (7 tests)
+
diff --git a/java/test/testfiles/JUnit-TestH5Drw.txt b/java/test/testfiles/JUnit-TestH5Drw.txt
new file mode 100644
index 0000000..6b854cf
--- /dev/null
+++ b/java/test/testfiles/JUnit-TestH5Drw.txt
@@ -0,0 +1,13 @@
+JUnit version 4.11
+.testH5Dread_32bit_floats
+.testH5Dread_32bit_ints
+.testH5Dread_64bit_ints
+.testH5Dread_64bit_floats
+.testH5Dread_8bit_ints
+.testH5Dread_128bit_floats
+.testH5Dread_16bit_ints
+
+Time: XXXX
+
+OK (7 tests)
+
diff --git a/java/test/testfiles/JUnit-TestH5Pfapl.txt b/java/test/testfiles/JUnit-TestH5Pfapl.txt
index c4f37d0..c34ac1c 100644
--- a/java/test/testfiles/JUnit-TestH5Pfapl.txt
+++ b/java/test/testfiles/JUnit-TestH5Pfapl.txt
@@ -28,6 +28,7 @@ JUnit version 4.11
.testH5Pset_elink_fapl
.testH5P_hyper_vector_size
.testH5P_gc_references
+.testH5P_file_locking
.testH5P_family_offset
.testH5P_fapl_core
.testH5P_fapl_muti
@@ -37,5 +38,5 @@ JUnit version 4.11
Time: XXXX
-OK (35 tests)
+OK (36 tests)
diff --git a/java/test/testfiles/JUnit-TestH5Rref.txt b/java/test/testfiles/JUnit-TestH5Rref.txt
new file mode 100644
index 0000000..05019c0
--- /dev/null
+++ b/java/test/testfiles/JUnit-TestH5Rref.txt
@@ -0,0 +1,10 @@
+JUnit version 4.11
+.testH5Rget_region_dataset
+.testH5Rget_object
+.testH5Rget_region_attribute
+.testH5Rget_obj_type3
+
+Time: XXXX
+
+OK (4 tests)
+
diff --git a/java/test/testfiles/JUnit-TestH5Sbasic.txt b/java/test/testfiles/JUnit-TestH5Sbasic.txt
index 707878e..3422442 100644
--- a/java/test/testfiles/JUnit-TestH5Sbasic.txt
+++ b/java/test/testfiles/JUnit-TestH5Sbasic.txt
@@ -5,18 +5,32 @@ JUnit version 4.11
.testH5Sdecode_null
.testH5Screate_simple_dims_exceed
.testH5Screate_simple_unlimted_1d
+.testH5Sselect_intersect_block_rank_start
+.testH5Sget_regular_hyperslab_invalid
+.testH5Sselect_adjust_rank_offset
.testH5Screate_simple_dims_invalid
.testH5Screate_scalar
.testH5Screate_simple
+.testH5Sselect_project_intersection_invalid
.testH5Screate_simple_rank_invalid
.testH5Sget_simple_extent_type_invalid
+.testH5Scombine_hyperslab_invalid
+.testH5Scombine_hyperslab_null_count
+.testH5Scombine_hyperslab_null_start
.testH5Sencode_invalid
.testH5Screate_null
.testH5Screate_simple_extent
.testH5Screate_invalid
+.testH5Sselect_intersect_block_invalid
+.testH5Sselect_adjust_invalid
.testH5Screate_simple_unlimted
+.testH5Sselect_shape_same_invalid
+.testH5Smodify_select_invalid
+.testH5Scombine_select_invalid
+.testH5Sselect_copy_invalid
+.testH5Sselect_intersect_block_rank_end
Time: XXXX
-OK (16 tests)
+OK (30 tests)
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index adfb755..fa42d6d 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -385,6 +385,8 @@ IDE_GENERATED_PROPERTIES ("H5HP" "${H5HP_HDRS}" "${H5HP_SOURCES}" )
set (H5I_SOURCES
${HDF5_SRC_DIR}/H5I.c
+ ${HDF5_SRC_DIR}/H5Idbg.c
+ ${HDF5_SRC_DIR}/H5Iint.c
${HDF5_SRC_DIR}/H5Itest.c
)
set (H5I_HDRS
@@ -606,14 +608,6 @@ set (H5SM_HDRS
IDE_GENERATED_PROPERTIES ("H5SM" "${H5SM_HDRS}" "${H5SM_SOURCES}" )
-set (H5ST_SOURCES
- ${HDF5_SRC_DIR}/H5ST.c
-)
-set (H5ST_HDRS
-)
-IDE_GENERATED_PROPERTIES ("H5ST" "${H5ST_HDRS}" "${H5ST_SOURCES}" )
-
-
set (H5T_SOURCES
${HDF5_SRC_DIR}/H5T.c
${HDF5_SRC_DIR}/H5Tarray.c
@@ -807,7 +801,6 @@ set (common_SRCS
${H5S_SOURCES}
${H5SL_SOURCES}
${H5SM_SOURCES}
- ${H5ST_SOURCES}
${H5T_SOURCES}
${H5TS_SOURCES}
${H5VL_SOURCES}
@@ -898,6 +891,7 @@ set (H5_PRIVATE_HEADERS
${HDF5_SRC_DIR}/H5FApkg.h
${HDF5_SRC_DIR}/H5FAprivate.h
+ ${HDF5_SRC_DIR}/H5FDmirror_priv.h
${HDF5_SRC_DIR}/H5FDpkg.h
${HDF5_SRC_DIR}/H5FDprivate.h
${HDF5_SRC_DIR}/H5FDvfd_swmr_private.h
@@ -932,6 +926,7 @@ set (H5_PRIVATE_HEADERS
${HDF5_SRC_DIR}/H5Mpkg.h
${HDF5_SRC_DIR}/H5Mprivate.h
+ ${HDF5_SRC_DIR}/H5MFpkg.h
${HDF5_SRC_DIR}/H5MFprivate.h
${HDF5_SRC_DIR}/H5MMprivate.h
@@ -968,8 +963,6 @@ set (H5_PRIVATE_HEADERS
${HDF5_SRC_DIR}/H5SMpkg.h
${HDF5_SRC_DIR}/H5SMprivate.h
- ${HDF5_SRC_DIR}/H5STprivate.h
-
${HDF5_SRC_DIR}/H5Tpkg.h
${HDF5_SRC_DIR}/H5Tprivate.h
@@ -989,6 +982,8 @@ set (H5_PRIVATE_HEADERS
${HDF5_SRC_DIR}/H5Zprivate.h
${HDF5_SRC_DIR}/H5win32defs.h
+
+ ${HDF5_SRC_DIR}/uthash.h
)
set (H5_GENERATED_HEADERS
@@ -1406,8 +1401,8 @@ endif ()
# Option to build documentation
#-----------------------------------------------------------------------------
if (DOXYGEN_FOUND)
- set (DOXYGEN_PACKAGE ${HDF5_PACKAGE})
- set (DOXYGEN_VERSION_STRING ${HDF5_VERSION_STRING})
+ set (DOXYGEN_PACKAGE ${HDF5_PACKAGE_NAME})
+ set (DOXYGEN_VERSION_STRING ${HDF5_PACKAGE_VERSION_STRING})
set (DOXYGEN_INCLUDE_ALIASES_PATH ${HDF5_DOXYGEN_DIR})
set (DOXYGEN_INCLUDE_ALIASES aliases)
set (DOXYGEN_VERBATIM_VARS DOXYGEN_INCLUDE_ALIASES)
@@ -1417,7 +1412,15 @@ if (DOXYGEN_FOUND)
set (DOXYGEN_OPTIMIZE_OUTPUT_FOR_C YES)
set (DOXYGEN_MACRO_EXPANSION YES)
set (DOXYGEN_OUTPUT_DIRECTORY ${HDF5_BINARY_DIR}/hdf5lib_docs)
- set (DOXYGEN_EXAMPLES_DIRECTORY ${HDF5_DOXYGEN_DIR}/examples)
+ set (DOXYGEN_EXAMPLES_DIRECTORY "${HDF5_DOXYGEN_DIR}/examples ${HDF5_SRC_DIR} ${HDF5_SOURCE_DIR}/examples ${HDF5_TEST_SRC_DIR}")
+ set (DOXYGEN_LAYOUT_FILE ${HDF5_DOXYGEN_DIR}/hdf5doxy_layout.xml)
+ set (DOXYGEN_HTML_HEADER ${HDF5_DOXYGEN_DIR}/hdf5_header.html)
+ set (DOXYGEN_HTML_FOOTER ${HDF5_DOXYGEN_DIR}/hdf5_footer.html)
+ set (DOXYGEN_HTML_EXTRA_STYLESHEET ${HDF5_DOXYGEN_DIR}/hdf5doxy.css)
+ set (DOXYGEN_HTML_EXTRA_FILES "${HDF5_DOXYGEN_DIR}/hdf5_navtree_hacks.js ${HDF5_DOXYGEN_DIR}/img/ftv2node.png ${HDF5_DOXYGEN_DIR}/img/ftv2pnode.png")
+ set (DOXYGEN_SERVER_BASED_SEARCH NO)
+ set (DOXYGEN_EXTERNAL_SEARCH NO)
+ set (DOXYGEN_SEARCHENGINE_URL)
# This configure and custom target work together
# Replace variables inside @@ with the current values
diff --git a/src/H5.c b/src/H5.c
index 62ea257..adbd3a7 100644
--- a/src/H5.c
+++ b/src/H5.c
@@ -254,6 +254,8 @@ H5_init_library(void)
* It might not be initialized during normal file open.
* When the application does not close the file, routines in the module might
* be called via H5_term_library() when shutting down the file.
+ * The dataspace interface needs to be initialized so that future IDs for
+ * dataspaces work.
*/
if (H5E_init() < 0)
HGOTO_ERROR(H5E_FUNC, H5E_CANTINIT, FAIL, "unable to initialize error interface")
@@ -271,6 +273,8 @@ H5_init_library(void)
HGOTO_ERROR(H5E_FUNC, H5E_CANTINIT, FAIL, "unable to initialize link interface")
if (H5FS_init() < 0)
HGOTO_ERROR(H5E_FUNC, H5E_CANTINIT, FAIL, "unable to initialize FS interface")
+ if (H5S_init() < 0)
+ HGOTO_ERROR(H5E_FUNC, H5E_CANTINIT, FAIL, "unable to initialize dataspace interface")
/* Finish initializing interfaces that depend on the interfaces above */
if (H5VL_init_phase2() < 0)
@@ -361,21 +365,26 @@ H5_term_library(void)
/* Try to organize these so the "higher" level components get shut
* down before "lower" level components that they might rely on. -QAK
*/
- pending += DOWN(L);
- /* Close the "top" of various interfaces (IDs, etc) but don't shut
- * down the whole interface yet, so that the object header messages
- * get serialized correctly for entries in the metadata cache and the
- * symbol table entry in the superblock gets serialized correctly, etc.
- * all of which is performed in the 'F' shutdown.
- */
- pending += DOWN(A_top);
- pending += DOWN(D_top);
- pending += DOWN(G_top);
- pending += DOWN(M_top);
- pending += DOWN(R_top);
- pending += DOWN(S_top);
- pending += DOWN(T_top);
+ /* Close down the user-facing interfaces, after the event sets */
+ if (pending == 0) {
+ /* Close the interfaces dependent on others */
+ pending += DOWN(L);
+
+ /* Close the "top" of various interfaces (IDs, etc) but don't shut
+ * down the whole interface yet, so that the object header messages
+ * get serialized correctly for entries in the metadata cache and the
+ * symbol table entry in the superblock gets serialized correctly, etc.
+ * all of which is performed in the 'F' shutdown.
+ */
+ pending += DOWN(A_top);
+ pending += DOWN(D_top);
+ pending += DOWN(G_top);
+ pending += DOWN(M_top);
+ pending += DOWN(R_top);
+ pending += DOWN(S_top);
+ pending += DOWN(T_top);
+ } /* end if */
/* Don't shut down the file code until objects in files are shut down */
if (pending == 0)
diff --git a/src/H5ACmpio.c b/src/H5ACmpio.c
index b0b54eb..afc15d1 100644
--- a/src/H5ACmpio.c
+++ b/src/H5ACmpio.c
@@ -1271,7 +1271,7 @@ H5AC__propagate_and_apply_candidate_list(H5F_t *f)
if (aux_ptr->write_done)
(aux_ptr->write_done)();
- /* to prevent "messages from the past" we must synchronize all
+ /* To prevent "messages from the past" we must synchronize all
* processes again before we go on.
*/
if (MPI_SUCCESS != (mpi_result = MPI_Barrier(aux_ptr->mpi_comm)))
@@ -1514,7 +1514,7 @@ H5AC__receive_and_apply_clean_list(H5F_t *f)
HGOTO_ERROR(H5E_CACHE, H5E_CANTGET, FAIL, "can't receive clean list")
if (num_entries > 0)
- /* mark the indicated entries as clean */
+ /* Mark the indicated entries as clean */
if (H5C_mark_entries_as_clean(f, num_entries, haddr_buf_ptr) < 0)
HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "Can't mark entries clean.")
@@ -1848,6 +1848,8 @@ done:
* Programmer: John Mainzer
* April 28, 2010
*
+ * Changes: None.
+ *
*-------------------------------------------------------------------------
*/
static herr_t
@@ -1876,9 +1878,12 @@ H5AC__rsp__p0_only__flush(H5F_t *f)
* However, when flushing from within the close operation from a file,
* it's possible to skip this barrier (on the second flush of the cache).
*/
- if (!H5CX_get_mpi_file_flushing())
+ if (!H5CX_get_mpi_file_flushing()) {
+
if (MPI_SUCCESS != (mpi_result = MPI_Barrier(aux_ptr->mpi_comm)))
+
HMPI_GOTO_ERROR(FAIL, "MPI_Barrier failed", mpi_result)
+ }
/* Flush data to disk, from rank 0 process */
if (aux_ptr->mpi_rank == 0) {
@@ -2075,9 +2080,13 @@ H5AC__run_sync_point(H5F_t *f, int sync_point_op)
/* Sanity checks */
HDassert(f != NULL);
+
cache_ptr = f->shared->cache;
+
HDassert(cache_ptr != NULL);
+
aux_ptr = (H5AC_aux_t *)H5C_get_aux_ptr(cache_ptr);
+
HDassert(aux_ptr != NULL);
HDassert(aux_ptr->magic == H5AC__H5AC_AUX_T_MAGIC);
HDassert((sync_point_op == H5AC_SYNC_POINT_OP__FLUSH_TO_MIN_CLEAN) ||
@@ -2157,6 +2166,7 @@ H5AC__run_sync_point(H5F_t *f, int sync_point_op)
#endif /* H5AC_DEBUG_DIRTY_BYTES_CREATION */
done:
+
FUNC_LEAVE_NOAPI(ret_value)
} /* H5AC__run_sync_point() */
@@ -2252,7 +2262,6 @@ H5AC__tidy_cache_0_lists(H5AC_t *cache_ptr, unsigned num_candidates, haddr_t *ca
* request to flush all items and something was protected.
*
* Programmer: Quincey Koziol
- * koziol@hdfgroup.org
* Aug 22 2009
*
*-------------------------------------------------------------------------
diff --git a/src/H5Abtree2.c b/src/H5Abtree2.c
index adca15a..3274dd7 100644
--- a/src/H5Abtree2.c
+++ b/src/H5Abtree2.c
@@ -15,7 +15,7 @@
*
* Created: H5Abtree2.c
* Dec 4 2006
- * Quincey Koziol <koziol@hdfgroup.org>
+ * Quincey Koziol
*
* Purpose: v2 B-tree callbacks for indexing attributes on objects
*
@@ -140,7 +140,6 @@ const H5B2_class_t H5A_BT2_CORDER[1] = {{
* Return: SUCCEED/FAIL
*
* Programmer: Quincey Koziol
- * koziol@hdfgroup.org
* Dec 4 2006
*
*-------------------------------------------------------------------------
@@ -365,9 +364,8 @@ H5A__dense_btree2_name_debug(FILE *stream, int indent, int fwidth, const void *_
FUNC_ENTER_STATIC_NOERR
- HDfprintf(stream, "%*s%-*s {%016Hx, %02x, %u, %08lx}\n", indent, "", fwidth,
- "Record:", (hsize_t)nrecord->id.val, (unsigned)nrecord->flags, (unsigned)nrecord->corder,
- (unsigned long)nrecord->hash);
+ HDfprintf(stream, "%*s%-*s {%016" PRIx64 ", %02" PRIx8 ", %u, %08" PRIx32 "}\n", indent, "", fwidth,
+ "Record:", nrecord->id.val, nrecord->flags, (unsigned)nrecord->corder, nrecord->hash);
FUNC_LEAVE_NOAPI(SUCCEED)
} /* H5A__dense_btree2_name_debug() */
@@ -517,8 +515,8 @@ H5A__dense_btree2_corder_debug(FILE *stream, int indent, int fwidth, const void
FUNC_ENTER_STATIC_NOERR
- HDfprintf(stream, "%*s%-*s {%016Hx, %02x, %u}\n", indent, "", fwidth, "Record:", (hsize_t)nrecord->id.val,
- (unsigned)nrecord->flags, (unsigned)nrecord->corder);
+ HDfprintf(stream, "%*s%-*s {%016" PRIx64 ", %02" PRIx8 ", %u}\n", indent, "", fwidth,
+ "Record:", nrecord->id.val, nrecord->flags, (unsigned)nrecord->corder);
FUNC_LEAVE_NOAPI(SUCCEED)
} /* H5A__dense_btree2_corder_debug() */
diff --git a/src/H5Adense.c b/src/H5Adense.c
index a1c0de6..1575f3c 100644
--- a/src/H5Adense.c
+++ b/src/H5Adense.c
@@ -15,7 +15,7 @@
*
* Created: H5Adense.c
* Dec 4 2006
- * Quincey Koziol <koziol@hdfgroup.org>
+ * Quincey Koziol
*
* Purpose: Routines for operating on "dense" attribute storage
* for an object.
@@ -199,9 +199,6 @@ H5A__dense_create(H5F_t *f, H5O_ainfo_t *ainfo)
/* Retrieve the heap's address in the file */
if (H5HF_get_heap_addr(fheap, &ainfo->fheap_addr) < 0)
HGOTO_ERROR(H5E_ATTR, H5E_CANTGETSIZE, FAIL, "can't get fractal heap address")
-#ifdef QAK
- HDfprintf(stderr, "%s: ainfo->fheap_addr = %a\n", FUNC, ainfo->fheap_addr);
-#endif /* QAK */
#ifndef NDEBUG
{
@@ -211,9 +208,6 @@ H5A__dense_create(H5F_t *f, H5O_ainfo_t *ainfo)
if (H5HF_get_id_len(fheap, &fheap_id_len) < 0)
HGOTO_ERROR(H5E_ATTR, H5E_CANTGETSIZE, FAIL, "can't get fractal heap ID length")
HDassert(fheap_id_len == H5O_FHEAP_ID_LEN);
-#ifdef QAK
- HDfprintf(stderr, "%s: fheap_id_len = %Zu\n", FUNC, fheap_id_len);
-#endif /* QAK */
}
#endif /* NDEBUG */
@@ -233,9 +227,6 @@ H5A__dense_create(H5F_t *f, H5O_ainfo_t *ainfo)
/* Retrieve the v2 B-tree's address in the file */
if (H5B2_get_addr(bt2_name, &ainfo->name_bt2_addr) < 0)
HGOTO_ERROR(H5E_ATTR, H5E_CANTGET, FAIL, "can't get v2 B-tree address for name index")
-#ifdef QAK
- HDfprintf(stderr, "%s: ainfo->name_bt2_addr = %a\n", FUNC, ainfo->name_bt2_addr);
-#endif /* QAK */
/* Check if we should create a creation order index v2 B-tree */
if (ainfo->index_corder) {
@@ -254,10 +245,7 @@ H5A__dense_create(H5F_t *f, H5O_ainfo_t *ainfo)
/* Retrieve the v2 B-tree's address in the file */
if (H5B2_get_addr(bt2_corder, &ainfo->corder_bt2_addr) < 0)
HGOTO_ERROR(H5E_ATTR, H5E_CANTGET, FAIL, "can't get v2 B-tree address for creation order index")
-#ifdef QAK
- HDfprintf(stderr, "%s: ainfo->corder_bt2_addr = %a\n", FUNC, ainfo->corder_bt2_addr);
-#endif /* QAK */
- } /* end if */
+ } /* end if */
done:
/* Release resources */
diff --git a/src/H5Adeprec.c b/src/H5Adeprec.c
index ba12d4c..3d4e391 100644
--- a/src/H5Adeprec.c
+++ b/src/H5Adeprec.c
@@ -15,7 +15,7 @@
*
* Created: H5Adeprec.c
* November 27 2006
- * Quincey Koziol <koziol@hdfgroup.org>
+ * Quincey Koziol
*
* Purpose: Deprecated functions from the H5A interface. These
* functions are here for compatibility purposes and may be
@@ -209,7 +209,7 @@ H5Aopen_name(hid_t loc_id, const char *name)
/* Register the attribute and get an ID for it */
if ((ret_value = H5VL_register(H5I_ATTR, attr, vol_obj->connector, TRUE)) < 0)
- HGOTO_ERROR(H5E_ATTR, H5E_CANTREGISTER, H5I_INVALID_HID, "unable to atomize attribute handle")
+ HGOTO_ERROR(H5E_ATTR, H5E_CANTREGISTER, H5I_INVALID_HID, "unable to register attribute handle")
done:
/* Clean up on failure */
@@ -277,7 +277,7 @@ H5Aopen_idx(hid_t loc_id, unsigned idx)
/* Register the attribute and get an ID for it */
if ((ret_value = H5VL_register(H5I_ATTR, attr, vol_obj->connector, TRUE)) < 0)
- HGOTO_ERROR(H5E_ATTR, H5E_CANTREGISTER, H5I_INVALID_HID, "unable to atomize attribute handle")
+ HGOTO_ERROR(H5E_ATTR, H5E_CANTREGISTER, H5I_INVALID_HID, "unable to register attribute handle")
done:
/* Clean up on failure */
@@ -373,7 +373,7 @@ done:
Deprecated in favor of H5Aiterate2
--------------------------------------------------------------------------*/
herr_t
-H5Aiterate1(hid_t loc_id, unsigned *attr_num, H5A_operator1_t op, void *op_data)
+H5Aiterate1(hid_t loc_id, unsigned *attr_num /*in,out*/, H5A_operator1_t op, void *op_data)
{
H5VL_object_t *vol_obj = NULL; /* Object of loc_id */
herr_t ret_value; /* Return value */
@@ -387,12 +387,12 @@ H5Aiterate1(hid_t loc_id, unsigned *attr_num, H5A_operator1_t op, void *op_data)
/* Get the location object */
if (NULL == (vol_obj = H5VL_vol_object(loc_id)))
- HGOTO_ERROR(H5E_VOL, H5E_BADTYPE, H5_ITER_ERROR, "invalid location identifier")
+ HGOTO_ERROR(H5E_ATTR, H5E_BADTYPE, H5_ITER_ERROR, "invalid location identifier")
/* Call attribute iteration routine */
if ((ret_value = H5VL_attr_optional(vol_obj, H5VL_NATIVE_ATTR_ITERATE_OLD, H5P_DATASET_XFER_DEFAULT,
H5_REQUEST_NULL, loc_id, attr_num, op, op_data)) < 0)
- HERROR(H5E_VOL, H5E_BADITER, "error iterating over attributes");
+ HERROR(H5E_ATTR, H5E_BADITER, "error iterating over attributes");
done:
FUNC_LEAVE_API(ret_value)
diff --git a/src/H5Aint.c b/src/H5Aint.c
index f323494..9bbf031 100644
--- a/src/H5Aint.c
+++ b/src/H5Aint.c
@@ -14,8 +14,8 @@
/*-------------------------------------------------------------------------
*
* Created: H5Aint.c
- * Dec 18 2006
- * Quincey Koziol <koziol@hdfgroup.org>
+ * Dec 18 2006
+ * Quincey Koziol
*
* Purpose: Internal routines for managing attributes.
*
@@ -589,7 +589,7 @@ H5A__read(const H5A_t *attr, const H5T_t *mem_type, void *buf)
hssize_t snelmts; /* elements in attribute */
size_t nelmts; /* elements in attribute*/
H5T_path_t *tpath = NULL; /* type conversion info */
- hid_t src_id = -1, dst_id = -1; /* temporary type atoms*/
+ hid_t src_id = -1, dst_id = -1; /* temporary type IDs*/
size_t src_type_size; /* size of source type */
size_t dst_type_size; /* size of destination type */
size_t buf_size; /* desired buffer size */
@@ -698,7 +698,7 @@ H5A__write(H5A_t *attr, const H5T_t *mem_type, const void *buf)
hssize_t snelmts; /* elements in attribute */
size_t nelmts; /* elements in attribute */
H5T_path_t *tpath = NULL; /* conversion information*/
- hid_t src_id = -1, dst_id = -1; /* temporary type atoms */
+ hid_t src_id = -1, dst_id = -1; /* temporary type IDs */
size_t src_type_size; /* size of source type */
size_t dst_type_size; /* size of destination type*/
size_t buf_size; /* desired buffer size */
@@ -856,9 +856,9 @@ H5A_get_space(H5A_t *attr)
if (NULL == (ds = H5S_copy(attr->shared->ds, FALSE, TRUE)))
HGOTO_ERROR(H5E_ATTR, H5E_CANTINIT, H5I_INVALID_HID, "unable to copy dataspace")
- /* Atomize */
+ /* Register */
if ((ret_value = H5I_register(H5I_DATASPACE, ds, TRUE)) < 0)
- HGOTO_ERROR(H5E_ATOM, H5E_CANTREGISTER, H5I_INVALID_HID, "unable to register dataspace atom")
+ HGOTO_ERROR(H5E_ID, H5E_CANTREGISTER, H5I_INVALID_HID, "unable to register dataspace ID")
done:
if (H5I_INVALID_HID == ret_value && ds && H5S_close(ds) < 0)
@@ -906,18 +906,18 @@ H5A__get_type(H5A_t *attr)
if (H5T_lock(dt, FALSE) < 0)
HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, H5I_INVALID_HID, "unable to lock transient datatype")
- /* Atomize */
+ /* Register */
if (H5T_is_named(dt)) {
/* If this is a committed datatype, we need to recreate the
* two level IDs, where the VOL object is a copy of the
* returned datatype
*/
if ((ret_value = H5VL_wrap_register(H5I_DATATYPE, dt, TRUE)) < 0)
- HGOTO_ERROR(H5E_ATOM, H5E_CANTREGISTER, H5I_INVALID_HID, "unable to atomize file handle")
+ HGOTO_ERROR(H5E_ID, H5E_CANTREGISTER, H5I_INVALID_HID, "unable to register file handle")
}
else {
if ((ret_value = H5I_register(H5I_DATATYPE, dt, TRUE)) < 0)
- HGOTO_ERROR(H5E_ATOM, H5E_CANTREGISTER, H5I_INVALID_HID, "unable to register datatype")
+ HGOTO_ERROR(H5E_ID, H5E_CANTREGISTER, H5I_INVALID_HID, "unable to register datatype")
}
done:
@@ -2189,10 +2189,10 @@ H5A__attr_copy_file(const H5A_t *attr_src, H5F_t *file_dst, hbool_t *recompute_s
if (NULL == (buf_space = H5S_create_simple((unsigned)1, &buf_dim, NULL)))
HGOTO_ERROR(H5E_DATASPACE, H5E_CANTCREATE, NULL, "can't create simple dataspace")
- /* Atomize */
+ /* Register */
if ((buf_sid = H5I_register(H5I_DATASPACE, buf_space, FALSE)) < 0) {
H5S_close(buf_space);
- HGOTO_ERROR(H5E_ATOM, H5E_CANTREGISTER, NULL, "unable to register dataspace ID")
+ HGOTO_ERROR(H5E_ID, H5E_CANTREGISTER, NULL, "unable to register dataspace ID")
} /* end if */
/* Allocate memory for recclaim buf */
@@ -2380,7 +2380,6 @@ done:
* Failure: Negative
*
* Programmer: Peter Cao
- * xcao@hdfgroup.org
* July 20, 2007
*
*-------------------------------------------------------------------------
@@ -2498,7 +2497,7 @@ H5A__rename_by_name(H5G_loc_t loc, const char *obj_name, const char *old_attr_na
FUNC_ENTER_PACKAGE
/* Avoid thrashing things if the names are the same */
- if (HDstrcmp(old_attr_name, new_attr_name)) {
+ if (HDstrcmp(old_attr_name, new_attr_name) != 0) {
/* Set up opened group location to fill in */
obj_loc.oloc = &obj_oloc;
obj_loc.path = &obj_path;
@@ -2601,7 +2600,7 @@ H5A__iterate(const H5G_loc_t *loc, const char *obj_name, H5_index_t idx_type, H5
/* Get an ID for the object */
if ((obj_loc_id = H5VL_wrap_register(obj_type, temp_obj, TRUE)) < 0)
- HGOTO_ERROR(H5E_ATOM, H5E_CANTREGISTER, FAIL, "unable to register datatype");
+ HGOTO_ERROR(H5E_ID, H5E_CANTREGISTER, FAIL, "unable to register datatype");
/* Call internal attribute iteration routine */
if ((ret_value = H5A__iterate_common(obj_loc_id, idx_type, order, idx, &attr_op, op_data)) < 0)
diff --git a/src/H5Amodule.h b/src/H5Amodule.h
index 45172bf..c89c93f 100644
--- a/src/H5Amodule.h
+++ b/src/H5Amodule.h
@@ -30,19 +30,39 @@
#define H5_MY_PKG_INIT YES
/**\defgroup H5A H5A
- * \brief Attribute Interface
*
- * \details The Attribute Interface, H5A, provides a mechanism for attaching
- * additional information to a dataset, group, or named datatype.
+ * Use the functions in this module to manage HDF5 attributes.
*
- * Attributes are accessed by opening the object that they are
- * attached to and are not independent objects. Typically an
- * attribute is small in size and contains user metadata about the
- * object that it is attached to.
+ * The Attribute Interface, H5A, provides a mechanism for attaching additional
+ * information to a dataset, group, or named datatype.
*
- * Attributes look similar to HDF5 datasets in that they have a
- * datatype and dataspace. However, they do not support partial
- * I/O operations and cannot be compressed or extended.
+ * Attributes are accessed by opening the object that they are attached to and
+ * are not independent objects. Typically an attribute is small in size and
+ * contains user metadata about the object that it is attached to.
+ *
+ * Attributes look similar to HDF5 datasets in that they have a datatype and
+ * dataspace. However, they do not support partial I/O operations and cannot be
+ * compressed or extended.
+ *
+ * <table>
+ * <tr><th>Create</th><th>Read</th></tr>
+ * <tr valign="top">
+ * <td>
+ * \snippet H5A_examples.c create
+ * </td>
+ * <td>
+ * \snippet H5A_examples.c read
+ * </td>
+ * <tr><th>Update</th><th>Delete</th></tr>
+ * <tr valign="top">
+ * <td>
+ * \snippet H5A_examples.c update
+ * </td>
+ * <td>
+ * \snippet H5A_examples.c delete
+ * </td>
+ * </tr>
+ * </table>
*
*/
diff --git a/src/H5Apublic.h b/src/H5Apublic.h
index 28a0e85..6ec9144 100644
--- a/src/H5Apublic.h
+++ b/src/H5Apublic.h
@@ -22,17 +22,40 @@
#include "H5Opublic.h" /* Object Headers */
#include "H5Tpublic.h" /* Datatypes */
-/* Information struct for attribute (for H5Aget_info/H5Aget_info_by_idx) */
+//! <!-- [H5A_info_t_snip] -->
+/**
+ * Information struct for H5Aget_info() / H5Aget_info_by_idx()
+ */
typedef struct {
- hbool_t corder_valid; /* Indicate if creation order is valid */
- H5O_msg_crt_idx_t corder; /* Creation order */
- H5T_cset_t cset; /* Character set of attribute name */
- hsize_t data_size; /* Size of raw data */
+ hbool_t corder_valid; /**< Indicate if creation order is valid */
+ H5O_msg_crt_idx_t corder; /**< Creation order */
+ H5T_cset_t cset; /**< Character set of attribute name */
+ hsize_t data_size; /**< Size of raw data */
} H5A_info_t;
+//! <!-- [H5A_info_t_snip] -->
-/* Typedef for H5Aiterate2() callbacks */
+//! <!-- [H5A_operator2_t_snip] -->
+/**
+ * Typedef for H5Aiterate2() / H5Aiterate_by_name() callbacks
+ * \param[in] location_id The identifier for the group, dataset
+ * or named datatype being iterated over
+ * \param[in] attr_name The name of the current object attribute
+ * \param[in] ainfo The attribute’s info struct
+ * \param[in,out] op_data A pointer to the operator data passed in to
+ * H5Aiterate2() or H5Aiterate_by_name()
+ * \returns The return values from an operator are:
+ * \li Zero causes the iterator to continue, returning zero when
+ * all attributes have been processed.
+ * \li Positive causes the iterator to immediately return that
+ * positive value, indicating short-circuit success. The
+ * iterator can be restarted at the next attribute.
+ * \li Negative causes the iterator to immediately return that value,
+ * indicating failure. The iterator can be restarted at the next
+ * attribute.
+ */
typedef herr_t (*H5A_operator2_t)(hid_t location_id /*in*/, const char *attr_name /*in*/,
const H5A_info_t *ainfo /*in*/, void *op_data /*in,out*/);
+//! <!-- [H5A_operator2_t_snip] -->
/********************/
/* Public Variables */
@@ -95,9 +118,28 @@ H5_DLL htri_t H5Aexists_by_name(hid_t obj_id, const char *obj_name, const char *
/* Typedefs */
-/* Typedef for H5Aiterate1() callbacks */
+//! <!-- [H5A_operator1_t_snip] -->
+/**
+ * \brief Typedef for H5Aiterate1() callbacks
+ *
+ * \param[in] location_id The identifier for the group, dataset
+ * or named datatype being iterated over
+ * \param[in] attr_name The name of the current object attribute
+ * \param[in,out] operator_data A pointer to the operator data passed in to
+ * H5Aiterate1()
+ * \returns The return values from an operator are:
+ * \li Zero causes the iterator to continue, returning zero when
+ * all attributes have been processed.
+ * \li Positive causes the iterator to immediately return that
+ * positive value, indicating short-circuit success. The
+ * iterator can be restarted at the next attribute.
+ * \li Negative causes the iterator to immediately return that value,
+ * indicating failure. The iterator can be restarted at the next
+ * attribute.
+ */
typedef herr_t (*H5A_operator1_t)(hid_t location_id /*in*/, const char *attr_name /*in*/,
void *operator_data /*in,out*/);
+//! <!-- [H5A_operator1_t_snip] -->
/* Function prototypes */
H5_DLL hid_t H5Acreate1(hid_t loc_id, const char *name, hid_t type_id, hid_t space_id, hid_t acpl_id);
diff --git a/src/H5B.c b/src/H5B.c
index 1650736..8a92e1a 100644
--- a/src/H5B.c
+++ b/src/H5B.c
@@ -13,9 +13,9 @@
/*-------------------------------------------------------------------------
*
- * Created: H5B.c
- * Jul 10 1997
- * Robb Matzke <matzke@llnl.gov>
+ * Created: H5B.c
+ * Jul 10 1997
+ * Robb Matzke
*
* Purpose: Implements balanced, sibling-linked, N-ary trees
* capable of storing any type of data with unique key
@@ -199,7 +199,6 @@ H5FL_SEQ_DEFINE_STATIC(size_t);
* Failure: Negative
*
* Programmer: Robb Matzke
- * matzke@llnl.gov
* Jun 23 1997
*
*-------------------------------------------------------------------------
@@ -283,7 +282,6 @@ done:
* UDATA is undefined).
*
* Programmer: Robb Matzke
- * matzke@llnl.gov
* Jun 23 1997
*
*-------------------------------------------------------------------------
@@ -336,6 +334,7 @@ H5B_find(H5F_t *f, const H5B_class_t *type, haddr_t addr, void *udata)
else
lt = idx + 1;
} /* end while */
+
/* Check if not found */
if (cmp)
HGOTO_DONE(FALSE)
@@ -378,7 +377,6 @@ done:
* returned through the NEW_ADDR argument). Negative on failure.
*
* Programmer: Robb Matzke
- * matzke@llnl.gov
* Jul 3 1997
*
*-------------------------------------------------------------------------
@@ -531,7 +529,6 @@ done:
* Return: Non-negative on success/Negative on failure
*
* Programmer: Robb Matzke
- * matzke@llnl.gov
* Jun 23 1997
*
*-------------------------------------------------------------------------
@@ -687,7 +684,6 @@ done:
* Return: Non-negative on success/Negative on failure
*
* Programmer: Robb Matzke
- * matzke@llnl.gov
* Jul 8 1997
*
*-------------------------------------------------------------------------
@@ -773,7 +769,6 @@ H5B__insert_child(H5B_t *bt, unsigned *bt_flags, unsigned idx, haddr_t child, H5
* Failure: H5B_INS_ERROR
*
* Programmer: Robb Matzke
- * matzke@llnl.gov
* Jul 9 1997
*
*-------------------------------------------------------------------------
@@ -1113,7 +1108,6 @@ done:
* Return: Non-negative on success/Negative on failure
*
* Programmer: Robb Matzke
- * matzke@llnl.gov
* Jun 23 1997
*
*-------------------------------------------------------------------------
@@ -1178,7 +1172,6 @@ done:
* Return: Non-negative on success/Negative on failure
*
* Programmer: Robb Matzke
- * matzke@llnl.gov
* Jun 23 1997
*
*-------------------------------------------------------------------------
@@ -1672,7 +1665,6 @@ done:
* Failure: NULL
*
* Programmer: Quincey Koziol
- * koziol@hdfgroup.org
* May 27 2008
*
*-------------------------------------------------------------------------
@@ -1777,7 +1769,6 @@ H5B_shared_free(void *_shared)
* Failure: NULL
*
* Programmer: Quincey Koziol
- * koziol@ncsa.uiuc.edu
* Apr 18 2000
*
*-------------------------------------------------------------------------
@@ -1842,7 +1833,6 @@ done:
* Return: Non-negative on success/Negative on failure
*
* Programmer: Quincey Koziol
- * koziol@hdfgroup.org
* Jun 3 2008
*
*-------------------------------------------------------------------------
@@ -2052,7 +2042,6 @@ done:
* Failure: FAIL
*
* Programmer: Quincey Koziol
- * koziol@hdfgroup.org
* Mar 26, 2008
*
*-------------------------------------------------------------------------
diff --git a/src/H5B2.c b/src/H5B2.c
index 320fe17..5453387 100644
--- a/src/H5B2.c
+++ b/src/H5B2.c
@@ -1509,9 +1509,6 @@ H5B2_delete(H5F_t *f, haddr_t addr, void *ctx_udata, H5B2_remove_t op, void *op_
HDassert(H5F_addr_defined(addr));
/* Lock the v2 B-tree header into memory */
-#ifdef QAK
- HDfprintf(stderr, "%s: addr = %a\n", FUNC, addr);
-#endif /* QAK */
if (NULL == (hdr = H5B2__hdr_protect(f, addr, ctx_udata, H5AC__NO_FLAGS_SET)))
HGOTO_ERROR(H5E_BTREE, H5E_CANTPROTECT, FAIL, "unable to protect v2 B-tree header")
diff --git a/src/H5B2cache.c b/src/H5B2cache.c
index 35351d9..f38147b 100644
--- a/src/H5B2cache.c
+++ b/src/H5B2cache.c
@@ -15,7 +15,7 @@
*
* Created: H5B2cache.c
* Jan 31 2005
- * Quincey Koziol <koziol@hdfgroup.org>
+ * Quincey Koziol
*
* Purpose: Implement v2 B-tree metadata cache methods.
*
@@ -159,7 +159,6 @@ const H5AC_class_t H5AC_BT2_LEAF[1] = {{
* Return: Non-negative on success/Negative on failure
*
* Programmer: Quincey Koziol
- * koziol@hdfgroup.org
* May 18, 2010
*
*-------------------------------------------------------------------------
@@ -226,7 +225,6 @@ H5B2__cache_hdr_verify_chksum(const void *_image, size_t len, void H5_ATTR_UNUSE
* Failure: NULL
*
* Programmer: Quincey Koziol
- * koziol@ncsa.uiuc.edu
* Feb 1 2005
*
*-------------------------------------------------------------------------
@@ -255,7 +253,7 @@ H5B2__cache_hdr_deserialize(const void *_image, size_t H5_ATTR_UNUSED len, void
HGOTO_ERROR(H5E_BTREE, H5E_CANTALLOC, NULL, "allocation failed for B-tree header")
/* Magic number */
- if (HDmemcmp(image, H5B2_HDR_MAGIC, (size_t)H5_SIZEOF_MAGIC))
+ if (HDmemcmp(image, H5B2_HDR_MAGIC, (size_t)H5_SIZEOF_MAGIC) != 0)
HGOTO_ERROR(H5E_BTREE, H5E_BADVALUE, NULL, "wrong B-tree header signature")
image += H5_SIZEOF_MAGIC;
@@ -324,7 +322,6 @@ done:
* Return: Non-negative on success/Negative on failure
*
* Programmer: Quincey Koziol
- * koziol@hdfgroup.org
* May 20, 2010
*
*-------------------------------------------------------------------------
@@ -354,7 +351,6 @@ H5B2__cache_hdr_image_len(const void *_thing, size_t *image_len)
* Return: Non-negative on success/Negative on failure
*
* Programmer: Quincey Koziol
- * koziol@ncsa.uiuc.edu
* Feb 1 2005
*
*-------------------------------------------------------------------------
@@ -424,7 +420,6 @@ H5B2__cache_hdr_serialize(const H5F_t *f, void *_image, size_t H5_ATTR_UNUSED le
* Return: Non-negative on success/Negative on failure
*
* Programmer: Neil Fortner
- * nfortne2@hdfgroup.org
* Apr 24 2012
*
*-------------------------------------------------------------------------
@@ -515,7 +510,6 @@ done:
* Return: Non-negative on success/Negative on failure
*
* Programmer: Mike McGreevy
- * mcgreevy@hdfgroup.org
* June 18, 2008
*
*-------------------------------------------------------------------------
@@ -546,7 +540,6 @@ done:
* Return: Non-negative on success/Negative on failure
*
* Programmer: Quincey Koziol
- * koziol@hdfgroup.org
* May 18, 2010
*
*-------------------------------------------------------------------------
@@ -620,7 +613,6 @@ H5B2__cache_int_verify_chksum(const void *_image, size_t H5_ATTR_UNUSED len, voi
* Failure: NULL
*
* Programmer: Quincey Koziol
- * koziol@ncsa.uiuc.edu
* Feb 2 2005
*
*-------------------------------------------------------------------------
@@ -659,7 +651,7 @@ H5B2__cache_int_deserialize(const void *_image, size_t H5_ATTR_UNUSED len, void
internal->shadow_epoch = udata->hdr->shadow_epoch;
/* Magic number */
- if (HDmemcmp(image, H5B2_INT_MAGIC, (size_t)H5_SIZEOF_MAGIC))
+ if (HDmemcmp(image, H5B2_INT_MAGIC, (size_t)H5_SIZEOF_MAGIC) != 0)
HGOTO_ERROR(H5E_BTREE, H5E_BADVALUE, NULL, "wrong B-tree internal node signature")
image += H5_SIZEOF_MAGIC;
@@ -743,7 +735,6 @@ done:
* Return: Non-negative on success/Negative on failure
*
* Programmer: Quincey Koziol
- * koziol@hdfgroup.org
* May 20, 2010
*
*-------------------------------------------------------------------------
@@ -775,7 +766,6 @@ H5B2__cache_int_image_len(const void *_thing, size_t *image_len)
* Return: Non-negative on success/Negative on failure
*
* Programmer: Quincey Koziol
- * koziol@ncsa.uiuc.edu
* Feb 3 2005
*
*-------------------------------------------------------------------------
@@ -861,7 +851,6 @@ done:
* Return: Non-negative on success/Negative on failure
*
* Programmer: Neil Fortner
- * nfortne2@hdfgroup.org
* Apr 25 2012
*
*-------------------------------------------------------------------------
@@ -872,7 +861,7 @@ H5B2__cache_int_notify(H5AC_notify_action_t action, void *_thing)
H5B2_internal_t *internal = (H5B2_internal_t *)_thing;
herr_t ret_value = SUCCEED;
- FUNC_ENTER_NOAPI_NOINIT
+ FUNC_ENTER_STATIC
/*
* Check arguments.
@@ -939,7 +928,6 @@ done:
* Return: Non-negative on success/Negative on failure
*
* Programmer: Mike McGreevy
- * mcgreevy@hdfgroup.org
* June 18, 2008
*
*-------------------------------------------------------------------------
@@ -971,7 +959,6 @@ done:
* Return: Non-negative on success/Negative on failure
*
* Programmer: Quincey Koziol
- * koziol@hdfgroup.org
* May 18, 2010
*
*-------------------------------------------------------------------------
@@ -1044,7 +1031,6 @@ H5B2__cache_leaf_verify_chksum(const void *_image, size_t H5_ATTR_UNUSED len, vo
* Failure: NULL
*
* Programmer: Quincey Koziol
- * koziol@ncsa.uiuc.edu
* Feb 2 2005
*
*-------------------------------------------------------------------------
@@ -1081,7 +1067,7 @@ H5B2__cache_leaf_deserialize(const void *_image, size_t H5_ATTR_UNUSED len, void
leaf->shadow_epoch = udata->hdr->shadow_epoch;
/* Magic number */
- if (HDmemcmp(image, H5B2_LEAF_MAGIC, (size_t)H5_SIZEOF_MAGIC))
+ if (HDmemcmp(image, H5B2_LEAF_MAGIC, (size_t)H5_SIZEOF_MAGIC) != 0)
HGOTO_ERROR(H5E_BTREE, H5E_BADVALUE, NULL, "wrong B-tree leaf node signature")
image += H5_SIZEOF_MAGIC;
@@ -1142,7 +1128,6 @@ done:
* Return: Non-negative on success/Negative on failure
*
* Programmer: Quincey Koziol
- * koziol@hdfgroup.org
* May 20, 2010
*
*-------------------------------------------------------------------------
@@ -1173,7 +1158,6 @@ H5B2__cache_leaf_image_len(const void *_thing, size_t *image_len)
* Return: Non-negative on success/Negative on failure
*
* Programmer: Quincey Koziol
- * koziol@ncsa.uiuc.edu
* Feb 2 2005
*
*-------------------------------------------------------------------------
@@ -1246,7 +1230,6 @@ done:
* Return: Non-negative on success/Negative on failure
*
* Programmer: Neil Fortner
- * nfortne2@hdfgroup.org
* Apr 25 2012
*
*-------------------------------------------------------------------------
@@ -1257,7 +1240,7 @@ H5B2__cache_leaf_notify(H5AC_notify_action_t action, void *_thing)
H5B2_leaf_t *leaf = (H5B2_leaf_t *)_thing;
herr_t ret_value = SUCCEED;
- FUNC_ENTER_NOAPI_NOINIT
+ FUNC_ENTER_STATIC
/*
* Check arguments.
@@ -1324,7 +1307,6 @@ done:
* Return: Non-negative on success/Negative on failure
*
* Programmer: Mike McGreevy
- * mcgreevy@hdfgroup.org
* June 18, 2008
*
*-------------------------------------------------------------------------
diff --git a/src/H5B2dbg.c b/src/H5B2dbg.c
index 3832b9c..711b200 100644
--- a/src/H5B2dbg.c
+++ b/src/H5B2dbg.c
@@ -15,7 +15,7 @@
*
* Created: H5B2dbg.c
* Feb 2 2005
- * Quincey Koziol <koziol@ncsa.uiuc.edu>
+ * Quincey Koziol
*
* Purpose: Dump debugging information about a v2 B-tree.
*
@@ -72,7 +72,6 @@
* Return: Non-negative on success/Negative on failure
*
* Programmer: Quincey Koziol
- * koziol@ncsa.uiuc.edu
* Feb 2 2005
*
*-------------------------------------------------------------------------
@@ -120,10 +119,12 @@ H5B2__hdr_debug(H5F_t *f, haddr_t addr, FILE *stream, int indent, int fwidth,
HDfprintf(stream, "%*s%-*s %s\n", indent, "", fwidth,
"Dirty flag:", hdr->cache_info.is_dirty ? "True" : "False");
HDfprintf(stream, "%*s%-*s %u\n", indent, "", fwidth, "Depth:", hdr->depth);
- HDfprintf(stream, "%*s%-*s %Hu\n", indent, "", fwidth, "Number of records in tree:", hdr->root.all_nrec);
+ HDfprintf(stream, "%*s%-*s %" PRIuHSIZE "\n", indent, "", fwidth,
+ "Number of records in tree:", hdr->root.all_nrec);
HDfprintf(stream, "%*s%-*s %u\n", indent, "", fwidth,
"Number of records in root node:", hdr->root.node_nrec);
- HDfprintf(stream, "%*s%-*s %a\n", indent, "", fwidth, "Address of root node:", hdr->root.addr);
+ HDfprintf(stream, "%*s%-*s %" PRIuHADDR "\n", indent, "", fwidth,
+ "Address of root node:", hdr->root.addr);
HDfprintf(stream, "%*s%-*s %u\n", indent, "", fwidth, "Split percent:", hdr->split_percent);
HDfprintf(stream, "%*s%-*s %u\n", indent, "", fwidth, "Merge percent:", hdr->merge_percent);
@@ -150,7 +151,6 @@ done:
* Return: Non-negative on success/Negative on failure
*
* Programmer: Quincey Koziol
- * koziol@ncsa.uiuc.edu
* Feb 4 2005
*
*-------------------------------------------------------------------------
@@ -217,8 +217,8 @@ H5B2__int_debug(H5F_t *f, haddr_t addr, FILE *stream, int indent, int fwidth, co
for (u = 0; u < internal->nrec; u++) {
/* Print node pointer */
HDsnprintf(temp_str, sizeof(temp_str), "Node pointer #%u: (all/node/addr)", u);
- HDfprintf(stream, "%*s%-*s (%Hu/%u/%a)\n", indent + 3, "", MAX(0, fwidth - 3), temp_str,
- internal->node_ptrs[u].all_nrec, internal->node_ptrs[u].node_nrec,
+ HDfprintf(stream, "%*s%-*s (%" PRIuHSIZE "/%u/%" PRIuHADDR ")\n", indent + 3, "", MAX(0, fwidth - 3),
+ temp_str, internal->node_ptrs[u].all_nrec, internal->node_ptrs[u].node_nrec,
internal->node_ptrs[u].addr);
/* Print record */
@@ -231,8 +231,9 @@ H5B2__int_debug(H5F_t *f, haddr_t addr, FILE *stream, int indent, int fwidth, co
/* Print final node pointer */
HDsnprintf(temp_str, sizeof(temp_str), "Node pointer #%u: (all/node/addr)", u);
- HDfprintf(stream, "%*s%-*s (%Hu/%u/%a)\n", indent + 3, "", MAX(0, fwidth - 3), temp_str,
- internal->node_ptrs[u].all_nrec, internal->node_ptrs[u].node_nrec, internal->node_ptrs[u].addr);
+ HDfprintf(stream, "%*s%-*s (%" PRIuHSIZE "/%u/%" PRIuHADDR ")\n", indent + 3, "", MAX(0, fwidth - 3),
+ temp_str, internal->node_ptrs[u].all_nrec, internal->node_ptrs[u].node_nrec,
+ internal->node_ptrs[u].addr);
done:
if (hdr && H5B2__hdr_unprotect(hdr, H5AC__NO_FLAGS_SET) < 0)
@@ -251,7 +252,6 @@ done:
* Return: Non-negative on success/Negative on failure
*
* Programmer: Quincey Koziol
- * koziol@ncsa.uiuc.edu
* Feb 7 2005
*
*-------------------------------------------------------------------------
diff --git a/src/H5B2hdr.c b/src/H5B2hdr.c
index e956fb5..bdde5ba 100644
--- a/src/H5B2hdr.c
+++ b/src/H5B2hdr.c
@@ -564,7 +564,6 @@ done:
* Return: Non-negative on success/Negative on failure
*
* Programmer: Quincey Koziol
- * koziol@hdfgroup.org
* Dec 18 2015
*
*-------------------------------------------------------------------------
@@ -596,7 +595,6 @@ done:
* Return: Non-negative on success/Negative on failure
*
* Programmer: Quincey Koziol
- * koziol@ncsa.uiuc.edu
* Feb 2 2005
*
*-------------------------------------------------------------------------
@@ -674,7 +672,6 @@ done:
* Return: Non-negative on success/Negative on failure
*
* Programmer: Quincey Koziol
- * koziol@hdfgroup.org
* Oct 15 2009
*
*-------------------------------------------------------------------------
diff --git a/src/H5B2int.c b/src/H5B2int.c
index 745fd2a..610da6c 100644
--- a/src/H5B2int.c
+++ b/src/H5B2int.c
@@ -15,7 +15,7 @@
*
* Created: H5B2int.c
* Feb 27 2006
- * Quincey Koziol <koziol@ncsa.uiuc.edu>
+ * Quincey Koziol
*
* Purpose: Internal routines for managing v2 B-trees.
*
@@ -87,7 +87,6 @@ H5FL_SEQ_EXTERN(H5B2_node_info_t);
* record to locate is greater than all records to search).
*
* Programmer: Quincey Koziol
- * koziol@ncsa.uiuc.edu
* Feb 3 2005
*
*-------------------------------------------------------------------------
@@ -130,7 +129,6 @@ done:
* Failure: Negative
*
* Programmer: Quincey Koziol
- * koziol@hdfgroup.org
* Aug 28 2006
*
*-------------------------------------------------------------------------
@@ -140,15 +138,15 @@ H5B2__split1(H5B2_hdr_t *hdr, uint16_t depth, H5B2_node_ptr_t *curr_node_ptr,
unsigned *parent_cache_info_flags_ptr, H5B2_internal_t *internal, unsigned *internal_flags_ptr,
unsigned idx)
{
- const H5AC_class_t *child_class; /* Pointer to child node's class info */
- haddr_t left_addr, right_addr; /* Addresses of left & right child nodes */
- void * left_child = NULL, *right_child = NULL; /* Pointers to child nodes */
- uint16_t * left_nrec, *right_nrec; /* Pointers to child # of records */
- uint8_t * left_native, *right_native; /* Pointers to childs' native records */
- H5B2_node_ptr_t * left_node_ptrs = NULL,
- *right_node_ptrs = NULL; /* Pointers to childs' node pointer info */
- uint16_t mid_record; /* Index of "middle" record in current node */
- uint16_t old_node_nrec; /* Number of records in internal node split */
+ const H5AC_class_t *child_class; /* Pointer to child node's class info */
+ haddr_t left_addr = HADDR_UNDEF, right_addr = HADDR_UNDEF; /* Addresses of left & right child nodes */
+ void * left_child = NULL, *right_child = NULL; /* Pointers to child nodes */
+ uint16_t *left_nrec, *right_nrec; /* Pointers to child # of records */
+ uint8_t * left_native, *right_native; /* Pointers to childs' native records */
+ H5B2_node_ptr_t *left_node_ptrs = NULL,
+ *right_node_ptrs = NULL; /* Pointers to childs' node pointer info */
+ uint16_t mid_record; /* Index of "middle" record in current node */
+ uint16_t old_node_nrec; /* Number of records in internal node split */
unsigned left_child_flags = H5AC__NO_FLAGS_SET,
right_child_flags = H5AC__NO_FLAGS_SET; /* Flags for unprotecting child nodes */
herr_t ret_value = SUCCEED; /* Return value */
@@ -336,7 +334,6 @@ done:
* Failure: Negative
*
* Programmer: Quincey Koziol
- * koziol@ncsa.uiuc.edu
* Feb 3 2005
*
*-------------------------------------------------------------------------
@@ -419,7 +416,6 @@ done:
* Failure: Negative
*
* Programmer: Quincey Koziol
- * koziol@ncsa.uiuc.edu
* Feb 9 2005
*
*-------------------------------------------------------------------------
@@ -427,13 +423,13 @@ done:
herr_t
H5B2__redistribute2(H5B2_hdr_t *hdr, uint16_t depth, H5B2_internal_t *internal, unsigned idx)
{
- const H5AC_class_t *child_class; /* Pointer to child node's class info */
- haddr_t left_addr, right_addr; /* Addresses of left & right child nodes */
- void * left_child = NULL, *right_child = NULL; /* Pointers to child nodes */
- uint16_t * left_nrec, *right_nrec; /* Pointers to child # of records */
- uint8_t * left_native, *right_native; /* Pointers to childs' native records */
- H5B2_node_ptr_t * left_node_ptrs = NULL,
- *right_node_ptrs = NULL; /* Pointers to childs' node pointer info */
+ const H5AC_class_t *child_class; /* Pointer to child node's class info */
+ haddr_t left_addr = HADDR_UNDEF, right_addr = HADDR_UNDEF; /* Addresses of left & right child nodes */
+ void * left_child = NULL, *right_child = NULL; /* Pointers to child nodes */
+ uint16_t *left_nrec, *right_nrec; /* Pointers to child # of records */
+ uint8_t * left_native, *right_native; /* Pointers to childs' native records */
+ H5B2_node_ptr_t *left_node_ptrs = NULL,
+ *right_node_ptrs = NULL; /* Pointers to childs' node pointer info */
hssize_t left_moved_nrec = 0, right_moved_nrec = 0; /* Number of records moved, for internal redistrib */
unsigned left_child_flags = H5AC__NO_FLAGS_SET,
right_child_flags = H5AC__NO_FLAGS_SET; /* Flags for unprotecting child nodes */
@@ -691,7 +687,6 @@ done:
* Failure: Negative
*
* Programmer: Quincey Koziol
- * koziol@ncsa.uiuc.edu
* Feb 9 2005
*
*-------------------------------------------------------------------------
@@ -701,20 +696,20 @@ H5B2__redistribute3(H5B2_hdr_t *hdr, uint16_t depth, H5B2_internal_t *internal,
unsigned idx)
{
H5B2_node_ptr_t *left_node_ptrs = NULL,
- *right_node_ptrs = NULL; /* Pointers to childs' node pointer info */
- H5B2_node_ptr_t * middle_node_ptrs = NULL; /* Pointers to childs' node pointer info */
- const H5AC_class_t *child_class; /* Pointer to child node's class info */
- haddr_t left_addr, right_addr; /* Addresses of left & right child nodes */
- haddr_t middle_addr; /* Address of middle child node */
- void * left_child = NULL, *right_child = NULL; /* Pointers to child nodes */
- void * middle_child = NULL; /* Pointers to middle child node */
- uint16_t * left_nrec, *right_nrec; /* Pointers to child # of records */
- uint16_t * middle_nrec; /* Pointers to middle child # of records */
- uint8_t * left_native, *right_native; /* Pointers to childs' native records */
- uint8_t * middle_native; /* Pointers to middle child's native records */
- hssize_t left_moved_nrec = 0, right_moved_nrec = 0; /* Number of records moved, for internal split */
- hssize_t middle_moved_nrec = 0; /* Number of records moved, for internal split */
- unsigned left_child_flags = H5AC__NO_FLAGS_SET,
+ *right_node_ptrs = NULL; /* Pointers to childs' node pointer info */
+ H5B2_node_ptr_t * middle_node_ptrs = NULL; /* Pointers to childs' node pointer info */
+ const H5AC_class_t *child_class; /* Pointer to child node's class info */
+ haddr_t left_addr = HADDR_UNDEF, right_addr = HADDR_UNDEF; /* Addresses of left & right child nodes */
+ haddr_t middle_addr = HADDR_UNDEF; /* Address of middle child node */
+ void * left_child = NULL, *right_child = NULL; /* Pointers to child nodes */
+ void * middle_child = NULL; /* Pointers to middle child node */
+ uint16_t *left_nrec, *right_nrec; /* Pointers to child # of records */
+ uint16_t *middle_nrec; /* Pointers to middle child # of records */
+ uint8_t * left_native, *right_native; /* Pointers to childs' native records */
+ uint8_t * middle_native; /* Pointers to middle child's native records */
+ hssize_t left_moved_nrec = 0, right_moved_nrec = 0; /* Number of records moved, for internal split */
+ hssize_t middle_moved_nrec = 0; /* Number of records moved, for internal split */
+ unsigned left_child_flags = H5AC__NO_FLAGS_SET,
right_child_flags = H5AC__NO_FLAGS_SET; /* Flags for unprotecting child nodes */
unsigned middle_child_flags = H5AC__NO_FLAGS_SET; /* Flags for unprotecting child nodes */
herr_t ret_value = SUCCEED; /* Return value */
@@ -1118,7 +1113,6 @@ done:
* Failure: Negative
*
* Programmer: Quincey Koziol
- * koziol@ncsa.uiuc.edu
* Mar 4 2005
*
*-------------------------------------------------------------------------
@@ -1128,16 +1122,16 @@ H5B2__merge2(H5B2_hdr_t *hdr, uint16_t depth, H5B2_node_ptr_t *curr_node_ptr,
unsigned *parent_cache_info_flags_ptr, H5B2_internal_t *internal, unsigned *internal_flags_ptr,
unsigned idx)
{
- const H5AC_class_t *child_class; /* Pointer to child node's class info */
- haddr_t left_addr, right_addr; /* Addresses of left & right child nodes */
- void * left_child = NULL, *right_child = NULL; /* Pointers to left & right child nodes */
- uint16_t * left_nrec, *right_nrec; /* Pointers to left & right child # of records */
- uint8_t * left_native, *right_native; /* Pointers to left & right children's native records */
- H5B2_node_ptr_t * left_node_ptrs = NULL,
- *right_node_ptrs = NULL; /* Pointers to childs' node pointer info */
- unsigned left_child_flags = H5AC__NO_FLAGS_SET,
- right_child_flags = H5AC__NO_FLAGS_SET; /* Flags for unprotecting child nodes */
- herr_t ret_value = SUCCEED; /* Return value */
+ const H5AC_class_t *child_class; /* Pointer to child node's class info */
+ haddr_t left_addr = HADDR_UNDEF, right_addr = HADDR_UNDEF; /* Addresses of left & right child nodes */
+ void * left_child = NULL, *right_child = NULL; /* Pointers to left & right child nodes */
+ uint16_t *left_nrec, *right_nrec; /* Pointers to left & right child # of records */
+ uint8_t * left_native, *right_native; /* Pointers to left & right children's native records */
+ H5B2_node_ptr_t *left_node_ptrs = NULL,
+ *right_node_ptrs = NULL; /* Pointers to childs' node pointer info */
+ unsigned left_child_flags = H5AC__NO_FLAGS_SET,
+ right_child_flags = H5AC__NO_FLAGS_SET; /* Flags for unprotecting child nodes */
+ herr_t ret_value = SUCCEED; /* Return value */
FUNC_ENTER_PACKAGE
@@ -1294,7 +1288,6 @@ done:
* Failure: Negative
*
* Programmer: Quincey Koziol
- * koziol@ncsa.uiuc.edu
* Mar 4 2005
*
*-------------------------------------------------------------------------
@@ -1304,19 +1297,19 @@ H5B2__merge3(H5B2_hdr_t *hdr, uint16_t depth, H5B2_node_ptr_t *curr_node_ptr,
unsigned *parent_cache_info_flags_ptr, H5B2_internal_t *internal, unsigned *internal_flags_ptr,
unsigned idx)
{
- const H5AC_class_t *child_class; /* Pointer to child node's class info */
- haddr_t left_addr, right_addr; /* Addresses of left & right child nodes */
- haddr_t middle_addr; /* Address of middle child node */
- void * left_child = NULL, *right_child = NULL; /* Pointers to left & right child nodes */
- void * middle_child = NULL; /* Pointer to middle child node */
- uint16_t * left_nrec, *right_nrec; /* Pointers to left & right child # of records */
- uint16_t * middle_nrec; /* Pointer to middle child # of records */
- uint8_t * left_native, *right_native; /* Pointers to left & right children's native records */
- uint8_t * middle_native; /* Pointer to middle child's native records */
- H5B2_node_ptr_t * left_node_ptrs = NULL,
- *right_node_ptrs = NULL; /* Pointers to childs' node pointer info */
- H5B2_node_ptr_t *middle_node_ptrs = NULL; /* Pointer to child's node pointer info */
- hsize_t middle_moved_nrec; /* Number of records moved, for internal split */
+ const H5AC_class_t *child_class; /* Pointer to child node's class info */
+ haddr_t left_addr = HADDR_UNDEF, right_addr = HADDR_UNDEF; /* Addresses of left & right child nodes */
+ haddr_t middle_addr = HADDR_UNDEF; /* Address of middle child node */
+ void * left_child = NULL, *right_child = NULL; /* Pointers to left & right child nodes */
+ void * middle_child = NULL; /* Pointer to middle child node */
+ uint16_t *left_nrec, *right_nrec; /* Pointers to left & right child # of records */
+ uint16_t *middle_nrec; /* Pointer to middle child # of records */
+ uint8_t * left_native, *right_native; /* Pointers to left & right children's native records */
+ uint8_t * middle_native; /* Pointer to middle child's native records */
+ H5B2_node_ptr_t *left_node_ptrs = NULL,
+ *right_node_ptrs = NULL; /* Pointers to childs' node pointer info */
+ H5B2_node_ptr_t *middle_node_ptrs = NULL; /* Pointer to child's node pointer info */
+ hsize_t middle_moved_nrec; /* Number of records moved, for internal split */
unsigned left_child_flags = H5AC__NO_FLAGS_SET,
right_child_flags = H5AC__NO_FLAGS_SET; /* Flags for unprotecting child nodes */
unsigned middle_child_flags = H5AC__NO_FLAGS_SET; /* Flags for unprotecting child nodes */
@@ -1561,7 +1554,6 @@ done:
* Return: Non-negative on success/Negative on failure
*
* Programmer: Quincey Koziol
- * koziol@hdfgroup.org
* Dec 23 2015
*
*-------------------------------------------------------------------------
@@ -1620,7 +1612,6 @@ done:
* Return: Value from callback, non-negative on success, negative on error
*
* Programmer: Quincey Koziol
- * koziol@ncsa.uiuc.edu
* Feb 11 2005
*
*-------------------------------------------------------------------------
@@ -1743,7 +1734,6 @@ done:
* Return: Value from callback, non-negative on success, negative on error
*
* Programmer: Quincey Koziol
- * koziol@ncsa.uiuc.edu
* Mar 9 2005
*
*-------------------------------------------------------------------------
@@ -1915,7 +1905,6 @@ done:
* Return: SUCCEED/FAIL
*
* Programmer: Quincey Koziol
- * koziol@lbl.gov
* Dec 1 2016
*
*-------------------------------------------------------------------------
@@ -1944,7 +1933,7 @@ H5B2__update_flush_depend(H5B2_hdr_t *hdr, unsigned depth, const H5B2_node_ptr_t
/* If the node is in the cache, check for retargeting its parent */
if (node_status & H5AC_ES__IN_CACHE) {
- void ** parent_ptr; /* Pointer to child node's parent */
+ void ** parent_ptr = NULL; /* Pointer to child node's parent */
hbool_t update_deps = FALSE; /* Whether to update flush dependencies */
/* Get child node pointer */
@@ -2016,7 +2005,6 @@ done:
* Return: SUCCEED/FAIL
*
* Programmer: Quincey Koziol
- * koziol@lbl.gov
* Dec 1 2016
*
*-------------------------------------------------------------------------
diff --git a/src/H5B2internal.c b/src/H5B2internal.c
index 9491c55..c00f555 100644
--- a/src/H5B2internal.c
+++ b/src/H5B2internal.c
@@ -15,7 +15,7 @@
*
* Created: H5B2internal.c
* Dec 01 2016
- * Quincey Koziol <koziol@lbl.gov>
+ * Quincey Koziol
*
* Purpose: Routines for managing v2 B-tree internal ndoes.
*
@@ -77,7 +77,6 @@ H5FL_DEFINE(H5B2_internal_t);
* Return: Non-negative on success/Negative on failure
*
* Programmer: Quincey Koziol
- * koziol@ncsa.uiuc.edu
* Feb 3 2005
*
*-------------------------------------------------------------------------
@@ -177,7 +176,6 @@ done:
* Return: Pointer to internal node on success/NULL on failure
*
* Programmer: Quincey Koziol
- * koziol@hdfgroup.org
* Aug 25 2006
*
*-------------------------------------------------------------------------
@@ -276,7 +274,6 @@ done:
* Return: Non-negative on success, negative on failure.
*
* Programmer: Quincey Koziol
- * koziol@ncsa.uiuc.edu
* Mar 9 2005
*
*-------------------------------------------------------------------------
@@ -353,7 +350,6 @@ done:
* Return: Non-negative on success/Negative on failure
*
* Programmer: Quincey Koziol
- * koziol@ncsa.uiuc.edu
* Mar 2 2005
*
*-------------------------------------------------------------------------
@@ -523,7 +519,6 @@ done:
* Return: Non-negative on success/Negative on failure
*
* Programmer: Quincey Koziol
- * koziol@hdfgroup.org
* Dec 24 2015
*
*-------------------------------------------------------------------------
@@ -801,7 +796,6 @@ done:
* Return: Non-negative on success/Negative on failure
*
* Programmer: Quincey Koziol
- * koziol@ncsa.uiuc.edu
* Mar 3 2005
*
*-------------------------------------------------------------------------
@@ -1046,7 +1040,6 @@ done:
* Return: Non-negative on success/Negative on failure
*
* Programmer: Quincey Koziol
- * koziol@hdfgroup.org
* Nov 14 2006
*
*-------------------------------------------------------------------------
@@ -1341,7 +1334,6 @@ done:
* Return: Non-negative on success/Negative on failure
*
* Programmer: Quincey Koziol
- * koziol@ncsa.uiuc.edu
* Feb 2 2005
*
*-------------------------------------------------------------------------
@@ -1392,7 +1384,6 @@ done:
* Return: Non-negative on success, negative on failure
*
* Programmer: Quincey Koziol
- * koziol@ncsa.uiuc.edu
* Feb 19 2005
*
*-------------------------------------------------------------------------
@@ -1433,7 +1424,6 @@ H5B2__assert_internal(hsize_t parent_all_nrec, const H5B2_hdr_t H5_ATTR_NDEBUG_U
* Return: Non-negative on success, negative on failure
*
* Programmer: Quincey Koziol
- * koziol@ncsa.uiuc.edu
* Feb 19 2005
*
*-------------------------------------------------------------------------
diff --git a/src/H5B2leaf.c b/src/H5B2leaf.c
index f60259b..20ace84 100644
--- a/src/H5B2leaf.c
+++ b/src/H5B2leaf.c
@@ -15,7 +15,7 @@
*
* Created: H5B2leaf.c
* Dec 01 2016
- * Quincey Koziol <koziol@lbl.gov>
+ * Quincey Koziol
*
* Purpose: Routines for managing v2 B-tree leaf ndoes.
*
@@ -78,7 +78,6 @@ H5FL_DEFINE(H5B2_leaf_t);
* Return: Non-negative on success/Negative on failure
*
* Programmer: Quincey Koziol
- * koziol@ncsa.uiuc.edu
* Feb 2 2005
*
*-------------------------------------------------------------------------
@@ -166,7 +165,6 @@ done:
* Return: Pointer to leaf node on success/NULL on failure
*
* Programmer: Quincey Koziol
- * koziol@hdfgroup.org
* May 5 2010
*
*-------------------------------------------------------------------------
@@ -260,7 +258,6 @@ done:
* Return: Non-negative on success, negative on failure.
*
* Programmer: Quincey Koziol
- * koziol@ncsa.uiuc.edu
* Mar 9 2005
*
*-------------------------------------------------------------------------
@@ -332,7 +329,6 @@ done:
* Return: Non-negative on success/Negative on failure
*
* Programmer: Quincey Koziol
- * koziol@ncsa.uiuc.edu
* Mar 3 2005
*
*-------------------------------------------------------------------------
@@ -447,7 +443,6 @@ done:
* Return: Non-negative on success/Negative on failure
*
* Programmer: Quincey Koziol
- * koziol@hdfgroup.org
* Dec 23 2015
*
*-------------------------------------------------------------------------
@@ -604,7 +599,6 @@ done:
* Failure: Negative
*
* Programmer: Quincey Koziol
- * koziol@ncsa.uiuc.edu
* Mar 4 2005
*
*-------------------------------------------------------------------------
@@ -613,11 +607,11 @@ herr_t
H5B2__swap_leaf(H5B2_hdr_t *hdr, uint16_t depth, H5B2_internal_t *internal, unsigned *internal_flags_ptr,
unsigned idx, void *swap_loc)
{
- const H5AC_class_t *child_class; /* Pointer to child node's class info */
- haddr_t child_addr; /* Address of child node */
- void * child = NULL; /* Pointer to child node */
- uint8_t * child_native; /* Pointer to child's native records */
- herr_t ret_value = SUCCEED; /* Return value */
+ const H5AC_class_t *child_class; /* Pointer to child node's class info */
+ haddr_t child_addr = HADDR_UNDEF; /* Address of child node */
+ void * child = NULL; /* Pointer to child node */
+ uint8_t * child_native; /* Pointer to child's native records */
+ herr_t ret_value = SUCCEED; /* Return value */
FUNC_ENTER_PACKAGE
@@ -762,7 +756,6 @@ done:
* Return: Non-negative on success/Negative on failure
*
* Programmer: Quincey Koziol
- * koziol@ncsa.uiuc.edu
* Mar 3 2005
*
*-------------------------------------------------------------------------
@@ -871,7 +864,6 @@ done:
* Return: Non-negative on success/Negative on failure
*
* Programmer: Quincey Koziol
- * koziol@hdfgroup.org
* Nov 14 2006
*
*-------------------------------------------------------------------------
@@ -972,7 +964,6 @@ done:
* Return: Non-negative on success/Negative on failure
*
* Programmer: Quincey Koziol
- * koziol@ncsa.uiuc.edu
* Feb 2 2005
*
*-------------------------------------------------------------------------
@@ -1017,7 +1008,6 @@ done:
* Return: Non-negative on success, negative on failure
*
* Programmer: Quincey Koziol
- * koziol@ncsa.uiuc.edu
* Feb 19 2005
*
*-------------------------------------------------------------------------
@@ -1039,7 +1029,6 @@ H5B2__assert_leaf(const H5B2_hdr_t H5_ATTR_NDEBUG_UNUSED *hdr, const H5B2_leaf_t
* Return: Non-negative on success, negative on failure
*
* Programmer: Quincey Koziol
- * koziol@ncsa.uiuc.edu
* Feb 19 2005
*
*-------------------------------------------------------------------------
diff --git a/src/H5B2stat.c b/src/H5B2stat.c
index 936e356..4735276 100644
--- a/src/H5B2stat.c
+++ b/src/H5B2stat.c
@@ -11,7 +11,7 @@
* help@hdfgroup.org. *
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
-/* Programmer: Quincey Koziol <koziol@hdfgroup.org>
+/* Programmer: Quincey Koziol
* Monday, March 6, 2006
*
* Purpose: v2 B-tree metadata statistics functions.
diff --git a/src/H5B2test.c b/src/H5B2test.c
index ca347ee..2b84332 100644
--- a/src/H5B2test.c
+++ b/src/H5B2test.c
@@ -11,7 +11,7 @@
* help@hdfgroup.org. *
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
-/* Programmer: Quincey Koziol <koziol@ncsa.uiuc.edu>
+/* Programmer: Quincey Koziol
* Thursday, February 3, 2005
*
* Purpose: v2 B-tree testing functions.
@@ -305,7 +305,7 @@ H5B2__test_debug(FILE *stream, int indent, int fwidth, const void *record, const
HDassert(record);
- HDfprintf(stream, "%*s%-*s %Hu\n", indent, "", fwidth, "Record:", *(const hsize_t *)record);
+ HDfprintf(stream, "%*s%-*s %" PRIuHSIZE "\n", indent, "", fwidth, "Record:", *(const hsize_t *)record);
FUNC_LEAVE_NOAPI(SUCCEED)
} /* H5B2__test_debug() */
@@ -435,7 +435,7 @@ H5B2__test2_debug(FILE *stream, int indent, int fwidth, const void *record, cons
HDassert(record);
- HDfprintf(stream, "%*s%-*s (%Hu, %Hu)\n", indent, "", fwidth,
+ HDfprintf(stream, "%*s%-*s (%" PRIuHSIZE ", %" PRIuHSIZE ")\n", indent, "", fwidth,
"Record:", ((const H5B2_test_rec_t *)record)->key, ((const H5B2_test_rec_t *)record)->val);
FUNC_LEAVE_NOAPI(SUCCEED)
diff --git a/src/H5Bcache.c b/src/H5Bcache.c
index f839673..9af146e 100644
--- a/src/H5Bcache.c
+++ b/src/H5Bcache.c
@@ -15,7 +15,7 @@
*
* Created: H5Bcache.c
* Oct 31 2005
- * Quincey Koziol <koziol@ncsa.uiuc.edu>
+ * Quincey Koziol
*
* Purpose: Implement B-tree metadata cache methods.
*
@@ -90,7 +90,6 @@ const H5AC_class_t H5AC_BT[1] = {{
* Return: Non-negative on success/Negative on failure
*
* Programmer: Quincey Koziol
- * koziol@hdfgroup.org
* May 18, 2010
*
*-------------------------------------------------------------------------
@@ -126,7 +125,6 @@ H5B__cache_get_initial_load_size(void *_udata, size_t *image_len)
* Failure: NULL
*
* Programmer: Quincey Koziol
- * koziol@hdfgroup.org
* Mar 24, 2008
*
*-------------------------------------------------------------------------
@@ -169,7 +167,7 @@ H5B__cache_deserialize(const void *_image, size_t H5_ATTR_UNUSED len, void *_uda
HGOTO_ERROR(H5E_BTREE, H5E_CANTALLOC, NULL, "can't allocate buffer for child addresses")
/* magic number */
- if (HDmemcmp(image, H5B_MAGIC, (size_t)H5_SIZEOF_MAGIC))
+ if (HDmemcmp(image, H5B_MAGIC, (size_t)H5_SIZEOF_MAGIC) != 0)
HGOTO_ERROR(H5E_BTREE, H5E_BADVALUE, NULL, "wrong B-tree signature")
image += H5_SIZEOF_MAGIC;
@@ -231,7 +229,6 @@ done:
* Return: Non-negative on success/Negative on failure
*
* Programmer: Quincey Koziol
- * koziol@hdfgroup.org
* May 20, 2010
*
*-------------------------------------------------------------------------
@@ -266,7 +263,6 @@ H5B__cache_image_len(const void *_thing, size_t *image_len)
* Return: Non-negative on success/Negative on failure
*
* Programmer: Quincey Koziol
- * koziol@hdfgroup.org
* Mar 24, 2008
*
*-------------------------------------------------------------------------
@@ -350,7 +346,6 @@ done:
* Return: Non-negative on success/Negative on failure
*
* Programmer: Quincey Koziol
- * koziol@hdfgroup.org
* Mar 26, 2008
*
*-------------------------------------------------------------------------
diff --git a/src/H5Bdbg.c b/src/H5Bdbg.c
index f8a86b7..23d0a8f 100644
--- a/src/H5Bdbg.c
+++ b/src/H5Bdbg.c
@@ -95,13 +95,13 @@ H5B_debug(H5F_t *f, haddr_t addr, FILE *stream, int indent, int fwidth, const H5
((shared->type->id) == H5B_SNODE_ID
? "H5B_SNODE_ID"
: ((shared->type->id) == H5B_CHUNK_ID ? "H5B_CHUNK_ID" : "Unknown!")));
- HDfprintf(stream, "%*s%-*s %Zu\n", indent, "", fwidth, "Size of node:", shared->sizeof_rnode);
- HDfprintf(stream, "%*s%-*s %Zu\n", indent, "", fwidth, "Size of raw (disk) key:", shared->sizeof_rkey);
+ HDfprintf(stream, "%*s%-*s %zu\n", indent, "", fwidth, "Size of node:", shared->sizeof_rnode);
+ HDfprintf(stream, "%*s%-*s %zu\n", indent, "", fwidth, "Size of raw (disk) key:", shared->sizeof_rkey);
HDfprintf(stream, "%*s%-*s %s\n", indent, "", fwidth,
"Dirty flag:", bt->cache_info.is_dirty ? "True" : "False");
HDfprintf(stream, "%*s%-*s %u\n", indent, "", fwidth, "Level:", bt->level);
- HDfprintf(stream, "%*s%-*s %a\n", indent, "", fwidth, "Address of left sibling:", bt->left);
- HDfprintf(stream, "%*s%-*s %a\n", indent, "", fwidth, "Address of right sibling:", bt->right);
+ HDfprintf(stream, "%*s%-*s %" PRIuHADDR "\n", indent, "", fwidth, "Address of left sibling:", bt->left);
+ HDfprintf(stream, "%*s%-*s %" PRIuHADDR "\n", indent, "", fwidth, "Address of right sibling:", bt->right);
HDfprintf(stream, "%*s%-*s %u (%u)\n", indent, "", fwidth, "Number of children (max):", bt->nchildren,
shared->two_k);
@@ -110,7 +110,8 @@ H5B_debug(H5F_t *f, haddr_t addr, FILE *stream, int indent, int fwidth, const H5
*/
for (u = 0; u < bt->nchildren; u++) {
HDfprintf(stream, "%*sChild %d...\n", indent, "", u);
- HDfprintf(stream, "%*s%-*s %a\n", indent + 3, "", MAX(0, fwidth - 3), "Address:", bt->child[u]);
+ HDfprintf(stream, "%*s%-*s %" PRIuHADDR "\n", indent + 3, "", MAX(0, fwidth - 3),
+ "Address:", bt->child[u]);
/* If there is a key debugging routine, use it to display the left & right keys */
if (type->debug_key) {
diff --git a/src/H5C.c b/src/H5C.c
index 222b836..958f334 100644
--- a/src/H5C.c
+++ b/src/H5C.c
@@ -19,13 +19,7 @@
*
* Purpose: Functions in this file implement a generic cache for
* things which exist on disk, and which may be
- * unambiguously referenced by their disk addresses.
- *
- * The code in this module was initially written in
- * support of a complete re-write of the metadata cache
- * in H5AC.c However, other uses for the cache code
- * suggested themselves, and thus this file was created
- * in an attempt to support re-use.
+ * unambiguously referenced by their disk addresses.
*
* For a detailed overview of the cache, please see the
* header comment for H5C_t in H5Cpkg.h.
@@ -494,13 +488,13 @@ done:
*
* Purpose: Print results of a automatic cache resize.
*
- * This function should only be used where HDprintf() behaves
- * well -- i.e. not on Windows.
+ * This function should only be used where HDprintf() behaves
+ * well -- i.e. not on Windows.
*
* Return: void
*
* Programmer: John Mainzer
- * 10/27/04
+ * 10/27/04
*
*-------------------------------------------------------------------------
*/
@@ -531,19 +525,18 @@ H5C_def_auto_resize_rpt_fcn(H5C_t *cache_ptr,
HDfprintf(stdout, "%sAuto cache resize -- hit rate (%lf) out of bounds low (%6.5lf).\n",
cache_ptr->prefix, hit_rate, (cache_ptr->resize_ctl).lower_hr_threshold);
- HDfprintf(stdout, "%s cache size increased from (%Zu/%Zu) to (%Zu/%Zu).\n",
- cache_ptr->prefix, old_max_cache_size, old_min_clean_size, new_max_cache_size,
- new_min_clean_size);
+ HDfprintf(stdout, "%scache size increased from (%zu/%zu) to (%zu/%zu).\n", cache_ptr->prefix,
+ old_max_cache_size, old_min_clean_size, new_max_cache_size, new_min_clean_size);
break;
case flash_increase:
HDassert(old_max_cache_size < new_max_cache_size);
- HDfprintf(stdout, "%sflash cache resize(%d) -- size threshold = %Zu.\n", cache_ptr->prefix,
+ HDfprintf(stdout, "%sflash cache resize(%d) -- size threshold = %zu.\n", cache_ptr->prefix,
(int)((cache_ptr->resize_ctl).flash_incr_mode),
cache_ptr->flash_size_increase_threshold);
- HDfprintf(stdout, "%s cache size increased from (%Zu/%Zu) to (%Zu/%Zu).\n", cache_ptr->prefix,
+ HDfprintf(stdout, "%s cache size increased from (%zu/%zu) to (%zu/%zu).\n", cache_ptr->prefix,
old_max_cache_size, old_min_clean_size, new_max_cache_size, new_min_clean_size);
break;
@@ -584,21 +577,20 @@ H5C_def_auto_resize_rpt_fcn(H5C_t *cache_ptr,
cache_ptr->prefix, hit_rate);
}
- HDfprintf(stdout, "%s cache size decreased from (%Zu/%Zu) to (%Zu/%Zu).\n",
- cache_ptr->prefix, old_max_cache_size, old_min_clean_size, new_max_cache_size,
- new_min_clean_size);
+ HDfprintf(stdout, "%s cache size decreased from (%zu/%zu) to (%zu/%zu).\n", cache_ptr->prefix,
+ old_max_cache_size, old_min_clean_size, new_max_cache_size, new_min_clean_size);
break;
case at_max_size:
HDfprintf(stdout, "%sAuto cache resize -- hit rate (%lf) out of bounds low (%6.5lf).\n",
cache_ptr->prefix, hit_rate, (cache_ptr->resize_ctl).lower_hr_threshold);
- HDfprintf(stdout, "%s cache already at maximum size so no change.\n", cache_ptr->prefix);
+ HDfprintf(stdout, "%s cache already at maximum size so no change.\n", cache_ptr->prefix);
break;
case at_min_size:
HDfprintf(stdout, "%sAuto cache resize -- hit rate (%lf) -- can't decrease.\n", cache_ptr->prefix,
hit_rate);
- HDfprintf(stdout, "%s cache already at minimum size.\n", cache_ptr->prefix);
+ HDfprintf(stdout, "%s cache already at minimum size.\n", cache_ptr->prefix);
break;
case increase_disabled:
@@ -616,16 +608,13 @@ H5C_def_auto_resize_rpt_fcn(H5C_t *cache_ptr,
HDfprintf(stdout, "%sAuto cache resize -- hit rate (%lf) out of bounds low (%6.5lf).\n",
cache_ptr->prefix, hit_rate, (cache_ptr->resize_ctl).lower_hr_threshold);
- HDfprintf(stdout, "%s cache not full so no increase in size.\n", cache_ptr->prefix);
+ HDfprintf(stdout, "%s cache not full so no increase in size.\n", cache_ptr->prefix);
break;
default:
HDfprintf(stdout, "%sAuto cache resize -- unknown status code.\n", cache_ptr->prefix);
break;
}
-
- return;
-
} /* H5C_def_auto_resize_rpt_fcn() */
/*-------------------------------------------------------------------------
@@ -807,9 +796,12 @@ H5C_dest(H5F_t *f)
#ifndef NDEBUG
#if H5C_DO_SANITY_CHECKS
- if (cache_ptr->get_entry_ptr_from_addr_counter > 0)
- HDfprintf(stdout, "*** %ld calls to H5C_get_entry_ptr_from_add(). ***\n",
+
+ if (cache_ptr->get_entry_ptr_from_addr_counter > 0) {
+
+ HDfprintf(stdout, "*** %" PRId64 " calls to H5C_get_entry_ptr_from_add(). ***\n",
cache_ptr->get_entry_ptr_from_addr_counter);
+ }
#endif /* H5C_DO_SANITY_CHECKS */
cache_ptr->magic = 0;
@@ -1308,47 +1300,47 @@ done:
/*-------------------------------------------------------------------------
* Function: H5C_flush_cache
*
- * Purpose: Flush (and possibly destroy) the entries contained in the
- * specified cache.
+ * Purpose: Flush (and possibly destroy) the entries contained in the
+ * specified cache.
*
- * If the cache contains protected entries, the function will
- * fail, as protected entries cannot be flushed. However
- * all unprotected entries should be flushed before the
- * function returns failure.
+ * If the cache contains protected entries, the function will
+ * fail, as protected entries cannot be flushed. However
+ * all unprotected entries should be flushed before the
+ * function returns failure.
*
* Return: Non-negative on success/Negative on failure or if there was
- * a request to flush all items and something was protected.
+ * a request to flush all items and something was protected.
*
* Programmer: John Mainzer
- * 6/2/04
+ * 6/2/04
*
- * Changes: Modified function to test for slist chamges in
- * pre_serialize and serialize callbacks, and re-start
- * scans through the slist when such changes occur.
+ * Changes: Modified function to test for slist chamges in
+ * pre_serialize and serialize callbacks, and re-start
+ * scans through the slist when such changes occur.
*
- * This has been a potential problem for some time,
- * and there has been code in this function to deal
- * with elements of this issue. However the shift
- * to the V3 cache in combination with the activities
- * of some of the cache clients (in particular the
- * free space manager and the fractal heap) have
- * made this re-work necessary.
+ * This has been a potential problem for some time,
+ * and there has been code in this function to deal
+ * with elements of this issue. However the shift
+ * to the V3 cache in combination with the activities
+ * of some of the cache clients (in particular the
+ * free space manager and the fractal heap) have
+ * made this re-work necessary.
*
- * JRM -- 12/13/14
+ * JRM -- 12/13/14
*
- * Modified function to support rings. Basic idea is that
- * every entry in the cache is assigned to a ring. Entries
- * in the outermost ring are flushed first, followed by
- * those in the next outermost ring, and so on until the
- * innermost ring is flushed. See header comment on
- * H5C_ring_t in H5Cprivate.h for a more detailed
- * discussion.
+ * Modified function to support rings. Basic idea is that
+ * every entry in the cache is assigned to a ring. Entries
+ * in the outermost ring are flushed first, followed by
+ * those in the next outermost ring, and so on until the
+ * innermost ring is flushed. See header comment on
+ * H5C_ring_t in H5Cprivate.h for a more detailed
+ * discussion.
*
- * JRM -- 8/30/15
+ * JRM -- 8/30/15
*
- * Modified function to call the free space manager
- * settling functions.
- * JRM -- 6/9/16
+ * Modified function to call the free space manager
+ * settling functions.
+ * JRM -- 6/9/16
*
*-------------------------------------------------------------------------
*/
@@ -1474,24 +1466,24 @@ done:
/*-------------------------------------------------------------------------
* Function: H5C_flush_to_min_clean
*
- * Purpose: Flush dirty entries until the caches min clean size is
- * attained.
+ * Purpose: Flush dirty entries until the caches min clean size is
+ * attained.
*
- * This function is used in the implementation of the
- * metadata cache in PHDF5. To avoid "messages from the
- * future", the cache on process 0 can't be allowed to
- * flush entries until the other processes have reached
- * the same point in the calculation. If this constraint
- * is not met, it is possible that the other processes will
- * read metadata generated at a future point in the
- * computation.
+ * This function is used in the implementation of the
+ * metadata cache in PHDF5. To avoid "messages from the
+ * future", the cache on process 0 can't be allowed to
+ * flush entries until the other processes have reached
+ * the same point in the calculation. If this constraint
+ * is not met, it is possible that the other processes will
+ * read metadata generated at a future point in the
+ * computation.
*
*
* Return: Non-negative on success/Negative on failure or if
- * write is not permitted.
+ * write is not permitted.
*
* Programmer: John Mainzer
- * 9/16/05
+ * 9/16/05
*
*-------------------------------------------------------------------------
*/
@@ -1536,12 +1528,12 @@ done:
* exist on disk yet, but it must have an address and disk
* space reserved.
*
- * Observe that this function cannot occasion a read.
+ * Observe that this function cannot occasion a read.
*
* Return: Non-negative on success/Negative on failure
*
* Programmer: John Mainzer
- * 6/2/04
+ * 6/2/04
*
*-------------------------------------------------------------------------
*/
@@ -1553,8 +1545,7 @@ H5C_insert_entry(H5F_t *f, const H5C_class_t *type, haddr_t addr, void *thing, u
hbool_t insert_pinned;
hbool_t flush_last;
#ifdef H5_HAVE_PARALLEL
- hbool_t coll_access = FALSE; /* whether access to the cache */
- /* entry is done collectively */
+ hbool_t coll_access = FALSE; /* whether access to the cache entry is done collectively */
#endif /* H5_HAVE_PARALLEL */
hbool_t set_flush_marker;
hbool_t write_permitted = TRUE;
@@ -2520,16 +2511,16 @@ done:
* Function: H5C_protect
*
* Purpose: If the target entry is not in the cache, load it. If
- * necessary, attempt to evict one or more entries to keep
- * the cache within its maximum size.
+ * necessary, attempt to evict one or more entries to keep
+ * the cache within its maximum size.
*
- * Mark the target entry as protected, and return its address
- * to the caller. The caller must call H5C_unprotect() when
- * finished with the entry.
+ * Mark the target entry as protected, and return its address
+ * to the caller. The caller must call H5C_unprotect() when
+ * finished with the entry.
*
- * While it is protected, the entry may not be either evicted
- * or flushed -- nor may it be accessed by another call to
- * H5C_protect. Any attempt to do so will result in a failure.
+ * While it is protected, the entry may not be either evicted
+ * or flushed -- nor may it be accessed by another call to
+ * H5C_protect. Any attempt to do so will result in a failure.
*
* Return: Success: Ptr to the desired entry
* Failure: NULL
@@ -2987,19 +2978,19 @@ done:
/*-------------------------------------------------------------------------
* Function: H5C_set_cache_auto_resize_config
*
- * Purpose: Set the cache automatic resize configuration to the
- * provided values if they are in range, and fail if they
- * are not.
+ * Purpose: Set the cache automatic resize configuration to the
+ * provided values if they are in range, and fail if they
+ * are not.
*
- * If the new configuration enables automatic cache resizing,
- * coerce the cache max size and min clean size into agreement
- * with the new policy and re-set the full cache hit rate
- * stats.
+ * If the new configuration enables automatic cache resizing,
+ * coerce the cache max size and min clean size into agreement
+ * with the new policy and re-set the full cache hit rate
+ * stats.
*
* Return: SUCCEED on success, and FAIL on failure.
*
* Programmer: John Mainzer
- * 10/8/04
+ * 10/8/04
*
*-------------------------------------------------------------------------
*/
@@ -3122,7 +3113,7 @@ H5C_set_cache_auto_resize_config(H5C_t *cache_ptr, H5C_auto_size_ctl_t *config_p
/* since new_min_clean_size is of type size_t, we have
*
- * ( 0 <= new_min_clean_size )
+ * ( 0 <= new_min_clean_size )
*
* by definition.
*/
@@ -3310,20 +3301,20 @@ done:
/*-------------------------------------------------------------------------
* Function: H5C_unprotect
*
- * Purpose: Undo an H5C_protect() call -- specifically, mark the
- * entry as unprotected, remove it from the protected list,
- * and give it back to the replacement policy.
+ * Purpose: Undo an H5C_protect() call -- specifically, mark the
+ * entry as unprotected, remove it from the protected list,
+ * and give it back to the replacement policy.
*
- * The TYPE and ADDR arguments must be the same as those in
- * the corresponding call to H5C_protect() and the THING
- * argument must be the value returned by that call to
- * H5C_protect().
+ * The TYPE and ADDR arguments must be the same as those in
+ * the corresponding call to H5C_protect() and the THING
+ * argument must be the value returned by that call to
+ * H5C_protect().
*
* Return: Non-negative on success/Negative on failure
*
- * If the deleted flag is TRUE, simply remove the target entry
- * from the cache, clear it, and free it without writing it to
- * disk.
+ * If the deleted flag is TRUE, simply remove the target entry
+ * from the cache, clear it, and free it without writing it to
+ * disk.
*
* Return: Non-negative on success/Negative on failure
*
@@ -3396,11 +3387,13 @@ H5C_unprotect(H5F_t *f, haddr_t addr, void *thing, unsigned flags)
* drops to zero.
*/
if (entry_ptr->ro_ref_count > 1) {
+
/* Sanity check */
HDassert(entry_ptr->is_protected);
HDassert(entry_ptr->is_read_only);
if (dirtied)
+
HGOTO_ERROR(H5E_CACHE, H5E_CANTUNPROTECT, FAIL, "Read only entry modified??")
/* Reduce the RO ref count */
@@ -3408,26 +3401,35 @@ H5C_unprotect(H5F_t *f, haddr_t addr, void *thing, unsigned flags)
/* Pin or unpin the entry as requested. */
if (pin_entry) {
+
/* Pin the entry from a client */
if (H5C__pin_entry_from_client(cache_ptr, entry_ptr) < 0)
+
HGOTO_ERROR(H5E_CACHE, H5E_CANTPIN, FAIL, "Can't pin entry by client")
}
else if (unpin_entry) {
+
/* Unpin the entry from a client */
if (H5C__unpin_entry_from_client(cache_ptr, entry_ptr, FALSE) < 0)
+
HGOTO_ERROR(H5E_CACHE, H5E_CANTUNPIN, FAIL, "Can't unpin entry by client")
+
} /* end if */
}
else {
+
if (entry_ptr->is_read_only) {
+
/* Sanity check */
HDassert(entry_ptr->ro_ref_count == 1);
if (dirtied)
+
HGOTO_ERROR(H5E_CACHE, H5E_CANTUNPROTECT, FAIL, "Read only entry modified??")
entry_ptr->is_read_only = FALSE;
entry_ptr->ro_ref_count = 0;
+
} /* end if */
#ifdef H5_HAVE_PARALLEL
@@ -3457,6 +3459,7 @@ H5C_unprotect(H5F_t *f, haddr_t addr, void *thing, unsigned flags)
#endif /* H5_HAVE_PARALLEL */
if (!entry_ptr->is_protected)
+
HGOTO_ERROR(H5E_CACHE, H5E_CANTUNPROTECT, FAIL, "Entry already unprotected??")
/* Mark the entry as dirty if appropriate */
@@ -3464,15 +3467,18 @@ H5C_unprotect(H5F_t *f, haddr_t addr, void *thing, unsigned flags)
if (dirtied)
if (entry_ptr->image_up_to_date) {
+
entry_ptr->image_up_to_date = FALSE;
if (entry_ptr->flush_dep_nparents > 0)
if (H5C__mark_flush_dep_unserialized(entry_ptr) < 0)
+
HGOTO_ERROR(H5E_CACHE, H5E_CANTNOTIFY, FAIL,
"Can't propagate serialization status to fd parents")
} /* end if */
/* Check for newly dirtied entry */
if (was_clean && entry_ptr->is_dirty) {
+
/* Update index for newly dirtied entry */
H5C__UPDATE_INDEX_FOR_ENTRY_DIRTY(cache_ptr, entry_ptr)
@@ -3487,6 +3493,7 @@ H5C_unprotect(H5F_t *f, haddr_t addr, void *thing, unsigned flags)
* if appropriate */
if (entry_ptr->flush_dep_nparents > 0)
if (H5C__mark_flush_dep_dirty(entry_ptr) < 0)
+
HGOTO_ERROR(H5E_CACHE, H5E_CANTMARKDIRTY, FAIL, "Can't propagate flush dep dirty flag")
} /* end if */
/* Check for newly clean entry */
@@ -3503,18 +3510,23 @@ H5C_unprotect(H5F_t *f, haddr_t addr, void *thing, unsigned flags)
* if appropriate */
if (entry_ptr->flush_dep_nparents > 0)
if (H5C__mark_flush_dep_clean(entry_ptr) < 0)
+
HGOTO_ERROR(H5E_CACHE, H5E_CANTMARKDIRTY, FAIL, "Can't propagate flush dep dirty flag")
} /* end else-if */
/* Pin or unpin the entry as requested. */
if (pin_entry) {
+
/* Pin the entry from a client */
if (H5C__pin_entry_from_client(cache_ptr, entry_ptr) < 0)
+
HGOTO_ERROR(H5E_CACHE, H5E_CANTPIN, FAIL, "Can't pin entry by client")
}
else if (unpin_entry) {
+
/* Unpin the entry from a client */
if (H5C__unpin_entry_from_client(cache_ptr, entry_ptr, FALSE) < 0)
+
HGOTO_ERROR(H5E_CACHE, H5E_CANTUNPIN, FAIL, "Can't unpin entry by client")
} /* end if */
@@ -3529,6 +3541,7 @@ H5C_unprotect(H5F_t *f, haddr_t addr, void *thing, unsigned flags)
* and then add it to the skip list if it isn't there already.
*/
if (entry_ptr->is_dirty) {
+
entry_ptr->flush_marker |= set_flush_marker;
if (!entry_ptr->in_slist)
H5C__INSERT_ENTRY_IN_SLIST(cache_ptr, entry_ptr, FAIL)
diff --git a/src/H5CX.c b/src/H5CX.c
index cff06f6..c304548 100644
--- a/src/H5CX.c
+++ b/src/H5CX.c
@@ -1371,7 +1371,7 @@ H5CX_set_apl(hid_t *acspl_id, const H5P_libclass_t *libclass,
/* Get the plist structure for the access property list */
if (NULL == (plist = (H5P_genplist_t *)H5I_object(*acspl_id)))
- HGOTO_ERROR(H5E_CONTEXT, H5E_BADATOM, FAIL, "can't find object for ID")
+ HGOTO_ERROR(H5E_CONTEXT, H5E_BADID, FAIL, "can't find object for ID")
/* Get the collective metadata read flag */
if (H5P_peek(plist, H5_COLL_MD_READ_FLAG_NAME, &md_coll_read) < 0)
diff --git a/src/H5Cdbg.c b/src/H5Cdbg.c
index 462e926..87b81dc 100644
--- a/src/H5Cdbg.c
+++ b/src/H5Cdbg.c
@@ -250,11 +250,12 @@ H5C_dump_cache_LRU(H5C_t *cache_ptr, const char *cache_name)
#endif /* NDEBUG */
/*-------------------------------------------------------------------------
+ *
* Function: H5C_dump_cache_skip_list
*
* Purpose: Debugging routine that prints a summary of the contents of
- * the skip list used by the metadata cache metadata cache to
- * maintain an address sorted list of dirty entries.
+ * the skip list used by the metadata cache metadata cache to
+ * maintain an address sorted list of dirty entries.
*
* Return: Non-negative on success/Negative on failure
*
@@ -283,41 +284,58 @@ H5C_dump_cache_skip_list(H5C_t *cache_ptr, char *calling_fcn)
HDfprintf(stdout, " slist size = %zu.\n", cache_ptr->slist_size);
if (cache_ptr->slist_len > 0) {
+
/* If we get this far, all entries in the cache are listed in the
* skip list -- scan the skip list generating the desired output.
*/
HDfprintf(stdout, "Num: Addr: Len: Prot/Pind: Dirty: Type:\n");
- i = 0;
+ i = 0;
+
node_ptr = H5SL_first(cache_ptr->slist_ptr);
- if (node_ptr != NULL)
+
+ if (node_ptr != NULL) {
+
entry_ptr = (H5C_cache_entry_t *)H5SL_item(node_ptr);
- else
+ }
+ else {
+
entry_ptr = NULL;
+ }
while (entry_ptr != NULL) {
+
HDassert(entry_ptr->magic == H5C__H5C_CACHE_ENTRY_T_MAGIC);
- HDfprintf(stdout, "%s%d 0x%016" PRIxHADDR " %4zu %d/%d %d %s\n",
- cache_ptr->prefix, i, entry_ptr->addr, entry_ptr->size, (int)(entry_ptr->is_protected),
- (int)(entry_ptr->is_pinned), (int)(entry_ptr->is_dirty), entry_ptr->type->name);
+ HDfprintf(stdout, "%s%d 0x%016llx %4lld %d/%d %d %s\n", cache_ptr->prefix, i,
+ (long long)(entry_ptr->addr), (long long)(entry_ptr->size),
+ (int)(entry_ptr->is_protected), (int)(entry_ptr->is_pinned), (int)(entry_ptr->is_dirty),
+ entry_ptr->type->name);
- HDfprintf(stdout, " node_ptr = %p, item = %p\n", node_ptr, H5SL_item(node_ptr));
+ HDfprintf(stdout, " node_ptr = %p, item = %p\n", (void *)node_ptr, H5SL_item(node_ptr));
/* increment node_ptr before we delete its target */
+
node_ptr = H5SL_next(node_ptr);
- if (node_ptr != NULL)
+
+ if (node_ptr != NULL) {
+
entry_ptr = (H5C_cache_entry_t *)H5SL_item(node_ptr);
- else
+ }
+ else {
+
entry_ptr = NULL;
+ }
i++;
+
} /* end while */
} /* end if */
HDfprintf(stdout, "\n\n");
FUNC_LEAVE_NOAPI(ret_value)
+
} /* H5C_dump_cache_skip_list() */
#endif /* NDEBUG */
@@ -392,13 +410,14 @@ H5C_dump_coll_write_list(H5C_t *cache_ptr, char *calling_fcn)
node_ptr = H5SL_next(node_ptr);
- if (node_ptr != NULL)
+ if (node_ptr != NULL) {
entry_ptr = (H5C_cache_entry_t *)H5SL_item(node_ptr);
-
- else
+ }
+ else {
entry_ptr = NULL;
+ }
i++;
@@ -686,8 +705,8 @@ H5C_stats(H5C_t *cache_ptr, const char *cache_name,
(long long)(cache_ptr->slist_scan_restarts), (long long)(cache_ptr->LRU_scan_restarts),
(long long)(cache_ptr->index_scan_restarts));
- HDfprintf(stdout, "%s cache image creations/reads/loads/size = %d / %d /%d / %Hu\n", cache_ptr->prefix,
- cache_ptr->images_created, cache_ptr->images_read, cache_ptr->images_loaded,
+ HDfprintf(stdout, "%s cache image creations/reads/loads/size = %d / %d /%d / %" PRIuHSIZE "\n",
+ cache_ptr->prefix, cache_ptr->images_created, cache_ptr->images_read, cache_ptr->images_loaded,
cache_ptr->last_image_size);
HDfprintf(stdout, "%s prefetches / dirty prefetches = %lld / %lld\n", cache_ptr->prefix,
diff --git a/src/H5D.c b/src/H5D.c
index d60465e..cb2a720 100644
--- a/src/H5D.c
+++ b/src/H5D.c
@@ -53,6 +53,9 @@ hbool_t H5_PKG_INIT_VAR = FALSE;
/* Library Private Variables */
/*****************************/
+/* Declare extern free list to manage the H5S_sel_iter_t struct */
+H5FL_EXTERN(H5S_sel_iter_t);
+
/* Declare extern the free list to manage blocks of type conversion data */
H5FL_BLK_EXTERN(type_conv);
@@ -138,7 +141,7 @@ H5Dcreate2(hid_t loc_id, const char *name, hid_t type_id, hid_t space_id, hid_t
/* Create the dataset */
if (NULL == (dset = H5VL_dataset_create(vol_obj, &loc_params, name, lcpl_id, type_id, space_id, dcpl_id,
dapl_id, H5P_DATASET_XFER_DEFAULT, H5_REQUEST_NULL)))
- HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, H5I_INVALID_HID, "unable to create dataset")
+ HGOTO_ERROR(H5E_DATASET, H5E_CANTCREATE, H5I_INVALID_HID, "unable to create dataset")
/* Get an ID for the dataset */
if ((ret_value = H5VL_register(H5I_DATASET, dset, vol_obj->connector, TRUE)) < 0)
@@ -187,9 +190,9 @@ done:
hid_t
H5Dcreate_anon(hid_t loc_id, hid_t type_id, hid_t space_id, hid_t dcpl_id, hid_t dapl_id)
{
- void * dset = NULL; /* dset object from VOL connector */
- H5VL_object_t * vol_obj = NULL; /* object of loc_id */
- H5VL_loc_params_t loc_params;
+ void * dset = NULL; /* dset object from VOL connector */
+ H5VL_object_t * vol_obj = NULL; /* Object for loc_id */
+ H5VL_loc_params_t loc_params; /* Location parameters for object access */
hid_t ret_value = H5I_INVALID_HID; /* Return value */
FUNC_ENTER_API(H5I_INVALID_HID)
@@ -222,7 +225,7 @@ H5Dcreate_anon(hid_t loc_id, hid_t type_id, hid_t space_id, hid_t dcpl_id, hid_t
dcpl_id, dapl_id, H5P_DATASET_XFER_DEFAULT, H5_REQUEST_NULL)))
HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, H5I_INVALID_HID, "unable to create dataset")
- /* Get an atom for the dataset */
+ /* Get an ID for the dataset */
if ((ret_value = H5VL_register(H5I_DATASET, dset, vol_obj->connector, TRUE)) < 0)
HGOTO_ERROR(H5E_DATASET, H5E_CANTREGISTER, H5I_INVALID_HID, "unable to register dataset")
@@ -374,13 +377,13 @@ done:
*-------------------------------------------------------------------------
*/
herr_t
-H5Dget_space_status(hid_t dset_id, H5D_space_status_t *allocation)
+H5Dget_space_status(hid_t dset_id, H5D_space_status_t *allocation /*out*/)
{
H5VL_object_t *vol_obj = NULL; /* Dataset structure */
herr_t ret_value = SUCCEED; /* Return value */
FUNC_ENTER_API(FAIL)
- H5TRACE2("e", "i*Ds", dset_id, allocation);
+ H5TRACE2("e", "ix", dset_id, allocation);
/* Check args */
if (NULL == (vol_obj = (H5VL_object_t *)H5I_object_verify(dset_id, H5I_DATASET)))
@@ -594,6 +597,253 @@ done:
} /* end H5Dget_offset() */
/*-------------------------------------------------------------------------
+ * Function: H5Dscatter
+ *
+ * Purpose: Scatters data provided by the callback op to the
+ * destination buffer dst_buf, where the dimensions of
+ * dst_buf and the selection to be scattered to are specified
+ * by the dataspace dst_space_id. The type of the data to be
+ * scattered is specified by type_id.
+ *
+ * Return: Non-negative on success/Negative on failure
+ *
+ * Programmer: Neil Fortner
+ * 14 Jan 2013
+ *
+ *-------------------------------------------------------------------------
+ */
+herr_t
+H5Dscatter(H5D_scatter_func_t op, void *op_data, hid_t type_id, hid_t dst_space_id, void *dst_buf /*out*/)
+{
+ H5T_t * type; /* Datatype */
+ H5S_t * dst_space; /* Dataspace */
+ H5S_sel_iter_t *iter = NULL; /* Selection iteration info*/
+ hbool_t iter_init = FALSE; /* Selection iteration info has been initialized */
+ const void * src_buf = NULL; /* Source (contiguous) data buffer */
+ size_t src_buf_nbytes = 0; /* Size of src_buf */
+ size_t type_size; /* Datatype element size */
+ hssize_t nelmts; /* Number of remaining elements in selection */
+ size_t nelmts_scatter = 0; /* Number of elements to scatter to dst_buf */
+ herr_t ret_value = SUCCEED; /* Return value */
+
+ FUNC_ENTER_API(FAIL)
+ H5TRACE5("e", "DS*xiix", op, op_data, type_id, dst_space_id, dst_buf);
+
+ /* Check args */
+ if (op == NULL)
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "invalid callback function pointer")
+ if (NULL == (type = (H5T_t *)H5I_object_verify(type_id, H5I_DATATYPE)))
+ HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a datatype")
+ if (NULL == (dst_space = (H5S_t *)H5I_object_verify(dst_space_id, H5I_DATASPACE)))
+ HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a dataspace")
+ if (dst_buf == NULL)
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "no destination buffer provided")
+
+ /* Get datatype element size */
+ if (0 == (type_size = H5T_GET_SIZE(type)))
+ HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, FAIL, "can't get datatype size")
+
+ /* Get number of elements in dataspace */
+ if ((nelmts = (hssize_t)H5S_GET_SELECT_NPOINTS(dst_space)) < 0)
+ HGOTO_ERROR(H5E_DATASET, H5E_CANTCOUNT, FAIL, "unable to get number of elements in selection")
+
+ /* Allocate the selection iterator */
+ if (NULL == (iter = H5FL_MALLOC(H5S_sel_iter_t)))
+ HGOTO_ERROR(H5E_DATASET, H5E_CANTALLOC, FAIL, "can't allocate selection iterator")
+
+ /* Initialize selection iterator */
+ if (H5S_select_iter_init(iter, dst_space, type_size, 0) < 0)
+ HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "unable to initialize selection iterator information")
+ iter_init = TRUE;
+
+ /* Loop until all data has been scattered */
+ while (nelmts > 0) {
+ /* Make callback to retrieve data */
+ if (op(&src_buf, &src_buf_nbytes, op_data) < 0)
+ HGOTO_ERROR(H5E_DATASET, H5E_CALLBACK, FAIL, "callback operator returned failure")
+
+ /* Calculate number of elements */
+ nelmts_scatter = src_buf_nbytes / type_size;
+
+ /* Check callback results */
+ if (!src_buf)
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "callback did not return a buffer")
+ if (src_buf_nbytes == 0)
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "callback returned a buffer size of 0")
+ if (src_buf_nbytes % type_size)
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "buffer size is not a multiple of datatype size")
+ if (nelmts_scatter > (size_t)nelmts)
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "callback returned more elements than in selection")
+
+ /* Scatter data */
+ if (H5D__scatter_mem(src_buf, iter, nelmts_scatter, dst_buf) < 0)
+ HGOTO_ERROR(H5E_DATASET, H5E_CANTCOPY, FAIL, "scatter failed")
+
+ nelmts -= (hssize_t)nelmts_scatter;
+ } /* end while */
+
+done:
+ /* Release selection iterator */
+ if (iter_init && H5S_SELECT_ITER_RELEASE(iter) < 0)
+ HDONE_ERROR(H5E_DATASET, H5E_CANTFREE, FAIL, "Can't release selection iterator")
+ if (iter)
+ iter = H5FL_FREE(H5S_sel_iter_t, iter);
+
+ FUNC_LEAVE_API(ret_value)
+} /* H5Dscatter() */
+
+/*-------------------------------------------------------------------------
+ * Function: H5Dgather
+ *
+ * Purpose: Gathers data provided from the source buffer src_buf to
+ * contiguous buffer dst_buf, then calls the callback op.
+ * The dimensions of src_buf and the selection to be gathered
+ * are specified by the dataspace src_space_id. The type of
+ * the data to be gathered is specified by type_id.
+ *
+ * Return: Non-negative on success/Negative on failure
+ *
+ * Programmer: Neil Fortner
+ * 16 Jan 2013
+ *
+ *-------------------------------------------------------------------------
+ */
+herr_t
+H5Dgather(hid_t src_space_id, const void *src_buf, hid_t type_id, size_t dst_buf_size, void *dst_buf /*out*/,
+ H5D_gather_func_t op, void *op_data)
+{
+ H5T_t * type; /* Datatype */
+ H5S_t * src_space; /* Dataspace */
+ H5S_sel_iter_t *iter = NULL; /* Selection iteration info*/
+ hbool_t iter_init = FALSE; /* Selection iteration info has been initialized */
+ size_t type_size; /* Datatype element size */
+ hssize_t nelmts; /* Number of remaining elements in selection */
+ size_t dst_buf_nelmts; /* Number of elements that can fit in dst_buf */
+ size_t nelmts_gathered; /* Number of elements gathered from src_buf */
+ herr_t ret_value = SUCCEED; /* Return value */
+
+ FUNC_ENTER_API(FAIL)
+ H5TRACE7("e", "i*xizxDg*x", src_space_id, src_buf, type_id, dst_buf_size, dst_buf, op, op_data);
+
+ /* Check args */
+ if (NULL == (src_space = (H5S_t *)H5I_object_verify(src_space_id, H5I_DATASPACE)))
+ HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a dataspace")
+ if (src_buf == NULL)
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "no source buffer provided")
+ if (NULL == (type = (H5T_t *)H5I_object_verify(type_id, H5I_DATATYPE)))
+ HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a datatype")
+ if (dst_buf_size == 0)
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "destination buffer size is 0")
+ if (dst_buf == NULL)
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "no destination buffer provided")
+
+ /* Get datatype element size */
+ if (0 == (type_size = H5T_GET_SIZE(type)))
+ HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, FAIL, "can't get datatype size")
+
+ /* Get number of elements in dst_buf_size */
+ dst_buf_nelmts = dst_buf_size / type_size;
+ if (dst_buf_nelmts == 0)
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL,
+ "destination buffer is not large enough to hold one element")
+
+ /* Get number of elements in dataspace */
+ if ((nelmts = (hssize_t)H5S_GET_SELECT_NPOINTS(src_space)) < 0)
+ HGOTO_ERROR(H5E_DATASET, H5E_CANTCOUNT, FAIL, "unable to get number of elements in selection")
+
+ /* If dst_buf is not large enough to hold all the elements, make sure there
+ * is a callback */
+ if (((size_t)nelmts > dst_buf_nelmts) && (op == NULL))
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "no callback supplied and destination buffer too small")
+
+ /* Allocate the selection iterator */
+ if (NULL == (iter = H5FL_MALLOC(H5S_sel_iter_t)))
+ HGOTO_ERROR(H5E_DATASET, H5E_CANTALLOC, FAIL, "can't allocate selection iterator")
+
+ /* Initialize selection iterator */
+ if (H5S_select_iter_init(iter, src_space, type_size, 0) < 0)
+ HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "unable to initialize selection iterator information")
+ iter_init = TRUE;
+
+ /* Loop until all data has been scattered */
+ while (nelmts > 0) {
+ /* Gather data */
+ if (0 ==
+ (nelmts_gathered = H5D__gather_mem(src_buf, iter, MIN(dst_buf_nelmts, (size_t)nelmts), dst_buf)))
+ HGOTO_ERROR(H5E_DATASET, H5E_CANTCOPY, FAIL, "gather failed")
+ HDassert(nelmts_gathered == MIN(dst_buf_nelmts, (size_t)nelmts));
+
+ /* Make callback to process dst_buf */
+ if (op && op(dst_buf, nelmts_gathered * type_size, op_data) < 0)
+ HGOTO_ERROR(H5E_DATASET, H5E_CALLBACK, FAIL, "callback operator returned failure")
+
+ nelmts -= (hssize_t)nelmts_gathered;
+ HDassert(op || (nelmts == 0));
+ } /* end while */
+
+done:
+ /* Release selection iterator */
+ if (iter_init && H5S_SELECT_ITER_RELEASE(iter) < 0)
+ HDONE_ERROR(H5E_DATASET, H5E_CANTFREE, FAIL, "Can't release selection iterator")
+ if (iter)
+ iter = H5FL_FREE(H5S_sel_iter_t, iter);
+
+ FUNC_LEAVE_API(ret_value)
+} /* H5Dgather() */
+
+/*--------------------------------------------------------------------------
+ NAME
+ H5Dfill
+ PURPOSE
+ Fill a selection in memory with a value
+ USAGE
+ herr_t H5Dfill(fill, fill_type, space, buf, buf_type)
+ const void *fill; IN: Pointer to fill value to use
+ hid_t fill_type_id; IN: Datatype of the fill value
+ void *buf; IN/OUT: Memory buffer to fill selection within
+ hid_t buf_type_id; IN: Datatype of the elements in buffer
+ hid_t space_id; IN: Dataspace describing memory buffer &
+ containing selection to use.
+ RETURNS
+ Non-negative on success/Negative on failure.
+ DESCRIPTION
+ Use the selection in the dataspace to fill elements in a memory buffer.
+ GLOBAL VARIABLES
+ COMMENTS, BUGS, ASSUMPTIONS
+ If "fill" parameter is NULL, use all zeros as fill value
+ EXAMPLES
+ REVISION LOG
+--------------------------------------------------------------------------*/
+herr_t
+H5Dfill(const void *fill, hid_t fill_type_id, void *buf, hid_t buf_type_id, hid_t space_id)
+{
+ H5S_t *space; /* Dataspace */
+ H5T_t *fill_type; /* Fill-value datatype */
+ H5T_t *buf_type; /* Buffer datatype */
+ herr_t ret_value = SUCCEED; /* Return value */
+
+ FUNC_ENTER_API(FAIL)
+ H5TRACE5("e", "*xi*xii", fill, fill_type_id, buf, buf_type_id, space_id);
+
+ /* Check args */
+ if (buf == NULL)
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "invalid buffer")
+ if (NULL == (space = (H5S_t *)H5I_object_verify(space_id, H5I_DATASPACE)))
+ HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, 0, "not a dataspace")
+ if (NULL == (fill_type = (H5T_t *)H5I_object_verify(fill_type_id, H5I_DATATYPE)))
+ HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, 0, "not a datatype")
+ if (NULL == (buf_type = (H5T_t *)H5I_object_verify(buf_type_id, H5I_DATATYPE)))
+ HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, 0, "not a datatype")
+
+ /* Fill the selection in the memory buffer */
+ if (H5D__fill(fill, fill_type, buf, buf_type, space) < 0)
+ HGOTO_ERROR(H5E_DATASET, H5E_CANTENCODE, FAIL, "filling selection failed")
+
+done:
+ FUNC_LEAVE_API(ret_value)
+} /* H5Dfill() */
+
+/*-------------------------------------------------------------------------
* Function: H5Diterate
*
* Purpose: This routine iterates over all the elements selected in a memory
@@ -704,14 +954,14 @@ done:
*-------------------------------------------------------------------------
*/
herr_t
-H5Dvlen_get_buf_size(hid_t dataset_id, hid_t type_id, hid_t space_id, hsize_t *size)
+H5Dvlen_get_buf_size(hid_t dataset_id, hid_t type_id, hid_t space_id, hsize_t *size /*out*/)
{
H5VL_object_t *vol_obj; /* Dataset for this operation */
hbool_t supported; /* Whether 'get vlen buf size' operation is supported by VOL connector */
herr_t ret_value = SUCCEED; /* Return value */
FUNC_ENTER_API(FAIL)
- H5TRACE4("e", "iii*h", dataset_id, type_id, space_id, size);
+ H5TRACE4("e", "iiix", dataset_id, type_id, space_id, size);
/* Check args */
if (NULL == (vol_obj = (H5VL_object_t *)H5I_object(dataset_id)))
@@ -727,7 +977,7 @@ H5Dvlen_get_buf_size(hid_t dataset_id, hid_t type_id, hid_t space_id, hsize_t *s
supported = FALSE;
if (H5VL_introspect_opt_query(vol_obj, H5VL_SUBCLS_DATASET, H5VL_NATIVE_DATASET_GET_VLEN_BUF_SIZE,
&supported) < 0)
- HGOTO_ERROR(H5E_FILE, H5E_CANTGET, H5I_INVALID_HID, "can't check for 'get vlen buf size' operation")
+ HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, FAIL, "can't check for 'get vlen buf size' operation")
if (supported) {
/* Make the 'get_vlen_buf_size' callback */
if (H5VL_dataset_optional(vol_obj, H5VL_NATIVE_DATASET_GET_VLEN_BUF_SIZE, H5P_DATASET_XFER_DEFAULT,
@@ -911,13 +1161,13 @@ done:
*-------------------------------------------------------------------------
*/
herr_t
-H5Dget_chunk_index_type(hid_t dset_id, H5D_chunk_index_t *idx_type)
+H5Dget_chunk_index_type(hid_t dset_id, H5D_chunk_index_t *idx_type /*out*/)
{
H5VL_object_t *vol_obj; /* Dataset for this operation */
herr_t ret_value = SUCCEED; /* Return value */
FUNC_ENTER_API(FAIL)
- H5TRACE2("e", "i*Dk", dset_id, idx_type);
+ H5TRACE2("e", "ix", dset_id, idx_type);
/* Check args */
if (NULL == (vol_obj = (H5VL_object_t *)H5I_object_verify(dset_id, H5I_DATASET)))
@@ -950,13 +1200,13 @@ done:
*-------------------------------------------------------------------------
*/
herr_t
-H5Dget_chunk_storage_size(hid_t dset_id, const hsize_t *offset, hsize_t *chunk_nbytes)
+H5Dget_chunk_storage_size(hid_t dset_id, const hsize_t *offset, hsize_t *chunk_nbytes /*out*/)
{
H5VL_object_t *vol_obj; /* Dataset for this operation */
herr_t ret_value = SUCCEED; /* Return value */
FUNC_ENTER_API(FAIL)
- H5TRACE3("e", "i*h*h", dset_id, offset, chunk_nbytes);
+ H5TRACE3("e", "i*hx", dset_id, offset, chunk_nbytes);
/* Check arguments */
if (NULL == (vol_obj = (H5VL_object_t *)H5I_object_verify(dset_id, H5I_DATASET)))
@@ -1043,15 +1293,15 @@ done:
*-------------------------------------------------------------------------
*/
herr_t
-H5Dget_chunk_info(hid_t dset_id, hid_t fspace_id, hsize_t chk_index, hsize_t *offset, unsigned *filter_mask,
- haddr_t *addr, hsize_t *size)
+H5Dget_chunk_info(hid_t dset_id, hid_t fspace_id, hsize_t chk_index, hsize_t *offset /*out*/,
+ unsigned *filter_mask /*out*/, haddr_t *addr /*out*/, hsize_t *size /*out*/)
{
H5VL_object_t *vol_obj = NULL; /* Dataset for this operation */
hsize_t nchunks = 0;
herr_t ret_value = SUCCEED;
FUNC_ENTER_API(FAIL)
- H5TRACE7("e", "iih*h*Iu*a*h", dset_id, fspace_id, chk_index, offset, filter_mask, addr, size);
+ H5TRACE7("e", "iihxxxx", dset_id, fspace_id, chk_index, offset, filter_mask, addr, size);
/* Check arguments */
if (NULL == offset && NULL == filter_mask && NULL == addr && NULL == size)
@@ -1100,14 +1350,14 @@ done:
*-------------------------------------------------------------------------
*/
herr_t
-H5Dget_chunk_info_by_coord(hid_t dset_id, const hsize_t *offset, unsigned *filter_mask, haddr_t *addr,
- hsize_t *size)
+H5Dget_chunk_info_by_coord(hid_t dset_id, const hsize_t *offset, unsigned *filter_mask /*out*/,
+ haddr_t *addr /*out*/, hsize_t *size /*out*/)
{
H5VL_object_t *vol_obj = NULL; /* Dataset for this operation */
herr_t ret_value = SUCCEED;
FUNC_ENTER_API(FAIL)
- H5TRACE5("e", "i*h*Iu*a*h", dset_id, offset, filter_mask, addr, size);
+ H5TRACE5("e", "i*hxxx", dset_id, offset, filter_mask, addr, size);
/* Check arguments */
if (NULL == (vol_obj = (H5VL_object_t *)H5I_object_verify(dset_id, H5I_DATASET)))
diff --git a/src/H5Dbtree.c b/src/H5Dbtree.c
index cca6697..75bc23f 100644
--- a/src/H5Dbtree.c
+++ b/src/H5Dbtree.c
@@ -11,7 +11,7 @@
* help@hdfgroup.org. *
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
-/* Programmer: Robb Matzke <matzke@llnl.gov>
+/* Programmer: Robb Matzke
* Wednesday, October 8, 1997
*
* Purpose: v1 B-tree indexed (chunked) I/O functions. The chunks are
@@ -595,8 +595,7 @@ done:
*
* Return: Non-negative on success/Negative on failure
*
- * Programmer: Robb Matzke
- * Pedro Vicente, pvn@ncsa.uiuc.edu
+ * Programmer: Pedro Vicente
* March 28, 2002
*
*-------------------------------------------------------------------------
@@ -743,7 +742,7 @@ H5D__btree_debug_key(FILE *stream, int indent, int fwidth, const void *_key, con
HDfprintf(stream, "%*s%-*s 0x%08x\n", indent, "", fwidth, "Filter mask:", key->filter_mask);
HDfprintf(stream, "%*s%-*s {", indent, "", fwidth, "Logical offset:");
for (u = 0; u < udata->ndims; u++)
- HDfprintf(stream, "%s%Hd", u ? ", " : "", (key->scaled[u] * udata->common.layout->dim[u]));
+ HDfprintf(stream, "%s%" PRIuHSIZE, u ? ", " : "", (key->scaled[u] * udata->common.layout->dim[u]));
HDfputs("}\n", stream);
FUNC_LEAVE_NOAPI(SUCCEED)
@@ -1372,7 +1371,7 @@ H5D__btree_idx_dump(const H5O_storage_chunk_t *storage, FILE *stream)
HDassert(storage);
HDassert(stream);
- HDfprintf(stream, " Address: %a\n", storage->idx_addr);
+ HDfprintf(stream, " Address: %" PRIuHADDR "\n", storage->idx_addr);
FUNC_LEAVE_NOAPI(SUCCEED)
} /* end H5D__btree_idx_dump() */
diff --git a/src/H5Dbtree2.c b/src/H5Dbtree2.c
index 35d2f94..529f735 100644
--- a/src/H5Dbtree2.c
+++ b/src/H5Dbtree2.c
@@ -108,7 +108,7 @@ static herr_t H5D__bt2_found_cb(const void *nrecord, void *op_data);
*/
static herr_t H5D__bt2_remove_cb(const void *nrecord, void *_udata);
-/* Callback for H5B2_modify() which is called in H5D__bt2_idx_insert() */
+/* Callback for H5B2_update() which is called in H5D__bt2_idx_insert() */
static herr_t H5D__bt2_mod_cb(void *_record, void *_op_data, hbool_t *changed);
/* Chunked layout indexing callbacks for v2 B-tree indexing */
@@ -442,11 +442,11 @@ H5D__bt2_unfilt_debug(FILE *stream, int indent, int fwidth, const void *_record,
HDassert(ctx->chunk_size == record->nbytes);
HDassert(0 == record->filter_mask);
- HDfprintf(stream, "%*s%-*s %a\n", indent, "", fwidth, "Chunk address:", record->chunk_addr);
+ HDfprintf(stream, "%*s%-*s %" PRIuHADDR "\n", indent, "", fwidth, "Chunk address:", record->chunk_addr);
HDfprintf(stream, "%*s%-*s {", indent, "", fwidth, "Logical offset:");
for (u = 0; u < ctx->ndims; u++)
- HDfprintf(stream, "%s%Hd", u ? ", " : "", record->scaled[u] * ctx->dim[u]);
+ HDfprintf(stream, "%s%" PRIuHSIZE, u ? ", " : "", record->scaled[u] * ctx->dim[u]);
HDfputs("}\n", stream);
FUNC_LEAVE_NOAPI(SUCCEED)
@@ -556,13 +556,13 @@ H5D__bt2_filt_debug(FILE *stream, int indent, int fwidth, const void *_record, c
HDassert(H5F_addr_defined(record->chunk_addr));
HDassert(0 != record->nbytes);
- HDfprintf(stream, "%*s%-*s %a\n", indent, "", fwidth, "Chunk address:", record->chunk_addr);
+ HDfprintf(stream, "%*s%-*s %" PRIuHADDR "\n", indent, "", fwidth, "Chunk address:", record->chunk_addr);
HDfprintf(stream, "%*s%-*s %u bytes\n", indent, "", fwidth, "Chunk size:", (unsigned)record->nbytes);
HDfprintf(stream, "%*s%-*s 0x%08x\n", indent, "", fwidth, "Filter mask:", record->filter_mask);
HDfprintf(stream, "%*s%-*s {", indent, "", fwidth, "Logical offset:");
for (u = 0; u < ctx->ndims; u++)
- HDfprintf(stream, "%s%Hd", u ? ", " : "", record->scaled[u] * ctx->dim[u]);
+ HDfprintf(stream, "%s%" PRIuHSIZE, u ? ", " : "", record->scaled[u] * ctx->dim[u]);
HDfputs("}\n", stream);
FUNC_LEAVE_NOAPI(SUCCEED)
@@ -815,7 +815,7 @@ H5D__bt2_idx_is_space_alloc(const H5O_storage_chunk_t *storage)
* Function: H5D__bt2_mod_cb
*
* Purpose: Modify record for dataset chunk when it is found in a v2 B-tree.
- * This is the callback for H5B2_modify() which is called in
+ * This is the callback for H5B2_update() which is called in
* H5D__bt2_idx_insert().
*
* Return: Success: non-negative
@@ -1237,13 +1237,6 @@ done:
*
* Programmer: Vailin Choi; June 2010
*
- * Modifications:
- * Vailin Choi; March 2011
- * Initialize size of an unfiltered chunk.
- * This is a fix for for the assertion failure in:
- * [src/H5FSsection.c:968: H5FS_sect_link_size: Assertion `bin < sinfo->nbins' failed.]
- * which is uncovered by test_unlink_chunked_dataset() in test/unlink.c
- *
*-------------------------------------------------------------------------
*/
static herr_t
@@ -1475,7 +1468,7 @@ H5D__bt2_idx_dump(const H5O_storage_chunk_t *storage, FILE *stream)
HDassert(storage);
HDassert(stream);
- HDfprintf(stream, " Address: %a\n", storage->idx_addr);
+ HDfprintf(stream, " Address: %" PRIuHADDR "\n", storage->idx_addr);
FUNC_LEAVE_NOAPI(SUCCEED)
} /* end H5D__bt2_idx_dump() */
diff --git a/src/H5Dchunk.c b/src/H5Dchunk.c
index 5783a72..5380644 100644
--- a/src/H5Dchunk.c
+++ b/src/H5Dchunk.c
@@ -11,7 +11,7 @@
* help@hdfgroup.org. *
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
-/* Programmer: Quincey Koziol <koziol@hdfgroup.org>
+/* Programmer: Quincey Koziol
* Thursday, April 24, 2008
*
* Purpose: Abstract indexed (chunked) I/O functions. The logical
@@ -278,25 +278,23 @@ static ssize_t H5D__nonexistent_readvv(const H5D_io_info_t *io_info, size_t chun
hsize_t chunk_offset_arr[], size_t mem_max_nseq, size_t *mem_curr_seq,
size_t mem_len_arr[], hsize_t mem_offset_arr[]);
-/* format convert cb */
+/* Format convert cb */
static int H5D__chunk_format_convert_cb(const H5D_chunk_rec_t *chunk_rec, void *_udata);
/* Helper routines */
-static herr_t H5D__chunk_set_info_real(H5O_layout_chunk_t *layout, unsigned ndims, const hsize_t *curr_dims,
- const hsize_t *max_dims);
-static void * H5D__chunk_mem_alloc(size_t size, const H5O_pline_t *pline);
-static void * H5D__chunk_mem_xfree(void *chk, const void *pline);
-static void * H5D__chunk_mem_realloc(void *chk, size_t size, const H5O_pline_t *pline);
-static herr_t H5D__chunk_cinfo_cache_reset(H5D_chunk_cached_t *last);
-static herr_t H5D__chunk_cinfo_cache_update(H5D_chunk_cached_t *last, const H5D_chunk_ud_t *udata);
-static hbool_t H5D__chunk_cinfo_cache_found(const H5D_chunk_cached_t *last, H5D_chunk_ud_t *udata);
-static herr_t H5D__free_chunk_info(void *item, void *key, void *opdata);
-static herr_t H5D__create_chunk_map_single(H5D_chunk_map_t *fm, const H5D_io_info_t *io_info);
-static herr_t H5D__create_chunk_file_map_all(H5D_chunk_map_t *fm, const H5D_io_info_t *io_info);
-static herr_t H5D__create_chunk_file_map_hyper(H5D_chunk_map_t *fm, const H5D_io_info_t *io_info);
-
-static herr_t H5D__create_chunk_mem_map_1d(const H5D_chunk_map_t *fm);
-
+static herr_t H5D__chunk_set_info_real(H5O_layout_chunk_t *layout, unsigned ndims, const hsize_t *curr_dims,
+ const hsize_t *max_dims);
+static void * H5D__chunk_mem_alloc(size_t size, const H5O_pline_t *pline);
+static void * H5D__chunk_mem_xfree(void *chk, const void *pline);
+static void * H5D__chunk_mem_realloc(void *chk, size_t size, const H5O_pline_t *pline);
+static herr_t H5D__chunk_cinfo_cache_reset(H5D_chunk_cached_t *last);
+static herr_t H5D__chunk_cinfo_cache_update(H5D_chunk_cached_t *last, const H5D_chunk_ud_t *udata);
+static hbool_t H5D__chunk_cinfo_cache_found(const H5D_chunk_cached_t *last, H5D_chunk_ud_t *udata);
+static herr_t H5D__free_chunk_info(void *item, void *key, void *opdata);
+static herr_t H5D__create_chunk_map_single(H5D_chunk_map_t *fm, const H5D_io_info_t *io_info);
+static herr_t H5D__create_chunk_file_map_all(H5D_chunk_map_t *fm, const H5D_io_info_t *io_info);
+static herr_t H5D__create_chunk_file_map_hyper(H5D_chunk_map_t *fm, const H5D_io_info_t *io_info);
+static herr_t H5D__create_chunk_mem_map_1d(const H5D_chunk_map_t *fm);
static herr_t H5D__create_chunk_mem_map_hyper(const H5D_chunk_map_t *fm);
static herr_t H5D__chunk_file_cb(void *elem, const H5T_t *type, unsigned ndims, const hsize_t *coords,
void *fm);
@@ -319,6 +317,7 @@ static herr_t H5D__chunk_collective_fill(const H5D_t *dset, H5D_chunk_coll_info_
static int H5D__chunk_cmp_addr(const void *addr1, const void *addr2);
#endif /* H5_HAVE_PARALLEL */
+/* Debugging helper routine callback */
static int H5D__chunk_dump_index_cb(const H5D_chunk_rec_t *chunk_rec, void *_udata);
/*********************/
@@ -917,7 +916,7 @@ H5D__chunk_init(H5F_t *f, const H5D_t *const dset, hid_t dapl_id)
H5D_CHUNK_STORAGE_INDEX_CHK(sc);
if (NULL == (dapl = (H5P_genplist_t *)H5I_object(dapl_id)))
- HGOTO_ERROR(H5E_ATOM, H5E_BADATOM, FAIL, "can't find object for fapl ID")
+ HGOTO_ERROR(H5E_ID, H5E_BADID, FAIL, "can't find object for fapl ID")
/* Use the properties in dapl_id if they have been set, otherwise use the properties from the file */
if (H5P_get(dapl, H5D_ACS_DATA_CACHE_NUM_SLOTS_NAME, &rdcc->nslots) < 0)
@@ -3605,10 +3604,10 @@ H5D__chunk_cache_prune(const H5D_t *dset, size_t size)
{
const H5D_rdcc_t *rdcc = &(dset->shared->cache.chunk);
size_t total = rdcc->nbytes_max;
- const int nmeth = 2; /*number of methods */
- int w[1]; /*weighting as an interval */
- H5D_rdcc_ent_t * p[2], *cur; /*list pointers */
- H5D_rdcc_ent_t * n[2]; /*list next pointers */
+ const int nmeth = 2; /* Number of methods */
+ int w[1]; /* Weighting as an interval */
+ H5D_rdcc_ent_t * p[2], *cur; /* List pointers */
+ H5D_rdcc_ent_t * n[2]; /* List next pointers */
int nerrors = 0; /* Accumulated error count during preemptions */
herr_t ret_value = SUCCEED; /* Return value */
@@ -4546,9 +4545,8 @@ H5D__chunk_allocate(const H5D_io_info_t *io_info, hbool_t full_overwrite, hsize_
HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, FAIL, "error looking up chunk address")
#ifndef NDEBUG
/* None of the chunks should be allocated */
- if (H5D_CHUNK_IDX_NONE != sc->idx_type) {
+ if (H5D_CHUNK_IDX_NONE != sc->idx_type)
HDassert(!H5F_addr_defined(udata.chunk_block.offset));
- }
/* Make sure the chunk is really in the dataset and outside the
* original dimensions */
@@ -4954,7 +4952,7 @@ H5D__chunk_collective_fill(const H5D_t *dset, H5D_chunk_coll_info_t *chunk_info,
int blocks, leftover, block_len; /* converted to int for MPI */
MPI_Aint * chunk_disp_array = NULL;
int * block_lens = NULL;
- MPI_Datatype mem_type, file_type;
+ MPI_Datatype mem_type = MPI_BYTE, file_type = MPI_BYTE;
H5FD_mpio_xfer_t prev_xfer_mode; /* Previous data xfer mode */
hbool_t have_xfer_mode = FALSE; /* Whether the previous xffer mode has been retrieved */
hbool_t need_addr_sort = FALSE;
@@ -4980,9 +4978,9 @@ H5D__chunk_collective_fill(const H5D_t *dset, H5D_chunk_coll_info_t *chunk_info,
HGOTO_ERROR(H5E_DATASET, H5E_BADVALUE, FAIL, "Resulted in division by zero")
num_blocks = (size_t)(chunk_info->num_io / (size_t)mpi_size); /* value should be the same on all procs */
- /* after evenly distributing the blocks between processes, are
- there any leftover blocks for each individual process
- (round-robin) */
+ /* After evenly distributing the blocks between processes, are there any
+ * leftover blocks for each individual process (round-robin)?
+ */
leftover_blocks = (size_t)(chunk_info->num_io % (size_t)mpi_size);
/* Cast values to types needed by MPI */
@@ -4990,58 +4988,63 @@ H5D__chunk_collective_fill(const H5D_t *dset, H5D_chunk_coll_info_t *chunk_info,
H5_CHECKED_ASSIGN(leftover, int, leftover_blocks, size_t);
H5_CHECKED_ASSIGN(block_len, int, chunk_size, size_t);
- /* Allocate buffers */
- /* (MSC - should not need block_lens if MPI_type_create_hindexed_block is working) */
- if (NULL == (block_lens = (int *)H5MM_malloc((size_t)(blocks + 1) * sizeof(int))))
- HGOTO_ERROR(H5E_DATASET, H5E_CANTALLOC, FAIL, "couldn't allocate chunk lengths buffer")
- if (NULL == (chunk_disp_array = (MPI_Aint *)H5MM_malloc((size_t)(blocks + 1) * sizeof(MPI_Aint))))
- HGOTO_ERROR(H5E_DATASET, H5E_CANTALLOC, FAIL, "couldn't allocate chunk file displacement buffer")
+ /* Check if we have any chunks to write on this rank */
+ if (num_blocks > 0 || (leftover && leftover > mpi_rank)) {
+ /* Allocate buffers */
+ /* (MSC - should not need block_lens if MPI_type_create_hindexed_block is working) */
+ if (NULL == (block_lens = (int *)H5MM_malloc((size_t)(blocks + 1) * sizeof(int))))
+ HGOTO_ERROR(H5E_DATASET, H5E_CANTALLOC, FAIL, "couldn't allocate chunk lengths buffer")
+ if (NULL == (chunk_disp_array = (MPI_Aint *)H5MM_malloc((size_t)(blocks + 1) * sizeof(MPI_Aint))))
+ HGOTO_ERROR(H5E_DATASET, H5E_CANTALLOC, FAIL, "couldn't allocate chunk file displacement buffer")
- for (i = 0; i < blocks; i++) {
- /* store the chunk address as an MPI_Aint */
- chunk_disp_array[i] = (MPI_Aint)(chunk_info->addr[i + mpi_rank * blocks]);
+ for (i = 0; i < blocks; i++) {
+ /* store the chunk address as an MPI_Aint */
+ chunk_disp_array[i] = (MPI_Aint)(chunk_info->addr[i + (mpi_rank * blocks)]);
- /* MSC - should not need this if MPI_type_create_hindexed_block is working */
- block_lens[i] = block_len;
+ /* MSC - should not need this if MPI_type_create_hindexed_block is working */
+ block_lens[i] = block_len;
- /* make sure that the addresses in the datatype are
- monotonically non decreasing */
- if (i && (chunk_disp_array[i] < chunk_disp_array[i - 1]))
- need_addr_sort = TRUE;
- } /* end for */
+ /* Make sure that the addresses in the datatype are
+ * monotonically non-decreasing
+ */
+ if (i && (chunk_disp_array[i] < chunk_disp_array[i - 1]))
+ need_addr_sort = TRUE;
+ } /* end for */
- /* calculate if there are any leftover blocks after evenly
- distributing. If there are, then round robin the distribution
- to processes 0 -> leftover. */
- if (leftover && leftover > mpi_rank) {
- chunk_disp_array[blocks] = (MPI_Aint)chunk_info->addr[blocks * mpi_size + mpi_rank];
- if (blocks && (chunk_disp_array[blocks] < chunk_disp_array[blocks - 1]))
- need_addr_sort = TRUE;
- block_lens[blocks] = block_len;
- blocks++;
- }
+ /* Calculate if there are any leftover blocks after evenly
+ * distributing. If there are, then round-robin the distribution
+ * to processes 0 -> leftover.
+ */
+ if (leftover && leftover > mpi_rank) {
+ chunk_disp_array[blocks] = (MPI_Aint)chunk_info->addr[(blocks * mpi_size) + mpi_rank];
+ if (blocks && (chunk_disp_array[blocks] < chunk_disp_array[blocks - 1]))
+ need_addr_sort = TRUE;
+ block_lens[blocks] = block_len;
+ blocks++;
+ }
- /*
- * Ensure that the blocks are sorted in monotonically non-decreasing
- * order of offset in the file.
- */
- if (need_addr_sort)
- HDqsort(chunk_disp_array, blocks, sizeof(MPI_Aint), H5D__chunk_cmp_addr);
+ /* Ensure that the blocks are sorted in monotonically non-decreasing
+ * order of offset in the file.
+ */
+ if (need_addr_sort)
+ HDqsort(chunk_disp_array, blocks, sizeof(MPI_Aint), H5D__chunk_cmp_addr);
- /* MSC - should use this if MPI_type_create_hindexed block is working:
- * mpi_code = MPI_Type_create_hindexed_block(blocks, block_len, chunk_disp_array, MPI_BYTE, &file_type);
- */
- mpi_code = MPI_Type_create_hindexed(blocks, block_lens, chunk_disp_array, MPI_BYTE, &file_type);
- if (mpi_code != MPI_SUCCESS)
- HMPI_GOTO_ERROR(FAIL, "MPI_Type_create_hindexed failed", mpi_code)
- if (MPI_SUCCESS != (mpi_code = MPI_Type_commit(&file_type)))
- HMPI_GOTO_ERROR(FAIL, "MPI_Type_commit failed", mpi_code)
-
- mpi_code = MPI_Type_create_hvector(blocks, block_len, 0, MPI_BYTE, &mem_type);
- if (mpi_code != MPI_SUCCESS)
- HMPI_GOTO_ERROR(FAIL, "MPI_Type_create_hvector failed", mpi_code)
- if (MPI_SUCCESS != (mpi_code = MPI_Type_commit(&mem_type)))
- HMPI_GOTO_ERROR(FAIL, "MPI_Type_commit failed", mpi_code)
+ /* MSC - should use this if MPI_type_create_hindexed block is working:
+ * mpi_code = MPI_Type_create_hindexed_block(blocks, block_len, chunk_disp_array, MPI_BYTE,
+ * &file_type);
+ */
+ mpi_code = MPI_Type_create_hindexed(blocks, block_lens, chunk_disp_array, MPI_BYTE, &file_type);
+ if (mpi_code != MPI_SUCCESS)
+ HMPI_GOTO_ERROR(FAIL, "MPI_Type_create_hindexed failed", mpi_code)
+ if (MPI_SUCCESS != (mpi_code = MPI_Type_commit(&file_type)))
+ HMPI_GOTO_ERROR(FAIL, "MPI_Type_commit failed", mpi_code)
+
+ mpi_code = MPI_Type_create_hvector(blocks, block_len, 0, MPI_BYTE, &mem_type);
+ if (mpi_code != MPI_SUCCESS)
+ HMPI_GOTO_ERROR(FAIL, "MPI_Type_create_hvector failed", mpi_code)
+ if (MPI_SUCCESS != (mpi_code = MPI_Type_commit(&mem_type)))
+ HMPI_GOTO_ERROR(FAIL, "MPI_Type_commit failed", mpi_code)
+ } /* end if */
/* Set MPI-IO VFD properties */
@@ -5074,10 +5077,12 @@ done:
HDONE_ERROR(H5E_DATASET, H5E_CANTSET, FAIL, "can't set transfer mode")
/* free things */
- if (MPI_SUCCESS != (mpi_code = MPI_Type_free(&file_type)))
- HMPI_DONE_ERROR(FAIL, "MPI_Type_free failed", mpi_code)
- if (MPI_SUCCESS != (mpi_code = MPI_Type_free(&mem_type)))
- HMPI_DONE_ERROR(FAIL, "MPI_Type_free failed", mpi_code)
+ if (MPI_BYTE != file_type)
+ if (MPI_SUCCESS != (mpi_code = MPI_Type_free(&file_type)))
+ HMPI_DONE_ERROR(FAIL, "MPI_Type_free failed", mpi_code)
+ if (MPI_BYTE != mem_type)
+ if (MPI_SUCCESS != (mpi_code = MPI_Type_free(&mem_type)))
+ HMPI_DONE_ERROR(FAIL, "MPI_Type_free failed", mpi_code)
H5MM_xfree(chunk_disp_array);
H5MM_xfree(block_lens);
@@ -5122,8 +5127,8 @@ H5D__chunk_cmp_addr(const void *addr1, const void *addr2)
*
* Return: Non-negative on success/Negative on failure
*
- * Programmer: Pedro Vicente, pvn@ncsa.uiuc.edu
- * March 26, 2002
+ * Programmer: Pedro Vicente
+ * March 26, 2002
*
*-------------------------------------------------------------------------
*/
@@ -5244,7 +5249,7 @@ done:
*
* Return: Non-negative on success/Negative on failure
*
- * Programmer: Pedro Vicente, pvn@ncsa.uiuc.edu
+ * Programmer: Pedro Vicente
* Algorithm: Robb Matzke
* March 27, 2002
*
@@ -6338,10 +6343,10 @@ H5D__chunk_copy(H5F_t *f_src, H5O_storage_chunk_t *storage_src, H5O_layout_chunk
if (NULL == (buf_space = H5S_create_simple((unsigned)1, &buf_dim, NULL)))
HGOTO_ERROR(H5E_DATASPACE, H5E_CANTCREATE, FAIL, "can't create simple dataspace")
- /* Atomize */
+ /* Register */
if ((sid_buf = H5I_register(H5I_DATASPACE, buf_space, FALSE)) < 0) {
(void)H5S_close(buf_space);
- HGOTO_ERROR(H5E_ATOM, H5E_CANTREGISTER, FAIL, "unable to register dataspace ID")
+ HGOTO_ERROR(H5E_ID, H5E_CANTREGISTER, FAIL, "unable to register dataspace ID")
} /* end if */
/* Set initial buffer sizes */
@@ -6576,10 +6581,11 @@ H5D__chunk_dump_index_cb(const H5D_chunk_rec_t *chunk_rec, void *_udata)
} /* end if */
/* Print information about this chunk */
- HDfprintf(udata->stream, " 0x%08x %8Zu %10a [", chunk_rec->filter_mask, chunk_rec->nbytes,
- chunk_rec->chunk_addr);
+ HDfprintf(udata->stream, " 0x%08x %8" PRIu32 " %10" PRIuHADDR " [", chunk_rec->filter_mask,
+ chunk_rec->nbytes, chunk_rec->chunk_addr);
for (u = 0; u < udata->ndims; u++)
- HDfprintf(udata->stream, "%s%Hu", (u ? ", " : ""), (chunk_rec->scaled[u] * udata->chunk_dim[u]));
+ HDfprintf(udata->stream, "%s%" PRIuHSIZE, (u ? ", " : ""),
+ (chunk_rec->scaled[u] * udata->chunk_dim[u]));
HDfputs("]\n", udata->stream);
} /* end if */
diff --git a/src/H5Dcompact.c b/src/H5Dcompact.c
index 7d11b61..fe41298 100644
--- a/src/H5Dcompact.c
+++ b/src/H5Dcompact.c
@@ -12,7 +12,7 @@
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
/*
- * Programmer: Raymond Lu <slu@ncsa.uiuc.edu>
+ * Programmer: Raymond Lu
* August 5, 2002
*
* Purpose: Compact dataset I/O functions. These routines are similar
@@ -493,10 +493,10 @@ H5D__compact_copy(H5F_t *f_src, H5O_storage_compact_t *_storage_src, H5F_t *f_ds
if (NULL == (buf_space = H5S_create_simple((unsigned)1, &buf_dim, NULL)))
HGOTO_ERROR(H5E_DATASPACE, H5E_CANTCREATE, FAIL, "can't create simple dataspace")
- /* Atomize */
+ /* Register */
if ((buf_sid = H5I_register(H5I_DATASPACE, buf_space, FALSE)) < 0) {
H5S_close(buf_space);
- HGOTO_ERROR(H5E_ATOM, H5E_CANTREGISTER, FAIL, "unable to register dataspace ID")
+ HGOTO_ERROR(H5E_ID, H5E_CANTREGISTER, FAIL, "unable to register dataspace ID")
} /* end if */
/* Allocate memory for recclaim buf */
diff --git a/src/H5Dcontig.c b/src/H5Dcontig.c
index ed4ac93..4dc6f72 100644
--- a/src/H5Dcontig.c
+++ b/src/H5Dcontig.c
@@ -12,7 +12,7 @@
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
/*
- * Programmer: Quincey Koziol <koziol@ncsa.uiuc.edu>
+ * Programmer: Quincey Koziol
* Thursday, September 28, 2000
*
* Purpose:
@@ -1414,10 +1414,10 @@ H5D__contig_copy(H5F_t *f_src, const H5O_storage_contig_t *storage_src, H5F_t *f
if (NULL == (buf_space = H5S_create_simple((unsigned)1, buf_dim, NULL)))
HGOTO_ERROR(H5E_DATASPACE, H5E_CANTCREATE, FAIL, "can't create simple dataspace")
- /* Atomize */
+ /* Register */
if ((buf_sid = H5I_register(H5I_DATASPACE, buf_space, FALSE)) < 0) {
H5S_close(buf_space);
- HGOTO_ERROR(H5E_ATOM, H5E_CANTREGISTER, FAIL, "unable to register dataspace ID")
+ HGOTO_ERROR(H5E_ID, H5E_CANTREGISTER, FAIL, "unable to register dataspace ID")
} /* end if */
/* Set flag to do type conversion */
diff --git a/src/H5Ddbg.c b/src/H5Ddbg.c
index 68af09d..d39d357 100644
--- a/src/H5Ddbg.c
+++ b/src/H5Ddbg.c
@@ -78,7 +78,8 @@ H5Ddebug(hid_t dset_id)
if (H5D_CHUNKED == dset->shared->layout.type)
(void)H5D__chunk_dump_index(dset, stdout);
else if (H5D_CONTIGUOUS == dset->shared->layout.type)
- HDfprintf(stdout, " %-10s %a\n", "Address:", dset->shared->layout.storage.u.contig.addr);
+ HDfprintf(stdout, " %-10s %" PRIuHADDR "\n",
+ "Address:", dset->shared->layout.storage.u.contig.addr);
done:
FUNC_LEAVE_API(ret_value)
diff --git a/src/H5Ddeprec.c b/src/H5Ddeprec.c
index 40104be..1c66f26 100644
--- a/src/H5Ddeprec.c
+++ b/src/H5Ddeprec.c
@@ -15,7 +15,7 @@
*
* Created: H5Ddeprec.c
* April 5 2007
- * Quincey Koziol <koziol@hdfgroup.org>
+ * Quincey Koziol
*
* Purpose: Deprecated functions from the H5D interface. These
* functions are here for compatibility purposes and may be
@@ -137,13 +137,13 @@ H5Dcreate1(hid_t loc_id, const char *name, hid_t type_id, hid_t space_id, hid_t
if (NULL == (vol_obj = H5VL_vol_object(loc_id)))
HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, H5I_INVALID_HID, "invalid location identifier")
- /* Create the dataset through the VOL */
+ /* Create the dataset */
if (NULL == (dset = H5VL_dataset_create(vol_obj, &loc_params, name, H5P_LINK_CREATE_DEFAULT, type_id,
space_id, dcpl_id, H5P_DATASET_ACCESS_DEFAULT,
H5P_DATASET_XFER_DEFAULT, H5_REQUEST_NULL)))
HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, H5I_INVALID_HID, "unable to create dataset")
- /* Get an atom for the dataset */
+ /* Register the new dataset to get an ID for it */
if ((ret_value = H5VL_register(H5I_DATASET, dset, vol_obj->connector, TRUE)) < 0)
HGOTO_ERROR(H5E_DATASET, H5E_CANTREGISTER, H5I_INVALID_HID, "unable to register dataset")
@@ -202,9 +202,9 @@ H5Dopen1(hid_t loc_id, const char *name)
H5P_DATASET_XFER_DEFAULT, H5_REQUEST_NULL)))
HGOTO_ERROR(H5E_DATASET, H5E_CANTOPENOBJ, H5I_INVALID_HID, "unable to open dataset")
- /* Get an atom for the dataset */
+ /* Get an ID for the dataset */
if ((ret_value = H5VL_register(H5I_DATASET, dset, vol_obj->connector, TRUE)) < 0)
- HGOTO_ERROR(H5E_DATASET, H5E_CANTREGISTER, H5I_INVALID_HID, "can't register dataset atom")
+ HGOTO_ERROR(H5E_DATASET, H5E_CANTREGISTER, H5I_INVALID_HID, "can't register dataset ID")
done:
if (H5I_INVALID_HID == ret_value)
diff --git a/src/H5Dearray.c b/src/H5Dearray.c
index 64b1e20..db77a4c 100644
--- a/src/H5Dearray.c
+++ b/src/H5Dearray.c
@@ -418,8 +418,8 @@ H5D__earray_debug(FILE *stream, int indent, int fwidth, hsize_t idx, const void
HDassert(elmt);
/* Print element */
- HDsprintf(temp_str, "Element #%llu:", (unsigned long long)idx);
- HDfprintf(stream, "%*s%-*s %a\n", indent, "", fwidth, temp_str, *(const haddr_t *)elmt);
+ HDsprintf(temp_str, "Element #%" PRIuHSIZE ":", idx);
+ HDfprintf(stream, "%*s%-*s %" PRIuHADDR "\n", indent, "", fwidth, temp_str, *(const haddr_t *)elmt);
FUNC_LEAVE_NOAPI(SUCCEED)
} /* end H5D__earray_debug() */
@@ -574,9 +574,9 @@ H5D__earray_filt_debug(FILE *stream, int indent, int fwidth, hsize_t idx, const
HDassert(elmt);
/* Print element */
- HDsprintf(temp_str, "Element #%llu:", (unsigned long long)idx);
- HDfprintf(stream, "%*s%-*s {%a, %u, %0x}\n", indent, "", fwidth, temp_str, elmt->addr, elmt->nbytes,
- elmt->filter_mask);
+ HDsprintf(temp_str, "Element #%" PRIuHSIZE ":", idx);
+ HDfprintf(stream, "%*s%-*s {%" PRIuHADDR ", %u, %0x}\n", indent, "", fwidth, temp_str, elmt->addr,
+ elmt->nbytes, elmt->filter_mask);
FUNC_LEAVE_NOAPI(SUCCEED)
} /* end H5D__earray_filt_debug() */
@@ -1743,7 +1743,7 @@ H5D__earray_idx_dump(const H5O_storage_chunk_t *storage, FILE *stream)
HDassert(storage);
HDassert(stream);
- HDfprintf(stream, " Address: %a\n", storage->idx_addr);
+ HDfprintf(stream, " Address: %" PRIuHADDR "\n", storage->idx_addr);
FUNC_LEAVE_NOAPI(SUCCEED)
} /* end H5D__earray_idx_dump() */
diff --git a/src/H5Defl.c b/src/H5Defl.c
index 2ad09ba..85c9dba 100644
--- a/src/H5Defl.c
+++ b/src/H5Defl.c
@@ -12,7 +12,7 @@
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
/*
- * Programmer: Quincey Koziol <koziol@ncsa.uiuc.edu>
+ * Programmer: Quincey Koziol
* Thursday, September 30, 2004
*/
@@ -310,9 +310,6 @@ done:
* Programmer: Robb Matzke
* Wednesday, March 4, 1998
*
- * Modifications:
- * Robb Matzke, 1999-07-28
- * The ADDR argument is passed by value.
*-------------------------------------------------------------------------
*/
static herr_t
diff --git a/src/H5Dfarray.c b/src/H5Dfarray.c
index d9f80a6..8293ec4 100644
--- a/src/H5Dfarray.c
+++ b/src/H5Dfarray.c
@@ -416,8 +416,8 @@ H5D__farray_debug(FILE *stream, int indent, int fwidth, hsize_t idx, const void
HDassert(elmt);
/* Print element */
- HDsprintf(temp_str, "Element #%llu:", (unsigned long long)idx);
- HDfprintf(stream, "%*s%-*s %a\n", indent, "", fwidth, temp_str, *(const haddr_t *)elmt);
+ HDsprintf(temp_str, "Element #%" PRIuHSIZE ":", idx);
+ HDfprintf(stream, "%*s%-*s %" PRIuHADDR "\n", indent, "", fwidth, temp_str, *(const haddr_t *)elmt);
FUNC_LEAVE_NOAPI(SUCCEED)
} /* end H5D__farray_debug() */
@@ -676,9 +676,9 @@ H5D__farray_filt_debug(FILE *stream, int indent, int fwidth, hsize_t idx, const
HDassert(elmt);
/* Print element */
- HDsprintf(temp_str, "Element #%llu:", (unsigned long long)idx);
- HDfprintf(stream, "%*s%-*s {%a, %u, %0x}\n", indent, "", fwidth, temp_str, elmt->addr, elmt->nbytes,
- elmt->filter_mask);
+ HDsprintf(temp_str, "Element #%" PRIuHSIZE ":", idx);
+ HDfprintf(stream, "%*s%-*s {%" PRIuHADDR ", %u, %0x}\n", indent, "", fwidth, temp_str, elmt->addr,
+ elmt->nbytes, elmt->filter_mask);
FUNC_LEAVE_NOAPI(SUCCEED)
} /* end H5D__farray_filt_debug() */
@@ -1592,7 +1592,7 @@ H5D__farray_idx_dump(const H5O_storage_chunk_t *storage, FILE *stream)
HDassert(storage);
HDassert(stream);
- HDfprintf(stream, " Address: %a\n", storage->idx_addr);
+ HDfprintf(stream, " Address: %" PRIuHADDR "\n", storage->idx_addr);
FUNC_LEAVE_NOAPI(SUCCEED)
} /* end H5D__farray_idx_dump() */
diff --git a/src/H5Dfill.c b/src/H5Dfill.c
index 9588446..fe98487 100644
--- a/src/H5Dfill.c
+++ b/src/H5Dfill.c
@@ -15,7 +15,7 @@
*
* Created: H5Dfill.c
* Jun 19 2007
- * Quincey Koziol <koziol@hdfgroup.org>
+ * Quincey Koziol
*
* Purpose: Fill value operations for datasets
*
@@ -85,58 +85,6 @@ H5FL_EXTERN(H5S_sel_iter_t);
/*--------------------------------------------------------------------------
NAME
- H5Dfill
- PURPOSE
- Fill a selection in memory with a value
- USAGE
- herr_t H5Dfill(fill, fill_type, space, buf, buf_type)
- const void *fill; IN: Pointer to fill value to use
- hid_t fill_type_id; IN: Datatype of the fill value
- void *buf; IN/OUT: Memory buffer to fill selection within
- hid_t buf_type_id; IN: Datatype of the elements in buffer
- hid_t space_id; IN: Dataspace describing memory buffer &
- containing selection to use.
- RETURNS
- Non-negative on success/Negative on failure.
- DESCRIPTION
- Use the selection in the dataspace to fill elements in a memory buffer.
- GLOBAL VARIABLES
- COMMENTS, BUGS, ASSUMPTIONS
- If "fill" parameter is NULL, use all zeros as fill value
- EXAMPLES
- REVISION LOG
---------------------------------------------------------------------------*/
-herr_t
-H5Dfill(const void *fill, hid_t fill_type_id, void *buf, hid_t buf_type_id, hid_t space_id)
-{
- H5S_t *space; /* Dataspace */
- H5T_t *fill_type; /* Fill-value datatype */
- H5T_t *buf_type; /* Buffer datatype */
- herr_t ret_value = SUCCEED; /* Return value */
-
- FUNC_ENTER_API(FAIL)
- H5TRACE5("e", "*xi*xii", fill, fill_type_id, buf, buf_type_id, space_id);
-
- /* Check args */
- if (buf == NULL)
- HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "invalid buffer")
- if (NULL == (space = (H5S_t *)H5I_object_verify(space_id, H5I_DATASPACE)))
- HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, 0, "not a dataspace")
- if (NULL == (fill_type = (H5T_t *)H5I_object_verify(fill_type_id, H5I_DATATYPE)))
- HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, 0, "not a datatype")
- if (NULL == (buf_type = (H5T_t *)H5I_object_verify(buf_type_id, H5I_DATATYPE)))
- HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, 0, "not a datatype")
-
- /* Fill the selection in the memory buffer */
- if (H5D__fill(fill, fill_type, buf, buf_type, space) < 0)
- HGOTO_ERROR(H5E_DATASET, H5E_CANTENCODE, FAIL, "filling selection failed")
-
-done:
- FUNC_LEAVE_API(ret_value)
-} /* H5Dfill() */
-
-/*--------------------------------------------------------------------------
- NAME
H5D__fill
PURPOSE
Fill a selection in memory with a value (internal version)
@@ -642,7 +590,7 @@ done:
static herr_t
H5D__fill_release(H5D_fill_buf_info_t *fb_info)
{
- FUNC_ENTER_PACKAGE_NOERR
+ FUNC_ENTER_STATIC_NOERR
/* Check args */
HDassert(fb_info);
diff --git a/src/H5Dint.c b/src/H5Dint.c
index 781e36d..d0c1ba2 100644
--- a/src/H5Dint.c
+++ b/src/H5Dint.c
@@ -92,6 +92,7 @@ static herr_t H5D__vlen_get_buf_size_cb(void *elem, hid_t type_id, unsigned ndim
void *op_data);
static herr_t H5D__vlen_get_buf_size_gen_cb(void *elem, hid_t type_id, unsigned ndim, const hsize_t *point,
void *op_data);
+static herr_t H5D__check_filters(H5D_t *dataset);
/*********************/
/* Package Variables */
@@ -191,7 +192,7 @@ H5D__init_package(void)
FUNC_ENTER_PACKAGE
- /* Initialize the atom group for the dataset IDs */
+ /* Initialize the ID group for the dataset IDs */
if (H5I_register_type(H5I_DATASET_CLS) < 0)
HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "unable to initialize interface")
@@ -343,11 +344,6 @@ H5D__close_cb(H5VL_object_t *dset_vol_obj)
HGOTO_ERROR(H5E_DATASET, H5E_CLOSEERROR, FAIL, "unable to close dataset");
done:
- /* XXX: (MSC) Weird thing for datasets and filters:
- * Always decrement the ref count on the VOL for datasets, since
- * the ID is removed even if the close fails.
- */
-
/* Free the VOL object */
if (H5VL_free_object(dset_vol_obj) < 0)
HGOTO_ERROR(H5E_DATASET, H5E_CANTDEC, FAIL, "unable to free VOL object");
@@ -1004,7 +1000,7 @@ H5D__update_oh_info(H5F_t *file, H5D_t *dset, hid_t dapl_id)
if (TRUE == use_minimized_header) {
if (H5D__prepare_minimized_oh(file, dset, oloc) == FAIL)
HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "can't create minimized dataset object header")
- }
+ } /* end if */
else {
/* Add the dataset's raw data size to the size of the header, if the
* raw data will be stored as compact
@@ -1276,18 +1272,24 @@ H5D__create(H5F_t *file, hid_t type_id, const H5S_t *space, hid_t dcpl_id, hid_t
/* Check if the dataset has a non-default DCPL & get important values, if so */
if (new_dset->shared->dcpl_id != H5P_DATASET_CREATE_DEFAULT) {
- H5O_layout_t *layout; /* Dataset's layout information */
- H5O_pline_t * pline; /* Dataset's I/O pipeline information */
- H5O_fill_t * fill; /* Dataset's fill value info */
- H5O_efl_t * efl; /* Dataset's external file list info */
+ H5O_layout_t *layout; /* Dataset's layout information */
+ H5O_pline_t * pline; /* Dataset's I/O pipeline information */
+ H5O_fill_t * fill; /* Dataset's fill value info */
+ H5O_efl_t * efl; /* Dataset's external file list info */
+ htri_t ignore_filters = FALSE; /* Ignore optional filters or not */
+
+ if ((ignore_filters = H5Z_ignore_filters(new_dset->shared->dcpl_id, dt, space)) < 0)
+ HGOTO_ERROR(H5E_ARGS, H5E_CANTINIT, NULL, "H5Z_has_optional_filter() failed")
- /* Check if the filters in the DCPL can be applied to this dataset */
- if (H5Z_can_apply(new_dset->shared->dcpl_id, new_dset->shared->type_id) < 0)
- HGOTO_ERROR(H5E_ARGS, H5E_CANTINIT, NULL, "I/O filters can't operate on this dataset")
+ if (FALSE == ignore_filters) {
+ /* Check if the filters in the DCPL can be applied to this dataset */
+ if (H5Z_can_apply(new_dset->shared->dcpl_id, new_dset->shared->type_id) < 0)
+ HGOTO_ERROR(H5E_ARGS, H5E_CANTINIT, NULL, "I/O filters can't operate on this dataset")
- /* Make the "set local" filter callbacks for this dataset */
- if (H5Z_set_local(new_dset->shared->dcpl_id, new_dset->shared->type_id) < 0)
- HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, NULL, "unable to set local filter parameters")
+ /* Make the "set local" filter callbacks for this dataset */
+ if (H5Z_set_local(new_dset->shared->dcpl_id, new_dset->shared->type_id) < 0)
+ HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, NULL, "unable to set local filter parameters")
+ } /* ignore_filters */
/* Get new dataset's property list object */
if (NULL == (dc_plist = (H5P_genplist_t *)H5I_object(new_dset->shared->dcpl_id)))
@@ -1311,9 +1313,11 @@ H5D__create(H5F_t *file, hid_t type_id, const H5S_t *space, hid_t dcpl_id, hid_t
HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, NULL, "can't retrieve external file list")
efl_copied = TRUE;
- /* Check that chunked layout is used if filters are enabled */
- if (pline->nused > 0 && H5D_CHUNKED != layout->type)
- HGOTO_ERROR(H5E_DATASET, H5E_BADVALUE, NULL, "filters can only be used with chunked layout")
+ if (FALSE == ignore_filters) {
+ /* Check that chunked layout is used if filters are enabled */
+ if (pline->nused > 0 && H5D_CHUNKED != layout->type)
+ HGOTO_ERROR(H5E_DATASET, H5E_BADVALUE, NULL, "filters can only be used with chunked layout")
+ }
/* Check if the alloc_time is the default and error out */
if (fill->alloc_time == H5D_ALLOC_TIME_DEFAULT)
@@ -1668,7 +1672,7 @@ H5D__append_flush_setup(H5D_t *dset, hid_t dapl_id)
/* Get dataset access property list */
if (NULL == (dapl = (H5P_genplist_t *)H5I_object(dapl_id)))
- HGOTO_ERROR(H5E_ATOM, H5E_BADATOM, FAIL, "can't find object for dapl ID");
+ HGOTO_ERROR(H5E_ID, H5E_BADID, FAIL, "can't find object for dapl ID");
/* Check if append flush property exists */
if (H5P_exist_plist(dapl, H5D_ACS_APPEND_FLUSH_NAME) > 0) {
@@ -2952,13 +2956,13 @@ done:
* Return: Non-negative on success/Negative on failure
*-------------------------------------------------------------------------
*/
-herr_t
+static herr_t
H5D__check_filters(H5D_t *dataset)
{
H5O_fill_t *fill; /* Dataset's fill value */
herr_t ret_value = SUCCEED; /* Return value */
- FUNC_ENTER_PACKAGE
+ FUNC_ENTER_STATIC
/* Check args */
HDassert(dataset);
@@ -3863,9 +3867,9 @@ H5D__get_space(const H5D_t *dset)
if (NULL == (space = H5S_copy(dset->shared->space, FALSE, TRUE)))
HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "unable to get dataspace")
- /* Create an atom */
+ /* Create an ID */
if ((ret_value = H5I_register(H5I_DATASPACE, space, TRUE)) < 0)
- HGOTO_ERROR(H5E_ATOM, H5E_CANTREGISTER, FAIL, "unable to register dataspace")
+ HGOTO_ERROR(H5E_ID, H5E_CANTREGISTER, FAIL, "unable to register dataspace")
done:
if (ret_value < 0)
@@ -3910,17 +3914,17 @@ H5D__get_type(const H5D_t *dset)
if (H5T_lock(dt, FALSE) < 0)
HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "unable to lock transient datatype")
- /* Create an atom */
+ /* Create an ID */
if (H5T_is_named(dt)) {
/* If this is a committed datatype, we need to recreate the
* two-level IDs, where the VOL object is a copy of the
* returned datatype.
*/
if ((ret_value = H5VL_wrap_register(H5I_DATATYPE, dt, TRUE)) < 0)
- HGOTO_ERROR(H5E_ATOM, H5E_CANTREGISTER, FAIL, "unable to register datatype")
+ HGOTO_ERROR(H5E_ID, H5E_CANTREGISTER, FAIL, "unable to register datatype")
} /* end if */
else if ((ret_value = H5I_register(H5I_DATATYPE, dt, TRUE)) < 0)
- HGOTO_ERROR(H5E_ATOM, H5E_CANTREGISTER, FAIL, "unable to register datatype")
+ HGOTO_ERROR(H5E_ID, H5E_CANTREGISTER, FAIL, "unable to register datatype")
done:
if (ret_value < 0)
diff --git a/src/H5Dio.c b/src/H5Dio.c
index 75727a9..e28da8c 100644
--- a/src/H5Dio.c
+++ b/src/H5Dio.c
@@ -926,7 +926,7 @@ H5D__typeinfo_init(const H5D_t *dset, hid_t mem_type_id, hbool_t do_write, H5D_t
/* Locate the type conversion function and dataspace conversion
* functions, and set up the element numbering information. If a data
- * type conversion is necessary then register datatype atoms. Data type
+ * type conversion is necessary then register datatype IDs. Data type
* conversion is necessary if the user has set the `need_bkg' to a high
* enough value in xfer_parms since turning off datatype conversion also
* turns off background preservation.
diff --git a/src/H5Dmodule.h b/src/H5Dmodule.h
index 292b624..595c714 100644
--- a/src/H5Dmodule.h
+++ b/src/H5Dmodule.h
@@ -29,15 +29,37 @@
#define H5_MY_PKG_ERR H5E_DATASET
#define H5_MY_PKG_INIT YES
-/**
- * \defgroup H5D H5D
- * \brief Group Interface
- * \details The HDF5 Dataset Interface, H5D, provides a mechanism for managing
- * HDF5 datasets, including the transfer of data between memory and
- * disk and the description of dataset properties.
+/**\defgroup H5D H5D
+ *
+ * Use the functions in this module to manage HDF5 datasets, including the
+ * transfer of data between memory and disk and the description of dataset
+ * properties. Datasets are used by other HDF5 APIs and referenced either by
+ * name or by a handle. Such handles can be obtained by either creating or
+ * opening the dataset.
+ *
+ * Typical stages in the HDF5 dataset life cycle are shown below in introductory
+ * examples.
+ *
+ * <table>
+ * <tr><th>Create</th><th>Read</th></tr>
+ * <tr valign="top">
+ * <td>
+ * \snippet H5D_examples.c create
+ * </td>
+ * <td>
+ * \snippet H5D_examples.c read
+ * </td>
+ * <tr><th>Update</th><th>Delete</th></tr>
+ * <tr valign="top">
+ * <td>
+ * \snippet H5D_examples.c update
+ * </td>
+ * <td>
+ * \snippet H5D_examples.c delete
+ * </td>
+ * </tr>
+ * </table>
*
- * A Dataset is used by other HDF5 APIs, either by name or by a handle,
- * which is obtained by either creating or opening the dataset.
*/
#endif /* H5Dmodule_H */
diff --git a/src/H5Dmpio.c b/src/H5Dmpio.c
index 16a8221..448e92d 100644
--- a/src/H5Dmpio.c
+++ b/src/H5Dmpio.c
@@ -413,7 +413,7 @@ H5D__mpio_opt_possible(const H5D_io_info_t *io_info, const H5S_t *file_space, co
* collective I/O
*/
if (MPI_SUCCESS !=
- (mpi_code = MPI_Allreduce(&local_cause, &global_cause, 2, MPI_UNSIGNED, MPI_BOR, io_info->comm)))
+ (mpi_code = MPI_Allreduce(local_cause, global_cause, 2, MPI_UNSIGNED, MPI_BOR, io_info->comm)))
HMPI_GOTO_ERROR(FAIL, "MPI_Allreduce failed", mpi_code)
} /* end else */
@@ -1094,7 +1094,7 @@ H5D__link_chunk_collective_io(H5D_io_info_t *io_info, const H5D_type_info_t *typ
#ifdef H5D_DEBUG
if (H5DEBUG(D))
- HDfprintf(H5DEBUG(D), "total_chunks = %Zu, num_chunk = %Zu\n", total_chunks, num_chunk);
+ HDfprintf(H5DEBUG(D), "total_chunks = %zu, num_chunk = %zu\n", total_chunks, num_chunk);
#endif
/* Set up MPI datatype for chunks selected */
@@ -1574,7 +1574,7 @@ H5D__multi_chunk_collective_io(H5D_io_info_t *io_info, const H5D_type_info_t *ty
chunk_addr = (haddr_t *)H5MM_calloc(total_chunk * sizeof(haddr_t));
#ifdef H5D_DEBUG
if (H5DEBUG(D))
- HDfprintf(H5DEBUG(D), "total_chunk %Zu\n", total_chunk);
+ HDfprintf(H5DEBUG(D), "total_chunk %zu\n", total_chunk);
#endif
/* Obtain IO option for each chunk */
@@ -1608,7 +1608,7 @@ H5D__multi_chunk_collective_io(H5D_io_info_t *io_info, const H5D_type_info_t *ty
#ifdef H5D_DEBUG
if (H5DEBUG(D))
- HDfprintf(H5DEBUG(D), "mpi_rank = %d, chunk index = %Zu\n", mpi_rank, u);
+ HDfprintf(H5DEBUG(D), "mpi_rank = %d, chunk index = %zu\n", mpi_rank, u);
#endif
/* Get the chunk info for this chunk, if there are elements selected */
chunk_info = fm->select_chunk[u];
@@ -1628,7 +1628,7 @@ H5D__multi_chunk_collective_io(H5D_io_info_t *io_info, const H5D_type_info_t *ty
if (chunk_io_option[u] == H5D_CHUNK_IO_MODE_COL) {
#ifdef H5D_DEBUG
if (H5DEBUG(D))
- HDfprintf(H5DEBUG(D), "inside collective chunk IO mpi_rank = %d, chunk index = %Zu\n",
+ HDfprintf(H5DEBUG(D), "inside collective chunk IO mpi_rank = %d, chunk index = %zu\n",
mpi_rank, u);
#endif
@@ -1667,7 +1667,7 @@ H5D__multi_chunk_collective_io(H5D_io_info_t *io_info, const H5D_type_info_t *ty
else { /* possible independent IO for this chunk */
#ifdef H5D_DEBUG
if (H5DEBUG(D))
- HDfprintf(H5DEBUG(D), "inside independent IO mpi_rank = %d, chunk index = %Zu\n", mpi_rank,
+ HDfprintf(H5DEBUG(D), "inside independent IO mpi_rank = %d, chunk index = %zu\n", mpi_rank,
u);
#endif
@@ -2838,7 +2838,7 @@ H5D__chunk_redistribute_shared_chunks(const H5D_io_info_t *io_info, const H5D_ty
"unable to allocate number of assigned chunks array")
for (i = 0; i < shared_chunks_info_array_num_entries;) {
- H5D_filtered_collective_io_info_t chunk_entry;
+ H5D_filtered_collective_io_info_t *chunk_entry;
haddr_t last_seen_addr = shared_chunks_info_array[i].chunk_states.chunk_current.offset;
size_t set_begin_index = i;
size_t num_writers = 0;
@@ -2846,17 +2846,17 @@ H5D__chunk_redistribute_shared_chunks(const H5D_io_info_t *io_info, const H5D_ty
/* Process each set of duplicate entries caused by another process writing to the same chunk */
do {
- chunk_entry = shared_chunks_info_array[i];
+ chunk_entry = &shared_chunks_info_array[i];
- send_counts[chunk_entry.owners.original_owner] += (int)sizeof(chunk_entry);
+ send_counts[chunk_entry->owners.original_owner] += (int)sizeof(*chunk_entry);
/* The new owner of the chunk is determined by the process
* writing to the chunk which currently has the least amount
* of chunks assigned to it
*/
- if (num_assigned_chunks_array[chunk_entry.owners.original_owner] <
+ if (num_assigned_chunks_array[chunk_entry->owners.original_owner] <
num_assigned_chunks_array[new_chunk_owner])
- new_chunk_owner = chunk_entry.owners.original_owner;
+ new_chunk_owner = chunk_entry->owners.original_owner;
num_writers++;
} while (++i < shared_chunks_info_array_num_entries &&
@@ -2907,6 +2907,8 @@ H5D__chunk_redistribute_shared_chunks(const H5D_io_info_t *io_info, const H5D_ty
sizeof(unsigned char *))))
HGOTO_ERROR(H5E_DATASET, H5E_CANTALLOC, FAIL, "unable to allocate modification data buffer array")
+ /* Perform all the sends on the chunks that this rank doesn't own */
+ /* (Sends and recvs must be two separate loops, to avoid deadlock) */
for (i = 0, last_assigned_idx = 0; i < *local_chunk_array_num_entries; i++) {
H5D_filtered_collective_io_info_t *chunk_entry = &local_chunk_array[i];
@@ -2965,7 +2967,13 @@ H5D__chunk_redistribute_shared_chunks(const H5D_io_info_t *io_info, const H5D_ty
num_send_requests++;
} /* end if */
- else {
+ } /* end for */
+
+ /* Perform all the recvs on the chunks this rank owns */
+ for (i = 0, last_assigned_idx = 0; i < *local_chunk_array_num_entries; i++) {
+ H5D_filtered_collective_io_info_t *chunk_entry = &local_chunk_array[i];
+
+ if (mpi_rank == chunk_entry->owners.new_owner) {
/* Allocate all necessary buffers for an asynchronous receive operation */
if (chunk_entry->num_writers > 1) {
MPI_Message message;
diff --git a/src/H5Dnone.c b/src/H5Dnone.c
index 507741c..f724949 100644
--- a/src/H5Dnone.c
+++ b/src/H5Dnone.c
@@ -11,7 +11,7 @@
* help@hdfgroup.org. *
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
-/* Programmer: Vailin Choi <vchoi@hdfgroup.org>
+/* Programmer: Vailin Choi
* September 2010
*
* Purpose: Implicit (Non Index) chunked I/O functions.
@@ -471,7 +471,7 @@ H5D__none_idx_dump(const H5O_storage_chunk_t *storage, FILE *stream)
HDassert(storage);
HDassert(stream);
- HDfprintf(stream, " Address: %a\n", storage->idx_addr);
+ HDfprintf(stream, " Address: %" PRIuHADDR "\n", storage->idx_addr);
FUNC_LEAVE_NOAPI(SUCCEED)
} /* end H5D__none_idx_dump() */
diff --git a/src/H5Doh.c b/src/H5Doh.c
index f6245d5..a991831 100644
--- a/src/H5Doh.c
+++ b/src/H5Doh.c
@@ -328,7 +328,7 @@ H5O__dset_get_oloc(hid_t obj_id)
/* Get the dataset */
if (NULL == (dset = (H5D_t *)H5VL_object(obj_id)))
- HGOTO_ERROR(H5E_OHDR, H5E_BADATOM, NULL, "couldn't get object from ID")
+ HGOTO_ERROR(H5E_OHDR, H5E_BADID, NULL, "couldn't get object from ID")
/* Get the dataset's object header location */
if (NULL == (ret_value = H5D_oloc(dset)))
diff --git a/src/H5Dpkg.h b/src/H5Dpkg.h
index 0627aef..954b108 100644
--- a/src/H5Dpkg.h
+++ b/src/H5Dpkg.h
@@ -570,7 +570,6 @@ H5_DLL haddr_t H5D__get_offset(const H5D_t *dset);
H5_DLL herr_t H5D__vlen_get_buf_size(H5D_t *dset, hid_t type_id, hid_t space_id, hsize_t *size);
H5_DLL herr_t H5D__vlen_get_buf_size_gen(H5VL_object_t *vol_obj, hid_t type_id, hid_t space_id,
hsize_t *size);
-H5_DLL herr_t H5D__check_filters(H5D_t *dataset);
H5_DLL herr_t H5D__set_extent(H5D_t *dataset, const hsize_t *size);
H5_DLL herr_t H5D__flush_sieve_buf(H5D_t *dataset);
H5_DLL herr_t H5D__flush_real(H5D_t *dataset);
diff --git a/src/H5Dpublic.h b/src/H5Dpublic.h
index 3c1a2de..c52bef3 100644
--- a/src/H5Dpublic.h
+++ b/src/H5Dpublic.h
@@ -39,30 +39,41 @@
/* Public Typedefs */
/*******************/
-/* Values for the H5D_LAYOUT property */
+//! <!-- [H5D_layout_t_snip] -->
+/**
+ * Values for the H5D_LAYOUT property
+ */
typedef enum H5D_layout_t {
H5D_LAYOUT_ERROR = -1,
- H5D_COMPACT = 0, /*raw data is very small */
- H5D_CONTIGUOUS = 1, /*the default */
- H5D_CHUNKED = 2, /*slow and fancy */
- H5D_VIRTUAL = 3, /*actual data is stored in other datasets */
- H5D_NLAYOUTS = 4 /*this one must be last! */
+ H5D_COMPACT = 0, /**< raw data is very small */
+ H5D_CONTIGUOUS = 1, /**< the default */
+ H5D_CHUNKED = 2, /**< slow and fancy */
+ H5D_VIRTUAL = 3, /**< actual data is stored in other datasets */
+ H5D_NLAYOUTS = 4 /**< this one must be last! */
} H5D_layout_t;
+//! <!-- [H5D_layout_t_snip] -->
-/* Types of chunk index data structures */
+//! <!-- [H5D_chunk_index_t_snip] -->
+/**
+ * Types of chunk index data structures
+ */
typedef enum H5D_chunk_index_t {
- H5D_CHUNK_IDX_BTREE = 0, /* v1 B-tree index (default) */
+ H5D_CHUNK_IDX_BTREE = 0, /**< v1 B-tree index (default) */
H5D_CHUNK_IDX_SINGLE =
- 1, /* Single Chunk index (cur dims[]=max dims[]=chunk dims[]; filtered & non-filtered) */
- H5D_CHUNK_IDX_NONE = 2, /* Implicit: No Index (H5D_ALLOC_TIME_EARLY, non-filtered, fixed dims) */
- H5D_CHUNK_IDX_FARRAY = 3, /* Fixed array (for 0 unlimited dims) */
- H5D_CHUNK_IDX_EARRAY = 4, /* Extensible array (for 1 unlimited dim) */
- H5D_CHUNK_IDX_BT2 = 5, /* v2 B-tree index (for >1 unlimited dims) */
- H5D_CHUNK_IDX_NTYPES /* This one must be last! */
+ 1, /**< Single Chunk index (cur dims[]=max dims[]=chunk dims[]; filtered & non-filtered) */
+ H5D_CHUNK_IDX_NONE = 2, /**< Implicit: No Index (#H5D_ALLOC_TIME_EARLY, non-filtered, fixed dims) */
+ H5D_CHUNK_IDX_FARRAY = 3, /**< Fixed array (for 0 unlimited dims) */
+ H5D_CHUNK_IDX_EARRAY = 4, /**< Extensible array (for 1 unlimited dim) */
+ H5D_CHUNK_IDX_BT2 = 5, /**< v2 B-tree index (for >1 unlimited dims) */
+ H5D_CHUNK_IDX_NTYPES /**< This one must be last! */
} H5D_chunk_index_t;
+//! <!-- [H5D_chunk_index_t_snip] -->
-/* Values for the space allocation time property */
+//! <!-- [H5D_alloc_time_t_snip] -->
+/**
+ * Values for the space allocation time property
+ */
typedef enum H5D_alloc_time_t {
H5D_ALLOC_TIME_ERROR = -1,
H5D_ALLOC_TIME_DEFAULT = 0,
@@ -70,51 +81,84 @@ typedef enum H5D_alloc_time_t {
H5D_ALLOC_TIME_LATE = 2,
H5D_ALLOC_TIME_INCR = 3
} H5D_alloc_time_t;
+//! <!-- [H5D_alloc_time_t_snip] -->
-/* Values for the status of space allocation */
+//! <!-- [H5D_space_status_t_snip] -->
+/**
+ * Values for the status of space allocation
+ */
typedef enum H5D_space_status_t {
H5D_SPACE_STATUS_ERROR = -1,
H5D_SPACE_STATUS_NOT_ALLOCATED = 0,
H5D_SPACE_STATUS_PART_ALLOCATED = 1,
H5D_SPACE_STATUS_ALLOCATED = 2
} H5D_space_status_t;
+//! <!-- [H5D_space_status_t_snip] -->
-/* Values for time of writing fill value property */
+//! <!-- [H5D_fill_time_t_snip] -->
+/**
+ * Values for time of writing fill value property
+ */
typedef enum H5D_fill_time_t {
H5D_FILL_TIME_ERROR = -1,
H5D_FILL_TIME_ALLOC = 0,
H5D_FILL_TIME_NEVER = 1,
H5D_FILL_TIME_IFSET = 2
} H5D_fill_time_t;
+//! <!-- [H5D_fill_time_t_snip] -->
-/* Values for fill value status */
+//! <!-- [H5D_fill_value_t_snip] -->
+/**
+ * Values for fill value status
+ */
typedef enum H5D_fill_value_t {
H5D_FILL_VALUE_ERROR = -1,
H5D_FILL_VALUE_UNDEFINED = 0,
H5D_FILL_VALUE_DEFAULT = 1,
H5D_FILL_VALUE_USER_DEFINED = 2
} H5D_fill_value_t;
+//! <!-- [H5D_fill_value_t_snip] -->
-/* Values for VDS bounds option */
+//! <!-- [H5D_vds_view_t_snip] -->
+/**
+ * Values for VDS bounds option
+ */
typedef enum H5D_vds_view_t {
H5D_VDS_ERROR = -1,
H5D_VDS_FIRST_MISSING = 0,
H5D_VDS_LAST_AVAILABLE = 1
} H5D_vds_view_t;
+//! <!-- [H5D_vds_view_t_snip] -->
-/* Callback for H5Pset_append_flush() in a dataset access property list */
+//! <!-- [H5D_append_cb_t_snip] -->
+/**
+ * Callback for H5Pset_append_flush() in a dataset access property list
+ */
typedef herr_t (*H5D_append_cb_t)(hid_t dataset_id, hsize_t *cur_dims, void *op_data);
+//! <!-- [H5D_append_cb_t_snip] -->
-/* Define the operator function pointer for H5Diterate() */
+//! <!-- [H5D_operator_t_snip] -->
+/**
+ * Define the operator function pointer for H5Diterate()
+ */
typedef herr_t (*H5D_operator_t)(void *elem, hid_t type_id, unsigned ndim, const hsize_t *point,
void *operator_data);
+//! <!-- [H5D_operator_t_snip] -->
-/* Define the operator function pointer for H5Dscatter() */
+//! <!-- [H5D_scatter_func_t_snip] -->
+/**
+ * Define the operator function pointer for H5Dscatter()
+ */
typedef herr_t (*H5D_scatter_func_t)(const void **src_buf /*out*/, size_t *src_buf_bytes_used /*out*/,
void *op_data);
+//! <!-- [H5D_scatter_func_t_snip] -->
-/* Define the operator function pointer for H5Dgather() */
+//! <!-- [H5D_gather_func_t_snip] -->
+/**
+ * Define the operator function pointer for H5Dgather()
+ */
typedef herr_t (*H5D_gather_func_t)(const void *dst_buf, size_t dst_buf_bytes_used, void *op_data);
+//! <!-- [H5D_gather_func_t_snip] -->
/********************/
/* Public Variables */
@@ -127,45 +171,1268 @@ typedef herr_t (*H5D_gather_func_t)(const void *dst_buf, size_t dst_buf_bytes_us
extern "C" {
#endif
-H5_DLL hid_t H5Dcreate2(hid_t loc_id, const char *name, hid_t type_id, hid_t space_id, hid_t lcpl_id,
- hid_t dcpl_id, hid_t dapl_id);
-H5_DLL hid_t H5Dcreate_anon(hid_t file_id, hid_t type_id, hid_t space_id, hid_t plist_id, hid_t dapl_id);
-H5_DLL hid_t H5Dopen2(hid_t file_id, const char *name, hid_t dapl_id);
-H5_DLL herr_t H5Dclose(hid_t dset_id);
-H5_DLL hid_t H5Dget_space(hid_t dset_id);
-H5_DLL herr_t H5Dget_space_status(hid_t dset_id, H5D_space_status_t *allocation);
-H5_DLL hid_t H5Dget_type(hid_t dset_id);
-H5_DLL hid_t H5Dget_create_plist(hid_t dset_id);
-H5_DLL hid_t H5Dget_access_plist(hid_t dset_id);
+/**
+ * --------------------------------------------------------------------------
+ * \ingroup H5D
+ *
+ * \brief Creates a new dataset and links it into the file
+ *
+ * \fgdta_loc_id
+ * \param[in] name Name of the dataset to create
+ * \type_id
+ * \space_id
+ * \lcpl_id
+ * \dcpl_id
+ * \dapl_id
+ *
+ * \return \hid_t{dataset}
+ *
+ * \details H5Dcreate2() creates a new dataset named \p name at
+ * the location specified by \p loc_id, and associates constant
+ * and initial persistent properties with that dataset, including
+ * the datatype \p dtype_id, the dataspace \p space_id, and
+ * other properties as specified by the dataset creation property
+ * list \p dcpl_id and the access property list \p dapl_id,
+ * respectively. Once created, the dataset is opened for access.
+ *
+ * \p loc_id may specify a file, group, dataset, named datatype,
+ * or attribute. If an attribute, dataset, or named datatype is
+ * specified then the dataset will be created at the location
+ * where the attribute, dataset, or named datatype is attached.
+ *
+ * \p name may be either an absolute path in the file or a relative
+ * path from \p loc_id naming the dataset.
+ *
+ * \p dtype_id specifies the datatype of each data element as stored
+ * in the file. If \p dtype_id is either a fixed-length or
+ * variable-length string, it is important to set the string length
+ * when defining the datatype. String datatypes are derived from
+ * #H5T_C_S1 (or #H5T_FORTRAN_S1 for Fortran codes), which defaults
+ * to 1 character in size.
+ *
+ * If \p dtype_id is a committed datatype, and if the file location
+ * associated with the committed datatype is different from the
+ * file location where the dataset will be created, the datatype
+ * is copied and converted to a transient type.
+ *
+ * The link creation property list, \p lcpl_id, governs creation
+ * of the link(s) by which the new dataset is accessed and the
+ * creation of any * intermediate groups that may be missing.
+ *
+ * The datatype and dataspace properties and the dataset creation
+ * and access property lists are attached to the dataset, so the
+ * caller may derive new datatypes, dataspaces, and creation and
+ * access properties from the old ones and reuse them in calls to
+ * create additional datasets. Once created, the dataset can be
+ * read from or written to. Reading data from a datatset that was
+ * not previously written, the HDF5 library will return default
+ * or user-defined fill values.
+ *
+ * To conserve and release resources, the dataset should be closed
+ * when access is no longer required.
+ *
+ * \since 1.8.0
+ *
+ * \see H5Dopen2(), H5Dclose(), H5Tset_size()
+ *
+ */
+H5_DLL hid_t H5Dcreate2(hid_t loc_id, const char *name, hid_t type_id, hid_t space_id, hid_t lcpl_id,
+ hid_t dcpl_id, hid_t dapl_id);
+
+/**
+ * --------------------------------------------------------------------------
+ * \ingroup H5D
+ *
+ * \brief Creates a dataset in a file without linking it into the file
+ * structure
+ *
+ * \fgdta_loc_id
+ * \type_id
+ * \space_id
+ * \dcpl_id
+ * \dapl_id
+ *
+ * \return \hid_t{dataset}
+ *
+ * \details H5Dcreate_anon() creates a dataset in the file specified
+ * by \p loc_id.
+ *
+ * \p loc_id may specify a file, group, dataset, named datatype,
+ * or attribute. If an attribute, dataset, or named datatype is
+ * specified then the dataset will be created at the location
+ * where the attribute, dataset, or named datatype is attached.
+ *
+ * The dataset’s datatype and dataspace are specified by
+ * \p type_id and \p space_id, respectively. These are the
+ * datatype and dataspace of the dataset as it will exist in
+ * the file, which may differ from the datatype and dataspace
+ * in application memory.
+ *
+ * Dataset creation property list and dataset access creation
+ * property list are specified by \p dcpl_id and \p dapl_id.
+ *
+ * H5Dcreate_anon() returns a new dataset identifier. Using
+ * this identifier, the new dataset must be linked into the
+ * HDF5 file structure with H5Olink() or it will be deleted
+ * from the file when the file is closed.
+ *
+ * See H5Dcreate2() for further details and considerations on
+ * the use of H5Dcreate2() and H5Dcreate_anon().
+ *
+ * The differences between this function and H5Dcreate2() are
+ * as follows:
+ * \li H5Dcreate_anon() explicitly includes a dataset access property
+ * list. H5Dcreate() always uses default dataset access properties.
+ *
+ * \li H5Dcreate_anon() neither provides the new dataset’s name nor
+ * links it into the HDF5 file structure; those actions must be
+ * performed separately through a call to H5Olink(), which offers
+ * greater control over linking.
+ *
+ * A dataset created with this function should be closed with
+ * H5Dclose() when the dataset is no longer needed so that resource
+ * leaks will not develop.
+ *
+ * \since 1.8.0
+ *
+ * \see H5Olink(), H5Dcreate(), Using Identifiers
+ *
+ */
+H5_DLL hid_t H5Dcreate_anon(hid_t loc_id, hid_t type_id, hid_t space_id, hid_t dcpl_id, hid_t dapl_id);
+
+/**
+ * --------------------------------------------------------------------------
+ * \ingroup H5D
+ *
+ * \brief Creates a new dataset and links it into the file
+ *
+ * \fgdta_loc_id
+ * \param[in] name Name of the dataset to open
+ * \dapl_id
+ *
+ * \return \hid_t{dataset}
+ *
+ * \details H5Dopen2() opens the existing dataset specified
+ * by a location identifier and name, \p loc_id and \p name,
+ * respectively.
+ *
+ * \p loc_id may specify a file, group, dataset, named datatype,
+ * or attribute. If an attribute, dataset, or named datatype is
+ * specified then the dataset will be opened at the location
+ * where the attribute, dataset, or named datatype is attached.
+ *
+ * The dataset access property list, \p dapl_id, provides
+ * information regarding access to the dataset.
+ *
+ * To conserve and release resources, the dataset should be closed
+ * when access is no longer required.
+ *
+ * \since 1.8.0
+ *
+ * \see H5Dcreate2(), H5Dclose()
+ *
+ */
+H5_DLL hid_t H5Dopen2(hid_t loc_id, const char *name, hid_t dapl_id);
+
+/**
+ * --------------------------------------------------------------------------
+ *\ingroup H5D
+ *
+ * \brief Returns an identifier for a copy of the dataspace for a dataset
+ *
+ * \dset_id
+ *
+ * \return \hid_t{dataspace}
+ *
+ * \details H5Dget_space() makes a copy of the dataspace of
+ * the dataset specified by \p dset_id. The function returns an
+ * identifier for the new copy of the dataspace.
+ *
+ * A dataspace identifier returned from this function should
+ * be released with H5Sclose() when the identifier is no longer
+ * needed so that resource leaks will not occur.
+ *
+ * \see H5Sclose()
+ *
+ */
+H5_DLL hid_t H5Dget_space(hid_t dset_id);
+
+/**
+ * --------------------------------------------------------------------------
+ * \ingroup H5D
+ * \todo Document this function!
+ */
+H5_DLL herr_t H5Dget_space_status(hid_t dset_id, H5D_space_status_t *allocation);
+
+/**
+ * --------------------------------------------------------------------------
+ * \ingroup H5D
+ *
+ * \brief Returns an identifier for a copy of the datatype for a dataset
+ *
+ * \dset_id
+ *
+ * \return \hid_t{datatype}
+ *
+ * \details H5Dget_type() returns an identifier of a copy of
+ * the datatype for a dataset.
+ *
+ * If a dataset has a named datatype, then an identifier to the
+ * opened datatype is returned. Otherwise, the returned datatype
+ * is read-only. If atomization of the datatype fails, then the
+ * datatype is closed.
+ *
+ * A datatype identifier returned from this function should be
+ * released with H5Tclose() when the identifier is no longer
+ * needed to prevent resource leaks.
+ *
+ * \note Datatype Identifiers
+ *
+ * Please note that the datatype identifier is actually an object
+ * identifier or a handle returned from opening the datatype. It
+ * is not persistent and its value can be different from one HDF5
+ * session to the next.
+ *
+ * H5Tequal() can be used to compare datatypes.
+ *
+ * HDF5 High Level APIs that may also be of interest are:
+ *
+ * H5LTdtype_to_text() creates a text description of a
+ * datatype. H5LTtext_to_dtype() creates an HDF5 datatype
+ * given a text description.
+ *
+ */
+H5_DLL hid_t H5Dget_type(hid_t dset_id);
+
+/**
+ * --------------------------------------------------------------------------
+ * \ingroup H5D
+ *
+ * \brief Returns an identifier for a copy of the dataset creation
+ * property list for a dataset
+ *
+ * \dset_id
+ *
+ * \return \hid_t{dataset creation property list}
+ *
+ * \details H5Dget_create_plist() returns an identifier for
+ * a copy of the dataset creation property list associated with
+ * the dataset specified by \p dset_id.
+ *
+ * The creation property list identifier should be released
+ * with H5Pclose() to prevent resource leaks.
+ *
+ */
+H5_DLL hid_t H5Dget_create_plist(hid_t dset_id);
+
+/**
+ * --------------------------------------------------------------------------
+ * \ingroup H5D
+ *
+ * \brief Returns the dataset access property list associated with
+ * a dataset
+ *
+ * \dset_id
+ *
+ * \return \hid_t{dataset access property list}
+ *
+ * \details H5Dget_access_plist() returns a copy of the
+ * dataset access property list used to open the specified
+ * dataset, \p dset_id. Modifications to the returned property
+ * list will have no effect on the dataset it was retrieved from.
+ *
+ * The chunk cache parameters in the returned property lists will
+ * be those used by the dataset. If the properties in the file
+ * access property list were used to determine the dataset's
+ * chunk cache configuration, then those properties will be
+ * present in the returned dataset access property list. If
+ * the dataset does not use a chunked layout, then the chunk
+ * cache properties will be set to the default. The chunk cache
+ * properties in the returned list are considered to be “set”,
+ * and any use of this list will override the corresponding
+ * properties in the file’s file access property list.
+ *
+ * All link access properties in the returned list will be set
+ * to the default values.
+ *
+ * The access property list identifier should be released with
+ * H5Pclose() when the identifier is no longer needed so that
+ * resource leaks will not develop.
+ *
+ * \since 1.8.3
+ *
+ */
+H5_DLL hid_t H5Dget_access_plist(hid_t dset_id);
+
+/**
+ * --------------------------------------------------------------------------
+ * \ingroup H5D
+ *
+ * \brief Returns the amount of storage allocated for a dataset
+ *
+ * \dset_id
+ *
+ * \return Returns the amount of storage space, in bytes, or 0 (zero).
+ *
+ * \details H5Dget_storage_size() returns the amount of storage,
+ * in bytes, that is allocated in the file for the raw data of
+ * the dataset specified by \p dset_id.
+ *
+ * \note The amount of storage in this case is the storage
+ * allocated in the written file, which will typically differ
+ * from the space required to hold a dataset in working memory.
+ *
+ * \li For contiguous datasets, the returned size equals the current
+ * allocated size of the raw data.
+ * \li For unfiltered chunked datasets, the returned size is the
+ * number of allocated chunks times the chunk size.
+ * \li For filtered chunked datasets, the returned size is the
+ * space required to store the filtered data. For example, if a
+ * compression filter is in use, H5Dget_storage_size() will return
+ * the total space required to store the compressed chunks.
+ *
+ * H5Dget_storage_size() reports only the space required to store
+ * the data, not including that of any metadata.
+ *
+ * \attention H5Dget_storage_size() does not differentiate between 0 (zero),
+ * the value returned for the storage size of a dataset
+ * with no stored values, and 0 (zero), the value returned to
+ * indicate an error.
+ *
+ * \note Note that H5Dget_storage_size() is not generally an
+ * appropriate function to use when determining the amount
+ * of memory required to work with a dataset. In such
+ * circumstances, you must determine the number of data
+ * points in a dataset and the size of an individual data
+ * element. H5Sget_simple_extent_npoints() and H5Tget_size()
+ * can be used to get that information.
+ *
+ */
H5_DLL hsize_t H5Dget_storage_size(hid_t dset_id);
-H5_DLL herr_t H5Dget_chunk_storage_size(hid_t dset_id, const hsize_t *offset, hsize_t *chunk_bytes);
-H5_DLL herr_t H5Dget_num_chunks(hid_t dset_id, hid_t fspace_id, hsize_t *nchunks);
-H5_DLL herr_t H5Dget_chunk_info_by_coord(hid_t dset_id, const hsize_t *coord, unsigned *filter_mask,
- haddr_t *addr, hsize_t *size);
-H5_DLL herr_t H5Dget_chunk_info(hid_t dset_id, hid_t fspace_id, hsize_t chk_idx, hsize_t *coord,
- unsigned *filter_mask, haddr_t *addr, hsize_t *size);
+
+/**
+ * --------------------------------------------------------------------------
+ * \ingroup H5D
+ *
+ * \brief Returns the amount of storage allocated within the file for a
+ * raw data chunk in a dataset
+ *
+ * \dset_id
+ * \param[in] offset Logical offset in the dataset for the chunk to query
+ * \param[out] chunk_bytes The size in bytes for the chunk
+ *
+ * \return \herr_t
+ *
+ * \details H5Dget_chunk_storage_size() returns the size in bytes
+ * allocated in the file for a raw data chunk as specified by
+ * its logical \p offset in the dataset \p dset_id. The size is
+ * returned in \p chunk_nbytes. It is the size of the compressed
+ * data if the chunk is filtered and the size may be zero if no
+ * storage is allocated yet for the dataset.
+ *
+ * \since 1.10.2
+ *
+ */
+H5_DLL herr_t H5Dget_chunk_storage_size(hid_t dset_id, const hsize_t *offset, hsize_t *chunk_bytes);
+
+/**
+ * --------------------------------------------------------------------------
+ * \ingroup H5D
+ *
+ * \brief Retrieves number of chunks that have nonempty intersection with a
+ * specified selection
+ *
+ * \dset_id
+ * \param[in] fspace_id File dataspace selection identifier
+ * \param[out] nchunks Number of chunks in the selection
+ *
+ * \return \herr_t
+ *
+ * \details H5Dget_num_chunks() retrieves the number of chunks
+ * nchunks in a set of selected elements specified by \p fspace_id
+ * for a dataset specified by the identifier \p dset_id. If \p
+ * fspace_id is #H5S_ALL, the function will retrieve the total
+ * number of chunks stored for the dataset.
+ *
+ * \p fspace_id specifies the file dataspace selection. It is
+ * intended to take #H5S_ALL for specifying the current selection.
+ *
+ * \note Please be aware that this function currently does not
+ * support non-trivial selections, thus \p fspace_id has no
+ * effect. Also, the implementation does not handle the #H5S_ALL
+ * macro correctly. As a workaround, application can get
+ * the dataspace for the dataset using H5Dget_space() and pass that
+ * in for \p fspace_id. This will be fixed in coming releases.
+ *
+ * \since 1.10.5
+ *
+ */
+H5_DLL herr_t H5Dget_num_chunks(hid_t dset_id, hid_t fspace_id, hsize_t *nchunks);
+
+/**
+ * --------------------------------------------------------------------------
+ * \ingroup H5D
+ *
+ * \brief Retrieves information about a chunk specified by its coordinates
+ *
+ * \dset_id
+ * \param[in] offset Logical position of the chunk’s first element
+ * \param[out] filter_mask Indicating filters used with the chunk when written
+ * \param[out] addr Chunk address in the file
+ * \param[out] size Chunk size in bytes, 0 if chunk doesn’t exist
+ *
+ * \return \herr_t
+ *
+ * \details H5Dget_chunk_info_by_coord() retrieves the \p filter_mask, \p size,
+ * and \p addr for a chunk in the dataset specified by \p dset_id,
+ * using the coordinates specified by \p offset.
+ *
+ * If the queried chunk does not exist in the file, \p size will
+ * be set to 0, \p addr to \c HADDR_UNDEF, and the buffer \p
+ * filter_mask will not be modified.
+ *
+ * \p offset is a pointer to a one-dimensional array with a size
+ * equal to the dataset’s rank. Each element is the logical
+ * position of the chunk’s first element in a dimension.
+ *
+ * \since 1.10.5
+ *
+ */
+H5_DLL herr_t H5Dget_chunk_info_by_coord(hid_t dset_id, const hsize_t *offset, unsigned *filter_mask,
+ haddr_t *addr, hsize_t *size);
+
+/**
+ * --------------------------------------------------------------------------
+ * \ingroup H5D
+ *
+ * \brief Retrieves information about a chunk specified by its index
+ *
+ * \dset_id
+ * \param[in] fspace_id File dataspace selection identifier (See Note below)
+ * \param[in] chk_idx Index of the chunk
+ * \param[out] offset Logical position of the chunk’s first element
+ * \param[out] filter_mask Indicating filters used with the chunk when written
+ * \param[out] addr Chunk address in the file
+ * \param[out] size Chunk size in bytes, 0 if chunk doesn’t exist
+ *
+ * \return \herr_t
+ *
+ * \details H5Dget_chunk_info() retrieves the offset coordinates
+ * offset, filter mask filter_mask, size size and address addr for
+ * the dataset specified by the identifier dset_id and the chunk
+ * specified by the index index. The chunk belongs to a set of
+ * chunks in the selection specified by fspace_id. If the queried
+ * chunk does not exist in the file, the size will be set to 0 and
+ * address to \c HADDR_UNDEF. The value pointed to by filter_mask will
+ * not be modified. NULL can be passed in for any \p out parameters.
+ *
+ * \p chk_idx is the chunk index in the selection. Index value
+ * may have a value of 0 up to the number of chunks stored in
+ * the file that have a nonempty intersection with the file
+ * dataspace selection
+ *
+ * \note As of 1.10.5, the dataspace intersection is not yet
+ * supported, hence, the index is of all the written chunks.
+ *
+ * \p fspace_id specifies the file dataspace selection. It is
+ * intended to take #H5S_ALL for specifying the current selection.
+ *
+ * \note Please be aware that this function currently does not
+ * support non-trivial selections, thus \p fspace_id has no
+ * effect. Also, the implementation does not handle the #H5S_ALL
+ * macro correctly. As a workaround, application can get
+ * the dataspace for the dataset using H5Dget_space() and pass that
+ * in for \p fspace_id. This will be fixed in coming releases.
+ *
+ * \since 1.10.5
+ *
+ */
+H5_DLL herr_t H5Dget_chunk_info(hid_t dset_id, hid_t fspace_id, hsize_t chk_idx, hsize_t *offset,
+ unsigned *filter_mask, haddr_t *addr, hsize_t *size);
+
+/**
+ * --------------------------------------------------------------------------
+ * \ingroup H5D
+ *
+ * \brief Returns dataset address in file
+ *
+ * \dset_id
+ *
+ * \return Returns the offset in bytes; otherwise, returns \c HADDR_UNDEF,
+ * a negative value.
+ *
+ * \details H5Dget_offset() returns the address in the file of
+ * the dataset, \p dset_id. That address is expressed as the
+ * offset in bytes from the beginning of the file.
+ *
+ * \since 1.6.0
+ *
+ */
H5_DLL haddr_t H5Dget_offset(hid_t dset_id);
-H5_DLL herr_t H5Dread(hid_t dset_id, hid_t mem_type_id, hid_t mem_space_id, hid_t file_space_id,
- hid_t plist_id, void *buf /*out*/);
-H5_DLL herr_t H5Dwrite(hid_t dset_id, hid_t mem_type_id, hid_t mem_space_id, hid_t file_space_id,
- hid_t plist_id, const void *buf);
-H5_DLL herr_t H5Dwrite_chunk(hid_t dset_id, hid_t dxpl_id, uint32_t filters, const hsize_t *offset,
- size_t data_size, const void *buf);
-H5_DLL herr_t H5Dread_chunk(hid_t dset_id, hid_t dxpl_id, const hsize_t *offset, uint32_t *filters,
- void *buf);
-H5_DLL herr_t H5Diterate(void *buf, hid_t type_id, hid_t space_id, H5D_operator_t op, void *operator_data);
-H5_DLL herr_t H5Dvlen_get_buf_size(hid_t dataset_id, hid_t type_id, hid_t space_id, hsize_t *size);
-H5_DLL herr_t H5Dfill(const void *fill, hid_t fill_type, void *buf, hid_t buf_type, hid_t space);
-H5_DLL herr_t H5Dset_extent(hid_t dset_id, const hsize_t size[]);
-H5_DLL herr_t H5Dflush(hid_t dset_id);
-H5_DLL herr_t H5Drefresh(hid_t dset_id);
-H5_DLL herr_t H5Dscatter(H5D_scatter_func_t op, void *op_data, hid_t type_id, hid_t dst_space_id,
- void *dst_buf);
-H5_DLL herr_t H5Dgather(hid_t src_space_id, const void *src_buf, hid_t type_id, size_t dst_buf_size,
- void *dst_buf, H5D_gather_func_t op, void *op_data);
-H5_DLL herr_t H5Ddebug(hid_t dset_id);
+
+/**
+ * --------------------------------------------------------------------------
+ * \ingroup H5D
+ *
+ * \brief Reads raw data from a dataset into a provided buffer
+ *
+ * \dset_id Identifier of the dataset to read from
+ * \param[in] mem_type_id Identifier of the memory datatype
+ * \param[in] mem_space_id Identifier of the memory dataspace
+ * \param[in] file_space_id Identifier of the dataset's dataspace in the file
+ * \param[in] dxpl_id Identifier of a transfer property list
+ * \param[out] buf Buffer to receive data read from file
+ *
+ * \return \herr_t
+ *
+ * \details H5Dread() reads a dataset, specified by its identifier
+ * \p dset_id, from the file into an application memory buffer \p
+ * buf. Data transfer properties are defined by the argument \p
+ * dxpl_id. The memory datatype of the (partial) dataset
+ * is identified by the identifier \p mem_type_id. The part
+ * of the dataset to read is defined by \p mem_space_id and \p
+ * file_space_id.
+ *
+ * \p file_space_id is used to specify only the selection within
+ * the file dataset's dataspace. Any dataspace specified in \p
+ * file_space_id is ignored by the library and the dataset's
+ * dataspace is always used. \p file_space_id can be the constant
+ * #H5S_ALL, which indicates that the entire file dataspace,
+ * as defined by the current dimensions of the dataset, is to
+ * be selected.
+ *
+ * \p mem_space_id is used to specify both the memory dataspace
+ * and the selection within that dataspace. \p mem_space_id can
+ * be the constant #H5S_ALL, in which case the file dataspace is
+ * used for the memory dataspace and the selection defined with \p
+ * file_space_id is used for the selection within that dataspace.
+ *
+ * If raw data storage space has not been allocated for the dataset
+ * and a fill value has been defined, the returned buffer \p buf
+ * is filled with the fill value.
+ *
+ * The behavior of the library for the various combinations of
+ * valid dataspace identifiers and #H5S_ALL for the \p mem_space_id
+ * and the \p file_space_id parameters is described below:
+ *
+ * <table>
+ * <tr>
+ * <th>mem_space_id</th>
+ * <th>file_space_id</th>
+ * <th>Behavior</th>
+ * </tr>
+ * <tr>
+ * <td>valid dataspace ID</td>
+ * <td>valid dataspace ID</td>
+ * <td>\p mem_space_id specifies the memory dataspace and the
+ * selection within it. \p file_space_id specifies the
+ * selection within the file dataset's dataspace.</td>
+ * </tr>
+ * <tr>
+ * <td>#H5S_ALL</td>
+ * <td>valid dataspace ID</td>
+ * <td>The file dataset's dataspace is used for the memory
+ * dataspace and the selection specified with \p file_space_id
+ * specifies the selection within it. The combination of the
+ * file dataset's dataspace and the selection from
+ * \p file_space_id is used for memory also.</td>
+ * </tr>
+ * <tr>
+ * <td>valid dataspace ID</td>
+ * <td>#H5S_ALL</td>
+ * <td>\p mem_space_id specifies the memory dataspace and the
+ * selection within it. The selection within the file
+ * dataset's dataspace is set to the "all" selection.</td>
+ * </tr>
+ * <tr>
+ * <td>#H5S_ALL</td>
+ * <td>#H5S_ALL</td>
+ * <td>The file dataset's dataspace is used for the memory
+ * dataspace and the selection within the memory dataspace
+ * is set to the "all" selection. The selection within the
+ * file dataset's dataspace is set to the "all" selection.</td>
+ * </tr>
+ * </table>
+ *
+ * \details Setting an #H5S_ALL selection indicates that the entire
+ * dataspace, as defined by the current dimensions of a dataspace,
+ * will be selected. The number of elements selected in the memory
+ * dataspace must match the number of elements selected in the
+ * file dataspace.
+ *
+ * \p dxpl_id can be the constant #H5P_DEFAULT, in which case the
+ * default data transfer properties are used.
+ *
+ */
+H5_DLL herr_t H5Dread(hid_t dset_id, hid_t mem_type_id, hid_t mem_space_id, hid_t file_space_id,
+ hid_t dxpl_id, void *buf /*out*/);
+/**
+ * --------------------------------------------------------------------------
+ * \ingroup H5D
+ *
+ * \brief Writes raw data from a buffer to a dataset
+ *
+ * \param[in] dset_id Identifier of the dataset to read from
+ * \param[in] mem_type_id Identifier of the memory datatype
+ * \param[in] mem_space_id Identifier of the memory dataspace
+ * \param[in] file_space_id Identifier of the dataset's dataspace in the file
+ * \dxpl_id
+ * \param[out] buf Buffer with data to be written to the file
+ *
+ * \return \herr_t
+ *
+ * \details H5Dwrite() writes a (partial) dataset, specified by
+ * its identifier \p dset_id, from the application memory buffer \p
+ * buf into the file. Data transfer properties are defined by the
+ * argument \p dxpl_id. The memory datatype of the (partial)
+ * dataset is identified by the identifier \p mem_type_id. The
+ * part of the dataset to write is defined by \p mem_space_id
+ * and \p file_space_id.
+ *
+ * If \p mem_type_id is either a fixed-length or variable-length
+ * string, it is important to set the string length when defining
+ * the datatype. String datatypes are derived from #H5T_C_S1
+ * (or #H5T_FORTRAN_S1 for Fortran codes), which defaults
+ * to 1 character in size. See H5Tset_size() and Creating
+ * variable-length string datatypes.
+ *
+ * \p file_space_id is used to specify only the selection within
+ * the file dataset's dataspace. Any dataspace specified in \p
+ * file_space_id is ignored by the library and the dataset's
+ * dataspace is always used. \p file_space_id can be the constant
+ * #H5S_ALL, which indicates that the entire file dataspace,
+ * as defined by the current dimensions of the dataset, is to
+ * be selected.
+ *
+ * \p mem_space_id is used to specify both the memory dataspace
+ * and the selection within that dataspace. mem_space_id can be
+ * the constant #H5S_ALL, in which case the file dataspace is
+ * used for the memory dataspace and the selection defined with \p
+ * file_space_id is used for the selection within that dataspace.
+ *
+ * The behavior of the library for the various combinations of
+ * valid dataspace IDs and #H5S_ALL for the mem_space_id and
+ * thefile_space_id parameters is described below:
+ *
+ * <table>
+ * <tr><th>\c mem_space_id</th>
+ * <th>\c file_space_id</th>
+ * <th>Behavior</th></tr>
+ * <tr><td>valid dataspace ID</td>
+ * <td>valid dataspace ID</td>
+ * <td>\p mem_space_id specifies the memory dataspace and the
+ * selection within it. \p file_space_id specifies the
+ * selection within the file dataset's dataspace.</td></tr>
+ * <tr><td>#H5S_ALL</td>
+ * <td>valid dataspace ID</td>
+ * <td>The file dataset's dataspace is used for the memory
+ * dataspace and the selection specified with \p file_space_id
+ * specifies the selection within it. The combination of the
+ * file dataset's dataspace and the selection from \p
+ * file_space_id is used for memory also. valid dataspace
+ * ID</td></tr>
+ * <tr><td>valid dataspace ID</td>
+ * <td>#H5S_ALL</td>
+ * <td>\p mem_space_id specifies the memory dataspace and the
+ * selection within it. The selection within the file
+ * dataset's dataspace is set to "all" selection.</td></tr>
+ * <tr><td>#H5S_ALL</td>
+ * <td>#H5S_ALL</td>
+ * <td>The file dataset's dataspace is used for the memory
+ * dataspace and the selection within the memory dataspace is
+ * set to the "all" selection. The selection within the file
+ * dataset's dataspace is set to the "all"
+ * selection.</td></tr>
+ * </table>
+ * Setting an "all" selection indicates that the entire dataspace,
+ * as defined by the current dimensions of a dataspace, will
+ * be selected. The number of elements selected in the memory
+ * dataspace must match the number of elements selected in the
+ * file dataspace.
+ *
+ * \p dxpl_id can be the constant #H5P_DEFAULT, in which
+ * case the default data transfer properties are used.
+ *
+ * Writing to a dataset will fail if the HDF5 file was not opened
+ * with write access permissions.
+ *
+ * If the dataset's space allocation time is set to
+ * #H5D_ALLOC_TIME_LATE or #H5D_ALLOC_TIME_INCR and the space for
+ * the dataset has not yet been allocated, that space is allocated
+ * when the first raw data is written to the dataset. Unused space
+ * in the dataset will be written with fill values at the same
+ * time if the dataset's fill time is set to #H5D_FILL_TIME_IFSET
+ * or #H5D_FILL_TIME_ALLOC.
+ *
+ * \attention If a dataset's storage layout is 'compact', care must be
+ * taken when writing data to the dataset in parallel. A compact
+ * dataset's raw data is cached in memory and may be flushed
+ * to the file from any of the parallel processes, so parallel
+ * applications should always attempt to write identical data to
+ * the dataset from all processes.
+ *
+ * \see H5Pset_fill_time(), H5Pset_alloc_time()
+ *
+ */
+H5_DLL herr_t H5Dwrite(hid_t dset_id, hid_t mem_type_id, hid_t mem_space_id, hid_t file_space_id,
+ hid_t dxpl_id, const void *buf);
+
+/**
+ * --------------------------------------------------------------------------
+ * \ingroup H5D
+ *
+ * \brief Writes a raw data chunk from a buffer directly to a dataset in a file
+ *
+ * \dset_id
+ * \dxpl_id
+ * \param[in] filters Mask for identifying the filters in use
+ * \param[in] offset Logical position of the chunk’s first element in the
+ * dataspace
+ * \param[in] data_size Size of the actual data to be written in bytes
+ * \param[in] buf Buffer containing data to be written to the chunk
+ *
+ * \return \herr_t
+ *
+ * \details H5Dwrite_chunk() writes a raw data chunk as specified
+ * by its logical offset \p offset in a chunked dataset \p dset_id
+ * from the application memory buffer \p buf to the dataset in
+ * the file. Typically, the data in \p buf is preprocessed in
+ * memory by a custom transformation, such as compression. The
+ * chunk will bypass the library’s internal data transfer
+ * pipeline, including filters, and will be written directly to
+ * the file. Only one chunk can be written with this function.
+ *
+ * H5Dwrite_chunk() replaces the now deprecated H5DOwrite_chunk()
+ * function, which was located in the high level optimization
+ * library. The parameters and behavior are identical to the
+ * original.
+ *
+ * \p filters is a mask providing a record of which filters are
+ * used with the the chunk. The default value of the mask is
+ * zero (0), indicating that all enabled filters are applied. A
+ * filter is skipped if the bit corresponding to the filter’s
+ * position in the pipeline (0 ≤ position < 32) is turned on.
+ * This mask is saved with the chunk in the file.
+ *
+ * \p offset is an array specifying the logical position of the
+ * first element of the chunk in the dataset’s dataspace. The
+ * length of the offset array must equal the number of dimensions,
+ * or rank, of the dataspace. The values in offset must not exceed
+ * the dimension limits and must specify a point that falls on
+ * a dataset chunk boundary.
+ *
+ * \p data_size is the size in bytes of the chunk, representing
+ * the number of bytes to be read from the buffer \p buf. If the
+ * data chunk has been precompressed, \p data_size should be the
+ * size of the compressed data.
+ *
+ * \p buf is the memory buffer containing data to be written to
+ * the chunk in the file.
+ *
+ * \attention Exercise caution when using H5Dread_chunk() and
+ * H5Dwrite_chunk(), as they read and write data chunks directly
+ * in a file. H5Dwrite_chunk() bypasses hyperslab selection, the
+ * conversion of data from one datatype to another, and the filter
+ * pipeline to write the chunk. Developers should have experience
+ * with these processes before using this function. Please see
+ * Using the Direct Chunk Write Function for more information.
+ *
+ * \note H5Dread_chunk() and H5Dwrite_chunk() are not supported under
+ * parallel and do not support variable length types.
+ *
+ * \since 1.10.2
+ *
+ */
+H5_DLL herr_t H5Dwrite_chunk(hid_t dset_id, hid_t dxpl_id, uint32_t filters, const hsize_t *offset,
+ size_t data_size, const void *buf);
+
+/**
+ * --------------------------------------------------------------------------
+ * \ingroup H5D
+ *
+ * \brief Reads a raw data chunk directly from a dataset in a file into
+ * a buffer
+ *
+ * \dset_id
+ * \dxpl_id
+ * \param[in] offset Logical position of the chunk’s first element in the
+ * dataspace
+ * \param[in,out] filters Mask for identifying the filters in use
+ * \param[out] buf Buffer containing data to be written to the chunk
+ *
+ * \return \herr_t
+ *
+ * \details H5Dread_chunk() reads a raw data chunk as specified by
+ * its logical offset \p offset in a chunked dataset \p dset_id
+ * from the dataset in the file into the application memory
+ * buffer \p buf. The data in \p buf is read directly from the
+ * file bypassing the library’s internal data transfer pipeline,
+ * including filters.
+ *
+ * \p offset is an array specifying the logical position of the
+ * first element of the chunk in the dataset’s dataspace. The
+ * length of the \p offset array must equal the number of dimensions,
+ * or rank, of the dataspace. The values in \p offset must not exceed
+ * the dimension limits and must specify a point that falls on
+ * a dataset chunk boundary.
+ *
+ * The mask \p filters indicates which filters are used with the
+ * chunk when written. A zero value indicates that all enabled
+ * filters are applied on the chunk. A filter is skipped if the
+ * bit corresponding to the filter’s position in the pipeline
+ * (0 ≤ position < 32) is turned on.
+ *
+ * \p buf is the memory buffer containing the chunk read from
+ * the dataset in the file.
+ *
+ * \attention Exercise caution when using H5Dread_chunk() and
+ * H5Dwrite_chunk(), as they read and write data chunks directly
+ * in a file. H5Dwrite_chunk() bypasses hyperslab selection, the
+ * conversion of data from one datatype to another, and the filter
+ * pipeline to write the chunk. Developers should have experience
+ * with these processes before using this function. Please see
+ * Using the Direct Chunk Write Function for more information.
+ *
+ * \note H5Dread_chunk() and H5Dwrite_chunk() are not supported under
+ * parallel and do not support variable length types.
+ *
+ * \since 1.10.2
+ *
+ */
+H5_DLL herr_t H5Dread_chunk(hid_t dset_id, hid_t dxpl_id, const hsize_t *offset, uint32_t *filters,
+ void *buf);
+
+/**
+ * --------------------------------------------------------------------------
+ * \ingroup H5D
+ *
+ * \brief Iterates over all selected elements in a dataspace
+ *
+ * \param[in,out] buf Buffer containing the elements to iterate over
+ * \type_id
+ * \space_id
+ * \param[in] op Function pointer
+ * \param[in,out] operator_data User-defined data
+ *
+ * \return \success{The return value of the first operator that returns
+ * non-zero, or zero if all members were processed with no
+ * operator returning non-zero.}
+ * \return \failure{Negative if an error occurs in the library, or the negative
+ * value returned by one of the operators.}
+ *
+ * \details H5Diterate() iterates over all the data elements
+ * in the memory buffer \p buf, executing the callback function
+ * \p op once for each such data element.
+ *
+ * The prototype of the callback function \p op is as follows
+ * (as defined in the source code file H5Lpublic.h):
+ * \snippet this H5D_operator_t_snip
+ * The parameters of this callback function are:
+ *
+ * <table>
+ * <tr><td>\c elem</td>
+ * <td><tt>[in,out]</tt></td>
+ * <td>Pointer to the memory buffer containing the current
+ * data element</td></tr>
+ * <tr><td>\c type_id</td>
+ * <td><tt>[in]</tt></td>
+ * <td>Datatype identifier of the elements stored in elem</td></tr>
+ * <tr><td>\c ndim</td>
+ * <td><tt>[in]</tt></td>
+ * <td>Number of dimensions for the point array</td></tr>
+ * <tr><td>\c point</td>
+ * <td><tt>[in]</tt></td>
+ * <td>Array containing the location of the element within
+ * the original dataspace</td></tr>
+ * <tr><td>\c operator_data</td>
+ * <td><tt>[in,out]</tt></td>
+ * <td>Pointer to any user-defined data associated with the
+ * operation</td></tr>
+ * </table>
+ *
+ * The possible return values from the callback function, and
+ * the effect ofeach,are as follows:
+ *
+ * \li Zero causes the iterator to continue, returning zero
+ * when all data elements have been processed.
+ * \li A positive value causes the iterator to immediately
+ * return that positive value, indicating short-circuit success.
+ * \li A negative value causes the iterator to immediately return
+ * that value, indicating failure.
+ *
+ * The \p operator_data parameter is a user-defined pointer to
+ * the data required to process dataset elements in the course
+ * of the iteration. If operator needs to pass data back to the
+ * application, such data can be returned in this same buffer. This
+ * pointer is passed back to each step of the iteration in the
+ * operator callback function’s operator_data parameter.
+ *
+ * Unlike other HDF5 iterators, this iteration operation cannot
+ * be restarted at the point of exit; a second H5Diterate()
+ * call will always restart at the beginning.
+ *
+ *
+ * \since 1.10.2
+ *
+ */
+H5_DLL herr_t H5Diterate(void *buf, hid_t type_id, hid_t space_id, H5D_operator_t op, void *operator_data);
+
+/**
+ * --------------------------------------------------------------------------
+ * \ingroup H5D
+ *
+ * \brief Determines the number of bytes required to store variable-length
+ * (VL) data
+ *
+ * \dset_id
+ * \type_id
+ * \space_id
+ * \param[out] size Size in bytes of the memory buffer required to store
+ * the VL data
+ *
+ * \return \herr_t
+ *
+ * \details H5Dvlen_get_buf_size() determines the number of bytes
+ * required to store the VL data from the dataset, using \p
+ * space_id for the selection in the dataset on disk and the \p
+ * type_id for the memory representation of the VL data in memory.
+ * \p size is returned with the number of bytes required to store
+ * the VL data in memory.
+ *
+ * \since 1.10.2
+ *
+ */
+H5_DLL herr_t H5Dvlen_get_buf_size(hid_t dset_id, hid_t type_id, hid_t space_id, hsize_t *size);
+
+/**
+ * --------------------------------------------------------------------------
+ * \ingroup H5D
+ *
+ * \brief Fills dataspace elements with a fill value in a memory buffer
+ *
+ * \param[in] fill Pointer to the fill value to be used
+ * \param[in] fill_type_id Fill value datatype identifier
+ * \param[in,out] buf Pointer to the memory buffer containing the
+ * selection to be filled
+ * \param[in] buf_type_id Datatype of dataspace elements to be filled
+ * \space_id
+ *
+ * \return \herr_t
+ *
+ * \details H5Dfill() fills the dataspace selection in memory, \p space_id,
+ * with the fill value specified in \p fill. If \p fill is NULL,
+ * a fill value of 0 (zero) is used.
+ *
+ * \p fill_type_id specifies the datatype of the fill value.
+ * \p buf specifies the buffer in which the dataspace elements
+ * will be written.
+ * \p buf_type_id specifies the datatype of those data elements.
+ *
+ * \note Note that if the fill value datatype differs from the memory
+ * buffer datatype, the fill value will be converted to the memory
+ * buffer datatype before filling the selection.
+ *
+ * \note Applications sometimes write data only to portions of an
+ * allocated dataset. It is often useful in such cases to fill
+ * the unused space with a known fill value. See the following
+ * function for more information:
+ * - H5Pset_fill_value()
+ * - H5Pget_fill_value()
+ * - H5Pfill_value_defined()
+ * - H5Pset_fill_time()
+ * - H5Pget_fill_time()
+ * - H5Pcreate()
+ * - H5Pcreate_anon()
+ *
+ */
+H5_DLL herr_t H5Dfill(const void *fill, hid_t fill_type_id, void *buf, hid_t buf_type_id, hid_t space_id);
+
+/**
+ * --------------------------------------------------------------------------
+ * \ingroup H5D
+ *
+ * \brief Changes the sizes of a dataset’s dimensions
+ *
+ * \dset_id
+ * \param[in] size[] Array containing the new magnitude of each dimension
+ * of the dataset
+ *
+ * \return \herr_t
+ *
+ * \details H5Dset_extent() sets the current dimensions of the
+ * chunked dataset \p dset_id to the sizes specified in size.
+ *
+ * \p size is a 1-dimensional array with n elements, where \p n is
+ * the rank of the dataset’s current dataspace.
+ *
+ * This function can be applied to the following datasets:
+ * - A chunked dataset with unlimited dimensions
+ * - A chunked dataset with fixed dimensions if the new dimension
+ * sizes are less than the maximum sizes set with maxdims (see
+ * H5Screate_simple())
+ * - An external dataset with unlimited dimensions
+ * - An external dataset with fixed dimensions if the new dimension
+ * sizes are less than the maximum sizes set with \p maxdims
+ *
+ * Note that external datasets are always contiguous and can be
+ * extended only along the first dimension.
+ *
+ * Space on disk is immediately allocated for the new dataset extent if
+ * the dataset’s space allocation time is set to #H5D_ALLOC_TIME_EARLY.
+ *
+ * Fill values will be written to the dataset in either of the
+ * following situations, but not otherwise:
+ *
+ * - If the dataset’s fill time is set to #H5D_FILL_TIME_IFSET and a
+ * fill value is defined (see H5Pset_fill_time() and
+ * H5Pset_fill_value())
+ * - If the dataset’s fill time is set to #H5D_FILL_TIME_ALLOC
+ * (see H5Pset_alloc_time())
+ *
+ * \note
+ * \li If the sizes specified in \p size array are smaller than
+ * the dataset’s current dimension sizes, H5Dset_extent() will reduce
+ * the dataset’s dimension sizes to the specified values. It is the
+ * user application’s responsibility to ensure that valuable data is
+ * not lost as H5Dset_extent() does not check.
+ *
+ * \li Except for external datasets, H5Dset_extent() is for use with
+ * chunked datasets only, not contiguous datasets.
+ *
+ * \li A call to H5Dset_extent() affects the dataspace of a dataset.
+ * If a dataspace handle was opened for a dataset prior to a call to
+ * H5Dset_extent() then that dataspace handle will no longer reflect
+ * the correct dataspace extent of the dataset. H5Dget_space() must
+ * be called (after closing the previous handle) to obtain the current
+ * dataspace extent.
+ *
+ * \since 1.8.0
+ *
+ */
+H5_DLL herr_t H5Dset_extent(hid_t dset_id, const hsize_t size[]);
+
+/**
+ * --------------------------------------------------------------------------
+ * \ingroup H5D
+ *
+ * \brief Flushes all buffers associated with a dataset to disk
+ *
+ * \dset_id
+ *
+ * \return \herr_t
+ *
+ * \details H5Dflush() causes all buffers associated with a
+ * dataset to be immediately flushed to disk without removing
+ * the data from the cache.
+ *
+ * \note HDF5 does not possess full control over buffering.
+ * H5Dflush() flushes the internal HDF5 buffers and then asks the
+ * operating system (the OS) to flush the system buffers for the
+ * open files. After that, the OS is responsible for ensuring
+ * that the data is actually flushed to disk.
+ *
+ */
+H5_DLL herr_t H5Dflush(hid_t dset_id);
+
+/**
+ * --------------------------------------------------------------------------
+ * \ingroup H5D
+ *
+ * \brief Refreshes all buffers associated with a dataset
+ *
+ * \dset_id
+ *
+ * \return \herr_t
+ *
+ * \details H5Drefresh() causes all buffers associated with a
+ * dataset to be cleared and immediately re-loaded with updated
+ * contents from disk.
+ *
+ * This function essentially closes the dataset, evicts all
+ * metadata associated with it from the cache, and then re-opens
+ * the dataset. The reopened dataset is automatically re-registered
+ * with the same identifier.
+ *
+ * \since 1.10.2
+ *
+ */
+H5_DLL herr_t H5Drefresh(hid_t dset_id);
+
+/**
+ * --------------------------------------------------------------------------
+ * \ingroup H5D
+ *
+ * \brief Scatters data into a selection within a memory buffer
+ *
+ * \param[in] op Callback function which provides data to be scattered
+ * \param[in] op_data User-defined pointer to data required by op
+ * \param[in] type_id Identifier for the datatype describing the data in
+ * both the source and destination buffers
+ * \param[in] dst_space_id Identifier for the dataspace for destination
+ * \param[out] dst_buf Destination buffer which the data will be scattered to
+ *
+ * \return \herr_t
+ *
+ * \details H5Dscatter() retrieves data from the supplied callback
+ * \p op and scatters it to the supplied buffer \p dst_buf in a
+ * manner similar to data being written to a dataset.
+ *
+ * \p dst_space_id is a dataspace which defines the extent of \p
+ * dst_buf and the selection within it to scatter the data to.
+ *
+ * \p type_id is the datatype of the data to be scattered in both
+ * the source and destination buffers.
+ *
+ * \p dst_buf must be at least as large as the number of elements
+ * in the extent of \p dst_space_id times the size in bytes of
+ * \p type_id.
+ *
+ * To retrieve the data to be scattered, H5Dscatter() repeatedly
+ * calls \p op, which should return a valid source buffer, until
+ * enough data to fill the selection has been retrieved. The
+ * prototype of the callback function \p op is as follows (as
+ * defined in the source code file H5Dpublic.h):
+ * \snippet this H5D_scatter_func_t_snip
+ * The parameters of this callback function are described below:
+ *
+ * <table>
+ * <tr><td>\c src_buf</td>
+ * <td><tt>[out]</tt></td>
+ * <td>Pointer to the buffer holding the next set of elements to
+ * scatter. On entry, the value of where \c src_buf points to
+ * is undefined. The callback function should set \c src_buf
+ * to point to the next set of elements.</td></tr>
+ * <tr><td>\c src_buf_bytes_used</td>
+ * <td><tt>[out]</tt></td>
+ * <td>Pointer to the number of valid bytes in \c src_buf. On
+ * entry, the value where \c src_buf_bytes_used points to is
+ * undefined. The callback function should set
+ * \c src_buf_bytes_used to the of valid bytes in \c src_buf.
+ * This number must be a multiple of the datatype size.
+ * </td></tr>
+ * <tr><td>\c op_data</td>
+ * <td><tt>[in,out]</tt></td>
+ * <td>User-defined pointer to data required by the callback
+ * function. A pass-through of the \c op_data pointer provided
+ * with the H5Dscatter() function call.</td></tr>
+ * </table>
+ *
+ * The callback function should always return at least one
+ * element in \p src_buf, and must not return more elements
+ * than are remaining to be scattered. This function will be
+ * repeatedly called until all elements to be scattered have
+ * been returned. The callback function should return zero (0)
+ * to indicate success, and a negative value to indicate failure.
+ *
+ * \since 1.10.2
+ *
+ */
+H5_DLL herr_t H5Dscatter(H5D_scatter_func_t op, void *op_data, hid_t type_id, hid_t dst_space_id,
+ void *dst_buf);
+
+/**
+ * --------------------------------------------------------------------------
+ * \ingroup H5D
+ *
+ * \brief Gathers data from a selection within a memory buffer
+ * raw data chunk in a dataset
+ *
+ * \param[in] src_space_id Dataspace identifier for the source buffer
+ * \param[in] src_buf Source buffer which the data will be gathered from
+ * \param[in] type_id Datatype identifier for the source
+ * \param[in] dst_buf_size Size in bytes of \p dst_buf
+ * \param[out] dst_buf Destination buffer for the gathered data
+ * \param[in] op Callback function which handles the gathered data
+ * \param[in] op_data User-defined pointer to data required by \p op
+ *
+ * \return \herr_t
+ *
+ * \details H5Dgather() retrieves data from a selection within the supplied
+ * buffer src_buf and passes it to the supplied callback function
+ * \p op in a contiguous form.
+ *
+ * The dataspace \p src_space_id describes both the dimensions of
+ * the source buffer and the selection within the source buffer
+ * to gather data from.
+ *
+ * \p src_buf must be at least the size of the gathered data, that
+ * is, the number of elements in the extent of \p src_space_id
+ * times the size in bytes of \p type_id.
+ *
+ * The datatype \p type_id describes the data in both the source
+ * and destination buffers. This information is used to calculate
+ * the element size.
+ *
+ * The data is gathered into \p dst_buf, which needs to be large
+ * enough to hold all the data if the callback function \p op is
+ * not provided.
+ *
+ * \p op is a callback function which handles the gathered data.
+ * It is optional if \p dst_buf is large enough to hold all of the
+ * gathered data; required otherwise.
+ *
+ * If no callback function is provided, H5Dgather() simply gathers
+ * the data into \p dst_buf and returns. If a callback function is
+ * provided, H5Dgather() repeatedly gathers up to \p dst_buf_size
+ * bytes to process the serialized data. The prototype of the
+ * callback function \p op is as follows (as defined in the source
+ * code file H5Dpublic.h):
+ * \snippet this H5D_gather_func_t_snip
+ * The parameters of this callback function are described in the
+ * table below.
+ * <table>
+ * <tr><td>\c dst_buf</td>
+ * <td>Pointer to the destination buffer which has been filled
+ * with the next set of elements gathered. This will always be
+ * identical to the \p dst_buf passed to H5Dgather().</td></tr>
+ * <tr><td>\c dst_buf_bytes_used</td>
+ * <td>Pointer to the number of valid bytes in \p dst_buf.
+ * This number must be a multiple of the datatype
+ * size.</td></tr>
+ * <tr><td>\c op_data</td>
+ * <td>User-defined pointer to data required by the callback
+ * function; a pass-through of the \p op_data pointer
+ * provided with the H5Dgather() function call.</td></tr>
+ * </table>
+ * The callback function should process, store, or otherwise,
+ * make use of the data returned in \p dst_buf before it returns,
+ * because the buffer will be overwritten unless it is the last
+ * call to the callback. This function will be repeatedly called
+ * until all gathered elements have been passed to the callback
+ * in \p dst_buf. The callback function should return zero (0)
+ * to indicate success, and a negative value to indicate failure.
+ *
+ * \since 1.10.2
+ *
+ */
+H5_DLL herr_t H5Dgather(hid_t src_space_id, const void *src_buf, hid_t type_id, size_t dst_buf_size,
+ void *dst_buf, H5D_gather_func_t op, void *op_data);
+
+/**
+ * --------------------------------------------------------------------------
+ * \ingroup H5D
+ *
+ * \brief Closes the specified dataset
+ *
+ * \dset_id
+ *
+ * \return \herr_t
+ *
+ * \details H5Dclose() ends access to a dataset specified by \p dset_id
+ * and releases resources used by it.
+ *
+ * \attention Further use of a released dataset identifier is illegal; a
+ * function using such an identifier will generate an error.
+ *
+ * \since 1.8.0
+ *
+ * \see H5Dcreate2(), H5Dopen2()
+ *
+ */
+H5_DLL herr_t H5Dclose(hid_t dset_id);
/* Internal API routines */
+H5_DLL herr_t H5Ddebug(hid_t dset_id);
H5_DLL herr_t H5Dformat_convert(hid_t dset_id);
H5_DLL herr_t H5Dget_chunk_index_type(hid_t did, H5D_chunk_index_t *idx_type);
@@ -194,10 +1461,182 @@ H5_DLL herr_t H5Dget_chunk_index_type(hid_t did, H5D_chunk_index_t *idx_type);
/* Typedefs */
/* Function prototypes */
-H5_DLL hid_t H5Dcreate1(hid_t file_id, const char *name, hid_t type_id, hid_t space_id, hid_t dcpl_id);
-H5_DLL hid_t H5Dopen1(hid_t file_id, const char *name);
+/**
+ * --------------------------------------------------------------------------
+ * \ingroup H5D
+ *
+ * \brief Creates a dataset at the specified location
+ *
+ * \fgdta_loc_id
+ * \param[in] name Name of the dataset to create
+ * \type_id
+ * \space_id
+ * \dcpl_id
+ *
+ * \return \hid_t{dataset}
+ *
+ * \deprecated This function is deprecated in favor of the function H5Dcreate2()
+ * or the macro H5Dcreate().
+ *
+ * \details H5Dcreate1() creates a data set with a name, \p name, in the
+ * location specified by the identifier \p loc_id. \p loc_id may be a
+ * file, group, dataset, named datatype or attribute. If an attribute,
+ * dataset, or named datatype is specified for \p loc_id then the
+ * dataset will be created at the location where the attribute,
+ * dataset, or named datatype is attached.
+ *
+ * \p name can be a relative path based at \p loc_id or an absolute
+ * path from the root of the file. Use of this function requires that
+ * any intermediate groups specified in the path already exist.
+ *
+ * The dataset’s datatype and dataspace are specified by \p type_id and
+ * \p space_id, respectively. These are the datatype and dataspace of
+ * the dataset as it will exist in the file, which may differ from the
+ * datatype and dataspace in application memory.
+ *
+ * Names within a group are unique: H5Dcreate1() will return an error
+ * if a link with the name specified in name already exists at the
+ * location specified in \p loc_id.
+ *
+ * As is the case for any object in a group, the length of a dataset
+ * name is not limited.
+ *
+ * \p dcpl_id is an #H5P_DATASET_CREATE property list created with \p
+ * H5reate1() and initialized with various property list functions
+ * described in Property List Interface.
+ *
+ * H5Dcreate() and H5Dcreate_anon() return an error if the dataset’s
+ * datatype includes a variable-length (VL) datatype and the fill value
+ * is undefined, i.e., set to \c NULL in the dataset creation property
+ * list. Such a VL datatype may be directly included, indirectly
+ * included as part of a compound or array datatype, or indirectly
+ * included as part of a nested compound or array datatype.
+ *
+ * H5Dcreate() and H5Dcreate_anon() return a dataset identifier for
+ * success or a negative value for failure. The dataset identifier
+ * should eventually be closed by calling H5Dclose() to release
+ * resources it uses.
+ *
+ * See H5Dcreate_anon() for discussion of the differences between
+ * H5Dcreate() and H5Dcreate_anon().
+ *
+ * The HDF5 library provides flexible means of specifying a fill value,
+ * of specifying when space will be allocated for a dataset, and of
+ * specifying when fill values will be written to a dataset.
+ *
+ * \version 1.8.0 Function H5Dcreate() renamed to H5Dcreate1() and deprecated in this release.
+ * \since 1.0.0
+ *
+ * \see H5Dopen2(), H5Dclose(), H5Tset_size()
+ *
+ */
+H5_DLL hid_t H5Dcreate1(hid_t loc_id, const char *name, hid_t type_id, hid_t space_id, hid_t dcpl_id);
+/**
+ * --------------------------------------------------------------------------
+ * \ingroup H5D
+ *
+ * \brief Opens an existing dataset
+ *
+ * \fgdta_loc_id
+ * \param[in] name Name of the dataset to access
+ *
+ * \return \hid_t{dataset}
+ *
+ * \deprecated This function is deprecated in favor of the function H5Dopen2()
+ * or the macro H5Dopen().
+ *
+ * \details H5Dopen1() opens an existing dataset for access at the location
+ * specified by \p loc_id. \p loc_id may be a file, group, dataset,
+ * named datatype or attribute. If an attribute, dataset, or named
+ * datatype is specified for loc_id then the dataset will be opened at
+ * the location where the attribute, dataset, or named datatype is
+ * attached. name is a dataset name and is used to identify the dataset
+ * in the file.
+ *
+ * A dataset opened with this function should be closed with H5Dclose()
+ * when the dataset is no longer needed so that resource leaks will not
+ * develop.
+ *
+ * \version 1.8.0 Function H5Dopen() renamed to H5Dopen1() and deprecated in this release.
+ * \since 1.0.0
+ *
+ */
+H5_DLL hid_t H5Dopen1(hid_t loc_id, const char *name);
+/**
+ * --------------------------------------------------------------------------
+ * \ingroup H5D
+ *
+ * \brief Extends a dataset
+ *
+ * \dset_id
+ * \param[in] size Array containing the new size of each dimension
+ *
+ * \return \herr_t
+ *
+ * \deprecated This function is deprecated in favor of the function H5Dset_extent().
+ *
+ * \details H5Dextend() verifies that the dataset is at least of size \p size,
+ * extending it if necessary. The dimensionality of size is the same as
+ * that of the dataspace of the dataset being changed.
+ *
+ * This function can be applied to the following datasets:
+ * \li Any dataset with unlimited dimensions
+ * \li A dataset with fixed dimensions if the current dimension sizes
+ * are less than the maximum sizes set with \c maxdims
+ * (see H5Screate_simple())
+ *
+ * Space on disk is immediately allocated for the new dataset extent if
+ * the dataset’s space allocation time is set to
+ * #H5D_ALLOC_TIME_EARLY. Fill values will be written to the dataset if
+ * the dataset’s fill time is set to #H5D_FILL_TIME_IFSET or
+ * #H5D_FILL_TIME_ALLOC. (See H5Pset_fill_time() and
+ * H5Pset_alloc_time().)
+ *
+ * This function ensures that the dataset dimensions are of at least
+ * the sizes specified in size. The function H5Dset_extent() must be
+ * used if the dataset dimension sizes are are to be reduced.
+ *
+ * \version 1.8.0 Function Function deprecated in this release. Parameter size
+ * syntax changed to \Code{const hsize_t size[]} in this release.
+ *
+ */
H5_DLL herr_t H5Dextend(hid_t dset_id, const hsize_t size[]);
-H5_DLL herr_t H5Dvlen_reclaim(hid_t type_id, hid_t space_id, hid_t plist_id, void *buf);
+/**
+ * --------------------------------------------------------------------------
+ * \ingroup H5D
+ *
+ * \brief Reclaims variable-length (VL) datatype memory buffers
+ *
+ * \type_id
+ * \space_id
+ * \dxpl_id
+ * \param[in] buf Pointer to the buffer to be reclaimed
+ *
+ * \return \herr_t
+ *
+ * \deprecated This function has been deprecated in HDF5-1.12 in favor of the
+ * function H5Treclaim().
+ *
+ * \details H5Dvlen_reclaim() reclaims memory buffers created to store VL
+ * datatypes.
+ *
+ * The \p type_id must be the datatype stored in the buffer. The \p
+ * space_id describes the selection for the memory buffer to free the
+ * VL datatypes within. The \p dxpl_id is the dataset transfer property
+ * list which was used for the I/O transfer to create the buffer. And
+ * \p buf is the pointer to the buffer to be reclaimed.
+ *
+ * The VL structures (\ref hvl_t) in the user's buffer are modified to
+ * zero out the VL information after the memory has been reclaimed.
+ *
+ * If nested VL datatypes were used to create the buffer, this routine
+ * frees them from the bottom up, releasing all the memory without
+ * creating memory leaks.
+ *
+ * \version 1.12.0 Routine was deprecated
+ *
+ */
+H5_DLL herr_t H5Dvlen_reclaim(hid_t type_id, hid_t space_id, hid_t dxpl_id, void *buf);
#endif /* H5_NO_DEPRECATED_SYMBOLS */
diff --git a/src/H5Dscatgath.c b/src/H5Dscatgath.c
index e8b70e3..971ddfb 100644
--- a/src/H5Dscatgath.c
+++ b/src/H5Dscatgath.c
@@ -370,7 +370,7 @@ H5D__gather_mem(const void *_buf, H5S_sel_iter_t *iter, size_t nelmts, void *_tg
size_t vec_size; /* Vector length */
size_t ret_value = nelmts; /* Number of elements gathered */
- FUNC_ENTER_STATIC
+ FUNC_ENTER_PACKAGE
/* Check args */
HDassert(buf);
@@ -898,198 +898,3 @@ H5D__compound_opt_write(size_t nelmts, const H5D_type_info_t *type_info)
FUNC_LEAVE_NOAPI(SUCCEED)
} /* end H5D__compound_opt_write() */
-
-/*-------------------------------------------------------------------------
- * Function: H5Dscatter
- *
- * Purpose: Scatters data provided by the callback op to the
- * destination buffer dst_buf, where the dimensions of
- * dst_buf and the selection to be scattered to are specified
- * by the dataspace dst_space_id. The type of the data to be
- * scattered is specified by type_id.
- *
- * Return: Non-negative on success/Negative on failure
- *
- * Programmer: Neil Fortner
- * 14 Jan 2013
- *
- *-------------------------------------------------------------------------
- */
-herr_t
-H5Dscatter(H5D_scatter_func_t op, void *op_data, hid_t type_id, hid_t dst_space_id, void *dst_buf)
-{
- H5T_t * type; /* Datatype */
- H5S_t * dst_space; /* Dataspace */
- H5S_sel_iter_t *iter = NULL; /* Selection iteration info*/
- hbool_t iter_init = FALSE; /* Selection iteration info has been initialized */
- const void * src_buf = NULL; /* Source (contiguous) data buffer */
- size_t src_buf_nbytes = 0; /* Size of src_buf */
- size_t type_size; /* Datatype element size */
- hssize_t nelmts; /* Number of remaining elements in selection */
- size_t nelmts_scatter = 0; /* Number of elements to scatter to dst_buf */
- herr_t ret_value = SUCCEED; /* Return value */
-
- FUNC_ENTER_API(FAIL)
- H5TRACE5("e", "DS*xii*x", op, op_data, type_id, dst_space_id, dst_buf);
-
- /* Check args */
- if (op == NULL)
- HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "invalid callback function pointer")
- if (NULL == (type = (H5T_t *)H5I_object_verify(type_id, H5I_DATATYPE)))
- HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a datatype")
- if (NULL == (dst_space = (H5S_t *)H5I_object_verify(dst_space_id, H5I_DATASPACE)))
- HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a dataspace")
- if (dst_buf == NULL)
- HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "no destination buffer provided")
-
- /* Get datatype element size */
- if (0 == (type_size = H5T_GET_SIZE(type)))
- HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, FAIL, "can't get datatype size")
-
- /* Get number of elements in dataspace */
- if ((nelmts = (hssize_t)H5S_GET_SELECT_NPOINTS(dst_space)) < 0)
- HGOTO_ERROR(H5E_DATASET, H5E_CANTCOUNT, FAIL, "unable to get number of elements in selection")
-
- /* Allocate the selection iterator */
- if (NULL == (iter = H5FL_MALLOC(H5S_sel_iter_t)))
- HGOTO_ERROR(H5E_DATASET, H5E_CANTALLOC, FAIL, "can't allocate selection iterator")
-
- /* Initialize selection iterator */
- if (H5S_select_iter_init(iter, dst_space, type_size, 0) < 0)
- HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "unable to initialize selection iterator information")
- iter_init = TRUE;
-
- /* Loop until all data has been scattered */
- while (nelmts > 0) {
- /* Make callback to retrieve data */
- if (op(&src_buf, &src_buf_nbytes, op_data) < 0)
- HGOTO_ERROR(H5E_DATASET, H5E_CALLBACK, FAIL, "callback operator returned failure")
-
- /* Calculate number of elements */
- nelmts_scatter = src_buf_nbytes / type_size;
-
- /* Check callback results */
- if (!src_buf)
- HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "callback did not return a buffer")
- if (src_buf_nbytes == 0)
- HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "callback returned a buffer size of 0")
- if (src_buf_nbytes % type_size)
- HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "buffer size is not a multiple of datatype size")
- if (nelmts_scatter > (size_t)nelmts)
- HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "callback returned more elements than in selection")
-
- /* Scatter data */
- if (H5D__scatter_mem(src_buf, iter, nelmts_scatter, dst_buf) < 0)
- HGOTO_ERROR(H5E_DATASET, H5E_CANTCOPY, FAIL, "scatter failed")
-
- nelmts -= (hssize_t)nelmts_scatter;
- } /* end while */
-
-done:
- /* Release selection iterator */
- if (iter_init && H5S_SELECT_ITER_RELEASE(iter) < 0)
- HDONE_ERROR(H5E_DATASET, H5E_CANTFREE, FAIL, "Can't release selection iterator")
- if (iter)
- iter = H5FL_FREE(H5S_sel_iter_t, iter);
-
- FUNC_LEAVE_API(ret_value)
-} /* H5Dscatter() */
-
-/*-------------------------------------------------------------------------
- * Function: H5Dgather
- *
- * Purpose: Gathers data provided from the source buffer src_buf to
- * contiguous buffer dst_buf, then calls the callback op.
- * The dimensions of src_buf and the selection to be gathered
- * are specified by the dataspace src_space_id. The type of
- * the data to be gathered is specified by type_id.
- *
- * Return: Non-negative on success/Negative on failure
- *
- * Programmer: Neil Fortner
- * 16 Jan 2013
- *
- *-------------------------------------------------------------------------
- */
-herr_t
-H5Dgather(hid_t src_space_id, const void *src_buf, hid_t type_id, size_t dst_buf_size, void *dst_buf,
- H5D_gather_func_t op, void *op_data)
-{
- H5T_t * type; /* Datatype */
- H5S_t * src_space; /* Dataspace */
- H5S_sel_iter_t *iter = NULL; /* Selection iteration info*/
- hbool_t iter_init = FALSE; /* Selection iteration info has been initialized */
- size_t type_size; /* Datatype element size */
- hssize_t nelmts; /* Number of remaining elements in selection */
- size_t dst_buf_nelmts; /* Number of elements that can fit in dst_buf */
- size_t nelmts_gathered; /* Number of elements gathered from src_buf */
- herr_t ret_value = SUCCEED; /* Return value */
-
- FUNC_ENTER_API(FAIL)
- H5TRACE7("e", "i*xiz*xDg*x", src_space_id, src_buf, type_id, dst_buf_size, dst_buf, op, op_data);
-
- /* Check args */
- if (NULL == (src_space = (H5S_t *)H5I_object_verify(src_space_id, H5I_DATASPACE)))
- HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a dataspace")
- if (src_buf == NULL)
- HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "no source buffer provided")
- if (NULL == (type = (H5T_t *)H5I_object_verify(type_id, H5I_DATATYPE)))
- HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a datatype")
- if (dst_buf_size == 0)
- HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "destination buffer size is 0")
- if (dst_buf == NULL)
- HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "no destination buffer provided")
-
- /* Get datatype element size */
- if (0 == (type_size = H5T_GET_SIZE(type)))
- HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, FAIL, "can't get datatype size")
-
- /* Get number of elements in dst_buf_size */
- dst_buf_nelmts = dst_buf_size / type_size;
- if (dst_buf_nelmts == 0)
- HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL,
- "destination buffer is not large enough to hold one element")
-
- /* Get number of elements in dataspace */
- if ((nelmts = (hssize_t)H5S_GET_SELECT_NPOINTS(src_space)) < 0)
- HGOTO_ERROR(H5E_DATASET, H5E_CANTCOUNT, FAIL, "unable to get number of elements in selection")
-
- /* If dst_buf is not large enough to hold all the elements, make sure there
- * is a callback */
- if (((size_t)nelmts > dst_buf_nelmts) && (op == NULL))
- HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "no callback supplied and destination buffer too small")
-
- /* Allocate the selection iterator */
- if (NULL == (iter = H5FL_MALLOC(H5S_sel_iter_t)))
- HGOTO_ERROR(H5E_DATASET, H5E_CANTALLOC, FAIL, "can't allocate selection iterator")
-
- /* Initialize selection iterator */
- if (H5S_select_iter_init(iter, src_space, type_size, 0) < 0)
- HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "unable to initialize selection iterator information")
- iter_init = TRUE;
-
- /* Loop until all data has been scattered */
- while (nelmts > 0) {
- /* Gather data */
- if (0 ==
- (nelmts_gathered = H5D__gather_mem(src_buf, iter, MIN(dst_buf_nelmts, (size_t)nelmts), dst_buf)))
- HGOTO_ERROR(H5E_IO, H5E_CANTCOPY, FAIL, "gather failed")
- HDassert(nelmts_gathered == MIN(dst_buf_nelmts, (size_t)nelmts));
-
- /* Make callback to process dst_buf */
- if (op && op(dst_buf, nelmts_gathered * type_size, op_data) < 0)
- HGOTO_ERROR(H5E_DATASET, H5E_CALLBACK, FAIL, "callback operator returned failure")
-
- nelmts -= (hssize_t)nelmts_gathered;
- HDassert(op || (nelmts == 0));
- } /* end while */
-
-done:
- /* Release selection iterator */
- if (iter_init && H5S_SELECT_ITER_RELEASE(iter) < 0)
- HDONE_ERROR(H5E_DATASET, H5E_CANTFREE, FAIL, "Can't release selection iterator")
- if (iter)
- iter = H5FL_FREE(H5S_sel_iter_t, iter);
-
- FUNC_LEAVE_API(ret_value)
-} /* H5Dgather() */
diff --git a/src/H5Dsingle.c b/src/H5Dsingle.c
index 09f7115..eba569e 100644
--- a/src/H5Dsingle.c
+++ b/src/H5Dsingle.c
@@ -11,7 +11,7 @@
* help@hdfgroup.org. *
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
-/* Programmer: Vailin Choi <vchoi@hdfgroup.org>
+/* Programmer: Vailin Choi
* May 2011; updated 10/2015
*
* Purpose: Single Chunk I/O functions.
@@ -522,7 +522,7 @@ H5D__single_idx_dump(const H5O_storage_chunk_t *storage, FILE *stream)
HDassert(storage);
HDassert(stream);
- HDfprintf(stream, " Address: %a\n", storage->idx_addr);
+ HDfprintf(stream, " Address: %" PRIuHADDR "\n", storage->idx_addr);
FUNC_LEAVE_NOAPI(SUCCEED)
} /* end H5D__single_idx_dump() */
diff --git a/src/H5Dtest.c b/src/H5Dtest.c
index 4317124..f37682d 100644
--- a/src/H5Dtest.c
+++ b/src/H5Dtest.c
@@ -11,7 +11,7 @@
* help@hdfgroup.org. *
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
-/* Programmer: Quincey Koziol <koziol@ncsa.uiuc.edu>
+/* Programmer: Quincey Koziol
* Thursday, May 27, 2004
*
* Purpose: Dataset testing functions.
diff --git a/src/H5Dvirtual.c b/src/H5Dvirtual.c
index 5f3d45e..d1c0266 100644
--- a/src/H5Dvirtual.c
+++ b/src/H5Dvirtual.c
@@ -11,7 +11,7 @@
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
/*
- * Programmer: Neil Fortner <nfortne2@hdfgroup.org>
+ * Programmer: Neil Fortner
* Wednesday, January 28, 2015
*
* Purpose:
@@ -395,8 +395,8 @@ done:
* Purpose: Store virtual dataset layout information, for new dataset
*
* Note: We assume here that the contents of the heap block cannot
- * change! If this ever stops being the case we must change
- * this code to allow overwrites of the heap block. -NAF
+ * change! If this ever stops being the case we must change
+ * this code to allow overwrites of the heap block. -NAF
*
* Return: Success: SUCCEED
* Failure: FAIL
@@ -895,7 +895,7 @@ H5D__virtual_open_source_dset(const H5D_t *vdset, H5O_storage_virtual_ent_t *vir
HDassert(source_dset->dset_name);
/* Check if we need to open the source file */
- if (HDstrcmp(source_dset->file_name, ".")) {
+ if (HDstrcmp(source_dset->file_name, ".") != 0) {
unsigned intent; /* File access permissions */
/* Get the virtual dataset's file open flags ("intent") */
@@ -2228,7 +2228,7 @@ H5D__virtual_init(H5F_t *f, const H5D_t *dset, hid_t dapl_id)
/* Get dataset access property list */
if (NULL == (dapl = (H5P_genplist_t *)H5I_object(dapl_id)))
- HGOTO_ERROR(H5E_ATOM, H5E_BADATOM, FAIL, "can't find object for dapl ID")
+ HGOTO_ERROR(H5E_ID, H5E_BADID, FAIL, "can't find object for dapl ID")
/* Get view option */
if (H5P_get(dapl, H5D_ACS_VDS_VIEW_NAME, &storage->view) < 0)
@@ -2277,7 +2277,7 @@ done:
hbool_t
H5D__virtual_is_space_alloc(const H5O_storage_t H5_ATTR_UNUSED *storage)
{
- hbool_t ret_value; /* Return value */
+ hbool_t ret_value = FALSE; /* Return value */
FUNC_ENTER_PACKAGE_NOERR
@@ -2310,7 +2310,7 @@ H5D__virtual_is_data_cached(const H5D_shared_t *shared_dset)
size_t i, j; /* Local index variables */
hbool_t ret_value = FALSE; /* Return value */
- FUNC_ENTER_PACKAGE_NOERR
+ FUNC_ENTER_STATIC_NOERR
/* Sanity checks */
HDassert(shared_dset);
@@ -2361,7 +2361,7 @@ H5D__virtual_pre_io(H5D_io_info_t *io_info, H5O_storage_virtual_t *storage, cons
hssize_t select_nelmts; /* Number of elements in selection */
hsize_t bounds_start[H5S_MAX_RANK]; /* Selection bounds start */
hsize_t bounds_end[H5S_MAX_RANK]; /* Selection bounds end */
- int rank;
+ int rank = 0;
hbool_t bounds_init = FALSE; /* Whether bounds_start, bounds_end, and rank are valid */
size_t i, j, k; /* Local index variables */
herr_t ret_value = SUCCEED; /* Return value */
diff --git a/src/H5E.c b/src/H5E.c
index 7fc4559..bb90101 100644
--- a/src/H5E.c
+++ b/src/H5E.c
@@ -49,7 +49,6 @@
/* Headers */
/***********/
#include "H5private.h" /* Generic Functions */
-#include "H5CXprivate.h" /* API Contexts */
#include "H5Epkg.h" /* Error handling */
#include "H5FLprivate.h" /* Free lists */
#include "H5Iprivate.h" /* IDs */
@@ -86,6 +85,7 @@ static H5E_t * H5E__get_current_stack(void);
static herr_t H5E__set_current_stack(H5E_t *estack);
static herr_t H5E__close_stack(H5E_t *err_stack);
static ssize_t H5E__get_num(const H5E_t *err_stack);
+static herr_t H5E__append_stack(H5E_t *dst_estack, const H5E_t *src_stack);
/*********************/
/* Package Variables */
@@ -181,17 +181,17 @@ H5E__init_package(void)
FUNC_ENTER_PACKAGE
- /* Initialize the atom group for the error class IDs */
+ /* Initialize the ID group for the error class IDs */
if (H5I_register_type(H5I_ERRCLS_CLS) < 0)
- HGOTO_ERROR(H5E_ATOM, H5E_CANTINIT, FAIL, "unable to initialize ID group")
+ HGOTO_ERROR(H5E_ID, H5E_CANTINIT, FAIL, "unable to initialize ID group")
- /* Initialize the atom group for the major error IDs */
+ /* Initialize the ID group for the major error IDs */
if (H5I_register_type(H5I_ERRMSG_CLS) < 0)
- HGOTO_ERROR(H5E_ATOM, H5E_CANTINIT, FAIL, "unable to initialize ID group")
+ HGOTO_ERROR(H5E_ID, H5E_CANTINIT, FAIL, "unable to initialize ID group")
- /* Initialize the atom group for the error stacks */
+ /* Initialize the ID group for the error stacks */
if (H5I_register_type(H5I_ERRSTK_CLS) < 0)
- HGOTO_ERROR(H5E_ATOM, H5E_CANTINIT, FAIL, "unable to initialize ID group")
+ HGOTO_ERROR(H5E_ID, H5E_CANTINIT, FAIL, "unable to initialize ID group")
#ifndef H5_HAVE_THREADSAFE
H5E_stack_g[0].nused = 0;
@@ -378,7 +378,7 @@ H5E__get_stack(void)
#endif /* H5_HAVE_THREADSAFE */
/*-------------------------------------------------------------------------
- * Function: H5E_free_class
+ * Function: H5E__free_class
*
* Purpose: Private function to free an error class.
*
@@ -390,9 +390,9 @@ H5E__get_stack(void)
*-------------------------------------------------------------------------
*/
static herr_t
-H5E_free_class(H5E_cls_t *cls)
+H5E__free_class(H5E_cls_t *cls)
{
- FUNC_ENTER_NOAPI_NOINIT_NOERR
+ FUNC_ENTER_STATIC_NOERR
/* Check arguments */
HDassert(cls);
@@ -404,7 +404,7 @@ H5E_free_class(H5E_cls_t *cls)
cls = H5FL_FREE(H5E_cls_t, cls);
FUNC_LEAVE_NOAPI(SUCCEED)
-} /* end H5E_free_class() */
+} /* end H5E__free_class() */
/*-------------------------------------------------------------------------
* Function: H5Eregister_class
@@ -487,7 +487,7 @@ H5E__register_class(const char *cls_name, const char *lib_name, const char *vers
done:
if (!ret_value)
- if (cls && H5E_free_class(cls) < 0)
+ if (cls && H5E__free_class(cls) < 0)
HDONE_ERROR(H5E_ERROR, H5E_CANTRELEASE, NULL, "unable to free error class")
FUNC_LEAVE_NOAPI(ret_value)
@@ -498,9 +498,9 @@ done:
*
* Purpose: Closes an error class.
*
- * Return: SUCCEED/FAIL
+ * Return: Non-negative value on success/Negative on failure
*
- * Programmer: Raymond Lu
+ * Programmer: Raymond Lu
* Friday, July 11, 2003
*
*-------------------------------------------------------------------------
@@ -555,7 +555,7 @@ H5E__unregister_class(H5E_cls_t *cls)
HGOTO_ERROR(H5E_ERROR, H5E_BADITER, FAIL, "unable to free all messages in this error class")
/* Free error class structure */
- if (H5E_free_class(cls) < 0)
+ if (H5E__free_class(cls) < 0)
HGOTO_ERROR(H5E_ERROR, H5E_CANTRELEASE, FAIL, "unable to free error class")
done:
@@ -576,13 +576,13 @@ done:
*-------------------------------------------------------------------------
*/
ssize_t
-H5Eget_class_name(hid_t class_id, char *name, size_t size)
+H5Eget_class_name(hid_t class_id, char *name /*out*/, size_t size)
{
H5E_cls_t *cls; /* Pointer to error class */
ssize_t ret_value = -1; /* Return value */
FUNC_ENTER_API((-1))
- H5TRACE3("Zs", "i*sz", class_id, name, size);
+ H5TRACE3("Zs", "ixz", class_id, name, size);
/* Get the error class */
if (NULL == (cls = (H5E_cls_t *)H5I_object_verify(class_id, H5I_ERROR_CLASS)))
@@ -837,13 +837,13 @@ done:
*-------------------------------------------------------------------------
*/
ssize_t
-H5Eget_msg(hid_t msg_id, H5E_type_t *type, char *msg_str, size_t size)
+H5Eget_msg(hid_t msg_id, H5E_type_t *type /*out*/, char *msg_str /*out*/, size_t size)
{
H5E_msg_t *msg; /* Pointer to error message */
ssize_t ret_value = -1; /* Return value */
FUNC_ENTER_API_NOCLEAR((-1))
- H5TRACE4("Zs", "i*Et*sz", msg_id, type, msg_str, size);
+ H5TRACE4("Zs", "ixxz", msg_id, type, msg_str, size);
/* Get the message object */
if (NULL == (msg = (H5E_msg_t *)H5I_object_verify(msg_id, H5I_ERROR_MSG)))
@@ -1014,9 +1014,9 @@ done:
* Purpose: Replaces current stack with specified stack. This closes the
* stack ID also.
*
- * Return: SUCCEED/FAIL
+ * Return: Non-negative value on success/Negative on failure
*
- * Programmer: Raymond Lu
+ * Programmer: Raymond Lu
* Friday, July 15, 2003
*
*-------------------------------------------------------------------------
@@ -1119,9 +1119,9 @@ done:
*
* Purpose: Closes an error stack.
*
- * Return: SUCCEED/FAIL
+ * Return: Non-negative value on success/Negative on failure
*
- * Programmer: Raymond Lu
+ * Programmer: Raymond Lu
* Friday, July 14, 2003
*
*-------------------------------------------------------------------------
@@ -1254,9 +1254,9 @@ H5E__get_num(const H5E_t *estack)
*
* Purpose: Deletes some error messages from the top of error stack.
*
- * Return: SUCCEED/FAIL
+ * Return: Non-negative value on success/Negative on failure
*
- * Programmer: Raymond Lu
+ * Programmer: Raymond Lu
* Friday, July 16, 2003
*
*-------------------------------------------------------------------------
@@ -1309,9 +1309,9 @@ done:
* function name, file name, and error description strings must
* be statically allocated.
*
- * Return: SUCCEED/FAIL
+ * Return: Non-negative on success/Negative on failure
*
- * Programmer: Quincey Koziol
+ * Programmer: Quincey Koziol
* Monday, October 18, 1999
*
* Notes: Basically a new public API wrapper around the H5E__push_stack
@@ -1319,16 +1319,13 @@ done:
*
*-------------------------------------------------------------------------
*/
+H5_ATTR_FORMAT(printf, 8, 9)
herr_t
H5Epush2(hid_t err_stack, const char *file, const char *func, unsigned line, hid_t cls_id, hid_t maj_id,
hid_t min_id, const char *fmt, ...)
{
- va_list ap; /* Varargs info */
- H5E_t * estack; /* Pointer to error stack to modify */
-#ifndef H5_HAVE_VASPRINTF
- int tmp_len; /* Current size of description buffer */
- int desc_len; /* Actual length of description when formatted */
-#endif /* H5_HAVE_VASPRINTF */
+ va_list ap; /* Varargs info */
+ H5E_t * estack; /* Pointer to error stack to modify */
char * tmp = NULL; /* Buffer to place formatted description in */
hbool_t va_started = FALSE; /* Whether the variable argument list is open */
herr_t ret_value = SUCCEED; /* Return value */
@@ -1357,31 +1354,9 @@ H5Epush2(hid_t err_stack, const char *file, const char *func, unsigned line, hid
HDva_start(ap, fmt);
va_started = TRUE;
-#ifdef H5_HAVE_VASPRINTF
/* Use the vasprintf() routine, since it does what we're trying to do below */
if (HDvasprintf(&tmp, fmt, ap) < 0)
HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "memory allocation failed")
-#else /* H5_HAVE_VASPRINTF */
- /* Allocate space for the formatted description buffer */
- tmp_len = 128;
- if (NULL == (tmp = H5MM_malloc((size_t)tmp_len)))
- HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "memory allocation failed")
-
- /* If the description doesn't fit into the initial buffer size, allocate more space and try again */
- while ((desc_len = HDvsnprintf(tmp, (size_t)tmp_len, fmt, ap)) > (tmp_len - 1)) {
- /* shutdown & restart the va_list */
- HDva_end(ap);
- HDva_start(ap, fmt);
-
- /* Release the previous description, it's too small */
- H5MM_xfree(tmp);
-
- /* Allocate a description of the appropriate length */
- tmp_len = desc_len + 1;
- if (NULL == (tmp = H5MM_malloc((size_t)tmp_len)))
- HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "memory allocation failed")
- } /* end while */
-#endif /* H5_HAVE_VASPRINTF */
/* Push the error on the stack */
if (H5E__push_stack(estack, file, func, line, cls_id, maj_id, min_id, tmp) < 0)
@@ -1390,16 +1365,11 @@ H5Epush2(hid_t err_stack, const char *file, const char *func, unsigned line, hid
done:
if (va_started)
HDva_end(ap);
-#ifdef H5_HAVE_VASPRINTF
/* Memory was allocated with HDvasprintf so it needs to be freed
* with HDfree
*/
if (tmp)
HDfree(tmp);
-#else /* H5_HAVE_VASPRINTF */
- if (tmp)
- H5MM_xfree(tmp);
-#endif /* H5_HAVE_VASPRINTF */
FUNC_LEAVE_API(ret_value)
} /* end H5Epush2() */
@@ -1409,9 +1379,9 @@ done:
*
* Purpose: Clears the error stack for the specified error stack.
*
- * Return: SUCCEED/FAIL
+ * Return: Non-negative on success/Negative on failure
*
- * Programmer: Raymond Lu
+ * Programmer: Raymond Lu
* Wednesday, July 16, 2003
*
*-------------------------------------------------------------------------
@@ -1453,9 +1423,9 @@ done:
* prints error messages. Users are encouraged to write their
* own more specific error handlers.
*
- * Return: SUCCEED/FAIL
+ * Return: Non-negative on success/Negative on failure
*
- * Programmer: Robb Matzke
+ * Programmer: Robb Matzke
* Friday, February 27, 1998
*
*-------------------------------------------------------------------------
@@ -1498,9 +1468,9 @@ done:
* Purpose: Walks the error stack for the current thread and calls some
* function for each error along the way.
*
- * Return: SUCCEED/FAIL
+ * Return: Non-negative on success/Negative on failure
*
- * Programmer: Robb Matzke
+ * Programmer: Robb Matzke
* Friday, February 27, 1998
*
*-------------------------------------------------------------------------
@@ -1548,7 +1518,7 @@ done:
* Either (or both) arguments may be null in which case the
* value is not returned.
*
- * Return: SUCCEED/FAIL
+ * Return: Non-negative value on success/Negative on failure
*
* Programmer: Robb Matzke
* Saturday, February 28, 1998
@@ -1556,14 +1526,14 @@ done:
*-------------------------------------------------------------------------
*/
herr_t
-H5Eget_auto2(hid_t estack_id, H5E_auto2_t *func, void **client_data)
+H5Eget_auto2(hid_t estack_id, H5E_auto2_t *func /*out*/, void **client_data /*out*/)
{
H5E_t * estack; /* Error stack to operate on */
H5E_auto_op_t op; /* Error stack function */
herr_t ret_value = SUCCEED; /* Return value */
FUNC_ENTER_API(FAIL)
- H5TRACE3("e", "i*EA**x", estack_id, func, client_data);
+ H5TRACE3("e", "ixx", estack_id, func, client_data);
if (estack_id == H5E_DEFAULT) {
if (NULL == (estack = H5E__get_my_stack())) /*lint !e506 !e774 Make lint 'constant value Boolean' in
@@ -1605,7 +1575,7 @@ done:
* Automatic stack traversal is always in the H5E_WALK_DOWNWARD
* direction.
*
- * Return: SUCCEED/FAIL
+ * Return: Non-negative value on success/Negative on failure
*
* Programmer: Robb Matzke
* Friday, February 27, 1998
@@ -1663,7 +1633,7 @@ done:
* or the H5E_auto_t typedef. The IS_STACK parameter is set
* to 1 for the first case and 0 for the latter case.
*
- * Return: SUCCEED/FAIL
+ * Return: Non-negative value on success/Negative on failure
*
* Programmer: Quincey Koziol
* Wednesday, September 8, 2004
@@ -1698,3 +1668,111 @@ H5Eauto_is_v2(hid_t estack_id, unsigned *is_stack)
done:
FUNC_LEAVE_API(ret_value)
} /* end H5Eauto_is_v2() */
+
+/*-------------------------------------------------------------------------
+ * Function: H5Eappend_stack
+ *
+ * Purpose: Appends one error stack to another, optionally closing the
+ * source stack.
+ *
+ * Return: Non-negative value on success/Negative on failure
+ *
+ * Programmer: Quincey Koziol
+ * Wednesday, October 7, 2020
+ *
+ *-------------------------------------------------------------------------
+ */
+herr_t
+H5Eappend_stack(hid_t dst_stack_id, hid_t src_stack_id, hbool_t close_source_stack)
+{
+ H5E_t *dst_stack, *src_stack; /* Error stacks */
+ herr_t ret_value = SUCCEED; /* Return value */
+
+ /* Don't clear the error stack! :-) */
+ FUNC_ENTER_API(FAIL)
+ H5TRACE3("e", "iib", dst_stack_id, src_stack_id, close_source_stack);
+
+ /* Check args */
+ if (NULL == (dst_stack = (H5E_t *)H5I_object_verify(dst_stack_id, H5I_ERROR_STACK)))
+ HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "dst_stack_id not a error stack ID")
+ if (NULL == (src_stack = (H5E_t *)H5I_object_verify(src_stack_id, H5I_ERROR_STACK)))
+ HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "src_stack_id not a error stack ID")
+
+ /* Append the source stack to the destination stack */
+ if (H5E__append_stack(dst_stack, src_stack) < 0)
+ HGOTO_ERROR(H5E_ERROR, H5E_CANTAPPEND, FAIL, "can't append stack")
+
+ /* Close source error stack, if requested */
+ if (close_source_stack)
+ /* Decrement the counter on the error stack. It will be freed if the
+ * count reaches zero.
+ */
+ if (H5I_dec_app_ref(src_stack_id) < 0)
+ HGOTO_ERROR(H5E_ERROR, H5E_CANTDEC, FAIL, "unable to decrement ref count on source error stack")
+
+done:
+ FUNC_LEAVE_API(ret_value)
+} /* end H5Eappend_stack() */
+
+/*-------------------------------------------------------------------------
+ * Function: H5E__append_stack
+ *
+ * Purpose: Private function to append error stacks.
+ *
+ * Return: Non-negative value on success/Negative on failure
+ *
+ * Programmer: Quincey Koziol
+ * Wednesday, October 7, 2020
+ *
+ *-------------------------------------------------------------------------
+ */
+static herr_t
+H5E__append_stack(H5E_t *dst_stack, const H5E_t *src_stack)
+{
+ unsigned u; /* Local index variable */
+ herr_t ret_value = SUCCEED; /* Return value */
+
+ FUNC_ENTER_STATIC
+
+ /* Sanity checks */
+ HDassert(dst_stack);
+ HDassert(src_stack);
+
+ /* Copy the errors from the source stack to the destination stack */
+ for (u = 0; u < src_stack->nused; u++) {
+ const H5E_error2_t *src_error; /* Pointers to source error on stack */
+ H5E_error2_t * dst_error; /* Pointers to destination error on stack */
+
+ /* Get pointers into the current error stack location */
+ src_error = &(src_stack->slot[u]);
+ dst_error = &(dst_stack->slot[dst_stack->nused]);
+
+ /* Increment the IDs to indicate that they are used in this stack */
+ if (H5I_inc_ref(src_error->cls_id, FALSE) < 0)
+ HGOTO_ERROR(H5E_ERROR, H5E_CANTINC, FAIL, "unable to increment ref count on error class")
+ dst_error->cls_id = src_error->cls_id;
+ if (H5I_inc_ref(src_error->maj_num, FALSE) < 0)
+ HGOTO_ERROR(H5E_ERROR, H5E_CANTINC, FAIL, "unable to increment ref count on error message")
+ dst_error->maj_num = src_error->maj_num;
+ if (H5I_inc_ref(src_error->min_num, FALSE) < 0)
+ HGOTO_ERROR(H5E_ERROR, H5E_CANTINC, FAIL, "unable to increment ref count on error message")
+ dst_error->min_num = src_error->min_num;
+ if (NULL == (dst_error->func_name = H5MM_xstrdup(src_error->func_name)))
+ HGOTO_ERROR(H5E_ERROR, H5E_CANTALLOC, FAIL, "memory allocation failed")
+ if (NULL == (dst_error->file_name = H5MM_xstrdup(src_error->file_name)))
+ HGOTO_ERROR(H5E_ERROR, H5E_CANTALLOC, FAIL, "memory allocation failed")
+ dst_error->line = src_error->line;
+ if (NULL == (dst_error->desc = H5MM_xstrdup(src_error->desc)))
+ HGOTO_ERROR(H5E_ERROR, H5E_CANTALLOC, FAIL, "memory allocation failed")
+
+ /* Increment # of errors in destination stack */
+ dst_stack->nused++;
+
+ /* Check for destination stack full */
+ if (dst_stack->nused >= H5E_NSLOTS)
+ break;
+ } /* end for */
+
+done:
+ FUNC_LEAVE_NOAPI(ret_value)
+} /* end H5E__append_stack() */
diff --git a/src/H5EA.c b/src/H5EA.c
index 1ccc860..4d6b7c1 100644
--- a/src/H5EA.c
+++ b/src/H5EA.c
@@ -15,7 +15,7 @@
*
* Created: H5EA.c
* Jun 17 2008
- * Quincey Koziol <koziol@hdfgroup.org>
+ * Quincey Koziol
*
* Purpose: Implements an "extensible array" for storing elements
* in an array whose high bounds can extend and shrink.
@@ -112,7 +112,6 @@ H5FL_BLK_DEFINE(ea_native_elmt);
* NULL on failure
*
* Programmer: Quincey Koziol
- * koziol@lbl.gov
* Oct 10 2016
*
*-------------------------------------------------------------------------
@@ -176,7 +175,6 @@ END_FUNC(STATIC) /* end H5EA__new() */
* NULL on failure
*
* Programmer: Quincey Koziol
- * koziol@hdfgroup.org
* Jun 17 2008
*
*-------------------------------------------------------------------------
@@ -225,7 +223,6 @@ END_FUNC(PRIV) /* end H5EA_create() */
* NULL on failure
*
* Programmer: Quincey Koziol
- * koziol@hdfgroup.org
* Aug 28 2008
*
*-------------------------------------------------------------------------
@@ -264,7 +261,6 @@ END_FUNC(PRIV) /* end H5EA_open() */
* Return: SUCCEED/FAIL
*
* Programmer: Quincey Koziol
- * koziol@hdfgroup.org
* Aug 21 2008
*
*-------------------------------------------------------------------------
@@ -292,7 +288,6 @@ END_FUNC(PRIV) /* end H5EA_get_nelmts() */
* Return: SUCCEED/FAIL
*
* Programmer: Quincey Koziol
- * koziol@hdfgroup.org
* Aug 21 2008
*
*-------------------------------------------------------------------------
@@ -322,7 +317,6 @@ END_FUNC(PRIV) /* end H5EA_get_addr() */
* Return: SUCCEED/FAIL
*
* Programmer: Quincey Koziol
- * koziol@hdfgroup.org
* Sep 9 2008
*
*-------------------------------------------------------------------------
@@ -514,10 +508,11 @@ BEGIN_FUNC(STATIC, ERR, herr_t, SUCCEED, FAIL,
*/
if (will_extend && !sblock->has_hdr_depend) {
if (H5EA__create_flush_depend((H5AC_info_t *)sblock->hdr, (H5AC_info_t *)sblock) < 0)
- H5E_THROW(H5E_CANTDEPEND,
- "unable to create flush dependency between super block and header, "
- "address = %llu",
- (unsigned long long)sblock->addr)
+ H5E_THROW(
+ H5E_CANTDEPEND,
+ "unable to create flush dependency between super block and header, address "
+ "= %llu",
+ (unsigned long long)sblock->addr)
sblock->has_hdr_depend = TRUE;
} /* end if */
} /* end if */
@@ -655,7 +650,6 @@ END_FUNC(STATIC) /* end H5EA__lookup_elmt() */
* Return: SUCCEED/FAIL
*
* Programmer: Quincey Koziol
- * koziol@hdfgroup.org
* Sep 9 2008
*
*-------------------------------------------------------------------------
@@ -719,7 +713,6 @@ END_FUNC(PRIV) /* end H5EA_set() */
* Return: SUCCEED/FAIL
*
* Programmer: Quincey Koziol
- * koziol@hdfgroup.org
* Sep 11 2008
*
*-------------------------------------------------------------------------
@@ -729,7 +722,8 @@ BEGIN_FUNC(PRIV, ERR, herr_t, SUCCEED, FAIL, H5EA_get(const H5EA_t *ea, hsize_t
/* Local variables */
H5EA_hdr_t *hdr = ea->hdr; /* Header for EA */
void *thing = NULL; /* Pointer to the array metadata containing the array index we are interested in */
- H5EA__unprotect_func_t thing_unprot_func; /* Function pointer for unprotecting the array metadata */
+ H5EA__unprotect_func_t thing_unprot_func =
+ NULL; /* Function pointer for unprotecting the array metadata */
/*
* Check arguments.
@@ -783,7 +777,6 @@ END_FUNC(PRIV) /* end H5EA_get() */
* Return: SUCCEED/FAIL
*
* Programmer: Quincey Koziol
- * koziol@hdfgroup.org
* May 27 2009
*
*-------------------------------------------------------------------------
@@ -830,7 +823,6 @@ END_FUNC(PRIV) /* end H5EA_depend() */
* Return: SUCCEED/FAIL
*
* Programmer: Quincey Koziol
- * koziol@hdfgroup.org
* Aug 21 2008
*
*-------------------------------------------------------------------------
@@ -930,7 +922,6 @@ END_FUNC(PRIV) /* end H5EA_close() */
* Return: SUCCEED/FAIL
*
* Programmer: Quincey Koziol
- * koziol@hdfgroup.org
* Aug 28 2008
*
*-------------------------------------------------------------------------
diff --git a/src/H5EAcache.c b/src/H5EAcache.c
index cdabcff..7e89592 100644
--- a/src/H5EAcache.c
+++ b/src/H5EAcache.c
@@ -15,7 +15,7 @@
*
* Created: H5EAcache.c
* Aug 26 2008
- * Quincey Koziol <koziol@hdfgroup.org>
+ * Quincey Koziol
*
* Purpose: Implement extensible array metadata cache methods.
*
@@ -222,7 +222,6 @@ const H5AC_class_t H5AC_EARRAY_DBLK_PAGE[1] = {{
* Return: Non-negative on success/Negative on failure
*
* Programmer: Quincey Koziol
- * koziol@hdfgroup.org
* July 16, 2013
*
*-------------------------------------------------------------------------
@@ -284,7 +283,6 @@ END_FUNC(STATIC) /* end H5EA__cache_hdr_verify_chksum() */
* Failure: NULL
*
* Programmer: Quincey Koziol
- * koziol@hdfgroup.org
* July 16, 2013
*
*-------------------------------------------------------------------------
@@ -314,7 +312,7 @@ BEGIN_FUNC(STATIC, ERR, void *, NULL, NULL,
hdr->addr = udata->addr;
/* Magic number */
- if (HDmemcmp(image, H5EA_HDR_MAGIC, (size_t)H5_SIZEOF_MAGIC))
+ if (HDmemcmp(image, H5EA_HDR_MAGIC, (size_t)H5_SIZEOF_MAGIC) != 0)
H5E_THROW(H5E_BADVALUE, "wrong extensible array header signature")
image += H5_SIZEOF_MAGIC;
@@ -409,7 +407,6 @@ END_FUNC(STATIC) /* end H5EA__cache_hdr_deserialize() */
* Return: Non-negative on success/Negative on failure
*
* Programmer: Quincey Koziol
- * koziol@hdfgroup.org
* July 16, 2013
*
*-------------------------------------------------------------------------
@@ -437,7 +434,6 @@ END_FUNC(STATIC) /* end H5EA__cache_hdr_image_len() */
* Return: Non-negative on success/Negative on failure
*
* Programmer: Quincey Koziol
- * koziol@hdfgroup.org
* July 16, 2013
*
*-------------------------------------------------------------------------
@@ -469,7 +465,7 @@ BEGIN_FUNC(STATIC, NOERR, herr_t, SUCCEED, -,
/* General array creation/configuration information */
*image++ = hdr->cparam.raw_elmt_size; /* Element size in file (in bytes) */
*image++ = hdr->cparam.max_nelmts_bits; /* Log2(Max. # of elements in array) - i.e. # of bits needed to
- store max. # of elements */
+ store max. # of elements */
*image++ = hdr->cparam.idx_blk_elmts; /* # of elements to store in index block */
*image++ = hdr->cparam.data_blk_min_elmts; /* Min. # of elements per data block */
*image++ = hdr->cparam.sup_blk_min_data_ptrs; /* Min. # of data block pointers for a super block */
@@ -585,7 +581,6 @@ END_FUNC(STATIC) /* end H5EA__cache_hdr_notify() */
* Return: Non-negative on success/Negative on failure
*
* Programmer: Quincey Koziol
- * koziol@hdfgroup.org
* July 16, 2013
*
*-------------------------------------------------------------------------
@@ -611,7 +606,6 @@ END_FUNC(STATIC) /* end H5EA__cache_hdr_free_icr() */
* Return: Non-negative on success/Negative on failure
*
* Programmer: Quincey Koziol
- * koziol@hdfgroup.org
* July 17, 2013
*
*-------------------------------------------------------------------------
@@ -680,7 +674,6 @@ END_FUNC(STATIC) /* end H5EA__cache_iblock_verify_chksum() */
* Failure: NULL
*
* Programmer: Quincey Koziol
- * koziol@hdfgroup.org
* July 17, 2013
*
*-------------------------------------------------------------------------
@@ -709,7 +702,7 @@ BEGIN_FUNC(STATIC, ERR, void *, NULL, NULL,
iblock->addr = hdr->idx_blk_addr;
/* Magic number */
- if (HDmemcmp(image, H5EA_IBLOCK_MAGIC, (size_t)H5_SIZEOF_MAGIC))
+ if (HDmemcmp(image, H5EA_IBLOCK_MAGIC, (size_t)H5_SIZEOF_MAGIC) != 0)
H5E_THROW(H5E_BADVALUE, "wrong extensible array index block signature")
image += H5_SIZEOF_MAGIC;
@@ -786,7 +779,6 @@ END_FUNC(STATIC) /* end H5EA__cache_iblock_deserialize() */
* Return: Non-negative on success/Negative on failure
*
* Programmer: Quincey Koziol
- * koziol@hdfgroup.org
* July 17, 2013
*
*-------------------------------------------------------------------------
@@ -814,7 +806,6 @@ END_FUNC(STATIC) /* end H5EA__cache_iblock_image_len() */
* Return: Non-negative on success/Negative on failure
*
* Programmer: Quincey Koziol
- * koziol@hdfgroup.org
* July 17, 2013
*
*-------------------------------------------------------------------------
@@ -900,7 +891,6 @@ END_FUNC(STATIC) /* end H5EA__cache_iblock_serialize() */
* Return: Non-negative on success/Negative on failure
*
* Programmer: Quincey Koziol
- * koziol@hdfgroup.org
* July 17, 2013
*
*-------------------------------------------------------------------------
@@ -972,7 +962,6 @@ END_FUNC(STATIC) /* end H5EA__cache_iblock_notify() */
* Return: Non-negative on success/Negative on failure
*
* Programmer: Quincey Koziol
- * koziol@hdfgroup.org
* July 17, 2013
*
*-------------------------------------------------------------------------
@@ -998,7 +987,6 @@ END_FUNC(STATIC) /* end H5EA__cache_iblock_free_icr() */
* Return: Non-negative on success/Negative on failure
*
* Programmer: Quincey Koziol
- * koziol@hdfgroup.org
* July 17, 2013
*
*-------------------------------------------------------------------------
@@ -1086,7 +1074,6 @@ END_FUNC(STATIC) /* end H5EA__cache_sblock_verify_chksum() */
* Failure: NULL
*
* Programmer: Quincey Koziol
- * koziol@hdfgroup.org
* July 17, 2013
*
*-------------------------------------------------------------------------
@@ -1118,7 +1105,7 @@ BEGIN_FUNC(STATIC, ERR, void *, NULL, NULL,
sblock->addr = udata->sblk_addr;
/* Magic number */
- if (HDmemcmp(image, H5EA_SBLOCK_MAGIC, (size_t)H5_SIZEOF_MAGIC))
+ if (HDmemcmp(image, H5EA_SBLOCK_MAGIC, (size_t)H5_SIZEOF_MAGIC) != 0)
H5E_THROW(H5E_BADVALUE, "wrong extensible array super block signature")
image += H5_SIZEOF_MAGIC;
@@ -1189,7 +1176,6 @@ END_FUNC(STATIC) /* end H5EA__cache_sblock_deserialize() */
* Return: Non-negative on success/Negative on failure
*
* Programmer: Quincey Koziol
- * koziol@hdfgroup.org
* July 17, 2013
*
*-------------------------------------------------------------------------
@@ -1217,7 +1203,6 @@ END_FUNC(STATIC) /* end H5EA__cache_sblock_image_len() */
* Return: Non-negative on success/Negative on failure
*
* Programmer: Quincey Koziol
- * koziol@hdfgroup.org
* July 17, 2013
*
*-------------------------------------------------------------------------
@@ -1290,7 +1275,6 @@ END_FUNC(STATIC) /* end H5EA__cache_sblock_serialize() */
* Return: Non-negative on success/Negative on failure
*
* Programmer: Quincey Koziol
- * koziol@hdfgroup.org
* Mar 31 2009
*
*-------------------------------------------------------------------------
@@ -1385,7 +1369,6 @@ END_FUNC(STATIC) /* end H5EA__cache_sblock_notify() */
* Return: Non-negative on success/Negative on failure
*
* Programmer: Quincey Koziol
- * koziol@hdfgroup.org
* July 17, 2013
*
*-------------------------------------------------------------------------
@@ -1411,7 +1394,6 @@ END_FUNC(STATIC) /* end H5EA__cache_sblock_free_icr() */
* Return: Non-negative on success/Negative on failure
*
* Programmer: Quincey Koziol
- * koziol@hdfgroup.org
* July 17, 2013
*
*-------------------------------------------------------------------------
@@ -1500,7 +1482,6 @@ END_FUNC(STATIC) /* end H5EA__cache_sblock_verify_chksum() */
* Failure: NULL
*
* Programmer: Quincey Koziol
- * koziol@hdfgroup.org
* July 17, 2013
*
*-------------------------------------------------------------------------
@@ -1534,7 +1515,7 @@ BEGIN_FUNC(STATIC, ERR, void *, NULL, NULL,
dblock->addr = udata->dblk_addr;
/* Magic number */
- if (HDmemcmp(image, H5EA_DBLOCK_MAGIC, (size_t)H5_SIZEOF_MAGIC))
+ if (HDmemcmp(image, H5EA_DBLOCK_MAGIC, (size_t)H5_SIZEOF_MAGIC) != 0)
H5E_THROW(H5E_BADVALUE, "wrong extensible array data block signature")
image += H5_SIZEOF_MAGIC;
@@ -1601,7 +1582,6 @@ END_FUNC(STATIC) /* end H5EA__cache_dblock_deserialize() */
* Return: Non-negative on success/Negative on failure
*
* Programmer: Quincey Koziol
- * koziol@hdfgroup.org
* July 17, 2013
*
*-------------------------------------------------------------------------
@@ -1632,7 +1612,6 @@ END_FUNC(STATIC) /* end H5EA__cache_dblock_image_len() */
* Return: Non-negative on success/Negative on failure
*
* Programmer: Quincey Koziol
- * koziol@hdfgroup.org
* July 17, 2013
*
*-------------------------------------------------------------------------
@@ -1702,7 +1681,6 @@ END_FUNC(STATIC) /* end H5EA__cache_dblock_serialize() */
* Return: Non-negative on success/Negative on failure
*
* Programmer: Quincey Koziol
- * koziol@hdfgroup.org
* Mar 31 2009
*
*-------------------------------------------------------------------------
@@ -1795,7 +1773,6 @@ END_FUNC(STATIC) /* end H5EA__cache_dblock_notify() */
* Return: Non-negative on success/Negative on failure
*
* Programmer: Quincey Koziol
- * koziol@hdfgroup.org
* July 17, 2013
*
*-------------------------------------------------------------------------
@@ -1866,7 +1843,6 @@ END_FUNC(STATIC) /* end H5EA__cache_dblock_fsf_size() */
* Return: Non-negative on success/Negative on failure
*
* Programmer: Quincey Koziol
- * koziol@hdfgroup.org
* July 17, 2013
*
*-------------------------------------------------------------------------
@@ -1928,7 +1904,6 @@ END_FUNC(STATIC) /* end H5EA__cache_dblk_page_verify_chksum() */
* Failure: NULL
*
* Programmer: Quincey Koziol
- * koziol@hdfgroup.org
* July 17, 2013
*
*-------------------------------------------------------------------------
@@ -2001,7 +1976,6 @@ END_FUNC(STATIC) /* end H5EA__cache_dblk_page_deserialize() */
* Return: Non-negative on success/Negative on failure
*
* Programmer: Quincey Koziol
- * koziol@hdfgroup.org
* July 17, 2013
*
*-------------------------------------------------------------------------
@@ -2029,7 +2003,6 @@ END_FUNC(STATIC) /* end H5EA__cache_dblk_page_image_len() */
* Return: Non-negative on success/Negative on failure
*
* Programmer: Quincey Koziol
- * koziol@hdfgroup.org
* July 17, 2013
*
*-------------------------------------------------------------------------
@@ -2080,7 +2053,6 @@ END_FUNC(STATIC) /* end H5EA__cache_dblk_page_serialize() */
* Return: Non-negative on success/Negative on failure
*
* Programmer: Quincey Koziol
- * koziol@hdfgroup.org
* Mar 31 2009
*
*-------------------------------------------------------------------------
@@ -2139,8 +2111,9 @@ BEGIN_FUNC(STATIC, ERR, herr_t, SUCCEED, FAIL,
/* Detach from 'top' proxy for extensible array */
if (dblk_page->top_proxy) {
if (H5AC_proxy_entry_remove_child(dblk_page->top_proxy, dblk_page) < 0)
- H5E_THROW(H5E_CANTUNDEPEND, "unable to destroy flush dependency between data block page "
- "and extensible array 'top' proxy")
+ H5E_THROW(H5E_CANTUNDEPEND,
+ "unable to destroy flush dependency between data block page and "
+ "extensible array 'top' proxy")
dblk_page->top_proxy = NULL;
} /* end if */
break;
@@ -2175,7 +2148,6 @@ END_FUNC(STATIC) /* end H5EA__cache_dblk_page_notify() */
* Return: Non-negative on success/Negative on failure
*
* Programmer: Quincey Koziol
- * koziol@hdfgroup.org
* July 17, 2013
*
*-------------------------------------------------------------------------
diff --git a/src/H5EAdbg.c b/src/H5EAdbg.c
index 038df1d..72d2f38 100644
--- a/src/H5EAdbg.c
+++ b/src/H5EAdbg.c
@@ -111,10 +111,10 @@ BEGIN_FUNC(PKG, ERR, herr_t, SUCCEED, FAIL,
/* Print the values */
HDfprintf(stream, "%*s%-*s %s\n", indent, "", fwidth, "Array class ID:", hdr->cparam.cls->name);
- HDfprintf(stream, "%*s%-*s %Zu\n", indent, "", fwidth, "Header size:", hdr->size);
+ HDfprintf(stream, "%*s%-*s %zu\n", indent, "", fwidth, "Header size:", hdr->size);
HDfprintf(stream, "%*s%-*s %u\n", indent, "", fwidth,
"Raw Element Size:", (unsigned)hdr->cparam.raw_elmt_size);
- HDfprintf(stream, "%*s%-*s %Zu\n", indent, "", fwidth,
+ HDfprintf(stream, "%*s%-*s %zu\n", indent, "", fwidth,
"Native Element Size (on this platform):", hdr->cparam.cls->nat_elmt_size);
HDfprintf(stream, "%*s%-*s %u\n", indent, "", fwidth,
"Log2(Max. # of elements in array):", (unsigned)hdr->cparam.max_nelmts_bits);
@@ -126,15 +126,16 @@ BEGIN_FUNC(PKG, ERR, herr_t, SUCCEED, FAIL,
(unsigned)hdr->cparam.sup_blk_min_data_ptrs);
HDfprintf(stream, "%*s%-*s %u\n", indent, "", fwidth, "Log2(Max. # of elements in data block page):",
(unsigned)hdr->cparam.max_dblk_page_nelmts_bits);
- HDfprintf(stream, "%*s%-*s %Hu\n", indent, "", fwidth,
+ HDfprintf(stream, "%*s%-*s %" PRIuHSIZE "\n", indent, "", fwidth,
"Highest element index stored (+1):", hdr->stats.stored.max_idx_set);
- HDfprintf(stream, "%*s%-*s %Hu\n", indent, "", fwidth,
+ HDfprintf(stream, "%*s%-*s %" PRIuHSIZE "\n", indent, "", fwidth,
"Number of super blocks created:", hdr->stats.stored.nsuper_blks);
- HDfprintf(stream, "%*s%-*s %Hu\n", indent, "", fwidth,
+ HDfprintf(stream, "%*s%-*s %" PRIuHSIZE "\n", indent, "", fwidth,
"Number of data blocks created:", hdr->stats.stored.ndata_blks);
- HDfprintf(stream, "%*s%-*s %Hu\n", indent, "", fwidth,
+ HDfprintf(stream, "%*s%-*s %" PRIuHSIZE "\n", indent, "", fwidth,
"Number of elements 'realized':", hdr->stats.stored.nelmts);
- HDfprintf(stream, "%*s%-*s %a\n", indent, "", fwidth, "Index Block Address:", hdr->idx_blk_addr);
+ HDfprintf(stream, "%*s%-*s %" PRIuHADDR "\n", indent, "", fwidth,
+ "Index Block Address:", hdr->idx_blk_addr);
CATCH
if (dbg_ctx && cls->dst_dbg_ctx(dbg_ctx) < 0)
@@ -198,10 +199,10 @@ BEGIN_FUNC(PKG, ERR, herr_t, SUCCEED, FAIL,
/* Print the values */
HDfprintf(stream, "%*s%-*s %s\n", indent, "", fwidth, "Array class ID:", hdr->cparam.cls->name);
- HDfprintf(stream, "%*s%-*s %Zu\n", indent, "", fwidth, "Index Block size:", iblock->size);
- HDfprintf(stream, "%*s%-*s %Zu\n", indent, "", fwidth,
+ HDfprintf(stream, "%*s%-*s %zu\n", indent, "", fwidth, "Index Block size:", iblock->size);
+ HDfprintf(stream, "%*s%-*s %zu\n", indent, "", fwidth,
"# of data block addresses in index block:", iblock->ndblk_addrs);
- HDfprintf(stream, "%*s%-*s %Zu\n", indent, "", fwidth,
+ HDfprintf(stream, "%*s%-*s %zu\n", indent, "", fwidth,
"# of super block addresses in index block:", iblock->nsblk_addrs);
/* Check if there are any elements in index block */
@@ -229,7 +230,7 @@ BEGIN_FUNC(PKG, ERR, herr_t, SUCCEED, FAIL,
for (u = 0; u < iblock->ndblk_addrs; u++) {
/* Print address */
HDsprintf(temp_str, "Address #%u:", u);
- HDfprintf(stream, "%*s%-*s %a\n", (indent + 3), "", MAX(0, (fwidth - 3)), temp_str,
+ HDfprintf(stream, "%*s%-*s %" PRIuHADDR "\n", (indent + 3), "", MAX(0, (fwidth - 3)), temp_str,
iblock->dblk_addrs[u]);
} /* end for */
} /* end if */
@@ -244,7 +245,7 @@ BEGIN_FUNC(PKG, ERR, herr_t, SUCCEED, FAIL,
for (u = 0; u < iblock->nsblk_addrs; u++) {
/* Print address */
HDsprintf(temp_str, "Address #%u:", u);
- HDfprintf(stream, "%*s%-*s %a\n", (indent + 3), "", MAX(0, (fwidth - 3)), temp_str,
+ HDfprintf(stream, "%*s%-*s %" PRIuHADDR "\n", (indent + 3), "", MAX(0, (fwidth - 3)), temp_str,
iblock->sblk_addrs[u]);
} /* end for */
} /* end if */
@@ -312,10 +313,10 @@ BEGIN_FUNC(PKG, ERR, herr_t, SUCCEED, FAIL,
/* Print the values */
HDfprintf(stream, "%*s%-*s %s\n", indent, "", fwidth, "Array class ID:", hdr->cparam.cls->name);
- HDfprintf(stream, "%*s%-*s %Zu\n", indent, "", fwidth, "Super Block size:", sblock->size);
- HDfprintf(stream, "%*s%-*s %Zu\n", indent, "", fwidth,
+ HDfprintf(stream, "%*s%-*s %zu\n", indent, "", fwidth, "Super Block size:", sblock->size);
+ HDfprintf(stream, "%*s%-*s %zu\n", indent, "", fwidth,
"# of data block addresses in super block:", sblock->ndblks);
- HDfprintf(stream, "%*s%-*s %Zu\n", indent, "", fwidth,
+ HDfprintf(stream, "%*s%-*s %zu\n", indent, "", fwidth,
"# of elements in data blocks from this super block:", sblock->dblk_nelmts);
/* Check if there are any data block addresses in super block */
@@ -328,7 +329,7 @@ BEGIN_FUNC(PKG, ERR, herr_t, SUCCEED, FAIL,
for (u = 0; u < sblock->ndblks; u++) {
/* Print address */
HDsprintf(temp_str, "Address #%u:", u);
- HDfprintf(stream, "%*s%-*s %a\n", (indent + 3), "", MAX(0, (fwidth - 3)), temp_str,
+ HDfprintf(stream, "%*s%-*s %" PRIuHADDR "\n", (indent + 3), "", MAX(0, (fwidth - 3)), temp_str,
sblock->dblk_addrs[u]);
} /* end for */
} /* end if */
@@ -390,15 +391,15 @@ BEGIN_FUNC(PKG, ERR, herr_t, SUCCEED, FAIL,
/* Protect data block */
/* (Note: setting parent of data block to 'hdr' for this operation should be OK -QAK) */
if (NULL == (dblock = H5EA__dblock_protect(hdr, hdr, addr, dblk_nelmts, H5AC__READ_ONLY_FLAG)))
- H5E_THROW(H5E_CANTPROTECT, "unable to protect extensible array data block, address = %llu",
- (unsigned long long)addr)
+ H5E_THROW(H5E_CANTPROTECT, "unable to protect extensible array data block, address = %" PRIuHADDR,
+ addr)
/* Print opening message */
HDfprintf(stream, "%*sExtensible Array data Block...\n", indent, "");
/* Print the values */
HDfprintf(stream, "%*s%-*s %s\n", indent, "", fwidth, "Array class ID:", hdr->cparam.cls->name);
- HDfprintf(stream, "%*s%-*s %Zu\n", indent, "", fwidth, "Data Block size:", dblock->size);
+ HDfprintf(stream, "%*s%-*s %zu\n", indent, "", fwidth, "Data Block size:", dblock->size);
/* Print the elements in the index block */
HDfprintf(stream, "%*sElements:\n", indent, "");
diff --git a/src/H5EAdblkpage.c b/src/H5EAdblkpage.c
index 81380f4..b42599c 100644
--- a/src/H5EAdblkpage.c
+++ b/src/H5EAdblkpage.c
@@ -15,7 +15,7 @@
*
* Created: H5EAdblkpage.c
* Nov 20 2008
- * Quincey Koziol <koziol@hdfgroup.org>
+ * Quincey Koziol
*
* Purpose: Data block page routines for extensible arrays.
*
@@ -80,7 +80,6 @@ H5FL_DEFINE_STATIC(H5EA_dblk_page_t);
* Return: Non-NULL pointer to data block on success/NULL on failure
*
* Programmer: Quincey Koziol
- * koziol@hdfgroup.org
* Nov 20 2008
*
*-------------------------------------------------------------------------
@@ -128,7 +127,6 @@ END_FUNC(PKG) /* end H5EA__dblk_page_alloc() */
* Return: Valid file address on success/HADDR_UNDEF on failure
*
* Programmer: Quincey Koziol
- * koziol@hdfgroup.org
* Nov 20 2008
*
*-------------------------------------------------------------------------
@@ -191,7 +189,6 @@ END_FUNC(PKG) /* end H5EA__dblk_page_create() */
* Return: Non-NULL pointer to data block page on success/NULL on failure
*
* Programmer: Quincey Koziol
- * koziol@hdfgroup.org
* Nov 20 2008
*
*-------------------------------------------------------------------------
@@ -255,7 +252,6 @@ END_FUNC(PKG) /* end H5EA__dblk_page_protect() */
* Return: Non-negative on success/Negative on failure
*
* Programmer: Quincey Koziol
- * koziol@hdfgroup.org
* Nov 20 2008
*
*-------------------------------------------------------------------------
@@ -285,7 +281,6 @@ END_FUNC(PKG) /* end H5EA__dblk_page_unprotect() */
* Return: Non-negative on success/Negative on failure
*
* Programmer: Quincey Koziol
- * koziol@hdfgroup.org
* Nov 20 2008
*
*-------------------------------------------------------------------------
diff --git a/src/H5EAdblock.c b/src/H5EAdblock.c
index fc3e2e8..45696c7 100644
--- a/src/H5EAdblock.c
+++ b/src/H5EAdblock.c
@@ -15,7 +15,7 @@
*
* Created: H5EAdblock.c
* Sep 11 2008
- * Quincey Koziol <koziol@hdfgroup.org>
+ * Quincey Koziol
*
* Purpose: Data block routines for extensible arrays.
*
@@ -81,7 +81,6 @@ H5FL_DEFINE_STATIC(H5EA_dblock_t);
* Return: Non-NULL pointer to data block on success/NULL on failure
*
* Programmer: Quincey Koziol
- * koziol@hdfgroup.org
* Sep 11 2008
*
*-------------------------------------------------------------------------
@@ -140,7 +139,6 @@ END_FUNC(PKG) /* end H5EA__dblock_alloc() */
* Return: Valid file address on success/HADDR_UNDEF on failure
*
* Programmer: Quincey Koziol
- * koziol@hdfgroup.org
* Sep 9 2008
*
*-------------------------------------------------------------------------
@@ -234,7 +232,6 @@ END_FUNC(PKG) /* end H5EA__dblock_create() */
* Return: Super block index on success/Can't fail
*
* Programmer: Quincey Koziol
- * koziol@hdfgroup.org
* Sep 11 2008
*
*-------------------------------------------------------------------------
@@ -268,7 +265,6 @@ END_FUNC(PKG) /* end H5EA__dblock_sblk_idx() */
* Return: Non-NULL pointer to data block on success/NULL on failure
*
* Programmer: Quincey Koziol
- * koziol@hdfgroup.org
* Sep 18 2008
*
*-------------------------------------------------------------------------
@@ -333,7 +329,6 @@ END_FUNC(PKG) /* end H5EA__dblock_protect() */
* Return: Non-negative on success/Negative on failure
*
* Programmer: Quincey Koziol
- * koziol@hdfgroup.org
* Sep 11 2008
*
*-------------------------------------------------------------------------
@@ -363,7 +358,6 @@ END_FUNC(PKG) /* end H5EA__dblock_unprotect() */
* Return: SUCCEED/FAIL
*
* Programmer: Quincey Koziol
- * koziol@hdfgroup.org
* Sep 22 2008
*
*-------------------------------------------------------------------------
@@ -424,7 +418,6 @@ END_FUNC(PKG) /* end H5EA__dblock_delete() */
* Return: Non-negative on success/Negative on failure
*
* Programmer: Quincey Koziol
- * koziol@hdfgroup.org
* Sep 11 2008
*
*-------------------------------------------------------------------------
diff --git a/src/H5EAhdr.c b/src/H5EAhdr.c
index 2641b86..7f142af 100644
--- a/src/H5EAhdr.c
+++ b/src/H5EAhdr.c
@@ -15,7 +15,7 @@
*
* Created: H5EAhdr.c
* Aug 26 2008
- * Quincey Koziol <koziol@hdfgroup.org>
+ * Quincey Koziol
*
* Purpose: Array header routines for extensible arrays.
*
@@ -98,7 +98,6 @@ H5FL_SEQ_DEFINE_STATIC(H5EA_sblk_info_t);
* Return: Non-negative on success/Negative on failure
*
* Programmer: Quincey Koziol
- * koziol@hdfgroup.org
* Aug 26 2008
*
*-------------------------------------------------------------------------
@@ -165,7 +164,6 @@ END_FUNC(PKG) /* end H5EA__hdr_alloc() */
* Return: Non-negative on success/Negative on failure
*
* Programmer: Quincey Koziol
- * koziol@hdfgroup.org
* Sep 18 2008
*
*-------------------------------------------------------------------------
@@ -227,7 +225,6 @@ END_FUNC(PKG) /* end H5EA__hdr_init() */
* Return: Non-NULL pointer to buffer for elements on success/NULL on failure
*
* Programmer: Quincey Koziol
- * koziol@hdfgroup.org
* Sep 16 2008
*
*-------------------------------------------------------------------------
@@ -294,7 +291,6 @@ END_FUNC(PKG) /* end H5EA__hdr_alloc_elmts() */
* Return: SUCCEED/FAIL
*
* Programmer: Quincey Koziol
- * koziol@hdfgroup.org
* Sep 18 2008
*
*-------------------------------------------------------------------------
@@ -328,7 +324,6 @@ END_FUNC(PKG) /* end H5EA__hdr_free_elmts() */
* Return: SUCCEED/FAIL
*
* Programmer: Quincey Koziol
- * koziol@hdfgroup.org
* Jun 17 2008
*
*-------------------------------------------------------------------------
@@ -446,7 +441,6 @@ END_FUNC(PKG) /* end H5EA__hdr_create() */
* Return: Non-negative on success/Negative on failure
*
* Programmer: Quincey Koziol
- * koziol@hdfgroup.org
* Aug 26 2008
*
*-------------------------------------------------------------------------
@@ -476,7 +470,6 @@ END_FUNC(PKG) /* end H5EA__hdr_incr() */
* Return: Non-negative on success/Negative on failure
*
* Programmer: Quincey Koziol
- * koziol@hdfgroup.org
* Aug 26 2008
*
*-------------------------------------------------------------------------
@@ -509,7 +502,6 @@ END_FUNC(PKG) /* end H5EA__hdr_decr() */
* Return: Non-negative on success/Negative on failure
*
* Programmer: Quincey Koziol
- * koziol@hdfgroup.org
* Aug 26 2008
*
*-------------------------------------------------------------------------
@@ -532,7 +524,6 @@ END_FUNC(PKG) /* end H5EA__hdr_fuse_incr() */
* Return: Non-negative on success/Negative on failure
*
* Programmer: Quincey Koziol
- * koziol@hdfgroup.org
* Aug 26 2008
*
*-------------------------------------------------------------------------
@@ -559,7 +550,6 @@ END_FUNC(PKG) /* end H5EA__hdr_fuse_decr() */
* Return: SUCCEED/FAIL
*
* Programmer: Quincey Koziol
- * koziol@hdfgroup.org
* Sep 9 2008
*
*-------------------------------------------------------------------------
@@ -586,7 +576,6 @@ END_FUNC(PKG) /* end H5EA__hdr_modified() */
* Return: Non-NULL pointer to header on success/NULL on failure
*
* Programmer: Quincey Koziol
- * koziol@hdfgroup.org
* Jul 31 2013
*
*-------------------------------------------------------------------------
@@ -642,7 +631,6 @@ END_FUNC(PKG) /* end H5EA__hdr_protect() */
* Return: Non-negative on success/Negative on failure
*
* Programmer: Quincey Koziol
- * koziol@hdfgroup.org
* Aug 1 2013
*
*-------------------------------------------------------------------------
@@ -671,7 +659,6 @@ END_FUNC(PKG) /* end H5EA__hdr_unprotect() */
* Return: SUCCEED/FAIL
*
* Programmer: Quincey Koziol
- * koziol@hdfgroup.org
* Aug 26 2008
*
*-------------------------------------------------------------------------
@@ -725,7 +712,6 @@ END_FUNC(PKG) /* end H5EA__hdr_delete() */
* Return: Non-negative on success/Negative on failure
*
* Programmer: Quincey Koziol
- * koziol@hdfgroup.org
* Sep 11 2008
*
*-------------------------------------------------------------------------
diff --git a/src/H5EAiblock.c b/src/H5EAiblock.c
index 0cf9f4e..1ef7980 100644
--- a/src/H5EAiblock.c
+++ b/src/H5EAiblock.c
@@ -15,7 +15,7 @@
*
* Created: H5EAiblock.c
* Sep 9 2008
- * Quincey Koziol <koziol@hdfgroup.org>
+ * Quincey Koziol
*
* Purpose: Index block routines for extensible arrays.
*
@@ -87,7 +87,6 @@ H5FL_SEQ_DEFINE_STATIC(haddr_t);
* Return: Non-NULL pointer to index block on success/NULL on failure
*
* Programmer: Quincey Koziol
- * koziol@hdfgroup.org
* Sep 9 2008
*
*-------------------------------------------------------------------------
@@ -116,11 +115,6 @@ BEGIN_FUNC(PKG, ERR, H5EA_iblock_t *, NULL, NULL, H5EA__iblock_alloc(H5EA_hdr_t
iblock->nsblks = H5EA_SBLK_FIRST_IDX(hdr->cparam.sup_blk_min_data_ptrs);
iblock->ndblk_addrs = 2 * ((size_t)hdr->cparam.sup_blk_min_data_ptrs - 1);
iblock->nsblk_addrs = hdr->nsblks - iblock->nsblks;
-#ifdef QAK
- HDfprintf(stderr, "%s: iblock->nsblks = %u\n", FUNC, iblock->nsblks);
- HDfprintf(stderr, "%s: iblock->ndblk_addrs = %Zu\n", FUNC, iblock->ndblk_addrs);
- HDfprintf(stderr, "%s: iblock->nsblk_addrs = %Zu\n", FUNC, iblock->nsblk_addrs);
-#endif /* QAK */
/* Allocate buffer for elements in index block */
if (hdr->cparam.idx_blk_elmts > 0)
@@ -157,7 +151,6 @@ END_FUNC(PKG) /* end H5EA__iblock_alloc() */
* Return: Valid file address on success/HADDR_UNDEF on failure
*
* Programmer: Quincey Koziol
- * koziol@hdfgroup.org
* Sep 9 2008
*
*-------------------------------------------------------------------------
@@ -170,10 +163,6 @@ BEGIN_FUNC(PKG, ERR, haddr_t, HADDR_UNDEF, HADDR_UNDEF,
haddr_t iblock_addr; /* Extensible array index block address */
hbool_t inserted = FALSE; /* Whether the header was inserted into cache */
-#ifdef QAK
- HDfprintf(stderr, "%s: Called\n", FUNC);
-#endif /* QAK */
-
/* Sanity check */
HDassert(hdr);
HDassert(stats_changed);
@@ -184,9 +173,6 @@ BEGIN_FUNC(PKG, ERR, haddr_t, HADDR_UNDEF, HADDR_UNDEF,
/* Set size of index block on disk */
iblock->size = H5EA_IBLOCK_SIZE(iblock);
-#ifdef QAK
- HDfprintf(stderr, "%s: iblock->size = %Zu\n", FUNC, iblock->size);
-#endif /* QAK */
/* Allocate space for the index block on disk */
if (HADDR_UNDEF == (iblock_addr = H5MF_alloc(hdr->f, H5FD_MEM_EARRAY_IBLOCK, (hsize_t)iblock->size)))
@@ -271,7 +257,6 @@ END_FUNC(PKG) /* end H5EA__iblock_create() */
* Return: Non-NULL pointer to index block on success/NULL on failure
*
* Programmer: Quincey Koziol
- * koziol@hdfgroup.org
* Sep 9 2008
*
*-------------------------------------------------------------------------
@@ -281,10 +266,6 @@ BEGIN_FUNC(PKG, ERR, H5EA_iblock_t *, NULL, NULL, H5EA__iblock_protect(H5EA_hdr_
/* Local variables */
H5EA_iblock_t *iblock = NULL; /* Pointer to index block */
-#ifdef QAK
- HDfprintf(stderr, "%s: Called\n", FUNC);
-#endif /* QAK */
-
/* Sanity check */
HDassert(hdr);
@@ -328,7 +309,6 @@ END_FUNC(PKG) /* end H5EA__iblock_protect() */
* Return: Non-negative on success/Negative on failure
*
* Programmer: Quincey Koziol
- * koziol@hdfgroup.org
* Sep 9 2008
*
*-------------------------------------------------------------------------
@@ -336,11 +316,7 @@ END_FUNC(PKG) /* end H5EA__iblock_protect() */
BEGIN_FUNC(PKG, ERR, herr_t, SUCCEED, FAIL,
H5EA__iblock_unprotect(H5EA_iblock_t *iblock, unsigned cache_flags))
-/* Local variables */
-
-#ifdef QAK
- HDfprintf(stderr, "%s: Called\n", FUNC);
-#endif /* QAK */
+ /* Local variables */
/* Sanity check */
HDassert(iblock);
@@ -362,7 +338,6 @@ END_FUNC(PKG) /* end H5EA__iblock_unprotect() */
* Return: SUCCEED/FAIL
*
* Programmer: Quincey Koziol
- * koziol@hdfgroup.org
* Sep 9 2008
*
*-------------------------------------------------------------------------
@@ -372,10 +347,6 @@ BEGIN_FUNC(PKG, ERR, herr_t, SUCCEED, FAIL, H5EA__iblock_delete(H5EA_hdr_t *hdr)
/* Local variables */
H5EA_iblock_t *iblock = NULL; /* Pointer to index block */
-#ifdef QAK
- HDfprintf(stderr, "%s: Called\n", FUNC);
-#endif /* QAK */
-
/* Sanity check */
HDassert(hdr);
HDassert(H5F_addr_defined(hdr->idx_blk_addr));
@@ -447,7 +418,6 @@ END_FUNC(PKG) /* end H5EA__iblock_delete() */
* Return: Non-negative on success/Negative on failure
*
* Programmer: Quincey Koziol
- * koziol@hdfgroup.org
* Sep 11 2008
*
*-------------------------------------------------------------------------
diff --git a/src/H5EAint.c b/src/H5EAint.c
index b6e8e9d..472cfb4 100644
--- a/src/H5EAint.c
+++ b/src/H5EAint.c
@@ -15,7 +15,7 @@
*
* Created: H5EAint.c
* Jun 17 2008
- * Quincey Koziol <koziol@hdfgroup.org>
+ * Quincey Koziol
*
* Purpose: Internal routines for extnsible arrays.
*
@@ -75,7 +75,6 @@
* Return: Non-negative on success/Negative on failure
*
* Programmer: Quincey Koziol
- * koziol@hdfgroup.org
* Mar 26 2009
*
*-------------------------------------------------------------------------
@@ -103,7 +102,6 @@ END_FUNC(PKG) /* end H5EA__create_flush_depend() */
* Return: Non-negative on success/Negative on failure
*
* Programmer: Quincey Koziol
- * koziol@hdfgroup.org
* Mar 26 2009
*
*-------------------------------------------------------------------------
diff --git a/src/H5EAstat.c b/src/H5EAstat.c
index 0a544db..47b9a86 100644
--- a/src/H5EAstat.c
+++ b/src/H5EAstat.c
@@ -15,7 +15,7 @@
*
* Created: H5EAstat.c
* Sep 11 2008
- * Quincey Koziol <koziol@hdfgroup.org>
+ * Quincey Koziol
*
* Purpose: Extensible array metadata statistics functions.
*
@@ -76,18 +76,13 @@
* Return: SUCCEED/FAIL
*
* Programmer: Quincey Koziol
- * koziol@hdfgroup.org
* Aug 21 2008
*
*-------------------------------------------------------------------------
*/
BEGIN_FUNC(PRIV, NOERR, herr_t, SUCCEED, -, H5EA_get_stats(const H5EA_t *ea, H5EA_stat_t *stats))
-/* Local variables */
-
-#ifdef QAK
- HDfprintf(stderr, "%s: Called\n", FUNC);
-#endif /* QAK */
+ /* Local variables */
/*
* Check arguments.
diff --git a/src/H5EAtest.c b/src/H5EAtest.c
index b80f7e6..dd669fc 100644
--- a/src/H5EAtest.c
+++ b/src/H5EAtest.c
@@ -11,7 +11,7 @@
* help@hdfgroup.org. *
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
-/* Programmer: Quincey Koziol <koziol@hdfgroup.org>
+/* Programmer: Quincey Koziol
* Thursday, August 28, 2008
*
* Purpose: Extensible array testing functions.
diff --git a/src/H5ESpublic.h b/src/H5ESpublic.h
index 28b41fa..9cc800a 100644
--- a/src/H5ESpublic.h
+++ b/src/H5ESpublic.h
@@ -24,18 +24,93 @@
/* Public Macros */
/*****************/
+/* Default value for "no event set" / synchronous execution */
+#define H5ES_NONE (hid_t)0
+
+/* Special "wait" timeout values */
+#define H5ES_WAIT_FOREVER (UINT64_MAX) /* Wait until all operations complete */
+#define H5ES_WAIT_NONE \
+ (0) /* Don't wait for operations to complete, \
+ * just check their status. \
+ * (this allows H5ESwait to behave \
+ * like a 'test' operation) \
+ */
+
/*******************/
/* Public Typedefs */
/*******************/
/* Asynchronous operation status */
typedef enum H5ES_status_t {
- H5ES_STATUS_IN_PROGRESS, /* Operation has not yet completed */
- H5ES_STATUS_SUCCEED, /* Operation has completed, successfully */
- H5ES_STATUS_FAIL, /* Operation has completed, but failed */
- H5ES_STATUS_CANCELED /* Operation has not completed and was canceled */
+ H5ES_STATUS_IN_PROGRESS, /* Operation(s) have not yet completed */
+ H5ES_STATUS_SUCCEED, /* Operation(s) have completed, successfully */
+ H5ES_STATUS_FAIL /* An operation has completed, but failed */
} H5ES_status_t;
+//! <!-- [H5ES_err_info_t_snip] -->
+/**
+ * Information about failed operations in event set
+ */
+typedef struct H5ES_err_info_t {
+ /* Operation info */
+ char * api_name; /**< Name of HDF5 API routine called */
+ char * api_args; /**< "Argument string" for arguments to HDF5 API routine called */
+ char * app_file_name; /**< Name of source file where the HDF5 API routine was called */
+ char * app_func_name; /**< Name of function where the HDF5 API routine was called */
+ unsigned app_line_num; /**< Line # of source file where the HDF5 API routine was called */
+ uint64_t op_ins_count; /**< Counter of operation's insertion into event set */
+ uint64_t op_ins_ts; /**< Timestamp for when the operation was inserted into the event set */
+
+ /* Error info */
+ hid_t err_stack_id; /**< ID for error stack from failed operation */
+} H5ES_err_info_t;
+//! <!-- [H5ES_err_info_t_snip] -->
+
+/*
+H5ES_op_info_t:
+ const char *: API name (H5Dwrite_async, ...)
+ const char *: Arg string
+ const char *: Appl. source file name
+ const char *: Appl. source function
+ unsigned: Appl. source file line
+ uint64_t: Insert Time Timestamp
+ uint64_t: "event count" - n'th event inserted into event set
+ uint64_t: Execution Time timestamp (*)
+
+More Possible Info for H5ES_op_info_t:
+ Parent Operation's request token (*) -> "parent event count"? -- Could be
+ used to "prune" child operations from reported errors, with flag
+ to H5ESget_err_info?
+
+H5ES_err_info_t:
+ H5ES_op_info_t: (above)
+ hid_t: Error stack (*)
+
+Possible debugging routines: (Should also be configured from Env Var)
+ H5ESdebug_signal(hid_t es_id, signal_t sig, uint64_t <event count>);
+ H5ESdebug_err_trace_log(hid_t es_id, const char *filename);
+ H5ESdebug_err_trace_fh(hid_t es_id, FILE *fh);
+ H5ESdebug_err_signal(hid_t es_id, signal_t sig);
+[Possibly option to allow operations to be inserted into event set with error?]
+
+ Example usage:
+ es_id = H5EScreate();
+ H5ESdebug...(es_id, ...);
+ ...
+ H5Dwrite_async(..., es_id);
+
+How to Trace Async Operations?
+ <Example of stacking Logging VOL Connector w/Async VOL Connector>
+
+"Library / wrapper developer" version of API routines: (Auto-generated)
+ H5Dwrite_async_wrap(const char *app_file, const char *app_func,
+ unsigned app_line_num, dset_id, mem_type_id, mem_space_id, ..., es_id);
+
+ vs.
+
+ H5Dwrite_async(dset_id, mem_type_id, mem_space_id, ..., es_id);
+*/
+
/********************/
/* Public Variables */
/********************/
diff --git a/src/H5Edeprec.c b/src/H5Edeprec.c
index cf20cfe..a5cc7aa 100644
--- a/src/H5Edeprec.c
+++ b/src/H5Edeprec.c
@@ -15,7 +15,7 @@
*
* Created: H5Edeprec.c
* April 11 2007
- * Quincey Koziol <koziol@hdfgroup.org>
+ * Quincey Koziol
*
* Purpose: Deprecated functions from the H5E interface. These
* functions are here for compatibility purposes and may be
@@ -35,7 +35,6 @@
/* Headers */
/***********/
#include "H5private.h" /* Generic Functions */
-#include "H5CXprivate.h" /* API Contexts */
#include "H5Epkg.h" /* Error handling */
#include "H5Iprivate.h" /* IDs */
#include "H5MMprivate.h" /* Memory management */
@@ -187,7 +186,7 @@ done:
* same parameter as the old function, in contrary to
* H5Epush2.
*
- * Return: SUCCEED/FAIL
+ * Return: Non-negative on success/Negative on failure
*
* Programmer: Raymond Lu
* Tuesday, Sep 16, 2003
@@ -217,7 +216,7 @@ done:
* Purpose: This function is for backward compatibility.
* Clears the error stack for the specified error stack.
*
- * Return: SUCCEED/FAIL
+ * Return: Non-negative on success/Negative on failure
*
* Programmer: Raymond Lu
* Wednesday, July 16, 2003
@@ -250,7 +249,7 @@ done:
* prints error messages. Users are encouraged to write there
* own more specific error handlers.
*
- * Return: SUCCEED/FAIL
+ * Return: Non-negative on success/Negative on failure
*
* Programmer: Raymond Lu
* Sep 16, 2003
@@ -286,7 +285,7 @@ done:
* Walks the error stack for the current thread and calls some
* function for each error along the way.
*
- * Return: SUCCEED/FAIL
+ * Return: Non-negative on success/Negative on failure
*
* Programmer: Raymond Lu
* Sep 16, 2003
@@ -327,7 +326,7 @@ done:
* Either (or both) arguments may be null in which case the
* value is not returned.
*
- * Return: SUCCEED/FAIL
+ * Return: Non-negative on success/Negative on failure
*
* Programmer: Raymond Lu
* Sep 16, 2003
@@ -335,14 +334,14 @@ done:
*-------------------------------------------------------------------------
*/
herr_t
-H5Eget_auto1(H5E_auto1_t *func, void **client_data)
+H5Eget_auto1(H5E_auto1_t *func /*out*/, void **client_data /*out*/)
{
H5E_t * estack; /* Error stack to operate on */
H5E_auto_op_t auto_op; /* Error stack operator */
herr_t ret_value = SUCCEED; /* Return value */
FUNC_ENTER_API(FAIL)
- H5TRACE2("e", "*Ea**x", func, client_data);
+ H5TRACE2("e", "xx", func, client_data);
/* Retrieve default error stack */
if (NULL == (estack = H5E__get_my_stack())) /*lint !e506 !e774 Make lint 'constant value Boolean' in
@@ -380,7 +379,7 @@ done:
* Automatic stack traversal is always in the H5E_WALK_DOWNWARD
* direction.
*
- * Return: SUCCEED/FAIL
+ * Return: Non-negative on success/Negative on failure
*
* Programmer: Raymond Lu
* Sep 16, 2003
diff --git a/src/H5Eint.c b/src/H5Eint.c
index b973f24..3fd4099 100644
--- a/src/H5Eint.c
+++ b/src/H5Eint.c
@@ -15,7 +15,7 @@
*
* Created: H5Eint.c
* April 11 2007
- * Quincey Koziol <koziol@hdfgroup.org>
+ * Quincey Koziol
*
* Purpose: General use, "internal" routines for error handling.
*
@@ -218,7 +218,7 @@ H5E__walk1_cb(int n, H5E_error1_t *err_desc, void *client_data)
cls_ptr = maj_ptr->cls;
/* Print error class header if new class */
- if (eprint->cls.lib_name == NULL || HDstrcmp(cls_ptr->lib_name, eprint->cls.lib_name)) {
+ if (eprint->cls.lib_name == NULL || HDstrcmp(cls_ptr->lib_name, eprint->cls.lib_name) != 0) {
/* update to the new class information */
if (cls_ptr->cls_name)
eprint->cls.cls_name = cls_ptr->cls_name;
@@ -346,7 +346,7 @@ H5E__walk2_cb(unsigned n, const H5E_error2_t *err_desc, void *client_data)
HGOTO_DONE(FAIL)
/* Print error class header if new class */
- if (eprint->cls.lib_name == NULL || HDstrcmp(cls_ptr->lib_name, eprint->cls.lib_name)) {
+ if (eprint->cls.lib_name == NULL || HDstrcmp(cls_ptr->lib_name, eprint->cls.lib_name) != 0) {
/* update to the new class information */
if (cls_ptr->cls_name)
eprint->cls.cls_name = cls_ptr->cls_name;
@@ -650,11 +650,7 @@ herr_t
H5E_printf_stack(H5E_t *estack, const char *file, const char *func, unsigned line, hid_t cls_id, hid_t maj_id,
hid_t min_id, const char *fmt, ...)
{
- va_list ap; /* Varargs info */
-#ifndef H5_HAVE_VASPRINTF
- int tmp_len; /* Current size of description buffer */
- int desc_len; /* Actual length of description when formatted */
-#endif /* H5_HAVE_VASPRINTF */
+ va_list ap; /* Varargs info */
char * tmp = NULL; /* Buffer to place formatted description in */
hbool_t va_started = FALSE; /* Whether the variable argument list is open */
herr_t ret_value = SUCCEED; /* Return value */
@@ -683,31 +679,9 @@ H5E_printf_stack(H5E_t *estack, const char *file, const char *func, unsigned lin
HDva_start(ap, fmt);
va_started = TRUE;
-#ifdef H5_HAVE_VASPRINTF
/* Use the vasprintf() routine, since it does what we're trying to do below */
if (HDvasprintf(&tmp, fmt, ap) < 0)
HGOTO_DONE(FAIL)
-#else /* H5_HAVE_VASPRINTF */
- /* Allocate space for the formatted description buffer */
- tmp_len = 128;
- if (NULL == (tmp = H5MM_malloc((size_t)tmp_len)))
- HGOTO_DONE(FAIL)
-
- /* If the description doesn't fit into the initial buffer size, allocate more space and try again */
- while ((desc_len = HDvsnprintf(tmp, (size_t)tmp_len, fmt, ap)) > (tmp_len - 1)) {
- /* shutdown & restart the va_list */
- HDva_end(ap);
- HDva_start(ap, fmt);
-
- /* Release the previous description, it's too small */
- H5MM_xfree(tmp);
-
- /* Allocate a description of the appropriate length */
- tmp_len = desc_len + 1;
- if (NULL == (tmp = H5MM_malloc((size_t)tmp_len)))
- HGOTO_DONE(FAIL)
- } /* end while */
-#endif /* H5_HAVE_VASPRINTF */
/* Push the error on the stack */
if (H5E__push_stack(estack, file, func, line, cls_id, maj_id, min_id, tmp) < 0)
@@ -716,16 +690,11 @@ H5E_printf_stack(H5E_t *estack, const char *file, const char *func, unsigned lin
done:
if (va_started)
HDva_end(ap);
-#ifdef H5_HAVE_VASPRINTF
/* Memory was allocated with HDvasprintf so it needs to be freed
* with HDfree
*/
if (tmp)
HDfree(tmp);
-#else /* H5_HAVE_VASPRINTF */
- if (tmp)
- H5MM_xfree(tmp);
-#endif /* H5_HAVE_VASPRINTF */
FUNC_LEAVE_NOAPI(ret_value)
} /* end H5E_printf_stack() */
diff --git a/src/H5Emodule.h b/src/H5Emodule.h
index 1670c03..43d5d36 100644
--- a/src/H5Emodule.h
+++ b/src/H5Emodule.h
@@ -29,4 +29,33 @@
#define H5_MY_PKG_ERR H5E_ERROR
#define H5_MY_PKG_INIT YES
+/**
+ * \defgroup H5E H5E
+ * \brief Error Handling Interface
+ *
+ * \details The Error interface provides error handling in the form of a stack.
+ * The \Code{FUNC_ENTER} macro clears the error stack whenever an
+ * interface function is entered. When an error is detected, an entry
+ * is pushed onto the stack. As the functions unwind, additional
+ * entries are pushed onto the stack. The API function will return some
+ * indication that an error occurred and the application can print the
+ * error stack.
+ *
+ * Certain API functions in the \c H5E package, such as H5Eprint1(), do
+ * not clear the error stack. Otherwise, any function which does not
+ * have an underscore immediately after the package name will clear the
+ * error stack. For instance, H5Fopen() clears the error stack while
+ * \Code{H5F_open} does not.
+ *
+ * An error stack has a fixed maximum size. If this size is exceeded
+ * then the stack will be truncated and only the inner-most functions
+ * will have entries on the stack. This is expected to be a rare
+ * condition.
+ *
+ * Each thread has its own error stack, but since multi-threading has
+ * not been added to the library yet, this package maintains a single
+ * error stack. The error stack is statically allocated to reduce the
+ * complexity of handling errors within the \c H5E package.
+ */
+
#endif /* H5Emodule_H */
diff --git a/src/H5Eprivate.h b/src/H5Eprivate.h
index c3c440f..4cd8b70 100644
--- a/src/H5Eprivate.h
+++ b/src/H5Eprivate.h
@@ -168,20 +168,15 @@ typedef struct H5E_t H5E_t;
extern char H5E_mpi_error_str[MPI_MAX_ERROR_STRING];
extern int H5E_mpi_error_str_len;
-#define HMPI_ERROR(mpierr) \
- { \
- MPI_Error_string(mpierr, H5E_mpi_error_str, &H5E_mpi_error_str_len); \
- HERROR(H5E_INTERNAL, H5E_MPIERRSTR, "%s", H5E_mpi_error_str); \
- }
#define HMPI_DONE_ERROR(retcode, str, mpierr) \
{ \
- HMPI_ERROR(mpierr); \
- HDONE_ERROR(H5E_INTERNAL, H5E_MPI, retcode, str); \
+ MPI_Error_string(mpierr, H5E_mpi_error_str, &H5E_mpi_error_str_len); \
+ HDONE_ERROR(H5E_INTERNAL, H5E_MPI, retcode, "%s: MPI error string is '%s'", str, H5E_mpi_error_str); \
}
#define HMPI_GOTO_ERROR(retcode, str, mpierr) \
{ \
- HMPI_ERROR(mpierr); \
- HGOTO_ERROR(H5E_INTERNAL, H5E_MPI, retcode, str); \
+ MPI_Error_string(mpierr, H5E_mpi_error_str, &H5E_mpi_error_str_len); \
+ HGOTO_ERROR(H5E_INTERNAL, H5E_MPI, retcode, "%s: MPI error string is '%s'", str, H5E_mpi_error_str); \
}
#endif /* H5_HAVE_PARALLEL */
diff --git a/src/H5Epublic.h b/src/H5Epublic.h
index 685665a..ace7700 100644
--- a/src/H5Epublic.h
+++ b/src/H5Epublic.h
@@ -26,18 +26,29 @@
/* Value for the default error stack */
#define H5E_DEFAULT (hid_t)0
-/* Different kinds of error information */
+/**
+ * Different kinds of error information
+ */
typedef enum H5E_type_t { H5E_MAJOR, H5E_MINOR } H5E_type_t;
-/* Information about an error; element of error stack */
+/**
+ * Information about an error; element of error stack
+ */
typedef struct H5E_error2_t {
- hid_t cls_id; /*class ID */
- hid_t maj_num; /*major error ID */
- hid_t min_num; /*minor error number */
- unsigned line; /*line in file where error occurs */
- const char *func_name; /*function in which error occurred */
- const char *file_name; /*file in which error occurred */
- const char *desc; /*optional supplied description */
+ hid_t cls_id;
+ /**< Class ID */
+ hid_t maj_num;
+ /**< Major error ID */
+ hid_t min_num;
+ /**< Minor error number */
+ unsigned line;
+ /**< Line in file where error occurs */
+ const char *func_name;
+ /**< Function in which error occurred */
+ const char *file_name;
+ /**< File in which error occurred */
+ const char *desc;
+ /**< Optional supplied description */
} H5E_error2_t;
/* When this header is included from a private header, don't make calls to H5open() */
@@ -61,12 +72,12 @@ H5_DLLVAR hid_t H5E_ERR_CLS_g;
* trying something that's likely or expected to fail. The code to try can
* be nested between calls to H5Eget_auto() and H5Eset_auto(), but it's
* easier just to use this macro like:
- * H5E_BEGIN_TRY {
- * ...stuff here that's likely to fail...
+ * H5E_BEGIN_TRY {
+ * ...stuff here that's likely to fail...
* } H5E_END_TRY;
*
* Warning: don't break, return, or longjmp() from the body of the loop or
- * the error reporting won't be properly restored!
+ * the error reporting won't be properly restored!
*
* These two macros still use the old API functions for backward compatibility
* purpose.
@@ -124,10 +135,10 @@ H5_DLLVAR hid_t H5E_ERR_CLS_g;
/* Use the Standard C __FILE__ & __LINE__ macros instead of typing them in */
/* And return after pushing error onto stack */
#define H5Epush_ret(func, cls, maj, min, str, ret) \
- { \
+ do { \
H5Epush2(H5E_DEFAULT, __FILE__, func, __LINE__, cls, maj, min, str); \
return (ret); \
- }
+ } while (0)
/* Use the Standard C __FILE__ & __LINE__ macros instead of typing them in
* And goto a label after pushing error onto stack.
@@ -138,10 +149,12 @@ H5_DLLVAR hid_t H5E_ERR_CLS_g;
goto label; \
}
-/* Error stack traversal direction */
+/**
+ * Error stack traversal direction
+ */
typedef enum H5E_direction_t {
- H5E_WALK_UPWARD = 0, /*begin deep, end at API function */
- H5E_WALK_DOWNWARD = 1 /*begin at API function, end deep */
+ H5E_WALK_UPWARD = 0, /**< begin w/ most specific error, end at API function */
+ H5E_WALK_DOWNWARD = 1 /**< begin at API function, end w/ most specific error */
} H5E_direction_t;
#ifdef __cplusplus
@@ -149,29 +162,498 @@ extern "C" {
#endif
/* Error stack traversal callback function pointers */
+//! <!-- [H5E_walk2_t_snip] -->
+/**
+ * \brief Callback function for H5Ewalk2()
+ *
+ * \param[in] n Indexed error position in the stack
+ * \param[in] err_desc Pointer to a data structure describing the error
+ * \param[in] client_data Pointer to client data in the format expected by the
+ * user-defined function
+ * \return \herr_t
+ */
typedef herr_t (*H5E_walk2_t)(unsigned n, const H5E_error2_t *err_desc, void *client_data);
+//! <!-- [H5E_walk2_t_snip] -->
+
+//! <!-- [H5E_auto2_t_snip] -->
+/**
+ * \brief Callback function for H5Eset_auto2()
+ *
+ * \estack_id{estack}
+ * \param[in] client_data Pointer to client data in the format expected by the
+ * user-defined function
+ * \return \herr_t
+ */
typedef herr_t (*H5E_auto2_t)(hid_t estack, void *client_data);
+//! <!-- [H5E_auto2_t_snip] -->
/* Public API functions */
-H5_DLL hid_t H5Eregister_class(const char *cls_name, const char *lib_name, const char *version);
-H5_DLL herr_t H5Eunregister_class(hid_t class_id);
-H5_DLL herr_t H5Eclose_msg(hid_t err_id);
-H5_DLL hid_t H5Ecreate_msg(hid_t cls, H5E_type_t msg_type, const char *msg);
-H5_DLL hid_t H5Ecreate_stack(void);
-H5_DLL hid_t H5Eget_current_stack(void);
-H5_DLL herr_t H5Eclose_stack(hid_t stack_id);
+/**
+ * --------------------------------------------------------------------------
+ * \ingroup H5E
+ *
+ * \brief Registers a client library or application program to the HDF5 error API
+ *
+ * \param[in] cls_name Name of the error class
+ * \param[in] lib_name Name of the client library or application to which the error class belongs
+ * \param[in] version Version of the client library or application to which the
+ error class belongs. Can be \c NULL.
+ * \return Returns a class identifier on success; otherwise returns H5I_INVALID_ID.
+ *
+ * \details H5Eregister_class() registers a client library or application
+ * program to the HDF5 error API so that the client library or
+ * application program can report errors together with the HDF5
+ * library. It receives an identifier for this error class for further
+ * error operations. The library name and version number will be
+ * printed out in the error message as a preamble.
+ *
+ * \since 1.8.0
+ */
+H5_DLL hid_t H5Eregister_class(const char *cls_name, const char *lib_name, const char *version);
+/**
+ * --------------------------------------------------------------------------
+ * \ingroup H5E
+ *
+ * \brief Removes an error class
+ *
+ * \param[in] class_id Error class identifier.
+ * \return \herr_t
+ *
+ * \details H5Eunregister_class() removes the error class specified by \p
+ * class_id. All the major and minor errors in this class will also be
+ * closed.
+ *
+ * \since 1.8.0
+ */
+H5_DLL herr_t H5Eunregister_class(hid_t class_id);
+/**
+ * --------------------------------------------------------------------------
+ * \ingroup H5E
+ *
+ * \brief Closes an error message
+ *
+ * \param[in] err_id An error message identifier
+ * \return \herr_t
+ *
+ * \details H5Eclose_msg() closes an error message identifier, which can be
+ * either a major or minor message.
+ *
+ * \since 1.8.0
+ */
+H5_DLL herr_t H5Eclose_msg(hid_t err_id);
+/**
+ * --------------------------------------------------------------------------
+ * \ingroup H5E
+ *
+ * \brief Adds a major error message to an error class
+ *
+ * \param[in] cls An error class identifier
+ * \param[in] msg_type The type of the error message
+ * \param[in] msg Major error message
+ * \return \herr_t
+ *
+ * \details H5Ecreate_msg() adds an error message to an error class defined by
+ * client library or application program. The error message can be
+ * either major or minor as indicated by the parameter \p msg_type.
+ *
+ * Use H5Eclose_msg() to close the message identifier returned by this
+ * function.
+ *
+ * \since 1.8.0
+ */
+H5_DLL hid_t H5Ecreate_msg(hid_t cls, H5E_type_t msg_type, const char *msg);
+/**
+ * --------------------------------------------------------------------------
+ * \ingroup H5E
+ *
+ * \brief Creates a new, empty error stack
+ *
+ * \return \hid_ti{error stack}
+ *
+ * \details H5Ecreate_stack() creates a new empty error stack and returns the
+ * new stack’s identifier. Use H5Eclose_stack() to close the error stack
+ * identifier returned by this function.
+ *
+ * \since 1.8.0
+ */
+H5_DLL hid_t H5Ecreate_stack(void);
+/**
+ * --------------------------------------------------------------------------
+ * \ingroup H5E
+ *
+ * \brief Returns a copy of the current error stack
+ *
+ * \return \hid_ti{error stack}
+ *
+ * \details H5Eget_current_stack() copies the current error stack and returns an
+ * error stack identifier for the new copy.
+ *
+ * \since 1.8.0
+ */
+H5_DLL hid_t H5Eget_current_stack(void);
+/**
+ * --------------------------------------------------------------------------
+ * \ingroup H5E
+ *
+ * \brief Appends one error stack to another, optionally closing the source
+ * stack.
+ *
+ * \estack_id{dst_stack_id}
+ * \estack_id{src_stack_id}
+ * \param[in] close_source_stack Flag to indicate whether to close the source stack
+ * \return \herr_t
+ *
+ * \details H5Eappend_stack() appends the messages from error stack
+ * \p src_stack_id to the error stack \p dst_stack_id.
+ * If \p close_source_stack is \c TRUE, the source error stack
+ * will be closed.
+ *
+ * \since 1.13.0
+ */
+H5_DLL herr_t H5Eappend_stack(hid_t dst_stack_id, hid_t src_stack_id, hbool_t close_source_stack);
+/**
+ * --------------------------------------------------------------------------
+ * \ingroup H5E
+ *
+ * \brief Closes an error stack handle
+ *
+ * \estack_id{stack_id}
+ *
+ * \return \herr_t
+ *
+ * \details H5Eclose_stack() closes the error stack handle \p stack_id
+ * and releases its resources. #H5E_DEFAULT cannot be closed.
+ *
+ * \since 1.8.0
+ */
+H5_DLL herr_t H5Eclose_stack(hid_t stack_id);
+/**
+ * --------------------------------------------------------------------------
+ * \ingroup H5E
+ *
+ * \brief Retrieves error class name
+ *
+ * \param[in] class_id Error class identifier
+ * \param[out] name Buffer for the error class name
+ * \param[in] size The maximum number of characters the class name to be returned
+ * by this function in\p name.
+ * \return Returns non-negative value as on success; otherwise returns negative value.
+ *
+ * \details H5Eget_class_name() retrieves the name of the error class specified
+ * by the class identifier. If non-NULL pointer is passed in for \p
+ * name and \p size is greater than zero, the class name of \p size
+ * long is returned. The length of the error class name is also
+ * returned. If NULL is passed in as \p name, only the length of class
+ * name is returned. If zero is returned, it means no name. The user is
+ * responsible for allocating sufficient buffer space for the name.
+ *
+ * \since 1.8.0
+ */
H5_DLL ssize_t H5Eget_class_name(hid_t class_id, char *name, size_t size);
-H5_DLL herr_t H5Eset_current_stack(hid_t err_stack_id);
-H5_DLL herr_t H5Epush2(hid_t err_stack, const char *file, const char *func, unsigned line, hid_t cls_id,
- hid_t maj_id, hid_t min_id, const char *msg, ...);
-H5_DLL herr_t H5Epop(hid_t err_stack, size_t count);
-H5_DLL herr_t H5Eprint2(hid_t err_stack, FILE *stream);
-H5_DLL herr_t H5Ewalk2(hid_t err_stack, H5E_direction_t direction, H5E_walk2_t func, void *client_data);
-H5_DLL herr_t H5Eget_auto2(hid_t estack_id, H5E_auto2_t *func, void **client_data);
-H5_DLL herr_t H5Eset_auto2(hid_t estack_id, H5E_auto2_t func, void *client_data);
-H5_DLL herr_t H5Eclear2(hid_t err_stack);
-H5_DLL herr_t H5Eauto_is_v2(hid_t err_stack, unsigned *is_stack);
+/**
+ * --------------------------------------------------------------------------
+ * \ingroup H5E
+ *
+ * \brief Replaces the current error stack
+ *
+ * \estack_id{err_stack_id}
+ *
+ * \return \herr_t
+ *
+ * \details H5Eset_current_stack() replaces the content of the current error
+ * stack with a copy of the content of the error stack specified by
+ * \p err_stack_id, and it closes the error stack specified by
+ * \p err_stack_id.
+ *
+ * \since 1.8.0
+ */
+H5_DLL herr_t H5Eset_current_stack(hid_t err_stack_id);
+/**
+ * --------------------------------------------------------------------------
+ * \ingroup H5E
+ *
+ * \brief Pushes a new error record onto an error stack
+ *
+ * \estack_id{err_stack}. If the identifier is #H5E_DEFAULT, the error record
+ * will be pushed to the current stack.
+ * \param[in] file Name of the file in which the error was detected
+ * \param[in] func Name of the function in which the error was detected
+ * \param[in] line Line number in the file where the error was detected
+ * \param[in] cls_id Error class identifier
+ * \param[in] maj_id Major error identifier
+ * \param[in] min_id Minor error identifier
+ * \param[in] msg Error description string
+ * \return \herr_t
+ *
+ * \details H5Epush2() pushes a new error record onto the error stack specified
+ * by \p err_stack.\n
+ * The error record contains the error class identifier \p cls_id, the
+ * major and minor message identifiers \p maj_id and \p min_id, the
+ * function name \p func where the error was detected, the file name \p
+ * file and line number \p line in the file where the error was
+ * detected, and an error description \p msg.\n
+ * The major and minor errors must be in the same error class.\n
+ * The function name, filename, and error description strings must be
+ * statically allocated.\n
+ * \p msg can be a format control string with additional
+ * arguments. This design of appending additional arguments is similar
+ * to the system and C functions printf() and fprintf().
+ *
+ * \since 1.8.0
+ */
+H5_DLL herr_t H5Epush2(hid_t err_stack, const char *file, const char *func, unsigned line, hid_t cls_id,
+ hid_t maj_id, hid_t min_id, const char *msg, ...);
+/**
+ * --------------------------------------------------------------------------
+ * \ingroup H5E
+ *
+ * \brief Deletes specified number of error messages from the error stack
+ *
+ * \estack_id{err_stack}
+ * \param[in] count The number of error messages to be deleted from the top
+ * of error stack
+ * \return \herr_t
+ *
+ * \details H5Epop() deletes the number of error records specified in \p count
+ * from the top of the error stack specified by \p err_stack (including
+ * major, minor messages and description). The number of error messages
+ * to be deleted is specified by \p count.
+ *
+ * \since 1.8.0
+ */
+H5_DLL herr_t H5Epop(hid_t err_stack, size_t count);
+/**
+ * --------------------------------------------------------------------------
+ * \ingroup H5E
+ *
+ * \brief Prints the specified error stack in a default manner
+ *
+ * \estack_id{err_stack}
+ * \param[in] stream File pointer, or \c NULL for \c stderr
+ * \return \herr_t
+ *
+ * \details H5Eprint2() prints the error stack specified by \p err_stack on the
+ * specified stream, \p stream. Even if the error stack is empty, a
+ * one-line message of the following form will be printed:
+ * \code{.unparsed}
+ * HDF5-DIAG: Error detected in HDF5 library version: 1.5.62 thread 0.
+ * \endcode
+ *
+ * A similar line will appear before the error messages of each error
+ * class stating the library name, library version number, and thread
+ * identifier.
+ *
+ * If \p err_stack is #H5E_DEFAULT, the current error stack will be
+ * printed.
+ *
+ * H5Eprint2() is a convenience function for H5Ewalk2() with a function
+ * that prints error messages. Users are encouraged to write their own
+ * more specific error handlers.
+ *
+ * \since 1.8.0
+ */
+H5_DLL herr_t H5Eprint2(hid_t err_stack, FILE *stream);
+/**
+ * --------------------------------------------------------------------------
+ * \ingroup H5E
+ *
+ * \brief Walks the specified error stack, calling the specified function
+ *
+ * \estack_id{err_stack}
+ * \param[in] direction Direction in which the error stack is to be walked
+ * \param[in] func Function to be called for each error encountered
+ * \param[in] client_data Data to be passed to \p func
+ * \return \herr_t
+ *
+ * \details H5Ewalk2() walks the error stack specified by err_stack for the
+ * current thread and calls the function specified in \p func for each
+ * error along the way.
+ *
+ * If the value of \p err_stack is #H5E_DEFAULT, then H5Ewalk2() walks
+ * the current error stack.
+ *
+ * \p direction specifies whether the stack is walked from the inside
+ * out or the outside in. A value of #H5E_WALK_UPWARD means to begin
+ * with the most specific error and end at the API; a value of
+ * #H5E_WALK_DOWNWARD means to start at the API and end at the
+ * innermost function where the error was first detected.
+ *
+ * \p func, a function conforming to the #H5E_walk2_t prototype, will
+ * be called for each error in the error stack. Its arguments will
+ * include an index number \c n (beginning at zero regardless of stack
+ * traversal direction), an error stack entry \c err_desc, and the \c
+ * client_data pointer passed to H5Eprint(). The #H5E_walk2_t prototype
+ * is as follows:
+ * \snippet this H5E_walk2_t_snip
+ *
+ * \since 1.8.0
+ */
+H5_DLL herr_t H5Ewalk2(hid_t err_stack, H5E_direction_t direction, H5E_walk2_t func, void *client_data);
+/**
+ * --------------------------------------------------------------------------
+ * \ingroup H5E
+ *
+ * \brief Returns the settings for the automatic error stack traversal
+ * function and its data
+ *
+ * \estack_id
+ * \param[out] func The function currently set to be called upon an error condition
+ * \param[out] client_data Data currently set to be passed to the error function
+ * \return \herr_t
+ *
+ * \details H5Eget_auto2() returns the settings for the automatic error stack
+ * traversal function, \p func, and its data, \p client_data, that are
+ * associated with the error stack specified by \p estack_id.
+ *
+ * Either or both of the \p func and \p client_data arguments may be
+ * \c NULL, in which case the value is not returned.
+ *
+ * The library initializes its default error stack traversal functions
+ * to H5Eprint1() and H5Eprint2(). A call to H5Eget_auto2() returns
+ * H5Eprint2() or the user-defined function passed in through
+ * H5Eset_auto2(). A call to H5Eget_auto1() returns H5Eprint1() or the
+ * user-defined function passed in through H5Eset_auto1(). However, if
+ * the application passes in a user-defined function through
+ * H5Eset_auto1(), it should call H5Eget_auto1() to query the traversal
+ * function. If the application passes in a user-defined function
+ * through H5Eset_auto2(), it should call H5Eget_auto2() to query the
+ * traversal function.
+ *
+ * Mixing the new style and the old style functions will cause a
+ * failure. For example, if the application sets a user-defined
+ * old-style traversal function through H5Eset_auto1(), a call to
+ * H5Eget_auto2() will fail and will indicate that the application has
+ * mixed H5Eset_auto1() and H5Eget_auto2(). On the other hand, mixing
+ * H5Eset_auto2() and H5Eget_auto1() will also cause a failure. But if
+ * the traversal functions are the library’s default H5Eprint1() or
+ * H5Eprint2(), mixing H5Eset_auto1() and H5Eget_auto2() or mixing
+ * H5Eset_auto2() and H5Eget_auto1() does not fail.
+ *
+ * \since 1.8.0
+ */
+H5_DLL herr_t H5Eget_auto2(hid_t estack_id, H5E_auto2_t *func, void **client_data);
+/**
+ * --------------------------------------------------------------------------
+ * \ingroup H5E
+ *
+ * \brief Turns automatic error printing on or off
+ *
+ * \estack_id
+ * \param[in] func Function to be called upon an error condition
+ * \param[in] client_data Data passed to the error function
+ * \return \herr_t
+ *
+ * \details H5Eset_auto2() turns on or off automatic printing of errors for the
+ * error stack specified with \p estack_id. An \p estack_id value of
+ * #H5E_DEFAULT indicates the current stack.
+ *
+ * When automatic printing is turned on, by the use of a non-null \p func
+ * pointer, any API function which returns an error indication will
+ * first call \p func, passing it \p client_data as an argument.
+ *
+ * \p func, a function compliant with the #H5E_auto2_t prototype, is
+ * defined in the H5Epublic.h source code file as:
+ * \snippet this H5E_auto2_t_snip
+ *
+ * When the library is first initialized, the auto printing function is
+ * set to H5Eprint2() (cast appropriately) and \p client_data is the
+ * standard error stream pointer, \c stderr.
+ *
+ * Automatic stack traversal is always in the #H5E_WALK_DOWNWARD
+ * direction.
+ *
+ * Automatic error printing is turned off with a H5Eset_auto2() call
+ * with a \c NULL \p func pointer.
+ *
+ * \since 1.8.0
+ */
+H5_DLL herr_t H5Eset_auto2(hid_t estack_id, H5E_auto2_t func, void *client_data);
+/**
+ * --------------------------------------------------------------------------
+ * \ingroup H5E
+ *
+ * \brief Clears the specified error stack or the error stack for the current thread
+ *
+ * \estack_id{err_stack}
+ * \return \herr_t
+ *
+ * \details H5Eclear2() clears the error stack specified by \p err_stack, or, if
+ * \p err_stack is set to #H5E_DEFAULT, the error stack for the current
+ * thread.
+ *
+ * \p err_stack is an error stack identifier, such as that returned by
+ * H5Eget_current_stack().
+ *
+ * The current error stack is also cleared whenever an API function is
+ * called, with certain exceptions (for instance, H5Eprint1() or
+ * H5Eprint2()).
+ *
+ * \since 1.8.0
+ */
+H5_DLL herr_t H5Eclear2(hid_t err_stack);
+/**
+ * --------------------------------------------------------------------------
+ * \ingroup H5E
+ *
+ * \brief Determines the type of error stack
+ *
+ * \estack_id{err_stack}
+ * \param[out] is_stack A flag indicating which error stack \c typedef the
+ * specified error stack conforms to
+ *
+ * \return \herr_t
+ *
+ * \details H5Eauto_is_v2() determines whether the error auto reporting function
+ * for an error stack conforms to the #H5E_auto2_t \c typedef or the
+ * #H5E_auto1_t \c typedef.
+ *
+ * The \p is_stack parameter is set to 1 if the error stack conforms to
+ * #H5E_auto2_t and 0 if it conforms to #H5E_auto1_t.
+ *
+ * \since 1.8.0
+ */
+H5_DLL herr_t H5Eauto_is_v2(hid_t err_stack, unsigned *is_stack);
+/**
+ * --------------------------------------------------------------------------
+ * \ingroup H5E
+ *
+ * \brief Retrieves an error message
+ *
+ * \param[in] msg_id Error message identifier
+ * \param[out] type The type of the error message Valid values are #H5E_MAJOR
+ * and #H5E_MINOR.
+ * \param[out] msg Error message buffer
+ * \param[in] size The length of error message to be returned by this function
+ * \return Returns the size of the error message in bytes on success; otherwise
+ * returns a negative value.
+ *
+ * \details H5Eget_msg() retrieves the error message including its length and
+ * type. The error message is specified by \p msg_id. The user is
+ * responsible for passing in sufficient buffer space for the
+ * message. If \p msg is not NULL and \p size is greater than zero, the
+ * error message of \p size long is returned. The length of the message
+ * is also returned. If NULL is passed in as \p msg, only the length
+ * and type of the message is returned. If the return value is zero, it
+ * means there is no message.
+ *
+ * \since 1.8.0
+ */
H5_DLL ssize_t H5Eget_msg(hid_t msg_id, H5E_type_t *type, char *msg, size_t size);
+/**
+ * --------------------------------------------------------------------------
+ * \ingroup H5E
+ *
+ * \brief Retrieves the number of error messages in an error stack
+ *
+ * \estack_id{error_stack_id}
+ * \return Returns a non-negative value on success; otherwise returns a negative value.
+ *
+ * \details H5Eget_num() retrieves the number of error records in the error
+ * stack specified by \p error_stack_id (including major, minor
+ * messages and description).
+ *
+ * \since 1.8.0
+ */
H5_DLL ssize_t H5Eget_num(hid_t error_stack_id);
/* Symbols defined for compatibility with previous versions of the HDF5 API.
@@ -188,30 +670,259 @@ H5_DLL ssize_t H5Eget_num(hid_t error_stack_id);
typedef hid_t H5E_major_t;
typedef hid_t H5E_minor_t;
-/* Information about an error element of error stack. */
+/**
+ * Information about an error element of error stack.
+ */
typedef struct H5E_error1_t {
- H5E_major_t maj_num; /*major error number */
- H5E_minor_t min_num; /*minor error number */
- const char *func_name; /*function in which error occurred */
- const char *file_name; /*file in which error occurred */
- unsigned line; /*line in file where error occurs */
- const char *desc; /*optional supplied description */
+ H5E_major_t maj_num; /**< major error number */
+ H5E_minor_t min_num; /**< minor error number */
+ const char *func_name; /**< function in which error occurred */
+ const char *file_name; /**< file in which error occurred */
+ unsigned line; /**< line in file where error occurs */
+ const char *desc; /**< optional supplied description */
} H5E_error1_t;
/* Error stack traversal callback function pointers */
+//! <!-- [H5E_walk1_t_snip] -->
+/**
+ * \brief Callback function for H5Ewalk1()
+ *
+ * \param[in] n Indexed error position in the stack
+ * \param[in] err_desc Pointer to a data structure describing the error
+ * \param[in] client_data Pointer to client data in the format expected by the
+ * user-defined function
+ * \return \herr_t
+ */
typedef herr_t (*H5E_walk1_t)(int n, H5E_error1_t *err_desc, void *client_data);
+//! <!-- [H5E_walk1_t_snip] -->
+
+//! <!-- [H5E_auto1_t_snip] -->
+/**
+ * \brief Callback function for H5Eset_auto1()
+ *
+ * \param[in] client_data Pointer to client data in the format expected by the
+ * user-defined function
+ * \return \herr_t
+ */
typedef herr_t (*H5E_auto1_t)(void *client_data);
+//! <!-- [H5E_auto1_t_snip] -->
/* Function prototypes */
+/**
+ * --------------------------------------------------------------------------
+ * \ingroup H5E
+ *
+ * \brief Clears the error stack for the current thread
+ *
+ * \return \herr_t
+ *
+ * \details H5Eclear1() clears the error stack for the current thread.\n
+ * The stack is also cleared whenever an API function is called, with
+ * certain exceptions (for instance, H5Eprint1()).
+ *
+ * \deprecated 1.8.0 Function H5Eclear() renamed to H5Eclear1() and deprecated
+ * in this release.
+ */
H5_DLL herr_t H5Eclear1(void);
+/**
+ * --------------------------------------------------------------------------
+ * \ingroup H5E
+ *
+ * \brief Returns the current settings for the automatic error stack traversal
+ * function and its data
+ *
+ * \param[out] func Current setting for the function to be called upon an error
+ * condition
+ * \param[out] client_data Current setting for the data passed to the error
+ * function
+ * \return \herr_t
+ *
+ * \details H5Eget_auto1() returns the current settings for the automatic error
+ * stack traversal function, \p func, and its data,
+ * \p client_data. Either or both arguments may be \c NULL, in which case the
+ * value is not returned.
+ *
+ * The library initializes its default error stack traversal functions
+ * to H5Eprint1() and H5Eprint2(). A call to H5Eget_auto2() returns
+ * H5Eprint2() or the user-defined function passed in through
+ * H5Eset_auto2(). A call to H5Eget_auto1() returns H5Eprint1() or the
+ * user-defined function passed in through H5Eset_auto1(). However, if
+ * the application passes in a user-defined function through
+ * H5Eset_auto1(), it should call H5Eget_auto1() to query the traversal
+ * function. If the application passes in a user-defined function
+ * through H5Eset_auto2(), it should call H5Eget_auto2() to query the
+ * traversal function.
+ *
+ * Mixing the new style and the old style functions will cause a
+ * failure. For example, if the application sets a user-defined
+ * old-style traversal function through H5Eset_auto1(), a call to
+ * H5Eget_auto2() will fail and will indicate that the application has
+ * mixed H5Eset_auto1() and H5Eget_auto2(). On the other hand, mixing
+ * H5Eset_auto2() and H5Eget_auto1() will also cause a failure. But if
+ * the traversal functions are the library’s default H5Eprint1() or
+ * H5Eprint2(), mixing H5Eset_auto1() and H5Eget_auto2() or mixing
+ * H5Eset_auto2() and H5Eget_auto1() does not fail.
+ *
+ * \deprecated 1.8.0 Function H5Eget_auto() renamed to H5Eget_auto1() and
+ * deprecated in this release.
+ */
H5_DLL herr_t H5Eget_auto1(H5E_auto1_t *func, void **client_data);
+/**
+ * --------------------------------------------------------------------------
+ * \ingroup H5E
+ *
+ * \brief Pushes a new error record onto the error stack
+ *
+ * \param[in] file Name of the file in which the error was detected
+ * \param[in] func Name of the function in which the error was detected
+ * \param[in] line Line number in the file where the error was detected
+ * \param[in] maj Major error identifier
+ * \param[in] min Minor error identifier
+ * \param[in] str Error description string
+ * \return \herr_t
+ *
+ * \details H5Epush1() pushes a new error record onto the error stack for the
+ * current thread.\n
+ * The error has major and minor numbers \p maj_num
+ * and \p min_num, the function \p func where the error was detected, the
+ * name of the file \p file where the error was detected, the line \p line
+ * within that file, and an error description string \p str.\n
+ * The function name, filename, and error description strings must be statically
+ * allocated.
+ *
+ * \since 1.4.0
+ * \deprecated 1.8.0 Function H5Epush() renamed to H5Epush1() and
+ * deprecated in this release.
+ */
H5_DLL herr_t H5Epush1(const char *file, const char *func, unsigned line, H5E_major_t maj, H5E_minor_t min,
const char *str);
+/**
+ * --------------------------------------------------------------------------
+ * \ingroup H5E
+ *
+ * \brief Prints the current error stack in a default manner
+ *
+ * \param[in] stream File pointer, or \c NULL for \c stderr
+ * \return \herr_t
+ *
+ * \details H5Eprint1() prints prints the error stack for the current thread
+ * on the specified stream, \p stream. Even if the error stack is empty, a
+ * one-line message of the following form will be printed:
+ * \code{.unparsed}
+ * HDF5-DIAG: Error detected in thread 0.
+ * \endcode
+ * H5Eprint1() is a convenience function for H5Ewalk1() with a function
+ * that prints error messages. Users are encouraged to write their own
+ * more specific error handlers.
+ *
+ * \deprecated 1.8.0 Function H5Eprint() renamed to H5Eprint1() and
+ * deprecated in this release.
+ */
H5_DLL herr_t H5Eprint1(FILE *stream);
+/**
+ * --------------------------------------------------------------------------
+ * \ingroup H5E
+ *
+ * \brief Turns automatic error printing on or off
+ *
+ * \param[in] func Function to be called upon an error condition
+ * \param[in] client_data Data passed to the error function
+ * \return \herr_t
+ *
+ * \details H5Eset_auto1() turns on or off automatic printing of errors. When
+ * turned on (non-null \p func pointer), any API function which returns
+ * an error indication will first call \p func, passing it \p
+ * client_data as an argument.
+ *
+ * \p func, a function conforming to the #H5E_auto1_t prototype, is
+ * defined in the H5Epublic.h source code file as:
+ * \snippet this H5E_auto1_t_snip
+ *
+ * When the library is first initialized, the auto printing function is
+ * set to H5Eprint1() (cast appropriately) and \p client_data is the
+ * standard error stream pointer, \c stderr.
+ *
+ * Automatic stack traversal is always in the #H5E_WALK_DOWNWARD
+ * direction.
+ *
+ * \deprecated 1.8.0 Function H5Eset_auto() renamed to H5Eset_auto1() and
+ * deprecated in this release.
+ */
H5_DLL herr_t H5Eset_auto1(H5E_auto1_t func, void *client_data);
+/**
+ * --------------------------------------------------------------------------
+ * \ingroup H5E
+ *
+ * \brief Walks the current error stack, calling the specified function
+ *
+ * \param[in] direction Direction in which the error stack is to be walked
+ * \param[in] func Function to be called for each error encountered
+ * \param[in] client_data Data to be passed to \p func
+ * \return \herr_t
+ *
+ * \details H5Ewalk1() walks the error stack for the current thread and calls
+ * the function specified in \p func for each error along the way.
+ *
+ * \p direction specifies whether the stack is walked from the inside
+ * out or the outside in. A value of #H5E_WALK_UPWARD means to begin
+ * with the most specific error and end at the API; a value of
+ * #H5E_WALK_DOWNWARD means to start at the API and end at the
+ * innermost function where the error was first detected.
+ *
+ * \p func, a function conforming to the #H5E_walk1_t prototype, will
+ * be called for each error in the error stack. Its arguments will
+ * include an index number \c n (beginning at zero regardless of stack
+ * traversal direction), an error stack entry \c err_desc, and the \c
+ * client_data pointer passed to H5Eprint(). The #H5E_walk1_t prototype
+ * is as follows:
+ * \snippet this H5E_walk1_t_snip
+ *
+ * \deprecated 1.8.0 Function H5Ewalk() renamed to H5Ewalk1() and
+ * deprecated in this release.
+ */
H5_DLL herr_t H5Ewalk1(H5E_direction_t direction, H5E_walk1_t func, void *client_data);
-H5_DLL char * H5Eget_major(H5E_major_t maj);
-H5_DLL char * H5Eget_minor(H5E_minor_t min);
+/**
+ * --------------------------------------------------------------------------
+ * \ingroup H5E
+ *
+ * \brief Returns a character string describing an error specified by a major
+ * error number
+ *
+ * \param[in] maj Major error number
+ * \return \herr_t
+ *
+ * \details Given a major error number, H5Eget_major() returns a constant
+ * character string that describes the error.
+ *
+ * \attention This function returns a dynamically allocated string (\c char
+ * array). An application calling this function must free the memory
+ * associated with the return value to prevent a memory leak.
+ *
+ * \deprecated 1.8.0 Function deprecated in this release.
+ */
+H5_DLL char *H5Eget_major(H5E_major_t maj);
+/**
+ * --------------------------------------------------------------------------
+ * \ingroup H5E
+ *
+ * \brief Returns a character string describing an error specified by a minor
+ * error number
+ *
+ * \param[in] min Minor error number
+ * \return \herr_t
+ *
+ * \details Given a minor error number, H5Eget_minor() returns a constant
+ * character string that describes the error.
+ *
+ * \attention In the Release 1.8.x series, H5Eget_minor() returns a string of
+ * dynamic allocated \c char array. An application calling this
+ * function from an HDF5 library of Release 1.8.0 or later must free
+ * the memory associated with the return value to prevent a memory
+ * leak. This is a change from the 1.6.x release series.
+ *
+ * \deprecated 1.8.0 Function deprecated and return type changed in this release.
+ */
+H5_DLL char *H5Eget_minor(H5E_minor_t min);
#endif /* H5_NO_DEPRECATED_SYMBOLS */
#ifdef __cplusplus
diff --git a/src/H5F.c b/src/H5F.c
index 99e352e..19a115e 100644
--- a/src/H5F.c
+++ b/src/H5F.c
@@ -95,8 +95,8 @@ H5FL_EXTERN(H5VL_object_t);
/*-------------------------------------------------------------------------
* Function: H5Fget_create_plist
*
- * Purpose: Get an atom for a copy of the file-creation property list for
- * this file. This function returns an atom with a copy of the
+ * Purpose: Get an ID for a copy of the file-creation property list for
+ * this file. This function returns an ID with a copy of the
* properties used to create a file.
*
* Return: Success: Object ID for a copy of the file creation
@@ -312,12 +312,12 @@ done:
*-------------------------------------------------------------------------
*/
ssize_t
-H5Fget_obj_ids(hid_t file_id, unsigned types, size_t max_objs, hid_t *oid_list)
+H5Fget_obj_ids(hid_t file_id, unsigned types, size_t max_objs, hid_t *oid_list /*out*/)
{
ssize_t ret_value = 0; /* Return value */
FUNC_ENTER_API((-1))
- H5TRACE4("Zs", "iIuz*i", file_id, types, max_objs, oid_list);
+ H5TRACE4("Zs", "iIuzx", file_id, types, max_objs, oid_list);
/* Check arguments */
if (0 == (types & H5F_OBJ_ALL))
@@ -391,13 +391,13 @@ done:
*-------------------------------------------------------------------------
*/
herr_t
-H5Fget_vfd_handle(hid_t file_id, hid_t fapl_id, void **file_handle)
+H5Fget_vfd_handle(hid_t file_id, hid_t fapl_id, void **file_handle /*out*/)
{
H5VL_object_t *vol_obj; /* File info */
herr_t ret_value = SUCCEED; /* Return value */
FUNC_ENTER_API(FAIL)
- H5TRACE3("e", "ii**x", file_id, fapl_id, file_handle);
+ H5TRACE3("e", "iix", file_id, fapl_id, file_handle);
/* Check args */
if (!file_handle)
@@ -704,7 +704,7 @@ done:
herr_t
H5Fclose(hid_t file_id)
{
- herr_t ret_value = SUCCEED;
+ herr_t ret_value = SUCCEED; /* Return value */
FUNC_ENTER_API(FAIL)
H5TRACE1("e", "i", file_id);
@@ -715,7 +715,7 @@ H5Fclose(hid_t file_id)
/* Close the file */
if (H5I_dec_app_ref(file_id) < 0)
- HGOTO_ERROR(H5E_FILE, H5E_CANTCLOSEFILE, FAIL, "closing file ID failed")
+ HGOTO_ERROR(H5E_FILE, H5E_CANTCLOSEFILE, FAIL, "decrementing file ID failed")
done:
FUNC_LEAVE_API(ret_value)
@@ -747,19 +747,19 @@ H5Fdelete(const char *filename, hid_t fapl_id)
/* Verify access property list and set up collective metadata if appropriate */
if (H5CX_set_apl(&fapl_id, H5P_CLS_FACC, H5I_INVALID_HID, TRUE) < 0)
- HGOTO_ERROR(H5E_FILE, H5E_CANTSET, H5I_INVALID_HID, "can't set access property list info")
+ HGOTO_ERROR(H5E_FILE, H5E_CANTSET, FAIL, "can't set access property list info")
/* Get the VOL info from the fapl */
if (NULL == (plist = (H5P_genplist_t *)H5I_object_verify(fapl_id, H5I_GENPROP_LST)))
- HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, H5I_INVALID_HID, "not a property list")
+ HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a property list")
if (H5P_peek(plist, H5F_ACS_VOL_CONN_NAME, &connector_prop) < 0)
- HGOTO_ERROR(H5E_FILE, H5E_CANTGET, H5I_INVALID_HID, "can't get VOL connector info")
+ HGOTO_ERROR(H5E_FILE, H5E_CANTGET, FAIL, "can't get VOL connector info")
/* Stash a copy of the "top-level" connector property, before any pass-through
* connectors modify or unwrap it.
*/
if (H5CX_set_vol_connector_prop(&connector_prop) < 0)
- HGOTO_ERROR(H5E_FILE, H5E_CANTSET, H5I_INVALID_HID, "can't set VOL connector info in API context")
+ HGOTO_ERROR(H5E_FILE, H5E_CANTSET, FAIL, "can't set VOL connector info in API context")
/* Make sure this is HDF5 storage for this VOL connector */
if (H5VL_file_specific(NULL, H5VL_FILE_IS_ACCESSIBLE, H5P_DATASET_XFER_DEFAULT, H5_REQUEST_NULL, fapl_id,
@@ -778,6 +778,121 @@ done:
} /* end H5Fdelete() */
/*-------------------------------------------------------------------------
+ * Function: H5Fmount
+ *
+ * Purpose: Mount file CHILD_ID onto the group specified by LOC_ID and
+ * NAME using mount properties PLIST_ID.
+ *
+ * Return: SUCCEED/FAIL
+ *
+ *-------------------------------------------------------------------------
+ */
+herr_t
+H5Fmount(hid_t loc_id, const char *name, hid_t child_id, hid_t plist_id)
+{
+ H5VL_object_t *loc_vol_obj = NULL; /* Parent object */
+ H5VL_object_t *child_vol_obj = NULL; /* Child object */
+ H5I_type_t loc_type; /* ID type of location */
+ H5I_type_t child_type; /* ID type of child */
+ herr_t ret_value = SUCCEED; /* Return value */
+
+ FUNC_ENTER_API(FAIL)
+ H5TRACE4("e", "i*sii", loc_id, name, child_id, plist_id);
+
+ /* Check arguments */
+ loc_type = H5I_get_type(loc_id);
+ if (H5I_FILE != loc_type && H5I_GROUP != loc_type)
+ HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "loc_id parameter not a file or group ID")
+ if (!name)
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "name parameter cannot be NULL")
+ if (!*name)
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "name parameter cannot be the empty string")
+ child_type = H5I_get_type(child_id);
+ if (H5I_FILE != child_type)
+ HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "child_id parameter not a file ID")
+ if (H5P_DEFAULT == plist_id)
+ plist_id = H5P_FILE_MOUNT_DEFAULT;
+ else if (TRUE != H5P_isa_class(plist_id, H5P_FILE_MOUNT))
+ HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "plist_id is not a file mount property list ID")
+
+ /* Set up collective metadata if appropriate */
+ if (H5CX_set_loc(loc_id) < 0)
+ HGOTO_ERROR(H5E_FILE, H5E_CANTSET, FAIL, "can't set collective metadata read info")
+
+ /* Get the location object */
+ if (NULL == (loc_vol_obj = (H5VL_object_t *)H5I_object(loc_id)))
+ HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "could not get location object")
+
+ /* Get the child object */
+ if (NULL == (child_vol_obj = (H5VL_object_t *)H5I_object(child_id)))
+ HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "could not get child object")
+
+ /* Check if both objects are associated with the same VOL connector */
+ if (loc_vol_obj->connector->cls->value != child_vol_obj->connector->cls->value)
+ HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "Can't mount file onto object from different VOL connector")
+
+ /* Perform the mount operation */
+ if (H5VL_file_specific(loc_vol_obj, H5VL_FILE_MOUNT, H5P_DATASET_XFER_DEFAULT, H5_REQUEST_NULL,
+ (int)loc_type, name, child_vol_obj->data, plist_id) < 0)
+ HGOTO_ERROR(H5E_FILE, H5E_MOUNT, FAIL, "unable to mount file")
+
+done:
+ FUNC_LEAVE_API(ret_value)
+} /* end H5Fmount() */
+
+/*-------------------------------------------------------------------------
+ * Function: H5Funmount
+ *
+ * Purpose: Given a mount point, dissassociate the mount point's file
+ * from the file mounted there. Do not close either file.
+ *
+ * The mount point can either be the group in the parent or the
+ * root group of the mounted file (both groups have the same
+ * name). If the mount point was opened before the mount then
+ * it's the group in the parent, but if it was opened after the
+ * mount then it's the root group of the child.
+ *
+ * Return: SUCCEED/FAIL
+ *
+ *-------------------------------------------------------------------------
+ */
+herr_t
+H5Funmount(hid_t loc_id, const char *name)
+{
+ H5VL_object_t *vol_obj = NULL; /* Parent object */
+ H5I_type_t loc_type; /* ID type of location */
+ herr_t ret_value = SUCCEED; /* Return value */
+
+ FUNC_ENTER_API(FAIL)
+ H5TRACE2("e", "i*s", loc_id, name);
+
+ /* Check arguments */
+ loc_type = H5I_get_type(loc_id);
+ if (H5I_FILE != loc_type && H5I_GROUP != loc_type)
+ HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "loc_id parameter not a file or group ID")
+ if (!name)
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "name parameter cannot be NULL")
+ if (!*name)
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "name parameter cannot be the empty string")
+
+ /* Set up collective metadata if appropriate */
+ if (H5CX_set_loc(loc_id) < 0)
+ HGOTO_ERROR(H5E_FILE, H5E_CANTSET, FAIL, "can't set collective metadata read info")
+
+ /* Get the location object */
+ if (NULL == (vol_obj = (H5VL_object_t *)H5I_object(loc_id)))
+ HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "could not get location object")
+
+ /* Perform the unmount operation */
+ if (H5VL_file_specific(vol_obj, H5VL_FILE_UNMOUNT, H5P_DATASET_XFER_DEFAULT, H5_REQUEST_NULL,
+ (int)loc_type, name) < 0)
+ HGOTO_ERROR(H5E_FILE, H5E_MOUNT, FAIL, "unable to unmount file")
+
+done:
+ FUNC_LEAVE_API(ret_value)
+} /* end H5Funmount() */
+
+/*-------------------------------------------------------------------------
* Function: H5Freopen
*
* Purpose: Reopen a file. The new file handle which is returned points
@@ -848,12 +963,12 @@ done:
*-------------------------------------------------------------------------
*/
herr_t
-H5Fget_intent(hid_t file_id, unsigned *intent_flags)
+H5Fget_intent(hid_t file_id, unsigned *intent_flags /*out*/)
{
herr_t ret_value = SUCCEED;
FUNC_ENTER_API(FAIL)
- H5TRACE2("e", "i*Iu", file_id, intent_flags);
+ H5TRACE2("e", "ix", file_id, intent_flags);
/* If no intent flags were passed in, exit quietly */
if (intent_flags) {
@@ -884,12 +999,12 @@ done:
*-------------------------------------------------------------------------
*/
herr_t
-H5Fget_fileno(hid_t file_id, unsigned long *fnumber)
+H5Fget_fileno(hid_t file_id, unsigned long *fnumber /*out*/)
{
herr_t ret_value = SUCCEED;
FUNC_ENTER_API(FAIL)
- H5TRACE2("e", "i*Ul", file_id, fnumber);
+ H5TRACE2("e", "ix", file_id, fnumber);
/* If no fnumber pointer was passed in, exit quietly */
if (fnumber) {
@@ -952,13 +1067,13 @@ done:
*-------------------------------------------------------------------------
*/
herr_t
-H5Fget_filesize(hid_t file_id, hsize_t *size)
+H5Fget_filesize(hid_t file_id, hsize_t *size /*out*/)
{
H5VL_object_t *vol_obj; /* File info */
herr_t ret_value = SUCCEED; /* Return value */
FUNC_ENTER_API(FAIL)
- H5TRACE2("e", "i*h", file_id, size);
+ H5TRACE2("e", "ix", file_id, size);
/* Check args */
if (!size)
@@ -1013,13 +1128,13 @@ done:
*-------------------------------------------------------------------------
*/
ssize_t
-H5Fget_file_image(hid_t file_id, void *buf_ptr, size_t buf_len)
+H5Fget_file_image(hid_t file_id, void *buf /*out*/, size_t buf_len)
{
H5VL_object_t *vol_obj; /* File object for file ID */
ssize_t ret_value; /* Return value */
FUNC_ENTER_API((-1))
- H5TRACE3("Zs", "i*xz", file_id, buf_ptr, buf_len);
+ H5TRACE3("Zs", "ixz", file_id, buf, buf_len);
/* Check args */
if (NULL == (vol_obj = (H5VL_object_t *)H5I_object_verify(file_id, H5I_FILE)))
@@ -1027,7 +1142,7 @@ H5Fget_file_image(hid_t file_id, void *buf_ptr, size_t buf_len)
/* Get the file image */
if (H5VL_file_optional(vol_obj, H5VL_NATIVE_FILE_GET_FILE_IMAGE, H5P_DATASET_XFER_DEFAULT,
- H5_REQUEST_NULL, buf_ptr, &ret_value, buf_len) < 0)
+ H5_REQUEST_NULL, buf, &ret_value, buf_len) < 0)
HGOTO_ERROR(H5E_FILE, H5E_CANTGET, (-1), "unable to get file image")
done:
@@ -1049,17 +1164,17 @@ done:
*-------------------------------------------------------------------------
*/
herr_t
-H5Fget_mdc_config(hid_t file_id, H5AC_cache_config_t *config_ptr)
+H5Fget_mdc_config(hid_t file_id, H5AC_cache_config_t *config /*out*/)
{
H5VL_object_t *vol_obj = NULL;
herr_t ret_value = SUCCEED; /* Return value */
FUNC_ENTER_API(FAIL)
- H5TRACE2("e", "i*Cc", file_id, config_ptr);
+ H5TRACE2("e", "ix", file_id, config);
/* Check args */
- if ((NULL == config_ptr) || (config_ptr->version != H5AC__CURR_CACHE_CONFIG_VERSION))
- HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "Bad config_ptr")
+ if ((NULL == config) || (config->version != H5AC__CURR_CACHE_CONFIG_VERSION))
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "Bad config ptr")
/* Get the file object */
if (NULL == (vol_obj = (H5VL_object_t *)H5I_object(file_id)))
@@ -1067,7 +1182,7 @@ H5Fget_mdc_config(hid_t file_id, H5AC_cache_config_t *config_ptr)
/* Get the metadata cache configuration */
if (H5VL_file_optional(vol_obj, H5VL_NATIVE_FILE_GET_MDC_CONF, H5P_DATASET_XFER_DEFAULT, H5_REQUEST_NULL,
- config_ptr) < 0)
+ config) < 0)
HGOTO_ERROR(H5E_FILE, H5E_CANTGET, FAIL, "unable to get metadata cache configuration")
done:
@@ -1120,23 +1235,23 @@ done:
*-------------------------------------------------------------------------
*/
herr_t
-H5Fget_mdc_hit_rate(hid_t file_id, double *hit_rate_ptr)
+H5Fget_mdc_hit_rate(hid_t file_id, double *hit_rate /*out*/)
{
H5VL_object_t *vol_obj;
herr_t ret_value = SUCCEED; /* Return value */
FUNC_ENTER_API(FAIL)
- H5TRACE2("e", "i*d", file_id, hit_rate_ptr);
+ H5TRACE2("e", "ix", file_id, hit_rate);
/* Check args */
- if (NULL == hit_rate_ptr)
+ if (NULL == hit_rate)
HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "NULL hit rate pointer")
if (NULL == (vol_obj = (H5VL_object_t *)H5I_object_verify(file_id, H5I_FILE)))
HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "not a file ID")
/* Get the current hit rate */
if (H5VL_file_optional(vol_obj, H5VL_NATIVE_FILE_GET_MDC_HR, H5P_DATASET_XFER_DEFAULT, H5_REQUEST_NULL,
- hit_rate_ptr) < 0)
+ hit_rate) < 0)
HGOTO_ERROR(H5E_FILE, H5E_CANTGET, FAIL, "unable to get MDC hit rate")
done:
@@ -1157,14 +1272,14 @@ done:
*-------------------------------------------------------------------------
*/
herr_t
-H5Fget_mdc_size(hid_t file_id, size_t *max_size_ptr, size_t *min_clean_size_ptr, size_t *cur_size_ptr,
- int *cur_num_entries_ptr)
+H5Fget_mdc_size(hid_t file_id, size_t *max_size /*out*/, size_t *min_clean_size /*out*/,
+ size_t *cur_size /*out*/, int *cur_num_entries /*out*/)
{
H5VL_object_t *vol_obj;
herr_t ret_value = SUCCEED; /* Return value */
FUNC_ENTER_API(FAIL)
- H5TRACE5("e", "i*z*z*z*Is", file_id, max_size_ptr, min_clean_size_ptr, cur_size_ptr, cur_num_entries_ptr);
+ H5TRACE5("e", "ixxxx", file_id, max_size, min_clean_size, cur_size, cur_num_entries);
/* Check args */
if (NULL == (vol_obj = (H5VL_object_t *)H5I_object_verify(file_id, H5I_FILE)))
@@ -1172,7 +1287,7 @@ H5Fget_mdc_size(hid_t file_id, size_t *max_size_ptr, size_t *min_clean_size_ptr,
/* Get the size data */
if (H5VL_file_optional(vol_obj, H5VL_NATIVE_FILE_GET_MDC_SIZE, H5P_DATASET_XFER_DEFAULT, H5_REQUEST_NULL,
- max_size_ptr, min_clean_size_ptr, cur_size_ptr, cur_num_entries_ptr) < 0)
+ max_size, min_clean_size, cur_size, cur_num_entries) < 0)
HGOTO_ERROR(H5E_FILE, H5E_CANTGET, FAIL, "unable to get MDC size")
done:
@@ -1279,14 +1394,14 @@ done:
*-------------------------------------------------------------------------
*/
herr_t
-H5Fget_info2(hid_t obj_id, H5F_info2_t *finfo)
+H5Fget_info2(hid_t obj_id, H5F_info2_t *finfo /*out*/)
{
H5VL_object_t *vol_obj = NULL;
H5I_type_t type;
herr_t ret_value = SUCCEED; /* Return value */
FUNC_ENTER_API(FAIL)
- H5TRACE2("e", "i*FI", obj_id, finfo);
+ H5TRACE2("e", "ix", obj_id, finfo);
/* Check args */
if (!finfo)
@@ -1322,13 +1437,13 @@ done:
*-------------------------------------------------------------------------
*/
herr_t
-H5Fget_metadata_read_retry_info(hid_t file_id, H5F_retry_info_t *info)
+H5Fget_metadata_read_retry_info(hid_t file_id, H5F_retry_info_t *info /*out*/)
{
H5VL_object_t *vol_obj = NULL; /* File object for file ID */
herr_t ret_value = SUCCEED; /* Return value */
FUNC_ENTER_API(FAIL)
- H5TRACE2("e", "i*!", file_id, info);
+ H5TRACE2("e", "ix", file_id, info);
/* Check args */
if (!info)
@@ -1553,13 +1668,13 @@ done:
*-------------------------------------------------------------------------
*/
herr_t
-H5Fget_mdc_logging_status(hid_t file_id, hbool_t *is_enabled, hbool_t *is_currently_logging)
+H5Fget_mdc_logging_status(hid_t file_id, hbool_t *is_enabled /*out*/, hbool_t *is_currently_logging /*out*/)
{
H5VL_object_t *vol_obj; /* File info */
herr_t ret_value = SUCCEED; /* Return value */
FUNC_ENTER_API(FAIL)
- H5TRACE3("e", "i*b*b", file_id, is_enabled, is_currently_logging);
+ H5TRACE3("e", "ixx", file_id, is_enabled, is_currently_logging);
/* Sanity check */
if (NULL == (vol_obj = (H5VL_object_t *)H5I_object_verify(file_id, H5I_FILE)))
@@ -1690,14 +1805,15 @@ done:
*-------------------------------------------------------------------------
*/
herr_t
-H5Fget_page_buffering_stats(hid_t file_id, unsigned accesses[2], unsigned hits[2], unsigned misses[2],
- unsigned evictions[2], unsigned bypasses[2])
+H5Fget_page_buffering_stats(hid_t file_id, unsigned accesses[2] /*out*/, unsigned hits[2] /*out*/,
+ unsigned misses[2] /*out*/, unsigned evictions[2] /*out*/,
+ unsigned bypasses[2] /*out*/)
{
H5VL_object_t *vol_obj; /* File object */
herr_t ret_value = SUCCEED; /* Return value */
FUNC_ENTER_API(FAIL)
- H5TRACE6("e", "i*Iu*Iu*Iu*Iu*Iu", file_id, accesses, hits, misses, evictions, bypasses);
+ H5TRACE6("e", "ixxxxx", file_id, accesses, hits, misses, evictions, bypasses);
/* Check args */
if (NULL == (vol_obj = (H5VL_object_t *)H5I_object_verify(file_id, H5I_FILE)))
@@ -1728,13 +1844,13 @@ done:
*-------------------------------------------------------------------------
*/
herr_t
-H5Fget_mdc_image_info(hid_t file_id, haddr_t *image_addr, hsize_t *image_len)
+H5Fget_mdc_image_info(hid_t file_id, haddr_t *image_addr /*out*/, hsize_t *image_len /*out*/)
{
H5VL_object_t *vol_obj; /* File info */
herr_t ret_value = SUCCEED; /* Return value */
FUNC_ENTER_API(FAIL)
- H5TRACE3("e", "i*a*h", file_id, image_addr, image_len);
+ H5TRACE3("e", "ixx", file_id, image_addr, image_len);
/* Check args */
if (NULL == (vol_obj = (H5VL_object_t *)H5I_object_verify(file_id, H5I_FILE)))
@@ -1761,13 +1877,13 @@ done:
*-------------------------------------------------------------------------
*/
herr_t
-H5Fget_eoa(hid_t file_id, haddr_t *eoa)
+H5Fget_eoa(hid_t file_id, haddr_t *eoa /*out*/)
{
H5VL_object_t *vol_obj; /* File info */
herr_t ret_value = SUCCEED; /* Return value */
FUNC_ENTER_API(FAIL)
- H5TRACE2("e", "i*a", file_id, eoa);
+ H5TRACE2("e", "ix", file_id, eoa);
/* Check args */
if (NULL == (vol_obj = (H5VL_object_t *)H5I_object_verify(file_id, H5I_FILE)))
@@ -1827,13 +1943,13 @@ done:
*-------------------------------------------------------------------------
*/
herr_t
-H5Fget_dset_no_attrs_hint(hid_t file_id, hbool_t *minimize)
+H5Fget_dset_no_attrs_hint(hid_t file_id, hbool_t *minimize /*out*/)
{
H5VL_object_t *vol_obj = NULL;
herr_t ret_value = SUCCEED;
FUNC_ENTER_API(FAIL)
- H5TRACE2("e", "i*b", file_id, minimize);
+ H5TRACE2("e", "ix", file_id, minimize);
if (NULL == minimize)
HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "out pointer 'minimize' cannot be NULL")
diff --git a/src/H5FA.c b/src/H5FA.c
index e4da82c..05b0bd8 100644
--- a/src/H5FA.c
+++ b/src/H5FA.c
@@ -15,7 +15,7 @@
*
* Created: H5FA.c
* April 2009
- * Vailin Choi <vchoi@hdfgroup.org>
+ * Vailin Choi
*
* Purpose: Implements a Fixed Array for storing elements
* of datasets with fixed dimensions.
@@ -101,7 +101,6 @@ H5FL_BLK_DEFINE(fa_native_elmt);
* NULL on failure
*
* Programmer: Quincey Koziol
- * koziol@lbl.gov
* Oct 17 2016
*
*-------------------------------------------------------------------------
diff --git a/src/H5FAcache.c b/src/H5FAcache.c
index cdfbd46..171f4e8 100644
--- a/src/H5FAcache.c
+++ b/src/H5FAcache.c
@@ -15,7 +15,7 @@
*
* Created: H5FAcache.c
* Jul 2 2009
- * Quincey Koziol <koziol@hdfgroup.org>
+ * Quincey Koziol
*
* Purpose: Implement fixed array metadata cache methods.
*
@@ -166,7 +166,6 @@ const H5AC_class_t H5AC_FARRAY_DBLK_PAGE[1] = {{
* Return: Non-negative on success/Negative on failure
*
* Programmer: Quincey Koziol
- * koziol@hdfgroup.org
* July 31, 2013
*
*-------------------------------------------------------------------------
@@ -228,7 +227,6 @@ END_FUNC(STATIC) /* end H5FA__cache_hdr_verify_chksum() */
* Failure: NULL
*
* Programmer: Quincey Koziol
- * koziol@hdfgroup.org
* August 12, 2013
*
*-------------------------------------------------------------------------
@@ -257,7 +255,7 @@ BEGIN_FUNC(STATIC, ERR, void *, NULL, NULL,
hdr->addr = udata->addr;
/* Magic number */
- if (HDmemcmp(image, H5FA_HDR_MAGIC, (size_t)H5_SIZEOF_MAGIC))
+ if (HDmemcmp(image, H5FA_HDR_MAGIC, (size_t)H5_SIZEOF_MAGIC) != 0)
H5E_THROW(H5E_BADVALUE, "wrong fixed array header signature")
image += H5_SIZEOF_MAGIC;
@@ -339,7 +337,6 @@ END_FUNC(STATIC) /* end H5FA__cache_hdr_deserialize() */
* Return: Non-negative on success/Negative on failure
*
* Programmer: Quincey Koziol
- * koziol@hdfgroup.org
* August 12, 2013
*
*-------------------------------------------------------------------------
@@ -367,7 +364,6 @@ END_FUNC(STATIC) /* end H5FA__cache_hdr_image_len() */
* Return: Non-negative on success/Negative on failure
*
* Programmer: Quincey Koziol
- * koziol@hdfgroup.org
* August 12, 2013
*
*-------------------------------------------------------------------------
@@ -506,7 +502,6 @@ END_FUNC(STATIC) /* end H5FA__cache_hdr_notify() */
* Return: SUCCEED/FAIL
*
* Programmer: Quincey Koziol
- * koziol@hdfgroup.org
* August 12, 2013
*
*-------------------------------------------------------------------------
@@ -532,7 +527,6 @@ END_FUNC(STATIC) /* end H5FA__cache_hdr_free_icr() */
* Return: Non-negative on success/Negative on failure
*
* Programmer: Quincey Koziol
- * koziol@hdfgroup.org
* August 12, 2013
*
*-------------------------------------------------------------------------
@@ -616,7 +610,6 @@ END_FUNC(STATIC) /* end H5FA__cache_dblock_verify_chksum() */
* Failure: NULL
*
* Programmer: Quincey Koziol
- * koziol@hdfgroup.org
* August 14, 2013
*
*-------------------------------------------------------------------------
@@ -647,7 +640,7 @@ BEGIN_FUNC(STATIC, ERR, void *, NULL, NULL,
dblock->addr = udata->dblk_addr;
/* Magic number */
- if (HDmemcmp(image, H5FA_DBLOCK_MAGIC, (size_t)H5_SIZEOF_MAGIC))
+ if (HDmemcmp(image, H5FA_DBLOCK_MAGIC, (size_t)H5_SIZEOF_MAGIC) != 0)
H5E_THROW(H5E_BADVALUE, "wrong fixed array data block signature")
image += H5_SIZEOF_MAGIC;
@@ -715,7 +708,6 @@ END_FUNC(STATIC) /* end H5FA__cache_dblock_deserialize() */
* Return: Non-negative on success/Negative on failure
*
* Programmer: Quincey Koziol
- * koziol@hdfgroup.org
* August 14, 2013
*
*-------------------------------------------------------------------------
@@ -746,7 +738,6 @@ END_FUNC(STATIC) /* end H5FA__cache_dblock_image_len() */
* Return: Non-negative on success/Negative on failure
*
* Programmer: Quincey Koziol
- * koziol@hdfgroup.org
* August 14, 2013
*
*-------------------------------------------------------------------------
@@ -893,7 +884,6 @@ END_FUNC(STATIC) /* end H5FA__cache_dblock_notify() */
* Return: SUCCEED/FAIL
*
* Programmer: Quincey Koziol
- * koziol@hdfgroup.org
* August 14, 2013
*
*-------------------------------------------------------------------------
@@ -965,7 +955,6 @@ END_FUNC(STATIC) /* end H5FA__cache_dblock_fsf_size() */
* Return: Non-negative on success/Negative on failure
*
* Programmer: Quincey Koziol
- * koziol@hdfgroup.org
* August 14, 2013
*
*-------------------------------------------------------------------------
@@ -1028,7 +1017,6 @@ END_FUNC(STATIC) /* end H5FA__cache_dblk_page_verify_chksum() */
* Failure: NULL
*
* Programmer: Quincey Koziol
- * koziol@hdfgroup.org
* August 14, 2013
*
*-------------------------------------------------------------------------
@@ -1100,7 +1088,6 @@ END_FUNC(STATIC) /* end H5FA__cache_dblk_page_deserialize() */
* Return: Non-negative on success/Negative on failure
*
* Programmer: Quincey Koziol
- * koziol@hdfgroup.org
* August 14, 2013
*
*-------------------------------------------------------------------------
@@ -1128,7 +1115,6 @@ END_FUNC(STATIC) /* end H5FA__cache_dblk_page_image_len() */
* Return: SUCCEED/FAIL
*
* Programmer: Quincey Koziol
- * koziol@hdfgroup.org
* August 14, 2013
*
*-------------------------------------------------------------------------
@@ -1179,7 +1165,6 @@ END_FUNC(STATIC) /* end H5FA__cache_dblk_page_serialize() */
* Return: Non-negative on success/Negative on failure
*
* Programmer: Quincey Koziol
- * koziol@lbl.gov
* Oct 17 2016
*
*-------------------------------------------------------------------------
@@ -1241,7 +1226,6 @@ END_FUNC(STATIC) /* end H5FA__cache_dblk_page_notify() */
* Return: Non-negative on success/Negative on failure
*
* Programmer: Quincey Koziol
- * koziol@hdfgroup.org
* August 14, 2013
*
*-------------------------------------------------------------------------
diff --git a/src/H5FAdbg.c b/src/H5FAdbg.c
index 1cdcf67..8c2c9a8 100644
--- a/src/H5FAdbg.c
+++ b/src/H5FAdbg.c
@@ -111,19 +111,20 @@ BEGIN_FUNC(PKG, ERR, herr_t, SUCCEED, FAIL,
/* Print the values */
HDfprintf(stream, "%*s%-*s %s\n", indent, "", fwidth, "Array class ID:", hdr->cparam.cls->name);
- HDfprintf(stream, "%*s%-*s %Zu\n", indent, "", fwidth, "Header size:", hdr->size);
+ HDfprintf(stream, "%*s%-*s %zu\n", indent, "", fwidth, "Header size:", hdr->size);
HDfprintf(stream, "%*s%-*s %u\n", indent, "", fwidth,
"Raw Element Size:", (unsigned)hdr->cparam.raw_elmt_size);
- HDfprintf(stream, "%*s%-*s %Zu\n", indent, "", fwidth,
+ HDfprintf(stream, "%*s%-*s %zu\n", indent, "", fwidth,
"Native Element Size (on this platform):", hdr->cparam.cls->nat_elmt_size);
HDfprintf(stream, "%*s%-*s %u\n", indent, "", fwidth, "Max. # of elements in data block page:",
(unsigned)((size_t)1 << hdr->cparam.max_dblk_page_nelmts_bits));
- HDfprintf(stream, "%*s%-*s %Hu\n", indent, "", fwidth,
+ HDfprintf(stream, "%*s%-*s %" PRIuHSIZE "\n", indent, "", fwidth,
"Number of elements in Fixed Array:", hdr->stats.nelmts);
- HDfprintf(stream, "%*s%-*s %a\n", indent, "", fwidth, "Fixed Array Data Block Address:", hdr->dblk_addr);
+ HDfprintf(stream, "%*s%-*s %" PRIuHADDR "\n", indent, "", fwidth,
+ "Fixed Array Data Block Address:", hdr->dblk_addr);
CATCH
if (dbg_ctx && cls->dst_dbg_ctx(dbg_ctx) < 0)
@@ -185,12 +186,12 @@ BEGIN_FUNC(PKG, ERR, herr_t, SUCCEED, FAIL,
/* Print the values */
HDfprintf(stream, "%*s%-*s %s\n", indent, "", fwidth, "Array class ID:", hdr->cparam.cls->name);
- HDfprintf(stream, "%*s%-*s %a\n", indent, "", fwidth, "Address of Data Block:", dblock->addr);
- HDfprintf(stream, "%*s%-*s %Zu\n", indent, "", fwidth, "Data Block size:", dblock->size);
- HDfprintf(stream, "%*s%-*s %Hu\n", indent, "", fwidth,
+ HDfprintf(stream, "%*s%-*s %" PRIuHADDR "\n", indent, "", fwidth, "Address of Data Block:", dblock->addr);
+ HDfprintf(stream, "%*s%-*s %" PRIuHSIZE "\n", indent, "", fwidth, "Data Block size:", dblock->size);
+ HDfprintf(stream, "%*s%-*s %" PRIuHSIZE "\n", indent, "", fwidth,
"Number of elements in Data Block:", hdr->cparam.nelmts);
- HDfprintf(stream, "%*s%-*s %Hu\n", indent, "", fwidth, "Number of pages in Data Block:", dblock->npages);
- HDfprintf(stream, "%*s%-*s %Hu\n", indent, "", fwidth,
+ HDfprintf(stream, "%*s%-*s %zu\n", indent, "", fwidth, "Number of pages in Data Block:", dblock->npages);
+ HDfprintf(stream, "%*s%-*s %zu\n", indent, "", fwidth,
"Number of elements per Data Block page:", dblock->dblk_page_nelmts);
if (dblock->npages) { /* paging */
@@ -207,7 +208,7 @@ BEGIN_FUNC(PKG, ERR, herr_t, SUCCEED, FAIL,
/* Read and print each page's elements in the data block */
for (page_idx = 0; page_idx < dblock->npages; page_idx++) {
if (!H5VM_bit_get(dblock->dblk_page_init, page_idx)) {
- HDfprintf(stream, "%*s%-*s %Hu %s\n", indent, "", fwidth, "Page %Zu:", page_idx, "empty");
+ HDfprintf(stream, "%*s%-*s %zu %s\n", indent, "", fwidth, "Page %zu:", page_idx, "empty");
} /* end if */
else { /* get the page */
@@ -225,7 +226,7 @@ BEGIN_FUNC(PKG, ERR, herr_t, SUCCEED, FAIL,
"unable to protect fixed array data block page, address = %llu",
(unsigned long long)dblk_page_addr)
- HDfprintf(stream, "%*sElements in page %Zu:\n", indent, "", page_idx);
+ HDfprintf(stream, "%*sElements in page %zu:\n", indent, "", page_idx);
for (u = 0; u < dblk_page_nelmts; u++) {
/* Call the class's 'debug' callback */
if ((hdr->cparam.cls->debug)(stream, (indent + 3), MAX(0, (fwidth - 3)), (hsize_t)u,
diff --git a/src/H5FAhdr.c b/src/H5FAhdr.c
index 3ff5e59..867160f 100644
--- a/src/H5FAhdr.c
+++ b/src/H5FAhdr.c
@@ -382,7 +382,6 @@ END_FUNC(PKG) /* end H5FA__hdr_modified() */
* Return: Non-NULL pointer to header on success/NULL on failure
*
* Programmer: Quincey Koziol
- * koziol@hdfgroup.org
* Aug 12 2013
*
*-------------------------------------------------------------------------
@@ -438,7 +437,6 @@ END_FUNC(PKG) /* end H5FA__hdr_protect() */
* Return: Non-negative on success/Negative on failure
*
* Programmer: Quincey Koziol
- * koziol@hdfgroup.org
* Aug 12 2013
*
*-------------------------------------------------------------------------
@@ -457,7 +455,7 @@ BEGIN_FUNC(PKG, ERR, herr_t, SUCCEED, FAIL, H5FA__hdr_unprotect(H5FA_hdr_t *hdr,
CATCH
-END_FUNC(PKG) /* end H5EA__hdr_unprotect() */
+END_FUNC(PKG) /* end H5FA__hdr_unprotect() */
/*-------------------------------------------------------------------------
* Function: H5FA__hdr_delete
diff --git a/src/H5FAint.c b/src/H5FAint.c
index 8f40e32..864c7ee 100644
--- a/src/H5FAint.c
+++ b/src/H5FAint.c
@@ -15,7 +15,7 @@
*
* Created: H5FAint.c
* Fall 2012
- * Dana Robinson <derobins@hdfgroup.org>
+ * Dana Robinson
*
* Purpose: Internal routines for fixed arrays.
*
diff --git a/src/H5FAstat.c b/src/H5FAstat.c
index a5b9cac..1fdf47f 100644
--- a/src/H5FAstat.c
+++ b/src/H5FAstat.c
@@ -33,9 +33,9 @@
/***********/
/* Headers */
/***********/
-#include "H5private.h" /* Generic Functions */
-#include "H5Eprivate.h" /* Error handling */
-#include "H5FApkg.h" /* Fixed Arrays */
+#include "H5private.h" /* Generic Functions */
+#include "H5Eprivate.h" /* Error handling */
+#include "H5FApkg.h" /* Fixed Arrays */
#include "H5MMprivate.h" /* Memory management */
/****************/
diff --git a/src/H5FD.c b/src/H5FD.c
index 1e9274f..fcf39f5 100644
--- a/src/H5FD.c
+++ b/src/H5FD.c
@@ -248,7 +248,7 @@ H5FDregister(const H5FD_class_t *cls)
/* Create the new class ID */
if ((ret_value = H5FD_register(cls, sizeof(H5FD_class_t), TRUE)) < 0)
- HGOTO_ERROR(H5E_ATOM, H5E_CANTREGISTER, H5I_INVALID_HID, "unable to register file driver ID")
+ HGOTO_ERROR(H5E_ID, H5E_CANTREGISTER, H5I_INVALID_HID, "unable to register file driver ID")
done:
FUNC_LEAVE_API(ret_value)
@@ -298,7 +298,7 @@ H5FD_register(const void *_cls, size_t size, hbool_t app_ref)
/* Create the new class ID */
if ((ret_value = H5I_register(H5I_VFL, saved, app_ref)) < 0)
- HGOTO_ERROR(H5E_ATOM, H5E_CANTREGISTER, H5I_INVALID_HID, "unable to register file driver ID")
+ HGOTO_ERROR(H5E_ID, H5E_CANTREGISTER, H5I_INVALID_HID, "unable to register file driver ID")
done:
if (H5I_INVALID_HID == ret_value)
@@ -371,7 +371,7 @@ H5FD_get_class(hid_t id)
/* Get the plist structure */
if (NULL == (plist = (H5P_genplist_t *)H5I_object(id)))
- HGOTO_ERROR(H5E_ATOM, H5E_BADATOM, NULL, "can't find object for ID")
+ HGOTO_ERROR(H5E_ID, H5E_BADID, NULL, "can't find object for ID")
if (TRUE == H5P_isa_class(id, H5P_FILE_ACCESS)) {
H5FD_driver_prop_t driver_prop; /* Property for driver ID & info */
@@ -504,9 +504,9 @@ H5FD_sb_load(H5FD_t *file, const char *name, const uint8_t *buf)
/* Check if driver matches driver information saved. Unfortunately, we can't push this
* function to each specific driver because we're checking if the driver is correct.
*/
- if (!HDstrncmp(name, "NCSAfami", (size_t)8) && HDstrcmp(file->cls->name, "family"))
+ if (!HDstrncmp(name, "NCSAfami", (size_t)8) && HDstrcmp(file->cls->name, "family") != 0)
HGOTO_ERROR(H5E_VFL, H5E_BADVALUE, FAIL, "family driver should be used")
- if (!HDstrncmp(name, "NCSAmult", (size_t)8) && HDstrcmp(file->cls->name, "multi"))
+ if (!HDstrncmp(name, "NCSAmult", (size_t)8) && HDstrcmp(file->cls->name, "multi") != 0)
HGOTO_ERROR(H5E_VFL, H5E_BADVALUE, FAIL, "multi driver should be used")
/* Decode driver information */
@@ -769,8 +769,8 @@ finish:
H5FD_t *
H5FD_open(const char *name, unsigned flags, hid_t fapl_id, haddr_t maxaddr)
{
- H5FD_class_t * driver; /* VFD for file */
- H5FD_t * file;
+ H5FD_class_t * driver; /* VFD for file */
+ H5FD_t * file = NULL; /* VFD file struct */
H5FD_driver_prop_t driver_prop; /* Property for driver ID & info */
H5P_genplist_t * plist; /* Property list pointer */
unsigned long driver_flags = 0; /* File-inspecific driver feature flags */
@@ -1715,7 +1715,7 @@ H5FDlock(H5FD_t *file, hbool_t rw)
/* Call private function */
if (H5FD_lock(file, rw) < 0)
- HGOTO_ERROR(H5E_VFL, H5E_CANTINIT, FAIL, "file lock request failed")
+ HGOTO_ERROR(H5E_VFL, H5E_CANTLOCKFILE, FAIL, "file lock request failed")
done:
FUNC_LEAVE_API(ret_value)
@@ -1743,7 +1743,7 @@ H5FD_lock(H5FD_t *file, hbool_t rw)
/* Dispatch to driver */
if (file->cls->lock && (file->cls->lock)(file, rw) < 0)
- HGOTO_ERROR(H5E_VFL, H5E_CANTUPDATE, FAIL, "driver lock request failed")
+ HGOTO_ERROR(H5E_VFL, H5E_CANTLOCKFILE, FAIL, "driver lock request failed")
done:
FUNC_LEAVE_NOAPI(ret_value)
@@ -1774,7 +1774,7 @@ H5FDunlock(H5FD_t *file)
/* Call private function */
if (H5FD_unlock(file) < 0)
- HGOTO_ERROR(H5E_VFL, H5E_CANTINIT, FAIL, "file unlock request failed")
+ HGOTO_ERROR(H5E_VFL, H5E_CANTUNLOCKFILE, FAIL, "file unlock request failed")
done:
FUNC_LEAVE_API(ret_value)
@@ -1802,7 +1802,7 @@ H5FD_unlock(H5FD_t *file)
/* Dispatch to driver */
if (file->cls->unlock && (file->cls->unlock)(file) < 0)
- HGOTO_ERROR(H5E_VFL, H5E_CANTUPDATE, FAIL, "driver unlock request failed")
+ HGOTO_ERROR(H5E_VFL, H5E_CANTUNLOCKFILE, FAIL, "driver unlock request failed")
done:
FUNC_LEAVE_NOAPI(ret_value)
@@ -1845,12 +1845,12 @@ H5FD_get_fileno(const H5FD_t *file, unsigned long *filenum)
*--------------------------------------------------------------------------
*/
herr_t
-H5FDget_vfd_handle(H5FD_t *file, hid_t fapl_id, void **file_handle)
+H5FDget_vfd_handle(H5FD_t *file, hid_t fapl_id, void **file_handle /*out*/)
{
herr_t ret_value = SUCCEED;
FUNC_ENTER_API(FAIL)
- H5TRACE3("e", "*#i**x", file, fapl_id, file_handle);
+ H5TRACE3("e", "*#ix", file, fapl_id, file_handle);
/* Check arguments */
if (!file)
@@ -2000,10 +2000,44 @@ H5FDdriver_query(hid_t driver_id, unsigned long *flags /*out*/)
/* Check for the driver to query and then query it */
if (NULL == (driver = (H5FD_class_t *)H5I_object_verify(driver_id, H5I_VFL)))
- HGOTO_ERROR(H5E_ATOM, H5E_BADATOM, FAIL, "not a VFL ID")
+ HGOTO_ERROR(H5E_ID, H5E_BADID, FAIL, "not a VFL ID")
if (H5FD_driver_query(driver, flags) < 0)
HGOTO_ERROR(H5E_VFL, H5E_BADVALUE, FAIL, "driver flag query failed")
done:
FUNC_LEAVE_API(ret_value)
} /* end H5FDdriver_query() */
+
+/*-------------------------------------------------------------------------
+ * Function: H5FDdelete
+ *
+ * Purpose: Deletes a file
+ *
+ * Return: Non-negative on success/Negative on failure
+ *
+ *-------------------------------------------------------------------------
+ */
+herr_t
+H5FDdelete(const char *filename, hid_t fapl_id)
+{
+ herr_t ret_value = SUCCEED;
+
+ FUNC_ENTER_API(FAIL)
+ H5TRACE2("e", "*si", filename, fapl_id);
+
+ /* Check arguments */
+ if (!filename || !*filename)
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "no file name specified")
+
+ if (H5P_DEFAULT == fapl_id)
+ fapl_id = H5P_FILE_ACCESS_DEFAULT;
+ else if (TRUE != H5P_isa_class(fapl_id, H5P_FILE_ACCESS))
+ HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a file access property list")
+
+ /* Call private function */
+ if (H5FD_delete(filename, fapl_id) < 0)
+ HGOTO_ERROR(H5E_VFL, H5E_CANTDELETEFILE, FAIL, "unable to delete file")
+
+done:
+ FUNC_LEAVE_API(ret_value)
+} /* end H5FDdelete() */
diff --git a/src/H5FDcore.c b/src/H5FDcore.c
index b50f71a..f405200 100644
--- a/src/H5FDcore.c
+++ b/src/H5FDcore.c
@@ -148,6 +148,7 @@ static herr_t H5FD__core_flush(H5FD_t *_file, hid_t dxpl_id, hbool_t closing);
static herr_t H5FD__core_truncate(H5FD_t *_file, hid_t dxpl_id, hbool_t closing);
static herr_t H5FD__core_lock(H5FD_t *_file, hbool_t rw);
static herr_t H5FD__core_unlock(H5FD_t *_file);
+static herr_t H5FD__core_delete(const char *filename, hid_t fapl_id);
static const H5FD_class_t H5FD_core_g = {
"core", /* name */
@@ -181,6 +182,7 @@ static const H5FD_class_t H5FD_core_g = {
H5FD__core_truncate, /* truncate */
H5FD__core_lock, /* lock */
H5FD__core_unlock, /* unlock */
+ H5FD__core_delete, /* del */
NULL, /* dedup */
H5FD_FLMAP_DICHOTOMY /* fl_map */
};
@@ -523,7 +525,7 @@ H5Pset_core_write_tracking(hid_t plist_id, hbool_t is_enabled, size_t page_size)
/* Get the plist structure */
if (NULL == (plist = H5P_object_verify(plist_id, H5P_FILE_ACCESS)))
- HGOTO_ERROR(H5E_PLIST, H5E_BADATOM, FAIL, "can't find object for ID")
+ HGOTO_ERROR(H5E_PLIST, H5E_BADID, FAIL, "can't find object for ID")
if (H5FD_CORE != H5P_peek_driver(plist))
HGOTO_ERROR(H5E_PLIST, H5E_BADVALUE, FAIL, "incorrect VFL driver")
if (NULL == (old_fa = (const H5FD_core_fapl_t *)H5P_peek_driver_info(plist)))
@@ -558,18 +560,18 @@ done:
*-------------------------------------------------------------------------
*/
herr_t
-H5Pget_core_write_tracking(hid_t plist_id, hbool_t *is_enabled, size_t *page_size)
+H5Pget_core_write_tracking(hid_t plist_id, hbool_t *is_enabled /*out*/, size_t *page_size /*out*/)
{
H5P_genplist_t * plist; /* Property list pointer */
const H5FD_core_fapl_t *fa; /* Core VFD info */
herr_t ret_value = SUCCEED; /* Return value */
FUNC_ENTER_API(FAIL)
- H5TRACE3("e", "i*b*z", plist_id, is_enabled, page_size);
+ H5TRACE3("e", "ixx", plist_id, is_enabled, page_size);
/* Get the plist structure */
if (NULL == (plist = H5P_object_verify(plist_id, H5P_FILE_ACCESS)))
- HGOTO_ERROR(H5E_PLIST, H5E_BADATOM, FAIL, "can't find object for ID")
+ HGOTO_ERROR(H5E_PLIST, H5E_BADID, FAIL, "can't find object for ID")
if (H5FD_CORE != H5P_peek_driver(plist))
HGOTO_ERROR(H5E_PLIST, H5E_BADVALUE, FAIL, "incorrect VFL driver")
if (NULL == (fa = (const H5FD_core_fapl_t *)H5P_peek_driver_info(plist)))
@@ -1131,23 +1133,24 @@ H5FD__core_query(const H5FD_t *_file, unsigned long *flags /* out */)
FUNC_ENTER_STATIC_NOERR
+ /* clang-format off */
/* Set the VFL feature flags that this driver supports */
- if (flags) {
+ if(flags) {
*flags = 0;
- *flags |= H5FD_FEAT_AGGREGATE_METADATA; /* OK to aggregate metadata allocations */
- *flags |= H5FD_FEAT_ACCUMULATE_METADATA; /* OK to accumulate metadata for faster writes */
- *flags |= H5FD_FEAT_DATA_SIEVE; /* OK to perform data sieving for faster raw data reads & writes */
- *flags |= H5FD_FEAT_AGGREGATE_SMALLDATA; /* OK to aggregate "small" raw data allocations */
- *flags |= H5FD_FEAT_ALLOW_FILE_IMAGE; /* OK to use file image feature with this VFD */
- *flags |= H5FD_FEAT_CAN_USE_FILE_IMAGE_CALLBACKS; /* OK to use file image callbacks with this VFD */
+ *flags |= H5FD_FEAT_AGGREGATE_METADATA; /* OK to aggregate metadata allocations */
+ *flags |= H5FD_FEAT_ACCUMULATE_METADATA; /* OK to accumulate metadata for faster writes */
+ *flags |= H5FD_FEAT_DATA_SIEVE; /* OK to perform data sieving for faster raw data reads & writes */
+ *flags |= H5FD_FEAT_AGGREGATE_SMALLDATA; /* OK to aggregate "small" raw data allocations */
+ *flags |= H5FD_FEAT_ALLOW_FILE_IMAGE; /* OK to use file image feature with this VFD */
+ *flags |= H5FD_FEAT_CAN_USE_FILE_IMAGE_CALLBACKS; /* OK to use file image callbacks with this VFD */
/* These feature flags are only applicable if the backing store is enabled */
- if (file && file->fd >= 0 && file->backing_store) {
- *flags |= H5FD_FEAT_POSIX_COMPAT_HANDLE; /* get_handle callback returns a POSIX file descriptor */
- *flags |= H5FD_FEAT_DEFAULT_VFD_COMPATIBLE; /* VFD creates a file which can be opened with the
- default VFD */
+ if(file && file->fd >= 0 && file->backing_store) {
+ *flags |= H5FD_FEAT_POSIX_COMPAT_HANDLE; /* get_handle callback returns a POSIX file descriptor */
+ *flags |= H5FD_FEAT_DEFAULT_VFD_COMPATIBLE; /* VFD creates a file which can be opened with the default VFD */
}
} /* end if */
+ /* clang-format on */
FUNC_LEAVE_NOAPI(SUCCEED)
} /* end H5FD__core_query() */
@@ -1525,7 +1528,7 @@ done:
* If we are not closing, we realloc the buffer to size equal
* to the smallest multiple of the allocation increment that
* equals or exceeds the eoa and set the eof accordingly.
- * Note that we no longer truncate the backing store to the
+ * Note that we no longer truncate the backing store to the
* new eof if applicable.
* -- JRM
*
@@ -1708,3 +1711,36 @@ H5FD__core_unlock(H5FD_t *_file)
done:
FUNC_LEAVE_NOAPI(ret_value)
} /* end H5FD__core_unlock() */
+
+/*-------------------------------------------------------------------------
+ * Function: H5FD__core_delete
+ *
+ * Purpose: Delete a file
+ *
+ * Return: SUCCEED/FAIL
+ *
+ *-------------------------------------------------------------------------
+ */
+static herr_t
+H5FD__core_delete(const char *filename, hid_t fapl_id)
+{
+ const H5FD_core_fapl_t *fa = NULL;
+ H5P_genplist_t * plist; /* Property list pointer */
+ herr_t ret_value = SUCCEED; /* Return value */
+
+ FUNC_ENTER_STATIC
+
+ HDassert(filename);
+
+ if (NULL == (plist = (H5P_genplist_t *)H5I_object(fapl_id)))
+ HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a file access property list")
+ if (NULL == (fa = (const H5FD_core_fapl_t *)H5P_peek_driver_info(plist)))
+ HGOTO_ERROR(H5E_PLIST, H5E_BADVALUE, FAIL, "bad VFL driver info")
+
+ if (fa->backing_store)
+ if (HDremove(filename) < 0)
+ HSYS_GOTO_ERROR(H5E_VFL, H5E_CANTDELETEFILE, FAIL, "unable to delete file")
+
+done:
+ FUNC_LEAVE_NOAPI(ret_value)
+} /* end H5FD__core_delete() */
diff --git a/src/H5FDdirect.c b/src/H5FDdirect.c
index 1233799..2a51883 100644
--- a/src/H5FDdirect.c
+++ b/src/H5FDdirect.c
@@ -22,15 +22,15 @@
#include "H5FDdrvr_module.h" /* This source code file is part of the H5FD driver module */
-#include "H5private.h" /* Generic Functions */
-#include "H5Eprivate.h" /* Error handling */
-#include "H5Fprivate.h" /* File access */
-#include "H5FDprivate.h" /* File drivers */
-#include "H5FDdirect.h" /* Direct file driver */
-#include "H5FLprivate.h" /* Free Lists */
-#include "H5Iprivate.h" /* IDs */
-#include "H5MMprivate.h" /* Memory management */
-#include "H5Pprivate.h" /* Property lists */
+#include "H5private.h" /* Generic Functions */
+#include "H5Eprivate.h" /* Error handling */
+#include "H5Fprivate.h" /* File access */
+#include "H5FDprivate.h" /* File drivers */
+#include "H5FDdirect.h" /* Direct file driver */
+#include "H5FLprivate.h" /* Free Lists */
+#include "H5Iprivate.h" /* IDs */
+#include "H5MMprivate.h" /* Memory management */
+#include "H5Pprivate.h" /* Property lists */
#ifdef H5_HAVE_DIRECT
@@ -119,59 +119,61 @@ typedef struct H5FD_direct_t {
(ADDR_OVERFLOW(A) || SIZE_OVERFLOW(Z) || HADDR_UNDEF == (A) + (Z) || (HDoff_t)((A) + (Z)) < (HDoff_t)(A))
/* Prototypes */
-static herr_t H5FD_direct_term(void);
-static void * H5FD_direct_fapl_get(H5FD_t *file);
-static void * H5FD_direct_fapl_copy(const void *_old_fa);
-static H5FD_t *H5FD_direct_open(const char *name, unsigned flags, hid_t fapl_id, haddr_t maxaddr);
-static herr_t H5FD_direct_close(H5FD_t *_file);
-static int H5FD_direct_cmp(const H5FD_t *_f1, const H5FD_t *_f2);
-static herr_t H5FD_direct_query(const H5FD_t *_f1, unsigned long *flags);
-static haddr_t H5FD_direct_get_eoa(const H5FD_t *_file, H5FD_mem_t type);
-static herr_t H5FD_direct_set_eoa(H5FD_t *_file, H5FD_mem_t type, haddr_t addr);
-static haddr_t H5FD_direct_get_eof(const H5FD_t *_file, H5FD_mem_t type);
-static herr_t H5FD_direct_get_handle(H5FD_t *_file, hid_t fapl, void **file_handle);
-static herr_t H5FD_direct_read(H5FD_t *_file, H5FD_mem_t type, hid_t fapl_id, haddr_t addr, size_t size,
- void *buf);
-static herr_t H5FD_direct_write(H5FD_t *_file, H5FD_mem_t type, hid_t fapl_id, haddr_t addr, size_t size,
- const void *buf);
-static herr_t H5FD_direct_truncate(H5FD_t *_file, hid_t dxpl_id, hbool_t closing);
-static herr_t H5FD_direct_lock(H5FD_t *_file, hbool_t rw);
-static herr_t H5FD_direct_unlock(H5FD_t *_file);
+static herr_t H5FD__direct_term(void);
+static void * H5FD__direct_fapl_get(H5FD_t *file);
+static void * H5FD__direct_fapl_copy(const void *_old_fa);
+static H5FD_t *H5FD__direct_open(const char *name, unsigned flags, hid_t fapl_id, haddr_t maxaddr);
+static herr_t H5FD__direct_close(H5FD_t *_file);
+static int H5FD__direct_cmp(const H5FD_t *_f1, const H5FD_t *_f2);
+static herr_t H5FD__direct_query(const H5FD_t *_f1, unsigned long *flags);
+static haddr_t H5FD__direct_get_eoa(const H5FD_t *_file, H5FD_mem_t type);
+static herr_t H5FD__direct_set_eoa(H5FD_t *_file, H5FD_mem_t type, haddr_t addr);
+static haddr_t H5FD__direct_get_eof(const H5FD_t *_file, H5FD_mem_t type);
+static herr_t H5FD__direct_get_handle(H5FD_t *_file, hid_t fapl, void **file_handle);
+static herr_t H5FD__direct_read(H5FD_t *_file, H5FD_mem_t type, hid_t fapl_id, haddr_t addr, size_t size,
+ void *buf);
+static herr_t H5FD__direct_write(H5FD_t *_file, H5FD_mem_t type, hid_t fapl_id, haddr_t addr, size_t size,
+ const void *buf);
+static herr_t H5FD__direct_truncate(H5FD_t *_file, hid_t dxpl_id, hbool_t closing);
+static herr_t H5FD__direct_lock(H5FD_t *_file, hbool_t rw);
+static herr_t H5FD__direct_unlock(H5FD_t *_file);
+static herr_t H5FD__direct_delete(const char *filename, hid_t fapl_id);
static const H5FD_class_t H5FD_direct_g = {
- "direct", /*name */
- MAXADDR, /*maxaddr */
- H5F_CLOSE_WEAK, /* fc_degree */
- H5FD_direct_term, /*terminate */
- NULL, /*sb_size */
- NULL, /*sb_encode */
- NULL, /*sb_decode */
- sizeof(H5FD_direct_fapl_t), /*fapl_size */
- H5FD_direct_fapl_get, /*fapl_get */
- H5FD_direct_fapl_copy, /*fapl_copy */
- NULL, /*fapl_free */
- 0, /*dxpl_size */
- NULL, /*dxpl_copy */
- NULL, /*dxpl_free */
- H5FD_direct_open, /*open */
- H5FD_direct_close, /*close */
- H5FD_direct_cmp, /*cmp */
- H5FD_direct_query, /*query */
- NULL, /*get_type_map */
- NULL, /*alloc */
- NULL, /*free */
- H5FD_direct_get_eoa, /*get_eoa */
- H5FD_direct_set_eoa, /*set_eoa */
- H5FD_direct_get_eof, /*get_eof */
- H5FD_direct_get_handle, /*get_handle */
- H5FD_direct_read, /*read */
- H5FD_direct_write, /*write */
- NULL, /*flush */
- H5FD_direct_truncate, /*truncate */
- H5FD_direct_lock, /*lock */
- H5FD_direct_unlock, /*unlock */
+ "direct", /* name */
+ MAXADDR, /* maxaddr */
+ H5F_CLOSE_WEAK, /* fc_degree */
+ H5FD__direct_term, /* terminate */
+ NULL, /* sb_size */
+ NULL, /* sb_encode */
+ NULL, /* sb_decode */
+ sizeof(H5FD_direct_fapl_t), /* fapl_size */
+ H5FD__direct_fapl_get, /* fapl_get */
+ H5FD__direct_fapl_copy, /* fapl_copy */
+ NULL, /* fapl_free */
+ 0, /* dxpl_size */
+ NULL, /* dxpl_copy */
+ NULL, /* dxpl_free */
+ H5FD__direct_open, /* open */
+ H5FD__direct_close, /* close */
+ H5FD__direct_cmp, /* cmp */
+ H5FD__direct_query, /* query */
+ NULL, /* get_type_map */
+ NULL, /* alloc */
+ NULL, /* free */
+ H5FD__direct_get_eoa, /* get_eoa */
+ H5FD__direct_set_eoa, /* set_eoa */
+ H5FD__direct_get_eof, /* get_eof */
+ H5FD__direct_get_handle, /* get_handle */
+ H5FD__direct_read, /* read */
+ H5FD__direct_write, /* write */
+ NULL, /* flush */
+ H5FD__direct_truncate, /* truncate */
+ H5FD__direct_lock, /* lock */
+ H5FD__direct_unlock, /* unlock */
+ H5FD__direct_delete, /* del */
NULL, /* dedup */
- H5FD_FLMAP_DICHOTOMY /*fl_map */
+ H5FD_FLMAP_DICHOTOMY /* fl_map */
};
/* Declare a free list to manage the H5FD_direct_t struct */
@@ -245,7 +247,7 @@ done:
} /* end H5FD_direct_init() */
/*---------------------------------------------------------------------------
- * Function: H5FD_direct_term
+ * Function: H5FD__direct_term
*
* Purpose: Shut down the VFD
*
@@ -257,15 +259,15 @@ done:
*---------------------------------------------------------------------------
*/
static herr_t
-H5FD_direct_term(void)
+H5FD__direct_term(void)
{
- FUNC_ENTER_NOAPI_NOINIT_NOERR
+ FUNC_ENTER_STATIC_NOERR
/* Reset VFL ID */
H5FD_DIRECT_g = 0;
FUNC_LEAVE_NOAPI(SUCCEED)
-} /* end H5FD_direct_term() */
+} /* end H5FD__direct_term() */
/*-------------------------------------------------------------------------
* Function: H5Pset_fapl_direct
@@ -365,7 +367,7 @@ done:
} /* end H5Pget_fapl_direct() */
/*-------------------------------------------------------------------------
- * Function: H5FD_direct_fapl_get
+ * Function: H5FD__direct_fapl_get
*
* Purpose: Returns a file access property list which indicates how the
* specified file is being accessed. The return list could be
@@ -379,27 +381,24 @@ done:
* Programmer: Raymond Lu
* Wednesday, 18 October 2006
*
- * Modifications:
- *
*-------------------------------------------------------------------------
*/
static void *
-H5FD_direct_fapl_get(H5FD_t *_file)
+H5FD__direct_fapl_get(H5FD_t *_file)
{
- H5FD_direct_t *file = (H5FD_direct_t *)_file;
- void * ret_value; /* Return value */
+ H5FD_direct_t *file = (H5FD_direct_t *)_file;
+ void * ret_value = NULL; /* Return value */
- FUNC_ENTER_NOAPI_NOINIT
+ FUNC_ENTER_STATIC_NOERR
/* Set return value */
- ret_value = H5FD_direct_fapl_copy(&(file->fa));
+ ret_value = H5FD__direct_fapl_copy(&(file->fa));
-done:
FUNC_LEAVE_NOAPI(ret_value)
-} /* end H5FD_direct_fapl_get() */
+} /* end H5FD__direct_fapl_get() */
/*-------------------------------------------------------------------------
- * Function: H5FD_direct_fapl_copy
+ * Function: H5FD__direct_fapl_copy
*
* Purpose: Copies the direct-specific file access properties.
*
@@ -410,17 +409,15 @@ done:
* Programmer: Raymond Lu
* Wednesday, 18 October 2006
*
- * Modifications:
- *
*-------------------------------------------------------------------------
*/
static void *
-H5FD_direct_fapl_copy(const void *_old_fa)
+H5FD__direct_fapl_copy(const void *_old_fa)
{
const H5FD_direct_fapl_t *old_fa = (const H5FD_direct_fapl_t *)_old_fa;
H5FD_direct_fapl_t * new_fa = H5MM_calloc(sizeof(H5FD_direct_fapl_t));
- FUNC_ENTER_NOAPI_NOINIT_NOERR
+ FUNC_ENTER_STATIC_NOERR
HDassert(new_fa);
@@ -428,10 +425,10 @@ H5FD_direct_fapl_copy(const void *_old_fa)
H5MM_memcpy(new_fa, old_fa, sizeof(H5FD_direct_fapl_t));
FUNC_LEAVE_NOAPI(new_fa)
-} /* end H5FD_direct_fapl_copy() */
+} /* end H5FD__direct_fapl_copy() */
/*-------------------------------------------------------------------------
- * Function: H5FD_direct_open
+ * Function: H5FD__direct_open
*
* Purpose: Create and/or opens a Unix file for direct I/O as an HDF5 file.
*
@@ -444,17 +441,15 @@ H5FD_direct_fapl_copy(const void *_old_fa)
* Programmer: Raymond Lu
* Wednesday, 20 September 2006
*
- * Modifications:
- *
*-------------------------------------------------------------------------
*/
static H5FD_t *
-H5FD_direct_open(const char *name, unsigned flags, hid_t fapl_id, haddr_t maxaddr)
+H5FD__direct_open(const char *name, unsigned flags, hid_t fapl_id, haddr_t maxaddr)
{
- int o_flags;
- int fd = (-1);
- H5FD_direct_t * file = NULL;
- H5FD_direct_fapl_t *fa;
+ int o_flags;
+ int fd = (-1);
+ H5FD_direct_t * file = NULL;
+ const H5FD_direct_fapl_t *fa;
#ifdef H5_HAVE_WIN32_API
HFILE filehandle;
struct _BY_HANDLE_FILE_INFORMATION fileinfo;
@@ -464,7 +459,7 @@ H5FD_direct_open(const char *name, unsigned flags, hid_t fapl_id, haddr_t maxadd
void * buf1, *buf2;
H5FD_t * ret_value = NULL;
- FUNC_ENTER_NOAPI_NOINIT
+ FUNC_ENTER_STATIC
/* Sanity check on file offsets */
HDassert(sizeof(HDoff_t) >= sizeof(size_t));
@@ -596,7 +591,7 @@ done:
}
/*-------------------------------------------------------------------------
- * Function: H5FD_direct_close
+ * Function: H5FD__direct_close
*
* Purpose: Closes the file.
*
@@ -607,17 +602,15 @@ done:
* Programmer: Raymond Lu
* Wednesday, 20 September 2006
*
- * Modifications:
- *
*-------------------------------------------------------------------------
*/
static herr_t
-H5FD_direct_close(H5FD_t *_file)
+H5FD__direct_close(H5FD_t *_file)
{
H5FD_direct_t *file = (H5FD_direct_t *)_file;
herr_t ret_value = SUCCEED; /* Return value */
- FUNC_ENTER_NOAPI_NOINIT
+ FUNC_ENTER_STATIC
if (HDclose(file->fd) < 0)
HSYS_GOTO_ERROR(H5E_IO, H5E_CANTCLOSEFILE, FAIL, "unable to close file")
@@ -629,7 +622,7 @@ done:
}
/*-------------------------------------------------------------------------
- * Function: H5FD_direct_cmp
+ * Function: H5FD__direct_cmp
*
* Purpose: Compares two files belonging to this driver using an
* arbitrary (but consistent) ordering.
@@ -642,18 +635,16 @@ done:
* Programmer: Raymond Lu
* Thursday, 21 September 2006
*
- * Modifications:
- *
*-------------------------------------------------------------------------
*/
static int
-H5FD_direct_cmp(const H5FD_t *_f1, const H5FD_t *_f2)
+H5FD__direct_cmp(const H5FD_t *_f1, const H5FD_t *_f2)
{
const H5FD_direct_t *f1 = (const H5FD_direct_t *)_f1;
const H5FD_direct_t *f2 = (const H5FD_direct_t *)_f2;
int ret_value = 0;
- FUNC_ENTER_NOAPI_NOINIT_NOERR
+ FUNC_ENTER_STATIC_NOERR
#ifdef H5_HAVE_WIN32_API
if (f1->fileindexhi < f2->fileindexhi)
@@ -695,7 +686,7 @@ done:
}
/*-------------------------------------------------------------------------
- * Function: H5FD_direct_query
+ * Function: H5FD__direct_query
*
* Purpose: Set the flags that this VFL driver is capable of supporting.
* (listed in H5FDpublic.h)
@@ -707,14 +698,12 @@ done:
* Programmer: Raymond Lu
* Thursday, 21 September 2006
*
- * Modifications:
- *
*-------------------------------------------------------------------------
*/
static herr_t
-H5FD_direct_query(const H5FD_t H5_ATTR_UNUSED *_f, unsigned long *flags /* out */)
+H5FD__direct_query(const H5FD_t H5_ATTR_UNUSED *_f, unsigned long *flags /* out */)
{
- FUNC_ENTER_NOAPI_NOINIT_NOERR
+ FUNC_ENTER_STATIC_NOERR
/* Set the VFL feature flags that this driver supports */
if (flags) {
@@ -731,7 +720,7 @@ H5FD_direct_query(const H5FD_t H5_ATTR_UNUSED *_f, unsigned long *flags /* out *
}
/*-------------------------------------------------------------------------
- * Function: H5FD_direct_get_eoa
+ * Function: H5FD__direct_get_eoa
*
* Purpose: Gets the end-of-address marker for the file. The EOA marker
* is the first address past the last byte allocated in the
@@ -744,25 +733,20 @@ H5FD_direct_query(const H5FD_t H5_ATTR_UNUSED *_f, unsigned long *flags /* out *
* Programmer: Raymond Lu
* Wednesday, 20 September 2006
*
- * Modifications:
- * Raymond Lu
- * 21 Dec. 2006
- * Added the parameter TYPE. It's only used for MULTI driver.
- *
*-------------------------------------------------------------------------
*/
static haddr_t
-H5FD_direct_get_eoa(const H5FD_t *_file, H5FD_mem_t H5_ATTR_UNUSED type)
+H5FD__direct_get_eoa(const H5FD_t *_file, H5FD_mem_t H5_ATTR_UNUSED type)
{
const H5FD_direct_t *file = (const H5FD_direct_t *)_file;
- FUNC_ENTER_NOAPI_NOINIT_NOERR
+ FUNC_ENTER_STATIC_NOERR
FUNC_LEAVE_NOAPI(file->eoa)
}
/*-------------------------------------------------------------------------
- * Function: H5FD_direct_set_eoa
+ * Function: H5FD__direct_set_eoa
*
* Purpose: Set the end-of-address marker for the file. This function is
* called shortly after an existing HDF5 file is opened in order
@@ -775,19 +759,14 @@ H5FD_direct_get_eoa(const H5FD_t *_file, H5FD_mem_t H5_ATTR_UNUSED type)
* Programmer: Raymond Lu
* Wednesday, 20 September 2006
*
- * Modifications:
- * Raymond Lu
- * 21 Dec. 2006
- * Added the parameter TYPE. It's only used for MULTI driver.
- *
*-------------------------------------------------------------------------
*/
static herr_t
-H5FD_direct_set_eoa(H5FD_t *_file, H5FD_mem_t H5_ATTR_UNUSED type, haddr_t addr)
+H5FD__direct_set_eoa(H5FD_t *_file, H5FD_mem_t H5_ATTR_UNUSED type, haddr_t addr)
{
H5FD_direct_t *file = (H5FD_direct_t *)_file;
- FUNC_ENTER_NOAPI_NOINIT_NOERR
+ FUNC_ENTER_STATIC_NOERR
file->eoa = addr;
@@ -795,7 +774,7 @@ H5FD_direct_set_eoa(H5FD_t *_file, H5FD_mem_t H5_ATTR_UNUSED type, haddr_t addr)
}
/*-------------------------------------------------------------------------
- * Function: H5FD_direct_get_eof
+ * Function: H5FD__direct_get_eof
*
* Purpose: Returns the end-of-file marker, which is the greater of
* either the Unix end-of-file or the HDF5 end-of-address
@@ -810,16 +789,14 @@ H5FD_direct_set_eoa(H5FD_t *_file, H5FD_mem_t H5_ATTR_UNUSED type, haddr_t addr)
* Programmer: Raymond Lu
* Wednesday, 20 September 2006
*
- * Modifications:
- *
*-------------------------------------------------------------------------
*/
static haddr_t
-H5FD_direct_get_eof(const H5FD_t *_file, H5FD_mem_t H5_ATTR_UNUSED type)
+H5FD__direct_get_eof(const H5FD_t *_file, H5FD_mem_t H5_ATTR_UNUSED type)
{
const H5FD_direct_t *file = (const H5FD_direct_t *)_file;
- FUNC_ENTER_NOAPI_NOINIT
+ FUNC_ENTER_STATIC_NOERR
FUNC_LEAVE_NOAPI(file->eof)
}
@@ -834,17 +811,15 @@ H5FD_direct_get_eof(const H5FD_t *_file, H5FD_mem_t H5_ATTR_UNUSED type)
* Programmer: Raymond Lu
* 21 September 2006
*
- * Modifications:
- *
*-------------------------------------------------------------------------
*/
static herr_t
-H5FD_direct_get_handle(H5FD_t *_file, hid_t H5_ATTR_UNUSED fapl, void **file_handle)
+H5FD__direct_get_handle(H5FD_t *_file, hid_t H5_ATTR_UNUSED fapl, void **file_handle)
{
H5FD_direct_t *file = (H5FD_direct_t *)_file;
herr_t ret_value = SUCCEED;
- FUNC_ENTER_NOAPI_NOINIT
+ FUNC_ENTER_STATIC
if (!file_handle)
HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "file handle not valid")
@@ -855,7 +830,7 @@ done:
}
/*-------------------------------------------------------------------------
- * Function: H5FD_direct_read
+ * Function: H5FD__direct_read
*
* Purpose: Reads SIZE bytes of data from FILE beginning at address ADDR
* into buffer BUF according to data transfer properties in
@@ -869,13 +844,11 @@ done:
* Programmer: Raymond Lu
* Thursday, 21 September 2006
*
- * Modifications:
- *
*-------------------------------------------------------------------------
*/
static herr_t
-H5FD_direct_read(H5FD_t *_file, H5FD_mem_t H5_ATTR_UNUSED type, hid_t H5_ATTR_UNUSED dxpl_id, haddr_t addr,
- size_t size, void *buf /*out*/)
+H5FD__direct_read(H5FD_t *_file, H5FD_mem_t H5_ATTR_UNUSED type, hid_t H5_ATTR_UNUSED dxpl_id, haddr_t addr,
+ size_t size, void *buf /*out*/)
{
H5FD_direct_t *file = (H5FD_direct_t *)_file;
ssize_t nbytes;
@@ -890,7 +863,7 @@ H5FD_direct_read(H5FD_t *_file, H5FD_mem_t H5_ATTR_UNUSED type, hid_t H5_ATTR_UN
size_t copy_size = size; /* Size remaining to read when using copy buffer */
size_t copy_offset; /* Offset into copy buffer of the requested data */
- FUNC_ENTER_NOAPI_NOINIT
+ FUNC_ENTER_STATIC
HDassert(file && file->pub.cls);
HDassert(buf);
@@ -1038,7 +1011,7 @@ done:
}
/*-------------------------------------------------------------------------
- * Function: H5FD_direct_write
+ * Function: H5FD__direct_write
*
* Purpose: Writes SIZE bytes of data to FILE beginning at address ADDR
* from buffer BUF according to data transfer properties in
@@ -1051,13 +1024,11 @@ done:
* Programmer: Raymond Lu
* Thursday, 21 September 2006
*
- * Modifications:
- *
*-------------------------------------------------------------------------
*/
static herr_t
-H5FD_direct_write(H5FD_t *_file, H5FD_mem_t H5_ATTR_UNUSED type, hid_t H5_ATTR_UNUSED dxpl_id, haddr_t addr,
- size_t size, const void *buf)
+H5FD__direct_write(H5FD_t *_file, H5FD_mem_t H5_ATTR_UNUSED type, hid_t H5_ATTR_UNUSED dxpl_id, haddr_t addr,
+ size_t size, const void *buf)
{
H5FD_direct_t *file = (H5FD_direct_t *)_file;
ssize_t nbytes;
@@ -1075,7 +1046,7 @@ H5FD_direct_write(H5FD_t *_file, H5FD_mem_t H5_ATTR_UNUSED type, hid_t H5_ATTR_U
size_t copy_size = size; /* Size remaining to write when using copy buffer */
size_t copy_offset; /* Offset into copy buffer of the data to write */
- FUNC_ENTER_NOAPI_NOINIT
+ FUNC_ENTER_STATIC
HDassert(file && file->pub.cls);
HDassert(buf);
@@ -1269,7 +1240,7 @@ done:
}
/*-------------------------------------------------------------------------
- * Function: H5FD_direct_truncate
+ * Function: H5FD__direct_truncate
*
* Purpose: Makes sure that the true file size is the same (or larger)
* than the end-of-address.
@@ -1284,12 +1255,12 @@ done:
*-------------------------------------------------------------------------
*/
static herr_t
-H5FD_direct_truncate(H5FD_t *_file, hid_t H5_ATTR_UNUSED dxpl_id, hbool_t H5_ATTR_UNUSED closing)
+H5FD__direct_truncate(H5FD_t *_file, hid_t H5_ATTR_UNUSED dxpl_id, hbool_t H5_ATTR_UNUSED closing)
{
H5FD_direct_t *file = (H5FD_direct_t *)_file;
herr_t ret_value = SUCCEED; /* Return value */
- FUNC_ENTER_NOAPI_NOINIT
+ FUNC_ENTER_STATIC
HDassert(file);
@@ -1330,10 +1301,10 @@ H5FD_direct_truncate(H5FD_t *_file, hid_t H5_ATTR_UNUSED dxpl_id, hbool_t H5_ATT
done:
FUNC_LEAVE_NOAPI(ret_value)
-} /* end H5FD_direct_truncate() */
+} /* end H5FD__direct_truncate() */
/*-------------------------------------------------------------------------
- * Function: H5FD_direct_lock
+ * Function: H5FD__direct_lock
*
* Purpose: To place an advisory lock on a file.
* The lock type to apply depends on the parameter "rw":
@@ -1347,13 +1318,13 @@ done:
*-------------------------------------------------------------------------
*/
static herr_t
-H5FD_direct_lock(H5FD_t *_file, hbool_t rw)
+H5FD__direct_lock(H5FD_t *_file, hbool_t rw)
{
H5FD_direct_t *file = (H5FD_direct_t *)_file; /* VFD file struct */
int lock_flags; /* file locking flags */
herr_t ret_value = SUCCEED; /* Return value */
- FUNC_ENTER_NOAPI_NOINIT
+ FUNC_ENTER_STATIC
HDassert(file);
@@ -1374,10 +1345,10 @@ H5FD_direct_lock(H5FD_t *_file, hbool_t rw)
done:
FUNC_LEAVE_NOAPI(ret_value)
-} /* end H5FD_direct_lock() */
+} /* end H5FD__direct_lock() */
/*-------------------------------------------------------------------------
- * Function: H5FD_direct_unlock
+ * Function: H5FD__direct_unlock
*
* Purpose: To remove the existing lock on the file
*
@@ -1388,12 +1359,12 @@ done:
*-------------------------------------------------------------------------
*/
static herr_t
-H5FD_direct_unlock(H5FD_t *_file)
+H5FD__direct_unlock(H5FD_t *_file)
{
H5FD_direct_t *file = (H5FD_direct_t *)_file; /* VFD file struct */
herr_t ret_value = SUCCEED; /* Return value */
- FUNC_ENTER_NOAPI_NOINIT
+ FUNC_ENTER_STATIC
HDassert(file);
@@ -1410,6 +1381,31 @@ H5FD_direct_unlock(H5FD_t *_file)
done:
FUNC_LEAVE_NOAPI(ret_value)
-} /* end H5FD_direct_unlock() */
+} /* end H5FD__direct_unlock() */
+
+/*-------------------------------------------------------------------------
+ * Function: H5FD__direct_delete
+ *
+ * Purpose: Delete a file
+ *
+ * Return: SUCCEED/FAIL
+ *
+ *-------------------------------------------------------------------------
+ */
+static herr_t
+H5FD__direct_delete(const char *filename, hid_t H5_ATTR_UNUSED fapl_id)
+{
+ herr_t ret_value = SUCCEED; /* Return value */
+
+ FUNC_ENTER_STATIC
+
+ HDassert(filename);
+
+ if (HDremove(filename) < 0)
+ HSYS_GOTO_ERROR(H5E_VFL, H5E_CANTDELETEFILE, FAIL, "unable to delete file")
+
+done:
+ FUNC_LEAVE_NOAPI(ret_value)
+} /* end H5FD__direct_delete() */
#endif /* H5_HAVE_DIRECT */
diff --git a/src/H5FDfamily.c b/src/H5FDfamily.c
index d09d25e..2356309 100644
--- a/src/H5FDfamily.c
+++ b/src/H5FDfamily.c
@@ -34,15 +34,15 @@
#include "H5FDdrvr_module.h" /* This source code file is part of the H5FD driver module */
-#include "H5private.h" /* Generic Functions */
+#include "H5private.h" /* Generic Functions */
#include "H5CXprivate.h" /* API Contexts */
-#include "H5Eprivate.h" /* Error handling */
-#include "H5Fprivate.h" /* File access */
-#include "H5FDprivate.h" /* File drivers */
-#include "H5FDfamily.h" /* Family file driver */
-#include "H5Iprivate.h" /* IDs */
-#include "H5MMprivate.h" /* Memory management */
-#include "H5Pprivate.h" /* Property lists */
+#include "H5Eprivate.h" /* Error handling */
+#include "H5Fprivate.h" /* File access */
+#include "H5FDprivate.h" /* File drivers */
+#include "H5FDfamily.h" /* Family file driver */
+#include "H5Iprivate.h" /* IDs */
+#include "H5MMprivate.h" /* Memory management */
+#include "H5Pprivate.h" /* Property lists */
/* The size of the member name buffers */
#define H5FD_FAM_MEMB_NAME_BUF_SIZE 4096
@@ -52,16 +52,16 @@ static hid_t H5FD_FAMILY_g = 0;
/* The description of a file belonging to this driver. */
typedef struct H5FD_family_t {
- H5FD_t pub; /*public stuff, must be first */
- hid_t memb_fapl_id; /*file access property list for members */
- hsize_t memb_size; /*actual size of each member file */
- hsize_t pmem_size; /*member size passed in from property */
- unsigned nmembs; /*number of family members */
- unsigned amembs; /*number of member slots allocated */
- H5FD_t **memb; /*dynamic array of member pointers */
- haddr_t eoa; /*end of allocated addresses */
- char * name; /*name generator printf format */
- unsigned flags; /*flags for opening additional members */
+ H5FD_t pub; /*public stuff, must be first */
+ hid_t memb_fapl_id; /*file access property list for members */
+ hsize_t memb_size; /*actual size of each member file */
+ hsize_t pmem_size; /*member size passed in from property */
+ unsigned nmembs; /*number of family members */
+ unsigned amembs; /*number of member slots allocated */
+ H5FD_t **memb; /*dynamic array of member pointers */
+ haddr_t eoa; /*end of allocated addresses */
+ char * name; /*name generator printf format */
+ unsigned flags; /*flags for opening additional members */
/* Information from properties set by 'h5repart' tool */
hsize_t mem_newsize; /*new member size passed in as private
@@ -73,70 +73,72 @@ typedef struct H5FD_family_t {
/* Driver-specific file access properties */
typedef struct H5FD_family_fapl_t {
- hsize_t memb_size; /*size of each member */
+ hsize_t memb_size; /*size of each member */
hid_t memb_fapl_id; /*file access property list of each memb*/
} H5FD_family_fapl_t;
/* Callback prototypes */
-static herr_t H5FD_family_term(void);
-static void * H5FD_family_fapl_get(H5FD_t *_file);
-static void * H5FD_family_fapl_copy(const void *_old_fa);
-static herr_t H5FD_family_fapl_free(void *_fa);
-static hsize_t H5FD_family_sb_size(H5FD_t *_file);
-static herr_t H5FD_family_sb_encode(H5FD_t *_file, char *name /*out*/, unsigned char *buf /*out*/);
-static herr_t H5FD_family_sb_decode(H5FD_t *_file, const char *name, const unsigned char *buf);
-static H5FD_t *H5FD_family_open(const char *name, unsigned flags, hid_t fapl_id, haddr_t maxaddr);
-static herr_t H5FD_family_close(H5FD_t *_file);
-static int H5FD_family_cmp(const H5FD_t *_f1, const H5FD_t *_f2);
-static herr_t H5FD_family_query(const H5FD_t *_f1, unsigned long *flags);
-static haddr_t H5FD_family_get_eoa(const H5FD_t *_file, H5FD_mem_t type);
-static herr_t H5FD_family_set_eoa(H5FD_t *_file, H5FD_mem_t type, haddr_t eoa);
-static haddr_t H5FD_family_get_eof(const H5FD_t *_file, H5FD_mem_t type);
-static herr_t H5FD_family_get_handle(H5FD_t *_file, hid_t fapl, void **file_handle);
-static herr_t H5FD_family_read(H5FD_t *_file, H5FD_mem_t type, hid_t dxpl_id, haddr_t addr, size_t size,
- void *_buf /*out*/);
-static herr_t H5FD_family_write(H5FD_t *_file, H5FD_mem_t type, hid_t dxpl_id, haddr_t addr, size_t size,
- const void *_buf);
-static herr_t H5FD_family_flush(H5FD_t *_file, hid_t dxpl_id, hbool_t closing);
-static herr_t H5FD_family_truncate(H5FD_t *_file, hid_t dxpl_id, hbool_t closing);
-static herr_t H5FD_family_lock(H5FD_t *_file, hbool_t rw);
-static herr_t H5FD_family_unlock(H5FD_t *_file);
+static herr_t H5FD__family_term(void);
+static void * H5FD__family_fapl_get(H5FD_t *_file);
+static void * H5FD__family_fapl_copy(const void *_old_fa);
+static herr_t H5FD__family_fapl_free(void *_fa);
+static hsize_t H5FD__family_sb_size(H5FD_t *_file);
+static herr_t H5FD__family_sb_encode(H5FD_t *_file, char *name /*out*/, unsigned char *buf /*out*/);
+static herr_t H5FD__family_sb_decode(H5FD_t *_file, const char *name, const unsigned char *buf);
+static H5FD_t *H5FD__family_open(const char *name, unsigned flags, hid_t fapl_id, haddr_t maxaddr);
+static herr_t H5FD__family_close(H5FD_t *_file);
+static int H5FD__family_cmp(const H5FD_t *_f1, const H5FD_t *_f2);
+static herr_t H5FD__family_query(const H5FD_t *_f1, unsigned long *flags);
+static haddr_t H5FD__family_get_eoa(const H5FD_t *_file, H5FD_mem_t type);
+static herr_t H5FD__family_set_eoa(H5FD_t *_file, H5FD_mem_t type, haddr_t eoa);
+static haddr_t H5FD__family_get_eof(const H5FD_t *_file, H5FD_mem_t type);
+static herr_t H5FD__family_get_handle(H5FD_t *_file, hid_t fapl, void **file_handle);
+static herr_t H5FD__family_read(H5FD_t *_file, H5FD_mem_t type, hid_t dxpl_id, haddr_t addr, size_t size,
+ void *_buf /*out*/);
+static herr_t H5FD__family_write(H5FD_t *_file, H5FD_mem_t type, hid_t dxpl_id, haddr_t addr, size_t size,
+ const void *_buf);
+static herr_t H5FD__family_flush(H5FD_t *_file, hid_t dxpl_id, hbool_t closing);
+static herr_t H5FD__family_truncate(H5FD_t *_file, hid_t dxpl_id, hbool_t closing);
+static herr_t H5FD__family_lock(H5FD_t *_file, hbool_t rw);
+static herr_t H5FD__family_unlock(H5FD_t *_file);
+static herr_t H5FD__family_delete(const char *filename, hid_t fapl_id);
/* The class struct */
static const H5FD_class_t H5FD_family_g = {
- "family", /*name */
- HADDR_MAX, /*maxaddr */
- H5F_CLOSE_WEAK, /*fc_degree */
- H5FD_family_term, /*terminate */
- H5FD_family_sb_size, /*sb_size */
- H5FD_family_sb_encode, /*sb_encode */
- H5FD_family_sb_decode, /*sb_decode */
- sizeof(H5FD_family_fapl_t), /*fapl_size */
- H5FD_family_fapl_get, /*fapl_get */
- H5FD_family_fapl_copy, /*fapl_copy */
- H5FD_family_fapl_free, /*fapl_free */
- 0, /*dxpl_size */
- NULL, /*dxpl_copy */
- NULL, /*dxpl_free */
- H5FD_family_open, /*open */
- H5FD_family_close, /*close */
- H5FD_family_cmp, /*cmp */
- H5FD_family_query, /*query */
- NULL, /*get_type_map */
- NULL, /*alloc */
- NULL, /*free */
- H5FD_family_get_eoa, /*get_eoa */
- H5FD_family_set_eoa, /*set_eoa */
- H5FD_family_get_eof, /*get_eof */
- H5FD_family_get_handle, /*get_handle */
- H5FD_family_read, /*read */
- H5FD_family_write, /*write */
- H5FD_family_flush, /*flush */
- H5FD_family_truncate, /*truncate */
- H5FD_family_lock, /*lock */
- H5FD_family_unlock, /*unlock */
- NULL, /*dedup */
- H5FD_FLMAP_DICHOTOMY /*fl_map */
+ "family", /* name */
+ HADDR_MAX, /* maxaddr */
+ H5F_CLOSE_WEAK, /* fc_degree */
+ H5FD__family_term, /* terminate */
+ H5FD__family_sb_size, /* sb_size */
+ H5FD__family_sb_encode, /* sb_encode */
+ H5FD__family_sb_decode, /* sb_decode */
+ sizeof(H5FD_family_fapl_t), /* fapl_size */
+ H5FD__family_fapl_get, /* fapl_get */
+ H5FD__family_fapl_copy, /* fapl_copy */
+ H5FD__family_fapl_free, /* fapl_free */
+ 0, /* dxpl_size */
+ NULL, /* dxpl_copy */
+ NULL, /* dxpl_free */
+ H5FD__family_open, /* open */
+ H5FD__family_close, /* close */
+ H5FD__family_cmp, /* cmp */
+ H5FD__family_query, /* query */
+ NULL, /* get_type_map */
+ NULL, /* alloc */
+ NULL, /* free */
+ H5FD__family_get_eoa, /* get_eoa */
+ H5FD__family_set_eoa, /* set_eoa */
+ H5FD__family_get_eof, /* get_eof */
+ H5FD__family_get_handle, /* get_handle */
+ H5FD__family_read, /* read */
+ H5FD__family_write, /* write */
+ H5FD__family_flush, /* flush */
+ H5FD__family_truncate, /* truncate */
+ H5FD__family_lock, /* lock */
+ H5FD__family_unlock, /* unlock */
+ H5FD__family_delete, /* del */
+ NULL, /* dedup */
+ H5FD_FLMAP_DICHOTOMY /* fl_map */
};
/*--------------------------------------------------------------------------
@@ -197,9 +199,9 @@ done:
} /* H5FD_family_init() */
/*---------------------------------------------------------------------------
- * Function: H5FD_family_term
+ * Function: H5FD__family_term
*
- * Purpose: Shut down the VFD
+ * Purpose: Shut down the VFD
*
* Returns: Non-negative on success or negative on failure
*
@@ -209,30 +211,30 @@ done:
*---------------------------------------------------------------------------
*/
static herr_t
-H5FD_family_term(void)
+H5FD__family_term(void)
{
- FUNC_ENTER_NOAPI_NOINIT_NOERR
+ FUNC_ENTER_STATIC_NOERR
/* Reset VFL ID */
H5FD_FAMILY_g = 0;
FUNC_LEAVE_NOAPI(SUCCEED)
-} /* end H5FD_family_term() */
+} /* end H5FD__family_term() */
/*-------------------------------------------------------------------------
- * Function: H5Pset_fapl_family
+ * Function: H5Pset_fapl_family
*
- * Purpose: Sets the file access property list FAPL_ID to use the family
- * driver. The MEMB_SIZE is the size in bytes of each file
- * member (used only when creating a new file) and the
- * MEMB_FAPL_ID is a file access property list to be used for
- * each family member.
+ * Purpose: Sets the file access property list FAPL_ID to use the family
+ * driver. The MEMB_SIZE is the size in bytes of each file
+ * member (used only when creating a new file) and the
+ * MEMB_FAPL_ID is a file access property list to be used for
+ * each family member.
*
- * Return: Success: Non-negative
+ * Return: Success: Non-negative
*
- * Failure: Negative
+ * Failure: Negative
*
- * Programmer: Robb Matzke
+ * Programmer: Robb Matzke
* Wednesday, August 4, 1999
*
*-------------------------------------------------------------------------
@@ -268,16 +270,16 @@ done:
}
/*-------------------------------------------------------------------------
- * Function: H5Pget_fapl_family
+ * Function: H5Pget_fapl_family
*
- * Purpose: Returns information about the family file access property
- * list though the function arguments.
+ * Purpose: Returns information about the family file access property
+ * list though the function arguments.
*
- * Return: Success: Non-negative
+ * Return: Success: Non-negative
*
- * Failure: Negative
+ * Failure: Negative
*
- * Programmer: Robb Matzke
+ * Programmer: Robb Matzke
* Wednesday, August 4, 1999
*
*-------------------------------------------------------------------------
@@ -311,29 +313,29 @@ done:
}
/*-------------------------------------------------------------------------
- * Function: H5FD_family_fapl_get
+ * Function: H5FD__family_fapl_get
*
- * Purpose: Gets a file access property list which could be used to
- * create an identical file.
+ * Purpose: Gets a file access property list which could be used to
+ * create an identical file.
*
- * Return: Success: Ptr to new file access property list.
+ * Return: Success: Ptr to new file access property list.
*
- * Failure: NULL
+ * Failure: NULL
*
- * Programmer: Robb Matzke
+ * Programmer: Robb Matzke
* Friday, August 13, 1999
*
*-------------------------------------------------------------------------
*/
static void *
-H5FD_family_fapl_get(H5FD_t *_file)
+H5FD__family_fapl_get(H5FD_t *_file)
{
H5FD_family_t * file = (H5FD_family_t *)_file;
H5FD_family_fapl_t *fa = NULL;
H5P_genplist_t * plist; /* Property list pointer */
void * ret_value = NULL; /* Return value */
- FUNC_ENTER_NOAPI_NOINIT
+ FUNC_ENTER_STATIC
if (NULL == (fa = (H5FD_family_fapl_t *)H5MM_calloc(sizeof(H5FD_family_fapl_t))))
HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "memory allocation failed")
@@ -347,36 +349,36 @@ H5FD_family_fapl_get(H5FD_t *_file)
ret_value = fa;
done:
- if (ret_value == NULL) {
+ if (ret_value == NULL)
if (fa != NULL)
H5MM_xfree(fa);
- } /* end if */
+
FUNC_LEAVE_NOAPI(ret_value)
}
/*-------------------------------------------------------------------------
- * Function: H5FD_family_fapl_copy
+ * Function: H5FD__family_fapl_copy
*
- * Purpose: Copies the family-specific file access properties.
+ * Purpose: Copies the family-specific file access properties.
*
- * Return: Success: Ptr to a new property list
+ * Return: Success: Ptr to a new property list
*
- * Failure: NULL
+ * Failure: NULL
*
- * Programmer: Robb Matzke
+ * Programmer: Robb Matzke
* Wednesday, August 4, 1999
*
*-------------------------------------------------------------------------
*/
static void *
-H5FD_family_fapl_copy(const void *_old_fa)
+H5FD__family_fapl_copy(const void *_old_fa)
{
const H5FD_family_fapl_t *old_fa = (const H5FD_family_fapl_t *)_old_fa;
H5FD_family_fapl_t * new_fa = NULL;
H5P_genplist_t * plist; /* Property list pointer */
void * ret_value = NULL; /* Return value */
- FUNC_ENTER_NOAPI_NOINIT
+ FUNC_ENTER_STATIC
if (NULL == (new_fa = (H5FD_family_fapl_t *)H5MM_malloc(sizeof(H5FD_family_fapl_t))))
HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "memory allocation failed")
@@ -399,34 +401,34 @@ H5FD_family_fapl_copy(const void *_old_fa)
ret_value = new_fa;
done:
- if (ret_value == NULL) {
+ if (ret_value == NULL)
if (new_fa != NULL)
H5MM_xfree(new_fa);
- } /* end if */
+
FUNC_LEAVE_NOAPI(ret_value)
}
/*-------------------------------------------------------------------------
- * Function: H5FD_family_fapl_free
+ * Function: H5FD__family_fapl_free
*
- * Purpose: Frees the family-specific file access properties.
+ * Purpose: Frees the family-specific file access properties.
*
- * Return: Success: 0
+ * Return: Success: 0
*
- * Failure: -1
+ * Failure: -1
*
- * Programmer: Robb Matzke
+ * Programmer: Robb Matzke
* Wednesday, August 4, 1999
*
*-------------------------------------------------------------------------
*/
static herr_t
-H5FD_family_fapl_free(void *_fa)
+H5FD__family_fapl_free(void *_fa)
{
H5FD_family_fapl_t *fa = (H5FD_family_fapl_t *)_fa;
herr_t ret_value = SUCCEED; /* Return value */
- FUNC_ENTER_NOAPI_NOINIT
+ FUNC_ENTER_STATIC
if (H5I_dec_ref(fa->memb_fapl_id) < 0)
HGOTO_ERROR(H5E_VFL, H5E_CANTDEC, FAIL, "can't close driver ID")
@@ -437,24 +439,24 @@ done:
}
/*-------------------------------------------------------------------------
- * Function: H5FD_family_sb_size
+ * Function: H5FD__family_sb_size
*
- * Purpose: Returns the size of the private information to be stored in
- * the superblock.
+ * Purpose: Returns the size of the private information to be stored in
+ * the superblock.
*
- * Return: Success: The super block driver data size.
+ * Return: Success: The super block driver data size.
*
- * Failure: never fails
+ * Failure: never fails
*
- * Programmer: Raymond Lu
+ * Programmer: Raymond Lu
* Tuesday, May 10, 2005
*
*-------------------------------------------------------------------------
*/
static hsize_t
-H5FD_family_sb_size(H5FD_t H5_ATTR_UNUSED *_file)
+H5FD__family_sb_size(H5FD_t H5_ATTR_UNUSED *_file)
{
- FUNC_ENTER_NOAPI_NOINIT_NOERR
+ FUNC_ENTER_STATIC_NOERR
/* 8 bytes field for the size of member file size field should be
* enough for now. */
@@ -462,29 +464,29 @@ H5FD_family_sb_size(H5FD_t H5_ATTR_UNUSED *_file)
}
/*-------------------------------------------------------------------------
- * Function: H5FD_family_sb_encode
+ * Function: H5FD__family_sb_encode
*
- * Purpose: Encode driver information for the superblock. The NAME
- * argument is a nine-byte buffer which will be initialized with
- * an eight-character name/version number and null termination.
+ * Purpose: Encode driver information for the superblock. The NAME
+ * argument is a nine-byte buffer which will be initialized with
+ * an eight-character name/version number and null termination.
*
- * The encoding is the member file size and name template.
+ * The encoding is the member file size and name template.
*
- * Return: Success: 0
+ * Return: Success: 0
*
- * Failure: -1
+ * Failure: -1
*
- * Programmer: Raymond Lu
+ * Programmer: Raymond Lu
* Tuesday, May 10, 2005
*
*-------------------------------------------------------------------------
*/
static herr_t
-H5FD_family_sb_encode(H5FD_t *_file, char *name /*out*/, unsigned char *buf /*out*/)
+H5FD__family_sb_encode(H5FD_t *_file, char *name /*out*/, unsigned char *buf /*out*/)
{
H5FD_family_t *file = (H5FD_family_t *)_file;
- FUNC_ENTER_NOAPI_NOINIT_NOERR
+ FUNC_ENTER_STATIC_NOERR
/* Name and version number */
HDstrncpy(name, "NCSAfami", (size_t)9);
@@ -494,41 +496,41 @@ H5FD_family_sb_encode(H5FD_t *_file, char *name /*out*/, unsigned char *buf /*ou
* This is to guarantee backward compatibility. If a file is created with
* v1.6 library and the driver info isn't saved in the superblock. We open
* it with v1.8, the FILE->MEMB_SIZE will be the actual size of the first
- * member file (see H5FD_family_open). So it isn't safe to use FILE->MEMB_SIZE.
+ * member file (see H5FD__family_open). So it isn't safe to use FILE->MEMB_SIZE.
* If the file is created with v1.8, the correctness of FILE->PMEM_SIZE is
- * checked in H5FD_family_sb_decode. SLU - 2009/3/21
+ * checked in H5FD__family_sb_decode. SLU - 2009/3/21
*/
UINT64ENCODE(buf, (uint64_t)file->pmem_size);
FUNC_LEAVE_NOAPI(SUCCEED)
-} /* end H5FD_family_sb_encode() */
+} /* end H5FD__family_sb_encode() */
/*-------------------------------------------------------------------------
- * Function: H5FD_family_sb_decode
+ * Function: H5FD__family_sb_decode
*
- * Purpose: This function has 2 separate purpose. One is to decodes the
+ * Purpose: This function has 2 separate purpose. One is to decodes the
* superblock information for this driver. The NAME argument is
* the eight-character (plus null termination) name stored in i
* the file. The FILE argument is updated according to the
* information in the superblock.
*
- * Return: Success: 0
+ * Return: Success: 0
*
- * Failure: -1
+ * Failure: -1
*
- * Programmer: Raymond Lu
+ * Programmer: Raymond Lu
* Tuesday, May 10, 2005
*
*-------------------------------------------------------------------------
*/
static herr_t
-H5FD_family_sb_decode(H5FD_t *_file, const char H5_ATTR_UNUSED *name, const unsigned char *buf)
+H5FD__family_sb_decode(H5FD_t *_file, const char H5_ATTR_UNUSED *name, const unsigned char *buf)
{
H5FD_family_t *file = (H5FD_family_t *)_file;
uint64_t msize;
herr_t ret_value = SUCCEED; /* Return value */
- FUNC_ENTER_NOAPI_NOINIT
+ FUNC_ENTER_STATIC
/* Read member file size. Skip name template for now although it's saved. */
UINT64DECODE(buf, msize);
@@ -557,20 +559,20 @@ H5FD_family_sb_decode(H5FD_t *_file, const char H5_ATTR_UNUSED *name, const unsi
done:
FUNC_LEAVE_NOAPI(ret_value)
-} /* end H5FD_family_sb_decode() */
+} /* end H5FD__family_sb_decode() */
/*-------------------------------------------------------------------------
- * Function: H5FD_family_open
+ * Function: H5FD__family_open
*
- * Purpose: Creates and/or opens a family of files as an HDF5 file.
+ * Purpose: Creates and/or opens a family of files as an HDF5 file.
*
- * Return: Success: A pointer to a new file dat structure. The
- * public fields will be initialized by the
- * caller, which is always H5FD_open().
+ * Return: Success: A pointer to a new file dat structure. The
+ * public fields will be initialized by the
+ * caller, which is always H5FD_open().
*
- * Failure: NULL
+ * Failure: NULL
*
- * Programmer: Robb Matzke
+ * Programmer: Robb Matzke
* Wednesday, August 4, 1999
*
*-------------------------------------------------------------------------
@@ -583,7 +585,7 @@ done:
*/
H5_GCC_DIAG_OFF("format-nonliteral")
static H5FD_t *
-H5FD_family_open(const char *name, unsigned flags, hid_t fapl_id, haddr_t maxaddr)
+H5FD__family_open(const char *name, unsigned flags, hid_t fapl_id, haddr_t maxaddr)
{
H5FD_family_t *file = NULL;
char * memb_name = NULL, *temp = NULL;
@@ -591,7 +593,7 @@ H5FD_family_open(const char *name, unsigned flags, hid_t fapl_id, haddr_t maxadd
unsigned t_flags = flags & ~H5F_ACC_CREAT;
H5FD_t * ret_value = NULL;
- FUNC_ENTER_NOAPI_NOINIT
+ FUNC_ENTER_STATIC
/* Check arguments */
if (!name || !*name)
@@ -733,34 +735,34 @@ done:
} /* end if */
FUNC_LEAVE_NOAPI(ret_value)
-} /* end H5FD_family_open() */
+} /* end H5FD__family_open() */
H5_GCC_DIAG_ON("format-nonliteral")
/*-------------------------------------------------------------------------
- * Function: H5FD_family_close
+ * Function: H5FD__family_close
*
- * Purpose: Closes a family of files.
+ * Purpose: Closes a family of files.
*
- * Return: Success: Non-negative
+ * Return: Success: Non-negative
*
- * Failure: Negative with as many members closed as
- * possible. The only subsequent operation
- * permitted on the file is a close operation.
+ * Failure: Negative with as many members closed as
+ * possible. The only subsequent operation
+ * permitted on the file is a close operation.
*
- * Programmer: Robb Matzke
+ * Programmer: Robb Matzke
* Wednesday, August 4, 1999
*
*-------------------------------------------------------------------------
*/
static herr_t
-H5FD_family_close(H5FD_t *_file)
+H5FD__family_close(H5FD_t *_file)
{
H5FD_family_t *file = (H5FD_family_t *)_file;
unsigned nerrors = 0; /* Number of errors while closing member files */
unsigned u; /* Local index variable */
herr_t ret_value = SUCCEED; /* Return value */
- FUNC_ENTER_NOAPI_NOINIT
+ FUNC_ENTER_STATIC
/* Close as many members as possible. Use private function here to avoid clearing
* the error stack. We need the error message to indicate wrong member file size. */
@@ -785,32 +787,32 @@ H5FD_family_close(H5FD_t *_file)
H5MM_xfree(file);
FUNC_LEAVE_NOAPI(ret_value)
-} /* end H5FD_family_close() */
+} /* end H5FD__family_close() */
/*-------------------------------------------------------------------------
- * Function: H5FD_family_cmp
+ * Function: H5FD__family_cmp
*
- * Purpose: Compares two file families to see if they are the same. It
- * does this by comparing the first member of the two families.
+ * Purpose: Compares two file families to see if they are the same. It
+ * does this by comparing the first member of the two families.
*
- * Return: Success: like strcmp()
+ * Return: Success: like strcmp()
*
- * Failure: never fails (arguments were checked by the
- * caller).
+ * Failure: never fails (arguments were checked by the
+ * caller).
*
- * Programmer: Robb Matzke
+ * Programmer: Robb Matzke
* Wednesday, August 4, 1999
*
*-------------------------------------------------------------------------
*/
static int
-H5FD_family_cmp(const H5FD_t *_f1, const H5FD_t *_f2)
+H5FD__family_cmp(const H5FD_t *_f1, const H5FD_t *_f2)
{
const H5FD_family_t *f1 = (const H5FD_family_t *)_f1;
const H5FD_family_t *f2 = (const H5FD_family_t *)_f2;
int ret_value = 0;
- FUNC_ENTER_NOAPI_NOINIT_NOERR
+ FUNC_ENTER_STATIC_NOERR
HDassert(f1->nmembs >= 1 && f1->memb[0]);
HDassert(f2->nmembs >= 1 && f2->memb[0]);
@@ -818,28 +820,28 @@ H5FD_family_cmp(const H5FD_t *_f1, const H5FD_t *_f2)
ret_value = H5FDcmp(f1->memb[0], f2->memb[0]);
FUNC_LEAVE_NOAPI(ret_value)
-} /* end H5FD_family_cmp() */
+} /* end H5FD__family_cmp() */
/*-------------------------------------------------------------------------
- * Function: H5FD_family_query
+ * Function: H5FD__family_query
*
- * Purpose: Set the flags that this VFL driver is capable of supporting.
+ * Purpose: Set the flags that this VFL driver is capable of supporting.
* (listed in H5FDpublic.h)
*
- * Return: Success: non-negative
- * Failure: negative
+ * Return: Success: non-negative
+ * Failure: negative
*
- * Programmer: Quincey Koziol
+ * Programmer: Quincey Koziol
* Friday, August 25, 2000
*
*-------------------------------------------------------------------------
*/
static herr_t
-H5FD_family_query(const H5FD_t *_file, unsigned long *flags /* out */)
+H5FD__family_query(const H5FD_t *_file, unsigned long *flags /* out */)
{
const H5FD_family_t *file = (const H5FD_family_t *)_file; /* Family VFD info */
- FUNC_ENTER_NOAPI_NOINIT_NOERR
+ FUNC_ENTER_STATIC_NOERR
/* Set the VFL feature flags that this driver supports */
if (flags) {
@@ -856,44 +858,44 @@ H5FD_family_query(const H5FD_t *_file, unsigned long *flags /* out */)
} /* end if */
FUNC_LEAVE_NOAPI(SUCCEED)
-} /* end H5FD_family_query() */
+} /* end H5FD__family_query() */
/*-------------------------------------------------------------------------
- * Function: H5FD_family_get_eoa
+ * Function: H5FD__family_get_eoa
*
- * Purpose: Returns the end-of-address marker for the file. The EOA
- * marker is the first address past the last byte allocated in
- * the format address space.
+ * Purpose: Returns the end-of-address marker for the file. The EOA
+ * marker is the first address past the last byte allocated in
+ * the format address space.
*
- * Return: Success: The end-of-address-marker
+ * Return: Success: The end-of-address-marker
*
- * Failure: HADDR_UNDEF
+ * Failure: HADDR_UNDEF
*
- * Programmer: Robb Matzke
+ * Programmer: Robb Matzke
* Wednesday, August 4, 1999
*
*-------------------------------------------------------------------------
*/
static haddr_t
-H5FD_family_get_eoa(const H5FD_t *_file, H5FD_mem_t H5_ATTR_UNUSED type)
+H5FD__family_get_eoa(const H5FD_t *_file, H5FD_mem_t H5_ATTR_UNUSED type)
{
const H5FD_family_t *file = (const H5FD_family_t *)_file;
- FUNC_ENTER_NOAPI_NOINIT_NOERR
+ FUNC_ENTER_STATIC_NOERR
FUNC_LEAVE_NOAPI(file->eoa)
}
/*-------------------------------------------------------------------------
- * Function: H5FD_family_set_eoa
+ * Function: H5FD__family_set_eoa
*
- * Purpose: Set the end-of-address marker for the file.
+ * Purpose: Set the end-of-address marker for the file.
*
- * Return: Success: 0
+ * Return: Success: 0
*
- * Failure: -1
+ * Failure: -1
*
- * Programmer: Robb Matzke
+ * Programmer: Robb Matzke
* Wednesday, August 4, 1999
*
*-------------------------------------------------------------------------
@@ -906,7 +908,7 @@ H5FD_family_get_eoa(const H5FD_t *_file, H5FD_mem_t H5_ATTR_UNUSED type)
*/
H5_GCC_DIAG_OFF("format-nonliteral")
static herr_t
-H5FD_family_set_eoa(H5FD_t *_file, H5FD_mem_t type, haddr_t abs_eoa)
+H5FD__family_set_eoa(H5FD_t *_file, H5FD_mem_t type, haddr_t abs_eoa)
{
H5FD_family_t *file = (H5FD_family_t *)_file;
haddr_t addr = abs_eoa;
@@ -914,7 +916,7 @@ H5FD_family_set_eoa(H5FD_t *_file, H5FD_mem_t type, haddr_t abs_eoa)
unsigned u; /* Local index variable */
herr_t ret_value = SUCCEED; /* Return value */
- FUNC_ENTER_NOAPI_NOINIT
+ FUNC_ENTER_STATIC
/* Allocate space for the member name buffer */
if (NULL == (memb_name = (char *)H5MM_malloc(H5FD_FAM_MEMB_NAME_BUF_SIZE)))
@@ -976,31 +978,31 @@ done:
H5_GCC_DIAG_ON("format-nonliteral")
/*-------------------------------------------------------------------------
- * Function: H5FD_family_get_eof
+ * Function: H5FD__family_get_eof
*
- * Purpose: Returns the end-of-file marker, which is the greater of
- * either the total family size or the current EOA marker.
+ * Purpose: Returns the end-of-file marker, which is the greater of
+ * either the total family size or the current EOA marker.
*
- * Return: Success: End of file address, the first address past
- * the end of the family of files or the current
- * EOA, whichever is larger.
+ * Return: Success: End of file address, the first address past
+ * the end of the family of files or the current
+ * EOA, whichever is larger.
*
- * Failure: HADDR_UNDEF
+ * Failure: HADDR_UNDEF
*
- * Programmer: Robb Matzke
+ * Programmer: Robb Matzke
* Wednesday, August 4, 1999
*
*-------------------------------------------------------------------------
*/
static haddr_t
-H5FD_family_get_eof(const H5FD_t *_file, H5FD_mem_t type)
+H5FD__family_get_eof(const H5FD_t *_file, H5FD_mem_t type)
{
const H5FD_family_t *file = (const H5FD_family_t *)_file;
haddr_t eof = 0;
int i; /* Local index variable */
haddr_t ret_value = HADDR_UNDEF; /* Return value */
- FUNC_ENTER_NOAPI_NOINIT_NOERR
+ FUNC_ENTER_STATIC_NOERR
/*
* Find the last member that has a non-zero EOF and break out of the loop
@@ -1031,7 +1033,7 @@ H5FD_family_get_eof(const H5FD_t *_file, H5FD_mem_t type)
}
/*-------------------------------------------------------------------------
- * Function: H5FD_family_get_handle
+ * Function: H5FD__family_get_handle
*
* Purpose: Returns the file handle of FAMILY file driver.
*
@@ -1043,7 +1045,7 @@ H5FD_family_get_eof(const H5FD_t *_file, H5FD_mem_t type)
*-------------------------------------------------------------------------
*/
static herr_t
-H5FD_family_get_handle(H5FD_t *_file, hid_t fapl, void **file_handle)
+H5FD__family_get_handle(H5FD_t *_file, hid_t fapl, void **file_handle)
{
H5FD_family_t * file = (H5FD_family_t *)_file;
H5P_genplist_t *plist;
@@ -1051,16 +1053,16 @@ H5FD_family_get_handle(H5FD_t *_file, hid_t fapl, void **file_handle)
int memb;
herr_t ret_value = FAIL; /* Return value */
- FUNC_ENTER_NOAPI_NOINIT
+ FUNC_ENTER_STATIC
/* Get the plist structure and family offset */
if (NULL == (plist = H5P_object_verify(fapl, H5P_FILE_ACCESS)))
- HGOTO_ERROR(H5E_ATOM, H5E_BADATOM, FAIL, "can't find object for ID")
+ HGOTO_ERROR(H5E_ID, H5E_BADID, FAIL, "can't find object for ID")
if (H5P_get(plist, H5F_ACS_FAMILY_OFFSET_NAME, &offset) < 0)
HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "can't get offset for family driver")
if (offset > (file->memb_size * file->nmembs))
- HGOTO_ERROR(H5E_ATOM, H5E_BADATOM, FAIL, "offset is bigger than file size")
+ HGOTO_ERROR(H5E_ID, H5E_BADID, FAIL, "offset is bigger than file size")
memb = (int)(offset / file->memb_size);
ret_value = H5FD_get_vfd_handle(file->memb[memb], fapl, file_handle);
@@ -1070,24 +1072,25 @@ done:
}
/*-------------------------------------------------------------------------
- * Function: H5FD_family_read
+ * Function: H5FD__family_read
*
- * Purpose: Reads SIZE bytes of data from FILE beginning at address ADDR
- * into buffer BUF according to data transfer properties in
- * DXPL_ID.
+ * Purpose: Reads SIZE bytes of data from FILE beginning at address ADDR
+ * into buffer BUF according to data transfer properties in
+ * DXPL_ID.
*
- * Return: Success: Zero. Result is stored in caller-supplied
- * buffer BUF.
+ * Return: Success: Zero. Result is stored in caller-supplied
+ * buffer BUF.
*
- * Failure: -1, contents of buffer BUF are undefined.
+ * Failure: -1, contents of buffer BUF are undefined.
*
- * Programmer: Robb Matzke
+ * Programmer: Robb Matzke
* Wednesday, August 4, 1999
*
*-------------------------------------------------------------------------
*/
static herr_t
-H5FD_family_read(H5FD_t *_file, H5FD_mem_t type, hid_t dxpl_id, haddr_t addr, size_t size, void *_buf /*out*/)
+H5FD__family_read(H5FD_t *_file, H5FD_mem_t type, hid_t dxpl_id, haddr_t addr, size_t size,
+ void *_buf /*out*/)
{
H5FD_family_t * file = (H5FD_family_t *)_file;
unsigned char * buf = (unsigned char *)_buf;
@@ -1098,7 +1101,7 @@ H5FD_family_read(H5FD_t *_file, H5FD_mem_t type, hid_t dxpl_id, haddr_t addr, si
H5P_genplist_t *plist; /* Property list pointer */
herr_t ret_value = SUCCEED; /* Return value */
- FUNC_ENTER_NOAPI_NOINIT
+ FUNC_ENTER_STATIC
/*
* Get the member data transfer property list. If the transfer property
@@ -1136,23 +1139,23 @@ done:
}
/*-------------------------------------------------------------------------
- * Function: H5FD_family_write
+ * Function: H5FD__family_write
*
- * Purpose: Writes SIZE bytes of data to FILE beginning at address ADDR
- * from buffer BUF according to data transfer properties in
- * DXPL_ID.
+ * Purpose: Writes SIZE bytes of data to FILE beginning at address ADDR
+ * from buffer BUF according to data transfer properties in
+ * DXPL_ID.
*
- * Return: Success: Zero
+ * Return: Success: Zero
*
- * Failure: -1
+ * Failure: -1
*
- * Programmer: Robb Matzke
+ * Programmer: Robb Matzke
* Wednesday, August 4, 1999
*
*-------------------------------------------------------------------------
*/
static herr_t
-H5FD_family_write(H5FD_t *_file, H5FD_mem_t type, hid_t dxpl_id, haddr_t addr, size_t size, const void *_buf)
+H5FD__family_write(H5FD_t *_file, H5FD_mem_t type, hid_t dxpl_id, haddr_t addr, size_t size, const void *_buf)
{
H5FD_family_t * file = (H5FD_family_t *)_file;
const unsigned char *buf = (const unsigned char *)_buf;
@@ -1163,7 +1166,7 @@ H5FD_family_write(H5FD_t *_file, H5FD_mem_t type, hid_t dxpl_id, haddr_t addr, s
H5P_genplist_t * plist; /* Property list pointer */
herr_t ret_value = SUCCEED; /* Return value */
- FUNC_ENTER_NOAPI_NOINIT
+ FUNC_ENTER_STATIC
/*
* Get the member data transfer property list. If the transfer property
@@ -1201,26 +1204,26 @@ done:
}
/*-------------------------------------------------------------------------
- * Function: H5FD_family_flush
+ * Function: H5FD__family_flush
*
- * Purpose: Flushes all family members.
+ * Purpose: Flushes all family members.
*
- * Return: Success: 0
- * Failure: -1, as many files flushed as possible.
+ * Return: Success: 0
+ * Failure: -1, as many files flushed as possible.
*
- * Programmer: Robb Matzke
+ * Programmer: Robb Matzke
* Wednesday, August 4, 1999
*
*-------------------------------------------------------------------------
*/
static herr_t
-H5FD_family_flush(H5FD_t *_file, hid_t H5_ATTR_UNUSED dxpl_id, hbool_t closing)
+H5FD__family_flush(H5FD_t *_file, hid_t H5_ATTR_UNUSED dxpl_id, hbool_t closing)
{
H5FD_family_t *file = (H5FD_family_t *)_file;
unsigned u, nerrors = 0;
herr_t ret_value = SUCCEED; /* Return value */
- FUNC_ENTER_NOAPI_NOINIT
+ FUNC_ENTER_STATIC
for (u = 0; u < file->nmembs; u++)
if (file->memb[u] && H5FD_flush(file->memb[u], closing) < 0)
@@ -1231,30 +1234,30 @@ H5FD_family_flush(H5FD_t *_file, hid_t H5_ATTR_UNUSED dxpl_id, hbool_t closing)
done:
FUNC_LEAVE_NOAPI(ret_value)
-} /* end H5FD_family_flush() */
+} /* end H5FD__family_flush() */
/*-------------------------------------------------------------------------
- * Function: H5FD_family_truncate
+ * Function: H5FD__family_truncate
*
- * Purpose: Truncates all family members.
+ * Purpose: Truncates all family members.
*
- * Return: Success: 0
+ * Return: Success: 0
*
- * Failure: -1, as many files truncated as possible.
+ * Failure: -1, as many files truncated as possible.
*
- * Programmer: Quincey Koziol
+ * Programmer: Quincey Koziol
* Saturday, February 23, 2008
*
*-------------------------------------------------------------------------
*/
static herr_t
-H5FD_family_truncate(H5FD_t *_file, hid_t H5_ATTR_UNUSED dxpl_id, hbool_t closing)
+H5FD__family_truncate(H5FD_t *_file, hid_t H5_ATTR_UNUSED dxpl_id, hbool_t closing)
{
H5FD_family_t *file = (H5FD_family_t *)_file;
unsigned u, nerrors = 0;
herr_t ret_value = SUCCEED; /* Return value */
- FUNC_ENTER_NOAPI_NOINIT
+ FUNC_ENTER_STATIC
for (u = 0; u < file->nmembs; u++)
if (file->memb[u] && H5FD_truncate(file->memb[u], closing) < 0)
@@ -1265,10 +1268,10 @@ H5FD_family_truncate(H5FD_t *_file, hid_t H5_ATTR_UNUSED dxpl_id, hbool_t closin
done:
FUNC_LEAVE_NOAPI(ret_value)
-} /* end H5FD_family_truncate() */
+} /* end H5FD__family_truncate() */
/*-------------------------------------------------------------------------
- * Function: H5FD_family_lock
+ * Function: H5FD__family_lock
*
* Purpose: To place an advisory lock on a file.
* The lock type to apply depends on the parameter "rw":
@@ -1282,13 +1285,13 @@ done:
*-------------------------------------------------------------------------
*/
static herr_t
-H5FD_family_lock(H5FD_t *_file, hbool_t rw)
+H5FD__family_lock(H5FD_t *_file, hbool_t rw)
{
H5FD_family_t *file = (H5FD_family_t *)_file; /* VFD file struct */
unsigned u; /* Local index variable */
herr_t ret_value = SUCCEED; /* Return value */
- FUNC_ENTER_NOAPI_NOINIT
+ FUNC_ENTER_STATIC
/* Place the lock on all the member files */
for (u = 0; u < file->nmembs; u++)
@@ -1312,10 +1315,10 @@ H5FD_family_lock(H5FD_t *_file, hbool_t rw)
done:
FUNC_LEAVE_NOAPI(ret_value)
-} /* end H5FD_family_lock() */
+} /* end H5FD__family_lock() */
/*-------------------------------------------------------------------------
- * Function: H5FD_family_unlock
+ * Function: H5FD__family_unlock
*
* Purpose: To remove the existing lock on the file
*
@@ -1326,13 +1329,13 @@ done:
*-------------------------------------------------------------------------
*/
static herr_t
-H5FD_family_unlock(H5FD_t *_file)
+H5FD__family_unlock(H5FD_t *_file)
{
H5FD_family_t *file = (H5FD_family_t *)_file; /* VFD file struct */
unsigned u; /* Local index variable */
herr_t ret_value = SUCCEED; /* Return value */
- FUNC_ENTER_NOAPI_NOINIT
+ FUNC_ENTER_STATIC
/* Remove the lock on the member files */
for (u = 0; u < file->nmembs; u++)
@@ -1342,4 +1345,95 @@ H5FD_family_unlock(H5FD_t *_file)
done:
FUNC_LEAVE_NOAPI(ret_value)
-} /* end H5FD_family_unlock() */
+} /* end H5FD__family_unlock() */
+
+/*-------------------------------------------------------------------------
+ * Function: H5FD__family_delete
+ *
+ * Purpose: Delete a file
+ *
+ * Return: SUCCEED/FAIL
+ *
+ *-------------------------------------------------------------------------
+ */
+static herr_t
+H5FD__family_delete(const char *filename, hid_t fapl_id)
+{
+ H5P_genplist_t * plist;
+ const H5FD_family_fapl_t *fa;
+ hid_t memb_fapl_id = H5I_INVALID_HID;
+ unsigned current_member;
+ char * member_name = NULL;
+ char * temp = NULL;
+ herr_t delete_error = FAIL;
+ herr_t ret_value = SUCCEED;
+
+ FUNC_ENTER_STATIC
+
+ HDassert(filename);
+
+ /* Get the driver info (for the member fapl)
+ * The family_open call accepts H5P_DEFAULT, so we'll accept that here, too.
+ */
+ if (H5P_FILE_ACCESS_DEFAULT == fapl_id)
+ memb_fapl_id = H5P_FILE_ACCESS_DEFAULT;
+ else {
+ if (NULL == (plist = (H5P_genplist_t *)H5I_object(fapl_id)))
+ HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a file access property list")
+ if (NULL == (fa = (const H5FD_family_fapl_t *)H5P_peek_driver_info(plist)))
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "bad family VFD driver info")
+ memb_fapl_id = fa->memb_fapl_id;
+ }
+
+ /* Allocate space for the string buffers */
+ if (NULL == (member_name = (char *)H5MM_malloc(H5FD_FAM_MEMB_NAME_BUF_SIZE)))
+ HGOTO_ERROR(H5E_VFL, H5E_CANTALLOC, FAIL, "unable to allocate member name")
+ if (NULL == (temp = (char *)H5MM_malloc(H5FD_FAM_MEMB_NAME_BUF_SIZE)))
+ HGOTO_ERROR(H5E_VFL, H5E_CANTALLOC, FAIL, "unable to allocate temporary member name")
+
+ /* Sanity check to make sure that generated names are unique */
+ HDsnprintf(member_name, H5FD_FAM_MEMB_NAME_BUF_SIZE, filename, 0);
+ HDsnprintf(temp, H5FD_FAM_MEMB_NAME_BUF_SIZE, filename, 1);
+ if (!HDstrcmp(member_name, temp))
+ HGOTO_ERROR(H5E_VFL, H5E_CANTDELETEFILE, FAIL, "provided file name cannot generate unique sub-files")
+
+ /* Delete all the family members */
+ current_member = 0;
+ while (1) {
+ /* Fix up the filename with the current member's number */
+ HDsnprintf(member_name, H5FD_FAM_MEMB_NAME_BUF_SIZE, filename, current_member);
+
+ /* Attempt to delete the member files. If the first file throws an error
+ * we always consider this an error. With subsequent member files, however,
+ * errors usually mean that we hit the last member file so we ignore them.
+ *
+ * Note that this means that any missing files in the family will leave
+ * undeleted members behind.
+ */
+ H5E_BEGIN_TRY
+ {
+ delete_error = H5FD_delete(member_name, memb_fapl_id);
+ }
+ H5E_END_TRY;
+ if (FAIL == delete_error) {
+ if (0 == current_member)
+ HGOTO_ERROR(H5E_VFL, H5E_CANTDELETEFILE, FAIL, "unable to delete member file")
+ else
+ H5E_clear_stack(NULL);
+ break;
+ }
+ current_member++;
+ } /* end while */
+
+done:
+ if (member_name)
+ H5MM_xfree(member_name);
+ if (temp)
+ H5MM_xfree(temp);
+
+ /* Don't close memb_fapl_id - We didn't bump its reference count since we're
+ * only using it in this call.
+ */
+
+ FUNC_LEAVE_NOAPI(ret_value)
+} /* end H5FD__family_delete() */
diff --git a/src/H5FDhdfs.c b/src/H5FDhdfs.c
index e44b575..50e02a4 100644
--- a/src/H5FDhdfs.c
+++ b/src/H5FDhdfs.c
@@ -309,6 +309,7 @@ static const H5FD_class_t H5FD_hdfs_g = {
H5FD__hdfs_truncate, /* truncate */
NULL, /* lock */
NULL, /* unlock */
+ NULL, /* del */
NULL, /* dedup */
H5FD_FLMAP_DICHOTOMY /* fl_map */
};
diff --git a/src/H5FDint.c b/src/H5FDint.c
index 3ab5ab7..23dfa4d 100644
--- a/src/H5FDint.c
+++ b/src/H5FDint.c
@@ -381,3 +381,47 @@ H5FD_driver_query(const H5FD_class_t *driver, unsigned long *flags /*out*/)
FUNC_LEAVE_NOAPI(ret_value)
} /* end H5FD_driver_query() */
+
+/*-------------------------------------------------------------------------
+ * Function: H5FD_delete
+ *
+ * Purpose: Private version of H5FDdelete()
+ *
+ * Return: SUCCEED/FAIL
+ *
+ *-------------------------------------------------------------------------
+ */
+herr_t
+H5FD_delete(const char *filename, hid_t fapl_id)
+{
+ H5FD_class_t * driver; /* VFD for file */
+ H5FD_driver_prop_t driver_prop; /* Property for driver ID & info */
+ H5P_genplist_t * plist; /* Property list pointer */
+ herr_t ret_value = SUCCEED; /* Return value */
+
+ FUNC_ENTER_NOAPI(FAIL)
+
+ /* Sanity checks */
+ HDassert(filename);
+
+ /* Get file access property list */
+ if (NULL == (plist = (H5P_genplist_t *)H5I_object(fapl_id)))
+ HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a file access property list")
+
+ /* Get the VFD to open the file with */
+ if (H5P_peek(plist, H5F_ACS_FILE_DRV_NAME, &driver_prop) < 0)
+ HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "can't get driver ID & info")
+
+ /* Get driver info */
+ if (NULL == (driver = (H5FD_class_t *)H5I_object(driver_prop.driver_id)))
+ HGOTO_ERROR(H5E_VFL, H5E_BADVALUE, FAIL, "invalid driver ID in file access property list")
+ if (NULL == driver->del)
+ HGOTO_ERROR(H5E_VFL, H5E_UNSUPPORTED, FAIL, "file driver has no 'del' method")
+
+ /* Dispatch to file driver */
+ if ((driver->del)(filename, fapl_id))
+ HGOTO_ERROR(H5E_VFL, H5E_CANTDELETEFILE, FAIL, "delete failed")
+
+done:
+ FUNC_LEAVE_NOAPI(ret_value)
+} /* end H5FD_delete() */
diff --git a/src/H5FDlog.c b/src/H5FDlog.c
index 09e71f1..4fd5e27 100644
--- a/src/H5FDlog.c
+++ b/src/H5FDlog.c
@@ -156,62 +156,64 @@ typedef struct H5FD_log_t {
(ADDR_OVERFLOW(A) || SIZE_OVERFLOW(Z) || HADDR_UNDEF == (A) + (Z) || (HDoff_t)((A) + (Z)) < (HDoff_t)(A))
/* Prototypes */
-static herr_t H5FD_log_term(void);
-static void * H5FD_log_fapl_get(H5FD_t *file);
-static void * H5FD_log_fapl_copy(const void *_old_fa);
-static herr_t H5FD_log_fapl_free(void *_fa);
-static H5FD_t *H5FD_log_open(const char *name, unsigned flags, hid_t fapl_id, haddr_t maxaddr);
-static herr_t H5FD_log_close(H5FD_t *_file);
-static int H5FD_log_cmp(const H5FD_t *_f1, const H5FD_t *_f2);
-static herr_t H5FD_log_query(const H5FD_t *_f1, unsigned long *flags);
-static haddr_t H5FD_log_alloc(H5FD_t *_file, H5FD_mem_t type, hid_t dxpl_id, hsize_t size);
+static herr_t H5FD__log_term(void);
+static void * H5FD__log_fapl_get(H5FD_t *file);
+static void * H5FD__log_fapl_copy(const void *_old_fa);
+static herr_t H5FD__log_fapl_free(void *_fa);
+static H5FD_t *H5FD__log_open(const char *name, unsigned flags, hid_t fapl_id, haddr_t maxaddr);
+static herr_t H5FD__log_close(H5FD_t *_file);
+static int H5FD__log_cmp(const H5FD_t *_f1, const H5FD_t *_f2);
+static herr_t H5FD__log_query(const H5FD_t *_f1, unsigned long *flags);
+static haddr_t H5FD__log_alloc(H5FD_t *_file, H5FD_mem_t type, hid_t dxpl_id, hsize_t size);
static herr_t H5FD__log_free(H5FD_t *_file, H5FD_mem_t type, hid_t dxpl_id, haddr_t addr, hsize_t size);
-static haddr_t H5FD_log_get_eoa(const H5FD_t *_file, H5FD_mem_t type);
-static herr_t H5FD_log_set_eoa(H5FD_t *_file, H5FD_mem_t type, haddr_t addr);
-static haddr_t H5FD_log_get_eof(const H5FD_t *_file, H5FD_mem_t type);
-static herr_t H5FD_log_get_handle(H5FD_t *_file, hid_t fapl, void **file_handle);
-static herr_t H5FD_log_read(H5FD_t *_file, H5FD_mem_t type, hid_t fapl_id, haddr_t addr, size_t size,
- void *buf);
-static herr_t H5FD_log_write(H5FD_t *_file, H5FD_mem_t type, hid_t fapl_id, haddr_t addr, size_t size,
- const void *buf);
-static herr_t H5FD_log_truncate(H5FD_t *_file, hid_t dxpl_id, hbool_t closing);
-static herr_t H5FD_log_lock(H5FD_t *_file, hbool_t rw);
-static herr_t H5FD_log_unlock(H5FD_t *_file);
+static haddr_t H5FD__log_get_eoa(const H5FD_t *_file, H5FD_mem_t type);
+static herr_t H5FD__log_set_eoa(H5FD_t *_file, H5FD_mem_t type, haddr_t addr);
+static haddr_t H5FD__log_get_eof(const H5FD_t *_file, H5FD_mem_t type);
+static herr_t H5FD__log_get_handle(H5FD_t *_file, hid_t fapl, void **file_handle);
+static herr_t H5FD__log_read(H5FD_t *_file, H5FD_mem_t type, hid_t fapl_id, haddr_t addr, size_t size,
+ void *buf);
+static herr_t H5FD__log_write(H5FD_t *_file, H5FD_mem_t type, hid_t fapl_id, haddr_t addr, size_t size,
+ const void *buf);
+static herr_t H5FD__log_truncate(H5FD_t *_file, hid_t dxpl_id, hbool_t closing);
+static herr_t H5FD__log_lock(H5FD_t *_file, hbool_t rw);
+static herr_t H5FD__log_unlock(H5FD_t *_file);
+static herr_t H5FD__log_delete(const char *filename, hid_t fapl_id);
static const H5FD_class_t H5FD_log_g = {
- "log", /*name */
- MAXADDR, /*maxaddr */
- H5F_CLOSE_WEAK, /* fc_degree */
- H5FD_log_term, /*terminate */
- NULL, /*sb_size */
- NULL, /*sb_encode */
- NULL, /*sb_decode */
- sizeof(H5FD_log_fapl_t), /*fapl_size */
- H5FD_log_fapl_get, /*fapl_get */
- H5FD_log_fapl_copy, /*fapl_copy */
- H5FD_log_fapl_free, /*fapl_free */
- 0, /*dxpl_size */
- NULL, /*dxpl_copy */
- NULL, /*dxpl_free */
- H5FD_log_open, /*open */
- H5FD_log_close, /*close */
- H5FD_log_cmp, /*cmp */
- H5FD_log_query, /*query */
- NULL, /*get_type_map */
- H5FD_log_alloc, /*alloc */
- H5FD__log_free, /*free */
- H5FD_log_get_eoa, /*get_eoa */
- H5FD_log_set_eoa, /*set_eoa */
- H5FD_log_get_eof, /*get_eof */
- H5FD_log_get_handle, /*get_handle */
- H5FD_log_read, /*read */
- H5FD_log_write, /*write */
- NULL, /*flush */
- H5FD_log_truncate, /*truncate */
- H5FD_log_lock, /*lock */
- H5FD_log_unlock, /*unlock */
- NULL, /*dedup */
- H5FD_FLMAP_DICHOTOMY /*fl_map */
+ "log", /* name */
+ MAXADDR, /* maxaddr */
+ H5F_CLOSE_WEAK, /* fc_degree */
+ H5FD__log_term, /* terminate */
+ NULL, /* sb_size */
+ NULL, /* sb_encode */
+ NULL, /* sb_decode */
+ sizeof(H5FD_log_fapl_t), /* fapl_size */
+ H5FD__log_fapl_get, /* fapl_get */
+ H5FD__log_fapl_copy, /* fapl_copy */
+ H5FD__log_fapl_free, /* fapl_free */
+ 0, /* dxpl_size */
+ NULL, /* dxpl_copy */
+ NULL, /* dxpl_free */
+ H5FD__log_open, /* open */
+ H5FD__log_close, /* close */
+ H5FD__log_cmp, /* cmp */
+ H5FD__log_query, /* query */
+ NULL, /* get_type_map */
+ H5FD__log_alloc, /* alloc */
+ H5FD__log_free, /* free */
+ H5FD__log_get_eoa, /* get_eoa */
+ H5FD__log_set_eoa, /* set_eoa */
+ H5FD__log_get_eof, /* get_eof */
+ H5FD__log_get_handle, /* get_handle */
+ H5FD__log_read, /* read */
+ H5FD__log_write, /* write */
+ NULL, /* flush */
+ H5FD__log_truncate, /* truncate */
+ H5FD__log_lock, /* lock */
+ H5FD__log_unlock, /* unlock */
+ H5FD__log_delete, /* del */
+ NULL, /* dedup */
+ H5FD_FLMAP_DICHOTOMY /* fl_map */
};
/* Declare a free list to manage the H5FD_log_t struct */
@@ -282,7 +284,7 @@ done:
} /* end H5FD_log_init() */
/*---------------------------------------------------------------------------
- * Function: H5FD_log_term
+ * Function: H5FD__log_term
*
* Purpose: Shut down the VFD
*
@@ -294,15 +296,15 @@ done:
*---------------------------------------------------------------------------
*/
static herr_t
-H5FD_log_term(void)
+H5FD__log_term(void)
{
- FUNC_ENTER_NOAPI_NOINIT_NOERR
+ FUNC_ENTER_STATIC_NOERR
/* Reset VFL ID */
H5FD_LOG_g = 0;
FUNC_LEAVE_NOAPI(SUCCEED)
-} /* end H5FD_log_term() */
+} /* end H5FD__log_term() */
/*-------------------------------------------------------------------------
* Function: H5Pset_fapl_log
@@ -327,12 +329,15 @@ H5Pset_fapl_log(hid_t fapl_id, const char *logfile, unsigned long long flags, si
FUNC_ENTER_API(FAIL)
H5TRACE4("e", "i*sULz", fapl_id, logfile, flags, buf_size);
+ /* Do this first, so that we don't try to free a wild pointer if
+ * H5P_object_verify() fails.
+ */
+ HDmemset(&fa, 0, sizeof(H5FD_log_fapl_t));
+
/* Check arguments */
if (NULL == (plist = H5P_object_verify(fapl_id, H5P_FILE_ACCESS)))
HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a file access property list")
- HDmemset(&fa, 0, sizeof(H5FD_log_fapl_t));
-
/* Duplicate the log file string
* A little wasteful, since this string will just be copied later, but
* passing it in as a pointer sets off a chain of impossible-to-resolve
@@ -353,7 +358,7 @@ done:
} /* end H5Pset_fapl_log() */
/*-------------------------------------------------------------------------
- * Function: H5FD_log_fapl_get
+ * Function: H5FD__log_fapl_get
*
* Purpose: Returns a file access property list which indicates how the
* specified file is being accessed. The return list could be
@@ -369,21 +374,21 @@ done:
*-------------------------------------------------------------------------
*/
static void *
-H5FD_log_fapl_get(H5FD_t *_file)
+H5FD__log_fapl_get(H5FD_t *_file)
{
H5FD_log_t *file = (H5FD_log_t *)_file;
void * ret_value = NULL; /* Return value */
- FUNC_ENTER_NOAPI_NOINIT_NOERR
+ FUNC_ENTER_STATIC_NOERR
/* Set return value */
- ret_value = H5FD_log_fapl_copy(&(file->fa));
+ ret_value = H5FD__log_fapl_copy(&(file->fa));
FUNC_LEAVE_NOAPI(ret_value)
-} /* end H5FD_log_fapl_get() */
+} /* end H5FD__log_fapl_get() */
/*-------------------------------------------------------------------------
- * Function: H5FD_log_fapl_copy
+ * Function: H5FD__log_fapl_copy
*
* Purpose: Copies the log-specific file access properties.
*
@@ -396,13 +401,13 @@ H5FD_log_fapl_get(H5FD_t *_file)
*-------------------------------------------------------------------------
*/
static void *
-H5FD_log_fapl_copy(const void *_old_fa)
+H5FD__log_fapl_copy(const void *_old_fa)
{
const H5FD_log_fapl_t *old_fa = (const H5FD_log_fapl_t *)_old_fa;
H5FD_log_fapl_t * new_fa = NULL; /* New FAPL info */
void * ret_value = NULL; /* Return value */
- FUNC_ENTER_NOAPI_NOINIT
+ FUNC_ENTER_STATIC
HDassert(old_fa);
@@ -427,13 +432,13 @@ done:
if (new_fa->logfile)
new_fa->logfile = (char *)H5MM_xfree(new_fa->logfile);
H5MM_free(new_fa);
- } /* end if */
+ }
FUNC_LEAVE_NOAPI(ret_value)
-} /* end H5FD_log_fapl_copy() */
+} /* end H5FD__log_fapl_copy() */
/*-------------------------------------------------------------------------
- * Function: H5FD_log_fapl_free
+ * Function: H5FD__log_fapl_free
*
* Purpose: Frees the log-specific file access properties.
*
@@ -445,11 +450,11 @@ done:
*-------------------------------------------------------------------------
*/
static herr_t
-H5FD_log_fapl_free(void *_fa)
+H5FD__log_fapl_free(void *_fa)
{
H5FD_log_fapl_t *fa = (H5FD_log_fapl_t *)_fa;
- FUNC_ENTER_NOAPI_NOINIT_NOERR
+ FUNC_ENTER_STATIC_NOERR
/* Free the fapl information */
if (fa->logfile)
@@ -457,10 +462,10 @@ H5FD_log_fapl_free(void *_fa)
H5MM_xfree(fa);
FUNC_LEAVE_NOAPI(SUCCEED)
-} /* end H5FD_log_fapl_free() */
+} /* end H5FD__log_fapl_free() */
/*-------------------------------------------------------------------------
- * Function: H5FD_log_open
+ * Function: H5FD__log_open
*
* Purpose: Create and/or opens a file as an HDF5 file.
*
@@ -475,7 +480,7 @@ H5FD_log_fapl_free(void *_fa)
*-------------------------------------------------------------------------
*/
static H5FD_t *
-H5FD_log_open(const char *name, unsigned flags, hid_t fapl_id, haddr_t maxaddr)
+H5FD__log_open(const char *name, unsigned flags, hid_t fapl_id, haddr_t maxaddr)
{
H5FD_log_t * file = NULL;
H5P_genplist_t * plist; /* Property list */
@@ -485,12 +490,12 @@ H5FD_log_open(const char *name, unsigned flags, hid_t fapl_id, haddr_t maxaddr)
#ifdef H5_HAVE_WIN32_API
struct _BY_HANDLE_FILE_INFORMATION fileinfo;
#endif
- H5_timer_t open_timer = {{0}, {0}, {0}, FALSE}; /* Timer for open() call */
- H5_timer_t stat_timer = {{0}, {0}, {0}, FALSE}; /* Timer for stat() call */
+ H5_timer_t open_timer; /* Timer for open() call */
+ H5_timer_t stat_timer; /* Timer for stat() call */
h5_stat_t sb;
H5FD_t * ret_value = NULL; /* Return value */
- FUNC_ENTER_NOAPI_NOINIT
+ FUNC_ENTER_STATIC
/* Sanity check on file offsets */
HDcompile_assert(sizeof(HDoff_t) >= sizeof(size_t));
@@ -503,6 +508,10 @@ H5FD_log_open(const char *name, unsigned flags, hid_t fapl_id, haddr_t maxaddr)
if (ADDR_OVERFLOW(maxaddr))
HGOTO_ERROR(H5E_ARGS, H5E_OVERFLOW, NULL, "bogus maxaddr")
+ /* Initialize timers */
+ H5_timer_init(&open_timer);
+ H5_timer_init(&stat_timer);
+
/* Build the open flags */
o_flags = (H5F_ACC_RDWR & flags) ? O_RDWR : O_RDONLY;
if (H5F_ACC_TRUNC & flags)
@@ -519,10 +528,8 @@ H5FD_log_open(const char *name, unsigned flags, hid_t fapl_id, haddr_t maxaddr)
HGOTO_ERROR(H5E_PLIST, H5E_BADVALUE, NULL, "bad VFL driver info")
/* Start timer for open() call */
- if (fa->flags & H5FD_LOG_TIME_OPEN) {
- H5_timer_init(&open_timer);
+ if (fa->flags & H5FD_LOG_TIME_OPEN)
H5_timer_start(&open_timer);
- } /* end if */
/* Open the file */
if ((fd = HDopen(name, o_flags, H5_POSIX_CREATE_MODE_RW)) < 0) {
@@ -532,17 +539,15 @@ H5FD_log_open(const char *name, unsigned flags, hid_t fapl_id, haddr_t maxaddr)
H5E_FILE, H5E_CANTOPENFILE, NULL,
"unable to open file: name = '%s', errno = %d, error message = '%s', flags = %x, o_flags = %x",
name, myerrno, HDstrerror(myerrno), flags, (unsigned)o_flags);
- } /* end if */
+ }
/* Stop timer for open() call */
if (fa->flags & H5FD_LOG_TIME_OPEN)
H5_timer_stop(&open_timer);
/* Start timer for stat() call */
- if (fa->flags & H5FD_LOG_TIME_STAT) {
- H5_timer_init(&stat_timer);
+ if (fa->flags & H5FD_LOG_TIME_STAT)
H5_timer_start(&stat_timer);
- } /* end if */
/* Get the file stats */
if (HDfstat(fd, &sb) < 0)
@@ -595,15 +600,15 @@ H5FD_log_open(const char *name, unsigned flags, hid_t fapl_id, haddr_t maxaddr)
if (file->fa.flags & H5FD_LOG_FILE_READ) {
file->nread = (unsigned char *)H5MM_calloc(file->iosize);
HDassert(file->nread);
- } /* end if */
+ }
if (file->fa.flags & H5FD_LOG_FILE_WRITE) {
file->nwrite = (unsigned char *)H5MM_calloc(file->iosize);
HDassert(file->nwrite);
- } /* end if */
+ }
if (file->fa.flags & H5FD_LOG_FLAVOR) {
file->flavor = (unsigned char *)H5MM_calloc(file->iosize);
HDassert(file->flavor);
- } /* end if */
+ }
/* Set the log file pointer */
if (fa->logfile)
@@ -617,14 +622,14 @@ H5FD_log_open(const char *name, unsigned flags, hid_t fapl_id, haddr_t maxaddr)
H5_timer_get_times(open_timer, &open_times);
HDfprintf(file->logfp, "Open took: (%f s)\n", open_times.elapsed);
- } /* end if */
+ }
if (file->fa.flags & H5FD_LOG_TIME_STAT) {
H5_timevals_t stat_times; /* Elapsed time for stat() call */
H5_timer_get_times(stat_timer, &stat_times);
HDfprintf(file->logfp, "Stat took: (%f s)\n", stat_times.elapsed);
- } /* end if */
- } /* end if */
+ }
+ }
/* Check the file locking flags in the fapl */
if (ignore_disabled_file_locks_s != FAIL)
@@ -646,7 +651,7 @@ H5FD_log_open(const char *name, unsigned flags, hid_t fapl_id, haddr_t maxaddr)
if (H5P_exist_plist(plist, H5F_ACS_FAMILY_TO_SINGLE_NAME) > 0)
if (H5P_get(plist, H5F_ACS_FAMILY_TO_SINGLE_NAME, &file->fam_to_single) < 0)
HGOTO_ERROR(H5E_VFL, H5E_CANTGET, NULL, "can't get property of changing family to single")
- } /* end if */
+ }
/* Set return value */
ret_value = (H5FD_t *)file;
@@ -657,13 +662,13 @@ done:
HDclose(fd);
if (file)
file = H5FL_FREE(H5FD_log_t, file);
- } /* end if */
+ }
FUNC_LEAVE_NOAPI(ret_value)
-} /* end H5FD_log_open() */
+} /* end H5FD__log_open() */
/*-------------------------------------------------------------------------
- * Function: H5FD_log_close
+ * Function: H5FD__log_close
*
* Purpose: Closes an HDF5 file.
*
@@ -676,22 +681,23 @@ done:
*-------------------------------------------------------------------------
*/
static herr_t
-H5FD_log_close(H5FD_t *_file)
+H5FD__log_close(H5FD_t *_file)
{
- H5FD_log_t *file = (H5FD_log_t *)_file;
- H5_timer_t close_timer = {{0}, {0}, {0}, FALSE}; /* Timer for close() call */
- herr_t ret_value = SUCCEED; /* Return value */
+ H5FD_log_t *file = (H5FD_log_t *)_file;
+ H5_timer_t close_timer; /* Timer for close() call */
+ herr_t ret_value = SUCCEED; /* Return value */
- FUNC_ENTER_NOAPI_NOINIT
+ FUNC_ENTER_STATIC
/* Sanity check */
HDassert(file);
+ /* Initialize timer */
+ H5_timer_init(&close_timer);
+
/* Start timer for close() call */
- if (file->fa.flags & H5FD_LOG_TIME_CLOSE) {
- H5_timer_init(&close_timer);
+ if (file->fa.flags & H5FD_LOG_TIME_CLOSE)
H5_timer_start(&close_timer);
- } /* end if */
/* Close the underlying file */
if (HDclose(file->fd) < 0)
@@ -712,7 +718,7 @@ H5FD_log_close(H5FD_t *_file)
H5_timer_get_times(close_timer, &close_times);
HDfprintf(file->logfp, "Close took: (%f s)\n", close_times.elapsed);
- } /* end if */
+ }
/* Dump the total number of seek/read/write operations */
if (file->fa.flags & H5FD_LOG_NUM_READ)
@@ -742,16 +748,18 @@ H5FD_log_close(H5FD_t *_file)
addr = 1;
while (addr < file->eoa) {
if (file->nwrite[addr] != last_val) {
- HDfprintf(file->logfp, "\tAddr %10a-%10a (%10lu bytes) written to %3d times\n", last_addr,
- (addr - 1), (unsigned long)(addr - last_addr), (int)last_val);
+ HDfprintf(file->logfp,
+ "\tAddr %10" PRIuHADDR "-%10" PRIuHADDR " (%10lu bytes) written to %3d times\n",
+ last_addr, (addr - 1), (unsigned long)(addr - last_addr), (int)last_val);
last_val = file->nwrite[addr];
last_addr = addr;
- } /* end if */
+ }
addr++;
- } /* end while */
- HDfprintf(file->logfp, "\tAddr %10a-%10a (%10lu bytes) written to %3d times\n", last_addr,
- (addr - 1), (unsigned long)(addr - last_addr), (int)last_val);
- } /* end if */
+ }
+ HDfprintf(file->logfp,
+ "\tAddr %10" PRIuHADDR "-%10" PRIuHADDR " (%10lu bytes) written to %3d times\n",
+ last_addr, (addr - 1), (unsigned long)(addr - last_addr), (int)last_val);
+ }
/* Dump the read I/O information */
if (file->fa.flags & H5FD_LOG_FILE_READ) {
@@ -761,16 +769,18 @@ H5FD_log_close(H5FD_t *_file)
addr = 1;
while (addr < file->eoa) {
if (file->nread[addr] != last_val) {
- HDfprintf(file->logfp, "\tAddr %10a-%10a (%10lu bytes) read from %3d times\n", last_addr,
- (addr - 1), (unsigned long)(addr - last_addr), (int)last_val);
+ HDfprintf(file->logfp,
+ "\tAddr %10" PRIuHADDR "-%10" PRIuHADDR " (%10lu bytes) read from %3d times\n",
+ last_addr, (addr - 1), (unsigned long)(addr - last_addr), (int)last_val);
last_val = file->nread[addr];
last_addr = addr;
- } /* end if */
+ }
addr++;
- } /* end while */
- HDfprintf(file->logfp, "\tAddr %10a-%10a (%10lu bytes) read from %3d times\n", last_addr,
- (addr - 1), (unsigned long)(addr - last_addr), (int)last_val);
- } /* end if */
+ }
+ HDfprintf(file->logfp,
+ "\tAddr %10" PRIuHADDR "-%10" PRIuHADDR " (%10lu bytes) read from %3d times\n",
+ last_addr, (addr - 1), (unsigned long)(addr - last_addr), (int)last_val);
+ }
/* Dump the I/O flavor information */
if (file->fa.flags & H5FD_LOG_FLAVOR) {
@@ -780,16 +790,17 @@ H5FD_log_close(H5FD_t *_file)
addr = 1;
while (addr < file->eoa) {
if (file->flavor[addr] != last_val) {
- HDfprintf(file->logfp, "\tAddr %10a-%10a (%10lu bytes) flavor is %s\n", last_addr,
- (addr - 1), (unsigned long)(addr - last_addr), flavors[last_val]);
+ HDfprintf(file->logfp,
+ "\tAddr %10" PRIuHADDR "-%10" PRIuHADDR " (%10lu bytes) flavor is %s\n",
+ last_addr, (addr - 1), (unsigned long)(addr - last_addr), flavors[last_val]);
last_val = file->flavor[addr];
last_addr = addr;
- } /* end if */
+ }
addr++;
- } /* end while */
- HDfprintf(file->logfp, "\tAddr %10a-%10a (%10lu bytes) flavor is %s\n", last_addr, (addr - 1),
- (unsigned long)(addr - last_addr), flavors[last_val]);
- } /* end if */
+ }
+ HDfprintf(file->logfp, "\tAddr %10" PRIuHADDR "-%10" PRIuHADDR " (%10lu bytes) flavor is %s\n",
+ last_addr, (addr - 1), (unsigned long)(addr - last_addr), flavors[last_val]);
+ }
/* Free the logging information */
if (file->fa.flags & H5FD_LOG_FILE_WRITE)
@@ -810,10 +821,10 @@ H5FD_log_close(H5FD_t *_file)
done:
FUNC_LEAVE_NOAPI(ret_value)
-} /* end H5FD_log_close() */
+} /* end H5FD__log_close() */
/*-------------------------------------------------------------------------
- * Function: H5FD_log_cmp
+ * Function: H5FD__log_cmp
*
* Purpose: Compares two files belonging to this driver using an
* arbitrary (but consistent) ordering.
@@ -828,13 +839,13 @@ done:
*-------------------------------------------------------------------------
*/
static int
-H5FD_log_cmp(const H5FD_t *_f1, const H5FD_t *_f2)
+H5FD__log_cmp(const H5FD_t *_f1, const H5FD_t *_f2)
{
const H5FD_log_t *f1 = (const H5FD_log_t *)_f1;
const H5FD_log_t *f2 = (const H5FD_log_t *)_f2;
int ret_value = 0;
- FUNC_ENTER_NOAPI_NOINIT_NOERR
+ FUNC_ENTER_STATIC_NOERR
#ifdef H5_HAVE_WIN32_API
if (f1->dwVolumeSerialNumber < f2->dwVolumeSerialNumber)
@@ -877,10 +888,10 @@ H5FD_log_cmp(const H5FD_t *_f1, const H5FD_t *_f2)
done:
FUNC_LEAVE_NOAPI(ret_value)
-} /* end H5FD_log_cmp() */
+} /* end H5FD__log_cmp() */
/*-------------------------------------------------------------------------
- * Function: H5FD_log_query
+ * Function: H5FD__log_query
*
* Purpose: Set the flags that this VFL driver is capable of supporting.
* (listed in H5FDpublic.h)
@@ -893,11 +904,11 @@ done:
*-------------------------------------------------------------------------
*/
static herr_t
-H5FD_log_query(const H5FD_t *_file, unsigned long *flags /* out */)
+H5FD__log_query(const H5FD_t *_file, unsigned long *flags /* out */)
{
const H5FD_log_t *file = (const H5FD_log_t *)_file;
- FUNC_ENTER_NOAPI_NOINIT_NOERR
+ FUNC_ENTER_STATIC_NOERR
/* Set the VFL feature flags that this driver supports */
if (flags) {
@@ -916,13 +927,13 @@ H5FD_log_query(const H5FD_t *_file, unsigned long *flags /* out */)
if (file && file->fam_to_single)
*flags |= H5FD_FEAT_IGNORE_DRVRINFO; /* Ignore the driver info when file is opened (which
eliminates it) */
- } /* end if */
+ }
FUNC_LEAVE_NOAPI(SUCCEED)
-} /* end H5FD_log_query() */
+} /* end H5FD__log_query() */
/*-------------------------------------------------------------------------
- * Function: H5FD_log_alloc
+ * Function: H5FD__log_alloc
*
* Purpose: Allocate file memory.
*
@@ -935,13 +946,13 @@ H5FD_log_query(const H5FD_t *_file, unsigned long *flags /* out */)
*-------------------------------------------------------------------------
*/
static haddr_t
-H5FD_log_alloc(H5FD_t *_file, H5FD_mem_t type, hid_t H5_ATTR_UNUSED dxpl_id, hsize_t size)
+H5FD__log_alloc(H5FD_t *_file, H5FD_mem_t type, hid_t H5_ATTR_UNUSED dxpl_id, hsize_t size)
{
H5FD_log_t *file = (H5FD_log_t *)_file;
haddr_t addr;
haddr_t ret_value = HADDR_UNDEF; /* Return value */
- FUNC_ENTER_NOAPI_NOINIT_NOERR
+ FUNC_ENTER_STATIC_NOERR
/* Compute the address for the block to allocate */
addr = file->eoa;
@@ -955,18 +966,19 @@ H5FD_log_alloc(H5FD_t *_file, H5FD_mem_t type, hid_t H5_ATTR_UNUSED dxpl_id, hsi
HDassert(addr < file->iosize);
H5_CHECK_OVERFLOW(size, hsize_t, size_t);
HDmemset(&file->flavor[addr], (int)type, (size_t)size);
- } /* end if */
+ }
if (file->fa.flags & H5FD_LOG_ALLOC)
- HDfprintf(file->logfp, "%10a-%10a (%10Hu bytes) (%s) Allocated\n", addr, (addr + size) - 1, size,
- flavors[type]);
- } /* end if */
+ HDfprintf(file->logfp,
+ "%10" PRIuHADDR "-%10" PRIuHADDR " (%10" PRIuHSIZE " bytes) (%s) Allocated\n", addr,
+ (haddr_t)((addr + size) - 1), size, flavors[type]);
+ }
/* Set return value */
ret_value = addr;
FUNC_LEAVE_NOAPI(ret_value)
-} /* end H5FD_log_alloc() */
+} /* end H5FD__log_alloc() */
/*-------------------------------------------------------------------------
* Function: H5FD__log_free
@@ -993,19 +1005,19 @@ H5FD__log_free(H5FD_t *_file, H5FD_mem_t type, hid_t H5_ATTR_UNUSED dxpl_id, had
HDassert(addr < file->iosize);
H5_CHECK_OVERFLOW(size, hsize_t, size_t);
HDmemset(&file->flavor[addr], H5FD_MEM_DEFAULT, (size_t)size);
- } /* end if */
+ }
/* Log the file memory freed */
if (file->fa.flags & H5FD_LOG_FREE)
- HDfprintf(file->logfp, "%10a-%10a (%10Hu bytes) (%s) Freed\n", addr, (addr + size) - 1, size,
- flavors[type]);
- } /* end if */
+ HDfprintf(file->logfp, "%10" PRIuHADDR "-%10" PRIuHADDR " (%10" PRIuHSIZE " bytes) (%s) Freed\n",
+ addr, (haddr_t)((addr + size) - 1), size, flavors[type]);
+ }
FUNC_LEAVE_NOAPI(SUCCEED)
} /* end H5FD__log_free() */
/*-------------------------------------------------------------------------
- * Function: H5FD_log_get_eoa
+ * Function: H5FD__log_get_eoa
*
* Purpose: Gets the end-of-address marker for the file. The EOA marker
* is the first address past the last byte allocated in the
@@ -1020,17 +1032,17 @@ H5FD__log_free(H5FD_t *_file, H5FD_mem_t type, hid_t H5_ATTR_UNUSED dxpl_id, had
*-------------------------------------------------------------------------
*/
static haddr_t
-H5FD_log_get_eoa(const H5FD_t *_file, H5FD_mem_t H5_ATTR_UNUSED type)
+H5FD__log_get_eoa(const H5FD_t *_file, H5FD_mem_t H5_ATTR_UNUSED type)
{
const H5FD_log_t *file = (const H5FD_log_t *)_file;
- FUNC_ENTER_NOAPI_NOINIT_NOERR
+ FUNC_ENTER_STATIC_NOERR
FUNC_LEAVE_NOAPI(file->eoa)
-} /* end H5FD_log_get_eoa() */
+} /* end H5FD__log_get_eoa() */
/*-------------------------------------------------------------------------
- * Function: H5FD_log_set_eoa
+ * Function: H5FD__log_set_eoa
*
* Purpose: Set the end-of-address marker for the file. This function is
* called shortly after an existing HDF5 file is opened in order
@@ -1044,11 +1056,11 @@ H5FD_log_get_eoa(const H5FD_t *_file, H5FD_mem_t H5_ATTR_UNUSED type)
*-------------------------------------------------------------------------
*/
static herr_t
-H5FD_log_set_eoa(H5FD_t *_file, H5FD_mem_t type, haddr_t addr)
+H5FD__log_set_eoa(H5FD_t *_file, H5FD_mem_t type, haddr_t addr)
{
H5FD_log_t *file = (H5FD_log_t *)_file;
- FUNC_ENTER_NOAPI_NOINIT_NOERR
+ FUNC_ENTER_STATIC_NOERR
if (file->fa.flags != 0) {
/* Check for increasing file size */
@@ -1060,13 +1072,14 @@ H5FD_log_set_eoa(H5FD_t *_file, H5FD_mem_t type, haddr_t addr)
HDassert(addr < file->iosize);
H5_CHECK_OVERFLOW(size, hsize_t, size_t);
HDmemset(&file->flavor[file->eoa], (int)type, (size_t)size);
- } /* end if */
+ }
/* Log the extension like an allocation */
if (file->fa.flags & H5FD_LOG_ALLOC)
- HDfprintf(file->logfp, "%10a-%10a (%10Hu bytes) (%s) Allocated\n", file->eoa, addr, size,
- flavors[type]);
- } /* end if */
+ HDfprintf(file->logfp,
+ "%10" PRIuHADDR "-%10" PRIuHADDR " (%10" PRIuHSIZE " bytes) (%s) Allocated\n",
+ file->eoa, addr, size, flavors[type]);
+ }
/* Check for decreasing file size */
if (H5F_addr_lt(addr, file->eoa) && H5F_addr_gt(addr, 0)) {
@@ -1077,22 +1090,23 @@ H5FD_log_set_eoa(H5FD_t *_file, H5FD_mem_t type, haddr_t addr)
HDassert((addr + size) < file->iosize);
H5_CHECK_OVERFLOW(size, hsize_t, size_t);
HDmemset(&file->flavor[addr], H5FD_MEM_DEFAULT, (size_t)size);
- } /* end if */
+ }
/* Log the shrink like a free */
if (file->fa.flags & H5FD_LOG_FREE)
- HDfprintf(file->logfp, "%10a-%10a (%10Hu bytes) (%s) Freed\n", file->eoa, addr, size,
- flavors[type]);
- } /* end if */
- } /* end if */
+ HDfprintf(file->logfp,
+ "%10" PRIuHADDR "-%10" PRIuHADDR " (%10" PRIuHSIZE " bytes) (%s) Freed\n",
+ file->eoa, addr, size, flavors[type]);
+ }
+ }
file->eoa = addr;
FUNC_LEAVE_NOAPI(SUCCEED)
-} /* end H5FD_log_set_eoa() */
+} /* end H5FD__log_set_eoa() */
/*-------------------------------------------------------------------------
- * Function: H5FD_log_get_eof
+ * Function: H5FD__log_get_eof
*
* Purpose: Returns the end-of-file marker, which is the greater of
* either the filesystem end-of-file or the HDF5 end-of-address
@@ -1109,17 +1123,17 @@ H5FD_log_set_eoa(H5FD_t *_file, H5FD_mem_t type, haddr_t addr)
*-------------------------------------------------------------------------
*/
static haddr_t
-H5FD_log_get_eof(const H5FD_t *_file, H5FD_mem_t H5_ATTR_UNUSED type)
+H5FD__log_get_eof(const H5FD_t *_file, H5FD_mem_t H5_ATTR_UNUSED type)
{
const H5FD_log_t *file = (const H5FD_log_t *)_file;
- FUNC_ENTER_NOAPI_NOINIT_NOERR
+ FUNC_ENTER_STATIC_NOERR
FUNC_LEAVE_NOAPI(file->eof)
-} /* end H5FD_log_get_eof() */
+} /* end H5FD__log_get_eof() */
/*-------------------------------------------------------------------------
- * Function: H5FD_log_get_handle
+ * Function: H5FD__log_get_handle
*
* Purpose: Returns the file handle of LOG file driver.
*
@@ -1131,12 +1145,12 @@ H5FD_log_get_eof(const H5FD_t *_file, H5FD_mem_t H5_ATTR_UNUSED type)
*-------------------------------------------------------------------------
*/
static herr_t
-H5FD_log_get_handle(H5FD_t *_file, hid_t H5_ATTR_UNUSED fapl, void **file_handle)
+H5FD__log_get_handle(H5FD_t *_file, hid_t H5_ATTR_UNUSED fapl, void **file_handle)
{
H5FD_log_t *file = (H5FD_log_t *)_file;
herr_t ret_value = SUCCEED;
- FUNC_ENTER_NOAPI_NOINIT
+ FUNC_ENTER_STATIC
if (!file_handle)
HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "file handle not valid")
@@ -1145,10 +1159,10 @@ H5FD_log_get_handle(H5FD_t *_file, hid_t H5_ATTR_UNUSED fapl, void **file_handle
done:
FUNC_LEAVE_NOAPI(ret_value)
-} /* end H5FD_log_get_handle() */
+} /* end H5FD__log_get_handle() */
/*-------------------------------------------------------------------------
- * Function: H5FD_log_read
+ * Function: H5FD__log_read
*
* Purpose: Reads SIZE bytes of data from FILE beginning at address ADDR
* into buffer BUF according to data transfer properties in
@@ -1164,26 +1178,25 @@ done:
*-------------------------------------------------------------------------
*/
static herr_t
-H5FD_log_read(H5FD_t *_file, H5FD_mem_t type, hid_t H5_ATTR_UNUSED dxpl_id, haddr_t addr, size_t size,
- void *buf /*out*/)
+H5FD__log_read(H5FD_t *_file, H5FD_mem_t type, hid_t H5_ATTR_UNUSED dxpl_id, haddr_t addr, size_t size,
+ void *buf /*out*/)
{
H5FD_log_t * file = (H5FD_log_t *)_file;
size_t orig_size = size; /* Save the original size for later */
haddr_t orig_addr = addr;
H5_timer_t read_timer; /* Timer for read operation */
H5_timevals_t read_times; /* Elapsed time for read operation */
-#ifndef H5_HAVE_PREADWRITE
- H5_timer_t seek_timer; /* Timer for seek operation */
- H5_timevals_t seek_times; /* Elapsed time for seek operation */
-#endif /* H5_HAVE_PREADWRITE */
- HDoff_t offset = (HDoff_t)addr;
- herr_t ret_value = SUCCEED; /* Return value */
+ HDoff_t offset = (HDoff_t)addr;
+ herr_t ret_value = SUCCEED; /* Return value */
- FUNC_ENTER_NOAPI_NOINIT
+ FUNC_ENTER_STATIC
HDassert(file && file->pub.cls);
HDassert(buf);
+ /* Initialize timer */
+ H5_timer_init(&read_timer);
+
/* Check for overflow conditions */
if (!H5F_addr_defined(addr))
HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "addr undefined, addr = %llu", (unsigned long long)addr)
@@ -1200,17 +1213,22 @@ H5FD_log_read(H5FD_t *_file, H5FD_mem_t type, hid_t H5_ATTR_UNUSED dxpl_id, hadd
HDassert((addr + size) < file->iosize);
while (tmp_size-- > 0)
file->nread[tmp_addr++]++;
- } /* end if */
- } /* end if */
+ }
+ }
#ifndef H5_HAVE_PREADWRITE
/* Seek to the correct location (if we don't have pread) */
if (addr != file->pos || OP_READ != file->op) {
+
+ H5_timer_t seek_timer; /* Timer for seek operation */
+ H5_timevals_t seek_times; /* Elapsed time for seek operation */
+
+ /* Initialize timer */
+ H5_timer_init(&seek_timer);
+
/* Start timer for seek() call */
- if (file->fa.flags & H5FD_LOG_TIME_SEEK) {
- H5_timer_init(&seek_timer);
+ if (file->fa.flags & H5FD_LOG_TIME_SEEK)
H5_timer_start(&seek_timer);
- } /* end if */
if (HDlseek(file->fd, (HDoff_t)addr, SEEK_SET) < 0)
HSYS_GOTO_ERROR(H5E_IO, H5E_SEEKERROR, FAIL, "unable to seek to proper position")
@@ -1227,11 +1245,11 @@ H5FD_log_read(H5FD_t *_file, H5FD_mem_t type, hid_t H5_ATTR_UNUSED dxpl_id, hadd
if (file->fa.flags & H5FD_LOG_TIME_SEEK) {
H5_timer_get_times(seek_timer, &seek_times);
file->total_seek_time += seek_times.elapsed;
- } /* end if */
+ }
/* Emit log string if we're tracking individual seek events. */
if (file->fa.flags & H5FD_LOG_LOC_SEEK) {
- HDfprintf(file->logfp, "Seek: From %10a To %10a", file->pos, addr);
+ HDfprintf(file->logfp, "Seek: From %10" PRIuHADDR " To %10" PRIuHADDR, file->pos, addr);
/* Add the seek time, if we're tracking that.
* Note that the seek time is NOT emitted for when just H5FD_LOG_TIME_SEEK
@@ -1241,15 +1259,13 @@ H5FD_log_read(H5FD_t *_file, H5FD_mem_t type, hid_t H5_ATTR_UNUSED dxpl_id, hadd
HDfprintf(file->logfp, " (%fs @ %f)\n", seek_times.elapsed, seek_timer.initial.elapsed);
else
HDfprintf(file->logfp, "\n");
- } /* end if */
- } /* end if */
-#endif /* H5_HAVE_PREADWRITE */
+ }
+ }
+#endif /* H5_HAVE_PREADWRITE */
/* Start timer for read operation */
- if (file->fa.flags & H5FD_LOG_TIME_READ) {
- H5_timer_init(&read_timer);
+ if (file->fa.flags & H5FD_LOG_TIME_READ)
H5_timer_start(&read_timer);
- } /* end if */
/*
* Read data, being careful of interrupted system calls, partial results,
@@ -1284,8 +1300,8 @@ H5FD_log_read(H5FD_t *_file, H5FD_mem_t type, hid_t H5_ATTR_UNUSED dxpl_id, hadd
offset = HDlseek(file->fd, (HDoff_t)0, SEEK_CUR);
if (file->fa.flags & H5FD_LOG_LOC_READ)
- HDfprintf(file->logfp, "Error! Reading: %10a-%10a (%10Zu bytes)\n", orig_addr,
- (orig_addr + orig_size) - 1, orig_size);
+ HDfprintf(file->logfp, "Error! Reading: %10" PRIuHADDR "-%10" PRIuHADDR " (%10zu bytes)\n",
+ orig_addr, (orig_addr + orig_size) - 1, orig_size);
HGOTO_ERROR(H5E_IO, H5E_READERROR, FAIL,
"file read failed: time = %s, filename = '%s', file descriptor = %d, errno = %d, "
@@ -1294,13 +1310,13 @@ H5FD_log_read(H5FD_t *_file, H5FD_mem_t type, hid_t H5_ATTR_UNUSED dxpl_id, hadd
HDctime(&mytime), file->filename, file->fd, myerrno, HDstrerror(myerrno), buf,
(unsigned long long)size, (unsigned long long)bytes_in,
(unsigned long long)bytes_read, (unsigned long long)offset);
- } /* end if */
+ }
if (0 == bytes_read) {
- /* end of file but not end of format address space */
+ /* End of file but not end of format address space */
HDmemset(buf, 0, size);
break;
- } /* end if */
+ }
HDassert(bytes_read >= 0);
HDassert((size_t)bytes_read <= size);
@@ -1308,8 +1324,7 @@ H5FD_log_read(H5FD_t *_file, H5FD_mem_t type, hid_t H5_ATTR_UNUSED dxpl_id, hadd
size -= (size_t)bytes_read;
addr += (haddr_t)bytes_read;
buf = (char *)buf + bytes_read;
-
- } /* end while */
+ }
/* Stop timer for read operation */
if (file->fa.flags & H5FD_LOG_TIME_READ)
@@ -1323,12 +1338,12 @@ H5FD_log_read(H5FD_t *_file, H5FD_mem_t type, hid_t H5_ATTR_UNUSED dxpl_id, hadd
if (file->fa.flags & H5FD_LOG_TIME_READ) {
H5_timer_get_times(read_timer, &read_times);
file->total_read_time += read_times.elapsed;
- } /* end if */
+ }
/* Log information about the read */
if (file->fa.flags & H5FD_LOG_LOC_READ) {
- HDfprintf(file->logfp, "%10a-%10a (%10Zu bytes) (%s) Read", orig_addr, (orig_addr + orig_size) - 1,
- orig_size, flavors[type]);
+ HDfprintf(file->logfp, "%10" PRIuHADDR "-%10" PRIuHADDR " (%10zu bytes) (%s) Read", orig_addr,
+ (orig_addr + orig_size) - 1, orig_size, flavors[type]);
/* Verify that we are reading in the type of data we allocated in this location */
if (file->flavor) {
@@ -1337,7 +1352,7 @@ H5FD_log_read(H5FD_t *_file, H5FD_mem_t type, hid_t H5_ATTR_UNUSED dxpl_id, hadd
HDassert(type == H5FD_MEM_DEFAULT ||
type == (H5FD_mem_t)file->flavor[(orig_addr + orig_size) - 1] ||
(H5FD_mem_t)file->flavor[(orig_addr + orig_size) - 1] == H5FD_MEM_DEFAULT);
- } /* end if */
+ }
/* Add the read time, if we're tracking that.
* Note that the read time is NOT emitted for when just H5FD_LOG_TIME_READ
@@ -1347,7 +1362,7 @@ H5FD_log_read(H5FD_t *_file, H5FD_mem_t type, hid_t H5_ATTR_UNUSED dxpl_id, hadd
HDfprintf(file->logfp, " (%fs @ %f)\n", read_times.elapsed, read_timer.initial.elapsed);
else
HDfprintf(file->logfp, "\n");
- } /* end if */
+ }
/* Update current position */
file->pos = addr;
@@ -1358,13 +1373,13 @@ done:
/* Reset last file I/O information */
file->pos = HADDR_UNDEF;
file->op = OP_UNKNOWN;
- } /* end if */
+ }
FUNC_LEAVE_NOAPI(ret_value)
-} /* end H5FD_log_read() */
+} /* end H5FD__log_read() */
/*-------------------------------------------------------------------------
- * Function: H5FD_log_write
+ * Function: H5FD__log_write
*
* Purpose: Writes SIZE bytes of data to FILE beginning at address ADDR
* from buffer BUF according to data transfer properties in
@@ -1378,34 +1393,33 @@ done:
*-------------------------------------------------------------------------
*/
static herr_t
-H5FD_log_write(H5FD_t *_file, H5FD_mem_t type, hid_t H5_ATTR_UNUSED dxpl_id, haddr_t addr, size_t size,
- const void *buf)
+H5FD__log_write(H5FD_t *_file, H5FD_mem_t type, hid_t H5_ATTR_UNUSED dxpl_id, haddr_t addr, size_t size,
+ const void *buf)
{
H5FD_log_t * file = (H5FD_log_t *)_file;
size_t orig_size = size; /* Save the original size for later */
haddr_t orig_addr = addr;
H5_timer_t write_timer; /* Timer for write operation */
H5_timevals_t write_times; /* Elapsed time for write operation */
-#ifndef H5_HAVE_PREADWRITE
- H5_timer_t seek_timer; /* Timer for seek operation */
- H5_timevals_t seek_times; /* Elapsed time for seek operation */
-#endif /* H5_HAVE_PREADWRITE */
- HDoff_t offset = (HDoff_t)addr;
- herr_t ret_value = SUCCEED; /* Return value */
+ HDoff_t offset = (HDoff_t)addr;
+ herr_t ret_value = SUCCEED; /* Return value */
- FUNC_ENTER_NOAPI_NOINIT
+ FUNC_ENTER_STATIC
HDassert(file && file->pub.cls);
HDassert(size > 0);
HDassert(buf);
+ /* Initialize timer */
+ H5_timer_init(&write_timer);
+
/* Verify that we are writing out the type of data we allocated in this location */
if (file->flavor) {
HDassert(type == H5FD_MEM_DEFAULT || type == (H5FD_mem_t)file->flavor[addr] ||
(H5FD_mem_t)file->flavor[addr] == H5FD_MEM_DEFAULT);
HDassert(type == H5FD_MEM_DEFAULT || type == (H5FD_mem_t)file->flavor[(addr + size) - 1] ||
(H5FD_mem_t)file->flavor[(addr + size) - 1] == H5FD_MEM_DEFAULT);
- } /* end if */
+ }
/* Check for overflow conditions */
if (!H5F_addr_defined(addr))
@@ -1423,16 +1437,21 @@ H5FD_log_write(H5FD_t *_file, H5FD_mem_t type, hid_t H5_ATTR_UNUSED dxpl_id, had
HDassert((addr + size) < file->iosize);
while (tmp_size-- > 0)
file->nwrite[tmp_addr++]++;
- } /* end if */
+ }
#ifndef H5_HAVE_PREADWRITE
/* Seek to the correct location (if we don't have pwrite) */
if (addr != file->pos || OP_WRITE != file->op) {
+
+ H5_timer_t seek_timer; /* Timer for seek operation */
+ H5_timevals_t seek_times; /* Elapsed time for seek operation */
+
+ /* Initialize timer */
+ H5_timer_init(&seek_timer);
+
/* Start timer for seek() call */
- if (file->fa.flags & H5FD_LOG_TIME_SEEK) {
- H5_timer_init(&seek_timer);
+ if (file->fa.flags & H5FD_LOG_TIME_SEEK)
H5_timer_start(&seek_timer);
- } /* end if */
if (HDlseek(file->fd, (HDoff_t)addr, SEEK_SET) < 0)
HSYS_GOTO_ERROR(H5E_IO, H5E_SEEKERROR, FAIL, "unable to seek to proper position")
@@ -1449,11 +1468,11 @@ H5FD_log_write(H5FD_t *_file, H5FD_mem_t type, hid_t H5_ATTR_UNUSED dxpl_id, had
if (file->fa.flags & H5FD_LOG_TIME_SEEK) {
H5_timer_get_times(seek_timer, &seek_times);
file->total_seek_time += seek_times.elapsed;
- } /* end if */
+ }
/* Emit log string if we're tracking individual seek events. */
if (file->fa.flags & H5FD_LOG_LOC_SEEK) {
- HDfprintf(file->logfp, "Seek: From %10a To %10a", file->pos, addr);
+ HDfprintf(file->logfp, "Seek: From %10" PRIuHADDR " To %10" PRIuHADDR, file->pos, addr);
/* Add the seek time, if we're tracking that.
* Note that the seek time is NOT emitted for when just H5FD_LOG_TIME_SEEK
@@ -1463,15 +1482,13 @@ H5FD_log_write(H5FD_t *_file, H5FD_mem_t type, hid_t H5_ATTR_UNUSED dxpl_id, had
HDfprintf(file->logfp, " (%fs @ %f)\n", seek_times.elapsed, seek_timer.initial.elapsed);
else
HDfprintf(file->logfp, "\n");
- } /* end if */
- } /* end if */
-#endif /* H5_HAVE_PREADWRITE */
+ }
+ }
+#endif /* H5_HAVE_PREADWRITE */
/* Start timer for write operation */
- if (file->fa.flags & H5FD_LOG_TIME_WRITE) {
- H5_timer_init(&write_timer);
+ if (file->fa.flags & H5FD_LOG_TIME_WRITE)
H5_timer_start(&write_timer);
- } /* end if */
/*
* Write the data, being careful of interrupted system calls and partial
@@ -1506,8 +1523,8 @@ H5FD_log_write(H5FD_t *_file, H5FD_mem_t type, hid_t H5_ATTR_UNUSED dxpl_id, had
offset = HDlseek(file->fd, (HDoff_t)0, SEEK_CUR);
if (file->fa.flags & H5FD_LOG_LOC_WRITE)
- HDfprintf(file->logfp, "Error! Writing: %10a-%10a (%10Zu bytes)\n", orig_addr,
- (orig_addr + orig_size) - 1, orig_size);
+ HDfprintf(file->logfp, "Error! Writing: %10" PRIuHADDR "-%10" PRIuHADDR " (%10zu bytes)\n",
+ orig_addr, (orig_addr + orig_size) - 1, orig_size);
HGOTO_ERROR(H5E_IO, H5E_WRITEERROR, FAIL,
"file write failed: time = %s, filename = '%s', file descriptor = %d, errno = %d, "
@@ -1538,12 +1555,12 @@ H5FD_log_write(H5FD_t *_file, H5FD_mem_t type, hid_t H5_ATTR_UNUSED dxpl_id, had
if (file->fa.flags & H5FD_LOG_TIME_WRITE) {
H5_timer_get_times(write_timer, &write_times);
file->total_write_time += write_times.elapsed;
- } /* end if */
+ }
/* Log information about the write */
if (file->fa.flags & H5FD_LOG_LOC_WRITE) {
- HDfprintf(file->logfp, "%10a-%10a (%10Zu bytes) (%s) Written", orig_addr, (orig_addr + orig_size) - 1,
- orig_size, flavors[type]);
+ HDfprintf(file->logfp, "%10" PRIuHADDR "-%10" PRIuHADDR " (%10zu bytes) (%s) Written", orig_addr,
+ (orig_addr + orig_size) - 1, orig_size, flavors[type]);
/* Check if this is the first write into a "default" section, grabbed by the metadata agregation
* algorithm */
@@ -1551,8 +1568,8 @@ H5FD_log_write(H5FD_t *_file, H5FD_mem_t type, hid_t H5_ATTR_UNUSED dxpl_id, had
if ((H5FD_mem_t)file->flavor[orig_addr] == H5FD_MEM_DEFAULT) {
HDmemset(&file->flavor[orig_addr], (int)type, orig_size);
HDfprintf(file->logfp, " (fresh)");
- } /* end if */
- } /* end if */
+ }
+ }
/* Add the write time, if we're tracking that.
* Note that the write time is NOT emitted for when just H5FD_LOG_TIME_WRITE
@@ -1562,7 +1579,7 @@ H5FD_log_write(H5FD_t *_file, H5FD_mem_t type, hid_t H5_ATTR_UNUSED dxpl_id, had
HDfprintf(file->logfp, " (%fs @ %f)\n", write_times.elapsed, write_timer.initial.elapsed);
else
HDfprintf(file->logfp, "\n");
- } /* end if */
+ }
/* Update current position and eof */
file->pos = addr;
@@ -1575,13 +1592,13 @@ done:
/* Reset last file I/O information */
file->pos = HADDR_UNDEF;
file->op = OP_UNKNOWN;
- } /* end if */
+ }
FUNC_LEAVE_NOAPI(ret_value)
-} /* end H5FD_log_write() */
+} /* end H5FD__log_write() */
/*-------------------------------------------------------------------------
- * Function: H5FD_log_truncate
+ * Function: H5FD__log_truncate
*
* Purpose: Makes sure that the true file size is the same (or larger)
* than the end-of-address.
@@ -1594,12 +1611,12 @@ done:
*-------------------------------------------------------------------------
*/
static herr_t
-H5FD_log_truncate(H5FD_t *_file, hid_t H5_ATTR_UNUSED dxpl_id, hbool_t H5_ATTR_UNUSED closing)
+H5FD__log_truncate(H5FD_t *_file, hid_t H5_ATTR_UNUSED dxpl_id, hbool_t H5_ATTR_UNUSED closing)
{
H5FD_log_t *file = (H5FD_log_t *)_file;
herr_t ret_value = SUCCEED; /* Return value */
- FUNC_ENTER_NOAPI_NOINIT
+ FUNC_ENTER_STATIC
HDassert(file);
@@ -1608,11 +1625,12 @@ H5FD_log_truncate(H5FD_t *_file, hid_t H5_ATTR_UNUSED dxpl_id, hbool_t H5_ATTR_U
H5_timer_t trunc_timer; /* Timer for truncate operation */
H5_timevals_t trunc_times; /* Elapsed time for truncate operation */
+ /* Initialize timer */
+ H5_timer_init(&trunc_timer);
+
/* Start timer for truncate operation */
- if (file->fa.flags & H5FD_LOG_TIME_TRUNCATE) {
- H5_timer_init(&trunc_timer);
+ if (file->fa.flags & H5FD_LOG_TIME_TRUNCATE)
H5_timer_start(&trunc_timer);
- } /* end if */
#ifdef H5_HAVE_WIN32_API
{
@@ -1636,7 +1654,7 @@ H5FD_log_truncate(H5FD_t *_file, hid_t H5_ATTR_UNUSED dxpl_id, hbool_t H5_ATTR_U
dwError = GetLastError();
if (dwError != NO_ERROR)
HGOTO_ERROR(H5E_FILE, H5E_FILEOPEN, FAIL, "unable to set file pointer")
- } /* end if */
+ }
if (0 == SetEndOfFile(file->hFile))
HGOTO_ERROR(H5E_IO, H5E_SEEKERROR, FAIL, "unable to extend file properly")
@@ -1659,11 +1677,11 @@ H5FD_log_truncate(H5FD_t *_file, hid_t H5_ATTR_UNUSED dxpl_id, hbool_t H5_ATTR_U
if (file->fa.flags & H5FD_LOG_TIME_TRUNCATE) {
H5_timer_get_times(trunc_timer, &trunc_times);
file->total_truncate_time += trunc_times.elapsed;
- } /* end if */
+ }
/* Emit log string if we're tracking individual truncate events. */
if (file->fa.flags & H5FD_LOG_TRUNCATE) {
- HDfprintf(file->logfp, "Truncate: To %10a", file->eoa);
+ HDfprintf(file->logfp, "Truncate: To %10" PRIuHADDR, file->eoa);
/* Add the truncate time, if we're tracking that.
* Note that the truncate time is NOT emitted for when just H5FD_LOG_TIME_TRUNCATE
@@ -1673,7 +1691,7 @@ H5FD_log_truncate(H5FD_t *_file, hid_t H5_ATTR_UNUSED dxpl_id, hbool_t H5_ATTR_U
HDfprintf(file->logfp, " (%fs @ %f)\n", trunc_times.elapsed, trunc_timer.initial.elapsed);
else
HDfprintf(file->logfp, "\n");
- } /* end if */
+ }
/* Update the eof value */
file->eof = file->eoa;
@@ -1685,10 +1703,10 @@ H5FD_log_truncate(H5FD_t *_file, hid_t H5_ATTR_UNUSED dxpl_id, hbool_t H5_ATTR_U
done:
FUNC_LEAVE_NOAPI(ret_value)
-} /* end H5FD_log_truncate() */
+} /* end H5FD__log_truncate() */
/*-------------------------------------------------------------------------
- * Function: H5FD_log_lock
+ * Function: H5FD__log_lock
*
* Purpose: Place a lock on the file
*
@@ -1700,13 +1718,13 @@ done:
*-------------------------------------------------------------------------
*/
static herr_t
-H5FD_log_lock(H5FD_t *_file, hbool_t rw)
+H5FD__log_lock(H5FD_t *_file, hbool_t rw)
{
H5FD_log_t *file = (H5FD_log_t *)_file; /* VFD file struct */
int lock_flags; /* file locking flags */
herr_t ret_value = SUCCEED; /* Return value */
- FUNC_ENTER_NOAPI_NOINIT
+ FUNC_ENTER_STATIC
/* Sanity check */
HDassert(file);
@@ -1728,10 +1746,10 @@ H5FD_log_lock(H5FD_t *_file, hbool_t rw)
done:
FUNC_LEAVE_NOAPI(ret_value)
-} /* end H5FD_log_lock() */
+} /* end H5FD__log_lock() */
/*-------------------------------------------------------------------------
- * Function: H5FD_log_unlock
+ * Function: H5FD__log_unlock
*
* Purpose: Remove the existing lock on the file
*
@@ -1742,12 +1760,12 @@ done:
*-------------------------------------------------------------------------
*/
static herr_t
-H5FD_log_unlock(H5FD_t *_file)
+H5FD__log_unlock(H5FD_t *_file)
{
H5FD_log_t *file = (H5FD_log_t *)_file; /* VFD file struct */
herr_t ret_value = SUCCEED; /* Return value */
- FUNC_ENTER_NOAPI_NOINIT
+ FUNC_ENTER_STATIC
HDassert(file);
@@ -1764,4 +1782,29 @@ H5FD_log_unlock(H5FD_t *_file)
done:
FUNC_LEAVE_NOAPI(ret_value)
-} /* end H5FD_log_unlock() */
+} /* end H5FD__log_unlock() */
+
+/*-------------------------------------------------------------------------
+ * Function: H5FD__log_delete
+ *
+ * Purpose: Delete a file
+ *
+ * Return: SUCCEED/FAIL
+ *
+ *-------------------------------------------------------------------------
+ */
+static herr_t
+H5FD__log_delete(const char *filename, hid_t H5_ATTR_UNUSED fapl_id)
+{
+ herr_t ret_value = SUCCEED; /* Return value */
+
+ FUNC_ENTER_STATIC
+
+ HDassert(filename);
+
+ if (HDremove(filename) < 0)
+ HSYS_GOTO_ERROR(H5E_VFL, H5E_CANTDELETEFILE, FAIL, "unable to delete file")
+
+done:
+ FUNC_LEAVE_NOAPI(ret_value)
+} /* end H5FD__log_delete() */
diff --git a/src/H5FDlog.h b/src/H5FDlog.h
index aa1f3cb..969c091 100644
--- a/src/H5FDlog.h
+++ b/src/H5FDlog.h
@@ -65,7 +65,410 @@
extern "C" {
#endif
-H5_DLL hid_t H5FD_log_init(void);
+H5_DLL hid_t H5FD_log_init(void);
+
+/**
+ * \ingroup FAPL
+ *
+ * \brief Sets up the logging virtual file driver (#H5FD_LOG) for use
+ *
+ * \fapl_id
+ * \param[in] logfile Name of the log file
+ * \param[in] flags Flags specifying the types of logging activity
+ * \param[in] buf_size The size of the logging buffers, in bytes (see description)
+ * \returns \herr_t
+ *
+ * \details H5Pset_fapl_log() modifies the file access property list to use the
+ * logging driver, #H5FD_LOG. The logging virtual file driver (VFD) is
+ * a clone of the standard SEC2 (#H5FD_SEC2) driver with additional
+ * facilities for logging VFD metrics and activity to a file.
+ *
+ * \p logfile is the name of the file in which the logging entries are
+ * to be recorded.
+ *
+ * The actions to be logged are specified in the parameter \p flags
+ * using the pre-defined constants described in the following
+ * table. Multiple flags can be set through the use of a logical \c OR
+ * contained in parentheses. For example, logging read and write
+ * locations would be specified as
+ * \Code{(H5FD_LOG_LOC_READ|H5FD_LOG_LOC_WRITE)}.
+ *
+ * <table>
+ * <caption>Table1: Logging Flags</caption>
+ * <tr>
+ * <td>
+ * #H5FD_LOG_LOC_READ
+ * </td>
+ * <td rowspan="3">
+ * Track the location and length of every read, write, or seek operation.
+ * </td>
+ * </tr>
+ * <tr><td>#H5FD_LOG_LOC_WRITE</td></tr>
+ * <tr><td>#H5FD_LOG_LOC_SEEK</td></tr>
+ * <tr>
+ * <td>
+ * #H5FD_LOG_LOC_IO
+ * </td>
+ * <td>
+ * Track all I/O locations and lengths. The logical equivalent of the following:
+ * \Code{(#H5FD_LOG_LOC_READ | #H5FD_LOG_LOC_WRITE | #H5FD_LOG_LOC_SEEK)}
+ * </td>
+ * </tr>
+ * <tr>
+ * <td>
+ * #H5FD_LOG_FILE_READ
+ * </td>
+ * <td rowspan="2">
+ * Track the number of times each byte is read or written.
+ * </td>
+ * </tr>
+ * <tr><td>#H5FD_LOG_FILE_WRITE</td></tr>
+ * <tr>
+ * <td>
+ * #H5FD_LOG_FILE_IO
+ * </td>
+ * <td>
+ * Track the number of times each byte is read and written. The logical
+ * equivalent of the following:
+ * \Code{(#H5FD_LOG_FILE_READ | #H5FD_LOG_FILE_WRITE)}
+ * </td>
+ * </tr>
+ * <tr>
+ * <td>
+ * #H5FD_LOG_FLAVOR
+ * </td>
+ * <td>
+ * Track the type, or flavor, of information stored at each byte.
+ * </td>
+ * </tr>
+ * <tr>
+ * <td>
+ * #H5FD_LOG_NUM_READ
+ * </td>
+ * <td rowspan="4">
+ * Track the total number of read, write, seek, or truncate operations that occur.
+ * </td>
+ * </tr>
+ * <tr><td>#H5FD_LOG_NUM_WRITE</td></tr>
+ * <tr><td>#H5FD_LOG_NUM_SEEK</td></tr>
+ * <tr><td>#H5FD_LOG_NUM_TRUNCATE</td></tr>
+ * <tr>
+ * <td>
+ * #H5FD_LOG_NUM_IO
+ * </td>
+ * <td>
+ * Track the total number of all types of I/O operations. The logical equivalent
+ * of the following:
+ * \Code{(#H5FD_LOG_NUM_READ | #H5FD_LOG_NUM_WRITE | #H5FD_LOG_NUM_SEEK | #H5FD_LOG_NUM_TRUNCATE)}
+ * </td>
+ * </tr>
+ * <tr>
+ * <td>
+ * #H5FD_LOG_TIME_OPEN
+ * </td>
+ * <td rowspan="6">
+ * Track the time spent in open, stat, read, write, seek, or close operations.
+ * </td>
+ * </tr>
+ * <tr><td>#H5FD_LOG_TIME_STAT</td></tr>
+ * <tr><td>#H5FD_LOG_TIME_READ</td></tr>
+ * <tr><td>#H5FD_LOG_TIME_WRITE</td></tr>
+ * <tr><td>#H5FD_LOG_TIME_SEEK</td></tr>
+ * <tr><td>#H5FD_LOG_TIME_CLOSE</td></tr>
+ * <tr>
+ * <td>
+ * #H5FD_LOG_TIME_IO
+ * </td>
+ * <td>
+ * Track the time spent in each of the above operations. The logical equivalent
+ * of the following:
+ * \Code{(#H5FD_LOG_TIME_OPEN | #H5FD_LOG_TIME_STAT | #H5FD_LOG_TIME_READ | #H5FD_LOG_TIME_WRITE |
+ * #H5FD_LOG_TIME_SEEK | #H5FD_LOG_TIME_CLOSE)}
+ * </td>
+ * </tr>
+ * <tr>
+ * <td>
+ * #H5FD_LOG_ALLOC
+ * </td>
+ * <td>
+ * Track the allocation of space in the file.
+ * </td>
+ * </tr>
+ * <tr>
+ * <td>
+ * #H5FD_LOG_ALL
+ * </td>
+ * <td>
+ * Track everything. The logical equivalent of the following:
+ * \Code{(#H5FD_LOG_ALLOC | #H5FD_LOG_TIME_IO | #H5FD_LOG_NUM_IO | #H5FD_LOG_FLAVOR | #H5FD_LOG_FILE_IO |
+ * #H5FD_LOG_LOC_IO)}
+ * </td>
+ * </tr>
+ * </table>
+ * The logging driver can track the number of times each byte in the file is
+ * read from or written to (using #H5FD_LOG_FILE_READ and #H5FD_LOG_FILE_WRITE)
+ * and what kind of data is at that location (e.g., metadata, raw data; using
+ * #H5FD_LOG_FLAVOR). This information is tracked in internal buffers of size
+ * buf_size, which must be at least the maximum size in bytes of the file to be
+ * logged while the log driver is in use.\n
+ * One buffer of size buf_size will be created for each of #H5FD_LOG_FILE_READ,
+ * #H5FD_LOG_FILE_WRITE and #H5FD_LOG_FLAVOR when those flags are set; these
+ * buffers will not grow as the file increases in size.
+ *
+ * \par Output:
+ * This section describes the logging driver (LOG VFD) output.\n
+ * The table, immediately below, describes output of the various logging driver
+ * flags and function calls. A list of valid flavor values, describing the type
+ * of data stored, follows the table.
+ * <table>
+ * <caption>Table2: Logging Output</caption>
+ * <tr>
+ * <th>Flag</th><th>VFD Call</th><th>Output and Comments</th>
+ * </th>
+ * </tr>
+ * <tr>
+ * <td>#H5FD_LOG_LOC_READ</td>
+ * <td>Read</td>
+ * <td>
+ * \Code{%10a-%10a (%10Zu bytes) (%s) Read}\n\n
+ * Start position\n
+ * End position\n
+ * Number of bytes\n
+ * Flavor of read\n\n
+ * Adds \Code{(\%f s)} and seek time if #H5FD_LOG_TIME_SEEK is also set.
+ * </td>
+ * </tr>
+ * <tr>
+ * <td>#H5FD_LOG_LOC_READ</td>
+ * <td>Read Error</td>
+ * <td>
+ * \Code{Error! Reading: %10a-%10a (%10Zu bytes)}\n\n
+ * Same parameters as non-error entry.
+ * </td>
+ * </tr>
+ * <tr>
+ * <td>#H5FD_LOG_LOC_WRITE</td>
+ * <td>Write</td>
+ * <td>
+ * \Code{%10a-%10a (%10Zu bytes) (%s) Written}\n\n
+ * Start position\n
+ * End position\n
+ * Number of bytes\n
+ * Flavor of write\n\n
+ * Adds \Code{(\%f s)} and seek time if #H5FD_LOG_TIME_SEEK is also set.
+ * </td>
+ * </tr>
+ * <tr>
+ * <td>#H5FD_LOG_LOC_WRITE</td>
+ * <td>Write Error</td>
+ * <td>
+ * \Code{Error! Writing: %10a-%10a (%10Zu bytes)}\n\n
+ * Same parameters as non-error entry.
+ * </td>
+ * </tr>
+ * <tr>
+ * <td>#H5FD_LOG_LOC_SEEK</td>
+ * <td>Read, Write</td>
+ * <td>
+ * \Code{Seek: From %10a-%10a}\n\n
+ * Start position\n
+ * End position\n\n
+ * Adds \Code{(\%f s)} and seek time if #H5FD_LOG_TIME_SEEK is also set.
+ * </td>
+ * </tr>
+ * <tr>
+ * <td>#H5FD_LOG_FILE_READ</td>
+ * <td>Close</td>
+ * <td>
+ * Begins with:\n
+ * Dumping read I/O information\n\n
+ * Then, for each range of identical values, there is this line:\n
+ * \Code{Addr %10-%10 (%10lu bytes) read from %3d times}\n\n
+ * Start address\n
+ * End address\n
+ * Number of bytes\n
+ * Number of times read\n\n
+ * Note: The data buffer is scanned and each range of identical values
+ * gets one entry in the log file to save space and make it easier to read.
+ * </td>
+ * </tr>
+ * <tr>
+ * <td>#H5FD_LOG_FILE_WRITE</td>
+ * <td>Close</td>
+ * <td>
+ * Begins with:\n
+ * Dumping read I/O information\n\n
+ * Then, for each range of identical values, there is this line:\n
+ * \Code{Addr %10-%10 (%10lu bytes) written to %3d times}\n\n
+ * Start address\n
+ * End address\n
+ * Number of bytes\n
+ * Number of times written\n\n
+ * Note: The data buffer is scanned and each range of identical values
+ * gets one entry in the log file to save space and make it easier to read.
+ * </td>
+ * </tr>
+ * <tr>
+ * <td>#H5FD_LOG_FLAVOR</td>
+ * <td>Close</td>
+ * <td>
+ * Begins with:\n
+ * Dumping I/O flavor information\n\n
+ * Then, for each range of identical values, there is this line:\n
+ * \Code{Addr %10-%10 (%10lu bytes) flavor is %s}\n\n
+ * Start address\n
+ * End address\n
+ * Number of bytes\n
+ * Flavor\n\n
+ * Note: The data buffer is scanned and each range of identical values
+ * gets one entry in the log file to save space and make it easier to read.
+ * </td>
+ * </tr>
+ * <tr>
+ * <td>#H5FD_LOG_NUM_READ</td>
+ * <td>Close</td>
+ * <td>
+ * Total number of read operations: \Code{%11u}
+ * </td>
+ * </tr>
+ * <tr>
+ * <td>#H5FD_LOG_NUM_WRITE</td>
+ * <td>Close</td>
+ * <td>
+ * Total number of write operations: \Code{%11u}
+ * </td>
+ * </tr>
+ * <tr>
+ * <td>#H5FD_LOG_NUM_SEEK</td>
+ * <td>Close</td>
+ * <td>
+ * Total number of seek operations: \Code{%11u}
+ * </td>
+ * </tr>
+ * <tr>
+ * <td>#H5FD_LOG_NUM_TRUNCATE</td>
+ * <td>Close</td>
+ * <td>
+ * Total number of truncate operations: \Code{%11u}
+ * </td>
+ * </tr>
+ * <tr>
+ * <td>#H5FD_LOG_TIME_OPEN</td>
+ * <td>Open</td>
+ * <td>
+ * Open took: \Code{(\%f s)}
+ * </td>
+ * </tr>
+ * <tr>
+ * <td>#H5FD_LOG_TIME_READ</td>
+ * <td>Close, Read</td>
+ * <td>
+ * Total time in read operations: \Code{\%f s}\n\n
+ * See also: #H5FD_LOG_LOC_READ
+ * </td>
+ * </tr>
+ * </tr>
+ * <tr>
+ * <td>#H5FD_LOG_TIME_WRITE</td>
+ * <td>Close, Write</td>
+ * <td>
+ * Total time in write operations: \Code{\%f s}\n\n
+ * See also: #H5FD_LOG_LOC_WRITE
+ * </td>
+ * </tr>
+ * <tr>
+ * <td>#H5FD_LOG_TIME_SEEK</td>
+ * <td>Close, Read, Write</td>
+ * <td>
+ * Total time in write operations: \Code{\%f s}\n\n
+ * See also: #H5FD_LOG_LOC_SEEK or #H5FD_LOG_LOC_WRITE
+ * </td>
+ * </tr>
+ * <tr>
+ * <td>#H5FD_LOG_TIME_CLOSE</td>
+ * <td>Close</td>
+ * <td>
+ * Close took: \Code{(\%f s)}
+ * </td>
+ * </tr>
+ * <tr>
+ * <td>#H5FD_LOG_TIME_STAT</td>
+ * <td>Open</td>
+ * <td>
+ * Stat took: \Code{(\%f s)}
+ * </td>
+ * </tr>
+ * <tr>
+ * <td>#H5FD_LOG_ALLOC</td>
+ * <td>Alloc</td>
+ * <td>
+ * \Code{%10-%10 (%10Hu bytes) (\%s) Allocated}\n\n
+ * Start of address space\n
+ * End of address space\n
+ * Total size allocation\n
+ * Flavor of allocation
+ * </td>
+ * </tr>
+ * </table>
+ *
+ * \par Flavors:
+ * The \Emph{flavor} describes the type of stored information. The following
+ * table lists the flavors that appear in log output and briefly describes each.
+ * These terms are provided here to aid in the construction of log message
+ * parsers; a full description is beyond the scope of this document.
+ * <table>
+ * <caption>Table3: Flavors of logged data</caption>
+ * <tr>
+ * <th>Flavor</th><th>Description</th>
+ * </th>
+ * </tr>
+ * <tr>
+ * <td>#H5FD_MEM_NOLIST</td>
+ * <td>Error value</td>
+ * </tr>
+ * <tr>
+ * <td>#H5FD_MEM_DEFAULT</td>
+ * <td>Value not yet set.\n
+ * May also be a datatype set in a larger allocation that will be
+ * suballocated by the library.</td>
+ * </tr>
+ * <tr>
+ * <td>#H5FD_MEM_SUPER</td>
+ * <td>Superblock data</td>
+ * </tr>
+ * <tr>
+ * <td>#H5FD_MEM_BTREE</td>
+ * <td>B-tree data</td>
+ * </tr>
+ * <tr>
+ * <td>#H5FD_MEM_DRAW</td>
+ * <td>Raw data (for example, contents of a dataset)</td>
+ * </tr>
+ * <tr>
+ * <td>#H5FD_MEM_GHEAP</td>
+ * <td>Global heap data</td>
+ * </tr>
+ * <tr>
+ * <td>#H5FD_MEM_LHEAP</td>
+ * <td>Local heap data</td>
+ * </tr>
+ * <tr>
+ * <td>#H5FD_MEM_OHDR</td>
+ * <td>Object header data</td>
+ * </tr>
+ * </table>
+ *
+ * \version 1.8.7 The flags parameter has been changed from \Code{unsigned int}
+ * to \Code{unsigned long long}.
+ * The implementation of the #H5FD_LOG_TIME_OPEN, #H5FD_LOG_TIME_READ,
+ * #H5FD_LOG_TIME_WRITE, and #H5FD_LOG_TIME_SEEK flags has been finished.
+ * New flags were added: #H5FD_LOG_NUM_TRUNCATE and #H5FD_LOG_TIME_STAT.
+ * \version 1.6.0 The \c verbosity parameter has been removed.
+ * Two new parameters have been added: \p flags of type \Code{unsigned} and
+ * \p buf_size of type \Code{size_t}.
+ * \since 1.4.0
+ *
+ */
H5_DLL herr_t H5Pset_fapl_log(hid_t fapl_id, const char *logfile, unsigned long long flags, size_t buf_size);
#ifdef __cplusplus
diff --git a/src/H5FDmirror.c b/src/H5FDmirror.c
index 2b4b158..3ea71ce 100644
--- a/src/H5FDmirror.c
+++ b/src/H5FDmirror.c
@@ -21,14 +21,15 @@
#ifdef H5_HAVE_MIRROR_VFD
-#include "H5Eprivate.h" /* Error handling */
-#include "H5Fprivate.h" /* File access */
-#include "H5FDprivate.h" /* File drivers */
-#include "H5FDmirror.h" /* "Mirror" definitions */
-#include "H5FLprivate.h" /* Free Lists */
-#include "H5Iprivate.h" /* IDs */
-#include "H5MMprivate.h" /* Memory management */
-#include "H5Pprivate.h" /* Property lists */
+#include "H5Eprivate.h" /* Error handling */
+#include "H5Fprivate.h" /* File access */
+#include "H5FDprivate.h" /* File drivers */
+#include "H5FDmirror.h" /* "Mirror" definitions */
+#include "H5FDmirror_priv.h" /* Private header for the mirror VFD */
+#include "H5FLprivate.h" /* Free Lists */
+#include "H5Iprivate.h" /* IDs */
+#include "H5MMprivate.h" /* Memory management */
+#include "H5Pprivate.h" /* Property lists */
/* The driver identification number, initialized at runtime */
static hid_t H5FD_MIRROR_g = 0;
@@ -131,72 +132,79 @@ typedef struct H5FD_mirror_t {
#define LOG_OP_CALL(name) \
do { \
HDprintf("called %s()\n", (name)); \
- fflush(stdout); \
+ HDfflush(stdout); \
} while (0)
#else
#define LOG_OP_CALL(name) /* no-op */
#endif /* MIRROR_DEBUG_OP_CALLS */
/* Prototypes */
-static herr_t H5FD_mirror_term(void);
-static void * H5FD_mirror_fapl_get(H5FD_t *_file);
-static void * H5FD_mirror_fapl_copy(const void *_old_fa);
-static herr_t H5FD_mirror_fapl_free(void *_fa);
-static haddr_t H5FD_mirror_get_eoa(const H5FD_t *_file, H5FD_mem_t type);
-static herr_t H5FD_mirror_set_eoa(H5FD_t *_file, H5FD_mem_t type, haddr_t addr);
-static haddr_t H5FD_mirror_get_eof(const H5FD_t *_file, H5FD_mem_t type);
-static H5FD_t *H5FD_mirror_open(const char *name, unsigned flags, hid_t fapl_id, haddr_t maxaddr);
-static herr_t H5FD_mirror_close(H5FD_t *_file);
-static herr_t H5FD_mirror_query(const H5FD_t *_file, unsigned long *flags);
-static herr_t H5FD_mirror_write(H5FD_t *_file, H5FD_mem_t type, hid_t fapl_id, haddr_t addr, size_t size,
- const void *buf);
-static herr_t H5FD_mirror_read(H5FD_t *_file, H5FD_mem_t type, hid_t fapl_id, haddr_t addr, size_t size,
- void *buf);
-static herr_t H5FD_mirror_truncate(H5FD_t *_file, hid_t dxpl_id, hbool_t closing);
-static herr_t H5FD_mirror_lock(H5FD_t *_file, hbool_t rw);
-static herr_t H5FD_mirror_unlock(H5FD_t *_file);
+static herr_t H5FD__mirror_term(void);
+static void * H5FD__mirror_fapl_get(H5FD_t *_file);
+static void * H5FD__mirror_fapl_copy(const void *_old_fa);
+static herr_t H5FD__mirror_fapl_free(void *_fa);
+static haddr_t H5FD__mirror_get_eoa(const H5FD_t *_file, H5FD_mem_t type);
+static herr_t H5FD__mirror_set_eoa(H5FD_t *_file, H5FD_mem_t type, haddr_t addr);
+static haddr_t H5FD__mirror_get_eof(const H5FD_t *_file, H5FD_mem_t type);
+static H5FD_t *H5FD__mirror_open(const char *name, unsigned flags, hid_t fapl_id, haddr_t maxaddr);
+static herr_t H5FD__mirror_close(H5FD_t *_file);
+static herr_t H5FD__mirror_query(const H5FD_t *_file, unsigned long *flags);
+static herr_t H5FD__mirror_write(H5FD_t *_file, H5FD_mem_t type, hid_t fapl_id, haddr_t addr, size_t size,
+ const void *buf);
+static herr_t H5FD__mirror_read(H5FD_t *_file, H5FD_mem_t type, hid_t fapl_id, haddr_t addr, size_t size,
+ void *buf);
+static herr_t H5FD__mirror_truncate(H5FD_t *_file, hid_t dxpl_id, hbool_t closing);
+static herr_t H5FD__mirror_lock(H5FD_t *_file, hbool_t rw);
+static herr_t H5FD__mirror_unlock(H5FD_t *_file);
static herr_t H5FD__mirror_verify_reply(H5FD_mirror_t *file);
static const H5FD_class_t H5FD_mirror_g = {
- "mirror", /* name */
- MAXADDR, /* maxaddr */
- H5F_CLOSE_WEAK, /* fc_degree */
- H5FD_mirror_term, /* terminate */
- NULL, /* sb_size */
- NULL, /* sb_encode */
- NULL, /* sb_decode */
- 0, /* fapl_size */
- H5FD_mirror_fapl_get, /* fapl_get */
- H5FD_mirror_fapl_copy, /* fapl_copy */
- H5FD_mirror_fapl_free, /* fapl_free */
- 0, /* dxpl_size */
- NULL, /* dxpl_copy */
- NULL, /* dxpl_free */
- H5FD_mirror_open, /* open */
- H5FD_mirror_close, /* close */
- NULL, /* cmp */
- H5FD_mirror_query, /* query */
- NULL, /* get_type_map */
- NULL, /* alloc */
- NULL, /* free */
- H5FD_mirror_get_eoa, /* get_eoa */
- H5FD_mirror_set_eoa, /* set_eoa */
- H5FD_mirror_get_eof, /* get_eof */
- NULL, /* get_handle */
- H5FD_mirror_read, /* read */
- H5FD_mirror_write, /* write */
- NULL, /* flush */
- H5FD_mirror_truncate, /* truncate */
- H5FD_mirror_lock, /* lock */
- H5FD_mirror_unlock, /* unlock */
- NULL, /* dedup */
- H5FD_FLMAP_DICHOTOMY /* fl_map */
+ "mirror", /* name */
+ MAXADDR, /* maxaddr */
+ H5F_CLOSE_WEAK, /* fc_degree */
+ H5FD__mirror_term, /* terminate */
+ NULL, /* sb_size */
+ NULL, /* sb_encode */
+ NULL, /* sb_decode */
+ 0, /* fapl_size */
+ H5FD__mirror_fapl_get, /* fapl_get */
+ H5FD__mirror_fapl_copy, /* fapl_copy */
+ H5FD__mirror_fapl_free, /* fapl_free */
+ 0, /* dxpl_size */
+ NULL, /* dxpl_copy */
+ NULL, /* dxpl_free */
+ H5FD__mirror_open, /* open */
+ H5FD__mirror_close, /* close */
+ NULL, /* cmp */
+ H5FD__mirror_query, /* query */
+ NULL, /* get_type_map */
+ NULL, /* alloc */
+ NULL, /* free */
+ H5FD__mirror_get_eoa, /* get_eoa */
+ H5FD__mirror_set_eoa, /* set_eoa */
+ H5FD__mirror_get_eof, /* get_eof */
+ NULL, /* get_handle */
+ H5FD__mirror_read, /* read */
+ H5FD__mirror_write, /* write */
+ NULL, /* flush */
+ H5FD__mirror_truncate, /* truncate */
+ H5FD__mirror_lock, /* lock */
+ H5FD__mirror_unlock, /* unlock */
+ NULL, /* del */
+ NULL, /* dedup */
+ H5FD_FLMAP_DICHOTOMY /* fl_map */
};
+/* Declare a free list to manage the transmission buffers */
+H5FL_BLK_DEFINE_STATIC(xmit);
+
/* Declare a free list to manage the H5FD_mirror_t struct */
H5FL_DEFINE_STATIC(H5FD_mirror_t);
+/* Declare a free list to manage the H5FD_mirror_xmit_open_t struct */
+H5FL_DEFINE_STATIC(H5FD_mirror_xmit_open_t);
+
/*-------------------------------------------------------------------------
* Function: H5FD__init_package
*
@@ -212,11 +220,10 @@ H5FD__init_package(void)
FUNC_ENTER_STATIC
- LOG_OP_CALL("H5FD__init_package");
+ LOG_OP_CALL(FUNC);
- if (H5FD_mirror_init() < 0) {
+ if (H5FD_mirror_init() < 0)
HGOTO_ERROR(H5E_VFL, H5E_CANTINIT, FAIL, "unable to initialize mirror VFD");
- }
done:
FUNC_LEAVE_NOAPI(ret_value)
@@ -237,13 +244,12 @@ H5FD_mirror_init(void)
{
hid_t ret_value = H5I_INVALID_HID;
- FUNC_ENTER_NOAPI(FAIL)
+ FUNC_ENTER_NOAPI(H5I_INVALID_HID)
- LOG_OP_CALL("H5FD_mirror_init");
+ LOG_OP_CALL(FUNC);
- if (H5I_VFL != H5I_get_type(H5FD_MIRROR_g)) {
+ if (H5I_VFL != H5I_get_type(H5FD_MIRROR_g))
H5FD_MIRROR_g = H5FD_register(&H5FD_mirror_g, sizeof(H5FD_class_t), FALSE);
- }
ret_value = H5FD_MIRROR_g;
@@ -252,7 +258,7 @@ done:
} /* end H5FD_mirror_init() */
/* ---------------------------------------------------------------------------
- * Function: H5FD_mirror_term
+ * Function: H5FD__mirror_term
*
* Purpose: Shut down the VFD
*
@@ -260,17 +266,17 @@ done:
* ---------------------------------------------------------------------------
*/
static herr_t
-H5FD_mirror_term(void)
+H5FD__mirror_term(void)
{
- FUNC_ENTER_NOAPI_NOINIT_NOERR
+ FUNC_ENTER_STATIC_NOERR
/* Reset VFL ID */
H5FD_MIRROR_g = 0;
- LOG_OP_CALL("H5FD_mirror_term");
+ LOG_OP_CALL(FUNC);
FUNC_LEAVE_NOAPI(SUCCEED)
-} /* end H5FD_mirror_term() */
+} /* end H5FD__mirror_term() */
/* ---------------------------------------------------------------------------
* Function: H5FD__mirror_xmit_decode_uint16
@@ -289,10 +295,14 @@ size_t
H5FD__mirror_xmit_decode_uint16(uint16_t *out, const unsigned char *_buf)
{
uint16_t n = 0;
- LOG_OP_CALL("H5FD__mirror_xmit_decode_uint16");
+
+ LOG_OP_CALL(__func__);
+
HDassert(_buf && out);
- HDmemcpy(&n, _buf, sizeof(n));
+
+ H5MM_memcpy(&n, _buf, sizeof(n));
*out = (uint16_t)HDntohs(n);
+
return 2; /* number of bytes eaten */
} /* end H5FD__mirror_xmit_decode_uint16() */
@@ -313,10 +323,14 @@ size_t
H5FD__mirror_xmit_decode_uint32(uint32_t *out, const unsigned char *_buf)
{
uint32_t n = 0;
- LOG_OP_CALL("H5FD__mirror_xmit_decode_uint32");
+
+ LOG_OP_CALL(__func__);
+
HDassert(_buf && out);
- HDmemcpy(&n, _buf, sizeof(n));
+
+ H5MM_memcpy(&n, _buf, sizeof(n));
*out = (uint32_t)HDntohl(n);
+
return 4; /* number of bytes eaten */
} /* end H5FD__mirror_xmit_decode_uint32() */
@@ -342,12 +356,11 @@ is_host_little_endian(void)
uint8_t u8[4];
} echeck;
echeck.u32 = 0xA1B2C3D4;
- if (echeck.u8[0] == 0xD4) {
+
+ if (echeck.u8[0] == 0xD4)
return TRUE;
- }
- else {
+ else
return FALSE;
- }
} /* end is_host_little_endian() */
/* ---------------------------------------------------------------------------
@@ -369,15 +382,17 @@ size_t
H5FD__mirror_xmit_decode_uint64(uint64_t *out, const unsigned char *_buf)
{
uint64_t n = 0;
- LOG_OP_CALL("H5FD__mirror_xmit_decode_uint64");
+
+ LOG_OP_CALL(__func__);
+
HDassert(_buf && out);
- HDmemcpy(&n, _buf, sizeof(n));
- if (TRUE == is_host_little_endian()) {
+
+ H5MM_memcpy(&n, _buf, sizeof(n));
+ if (TRUE == is_host_little_endian())
*out = BSWAP_64(n);
- }
- else {
+ else
*out = n;
- }
+
return 8;
} /* end H5FD__mirror_xmit_decode_uint64() */
@@ -395,9 +410,12 @@ H5FD__mirror_xmit_decode_uint64(uint64_t *out, const unsigned char *_buf)
size_t
H5FD__mirror_xmit_decode_uint8(uint8_t *out, const unsigned char *_buf)
{
- LOG_OP_CALL("H5FD__mirror_xmit_decode_uint8");
+ LOG_OP_CALL(__func__);
+
HDassert(_buf && out);
- HDmemcpy(out, _buf, sizeof(uint8_t));
+
+ H5MM_memcpy(out, _buf, sizeof(uint8_t));
+
return 1; /* number of bytes eaten */
} /* end H5FD__mirror_xmit_decode_uint8() */
@@ -417,10 +435,14 @@ size_t
H5FD__mirror_xmit_encode_uint16(unsigned char *_dest, uint16_t v)
{
uint16_t n = 0;
- LOG_OP_CALL("H5FD__mirror_xmit_encode_uint16");
+
+ LOG_OP_CALL(__func__);
+
HDassert(_dest);
+
n = (uint16_t)HDhtons(v);
- HDmemcpy(_dest, &n, sizeof(n));
+ H5MM_memcpy(_dest, &n, sizeof(n));
+
return 2;
} /* end H5FD__mirror_xmit_encode_uint16() */
@@ -440,10 +462,14 @@ size_t
H5FD__mirror_xmit_encode_uint32(unsigned char *_dest, uint32_t v)
{
uint32_t n = 0;
- LOG_OP_CALL("H5FD__mirror_xmit_encode_uint32");
+
+ LOG_OP_CALL(__func__);
+
HDassert(_dest);
+
n = (uint32_t)HDhtonl(v);
- HDmemcpy(_dest, &n, sizeof(n));
+ H5MM_memcpy(_dest, &n, sizeof(n));
+
return 4;
} /* end H5FD__mirror_xmit_encode_uint32() */
@@ -463,12 +489,15 @@ size_t
H5FD__mirror_xmit_encode_uint64(unsigned char *_dest, uint64_t v)
{
uint64_t n = v;
- LOG_OP_CALL("H5FD__mirror_xmit_decode_uint64");
+
+ LOG_OP_CALL(__func__);
+
HDassert(_dest);
- if (TRUE == is_host_little_endian()) {
+
+ if (TRUE == is_host_little_endian())
n = BSWAP_64(v);
- }
- HDmemcpy(_dest, &n, sizeof(n));
+ H5MM_memcpy(_dest, &n, sizeof(n));
+
return 8;
} /* H5FD__mirror_xmit_encode_uint64() */
@@ -488,9 +517,12 @@ H5FD__mirror_xmit_encode_uint64(unsigned char *_dest, uint64_t v)
size_t
H5FD__mirror_xmit_encode_uint8(unsigned char *dest, uint8_t v)
{
- LOG_OP_CALL("H5FD__mirror_xmit_encode_uint8");
+ LOG_OP_CALL(__func__);
+
HDassert(dest);
- HDmemcpy(dest, &v, sizeof(v));
+
+ H5MM_memcpy(dest, &v, sizeof(v));
+
return 1;
} /* end H5FD__mirror_xmit_encode_uint8() */
@@ -517,14 +549,18 @@ size_t
H5FD_mirror_xmit_decode_header(H5FD_mirror_xmit_t *out, const unsigned char *buf)
{
size_t n_eaten = 0;
- LOG_OP_CALL("H5FD_mirror_xmit_decode_header");
+
+ LOG_OP_CALL(__func__);
+
HDassert(out && buf);
+
n_eaten += H5FD__mirror_xmit_decode_uint32(&(out->magic), &buf[n_eaten]);
n_eaten += H5FD__mirror_xmit_decode_uint8(&(out->version), &buf[n_eaten]);
n_eaten += H5FD__mirror_xmit_decode_uint32(&(out->session_token), &buf[n_eaten]);
n_eaten += H5FD__mirror_xmit_decode_uint32(&(out->xmit_count), &buf[n_eaten]);
n_eaten += H5FD__mirror_xmit_decode_uint8(&(out->op), &buf[n_eaten]);
HDassert(n_eaten == H5FD_MIRROR_XMIT_HEADER_SIZE);
+
return n_eaten;
} /* end H5FD_mirror_xmit_decode_header() */
@@ -551,11 +587,15 @@ size_t
H5FD_mirror_xmit_decode_lock(H5FD_mirror_xmit_lock_t *out, const unsigned char *buf)
{
size_t n_eaten = 0;
- LOG_OP_CALL("H5FD_mirror_xmit_decode_lock");
+
+ LOG_OP_CALL(__func__);
+
HDassert(out && buf);
+
n_eaten += H5FD_mirror_xmit_decode_header(&(out->pub), buf);
n_eaten += H5FD__mirror_xmit_decode_uint64(&(out->rw), &buf[n_eaten]);
HDassert(n_eaten == H5FD_MIRROR_XMIT_LOCK_SIZE);
+
return n_eaten;
} /* end H5FD_mirror_xmit_decode_lock() */
@@ -583,8 +623,11 @@ size_t
H5FD_mirror_xmit_decode_open(H5FD_mirror_xmit_open_t *out, const unsigned char *buf)
{
size_t n_eaten = 0;
- LOG_OP_CALL("H5FD_mirror_xmit_decode_open");
+
+ LOG_OP_CALL(__func__);
+
HDassert(out && buf);
+
n_eaten += H5FD_mirror_xmit_decode_header(&(out->pub), buf);
n_eaten += H5FD__mirror_xmit_decode_uint32(&(out->flags), &buf[n_eaten]);
n_eaten += H5FD__mirror_xmit_decode_uint64(&(out->maxaddr), &buf[n_eaten]);
@@ -592,6 +635,7 @@ H5FD_mirror_xmit_decode_open(H5FD_mirror_xmit_open_t *out, const unsigned char *
HDassert((H5FD_MIRROR_XMIT_OPEN_SIZE - H5FD_MIRROR_XMIT_FILEPATH_MAX) == n_eaten);
HDstrncpy(out->filename, (const char *)&buf[n_eaten], H5FD_MIRROR_XMIT_FILEPATH_MAX - 1);
out->filename[H5FD_MIRROR_XMIT_FILEPATH_MAX - 1] = 0; /* force final NULL */
+
return H5FD_MIRROR_XMIT_OPEN_SIZE;
} /* end H5FD_mirror_xmit_decode_open() */
@@ -619,13 +663,17 @@ size_t
H5FD_mirror_xmit_decode_reply(H5FD_mirror_xmit_reply_t *out, const unsigned char *buf)
{
size_t n_eaten = 0;
- LOG_OP_CALL("H5FD_mirror_xmit_decode_reply");
+
+ LOG_OP_CALL(__func__);
+
HDassert(out && buf);
+
n_eaten += H5FD_mirror_xmit_decode_header(&(out->pub), buf);
n_eaten += H5FD__mirror_xmit_decode_uint32(&(out->status), &buf[n_eaten]);
HDassert((H5FD_MIRROR_XMIT_REPLY_SIZE - H5FD_MIRROR_STATUS_MESSAGE_MAX) == n_eaten);
HDstrncpy(out->message, (const char *)&buf[n_eaten], H5FD_MIRROR_STATUS_MESSAGE_MAX - 1);
out->message[H5FD_MIRROR_STATUS_MESSAGE_MAX - 1] = 0; /* force NULL term */
+
return H5FD_MIRROR_XMIT_REPLY_SIZE;
} /* end H5FD_mirror_xmit_decode_reply() */
@@ -652,12 +700,16 @@ size_t
H5FD_mirror_xmit_decode_set_eoa(H5FD_mirror_xmit_eoa_t *out, const unsigned char *buf)
{
size_t n_eaten = 0;
- LOG_OP_CALL("H5FD_mirror_xmit_decode_set_eoa");
+
+ LOG_OP_CALL(__func__);
+
HDassert(out && buf);
+
n_eaten += H5FD_mirror_xmit_decode_header(&(out->pub), buf);
n_eaten += H5FD__mirror_xmit_decode_uint8(&(out->type), &buf[n_eaten]);
n_eaten += H5FD__mirror_xmit_decode_uint64(&(out->eoa_addr), &buf[n_eaten]);
HDassert(n_eaten == H5FD_MIRROR_XMIT_EOA_SIZE);
+
return n_eaten;
} /* end H5FD_mirror_xmit_decode_set_eoa() */
@@ -684,13 +736,17 @@ size_t
H5FD_mirror_xmit_decode_write(H5FD_mirror_xmit_write_t *out, const unsigned char *buf)
{
size_t n_eaten = 0;
- LOG_OP_CALL("H5FD_mirror_xmit_decode_write");
+
+ LOG_OP_CALL(__func__);
+
HDassert(out && buf);
+
n_eaten += H5FD_mirror_xmit_decode_header(&(out->pub), buf);
n_eaten += H5FD__mirror_xmit_decode_uint8(&(out->type), &buf[n_eaten]);
n_eaten += H5FD__mirror_xmit_decode_uint64(&(out->offset), &buf[n_eaten]);
n_eaten += H5FD__mirror_xmit_decode_uint64(&(out->size), &buf[n_eaten]);
HDassert(n_eaten == H5FD_MIRROR_XMIT_WRITE_SIZE);
+
return n_eaten;
} /* end H5FD_mirror_xmit_decode_write() */
@@ -712,14 +768,18 @@ size_t
H5FD_mirror_xmit_encode_header(unsigned char *dest, const H5FD_mirror_xmit_t *x)
{
size_t n_writ = 0;
- LOG_OP_CALL("H5FD_mirror_xmit_encode_header");
+
+ LOG_OP_CALL(__func__);
+
HDassert(dest && x);
+
n_writ += H5FD__mirror_xmit_encode_uint32((dest + n_writ), x->magic);
n_writ += H5FD__mirror_xmit_encode_uint8((dest + n_writ), x->version);
n_writ += H5FD__mirror_xmit_encode_uint32((dest + n_writ), x->session_token);
n_writ += H5FD__mirror_xmit_encode_uint32((dest + n_writ), x->xmit_count);
n_writ += H5FD__mirror_xmit_encode_uint8((dest + n_writ), x->op);
HDassert(n_writ == H5FD_MIRROR_XMIT_HEADER_SIZE);
+
return n_writ;
} /* end H5FD_mirror_xmit_encode_header() */
@@ -740,11 +800,15 @@ size_t
H5FD_mirror_xmit_encode_lock(unsigned char *dest, const H5FD_mirror_xmit_lock_t *x)
{
size_t n_writ = 0;
- LOG_OP_CALL("H5FD_mirror_xmit_encode_lock");
+
+ LOG_OP_CALL(__func__);
+
HDassert(dest && x);
+
n_writ += H5FD_mirror_xmit_encode_header(dest, (const H5FD_mirror_xmit_t *)&(x->pub));
n_writ += H5FD__mirror_xmit_encode_uint64(&dest[n_writ], x->rw);
HDassert(n_writ == H5FD_MIRROR_XMIT_LOCK_SIZE);
+
return n_writ;
} /* end H5FD_mirror_xmit_encode_lock() */
@@ -766,19 +830,21 @@ size_t
H5FD_mirror_xmit_encode_open(unsigned char *dest, const H5FD_mirror_xmit_open_t *x)
{
size_t n_writ = 0;
- LOG_OP_CALL("H5FD_mirror_xmit_encode_open");
+
+ LOG_OP_CALL(__func__);
+
HDassert(dest && x);
+
/* clear entire structure, but especially its filepath string area */
- for (n_writ = 0; n_writ < H5FD_MIRROR_XMIT_OPEN_SIZE; n_writ++) {
- *(dest + n_writ) = 0;
- }
- n_writ = 0;
+ HDmemset(dest, 0, H5FD_MIRROR_XMIT_OPEN_SIZE);
+
n_writ += H5FD_mirror_xmit_encode_header(dest, (const H5FD_mirror_xmit_t *)&(x->pub));
n_writ += H5FD__mirror_xmit_encode_uint32(&dest[n_writ], x->flags);
n_writ += H5FD__mirror_xmit_encode_uint64(&dest[n_writ], x->maxaddr);
n_writ += H5FD__mirror_xmit_encode_uint64(&dest[n_writ], x->size_t_blob);
HDassert((H5FD_MIRROR_XMIT_OPEN_SIZE - H5FD_MIRROR_XMIT_FILEPATH_MAX) == n_writ);
HDstrncpy((char *)&dest[n_writ], x->filename, H5FD_MIRROR_XMIT_FILEPATH_MAX);
+
return H5FD_MIRROR_XMIT_OPEN_SIZE;
} /* end H5FD_mirror_xmit_encode_open() */
@@ -801,17 +867,19 @@ size_t
H5FD_mirror_xmit_encode_reply(unsigned char *dest, const H5FD_mirror_xmit_reply_t *x)
{
size_t n_writ = 0;
- LOG_OP_CALL("H5FD_mirror_xmit_encode_reply");
+
+ LOG_OP_CALL(__func__);
+
HDassert(dest && x);
+
/* clear entire structure, but especially its message string area */
- for (n_writ = 0; n_writ < H5FD_MIRROR_XMIT_REPLY_SIZE; n_writ++) {
- *(dest + n_writ) = 0;
- }
- n_writ = 0;
+ HDmemset(dest, 0, H5FD_MIRROR_XMIT_REPLY_SIZE);
+
n_writ += H5FD_mirror_xmit_encode_header(dest, (const H5FD_mirror_xmit_t *)&(x->pub));
n_writ += H5FD__mirror_xmit_encode_uint32(&dest[n_writ], x->status);
HDassert((H5FD_MIRROR_XMIT_REPLY_SIZE - H5FD_MIRROR_STATUS_MESSAGE_MAX) == n_writ);
HDstrncpy((char *)&dest[n_writ], x->message, H5FD_MIRROR_STATUS_MESSAGE_MAX);
+
return H5FD_MIRROR_XMIT_REPLY_SIZE;
} /* end H5FD_mirror_xmit_encode_reply() */
@@ -833,12 +901,16 @@ size_t
H5FD_mirror_xmit_encode_set_eoa(unsigned char *dest, const H5FD_mirror_xmit_eoa_t *x)
{
size_t n_writ = 0;
- LOG_OP_CALL("H5FD_mirror_xmit_encode_set_eoa");
+
+ LOG_OP_CALL(__func__);
+
HDassert(dest && x);
+
n_writ += H5FD_mirror_xmit_encode_header(dest, (const H5FD_mirror_xmit_t *)&(x->pub));
n_writ += H5FD__mirror_xmit_encode_uint8(&dest[n_writ], x->type);
n_writ += H5FD__mirror_xmit_encode_uint64(&dest[n_writ], x->eoa_addr);
HDassert(n_writ == H5FD_MIRROR_XMIT_EOA_SIZE);
+
return n_writ;
} /* end H5FD_mirror_xmit_encode_set_eoa() */
@@ -860,13 +932,17 @@ size_t
H5FD_mirror_xmit_encode_write(unsigned char *dest, const H5FD_mirror_xmit_write_t *x)
{
size_t n_writ = 0;
- LOG_OP_CALL("H5FD_mirror_xmit_encode_write");
+
+ LOG_OP_CALL(__func__);
+
HDassert(dest && x);
+
n_writ += H5FD_mirror_xmit_encode_header(dest, (const H5FD_mirror_xmit_t *)&(x->pub));
n_writ += H5FD__mirror_xmit_encode_uint8(&dest[n_writ], x->type);
n_writ += H5FD__mirror_xmit_encode_uint64(&dest[n_writ], x->offset);
n_writ += H5FD__mirror_xmit_encode_uint64(&dest[n_writ], x->size);
HDassert(n_writ == H5FD_MIRROR_XMIT_WRITE_SIZE);
+
return n_writ;
} /* end H5FD_mirror_xmit_encode_write() */
@@ -880,14 +956,16 @@ H5FD_mirror_xmit_encode_write(unsigned char *dest, const H5FD_mirror_xmit_write_
* Return: TRUE if valid; else FALSE.
* ---------------------------------------------------------------------------
*/
-hbool_t
+H5_ATTR_PURE hbool_t
H5FD_mirror_xmit_is_close(const H5FD_mirror_xmit_t *xmit)
{
- LOG_OP_CALL("H5FD_mirror_xmit_is_close");
+ LOG_OP_CALL(__func__);
+
HDassert(xmit);
- if ((TRUE == H5FD_mirror_xmit_is_xmit(xmit)) && (H5FD_MIRROR_OP_CLOSE == xmit->op)) {
+
+ if ((TRUE == H5FD_mirror_xmit_is_xmit(xmit)) && (H5FD_MIRROR_OP_CLOSE == xmit->op))
return TRUE;
- }
+
return FALSE;
} /* end H5FD_mirror_xmit_is_close() */
@@ -901,14 +979,16 @@ H5FD_mirror_xmit_is_close(const H5FD_mirror_xmit_t *xmit)
* Return: TRUE if valid; else FALSE.
* ---------------------------------------------------------------------------
*/
-hbool_t
+H5_ATTR_PURE hbool_t
H5FD_mirror_xmit_is_lock(const H5FD_mirror_xmit_lock_t *xmit)
{
- LOG_OP_CALL("H5FD_mirror_xmit_is_lock");
+ LOG_OP_CALL(__func__);
+
HDassert(xmit);
- if ((TRUE == H5FD_mirror_xmit_is_xmit(&(xmit->pub))) && (H5FD_MIRROR_OP_LOCK == xmit->pub.op)) {
+
+ if ((TRUE == H5FD_mirror_xmit_is_xmit(&(xmit->pub))) && (H5FD_MIRROR_OP_LOCK == xmit->pub.op))
return TRUE;
- }
+
return FALSE;
} /* end H5FD_mirror_xmit_is_lock() */
@@ -922,14 +1002,17 @@ H5FD_mirror_xmit_is_lock(const H5FD_mirror_xmit_lock_t *xmit)
* Return: TRUE if valid; else FALSE.
* ---------------------------------------------------------------------------
*/
-hbool_t
+H5_ATTR_PURE hbool_t
H5FD_mirror_xmit_is_open(const H5FD_mirror_xmit_open_t *xmit)
{
- LOG_OP_CALL("H5FD_mirror_xmit_is_open");
+ LOG_OP_CALL(__func__);
+
HDassert(xmit);
- if ((TRUE == H5FD_mirror_xmit_is_xmit(&(xmit->pub))) && (H5FD_MIRROR_OP_OPEN == xmit->pub.op)) {
+
+ if ((TRUE == H5FD_mirror_xmit_is_xmit(&(xmit->pub))) && (H5FD_MIRROR_OP_OPEN == xmit->pub.op))
+
return TRUE;
- }
+
return FALSE;
} /* end H5FD_mirror_xmit_is_open() */
@@ -943,14 +1026,16 @@ H5FD_mirror_xmit_is_open(const H5FD_mirror_xmit_open_t *xmit)
* Return: TRUE if valid; else FALSE.
* ---------------------------------------------------------------------------
*/
-hbool_t
+H5_ATTR_PURE hbool_t
H5FD_mirror_xmit_is_set_eoa(const H5FD_mirror_xmit_eoa_t *xmit)
{
- LOG_OP_CALL("H5FD_mirror_xmit_is_set_eoa");
+ LOG_OP_CALL(__func__);
+
HDassert(xmit);
- if ((TRUE == H5FD_mirror_xmit_is_xmit(&(xmit->pub))) && (H5FD_MIRROR_OP_SET_EOA == xmit->pub.op)) {
+
+ if ((TRUE == H5FD_mirror_xmit_is_xmit(&(xmit->pub))) && (H5FD_MIRROR_OP_SET_EOA == xmit->pub.op))
return TRUE;
- }
+
return FALSE;
} /* end H5FD_mirror_xmit_is_eoa() */
@@ -964,14 +1049,16 @@ H5FD_mirror_xmit_is_set_eoa(const H5FD_mirror_xmit_eoa_t *xmit)
* Return: TRUE if valid; else FALSE.
* ---------------------------------------------------------------------------
*/
-hbool_t
+H5_ATTR_PURE hbool_t
H5FD_mirror_xmit_is_reply(const H5FD_mirror_xmit_reply_t *xmit)
{
- LOG_OP_CALL("H5FD_mirror_xmit_is_reply");
+ LOG_OP_CALL(__func__);
+
HDassert(xmit);
- if ((TRUE == H5FD_mirror_xmit_is_xmit(&(xmit->pub))) && (H5FD_MIRROR_OP_REPLY == xmit->pub.op)) {
+
+ if ((TRUE == H5FD_mirror_xmit_is_xmit(&(xmit->pub))) && (H5FD_MIRROR_OP_REPLY == xmit->pub.op))
return TRUE;
- }
+
return FALSE;
} /* end H5FD_mirror_xmit_is_reply() */
@@ -985,14 +1072,16 @@ H5FD_mirror_xmit_is_reply(const H5FD_mirror_xmit_reply_t *xmit)
* Return: TRUE if valid; else FALSE.
* ---------------------------------------------------------------------------
*/
-hbool_t
+H5_ATTR_PURE hbool_t
H5FD_mirror_xmit_is_write(const H5FD_mirror_xmit_write_t *xmit)
{
- LOG_OP_CALL("H5FD_mirror_xmit_is_write");
+ LOG_OP_CALL(__func__);
+
HDassert(xmit);
- if ((TRUE == H5FD_mirror_xmit_is_xmit(&(xmit->pub))) && (H5FD_MIRROR_OP_WRITE == xmit->pub.op)) {
+
+ if ((TRUE == H5FD_mirror_xmit_is_xmit(&(xmit->pub))) && (H5FD_MIRROR_OP_WRITE == xmit->pub.op))
return TRUE;
- }
+
return FALSE;
} /* end H5FD_mirror_xmit_is_write() */
@@ -1006,14 +1095,16 @@ H5FD_mirror_xmit_is_write(const H5FD_mirror_xmit_write_t *xmit)
* Return: TRUE if valid; else FALSE.
* ---------------------------------------------------------------------------
*/
-hbool_t
+H5_ATTR_PURE hbool_t
H5FD_mirror_xmit_is_xmit(const H5FD_mirror_xmit_t *xmit)
{
- LOG_OP_CALL("H5FD_mirror_xmit_is_xmit");
+ LOG_OP_CALL(__func__);
+
HDassert(xmit);
- if ((H5FD_MIRROR_XMIT_MAGIC != xmit->magic) || (H5FD_MIRROR_XMIT_CURR_VERSION != xmit->version)) {
+
+ if ((H5FD_MIRROR_XMIT_MAGIC != xmit->magic) || (H5FD_MIRROR_XMIT_CURR_VERSION != xmit->version))
return FALSE;
- }
+
return TRUE;
} /* end H5FD_mirror_xmit_is_xmit() */
@@ -1028,57 +1119,54 @@ H5FD_mirror_xmit_is_xmit(const H5FD_mirror_xmit_t *xmit)
* Return: SUCCEED if ok, else FAIL.
* ----------------------------------------------------------------------------
*/
-herr_t
+static herr_t
H5FD__mirror_verify_reply(H5FD_mirror_t *file)
{
- char xmit_buf[H5FD_MIRROR_XMIT_REPLY_SIZE];
+ unsigned char * xmit_buf = NULL;
struct H5FD_mirror_xmit_reply_t reply;
ssize_t read_ret = 0;
herr_t ret_value = SUCCEED;
- FUNC_ENTER_NOAPI_NOINIT;
+ FUNC_ENTER_STATIC
- LOG_OP_CALL("H5FD__mirror_verify_reply");
+ LOG_OP_CALL(FUNC);
HDassert(file && file->sock_fd);
+ xmit_buf = H5FL_BLK_MALLOC(xmit, H5FD_MIRROR_XMIT_BUFFER_MAX);
+ if (NULL == xmit_buf)
+ HGOTO_ERROR(H5E_VFL, H5E_CANTALLOC, FAIL, "unable to allocate xmit buffer");
+
read_ret = HDread(file->sock_fd, xmit_buf, H5FD_MIRROR_XMIT_REPLY_SIZE);
- if (read_ret < 0) {
+ if (read_ret < 0)
HGOTO_ERROR(H5E_VFL, H5E_READERROR, FAIL, "unable to read reply");
- }
- if (read_ret != H5FD_MIRROR_XMIT_REPLY_SIZE) {
+ if (read_ret != H5FD_MIRROR_XMIT_REPLY_SIZE)
HGOTO_ERROR(H5E_VFL, H5E_READERROR, FAIL, "unexpected read size");
- }
LOG_XMIT_BYTES("reply", xmit_buf, read_ret);
- if (H5FD_mirror_xmit_decode_reply(&reply, (const unsigned char *)xmit_buf) !=
- H5FD_MIRROR_XMIT_REPLY_SIZE) {
+ if (H5FD_mirror_xmit_decode_reply(&reply, xmit_buf) != H5FD_MIRROR_XMIT_REPLY_SIZE)
HGOTO_ERROR(H5E_VFL, H5E_BADVALUE, FAIL, "unable to decode reply xmit");
- }
- if (H5FD_mirror_xmit_is_reply(&reply) != TRUE) {
+ if (H5FD_mirror_xmit_is_reply(&reply) != TRUE)
HGOTO_ERROR(H5E_VFL, H5E_BADVALUE, FAIL, "xmit op code was not REPLY");
- }
- if (reply.pub.session_token != file->xmit.session_token) {
+ if (reply.pub.session_token != file->xmit.session_token)
HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "wrong session");
- }
-
- if (reply.pub.xmit_count != (file->xmit_i)++) {
+ if (reply.pub.xmit_count != (file->xmit_i)++)
HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "xmit out of sync");
- }
-
- if (reply.status != H5FD_MIRROR_STATUS_OK) {
+ if (reply.status != H5FD_MIRROR_STATUS_OK)
HGOTO_ERROR(H5E_VFL, H5E_BADVALUE, FAIL, "%s", (const char *)(reply.message));
- }
done:
+ if (xmit_buf)
+ xmit_buf = H5FL_BLK_FREE(xmit, xmit_buf);
+
FUNC_LEAVE_NOAPI(ret_value);
} /* end H5FD__mirror_verify_reply() */
/* -------------------------------------------------------------------------
- * Function: H5FD_mirror_fapl_get
+ * Function: H5FD__mirror_fapl_get
*
* Purpose: Get the file access propety list which could be used to create
* an identical file.
@@ -1088,36 +1176,34 @@ done:
* -------------------------------------------------------------------------
*/
static void *
-H5FD_mirror_fapl_get(H5FD_t *_file)
+H5FD__mirror_fapl_get(H5FD_t *_file)
{
H5FD_mirror_t * file = (H5FD_mirror_t *)_file;
H5FD_mirror_fapl_t *fa = NULL;
void * ret_value = NULL;
- FUNC_ENTER_NOAPI_NOINIT
+ FUNC_ENTER_STATIC
- LOG_OP_CALL("H5FD_mirror_fapl_get");
+ LOG_OP_CALL(FUNC);
fa = (H5FD_mirror_fapl_t *)H5MM_calloc(sizeof(H5FD_mirror_fapl_t));
- if (NULL == fa) {
- HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "calloc failed");
- }
+ if (NULL == fa)
+ HGOTO_ERROR(H5E_VFL, H5E_CANTALLOC, NULL, "calloc failed");
- HDmemcpy(fa, &(file->fa), sizeof(H5FD_mirror_fapl_t));
+ H5MM_memcpy(fa, &(file->fa), sizeof(H5FD_mirror_fapl_t));
ret_value = fa;
done:
- if (ret_value == NULL) {
- if (fa != NULL) {
+ if (ret_value == NULL)
+ if (fa != NULL)
H5MM_xfree(fa);
- }
- }
+
FUNC_LEAVE_NOAPI(ret_value)
-} /* end H5FD_mirror_fapl_get() */
+} /* end H5FD__mirror_fapl_get() */
/* -------------------------------------------------------------------------
- * Function: H5FD_mirror_fapl_copy
+ * Function: H5FD__mirror_fapl_copy
*
* Purpose: Copies the mirror vfd-specific file access properties.
*
@@ -1126,35 +1212,33 @@ done:
* -------------------------------------------------------------------------
*/
static void *
-H5FD_mirror_fapl_copy(const void *_old_fa)
+H5FD__mirror_fapl_copy(const void *_old_fa)
{
const H5FD_mirror_fapl_t *old_fa = (const H5FD_mirror_fapl_t *)_old_fa;
H5FD_mirror_fapl_t * new_fa = NULL;
void * ret_value = NULL;
- FUNC_ENTER_NOAPI_NOINIT
+ FUNC_ENTER_STATIC
- LOG_OP_CALL("H5FD_mirror_fapl_copy");
+ LOG_OP_CALL(FUNC);
new_fa = (H5FD_mirror_fapl_t *)H5MM_malloc(sizeof(H5FD_mirror_fapl_t));
- if (new_fa == NULL) {
- HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "memory allocation failed");
- }
+ if (new_fa == NULL)
+ HGOTO_ERROR(H5E_VFL, H5E_CANTALLOC, NULL, "memory allocation failed");
- HDmemcpy(new_fa, old_fa, sizeof(H5FD_mirror_fapl_t));
+ H5MM_memcpy(new_fa, old_fa, sizeof(H5FD_mirror_fapl_t));
ret_value = new_fa;
done:
- if (ret_value == NULL) {
- if (new_fa != NULL) {
+ if (ret_value == NULL)
+ if (new_fa != NULL)
H5MM_xfree(new_fa);
- }
- }
+
FUNC_LEAVE_NOAPI(ret_value)
-} /* end H5FD_mirror_fapl_copy() */
+} /* end H5FD__mirror_fapl_copy() */
/*-------------------------------------------------------------------------
- * Function: H5FD_mirror_fapl_free
+ * Function: H5FD__mirror_fapl_free
*
* Purpose: Frees the mirror VFD-specific file access properties.
*
@@ -1162,13 +1246,13 @@ done:
*-------------------------------------------------------------------------
*/
static herr_t
-H5FD_mirror_fapl_free(void *_fa)
+H5FD__mirror_fapl_free(void *_fa)
{
H5FD_mirror_fapl_t *fa = (H5FD_mirror_fapl_t *)_fa;
- FUNC_ENTER_NOAPI_NOINIT_NOERR
+ FUNC_ENTER_STATIC_NOERR
- LOG_OP_CALL("H5FD_mirror_fapl_free");
+ LOG_OP_CALL(FUNC);
/* sanity check */
HDassert(fa != NULL);
@@ -1178,50 +1262,45 @@ H5FD_mirror_fapl_free(void *_fa)
H5MM_xfree(fa);
FUNC_LEAVE_NOAPI(SUCCEED)
-} /* end H5FD_mirror_fapl_free() */
+} /* end H5FD__mirror_fapl_free() */
/* -------------------------------------------------------------------------
* Function: H5Pget_fapl_mirror
*
* Purpose: Get the configuration information for this fapl.
- * Data is memcopied into the fa_out pointer.
+ * Data is memcopied into the fa_dst pointer.
*
* Return: SUCCEED/FAIL
* -------------------------------------------------------------------------
*/
herr_t
-H5Pget_fapl_mirror(hid_t fapl_id, H5FD_mirror_fapl_t *fa_out)
+H5Pget_fapl_mirror(hid_t fapl_id, H5FD_mirror_fapl_t *fa_dst /*out*/)
{
- const H5FD_mirror_fapl_t *fa = NULL;
+ const H5FD_mirror_fapl_t *fa_src = NULL;
H5P_genplist_t * plist = NULL;
herr_t ret_value = SUCCEED;
FUNC_ENTER_API(FAIL)
- H5TRACE2("e", "i*#", fapl_id, fa_out);
+ H5TRACE2("e", "ix", fapl_id, fa_dst);
- LOG_OP_CALL("H5Pget_fapl_mirror");
+ LOG_OP_CALL(FUNC);
- if (NULL == fa_out) {
- HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "fa_out is NULL");
- }
+ if (NULL == fa_dst)
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "fa_dst is NULL");
plist = H5P_object_verify(fapl_id, H5P_FILE_ACCESS);
- if (NULL == plist) {
+ if (NULL == plist)
HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a file access property list");
- }
-
- if (H5P_peek_driver(plist) != H5FD_MIRROR) {
+ if (H5P_peek_driver(plist) != H5FD_MIRROR)
HGOTO_ERROR(H5E_PLIST, H5E_BADVALUE, FAIL, "incorrect VFL driver");
- }
- fa = (const H5FD_mirror_fapl_t *)H5P_peek_driver_info(plist);
- if (NULL == fa) {
+ fa_src = (const H5FD_mirror_fapl_t *)H5P_peek_driver_info(plist);
+ if (NULL == fa_src)
HGOTO_ERROR(H5E_PLIST, H5E_BADVALUE, FAIL, "bad VFL driver info");
- }
- HDassert(fa->magic == H5FD_MIRROR_FAPL_MAGIC); /* sanity check */
+ HDassert(fa_src->magic == H5FD_MIRROR_FAPL_MAGIC); /* sanity check */
- HDmemcpy(fa_out, fa, sizeof(H5FD_mirror_fapl_t));
+ H5MM_memcpy(fa_dst, fa_src, sizeof(H5FD_mirror_fapl_t));
done:
FUNC_LEAVE_API(ret_value);
@@ -1245,21 +1324,17 @@ H5Pset_fapl_mirror(hid_t fapl_id, H5FD_mirror_fapl_t *fa)
FUNC_ENTER_API(FAIL)
H5TRACE2("e", "i*#", fapl_id, fa);
- LOG_OP_CALL("H5Pset_fapl_mirror");
+ LOG_OP_CALL(FUNC);
plist = H5P_object_verify(fapl_id, H5P_FILE_ACCESS);
- if (NULL == plist) {
+ if (NULL == plist)
HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a file access property list");
- }
- if (NULL == fa) {
+ if (NULL == fa)
HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "null fapl_t pointer");
- }
- if (H5FD_MIRROR_FAPL_MAGIC != fa->magic) {
+ if (H5FD_MIRROR_FAPL_MAGIC != fa->magic)
HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "invalid fapl_t magic");
- }
- if (H5FD_MIRROR_CURR_FAPL_T_VERSION != fa->version) {
+ if (H5FD_MIRROR_CURR_FAPL_T_VERSION != fa->version)
HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "unknown fapl_t version");
- }
ret_value = H5P_set_driver(plist, H5FD_MIRROR, (const void *)fa);
@@ -1268,7 +1343,7 @@ done:
} /* end H5Pset_fapl_mirror() */
/*-------------------------------------------------------------------------
- * Function: H5FD_mirror_open
+ * Function: H5FD__mirror_open
*
* Purpose: Create and/or opens a file as an HDF5 file.
*
@@ -1282,61 +1357,48 @@ done:
*-------------------------------------------------------------------------
*/
static H5FD_t *
-H5FD_mirror_open(const char *name, unsigned flags, hid_t fapl_id, haddr_t maxaddr)
+H5FD__mirror_open(const char *name, unsigned flags, hid_t fapl_id, haddr_t maxaddr)
{
-#define MIRR_OPEN_MAXBUF 16 /* local symbol to give meaning to magic number */
- /* #defined because it is needed at compile time */
- /* Large enough to hold a port number string */
- int live_socket = -1;
- struct sockaddr_in target_addr;
- socklen_t addr_size;
- char xmit_buf[H5FD_MIRROR_XMIT_OPEN_SIZE];
- H5FD_mirror_fapl_t fa;
- H5FD_mirror_t * file = NULL;
- H5FD_mirror_xmit_open_t open_xmit;
- H5FD_t * ret_value = NULL;
-
- FUNC_ENTER_NOAPI_NOINIT
-
- LOG_OP_CALL("H5FD_mirror_open");
+ int live_socket = -1;
+ struct sockaddr_in target_addr;
+ socklen_t addr_size;
+ unsigned char * xmit_buf = NULL;
+ H5FD_mirror_fapl_t fa;
+ H5FD_mirror_t * file = NULL;
+ H5FD_mirror_xmit_open_t *open_xmit = NULL;
+ H5FD_t * ret_value = NULL;
+
+ FUNC_ENTER_STATIC
+
+ LOG_OP_CALL(FUNC);
/* --------------- */
/* Check arguments */
/* --------------- */
- if (!name || !*name) {
+ if (!name || !*name)
HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, NULL, "invalid file name");
- }
- if (HDstrlen(name) >= H5FD_MIRROR_XMIT_FILEPATH_MAX) {
+ if (HDstrlen(name) >= H5FD_MIRROR_XMIT_FILEPATH_MAX)
HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, NULL, "filename is too long");
- }
- if (0 == maxaddr || HADDR_UNDEF == maxaddr) {
+ if (0 == maxaddr || HADDR_UNDEF == maxaddr)
HGOTO_ERROR(H5E_ARGS, H5E_BADRANGE, NULL, "bogus maxaddr");
- }
- if (ADDR_OVERFLOW(maxaddr)) {
+ if (ADDR_OVERFLOW(maxaddr))
HGOTO_ERROR(H5E_ARGS, H5E_OVERFLOW, NULL, "bogus maxaddr");
- }
- if (H5Pget_fapl_mirror(fapl_id, &fa) == FAIL) {
+ if (H5Pget_fapl_mirror(fapl_id, &fa) == FAIL)
HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, NULL, "can't get config info");
- }
-
- if (H5FD_MIRROR_FAPL_MAGIC != fa.magic) {
+ if (H5FD_MIRROR_FAPL_MAGIC != fa.magic)
HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, NULL, "invalid fapl magic");
- }
-
- if (H5FD_MIRROR_CURR_FAPL_T_VERSION != fa.version) {
+ if (H5FD_MIRROR_CURR_FAPL_T_VERSION != fa.version)
HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, NULL, "invalid fapl version");
- }
/* --------------------- */
/* Handshake with remote */
/* --------------------- */
live_socket = HDsocket(AF_INET, SOCK_STREAM, 0);
- if (live_socket < 0) {
+ if (live_socket < 0)
HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, NULL, "can't create socket");
- }
target_addr.sin_family = AF_INET;
target_addr.sin_port = HDhtons((uint16_t)fa.handshake_port);
@@ -1344,18 +1406,16 @@ H5FD_mirror_open(const char *name, unsigned flags, hid_t fapl_id, haddr_t maxadd
HDmemset(target_addr.sin_zero, '\0', sizeof target_addr.sin_zero);
addr_size = sizeof(target_addr);
- if (HDconnect(live_socket, (struct sockaddr *)&target_addr, addr_size) < 0) {
+ if (HDconnect(live_socket, (struct sockaddr *)&target_addr, addr_size) < 0)
HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, NULL, "can't connect to remote server");
- }
/* ------------- */
/* Open the file */
/* ------------- */
file = (H5FD_mirror_t *)H5FL_CALLOC(H5FD_mirror_t);
- if (NULL == file) {
- HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "unable to allocate file struct");
- }
+ if (NULL == file)
+ HGOTO_ERROR(H5E_VFL, H5E_CANTALLOC, NULL, "unable to allocate file struct");
file->sock_fd = live_socket;
file->xmit_i = 0;
@@ -1366,46 +1426,52 @@ H5FD_mirror_open(const char *name, unsigned flags, hid_t fapl_id, haddr_t maxadd
file->xmit.session_token = (uint32_t)(0x01020304 ^ file->sock_fd); /* TODO: hashing? */
/* int --> uint32_t may truncate on some systems... shouldn't matter? */
- file->xmit.op = H5FD_MIRROR_OP_OPEN;
- open_xmit.pub = file->xmit;
- open_xmit.flags = (uint32_t)flags;
- open_xmit.maxaddr = (uint64_t)maxaddr;
- open_xmit.size_t_blob = (uint64_t)((size_t)(-1));
- HDsnprintf(open_xmit.filename, H5FD_MIRROR_XMIT_FILEPATH_MAX - 1, "%s", name);
+ open_xmit = (H5FD_mirror_xmit_open_t *)H5FL_CALLOC(H5FD_mirror_xmit_open_t);
+ if (NULL == open_xmit)
+ HGOTO_ERROR(H5E_VFL, H5E_CANTALLOC, NULL, "unable to allocate open_xmit struct");
+
+ file->xmit.op = H5FD_MIRROR_OP_OPEN;
+ open_xmit->pub = file->xmit;
+ open_xmit->flags = (uint32_t)flags;
+ open_xmit->maxaddr = (uint64_t)maxaddr;
+ open_xmit->size_t_blob = (uint64_t)((size_t)(-1));
+ HDsnprintf(open_xmit->filename, H5FD_MIRROR_XMIT_FILEPATH_MAX - 1, "%s", name);
+
+ xmit_buf = H5FL_BLK_MALLOC(xmit, H5FD_MIRROR_XMIT_BUFFER_MAX);
+ if (NULL == xmit_buf)
+ HGOTO_ERROR(H5E_VFL, H5E_CANTALLOC, NULL, "unable to allocate xmit buffer");
- if (H5FD_mirror_xmit_encode_open((unsigned char *)xmit_buf,
- (const H5FD_mirror_xmit_open_t *)&open_xmit) !=
- H5FD_MIRROR_XMIT_OPEN_SIZE) {
+ if (H5FD_mirror_xmit_encode_open(xmit_buf, open_xmit) != H5FD_MIRROR_XMIT_OPEN_SIZE)
HGOTO_ERROR(H5E_VFL, H5E_WRITEERROR, NULL, "unable to encode open");
- }
LOG_XMIT_BYTES("open", xmit_buf, H5FD_MIRROR_XMIT_OPEN_SIZE);
- if (HDwrite(file->sock_fd, xmit_buf, H5FD_MIRROR_XMIT_OPEN_SIZE) < 0) {
+ if (HDwrite(file->sock_fd, xmit_buf, H5FD_MIRROR_XMIT_OPEN_SIZE) < 0)
HGOTO_ERROR(H5E_VFL, H5E_WRITEERROR, NULL, "unable to transmit open");
- }
- if (H5FD__mirror_verify_reply(file) == FAIL) {
+ if (H5FD__mirror_verify_reply(file) == FAIL)
HGOTO_ERROR(H5E_VFL, H5E_BADVALUE, NULL, "invalid reply");
- }
ret_value = (H5FD_t *)file;
done:
if (NULL == ret_value) {
- if (file) {
+ if (file)
file = H5FL_FREE(H5FD_mirror_t, file);
- }
- if (live_socket >= 0 && HDclose(live_socket) < 0) {
+ if (live_socket >= 0 && HDclose(live_socket) < 0)
HDONE_ERROR(H5E_VFL, H5E_CANTCLOSEFILE, NULL, "can't close socket");
- }
}
+
+ if (open_xmit)
+ open_xmit = H5FL_FREE(H5FD_mirror_xmit_open_t, open_xmit);
+ if (xmit_buf)
+ xmit_buf = H5FL_BLK_FREE(xmit, xmit_buf);
+
FUNC_LEAVE_NOAPI(ret_value)
-#undef MIRR_OPEN_MAXBUF
-} /* end H5FD_mirror_open() */
+} /* end H5FD__mirror_open() */
/*-------------------------------------------------------------------------
- * Function: H5FD_mirror_close
+ * Function: H5FD__mirror_close
*
* Purpose: Closes the HDF5 file.
*
@@ -1420,16 +1486,16 @@ done:
*-------------------------------------------------------------------------
*/
static herr_t
-H5FD_mirror_close(H5FD_t *_file)
+H5FD__mirror_close(H5FD_t *_file)
{
- H5FD_mirror_t *file = (H5FD_mirror_t *)_file;
- unsigned char xmit_buf[H5FD_MIRROR_XMIT_HEADER_SIZE];
+ H5FD_mirror_t *file = (H5FD_mirror_t *)_file;
+ unsigned char *xmit_buf = NULL;
int xmit_encoded = 0; /* monitor point of failure */
herr_t ret_value = SUCCEED;
- FUNC_ENTER_NOAPI_NOINIT
+ FUNC_ENTER_STATIC
- LOG_OP_CALL("H5FD_mirror_close");
+ LOG_OP_CALL(FUNC);
/* Sanity check */
HDassert(file);
@@ -1438,25 +1504,24 @@ H5FD_mirror_close(H5FD_t *_file)
file->xmit.xmit_count = (file->xmit_i)++;
file->xmit.op = H5FD_MIRROR_OP_CLOSE;
- if (H5FD_mirror_xmit_encode_header(xmit_buf, (const H5FD_mirror_xmit_t *)&(file->xmit)) !=
- H5FD_MIRROR_XMIT_HEADER_SIZE) {
+ xmit_buf = H5FL_BLK_MALLOC(xmit, H5FD_MIRROR_XMIT_BUFFER_MAX);
+ if (NULL == xmit_buf)
+ HGOTO_ERROR(H5E_VFL, H5E_CANTALLOC, FAIL, "unable to allocate xmit buffer");
+
+ if (H5FD_mirror_xmit_encode_header(xmit_buf, &(file->xmit)) != H5FD_MIRROR_XMIT_HEADER_SIZE)
HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "unable to encode close");
- }
xmit_encoded = 1;
LOG_XMIT_BYTES("close", xmit_buf, H5FD_MIRROR_XMIT_HEADER_SIZE);
- if (HDwrite(file->sock_fd, xmit_buf, H5FD_MIRROR_XMIT_HEADER_SIZE) < 0) {
+ if (HDwrite(file->sock_fd, xmit_buf, H5FD_MIRROR_XMIT_HEADER_SIZE) < 0)
HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "unable to transmit close");
- }
- if (H5FD__mirror_verify_reply(file) == FAIL) {
+ if (H5FD__mirror_verify_reply(file) == FAIL)
HGOTO_ERROR(H5E_VFL, H5E_BADVALUE, FAIL, "invalid reply");
- }
- if (HDclose(file->sock_fd) < 0) {
+ if (HDclose(file->sock_fd) < 0)
HGOTO_ERROR(H5E_VFL, H5E_CANTCLOSEFILE, FAIL, "can't close socket");
- }
done:
if (ret_value == FAIL) {
@@ -1467,31 +1532,30 @@ done:
*/
if (HDwrite(file->sock_fd, "GOODBYE", HDstrlen("GOODBYE")) < 0) {
HDONE_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "unable to transmit close");
- if (HDclose(file->sock_fd) < 0) {
+ if (HDclose(file->sock_fd) < 0)
HDONE_ERROR(H5E_VFL, H5E_CANTCLOSEFILE, FAIL, "can't close socket");
- }
file->sock_fd = -1; /* invalidate for later */
} /* end if problem writing goodbye; go down hard */
- else if (HDshutdown(file->sock_fd, SHUT_WR) < 0) {
+ else if (HDshutdown(file->sock_fd, SHUT_WR) < 0)
HDONE_ERROR(H5E_VFL, H5E_BADVALUE, FAIL, "can't shutdown socket write: %s",
HDstrerror(errno));
- } /* end else-if problem shutting down socket */
- } /* end if xmit encode failed */
+ } /* end if xmit encode failed */
- if (file->sock_fd >= 0) {
- if (HDclose(file->sock_fd) < 0) {
+ if (file->sock_fd >= 0)
+ if (HDclose(file->sock_fd) < 0)
HDONE_ERROR(H5E_VFL, H5E_CANTCLOSEFILE, FAIL, "can't close socket");
- }
- } /* end if socket not closed by going down hard */
- } /* end if error */
+ } /* end if error */
file = H5FL_FREE(H5FD_mirror_t, file); /* always release resources */
+ if (xmit_buf)
+ xmit_buf = H5FL_BLK_FREE(xmit, xmit_buf);
+
FUNC_LEAVE_NOAPI(ret_value)
-} /* end H5FD_mirror_close() */
+} /* end H5FD__mirror_close() */
/*-------------------------------------------------------------------------
- * Function: H5FD_mirror_query
+ * Function: H5FD__mirror_query
*
* Purpose: Get the driver feature flags implemented by the driver.
*
@@ -1499,11 +1563,11 @@ done:
*-------------------------------------------------------------------------
*/
static herr_t
-H5FD_mirror_query(const H5FD_t H5_ATTR_UNUSED *_file, unsigned long *flags)
+H5FD__mirror_query(const H5FD_t H5_ATTR_UNUSED *_file, unsigned long *flags)
{
- FUNC_ENTER_NOAPI_NOINIT_NOERR;
+ FUNC_ENTER_STATIC_NOERR;
- LOG_OP_CALL("H5FD_mirror_query");
+ LOG_OP_CALL(FUNC);
/* Notice: the Mirror VFD Writer currently uses only the Sec2 driver as
* the underying driver -- as such, the Mirror VFD implementation copies
@@ -1513,17 +1577,16 @@ H5FD_mirror_query(const H5FD_t H5_ATTR_UNUSED *_file, unsigned long *flags)
* is never included.
* -- JOS 2020-01-13
*/
- if (flags) {
- *flags = 0 | H5FD_FEAT_AGGREGATE_METADATA | H5FD_FEAT_ACCUMULATE_METADATA | H5FD_FEAT_DATA_SIEVE |
+ if (flags)
+ *flags = H5FD_FEAT_AGGREGATE_METADATA | H5FD_FEAT_ACCUMULATE_METADATA | H5FD_FEAT_DATA_SIEVE |
H5FD_FEAT_AGGREGATE_SMALLDATA | H5FD_FEAT_POSIX_COMPAT_HANDLE | H5FD_FEAT_SUPPORTS_SWMR_IO |
H5FD_FEAT_DEFAULT_VFD_COMPATIBLE;
- }
FUNC_LEAVE_NOAPI(SUCCEED);
-} /* end H5FD_mirror_query() */
+} /* end H5FD__mirror_query() */
/*-------------------------------------------------------------------------
- * Function: H5FD_mirror_get_eoa
+ * Function: H5FD__mirror_get_eoa
*
* Purpose: Gets the end-of-address marker for the file. The EOA marker
* is the first address past the last byte allocated in the
@@ -1535,21 +1598,21 @@ H5FD_mirror_query(const H5FD_t H5_ATTR_UNUSED *_file, unsigned long *flags)
*-------------------------------------------------------------------------
*/
static haddr_t
-H5FD_mirror_get_eoa(const H5FD_t *_file, H5FD_mem_t H5_ATTR_UNUSED type)
+H5FD__mirror_get_eoa(const H5FD_t *_file, H5FD_mem_t H5_ATTR_UNUSED type)
{
const H5FD_mirror_t *file = (const H5FD_mirror_t *)_file;
- FUNC_ENTER_NOAPI_NOINIT_NOERR
+ FUNC_ENTER_STATIC_NOERR
- LOG_OP_CALL("H5FD_mirror_get_eoa");
+ LOG_OP_CALL(FUNC);
HDassert(file);
FUNC_LEAVE_NOAPI(file->eoa)
-} /* end H5FD_mirror_get_eoa() */
+} /* end H5FD__mirror_get_eoa() */
/*-------------------------------------------------------------------------
- * Function: H5FD_mirror_set_eoa
+ * Function: H5FD__mirror_set_eoa
*
* Purpose: Set the end-of-address marker for the file. This function is
* called shortly after an existing HDF5 file is opened in order
@@ -1559,16 +1622,16 @@ H5FD_mirror_get_eoa(const H5FD_t *_file, H5FD_mem_t H5_ATTR_UNUSED type)
*-------------------------------------------------------------------------
*/
static herr_t
-H5FD_mirror_set_eoa(H5FD_t *_file, H5FD_mem_t type, haddr_t addr)
+H5FD__mirror_set_eoa(H5FD_t *_file, H5FD_mem_t type, haddr_t addr)
{
H5FD_mirror_xmit_eoa_t xmit_eoa;
- unsigned char xmit_buf[H5FD_MIRROR_XMIT_EOA_SIZE];
+ unsigned char * xmit_buf = NULL;
H5FD_mirror_t * file = (H5FD_mirror_t *)_file;
herr_t ret_value = SUCCEED;
- FUNC_ENTER_NOAPI_NOINIT
+ FUNC_ENTER_STATIC
- LOG_OP_CALL("H5FD_mirror_set_eoa");
+ LOG_OP_CALL(FUNC);
HDassert(file);
@@ -1581,27 +1644,30 @@ H5FD_mirror_set_eoa(H5FD_t *_file, H5FD_mem_t type, haddr_t addr)
xmit_eoa.type = (uint8_t)type;
xmit_eoa.eoa_addr = (uint64_t)addr;
- if (H5FD_mirror_xmit_encode_set_eoa(xmit_buf, (const H5FD_mirror_xmit_eoa_t *)&xmit_eoa) !=
- H5FD_MIRROR_XMIT_EOA_SIZE) {
+ xmit_buf = H5FL_BLK_MALLOC(xmit, H5FD_MIRROR_XMIT_BUFFER_MAX);
+ if (NULL == xmit_buf)
+ HGOTO_ERROR(H5E_VFL, H5E_CANTALLOC, FAIL, "unable to allocate xmit buffer");
+
+ if (H5FD_mirror_xmit_encode_set_eoa(xmit_buf, &xmit_eoa) != H5FD_MIRROR_XMIT_EOA_SIZE)
HGOTO_ERROR(H5E_VFL, H5E_WRITEERROR, FAIL, "unable to encode set-eoa");
- }
LOG_XMIT_BYTES("set-eoa", xmit_buf, H5FD_MIRROR_XMIT_EOA_SIZE);
- if (HDwrite(file->sock_fd, xmit_buf, H5FD_MIRROR_XMIT_EOA_SIZE) < 0) {
+ if (HDwrite(file->sock_fd, xmit_buf, H5FD_MIRROR_XMIT_EOA_SIZE) < 0)
HGOTO_ERROR(H5E_VFL, H5E_WRITEERROR, FAIL, "unable to transmit set-eoa");
- }
- if (H5FD__mirror_verify_reply(file) == FAIL) {
+ if (H5FD__mirror_verify_reply(file) == FAIL)
HGOTO_ERROR(H5E_VFL, H5E_BADVALUE, FAIL, "invalid reply");
- }
done:
+ if (xmit_buf)
+ xmit_buf = H5FL_BLK_FREE(xmit, xmit_buf);
+
FUNC_LEAVE_NOAPI(ret_value)
-} /* end H5FD_mirror_set_eoa() */
+} /* end H5FD__mirror_set_eoa() */
/*-------------------------------------------------------------------------
- * Function: H5FD_mirror_get_eof
+ * Function: H5FD__mirror_get_eof
*
* Purpose: Returns the end-of-file marker, which is the greater of
* either the filesystem end-of-file or the HDF5 end-of-address
@@ -1614,43 +1680,40 @@ done:
*-------------------------------------------------------------------------
*/
static haddr_t
-H5FD_mirror_get_eof(const H5FD_t *_file, H5FD_mem_t H5_ATTR_UNUSED type)
+H5FD__mirror_get_eof(const H5FD_t *_file, H5FD_mem_t H5_ATTR_UNUSED type)
{
const H5FD_mirror_t *file = (const H5FD_mirror_t *)_file;
- FUNC_ENTER_NOAPI_NOINIT_NOERR
+ FUNC_ENTER_STATIC_NOERR
- LOG_OP_CALL("H5FD_mirror_get_eof");
+ LOG_OP_CALL(FUNC);
HDassert(file);
FUNC_LEAVE_NOAPI(file->eof)
-} /* end H5FD_mirror_get_eof() */
+} /* end H5FD__mirror_get_eof() */
/*-------------------------------------------------------------------------
- * Function: H5FD_mirror_read
+ * Function: H5FD__mirror_read
*
- * Purpose: Required to register the driver.
- * If called, MUST fail.
+ * Purpose: Required to register the driver, but if called, MUST fail.
*
* Return: FAIL
*-------------------------------------------------------------------------
*/
static herr_t
-H5FD_mirror_read(H5FD_t H5_ATTR_UNUSED *_file, H5FD_mem_t H5_ATTR_UNUSED type, hid_t H5_ATTR_UNUSED fapl_id,
- haddr_t H5_ATTR_UNUSED addr, size_t H5_ATTR_UNUSED size, void H5_ATTR_UNUSED *buf)
+H5FD__mirror_read(H5FD_t H5_ATTR_UNUSED *_file, H5FD_mem_t H5_ATTR_UNUSED type, hid_t H5_ATTR_UNUSED fapl_id,
+ haddr_t H5_ATTR_UNUSED addr, size_t H5_ATTR_UNUSED size, void H5_ATTR_UNUSED *buf)
{
- herr_t ret_value = FAIL;
-
- FUNC_ENTER_NOAPI_NOINIT_NOERR
+ FUNC_ENTER_STATIC_NOERR
- LOG_OP_CALL("H5FD_mirror_read");
+ LOG_OP_CALL(FUNC);
- FUNC_LEAVE_NOAPI(ret_value)
-} /* end H5FD_mirror_read() */
+ FUNC_LEAVE_NOAPI(FAIL)
+} /* end H5FD__mirror_read() */
/*-------------------------------------------------------------------------
- * Function: H5FD_mirror_write
+ * Function: H5FD__mirror_write
*
* Purpose: Writes SIZE bytes of data to FILE beginning at address ADDR
* from buffer BUF according to data transfer properties in
@@ -1667,17 +1730,17 @@ H5FD_mirror_read(H5FD_t H5_ATTR_UNUSED *_file, H5FD_mem_t H5_ATTR_UNUSED type, h
*-------------------------------------------------------------------------
*/
static herr_t
-H5FD_mirror_write(H5FD_t *_file, H5FD_mem_t type, hid_t H5_ATTR_UNUSED dxpl_id, haddr_t addr, size_t size,
- const void *buf)
+H5FD__mirror_write(H5FD_t *_file, H5FD_mem_t type, hid_t H5_ATTR_UNUSED dxpl_id, haddr_t addr, size_t size,
+ const void *buf)
{
H5FD_mirror_xmit_write_t xmit_write;
- unsigned char xmit_buf[H5FD_MIRROR_XMIT_WRITE_SIZE];
+ unsigned char * xmit_buf = NULL;
H5FD_mirror_t * file = (H5FD_mirror_t *)_file;
herr_t ret_value = SUCCEED;
- FUNC_ENTER_NOAPI_NOINIT
+ FUNC_ENTER_STATIC
- LOG_OP_CALL("H5FD_mirror_write");
+ LOG_OP_CALL(FUNC);
HDassert(file);
HDassert(buf);
@@ -1690,39 +1753,40 @@ H5FD_mirror_write(H5FD_t *_file, H5FD_mem_t type, hid_t H5_ATTR_UNUSED dxpl_id,
xmit_write.offset = (uint64_t)addr;
xmit_write.type = (uint8_t)type;
+ xmit_buf = H5FL_BLK_MALLOC(xmit, H5FD_MIRROR_XMIT_BUFFER_MAX);
+ if (NULL == xmit_buf)
+ HGOTO_ERROR(H5E_VFL, H5E_CANTALLOC, FAIL, "unable to allocate xmit buffer");
+
/* Notify Writer of incoming data to write. */
- if (H5FD_mirror_xmit_encode_write(xmit_buf, (const H5FD_mirror_xmit_write_t *)&xmit_write) !=
- H5FD_MIRROR_XMIT_WRITE_SIZE) {
+ if (H5FD_mirror_xmit_encode_write(xmit_buf, &xmit_write) != H5FD_MIRROR_XMIT_WRITE_SIZE)
HGOTO_ERROR(H5E_VFL, H5E_WRITEERROR, FAIL, "unable to encode write");
- }
LOG_XMIT_BYTES("write", xmit_buf, H5FD_MIRROR_XMIT_WRITE_SIZE);
- if (HDwrite(file->sock_fd, xmit_buf, H5FD_MIRROR_XMIT_WRITE_SIZE) < 0) {
+ if (HDwrite(file->sock_fd, xmit_buf, H5FD_MIRROR_XMIT_WRITE_SIZE) < 0)
HGOTO_ERROR(H5E_VFL, H5E_WRITEERROR, FAIL, "unable to transmit write");
- }
/* Check that our write xmission was received */
- if (H5FD__mirror_verify_reply(file) == FAIL) {
+ if (H5FD__mirror_verify_reply(file) == FAIL)
HGOTO_ERROR(H5E_VFL, H5E_BADVALUE, FAIL, "invalid reply");
- }
/* Send the data to be written */
- if (HDwrite(file->sock_fd, buf, size) < 0) {
+ if (HDwrite(file->sock_fd, buf, size) < 0)
HGOTO_ERROR(H5E_VFL, H5E_WRITEERROR, FAIL, "unable to transmit data");
- }
/* Writer should reply that it got the data and is still okay/ready */
- if (H5FD__mirror_verify_reply(file) == FAIL) {
+ if (H5FD__mirror_verify_reply(file) == FAIL)
HGOTO_ERROR(H5E_VFL, H5E_BADVALUE, FAIL, "invalid reply");
- }
done:
+ if (xmit_buf)
+ xmit_buf = H5FL_BLK_FREE(xmit, xmit_buf);
+
FUNC_LEAVE_NOAPI(ret_value)
-} /* end H5FD_mirror_write() */
+} /* end H5FD__mirror_write() */
/*-------------------------------------------------------------------------
- * Function: H5FD_mirror_truncate
+ * Function: H5FD__mirror_truncate
*
* Purpose: Makes sure that the true file size is the same (or larger)
* than the end-of-address.
@@ -1731,39 +1795,43 @@ done:
*-------------------------------------------------------------------------
*/
static herr_t
-H5FD_mirror_truncate(H5FD_t *_file, hid_t H5_ATTR_UNUSED dxpl_id, hbool_t H5_ATTR_UNUSED closing)
+H5FD__mirror_truncate(H5FD_t *_file, hid_t H5_ATTR_UNUSED dxpl_id, hbool_t H5_ATTR_UNUSED closing)
{
- unsigned char xmit_buf[H5FD_MIRROR_XMIT_HEADER_SIZE];
+ unsigned char *xmit_buf = NULL;
H5FD_mirror_t *file = (H5FD_mirror_t *)_file;
herr_t ret_value = SUCCEED;
- FUNC_ENTER_NOAPI_NOINIT
+ FUNC_ENTER_STATIC
- LOG_OP_CALL("H5FD_mirror_truncate");
+ LOG_OP_CALL(FUNC);
file->xmit.xmit_count = (file->xmit_i)++;
file->xmit.op = H5FD_MIRROR_OP_TRUNCATE;
- if (H5FD_mirror_xmit_encode_header(xmit_buf, &(file->xmit)) != H5FD_MIRROR_XMIT_HEADER_SIZE) {
+ xmit_buf = H5FL_BLK_MALLOC(xmit, H5FD_MIRROR_XMIT_BUFFER_MAX);
+ if (NULL == xmit_buf)
+ HGOTO_ERROR(H5E_VFL, H5E_CANTALLOC, FAIL, "unable to allocate xmit buffer");
+
+ if (H5FD_mirror_xmit_encode_header(xmit_buf, &(file->xmit)) != H5FD_MIRROR_XMIT_HEADER_SIZE)
HGOTO_ERROR(H5E_VFL, H5E_WRITEERROR, FAIL, "unable to encode truncate");
- }
LOG_XMIT_BYTES("truncate", xmit_buf, H5FD_MIRROR_XMIT_HEADER_SIZE);
- if (HDwrite(file->sock_fd, xmit_buf, H5FD_MIRROR_XMIT_HEADER_SIZE) < 0) {
+ if (HDwrite(file->sock_fd, xmit_buf, H5FD_MIRROR_XMIT_HEADER_SIZE) < 0)
HGOTO_ERROR(H5E_VFL, H5E_WRITEERROR, FAIL, "unable to transmit truncate");
- }
- if (H5FD__mirror_verify_reply(file) == FAIL) {
+ if (H5FD__mirror_verify_reply(file) == FAIL)
HGOTO_ERROR(H5E_VFL, H5E_BADVALUE, FAIL, "invalid reply");
- }
done:
+ if (xmit_buf)
+ xmit_buf = H5FL_BLK_FREE(xmit, xmit_buf);
+
FUNC_LEAVE_NOAPI(ret_value)
-} /* end H5FD_mirror_truncate() */
+} /* end H5FD__mirror_truncate() */
/*-------------------------------------------------------------------------
- * Function: H5FD_mirror_lock
+ * Function: H5FD__mirror_lock
*
* Purpose: To place an advisory lock on a file.
* The lock type to apply depends on the parameter "rw":
@@ -1774,16 +1842,16 @@ done:
*-------------------------------------------------------------------------
*/
static herr_t
-H5FD_mirror_lock(H5FD_t *_file, hbool_t rw)
+H5FD__mirror_lock(H5FD_t *_file, hbool_t rw)
{
H5FD_mirror_xmit_lock_t xmit_lock;
- unsigned char xmit_buf[H5FD_MIRROR_XMIT_LOCK_SIZE];
+ unsigned char * xmit_buf = NULL;
H5FD_mirror_t * file = (H5FD_mirror_t *)_file;
herr_t ret_value = SUCCEED;
- FUNC_ENTER_NOAPI_NOINIT;
+ FUNC_ENTER_STATIC
- LOG_OP_CALL("H5FD_mirror_lock");
+ LOG_OP_CALL(FUNC);
file->xmit.xmit_count = (file->xmit_i)++;
file->xmit.op = H5FD_MIRROR_OP_LOCK;
@@ -1791,27 +1859,30 @@ H5FD_mirror_lock(H5FD_t *_file, hbool_t rw)
xmit_lock.pub = file->xmit;
xmit_lock.rw = (uint64_t)rw;
- if (H5FD_mirror_xmit_encode_lock(xmit_buf, (const H5FD_mirror_xmit_lock_t *)&xmit_lock) !=
- H5FD_MIRROR_XMIT_LOCK_SIZE) {
+ xmit_buf = H5FL_BLK_MALLOC(xmit, H5FD_MIRROR_XMIT_BUFFER_MAX);
+ if (NULL == xmit_buf)
+ HGOTO_ERROR(H5E_VFL, H5E_CANTALLOC, FAIL, "unable to allocate xmit buffer");
+
+ if (H5FD_mirror_xmit_encode_lock(xmit_buf, &xmit_lock) != H5FD_MIRROR_XMIT_LOCK_SIZE)
HGOTO_ERROR(H5E_VFL, H5E_WRITEERROR, FAIL, "unable to encode lock");
- }
LOG_XMIT_BYTES("lock", xmit_buf, H5FD_MIRROR_XMIT_LOCK_SIZE);
- if (HDwrite(file->sock_fd, xmit_buf, H5FD_MIRROR_XMIT_LOCK_SIZE) < 0) {
+ if (HDwrite(file->sock_fd, xmit_buf, H5FD_MIRROR_XMIT_LOCK_SIZE) < 0)
HGOTO_ERROR(H5E_VFL, H5E_WRITEERROR, FAIL, "unable to transmit lock");
- }
- if (H5FD__mirror_verify_reply(file) == FAIL) {
+ if (H5FD__mirror_verify_reply(file) == FAIL)
HGOTO_ERROR(H5E_VFL, H5E_BADVALUE, FAIL, "invalid reply");
- }
done:
+ if (xmit_buf)
+ xmit_buf = H5FL_BLK_FREE(xmit, xmit_buf);
+
FUNC_LEAVE_NOAPI(ret_value);
-} /* end H5FD_mirror_lock */
+} /* end H5FD__mirror_lock */
/*-------------------------------------------------------------------------
- * Function: H5FD_mirror_unlock
+ * Function: H5FD__mirror_unlock
*
* Purpose: Remove the existing lock on the file.
*
@@ -1819,35 +1890,39 @@ done:
*-------------------------------------------------------------------------
*/
static herr_t
-H5FD_mirror_unlock(H5FD_t *_file)
+H5FD__mirror_unlock(H5FD_t *_file)
{
- unsigned char xmit_buf[H5FD_MIRROR_XMIT_HEADER_SIZE];
+ unsigned char *xmit_buf = NULL;
H5FD_mirror_t *file = (H5FD_mirror_t *)_file;
herr_t ret_value = SUCCEED;
- FUNC_ENTER_NOAPI_NOINIT;
+ FUNC_ENTER_STATIC
- LOG_OP_CALL("H5FD_mirror_unlock");
+ LOG_OP_CALL(FUNC);
file->xmit.xmit_count = (file->xmit_i)++;
file->xmit.op = H5FD_MIRROR_OP_UNLOCK;
- if (H5FD_mirror_xmit_encode_header(xmit_buf, &(file->xmit)) != H5FD_MIRROR_XMIT_HEADER_SIZE) {
+ xmit_buf = H5FL_BLK_MALLOC(xmit, H5FD_MIRROR_XMIT_BUFFER_MAX);
+ if (NULL == xmit_buf)
+ HGOTO_ERROR(H5E_VFL, H5E_CANTALLOC, FAIL, "unable to allocate xmit buffer");
+
+ if (H5FD_mirror_xmit_encode_header(xmit_buf, &(file->xmit)) != H5FD_MIRROR_XMIT_HEADER_SIZE)
HGOTO_ERROR(H5E_VFL, H5E_WRITEERROR, FAIL, "unable to encode unlock");
- }
LOG_XMIT_BYTES("unlock", xmit_buf, H5FD_MIRROR_XMIT_HEADER_SIZE);
- if (HDwrite(file->sock_fd, xmit_buf, H5FD_MIRROR_XMIT_HEADER_SIZE) < 0) {
+ if (HDwrite(file->sock_fd, xmit_buf, H5FD_MIRROR_XMIT_HEADER_SIZE) < 0)
HGOTO_ERROR(H5E_VFL, H5E_WRITEERROR, FAIL, "unable to transmit unlock");
- }
- if (H5FD__mirror_verify_reply(file) == FAIL) {
+ if (H5FD__mirror_verify_reply(file) == FAIL)
HGOTO_ERROR(H5E_VFL, H5E_BADVALUE, FAIL, "invalid reply");
- }
done:
+ if (xmit_buf)
+ xmit_buf = H5FL_BLK_FREE(xmit, xmit_buf);
+
FUNC_LEAVE_NOAPI(ret_value);
-} /* end H5FD_mirror_unlock */
+} /* end H5FD__mirror_unlock */
#endif /* H5_HAVE_MIRROR_VFD */
diff --git a/src/H5FDmirror.h b/src/H5FDmirror.h
index 2ed6bbd..49e24c1 100644
--- a/src/H5FDmirror.h
+++ b/src/H5FDmirror.h
@@ -61,294 +61,21 @@ typedef struct H5FD_mirror_fapl_t {
char remote_ip[H5FD_MIRROR_MAX_IP_LEN + 1];
} H5FD_mirror_fapl_t;
-H5_DLL hid_t H5FD_mirror_init(void);
-H5_DLL herr_t H5Pget_fapl_mirror(hid_t fapl_id, H5FD_mirror_fapl_t *fa_out);
-H5_DLL herr_t H5Pset_fapl_mirror(hid_t fapl_id, H5FD_mirror_fapl_t *fa);
-
-/* = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =
- * IPC - Mirror VFD and Remote Worker application.
- * = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =
- */
-
-/* The maximum allowed size for a receiving buffer when accepting bytes to
- * write. Writes larger than this size are performed by multiple accept-write
- * steps by the Writer. */
-#define H5FD_MIRROR_DATA_BUFFER_MAX H5_GB /* 1 Gigabyte */
-
-#define H5FD_MIRROR_XMIT_CURR_VERSION 1
-#define H5FD_MIRROR_XMIT_MAGIC 0x87F8005B
-
-#define H5FD_MIRROR_OP_OPEN 1
-#define H5FD_MIRROR_OP_CLOSE 2
-#define H5FD_MIRROR_OP_WRITE 3
-#define H5FD_MIRROR_OP_TRUNCATE 4
-#define H5FD_MIRROR_OP_REPLY 5
-#define H5FD_MIRROR_OP_SET_EOA 6
-#define H5FD_MIRROR_OP_LOCK 7
-#define H5FD_MIRROR_OP_UNLOCK 8
-
-#define H5FD_MIRROR_STATUS_OK 0
-#define H5FD_MIRROR_STATUS_ERROR 1
-#define H5FD_MIRROR_STATUS_MESSAGE_MAX 256 /* Dedicated error message size */
-
-/* Maximum length of a path/filename string, including the NULL-terminator.
- * Must not be smaller than H5FD_SPLITTER_PATH_MAX. */
-#define H5FD_MIRROR_XMIT_FILEPATH_MAX 4097
-
-/* Define the exact sizes of the various xmit blobs as sent over the wire.
- * This is used to minimize the number of bytes transmitted as well as to
- * sanity-check received bytes.
- * Any modifications to the xmit structures and/or the encode/decode functions
- * must be reflected here.
- * */
-#define H5FD_MIRROR_XMIT_HEADER_SIZE 14
-#define H5FD_MIRROR_XMIT_EOA_SIZE (H5FD_MIRROR_XMIT_HEADER_SIZE + 9)
-#define H5FD_MIRROR_XMIT_LOCK_SIZE (H5FD_MIRROR_XMIT_HEADER_SIZE + 8)
-#define H5FD_MIRROR_XMIT_OPEN_SIZE (H5FD_MIRROR_XMIT_HEADER_SIZE + 20 + H5FD_MIRROR_XMIT_FILEPATH_MAX)
-#define H5FD_MIRROR_XMIT_REPLY_SIZE (H5FD_MIRROR_XMIT_HEADER_SIZE + 4 + H5FD_MIRROR_STATUS_MESSAGE_MAX)
-#define H5FD_MIRROR_XMIT_WRITE_SIZE (H5FD_MIRROR_XMIT_HEADER_SIZE + 17)
+H5_DLL hid_t H5FD_mirror_init(void);
-/* Maximum length of any xmit. */
-#define H5FD_MIRROR_XMIT_BUFFER_MAX \
- MAX2(MAX3(H5FD_MIRROR_XMIT_HEADER_SIZE, H5FD_MIRROR_XMIT_EOA_SIZE, H5FD_MIRROR_XMIT_LOCK_SIZE), \
- MAX3(H5FD_MIRROR_XMIT_OPEN_SIZE, H5FD_MIRROR_XMIT_REPLY_SIZE, H5FD_MIRROR_XMIT_WRITE_SIZE))
-
-/* ---------------------------------------------------------------------------
- * Structure: H5FD_mirror_xmit_t
- *
- * Common structure 'header' for all mirror VFD/worker IPC.
- * Must be the first component of a derived operation xmit structure,
- * such as file-open or write command.
- *
- * `magic` (uint32_t)
- * A "unique" number identifying the structure and endianness of
- * transmitting maching.
- * Must be set to H5FD_MIRROR_XMIT_MAGIC native to the VFD "sender".
+/**
+ * \ingroup FAPL
*
- * `version` (uint8_t)
- * Number used to identify the structure membership.
- * Allows sane modifications to this structure in the future.
- * Must be set to H5FD_MIRROR_XMIT_CURR_VERSION.
- *
- * `session_token` (uint32_t)
- * A "unique" number identifying the session between VFD sender and
- * remote receiver/worker/writer. Exists to help sanity-check.
- *
- * `xmit_count` (uint32_t)
- * Which transmission this is since the session began.
- * Used to sanity-check transmission errors.
- * First xmit (file-open) must be 0.
- *
- * `op` (uint8_t)
- * Number identifying which operation to perform.
- * Corresponds with the extended structure outside of this xmit header.
- * Possible values are all defined H5FD_MIRROR_OP_* constants.
- *
- * ---------------------------------------------------------------------------
+ * \todo Add missing documentation
*/
-typedef struct H5FD_mirror_xmit_t {
- uint32_t magic;
- uint8_t version;
- uint32_t session_token;
- uint32_t xmit_count;
- uint8_t op;
-} H5FD_mirror_xmit_t;
-
-/* ---------------------------------------------------------------------------
- * Structure: H5FD_mirror_xmit_eoa_t
- *
- * Structure containing eoa-set information from VFD sender.
- *
- * `pub` (H5FD_mirror_xmit_t)
- * Common transmission header, containing session information.
- * Must be first.
- *
- * `type` (uint8_t)
- * System-independent alias for H5F[D]_mem_t.
- * Specifies datatype to be written.
- *
- * `eoa_addr` (uint64_t)
- * New address for eoa.
- * (Natively 'haddr_t', always a 64-bit field)
- *
- * ---------------------------------------------------------------------------
- */
-typedef struct H5FD_mirror_xmit_eoa_t {
- H5FD_mirror_xmit_t pub;
- uint8_t type;
- uint64_t eoa_addr;
-} H5FD_mirror_xmit_eoa_t;
-
-/* ---------------------------------------------------------------------------
- * Structure: H5FD_mirror_xmit_lock_t
- *
- * Structure containing eoa-set information from VFD sender.
- *
- * `pub` (H5FD_mirror_xmit_t)
- * Common transmission header, containing session information.
- * Must be first.
- *
- * `rw` (uint64_t)
- * The Read/Write mode flag passed into H5FDlock().
- * (Natively `hbool_t`, an 'int') TODO: native int may be 64-bit?
- *
- * ---------------------------------------------------------------------------
- */
-typedef struct H5FD_mirror_xmit_lock_t {
- H5FD_mirror_xmit_t pub;
- uint64_t rw;
-} H5FD_mirror_xmit_lock_t;
-
-/* ---------------------------------------------------------------------------
- * Structure: H5FD_mirror_xmit_open_t
- *
- * Structure containing file-open information from the VFD sender.
- *
- * `pub` (H5FD_mirror_xmit_t)
- * Common transmission header, containing session information.
- * Must be first.
- *
- * `flags` (uint32_t)
- * VFL-layer file-open flags passed directly to H5FDopen().
- * (Natively 'unsigned [int]') TODO: native int may be 64-bit?
- *
- * `maxaddr` (uint64_t)
- * VFL-layer maximum allowed address space for the file to open passed
- * directly to H5FDopen().
- * (Natively 'haddr_t', always a 64-bit field)
- *
- * `size_t_blob` (uint64_t)
- * A number indicating how large a size_t is on the sending system.
- * Must be set to (uint64_t)((size_t)(-1))
- * (maximum possible value of size_t, cast to uint64_t).
- * The receiving system inspects this value -- if the local (remote)
- * size_t is smaller than that of the Sender, issues a warning.
- * Not an error, as:
- * 1. It is assumed that underlying file systems/drivers have become
- * smart enough to handle file sizes that otherwise might be
- * constrained.
- * 2. The Mirror Writer ingests bytes to write multiple 'slices' if the
- * size is greater than H5FD_MIRROR_DATA_BUFFER_MAX, regardless of
- * any size_t storage size disparity.
- *
- * `filename` (char[])
- * String giving the filename and path of file to open.
- *
- * ---------------------------------------------------------------------------
- */
-typedef struct H5FD_mirror_xmit_open_t {
- H5FD_mirror_xmit_t pub;
- uint32_t flags;
- uint64_t maxaddr;
- uint64_t size_t_blob;
- char filename[H5FD_MIRROR_XMIT_FILEPATH_MAX];
-} H5FD_mirror_xmit_open_t;
-
-/* ---------------------------------------------------------------------------
- * Structure: H5FD_mirror_xmit_reply_t
- *
- * Structure used by the remote receiver/worker/writer to respond to
- * a command from the VFD sender.
- *
- * `pub` (H5FD_mirror_xmit_t)
- * Common transmission header, containing session information.
- * Must be first.
- *
- * `status` (uint32_t)
- * Number indicating whether the command was successful or if an
- * occured.
- * Allowed values are H5FD_MIRROR_STATUS_OK and
- * H5FD_MIRROR_STATUS_ERROR.
- *
- * `message` (char[])
- * Error message. Populated if and only if there was a problem.
- * It is possible that a message may reach the end of the alloted
- * space without a NULL terminator -- the onus is on the programmer to
- * handle this situation.
- *
- * ---------------------------------------------------------------------------
- */
-typedef struct H5FD_mirror_xmit_reply_t {
- H5FD_mirror_xmit_t pub;
- uint32_t status;
- char message[H5FD_MIRROR_STATUS_MESSAGE_MAX];
-} H5FD_mirror_xmit_reply_t;
-
-/* ---------------------------------------------------------------------------
- * Structure: H5FD_mirror_xmit_write_t
- *
- * Structure containing data-write information from VFD sender.
- *
- * The data to be written is transmitted in subsequent, packets
- * and may be broken up into more than one transmission buffer.
- * The VFD sender and remote receiver/worker/writer must coordinate
- * the receipt of data.
- *
- * `pub` (H5FD_mirror_xmit_t)
- * Common transmission header, containing session information.
- * Must be first.
- *
- * `type` (uint8_t)
- * Specifies datatype to be written.
- * (Natively 'H5FD_mem_t', an enumerated type in H5Fpublic.h)
- *
- * `offset` (uint64_t)
- * Start location of write in file.
- * (Natively 'haddr_t', always a 64-bit field)
- *
- * `size` (uint64_t)
- * Size of the data to be written, in bytes.
- * (Natively 'size_t', accommodate the largest possible as 64-bits)
- *
- * ---------------------------------------------------------------------------
- */
-typedef struct H5FD_mirror_xmit_write_t {
- H5FD_mirror_xmit_t pub;
- uint8_t type;
- uint64_t offset;
- uint64_t size;
-} H5FD_mirror_xmit_write_t;
+H5_DLL herr_t H5Pget_fapl_mirror(hid_t fapl_id, H5FD_mirror_fapl_t *fa_out);
-/* Encode/decode routines are required to "pack" the xmit data into a known
- * byte format for transmission over the wire.
- *
- * All component numbers must be stored in "network" word order (Big-Endian).
+/**
+ * \ingroup FAPL
*
- * All components must be packed in the order given in the structure definition.
- *
- * All components must be packed with zero padding between.
+ * \todo Add missing documentation
*/
-
-H5_DLL size_t H5FD__mirror_xmit_decode_uint16(uint16_t *out, const unsigned char *buf);
-H5_DLL size_t H5FD__mirror_xmit_decode_uint32(uint32_t *out, const unsigned char *buf);
-H5_DLL size_t H5FD__mirror_xmit_decode_uint64(uint64_t *out, const unsigned char *buf);
-H5_DLL size_t H5FD__mirror_xmit_decode_uint8(uint8_t *out, const unsigned char *buf);
-H5_DLL size_t H5FD__mirror_xmit_encode_uint16(unsigned char *dest, uint16_t v);
-H5_DLL size_t H5FD__mirror_xmit_encode_uint32(unsigned char *dest, uint32_t v);
-H5_DLL size_t H5FD__mirror_xmit_encode_uint64(unsigned char *dest, uint64_t v);
-H5_DLL size_t H5FD__mirror_xmit_encode_uint8(unsigned char *dest, uint8_t v);
-
-H5_DLL size_t H5FD_mirror_xmit_decode_header(H5FD_mirror_xmit_t *out, const unsigned char *buf);
-H5_DLL size_t H5FD_mirror_xmit_decode_lock(H5FD_mirror_xmit_lock_t *out, const unsigned char *buf);
-H5_DLL size_t H5FD_mirror_xmit_decode_open(H5FD_mirror_xmit_open_t *out, const unsigned char *buf);
-H5_DLL size_t H5FD_mirror_xmit_decode_reply(H5FD_mirror_xmit_reply_t *out, const unsigned char *buf);
-H5_DLL size_t H5FD_mirror_xmit_decode_set_eoa(H5FD_mirror_xmit_eoa_t *out, const unsigned char *buf);
-H5_DLL size_t H5FD_mirror_xmit_decode_write(H5FD_mirror_xmit_write_t *out, const unsigned char *buf);
-
-H5_DLL size_t H5FD_mirror_xmit_encode_header(unsigned char *dest, const H5FD_mirror_xmit_t *x);
-H5_DLL size_t H5FD_mirror_xmit_encode_lock(unsigned char *dest, const H5FD_mirror_xmit_lock_t *x);
-H5_DLL size_t H5FD_mirror_xmit_encode_open(unsigned char *dest, const H5FD_mirror_xmit_open_t *x);
-H5_DLL size_t H5FD_mirror_xmit_encode_reply(unsigned char *dest, const H5FD_mirror_xmit_reply_t *x);
-H5_DLL size_t H5FD_mirror_xmit_encode_set_eoa(unsigned char *dest, const H5FD_mirror_xmit_eoa_t *x);
-H5_DLL size_t H5FD_mirror_xmit_encode_write(unsigned char *dest, const H5FD_mirror_xmit_write_t *x);
-
-H5_DLL hbool_t H5FD_mirror_xmit_is_close(const H5FD_mirror_xmit_t *xmit);
-H5_DLL hbool_t H5FD_mirror_xmit_is_lock(const H5FD_mirror_xmit_lock_t *xmit);
-H5_DLL hbool_t H5FD_mirror_xmit_is_open(const H5FD_mirror_xmit_open_t *xmit);
-H5_DLL hbool_t H5FD_mirror_xmit_is_reply(const H5FD_mirror_xmit_reply_t *xmit);
-H5_DLL hbool_t H5FD_mirror_xmit_is_set_eoa(const H5FD_mirror_xmit_eoa_t *xmit);
-H5_DLL hbool_t H5FD_mirror_xmit_is_write(const H5FD_mirror_xmit_write_t *xmit);
-H5_DLL hbool_t H5FD_mirror_xmit_is_xmit(const H5FD_mirror_xmit_t *xmit);
+H5_DLL herr_t H5Pset_fapl_mirror(hid_t fapl_id, H5FD_mirror_fapl_t *fa);
#ifdef __cplusplus
}
diff --git a/src/H5FDmirror_priv.h b/src/H5FDmirror_priv.h
new file mode 100644
index 0000000..21de97b
--- /dev/null
+++ b/src/H5FDmirror_priv.h
@@ -0,0 +1,317 @@
+/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
+ * Copyright by The HDF Group. *
+ * All rights reserved. *
+ * *
+ * This file is part of HDF5. The full HDF5 copyright notice, including *
+ * terms governing use, modification, and redistribution, is contained in *
+ * the COPYING file, which can be found at the root of the source code *
+ * distribution tree, or in https://www.hdfgroup.org/licenses. *
+ * If you do not have access to either file, you may request a copy from *
+ * help@hdfgroup.org. *
+ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
+
+/*
+ * Purpose: Public, shared definitions for Mirror VFD & remote Writer.
+ */
+
+#ifndef H5FDmirror_priv_H
+#define H5FDmirror_priv_H
+
+#ifdef H5_HAVE_MIRROR_VFD
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/* = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =
+ * IPC - Mirror VFD and Remote Worker application.
+ * = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =
+ */
+
+/* The maximum allowed size for a receiving buffer when accepting bytes to
+ * write. Writes larger than this size are performed by multiple accept-write
+ * steps by the Writer. */
+#define H5FD_MIRROR_DATA_BUFFER_MAX H5_GB /* 1 Gigabyte */
+
+#define H5FD_MIRROR_XMIT_CURR_VERSION 1
+#define H5FD_MIRROR_XMIT_MAGIC 0x87F8005B
+
+#define H5FD_MIRROR_OP_OPEN 1
+#define H5FD_MIRROR_OP_CLOSE 2
+#define H5FD_MIRROR_OP_WRITE 3
+#define H5FD_MIRROR_OP_TRUNCATE 4
+#define H5FD_MIRROR_OP_REPLY 5
+#define H5FD_MIRROR_OP_SET_EOA 6
+#define H5FD_MIRROR_OP_LOCK 7
+#define H5FD_MIRROR_OP_UNLOCK 8
+
+#define H5FD_MIRROR_STATUS_OK 0
+#define H5FD_MIRROR_STATUS_ERROR 1
+#define H5FD_MIRROR_STATUS_MESSAGE_MAX 256 /* Dedicated error message size */
+
+/* Maximum length of a path/filename string, including the NULL-terminator.
+ * Must not be smaller than H5FD_SPLITTER_PATH_MAX. */
+#define H5FD_MIRROR_XMIT_FILEPATH_MAX 4097
+
+/* Define the exact sizes of the various xmit blobs as sent over the wire.
+ * This is used to minimize the number of bytes transmitted as well as to
+ * sanity-check received bytes.
+ * Any modifications to the xmit structures and/or the encode/decode functions
+ * must be reflected here.
+ * */
+#define H5FD_MIRROR_XMIT_HEADER_SIZE 14
+#define H5FD_MIRROR_XMIT_EOA_SIZE (H5FD_MIRROR_XMIT_HEADER_SIZE + 9)
+#define H5FD_MIRROR_XMIT_LOCK_SIZE (H5FD_MIRROR_XMIT_HEADER_SIZE + 8)
+#define H5FD_MIRROR_XMIT_OPEN_SIZE (H5FD_MIRROR_XMIT_HEADER_SIZE + 20 + H5FD_MIRROR_XMIT_FILEPATH_MAX)
+#define H5FD_MIRROR_XMIT_REPLY_SIZE (H5FD_MIRROR_XMIT_HEADER_SIZE + 4 + H5FD_MIRROR_STATUS_MESSAGE_MAX)
+#define H5FD_MIRROR_XMIT_WRITE_SIZE (H5FD_MIRROR_XMIT_HEADER_SIZE + 17)
+
+/* Maximum length of any xmit. */
+#define H5FD_MIRROR_XMIT_BUFFER_MAX \
+ MAX2(MAX3(H5FD_MIRROR_XMIT_HEADER_SIZE, H5FD_MIRROR_XMIT_EOA_SIZE, H5FD_MIRROR_XMIT_LOCK_SIZE), \
+ MAX3(H5FD_MIRROR_XMIT_OPEN_SIZE, H5FD_MIRROR_XMIT_REPLY_SIZE, H5FD_MIRROR_XMIT_WRITE_SIZE))
+
+/* ---------------------------------------------------------------------------
+ * Structure: H5FD_mirror_xmit_t
+ *
+ * Common structure 'header' for all mirror VFD/worker IPC.
+ * Must be the first component of a derived operation xmit structure,
+ * such as file-open or write command.
+ *
+ * `magic` (uint32_t)
+ * A "unique" number identifying the structure and endianness of
+ * transmitting maching.
+ * Must be set to H5FD_MIRROR_XMIT_MAGIC native to the VFD "sender".
+ *
+ * `version` (uint8_t)
+ * Number used to identify the structure membership.
+ * Allows sane modifications to this structure in the future.
+ * Must be set to H5FD_MIRROR_XMIT_CURR_VERSION.
+ *
+ * `session_token` (uint32_t)
+ * A "unique" number identifying the session between VFD sender and
+ * remote receiver/worker/writer. Exists to help sanity-check.
+ *
+ * `xmit_count` (uint32_t)
+ * Which transmission this is since the session began.
+ * Used to sanity-check transmission errors.
+ * First xmit (file-open) must be 0.
+ *
+ * `op` (uint8_t)
+ * Number identifying which operation to perform.
+ * Corresponds with the extended structure outside of this xmit header.
+ * Possible values are all defined H5FD_MIRROR_OP_* constants.
+ *
+ * ---------------------------------------------------------------------------
+ */
+typedef struct H5FD_mirror_xmit_t {
+ uint32_t magic;
+ uint8_t version;
+ uint32_t session_token;
+ uint32_t xmit_count;
+ uint8_t op;
+} H5FD_mirror_xmit_t;
+
+/* ---------------------------------------------------------------------------
+ * Structure: H5FD_mirror_xmit_eoa_t
+ *
+ * Structure containing eoa-set information from VFD sender.
+ *
+ * `pub` (H5FD_mirror_xmit_t)
+ * Common transmission header, containing session information.
+ * Must be first.
+ *
+ * `type` (uint8_t)
+ * System-independent alias for H5F[D]_mem_t.
+ * Specifies datatype to be written.
+ *
+ * `eoa_addr` (uint64_t)
+ * New address for eoa.
+ * (Natively 'haddr_t', always a 64-bit field)
+ *
+ * ---------------------------------------------------------------------------
+ */
+typedef struct H5FD_mirror_xmit_eoa_t {
+ H5FD_mirror_xmit_t pub;
+ uint8_t type;
+ uint64_t eoa_addr;
+} H5FD_mirror_xmit_eoa_t;
+
+/* ---------------------------------------------------------------------------
+ * Structure: H5FD_mirror_xmit_lock_t
+ *
+ * Structure containing eoa-set information from VFD sender.
+ *
+ * `pub` (H5FD_mirror_xmit_t)
+ * Common transmission header, containing session information.
+ * Must be first.
+ *
+ * `rw` (uint64_t)
+ * The Read/Write mode flag passed into H5FDlock().
+ * (Natively `hbool_t`, an 'int') TODO: native int may be 64-bit?
+ *
+ * ---------------------------------------------------------------------------
+ */
+typedef struct H5FD_mirror_xmit_lock_t {
+ H5FD_mirror_xmit_t pub;
+ uint64_t rw;
+} H5FD_mirror_xmit_lock_t;
+
+/* ---------------------------------------------------------------------------
+ * Structure: H5FD_mirror_xmit_open_t
+ *
+ * Structure containing file-open information from the VFD sender.
+ *
+ * `pub` (H5FD_mirror_xmit_t)
+ * Common transmission header, containing session information.
+ * Must be first.
+ *
+ * `flags` (uint32_t)
+ * VFL-layer file-open flags passed directly to H5FDopen().
+ * (Natively 'unsigned [int]') TODO: native int may be 64-bit?
+ *
+ * `maxaddr` (uint64_t)
+ * VFL-layer maximum allowed address space for the file to open passed
+ * directly to H5FDopen().
+ * (Natively 'haddr_t', always a 64-bit field)
+ *
+ * `size_t_blob` (uint64_t)
+ * A number indicating how large a size_t is on the sending system.
+ * Must be set to (uint64_t)((size_t)(-1))
+ * (maximum possible value of size_t, cast to uint64_t).
+ * The receiving system inspects this value -- if the local (remote)
+ * size_t is smaller than that of the Sender, issues a warning.
+ * Not an error, as:
+ * 1. It is assumed that underlying file systems/drivers have become
+ * smart enough to handle file sizes that otherwise might be
+ * constrained.
+ * 2. The Mirror Writer ingests bytes to write multiple 'slices' if the
+ * size is greater than H5FD_MIRROR_DATA_BUFFER_MAX, regardless of
+ * any size_t storage size disparity.
+ *
+ * `filename` (char[])
+ * String giving the filename and path of file to open.
+ *
+ * ---------------------------------------------------------------------------
+ */
+typedef struct H5FD_mirror_xmit_open_t {
+ H5FD_mirror_xmit_t pub;
+ uint32_t flags;
+ uint64_t maxaddr;
+ uint64_t size_t_blob;
+ char filename[H5FD_MIRROR_XMIT_FILEPATH_MAX];
+} H5FD_mirror_xmit_open_t;
+
+/* ---------------------------------------------------------------------------
+ * Structure: H5FD_mirror_xmit_reply_t
+ *
+ * Structure used by the remote receiver/worker/writer to respond to
+ * a command from the VFD sender.
+ *
+ * `pub` (H5FD_mirror_xmit_t)
+ * Common transmission header, containing session information.
+ * Must be first.
+ *
+ * `status` (uint32_t)
+ * Number indicating whether the command was successful or if an
+ * occured.
+ * Allowed values are H5FD_MIRROR_STATUS_OK and
+ * H5FD_MIRROR_STATUS_ERROR.
+ *
+ * `message` (char[])
+ * Error message. Populated if and only if there was a problem.
+ * It is possible that a message may reach the end of the alloted
+ * space without a NULL terminator -- the onus is on the programmer to
+ * handle this situation.
+ *
+ * ---------------------------------------------------------------------------
+ */
+typedef struct H5FD_mirror_xmit_reply_t {
+ H5FD_mirror_xmit_t pub;
+ uint32_t status;
+ char message[H5FD_MIRROR_STATUS_MESSAGE_MAX];
+} H5FD_mirror_xmit_reply_t;
+
+/* ---------------------------------------------------------------------------
+ * Structure: H5FD_mirror_xmit_write_t
+ *
+ * Structure containing data-write information from VFD sender.
+ *
+ * The data to be written is transmitted in subsequent, packets
+ * and may be broken up into more than one transmission buffer.
+ * The VFD sender and remote receiver/worker/writer must coordinate
+ * the receipt of data.
+ *
+ * `pub` (H5FD_mirror_xmit_t)
+ * Common transmission header, containing session information.
+ * Must be first.
+ *
+ * `type` (uint8_t)
+ * Specifies datatype to be written.
+ * (Natively 'H5FD_mem_t', an enumerated type in H5Fpublic.h)
+ *
+ * `offset` (uint64_t)
+ * Start location of write in file.
+ * (Natively 'haddr_t', always a 64-bit field)
+ *
+ * `size` (uint64_t)
+ * Size of the data to be written, in bytes.
+ * (Natively 'size_t', accommodate the largest possible as 64-bits)
+ *
+ * ---------------------------------------------------------------------------
+ */
+typedef struct H5FD_mirror_xmit_write_t {
+ H5FD_mirror_xmit_t pub;
+ uint8_t type;
+ uint64_t offset;
+ uint64_t size;
+} H5FD_mirror_xmit_write_t;
+
+/* Encode/decode routines are required to "pack" the xmit data into a known
+ * byte format for transmission over the wire.
+ *
+ * All component numbers must be stored in "network" word order (Big-Endian).
+ *
+ * All components must be packed in the order given in the structure definition.
+ *
+ * All components must be packed with zero padding between.
+ */
+
+H5_DLL size_t H5FD__mirror_xmit_decode_uint16(uint16_t *out, const unsigned char *buf);
+H5_DLL size_t H5FD__mirror_xmit_decode_uint32(uint32_t *out, const unsigned char *buf);
+H5_DLL size_t H5FD__mirror_xmit_decode_uint64(uint64_t *out, const unsigned char *buf);
+H5_DLL size_t H5FD__mirror_xmit_decode_uint8(uint8_t *out, const unsigned char *buf);
+H5_DLL size_t H5FD__mirror_xmit_encode_uint16(unsigned char *dest, uint16_t v);
+H5_DLL size_t H5FD__mirror_xmit_encode_uint32(unsigned char *dest, uint32_t v);
+H5_DLL size_t H5FD__mirror_xmit_encode_uint64(unsigned char *dest, uint64_t v);
+H5_DLL size_t H5FD__mirror_xmit_encode_uint8(unsigned char *dest, uint8_t v);
+
+H5_DLL size_t H5FD_mirror_xmit_decode_header(H5FD_mirror_xmit_t *out, const unsigned char *buf);
+H5_DLL size_t H5FD_mirror_xmit_decode_lock(H5FD_mirror_xmit_lock_t *out, const unsigned char *buf);
+H5_DLL size_t H5FD_mirror_xmit_decode_open(H5FD_mirror_xmit_open_t *out, const unsigned char *buf);
+H5_DLL size_t H5FD_mirror_xmit_decode_reply(H5FD_mirror_xmit_reply_t *out, const unsigned char *buf);
+H5_DLL size_t H5FD_mirror_xmit_decode_set_eoa(H5FD_mirror_xmit_eoa_t *out, const unsigned char *buf);
+H5_DLL size_t H5FD_mirror_xmit_decode_write(H5FD_mirror_xmit_write_t *out, const unsigned char *buf);
+
+H5_DLL size_t H5FD_mirror_xmit_encode_header(unsigned char *dest, const H5FD_mirror_xmit_t *x);
+H5_DLL size_t H5FD_mirror_xmit_encode_lock(unsigned char *dest, const H5FD_mirror_xmit_lock_t *x);
+H5_DLL size_t H5FD_mirror_xmit_encode_open(unsigned char *dest, const H5FD_mirror_xmit_open_t *x);
+H5_DLL size_t H5FD_mirror_xmit_encode_reply(unsigned char *dest, const H5FD_mirror_xmit_reply_t *x);
+H5_DLL size_t H5FD_mirror_xmit_encode_set_eoa(unsigned char *dest, const H5FD_mirror_xmit_eoa_t *x);
+H5_DLL size_t H5FD_mirror_xmit_encode_write(unsigned char *dest, const H5FD_mirror_xmit_write_t *x);
+
+H5_DLL hbool_t H5FD_mirror_xmit_is_close(const H5FD_mirror_xmit_t *xmit);
+H5_DLL hbool_t H5FD_mirror_xmit_is_lock(const H5FD_mirror_xmit_lock_t *xmit);
+H5_DLL hbool_t H5FD_mirror_xmit_is_open(const H5FD_mirror_xmit_open_t *xmit);
+H5_DLL hbool_t H5FD_mirror_xmit_is_reply(const H5FD_mirror_xmit_reply_t *xmit);
+H5_DLL hbool_t H5FD_mirror_xmit_is_set_eoa(const H5FD_mirror_xmit_eoa_t *xmit);
+H5_DLL hbool_t H5FD_mirror_xmit_is_write(const H5FD_mirror_xmit_write_t *xmit);
+H5_DLL hbool_t H5FD_mirror_xmit_is_xmit(const H5FD_mirror_xmit_t *xmit);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* H5_HAVE_MIRROR_VFD */
+
+#endif /* H5FDmirror_priv_H */
diff --git a/src/H5FDmpi.h b/src/H5FDmpi.h
index 3af5e41..cf49301 100644
--- a/src/H5FDmpi.h
+++ b/src/H5FDmpi.h
@@ -34,10 +34,12 @@
*/
#define H5D_MULTI_CHUNK_IO_COL_THRESHOLD 60
-/* Type of I/O for data transfer properties */
+/**
+ * Type of I/O for data transfer properties
+ */
typedef enum H5FD_mpio_xfer_t {
- H5FD_MPIO_INDEPENDENT = 0, /*zero is the default*/
- H5FD_MPIO_COLLECTIVE
+ H5FD_MPIO_INDEPENDENT = 0, /**< Use independent I/O access */
+ H5FD_MPIO_COLLECTIVE /**< Use collective I/O access */
} H5FD_mpio_xfer_t;
/* Type of chunked dataset I/O */
diff --git a/src/H5FDmpio.c b/src/H5FDmpio.c
index 9dbd443..b229207 100644
--- a/src/H5FDmpio.c
+++ b/src/H5FDmpio.c
@@ -86,6 +86,7 @@ static herr_t H5FD__mpio_write(H5FD_t *_file, H5FD_mem_t type, hid_t dxpl_id,
const void *buf);
static herr_t H5FD__mpio_flush(H5FD_t *_file, hid_t dxpl_id, hbool_t closing);
static herr_t H5FD__mpio_truncate(H5FD_t *_file, hid_t dxpl_id, hbool_t closing);
+static herr_t H5FD__mpio_delete(const char *filename, hid_t fapl_id);
static int H5FD__mpio_mpi_rank(const H5FD_t *_file);
static int H5FD__mpio_mpi_size(const H5FD_t *_file);
static MPI_Comm H5FD__mpio_communicator(const H5FD_t *_file);
@@ -94,43 +95,44 @@ static MPI_Comm H5FD__mpio_communicator(const H5FD_t *_file);
static const H5FD_class_mpi_t H5FD_mpio_g = {
{
/* Start of superclass information */
- "mpio", /*name */
- HADDR_MAX, /*maxaddr */
- H5F_CLOSE_SEMI, /*fc_degree */
- H5FD__mpio_term, /*terminate */
- NULL, /*sb_size */
- NULL, /*sb_encode */
- NULL, /*sb_decode */
- 0, /*fapl_size */
- NULL, /*fapl_get */
- NULL, /*fapl_copy */
- NULL, /*fapl_free */
- 0, /*dxpl_size */
- NULL, /*dxpl_copy */
- NULL, /*dxpl_free */
- H5FD__mpio_open, /*open */
- H5FD__mpio_close, /*close */
- NULL, /*cmp */
- H5FD__mpio_query, /*query */
- NULL, /*get_type_map */
- NULL, /*alloc */
- NULL, /*free */
- H5FD__mpio_get_eoa, /*get_eoa */
- H5FD__mpio_set_eoa, /*set_eoa */
- H5FD__mpio_get_eof, /*get_eof */
- H5FD__mpio_get_handle, /*get_handle */
- H5FD__mpio_read, /*read */
- H5FD__mpio_write, /*write */
- H5FD__mpio_flush, /*flush */
- H5FD__mpio_truncate, /*truncate */
- NULL, /*lock */
- NULL, /*unlock */
- NULL, /* dedup */
- H5FD_FLMAP_DICHOTOMY /*fl_map */
+ "mpio", /* name */
+ HADDR_MAX, /* maxaddr */
+ H5F_CLOSE_SEMI, /* fc_degree */
+ H5FD__mpio_term, /* terminate */
+ NULL, /* sb_size */
+ NULL, /* sb_encode */
+ NULL, /* sb_decode */
+ 0, /* fapl_size */
+ NULL, /* fapl_get */
+ NULL, /* fapl_copy */
+ NULL, /* fapl_free */
+ 0, /* dxpl_size */
+ NULL, /* dxpl_copy */
+ NULL, /* dxpl_free */
+ H5FD__mpio_open, /* open */
+ H5FD__mpio_close, /* close */
+ NULL, /* cmp */
+ H5FD__mpio_query, /* query */
+ NULL, /* get_type_map */
+ NULL, /* alloc */
+ NULL, /* free */
+ H5FD__mpio_get_eoa, /* get_eoa */
+ H5FD__mpio_set_eoa, /* set_eoa */
+ H5FD__mpio_get_eof, /* get_eof */
+ H5FD__mpio_get_handle, /* get_handle */
+ H5FD__mpio_read, /* read */
+ H5FD__mpio_write, /* write */
+ H5FD__mpio_flush, /* flush */
+ H5FD__mpio_truncate, /* truncate */
+ NULL, /* lock */
+ NULL, /* unlock */
+ H5FD__mpio_delete, /* del */
+ NULL, /* dedup */
+ H5FD_FLMAP_DICHOTOMY /* fl_map */
}, /* End of superclass information */
- H5FD__mpio_mpi_rank, /*get_rank */
- H5FD__mpio_mpi_size, /*get_size */
- H5FD__mpio_communicator /*get_comm */
+ H5FD__mpio_mpi_rank, /* get_rank */
+ H5FD__mpio_mpi_size, /* get_size */
+ H5FD__mpio_communicator /* get_comm */
};
#ifdef H5FDmpio_DEBUG
@@ -1747,6 +1749,60 @@ done:
} /* end H5FD__mpio_truncate() */
/*-------------------------------------------------------------------------
+ * Function: H5FD__mpio_delete
+ *
+ * Purpose: Delete a file
+ *
+ * Return: SUCCEED/FAIL
+ *
+ *-------------------------------------------------------------------------
+ */
+static herr_t
+H5FD__mpio_delete(const char *filename, hid_t fapl_id)
+{
+ H5P_genplist_t *plist; /* Property list pointer */
+ MPI_Comm comm = MPI_COMM_NULL;
+ MPI_Info info = MPI_INFO_NULL;
+ int mpi_rank = INT_MAX;
+ int mpi_code; /* MPI return code */
+ herr_t ret_value = SUCCEED; /* Return value */
+
+ FUNC_ENTER_STATIC
+
+ HDassert(filename);
+
+ if (NULL == (plist = H5P_object_verify(fapl_id, H5P_FILE_ACCESS)))
+ HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a file access property list")
+ HDassert(H5FD_MPIO == H5P_peek_driver(plist));
+
+ /* Get the MPI communicator and info from the fapl */
+ if (H5P_get(plist, H5F_ACS_MPI_PARAMS_INFO_NAME, &info) < 0)
+ HGOTO_ERROR(H5E_VFL, H5E_CANTGET, FAIL, "can't get MPI info object")
+ if (H5P_get(plist, H5F_ACS_MPI_PARAMS_COMM_NAME, &comm) < 0)
+ HGOTO_ERROR(H5E_VFL, H5E_CANTGET, FAIL, "can't get MPI communicator")
+
+ /* Get the MPI rank of this process */
+ if (MPI_SUCCESS != (mpi_code = MPI_Comm_rank(comm, &mpi_rank)))
+ HMPI_GOTO_ERROR(FAIL, "MPI_Comm_rank failed", mpi_code)
+
+ /* Set up a barrier */
+ if (MPI_SUCCESS != (mpi_code = MPI_Barrier(comm)))
+ HMPI_GOTO_ERROR(FAIL, "MPI_Barrier failed", mpi_code)
+
+ /* Delete the file */
+ if (mpi_rank == 0)
+ if (MPI_SUCCESS != (mpi_code = MPI_File_delete(filename, info)))
+ HMPI_GOTO_ERROR(FAIL, "MPI_File_delete failed", mpi_code)
+
+ /* Set up a barrier (don't want processes to run ahead of the delete) */
+ if (MPI_SUCCESS != (mpi_code = MPI_Barrier(comm)))
+ HMPI_GOTO_ERROR(FAIL, "MPI_Barrier failed", mpi_code)
+
+done:
+ FUNC_LEAVE_NOAPI(ret_value)
+} /* end H5FD__mpio_delete() */
+
+/*-------------------------------------------------------------------------
* Function: H5FD__mpio_mpi_rank
*
* Purpose: Returns the MPI rank for a process
diff --git a/src/H5FDmpio.h b/src/H5FDmpio.h
index 79b52c7..8caf11c 100644
--- a/src/H5FDmpio.h
+++ b/src/H5FDmpio.h
@@ -44,14 +44,237 @@ H5_DLLVAR hbool_t H5FD_mpi_opt_types_g;
#ifdef __cplusplus
extern "C" {
#endif
-H5_DLL hid_t H5FD_mpio_init(void);
+H5_DLL hid_t H5FD_mpio_init(void);
+
+/**
+ * \ingroup FAPL
+ *
+ * \brief Stores MPI IO communicator information to the file access property list
+ *
+ * \fapl_id
+ * \param[in] comm MPI-2 communicator
+ * \param[in] info MPI-2 info object
+ * \returns \herr_t
+ *
+ * \details H5Pset_fapl_mpio() stores the user-supplied MPI IO parameters \p
+ * comm, for communicator, and \p info, for information, in the file
+ * access property list \p fapl_id. That property list can then be used
+ * to create and/or open a file.
+ *
+ * H5Pset_fapl_mpio() is available only in the parallel HDF5 library
+ * and is not a collective function.
+ *
+ * \p comm is the MPI communicator to be used for file open, as defined
+ * in \c MPI_File_open of MPI-2. This function makes a duplicate of the
+ * communicator, so modifications to \p comm after this function call
+ * returns have no effect on the file access property list.
+ *
+ * \p info is the MPI Info object to be used for file open, as defined
+ * in MPI_File_open() of MPI-2. This function makes a duplicate copy of
+ * the Info object, so modifications to the Info object after this
+ * function call returns will have no effect on the file access
+ * property list.
+ *
+ * If the file access property list already contains previously-set
+ * communicator and Info values, those values will be replaced and the
+ * old communicator and Info object will be freed.
+ *
+ * \note Raw dataset chunk caching is not currently supported when using this
+ * file driver in read/write mode. All calls to H5Dread() and H5Dwrite()
+ * will access the disk directly, and H5Pset_cache() and
+ * H5Pset_chunk_cache() will have no effect on performance.\n
+ * Raw dataset chunk caching is supported when this driver is used in
+ * read-only mode.
+ *
+ * \version 1.4.5 Handling of the MPI Communicator and Info object changed at
+ * this release. A duplicate of each of these is now stored in the property
+ * list instead of pointers to each.
+ * \since 1.4.0
+ *
+ */
H5_DLL herr_t H5Pset_fapl_mpio(hid_t fapl_id, MPI_Comm comm, MPI_Info info);
+
+/**
+ * \ingroup FAPL
+ *
+ * \brief Returns MPI IO communicator information
+ *
+ * \fapl_id
+ * \param[out] comm MPI-2 communicator
+ * \param[out] info MPI-2 info object
+ * \returns \herr_t
+ *
+ * \details If the file access property list is set to the #H5FD_MPIO driver,
+ * H5Pget_fapl_mpio() returns duplicates of the stored MPI communicator
+ * and Info object through the \p comm and \p info pointers, if those
+ * values are non-null.
+ *
+ * Since the MPI communicator and Info object are duplicates of the
+ * stored information, future modifications to the access property list
+ * will not affect them. It is the responsibility of the application to
+ * free these objects.
+ *
+ * \version 1.4.5 Handling of the MPI Communicator and Info object changed at
+ * this release. A duplicate of each of these is now stored in the
+ * property list instead of pointers to each.
+ * \since 1.4.0
+ *
+ */
H5_DLL herr_t H5Pget_fapl_mpio(hid_t fapl_id, MPI_Comm *comm /*out*/, MPI_Info *info /*out*/);
+
+/**
+ * \ingroup DXPL
+ *
+ * \brief Sets data transfer mode
+ *
+ * \dxpl_id
+ * \param[in] xfer_mode Transfer mode
+ * \returns \herr_t
+ *
+ * \details H5Pset_dxpl_mpio() sets the data transfer property list \p dxpl_id
+ * to use transfer mode \p xfer_mode. The property list can then be
+ * used to control the I/O transfer mode during data I/O operations.
+ *
+ * Valid transfer modes are #H5FD_MPIO_INDEPENDENT (default) and
+ * #H5FD_MPIO_COLLECTIVE.
+ *
+ * \since 1.4.0
+ *
+ */
H5_DLL herr_t H5Pset_dxpl_mpio(hid_t dxpl_id, H5FD_mpio_xfer_t xfer_mode);
+
+/**
+ * \ingroup DXPL
+ *
+ * \brief Returns the data transfer mode
+ *
+ * \dxpl_id
+ * \param[out] xfer_mode Transfer mode
+ * \returns \herr_t
+ *
+ * \details H5Pget_dxpl_mpio() queries the data transfer mode currently set in
+ * the data transfer property list \p dxpl_id.
+ *
+ * Upon return, \p xfer_mode contains the data transfer mode, if it is
+ * non-null.
+ *
+ * H5Pget_dxpl_mpio() is not a collective function.
+ *
+ * \since 1.4.0
+ *
+ */
H5_DLL herr_t H5Pget_dxpl_mpio(hid_t dxpl_id, H5FD_mpio_xfer_t *xfer_mode /*out*/);
+
+/**
+ * \ingroup DXPL
+ *
+ * \brief Sets data transfer mode
+ *
+ * \dxpl_id
+ * \param[in] opt_mode Transfer mode
+ * \returns \herr_t
+ *
+ * \details H5Pset_dxpl_mpio() sets the data transfer property list \p dxpl_id
+ * to use transfer mode xfer_mode. The property list can then be used
+ * to control the I/O transfer mode during data I/O operations.
+ *
+ * Valid transfer modes are #H5FD_MPIO_INDEPENDENT (default) and
+ * #H5FD_MPIO_COLLECTIVE.
+ *
+ * \since 1.4.0
+ *
+ */
H5_DLL herr_t H5Pset_dxpl_mpio_collective_opt(hid_t dxpl_id, H5FD_mpio_collective_opt_t opt_mode);
+
+/**
+ * \ingroup DXPL
+ *
+ * \brief Sets a flag specifying linked-chunk I/O or multi-chunk I/O
+ *
+ * \dxpl_id
+ * \param[in] opt_mode Transfer mode
+ * \returns \herr_t
+ *
+ * \details H5Pset_dxpl_mpio_chunk_opt() specifies whether I/O is to be
+ * performed as linked-chunk I/O or as multi-chunk I/O. This function
+ * overrides the HDF5 library's internal algorithm for determining
+ * which mechanism to use.
+ *
+ * When an application uses collective I/O with chunked storage, the
+ * HDF5 library normally uses an internal algorithm to determine
+ * whether that I/O activity should be conducted as one linked-chunk
+ * I/O or as multi-chunk I/O. H5Pset_dxpl_mpio_chunk_opt() is provided
+ * so that an application can override the library's algorithm in
+ * circumstances where the library might lack the information needed to
+ * make an optimal decision.
+ *
+ * H5Pset_dxpl_mpio_chunk_opt() works by setting one of the following
+ * flags in the parameter \p opt_mode:
+ * - #H5FD_MPIO_CHUNK_ONE_IO - Do one-link chunked I/O
+ * - #H5FD_MPIO_CHUNK_MULTI_IO - Do multi-chunked I/O
+ *
+ * This function works by setting a corresponding property in the
+ * dataset transfer property list \p dxpl_id.
+ *
+ * The library performs I/O in the specified manner unless it
+ * determines that the low-level MPI IO package does not support the
+ * requested behavior; in such cases, the HDF5 library will internally
+ * use independent I/O.
+ *
+ * Use of this function is optional.
+ *
+ * \todo Add missing version information
+ *
+ */
H5_DLL herr_t H5Pset_dxpl_mpio_chunk_opt(hid_t dxpl_id, H5FD_mpio_chunk_opt_t opt_mode);
+
+/**
+ * \ingroup DXPL
+ *
+ * \brief Sets a numeric threshold for linked-chunk I/O
+ *
+ * \dxpl_id
+ * \param[in] num_chunk_per_proc
+ * \returns \herr_t
+ *
+ * \details H5Pset_dxpl_mpio_chunk_opt_num() sets a numeric threshold for the
+ * use of linked-chunk I/O.
+ *
+ * The library will calculate the average number of chunks selected by
+ * each process when doing collective access with chunked storage. If
+ * the number is greater than the threshold set in \p
+ * num_chunk_per_proc, the library will use linked-chunk I/O;
+ * otherwise, a separate I/O process will be invoked for each chunk
+ * (multi-chunk I/O).
+ *
+ * \todo Add missing version information
+ *
+ */
H5_DLL herr_t H5Pset_dxpl_mpio_chunk_opt_num(hid_t dxpl_id, unsigned num_chunk_per_proc);
+
+/**
+ * \ingroup DXPL
+ *
+ * \brief Sets a ratio threshold for collective I/O
+ *
+ * \dxpl_id
+ * \param[in] percent_num_proc_per_chunk
+ * \returns \herr_t
+ *
+ * \details H5Pset_dxpl_mpio_chunk_opt_ratio() sets a threshold for the use of
+ * collective I/O based on the ratio of processes with collective
+ * access to a dataset with chunked storage. The decision whether to
+ * use collective I/O is made on a per-chunk basis.
+ *
+ * The library will calculate the percentage of the total number of
+ * processes, the ratio, that hold selections in each chunk. If that
+ * percentage is greater than the threshold set in \p
+ * percent_proc_per_chunk, the library will do collective I/O for this
+ * chunk; otherwise, independent I/O will be done for the chunk.
+ *
+ * \todo Add missing version information
+ *
+ */
H5_DLL herr_t H5Pset_dxpl_mpio_chunk_opt_ratio(hid_t dxpl_id, unsigned percent_num_proc_per_chunk);
#ifdef __cplusplus
}
diff --git a/src/H5FDmulti.c b/src/H5FDmulti.c
index e71f450..8b87319 100644
--- a/src/H5FDmulti.c
+++ b/src/H5FDmulti.c
@@ -15,12 +15,12 @@
* Programmer: Robb Matzke
* Monday, November 10, 1997
*
- * Purpose: Implements a file driver which dispatches I/O requests to
- * other file drivers depending on the purpose of the address
- * region being accessed. For instance, all meta-data could be
- * place in one file while all raw data goes to some other file.
- * This also serves as an example of coding a complex file driver,
- * therefore, it should not use any non-public definitions.
+ * Purpose: Implements a file driver which dispatches I/O requests to
+ * other file drivers depending on the purpose of the address
+ * region being accessed. For instance, all meta-data could be
+ * place in one file while all raw data goes to some other file.
+ * This also serves as an example of coding a complex file driver,
+ * therefore, it should not use any non-public definitions.
*/
#include <assert.h>
#include <stdlib.h>
@@ -35,6 +35,15 @@
#define TRUE 1
#endif
+/* Windows doesn't like some POSIX names and redefines them with an
+ * underscore
+ */
+#ifdef _WIN32
+#define my_strdup _strdup
+#else
+#define my_strdup strdup
+#endif
+
/* Loop through all mapped files */
#define UNIQUE_MEMBERS_CORE(MAP, ITER, SEEN, LOOPVAR) \
{ \
@@ -103,9 +112,8 @@ typedef struct H5FD_multi_dxpl_t {
} H5FD_multi_dxpl_t;
/* Private functions */
-static char *my_strdup(const char *s);
-static int compute_next(H5FD_multi_t *file);
-static int open_members(H5FD_multi_t *file);
+static int compute_next(H5FD_multi_t *file);
+static int open_members(H5FD_multi_t *file);
/* Callback prototypes */
static herr_t H5FD_multi_term(void);
@@ -134,75 +142,47 @@ static herr_t H5FD_multi_flush(H5FD_t *_file, hid_t dxpl_id, hbool_t closing);
static herr_t H5FD_multi_truncate(H5FD_t *_file, hid_t dxpl_id, hbool_t closing);
static herr_t H5FD_multi_lock(H5FD_t *_file, hbool_t rw);
static herr_t H5FD_multi_unlock(H5FD_t *_file);
+static herr_t H5FD_multi_delete(const char *filename, hid_t fapl_id);
/* The class struct */
static const H5FD_class_t H5FD_multi_g = {
- "multi", /*name */
- HADDR_MAX, /*maxaddr */
- H5F_CLOSE_WEAK, /* fc_degree */
- H5FD_multi_term, /*terminate */
- H5FD_multi_sb_size, /*sb_size */
- H5FD_multi_sb_encode, /*sb_encode */
- H5FD_multi_sb_decode, /*sb_decode */
- sizeof(H5FD_multi_fapl_t), /*fapl_size */
- H5FD_multi_fapl_get, /*fapl_get */
- H5FD_multi_fapl_copy, /*fapl_copy */
- H5FD_multi_fapl_free, /*fapl_free */
- 0, /*dxpl_size */
- NULL, /*dxpl_copy */
- NULL, /*dxpl_free */
- H5FD_multi_open, /*open */
- H5FD_multi_close, /*close */
- H5FD_multi_cmp, /*cmp */
- H5FD_multi_query, /*query */
- H5FD_multi_get_type_map, /*get_type_map */
- H5FD_multi_alloc, /*alloc */
- H5FD_multi_free, /*free */
- H5FD_multi_get_eoa, /*get_eoa */
- H5FD_multi_set_eoa, /*set_eoa */
- H5FD_multi_get_eof, /*get_eof */
- H5FD_multi_get_handle, /*get_handle */
- H5FD_multi_read, /*read */
- H5FD_multi_write, /*write */
- H5FD_multi_flush, /*flush */
- H5FD_multi_truncate, /*truncate */
- H5FD_multi_lock, /*lock */
- H5FD_multi_unlock, /*unlock */
- NULL, /*dedup */
- H5FD_FLMAP_DEFAULT /*fl_map */
+ "multi", /* name */
+ HADDR_MAX, /* maxaddr */
+ H5F_CLOSE_WEAK, /* fc_degree */
+ H5FD_multi_term, /* terminate */
+ H5FD_multi_sb_size, /* sb_size */
+ H5FD_multi_sb_encode, /* sb_encode */
+ H5FD_multi_sb_decode, /* sb_decode */
+ sizeof(H5FD_multi_fapl_t), /* fapl_size */
+ H5FD_multi_fapl_get, /* fapl_get */
+ H5FD_multi_fapl_copy, /* fapl_copy */
+ H5FD_multi_fapl_free, /* fapl_free */
+ 0, /* dxpl_size */
+ NULL, /* dxpl_copy */
+ NULL, /* dxpl_free */
+ H5FD_multi_open, /* open */
+ H5FD_multi_close, /* close */
+ H5FD_multi_cmp, /* cmp */
+ H5FD_multi_query, /* query */
+ H5FD_multi_get_type_map, /* get_type_map */
+ H5FD_multi_alloc, /* alloc */
+ H5FD_multi_free, /* free */
+ H5FD_multi_get_eoa, /* get_eoa */
+ H5FD_multi_set_eoa, /* set_eoa */
+ H5FD_multi_get_eof, /* get_eof */
+ H5FD_multi_get_handle, /* get_handle */
+ H5FD_multi_read, /* read */
+ H5FD_multi_write, /* write */
+ H5FD_multi_flush, /* flush */
+ H5FD_multi_truncate, /* truncate */
+ H5FD_multi_lock, /* lock */
+ H5FD_multi_unlock, /* unlock */
+ H5FD_multi_delete, /* del */
+ NULL, /* dedup */
+ H5FD_FLMAP_DEFAULT /* fl_map */
};
/*-------------------------------------------------------------------------
- * Function: my_strdup
- *
- * Purpose: Private version of strdup()
- *
- * Return: Success: Ptr to new copy of string
- *
- * Failure: NULL
- *
- * Programmer: Robb Matzke
- * Friday, August 13, 1999
- *
- *-------------------------------------------------------------------------
- */
-static char *
-my_strdup(const char *s)
-{
- char * x;
- size_t str_len;
-
- if (!s)
- return NULL;
- str_len = strlen(s) + 1;
- if (NULL == (x = (char *)malloc(str_len)))
- return NULL;
- memcpy(x, s, str_len);
-
- return x;
-}
-
-/*-------------------------------------------------------------------------
* Function: H5FD_multi_init
*
* Purpose: Initialize this driver by registering the driver with the
@@ -229,9 +209,9 @@ H5FD_multi_init(void)
} /* end H5FD_multi_init() */
/*---------------------------------------------------------------------------
- * Function: H5FD_multi_term
+ * Function: H5FD_multi_term
*
- * Purpose: Shut down the VFD
+ * Purpose: Shut down the VFD
*
* Returns: Non-negative on success or negative on failure
*
@@ -250,17 +230,17 @@ H5FD_multi_term(void)
} /* end H5FD_multi_term() */
/*-------------------------------------------------------------------------
- * Function: H5Pset_fapl_split
+ * Function: H5Pset_fapl_split
*
- * Purpose: Compatibility function. Makes the multi driver act like the
- * old split driver which stored meta data in one file and raw
- * data in another file.
+ * Purpose: Compatibility function. Makes the multi driver act like the
+ * old split driver which stored meta data in one file and raw
+ * data in another file.
*
- * Return: Success: 0
+ * Return: Success: 0
*
- * Failure: -1
+ * Failure: -1
*
- * Programmer: Robb Matzke
+ * Programmer: Robb Matzke
* Wednesday, August 11, 1999
*
*-------------------------------------------------------------------------
@@ -340,77 +320,77 @@ H5Pset_fapl_split(hid_t fapl, const char *meta_ext, hid_t meta_plist_id, const c
}
/*-------------------------------------------------------------------------
- * Function: H5Pset_fapl_multi
+ * Function: H5Pset_fapl_multi
*
- * Purpose: Sets the file access property list FAPL_ID to use the multi
- * driver. The MEMB_MAP array maps memory usage types to other
- * memory usage types and is the mechanism which allows the
- * caller to specify how many files are created. The array
- * contains H5FD_MEM_NTYPES entries which are either the value
- * H5FD_MEM_DEFAULT or a memory usage type and the number of
- * unique values determines the number of files which are
- * opened. For each memory usage type which will be associated
- * with a file the MEMB_FAPL array should have a property list
- * and the MEMB_NAME array should be a name generator (a
- * printf-style format with a %s which will be replaced with the
- * name passed to H5FDopen(), usually from H5Fcreate() or
- * H5Fopen()).
+ * Purpose: Sets the file access property list FAPL_ID to use the multi
+ * driver. The MEMB_MAP array maps memory usage types to other
+ * memory usage types and is the mechanism which allows the
+ * caller to specify how many files are created. The array
+ * contains H5FD_MEM_NTYPES entries which are either the value
+ * H5FD_MEM_DEFAULT or a memory usage type and the number of
+ * unique values determines the number of files which are
+ * opened. For each memory usage type which will be associated
+ * with a file the MEMB_FAPL array should have a property list
+ * and the MEMB_NAME array should be a name generator (a
+ * printf-style format with a %s which will be replaced with the
+ * name passed to H5FDopen(), usually from H5Fcreate() or
+ * H5Fopen()).
*
- * If RELAX is set then opening an existing file for read-only
- * access will not fail if some file members are missing. This
- * allows a file to be accessed in a limited sense if just the
- * meta data is available.
+ * If RELAX is set then opening an existing file for read-only
+ * access will not fail if some file members are missing. This
+ * allows a file to be accessed in a limited sense if just the
+ * meta data is available.
*
- * Defaults: Default values for each of the optional arguments are:
+ * Defaults: Default values for each of the optional arguments are:
*
- * memb_map: The default member map has the value
- * H5FD_MEM_DEFAULT for each element.
+ * memb_map: The default member map has the value
+ * H5FD_MEM_DEFAULT for each element.
*
- * memb_fapl: The value H5P_DEFAULT for each element.
+ * memb_fapl: The value H5P_DEFAULT for each element.
*
- * memb_name: The string `%s-X.h5' where `X' is one of the
- * letters `s' (H5FD_MEM_SUPER),
- * `b' (H5FD_MEM_BTREE), `r' (H5FD_MEM_DRAW),
- * `g' (H5FD_MEM_GHEAP), 'l' (H5FD_MEM_LHEAP),
- * `o' (H5FD_MEM_OHDR).
+ * memb_name: The string `%s-X.h5' where `X' is one of the
+ * letters `s' (H5FD_MEM_SUPER),
+ * `b' (H5FD_MEM_BTREE), `r' (H5FD_MEM_DRAW),
+ * `g' (H5FD_MEM_GHEAP), 'l' (H5FD_MEM_LHEAP),
+ * `o' (H5FD_MEM_OHDR).
*
- * memb_addr: The value HADDR_UNDEF for each element.
+ * memb_addr: The value HADDR_UNDEF for each element.
*
*
- * Example: To set up a multi file access property list which partitions
- * data into meta and raw files each being 1/2 of the address
- * space one would say:
+ * Example: To set up a multi file access property list which partitions
+ * data into meta and raw files each being 1/2 of the address
+ * space one would say:
*
- * H5FD_mem_t mt, memb_map[H5FD_MEM_NTYPES];
- * hid_t memb_fapl[H5FD_MEM_NTYPES];
- * const char *memb[H5FD_MEM_NTYPES];
- * haddr_t memb_addr[H5FD_MEM_NTYPES];
+ * H5FD_mem_t mt, memb_map[H5FD_MEM_NTYPES];
+ * hid_t memb_fapl[H5FD_MEM_NTYPES];
+ * const char *memb[H5FD_MEM_NTYPES];
+ * haddr_t memb_addr[H5FD_MEM_NTYPES];
*
- * // The mapping...
- * for (mt=0; mt<H5FD_MEM_NTYPES; mt++) {
- * memb_map[mt] = H5FD_MEM_SUPER;
- * }
- * memb_map[H5FD_MEM_DRAW] = H5FD_MEM_DRAW;
+ * // The mapping...
+ * for (mt=0; mt<H5FD_MEM_NTYPES; mt++) {
+ * memb_map[mt] = H5FD_MEM_SUPER;
+ * }
+ * memb_map[H5FD_MEM_DRAW] = H5FD_MEM_DRAW;
*
- * // Member information
- * memb_fapl[H5FD_MEM_SUPER] = H5P_DEFAULT;
- * memb_name[H5FD_MEM_SUPER] = "%s.meta";
- * memb_addr[H5FD_MEM_SUPER] = 0;
+ * // Member information
+ * memb_fapl[H5FD_MEM_SUPER] = H5P_DEFAULT;
+ * memb_name[H5FD_MEM_SUPER] = "%s.meta";
+ * memb_addr[H5FD_MEM_SUPER] = 0;
*
- * memb_fapl[H5FD_MEM_DRAW] = H5P_DEFAULT;
- * memb_name[H5FD_MEM_DRAW] = "%s.raw";
- * memb_addr[H5FD_MEM_DRAW] = HADDR_MAX/2;
+ * memb_fapl[H5FD_MEM_DRAW] = H5P_DEFAULT;
+ * memb_name[H5FD_MEM_DRAW] = "%s.raw";
+ * memb_addr[H5FD_MEM_DRAW] = HADDR_MAX/2;
*
- * hid_t fapl = H5Pcreate(H5P_FILE_ACCESS);
- * H5Pset_fapl_multi(fapl, memb_map, memb_fapl,
- * memb_name, memb_addr, TRUE);
+ * hid_t fapl = H5Pcreate(H5P_FILE_ACCESS);
+ * H5Pset_fapl_multi(fapl, memb_map, memb_fapl,
+ * memb_name, memb_addr, TRUE);
*
*
- * Return: Success: Non-negative
+ * Return: Success: Non-negative
*
- * Failure: Negative
+ * Failure: Negative
*
- * Programmer: Robb Matzke
+ * Programmer: Robb Matzke
* Wednesday, August 4, 1999
*
*-------------------------------------------------------------------------
@@ -436,12 +416,12 @@ H5Pset_fapl_multi(hid_t fapl_id, const H5FD_mem_t *memb_map, const hid_t *memb_f
/* Check arguments and supply default values */
if (H5I_GENPROP_LST != H5Iget_type(fapl_id) || TRUE != H5Pisa_class(fapl_id, H5P_FILE_ACCESS))
- H5Epush_ret(func, H5E_ERR_CLS, H5E_PLIST, H5E_BADVALUE, "not an access list", -1) if (!memb_map)
- {
- for (mt = H5FD_MEM_DEFAULT; mt < H5FD_MEM_NTYPES; mt = (H5FD_mem_t)(mt + 1))
- _memb_map[mt] = H5FD_MEM_DEFAULT;
- memb_map = _memb_map;
- }
+ H5Epush_ret(func, H5E_ERR_CLS, H5E_PLIST, H5E_BADVALUE, "not an access list", -1);
+ if (!memb_map) {
+ for (mt = H5FD_MEM_DEFAULT; mt < H5FD_MEM_NTYPES; mt = (H5FD_mem_t)(mt + 1))
+ _memb_map[mt] = H5FD_MEM_DEFAULT;
+ memb_map = _memb_map;
+ }
if (!memb_fapl) {
for (mt = H5FD_MEM_DEFAULT; mt < H5FD_MEM_NTYPES; mt = (H5FD_mem_t)(mt + 1))
_memb_fapl[mt] = H5Pcreate(H5P_FILE_ACCESS);
@@ -465,19 +445,20 @@ H5Pset_fapl_multi(hid_t fapl_id, const H5FD_mem_t *memb_map, const hid_t *memb_f
/* Map usage type */
mmt = memb_map[mt];
if (mmt < 0 || mmt >= H5FD_MEM_NTYPES)
- H5Epush_ret(func, H5E_ERR_CLS, H5E_INTERNAL, H5E_BADRANGE, "file resource type out of range",
- -1) if (H5FD_MEM_DEFAULT == mmt) mmt = mt;
+ H5Epush_ret(func, H5E_ERR_CLS, H5E_INTERNAL, H5E_BADRANGE, "file resource type out of range", -1);
+ if (H5FD_MEM_DEFAULT == mmt)
+ mmt = mt;
/*
* All members of MEMB_FAPL must be either defaults or actual file
* access property lists.
*/
if (H5P_DEFAULT != memb_fapl[mmt] && TRUE != H5Pisa_class(memb_fapl[mmt], H5P_FILE_ACCESS))
- H5Epush_ret(func, H5E_ERR_CLS, H5E_INTERNAL, H5E_BADVALUE, "file resource type incorrect", -1)
+ H5Epush_ret(func, H5E_ERR_CLS, H5E_INTERNAL, H5E_BADVALUE, "file resource type incorrect", -1);
- /* All names must be defined */
- if (!memb_name[mmt] || !memb_name[mmt][0]) H5Epush_ret(
- func, H5E_ERR_CLS, H5E_INTERNAL, H5E_BADVALUE, "file resource type not set", -1)
+ /* All names must be defined */
+ if (!memb_name[mmt] || !memb_name[mmt][0])
+ H5Epush_ret(func, H5E_ERR_CLS, H5E_INTERNAL, H5E_BADVALUE, "file resource type not set", -1);
}
/*
@@ -500,17 +481,17 @@ H5Pset_fapl_multi(hid_t fapl_id, const H5FD_mem_t *memb_map, const hid_t *memb_f
}
/*-------------------------------------------------------------------------
- * Function: H5Pget_fapl_multi
+ * Function: H5Pget_fapl_multi
*
- * Purpose: Returns information about the multi file access property
- * list though the function arguments which are the same as for
- * H5Pset_fapl_multi() above.
+ * Purpose: Returns information about the multi file access property
+ * list though the function arguments which are the same as for
+ * H5Pset_fapl_multi() above.
*
- * Return: Success: Non-negative
+ * Return: Success: Non-negative
*
- * Failure: Negative
+ * Failure: Negative
*
- * Programmer: Robb Matzke
+ * Programmer: Robb Matzke
* Wednesday, August 4, 1999
*
*-------------------------------------------------------------------------
@@ -529,13 +510,14 @@ H5Pget_fapl_multi(hid_t fapl_id, H5FD_mem_t *memb_map /*out*/, hid_t *memb_fapl
H5Eclear2(H5E_DEFAULT);
if (H5I_GENPROP_LST != H5Iget_type(fapl_id) || TRUE != H5Pisa_class(fapl_id, H5P_FILE_ACCESS))
- H5Epush_ret(func, H5E_ERR_CLS, H5E_PLIST, H5E_BADTYPE, "not an access list",
- -1) if (H5FD_MULTI != H5Pget_driver(fapl_id))
- H5Epush_ret(func, H5E_ERR_CLS, H5E_PLIST, H5E_BADVALUE, "incorrect VFL driver",
- -1) if (NULL == (fa = (const H5FD_multi_fapl_t *)H5Pget_driver_info(fapl_id)))
- H5Epush_ret(func, H5E_ERR_CLS, H5E_PLIST, H5E_BADVALUE, "bad VFL driver info", -1)
-
- if (memb_map) memcpy(memb_map, fa->memb_map, H5FD_MEM_NTYPES * sizeof(H5FD_mem_t));
+ H5Epush_ret(func, H5E_ERR_CLS, H5E_PLIST, H5E_BADTYPE, "not an access list", -1);
+ if (H5FD_MULTI != H5Pget_driver(fapl_id))
+ H5Epush_ret(func, H5E_ERR_CLS, H5E_PLIST, H5E_BADVALUE, "incorrect VFL driver", -1);
+ if (NULL == (fa = (const H5FD_multi_fapl_t *)H5Pget_driver_info(fapl_id)))
+ H5Epush_ret(func, H5E_ERR_CLS, H5E_PLIST, H5E_BADVALUE, "bad VFL driver info", -1);
+
+ if (memb_map)
+ memcpy(memb_map, fa->memb_map, H5FD_MEM_NTYPES * sizeof(H5FD_mem_t));
if (memb_fapl) {
for (mt = H5FD_MEM_DEFAULT; mt < H5FD_MEM_NTYPES; mt = (H5FD_mem_t)(mt + 1)) {
if (fa->memb_fapl[mt] >= 0)
@@ -561,16 +543,16 @@ H5Pget_fapl_multi(hid_t fapl_id, H5FD_mem_t *memb_map /*out*/, hid_t *memb_fapl
}
/*-------------------------------------------------------------------------
- * Function: H5FD_multi_sb_size
+ * Function: H5FD_multi_sb_size
*
- * Purpose: Returns the size of the private information to be stored in
- * the superblock.
+ * Purpose: Returns the size of the private information to be stored in
+ * the superblock.
*
- * Return: Success: The super block driver data size.
+ * Return: Success: The super block driver data size.
*
- * Failure: never fails
+ * Failure: never fails
*
- * Programmer: Robb Matzke
+ * Programmer: Robb Matzke
* Monday, August 16, 1999
*
*-------------------------------------------------------------------------
@@ -605,24 +587,24 @@ H5FD_multi_sb_size(H5FD_t *_file)
}
/*-------------------------------------------------------------------------
- * Function: H5FD_multi_sb_encode
+ * Function: H5FD_multi_sb_encode
*
- * Purpose: Encode driver information for the superblock. The NAME
- * argument is a nine-byte buffer which will be initialized with
- * an eight-character name/version number and null termination.
+ * Purpose: Encode driver information for the superblock. The NAME
+ * argument is a nine-byte buffer which will be initialized with
+ * an eight-character name/version number and null termination.
*
- * The encoding is a six-byte member mapping followed two bytes
- * which are unused. For each unique file in usage-type order
- * encode all the starting addresses as unsigned 64-bit integers,
- * then all the EOA values as unsigned 64-bit integers, then all
- * the template names as null terminated strings which are
- * multiples of 8 characters.
+ * The encoding is a six-byte member mapping followed two bytes
+ * which are unused. For each unique file in usage-type order
+ * encode all the starting addresses as unsigned 64-bit integers,
+ * then all the EOA values as unsigned 64-bit integers, then all
+ * the template names as null terminated strings which are
+ * multiples of 8 characters.
*
- * Return: Success: 0
+ * Return: Success: 0
*
- * Failure: -1
+ * Failure: -1
*
- * Programmer: Robb Matzke
+ * Programmer: Robb Matzke
* Monday, August 16, 1999
*
*-------------------------------------------------------------------------
@@ -672,10 +654,10 @@ H5FD_multi_sb_encode(H5FD_t *_file, char *name /*out*/, unsigned char *buf /*out
}
END_MEMBERS;
if (H5Tconvert(H5T_NATIVE_HADDR, H5T_STD_U64LE, nseen * 2, buf + 8, NULL, H5P_DEFAULT) < 0)
- H5Epush_ret(func, H5E_ERR_CLS, H5E_DATATYPE, H5E_CANTCONVERT, "can't convert superblock info", -1)
+ H5Epush_ret(func, H5E_ERR_CLS, H5E_DATATYPE, H5E_CANTCONVERT, "can't convert superblock info", -1);
- /* Encode all name templates */
- p = buf + 8 + nseen * 2 * 8;
+ /* Encode all name templates */
+ p = buf + 8 + nseen * 2 * 8;
UNIQUE_MEMBERS (file->fa.memb_map, mt) {
size_t n = strlen(file->fa.memb_name[mt]) + 1;
strncpy((char *)p, file->fa.memb_name[mt], n);
@@ -689,21 +671,21 @@ H5FD_multi_sb_encode(H5FD_t *_file, char *name /*out*/, unsigned char *buf /*out
} /* end H5FD_multi_sb_encode() */
/*-------------------------------------------------------------------------
- * Function: H5FD_multi_sb_decode
+ * Function: H5FD_multi_sb_decode
*
- * Purpose: Decodes the superblock information for this driver. The NAME
- * argument is the eight-character (plus null termination) name
- * stored in the file.
+ * Purpose: Decodes the superblock information for this driver. The NAME
+ * argument is the eight-character (plus null termination) name
+ * stored in the file.
*
- * The FILE argument is updated according to the information in
- * the superblock. This may mean that some member files are
- * closed and others are opened.
+ * The FILE argument is updated according to the information in
+ * the superblock. This may mean that some member files are
+ * closed and others are opened.
*
- * Return: Success: 0
+ * Return: Success: 0
*
- * Failure: -1
+ * Failure: -1
*
- * Programmer: Robb Matzke
+ * Programmer: Robb Matzke
* Monday, August 16, 1999
*
*-------------------------------------------------------------------------
@@ -728,16 +710,15 @@ H5FD_multi_sb_decode(H5FD_t *_file, const char *name, const unsigned char *buf)
H5Eclear2(H5E_DEFAULT);
/* Make sure the name/version number is correct */
- if (strcmp(name, "NCSAmult"))
- H5Epush_ret(func, H5E_ERR_CLS, H5E_FILE, H5E_BADVALUE, "invalid multi superblock", -1)
+ if (strcmp(name, "NCSAmult") != 0)
+ H5Epush_ret(func, H5E_ERR_CLS, H5E_FILE, H5E_BADVALUE, "invalid multi superblock", -1);
- /* Set default values */
- ALL_MEMBERS (mt)
- {
- memb_addr[mt] = HADDR_UNDEF;
- memb_eoa[mt] = HADDR_UNDEF;
- memb_name[mt] = NULL;
- }
+ /* Set default values */
+ ALL_MEMBERS (mt) {
+ memb_addr[mt] = HADDR_UNDEF;
+ memb_eoa[mt] = HADDR_UNDEF;
+ memb_name[mt] = NULL;
+ }
END_MEMBERS;
/*
@@ -762,9 +743,9 @@ H5FD_multi_sb_decode(H5FD_t *_file, const char *name, const unsigned char *buf)
memcpy(x, buf, (nseen * 2 * 8));
buf += nseen * 2 * 8;
if (H5Tconvert(H5T_STD_U64LE, H5T_NATIVE_HADDR, nseen * 2, x, NULL, H5P_DEFAULT) < 0)
- H5Epush_ret(func, H5E_ERR_CLS, H5E_DATATYPE, H5E_CANTCONVERT, "can't convert superblock info", -1)
- ap = (haddr_t *)((void *)x); /* Extra (void *) cast to quiet "cast to create alignment" warning -
- 2019/07/05, QAK */
+ H5Epush_ret(func, H5E_ERR_CLS, H5E_DATATYPE, H5E_CANTCONVERT, "can't convert superblock info", -1);
+ ap = (haddr_t *)((void *)x); /* Extra (void *) cast to quiet "cast to create alignment" warning -
+ 2019/07/05, QAK */
UNIQUE_MEMBERS (map, mt) {
memb_addr[_unmapped] = *ap++;
memb_eoa[_unmapped] = *ap++;
@@ -819,41 +800,40 @@ H5FD_multi_sb_decode(H5FD_t *_file, const char *name, const unsigned char *buf)
}
END_MEMBERS;
if (compute_next(file) < 0)
- H5Epush_ret(func, H5E_ERR_CLS, H5E_INTERNAL, H5E_BADVALUE, "compute_next() failed", -1)
+ H5Epush_ret(func, H5E_ERR_CLS, H5E_INTERNAL, H5E_BADVALUE, "compute_next() failed", -1);
- /* Open all necessary files */
- if (open_members(file) < 0)
- H5Epush_ret(func, H5E_ERR_CLS, H5E_INTERNAL, H5E_BADVALUE, "open_members() failed", -1)
+ /* Open all necessary files */
+ if (open_members(file) < 0)
+ H5Epush_ret(func, H5E_ERR_CLS, H5E_INTERNAL, H5E_BADVALUE, "open_members() failed", -1);
- /* Set the EOA marker for all open files */
- UNIQUE_MEMBERS (file->fa.memb_map, mt)
- {
- if (file->memb[mt])
- if (H5FDset_eoa(file->memb[mt], mt, memb_eoa[mt]) < 0)
- H5Epush_ret(func, H5E_ERR_CLS, H5E_INTERNAL, H5E_CANTSET, "set_eoa() failed", -1)
+ /* Set the EOA marker for all open files */
+ UNIQUE_MEMBERS (file->fa.memb_map, mt) {
+ if (file->memb[mt])
+ if (H5FDset_eoa(file->memb[mt], mt, memb_eoa[mt]) < 0)
+ H5Epush_ret(func, H5E_ERR_CLS, H5E_INTERNAL, H5E_CANTSET, "set_eoa() failed", -1);
- /* Save the individual EOAs in one place for later comparison (in H5FD_multi_set_eoa)
- */
- file->memb_eoa[mt] = memb_eoa[mt];
- }
+ /* Save the individual EOAs in one place for later comparison (in H5FD_multi_set_eoa)
+ */
+ file->memb_eoa[mt] = memb_eoa[mt];
+ }
END_MEMBERS;
return 0;
} /* end H5FD_multi_sb_decode() */
/*-------------------------------------------------------------------------
- * Function: H5FD_multi_fapl_get
+ * Function: H5FD_multi_fapl_get
*
- * Purpose: Returns a file access property list which indicates how the
- * specified file is being accessed. The return list could be
- * used to access another file the same way.
+ * Purpose: Returns a file access property list which indicates how the
+ * specified file is being accessed. The return list could be
+ * used to access another file the same way.
*
- * Return: Success: Ptr to new file access property list with all
- * members copied from the file struct.
+ * Return: Success: Ptr to new file access property list with all
+ * members copied from the file struct.
*
- * Failure: NULL
+ * Failure: NULL
*
- * Programmer: Robb Matzke
+ * Programmer: Robb Matzke
* Friday, August 13, 1999
*
*-------------------------------------------------------------------------
@@ -870,15 +850,15 @@ H5FD_multi_fapl_get(H5FD_t *_file)
}
/*-------------------------------------------------------------------------
- * Function: H5FD_multi_fapl_copy
+ * Function: H5FD_multi_fapl_copy
*
- * Purpose: Copies the multi-specific file access properties.
+ * Purpose: Copies the multi-specific file access properties.
*
- * Return: Success: Ptr to a new property list
+ * Return: Success: Ptr to a new property list
*
- * Failure: NULL
+ * Failure: NULL
*
- * Programmer: Robb Matzke
+ * Programmer: Robb Matzke
* Wednesday, August 4, 1999
*
*-------------------------------------------------------------------------
@@ -924,21 +904,21 @@ H5FD_multi_fapl_copy(const void *_old_fa)
}
END_MEMBERS;
free(new_fa);
- H5Epush_ret(func, H5E_ERR_CLS, H5E_INTERNAL, H5E_BADVALUE, "can't release object on error", NULL)
+ H5Epush_ret(func, H5E_ERR_CLS, H5E_INTERNAL, H5E_BADVALUE, "can't release object on error", NULL);
}
return new_fa;
}
/*-------------------------------------------------------------------------
- * Function: H5FD_multi_fapl_free
+ * Function: H5FD_multi_fapl_free
*
- * Purpose: Frees the multi-specific file access properties.
+ * Purpose: Frees the multi-specific file access properties.
*
- * Return: Success: 0
+ * Return: Success: 0
*
- * Failure: -1
+ * Failure: -1
*
- * Programmer: Robb Matzke
+ * Programmer: Robb Matzke
* Wednesday, August 4, 1999
*
*-------------------------------------------------------------------------
@@ -955,8 +935,9 @@ H5FD_multi_fapl_free(void *_fa)
ALL_MEMBERS (mt) {
if (fa->memb_fapl[mt] >= 0)
if (H5Idec_ref(fa->memb_fapl[mt]) < 0)
- H5Epush_ret(func, H5E_ERR_CLS, H5E_FILE, H5E_CANTCLOSEOBJ, "can't close property list",
- -1) if (fa->memb_name[mt]) free(fa->memb_name[mt]);
+ H5Epush_ret(func, H5E_ERR_CLS, H5E_FILE, H5E_CANTCLOSEOBJ, "can't close property list", -1);
+ if (fa->memb_name[mt])
+ free(fa->memb_name[mt]);
}
END_MEMBERS;
free(fa);
@@ -965,17 +946,17 @@ H5FD_multi_fapl_free(void *_fa)
}
/*-------------------------------------------------------------------------
- * Function: H5FD_multi_open
+ * Function: H5FD_multi_open
*
- * Purpose: Creates and/or opens a multi HDF5 file.
+ * Purpose: Creates and/or opens a multi HDF5 file.
*
- * Return: Success: A pointer to a new file data structure. The
- * public fields will be initialized by the
- * caller, which is always H5FD_open().
+ * Return: Success: A pointer to a new file data structure. The
+ * public fields will be initialized by the
+ * caller, which is always H5FD_open().
*
- * Failure: NULL
+ * Failure: NULL
*
- * Programmer: Robb Matzke
+ * Programmer: Robb Matzke
* Wednesday, August 4, 1999
*
*-------------------------------------------------------------------------
@@ -994,24 +975,23 @@ H5FD_multi_open(const char *name, unsigned flags, hid_t fapl_id, haddr_t maxaddr
/* Check arguments */
if (!name || !*name)
- H5Epush_ret(func, H5E_ERR_CLS, H5E_ARGS, H5E_BADVALUE, "invalid file name",
- NULL) if (0 == maxaddr || HADDR_UNDEF == maxaddr)
- H5Epush_ret(func, H5E_ERR_CLS, H5E_ARGS, H5E_BADRANGE, "bogus maxaddr", NULL)
+ H5Epush_ret(func, H5E_ERR_CLS, H5E_ARGS, H5E_BADVALUE, "invalid file name", NULL);
+ if (0 == maxaddr || HADDR_UNDEF == maxaddr)
+ H5Epush_ret(func, H5E_ERR_CLS, H5E_ARGS, H5E_BADRANGE, "bogus maxaddr", NULL);
- /*
- * Initialize the file from the file access properties, using default
- * values if necessary. Make sure to use CALLOC here because the code
- * in H5FD_multi_set_eoa depends on the proper initialization of memb_eoa
- * in H5FD_multi_t.
- */
- if (NULL == (file = (H5FD_multi_t *)calloc((size_t)1, sizeof(H5FD_multi_t)))) H5Epush_ret(
- func, H5E_ERR_CLS, H5E_RESOURCE, H5E_NOSPACE, "memory allocation failed",
- NULL) if (H5P_FILE_ACCESS_DEFAULT == fapl_id || H5FD_MULTI != H5Pget_driver(fapl_id))
- {
- close_fapl = fapl_id = H5Pcreate(H5P_FILE_ACCESS);
- if (H5Pset_fapl_multi(fapl_id, NULL, NULL, NULL, NULL, TRUE) < 0)
- H5Epush_goto(func, H5E_ERR_CLS, H5E_FILE, H5E_CANTSET, "can't set property value", error)
- }
+ /*
+ * Initialize the file from the file access properties, using default
+ * values if necessary. Make sure to use CALLOC here because the code
+ * in H5FD_multi_set_eoa depends on the proper initialization of memb_eoa
+ * in H5FD_multi_t.
+ */
+ if (NULL == (file = (H5FD_multi_t *)calloc((size_t)1, sizeof(H5FD_multi_t))))
+ H5Epush_ret(func, H5E_ERR_CLS, H5E_RESOURCE, H5E_NOSPACE, "memory allocation failed", NULL);
+ if (H5P_FILE_ACCESS_DEFAULT == fapl_id || H5FD_MULTI != H5Pget_driver(fapl_id)) {
+ close_fapl = fapl_id = H5Pcreate(H5P_FILE_ACCESS);
+ if (H5Pset_fapl_multi(fapl_id, NULL, NULL, NULL, NULL, TRUE) < 0)
+ H5Epush_goto(func, H5E_ERR_CLS, H5E_FILE, H5E_CANTSET, "can't set property value", error)
+ }
fa = (const H5FD_multi_fapl_t *)H5Pget_driver_info(fapl_id);
assert(fa);
ALL_MEMBERS (mt) {
@@ -1067,17 +1047,17 @@ error:
}
/*-------------------------------------------------------------------------
- * Function: H5FD_multi_close
+ * Function: H5FD_multi_close
*
- * Purpose: Closes a multi file.
+ * Purpose: Closes a multi file.
*
- * Return: Success: Non-negative
+ * Return: Success: Non-negative
*
- * Failure: Negative with as many members closed as
- * possible. The only subsequent operation
- * permitted on the file is a close operation.
+ * Failure: Negative with as many members closed as
+ * possible. The only subsequent operation
+ * permitted on the file is a close operation.
*
- * Programmer: Robb Matzke
+ * Programmer: Robb Matzke
* Wednesday, August 4, 1999
*
*-------------------------------------------------------------------------
@@ -1105,16 +1085,15 @@ H5FD_multi_close(H5FD_t *_file)
}
END_MEMBERS;
if (nerrors)
- H5Epush_ret(func, H5E_ERR_CLS, H5E_INTERNAL, H5E_BADVALUE, "error closing member files", -1)
+ H5Epush_ret(func, H5E_ERR_CLS, H5E_INTERNAL, H5E_BADVALUE, "error closing member files", -1);
- /* Clean up other stuff */
- ALL_MEMBERS (mt)
- {
- if (file->fa.memb_fapl[mt] >= 0)
- (void)H5Idec_ref(file->fa.memb_fapl[mt]);
- if (file->fa.memb_name[mt])
- free(file->fa.memb_name[mt]);
- }
+ /* Clean up other stuff */
+ ALL_MEMBERS (mt) {
+ if (file->fa.memb_fapl[mt] >= 0)
+ (void)H5Idec_ref(file->fa.memb_fapl[mt]);
+ if (file->fa.memb_name[mt])
+ free(file->fa.memb_name[mt]);
+ }
END_MEMBERS;
free(file->name);
@@ -1123,20 +1102,19 @@ H5FD_multi_close(H5FD_t *_file)
}
/*-------------------------------------------------------------------------
- * Function: H5FD_multi_cmp
+ * Function: H5FD_multi_cmp
*
- * Purpose: Compares two file families to see if they are the same. It
- * does this by comparing the first common member of the two
- * families. If the families have no members in common then the
- * file with the earliest member is smaller than the other file.
- * We abort if neither file has any members.
+ * Purpose: Compares two file families to see if they are the same. It
+ * does this by comparing the first common member of the two
+ * families. If the families have no members in common then the
+ * file with the earliest member is smaller than the other file.
+ * We abort if neither file has any members.
*
- * Return: Success: like strcmp()
+ * Return: Success: like strcmp()
*
- * Failure: never fails (arguments were checked by the
- * caller).
+ * Failure: never fails (arguments were checked by th caller).
*
- * Programmer: Robb Matzke
+ * Programmer: Robb Matzke
* Wednesday, August 4, 1999
*
*-------------------------------------------------------------------------
@@ -1172,16 +1150,16 @@ H5FD_multi_cmp(const H5FD_t *_f1, const H5FD_t *_f2)
}
/*-------------------------------------------------------------------------
- * Function: H5FD_multi_query
+ * Function: H5FD_multi_query
*
- * Purpose: Set the flags that this VFL driver is capable of supporting.
+ * Purpose: Set the flags that this VFL driver is capable of supporting.
* (listed in H5FDpublic.h)
*
- * Return: Success: non-negative
+ * Return: Success: non-negative
*
- * Failure: negative
+ * Failure: negative
*
- * Programmer: Quincey Koziol
+ * Programmer: Quincey Koziol
* Tuesday, September 26, 2000
*
*-------------------------------------------------------------------------
@@ -1190,7 +1168,7 @@ static herr_t
H5FD_multi_query(const H5FD_t *_f, unsigned long *flags /* out */)
{
/* Shut compiler up */
- _f = _f;
+ (void)_f;
/* Set the VFL feature flags that this driver supports */
if (flags) {
@@ -1205,14 +1183,14 @@ H5FD_multi_query(const H5FD_t *_f, unsigned long *flags /* out */)
} /* end H5FD_multi_query() */
/*-------------------------------------------------------------------------
- * Function: H5FD_multi_get_type_map
+ * Function: H5FD_multi_get_type_map
*
- * Purpose: Retrieve the memory type mapping for this file
+ * Purpose: Retrieve the memory type mapping for this file
*
- * Return: Success: non-negative
- * Failure: negative
+ * Return: Success: non-negative
+ * Failure: negative
*
- * Programmer: Quincey Koziol
+ * Programmer: Quincey Koziol
* Tuesday, October 9, 2008
*
*-------------------------------------------------------------------------
@@ -1229,17 +1207,17 @@ H5FD_multi_get_type_map(const H5FD_t *_file, H5FD_mem_t *type_map)
} /* end H5FD_multi_get_type_map() */
/*-------------------------------------------------------------------------
- * Function: H5FD_multi_get_eoa
+ * Function: H5FD_multi_get_eoa
*
- * Purpose: Returns the end-of-address marker for the file. The EOA
- * marker is the first address past the last byte allocated in
- * the format address space.
+ * Purpose: Returns the end-of-address marker for the file. The EOA
+ * marker is the first address past the last byte allocated in
+ * the format address space.
*
- * Return: Success: The end-of-address-marker
+ * Return: Success: The end-of-address-marker
*
- * Failure: HADDR_UNDEF
+ * Failure: HADDR_UNDEF
*
- * Programmer: Robb Matzke
+ * Programmer: Robb Matzke
* Wednesday, August 4, 1999
*
*-------------------------------------------------------------------------
@@ -1274,7 +1252,9 @@ H5FD_multi_get_eoa(const H5FD_t *_file, H5FD_mem_t type)
if (HADDR_UNDEF == memb_eoa)
H5Epush_ret(func, H5E_ERR_CLS, H5E_INTERNAL, H5E_BADVALUE, "member file has unknown eoa",
- HADDR_UNDEF) if (memb_eoa > 0) memb_eoa += file->fa.memb_addr[mt];
+ HADDR_UNDEF);
+ if (memb_eoa > 0)
+ memb_eoa += file->fa.memb_addr[mt];
}
else if (file->fa.relax) {
/*
@@ -1285,7 +1265,7 @@ H5FD_multi_get_eoa(const H5FD_t *_file, H5FD_mem_t type)
assert(HADDR_UNDEF != memb_eoa);
}
else {
- H5Epush_ret(func, H5E_ERR_CLS, H5E_INTERNAL, H5E_BADVALUE, "bad eoa", HADDR_UNDEF)
+ H5Epush_ret(func, H5E_ERR_CLS, H5E_INTERNAL, H5E_BADVALUE, "bad eoa", HADDR_UNDEF);
}
if (memb_eoa > eoa)
@@ -1308,7 +1288,9 @@ H5FD_multi_get_eoa(const H5FD_t *_file, H5FD_mem_t type)
if (HADDR_UNDEF == eoa)
H5Epush_ret(func, H5E_ERR_CLS, H5E_INTERNAL, H5E_BADVALUE, "member file has unknown eoa",
- HADDR_UNDEF) if (eoa > 0) eoa += file->fa.memb_addr[mmt];
+ HADDR_UNDEF);
+ if (eoa > 0)
+ eoa += file->fa.memb_addr[mmt];
}
else if (file->fa.relax) {
/*
@@ -1319,7 +1301,7 @@ H5FD_multi_get_eoa(const H5FD_t *_file, H5FD_mem_t type)
assert(HADDR_UNDEF != eoa);
}
else {
- H5Epush_ret(func, H5E_ERR_CLS, H5E_INTERNAL, H5E_BADVALUE, "bad eoa", HADDR_UNDEF)
+ H5Epush_ret(func, H5E_ERR_CLS, H5E_INTERNAL, H5E_BADVALUE, "bad eoa", HADDR_UNDEF);
}
}
@@ -1327,18 +1309,18 @@ H5FD_multi_get_eoa(const H5FD_t *_file, H5FD_mem_t type)
} /* end H5FD_multi_get_eoa() */
/*-------------------------------------------------------------------------
- * Function: H5FD_multi_set_eoa
+ * Function: H5FD_multi_set_eoa
*
- * Purpose: Set the end-of-address marker for the file by savig the new
- * EOA value in the file struct. Also set the EOA marker for the
- * subfile in which the new EOA value falls. We don't set the
- * EOA values of any other subfiles.
+ * Purpose: Set the end-of-address marker for the file by savig the new
+ * EOA value in the file struct. Also set the EOA marker for the
+ * subfile in which the new EOA value falls. We don't set the
+ * EOA values of any other subfiles.
*
- * Return: Success: 0
+ * Return: Success: 0
*
- * Failure: -1
+ * Failure: -1
*
- * Programmer: Robb Matzke
+ * Programmer: Robb Matzke
* Wednesday, August 4, 1999
*
*-------------------------------------------------------------------------
@@ -1385,24 +1367,24 @@ H5FD_multi_set_eoa(H5FD_t *_file, H5FD_mem_t type, haddr_t eoa)
}
H5E_END_TRY;
if (status < 0)
- H5Epush_ret(func, H5E_ERR_CLS, H5E_FILE, H5E_BADVALUE, "member H5FDset_eoa failed", -1)
+ H5Epush_ret(func, H5E_ERR_CLS, H5E_FILE, H5E_BADVALUE, "member H5FDset_eoa failed", -1);
- return 0;
+ return 0;
} /* end H5FD_multi_set_eoa() */
/*-------------------------------------------------------------------------
- * Function: H5FD_multi_get_eof
+ * Function: H5FD_multi_get_eof
*
- * Purpose: Returns the end-of-file marker, which is the greater of
- * either the total multi size or the current EOA marker.
+ * Purpose: Returns the end-of-file marker, which is the greater of
+ * either the total multi size or the current EOA marker.
*
- * Return: Success: End of file address, the first address past
- * the end of the multi of files or the current
- * EOA, whichever is larger.
+ * Return: Success: End of file address, the first address past
+ * the end of the multi of files or the current
+ * EOA, whichever is larger.
*
- * Failure: HADDR_UNDEF
+ * Failure: HADDR_UNDEF
*
- * Programmer: Robb Matzke
+ * Programmer: Robb Matzke
* Wednesday, August 4, 1999
*
*-------------------------------------------------------------------------
@@ -1431,7 +1413,9 @@ H5FD_multi_get_eof(const H5FD_t *_file, H5FD_mem_t type)
if (HADDR_UNDEF == tmp_eof)
H5Epush_ret(func, H5E_ERR_CLS, H5E_INTERNAL, H5E_BADVALUE, "member file has unknown eof",
- HADDR_UNDEF) if (tmp_eof > 0) tmp_eof += file->fa.memb_addr[mt];
+ HADDR_UNDEF);
+ if (tmp_eof > 0)
+ tmp_eof += file->fa.memb_addr[mt];
}
else if (file->fa.relax) {
/*
@@ -1442,7 +1426,7 @@ H5FD_multi_get_eof(const H5FD_t *_file, H5FD_mem_t type)
assert(HADDR_UNDEF != tmp_eof);
}
else {
- H5Epush_ret(func, H5E_ERR_CLS, H5E_INTERNAL, H5E_BADVALUE, "bad eof", HADDR_UNDEF)
+ H5Epush_ret(func, H5E_ERR_CLS, H5E_INTERNAL, H5E_BADVALUE, "bad eof", HADDR_UNDEF);
}
if (tmp_eof > eof)
eof = tmp_eof;
@@ -1465,7 +1449,9 @@ H5FD_multi_get_eof(const H5FD_t *_file, H5FD_mem_t type)
if (HADDR_UNDEF == eof)
H5Epush_ret(func, H5E_ERR_CLS, H5E_INTERNAL, H5E_BADVALUE, "member file has unknown eof",
- HADDR_UNDEF) if (eof > 0) eof += file->fa.memb_addr[mmt];
+ HADDR_UNDEF);
+ if (eof > 0)
+ eof += file->fa.memb_addr[mmt];
}
else if (file->fa.relax) {
/*
@@ -1476,7 +1462,7 @@ H5FD_multi_get_eof(const H5FD_t *_file, H5FD_mem_t type)
assert(HADDR_UNDEF != eof);
}
else {
- H5Epush_ret(func, H5E_ERR_CLS, H5E_INTERNAL, H5E_BADVALUE, "bad eof", HADDR_UNDEF)
+ H5Epush_ret(func, H5E_ERR_CLS, H5E_INTERNAL, H5E_BADVALUE, "bad eof", HADDR_UNDEF);
}
}
return eof;
@@ -1504,9 +1490,10 @@ H5FD_multi_get_handle(H5FD_t *_file, hid_t fapl, void **file_handle)
/* Get data type for multi driver */
if (H5Pget_multi_type(fapl, &type) < 0)
H5Epush_ret(func, H5E_ERR_CLS, H5E_INTERNAL, H5E_BADVALUE, "can't get data type for multi driver",
- -1) if (type < H5FD_MEM_DEFAULT || type >= H5FD_MEM_NTYPES)
- H5Epush_ret(func, H5E_ERR_CLS, H5E_INTERNAL, H5E_BADVALUE, "data type is out of range", -1) mmt =
- file->fa.memb_map[type];
+ -1);
+ if (type < H5FD_MEM_DEFAULT || type >= H5FD_MEM_NTYPES)
+ H5Epush_ret(func, H5E_ERR_CLS, H5E_INTERNAL, H5E_BADVALUE, "data type is out of range", -1);
+ mmt = file->fa.memb_map[type];
if (H5FD_MEM_DEFAULT == mmt)
mmt = type;
@@ -1514,15 +1501,15 @@ H5FD_multi_get_handle(H5FD_t *_file, hid_t fapl, void **file_handle)
}
/*-------------------------------------------------------------------------
- * Function: H5FD_multi_alloc
+ * Function: H5FD_multi_alloc
*
- * Purpose: Allocate file memory.
+ * Purpose: Allocate file memory.
*
- * Return: Success: Address of new memory
+ * Return: Success: Address of new memory
*
- * Failure: HADDR_UNDEF
+ * Failure: HADDR_UNDEF
*
- * Programmer: Robb Matzke
+ * Programmer: Robb Matzke
* Thursday, August 12, 1999
*
*-------------------------------------------------------------------------
@@ -1549,36 +1536,36 @@ H5FD_multi_alloc(H5FD_t *_file, H5FD_mem_t type, hid_t dxpl_id, hsize_t size)
}
if (HADDR_UNDEF == (addr = H5FDalloc(file->memb[mmt], mmt, dxpl_id, size)))
- H5Epush_ret(func, H5E_ERR_CLS, H5E_INTERNAL, H5E_BADVALUE, "member file can't alloc", HADDR_UNDEF)
- addr += file->fa.memb_addr[mmt];
+ H5Epush_ret(func, H5E_ERR_CLS, H5E_INTERNAL, H5E_BADVALUE, "member file can't alloc", HADDR_UNDEF);
+ addr += file->fa.memb_addr[mmt];
/*#ifdef TMP
if ( addr + size > file->eoa ) {
- if ( H5FD_multi_set_eoa(_file, addr + size) < 0 ) {
+ if ( H5FD_multi_set_eoa(_file, addr + size) < 0 ) {
H5Epush_ret(func, H5E_ERR_CLS, H5E_INTERNAL, H5E_BADVALUE, \
- "can't set eoa", HADDR_UNDEF)
- }
+ "can't set eoa", HADDR_UNDEF);
+ }
}
#else
if ( addr + size > file->eoa )
- file->eoa = addr + size;
+ file->eoa = addr + size;
#endif */
return addr;
}
/*-------------------------------------------------------------------------
- * Function: H5FD_multi_free
+ * Function: H5FD_multi_free
*
- * Purpose: Frees memory
+ * Purpose: Frees memory
*
- * Return: Success: 0
+ * Return: Success: 0
*
- * Failure: -1
+ * Failure: -1
*
- * Programmer: Robb Matzke
+ * Programmer: Robb Matzke
* Thursday, August 12, 1999
*
*-------------------------------------------------------------------------
@@ -1602,18 +1589,18 @@ H5FD_multi_free(H5FD_t *_file, H5FD_mem_t type, hid_t dxpl_id, haddr_t addr, hsi
}
/*-------------------------------------------------------------------------
- * Function: H5FD_multi_read
+ * Function: H5FD_multi_read
*
- * Purpose: Reads SIZE bytes of data from FILE beginning at address ADDR
- * into buffer BUF according to data transfer properties in
- * DXPL_ID.
+ * Purpose: Reads SIZE bytes of data from FILE beginning at address ADDR
+ * into buffer BUF according to data transfer properties in
+ * DXPL_ID.
*
- * Return: Success: Zero. Result is stored in caller-supplied
- * buffer BUF.
+ * Return: Success: Zero. Result is stored in caller-supplied
+ * buffer BUF.
*
- * Failure: -1, contents of buffer BUF are undefined.
+ * Failure: -1, contents of buffer BUF are undefined.
*
- * Programmer: Robb Matzke
+ * Programmer: Robb Matzke
* Wednesday, August 4, 1999
*
*-------------------------------------------------------------------------
@@ -1649,17 +1636,17 @@ H5FD_multi_read(H5FD_t *_file, H5FD_mem_t type, hid_t dxpl_id, haddr_t addr, siz
} /* end H5FD_multi_read() */
/*-------------------------------------------------------------------------
- * Function: H5FD_multi_write
+ * Function: H5FD_multi_write
*
- * Purpose: Writes SIZE bytes of data to FILE beginning at address ADDR
- * from buffer BUF according to data transfer properties in
- * DXPL_ID.
+ * Purpose: Writes SIZE bytes of data to FILE beginning at address ADDR
+ * from buffer BUF according to data transfer properties in
+ * DXPL_ID.
*
- * Return: Success: Zero
+ * Return: Success: Zero
*
- * Failure: -1
+ * Failure: -1
*
- * Programmer: Robb Matzke
+ * Programmer: Robb Matzke
* Wednesday, August 4, 1999
*
*-------------------------------------------------------------------------
@@ -1695,15 +1682,15 @@ H5FD_multi_write(H5FD_t *_file, H5FD_mem_t type, hid_t dxpl_id, haddr_t addr, si
} /* end H5FD_multi_write() */
/*-------------------------------------------------------------------------
- * Function: H5FD_multi_flush
+ * Function: H5FD_multi_flush
*
- * Purpose: Flushes all multi members.
+ * Purpose: Flushes all multi members.
*
- * Return: Success: 0
+ * Return: Success: 0
*
- * Failure: -1, as many files flushed as possible.
+ * Failure: -1, as many files flushed as possible.
*
- * Programmer: Robb Matzke
+ * Programmer: Robb Matzke
* Wednesday, August 4, 1999
*
*-------------------------------------------------------------------------
@@ -1717,7 +1704,7 @@ H5FD_multi_flush(H5FD_t *_file, hid_t dxpl_id, hbool_t closing)
static const char *func = "H5FD_multi_flush"; /* Function Name for error reporting */
#if 0
- H5FD_mem_t mmt;
+ H5FD_mem_t mmt;
/* Debugging stuff... */
fprintf(stderr, "multifile access information:\n");
@@ -1725,9 +1712,9 @@ H5FD_multi_flush(H5FD_t *_file, hid_t dxpl_id, hbool_t closing)
/* print the map */
fprintf(stderr, " map=");
for (mt=1; mt<H5FD_MEM_NTYPES; mt++) {
- mmt = file->memb_map[mt];
- if (H5FD_MEM_DEFAULT==mmt) mmt = mt;
- fprintf(stderr, "%s%d", 1==mt?"":",", (int)mmt);
+ mmt = file->memb_map[mt];
+ if (H5FD_MEM_DEFAULT==mmt) mmt = mt;
+ fprintf(stderr, "%s%d", 1==mt?"":",", (int)mmt);
}
fprintf(stderr, "\n");
@@ -1737,14 +1724,14 @@ H5FD_multi_flush(H5FD_t *_file, hid_t dxpl_id, hbool_t closing)
fprintf(stderr, " ------ -------------------- -------------------- -------------------- ------------------------------\n");
for (mt=1; mt<H5FD_MEM_NTYPES; mt++) {
- if (HADDR_UNDEF!=file->memb_addr[mt]) {
- haddr_t eoa = H5FDget_eoa(file->memb[mt], mt);
- fprintf(stderr, " %6d %20llu %20llu %20llu %s\n",
- (int)mt, (unsigned long long)(file->memb_addr[mt]),
- (unsigned long long)eoa,
- (unsigned long long)(file->memb_next[mt]),
- file->memb_name[mt]);
- }
+ if (HADDR_UNDEF!=file->memb_addr[mt]) {
+ haddr_t eoa = H5FDget_eoa(file->memb[mt], mt);
+ fprintf(stderr, " %6d %20llu %20llu %20llu %s\n",
+ (int)mt, (unsigned long long)(file->memb_addr[mt]),
+ (unsigned long long)eoa,
+ (unsigned long long)(file->memb_next[mt]),
+ file->memb_name[mt]);
+ }
}
#endif
@@ -1763,20 +1750,20 @@ H5FD_multi_flush(H5FD_t *_file, hid_t dxpl_id, hbool_t closing)
}
}
if (nerrors)
- H5Epush_ret(func, H5E_ERR_CLS, H5E_INTERNAL, H5E_BADVALUE, "error flushing member files", -1)
+ H5Epush_ret(func, H5E_ERR_CLS, H5E_INTERNAL, H5E_BADVALUE, "error flushing member files", -1);
- return 0;
+ return 0;
}
/*-------------------------------------------------------------------------
- * Function: H5FD_multi_truncate
+ * Function: H5FD_multi_truncate
*
- * Purpose: Truncates all multi members.
+ * Purpose: Truncates all multi members.
*
- * Return: Success: 0
- * Failure: -1, as many files truncated as possible.
+ * Return: Success: 0
+ * Failure: -1, as many files truncated as possible.
*
- * Programmer: Quincey Koziol
+ * Programmer: Quincey Koziol
* Thursday, January 31, 2008
*
*-------------------------------------------------------------------------
@@ -1804,23 +1791,23 @@ H5FD_multi_truncate(H5FD_t *_file, hid_t dxpl_id, hbool_t closing)
}
}
if (nerrors)
- H5Epush_ret(func, H5E_ERR_CLS, H5E_INTERNAL, H5E_BADVALUE, "error truncating member files", -1)
+ H5Epush_ret(func, H5E_ERR_CLS, H5E_INTERNAL, H5E_BADVALUE, "error truncating member files", -1);
- return 0;
+ return 0;
} /* end H5FD_multi_truncate() */
/*-------------------------------------------------------------------------
- * Function: H5FD_multi_lock
+ * Function: H5FD_multi_lock
*
- * Purpose: Place a lock on all multi members.
- * When there is error in locking a member file, it will not
- * proceed further and will try to remove the locks of those
- * member files that are locked before error is encountered.
+ * Purpose: Place a lock on all multi members.
+ * When there is error in locking a member file, it will not
+ * proceed further and will try to remove the locks of those
+ * member files that are locked before error is encountered.
*
- * Return: Success: 0
- * Failure: -1
+ * Return: Success: 0
+ * Failure: -1
*
- * Programmer: Vailin Choi; March 2015
+ * Programmer: Vailin Choi; March 2015
*
*-------------------------------------------------------------------------
*/
@@ -1872,16 +1859,16 @@ H5FD_multi_lock(H5FD_t *_file, hbool_t rw)
} /* H5FD_multi_lock() */
/*-------------------------------------------------------------------------
- * Function: H5FD_multi_unlock
+ * Function: H5FD_multi_unlock
*
- * Purpose: Remove the lock on all multi members.
- * It will try to unlock all member files but will record error
- * encountered.
+ * Purpose: Remove the lock on all multi members.
+ * It will try to unlock all member files but will record error
+ * encountered.
*
- * Return: Success: 0
- * Failure: -1
+ * Return: Success: 0
+ * Failure: -1
*
- * Programmer: Vailin Choi; March 2015
+ * Programmer: Vailin Choi; March 2015
*
*-------------------------------------------------------------------------
*/
@@ -1909,16 +1896,16 @@ H5FD_multi_unlock(H5FD_t *_file)
} /* H5FD_multi_unlock() */
/*-------------------------------------------------------------------------
- * Function: compute_next
+ * Function: compute_next
*
- * Purpose: Compute the memb_next[] values of the file based on the
- * file's member map and the member starting addresses.
+ * Purpose: Compute the memb_next[] values of the file based on the
+ * file's member map and the member starting addresses.
*
- * Return: Success: 0
+ * Return: Success: 0
*
- * Failure: -1
+ * Failure: -1
*
- * Programmer: Robb Matzke
+ * Programmer: Robb Matzke
* Monday, August 23, 1999
*
*-------------------------------------------------------------------------
@@ -1953,21 +1940,21 @@ compute_next(H5FD_multi_t *file)
}
/*-------------------------------------------------------------------------
- * Function: open_members
+ * Function: open_members
*
- * Purpose: Opens all members which are not opened yet.
+ * Purpose: Opens all members which are not opened yet.
*
- * Return: Success: 0
+ * Return: Success: 0
*
- * Failure: -1
+ * Failure: -1
*
- * Programmer: Robb Matzke
+ * Programmer: Robb Matzke
* Monday, August 23, 1999
*
*-------------------------------------------------------------------------
*/
-/* Disable warning for "format not a string literal" here -QAK */
-/*
+/* Disable warning for "format not a string literal" here
+ *
* This pragma only needs to surround the snprintf() call with
* tmp in the code below, but early (4.4.7, at least) gcc only
* allows diagnostic pragmas to be toggled outside of functions.
@@ -1978,7 +1965,8 @@ open_members(H5FD_multi_t *file)
{
char tmp[H5FD_MULT_MAX_FILE_NAME_LEN];
int nerrors = 0;
- static const char *func = "(H5FD_multi)open_members"; /* Function Name for error reporting */
+ int nchars;
+ static const char *func = "(H5FD_multi)open_members"; /* Function Name for error reporting */
/* Clear the error stack */
H5Eclear2(H5E_DEFAULT);
@@ -1987,11 +1975,11 @@ open_members(H5FD_multi_t *file)
if (file->memb[mt])
continue; /*already open*/
assert(file->fa.memb_name[mt]);
- /* Note: This truncates the user's filename down to only sizeof(tmp)
- * characters. -QK & JK, 2013/01/17
- */
- sprintf(tmp, file->fa.memb_name[mt], file->name);
- tmp[sizeof(tmp) - 1] = '\0';
+
+ nchars = snprintf(tmp, sizeof(tmp), file->fa.memb_name[mt], file->name);
+ if (nchars < 0 || nchars >= (int)sizeof(tmp))
+ H5Epush_ret(func, H5E_ERR_CLS, H5E_VFL, H5E_BADVALUE,
+ "filename is too long and would be truncated", -1);
H5E_BEGIN_TRY
{
@@ -2005,10 +1993,57 @@ open_members(H5FD_multi_t *file)
}
END_MEMBERS;
if (nerrors)
- H5Epush_ret(func, H5E_ERR_CLS, H5E_INTERNAL, H5E_BADVALUE, "error opening member files", -1)
+ H5Epush_ret(func, H5E_ERR_CLS, H5E_INTERNAL, H5E_BADVALUE, "error opening member files", -1);
- return 0;
+ return 0;
}
+
+/*-------------------------------------------------------------------------
+ * Function: H5FD_multi_delete
+ *
+ * Purpose: Delete a file
+ *
+ * Return: SUCCEED/FAIL
+ *
+ *-------------------------------------------------------------------------
+ */
+static herr_t
+H5FD_multi_delete(const char *filename, hid_t fapl_id)
+{
+ char full_filename[H5FD_MULT_MAX_FILE_NAME_LEN];
+ int nchars;
+ const H5FD_multi_fapl_t *fa;
+ static const char * func = "H5FD_multi_delete"; /* Function Name for error reporting */
+
+ /* Clear the error stack */
+ H5Eclear2(H5E_DEFAULT);
+
+ assert(filename);
+
+ /* Quiet compiler */
+ (void)fapl_id;
+
+ /* Get the driver info */
+ fa = (const H5FD_multi_fapl_t *)H5Pget_driver_info(fapl_id);
+ assert(fa);
+
+ /* Delete each member file using the underlying fapl */
+ UNIQUE_MEMBERS (fa->memb_map, mt) {
+ assert(fa->memb_name[mt]);
+ assert(fa->memb_fapl[mt] >= 0);
+
+ nchars = snprintf(full_filename, sizeof(full_filename), fa->memb_name[mt], filename);
+ if (nchars < 0 || nchars >= (int)sizeof(full_filename))
+ H5Epush_ret(func, H5E_ERR_CLS, H5E_VFL, H5E_BADVALUE,
+ "filename is too long and would be truncated", -1);
+
+ if (H5FDdelete(full_filename, fa->memb_fapl[mt]) < 0)
+ H5Epush_ret(func, H5E_ERR_CLS, H5E_VFL, H5E_BADVALUE, "error deleting member files", -1);
+ }
+ END_MEMBERS;
+
+ return 0;
+} /* end H5FD_multi_delete() */
H5_GCC_DIAG_ON("format-nonliteral")
#ifdef H5private_H
diff --git a/src/H5FDmulti.h b/src/H5FDmulti.h
index 9e04d8d..62cc9c8 100644
--- a/src/H5FDmulti.h
+++ b/src/H5FDmulti.h
@@ -25,11 +25,228 @@
#ifdef __cplusplus
extern "C" {
#endif
-H5_DLL hid_t H5FD_multi_init(void);
+H5_DLL hid_t H5FD_multi_init(void);
+
+/**
+ * \ingroup FAPL
+ *
+ * \brief Sets up use of the multi-file driver
+ *
+ * \fapl_id
+ * \param[in] memb_map Maps memory usage types to other memory usage types
+ * \param[in] memb_fapl Property list for each memory usage type
+ * \param[in] memb_name Name generator for names of member files
+ * \param[in] memb_addr The offsets within the virtual address space, from 0
+ * (zero) to #HADDR_MAX, at which each type of data storage begins
+ * \param[in] relax Allows read-only access to incomplete file sets when \c TRUE
+ * \returns \herr_t
+ *
+ * \details H5Pset_fapl_multi() sets the file access property list \p fapl_id to
+ * use the multi-file driver.
+ *
+ * The multi-file driver enables different types of HDF5 data and
+ * metadata to be written to separate files. These files are viewed by
+ * the HDF5 library and the application as a single virtual HDF5 file
+ * with a single HDF5 file address space. The types of data that can be
+ * broken out into separate files include raw data, the superblock,
+ * B-tree data, global heap data, local heap data, and object
+ * headers. At the programmer's discretion, two or more types of data
+ * can be written to the same file while other types of data are
+ * written to separate files.
+ *
+ * The array \p memb_map maps memory usage types to other memory usage
+ * types and is the mechanism that allows the caller to specify how
+ * many files are created. The array contains #H5FD_MEM_NTYPES entries,
+ * which are either the value #H5FD_MEM_DEFAULT or a memory usage
+ * type. The number of unique values determines the number of files
+ * that are opened.
+ *
+ * The array \p memb_fapl contains a property list for each memory
+ * usage type that will be associated with a file.
+ *
+ * The array \p memb_name should be a name generator (a
+ * \Code{printf}-style format with a \Code{%s} which will be replaced
+ * with the name passed to H5FDopen(), usually from H5Fcreate() or
+ * H5Fopen()).
+ *
+ * The array \p memb_addr specifies the offsets within the virtual
+ * address space, from 0 (zero) to #HADDR_MAX, at which each type of
+ * data storage begins.
+ *
+ * If \p relax is set to 1 (TRUE), then opening an existing file for
+ * read-only access will not fail if some file members are
+ * missing. This allows a file to be accessed in a limited sense if
+ * just the meta data is available.
+ *
+ * Default values for each of the optional arguments are as follows:
+ * <table>
+ * <tr>
+ * <td>\p memb_map</td>
+ * <td>The default member map contains the value #H5FD_MEM_DEFAULT for each element.</td>
+ * </tr>
+ * <tr>
+ * <td>
+ * \p memb_fapl
+ * </td>
+ * <td>
+ * The default value is #H5P_DEFAULT for each element.
+ * </td>
+ * </tr>
+ * <tr>
+ * <td>
+ * \p memb_name
+ * </td>
+ * <td>
+ * The default string is \Code{%s-X.h5} where \c X is one of the following letters:
+ * - \c s for #H5FD_MEM_SUPER
+ * - \c b for #H5FD_MEM_BTREE
+ * - \c r for #H5FD_MEM_DRAW
+ * - \c g for #H5FD_MEM_GHEAP
+ * - \c l for #H5FD_MEM_LHEAP
+ * - \c o for #H5FD_MEM_OHDR
+ * </td>
+ * </tr>
+ * <tr>
+ * <td>
+ * \p memb_addr
+ * </td>
+ * <td>
+ * The default setting is that the address space is equally divided
+ * among all of the elements:
+ * - #H5FD_MEM_SUPER \Code{-> 0 * (HADDR_MAX/6)}
+ * - #H5FD_MEM_BTREE \Code{-> 1 * (HADDR_MAX/6)}
+ * - #H5FD_MEM_DRAW \Code{-> 2 * (HADDR_MAX/6)}
+ * - #H5FD_MEM_GHEAP \Code{-> 3 * (HADDR_MAX/6)}
+ * - #H5FD_MEM_LHEAP \Code{-> 4 * (HADDR_MAX/6)}
+ * - #H5FD_MEM_OHDR \Code{-> 5 * (HADDR_MAX/6)}
+ * </td>
+ * </tr>
+ * </table>
+ *
+ * \par Example:
+ * The following code sample sets up a multi-file access property list that
+ * partitions data into meta and raw files, each being one-half of the address:\n
+ * \code
+ * H5FD_mem_t mt, memb_map[H5FD_MEM_NTYPES];
+ * hid_t memb_fapl[H5FD_MEM_NTYPES];
+ * const char *memb[H5FD_MEM_NTYPES];
+ * haddr_t memb_addr[H5FD_MEM_NTYPES];
+ *
+ * // The mapping...
+ * for (mt=0; mt<H5FD_MEM_NTYPES; mt++) {
+ * memb_map[mt] = H5FD_MEM_SUPER;
+ * }
+ * memb_map[H5FD_MEM_DRAW] = H5FD_MEM_DRAW;
+ *
+ * // Member information
+ * memb_fapl[H5FD_MEM_SUPER] = H5P_DEFAULT;
+ * memb_name[H5FD_MEM_SUPER] = "%s.meta";
+ * memb_addr[H5FD_MEM_SUPER] = 0;
+ *
+ * memb_fapl[H5FD_MEM_DRAW] = H5P_DEFAULT;
+ * memb_name[H5FD_MEM_DRAW] = "%s.raw";
+ * memb_addr[H5FD_MEM_DRAW] = HADDR_MAX/2;
+ *
+ * hid_t fapl = H5Pcreate(H5P_FILE_ACCESS);
+ * H5Pset_fapl_multi(fapl, memb_map, memb_fapl,
+ * memb_name, memb_addr, TRUE);
+ * \endcode
+ *
+ * \version 1.6.3 \p memb_name parameter type changed to \Code{const char* const*}.
+ * \since 1.4.0
+ */
H5_DLL herr_t H5Pset_fapl_multi(hid_t fapl_id, const H5FD_mem_t *memb_map, const hid_t *memb_fapl,
const char *const *memb_name, const haddr_t *memb_addr, hbool_t relax);
+
+/**
+ * \ingroup FAPL
+ *
+ * \brief Returns information about the multi-file access property list
+ *
+ * \fapl_id
+ * \param[out] memb_map Maps memory usage types to other memory usage types
+ * \param[out] memb_fapl Property list for each memory usage type
+ * \param[out] memb_name Name generator for names of member files
+ * \param[out] memb_addr The offsets within the virtual address space, from 0
+ * (zero) to #HADDR_MAX, at which each type of data storage begins
+ * \param[out] relax Allows read-only access to incomplete file sets when \c TRUE
+ * \returns \herr_t
+ *
+ * \details H5Pget_fapl_multi() returns information about the multi-file access
+ * property list.
+ *
+ * \since 1.4.0
+ *
+ */
H5_DLL herr_t H5Pget_fapl_multi(hid_t fapl_id, H5FD_mem_t *memb_map /*out*/, hid_t *memb_fapl /*out*/,
char **memb_name /*out*/, haddr_t *memb_addr /*out*/, hbool_t *relax /*out*/);
+
+/**
+ * \ingroup FAPL
+ *
+ * \brief Emulates the old split file driver
+ *
+ * \fapl_id{fapl}
+ * \param[in] meta_ext Metadata filename extension
+ * \param[in] meta_plist_id File access property list identifier for the metadata file
+ * \param[in] raw_ext Raw data filename extension
+ * \param[in] raw_plist_id
+ * \returns \herr_t
+ *
+ * \details H5Pset_fapl_split() is a compatibility function that enables the
+ * multi-file driver to emulate the split driver from HDF5 Releases 1.0
+ * and 1.2. The split file driver stored metadata and raw data in
+ * separate files but provided no mechanism for separating types of
+ * metadata.
+ *
+ * \p fapl is a file access property list identifier.
+ *
+ * \p meta_ext is the filename extension for the metadata file. The
+ * extension is appended to the name passed to H5FDopen(), usually from
+ * H5Fcreate() or H5Fopen(), to form the name of the metadata file. If
+ * the string \Code{%s} is used in the extension, it works like the
+ * name generator as in H5Pset_fapl_multi().
+ *
+ * \p meta_plist_id is the file access property list identifier for the
+ * metadata file.
+ *
+ * \p raw_ext is the filename extension for the raw data file. The
+ * extension is appended to the name passed to H5FDopen(), usually from
+ * H5Fcreate() or H5Fopen(), to form the name of the raw data file. If
+ * the string \Code{%s} is used in the extension, it works like the
+ * name generator as in H5Pset_fapl_multi().
+ *
+ * \p raw_plist_id is the file access property list identifier for the
+ * raw data file.
+ *
+ * If a user wishes to check to see whether this driver is in use, the
+ * user must call H5Pget_driver() and compare the returned value to the
+ * string #H5FD_MULTI. A positive match will confirm that the multi
+ * driver is in use; HDF5 provides no mechanism to determine whether it
+ * was called as the special case invoked by H5Pset_fapl_split().
+ *
+ * \par Example:
+ * \code
+ * // Example 1: Both metadata and rawdata files are in the same
+ * // directory. Use Station1-m.h5 and Station1-r.h5 as
+ * // the metadata and rawdata files.
+ * hid_t fapl, fid;
+ * fapl = H5Pcreate(H5P_FILE_ACCESS);
+ * H5Pset_fapl_split(fapl, "-m.h5", H5P_DEFAULT, "-r.h5", H5P_DEFAULT);
+ * fid=H5Fcreate("Station1",H5F_ACC_TRUNC,H5P_DEFAULT,fapl);
+ *
+ * // Example 2: metadata and rawdata files are in different
+ * // directories. Use PointA-m.h5 and /pfs/PointA-r.h5 as
+ * // the metadata and rawdata files.
+ * hid_t fapl, fid;
+ * fapl = H5Pcreate(H5P_FILE_ACCESS);
+ * H5Pset_fapl_split(fapl, "-m.h5", H5P_DEFAULT, "/pfs/%s-r.h5", H5P_DEFAULT);
+ * fid=H5Fcreate("PointA",H5F_ACC_TRUNC,H5P_DEFAULT,fapl);
+ * \endcode
+ *
+ * \since 1.4.0
+ *
+ */
H5_DLL herr_t H5Pset_fapl_split(hid_t fapl, const char *meta_ext, hid_t meta_plist_id, const char *raw_ext,
hid_t raw_plist_id);
#ifdef __cplusplus
diff --git a/src/H5FDprivate.h b/src/H5FDprivate.h
index adf900a..645436b 100644
--- a/src/H5FDprivate.h
+++ b/src/H5FDprivate.h
@@ -350,6 +350,7 @@ H5_DLL herr_t H5FD_flush(H5FD_t *file, hbool_t closing);
H5_DLL herr_t H5FD_truncate(H5FD_t *file, hbool_t closing);
H5_DLL herr_t H5FD_lock(H5FD_t *file, hbool_t rw);
H5_DLL herr_t H5FD_unlock(H5FD_t *file);
+H5_DLL herr_t H5FD_delete(const char *name, hid_t fapl_id);
H5_DLL herr_t H5FD_get_fileno(const H5FD_t *file, unsigned long *filenum);
H5_DLL herr_t H5FD_get_vfd_handle(H5FD_t *file, hid_t fapl, void **file_handle);
H5_DLL herr_t H5FD_set_base_addr(H5FD_t *file, haddr_t base_addr);
diff --git a/src/H5FDpublic.h b/src/H5FDpublic.h
index f642f41..46f8803 100644
--- a/src/H5FDpublic.h
+++ b/src/H5FDpublic.h
@@ -299,6 +299,7 @@ typedef struct H5FD_class_t {
herr_t (*truncate)(H5FD_t *file, hid_t dxpl_id, hbool_t closing);
herr_t (*lock)(H5FD_t *file, hbool_t rw);
herr_t (*unlock)(H5FD_t *file);
+ herr_t (*del)(const char *name, hid_t fapl);
H5FD_t *(*dedup)(H5FD_t *, H5FD_t *, hid_t);
H5FD_mem_t fl_map[H5FD_MEM_NTYPES];
} H5FD_class_t;
@@ -333,29 +334,113 @@ struct H5FD_t {
hbool_t paged_aggr; /* Paged aggregation for file space is enabled or not */
};
-/* Define enum for the source of file image callbacks */
+/**
+ * Define enum for the source of file image callbacks
+ */
+//! <!-- [H5FD_file_image_op_t_snip] -->
typedef enum {
H5FD_FILE_IMAGE_OP_NO_OP,
H5FD_FILE_IMAGE_OP_PROPERTY_LIST_SET,
+ /**< Passed to the \p image_malloc and \p image_memcpy callbacks when a
+ * file image buffer is to be copied while being set in a file access
+ * property list (FAPL)*/
H5FD_FILE_IMAGE_OP_PROPERTY_LIST_COPY,
+ /**< Passed to the \p image_malloc and \p image_memcpy callbacks
+ * when a file image buffer is to be copied when a FAPL is copied*/
H5FD_FILE_IMAGE_OP_PROPERTY_LIST_GET,
+ /**<Passed to the \p image_malloc and \p image_memcpy callbacks when
+ * a file image buffer is to be copied while being retrieved from a FAPL*/
H5FD_FILE_IMAGE_OP_PROPERTY_LIST_CLOSE,
+ /**<Passed to the \p image_free callback when a file image
+ * buffer is to be released during a FAPL close operation*/
H5FD_FILE_IMAGE_OP_FILE_OPEN,
+ /**<Passed to the \p image_malloc and
+ * \p image_memcpy callbackswhen a
+ * file image buffer is to be copied during a file open operation \n
+ * While the file image being opened will typically be copied from a
+ * FAPL, this need not always be the case. For example, the core file
+ * driver, also known as the memory file driver, takes its initial
+ * image from a file.*/
H5FD_FILE_IMAGE_OP_FILE_RESIZE,
+ /**<Passed to the \p image_realloc callback when a file driver needs
+ * to resize an image buffer*/
H5FD_FILE_IMAGE_OP_FILE_CLOSE
+ /**<Passed to the \p image_free callback when an image buffer is to
+ * be released during a file close operation*/
} H5FD_file_image_op_t;
+//! <!-- [H5FD_file_image_op_t_snip] -->
-/* Define structure to hold file image callbacks */
+/**
+ * Define structure to hold file image callbacks
+ */
+//! <!-- [H5FD_file_image_callbacks_t_snip] -->
typedef struct {
+ /**
+ * \param[in] size Size in bytes of the file image buffer to allocate
+ * \param[in] file_image_op A value from H5FD_file_image_op_t indicating
+ * the operation being performed on the file image
+ * when this callback is invoked
+ * \param[in] udata Value passed in in the H5Pset_file_image_callbacks
+ * parameter \p udata
+ */
+ //! <!-- [image_malloc_snip] -->
void *(*image_malloc)(size_t size, H5FD_file_image_op_t file_image_op, void *udata);
+ //! <!-- [image_malloc_snip] -->
+ /**
+ * \param[in] dest Address of the destination buffer
+ * \param[in] src Address of the source buffer
+ * \param[in] file_image_op A value from #H5FD_file_image_op_t indicating
+ * the operation being performed on the file image
+ * when this callback is invoked
+ * \param[in] udata Value passed in in the H5Pset_file_image_callbacks
+ * parameter \p udata
+ */
+ //! <!-- [image_memcpy_snip] -->
void *(*image_memcpy)(void *dest, const void *src, size_t size, H5FD_file_image_op_t file_image_op,
void *udata);
+ //! <!-- [image_memcpy_snip] -->
+ /**
+ * \param[in] ptr Pointer to the buffer being reallocated
+ * \param[in] file_image_op A value from #H5FD_file_image_op_t indicating
+ * the operation being performed on the file image
+ * when this callback is invoked
+ * \param[in] udata Value passed in in the H5Pset_file_image_callbacks
+ * parameter \p udata
+ */
+ //! <!-- [image_realloc_snip] -->
void *(*image_realloc)(void *ptr, size_t size, H5FD_file_image_op_t file_image_op, void *udata);
+ //! <!-- [image_realloc_snip] -->
+ /**
+ * \param[in] udata Value passed in in the H5Pset_file_image_callbacks
+ * parameter \p udata
+ */
+ //! <!-- [image_free_snip] -->
herr_t (*image_free)(void *ptr, H5FD_file_image_op_t file_image_op, void *udata);
+ //! <!-- [image_free_snip] -->
+ /**
+ * \param[in] udata Value passed in in the H5Pset_file_image_callbacks
+ * parameter \p udata
+ */
+ //! <!-- [udata_copy_snip] -->
void *(*udata_copy)(void *udata);
+ //! <!-- [udata_copy_snip] -->
+ /**
+ * \param[in] udata Value passed in in the H5Pset_file_image_callbacks
+ * parameter \p udata
+ */
+ //! <!-- [udata_free_snip] -->
herr_t (*udata_free)(void *udata);
+ //! <!-- [udata_free_snip] -->
+ /**
+ * \brief The final field in the #H5FD_file_image_callbacks_t struct,
+ * provides a pointer to user-defined data. This pointer will be
+ * passed to the image_malloc, image_memcpy, image_realloc, and
+ * image_free callbacks. Define udata as NULL if no user-defined
+ * data is provided.
+ */
void *udata;
} H5FD_file_image_callbacks_t;
+//! <!-- [H5FD_file_image_callbacks_t_snip] -->
#ifdef __cplusplus
extern "C" {
@@ -382,6 +467,7 @@ H5_DLL herr_t H5FDflush(H5FD_t *file, hid_t dxpl_id, hbool_t closing);
H5_DLL herr_t H5FDtruncate(H5FD_t *file, hid_t dxpl_id, hbool_t closing);
H5_DLL herr_t H5FDlock(H5FD_t *file, hbool_t rw);
H5_DLL herr_t H5FDunlock(H5FD_t *file);
+H5_DLL herr_t H5FDdelete(const char *name, hid_t fapl_id);
/* Allows querying a VFD ID for features before the file is opened */
H5_DLL herr_t H5FDdriver_query(hid_t driver_id, unsigned long *flags /*out*/);
diff --git a/src/H5FDros3.c b/src/H5FDros3.c
index a241180..0303b50 100644
--- a/src/H5FDros3.c
+++ b/src/H5FDros3.c
@@ -214,59 +214,59 @@ typedef struct H5FD_ros3_t {
#define ADDR_OVERFLOW(A) (HADDR_UNDEF == (A) || ((A) & ~(haddr_t)MAXADDR))
/* Prototypes */
-static herr_t H5FD_ros3_term(void);
-static void * H5FD_ros3_fapl_get(H5FD_t *_file);
-static void * H5FD_ros3_fapl_copy(const void *_old_fa);
-static herr_t H5FD_ros3_fapl_free(void *_fa);
-static H5FD_t *H5FD_ros3_open(const char *name, unsigned flags, hid_t fapl_id, haddr_t maxaddr);
-static herr_t H5FD_ros3_close(H5FD_t *_file);
-static int H5FD_ros3_cmp(const H5FD_t *_f1, const H5FD_t *_f2);
-static herr_t H5FD_ros3_query(const H5FD_t *_f1, unsigned long *flags);
-static haddr_t H5FD_ros3_get_eoa(const H5FD_t *_file, H5FD_mem_t type);
-static herr_t H5FD_ros3_set_eoa(H5FD_t *_file, H5FD_mem_t type, haddr_t addr);
-static haddr_t H5FD_ros3_get_eof(const H5FD_t *_file, H5FD_mem_t type);
-static herr_t H5FD_ros3_get_handle(H5FD_t *_file, hid_t fapl, void **file_handle);
-static herr_t H5FD_ros3_read(H5FD_t *_file, H5FD_mem_t type, hid_t fapl_id, haddr_t addr, size_t size,
- void *buf);
-static herr_t H5FD_ros3_write(H5FD_t *_file, H5FD_mem_t type, hid_t fapl_id, haddr_t addr, size_t size,
- const void *buf);
-static herr_t H5FD_ros3_truncate(H5FD_t *_file, hid_t dxpl_id, hbool_t closing);
-static herr_t H5FD_ros3_lock(H5FD_t *_file, hbool_t rw);
-static herr_t H5FD_ros3_unlock(H5FD_t *_file);
-static herr_t H5FD_ros3_validate_config(const H5FD_ros3_fapl_t *fa);
+static herr_t H5FD__ros3_term(void);
+static void * H5FD__ros3_fapl_get(H5FD_t *_file);
+static void * H5FD__ros3_fapl_copy(const void *_old_fa);
+static herr_t H5FD__ros3_fapl_free(void *_fa);
+static H5FD_t *H5FD__ros3_open(const char *name, unsigned flags, hid_t fapl_id, haddr_t maxaddr);
+static herr_t H5FD__ros3_close(H5FD_t *_file);
+static int H5FD__ros3_cmp(const H5FD_t *_f1, const H5FD_t *_f2);
+static herr_t H5FD__ros3_query(const H5FD_t *_f1, unsigned long *flags);
+static haddr_t H5FD__ros3_get_eoa(const H5FD_t *_file, H5FD_mem_t type);
+static herr_t H5FD__ros3_set_eoa(H5FD_t *_file, H5FD_mem_t type, haddr_t addr);
+static haddr_t H5FD__ros3_get_eof(const H5FD_t *_file, H5FD_mem_t type);
+static herr_t H5FD__ros3_get_handle(H5FD_t *_file, hid_t fapl, void **file_handle);
+static herr_t H5FD__ros3_read(H5FD_t *_file, H5FD_mem_t type, hid_t fapl_id, haddr_t addr, size_t size,
+ void *buf);
+static herr_t H5FD__ros3_write(H5FD_t *_file, H5FD_mem_t type, hid_t fapl_id, haddr_t addr, size_t size,
+ const void *buf);
+static herr_t H5FD__ros3_truncate(H5FD_t *_file, hid_t dxpl_id, hbool_t closing);
+
+static herr_t H5FD__ros3_validate_config(const H5FD_ros3_fapl_t *fa);
static const H5FD_class_t H5FD_ros3_g = {
"ros3", /* name */
MAXADDR, /* maxaddr */
H5F_CLOSE_WEAK, /* fc_degree */
- H5FD_ros3_term, /* terminate */
+ H5FD__ros3_term, /* terminate */
NULL, /* sb_size */
NULL, /* sb_encode */
NULL, /* sb_decode */
sizeof(H5FD_ros3_fapl_t), /* fapl_size */
- H5FD_ros3_fapl_get, /* fapl_get */
- H5FD_ros3_fapl_copy, /* fapl_copy */
- H5FD_ros3_fapl_free, /* fapl_free */
+ H5FD__ros3_fapl_get, /* fapl_get */
+ H5FD__ros3_fapl_copy, /* fapl_copy */
+ H5FD__ros3_fapl_free, /* fapl_free */
0, /* dxpl_size */
NULL, /* dxpl_copy */
NULL, /* dxpl_free */
- H5FD_ros3_open, /* open */
- H5FD_ros3_close, /* close */
- H5FD_ros3_cmp, /* cmp */
- H5FD_ros3_query, /* query */
+ H5FD__ros3_open, /* open */
+ H5FD__ros3_close, /* close */
+ H5FD__ros3_cmp, /* cmp */
+ H5FD__ros3_query, /* query */
NULL, /* get_type_map */
NULL, /* alloc */
NULL, /* free */
- H5FD_ros3_get_eoa, /* get_eoa */
- H5FD_ros3_set_eoa, /* set_eoa */
- H5FD_ros3_get_eof, /* get_eof */
- H5FD_ros3_get_handle, /* get_handle */
- H5FD_ros3_read, /* read */
- H5FD_ros3_write, /* write */
+ H5FD__ros3_get_eoa, /* get_eoa */
+ H5FD__ros3_set_eoa, /* set_eoa */
+ H5FD__ros3_get_eof, /* get_eof */
+ H5FD__ros3_get_handle, /* get_handle */
+ H5FD__ros3_read, /* read */
+ H5FD__ros3_write, /* write */
NULL, /* flush */
- H5FD_ros3_truncate, /* truncate */
- H5FD_ros3_lock, /* lock */
- H5FD_ros3_unlock, /* unlock */
+ H5FD__ros3_truncate, /* truncate */
+ NULL, /* lock */
+ NULL, /* unlock */
+ NULL, /* del */
NULL, /* dedup */
H5FD_FLMAP_DICHOTOMY /* fl_map */
};
@@ -292,13 +292,11 @@ H5FD__init_package(void)
FUNC_ENTER_STATIC
- if (H5FD_ros3_init() < 0) {
+ if (H5FD_ros3_init() < 0)
HGOTO_ERROR(H5E_VFL, H5E_CANTINIT, FAIL, "unable to initialize ros3 VFD")
- }
done:
FUNC_LEAVE_NOAPI(ret_value)
-
} /* end H5FD__init_package() */
/*-------------------------------------------------------------------------
@@ -322,7 +320,7 @@ H5FD_ros3_init(void)
unsigned int bin_i;
#endif
- FUNC_ENTER_NOAPI(FAIL)
+ FUNC_ENTER_NOAPI(H5I_INVALID_HID)
#if ROS3_DEBUG
HDfprintf(stdout, "H5FD_ros3_init() called.\n");
@@ -336,21 +334,20 @@ H5FD_ros3_init(void)
*/
for (bin_i = 0; bin_i < ROS3_STATS_BIN_COUNT; bin_i++) {
unsigned long long value = 0;
+
ROS3_STATS_POW(bin_i, &value)
ros3_stats_boundaries[bin_i] = value;
}
#endif
- /* Set return value */
ret_value = H5FD_ROS3_g;
done:
FUNC_LEAVE_NOAPI(ret_value)
-
} /* end H5FD_ros3_init() */
/*---------------------------------------------------------------------------
- * Function: H5FD_ros3_term
+ * Function: H5FD__ros3_term
*
* Purpose: Shut down the VFD
*
@@ -361,20 +358,19 @@ done:
*---------------------------------------------------------------------------
*/
static herr_t
-H5FD_ros3_term(void)
+H5FD__ros3_term(void)
{
- FUNC_ENTER_NOAPI_NOINIT_NOERR
+ FUNC_ENTER_STATIC_NOERR
#if ROS3_DEBUG
- HDfprintf(stdout, "H5FD_ros3_term() called.\n");
+ HDfprintf(stdout, "H5FD__ros3_term() called.\n");
#endif
/* Reset VFL ID */
H5FD_ROS3_g = 0;
FUNC_LEAVE_NOAPI(SUCCEED)
-
-} /* end H5FD_ros3_term() */
+} /* end H5FD__ros3_term() */
/*-------------------------------------------------------------------------
* Function: H5Pset_fapl_ros3
@@ -407,23 +403,20 @@ H5Pset_fapl_ros3(hid_t fapl_id, H5FD_ros3_fapl_t *fa)
#endif
plist = H5P_object_verify(fapl_id, H5P_FILE_ACCESS);
- if (plist == NULL) {
+ if (plist == NULL)
HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a file access property list")
- }
- if (FAIL == H5FD_ros3_validate_config(fa)) {
+ if (FAIL == H5FD__ros3_validate_config(fa))
HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "invalid ros3 config")
- }
ret_value = H5P_set_driver(plist, H5FD_ROS3, (void *)fa);
done:
FUNC_LEAVE_API(ret_value)
-
} /* end H5Pset_fapl_ros3() */
/*-------------------------------------------------------------------------
- * Function: H5FD_ros3_validate_config()
+ * Function: H5FD__ros3_validate_config()
*
* Purpose: Test to see if the supplied instance of H5FD_ros3_fapl_t
* contains internally consistant data. Return SUCCEED if so,
@@ -443,30 +436,25 @@ done:
*-------------------------------------------------------------------------
*/
static herr_t
-H5FD_ros3_validate_config(const H5FD_ros3_fapl_t *fa)
+H5FD__ros3_validate_config(const H5FD_ros3_fapl_t *fa)
{
herr_t ret_value = SUCCEED;
- FUNC_ENTER_NOAPI_NOINIT
+ FUNC_ENTER_STATIC
HDassert(fa != NULL);
- if (fa->version != H5FD_CURR_ROS3_FAPL_T_VERSION) {
+ if (fa->version != H5FD_CURR_ROS3_FAPL_T_VERSION)
HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "Unknown H5FD_ros3_fapl_t version");
- }
- /* if set to authenticate, region and id cannot be empty strings
- */
- if (fa->authenticate == TRUE) {
- if ((fa->aws_region[0] == '\0') || (fa->secret_id[0] == '\0')) {
+ /* if set to authenticate, region and id cannot be empty strings */
+ if (fa->authenticate == TRUE)
+ if ((fa->aws_region[0] == '\0') || (fa->secret_id[0] == '\0'))
HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "Inconsistent authentication information");
- }
- }
done:
FUNC_LEAVE_NOAPI(ret_value)
-
-} /* end H5FD_ros3_validate_config() */
+} /* end H5FD__ros3_validate_config() */
/*-------------------------------------------------------------------------
* Function: H5Pget_fapl_ros3
@@ -481,52 +469,45 @@ done:
* Programmer: John Mainzer
* 9/10/17
*
- * Modifications:
- *
*-------------------------------------------------------------------------
*/
herr_t
-H5Pget_fapl_ros3(hid_t fapl_id, H5FD_ros3_fapl_t *fa_out)
+H5Pget_fapl_ros3(hid_t fapl_id, H5FD_ros3_fapl_t *fa_dst /*out*/)
{
- const H5FD_ros3_fapl_t *fa = NULL;
+ const H5FD_ros3_fapl_t *fa_src = NULL;
H5P_genplist_t * plist = NULL;
herr_t ret_value = SUCCEED;
FUNC_ENTER_API(FAIL)
- H5TRACE2("e", "i*#", fapl_id, fa_out);
+ H5TRACE2("e", "ix", fapl_id, fa_dst);
#if ROS3_DEBUG
HDfprintf(stdout, "H5Pget_fapl_ros3() called.\n");
#endif
- if (fa_out == NULL) {
- HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "fa_out is NULL")
- }
+ if (fa_dst == NULL)
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "fa_dst is NULL")
plist = H5P_object_verify(fapl_id, H5P_FILE_ACCESS);
- if (plist == NULL) {
+ if (plist == NULL)
HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a file access list")
- }
- if (H5FD_ROS3 != H5P_peek_driver(plist)) {
+ if (H5FD_ROS3 != H5P_peek_driver(plist))
HGOTO_ERROR(H5E_PLIST, H5E_BADVALUE, FAIL, "incorrect VFL driver")
- }
- fa = (const H5FD_ros3_fapl_t *)H5P_peek_driver_info(plist);
- if (fa == NULL) {
+ fa_src = (const H5FD_ros3_fapl_t *)H5P_peek_driver_info(plist);
+ if (fa_src == NULL)
HGOTO_ERROR(H5E_PLIST, H5E_BADVALUE, FAIL, "bad VFL driver info")
- }
/* Copy the ros3 fapl data out */
- HDmemcpy(fa_out, fa, sizeof(H5FD_ros3_fapl_t));
+ H5MM_memcpy(fa_dst, fa_src, sizeof(H5FD_ros3_fapl_t));
done:
FUNC_LEAVE_API(ret_value)
-
} /* end H5Pget_fapl_ros3() */
/*-------------------------------------------------------------------------
- * Function: H5FD_ros3_fapl_get
+ * Function: H5FD__ros3_fapl_get
*
* Purpose: Gets a file access property list which could be used to
* create an identical file.
@@ -538,42 +519,37 @@ done:
* Programmer: John Mainzer
* 9/8/17
*
- * Modifications:
- *
*-------------------------------------------------------------------------
*/
static void *
-H5FD_ros3_fapl_get(H5FD_t *_file)
+H5FD__ros3_fapl_get(H5FD_t *_file)
{
H5FD_ros3_t * file = (H5FD_ros3_t *)_file;
H5FD_ros3_fapl_t *fa = NULL;
void * ret_value = NULL;
- FUNC_ENTER_NOAPI_NOINIT
+ FUNC_ENTER_STATIC
fa = (H5FD_ros3_fapl_t *)H5MM_calloc(sizeof(H5FD_ros3_fapl_t));
- if (fa == NULL) {
+ if (fa == NULL)
HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "memory allocation failed")
- }
/* Copy the fields of the structure */
- HDmemcpy(fa, &(file->fa), sizeof(H5FD_ros3_fapl_t));
+ H5MM_memcpy(fa, &(file->fa), sizeof(H5FD_ros3_fapl_t));
/* Set return value */
ret_value = fa;
done:
- if (ret_value == NULL) {
- if (fa != NULL) {
+ if (ret_value == NULL)
+ if (fa != NULL)
H5MM_xfree(fa);
- }
- }
- FUNC_LEAVE_NOAPI(ret_value)
-} /* end H5FD_ros3_fapl_get() */
+ FUNC_LEAVE_NOAPI(ret_value)
+} /* end H5FD__ros3_fapl_get() */
/*-------------------------------------------------------------------------
- * Function: H5FD_ros3_fapl_copy
+ * Function: H5FD__ros3_fapl_copy
*
* Purpose: Copies the ros3-specific file access properties.
*
@@ -584,39 +560,34 @@ done:
* Programmer: John Mainzer
* 9/8/17
*
- * Modifications:
- *
*-------------------------------------------------------------------------
*/
static void *
-H5FD_ros3_fapl_copy(const void *_old_fa)
+H5FD__ros3_fapl_copy(const void *_old_fa)
{
const H5FD_ros3_fapl_t *old_fa = (const H5FD_ros3_fapl_t *)_old_fa;
H5FD_ros3_fapl_t * new_fa = NULL;
void * ret_value = NULL;
- FUNC_ENTER_NOAPI_NOINIT
+ FUNC_ENTER_STATIC
new_fa = (H5FD_ros3_fapl_t *)H5MM_malloc(sizeof(H5FD_ros3_fapl_t));
- if (new_fa == NULL) {
+ if (new_fa == NULL)
HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "memory allocation failed");
- }
- HDmemcpy(new_fa, old_fa, sizeof(H5FD_ros3_fapl_t));
+ H5MM_memcpy(new_fa, old_fa, sizeof(H5FD_ros3_fapl_t));
ret_value = new_fa;
done:
- if (ret_value == NULL) {
- if (new_fa != NULL) {
+ if (ret_value == NULL)
+ if (new_fa != NULL)
H5MM_xfree(new_fa);
- }
- }
- FUNC_LEAVE_NOAPI(ret_value)
-} /* end H5FD_ros3_fapl_copy() */
+ FUNC_LEAVE_NOAPI(ret_value)
+} /* end H5FD__ros3_fapl_copy() */
/*-------------------------------------------------------------------------
- * Function: H5FD_ros3_fapl_free
+ * Function: H5FD__ros3_fapl_free
*
* Purpose: Frees the ros3-specific file access properties.
*
@@ -625,27 +596,23 @@ done:
* Programmer: John Mainzer
* 9/8/17
*
- * Modifications:
- *
*-------------------------------------------------------------------------
*/
static herr_t
-H5FD_ros3_fapl_free(void *_fa)
+H5FD__ros3_fapl_free(void *_fa)
{
H5FD_ros3_fapl_t *fa = (H5FD_ros3_fapl_t *)_fa;
- FUNC_ENTER_NOAPI_NOINIT_NOERR
+ FUNC_ENTER_STATIC_NOERR
HDassert(fa != NULL); /* sanity check */
H5MM_xfree(fa);
FUNC_LEAVE_NOAPI(SUCCEED)
-
-} /* end H5FD_ros3_fapl_free() */
+} /* end H5FD__ros3_fapl_free() */
#if ROS3_STATS
-
/*----------------------------------------------------------------------------
*
* Function: ros3_reset_stats()
@@ -673,15 +640,14 @@ ros3_reset_stats(H5FD_ros3_t *file)
unsigned i = 0;
herr_t ret_value = SUCCEED;
- FUNC_ENTER_NOAPI_NOINIT
+ FUNC_ENTER_STATIC
#if ROS3_DEBUG
HDprintf("ros3_reset_stats() called\n");
#endif
- if (file == NULL) {
+ if (file == NULL)
HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "file was null");
- }
for (i = 0; i <= ROS3_STATS_BIN_COUNT; i++) {
file->raw[i].bytes = 0;
@@ -697,14 +663,12 @@ ros3_reset_stats(H5FD_ros3_t *file)
done:
FUNC_LEAVE_NOAPI(ret_value);
-
} /* end ros3_reset_stats() */
-
#endif /* ROS3_STATS */
/*-------------------------------------------------------------------------
*
- * Function: H5FD_ros3_open()
+ * Function: H5FD__ros3_open()
*
* Purpose:
*
@@ -734,7 +698,7 @@ done:
*-------------------------------------------------------------------------
*/
static H5FD_t *
-H5FD_ros3_open(const char *url, unsigned flags, hid_t fapl_id, haddr_t maxaddr)
+H5FD__ros3_open(const char *url, unsigned flags, hid_t fapl_id, haddr_t maxaddr)
{
H5FD_ros3_t * file = NULL;
struct tm * now = NULL;
@@ -744,10 +708,10 @@ H5FD_ros3_open(const char *url, unsigned flags, hid_t fapl_id, haddr_t maxaddr)
H5FD_ros3_fapl_t fa;
H5FD_t * ret_value = NULL;
- FUNC_ENTER_NOAPI_NOINIT
+ FUNC_ENTER_STATIC
#if ROS3_DEBUG
- HDfprintf(stdout, "H5FD_ros3_open() called.\n");
+ HDfprintf(stdout, "H5FD__ros3_open() called.\n");
#endif
/* Sanity check on file offsets */
@@ -763,13 +727,11 @@ H5FD_ros3_open(const char *url, unsigned flags, hid_t fapl_id, haddr_t maxaddr)
if (flags != H5F_ACC_RDONLY)
HGOTO_ERROR(H5E_ARGS, H5E_UNSUPPORTED, NULL, "only Read-Only access allowed")
- if (FAIL == H5Pget_fapl_ros3(fapl_id, &fa)) {
+ if (FAIL == H5Pget_fapl_ros3(fapl_id, &fa))
HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, NULL, "can't get property list")
- }
- if (CURLE_OK != curl_global_init(CURL_GLOBAL_DEFAULT)) {
+ if (CURLE_OK != curl_global_init(CURL_GLOBAL_DEFAULT))
HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, NULL, "unable to initialize curl global (placeholder flags)")
- }
/* open file; procedure depends on whether or not the fapl instructs to
* authenticate requests or not.
@@ -781,66 +743,54 @@ H5FD_ros3_open(const char *url, unsigned flags, hid_t fapl_id, haddr_t maxaddr)
*/
now = gmnow();
HDassert(now != NULL);
- if (ISO8601NOW(iso8601now, now) != (ISO8601_SIZE - 1)) {
+ if (ISO8601NOW(iso8601now, now) != (ISO8601_SIZE - 1))
HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, NULL, "problem while writing iso8601 timestamp")
- }
if (FAIL == H5FD_s3comms_signing_key(signing_key, (const char *)fa.secret_key,
- (const char *)fa.aws_region, (const char *)iso8601now)) {
+ (const char *)fa.aws_region, (const char *)iso8601now))
HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, NULL, "problem while computing signing key")
- }
handle = H5FD_s3comms_s3r_open(url, (const char *)fa.aws_region, (const char *)fa.secret_id,
(const unsigned char *)signing_key);
}
- else {
+ else
handle = H5FD_s3comms_s3r_open(url, NULL, NULL, NULL);
- } /* if/else should authenticate */
- if (handle == NULL) {
+ if (handle == NULL)
/* If we want to check CURL's say on the matter in a controlled
* fashion, this is the place to do it, but would need to make a
* few minor changes to s3comms `s3r_t` and `s3r_read()`.
*/
HGOTO_ERROR(H5E_VFL, H5E_CANTOPENFILE, NULL, "could not open");
- }
- /* create new file struct
- */
+ /* create new file struct */
file = H5FL_CALLOC(H5FD_ros3_t);
- if (file == NULL) {
+ if (file == NULL)
HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "unable to allocate file struct")
- }
file->s3r_handle = handle;
- HDmemcpy(&(file->fa), &fa, sizeof(H5FD_ros3_fapl_t));
+ H5MM_memcpy(&(file->fa), &fa, sizeof(H5FD_ros3_fapl_t));
#if ROS3_STATS
- if (FAIL == ros3_reset_stats(file)) {
+ if (FAIL == ros3_reset_stats(file))
HGOTO_ERROR(H5E_INTERNAL, H5E_UNINITIALIZED, NULL, "unable to reset file statistics")
- }
#endif /* ROS3_STATS */
ret_value = (H5FD_t *)file;
done:
if (ret_value == NULL) {
- if (handle != NULL) {
- if (FAIL == H5FD_s3comms_s3r_close(handle)) {
+ if (handle != NULL)
+ if (FAIL == H5FD_s3comms_s3r_close(handle))
HDONE_ERROR(H5E_VFL, H5E_CANTCLOSEFILE, NULL, "unable to close s3 file handle")
- }
- }
- if (file != NULL) {
+ if (file != NULL)
file = H5FL_FREE(H5FD_ros3_t, file);
- }
curl_global_cleanup(); /* early cleanup because open failed */
} /* end if null return value (error) */
FUNC_LEAVE_NOAPI(ret_value)
-
-} /* end H5FD_ros3_open() */
+} /* end H5FD__ros3_open() */
#if ROS3_STATS
-
/*----------------------------------------------------------------------------
*
* Function: ros3_fprint_stats()
@@ -915,20 +865,16 @@ ros3_fprint_stats(FILE *stream, const H5FD_ros3_t *file)
unsigned suffix_i = 0;
const char suffixes[] = {' ', 'K', 'M', 'G', 'T', 'P'};
- FUNC_ENTER_NOAPI_NOINIT
+ FUNC_ENTER_STATIC
- if (stream == NULL) {
+ if (stream == NULL)
HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "file stream cannot be null");
- }
- if (file == NULL) {
+ if (file == NULL)
HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "file cannot be null");
- }
- if (file->s3r_handle == NULL) {
+ if (file->s3r_handle == NULL)
HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "s3 request handle cannot be null");
- }
- if (file->s3r_handle->purl == NULL) {
+ if (file->s3r_handle->purl == NULL)
HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "parsed url structure cannot be null");
- }
purl = file->s3r_handle->purl;
/******************
@@ -995,9 +941,8 @@ ros3_fprint_stats(FILE *stream, const H5FD_ros3_t *file)
HDfprintf(stream, "SIZES meta raw\n");
HDfprintf(stream, " min ");
- if (count_meta == 0) {
+ if (count_meta == 0)
HDfprintf(stream, " 0.000 ");
- }
else {
re_dub = (double)min_meta;
for (suffix_i = 0; re_dub >= 1024.0; suffix_i++)
@@ -1006,9 +951,8 @@ ros3_fprint_stats(FILE *stream, const H5FD_ros3_t *file)
HDfprintf(stream, "%8.3lf%c ", re_dub, suffixes[suffix_i]);
}
- if (count_raw == 0) {
+ if (count_raw == 0)
HDfprintf(stream, " 0.000 \n");
- }
else {
re_dub = (double)min_raw;
for (suffix_i = 0; re_dub >= 1024.0; suffix_i++)
@@ -1074,9 +1018,8 @@ ros3_fprint_stats(FILE *stream, const H5FD_ros3_t *file)
range_end = ros3_stats_boundaries[i - 1];
HDfprintf(stream, ">");
}
- else {
+ else
HDfprintf(stream, " ");
- }
bm_val = (double)m->bytes;
for (suffix_i = 0; bm_val >= 1024.0; suffix_i++)
@@ -1118,7 +1061,7 @@ ros3_fprint_stats(FILE *stream, const H5FD_ros3_t *file)
am_val, am_suffix, /* metadata average */
ar_val, ar_suffix); /* rawdata average */
- fflush(stream);
+ HDfflush(stream);
}
done:
@@ -1129,7 +1072,7 @@ done:
/*-------------------------------------------------------------------------
*
- * Function: H5FD_ros3_close()
+ * Function: H5FD__ros3_close()
*
* Purpose:
*
@@ -1145,49 +1088,44 @@ done:
*-------------------------------------------------------------------------
*/
static herr_t
-H5FD_ros3_close(H5FD_t H5_ATTR_UNUSED *_file)
+H5FD__ros3_close(H5FD_t H5_ATTR_UNUSED *_file)
{
H5FD_ros3_t *file = (H5FD_ros3_t *)_file;
herr_t ret_value = SUCCEED;
- FUNC_ENTER_NOAPI_NOINIT
+ FUNC_ENTER_STATIC
#if ROS3_DEBUG
- HDfprintf(stdout, "H5FD_ros3_close() called.\n");
+ HDfprintf(stdout, "H5FD__ros3_close() called.\n");
#endif
- /* Sanity checks
- */
+ /* Sanity checks */
HDassert(file != NULL);
HDassert(file->s3r_handle != NULL);
/* Close the underlying request handle
*/
- if (FAIL == H5FD_s3comms_s3r_close(file->s3r_handle)) {
+ if (FAIL == H5FD_s3comms_s3r_close(file->s3r_handle))
HGOTO_ERROR(H5E_VFL, H5E_CANTCLOSEFILE, FAIL, "unable to close S3 request handle")
- }
#if ROS3_STATS
/* TODO: mechanism to re-target stats printout */
- if (ros3_fprint_stats(stdout, file) == FAIL) {
+ if (ros3_fprint_stats(stdout, file) == FAIL)
HGOTO_ERROR(H5E_INTERNAL, H5E_ERROR, FAIL, "problem while writing file statistics")
- }
#endif /* ROS3_STATS */
- /* Release the file info
- */
+ /* Release the file info */
file = H5FL_FREE(H5FD_ros3_t, file);
done:
curl_global_cleanup(); /* cleanup to answer init on open */
FUNC_LEAVE_NOAPI(ret_value)
-
-} /* end H5FD_ros3_close() */
+} /* end H5FD__ros3_close() */
/*-------------------------------------------------------------------------
*
- * Function: H5FD_ros3_cmp()
+ * Function: H5FD__ros3_cmp()
*
* Purpose:
*
@@ -1216,7 +1154,7 @@ done:
*-------------------------------------------------------------------------
*/
static int
-H5FD_ros3_cmp(const H5FD_t *_f1, const H5FD_t *_f2)
+H5FD__ros3_cmp(const H5FD_t *_f1, const H5FD_t *_f2)
{
const H5FD_ros3_t * f1 = (const H5FD_ros3_t *)_f1;
const H5FD_ros3_t * f2 = (const H5FD_ros3_t *)_f2;
@@ -1224,10 +1162,10 @@ H5FD_ros3_cmp(const H5FD_t *_f1, const H5FD_t *_f2)
const parsed_url_t *purl2 = NULL;
int ret_value = 0;
- FUNC_ENTER_NOAPI_NOINIT_NOERR
+ FUNC_ENTER_STATIC_NOERR
#if ROS3_DEBUG
- HDfprintf(stdout, "H5FD_ros3_cmp() called.\n");
+ HDfprintf(stdout, "H5FD__ros3_cmp() called.\n");
#endif
HDassert(f1->s3r_handle != NULL);
@@ -1243,100 +1181,79 @@ H5FD_ros3_cmp(const H5FD_t *_f1, const H5FD_t *_f2)
HDassert(purl2->host != NULL);
/* URL: SCHEME */
- if (HDstrcmp(purl1->scheme, purl2->scheme)) {
- HGOTO_DONE(-1);
- }
+ if (HDstrcmp(purl1->scheme, purl2->scheme))
+ HGOTO_DONE(-1)
/* URL: HOST */
- if (HDstrcmp(purl1->host, purl2->host)) {
- HGOTO_DONE(-1);
- }
+ if (HDstrcmp(purl1->host, purl2->host))
+ HGOTO_DONE(-1)
/* URL: PORT */
if (purl1->port && purl2->port) {
- if (HDstrcmp(purl1->port, purl2->port)) {
- HGOTO_DONE(-1);
- }
- }
- else if (purl1->port) {
- HGOTO_DONE(-1);
- }
- else if (purl2->port) {
- HGOTO_DONE(-1);
+ if (HDstrcmp(purl1->port, purl2->port))
+ HGOTO_DONE(-1)
}
+ else if (purl1->port)
+ HGOTO_DONE(-1)
+ else if (purl2->port)
+ HGOTO_DONE(-1)
/* URL: PATH */
if (purl1->path && purl2->path) {
- if (HDstrcmp(purl1->path, purl2->path)) {
- HGOTO_DONE(-1);
- }
- }
- else if (purl1->path && !purl2->path) {
- HGOTO_DONE(-1);
- }
- else if (purl2->path && !purl1->path) {
- HGOTO_DONE(-1);
+ if (HDstrcmp(purl1->path, purl2->path))
+ HGOTO_DONE(-1)
}
+ else if (purl1->path && !purl2->path)
+ HGOTO_DONE(-1)
+ else if (purl2->path && !purl1->path)
+ HGOTO_DONE(-1)
/* URL: QUERY */
if (purl1->query && purl2->query) {
- if (HDstrcmp(purl1->query, purl2->query)) {
- HGOTO_DONE(-1);
- }
- }
- else if (purl1->query && !purl2->query) {
- HGOTO_DONE(-1);
- }
- else if (purl2->query && !purl1->query) {
- HGOTO_DONE(-1);
+ if (HDstrcmp(purl1->query, purl2->query))
+ HGOTO_DONE(-1)
}
+ else if (purl1->query && !purl2->query)
+ HGOTO_DONE(-1)
+ else if (purl2->query && !purl1->query)
+ HGOTO_DONE(-1)
/* FAPL: AWS_REGION */
if (f1->fa.aws_region[0] != '\0' && f2->fa.aws_region[0] != '\0') {
- if (HDstrcmp(f1->fa.aws_region, f2->fa.aws_region)) {
- HGOTO_DONE(-1);
- }
- }
- else if (f1->fa.aws_region[0] != '\0') {
- HGOTO_DONE(-1);
- }
- else if (f2->fa.aws_region[0] != '\0') {
- HGOTO_DONE(-1);
+ if (HDstrcmp(f1->fa.aws_region, f2->fa.aws_region))
+ HGOTO_DONE(-1)
}
+ else if (f1->fa.aws_region[0] != '\0')
+ HGOTO_DONE(-1)
+ else if (f2->fa.aws_region[0] != '\0')
+ HGOTO_DONE(-1)
/* FAPL: SECRET_ID */
if (f1->fa.secret_id[0] != '\0' && f2->fa.secret_id[0] != '\0') {
- if (HDstrcmp(f1->fa.secret_id, f2->fa.secret_id)) {
- HGOTO_DONE(-1);
- }
- }
- else if (f1->fa.secret_id[0] != '\0') {
- HGOTO_DONE(-1);
- }
- else if (f2->fa.secret_id[0] != '\0') {
- HGOTO_DONE(-1);
+ if (HDstrcmp(f1->fa.secret_id, f2->fa.secret_id))
+ HGOTO_DONE(-1)
}
+ else if (f1->fa.secret_id[0] != '\0')
+ HGOTO_DONE(-1)
+ else if (f2->fa.secret_id[0] != '\0')
+ HGOTO_DONE(-1)
/* FAPL: SECRET_KEY */
if (f1->fa.secret_key[0] != '\0' && f2->fa.secret_key[0] != '\0') {
- if (HDstrcmp(f1->fa.secret_key, f2->fa.secret_key)) {
- HGOTO_DONE(-1);
- }
- }
- else if (f1->fa.secret_key[0] != '\0') {
- HGOTO_DONE(-1);
- }
- else if (f2->fa.secret_key[0] != '\0') {
- HGOTO_DONE(-1);
+ if (HDstrcmp(f1->fa.secret_key, f2->fa.secret_key))
+ HGOTO_DONE(-1)
}
+ else if (f1->fa.secret_key[0] != '\0')
+ HGOTO_DONE(-1)
+ else if (f2->fa.secret_key[0] != '\0')
+ HGOTO_DONE(-1)
done:
FUNC_LEAVE_NOAPI(ret_value)
-
-} /* H5FD_ros3_cmp() */
+} /* H5FD__ros3_cmp() */
/*-------------------------------------------------------------------------
- * Function: H5FD_ros3_query
+ * Function: H5FD__ros3_query
*
* Purpose: Set the flags that this VFL driver is capable of supporting.
* (listed in H5FDpublic.h)
@@ -1355,12 +1272,12 @@ done:
*-------------------------------------------------------------------------
*/
static herr_t
-H5FD_ros3_query(const H5FD_t H5_ATTR_UNUSED *_file, unsigned long *flags /* out */)
+H5FD__ros3_query(const H5FD_t H5_ATTR_UNUSED *_file, unsigned long *flags)
{
- FUNC_ENTER_NOAPI_NOINIT_NOERR
+ FUNC_ENTER_STATIC_NOERR
#if ROS3_DEBUG
- HDfprintf(stdout, "H5FD_ros3_query() called.\n");
+ HDfprintf(stdout, "H5FD__ros3_query() called.\n");
#endif
/* Set the VFL feature flags that this driver supports */
@@ -1371,12 +1288,11 @@ H5FD_ros3_query(const H5FD_t H5_ATTR_UNUSED *_file, unsigned long *flags /* out
} /* end if */
FUNC_LEAVE_NOAPI(SUCCEED)
-
-} /* H5FD_ros3_query() */
+} /* H5FD__ros3_query() */
/*-------------------------------------------------------------------------
*
- * Function: H5FD_ros3_get_eoa()
+ * Function: H5FD__ros3_get_eoa()
*
* Purpose:
*
@@ -1394,23 +1310,22 @@ H5FD_ros3_query(const H5FD_t H5_ATTR_UNUSED *_file, unsigned long *flags /* out
*-------------------------------------------------------------------------
*/
static haddr_t
-H5FD_ros3_get_eoa(const H5FD_t *_file, H5FD_mem_t H5_ATTR_UNUSED type)
+H5FD__ros3_get_eoa(const H5FD_t *_file, H5FD_mem_t H5_ATTR_UNUSED type)
{
const H5FD_ros3_t *file = (const H5FD_ros3_t *)_file;
- FUNC_ENTER_NOAPI_NOINIT_NOERR
+ FUNC_ENTER_STATIC_NOERR
#if ROS3_DEBUG
- HDfprintf(stdout, "H5FD_ros3_get_eoa() called.\n");
+ HDfprintf(stdout, "H5FD__ros3_get_eoa() called.\n");
#endif
FUNC_LEAVE_NOAPI(file->eoa)
-
-} /* end H5FD_ros3_get_eoa() */
+} /* end H5FD__ros3_get_eoa() */
/*-------------------------------------------------------------------------
*
- * Function: H5FD_ros3_set_eoa()
+ * Function: H5FD__ros3_set_eoa()
*
* Purpose:
*
@@ -1426,25 +1341,24 @@ H5FD_ros3_get_eoa(const H5FD_t *_file, H5FD_mem_t H5_ATTR_UNUSED type)
*-------------------------------------------------------------------------
*/
static herr_t
-H5FD_ros3_set_eoa(H5FD_t *_file, H5FD_mem_t H5_ATTR_UNUSED type, haddr_t addr)
+H5FD__ros3_set_eoa(H5FD_t *_file, H5FD_mem_t H5_ATTR_UNUSED type, haddr_t addr)
{
H5FD_ros3_t *file = (H5FD_ros3_t *)_file;
- FUNC_ENTER_NOAPI_NOINIT_NOERR
+ FUNC_ENTER_STATIC_NOERR
#if ROS3_DEBUG
- HDfprintf(stdout, "H5FD_ros3_set_eoa() called.\n");
+ HDfprintf(stdout, "H5FD__ros3_set_eoa() called.\n");
#endif
file->eoa = addr;
FUNC_LEAVE_NOAPI(SUCCEED)
-
-} /* H5FD_ros3_set_eoa() */
+} /* H5FD__ros3_set_eoa() */
/*-------------------------------------------------------------------------
*
- * Function: H5FD_ros3_get_eof()
+ * Function: H5FD__ros3_get_eof()
*
* Purpose:
*
@@ -1461,23 +1375,22 @@ H5FD_ros3_set_eoa(H5FD_t *_file, H5FD_mem_t H5_ATTR_UNUSED type, haddr_t addr)
*-------------------------------------------------------------------------
*/
static haddr_t
-H5FD_ros3_get_eof(const H5FD_t *_file, H5FD_mem_t H5_ATTR_UNUSED type)
+H5FD__ros3_get_eof(const H5FD_t *_file, H5FD_mem_t H5_ATTR_UNUSED type)
{
const H5FD_ros3_t *file = (const H5FD_ros3_t *)_file;
- FUNC_ENTER_NOAPI_NOINIT_NOERR
+ FUNC_ENTER_STATIC_NOERR
#if ROS3_DEBUG
- HDfprintf(stdout, "H5FD_ros3_get_eof() called.\n");
+ HDfprintf(stdout, "H5FD__ros3_get_eof() called.\n");
#endif
FUNC_LEAVE_NOAPI(H5FD_s3comms_s3r_get_filesize(file->s3r_handle))
-
-} /* end H5FD_ros3_get_eof() */
+} /* end H5FD__ros3_get_eof() */
/*-------------------------------------------------------------------------
*
- * Function: H5FD_ros3_get_handle()
+ * Function: H5FD__ros3_get_handle()
*
* Purpose:
*
@@ -1493,31 +1406,29 @@ H5FD_ros3_get_eof(const H5FD_t *_file, H5FD_mem_t H5_ATTR_UNUSED type)
*-------------------------------------------------------------------------
*/
static herr_t
-H5FD_ros3_get_handle(H5FD_t *_file, hid_t H5_ATTR_UNUSED fapl, void **file_handle)
+H5FD__ros3_get_handle(H5FD_t *_file, hid_t H5_ATTR_UNUSED fapl, void **file_handle)
{
H5FD_ros3_t *file = (H5FD_ros3_t *)_file;
herr_t ret_value = SUCCEED;
- FUNC_ENTER_NOAPI_NOINIT
+ FUNC_ENTER_STATIC
#if ROS3_DEBUG
- HDfprintf(stdout, "H5FD_ros3_get_handle() called.\n");
+ HDfprintf(stdout, "H5FD__ros3_get_handle() called.\n");
#endif
- if (!file_handle) {
+ if (!file_handle)
HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "file handle not valid")
- }
*file_handle = file->s3r_handle;
done:
FUNC_LEAVE_NOAPI(ret_value)
-
-} /* end H5FD_ros3_get_handle() */
+} /* end H5FD__ros3_get_handle() */
/*-------------------------------------------------------------------------
*
- * Function: H5FD_ros3_read()
+ * Function: H5FD__ros3_read()
*
* Purpose
*
@@ -1538,8 +1449,8 @@ done:
*-------------------------------------------------------------------------
*/
static herr_t
-H5FD_ros3_read(H5FD_t *_file, H5FD_mem_t H5_ATTR_UNUSED type, hid_t H5_ATTR_UNUSED dxpl_id, haddr_t addr,
- size_t size, void *buf)
+H5FD__ros3_read(H5FD_t *_file, H5FD_mem_t H5_ATTR_UNUSED type, hid_t H5_ATTR_UNUSED dxpl_id, haddr_t addr,
+ size_t size, void *buf)
{
H5FD_ros3_t *file = (H5FD_ros3_t *)_file;
size_t filesize = 0;
@@ -1550,10 +1461,10 @@ H5FD_ros3_read(H5FD_t *_file, H5FD_mem_t H5_ATTR_UNUSED type, hid_t H5_ATTR_UNUS
unsigned bin_i = 0;
#endif /* ROS3_STATS */
- FUNC_ENTER_NOAPI_NOINIT
+ FUNC_ENTER_STATIC
#if ROS3_DEBUG
- HDfprintf(stdout, "H5FD_ros3_read() called.\n");
+ HDfprintf(stdout, "H5FD__ros3_read() called.\n");
#endif
HDassert(file != NULL);
@@ -1562,38 +1473,30 @@ H5FD_ros3_read(H5FD_t *_file, H5FD_mem_t H5_ATTR_UNUSED type, hid_t H5_ATTR_UNUS
filesize = H5FD_s3comms_s3r_get_filesize(file->s3r_handle);
- if ((addr > filesize) || ((addr + size) > filesize)) {
+ if ((addr > filesize) || ((addr + size) > filesize))
HGOTO_ERROR(H5E_ARGS, H5E_OVERFLOW, FAIL, "range exceeds file address")
- }
- if (H5FD_s3comms_s3r_read(file->s3r_handle, addr, size, buf) == FAIL) {
+ if (H5FD_s3comms_s3r_read(file->s3r_handle, addr, size, buf) == FAIL)
HGOTO_ERROR(H5E_VFL, H5E_READERROR, FAIL, "unable to execute read")
- }
#if ROS3_STATS
- /* Find which "bin" this read fits in. Can be "overflow" bin.
- */
- for (bin_i = 0; bin_i < ROS3_STATS_BIN_COUNT; bin_i++) {
- if ((unsigned long long)size < ros3_stats_boundaries[bin_i]) {
+ /* Find which "bin" this read fits in. Can be "overflow" bin. */
+ for (bin_i = 0; bin_i < ROS3_STATS_BIN_COUNT; bin_i++)
+ if ((unsigned long long)size < ros3_stats_boundaries[bin_i])
break;
- }
- }
bin = (type == H5FD_MEM_DRAW) ? &file->raw[bin_i] : &file->meta[bin_i];
- /* Store collected stats in appropriate bin
- */
+ /* Store collected stats in appropriate bin */
if (bin->count == 0) {
bin->min = size;
bin->max = size;
}
else {
- if (size < bin->min) {
+ if (size < bin->min)
bin->min = size;
- }
- if (size > bin->max) {
+ if (size > bin->max)
bin->max = size;
- }
}
bin->count++;
bin->bytes += (unsigned long long)size;
@@ -1602,12 +1505,11 @@ H5FD_ros3_read(H5FD_t *_file, H5FD_mem_t H5_ATTR_UNUSED type, hid_t H5_ATTR_UNUS
done:
FUNC_LEAVE_NOAPI(ret_value)
-
-} /* end H5FD_ros3_read() */
+} /* end H5FD__ros3_read() */
/*-------------------------------------------------------------------------
*
- * Function: H5FD_ros3_write()
+ * Function: H5FD__ros3_write()
*
* Purpose:
*
@@ -1624,27 +1526,26 @@ done:
*-------------------------------------------------------------------------
*/
static herr_t
-H5FD_ros3_write(H5FD_t H5_ATTR_UNUSED *_file, H5FD_mem_t H5_ATTR_UNUSED type, hid_t H5_ATTR_UNUSED dxpl_id,
- haddr_t H5_ATTR_UNUSED addr, size_t H5_ATTR_UNUSED size, const void H5_ATTR_UNUSED *buf)
+H5FD__ros3_write(H5FD_t H5_ATTR_UNUSED *_file, H5FD_mem_t H5_ATTR_UNUSED type, hid_t H5_ATTR_UNUSED dxpl_id,
+ haddr_t H5_ATTR_UNUSED addr, size_t H5_ATTR_UNUSED size, const void H5_ATTR_UNUSED *buf)
{
herr_t ret_value = FAIL;
- FUNC_ENTER_NOAPI_NOINIT
+ FUNC_ENTER_STATIC
#if ROS3_DEBUG
- HDfprintf(stdout, "H5FD_ros3_write() called.\n");
+ HDfprintf(stdout, "H5FD__ros3_write() called.\n");
#endif
HGOTO_ERROR(H5E_VFL, H5E_UNSUPPORTED, FAIL, "cannot write to read-only file.")
done:
FUNC_LEAVE_NOAPI(ret_value)
-
-} /* H5FD_ros3_write() */
+} /* H5FD__ros3_write() */
/*-------------------------------------------------------------------------
*
- * Function: H5FD_ros3_truncate()
+ * Function: H5FD__ros3_truncate()
*
* Purpose:
*
@@ -1663,76 +1564,21 @@ done:
*-------------------------------------------------------------------------
*/
static herr_t
-H5FD_ros3_truncate(H5FD_t H5_ATTR_UNUSED *_file, hid_t H5_ATTR_UNUSED dxpl_id, hbool_t H5_ATTR_UNUSED closing)
+H5FD__ros3_truncate(H5FD_t H5_ATTR_UNUSED *_file, hid_t H5_ATTR_UNUSED dxpl_id,
+ hbool_t H5_ATTR_UNUSED closing)
{
herr_t ret_value = SUCCEED;
- FUNC_ENTER_NOAPI_NOINIT
+ FUNC_ENTER_STATIC
#if ROS3_DEBUG
- HDfprintf(stdout, "H5FD_ros3_truncate() called.\n");
+ HDfprintf(stdout, "H5FD__ros3_truncate() called.\n");
#endif
HGOTO_ERROR(H5E_VFL, H5E_UNSUPPORTED, FAIL, "cannot truncate read-only file.")
done:
FUNC_LEAVE_NOAPI(ret_value)
-
-} /* end H5FD_ros3_truncate() */
-
-/*-------------------------------------------------------------------------
- *
- * Function: H5FD_ros3_lock()
- *
- * Purpose:
- *
- * Place an advisory lock on a file.
- * No effect on Read-Only S3 file.
- *
- * Suggestion: remove lock/unlock from class
- * > would result in error at H5FD_[un]lock() (H5FD.c)
- *
- * Return:
- *
- * SUCCEED (No-op always succeeds)
- *
- * Programmer: Jacob Smith
- * 2017-11-03
- *
- *-------------------------------------------------------------------------
- */
-static herr_t
-H5FD_ros3_lock(H5FD_t H5_ATTR_UNUSED *_file, hbool_t H5_ATTR_UNUSED rw)
-{
- FUNC_ENTER_NOAPI_NOINIT_NOERR
- FUNC_LEAVE_NOAPI(SUCCEED)
-
-} /* end H5FD_ros3_lock() */
-
-/*-------------------------------------------------------------------------
- *
- * Function: H5FD_ros3_unlock()
- *
- * Purpose:
- *
- * Remove the existing lock on the file.
- * No effect on Read-Only S3 file.
- *
- * Return:
- *
- * SUCCEED (No-op always succeeds)
- *
- * Programmer: Jacob Smith
- * 2017-11-03
- *
- *-------------------------------------------------------------------------
- */
-static herr_t
-H5FD_ros3_unlock(H5FD_t H5_ATTR_UNUSED *_file)
-{
- FUNC_ENTER_NOAPI_NOINIT_NOERR
- FUNC_LEAVE_NOAPI(SUCCEED)
-
-} /* end H5FD_ros3_unlock() */
+} /* end H5FD__ros3_truncate() */
#endif /* H5_HAVE_ROS3_VFD */
diff --git a/src/H5FDros3.h b/src/H5FDros3.h
index 3ef6b8a..8e42ca2 100644
--- a/src/H5FDros3.h
+++ b/src/H5FDros3.h
@@ -89,8 +89,20 @@ typedef struct H5FD_ros3_fapl_t {
extern "C" {
#endif
-H5_DLL hid_t H5FD_ros3_init(void);
+H5_DLL hid_t H5FD_ros3_init(void);
+
+/**
+ * \ingroup FAPL
+ *
+ * \todo Add missing documentation
+ */
H5_DLL herr_t H5Pget_fapl_ros3(hid_t fapl_id, H5FD_ros3_fapl_t *fa_out);
+
+/**
+ * \ingroup FAPL
+ *
+ * \todo Add missing documentation
+ */
H5_DLL herr_t H5Pset_fapl_ros3(hid_t fapl_id, H5FD_ros3_fapl_t *fa);
#ifdef __cplusplus
diff --git a/src/H5FDs3comms.c b/src/H5FDs3comms.c
index d958675..ee5b5ec 100644
--- a/src/H5FDs3comms.c
+++ b/src/H5FDs3comms.c
@@ -140,18 +140,16 @@ curlwritecallback(char *ptr, size_t size, size_t nmemb, void *userdata)
size_t product = (size * nmemb);
size_t written = 0;
- if (sds->magic != S3COMMS_CALLBACK_DATASTRUCT_MAGIC) {
+ if (sds->magic != S3COMMS_CALLBACK_DATASTRUCT_MAGIC)
return written;
- }
if (size > 0) {
- HDmemcpy(&(sds->data[sds->size]), ptr, product);
+ H5MM_memcpy(&(sds->data[sds->size]), ptr, product);
sds->size += product;
written = product;
}
return written;
-
} /* end curlwritecallback() */
/*----------------------------------------------------------------------------
@@ -224,21 +222,19 @@ H5FD_s3comms_hrb_node_set(hrb_node_t **L, const char *name, const char *value)
FUNC_ENTER_NOAPI_NOINIT
#if S3COMMS_DEBUG
- HDfprintf(stdout, "called H5FD_s3comms_hrb_node_set.\n");
+ HDfprintf(stdout, "called H5FD_s3comms_hrb_node_set.");
HDprintf("NAME: %s\n", name);
HDprintf("VALUE: %s\n", value);
HDprintf("LIST:\n->");
- for (node_ptr = (*L); node_ptr != NULL; node_ptr = node_ptr->next) {
+ for (node_ptr = (*L); node_ptr != NULL; node_ptr = node_ptr->next)
HDfprintf(stdout, "{%s}\n->", node_ptr->cat);
- }
HDprintf("(null)\n");
- fflush(stdout);
+ HDfflush(stdout);
node_ptr = NULL;
#endif
- if (name == NULL) {
- HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "unable to operate on null name.\n");
- }
+ if (name == NULL)
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "unable to operate on null name");
namelen = HDstrlen(name);
/***********************
@@ -248,12 +244,10 @@ H5FD_s3comms_hrb_node_set(hrb_node_t **L, const char *name, const char *value)
/* copy and lowercase name
*/
lowername = (char *)H5MM_malloc(sizeof(char) * (namelen + 1));
- if (lowername == NULL) {
- HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "cannot make space for lowercase name copy.\n");
- }
- for (i = 0; i < namelen; i++) {
- lowername[i] = (char)tolower((int)name[i]);
- }
+ if (lowername == NULL)
+ HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "cannot make space for lowercase name copy.");
+ for (i = 0; i < namelen; i++)
+ lowername[i] = (char)HDtolower((int)name[i]);
lowername[namelen] = 0;
/* If value supplied, copy name, value, and concatenated "name: value".
@@ -267,33 +261,28 @@ H5FD_s3comms_hrb_node_set(hrb_node_t **L, const char *name, const char *value)
size_t catwrite = catlen + 3; /* 3 not 1 to quiet compiler warning */
namecpy = (char *)H5MM_malloc(sizeof(char) * (namelen + 1));
- if (namecpy == NULL) {
- HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "cannot make space for name copy.\n");
- }
- HDmemcpy(namecpy, name, (namelen + 1));
+ if (namecpy == NULL)
+ HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "cannot make space for name copy.");
+ H5MM_memcpy(namecpy, name, (namelen + 1));
valuecpy = (char *)H5MM_malloc(sizeof(char) * (valuelen + 1));
- if (valuecpy == NULL) {
- HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "cannot make space for value copy.\n");
- }
- HDmemcpy(valuecpy, value, (valuelen + 1));
+ if (valuecpy == NULL)
+ HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "cannot make space for value copy.");
+ H5MM_memcpy(valuecpy, value, (valuelen + 1));
nvcat = (char *)H5MM_malloc(sizeof(char) * catwrite);
- if (nvcat == NULL) {
- HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "cannot make space for concatenated string.\n");
- }
+ if (nvcat == NULL)
+ HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "cannot make space for concatenated string.");
ret = HDsnprintf(nvcat, catwrite, "%s: %s", name, value);
- if (ret < 0 || (size_t)ret > catlen) {
+ if (ret < 0 || (size_t)ret > catlen)
HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "cannot concatenate `%s: %s", name, value);
- }
HDassert(catlen == HDstrlen(nvcat));
/* create new_node, should we need it
*/
new_node = (hrb_node_t *)H5MM_malloc(sizeof(hrb_node_t));
- if (new_node == NULL) {
- HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "cannot make space for new set.\n");
- }
+ if (new_node == NULL)
+ HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "cannot make space for new set.");
new_node->magic = S3COMMS_HRB_NODE_MAGIC;
new_node->name = NULL;
@@ -308,13 +297,12 @@ H5FD_s3comms_hrb_node_set(hrb_node_t **L, const char *name, const char *value)
***************/
if (*L == NULL) {
- if (value == NULL) {
- HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "trying to remove node from empty list");
- }
+ if (value == NULL)
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "trying to remove node from empty list")
else {
#if S3COMMS_DEBUG
HDprintf("CREATE NEW\n");
- fflush(stdout);
+ HDfflush(stdout);
#endif
/*******************
* CREATE NEW LIST *
@@ -338,14 +326,14 @@ H5FD_s3comms_hrb_node_set(hrb_node_t **L, const char *name, const char *value)
/* Check whether to modify/remove first node in list
*/
- if (strcmp(lowername, node_ptr->lowername) == 0) {
+ if (HDstrcmp(lowername, node_ptr->lowername) == 0) {
is_looking = FALSE;
if (value == NULL) {
#if S3COMMS_DEBUG
HDprintf("REMOVE HEAD\n");
- fflush(stdout);
+ HDfflush(stdout);
#endif
/***************
* REMOVE HEAD *
@@ -355,39 +343,39 @@ H5FD_s3comms_hrb_node_set(hrb_node_t **L, const char *name, const char *value)
#if S3COMMS_DEBUG
HDprintf("FREEING CAT (node)\n");
- fflush(stdout);
+ HDfflush(stdout);
#endif
H5MM_xfree(node_ptr->cat);
#if S3COMMS_DEBUG
HDprintf("FREEING LOWERNAME (node)\n");
- fflush(stdout);
+ HDfflush(stdout);
#endif
H5MM_xfree(node_ptr->lowername);
#if S3COMMS_DEBUG
HDprintf("FREEING NAME (node)\n");
- fflush(stdout);
+ HDfflush(stdout);
#endif
H5MM_xfree(node_ptr->name);
#if S3COMMS_DEBUG
HDprintf("FREEING VALUE (node)\n");
- fflush(stdout);
+ HDfflush(stdout);
#endif
H5MM_xfree(node_ptr->value);
#if S3COMMS_DEBUG
HDprintf("MAGIC OK? %s\n", (node_ptr->magic == S3COMMS_HRB_NODE_MAGIC) ? "YES" : "NO");
- fflush(stdout);
+ HDfflush(stdout);
#endif
HDassert(node_ptr->magic == S3COMMS_HRB_NODE_MAGIC);
node_ptr->magic += 1ul;
#if S3COMMS_DEBUG
HDprintf("FREEING POINTER\n");
- fflush(stdout);
+ HDfflush(stdout);
#endif
H5MM_xfree(node_ptr);
#if S3COMMS_DEBUG
HDprintf("FREEING WORKING LOWERNAME\n");
- fflush(stdout);
+ HDfflush(stdout);
#endif
H5MM_xfree(lowername);
lowername = NULL;
@@ -395,7 +383,7 @@ H5FD_s3comms_hrb_node_set(hrb_node_t **L, const char *name, const char *value)
else {
#if S3COMMS_DEBUG
HDprintf("MODIFY HEAD\n");
- fflush(stdout);
+ HDfflush(stdout);
#endif
/***************
* MODIFY HEAD *
@@ -416,17 +404,16 @@ H5FD_s3comms_hrb_node_set(hrb_node_t **L, const char *name, const char *value)
new_node = NULL;
}
}
- else if (strcmp(lowername, node_ptr->lowername) < 0) {
+ else if (HDstrcmp(lowername, node_ptr->lowername) < 0) {
is_looking = FALSE;
- if (value == NULL) {
- HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "trying to remove a node 'before' head");
- }
+ if (value == NULL)
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "trying to remove a node 'before' head")
else {
#if S3COMMS_DEBUG
HDprintf("PREPEND NEW HEAD\n");
- fflush(stdout);
+ HDfflush(stdout);
#endif
/*******************
* INSERT NEW HEAD *
@@ -450,19 +437,18 @@ H5FD_s3comms_hrb_node_set(hrb_node_t **L, const char *name, const char *value)
is_looking = FALSE;
- if (value == NULL) {
- HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "trying to remove absent node");
- }
+ if (value == NULL)
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "trying to remove absent node")
else {
#if S3COMMS_DEBUG
HDprintf("APPEND A NODE\n");
- fflush(stdout);
+ HDfflush(stdout);
#endif
/*******************
* APPEND NEW NODE *
*******************/
- HDassert(strcmp(lowername, node_ptr->lowername) > 0);
+ HDassert(HDstrcmp(lowername, node_ptr->lowername) > 0);
new_node->name = namecpy;
new_node->value = valuecpy;
new_node->lowername = lowername;
@@ -470,23 +456,22 @@ H5FD_s3comms_hrb_node_set(hrb_node_t **L, const char *name, const char *value)
node_ptr->next = new_node;
}
}
- else if (strcmp(lowername, node_ptr->next->lowername) < 0) {
+ else if (HDstrcmp(lowername, node_ptr->next->lowername) < 0) {
is_looking = FALSE;
- if (value == NULL) {
- HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "trying to remove absent node");
- }
+ if (value == NULL)
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "trying to remove absent node")
else {
#if S3COMMS_DEBUG
HDprintf("INSERT A NODE\n");
- fflush(stdout);
+ HDfflush(stdout);
#endif
/*******************
* INSERT NEW NODE *
*******************/
- HDassert(strcmp(lowername, node_ptr->lowername) > 0);
+ HDassert(HDstrcmp(lowername, node_ptr->lowername) > 0);
new_node->name = namecpy;
new_node->value = valuecpy;
new_node->lowername = lowername;
@@ -495,7 +480,7 @@ H5FD_s3comms_hrb_node_set(hrb_node_t **L, const char *name, const char *value)
node_ptr->next = new_node;
}
}
- else if (strcmp(lowername, node_ptr->next->lowername) == 0) {
+ else if (HDstrcmp(lowername, node_ptr->next->lowername) == 0) {
is_looking = FALSE;
@@ -509,7 +494,7 @@ H5FD_s3comms_hrb_node_set(hrb_node_t **L, const char *name, const char *value)
#if S3COMMS_DEBUG
HDprintf("REMOVE A NODE\n");
- fflush(stdout);
+ HDfflush(stdout);
#endif
H5MM_xfree(tmp->cat);
H5MM_xfree(tmp->lowername);
@@ -526,7 +511,7 @@ H5FD_s3comms_hrb_node_set(hrb_node_t **L, const char *name, const char *value)
else {
#if S3COMMS_DEBUG
HDprintf("MODIFY A NODE\n");
- fflush(stdout);
+ HDfflush(stdout);
#endif
/*****************
* MODIFY A NODE *
@@ -560,20 +545,15 @@ H5FD_s3comms_hrb_node_set(hrb_node_t **L, const char *name, const char *value)
done:
if (ret_value == FAIL) {
- /* clean up
- */
- if (nvcat != NULL) {
+ /* clean up */
+ if (nvcat != NULL)
H5MM_xfree(nvcat);
- }
- if (namecpy != NULL) {
+ if (namecpy != NULL)
H5MM_xfree(namecpy);
- }
- if (lowername != NULL) {
+ if (lowername != NULL)
H5MM_xfree(lowername);
- }
- if (valuecpy != NULL) {
+ if (valuecpy != NULL)
H5MM_xfree(valuecpy);
- }
if (new_node != NULL) {
HDassert(new_node->magic == S3COMMS_HRB_NODE_MAGIC);
new_node->magic += 1ul;
@@ -634,9 +614,8 @@ H5FD_s3comms_hrb_destroy(hrb_t **_buf)
if (_buf != NULL && *_buf != NULL) {
buf = *_buf;
- if (buf->magic != S3COMMS_HRB_MAGIC) {
- HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "pointer's magic does not match.\n");
- }
+ if (buf->magic != S3COMMS_HRB_MAGIC)
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "pointer's magic does not match.");
H5MM_xfree(buf->verb);
H5MM_xfree(buf->version);
@@ -697,68 +676,55 @@ H5FD_s3comms_hrb_init_request(const char *_verb, const char *_resource, const ch
HDfprintf(stdout, "called H5FD_s3comms_hrb_init_request.\n");
#endif
- if (_resource == NULL) {
- HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, NULL, "resource string cannot be null.\n");
- }
+ if (_resource == NULL)
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, NULL, "resource string cannot be null.");
- /* populate valid NULLs with defaults
- */
- if (_verb == NULL) {
+ /* populate valid NULLs with defaults */
+ if (_verb == NULL)
_verb = "GET";
- }
-
- if (_http_version == NULL) {
+ if (_http_version == NULL)
_http_version = "HTTP/1.1";
- }
- /* malloc space for and prepare structure
- */
+ /* malloc space for and prepare structure */
request = (hrb_t *)H5MM_malloc(sizeof(hrb_t));
- if (request == NULL) {
+ if (request == NULL)
HGOTO_ERROR(H5E_ARGS, H5E_CANTALLOC, NULL, "no space for request structure");
- }
request->magic = S3COMMS_HRB_MAGIC;
request->body = NULL;
request->body_len = 0;
request->first_header = NULL;
- /* malloc and copy strings for the structure
- */
+ /* malloc and copy strings for the structure */
reslen = HDstrlen(_resource);
if (_resource[0] == '/') {
res = (char *)H5MM_malloc(sizeof(char) * (reslen + 1));
- if (res == NULL) {
+ if (res == NULL)
HGOTO_ERROR(H5E_ARGS, H5E_CANTALLOC, NULL, "no space for resource string");
- }
- HDmemcpy(res, _resource, (reslen + 1));
+ H5MM_memcpy(res, _resource, (reslen + 1));
}
else {
res = (char *)H5MM_malloc(sizeof(char) * (reslen + 2));
- if (res == NULL) {
+ if (res == NULL)
HGOTO_ERROR(H5E_ARGS, H5E_CANTALLOC, NULL, "no space for resource string");
- }
*res = '/';
- HDmemcpy((&res[1]), _resource, (reslen + 1));
+ H5MM_memcpy((&res[1]), _resource, (reslen + 1));
HDassert((reslen + 1) == HDstrlen(res));
} /* end if (else resource string not starting with '/') */
verblen = HDstrlen(_verb) + 1;
verb = (char *)H5MM_malloc(sizeof(char) * verblen);
- if (verb == NULL) {
+ if (verb == NULL)
HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, NULL, "no space for verb string");
- }
HDstrncpy(verb, _verb, verblen);
vrsnlen = HDstrlen(_http_version) + 1;
vrsn = (char *)H5MM_malloc(sizeof(char) * vrsnlen);
- if (vrsn == NULL) {
+ if (vrsn == NULL)
HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, NULL, "no space for http-version string");
- }
HDstrncpy(vrsn, _http_version, vrsnlen);
- /* place new copies into structure
- */
+ /* place new copies into structure */
request->resource = res;
request->verb = verb;
request->version = vrsn;
@@ -766,8 +732,7 @@ H5FD_s3comms_hrb_init_request(const char *_verb, const char *_resource, const ch
ret_value = request;
done:
- /* if there is an error, clean up after ourselves
- */
+ /* if there is an error, clean up after ourselves */
if (ret_value == NULL) {
if (request != NULL)
H5MM_xfree(request);
@@ -818,12 +783,10 @@ H5FD_s3comms_s3r_close(s3r_t *handle)
HDfprintf(stdout, "called H5FD_s3comms_s3r_close.\n");
#endif
- if (handle == NULL) {
- HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "handle cannot be null.\n");
- }
- if (handle->magic != S3COMMS_S3R_MAGIC) {
- HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "handle has invalid magic.\n");
- }
+ if (handle == NULL)
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "handle cannot be null.");
+ if (handle->magic != S3COMMS_S3R_MAGIC)
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "handle has invalid magic.");
curl_easy_cleanup(handle->curlhandle);
@@ -834,9 +797,8 @@ H5FD_s3comms_s3r_close(s3r_t *handle)
HDassert(handle->httpverb != NULL);
H5MM_xfree(handle->httpverb);
- if (FAIL == H5FD_s3comms_free_purl(handle->purl)) {
+ if (FAIL == H5FD_s3comms_free_purl(handle->purl))
HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "unable to release parsed url structure")
- }
H5MM_xfree(handle);
@@ -871,9 +833,8 @@ H5FD_s3comms_s3r_get_filesize(s3r_t *handle)
FUNC_ENTER_NOAPI_NOINIT_NOERR
- if (handle != NULL) {
+ if (handle != NULL)
ret_value = handle->filesize;
- }
FUNC_LEAVE_NOAPI(ret_value)
} /* H5FD_s3comms_s3r_get_filesize */
@@ -927,45 +888,33 @@ H5FD_s3comms_s3r_getsize(s3r_t *handle)
HDfprintf(stdout, "called H5FD_s3comms_s3r_getsize.\n");
#endif
- if (handle == NULL) {
- HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "handle cannot be null.\n");
- }
- if (handle->magic != S3COMMS_S3R_MAGIC) {
- HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "handle has invalid magic.\n");
- }
- if (handle->curlhandle == NULL) {
- HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "handle has bad (null) curlhandle.\n")
- }
+ if (handle == NULL)
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "handle cannot be null.");
+ if (handle->magic != S3COMMS_S3R_MAGIC)
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "handle has invalid magic.");
+ if (handle->curlhandle == NULL)
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "handle has bad (null) curlhandle.")
/********************
* PREPARE FOR HEAD *
********************/
curlh = handle->curlhandle;
+ if (CURLE_OK != curl_easy_setopt(curlh, CURLOPT_NOBODY, 1L))
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "error while setting CURL option (CURLOPT_NOBODY).");
- if (CURLE_OK != curl_easy_setopt(curlh, CURLOPT_NOBODY, 1L)) {
- HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL,
- "error while setting CURL option (CURLOPT_NOBODY). "
- "(placeholder flags)");
- }
-
- if (CURLE_OK != curl_easy_setopt(curlh, CURLOPT_HEADERDATA, &sds)) {
- HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL,
- "error while setting CURL option (CURLOPT_HEADERDATA). "
- "(placeholder flags)");
- }
+ if (CURLE_OK != curl_easy_setopt(curlh, CURLOPT_HEADERDATA, &sds))
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "error while setting CURL option (CURLOPT_HEADERDATA).");
HDassert(handle->httpverb == NULL);
handle->httpverb = (char *)H5MM_malloc(sizeof(char) * 16);
- if (handle->httpverb == NULL) {
+ if (handle->httpverb == NULL)
HGOTO_ERROR(H5E_ARGS, H5E_CANTALLOC, FAIL, "unable to allocate space for S3 request HTTP verb");
- }
- HDmemcpy(handle->httpverb, "HEAD", 5);
+ H5MM_memcpy(handle->httpverb, "HEAD", 5);
headerresponse = (char *)H5MM_malloc(sizeof(char) * CURL_MAX_HTTP_HEADER);
- if (headerresponse == NULL) {
+ if (headerresponse == NULL)
HGOTO_ERROR(H5E_ARGS, H5E_CANTALLOC, FAIL, "unable to allocate space for curl header response");
- }
sds.data = headerresponse;
/*******************
@@ -976,55 +925,44 @@ H5FD_s3comms_s3r_getsize(s3r_t *handle)
* but, with a NULL destination and NOBODY and HEADERDATA supplied above,
* only http metadata will be sent by server and recorded by s3comms
*/
- if (FAIL == H5FD_s3comms_s3r_read(handle, 0, 0, NULL)) {
- HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "problem in reading during getsize.\n");
- }
+ if (FAIL == H5FD_s3comms_s3r_read(handle, 0, 0, NULL))
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "problem in reading during getsize.");
- if (sds.size > CURL_MAX_HTTP_HEADER) {
- HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "HTTP metadata buffer overrun\n");
- }
- else if (sds.size == 0) {
- HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "No HTTP metadata\n");
+ if (sds.size > CURL_MAX_HTTP_HEADER)
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "HTTP metadata buffer overrun")
+ else if (sds.size == 0)
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "No HTTP metadata")
#if S3COMMS_DEBUG
- }
- else {
+ else
HDfprintf(stderr, "GETSIZE: OK\n");
#endif
- }
/******************
* PARSE RESPONSE *
******************/
- start = strstr(headerresponse, "\r\nContent-Length: ");
- if (start == NULL) {
- HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "could not find \"Content-Length\" in response.\n");
- }
+ start = HDstrstr(headerresponse, "\r\nContent-Length: ");
+ if (start == NULL)
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "could not find \"Content-Length\" in response.");
- /* move "start" to beginning of value in line; find end of line
- */
+ /* move "start" to beginning of value in line; find end of line */
start = start + HDstrlen("\r\nContent-Length: ");
- end = strstr(start, "\r\n");
- if (end == NULL) {
+ end = HDstrstr(start, "\r\n");
+ if (end == NULL)
HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "could not find end of content length line");
- }
/* place null terminator at end of numbers
*/
*end = '\0';
- content_length = strtoumax((const char *)start, NULL, 0);
+ content_length = HDstrtoumax((const char *)start, NULL, 0);
+ if (UINTMAX_MAX > SIZE_MAX && content_length > SIZE_MAX)
+ HGOTO_ERROR(H5E_ARGS, H5E_OVERFLOW, FAIL, "content_length overflows size_t");
- if (UINTMAX_MAX > SIZE_MAX && content_length > SIZE_MAX) {
- HGOTO_ERROR(H5E_ARGS, H5E_OVERFLOW, FAIL, "content_length overflows size_t\n");
- }
-
- if (content_length == 0 || errno == ERANGE) /* errno set by strtoumax*/
- {
+ if (content_length == 0 || errno == ERANGE) /* errno set by HDstrtoumax*/
HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL,
"could not convert found \"Content-Length\" response (\"%s\")",
start); /* range is null-terminated, remember */
- }
handle->filesize = (size_t)content_length;
@@ -1032,24 +970,17 @@ H5FD_s3comms_s3r_getsize(s3r_t *handle)
* UNDO HEAD SETTINGS *
**********************/
- if (CURLE_OK != curl_easy_setopt(curlh, CURLOPT_NOBODY, NULL)) {
- HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL,
- "error while setting CURL option (CURLOPT_NOBODY). "
- "(placeholder flags)");
- }
+ if (CURLE_OK != curl_easy_setopt(curlh, CURLOPT_NOBODY, NULL))
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "error while setting CURL option (CURLOPT_NOBODY).");
- if (CURLE_OK != curl_easy_setopt(curlh, CURLOPT_HEADERDATA, NULL)) {
- HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL,
- "error while setting CURL option (CURLOPT_HEADERDATA). "
- "(placeholder flags)");
- }
+ if (CURLE_OK != curl_easy_setopt(curlh, CURLOPT_HEADERDATA, NULL))
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "error while setting CURL option (CURLOPT_HEADERDATA).");
done:
H5MM_xfree(headerresponse);
sds.magic += 1; /* set to bad magic */
FUNC_LEAVE_NOAPI(ret_value);
-
} /* H5FD_s3comms_s3r_getsize */
/*----------------------------------------------------------------------------
@@ -1106,21 +1037,19 @@ H5FD_s3comms_s3r_open(const char *url, const char *region, const char *id, const
HDfprintf(stdout, "called H5FD_s3comms_s3r_open.\n");
#endif
- if (url == NULL || url[0] == '\0') {
- HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, NULL, "url cannot be null.\n");
- }
+ if (url == NULL || url[0] == '\0')
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, NULL, "url cannot be null.");
- if (FAIL == H5FD_s3comms_parse_url(url, &purl)) {
+ if (FAIL == H5FD_s3comms_parse_url(url, &purl))
/* probably a malformed url, but could be internal error */
HGOTO_ERROR(H5E_ARGS, H5E_CANTCREATE, NULL, "unable to create parsed url structure");
- }
+
HDassert(purl != NULL); /* if above passes, this must be true */
HDassert(purl->magic == S3COMMS_PARSED_URL_MAGIC);
handle = (s3r_t *)H5MM_malloc(sizeof(s3r_t));
- if (handle == NULL) {
- HGOTO_ERROR(H5E_ARGS, H5E_CANTALLOC, NULL, "could not malloc space for handle.\n");
- }
+ if (handle == NULL)
+ HGOTO_ERROR(H5E_ARGS, H5E_CANTALLOC, NULL, "could not malloc space for handle.");
handle->magic = S3COMMS_S3R_MAGIC;
handle->purl = purl;
@@ -1135,40 +1064,33 @@ H5FD_s3comms_s3r_open(const char *url, const char *region, const char *id, const
*************************************/
if ((region != NULL && *region != '\0') || (id != NULL && *id != '\0') || (signing_key != NULL)) {
- /* if one exists, all three must exist
- */
- if (region == NULL || region[0] == '\0') {
- HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, NULL, "region cannot be null.\n");
- }
- if (id == NULL || id[0] == '\0') {
- HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, NULL, "secret id cannot be null.\n");
- }
- if (signing_key == NULL) {
- HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, NULL, "signing key cannot be null.\n");
- }
- /* copy strings
- */
+ /* if one exists, all three must exist */
+ if (region == NULL || region[0] == '\0')
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, NULL, "region cannot be null.");
+ if (id == NULL || id[0] == '\0')
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, NULL, "secret id cannot be null.");
+ if (signing_key == NULL)
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, NULL, "signing key cannot be null.");
+
+ /* copy strings */
tmplen = HDstrlen(region) + 1;
handle->region = (char *)H5MM_malloc(sizeof(char) * tmplen);
- if (handle->region == NULL) {
- HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, NULL, "could not malloc space for handle region copy.\n");
- }
- HDmemcpy(handle->region, region, tmplen);
+ if (handle->region == NULL)
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, NULL, "could not malloc space for handle region copy.");
+ H5MM_memcpy(handle->region, region, tmplen);
tmplen = HDstrlen(id) + 1;
handle->secret_id = (char *)H5MM_malloc(sizeof(char) * tmplen);
- if (handle->secret_id == NULL) {
- HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, NULL, "could not malloc space for handle ID copy.\n");
- }
- HDmemcpy(handle->secret_id, id, tmplen);
+ if (handle->secret_id == NULL)
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, NULL, "could not malloc space for handle ID copy.");
+ H5MM_memcpy(handle->secret_id, id, tmplen);
tmplen = SHA256_DIGEST_LENGTH;
handle->signing_key = (unsigned char *)H5MM_malloc(sizeof(unsigned char) * tmplen);
- if (handle->signing_key == NULL) {
- HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, NULL, "could not malloc space for handle key copy.\n");
- }
- HDmemcpy(handle->signing_key, signing_key, tmplen);
+ if (handle->signing_key == NULL)
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, NULL, "could not malloc space for handle key copy.");
+ H5MM_memcpy(handle->signing_key, signing_key, tmplen);
} /* if authentication information provided */
/************************
@@ -1176,40 +1098,23 @@ H5FD_s3comms_s3r_open(const char *url, const char *region, const char *id, const
************************/
curlh = curl_easy_init();
+ if (curlh == NULL)
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, NULL, "problem creating curl easy handle!");
- if (curlh == NULL) {
- HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, NULL, "problem creating curl easy handle!\n");
- }
-
- if (CURLE_OK != curl_easy_setopt(curlh, CURLOPT_HTTPGET, 1L)) {
- HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, NULL,
- "error while setting CURL option (CURLOPT_HTTPGET). "
- "(placeholder flags)");
- }
+ if (CURLE_OK != curl_easy_setopt(curlh, CURLOPT_HTTPGET, 1L))
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, NULL, "error while setting CURL option (CURLOPT_HTTPGET).");
- if (CURLE_OK != curl_easy_setopt(curlh, CURLOPT_HTTP_VERSION, CURL_HTTP_VERSION_1_1)) {
- HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, NULL,
- "error while setting CURL option (CURLOPT_HTTP_VERSION). "
- "(placeholder flags)");
- }
+ if (CURLE_OK != curl_easy_setopt(curlh, CURLOPT_HTTP_VERSION, CURL_HTTP_VERSION_1_1))
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, NULL, "error while setting CURL option (CURLOPT_HTTP_VERSION).");
- if (CURLE_OK != curl_easy_setopt(curlh, CURLOPT_FAILONERROR, 1L)) {
- HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, NULL,
- "error while setting CURL option (CURLOPT_FAILONERROR). "
- "(placeholder flags)");
- }
+ if (CURLE_OK != curl_easy_setopt(curlh, CURLOPT_FAILONERROR, 1L))
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, NULL, "error while setting CURL option (CURLOPT_FAILONERROR).");
- if (CURLE_OK != curl_easy_setopt(curlh, CURLOPT_WRITEFUNCTION, curlwritecallback)) {
- HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, NULL,
- "error while setting CURL option (CURLOPT_WRITEFUNCTION). "
- "(placeholder flags)");
- }
+ if (CURLE_OK != curl_easy_setopt(curlh, CURLOPT_WRITEFUNCTION, curlwritecallback))
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, NULL, "error while setting CURL option (CURLOPT_WRITEFUNCTION).");
- if (CURLE_OK != curl_easy_setopt(curlh, CURLOPT_URL, url)) {
- HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, NULL,
- "error while setting CURL option (CURLOPT_URL). "
- "(placeholder flags)");
- }
+ if (CURLE_OK != curl_easy_setopt(curlh, CURLOPT_URL, url))
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, NULL, "error while setting CURL option (CURLOPT_URL).");
#if S3COMMS_CURL_VERBOSITY > 1
/* CURL will print (to stdout) information for each operation
@@ -1225,40 +1130,35 @@ H5FD_s3comms_s3r_open(const char *url, const char *region, const char *id, const
* GET FILE SIZE *
*******************/
- if (FAIL == H5FD_s3comms_s3r_getsize(handle)) {
- HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, NULL, "problem in H5FD_s3comms_s3r_getsize.\n");
- }
+ if (FAIL == H5FD_s3comms_s3r_getsize(handle))
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, NULL, "problem in H5FD_s3comms_s3r_getsize.");
/*********************
* FINAL PREPARATION *
*********************/
HDassert(handle->httpverb != NULL);
- HDmemcpy(handle->httpverb, "GET", 4);
+ H5MM_memcpy(handle->httpverb, "GET", 4);
ret_value = handle;
done:
if (ret_value == NULL) {
- if (curlh != NULL) {
+ if (curlh != NULL)
curl_easy_cleanup(curlh);
- }
- if (FAIL == H5FD_s3comms_free_purl(purl)) {
+ if (FAIL == H5FD_s3comms_free_purl(purl))
HDONE_ERROR(H5E_ARGS, H5E_BADVALUE, NULL, "unable to free parsed url structure")
- }
if (handle != NULL) {
H5MM_xfree(handle->region);
H5MM_xfree(handle->secret_id);
H5MM_xfree(handle->signing_key);
- if (handle->httpverb != NULL) {
+ if (handle->httpverb != NULL)
H5MM_xfree(handle->httpverb);
- }
H5MM_xfree(handle);
}
}
FUNC_LEAVE_NOAPI(ret_value)
-
} /* H5FD_s3comms_s3r_open */
/*----------------------------------------------------------------------------
@@ -1328,22 +1228,17 @@ H5FD_s3comms_s3r_read(s3r_t *handle, haddr_t offset, size_t len, void *dest)
* ABSOLUTELY NECESSARY SANITY-CHECKS *
**************************************/
- if (handle == NULL) {
- HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "handle cannot be null.\n");
- }
- if (handle->magic != S3COMMS_S3R_MAGIC) {
- HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "handle has invalid magic.\n");
- }
- if (handle->curlhandle == NULL) {
- HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "handle has bad (null) curlhandle.\n")
- }
- if (handle->purl == NULL) {
- HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "handle has bad (null) url.\n")
- }
+ if (handle == NULL)
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "handle cannot be null.");
+ if (handle->magic != S3COMMS_S3R_MAGIC)
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "handle has invalid magic.");
+ if (handle->curlhandle == NULL)
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "handle has bad (null) curlhandle.")
+ if (handle->purl == NULL)
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "handle has bad (null) url.")
HDassert(handle->purl->magic == S3COMMS_PARSED_URL_MAGIC);
- if (offset > handle->filesize || (len + offset) > handle->filesize) {
+ if (offset > handle->filesize || (len + offset) > handle->filesize)
HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "unable to read past EoF")
- }
curlh = handle->curlhandle;
@@ -1353,18 +1248,15 @@ H5FD_s3comms_s3r_read(s3r_t *handle, haddr_t offset, size_t len, void *dest)
if (dest != NULL) {
sds = (struct s3r_datastruct *)H5MM_malloc(sizeof(struct s3r_datastruct));
- if (sds == NULL) {
- HGOTO_ERROR(H5E_ARGS, H5E_CANTALLOC, FAIL, "could not malloc destination datastructure.\n");
- }
+ if (sds == NULL)
+ HGOTO_ERROR(H5E_ARGS, H5E_CANTALLOC, FAIL, "could not malloc destination datastructure.");
sds->magic = S3COMMS_CALLBACK_DATASTRUCT_MAGIC;
sds->data = (char *)dest;
sds->size = 0;
- if (CURLE_OK != curl_easy_setopt(curlh, CURLOPT_WRITEDATA, sds)) {
+ if (CURLE_OK != curl_easy_setopt(curlh, CURLOPT_WRITEDATA, sds))
HGOTO_ERROR(H5E_ARGS, H5E_UNINITIALIZED, FAIL,
- "error while setting CURL option (CURLOPT_WRITEDATA). "
- "(placeholder flags)");
- }
+ "error while setting CURL option (CURLOPT_WRITEDATA).");
}
/*********************
@@ -1373,21 +1265,18 @@ H5FD_s3comms_s3r_read(s3r_t *handle, haddr_t offset, size_t len, void *dest)
if (len > 0) {
rangebytesstr = (char *)H5MM_malloc(sizeof(char) * (S3COMMS_MAX_RANGE_STRING_SIZE + 1));
- if (rangebytesstr == NULL) {
- HGOTO_ERROR(H5E_ARGS, H5E_CANTALLOC, FAIL, "could not malloc range format string.\n");
- }
- ret = HDsnprintf(rangebytesstr, (S3COMMS_MAX_RANGE_STRING_SIZE),
- "bytes=" H5_PRINTF_HADDR_FMT "-" H5_PRINTF_HADDR_FMT, offset, offset + len - 1);
+ if (rangebytesstr == NULL)
+ HGOTO_ERROR(H5E_ARGS, H5E_CANTALLOC, FAIL, "could not malloc range format string.");
+ ret = HDsnprintf(rangebytesstr, (S3COMMS_MAX_RANGE_STRING_SIZE), "bytes=%" PRIuHADDR "-%" PRIuHADDR,
+ offset, offset + len - 1);
if (ret <= 0 || ret >= S3COMMS_MAX_RANGE_STRING_SIZE)
HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "unable to format HTTP Range value");
}
else if (offset > 0) {
rangebytesstr = (char *)H5MM_malloc(sizeof(char) * (S3COMMS_MAX_RANGE_STRING_SIZE + 1));
- if (rangebytesstr == NULL) {
- HGOTO_ERROR(H5E_ARGS, H5E_CANTALLOC, FAIL, "could not malloc range format string.\n");
- }
- ret = HDsnprintf(rangebytesstr, (S3COMMS_MAX_RANGE_STRING_SIZE), "bytes=" H5_PRINTF_HADDR_FMT "-",
- offset);
+ if (rangebytesstr == NULL)
+ HGOTO_ERROR(H5E_ARGS, H5E_CANTALLOC, FAIL, "could not malloc range format string.");
+ ret = HDsnprintf(rangebytesstr, (S3COMMS_MAX_RANGE_STRING_SIZE), "bytes=%" PRIuHADDR "-", offset);
if (ret <= 0 || ret >= S3COMMS_MAX_RANGE_STRING_SIZE)
HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "unable to format HTTP Range value");
}
@@ -1397,22 +1286,19 @@ H5FD_s3comms_s3r_read(s3r_t *handle, haddr_t offset, size_t len, void *dest)
*******************/
if (handle->signing_key == NULL) {
- /* Do not authenticate.
- */
+ /* Do not authenticate. */
if (rangebytesstr != NULL) {
- /* Pass in range directly
- */
+ /* Pass in range directly */
char *bytesrange_ptr = NULL; /* pointer past "bytes=" portion */
- bytesrange_ptr = strchr(rangebytesstr, '=');
+ bytesrange_ptr = HDstrchr(rangebytesstr, '=');
HDassert(bytesrange_ptr != NULL);
bytesrange_ptr++; /* move to first char past '=' */
HDassert(*bytesrange_ptr != '\0');
- if (CURLE_OK != curl_easy_setopt(curlh, CURLOPT_RANGE, bytesrange_ptr)) {
+ if (CURLE_OK != curl_easy_setopt(curlh, CURLOPT_RANGE, bytesrange_ptr))
HGOTO_ERROR(H5E_VFL, H5E_UNINITIALIZED, FAIL,
"error while setting CURL option (CURLOPT_RANGE). ");
- }
}
}
else {
@@ -1446,98 +1332,71 @@ H5FD_s3comms_s3r_read(s3r_t *handle, haddr_t offset, size_t len, void *dest)
/**** VERIFY INFORMATION EXISTS ****/
- if (handle->region == NULL) {
- HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "handle must have non-null region.\n");
- }
- if (handle->secret_id == NULL) {
- HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "handle must have non-null secret_id.\n");
- }
- if (handle->signing_key == NULL) {
- HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "handle must have non-null signing_key.\n");
- }
- if (handle->httpverb == NULL) {
- HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "handle must have non-null httpverb.\n");
- }
- if (handle->purl->host == NULL) {
- HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "handle must have non-null host.\n");
- }
- if (handle->purl->path == NULL) {
- HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "handle must have non-null resource.\n");
- }
+ if (handle->region == NULL)
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "handle must have non-null region.");
+ if (handle->secret_id == NULL)
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "handle must have non-null secret_id.");
+ if (handle->signing_key == NULL)
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "handle must have non-null signing_key.");
+ if (handle->httpverb == NULL)
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "handle must have non-null httpverb.");
+ if (handle->purl->host == NULL)
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "handle must have non-null host.");
+ if (handle->purl->path == NULL)
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "handle must have non-null resource.");
/**** CREATE HTTP REQUEST STRUCTURE (hrb_t) ****/
request = H5FD_s3comms_hrb_init_request((const char *)handle->httpverb,
(const char *)handle->purl->path, "HTTP/1.1");
- if (request == NULL) {
- HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "could not allocate hrb_t request.\n");
- }
+ if (request == NULL)
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "could not allocate hrb_t request.");
HDassert(request->magic == S3COMMS_HRB_MAGIC);
now = gmnow();
- if (ISO8601NOW(iso8601now, now) != (ISO8601_SIZE - 1)) {
- HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "could not format ISO8601 time.\n");
- }
+ if (ISO8601NOW(iso8601now, now) != (ISO8601_SIZE - 1))
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "could not format ISO8601 time.");
- if (FAIL == H5FD_s3comms_hrb_node_set(&headers, "x-amz-date", (const char *)iso8601now)) {
+ if (FAIL == H5FD_s3comms_hrb_node_set(&headers, "x-amz-date", (const char *)iso8601now))
HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "unable to set x-amz-date header")
- }
- if (headers == NULL) {
- HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL,
- "problem building headers list. "
- "(placeholder flags)\n");
- }
+ if (headers == NULL)
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "problem building headers list.");
HDassert(headers->magic == S3COMMS_HRB_NODE_MAGIC);
- if (FAIL == H5FD_s3comms_hrb_node_set(&headers, "x-amz-content-sha256", (const char *)EMPTY_SHA256)) {
+ if (FAIL == H5FD_s3comms_hrb_node_set(&headers, "x-amz-content-sha256", (const char *)EMPTY_SHA256))
HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "unable to set x-amz-content-sha256 header")
- }
- if (headers == NULL) {
- HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL,
- "problem building headers list. "
- "(placeholder flags)\n");
- }
+ if (headers == NULL)
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "problem building headers list.");
HDassert(headers->magic == S3COMMS_HRB_NODE_MAGIC);
if (rangebytesstr != NULL) {
- if (FAIL == H5FD_s3comms_hrb_node_set(&headers, "Range", (const char *)rangebytesstr)) {
+ if (FAIL == H5FD_s3comms_hrb_node_set(&headers, "Range", rangebytesstr))
HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "unable to set range header")
- }
- if (headers == NULL) {
- HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL,
- "problem building headers list. "
- "(placeholder flags)\n");
- }
+ if (headers == NULL)
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "problem building headers list.");
HDassert(headers->magic == S3COMMS_HRB_NODE_MAGIC);
}
- if (FAIL == H5FD_s3comms_hrb_node_set(&headers, "Host", (const char *)handle->purl->host)) {
+ if (FAIL == H5FD_s3comms_hrb_node_set(&headers, "Host", handle->purl->host))
HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "unable to set host header")
- }
- if (headers == NULL) {
- HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL,
- "problem building headers list. "
- "(placeholder flags)\n");
- }
+ if (headers == NULL)
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "problem building headers list.");
HDassert(headers->magic == S3COMMS_HRB_NODE_MAGIC);
request->first_header = headers;
/**** COMPUTE AUTHORIZATION ****/
- if (FAIL == /* buffer1 -> canonical request */
- H5FD_s3comms_aws_canonical_request(buffer1, 512, signed_headers, 48, request)) {
- HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "(placeholder flags)\n");
- }
- if (FAIL == /* buffer2->string-to-sign */
- H5FD_s3comms_tostringtosign(buffer2, buffer1, iso8601now, handle->region)) {
- HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "(placeholder flags)\n");
- }
- if (FAIL == /* buffer1 -> signature */
- H5FD_s3comms_HMAC_SHA256(handle->signing_key, SHA256_DIGEST_LENGTH, buffer2, HDstrlen(buffer2),
- buffer1)) {
- HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "(placeholder flags)\n");
- }
+ /* buffer1 -> canonical request */
+ if (FAIL == H5FD_s3comms_aws_canonical_request(buffer1, 512, signed_headers, 48, request))
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "bad canonical request");
+ /* buffer2->string-to-sign */
+ if (FAIL == H5FD_s3comms_tostringtosign(buffer2, buffer1, iso8601now, handle->region))
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "bad string-to-sign");
+ /* buffer1 -> signature */
+ if (FAIL == H5FD_s3comms_HMAC_SHA256(handle->signing_key, SHA256_DIGEST_LENGTH, buffer2,
+ HDstrlen(buffer2), buffer1))
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "bad signature");
iso8601now[8] = 0; /* trim to yyyyMMDD */
ret = S3COMMS_FORMAT_CREDENTIAL(buffer2, handle->secret_id, iso8601now, handle->region, "s3");
@@ -1546,23 +1405,16 @@ H5FD_s3comms_s3r_read(s3r_t *handle, haddr_t offset, size_t len, void *dest)
ret = HDsnprintf(authorization, 512, "AWS4-HMAC-SHA256 Credential=%s,SignedHeaders=%s,Signature=%s",
buffer2, signed_headers, buffer1);
- if (ret <= 0 || ret >= 512) {
+ if (ret <= 0 || ret >= 512)
HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "unable to format aws4 authorization string");
- }
- /* append authorization header to http request buffer
- */
- if (H5FD_s3comms_hrb_node_set(&headers, "Authorization", (const char *)authorization) == FAIL) {
+ /* append authorization header to http request buffer */
+ if (H5FD_s3comms_hrb_node_set(&headers, "Authorization", (const char *)authorization) == FAIL)
HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "unable to set Authorization header")
- }
- if (headers == NULL) {
- HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL,
- "problem building headers list. "
- "(placeholder flags)\n");
- }
+ if (headers == NULL)
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "problem building headers list.");
- /* update hrb's "first header" pointer
- */
+ /* update hrb's "first header" pointer */
request->first_header = headers;
/**** SET CURLHANDLE HTTP HEADERS FROM GENERATED DATA ****/
@@ -1571,29 +1423,20 @@ H5FD_s3comms_s3r_read(s3r_t *handle, haddr_t offset, size_t len, void *dest)
while (node != NULL) {
HDassert(node->magic == S3COMMS_HRB_NODE_MAGIC);
curlheaders = curl_slist_append(curlheaders, (const char *)node->cat);
- if (curlheaders == NULL) {
- HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL,
- "could not append header to curl slist. "
- "(placeholder flags)\n");
- }
+ if (curlheaders == NULL)
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "could not append header to curl slist.");
node = node->next;
}
- /* sanity-check
- */
- if (curlheaders == NULL) {
+ /* sanity-check */
+ if (curlheaders == NULL)
/* above loop was probably never run */
- HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "curlheaders was never populated.\n");
- }
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "curlheaders was never populated.");
- /* finally, set http headers in curl handle
- */
- if (curl_easy_setopt(curlh, CURLOPT_HTTPHEADER, curlheaders) != CURLE_OK) {
+ /* finally, set http headers in curl handle */
+ if (curl_easy_setopt(curlh, CURLOPT_HTTPHEADER, curlheaders) != CURLE_OK)
HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL,
- "error while setting CURL option "
- "(CURLOPT_HTTPHEADER). (placeholder flags)");
- }
-
+ "error while setting CURL option (CURLOPT_HTTPHEADER).");
} /* end if should authenticate (info provided) */
/*******************
@@ -1609,50 +1452,43 @@ H5FD_s3comms_s3r_read(s3r_t *handle, haddr_t offset, size_t len, void *dest)
char curlerrbuf[CURL_ERROR_SIZE];
curlerrbuf[0] = '\0';
- if (CURLE_OK != curl_easy_setopt(curlh, CURLOPT_ERRORBUFFER, curlerrbuf)) {
+ if (CURLE_OK != curl_easy_setopt(curlh, CURLOPT_ERRORBUFFER, curlerrbuf))
HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "problem setting error buffer")
- }
p_status = curl_easy_perform(curlh);
if (p_status != CURLE_OK) {
- if (CURLE_OK != curl_easy_getinfo(curlh, CURLINFO_RESPONSE_CODE, &httpcode)) {
+ if (CURLE_OK != curl_easy_getinfo(curlh, CURLINFO_RESPONSE_CODE, &httpcode))
HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "problem getting response code")
- }
HDfprintf(stderr, "CURL ERROR CODE: %d\nHTTP CODE: %d\n", p_status, httpcode);
HDfprintf(stderr, "%s\n", curl_easy_strerror(p_status));
- HGOTO_ERROR(H5E_VFL, H5E_CANTOPENFILE, FAIL, "problem while performing request.\n");
+ HGOTO_ERROR(H5E_VFL, H5E_CANTOPENFILE, FAIL, "problem while performing request.");
}
- if (CURLE_OK != curl_easy_setopt(curlh, CURLOPT_ERRORBUFFER, NULL)) {
+ if (CURLE_OK != curl_easy_setopt(curlh, CURLOPT_ERRORBUFFER, NULL))
HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "problem unsetting error buffer")
- }
} /* verbose error reporting */
#else
p_status = curl_easy_perform(curlh);
- if (p_status != CURLE_OK) {
- HGOTO_ERROR(H5E_VFL, H5E_CANTOPENFILE, FAIL, "curl cannot perform request\n")
- }
+ if (p_status != CURLE_OK)
+ HGOTO_ERROR(H5E_VFL, H5E_CANTOPENFILE, FAIL, "curl cannot perform request")
#endif
#if S3COMMS_DEBUG
if (dest != NULL) {
HDfprintf(stderr, "len: %d\n", (int)len);
HDfprintf(stderr, "CHECKING FOR BUFFER OVERFLOW\n");
- if (sds == NULL) {
+ if (sds == NULL)
HDfprintf(stderr, "sds is NULL!\n");
- }
else {
HDfprintf(stderr, "sds: 0x%lx\n", (long long)sds);
HDfprintf(stderr, "sds->size: %d\n", (int)sds->size);
- if (len > sds->size) {
+ if (len > sds->size)
HDfprintf(stderr, "buffer overwrite\n");
- }
}
}
- else {
+ else
HDfprintf(stderr, "performed on entire file\n");
- }
#endif
done:
@@ -1672,26 +1508,22 @@ done:
}
if (request != NULL) {
while (headers != NULL)
- if (FAIL == H5FD_s3comms_hrb_node_set(&headers, headers->name, NULL)) {
+ if (FAIL == H5FD_s3comms_hrb_node_set(&headers, headers->name, NULL))
HDONE_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "cannot release header node")
- }
HDassert(NULL == headers);
- if (FAIL == H5FD_s3comms_hrb_destroy(&request)) {
+ if (FAIL == H5FD_s3comms_hrb_destroy(&request))
HDONE_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "cannot release header request structure")
- }
HDassert(NULL == request);
}
if (curlh != NULL) {
/* clear any Range */
- if (CURLE_OK != curl_easy_setopt(curlh, CURLOPT_RANGE, NULL)) {
+ if (CURLE_OK != curl_easy_setopt(curlh, CURLOPT_RANGE, NULL))
HDONE_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "cannot unset CURLOPT_RANGE")
- }
/* clear headers */
- if (CURLE_OK != curl_easy_setopt(curlh, CURLOPT_HTTPHEADER, NULL)) {
+ if (CURLE_OK != curl_easy_setopt(curlh, CURLOPT_HTTPHEADER, NULL))
HDONE_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "cannot unset CURLOPT_HTTPHEADER")
- }
}
FUNC_LEAVE_NOAPI(ret_value);
@@ -1727,9 +1559,8 @@ gmnow(void)
struct tm *ret_value = NULL;
/* Doctor assert, checks against error in time() */
- if ((time_t)(-1) != time(now_ptr)) {
- ret_value = gmtime(now_ptr);
- }
+ if ((time_t)(-1) != HDtime(now_ptr))
+ ret_value = HDgmtime(now_ptr);
HDassert(ret_value != NULL);
@@ -1806,77 +1637,65 @@ H5FD_s3comms_aws_canonical_request(char *canonical_request_dest, int _cr_size, c
HDfprintf(stdout, "called H5FD_s3comms_aws_canonical_request.\n");
#endif
- if (http_request == NULL) {
- HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "hrb object cannot be null.\n");
- }
+ if (http_request == NULL)
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "hrb object cannot be null.");
HDassert(http_request->magic == S3COMMS_HRB_MAGIC);
- if (canonical_request_dest == NULL) {
- HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "canonical request destination cannot be null.\n");
- }
+ if (canonical_request_dest == NULL)
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "canonical request destination cannot be null.");
- if (signed_headers_dest == NULL) {
- HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "signed headers destination cannot be null.\n");
- }
+ if (signed_headers_dest == NULL)
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "signed headers destination cannot be null.");
- /* HTTP verb, resource path, and query string lines
- */
+ /* HTTP verb, resource path, and query string lines */
cr_len = (HDstrlen(http_request->verb) + HDstrlen(http_request->resource) + HDstrlen(query_params) +
(size_t)3); /* three newline chars */
- if (cr_len >= cr_size) {
+ if (cr_len >= cr_size)
HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "not enough space in canonical request");
- }
- ret = HDsnprintf(/* TODO: compiler warning */
- canonical_request_dest, (cr_size - 1), "%s\n%s\n%s\n", http_request->verb,
+ /* TODO: compiler warning */
+ ret = HDsnprintf(canonical_request_dest, (cr_size - 1), "%s\n%s\n%s\n", http_request->verb,
http_request->resource, query_params);
- if (ret < 0 || (size_t)ret >= cr_size) {
+ if (ret < 0 || (size_t)ret >= cr_size)
HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "unable to compose canonical request first line");
- }
- /* write in canonical headers, building signed headers concurrently
- */
+ /* write in canonical headers, building signed headers concurrently */
node = http_request->first_header; /* assumed sorted */
while (node != NULL) {
HDassert(node->magic == S3COMMS_HRB_NODE_MAGIC);
ret = HDsnprintf(tmpstr, 256, "%s:%s\n", node->lowername, node->value);
- if (ret < 0 || ret >= 256) {
+ if (ret < 0 || ret >= 256)
HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "unable to concatenate HTTP header %s:%s",
node->lowername, node->value);
- }
cr_len += HDstrlen(tmpstr);
- if (cr_len + 1 > cr_size) {
+ if (cr_len + 1 > cr_size)
HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "not enough space in canonical request");
- }
- strcat(canonical_request_dest, tmpstr);
+ HDstrcat(canonical_request_dest, tmpstr);
ret = HDsnprintf(tmpstr, 256, "%s;", node->lowername);
- if (ret < 0 || ret >= 256) {
+ if (ret < 0 || ret >= 256)
HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "unable to append semicolon to lowername %s",
node->lowername);
- }
sh_len += HDstrlen(tmpstr);
- if (sh_len + 1 > sh_size) {
+ if (sh_len + 1 > sh_size)
HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "not enough space in signed headers");
- }
- strcat(signed_headers_dest, tmpstr);
+ HDstrcat(signed_headers_dest, tmpstr);
node = node->next;
} /* end while node is not NULL */
- /* remove tailing ';' from signed headers sequence
- */
+ /* remove trailing ';' from signed headers sequence */
signed_headers_dest[HDstrlen(signed_headers_dest) - 1] = '\0';
/* append signed headers and payload hash
* NOTE: at present, no HTTP body is handled, per the nature of
* requests/range-gets
*/
- strcat(canonical_request_dest, "\n");
- strcat(canonical_request_dest, signed_headers_dest);
- strcat(canonical_request_dest, "\n");
- strcat(canonical_request_dest, EMPTY_SHA256);
+ HDstrcat(canonical_request_dest, "\n");
+ HDstrcat(canonical_request_dest, signed_headers_dest);
+ HDstrcat(canonical_request_dest, "\n");
+ HDstrcat(canonical_request_dest, EMPTY_SHA256);
done:
FUNC_LEAVE_NOAPI(ret_value);
@@ -1925,24 +1744,20 @@ H5FD_s3comms_bytes_to_hex(char *dest, const unsigned char *msg, size_t msg_len,
HDfprintf(stdout, "called H5FD_s3comms_bytes_to_hex.\n");
#endif
- if (dest == NULL) {
- HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "hex destination cannot be null.\n")
- }
- if (msg == NULL) {
- HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "bytes sequence cannot be null.\n")
- }
+ if (dest == NULL)
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "hex destination cannot be null.")
+ if (msg == NULL)
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "bytes sequence cannot be null.")
for (i = 0; i < msg_len; i++) {
int chars_written = HDsnprintf(&(dest[i * 2]), 3, /* 'X', 'X', '\n' */
(lowercase == TRUE) ? "%02x" : "%02X", msg[i]);
- if (chars_written != 2) {
+ if (chars_written != 2)
HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "problem while writing hex chars for %c", msg[i]);
- }
}
done:
FUNC_LEAVE_NOAPI(ret_value);
-
} /* end H5FD_s3comms_bytes_to_hex() */
/*----------------------------------------------------------------------------
@@ -1975,21 +1790,16 @@ H5FD_s3comms_free_purl(parsed_url_t *purl)
if (purl != NULL) {
HDassert(purl->magic == S3COMMS_PARSED_URL_MAGIC);
- if (purl->scheme != NULL) {
+ if (purl->scheme != NULL)
H5MM_xfree(purl->scheme);
- }
- if (purl->host != NULL) {
+ if (purl->host != NULL)
H5MM_xfree(purl->host);
- }
- if (purl->port != NULL) {
+ if (purl->port != NULL)
H5MM_xfree(purl->port);
- }
- if (purl->path != NULL) {
+ if (purl->path != NULL)
H5MM_xfree(purl->path);
- }
- if (purl->query != NULL) {
+ if (purl->query != NULL)
H5MM_xfree(purl->query);
- }
purl->magic += 1ul;
H5MM_xfree(purl);
}
@@ -2041,15 +1851,13 @@ H5FD_s3comms_HMAC_SHA256(const unsigned char *key, size_t key_len, const char *m
HDfprintf(stdout, "called H5FD_s3comms_HMAC_SHA256.\n");
#endif
- if (dest == NULL) {
+ if (dest == NULL)
HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "destination cannot be null.");
- }
HMAC(EVP_sha256(), key, (int)key_len, (const unsigned char *)msg, msg_len, md, &md_len);
- if (H5FD_s3comms_bytes_to_hex(dest, (const unsigned char *)md, (size_t)md_len, true) == FAIL) {
+ if (H5FD_s3comms_bytes_to_hex(dest, (const unsigned char *)md, (size_t)md_len, true) == FAIL)
HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "could not convert to hex string.");
- }
done:
FUNC_LEAVE_NOAPI(ret_value);
@@ -2127,42 +1935,37 @@ H5FD__s3comms_load_aws_creds_from_file(FILE *file, const char *profile_name, cha
int found_setting = 0;
char * line_buffer = &(buffer[0]);
- FUNC_ENTER_NOAPI_NOINIT
+ FUNC_ENTER_STATIC
#if S3COMMS_DEBUG
HDfprintf(stdout, "called load_aws_creds_from_file.\n");
#endif
/* format target line for start of profile */
- if (32 < HDsnprintf(profile_line, 32, "[%s]", profile_name)) {
+ if (32 < HDsnprintf(profile_line, 32, "[%s]", profile_name))
HGOTO_ERROR(H5E_ARGS, H5E_CANTCOPY, FAIL, "unable to format profile label")
- }
/* look for start of profile */
do {
/* clear buffer */
- for (buffer_i = 0; buffer_i < 128; buffer_i++) {
+ for (buffer_i = 0; buffer_i < 128; buffer_i++)
buffer[buffer_i] = 0;
- }
- line_buffer = fgets(line_buffer, 128, file);
- if (line_buffer == NULL) { /* reached end of file */
+ line_buffer = HDfgets(line_buffer, 128, file);
+ if (line_buffer == NULL) /* reached end of file */
goto done;
- }
- } while (strncmp(line_buffer, profile_line, HDstrlen(profile_line)));
+ } while (HDstrncmp(line_buffer, profile_line, HDstrlen(profile_line)));
/* extract credentials from lines */
do {
/* clear buffer */
- for (buffer_i = 0; buffer_i < 128; buffer_i++) {
+ for (buffer_i = 0; buffer_i < 128; buffer_i++)
buffer[buffer_i] = 0;
- }
/* collect a line from file */
- line_buffer = fgets(line_buffer, 128, file);
- if (line_buffer == NULL) {
+ line_buffer = HDfgets(line_buffer, 128, file);
+ if (line_buffer == NULL)
goto done; /* end of file */
- }
/* loop over names to see if line looks like assignment */
for (setting_i = 0; setting_i < setting_count; setting_i++) {
@@ -2172,40 +1975,33 @@ H5FD__s3comms_load_aws_creds_from_file(FILE *file, const char *profile_name, cha
setting_name = setting_names[setting_i];
setting_name_len = HDstrlen(setting_name);
- if (HDsnprintf(line_prefix, 128, "%s=", setting_name) < 0) {
+ if (HDsnprintf(line_prefix, 128, "%s=", setting_name) < 0)
HGOTO_ERROR(H5E_ARGS, H5E_CANTCOPY, FAIL, "unable to format line prefix")
- }
/* found a matching name? */
if (!HDstrncmp(line_buffer, line_prefix, setting_name_len + 1)) {
found_setting = 1;
/* skip NULL destination buffer */
- if (setting_pointers[setting_i] == NULL) {
+ if (setting_pointers[setting_i] == NULL)
break;
- }
/* advance to end of name in string */
do {
line_buffer++;
} while (*line_buffer != 0 && *line_buffer != '=');
- if (*line_buffer == 0 || *(line_buffer + 1) == 0) {
+ if (*line_buffer == 0 || *(line_buffer + 1) == 0)
HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "incomplete assignment in file")
- }
line_buffer++; /* was pointing at '='; advance */
/* copy line buffer into out pointer */
- if (HDstrncpy(setting_pointers[setting_i], (const char *)line_buffer,
- HDstrlen(line_buffer)) == NULL) {
- HGOTO_ERROR(H5E_ARGS, H5E_CANTCOPY, FAIL, "unable to copy line into pointer")
- }
+ HDstrncpy(setting_pointers[setting_i], (const char *)line_buffer, HDstrlen(line_buffer));
/* "trim" tailing whitespace by replacing with null terminator*/
buffer_i = 0;
- while (!isspace(setting_pointers[setting_i][buffer_i])) {
+ while (!HDisspace(setting_pointers[setting_i][buffer_i]))
buffer_i++;
- }
setting_pointers[setting_i][buffer_i] = '\0';
break; /* have read setting; don't compare with others */
@@ -2266,59 +2062,50 @@ H5FD_s3comms_load_aws_profile(const char *profile_name, char *key_id_out, char *
#endif
#ifdef H5_HAVE_WIN32_API
- ret = HDsnprintf(awspath, 117, "%s/.aws/", getenv("USERPROFILE"));
+ ret = HDsnprintf(awspath, 117, "%s/.aws/", HDgetenv("USERPROFILE"));
#else
- ret = HDsnprintf(awspath, 117, "%s/.aws/", getenv("HOME"));
+ ret = HDsnprintf(awspath, 117, "%s/.aws/", HDgetenv("HOME"));
#endif
- if (ret < 0 || (size_t)ret >= 117) {
+ if (ret < 0 || (size_t)ret >= 117)
HGOTO_ERROR(H5E_ARGS, H5E_CANTCOPY, FAIL, "unable to format home-aws path")
- }
ret = HDsnprintf(filepath, 128, "%s%s", awspath, "credentials");
- if (ret < 0 || (size_t)ret >= 128) {
+ if (ret < 0 || (size_t)ret >= 128)
HGOTO_ERROR(H5E_ARGS, H5E_CANTCOPY, FAIL, "unable to format credentials path")
- }
- credfile = fopen(filepath, "r");
+ credfile = HDfopen(filepath, "r");
if (credfile != NULL) {
if (H5FD__s3comms_load_aws_creds_from_file(credfile, profile_name, key_id_out, secret_access_key_out,
- aws_region_out) == FAIL) {
+ aws_region_out) == FAIL)
HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "unable to load from aws credentials")
- }
- if (fclose(credfile) == EOF) {
+ if (HDfclose(credfile) == EOF)
HGOTO_ERROR(H5E_FILE, H5E_CANTCLOSEFILE, FAIL, "unable to close credentials file")
- }
credfile = NULL;
} /* end if credential file opened */
ret = HDsnprintf(filepath, 128, "%s%s", awspath, "config");
- if (ret < 0 || (size_t)ret >= 128) {
+ if (ret < 0 || (size_t)ret >= 128)
HGOTO_ERROR(H5E_ARGS, H5E_CANTCOPY, FAIL, "unable to format config path")
- }
- credfile = fopen(filepath, "r");
+ credfile = HDfopen(filepath, "r");
if (credfile != NULL) {
if (H5FD__s3comms_load_aws_creds_from_file(
credfile, profile_name, (*key_id_out == 0) ? key_id_out : NULL,
(*secret_access_key_out == 0) ? secret_access_key_out : NULL,
- (*aws_region_out == 0) ? aws_region_out : NULL) == FAIL) {
+ (*aws_region_out == 0) ? aws_region_out : NULL) == FAIL)
HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "unable to load from aws config")
- }
- if (fclose(credfile) == EOF) {
+ if (HDfclose(credfile) == EOF)
HGOTO_ERROR(H5E_FILE, H5E_CANTCLOSEFILE, FAIL, "unable to close config file")
- }
credfile = NULL;
} /* end if credential file opened */
/* fail if not all three settings were loaded */
- if (*key_id_out == 0 || *secret_access_key_out == 0 || *aws_region_out == 0) {
+ if (*key_id_out == 0 || *secret_access_key_out == 0 || *aws_region_out == 0)
ret_value = FAIL;
- }
done:
- if (credfile != NULL) {
- if (fclose(credfile) == EOF) {
+ if (credfile != NULL)
+ if (HDfclose(credfile) == EOF)
HDONE_ERROR(H5E_ARGS, H5E_ARGS, FAIL, "problem error-closing aws configuration file")
- }
- }
+
FUNC_LEAVE_NOAPI(ret_value);
} /* end H5FD_s3comms_load_aws_profile() */
@@ -2359,15 +2146,14 @@ H5FD_s3comms_nlowercase(char *dest, const char *s, size_t len)
HDfprintf(stdout, "called H5FD_s3comms_nlowercase.\n");
#endif
- if (dest == NULL) {
- HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "destination cannot be null.\n");
- }
+ if (dest == NULL)
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "destination cannot be null.");
if (len > 0) {
- HDmemcpy(dest, s, len);
+ H5MM_memcpy(dest, s, len);
do {
len--;
- dest[len] = (char)tolower((int)dest[len]);
+ dest[len] = (char)HDtolower((int)dest[len]);
} while (len > 0);
}
@@ -2423,16 +2209,14 @@ H5FD_s3comms_parse_url(const char *str, parsed_url_t **_purl)
HDprintf("called H5FD_s3comms_parse_url.\n");
#endif
- if (str == NULL || *str == '\0') {
+ if (str == NULL || *str == '\0')
HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "invalid url string");
- }
urllen = (long int)HDstrlen(str);
purl = (parsed_url_t *)H5MM_malloc(sizeof(parsed_url_t));
- if (purl == NULL) {
+ if (purl == NULL)
HGOTO_ERROR(H5E_ARGS, H5E_CANTALLOC, FAIL, "can't allocate space for parsed_url_t");
- }
purl->magic = S3COMMS_PARSED_URL_MAGIC;
purl->scheme = NULL;
purl->host = NULL;
@@ -2445,31 +2229,26 @@ H5FD_s3comms_parse_url(const char *str, parsed_url_t **_purl)
***************/
tmpstr = HDstrchr(curstr, ':');
- if (tmpstr == NULL) {
+ if (tmpstr == NULL)
HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "invalid SCHEME construction: probably not URL");
- }
len = tmpstr - curstr;
HDassert((0 <= len) && (len < urllen));
- /* check for restrictions
- */
+ /* check for restrictions */
for (i = 0; i < len; i++) {
/* scheme = [a-zA-Z+-.]+ (terminated by ":") */
- if (!isalpha(curstr[i]) && '+' != curstr[i] && '-' != curstr[i] && '.' != curstr[i]) {
+ if (!HDisalpha(curstr[i]) && '+' != curstr[i] && '-' != curstr[i] && '.' != curstr[i])
HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "invalid SCHEME construction");
- }
}
- /* copy lowercased scheme to structure
- */
+
+ /* copy lowercased scheme to structure */
purl->scheme = (char *)H5MM_malloc(sizeof(char) * (size_t)(len + 1));
- if (purl->scheme == NULL) {
+ if (purl->scheme == NULL)
HGOTO_ERROR(H5E_ARGS, H5E_CANTALLOC, FAIL, "can't allocate space for SCHEME");
- }
- (void)HDstrncpy(purl->scheme, curstr, (size_t)len);
+ HDstrncpy(purl->scheme, curstr, (size_t)len);
purl->scheme[len] = '\0';
- for (i = 0; i < len; i++) {
- purl->scheme[i] = (char)tolower(purl->scheme[i]);
- }
+ for (i = 0; i < len; i++)
+ purl->scheme[i] = (char)HDtolower(purl->scheme[i]);
/* Skip "://" */
tmpstr += 3;
@@ -2482,36 +2261,31 @@ H5FD_s3comms_parse_url(const char *str, parsed_url_t **_purl)
if (*curstr == '[') {
/* IPv6 */
while (']' != *tmpstr) {
- if (tmpstr == 0) { /* end of string reached! */
+ /* end of string reached! */
+ if (tmpstr == 0)
HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "reached end of URL: incomplete IPv6 HOST");
- }
tmpstr++;
}
tmpstr++;
} /* end if (IPv6) */
else {
while (0 != *tmpstr) {
- if (':' == *tmpstr || '/' == *tmpstr || '?' == *tmpstr) {
+ if (':' == *tmpstr || '/' == *tmpstr || '?' == *tmpstr)
break;
- }
tmpstr++;
}
} /* end else (IPv4) */
len = tmpstr - curstr;
- if (len == 0) {
- HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "HOST substring cannot be empty");
- }
- else if (len > urllen) {
+ if (len == 0)
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "HOST substring cannot be empty")
+ else if (len > urllen)
HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "problem with length of HOST substring");
- }
- /* copy host
- */
+ /* copy host */
purl->host = (char *)H5MM_malloc(sizeof(char) * (size_t)(len + 1));
- if (purl->host == NULL) {
+ if (purl->host == NULL)
HGOTO_ERROR(H5E_ARGS, H5E_CANTALLOC, FAIL, "can't allocate space for HOST");
- }
- (void)HDstrncpy(purl->host, curstr, (size_t)len);
+ HDstrncpy(purl->host, curstr, (size_t)len);
purl->host[len] = 0;
/*************
@@ -2521,29 +2295,22 @@ H5FD_s3comms_parse_url(const char *str, parsed_url_t **_purl)
if (':' == *tmpstr) {
tmpstr += 1; /* advance past ':' */
curstr = tmpstr;
- while ((0 != *tmpstr) && ('/' != *tmpstr) && ('?' != *tmpstr)) {
+ while ((0 != *tmpstr) && ('/' != *tmpstr) && ('?' != *tmpstr))
tmpstr++;
- }
len = tmpstr - curstr;
- if (len == 0) {
- HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "PORT element cannot be empty");
- }
- else if (len > urllen) {
+ if (len == 0)
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "PORT element cannot be empty")
+ else if (len > urllen)
HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "problem with length of PORT substring");
- }
- for (i = 0; i < len; i++) {
- if (!isdigit(curstr[i])) {
+ for (i = 0; i < len; i++)
+ if (!HDisdigit(curstr[i]))
HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "PORT is not a decimal string");
- }
- }
- /* copy port
- */
+ /* copy port */
purl->port = (char *)H5MM_malloc(sizeof(char) * (size_t)(len + 1));
- if (purl->port == NULL) { /* cannot malloc */
+ if (purl->port == NULL)
HGOTO_ERROR(H5E_ARGS, H5E_CANTALLOC, FAIL, "can't allocate space for PORT");
- }
- (void)HDstrncpy(purl->port, curstr, (size_t)len);
+ HDstrncpy(purl->port, curstr, (size_t)len);
purl->port[len] = 0;
} /* end if PORT element */
@@ -2556,21 +2323,17 @@ H5FD_s3comms_parse_url(const char *str, parsed_url_t **_purl)
tmpstr += 1;
curstr = tmpstr;
- /* seek end of PATH
- */
- while ((0 != *tmpstr) && ('?' != *tmpstr)) {
+ /* seek end of PATH */
+ while ((0 != *tmpstr) && ('?' != *tmpstr))
tmpstr++;
- }
len = tmpstr - curstr;
- if (len > urllen) {
+ if (len > urllen)
HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "problem with length of PATH substring");
- }
if (len > 0) {
purl->path = (char *)H5MM_malloc(sizeof(char) * (size_t)(len + 1));
- if (purl->path == NULL) {
+ if (purl->path == NULL)
HGOTO_ERROR(H5E_ARGS, H5E_CANTALLOC, FAIL, "can't allocate space for PATH");
- } /* cannot malloc path pointer */
- (void)HDstrncpy(purl->path, curstr, (size_t)len);
+ HDstrncpy(purl->path, curstr, (size_t)len);
purl->path[len] = 0;
}
} /* end if PATH element */
@@ -2582,21 +2345,17 @@ H5FD_s3comms_parse_url(const char *str, parsed_url_t **_purl)
if ('?' == *tmpstr) {
tmpstr += 1;
curstr = tmpstr;
- while (0 != *tmpstr) {
+ while (0 != *tmpstr)
tmpstr++;
- }
len = tmpstr - curstr;
- if (len == 0) {
- HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "QUERY cannot be empty");
- }
- else if (len > urllen) {
+ if (len == 0)
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "QUERY cannot be empty")
+ else if (len > urllen)
HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "problem with length of QUERY substring");
- }
purl->query = (char *)H5MM_malloc(sizeof(char) * (size_t)(len + 1));
- if (purl->query == NULL) {
+ if (purl->query == NULL)
HGOTO_ERROR(H5E_ARGS, H5E_CANTALLOC, FAIL, "can't allocate space for QUERY");
- } /* cannot malloc path pointer */
- (void)HDstrncpy(purl->query, curstr, (size_t)len);
+ HDstrncpy(purl->query, curstr, (size_t)len);
purl->query[len] = 0;
} /* end if QUERY exists */
@@ -2604,9 +2363,9 @@ H5FD_s3comms_parse_url(const char *str, parsed_url_t **_purl)
ret_value = SUCCEED;
done:
- if (ret_value == FAIL) {
+ if (ret_value == FAIL)
H5FD_s3comms_free_purl(purl);
- }
+
FUNC_LEAVE_NOAPI(ret_value);
} /* end H5FD_s3comms_parse_url() */
@@ -2666,9 +2425,8 @@ H5FD_s3comms_percent_encode_char(char *repr, const unsigned char c, size_t *repr
HDfprintf(stdout, "called H5FD_s3comms_percent_encode_char.\n");
#endif
- if (repr == NULL) {
- HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "no destination `repr`.\n")
- }
+ if (repr == NULL)
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "no destination `repr`.")
#if S3COMMS_DEBUG
H5FD_s3comms_bytes_to_hex((char *)hex, s, 1, FALSE);
@@ -2685,9 +2443,8 @@ H5FD_s3comms_percent_encode_char(char *repr, const unsigned char c, size_t *repr
#endif
*repr_len = 3;
chars_written = HDsnprintf(repr, 4, "%%%02X", c);
- if (chars_written < 0) {
+ if (chars_written < 0)
HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "cannot write char %c", c);
- }
} /* end if single-byte unicode char */
else {
/* multi-byte, multi-percent representation
@@ -2737,9 +2494,8 @@ H5FD_s3comms_percent_encode_char(char *repr, const unsigned char c, size_t *repr
acc += (stack_size > 3) ? 0x10 : 0; /* 0x00010000 */
stack_size--;
chars_written = HDsnprintf(repr, 4, "%%%02X", (unsigned char)(acc + stack[stack_size]));
- if (chars_written < 0) {
+ if (chars_written < 0)
HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "cannot write char %c", c);
- }
*repr_len += 3;
/************************
@@ -2750,9 +2506,8 @@ H5FD_s3comms_percent_encode_char(char *repr, const unsigned char c, size_t *repr
for (i = 0; i < stack_size; i++) {
chars_written =
HDsnprintf(&repr[i * 3 + 3], 4, "%%%02X", (unsigned char)(0x80 + stack[stack_size - 1 - i]));
- if (chars_written < 0) {
+ if (chars_written < 0)
HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "cannot write char %c", c);
- }
*repr_len += 3;
} /* end for each continuation byte */
} /* end else (multi-byte) */
@@ -2818,31 +2573,24 @@ H5FD_s3comms_signing_key(unsigned char *md, const char *secret, const char *regi
HDfprintf(stdout, "called H5FD_s3comms_signing_key.\n");
#endif
- if (md == NULL) {
- HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "Destination `md` cannot be NULL.\n")
- }
- if (secret == NULL) {
- HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "`secret` cannot be NULL.\n")
- }
- if (region == NULL) {
- HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "`region` cannot be NULL.\n")
- }
- if (iso8601now == NULL) {
- HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "`iso8601now` cannot be NULL.\n")
- }
+ if (md == NULL)
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "Destination `md` cannot be NULL.")
+ if (secret == NULL)
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "`secret` cannot be NULL.")
+ if (region == NULL)
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "`region` cannot be NULL.")
+ if (iso8601now == NULL)
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "`iso8601now` cannot be NULL.")
AWS4_secret_len = 4 + HDstrlen(secret) + 1;
AWS4_secret = (char *)H5MM_malloc(sizeof(char *) * AWS4_secret_len);
- if (AWS4_secret == NULL) {
- HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "Could not allocate space.\n")
- }
+ if (AWS4_secret == NULL)
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "Could not allocate space.")
- /* prepend "AWS4" to start of the secret key
- */
+ /* prepend "AWS4" to start of the secret key */
ret = HDsnprintf(AWS4_secret, AWS4_secret_len, "%s%s", "AWS4", secret);
- if ((size_t)ret != (AWS4_secret_len - 1)) {
+ if ((size_t)ret != (AWS4_secret_len - 1))
HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "problem writing AWS4+secret `%s`", secret);
- }
/* hash_func, key, len(key), msg, len(msg), digest_dest, digest_len_dest
* we know digest length, so ignore via NULL
@@ -2917,22 +2665,17 @@ H5FD_s3comms_tostringtosign(char *dest, const char *req, const char *now, const
HDfprintf(stdout, "called H5FD_s3comms_tostringtosign.\n");
#endif
- if (dest == NULL) {
- HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "destination buffer cannot be null.\n")
- }
- if (req == NULL) {
- HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "canonical request cannot be null.\n")
- }
- if (now == NULL) {
- HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "Timestring cannot be NULL.\n")
- }
- if (region == NULL) {
- HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "Region cannot be NULL.\n")
- }
+ if (dest == NULL)
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "destination buffer cannot be null.")
+ if (req == NULL)
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "canonical request cannot be null.")
+ if (now == NULL)
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "Timestring cannot be NULL.")
+ if (region == NULL)
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "Region cannot be NULL.")
- for (i = 0; i < 128; i++) {
+ for (i = 0; i < 128; i++)
tmp[i] = '\0';
- }
for (i = 0; i < SHA256_DIGEST_LENGTH * 2 + 1; i++) {
checksum[i] = '\0';
hexsum[i] = '\0';
@@ -2940,31 +2683,28 @@ H5FD_s3comms_tostringtosign(char *dest, const char *req, const char *now, const
HDstrncpy(day, now, 8);
day[8] = '\0';
ret = HDsnprintf(tmp, 127, "%s/%s/s3/aws4_request", day, region);
- if (ret <= 0 || ret >= 127) {
+ if (ret <= 0 || ret >= 127)
HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "problem adding day and region to string")
- }
- HDmemcpy((dest + d), "AWS4-HMAC-SHA256\n", 17);
+ H5MM_memcpy((dest + d), "AWS4-HMAC-SHA256\n", 17);
d = 17;
- HDmemcpy((dest + d), now, HDstrlen(now));
+ H5MM_memcpy((dest + d), now, HDstrlen(now));
d += HDstrlen(now);
dest[d++] = '\n';
- HDmemcpy((dest + d), tmp, HDstrlen(tmp));
+ H5MM_memcpy((dest + d), tmp, HDstrlen(tmp));
d += HDstrlen(tmp);
dest[d++] = '\n';
SHA256((const unsigned char *)req, HDstrlen(req), checksum);
if (H5FD_s3comms_bytes_to_hex(hexsum, (const unsigned char *)checksum, SHA256_DIGEST_LENGTH, true) ==
- FAIL) {
+ FAIL)
HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "could not create hex string");
- }
- for (i = 0; i < SHA256_DIGEST_LENGTH * 2; i++) {
+ for (i = 0; i < SHA256_DIGEST_LENGTH * 2; i++)
dest[d++] = hexsum[i];
- }
dest[d] = '\0';
@@ -3012,18 +2752,16 @@ H5FD_s3comms_trim(char *dest, char *s, size_t s_len, size_t *n_written)
HDfprintf(stdout, "called H5FD_s3comms_trim.\n");
#endif
- if (dest == NULL) {
+ if (dest == NULL)
HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "destination cannot be null.")
- }
- if (s == NULL) {
+ if (s == NULL)
s_len = 0;
- }
if (s_len > 0) {
/* Find first non-whitespace character from start;
* reduce total length per character.
*/
- while ((s_len > 0) && isspace((unsigned char)s[0]) && s_len > 0) {
+ while ((s_len > 0) && HDisspace((unsigned char)s[0]) && s_len > 0) {
s++;
s_len--;
}
@@ -3035,12 +2773,11 @@ H5FD_s3comms_trim(char *dest, char *s, size_t s_len, size_t *n_written)
if (s_len > 0) {
do {
s_len--;
- } while (isspace((unsigned char)s[s_len]));
+ } while (HDisspace((unsigned char)s[s_len]));
s_len++;
- /* write output into dest
- */
- HDmemcpy(dest, s, s_len);
+ /* write output into dest */
+ H5MM_memcpy(dest, s, s_len);
}
}
@@ -3105,12 +2842,10 @@ H5FD_s3comms_uriencode(char *dest, const char *s, size_t s_len, hbool_t encode_s
HDfprintf(stdout, "H5FD_s3comms_uriencode called.\n");
#endif
- if (s == NULL) {
+ if (s == NULL)
HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "source string cannot be NULL");
- }
- if (dest == NULL) {
+ if (dest == NULL)
HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "destination cannot be NULL");
- }
/* Write characters to destination, converting to percent-encoded
* "hex-utf-8" strings if necessary.
@@ -3118,10 +2853,9 @@ H5FD_s3comms_uriencode(char *dest, const char *s, size_t s_len, hbool_t encode_s
*/
for (s_off = 0; s_off < s_len; s_off++) {
c = s[s_off];
- if (isalnum(c) || c == '.' || c == '-' || c == '_' || c == '~' ||
- (c == '/' && encode_slash == FALSE)) {
+ if (HDisalnum(c) || c == '.' || c == '-' || c == '_' || c == '~' ||
+ (c == '/' && encode_slash == FALSE))
dest[dest_off++] = c;
- }
else {
hex_off = 0;
if (H5FD_s3comms_percent_encode_char(hex_buffer, (const unsigned char)c, &hex_len) == FAIL) {
@@ -3133,9 +2867,8 @@ H5FD_s3comms_uriencode(char *dest, const char *s, size_t s_len, hbool_t encode_s
hex_buffer, (int)s_off, s);
}
- for (hex_off = 0; hex_off < hex_len; hex_off++) {
+ for (hex_off = 0; hex_off < hex_len; hex_off++)
dest[dest_off++] = hex_buffer[hex_off];
- }
} /* end else (not a regular character) */
} /* end for each character */
diff --git a/src/H5FDsec2.c b/src/H5FDsec2.c
index 319089c..c694190 100644
--- a/src/H5FDsec2.c
+++ b/src/H5FDsec2.c
@@ -98,7 +98,6 @@ typedef struct H5FD_sec2_t {
* a single file.
*/
hbool_t fam_to_single;
-
} H5FD_sec2_t;
/*
@@ -123,57 +122,59 @@ typedef struct H5FD_sec2_t {
(ADDR_OVERFLOW(A) || SIZE_OVERFLOW(Z) || HADDR_UNDEF == (A) + (Z) || (HDoff_t)((A) + (Z)) < (HDoff_t)(A))
/* Prototypes */
-static herr_t H5FD_sec2_term(void);
-static H5FD_t *H5FD_sec2_open(const char *name, unsigned flags, hid_t fapl_id, haddr_t maxaddr);
-static herr_t H5FD_sec2_close(H5FD_t *_file);
-static int H5FD_sec2_cmp(const H5FD_t *_f1, const H5FD_t *_f2);
-static herr_t H5FD_sec2_query(const H5FD_t *_f1, unsigned long *flags);
-static haddr_t H5FD_sec2_get_eoa(const H5FD_t *_file, H5FD_mem_t type);
-static herr_t H5FD_sec2_set_eoa(H5FD_t *_file, H5FD_mem_t type, haddr_t addr);
-static haddr_t H5FD_sec2_get_eof(const H5FD_t *_file, H5FD_mem_t type);
-static herr_t H5FD_sec2_get_handle(H5FD_t *_file, hid_t fapl, void **file_handle);
-static herr_t H5FD_sec2_read(H5FD_t *_file, H5FD_mem_t type, hid_t fapl_id, haddr_t addr, size_t size,
- void *buf);
-static herr_t H5FD_sec2_write(H5FD_t *_file, H5FD_mem_t type, hid_t fapl_id, haddr_t addr, size_t size,
- const void *buf);
-static herr_t H5FD_sec2_truncate(H5FD_t *_file, hid_t dxpl_id, hbool_t closing);
-static herr_t H5FD_sec2_lock(H5FD_t *_file, hbool_t rw);
-static herr_t H5FD_sec2_unlock(H5FD_t *_file);
+static herr_t H5FD__sec2_term(void);
+static H5FD_t *H5FD__sec2_open(const char *name, unsigned flags, hid_t fapl_id, haddr_t maxaddr);
+static herr_t H5FD__sec2_close(H5FD_t *_file);
+static int H5FD__sec2_cmp(const H5FD_t *_f1, const H5FD_t *_f2);
+static herr_t H5FD__sec2_query(const H5FD_t *_f1, unsigned long *flags);
+static haddr_t H5FD__sec2_get_eoa(const H5FD_t *_file, H5FD_mem_t type);
+static herr_t H5FD__sec2_set_eoa(H5FD_t *_file, H5FD_mem_t type, haddr_t addr);
+static haddr_t H5FD__sec2_get_eof(const H5FD_t *_file, H5FD_mem_t type);
+static herr_t H5FD__sec2_get_handle(H5FD_t *_file, hid_t fapl, void **file_handle);
+static herr_t H5FD__sec2_read(H5FD_t *_file, H5FD_mem_t type, hid_t fapl_id, haddr_t addr, size_t size,
+ void *buf);
+static herr_t H5FD__sec2_write(H5FD_t *_file, H5FD_mem_t type, hid_t fapl_id, haddr_t addr, size_t size,
+ const void *buf);
+static herr_t H5FD__sec2_truncate(H5FD_t *_file, hid_t dxpl_id, hbool_t closing);
+static herr_t H5FD__sec2_lock(H5FD_t *_file, hbool_t rw);
+static herr_t H5FD__sec2_unlock(H5FD_t *_file);
+static herr_t H5FD__sec2_delete(const char *filename, hid_t fapl_id);
static const H5FD_class_t H5FD_sec2_g = {
- "sec2", /* name */
- MAXADDR, /* maxaddr */
- H5F_CLOSE_WEAK, /* fc_degree */
- H5FD_sec2_term, /* terminate */
- NULL, /* sb_size */
- NULL, /* sb_encode */
- NULL, /* sb_decode */
- 0, /* fapl_size */
- NULL, /* fapl_get */
- NULL, /* fapl_copy */
- NULL, /* fapl_free */
- 0, /* dxpl_size */
- NULL, /* dxpl_copy */
- NULL, /* dxpl_free */
- H5FD_sec2_open, /* open */
- H5FD_sec2_close, /* close */
- H5FD_sec2_cmp, /* cmp */
- H5FD_sec2_query, /* query */
- NULL, /* get_type_map */
- NULL, /* alloc */
- NULL, /* free */
- H5FD_sec2_get_eoa, /* get_eoa */
- H5FD_sec2_set_eoa, /* set_eoa */
- H5FD_sec2_get_eof, /* get_eof */
- H5FD_sec2_get_handle, /* get_handle */
- H5FD_sec2_read, /* read */
- H5FD_sec2_write, /* write */
- NULL, /* flush */
- H5FD_sec2_truncate, /* truncate */
- H5FD_sec2_lock, /* lock */
- H5FD_sec2_unlock, /* unlock */
- NULL, /* dedup */
- H5FD_FLMAP_DICHOTOMY /* fl_map */
+ "sec2", /* name */
+ MAXADDR, /* maxaddr */
+ H5F_CLOSE_WEAK, /* fc_degree */
+ H5FD__sec2_term, /* terminate */
+ NULL, /* sb_size */
+ NULL, /* sb_encode */
+ NULL, /* sb_decode */
+ 0, /* fapl_size */
+ NULL, /* fapl_get */
+ NULL, /* fapl_copy */
+ NULL, /* fapl_free */
+ 0, /* dxpl_size */
+ NULL, /* dxpl_copy */
+ NULL, /* dxpl_free */
+ H5FD__sec2_open, /* open */
+ H5FD__sec2_close, /* close */
+ H5FD__sec2_cmp, /* cmp */
+ H5FD__sec2_query, /* query */
+ NULL, /* get_type_map */
+ NULL, /* alloc */
+ NULL, /* free */
+ H5FD__sec2_get_eoa, /* get_eoa */
+ H5FD__sec2_set_eoa, /* set_eoa */
+ H5FD__sec2_get_eof, /* get_eof */
+ H5FD__sec2_get_handle, /* get_handle */
+ H5FD__sec2_read, /* read */
+ H5FD__sec2_write, /* write */
+ NULL, /* flush */
+ H5FD__sec2_truncate, /* truncate */
+ H5FD__sec2_lock, /* lock */
+ H5FD__sec2_unlock, /* unlock */
+ H5FD__sec2_delete, /* del */
+ NULL, /* dedup */
+ H5FD_FLMAP_DICHOTOMY /* fl_map */
};
/* Declare a free list to manage the H5FD_sec2_t struct */
@@ -244,7 +245,7 @@ done:
} /* end H5FD_sec2_init() */
/*---------------------------------------------------------------------------
- * Function: H5FD_sec2_term
+ * Function: H5FD__sec2_term
*
* Purpose: Shut down the VFD
*
@@ -256,15 +257,15 @@ done:
*---------------------------------------------------------------------------
*/
static herr_t
-H5FD_sec2_term(void)
+H5FD__sec2_term(void)
{
- FUNC_ENTER_NOAPI_NOINIT_NOERR
+ FUNC_ENTER_STATIC_NOERR
/* Reset VFL ID */
H5FD_SEC2_g = 0;
FUNC_LEAVE_NOAPI(SUCCEED)
-} /* end H5FD_sec2_term() */
+} /* end H5FD__sec2_term() */
/*-------------------------------------------------------------------------
* Function: H5Pset_fapl_sec2
@@ -299,7 +300,7 @@ done:
} /* end H5Pset_fapl_sec2() */
/*-------------------------------------------------------------------------
- * Function: H5FD_sec2_open
+ * Function: H5FD__sec2_open
*
* Purpose: Create and/or opens a file as an HDF5 file.
*
@@ -314,7 +315,7 @@ done:
*-------------------------------------------------------------------------
*/
static H5FD_t *
-H5FD_sec2_open(const char *name, unsigned flags, hid_t fapl_id, haddr_t maxaddr)
+H5FD__sec2_open(const char *name, unsigned flags, hid_t fapl_id, haddr_t maxaddr)
{
H5FD_sec2_t *file = NULL; /* sec2 VFD info */
int fd = -1; /* File descriptor */
@@ -326,7 +327,7 @@ H5FD_sec2_open(const char *name, unsigned flags, hid_t fapl_id, haddr_t maxaddr)
H5P_genplist_t *plist; /* Property list pointer */
H5FD_t * ret_value = NULL; /* Return value */
- FUNC_ENTER_NOAPI_NOINIT
+ FUNC_ENTER_STATIC
/* Sanity check on file offsets */
HDcompile_assert(sizeof(HDoff_t) >= sizeof(size_t));
@@ -427,10 +428,10 @@ done:
} /* end if */
FUNC_LEAVE_NOAPI(ret_value)
-} /* end H5FD_sec2_open() */
+} /* end H5FD__sec2_open() */
/*-------------------------------------------------------------------------
- * Function: H5FD_sec2_close
+ * Function: H5FD__sec2_close
*
* Purpose: Closes an HDF5 file.
*
@@ -443,12 +444,12 @@ done:
*-------------------------------------------------------------------------
*/
static herr_t
-H5FD_sec2_close(H5FD_t *_file)
+H5FD__sec2_close(H5FD_t *_file)
{
H5FD_sec2_t *file = (H5FD_sec2_t *)_file;
herr_t ret_value = SUCCEED; /* Return value */
- FUNC_ENTER_NOAPI_NOINIT
+ FUNC_ENTER_STATIC
/* Sanity check */
HDassert(file);
@@ -462,10 +463,10 @@ H5FD_sec2_close(H5FD_t *_file)
done:
FUNC_LEAVE_NOAPI(ret_value)
-} /* end H5FD_sec2_close() */
+} /* end H5FD__sec2_close() */
/*-------------------------------------------------------------------------
- * Function: H5FD_sec2_cmp
+ * Function: H5FD__sec2_cmp
*
* Purpose: Compares two files belonging to this driver using an
* arbitrary (but consistent) ordering.
@@ -480,13 +481,13 @@ done:
*-------------------------------------------------------------------------
*/
static int
-H5FD_sec2_cmp(const H5FD_t *_f1, const H5FD_t *_f2)
+H5FD__sec2_cmp(const H5FD_t *_f1, const H5FD_t *_f2)
{
const H5FD_sec2_t *f1 = (const H5FD_sec2_t *)_f1;
const H5FD_sec2_t *f2 = (const H5FD_sec2_t *)_f2;
int ret_value = 0;
- FUNC_ENTER_NOAPI_NOINIT_NOERR
+ FUNC_ENTER_STATIC_NOERR
#ifdef H5_HAVE_WIN32_API
if (f1->dwVolumeSerialNumber < f2->dwVolumeSerialNumber)
@@ -527,10 +528,10 @@ H5FD_sec2_cmp(const H5FD_t *_f1, const H5FD_t *_f2)
done:
FUNC_LEAVE_NOAPI(ret_value)
-} /* end H5FD_sec2_cmp() */
+} /* end H5FD__sec2_cmp() */
/*-------------------------------------------------------------------------
- * Function: H5FD_sec2_query
+ * Function: H5FD__sec2_query
*
* Purpose: Set the flags that this VFL driver is capable of supporting.
* (listed in H5FDpublic.h)
@@ -543,11 +544,11 @@ done:
*-------------------------------------------------------------------------
*/
static herr_t
-H5FD_sec2_query(const H5FD_t *_file, unsigned long *flags /* out */)
+H5FD__sec2_query(const H5FD_t *_file, unsigned long *flags /* out */)
{
const H5FD_sec2_t *file = (const H5FD_sec2_t *)_file; /* sec2 VFD info */
- FUNC_ENTER_NOAPI_NOINIT_NOERR
+ FUNC_ENTER_STATIC_NOERR
/* Set the VFL feature flags that this driver supports */
/* Notice: the Mirror VFD Writer currently uses only the Sec2 driver as
@@ -575,10 +576,10 @@ H5FD_sec2_query(const H5FD_t *_file, unsigned long *flags /* out */)
} /* end if */
FUNC_LEAVE_NOAPI(SUCCEED)
-} /* end H5FD_sec2_query() */
+} /* end H5FD__sec2_query() */
/*-------------------------------------------------------------------------
- * Function: H5FD_sec2_get_eoa
+ * Function: H5FD__sec2_get_eoa
*
* Purpose: Gets the end-of-address marker for the file. The EOA marker
* is the first address past the last byte allocated in the
@@ -592,17 +593,17 @@ H5FD_sec2_query(const H5FD_t *_file, unsigned long *flags /* out */)
*-------------------------------------------------------------------------
*/
static haddr_t
-H5FD_sec2_get_eoa(const H5FD_t *_file, H5FD_mem_t H5_ATTR_UNUSED type)
+H5FD__sec2_get_eoa(const H5FD_t *_file, H5FD_mem_t H5_ATTR_UNUSED type)
{
const H5FD_sec2_t *file = (const H5FD_sec2_t *)_file;
- FUNC_ENTER_NOAPI_NOINIT_NOERR
+ FUNC_ENTER_STATIC_NOERR
FUNC_LEAVE_NOAPI(file->eoa)
-} /* end H5FD_sec2_get_eoa() */
+} /* end H5FD__sec2_get_eoa() */
/*-------------------------------------------------------------------------
- * Function: H5FD_sec2_set_eoa
+ * Function: H5FD__sec2_set_eoa
*
* Purpose: Set the end-of-address marker for the file. This function is
* called shortly after an existing HDF5 file is opened in order
@@ -616,19 +617,19 @@ H5FD_sec2_get_eoa(const H5FD_t *_file, H5FD_mem_t H5_ATTR_UNUSED type)
*-------------------------------------------------------------------------
*/
static herr_t
-H5FD_sec2_set_eoa(H5FD_t *_file, H5FD_mem_t H5_ATTR_UNUSED type, haddr_t addr)
+H5FD__sec2_set_eoa(H5FD_t *_file, H5FD_mem_t H5_ATTR_UNUSED type, haddr_t addr)
{
H5FD_sec2_t *file = (H5FD_sec2_t *)_file;
- FUNC_ENTER_NOAPI_NOINIT_NOERR
+ FUNC_ENTER_STATIC_NOERR
file->eoa = addr;
FUNC_LEAVE_NOAPI(SUCCEED)
-} /* end H5FD_sec2_set_eoa() */
+} /* end H5FD__sec2_set_eoa() */
/*-------------------------------------------------------------------------
- * Function: H5FD_sec2_get_eof
+ * Function: H5FD__sec2_get_eof
*
* Purpose: Returns the end-of-file marker, which is the greater of
* either the filesystem end-of-file or the HDF5 end-of-address
@@ -643,17 +644,17 @@ H5FD_sec2_set_eoa(H5FD_t *_file, H5FD_mem_t H5_ATTR_UNUSED type, haddr_t addr)
*-------------------------------------------------------------------------
*/
static haddr_t
-H5FD_sec2_get_eof(const H5FD_t *_file, H5FD_mem_t H5_ATTR_UNUSED type)
+H5FD__sec2_get_eof(const H5FD_t *_file, H5FD_mem_t H5_ATTR_UNUSED type)
{
const H5FD_sec2_t *file = (const H5FD_sec2_t *)_file;
- FUNC_ENTER_NOAPI_NOINIT_NOERR
+ FUNC_ENTER_STATIC_NOERR
FUNC_LEAVE_NOAPI(file->eof)
-} /* end H5FD_sec2_get_eof() */
+} /* end H5FD__sec2_get_eof() */
/*-------------------------------------------------------------------------
- * Function: H5FD_sec2_get_handle
+ * Function: H5FD__sec2_get_handle
*
* Purpose: Returns the file handle of sec2 file driver.
*
@@ -665,12 +666,12 @@ H5FD_sec2_get_eof(const H5FD_t *_file, H5FD_mem_t H5_ATTR_UNUSED type)
*-------------------------------------------------------------------------
*/
static herr_t
-H5FD_sec2_get_handle(H5FD_t *_file, hid_t H5_ATTR_UNUSED fapl, void **file_handle)
+H5FD__sec2_get_handle(H5FD_t *_file, hid_t H5_ATTR_UNUSED fapl, void **file_handle)
{
H5FD_sec2_t *file = (H5FD_sec2_t *)_file;
herr_t ret_value = SUCCEED;
- FUNC_ENTER_NOAPI_NOINIT
+ FUNC_ENTER_STATIC
if (!file_handle)
HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "file handle not valid")
@@ -679,10 +680,10 @@ H5FD_sec2_get_handle(H5FD_t *_file, hid_t H5_ATTR_UNUSED fapl, void **file_handl
done:
FUNC_LEAVE_NOAPI(ret_value)
-} /* end H5FD_sec2_get_handle() */
+} /* end H5FD__sec2_get_handle() */
/*-------------------------------------------------------------------------
- * Function: H5FD_sec2_read
+ * Function: H5FD__sec2_read
*
* Purpose: Reads SIZE bytes of data from FILE beginning at address ADDR
* into buffer BUF according to data transfer properties in
@@ -698,14 +699,14 @@ done:
*-------------------------------------------------------------------------
*/
static herr_t
-H5FD_sec2_read(H5FD_t *_file, H5FD_mem_t H5_ATTR_UNUSED type, hid_t H5_ATTR_UNUSED dxpl_id, haddr_t addr,
- size_t size, void *buf /*out*/)
+H5FD__sec2_read(H5FD_t *_file, H5FD_mem_t H5_ATTR_UNUSED type, hid_t H5_ATTR_UNUSED dxpl_id, haddr_t addr,
+ size_t size, void *buf /*out*/)
{
H5FD_sec2_t *file = (H5FD_sec2_t *)_file;
HDoff_t offset = (HDoff_t)addr;
herr_t ret_value = SUCCEED; /* Return value */
- FUNC_ENTER_NOAPI_NOINIT
+ FUNC_ENTER_STATIC
HDassert(file && file->pub.cls);
HDassert(buf);
@@ -718,17 +719,15 @@ H5FD_sec2_read(H5FD_t *_file, H5FD_mem_t H5_ATTR_UNUSED type, hid_t H5_ATTR_UNUS
#ifndef H5_HAVE_PREADWRITE
/* Seek to the correct location (if we don't have pread) */
- if (addr != file->pos || OP_READ != file->op) {
+ if (addr != file->pos || OP_READ != file->op)
if (HDlseek(file->fd, (HDoff_t)addr, SEEK_SET) < 0)
HSYS_GOTO_ERROR(H5E_IO, H5E_SEEKERROR, FAIL, "unable to seek to proper position")
- }
#endif /* H5_HAVE_PREADWRITE */
/* Read data, being careful of interrupted system calls, partial results,
* and the end of the file.
*/
while (size > 0) {
-
h5_posix_io_t bytes_in = 0; /* # of bytes to read */
h5_posix_io_ret_t bytes_read = -1; /* # of bytes actually read */
@@ -791,10 +790,10 @@ done:
} /* end if */
FUNC_LEAVE_NOAPI(ret_value)
-} /* end H5FD_sec2_read() */
+} /* end H5FD__sec2_read() */
/*-------------------------------------------------------------------------
- * Function: H5FD_sec2_write
+ * Function: H5FD__sec2_write
*
* Purpose: Writes SIZE bytes of data to FILE beginning at address ADDR
* from buffer BUF according to data transfer properties in
@@ -808,14 +807,14 @@ done:
*-------------------------------------------------------------------------
*/
static herr_t
-H5FD_sec2_write(H5FD_t *_file, H5FD_mem_t H5_ATTR_UNUSED type, hid_t H5_ATTR_UNUSED dxpl_id, haddr_t addr,
- size_t size, const void *buf)
+H5FD__sec2_write(H5FD_t *_file, H5FD_mem_t H5_ATTR_UNUSED type, hid_t H5_ATTR_UNUSED dxpl_id, haddr_t addr,
+ size_t size, const void *buf)
{
H5FD_sec2_t *file = (H5FD_sec2_t *)_file;
HDoff_t offset = (HDoff_t)addr;
herr_t ret_value = SUCCEED; /* Return value */
- FUNC_ENTER_NOAPI_NOINIT
+ FUNC_ENTER_STATIC
HDassert(file && file->pub.cls);
HDassert(buf);
@@ -829,17 +828,15 @@ H5FD_sec2_write(H5FD_t *_file, H5FD_mem_t H5_ATTR_UNUSED type, hid_t H5_ATTR_UNU
#ifndef H5_HAVE_PREADWRITE
/* Seek to the correct location (if we don't have pwrite) */
- if (addr != file->pos || OP_WRITE != file->op) {
+ if (addr != file->pos || OP_WRITE != file->op)
if (HDlseek(file->fd, (HDoff_t)addr, SEEK_SET) < 0)
HSYS_GOTO_ERROR(H5E_IO, H5E_SEEKERROR, FAIL, "unable to seek to proper position")
- }
#endif /* H5_HAVE_PREADWRITE */
/* Write the data, being careful of interrupted system calls and partial
* results
*/
while (size > 0) {
-
h5_posix_io_t bytes_in = 0; /* # of bytes to write */
h5_posix_io_ret_t bytes_wrote = -1; /* # of bytes written */
@@ -898,10 +895,10 @@ done:
} /* end if */
FUNC_LEAVE_NOAPI(ret_value)
-} /* end H5FD_sec2_write() */
+} /* end H5FD__sec2_write() */
/*-------------------------------------------------------------------------
- * Function: H5FD_sec2_truncate
+ * Function: H5FD__sec2_truncate
*
* Purpose: Makes sure that the true file size is the same (or larger)
* than the end-of-address.
@@ -914,12 +911,12 @@ done:
*-------------------------------------------------------------------------
*/
static herr_t
-H5FD_sec2_truncate(H5FD_t *_file, hid_t H5_ATTR_UNUSED dxpl_id, hbool_t H5_ATTR_UNUSED closing)
+H5FD__sec2_truncate(H5FD_t *_file, hid_t H5_ATTR_UNUSED dxpl_id, hbool_t H5_ATTR_UNUSED closing)
{
H5FD_sec2_t *file = (H5FD_sec2_t *)_file;
herr_t ret_value = SUCCEED; /* Return value */
- FUNC_ENTER_NOAPI_NOINIT
+ FUNC_ENTER_STATIC
HDassert(file);
@@ -966,10 +963,10 @@ H5FD_sec2_truncate(H5FD_t *_file, hid_t H5_ATTR_UNUSED dxpl_id, hbool_t H5_ATTR_
done:
FUNC_LEAVE_NOAPI(ret_value)
-} /* end H5FD_sec2_truncate() */
+} /* end H5FD__sec2_truncate() */
/*-------------------------------------------------------------------------
- * Function: H5FD_sec2_lock
+ * Function: H5FD__sec2_lock
*
* Purpose: To place an advisory lock on a file.
* The lock type to apply depends on the parameter "rw":
@@ -983,13 +980,13 @@ done:
*-------------------------------------------------------------------------
*/
static herr_t
-H5FD_sec2_lock(H5FD_t *_file, hbool_t rw)
+H5FD__sec2_lock(H5FD_t *_file, hbool_t rw)
{
H5FD_sec2_t *file = (H5FD_sec2_t *)_file; /* VFD file struct */
int lock_flags; /* file locking flags */
herr_t ret_value = SUCCEED; /* Return value */
- FUNC_ENTER_NOAPI_NOINIT
+ FUNC_ENTER_STATIC
HDassert(file);
@@ -1010,10 +1007,10 @@ H5FD_sec2_lock(H5FD_t *_file, hbool_t rw)
done:
FUNC_LEAVE_NOAPI(ret_value)
-} /* end H5FD_sec2_lock() */
+} /* end H5FD__sec2_lock() */
/*-------------------------------------------------------------------------
- * Function: H5FD_sec2_unlock
+ * Function: H5FD__sec2_unlock
*
* Purpose: To remove the existing lock on the file
*
@@ -1024,12 +1021,12 @@ done:
*-------------------------------------------------------------------------
*/
static herr_t
-H5FD_sec2_unlock(H5FD_t *_file)
+H5FD__sec2_unlock(H5FD_t *_file)
{
H5FD_sec2_t *file = (H5FD_sec2_t *)_file; /* VFD file struct */
herr_t ret_value = SUCCEED; /* Return value */
- FUNC_ENTER_NOAPI_NOINIT
+ FUNC_ENTER_STATIC
HDassert(file);
@@ -1046,4 +1043,29 @@ H5FD_sec2_unlock(H5FD_t *_file)
done:
FUNC_LEAVE_NOAPI(ret_value)
-} /* end H5FD_sec2_unlock() */
+} /* end H5FD__sec2_unlock() */
+
+/*-------------------------------------------------------------------------
+ * Function: H5FD__sec2_delete
+ *
+ * Purpose: Delete a file
+ *
+ * Return: SUCCEED/FAIL
+ *
+ *-------------------------------------------------------------------------
+ */
+static herr_t
+H5FD__sec2_delete(const char *filename, hid_t H5_ATTR_UNUSED fapl_id)
+{
+ herr_t ret_value = SUCCEED; /* Return value */
+
+ FUNC_ENTER_STATIC
+
+ HDassert(filename);
+
+ if (HDremove(filename) < 0)
+ HSYS_GOTO_ERROR(H5E_VFL, H5E_CANTDELETEFILE, FAIL, "unable to delete file")
+
+done:
+ FUNC_LEAVE_NOAPI(ret_value)
+} /* end H5FD__sec2_delete() */
diff --git a/src/H5FDspace.c b/src/H5FDspace.c
index 5692b24..339c413 100644
--- a/src/H5FDspace.c
+++ b/src/H5FDspace.c
@@ -15,7 +15,7 @@
*
* Created: H5FDspace.c
* Jan 3 2008
- * Quincey Koziol <koziol@hdfgroup.org>
+ * Quincey Koziol
*
* Purpose: Space allocation routines for the file driver code.
*
@@ -74,7 +74,7 @@
H5FL_DEFINE(H5FD_free_t);
/*-------------------------------------------------------------------------
- * Function: H5FD_extend
+ * Function: H5FD__extend
*
* Purpose: Extend the EOA space of a file.
*
@@ -89,12 +89,12 @@ H5FL_DEFINE(H5FD_free_t);
*-------------------------------------------------------------------------
*/
static haddr_t
-H5FD_extend(H5FD_t *file, H5FD_mem_t type, hsize_t size)
+H5FD__extend(H5FD_t *file, H5FD_mem_t type, hsize_t size)
{
haddr_t eoa; /* Address of end-of-allocated space */
haddr_t ret_value = HADDR_UNDEF; /* Return value */
- FUNC_ENTER_NOAPI_NOINIT
+ FUNC_ENTER_STATIC
/* check args */
HDassert(file);
@@ -119,7 +119,7 @@ H5FD_extend(H5FD_t *file, H5FD_mem_t type, hsize_t size)
done:
FUNC_LEAVE_NOAPI(ret_value)
-} /* end H5FD_extend() */
+} /* end H5FD__extend() */
/*-------------------------------------------------------------------------
* Function: H5FD__alloc_real
@@ -193,7 +193,7 @@ H5FD__alloc_real(H5FD_t *file, H5FD_mem_t type, hsize_t size, haddr_t *frag_addr
HGOTO_ERROR(H5E_VFL, H5E_NOSPACE, HADDR_UNDEF, "driver allocation request failed")
} /* end if */
else {
- ret_value = H5FD_extend(file, type, size + extra);
+ ret_value = H5FD__extend(file, type, size + extra);
if (!H5F_addr_defined(ret_value))
HGOTO_ERROR(H5E_VFL, H5E_NOSPACE, HADDR_UNDEF, "driver eoa update request failed")
} /* end else */
@@ -425,7 +425,7 @@ H5FD_try_extend(H5FD_t *file, H5FD_mem_t type, H5F_t *f, haddr_t blk_end, hsize_
/* Check if the block is exactly at the end of the file */
if (H5F_addr_eq(blk_end, eoa)) {
/* Extend the object by extending the underlying file */
- if (HADDR_UNDEF == H5FD_extend(file, type, extra_requested))
+ if (HADDR_UNDEF == H5FD__extend(file, type, extra_requested))
HGOTO_ERROR(H5E_VFL, H5E_CANTEXTEND, FAIL, "driver extend request failed")
/* Mark EOA info dirty in cache, so change will get encoded */
diff --git a/src/H5FDsplitter.c b/src/H5FDsplitter.c
index 790b953..99d7100 100644
--- a/src/H5FDsplitter.c
+++ b/src/H5FDsplitter.c
@@ -27,8 +27,6 @@
#include "H5FLprivate.h" /* Free Lists */
#include "H5Iprivate.h" /* IDs */
#include "H5MMprivate.h" /* Memory management */
-#include "H5FDsec2.h" /* Generic Functions */
-#include "H5FDstdio.h" /* Generic Functions */
#include "H5Pprivate.h" /* Property lists */
/* The driver identification number, initialized at runtime */
@@ -82,9 +80,8 @@ typedef struct H5FD_splitter_t {
#define H5FD_SPLITTER_WO_ERROR(file, funcname, errmajor, errminor, ret, mesg) \
{ \
H5FD__splitter_log_error((file), (funcname), (mesg)); \
- if (FALSE == (file)->fa.ignore_wo_errs) { \
+ if (FALSE == (file)->fa.ignore_wo_errs) \
HGOTO_ERROR((errmajor), (errminor), (ret), (mesg)) \
- } \
}
#define H5FD_SPLITTER_DEBUG_OP_CALLS 0 /* debugging print toggle; 0 disables */
@@ -93,7 +90,7 @@ typedef struct H5FD_splitter_t {
#define H5FD_SPLITTER_LOG_CALL(name) \
do { \
HDprintf("called %s()\n", (name)); \
- fflush(stdout); \
+ HDfflush(stdout); \
} while (0)
#else
#define H5FD_SPLITTER_LOG_CALL(name) /* no-op */
@@ -103,69 +100,69 @@ typedef struct H5FD_splitter_t {
/* Print error messages from W/O channel to log file */
static herr_t H5FD__splitter_log_error(const H5FD_splitter_t *file, const char *atfunc, const char *msg);
-
-static int H5FD__copy_plist(hid_t fapl_id, hid_t *id_out_ptr);
+static int H5FD__copy_plist(hid_t fapl_id, hid_t *id_out_ptr);
/* Prototypes */
-static herr_t H5FD_splitter_term(void);
-static hsize_t H5FD_splitter_sb_size(H5FD_t *_file);
-static herr_t H5FD_splitter_sb_encode(H5FD_t *_file, char *name /*out*/, unsigned char *buf /*out*/);
-static herr_t H5FD_splitter_sb_decode(H5FD_t *_file, const char *name, const unsigned char *buf);
-static void * H5FD_splitter_fapl_get(H5FD_t *_file);
-static void * H5FD_splitter_fapl_copy(const void *_old_fa);
-static herr_t H5FD_splitter_fapl_free(void *_fapl);
-static H5FD_t *H5FD_splitter_open(const char *name, unsigned flags, hid_t fapl_id, haddr_t maxaddr);
-static herr_t H5FD_splitter_close(H5FD_t *_file);
-static int H5FD_splitter_cmp(const H5FD_t *_f1, const H5FD_t *_f2);
-static herr_t H5FD_splitter_query(const H5FD_t *_file, unsigned long *flags /* out */);
-static herr_t H5FD_splitter_get_type_map(const H5FD_t *_file, H5FD_mem_t *type_map);
-static haddr_t H5FD_splitter_alloc(H5FD_t *file, H5FD_mem_t type, hid_t dxpl_id, hsize_t size);
-static herr_t H5FD_splitter_free(H5FD_t *_file, H5FD_mem_t type, hid_t dxpl_id, haddr_t addr, hsize_t size);
-static haddr_t H5FD_splitter_get_eoa(const H5FD_t *_file, H5FD_mem_t H5_ATTR_UNUSED type);
-static herr_t H5FD_splitter_set_eoa(H5FD_t *_file, H5FD_mem_t H5_ATTR_UNUSED type, haddr_t addr);
-static haddr_t H5FD_splitter_get_eof(const H5FD_t *_file, H5FD_mem_t H5_ATTR_UNUSED type);
-static herr_t H5FD_splitter_get_handle(H5FD_t *_file, hid_t H5_ATTR_UNUSED fapl, void **file_handle);
-static herr_t H5FD_splitter_read(H5FD_t *_file, H5FD_mem_t type, hid_t dxpl_id, haddr_t addr, size_t size,
- void *buf);
-static herr_t H5FD_splitter_write(H5FD_t *_file, H5FD_mem_t type, hid_t dxpl_id, haddr_t addr, size_t size,
- const void *buf);
-static herr_t H5FD_splitter_flush(H5FD_t *_file, hid_t dxpl_id, hbool_t closing);
-static herr_t H5FD_splitter_truncate(H5FD_t *_file, hid_t dxpl_id, hbool_t closing);
-static herr_t H5FD_splitter_lock(H5FD_t *_file, hbool_t rw);
-static herr_t H5FD_splitter_unlock(H5FD_t *_file);
+static herr_t H5FD__splitter_term(void);
+static hsize_t H5FD__splitter_sb_size(H5FD_t *_file);
+static herr_t H5FD__splitter_sb_encode(H5FD_t *_file, char *name /*out*/, unsigned char *buf /*out*/);
+static herr_t H5FD__splitter_sb_decode(H5FD_t *_file, const char *name, const unsigned char *buf);
+static void * H5FD__splitter_fapl_get(H5FD_t *_file);
+static void * H5FD__splitter_fapl_copy(const void *_old_fa);
+static herr_t H5FD__splitter_fapl_free(void *_fapl);
+static H5FD_t *H5FD__splitter_open(const char *name, unsigned flags, hid_t fapl_id, haddr_t maxaddr);
+static herr_t H5FD__splitter_close(H5FD_t *_file);
+static int H5FD__splitter_cmp(const H5FD_t *_f1, const H5FD_t *_f2);
+static herr_t H5FD__splitter_query(const H5FD_t *_file, unsigned long *flags /* out */);
+static herr_t H5FD__splitter_get_type_map(const H5FD_t *_file, H5FD_mem_t *type_map);
+static haddr_t H5FD__splitter_alloc(H5FD_t *file, H5FD_mem_t type, hid_t dxpl_id, hsize_t size);
+static herr_t H5FD__splitter_free(H5FD_t *_file, H5FD_mem_t type, hid_t dxpl_id, haddr_t addr, hsize_t size);
+static haddr_t H5FD__splitter_get_eoa(const H5FD_t *_file, H5FD_mem_t H5_ATTR_UNUSED type);
+static herr_t H5FD__splitter_set_eoa(H5FD_t *_file, H5FD_mem_t H5_ATTR_UNUSED type, haddr_t addr);
+static haddr_t H5FD__splitter_get_eof(const H5FD_t *_file, H5FD_mem_t H5_ATTR_UNUSED type);
+static herr_t H5FD__splitter_get_handle(H5FD_t *_file, hid_t H5_ATTR_UNUSED fapl, void **file_handle);
+static herr_t H5FD__splitter_read(H5FD_t *_file, H5FD_mem_t type, hid_t dxpl_id, haddr_t addr, size_t size,
+ void *buf);
+static herr_t H5FD__splitter_write(H5FD_t *_file, H5FD_mem_t type, hid_t dxpl_id, haddr_t addr, size_t size,
+ const void *buf);
+static herr_t H5FD__splitter_flush(H5FD_t *_file, hid_t dxpl_id, hbool_t closing);
+static herr_t H5FD__splitter_truncate(H5FD_t *_file, hid_t dxpl_id, hbool_t closing);
+static herr_t H5FD__splitter_lock(H5FD_t *_file, hbool_t rw);
+static herr_t H5FD__splitter_unlock(H5FD_t *_file);
static const H5FD_class_t H5FD_splitter_g = {
"splitter", /* name */
MAXADDR, /* maxaddr */
H5F_CLOSE_WEAK, /* fc_degree */
- H5FD_splitter_term, /* terminate */
- H5FD_splitter_sb_size, /* sb_size */
- H5FD_splitter_sb_encode, /* sb_encode */
- H5FD_splitter_sb_decode, /* sb_decode */
+ H5FD__splitter_term, /* terminate */
+ H5FD__splitter_sb_size, /* sb_size */
+ H5FD__splitter_sb_encode, /* sb_encode */
+ H5FD__splitter_sb_decode, /* sb_decode */
sizeof(H5FD_splitter_fapl_t), /* fapl_size */
- H5FD_splitter_fapl_get, /* fapl_get */
- H5FD_splitter_fapl_copy, /* fapl_copy */
- H5FD_splitter_fapl_free, /* fapl_free */
+ H5FD__splitter_fapl_get, /* fapl_get */
+ H5FD__splitter_fapl_copy, /* fapl_copy */
+ H5FD__splitter_fapl_free, /* fapl_free */
0, /* dxpl_size */
NULL, /* dxpl_copy */
NULL, /* dxpl_free */
- H5FD_splitter_open, /* open */
- H5FD_splitter_close, /* close */
- H5FD_splitter_cmp, /* cmp */
- H5FD_splitter_query, /* query */
- H5FD_splitter_get_type_map, /* get_type_map */
- H5FD_splitter_alloc, /* alloc */
- H5FD_splitter_free, /* free */
- H5FD_splitter_get_eoa, /* get_eoa */
- H5FD_splitter_set_eoa, /* set_eoa */
- H5FD_splitter_get_eof, /* get_eof */
- H5FD_splitter_get_handle, /* get_handle */
- H5FD_splitter_read, /* read */
- H5FD_splitter_write, /* write */
- H5FD_splitter_flush, /* flush */
- H5FD_splitter_truncate, /* truncate */
- H5FD_splitter_lock, /* lock */
- H5FD_splitter_unlock, /* unlock */
+ H5FD__splitter_open, /* open */
+ H5FD__splitter_close, /* close */
+ H5FD__splitter_cmp, /* cmp */
+ H5FD__splitter_query, /* query */
+ H5FD__splitter_get_type_map, /* get_type_map */
+ H5FD__splitter_alloc, /* alloc */
+ H5FD__splitter_free, /* free */
+ H5FD__splitter_get_eoa, /* get_eoa */
+ H5FD__splitter_set_eoa, /* set_eoa */
+ H5FD__splitter_get_eof, /* get_eof */
+ H5FD__splitter_get_handle, /* get_handle */
+ H5FD__splitter_read, /* read */
+ H5FD__splitter_write, /* write */
+ H5FD__splitter_flush, /* flush */
+ H5FD__splitter_truncate, /* truncate */
+ H5FD__splitter_lock, /* lock */
+ H5FD__splitter_unlock, /* unlock */
+ NULL, /* del */
NULL, /* dedup */
H5FD_FLMAP_DICHOTOMY /* fl_map */
};
@@ -173,6 +170,9 @@ static const H5FD_class_t H5FD_splitter_g = {
/* Declare a free list to manage the H5FD_splitter_t struct */
H5FL_DEFINE_STATIC(H5FD_splitter_t);
+/* Declare a free list to manage the H5FD_splitter_fapl_t struct */
+H5FL_DEFINE_STATIC(H5FD_splitter_fapl_t);
+
/*-------------------------------------------------------------------------
* Function: H5FD__init_package
*
@@ -188,11 +188,10 @@ H5FD__init_package(void)
FUNC_ENTER_STATIC
- H5FD_SPLITTER_LOG_CALL("H5FD__init_package");
+ H5FD_SPLITTER_LOG_CALL(FUNC);
- if (H5FD_splitter_init() < 0) {
+ if (H5FD_splitter_init() < 0)
HGOTO_ERROR(H5E_VFL, H5E_CANTINIT, FAIL, "unable to initialize splitter VFD")
- }
done:
FUNC_LEAVE_NOAPI(ret_value)
@@ -213,13 +212,12 @@ H5FD_splitter_init(void)
{
hid_t ret_value = H5I_INVALID_HID;
- FUNC_ENTER_NOAPI(FAIL)
+ FUNC_ENTER_NOAPI(H5I_INVALID_HID)
- H5FD_SPLITTER_LOG_CALL("H5FD_splitter_init");
+ H5FD_SPLITTER_LOG_CALL(FUNC);
- if (H5I_VFL != H5I_get_type(H5FD_SPLITTER_g)) {
+ if (H5I_VFL != H5I_get_type(H5FD_SPLITTER_g))
H5FD_SPLITTER_g = H5FDregister(&H5FD_splitter_g);
- }
ret_value = H5FD_SPLITTER_g;
@@ -228,7 +226,7 @@ done:
} /* end H5FD_splitter_init() */
/*---------------------------------------------------------------------------
- * Function: H5FD_splitter_term
+ * Function: H5FD__splitter_term
*
* Purpose: Shut down the splitter VFD.
*
@@ -236,17 +234,17 @@ done:
*---------------------------------------------------------------------------
*/
static herr_t
-H5FD_splitter_term(void)
+H5FD__splitter_term(void)
{
- FUNC_ENTER_NOAPI_NOINIT_NOERR
+ FUNC_ENTER_STATIC_NOERR
- H5FD_SPLITTER_LOG_CALL("H5FD_splitter_term");
+ H5FD_SPLITTER_LOG_CALL(FUNC);
/* Reset VFL ID */
H5FD_SPLITTER_g = 0;
FUNC_LEAVE_NOAPI(SUCCEED)
-} /* end H5FD_splitter_term() */
+} /* end H5FD__splitter_term() */
/*-------------------------------------------------------------------------
* Function: H5FD__copy_plist
@@ -263,25 +261,22 @@ H5FD__copy_plist(hid_t fapl_id, hid_t *id_out_ptr)
int ret_value = 0;
H5P_genplist_t *plist_ptr = NULL;
- FUNC_ENTER_NOAPI_NOINIT
+ FUNC_ENTER_STATIC
- H5FD_SPLITTER_LOG_CALL("H5FD__copy_plist");
+ H5FD_SPLITTER_LOG_CALL(FUNC);
HDassert(id_out_ptr != NULL);
- if (FALSE == H5P_isa_class(fapl_id, H5P_FILE_ACCESS)) {
+ if (FALSE == H5P_isa_class(fapl_id, H5P_FILE_ACCESS))
HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, -1, "not a file access property list");
- }
plist_ptr = (H5P_genplist_t *)H5I_object(fapl_id);
- if (NULL == plist_ptr) {
+ if (NULL == plist_ptr)
HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, -1, "unable to get property list");
- }
*id_out_ptr = H5P_copy_plist(plist_ptr, FALSE);
- if (H5I_INVALID_HID == *id_out_ptr) {
+ if (H5I_INVALID_HID == *id_out_ptr)
HGOTO_ERROR(H5E_VFL, H5E_BADTYPE, -1, "unable to copy file access property list");
- }
done:
FUNC_LEAVE_NOAPI(ret_value);
@@ -299,27 +294,21 @@ done:
herr_t
H5Pset_fapl_splitter(hid_t fapl_id, H5FD_splitter_vfd_config_t *vfd_config)
{
- H5FD_splitter_fapl_t info;
- H5P_genplist_t * plist_ptr = NULL;
- herr_t ret_value = SUCCEED;
-
- H5Eclear2(H5E_DEFAULT);
+ H5FD_splitter_fapl_t *info = NULL;
+ H5P_genplist_t * plist_ptr = NULL;
+ herr_t ret_value = SUCCEED;
FUNC_ENTER_API(FAIL)
H5TRACE2("e", "i*#", fapl_id, vfd_config);
- H5FD_SPLITTER_LOG_CALL("H5Pset_fapl_splitter");
+ H5FD_SPLITTER_LOG_CALL(FUNC);
- if (H5FD_SPLITTER_MAGIC != vfd_config->magic) {
+ if (H5FD_SPLITTER_MAGIC != vfd_config->magic)
HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "invalid configuration (magic number mismatch)")
- }
- if (H5FD_CURR_SPLITTER_VFD_CONFIG_VERSION != vfd_config->version) {
- HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "invlaid config (version number mismatch)")
- }
-
- if (NULL == (plist_ptr = (H5P_genplist_t *)H5I_object(fapl_id))) {
+ if (H5FD_CURR_SPLITTER_VFD_CONFIG_VERSION != vfd_config->version)
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "invalid config (version number mismatch)")
+ if (NULL == (plist_ptr = (H5P_genplist_t *)H5I_object(fapl_id)))
HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a valid property list")
- }
/* Make sure that the W/O channel supports write-only capability.
* Some drivers (e.g. family or multi) do revision of the superblock
@@ -334,47 +323,47 @@ H5Pset_fapl_splitter(hid_t fapl_id, H5FD_splitter_vfd_config_t *vfd_config)
unsigned long wo_driver_flags = 0;
wo_plist_ptr = (H5P_genplist_t *)H5I_object(vfd_config->wo_fapl_id);
- if (NULL == wo_plist_ptr) {
+ if (NULL == wo_plist_ptr)
HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a file access property list")
- }
- if (H5P_peek(wo_plist_ptr, H5F_ACS_FILE_DRV_NAME, &wo_driver_prop) < 0) {
+ if (H5P_peek(wo_plist_ptr, H5F_ACS_FILE_DRV_NAME, &wo_driver_prop) < 0)
HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "can't get driver ID & info")
- }
wo_driver = (H5FD_class_t *)H5I_object(wo_driver_prop.driver_id);
- if (NULL == wo_driver) {
+ if (NULL == wo_driver)
HGOTO_ERROR(H5E_VFL, H5E_BADVALUE, FAIL, "invalid driver ID in file access property list")
- }
- if (H5FD_driver_query(wo_driver, &wo_driver_flags) < 0) {
+ if (H5FD_driver_query(wo_driver, &wo_driver_flags) < 0)
HGOTO_ERROR(H5E_VFL, H5E_BADVALUE, FAIL, "can't query VFD flags")
- }
- if (0 == (H5FD_FEAT_DEFAULT_VFD_COMPATIBLE & wo_driver_flags)) {
+ if (0 == (H5FD_FEAT_DEFAULT_VFD_COMPATIBLE & wo_driver_flags))
HGOTO_ERROR(H5E_VFL, H5E_BADVALUE, FAIL, "unsuitable W/O driver")
- }
} /* end if W/O VFD is non-default */
- info.ignore_wo_errs = vfd_config->ignore_wo_errs;
- HDstrncpy(info.wo_path, vfd_config->wo_path, H5FD_SPLITTER_PATH_MAX);
- HDstrncpy(info.log_file_path, vfd_config->log_file_path, H5FD_SPLITTER_PATH_MAX);
- info.rw_fapl_id = H5P_FILE_ACCESS_DEFAULT; /* pre-set value */
- info.wo_fapl_id = H5P_FILE_ACCESS_DEFAULT; /* pre-set value */
+ info = H5FL_CALLOC(H5FD_splitter_fapl_t);
+ if (NULL == info)
+ HGOTO_ERROR(H5E_VFL, H5E_CANTALLOC, FAIL, "unable to allocate file access property list struct")
+
+ info->ignore_wo_errs = vfd_config->ignore_wo_errs;
+ HDstrncpy(info->wo_path, vfd_config->wo_path, H5FD_SPLITTER_PATH_MAX);
+ HDstrncpy(info->log_file_path, vfd_config->log_file_path, H5FD_SPLITTER_PATH_MAX);
+ info->rw_fapl_id = H5P_FILE_ACCESS_DEFAULT; /* pre-set value */
+ info->wo_fapl_id = H5P_FILE_ACCESS_DEFAULT; /* pre-set value */
/* Set non-default channel FAPL IDs in splitter configuration info */
if (H5P_DEFAULT != vfd_config->rw_fapl_id) {
- if (FALSE == H5P_isa_class(vfd_config->rw_fapl_id, H5P_FILE_ACCESS)) {
+ if (FALSE == H5P_isa_class(vfd_config->rw_fapl_id, H5P_FILE_ACCESS))
HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a file access list")
- }
- info.rw_fapl_id = vfd_config->rw_fapl_id;
+ info->rw_fapl_id = vfd_config->rw_fapl_id;
}
if (H5P_DEFAULT != vfd_config->wo_fapl_id) {
- if (FALSE == H5P_isa_class(vfd_config->wo_fapl_id, H5P_FILE_ACCESS)) {
+ if (FALSE == H5P_isa_class(vfd_config->wo_fapl_id, H5P_FILE_ACCESS))
HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a file access list")
- }
- info.wo_fapl_id = vfd_config->wo_fapl_id;
+ info->wo_fapl_id = vfd_config->wo_fapl_id;
}
- ret_value = H5P_set_driver(plist_ptr, H5FD_SPLITTER, &info);
+ ret_value = H5P_set_driver(plist_ptr, H5FD_SPLITTER, info);
done:
+ if (info)
+ info = H5FL_FREE(H5FD_splitter_fapl_t, info);
+
FUNC_LEAVE_API(ret_value)
} /* end H5Pset_fapl_splitter() */
@@ -382,73 +371,64 @@ done:
* Function: H5Pget_fapl_splitter
*
* Purpose: Returns information about the splitter file access property
- * list through the structure config_out.
+ * list through the structure config.
*
- * Will fail if config_out is received without pre-set valid
+ * Will fail if config is received without pre-set valid
* magic and version information.
*
* Return: SUCCEED/FAIL
*-------------------------------------------------------------------------
*/
herr_t
-H5Pget_fapl_splitter(hid_t fapl_id, H5FD_splitter_vfd_config_t *config_out)
+H5Pget_fapl_splitter(hid_t fapl_id, H5FD_splitter_vfd_config_t *config /*out*/)
{
const H5FD_splitter_fapl_t *fapl_ptr = NULL;
H5P_genplist_t * plist_ptr = NULL;
herr_t ret_value = SUCCEED;
FUNC_ENTER_API(FAIL)
- H5TRACE2("e", "i*#", fapl_id, config_out);
+ H5TRACE2("e", "ix", fapl_id, config);
- H5FD_SPLITTER_LOG_CALL("H5Pget_fapl_splitter");
+ H5FD_SPLITTER_LOG_CALL(FUNC);
/* Check arguments */
- if (TRUE != H5P_isa_class(fapl_id, H5P_FILE_ACCESS)) {
+ if (TRUE != H5P_isa_class(fapl_id, H5P_FILE_ACCESS))
HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a file access property list")
- }
- if (config_out == NULL) {
- HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "config_out pointer is null")
- }
- if (H5FD_SPLITTER_MAGIC != config_out->magic) {
+ if (config == NULL)
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "config pointer is null")
+ if (H5FD_SPLITTER_MAGIC != config->magic)
HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "info-out pointer invalid (magic number mismatch)")
- }
- if (H5FD_CURR_SPLITTER_VFD_CONFIG_VERSION != config_out->version) {
+ if (H5FD_CURR_SPLITTER_VFD_CONFIG_VERSION != config->version)
HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "info-out pointer invalid (version unsafe)")
- }
/* Pre-set out FAPL IDs with intent to replace these values */
- config_out->rw_fapl_id = H5I_INVALID_HID;
- config_out->wo_fapl_id = H5I_INVALID_HID;
+ config->rw_fapl_id = H5I_INVALID_HID;
+ config->wo_fapl_id = H5I_INVALID_HID;
/* Check and get the splitter fapl */
- if (NULL == (plist_ptr = H5P_object_verify(fapl_id, H5P_FILE_ACCESS))) {
+ if (NULL == (plist_ptr = H5P_object_verify(fapl_id, H5P_FILE_ACCESS)))
HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a file access property list")
- }
- if (H5FD_SPLITTER != H5P_peek_driver(plist_ptr)) {
+ if (H5FD_SPLITTER != H5P_peek_driver(plist_ptr))
HGOTO_ERROR(H5E_PLIST, H5E_BADVALUE, FAIL, "incorrect VFL driver")
- }
- if (NULL == (fapl_ptr = (const H5FD_splitter_fapl_t *)H5P_peek_driver_info(plist_ptr))) {
+ if (NULL == (fapl_ptr = (const H5FD_splitter_fapl_t *)H5P_peek_driver_info(plist_ptr)))
HGOTO_ERROR(H5E_PLIST, H5E_BADVALUE, FAIL, "unable to get specific-driver info")
- }
- HDstrncpy(config_out->wo_path, fapl_ptr->wo_path, H5FD_SPLITTER_PATH_MAX);
- HDstrncpy(config_out->log_file_path, fapl_ptr->log_file_path, H5FD_SPLITTER_PATH_MAX);
- config_out->ignore_wo_errs = fapl_ptr->ignore_wo_errs;
+ HDstrncpy(config->wo_path, fapl_ptr->wo_path, H5FD_SPLITTER_PATH_MAX);
+ HDstrncpy(config->log_file_path, fapl_ptr->log_file_path, H5FD_SPLITTER_PATH_MAX);
+ config->ignore_wo_errs = fapl_ptr->ignore_wo_errs;
/* Copy R/W and W/O FAPLs */
- if (H5FD__copy_plist(fapl_ptr->rw_fapl_id, &(config_out->rw_fapl_id)) < 0) {
+ if (H5FD__copy_plist(fapl_ptr->rw_fapl_id, &(config->rw_fapl_id)) < 0)
HGOTO_ERROR(H5E_VFL, H5E_BADVALUE, FAIL, "can't copy R/W FAPL");
- }
- if (H5FD__copy_plist(fapl_ptr->wo_fapl_id, &(config_out->wo_fapl_id)) < 0) {
+ if (H5FD__copy_plist(fapl_ptr->wo_fapl_id, &(config->wo_fapl_id)) < 0)
HGOTO_ERROR(H5E_VFL, H5E_BADVALUE, FAIL, "can't copy W/O FAPL");
- }
done:
FUNC_LEAVE_API(ret_value)
} /* end H5Pget_fapl_splitter() */
/*-------------------------------------------------------------------------
- * Function: H5FD_splitter_flush
+ * Function: H5FD__splitter_flush
*
* Purpose: Flushes all data to disk for both channels.
*
@@ -456,30 +436,27 @@ done:
*-------------------------------------------------------------------------
*/
static herr_t
-H5FD_splitter_flush(H5FD_t *_file, hid_t H5_ATTR_UNUSED dxpl_id, hbool_t closing)
+H5FD__splitter_flush(H5FD_t *_file, hid_t H5_ATTR_UNUSED dxpl_id, hbool_t closing)
{
H5FD_splitter_t *file = (H5FD_splitter_t *)_file;
herr_t ret_value = SUCCEED; /* Return value */
- FUNC_ENTER_NOAPI_NOINIT
+ FUNC_ENTER_STATIC
- H5FD_SPLITTER_LOG_CALL("H5FD_splitter_flush");
+ H5FD_SPLITTER_LOG_CALL(FUNC);
/* Public API for dxpl "context" */
- if (H5FDflush(file->rw_file, dxpl_id, closing) < 0) {
+ if (H5FDflush(file->rw_file, dxpl_id, closing) < 0)
HGOTO_ERROR(H5E_VFL, H5E_CANTFLUSH, FAIL, "unable to flush R/W file")
- }
- if (H5FDflush(file->wo_file, dxpl_id, closing) < 0) {
- H5FD_SPLITTER_WO_ERROR(file, "H5FD_splitter_flush", H5E_VFL, H5E_CANTFLUSH, FAIL,
- "unable to flush W/O file")
- }
+ if (H5FDflush(file->wo_file, dxpl_id, closing) < 0)
+ H5FD_SPLITTER_WO_ERROR(file, FUNC, H5E_VFL, H5E_CANTFLUSH, FAIL, "unable to flush W/O file")
done:
FUNC_LEAVE_NOAPI(ret_value)
-} /* end H5FD_splitter_flush() */
+} /* end H5FD__splitter_flush() */
/*-------------------------------------------------------------------------
- * Function: H5FD_splitter_read
+ * Function: H5FD__splitter_read
*
* Purpose: Reads SIZE bytes of data from the R/W channel, beginning at
* address ADDR into buffer BUF according to data transfer
@@ -493,39 +470,36 @@ done:
*-------------------------------------------------------------------------
*/
static herr_t
-H5FD_splitter_read(H5FD_t *_file, H5FD_mem_t H5_ATTR_UNUSED type, hid_t H5_ATTR_UNUSED dxpl_id, haddr_t addr,
- size_t size, void *buf /*out*/)
+H5FD__splitter_read(H5FD_t *_file, H5FD_mem_t H5_ATTR_UNUSED type, hid_t H5_ATTR_UNUSED dxpl_id, haddr_t addr,
+ size_t size, void *buf)
{
H5FD_splitter_t *file = (H5FD_splitter_t *)_file;
herr_t ret_value = SUCCEED;
- FUNC_ENTER_NOAPI_NOINIT
+ FUNC_ENTER_STATIC
- H5FD_SPLITTER_LOG_CALL("H5FD_splitter_read");
+ H5FD_SPLITTER_LOG_CALL(FUNC);
HDassert(file && file->pub.cls);
HDassert(buf);
/* Check for overflow conditions */
- if (!H5F_addr_defined(addr)) {
+ if (!H5F_addr_defined(addr))
HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "addr undefined, addr = %llu", (unsigned long long)addr)
- }
- if (REGION_OVERFLOW(addr, size)) {
+ if (REGION_OVERFLOW(addr, size))
HGOTO_ERROR(H5E_ARGS, H5E_OVERFLOW, FAIL, "addr overflow, addr = %llu", (unsigned long long)addr)
- }
/* Only read from R/W channel */
/* Public API for dxpl "context" */
- if (H5FDread(file->rw_file, type, dxpl_id, addr, size, buf) < 0) {
+ if (H5FDread(file->rw_file, type, dxpl_id, addr, size, buf) < 0)
HGOTO_ERROR(H5E_VFL, H5E_READERROR, FAIL, "Reading from R/W channel failed")
- }
done:
FUNC_LEAVE_NOAPI(ret_value)
-} /* end H5FD_splitter_read() */
+} /* end H5FD__splitter_read() */
/*-------------------------------------------------------------------------
- * Function: H5FD_splitter_write
+ * Function: H5FD__splitter_write
*
* Purpose: Writes SIZE bytes of data to R/W and W/O channels, beginning
* at address ADDR from buffer BUF according to data transfer
@@ -535,36 +509,33 @@ done:
*-------------------------------------------------------------------------
*/
static herr_t
-H5FD_splitter_write(H5FD_t *_file, H5FD_mem_t type, hid_t dxpl_id, haddr_t addr, size_t size, const void *buf)
+H5FD__splitter_write(H5FD_t *_file, H5FD_mem_t type, hid_t dxpl_id, haddr_t addr, size_t size,
+ const void *buf)
{
H5FD_splitter_t *file = (H5FD_splitter_t *)_file;
H5P_genplist_t * plist_ptr = NULL;
herr_t ret_value = SUCCEED;
- FUNC_ENTER_NOAPI_NOINIT
+ FUNC_ENTER_STATIC
- H5FD_SPLITTER_LOG_CALL("H5FD_splitter_write");
+ H5FD_SPLITTER_LOG_CALL(FUNC);
- if (NULL == (plist_ptr = (H5P_genplist_t *)H5I_object(dxpl_id))) {
+ if (NULL == (plist_ptr = (H5P_genplist_t *)H5I_object(dxpl_id)))
HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a property list")
- }
/* Write to each file */
/* Public API for dxpl "context" */
- if (H5FDwrite(file->rw_file, type, dxpl_id, addr, size, buf) < 0) {
+ if (H5FDwrite(file->rw_file, type, dxpl_id, addr, size, buf) < 0)
HGOTO_ERROR(H5E_VFL, H5E_WRITEERROR, FAIL, "R/W file write failed")
- }
- if (H5FDwrite(file->wo_file, type, dxpl_id, addr, size, buf) < 0) {
- H5FD_SPLITTER_WO_ERROR(file, "H5FD_splitter_write", H5E_VFL, H5E_WRITEERROR, FAIL,
- "unable to write W/O file")
- }
+ if (H5FDwrite(file->wo_file, type, dxpl_id, addr, size, buf) < 0)
+ H5FD_SPLITTER_WO_ERROR(file, FUNC, H5E_VFL, H5E_WRITEERROR, FAIL, "unable to write W/O file")
done:
FUNC_LEAVE_NOAPI(ret_value)
-} /* end H5FD_splitter_write() */
+} /* end H5FD__splitter_write() */
/*-------------------------------------------------------------------------
- * Function: H5FD_splitter_fapl_get
+ * Function: H5FD__splitter_fapl_get
*
* Purpose: Returns a file access property list which indicates how the
* specified file is being accessed. The return list could be
@@ -576,22 +547,22 @@ done:
*-------------------------------------------------------------------------
*/
static void *
-H5FD_splitter_fapl_get(H5FD_t *_file)
+H5FD__splitter_fapl_get(H5FD_t *_file)
{
H5FD_splitter_t *file = (H5FD_splitter_t *)_file;
void * ret_value = NULL;
- FUNC_ENTER_NOAPI_NOINIT_NOERR
+ FUNC_ENTER_STATIC_NOERR
- H5FD_SPLITTER_LOG_CALL("H5FD_splitter_fapl_get");
+ H5FD_SPLITTER_LOG_CALL(FUNC);
- ret_value = H5FD_splitter_fapl_copy(&(file->fa));
+ ret_value = H5FD__splitter_fapl_copy(&(file->fa));
FUNC_LEAVE_NOAPI(ret_value)
-}
+} /* end H5FD__splitter_fapl_get() */
/*-------------------------------------------------------------------------
- * Function: H5FD_splitter_fapl_copy
+ * Function: H5FD__splitter_fapl_copy
*
* Purpose: Copies the file access properties.
*
@@ -600,55 +571,44 @@ H5FD_splitter_fapl_get(H5FD_t *_file)
*-------------------------------------------------------------------------
*/
static void *
-H5FD_splitter_fapl_copy(const void *_old_fa)
+H5FD__splitter_fapl_copy(const void *_old_fa)
{
const H5FD_splitter_fapl_t *old_fa_ptr = (const H5FD_splitter_fapl_t *)_old_fa;
H5FD_splitter_fapl_t * new_fa_ptr = NULL;
void * ret_value = NULL;
- FUNC_ENTER_NOAPI_NOINIT
+ FUNC_ENTER_STATIC
- H5FD_SPLITTER_LOG_CALL("H5FD_splitter_fapl_copy");
+ H5FD_SPLITTER_LOG_CALL(FUNC);
HDassert(old_fa_ptr);
- new_fa_ptr = (H5FD_splitter_fapl_t *)H5MM_calloc(sizeof(H5FD_splitter_fapl_t));
- if (NULL == new_fa_ptr) {
+ new_fa_ptr = H5FL_CALLOC(H5FD_splitter_fapl_t);
+ if (NULL == new_fa_ptr)
HGOTO_ERROR(H5E_VFL, H5E_CANTALLOC, NULL, "unable to allocate log file FAPL")
- }
- if (HDmemcpy(new_fa_ptr, old_fa_ptr, sizeof(H5FD_splitter_fapl_t)) == NULL) {
- HGOTO_ERROR(H5E_ARGS, H5E_CANTCOPY, NULL, "unable to shallow-copy info")
- }
- if (HDstrncpy(new_fa_ptr->wo_path, old_fa_ptr->wo_path, H5FD_SPLITTER_PATH_MAX) == NULL) {
- HGOTO_ERROR(H5E_ARGS, H5E_CANTCOPY, NULL, "unable to copy write-only channel file path")
- }
- if (HDstrncpy(new_fa_ptr->log_file_path, old_fa_ptr->log_file_path, H5FD_SPLITTER_PATH_MAX) == NULL) {
- HGOTO_ERROR(H5E_ARGS, H5E_CANTCOPY, NULL, "unable to copy log file path")
- }
+ H5MM_memcpy(new_fa_ptr, old_fa_ptr, sizeof(H5FD_splitter_fapl_t));
+ HDstrncpy(new_fa_ptr->wo_path, old_fa_ptr->wo_path, H5FD_SPLITTER_PATH_MAX);
+ HDstrncpy(new_fa_ptr->log_file_path, old_fa_ptr->log_file_path, H5FD_SPLITTER_PATH_MAX);
/* Copy R/W and W/O FAPLs */
- if (H5FD__copy_plist(old_fa_ptr->rw_fapl_id, &(new_fa_ptr->rw_fapl_id)) < 0) {
+ if (H5FD__copy_plist(old_fa_ptr->rw_fapl_id, &(new_fa_ptr->rw_fapl_id)) < 0)
HGOTO_ERROR(H5E_VFL, H5E_BADVALUE, NULL, "can't copy R/W FAPL");
- }
- if (H5FD__copy_plist(old_fa_ptr->wo_fapl_id, &(new_fa_ptr->wo_fapl_id)) < 0) {
+ if (H5FD__copy_plist(old_fa_ptr->wo_fapl_id, &(new_fa_ptr->wo_fapl_id)) < 0)
HGOTO_ERROR(H5E_VFL, H5E_BADVALUE, NULL, "can't copy W/O FAPL");
- }
ret_value = (void *)new_fa_ptr;
done:
- if (NULL == ret_value) {
- if (new_fa_ptr) {
- H5MM_free(new_fa_ptr);
- }
- }
+ if (NULL == ret_value)
+ if (new_fa_ptr)
+ new_fa_ptr = H5FL_FREE(H5FD_splitter_fapl_t, new_fa_ptr);
FUNC_LEAVE_NOAPI(ret_value)
-} /* end H5FD_splitter_fapl_copy() */
+} /* end H5FD__splitter_fapl_copy() */
/*--------------------------------------------------------------------------
- * Function: H5FD_splitter_fapl_free
+ * Function: H5FD__splitter_fapl_free
*
* Purpose: Releases the file access lists
*
@@ -656,34 +616,32 @@ done:
*--------------------------------------------------------------------------
*/
static herr_t
-H5FD_splitter_fapl_free(void *_fapl)
+H5FD__splitter_fapl_free(void *_fapl)
{
H5FD_splitter_fapl_t *fapl = (H5FD_splitter_fapl_t *)_fapl;
herr_t ret_value = SUCCEED;
- FUNC_ENTER_NOAPI_NOINIT
+ FUNC_ENTER_STATIC
- H5FD_SPLITTER_LOG_CALL("H5FD_splitter_fapl_free");
+ H5FD_SPLITTER_LOG_CALL(FUNC);
/* Check arguments */
HDassert(fapl);
- if (H5I_dec_ref(fapl->rw_fapl_id) < 0) {
+ if (H5I_dec_ref(fapl->rw_fapl_id) < 0)
HGOTO_ERROR(H5E_VFL, H5E_CANTDEC, FAIL, "can't close R/W FAPL ID")
- }
- if (H5I_dec_ref(fapl->wo_fapl_id) < 0) {
+ if (H5I_dec_ref(fapl->wo_fapl_id) < 0)
HGOTO_ERROR(H5E_VFL, H5E_CANTDEC, FAIL, "can't close W/O FAPL ID")
- }
/* Free the property list */
- H5MM_free(fapl);
+ fapl = H5FL_FREE(H5FD_splitter_fapl_t, fapl);
done:
FUNC_LEAVE_NOAPI(ret_value)
-} /* end H5FD_splitter_fapl_free() */
+} /* end H5FD__splitter_fapl_free() */
/*-------------------------------------------------------------------------
- * Function: H5FD_splitter_open
+ * Function: H5FD__splitter_open
*
* Purpose: Create and/or opens a file as an HDF5 file.
*
@@ -694,65 +652,52 @@ done:
*-------------------------------------------------------------------------
*/
static H5FD_t *
-H5FD_splitter_open(const char *name, unsigned flags, hid_t splitter_fapl_id, haddr_t maxaddr)
+H5FD__splitter_open(const char *name, unsigned flags, hid_t splitter_fapl_id, haddr_t maxaddr)
{
H5FD_splitter_t * file_ptr = NULL; /* Splitter VFD info */
const H5FD_splitter_fapl_t *fapl_ptr = NULL; /* Driver-specific property list */
H5P_genplist_t * plist_ptr = NULL;
H5FD_t * ret_value = NULL;
- FUNC_ENTER_NOAPI_NOINIT
+ FUNC_ENTER_STATIC
- H5FD_SPLITTER_LOG_CALL("H5FD_splitter_open");
+ H5FD_SPLITTER_LOG_CALL(FUNC);
/* Check arguments */
- if (!name || !*name) {
+ if (!name || !*name)
HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, NULL, "invalid file name")
- }
- if (0 == maxaddr || HADDR_UNDEF == maxaddr) {
+ if (0 == maxaddr || HADDR_UNDEF == maxaddr)
HGOTO_ERROR(H5E_ARGS, H5E_BADRANGE, NULL, "bogus maxaddr")
- }
- if (ADDR_OVERFLOW(maxaddr)) {
+ if (ADDR_OVERFLOW(maxaddr))
HGOTO_ERROR(H5E_ARGS, H5E_OVERFLOW, NULL, "bogus maxaddr")
- }
- if ((H5P_FILE_ACCESS_DEFAULT == splitter_fapl_id) || (H5FD_SPLITTER != H5Pget_driver(splitter_fapl_id))) {
+ if ((H5P_FILE_ACCESS_DEFAULT == splitter_fapl_id) || (H5FD_SPLITTER != H5Pget_driver(splitter_fapl_id)))
/* presupposes that H5P_FILE_ACCESS_DEFAULT is not a splitter */
HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, NULL, "driver is not splitter")
- }
file_ptr = (H5FD_splitter_t *)H5FL_CALLOC(H5FD_splitter_t);
- if (NULL == file_ptr) {
- HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "unable to allocate file struct")
- }
+ if (NULL == file_ptr)
+ HGOTO_ERROR(H5E_VFL, H5E_CANTALLOC, NULL, "unable to allocate file struct")
file_ptr->fa.rw_fapl_id = H5I_INVALID_HID;
file_ptr->fa.wo_fapl_id = H5I_INVALID_HID;
/* Get the driver-specific file access properties */
plist_ptr = (H5P_genplist_t *)H5I_object(splitter_fapl_id);
- if (NULL == plist_ptr) {
+ if (NULL == plist_ptr)
HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, NULL, "not a file access property list")
- }
fapl_ptr = (const H5FD_splitter_fapl_t *)H5P_peek_driver_info(plist_ptr);
- if (NULL == fapl_ptr) {
+ if (NULL == fapl_ptr)
HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, NULL, "unable to get VFL driver info")
- }
/* Copy simpler info */
- if (HDstrncpy(file_ptr->fa.wo_path, fapl_ptr->wo_path, H5FD_SPLITTER_PATH_MAX) == NULL) {
- HGOTO_ERROR(H5E_VFL, H5E_CANTCOPY, NULL, "unable to copy write-only path")
- }
- if (HDstrncpy(file_ptr->fa.log_file_path, fapl_ptr->log_file_path, H5FD_SPLITTER_PATH_MAX) == NULL) {
- HGOTO_ERROR(H5E_VFL, H5E_CANTCOPY, NULL, "unable to copy logfile path")
- }
+ HDstrncpy(file_ptr->fa.wo_path, fapl_ptr->wo_path, H5FD_SPLITTER_PATH_MAX);
+ HDstrncpy(file_ptr->fa.log_file_path, fapl_ptr->log_file_path, H5FD_SPLITTER_PATH_MAX);
file_ptr->fa.ignore_wo_errs = fapl_ptr->ignore_wo_errs;
/* Copy R/W and W/O channel FAPLs. */
- if (H5FD__copy_plist(fapl_ptr->rw_fapl_id, &(file_ptr->fa.rw_fapl_id)) < 0) {
+ if (H5FD__copy_plist(fapl_ptr->rw_fapl_id, &(file_ptr->fa.rw_fapl_id)) < 0)
HGOTO_ERROR(H5E_VFL, H5E_BADVALUE, NULL, "can't copy R/W FAPL");
- }
- if (H5FD__copy_plist(fapl_ptr->wo_fapl_id, &(file_ptr->fa.wo_fapl_id)) < 0) {
+ if (H5FD__copy_plist(fapl_ptr->wo_fapl_id, &(file_ptr->fa.wo_fapl_id)) < 0)
HGOTO_ERROR(H5E_VFL, H5E_BADVALUE, NULL, "can't copy W/O FAPL");
- }
/* Prepare log file if necessary.
* If application wants to ignore the errors from W/O channel and
@@ -761,52 +706,43 @@ H5FD_splitter_open(const char *name, unsigned flags, hid_t splitter_fapl_id, had
if (!file_ptr->logfp) {
if (file_ptr->fa.log_file_path[0] != '\0') {
file_ptr->logfp = HDfopen(file_ptr->fa.log_file_path, "w");
- if (file_ptr->logfp == NULL) {
+ if (file_ptr->logfp == NULL)
HGOTO_ERROR(H5E_VFL, H5E_CANTOPENFILE, NULL, "unable to open log file")
- }
} /* end if logfile path given */
} /* end if logfile pointer/handle does not exist */
file_ptr->rw_file = H5FD_open(name, flags, fapl_ptr->rw_fapl_id, HADDR_UNDEF);
- if (!file_ptr->rw_file) {
+ if (!file_ptr->rw_file)
HGOTO_ERROR(H5E_VFL, H5E_CANTOPENFILE, NULL, "unable to open R/W file")
- }
file_ptr->wo_file = H5FD_open(fapl_ptr->wo_path, flags, fapl_ptr->wo_fapl_id, HADDR_UNDEF);
- if (!file_ptr->wo_file) {
- H5FD_SPLITTER_WO_ERROR(file_ptr, "H5FD_splitter_open", H5E_VFL, H5E_CANTOPENFILE, NULL,
- "unable to open W/O file")
- }
+ if (!file_ptr->wo_file)
+ H5FD_SPLITTER_WO_ERROR(file_ptr, FUNC, H5E_VFL, H5E_CANTOPENFILE, NULL, "unable to open W/O file")
ret_value = (H5FD_t *)file_ptr;
done:
if (NULL == ret_value) {
if (file_ptr) {
- if (H5I_INVALID_HID != file_ptr->fa.rw_fapl_id) {
+ if (H5I_INVALID_HID != file_ptr->fa.rw_fapl_id)
H5I_dec_ref(file_ptr->fa.rw_fapl_id);
- }
- if (H5I_INVALID_HID != file_ptr->fa.wo_fapl_id) {
+ if (H5I_INVALID_HID != file_ptr->fa.wo_fapl_id)
H5I_dec_ref(file_ptr->fa.wo_fapl_id);
- }
- if (file_ptr->rw_file) {
+ if (file_ptr->rw_file)
H5FD_close(file_ptr->rw_file);
- }
- if (file_ptr->wo_file) {
+ if (file_ptr->wo_file)
H5FD_close(file_ptr->wo_file);
- }
- if (file_ptr->logfp) {
+ if (file_ptr->logfp)
HDfclose(file_ptr->logfp);
- }
H5FL_FREE(H5FD_splitter_t, file_ptr);
}
} /* end if error */
FUNC_LEAVE_NOAPI(ret_value)
-} /* end H5FD_splitter_open() */
+} /* end H5FD__splitter_open() */
/*-------------------------------------------------------------------------
- * Function: H5FD_splitter_close
+ * Function: H5FD__splitter_close
*
* Purpose: Closes files on both read-write and write-only channels.
*
@@ -815,36 +751,29 @@ done:
*-------------------------------------------------------------------------
*/
static herr_t
-H5FD_splitter_close(H5FD_t *_file)
+H5FD__splitter_close(H5FD_t *_file)
{
H5FD_splitter_t *file = (H5FD_splitter_t *)_file;
herr_t ret_value = SUCCEED;
- FUNC_ENTER_NOAPI_NOINIT
+ FUNC_ENTER_STATIC
- H5FD_SPLITTER_LOG_CALL("H5FD_splitter_close");
+ H5FD_SPLITTER_LOG_CALL(FUNC);
/* Sanity check */
HDassert(file);
- if (H5I_dec_ref(file->fa.rw_fapl_id) < 0) {
+ if (H5I_dec_ref(file->fa.rw_fapl_id) < 0)
HGOTO_ERROR(H5E_VFL, H5E_ARGS, FAIL, "can't close R/W FAPL")
- }
- if (H5I_dec_ref(file->fa.wo_fapl_id) < 0) {
+ if (H5I_dec_ref(file->fa.wo_fapl_id) < 0)
HGOTO_ERROR(H5E_VFL, H5E_ARGS, FAIL, "can't close W/O FAPL")
- }
- if (file->rw_file) {
- if (H5FD_close(file->rw_file) == FAIL) {
+ if (file->rw_file)
+ if (H5FD_close(file->rw_file) == FAIL)
HGOTO_ERROR(H5E_VFL, H5E_CANTCLOSEFILE, FAIL, "unable to close R/W file")
- }
- }
- if (file->wo_file) {
- if (H5FD_close(file->wo_file) == FAIL) {
- H5FD_SPLITTER_WO_ERROR(file, "H5FD_splitter_close", H5E_VFL, H5E_CANTCLOSEFILE, FAIL,
- "unable to close W/O file")
- }
- }
+ if (file->wo_file)
+ if (H5FD_close(file->wo_file) == FAIL)
+ H5FD_SPLITTER_WO_ERROR(file, FUNC, H5E_VFL, H5E_CANTCLOSEFILE, FAIL, "unable to close W/O file")
if (file->logfp) {
HDfclose(file->logfp);
@@ -857,10 +786,10 @@ H5FD_splitter_close(H5FD_t *_file)
done:
FUNC_LEAVE_NOAPI(ret_value)
-} /* end H5FD_splitter_close() */
+} /* end H5FD__splitter_close() */
/*-------------------------------------------------------------------------
- * Function: H5FD_splitter_get_eoa
+ * Function: H5FD__splitter_get_eoa
*
* Purpose: Returns the end-of-address marker for the file. The EOA
* marker is the first address past the last byte allocated in
@@ -872,29 +801,28 @@ done:
*-------------------------------------------------------------------------
*/
static haddr_t
-H5FD_splitter_get_eoa(const H5FD_t *_file, H5FD_mem_t H5_ATTR_UNUSED type)
+H5FD__splitter_get_eoa(const H5FD_t *_file, H5FD_mem_t H5_ATTR_UNUSED type)
{
const H5FD_splitter_t *file = (const H5FD_splitter_t *)_file;
haddr_t ret_value = HADDR_UNDEF;
- FUNC_ENTER_NOAPI_NOINIT
+ FUNC_ENTER_STATIC
- H5FD_SPLITTER_LOG_CALL("H5FD_splitter_get_eoa");
+ H5FD_SPLITTER_LOG_CALL(FUNC);
/* Sanity check */
HDassert(file);
HDassert(file->rw_file);
- if ((ret_value = H5FD_get_eoa(file->rw_file, type)) == HADDR_UNDEF) {
+ if ((ret_value = H5FD_get_eoa(file->rw_file, type)) == HADDR_UNDEF)
HGOTO_ERROR(H5E_VFL, H5E_BADVALUE, HADDR_UNDEF, "unable to get eoa")
- }
done:
FUNC_LEAVE_NOAPI(ret_value)
-} /* end H5FD_splitter_get_eoa */
+} /* end H5FD__splitter_get_eoa */
/*-------------------------------------------------------------------------
- * Function: H5FD_splitter_set_eoa
+ * Function: H5FD__splitter_set_eoa
*
* Purpose: Set the end-of-address marker for the file. This function is
* called shortly after an existing HDF5 file is opened in order
@@ -904,35 +832,32 @@ done:
*-------------------------------------------------------------------------
*/
static herr_t
-H5FD_splitter_set_eoa(H5FD_t *_file, H5FD_mem_t H5_ATTR_UNUSED type, haddr_t addr)
+H5FD__splitter_set_eoa(H5FD_t *_file, H5FD_mem_t H5_ATTR_UNUSED type, haddr_t addr)
{
H5FD_splitter_t *file = (H5FD_splitter_t *)_file;
herr_t ret_value = SUCCEED; /* Return value */
- FUNC_ENTER_NOAPI_NOINIT
+ FUNC_ENTER_STATIC
- H5FD_SPLITTER_LOG_CALL("H5FD_splitter_set_eoa";)
+ H5FD_SPLITTER_LOG_CALL(FUNC)
/* Sanity check */
HDassert(file);
HDassert(file->rw_file);
HDassert(file->wo_file);
- if (H5FD_set_eoa(file->rw_file, type, addr) < 0) {
+ if (H5FD_set_eoa(file->rw_file, type, addr) < 0)
HGOTO_ERROR(H5E_VFL, H5E_CANTSET, FAIL, "H5FDset_eoa failed for R/W file")
- }
- if (H5FD_set_eoa(file->wo_file, type, addr) < 0) {
- H5FD_SPLITTER_WO_ERROR(file, "H5FD_splitter_set_eoa", H5E_VFL, H5E_CANTSET, FAIL,
- "unable to set EOA for W/O file")
- }
+ if (H5FD_set_eoa(file->wo_file, type, addr) < 0)
+ H5FD_SPLITTER_WO_ERROR(file, FUNC, H5E_VFL, H5E_CANTSET, FAIL, "unable to set EOA for W/O file")
done:
FUNC_LEAVE_NOAPI(ret_value)
-} /* end H5FD_splitter_set_eoa() */
+} /* end H5FD__splitter_set_eoa() */
/*-------------------------------------------------------------------------
- * Function: H5FD_splitter_get_eof
+ * Function: H5FD__splitter_get_eof
*
* Purpose: Returns the end-of-address marker for the file. The EOA
* marker is the first address past the last byte allocated in
@@ -944,29 +869,28 @@ done:
*-------------------------------------------------------------------------
*/
static haddr_t
-H5FD_splitter_get_eof(const H5FD_t *_file, H5FD_mem_t H5_ATTR_UNUSED type)
+H5FD__splitter_get_eof(const H5FD_t *_file, H5FD_mem_t H5_ATTR_UNUSED type)
{
const H5FD_splitter_t *file = (const H5FD_splitter_t *)_file;
haddr_t ret_value = HADDR_UNDEF; /* Return value */
- FUNC_ENTER_NOAPI_NOINIT
+ FUNC_ENTER_STATIC
- H5FD_SPLITTER_LOG_CALL("H5FD_splitter_get_eof");
+ H5FD_SPLITTER_LOG_CALL(FUNC);
/* Sanity check */
HDassert(file);
HDassert(file->rw_file);
- if (HADDR_UNDEF == (ret_value = H5FD_get_eof(file->rw_file, type))) {
+ if (HADDR_UNDEF == (ret_value = H5FD_get_eof(file->rw_file, type)))
HGOTO_ERROR(H5E_VFL, H5E_CANTGET, HADDR_UNDEF, "unable to get eof")
- }
done:
FUNC_LEAVE_NOAPI(ret_value)
-} /* end H5FD_splitter_get_eof */
+} /* end H5FD__splitter_get_eof */
/*-------------------------------------------------------------------------
- * Function: H5FD_splitter_truncate
+ * Function: H5FD__splitter_truncate
*
* Purpose: Notify driver to truncate the file back to the allocated size.
*
@@ -974,34 +898,31 @@ done:
*-------------------------------------------------------------------------
*/
static herr_t
-H5FD_splitter_truncate(H5FD_t *_file, hid_t dxpl_id, hbool_t closing)
+H5FD__splitter_truncate(H5FD_t *_file, hid_t dxpl_id, hbool_t closing)
{
H5FD_splitter_t *file = (H5FD_splitter_t *)_file;
herr_t ret_value = SUCCEED; /* Return value */
- FUNC_ENTER_NOAPI_NOINIT
+ FUNC_ENTER_STATIC
- H5FD_SPLITTER_LOG_CALL("H5FD_splitter_truncate");
+ H5FD_SPLITTER_LOG_CALL(FUNC);
HDassert(file);
HDassert(file->rw_file);
HDassert(file->wo_file);
- if (H5FDtruncate(file->rw_file, dxpl_id, closing) < 0) {
+ if (H5FDtruncate(file->rw_file, dxpl_id, closing) < 0)
HGOTO_ERROR(H5E_VFL, H5E_CANTUPDATE, FAIL, "unable to truncate R/W file")
- }
- if (H5FDtruncate(file->wo_file, dxpl_id, closing) < 0) {
- H5FD_SPLITTER_WO_ERROR(file, "H5FD_splitter_truncate", H5E_VFL, H5E_CANTUPDATE, FAIL,
- "unable to truncate W/O file")
- }
+ if (H5FDtruncate(file->wo_file, dxpl_id, closing) < 0)
+ H5FD_SPLITTER_WO_ERROR(file, FUNC, H5E_VFL, H5E_CANTUPDATE, FAIL, "unable to truncate W/O file")
done:
FUNC_LEAVE_NOAPI(ret_value)
-} /* end H5FD_splitter_truncate */
+} /* end H5FD__splitter_truncate */
/*-------------------------------------------------------------------------
- * Function: H5FD_splitter_sb_size
+ * Function: H5FD__splitter_sb_size
*
* Purpose: Obtains the number of bytes required to store the driver file
* access data in the HDF5 superblock.
@@ -1015,28 +936,27 @@ done:
*-------------------------------------------------------------------------
*/
static hsize_t
-H5FD_splitter_sb_size(H5FD_t *_file)
+H5FD__splitter_sb_size(H5FD_t *_file)
{
H5FD_splitter_t *file = (H5FD_splitter_t *)_file;
hsize_t ret_value = 0;
- FUNC_ENTER_NOAPI_NOINIT_NOERR
+ FUNC_ENTER_STATIC_NOERR
- H5FD_SPLITTER_LOG_CALL("H5FD_splitter_sb_size");
+ H5FD_SPLITTER_LOG_CALL(FUNC);
/* Sanity check */
HDassert(file);
HDassert(file->rw_file);
- if (file->rw_file) {
+ if (file->rw_file)
ret_value = H5FD_sb_size(file->rw_file);
- }
FUNC_LEAVE_NOAPI(ret_value)
-} /* end H5FD_splitter_sb_size */
+} /* end H5FD__splitter_sb_size */
/*-------------------------------------------------------------------------
- * Function: H5FD_splitter_sb_encode
+ * Function: H5FD__splitter_sb_encode
*
* Purpose: Encode driver-specific data into the output arguments.
*
@@ -1044,29 +964,28 @@ H5FD_splitter_sb_size(H5FD_t *_file)
*-------------------------------------------------------------------------
*/
static herr_t
-H5FD_splitter_sb_encode(H5FD_t *_file, char *name /*out*/, unsigned char *buf /*out*/)
+H5FD__splitter_sb_encode(H5FD_t *_file, char *name /*out*/, unsigned char *buf /*out*/)
{
H5FD_splitter_t *file = (H5FD_splitter_t *)_file;
herr_t ret_value = SUCCEED; /* Return value */
- FUNC_ENTER_NOAPI_NOINIT
+ FUNC_ENTER_STATIC
- H5FD_SPLITTER_LOG_CALL("H5FD_splitter_sb_encode");
+ H5FD_SPLITTER_LOG_CALL(FUNC);
/* Sanity check */
HDassert(file);
HDassert(file->rw_file);
- if (file->rw_file && H5FD_sb_encode(file->rw_file, name, buf) < 0) {
+ if (file->rw_file && H5FD_sb_encode(file->rw_file, name, buf) < 0)
HGOTO_ERROR(H5E_VFL, H5E_CANTENCODE, FAIL, "unable to encode the superblock in R/W file")
- }
done:
FUNC_LEAVE_NOAPI(ret_value)
-} /* end H5FD_splitter_sb_encode */
+} /* end H5FD__splitter_sb_encode */
/*-------------------------------------------------------------------------
- * Function: H5FD_splitter_sb_decode
+ * Function: H5FD__splitter_sb_decode
*
* Purpose: Decodes the driver information block.
*
@@ -1076,29 +995,28 @@ done:
*-------------------------------------------------------------------------
*/
static herr_t
-H5FD_splitter_sb_decode(H5FD_t *_file, const char *name, const unsigned char *buf)
+H5FD__splitter_sb_decode(H5FD_t *_file, const char *name, const unsigned char *buf)
{
H5FD_splitter_t *file = (H5FD_splitter_t *)_file;
herr_t ret_value = SUCCEED; /* Return value */
- FUNC_ENTER_NOAPI_NOINIT
+ FUNC_ENTER_STATIC
- H5FD_SPLITTER_LOG_CALL("H5FD_splitter_sb_decode");
+ H5FD_SPLITTER_LOG_CALL(FUNC);
/* Sanity check */
HDassert(file);
HDassert(file->rw_file);
- if (H5FD_sb_load(file->rw_file, name, buf) < 0) {
+ if (H5FD_sb_load(file->rw_file, name, buf) < 0)
HGOTO_ERROR(H5E_VFL, H5E_CANTDECODE, FAIL, "unable to decode the superblock in R/W file")
- }
done:
FUNC_LEAVE_NOAPI(ret_value)
-} /* end H5FD_splitter_sb_decode */
+} /* end H5FD__splitter_sb_decode */
/*-------------------------------------------------------------------------
- * Function: H5FD_splitter_cmp
+ * Function: H5FD__splitter_cmp
*
* Purpose: Compare the keys of two files.
*
@@ -1107,15 +1025,15 @@ done:
*-------------------------------------------------------------------------
*/
static int
-H5FD_splitter_cmp(const H5FD_t *_f1, const H5FD_t *_f2)
+H5FD__splitter_cmp(const H5FD_t *_f1, const H5FD_t *_f2)
{
const H5FD_splitter_t *f1 = (const H5FD_splitter_t *)_f1;
const H5FD_splitter_t *f2 = (const H5FD_splitter_t *)_f2;
herr_t ret_value = 0; /* Return value */
- FUNC_ENTER_NOAPI_NOINIT_NOERR
+ FUNC_ENTER_STATIC_NOERR
- H5FD_SPLITTER_LOG_CALL("H5FD_splitter_cmp");
+ H5FD_SPLITTER_LOG_CALL(FUNC);
HDassert(f1);
HDassert(f2);
@@ -1123,10 +1041,10 @@ H5FD_splitter_cmp(const H5FD_t *_f1, const H5FD_t *_f2)
ret_value = H5FD_cmp(f1->rw_file, f2->rw_file);
FUNC_LEAVE_NOAPI(ret_value)
-} /* end H5FD_splitter_cmp */
+} /* end H5FD__splitter_cmp */
/*--------------------------------------------------------------------------
- * Function: H5FD_splitter_get_handle
+ * Function: H5FD__splitter_get_handle
*
* Purpose: Returns a pointer to the file handle of low-level virtual
* file driver.
@@ -1135,14 +1053,14 @@ H5FD_splitter_cmp(const H5FD_t *_f1, const H5FD_t *_f2)
*--------------------------------------------------------------------------
*/
static herr_t
-H5FD_splitter_get_handle(H5FD_t *_file, hid_t H5_ATTR_UNUSED fapl, void **file_handle)
+H5FD__splitter_get_handle(H5FD_t *_file, hid_t H5_ATTR_UNUSED fapl, void **file_handle)
{
H5FD_splitter_t *file = (H5FD_splitter_t *)_file;
herr_t ret_value = SUCCEED; /* Return value */
- FUNC_ENTER_NOAPI_NOINIT
+ FUNC_ENTER_STATIC
- H5FD_SPLITTER_LOG_CALL("H5FD_splitter_get_handle");
+ H5FD_SPLITTER_LOG_CALL(FUNC);
/* Check arguments */
HDassert(file);
@@ -1150,16 +1068,15 @@ H5FD_splitter_get_handle(H5FD_t *_file, hid_t H5_ATTR_UNUSED fapl, void **file_h
HDassert(file_handle);
/* Only do for R/W channel */
- if (H5FD_get_vfd_handle(file->rw_file, file->fa.rw_fapl_id, file_handle) < 0) {
+ if (H5FD_get_vfd_handle(file->rw_file, file->fa.rw_fapl_id, file_handle) < 0)
HGOTO_ERROR(H5E_VFL, H5E_CANTGET, FAIL, "unable to get handle of R/W file")
- }
done:
FUNC_LEAVE_NOAPI(ret_value)
-} /* end H5FD_splitter_get_handle */
+} /* end H5FD__splitter_get_handle */
/*--------------------------------------------------------------------------
- * Function: H5FD_splitter_lock
+ * Function: H5FD__splitter_lock
*
* Purpose: Sets a file lock.
*
@@ -1167,35 +1084,32 @@ done:
*--------------------------------------------------------------------------
*/
static herr_t
-H5FD_splitter_lock(H5FD_t *_file, hbool_t rw)
+H5FD__splitter_lock(H5FD_t *_file, hbool_t rw)
{
H5FD_splitter_t *file = (H5FD_splitter_t *)_file; /* VFD file struct */
herr_t ret_value = SUCCEED; /* Return value */
- FUNC_ENTER_NOAPI_NOINIT
+ FUNC_ENTER_STATIC
- H5FD_SPLITTER_LOG_CALL("H5FD_splitter_lock");
+ H5FD_SPLITTER_LOG_CALL(FUNC);
HDassert(file);
HDassert(file->rw_file);
/* Place the lock on each file */
- if (H5FD_lock(file->rw_file, rw) < 0) {
- HGOTO_ERROR(H5E_VFL, H5E_CANTLOCK, FAIL, "unable to lock R/W file")
- }
- if (file->wo_file != NULL) {
- if (H5FD_lock(file->wo_file, rw) < 0) {
- H5FD_SPLITTER_WO_ERROR(file, "H5FD_splitter_lock", H5E_VFL, H5E_CANTLOCK, FAIL,
- "unable to lock W/O file")
- }
- }
+ if (H5FD_lock(file->rw_file, rw) < 0)
+ HGOTO_ERROR(H5E_VFL, H5E_CANTLOCKFILE, FAIL, "unable to lock R/W file")
+
+ if (file->wo_file != NULL)
+ if (H5FD_lock(file->wo_file, rw) < 0)
+ H5FD_SPLITTER_WO_ERROR(file, FUNC, H5E_VFL, H5E_CANTLOCKFILE, FAIL, "unable to lock W/O file")
done:
FUNC_LEAVE_NOAPI(ret_value)
-} /* end H5FD_splitter_lock */
+} /* end H5FD__splitter_lock */
/*--------------------------------------------------------------------------
- * Function: H5FD_splitter_unlock
+ * Function: H5FD__splitter_unlock
*
* Purpose: Removes a file lock.
*
@@ -1203,35 +1117,33 @@ done:
*--------------------------------------------------------------------------
*/
static herr_t
-H5FD_splitter_unlock(H5FD_t *_file)
+H5FD__splitter_unlock(H5FD_t *_file)
{
H5FD_splitter_t *file = (H5FD_splitter_t *)_file; /* VFD file struct */
herr_t ret_value = SUCCEED; /* Return value */
- FUNC_ENTER_NOAPI_NOINIT
+ FUNC_ENTER_STATIC
- H5FD_SPLITTER_LOG_CALL("H5FD_splitter_unlock");
+ H5FD_SPLITTER_LOG_CALL(FUNC);
/* Check arguments */
HDassert(file);
HDassert(file->rw_file);
/* Remove the lock on each file */
- if (H5FD_unlock(file->rw_file) < 0) {
- HGOTO_ERROR(H5E_VFL, H5E_CANTUNLOCK, FAIL, "unable to unlock R/W file")
- }
- if (file->wo_file != NULL) {
- if (H5FD_unlock(file->wo_file) < 0) {
- HGOTO_ERROR(H5E_VFL, H5E_CANTUNLOCK, FAIL, "unable to unlock W/O file")
- }
- }
+ if (H5FD_unlock(file->rw_file) < 0)
+ HGOTO_ERROR(H5E_VFL, H5E_CANTUNLOCKFILE, FAIL, "unable to unlock R/W file")
+
+ if (file->wo_file != NULL)
+ if (H5FD_unlock(file->wo_file) < 0)
+ HGOTO_ERROR(H5E_VFL, H5E_CANTUNLOCKFILE, FAIL, "unable to unlock W/O file")
done:
FUNC_LEAVE_NOAPI(ret_value)
-} /* end H5FD_splitter_unlock */
+} /* end H5FD__splitter_unlock */
/*-------------------------------------------------------------------------
- * Function: H5FD_splitter_query
+ * Function: H5FD__splitter_query
*
* Purpose: Set the flags that this VFL driver is capable of supporting.
* (listed in H5FDpublic.h)
@@ -1240,38 +1152,36 @@ done:
*-------------------------------------------------------------------------
*/
static herr_t
-H5FD_splitter_query(const H5FD_t *_file, unsigned long *flags /* out */)
+H5FD__splitter_query(const H5FD_t *_file, unsigned long *flags /* out */)
{
const H5FD_splitter_t *file = (const H5FD_splitter_t *)_file;
herr_t ret_value = SUCCEED;
- FUNC_ENTER_NOAPI_NOINIT
+ FUNC_ENTER_STATIC
- H5FD_SPLITTER_LOG_CALL("H5FD_splitter_query");
+ H5FD_SPLITTER_LOG_CALL(FUNC);
if (file) {
HDassert(file);
HDassert(file->rw_file);
- if (H5FDquery(file->rw_file, flags) < 0) {
+ if (H5FDquery(file->rw_file, flags) < 0)
HGOTO_ERROR(H5E_VFL, H5E_CANTLOCK, FAIL, "unable to query R/W file");
- }
}
else {
/* There is no file. Because this is a pure passthrough VFD,
* it has no features of its own.
*/
- if (flags) {
+ if (flags)
*flags = 0;
- }
}
done:
FUNC_LEAVE_NOAPI(ret_value)
-} /* end H5FD_splitter_query() */
+} /* end H5FD__splitter_query() */
/*-------------------------------------------------------------------------
- * Function: H5FD_splitter_alloc
+ * Function: H5FD__splitter_alloc
*
* Purpose: Allocate file memory.
*
@@ -1279,35 +1189,32 @@ done:
*-------------------------------------------------------------------------
*/
static haddr_t
-H5FD_splitter_alloc(H5FD_t *_file, H5FD_mem_t type, hid_t dxpl_id, hsize_t size)
+H5FD__splitter_alloc(H5FD_t *_file, H5FD_mem_t type, hid_t dxpl_id, hsize_t size)
{
H5FD_splitter_t *file = (H5FD_splitter_t *)_file; /* VFD file struct */
haddr_t ret_value = HADDR_UNDEF; /* Return value */
- FUNC_ENTER_NOAPI_NOINIT
+ FUNC_ENTER_STATIC
- H5FD_SPLITTER_LOG_CALL("H5FD_splitter_alloc");
+ H5FD_SPLITTER_LOG_CALL(FUNC);
/* Check arguments */
HDassert(file);
HDassert(file->rw_file);
/* Allocate memory for each file, only return the return value for R/W file. */
- if ((ret_value = H5FDalloc(file->rw_file, type, dxpl_id, size)) == HADDR_UNDEF) {
+ if ((ret_value = H5FDalloc(file->rw_file, type, dxpl_id, size)) == HADDR_UNDEF)
HGOTO_ERROR(H5E_VFL, H5E_CANTINIT, HADDR_UNDEF, "unable to allocate for R/W file")
- }
- if (H5FDalloc(file->wo_file, type, dxpl_id, size) == HADDR_UNDEF) {
- H5FD_SPLITTER_WO_ERROR(file, "H5FD_splitter_alloc", H5E_VFL, H5E_CANTINIT, HADDR_UNDEF,
- "unable to alloc for W/O file")
- }
+ if (H5FDalloc(file->wo_file, type, dxpl_id, size) == HADDR_UNDEF)
+ H5FD_SPLITTER_WO_ERROR(file, FUNC, H5E_VFL, H5E_CANTINIT, HADDR_UNDEF, "unable to alloc for W/O file")
done:
FUNC_LEAVE_NOAPI(ret_value)
-} /* end H5FD_splitter_alloc() */
+} /* end H5FD__splitter_alloc() */
/*-------------------------------------------------------------------------
- * Function: H5FD_splitter_get_type_map
+ * Function: H5FD__splitter_get_type_map
*
* Purpose: Retrieve the memory type mapping for this file
*
@@ -1315,30 +1222,29 @@ done:
*-------------------------------------------------------------------------
*/
static herr_t
-H5FD_splitter_get_type_map(const H5FD_t *_file, H5FD_mem_t *type_map)
+H5FD__splitter_get_type_map(const H5FD_t *_file, H5FD_mem_t *type_map)
{
const H5FD_splitter_t *file = (const H5FD_splitter_t *)_file;
herr_t ret_value = SUCCEED;
- FUNC_ENTER_NOAPI_NOINIT
+ FUNC_ENTER_STATIC
- H5FD_SPLITTER_LOG_CALL("H5FD_splitter_get_type_map");
+ H5FD_SPLITTER_LOG_CALL(FUNC);
/* Check arguments */
HDassert(file);
HDassert(file->rw_file);
/* Retrieve memory type mapping for R/W channel only */
- if (H5FD_get_fs_type_map(file->rw_file, type_map) < 0) {
+ if (H5FD_get_fs_type_map(file->rw_file, type_map) < 0)
HGOTO_ERROR(H5E_VFL, H5E_CANTGET, FAIL, "unable to allocate for R/W file")
- }
done:
FUNC_LEAVE_NOAPI(ret_value)
-} /* end H5FD_splitter_get_type_map() */
+} /* end H5FD__splitter_get_type_map() */
/*-------------------------------------------------------------------------
- * Function: H5FD_splitter_free
+ * Function: H5FD__splitter_free
*
* Purpose: Free the resources for the splitter VFD.
*
@@ -1346,31 +1252,28 @@ done:
*-------------------------------------------------------------------------
*/
static herr_t
-H5FD_splitter_free(H5FD_t *_file, H5FD_mem_t type, hid_t dxpl_id, haddr_t addr, hsize_t size)
+H5FD__splitter_free(H5FD_t *_file, H5FD_mem_t type, hid_t dxpl_id, haddr_t addr, hsize_t size)
{
H5FD_splitter_t *file = (H5FD_splitter_t *)_file; /* VFD file struct */
herr_t ret_value = SUCCEED; /* Return value */
- FUNC_ENTER_NOAPI_NOINIT
+ FUNC_ENTER_STATIC
- H5FD_SPLITTER_LOG_CALL("H5FD_splitter_free");
+ H5FD_SPLITTER_LOG_CALL(FUNC);
/* Check arguments */
HDassert(file);
HDassert(file->rw_file);
- if (H5FDfree(file->rw_file, type, dxpl_id, addr, size) < 0) {
+ if (H5FDfree(file->rw_file, type, dxpl_id, addr, size) < 0)
HGOTO_ERROR(H5E_VFL, H5E_CANTFREE, FAIL, "unable to free for R/W file")
- }
- if (H5FDfree(file->wo_file, type, dxpl_id, addr, size) < 0) {
- H5FD_SPLITTER_WO_ERROR(file, "H5FD_splitter_free", H5E_VFL, H5E_CANTINIT, FAIL,
- "unable to free for W/O file")
- }
+ if (H5FDfree(file->wo_file, type, dxpl_id, addr, size) < 0)
+ H5FD_SPLITTER_WO_ERROR(file, FUNC, H5E_VFL, H5E_CANTINIT, FAIL, "unable to free for W/O file")
done:
FUNC_LEAVE_NOAPI(ret_value)
-} /* end H5FD_splitter_free() */
+} /* end H5FD__splitter_free() */
/*-------------------------------------------------------------------------
* Function: H5FD__splitter_log_error
@@ -1383,13 +1286,11 @@ done:
static herr_t
H5FD__splitter_log_error(const H5FD_splitter_t *file, const char *atfunc, const char *msg)
{
- size_t size = 0;
- char * s = NULL;
herr_t ret_value = SUCCEED;
FUNC_ENTER_STATIC_NOERR
- H5FD_SPLITTER_LOG_CALL("H5FD__splitter_log_error");
+ H5FD_SPLITTER_LOG_CALL(FUNC);
/* Check arguments */
HDassert(file);
@@ -1397,18 +1298,18 @@ H5FD__splitter_log_error(const H5FD_splitter_t *file, const char *atfunc, const
HDassert(msg && *msg);
if (file->logfp != NULL) {
- size = strlen(atfunc) + strlen(msg) + 3; /* ':', ' ', '\n' */
- s = (char *)malloc(sizeof(char) * (size + 1));
- if (NULL == s) {
+ size_t size;
+ char * s;
+
+ size = HDstrlen(atfunc) + HDstrlen(msg) + 3; /* ':', ' ', '\n' */
+ s = (char *)H5MM_malloc(sizeof(char) * (size + 1));
+ if (NULL == s)
ret_value = FAIL;
- }
- else if (size < (size_t)HDsnprintf(s, size + 1, "%s: %s\n", atfunc, msg)) {
+ else if (size < (size_t)HDsnprintf(s, size + 1, "%s: %s\n", atfunc, msg))
ret_value = FAIL;
- }
- else if (size != HDfwrite(s, 1, size, file->logfp)) {
+ else if (size != HDfwrite(s, 1, size, file->logfp))
ret_value = FAIL;
- }
- HDfree(s);
+ H5MM_free(s);
}
FUNC_LEAVE_NOAPI(ret_value)
diff --git a/src/H5FDsplitter.h b/src/H5FDsplitter.h
index a201116..ee6e7c5 100644
--- a/src/H5FDsplitter.h
+++ b/src/H5FDsplitter.h
@@ -87,8 +87,20 @@ typedef struct H5FD_splitter_vfd_config_t {
#ifdef __cplusplus
extern "C" {
#endif
-H5_DLL hid_t H5FD_splitter_init(void);
+H5_DLL hid_t H5FD_splitter_init(void);
+
+/**
+ * \ingroup FAPL
+ *
+ * \todo Add missing documentation
+ */
H5_DLL herr_t H5Pset_fapl_splitter(hid_t fapl_id, H5FD_splitter_vfd_config_t *config_ptr);
+
+/**
+ * \ingroup FAPL
+ *
+ * \todo Add missing documentation
+ */
H5_DLL herr_t H5Pget_fapl_splitter(hid_t fapl_id, H5FD_splitter_vfd_config_t *config_ptr);
#ifdef __cplusplus
diff --git a/src/H5FDstdio.c b/src/H5FDstdio.c
index 230f5e1..f9faf53 100644
--- a/src/H5FDstdio.c
+++ b/src/H5FDstdio.c
@@ -180,6 +180,7 @@ static herr_t H5FD_stdio_flush(H5FD_t *_file, hid_t dxpl_id, hbool_t closing);
static herr_t H5FD_stdio_truncate(H5FD_t *_file, hid_t dxpl_id, hbool_t closing);
static herr_t H5FD_stdio_lock(H5FD_t *_file, hbool_t rw);
static herr_t H5FD_stdio_unlock(H5FD_t *_file);
+static herr_t H5FD_stdio_delete(const char *filename, hid_t fapl_id);
static const H5FD_class_t H5FD_stdio_g = {
"stdio", /* name */
@@ -213,6 +214,7 @@ static const H5FD_class_t H5FD_stdio_g = {
H5FD_stdio_truncate, /* truncate */
H5FD_stdio_lock, /* lock */
H5FD_stdio_unlock, /* unlock */
+ H5FD_stdio_delete, /* del */
NULL, /* dedup */
H5FD_FLMAP_DICHOTOMY /* fl_map */
};
@@ -331,7 +333,7 @@ H5Pset_fapl_stdio(hid_t fapl_id)
*-------------------------------------------------------------------------
*/
static H5FD_t *
-H5FD_stdio_open(const char *name, unsigned flags, hid_t /*UNUSED*/ fapl_id, haddr_t maxaddr)
+H5FD_stdio_open(const char *name, unsigned flags, hid_t fapl_id, haddr_t maxaddr)
{
FILE * f = NULL;
unsigned write_access = 0; /* File opened with write access? */
@@ -347,21 +349,22 @@ H5FD_stdio_open(const char *name, unsigned flags, hid_t /*UNUSED*/ fapl_id, hadd
assert(sizeof(file_offset_t) >= sizeof(size_t));
/* Quiet compiler */
- fapl_id = fapl_id;
+ (void)fapl_id;
/* Clear the error stack */
H5Eclear2(H5E_DEFAULT);
/* Check arguments */
if (!name || !*name)
- H5Epush_ret(func, H5E_ERR_CLS, H5E_ARGS, H5E_BADVALUE, "invalid file name",
- NULL) if (0 == maxaddr || HADDR_UNDEF == maxaddr)
- H5Epush_ret(func, H5E_ERR_CLS, H5E_ARGS, H5E_BADRANGE, "bogus maxaddr",
- NULL) if (ADDR_OVERFLOW(maxaddr))
- H5Epush_ret(func, H5E_ERR_CLS, H5E_ARGS, H5E_OVERFLOW, "maxaddr too large", NULL)
-
- /* Tentatively open file in read-only mode, to check for existence */
- if (flags & H5F_ACC_RDWR) f = fopen(name, "rb+");
+ H5Epush_ret(func, H5E_ERR_CLS, H5E_ARGS, H5E_BADVALUE, "invalid file name", NULL);
+ if (0 == maxaddr || HADDR_UNDEF == maxaddr)
+ H5Epush_ret(func, H5E_ERR_CLS, H5E_ARGS, H5E_BADRANGE, "bogus maxaddr", NULL);
+ if (ADDR_OVERFLOW(maxaddr))
+ H5Epush_ret(func, H5E_ERR_CLS, H5E_ARGS, H5E_OVERFLOW, "maxaddr too large", NULL);
+
+ /* Tentatively open file in read-only mode, to check for existence */
+ if (flags & H5F_ACC_RDWR)
+ f = fopen(name, "rb+");
else
f = fopen(name, "rb");
@@ -374,14 +377,14 @@ H5FD_stdio_open(const char *name, unsigned flags, hid_t /*UNUSED*/ fapl_id, hadd
}
else
H5Epush_ret(func, H5E_ERR_CLS, H5E_IO, H5E_CANTOPENFILE,
- "file doesn't exist and CREAT wasn't specified", NULL)
+ "file doesn't exist and CREAT wasn't specified", NULL);
}
else if (flags & H5F_ACC_EXCL) {
/* File exists, but EXCL is passed. Fail. */
assert(flags & H5F_ACC_CREAT);
fclose(f);
H5Epush_ret(func, H5E_ERR_CLS, H5E_IO, H5E_FILEEXISTS,
- "file exists but CREAT and EXCL were specified", NULL)
+ "file exists but CREAT and EXCL were specified", NULL);
}
else if (flags & H5F_ACC_RDWR) {
if (flags & H5F_ACC_TRUNC)
@@ -392,14 +395,13 @@ H5FD_stdio_open(const char *name, unsigned flags, hid_t /*UNUSED*/ fapl_id, hadd
* as the tentative open will work */
if (!f)
- H5Epush_ret(func, H5E_ERR_CLS, H5E_IO, H5E_CANTOPENFILE, "fopen failed", NULL)
+ H5Epush_ret(func, H5E_ERR_CLS, H5E_IO, H5E_CANTOPENFILE, "fopen failed", NULL);
- /* Build the return value */
- if (NULL == (file = (H5FD_stdio_t *)calloc((size_t)1, sizeof(H5FD_stdio_t))))
- {
- fclose(f);
- H5Epush_ret(func, H5E_ERR_CLS, H5E_RESOURCE, H5E_NOSPACE, "memory allocation failed", NULL)
- } /* end if */
+ /* Build the return value */
+ if (NULL == (file = (H5FD_stdio_t *)calloc((size_t)1, sizeof(H5FD_stdio_t)))) {
+ fclose(f);
+ H5Epush_ret(func, H5E_ERR_CLS, H5E_RESOURCE, H5E_NOSPACE, "memory allocation failed", NULL);
+ } /* end if */
file->fp = f;
file->op = H5FD_STDIO_OP_SEEK;
file->pos = HADDR_UNDEF;
@@ -463,7 +465,7 @@ H5FD_stdio_open(const char *name, unsigned flags, hid_t /*UNUSED*/ fapl_id, hadd
if (fstat(file->fd, &sb) < 0) {
free(file);
fclose(f);
- H5Epush_ret(func, H5E_ERR_CLS, H5E_FILE, H5E_BADFILE, "unable to fstat file", NULL)
+ H5Epush_ret(func, H5E_ERR_CLS, H5E_FILE, H5E_BADFILE, "unable to fstat file", NULL);
} /* end if */
file->device = sb.st_dev;
file->inode = sb.st_ino;
@@ -497,9 +499,9 @@ H5FD_stdio_close(H5FD_t *_file)
H5Eclear2(H5E_DEFAULT);
if (fclose(file->fp) < 0)
- H5Epush_ret(func, H5E_ERR_CLS, H5E_IO, H5E_CLOSEERROR, "fclose failed", -1)
+ H5Epush_ret(func, H5E_ERR_CLS, H5E_IO, H5E_CLOSEERROR, "fclose failed", -1);
- free(file);
+ free(file);
return 0;
} /* end H5FD_stdio_close() */
@@ -770,9 +772,9 @@ H5FD_stdio_get_handle(H5FD_t *_file, hid_t /*UNUSED*/ fapl, void **file_handle)
*file_handle = &(file->fp);
if (*file_handle == NULL)
- H5Epush_ret(func, H5E_ERR_CLS, H5E_IO, H5E_WRITEERROR, "get handle failed", -1)
+ H5Epush_ret(func, H5E_ERR_CLS, H5E_IO, H5E_WRITEERROR, "get handle failed", -1);
- return 0;
+ return 0;
} /* end H5FD_stdio_get_handle() */
/*-------------------------------------------------------------------------
@@ -809,12 +811,13 @@ H5FD_stdio_read(H5FD_t *_file, H5FD_mem_t /*UNUSED*/ type, hid_t /*UNUSED*/ dxpl
/* Check for overflow */
if (HADDR_UNDEF == addr)
- H5Epush_ret(func, H5E_ERR_CLS, H5E_IO, H5E_OVERFLOW, "file address overflowed",
- -1) if (REGION_OVERFLOW(addr, size))
- H5Epush_ret(func, H5E_ERR_CLS, H5E_IO, H5E_OVERFLOW, "file address overflowed", -1)
+ H5Epush_ret(func, H5E_ERR_CLS, H5E_IO, H5E_OVERFLOW, "file address overflowed", -1);
+ if (REGION_OVERFLOW(addr, size))
+ H5Epush_ret(func, H5E_ERR_CLS, H5E_IO, H5E_OVERFLOW, "file address overflowed", -1);
- /* Check easy cases */
- if (0 == size) return 0;
+ /* Check easy cases */
+ if (0 == size)
+ return 0;
if ((haddr_t)addr >= file->eof) {
memset(buf, 0, size);
return 0;
@@ -825,7 +828,7 @@ H5FD_stdio_read(H5FD_t *_file, H5FD_mem_t /*UNUSED*/ type, hid_t /*UNUSED*/ dxpl
if (file_fseek(file->fp, (file_offset_t)addr, SEEK_SET) < 0) {
file->op = H5FD_STDIO_OP_UNKNOWN;
file->pos = HADDR_UNDEF;
- H5Epush_ret(func, H5E_ERR_CLS, H5E_IO, H5E_SEEKERROR, "fseek failed", -1)
+ H5Epush_ret(func, H5E_ERR_CLS, H5E_IO, H5E_SEEKERROR, "fseek failed", -1);
}
file->pos = addr;
}
@@ -857,7 +860,7 @@ H5FD_stdio_read(H5FD_t *_file, H5FD_mem_t /*UNUSED*/ type, hid_t /*UNUSED*/ dxpl
if (0 == bytes_read && ferror(file->fp)) { /* error */
file->op = H5FD_STDIO_OP_UNKNOWN;
file->pos = HADDR_UNDEF;
- H5Epush_ret(func, H5E_ERR_CLS, H5E_IO, H5E_READERROR, "fread failed", -1)
+ H5Epush_ret(func, H5E_ERR_CLS, H5E_IO, H5E_READERROR, "fread failed", -1);
} /* end if */
if (0 == bytes_read && feof(file->fp)) {
@@ -911,20 +914,19 @@ H5FD_stdio_write(H5FD_t *_file, H5FD_mem_t /*UNUSED*/ type, hid_t /*UNUSED*/ dxp
/* Check for overflow conditions */
if (HADDR_UNDEF == addr)
- H5Epush_ret(func, H5E_ERR_CLS, H5E_IO, H5E_OVERFLOW, "file address overflowed",
- -1) if (REGION_OVERFLOW(addr, size))
- H5Epush_ret(func, H5E_ERR_CLS, H5E_IO, H5E_OVERFLOW, "file address overflowed", -1)
-
- /* Seek to the correct file position. */
- if ((file->op != H5FD_STDIO_OP_WRITE && file->op != H5FD_STDIO_OP_SEEK) || file->pos != addr)
- {
- if (file_fseek(file->fp, (file_offset_t)addr, SEEK_SET) < 0) {
- file->op = H5FD_STDIO_OP_UNKNOWN;
- file->pos = HADDR_UNDEF;
- H5Epush_ret(func, H5E_ERR_CLS, H5E_IO, H5E_SEEKERROR, "fseek failed", -1)
- }
- file->pos = addr;
+ H5Epush_ret(func, H5E_ERR_CLS, H5E_IO, H5E_OVERFLOW, "file address overflowed", -1);
+ if (REGION_OVERFLOW(addr, size))
+ H5Epush_ret(func, H5E_ERR_CLS, H5E_IO, H5E_OVERFLOW, "file address overflowed", -1);
+
+ /* Seek to the correct file position. */
+ if ((file->op != H5FD_STDIO_OP_WRITE && file->op != H5FD_STDIO_OP_SEEK) || file->pos != addr) {
+ if (file_fseek(file->fp, (file_offset_t)addr, SEEK_SET) < 0) {
+ file->op = H5FD_STDIO_OP_UNKNOWN;
+ file->pos = HADDR_UNDEF;
+ H5Epush_ret(func, H5E_ERR_CLS, H5E_IO, H5E_SEEKERROR, "fseek failed", -1);
}
+ file->pos = addr;
+ }
/* Write the buffer. On successful return, the file position will be
* advanced by the number of bytes read. On failure, the file position is
@@ -946,7 +948,7 @@ H5FD_stdio_write(H5FD_t *_file, H5FD_mem_t /*UNUSED*/ type, hid_t /*UNUSED*/ dxp
if (bytes_wrote != bytes_in || (0 == bytes_wrote && ferror(file->fp))) { /* error */
file->op = H5FD_STDIO_OP_UNKNOWN;
file->pos = HADDR_UNDEF;
- H5Epush_ret(func, H5E_ERR_CLS, H5E_IO, H5E_WRITEERROR, "fwrite failed", -1)
+ H5Epush_ret(func, H5E_ERR_CLS, H5E_IO, H5E_WRITEERROR, "fwrite failed", -1);
} /* end if */
assert(bytes_wrote > 0);
@@ -1000,11 +1002,11 @@ H5FD_stdio_flush(H5FD_t *_file, hid_t /*UNUSED*/ dxpl_id, hbool_t closing)
if (file->write_access) {
if (!closing) {
if (fflush(file->fp) < 0)
- H5Epush_ret(func, H5E_ERR_CLS, H5E_IO, H5E_WRITEERROR, "fflush failed", -1)
+ H5Epush_ret(func, H5E_ERR_CLS, H5E_IO, H5E_WRITEERROR, "fflush failed", -1);
- /* Reset last file I/O information */
- file->pos = HADDR_UNDEF;
- file->op = H5FD_STDIO_OP_UNKNOWN;
+ /* Reset last file I/O information */
+ file->pos = HADDR_UNDEF;
+ file->op = H5FD_STDIO_OP_UNKNOWN;
} /* end if */
} /* end if */
@@ -1069,13 +1071,13 @@ H5FD_stdio_truncate(H5FD_t *_file, hid_t /*UNUSED*/ dxpl_id, hbool_t /*UNUSED*/
if (INVALID_SET_FILE_POINTER == dwPtrLow) {
dwError = GetLastError();
if (dwError != NO_ERROR)
- H5Epush_ret(func, H5E_ERR_CLS, H5E_FILE, H5E_FILEOPEN, "unable to set file pointer", -1)
+ H5Epush_ret(func, H5E_ERR_CLS, H5E_FILE, H5E_FILEOPEN, "unable to set file pointer", -1);
}
bError = SetEndOfFile(file->hFile);
if (0 == bError)
H5Epush_ret(func, H5E_ERR_CLS, H5E_IO, H5E_SEEKERROR,
- "unable to truncate/extend file properly", -1)
+ "unable to truncate/extend file properly", -1);
#else /* H5_HAVE_WIN32_API */
/* Reset seek offset to beginning of file, so that file isn't re-extended later */
rewind(file->fp);
@@ -1083,11 +1085,11 @@ H5FD_stdio_truncate(H5FD_t *_file, hid_t /*UNUSED*/ dxpl_id, hbool_t /*UNUSED*/
/* Truncate file to proper length */
if (-1 == file_ftruncate(file->fd, (file_offset_t)file->eoa))
H5Epush_ret(func, H5E_ERR_CLS, H5E_IO, H5E_SEEKERROR,
- "unable to truncate/extend file properly", -1)
+ "unable to truncate/extend file properly", -1);
#endif /* H5_HAVE_WIN32_API */
- /* Update the eof value */
- file->eof = file->eoa;
+ /* Update the eof value */
+ file->eof = file->eoa;
/* Reset last file I/O information */
file->pos = HADDR_UNDEF;
@@ -1097,7 +1099,7 @@ H5FD_stdio_truncate(H5FD_t *_file, hid_t /*UNUSED*/ dxpl_id, hbool_t /*UNUSED*/
else {
/* Double-check for problems */
if (file->eoa > file->eof)
- H5Epush_ret(func, H5E_ERR_CLS, H5E_IO, H5E_TRUNCATED, "eoa > eof!", -1)
+ H5Epush_ret(func, H5E_ERR_CLS, H5E_IO, H5E_TRUNCATED, "eoa > eof!", -1);
} /* end else */
return 0;
@@ -1201,6 +1203,34 @@ H5FD_stdio_unlock(H5FD_t *_file)
return 0;
} /* end H5FD_stdio_unlock() */
+/*-------------------------------------------------------------------------
+ * Function: H5FD_stdio_delete
+ *
+ * Purpose: Delete a file
+ *
+ * Return: Non-negative on success/Negative on failure
+ *
+ *-------------------------------------------------------------------------
+ */
+static herr_t
+H5FD_stdio_delete(const char *filename, hid_t /*UNUSED*/ fapl_id)
+{
+ static const char *func = "H5FD_stdio_delete"; /* Function Name for error reporting */
+
+ /* Clear the error stack */
+ H5Eclear2(H5E_DEFAULT);
+
+ assert(filename);
+
+ /* Quiet compiler */
+ (void)fapl_id;
+
+ if (remove(filename) < 0)
+ H5Epush_ret(func, H5E_ERR_CLS, H5E_VFL, H5E_CANTDELETEFILE, "can't delete file)", -1);
+
+ return 0;
+} /* end H5FD_stdio_delete() */
+
#ifdef H5private_H
/*
* This is not related to the functionality of the driver code.
diff --git a/src/H5FDstdio.h b/src/H5FDstdio.h
index b3e06bb..9db92ed 100644
--- a/src/H5FDstdio.h
+++ b/src/H5FDstdio.h
@@ -28,7 +28,21 @@
extern "C" {
#endif
-H5_DLL hid_t H5FD_stdio_init(void);
+H5_DLL hid_t H5FD_stdio_init(void);
+/**
+ * \ingroup FAPL
+ *
+ * \brief Sets the standard I/O driver
+ *
+ * \fapl_id
+ * \returns \herr_t
+ *
+ * \details H5Pset_fapl_stdio() modifies the file access property list to use
+ * the standard I/O driver, H5FDstdio().
+ *
+ * \since 1.4.0
+ *
+ */
H5_DLL herr_t H5Pset_fapl_stdio(hid_t fapl_id);
#ifdef __cplusplus
diff --git a/src/H5FDtest.c b/src/H5FDtest.c
index eb3d59a..a55d34c 100644
--- a/src/H5FDtest.c
+++ b/src/H5FDtest.c
@@ -26,7 +26,7 @@
/****************/
#include "H5FDmodule.h" /* This source code file is part of the H5FD module */
-#define H5FD_TESTING /* Suppress warning about H5FD testing funcs */
+#define H5FD_TESTING /* Suppress warning about H5FD testing funcs */
/***********/
/* Headers */
@@ -106,7 +106,6 @@ H5FD__supports_swmr_test(const char *vfd_name)
ret_value = !HDstrcmp(vfd_name, "log") || !HDstrcmp(vfd_name, "sec2");
FUNC_LEAVE_NOAPI(ret_value)
-
} /* end H5FD__supports_swmr_test() */
/*
diff --git a/src/H5FDvfd_swmr.c b/src/H5FDvfd_swmr.c
index c409c52..316ca6d 100644
--- a/src/H5FDvfd_swmr.c
+++ b/src/H5FDvfd_swmr.c
@@ -128,7 +128,8 @@ static const H5FD_class_t H5FD_vfd_swmr_g = {
H5FD_vfd_swmr_truncate, /* truncate */
H5FD_vfd_swmr_lock, /* lock */
H5FD_vfd_swmr_unlock, /* unlock */
- H5FD_vfd_swmr_dedup, /* dedup */
+ NULL, /* del */
+ H5FD_vfd_swmr_dedup, /* dedup */
H5FD_FLMAP_DICHOTOMY /* fl_map */
};
diff --git a/src/H5FDwindows.h b/src/H5FDwindows.h
index c1c4654..79e73b6 100644
--- a/src/H5FDwindows.h
+++ b/src/H5FDwindows.h
@@ -27,6 +27,36 @@
extern "C" {
#endif /* __cplusplus */
+/**
+ * \ingroup FAPL
+ *
+ * \brief Sets the Windows I/O driver
+ *
+ * \fapl_id
+ * \returns \herr_t
+ *
+ * \details H5Pset_fapl_windows() sets the default HDF5 Windows I/O driver on
+ * Windows systems.
+ *
+ * Since the HDF5 library uses this driver, #H5FD_WINDOWS, by default
+ * on Windows systems, it is not normally necessary for a user
+ * application to call H5Pset_fapl_windows(). While it is not
+ * recommended, there may be times when a user chooses to set a
+ * different HDF5 driver, such as the standard I/O driver (#H5FD_STDIO)
+ * or the sec2 driver (#H5FD_SEC2), in a Windows
+ * application. H5Pset_fapl_windows() is provided so that the
+ * application can return to the Windows I/O driver when the time
+ * comes.
+ *
+ * Only the Windows driver is tested on Windows systems; other drivers
+ * are used at the application’s and the user’s risk.
+ *
+ * Furthermore, the Windows driver is tested and available only on
+ * Windows systems; it is not available on non-Windows systems.
+ *
+ * \since 1.8.0
+ *
+ */
H5_DLL herr_t H5Pset_fapl_windows(hid_t fapl_id);
#ifdef __cplusplus
diff --git a/src/H5FL.c b/src/H5FL.c
index 21d3655..95188d5 100644
--- a/src/H5FL.c
+++ b/src/H5FL.c
@@ -12,7 +12,7 @@
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
/*
- * Programmer: Quincey Koziol <koziol@ncsa.uiuc.edu>
+ * Programmer: Quincey Koziol
* Thursday, March 23, 2000
*
* Purpose: Manage priority queues of free-lists (of blocks of bytes).
diff --git a/src/H5FS.c b/src/H5FS.c
index 170d427..c85790c 100644
--- a/src/H5FS.c
+++ b/src/H5FS.c
@@ -12,7 +12,7 @@
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
/*
- * Programmer: Quincey Koziol <koziol@hdfgroup.org>
+ * Programmer: Quincey Koziol
* Tuesday, May 2, 2006
*
* Purpose: Free space tracking functions.
@@ -793,9 +793,6 @@ H5FS__dirty(H5FS_t *fspace)
herr_t ret_value = SUCCEED; /* Return value */
FUNC_ENTER_PACKAGE
-#ifdef QAK
- HDfprintf(stderr, "%s: Marking free space header as dirty\n", FUNC);
-#endif /* QAK */
/* Sanity check */
HDassert(fspace);
@@ -1209,9 +1206,6 @@ void
H5FS__assert(const H5FS_t *fspace)
{
FUNC_ENTER_PACKAGE_NOERR
-#ifdef QAK
- HDfprintf(stderr, "%s: fspace->tot_sect_count = %Hu\n", "H5FS__assert", fspace->tot_sect_count);
-#endif /* QAK */
/* Checks for section info, if it's available */
if (fspace->sinfo) {
@@ -1227,9 +1221,6 @@ H5FS__assert(const H5FS_t *fspace)
HDassert(fspace->tot_sect_count >= fspace->serial_sect_count);
HDassert(fspace->tot_sect_count >= fspace->ghost_sect_count);
HDassert(fspace->tot_sect_count == (fspace->serial_sect_count + fspace->ghost_sect_count));
-#ifdef QAK
- HDassert(fspace->serial_sect_count > 0 || fspace->ghost_sect_count == 0);
-#endif /* QAK */
FUNC_LEAVE_NOAPI_VOID
} /* end H5FS__assert() */
diff --git a/src/H5FScache.c b/src/H5FScache.c
index 244a3b6..8d94075 100644
--- a/src/H5FScache.c
+++ b/src/H5FScache.c
@@ -15,7 +15,7 @@
*
* Created: H5FScache.c
* May 2 2006
- * Quincey Koziol <koziol@hdfgroup.org>
+ * Quincey Koziol
*
* Purpose: Implement file free space metadata cache methods.
*
@@ -151,7 +151,6 @@ const H5AC_class_t H5AC_FSPACE_SINFO[1] = {{
* Return: Non-negative on success/Negative on failure
*
* Programmer: Quincey Koziol
- * koziol@hdfgroup.org
* August 14, 2013
*
*-------------------------------------------------------------------------
@@ -221,7 +220,6 @@ H5FS__cache_hdr_verify_chksum(const void *_image, size_t len, void H5_ATTR_UNUSE
* Failure: NULL
*
* Programmer: Quincey Koziol
- * koziol@hdfgroup.org
* August 18 2013
*
*-------------------------------------------------------------------------
@@ -252,7 +250,7 @@ H5FS__cache_hdr_deserialize(const void *_image, size_t H5_ATTR_NDEBUG_UNUSED len
fspace->addr = udata->addr;
/* Magic number */
- if (HDmemcmp(image, H5FS_HDR_MAGIC, (size_t)H5_SIZEOF_MAGIC))
+ if (HDmemcmp(image, H5FS_HDR_MAGIC, (size_t)H5_SIZEOF_MAGIC) != 0)
HGOTO_ERROR(H5E_FSPACE, H5E_CANTLOAD, NULL, "wrong free space header signature")
image += H5_SIZEOF_MAGIC;
@@ -335,7 +333,6 @@ done:
* Return: Non-negative on success/Negative on failure
*
* Programmer: Quincey Koziol
- * koziol@hdfgroup.org
* August 14, 2013
*
*-------------------------------------------------------------------------
@@ -785,7 +782,6 @@ H5FS__cache_hdr_serialize(const H5F_t *f, void *_image, size_t H5_ATTR_NDEBUG_UN
* Return: SUCCEED/FAIL
*
* Programmer: Quincey Koziol
- * koziol@lbl.gov
* January 3, 2017
*
*-------------------------------------------------------------------------
@@ -848,7 +844,6 @@ done:
* Failure: FAIL
*
* Programmer: Quincey Koziol
- * koziol@ncsa.uiuc.edu
* May 2 2006
*
*-------------------------------------------------------------------------
@@ -995,7 +990,7 @@ H5FS__cache_sinfo_deserialize(const void *_image, size_t H5_ATTR_NDEBUG_UNUSED l
H5_CHECKED_ASSIGN(old_sect_size, size_t, fspace->sect_size, hsize_t);
/* Magic number */
- if (HDmemcmp(image, H5FS_SINFO_MAGIC, (size_t)H5_SIZEOF_MAGIC))
+ if (HDmemcmp(image, H5FS_SINFO_MAGIC, (size_t)H5_SIZEOF_MAGIC) != 0)
HGOTO_ERROR(H5E_FSPACE, H5E_CANTLOAD, NULL, "wrong free space sections signature")
image += H5_SIZEOF_MAGIC;
@@ -1119,7 +1114,6 @@ done:
* Return: Non-negative on success/Negative on failure
*
* Programmer: Quincey Koziol
- * koziol@hdfgroup.org
* August 14, 2013
*
*-------------------------------------------------------------------------
diff --git a/src/H5FSdbg.c b/src/H5FSdbg.c
index fcc1fa4..3862b53 100644
--- a/src/H5FSdbg.c
+++ b/src/H5FSdbg.c
@@ -15,7 +15,7 @@
*
* Created: H5FSdbg.c
* May 9 2006
- * Quincey Koziol <koziol@hdfgroup.org>
+ * Quincey Koziol
*
* Purpose: Dump debugging information about a free space manager
*
@@ -121,12 +121,13 @@ H5FS_debug(H5F_t *f, haddr_t addr, FILE *stream, int indent, int fwidth)
(fspace->client == H5FS_CLIENT_FHEAP_ID
? "Fractal heap"
: (fspace->client == H5FS_CLIENT_FILE_ID ? "File" : "Unknown")));
- HDfprintf(stream, "%*s%-*s %Hu\n", indent, "", fwidth, "Total free space tracked:", fspace->tot_space);
- HDfprintf(stream, "%*s%-*s %Hu\n", indent, "", fwidth,
+ HDfprintf(stream, "%*s%-*s %" PRIuHSIZE "\n", indent, "", fwidth,
+ "Total free space tracked:", fspace->tot_space);
+ HDfprintf(stream, "%*s%-*s %" PRIuHSIZE "\n", indent, "", fwidth,
"Total number of free space sections tracked:", fspace->tot_sect_count);
- HDfprintf(stream, "%*s%-*s %Hu\n", indent, "", fwidth,
+ HDfprintf(stream, "%*s%-*s %" PRIuHSIZE "\n", indent, "", fwidth,
"Number of serializable free space sections tracked:", fspace->serial_sect_count);
- HDfprintf(stream, "%*s%-*s %Hu\n", indent, "", fwidth,
+ HDfprintf(stream, "%*s%-*s %" PRIuHSIZE "\n", indent, "", fwidth,
"Number of ghost free space sections tracked:", fspace->ghost_sect_count);
HDfprintf(stream, "%*s%-*s %u\n", indent, "", fwidth,
"Number of free space section classes:", (unsigned)fspace->nclasses);
@@ -134,11 +135,13 @@ H5FS_debug(H5F_t *f, haddr_t addr, FILE *stream, int indent, int fwidth)
HDfprintf(stream, "%*s%-*s %u%%\n", indent, "", fwidth, "Expand percent:", fspace->expand_percent);
HDfprintf(stream, "%*s%-*s %u\n", indent, "", fwidth,
"# of bits for section address space:", fspace->max_sect_addr);
- HDfprintf(stream, "%*s%-*s %Hu\n", indent, "", fwidth, "Maximum section size:", fspace->max_sect_size);
- HDfprintf(stream, "%*s%-*s %a\n", indent, "", fwidth, "Serialized sections address:", fspace->sect_addr);
- HDfprintf(stream, "%*s%-*s %Hu\n", indent, "", fwidth,
+ HDfprintf(stream, "%*s%-*s %" PRIuHSIZE "\n", indent, "", fwidth,
+ "Maximum section size:", fspace->max_sect_size);
+ HDfprintf(stream, "%*s%-*s %" PRIuHADDR "\n", indent, "", fwidth,
+ "Serialized sections address:", fspace->sect_addr);
+ HDfprintf(stream, "%*s%-*s %" PRIuHSIZE "\n", indent, "", fwidth,
"Serialized sections size used:", fspace->sect_size);
- HDfprintf(stream, "%*s%-*s %Hu\n", indent, "", fwidth,
+ HDfprintf(stream, "%*s%-*s %" PRIuHSIZE "\n", indent, "", fwidth,
"Serialized sections size allocated:", fspace->alloc_sect_size);
done:
diff --git a/src/H5FSint.c b/src/H5FSint.c
index 829ba75..0ab975b 100644
--- a/src/H5FSint.c
+++ b/src/H5FSint.c
@@ -15,7 +15,7 @@
*
* Created: H5FSint.c
* Fall 2012
- * Dana Robinson <derobins@hdfgroup.org>
+ * Dana Robinson
*
* Purpose: Internal routines for free space managers.
*
diff --git a/src/H5FSsection.c b/src/H5FSsection.c
index 0653cbc..14870b4 100644
--- a/src/H5FSsection.c
+++ b/src/H5FSsection.c
@@ -12,7 +12,7 @@
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
/*
- * Programmer: Quincey Koziol <koziol@hdfgroup.org>
+ * Programmer: Quincey Koziol
* Monday, July 31, 2006
*
* Purpose: Free space tracking functions.
@@ -526,16 +526,6 @@ H5FS__sect_serialize_size(H5FS_t *fspace)
/* Check arguments. */
HDassert(fspace);
-#ifdef QAK
- HDfprintf(stderr, "%s: Check 1.0 - fspace->sect_size = %Hu\n", "H5FS__sect_serialize_size",
- fspace->sect_size);
- HDfprintf(stderr, "%s: fspace->serial_sect_count = %Zu\n", "H5FS__sect_serialize_size",
- fspace->serial_sect_count);
- HDfprintf(stderr, "%s: fspace->alloc_sect_size = %Hu\n", "H5FS__sect_serialize_size",
- fspace->alloc_sect_size);
- HDfprintf(stderr, "%s: fspace->sinfo->serial_size_count = %Zu\n", "H5FS__sect_serialize_size",
- fspace->sinfo->serial_size_count);
-#endif /* QAK */
/* Compute the size of the buffer required to serialize all the sections */
if (fspace->serial_sect_count > 0) {
@@ -545,12 +535,6 @@ H5FS__sect_serialize_size(H5FS_t *fspace)
sect_buf_size = fspace->sinfo->sect_prefix_size;
/* Count for each differently sized serializable section */
-#ifdef QAK
- HDfprintf(stderr, "%s: fspace->sinfo->serial_size_count = %Zu\n", "H5FS__sect_serialize_size",
- fspace->sinfo->serial_size_count);
- HDfprintf(stderr, "%s: fspace->serial_sect_count = %Hu\n", "H5FS__sect_serialize_size",
- fspace->serial_sect_count);
-#endif /* QAK */
sect_buf_size +=
fspace->sinfo->serial_size_count * H5VM_limit_enc_size((uint64_t)fspace->serial_sect_count);
@@ -617,10 +601,6 @@ H5FS__sect_increase(H5FS_t *fspace, const H5FS_section_class_t *cls, unsigned fl
fspace->serial_sect_count++;
/* Increment amount of space required to serialize all sections */
-#ifdef QAK
- HDfprintf(stderr, "%s: sinfo->serial_size = %Zu\n", FUNC, fspace->sinfo->serial_size);
- HDfprintf(stderr, "%s: cls->serial_size = %Zu\n", FUNC, cls->serial_size);
-#endif /* QAK */
fspace->sinfo->serial_size += cls->serial_size;
/* Update the free space sections' serialized size */
@@ -676,10 +656,6 @@ H5FS__sect_decrease(H5FS_t *fspace, const H5FS_section_class_t *cls)
fspace->serial_sect_count--;
/* Decrement amount of space required to serialize all sections */
-#ifdef QAK
- HDfprintf(stderr, "%s: fspace->serial_size = %Zu\n", FUNC, fspace->sinfo->serial_size);
- HDfprintf(stderr, "%s: cls->serial_size = %Zu\n", FUNC, cls->serial_size);
-#endif /* QAK */
fspace->sinfo->serial_size -= cls->serial_size;
/* Update the free space sections' serialized size */
@@ -721,9 +697,6 @@ H5FS__size_node_decr(H5FS_sinfo_t *sinfo, unsigned bin, H5FS_node_t *fspace_node
* the bin's skiplist is also a skiplist...)
*/
sinfo->bins[bin].tot_sect_count--;
-#ifdef QAK
- HDfprintf(stderr, "%s: sinfo->bins[%u].sect_count = %Zu\n", FUNC, bin, sinfo->bins[bin].sect_count);
-#endif /* QAK */
/* Check for 'ghost' or 'serializable' section */
if (cls->flags & H5FS_CLS_GHOST_OBJ) {
@@ -861,10 +834,6 @@ H5FS__sect_unlink_rest(H5FS_t *fspace, const H5FS_section_class_t *cls, H5FS_sec
if (!(cls->flags & H5FS_CLS_SEPAR_OBJ)) {
H5FS_section_info_t *tmp_sect_node; /* Temporary section node */
-#ifdef QAK
- HDfprintf(stderr, "%s: removing object from merge list, sect->type = %u\n", FUNC,
- (unsigned)sect->type);
-#endif /* QAK */
tmp_sect_node = (H5FS_section_info_t *)H5SL_remove(fspace->sinfo->merge_list, &sect->addr);
if (tmp_sect_node == NULL || tmp_sect_node != sect)
HGOTO_ERROR(H5E_FSPACE, H5E_NOTFOUND, FAIL, "can't find section node on size list")
@@ -874,10 +843,7 @@ H5FS__sect_unlink_rest(H5FS_t *fspace, const H5FS_section_class_t *cls, H5FS_sec
if (H5FS__sect_decrease(fspace, cls) < 0)
HGOTO_ERROR(H5E_FSPACE, H5E_CANTINSERT, FAIL, "can't increase free space section size on disk")
- /* Decrement amount of free space managed */
-#ifdef QAK
- HDfprintf(stderr, "%s: fspace->tot_space = %Hu\n", FUNC, fspace->tot_space);
-#endif /* QAK */
+ /* Decrement amount of free space managed */
fspace->tot_space -= sect->size;
done:
@@ -988,9 +954,6 @@ H5FS__sect_link_size(H5FS_sinfo_t *sinfo, const H5FS_section_class_t *cls, H5FS_
herr_t ret_value = SUCCEED; /* Return value */
FUNC_ENTER_STATIC
-#ifdef QAK
- HDfprintf(stderr, "%s: sect->size = %Hu, sect->addr = %a\n", FUNC, sect->size, sect->addr);
-#endif /* QAK */
/* Check arguments. */
HDassert(sinfo);
@@ -1005,10 +968,9 @@ H5FS__sect_link_size(H5FS_sinfo_t *sinfo, const H5FS_section_class_t *cls, H5FS_
if (NULL == (sinfo->bins[bin].bin_list = H5SL_create(H5SL_TYPE_HSIZE, NULL)))
HGOTO_ERROR(H5E_FSPACE, H5E_CANTCREATE, FAIL, "can't create skip list for free space nodes")
} /* end if */
- else {
+ else
/* Check for node list of the correct size already */
fspace_node = (H5FS_node_t *)H5SL_search(sinfo->bins[bin].bin_list, &sect->size);
- } /* end else */
/* Check if we need to create a new skip list for nodes of this size */
if (fspace_node == NULL) {
@@ -1036,9 +998,6 @@ H5FS__sect_link_size(H5FS_sinfo_t *sinfo, const H5FS_section_class_t *cls, H5FS_
/* (Different from the # of items in the bin's skiplist, since each node on
* the bin's skiplist is also a skiplist...)
*/
-#ifdef QAK
- HDfprintf(stderr, "%s: sinfo->bins[%u].sect_count = %Zu\n", FUNC, bin, sinfo->bins[bin].sect_count);
-#endif /* QAK */
sinfo->bins[bin].tot_sect_count++;
if (cls->flags & H5FS_CLS_GHOST_OBJ) {
sinfo->bins[bin].ghost_sect_count++;
@@ -1101,10 +1060,6 @@ H5FS__sect_link_rest(H5FS_t *fspace, const H5FS_section_class_t *cls, H5FS_secti
/* Add section to the address-ordered list of sections, if allowed */
if (!(cls->flags & H5FS_CLS_SEPAR_OBJ)) {
-#ifdef QAK
- HDfprintf(stderr, "%s: inserting object into merge list, sect->type = %u\n", FUNC,
- (unsigned)sect->type);
-#endif /* QAK */
if (fspace->sinfo->merge_list == NULL)
if (NULL == (fspace->sinfo->merge_list = H5SL_create(H5SL_TYPE_HADDR, NULL)))
HGOTO_ERROR(H5E_FSPACE, H5E_CANTCREATE, FAIL,
@@ -1154,22 +1109,13 @@ H5FS__sect_link(H5FS_t *fspace, H5FS_section_info_t *sect, unsigned flags)
cls = &fspace->sect_cls[sect->type];
/* Add section to size tracked data structures */
-#ifdef QAK
- HDfprintf(stderr, "%s: Check 1.0 - fspace->tot_space = %Hu\n", FUNC, fspace->tot_space);
-#endif /* QAK */
if (H5FS__sect_link_size(fspace->sinfo, cls, sect) < 0)
HGOTO_ERROR(H5E_FSPACE, H5E_CANTINSERT, FAIL, "can't add section to size tracking data structures")
-#ifdef QAK
- HDfprintf(stderr, "%s: Check 2.0 - fspace->tot_space = %Hu\n", FUNC, fspace->tot_space);
-#endif /* QAK */
/* Update rest of free space manager data structures for section addition */
if (H5FS__sect_link_rest(fspace, cls, sect, flags) < 0)
HGOTO_ERROR(H5E_FSPACE, H5E_CANTINSERT, FAIL,
"can't add section to non-size tracking data structures")
-#ifdef QAK
- HDfprintf(stderr, "%s: Check 3.0 - fspace->tot_space = %Hu\n", FUNC, fspace->tot_space);
-#endif /* QAK */
done:
FUNC_LEAVE_NOAPI(ret_value)
@@ -1208,8 +1154,8 @@ H5FS__sect_merge(H5FS_t *fspace, H5FS_section_info_t **sect, void *op_data)
/* Loop until no more merging */
if (fspace->sinfo->merge_list) {
do {
- H5SL_node_t * less_sect_node; /* Skip list node for section less than new section */
- H5SL_node_t * greater_sect_node; /* Skip list node for section greater than new section */
+ H5SL_node_t *less_sect_node; /* Skip list node for section less than new section */
+ H5SL_node_t *greater_sect_node = NULL; /* Skip list node for section greater than new section */
H5FS_section_info_t * tmp_sect; /* Temporary free space section */
H5FS_section_class_t *tmp_sect_cls; /* Temporary section's class */
hbool_t greater_sect_node_valid = FALSE; /* Indicate if 'greater than' section node is valid */
@@ -1315,10 +1261,6 @@ H5FS__sect_merge(H5FS_t *fspace, H5FS_section_info_t **sect, void *op_data)
} while (modified);
} /* end if */
HDassert(*sect);
-#ifdef QAK
- HDfprintf(stderr, "%s: Done merging, (*sect) = {%a, %Hu, %u, %s}\n", FUNC, (*sect)->addr, (*sect)->size,
- (*sect)->type, ((*sect)->state == H5FS_SECT_LIVE ? "H5FS_SECT_LIVE" : "H5FS_SECT_SERIALIZED"));
-#endif /* QAK */
/* Loop until no more shrinking */
do {
@@ -1331,10 +1273,6 @@ H5FS__sect_merge(H5FS_t *fspace, H5FS_section_info_t **sect, void *op_data)
if ((status = (*sect_cls->can_shrink)(*sect, op_data)) < 0)
HGOTO_ERROR(H5E_FSPACE, H5E_CANTSHRINK, FAIL, "can't check for shrinking container")
if (status > 0) {
-#ifdef QAK
- HDfprintf(stderr, "%s: Can shrink!\n", FUNC);
-#endif /* QAK */
-
/* Remove SECT from free-space manager */
/* (only possible to happen on second+ pass through loop) */
if (remove_sect) {
@@ -1378,20 +1316,7 @@ H5FS__sect_merge(H5FS_t *fspace, H5FS_section_info_t **sect, void *op_data)
if (remove_sect && (*sect != NULL))
*sect = NULL;
-#ifdef QAK
- HDfprintf(stderr, "%s: Done shrinking\n", FUNC);
- if (*sect)
- HDfprintf(stderr, "%s: (*sect) = {%a, %Hu, %u, %s}\n", FUNC, (*sect)->addr, (*sect)->size,
- (*sect)->type,
- ((*sect)->state == H5FS_SECT_LIVE ? "H5FS_SECT_LIVE" : "H5FS_SECT_SERIALIZED"));
- else
- HDfprintf(stderr, "%s: *sect = %p\n", FUNC, *sect);
-#endif /* QAK */
-
done:
-#ifdef QAK
- HDfprintf(stderr, "%s: Leaving, ret_value = %d\n", FUNC, ret_value);
-#endif /* QAK */
FUNC_LEAVE_NOAPI(ret_value)
} /* H5FS__sect_merge() */
@@ -1720,10 +1645,6 @@ H5FS__sect_find_node(H5FS_t *fspace, hsize_t request, H5FS_section_info_t **node
/* Determine correct bin which holds items of at least the section's size */
bin = H5VM_log2_gen(request);
HDassert(bin < fspace->sinfo->nbins);
-#ifdef QAK
- HDfprintf(stderr, "%s: fspace->sinfo->nbins = %u\n", FUNC, fspace->sinfo->nbins);
- HDfprintf(stderr, "%s: bin = %u\n", FUNC, bin);
-#endif /* QAK */
alignment = fspace->alignment;
if (!((alignment > 1) && (request >= fspace->align_thres)))
alignment = 0; /* no alignment */
@@ -1863,10 +1784,6 @@ H5FS_sect_find(H5F_t *f, H5FS_t *fspace, hsize_t request, H5FS_section_info_t **
FUNC_ENTER_NOAPI(FAIL)
-#ifdef QAK
- HDfprintf(stderr, "%s: request = %Hu\n", FUNC, request);
-#endif /* QAK */
-
/* Check arguments. */
HDassert(fspace);
HDassert(fspace->nclasses);
@@ -1874,11 +1791,6 @@ H5FS_sect_find(H5F_t *f, H5FS_t *fspace, hsize_t request, H5FS_section_info_t **
HDassert(node);
/* Check for any sections on free space list */
-#ifdef QAK
- HDfprintf(stderr, "%s: fspace->tot_sect_count = %Hu\n", FUNC, fspace->tot_sect_count);
- HDfprintf(stderr, "%s: fspace->serial_sect_count = %Hu\n", FUNC, fspace->serial_sect_count);
- HDfprintf(stderr, "%s: fspace->ghost_sect_count = %Hu\n", FUNC, fspace->ghost_sect_count);
-#endif /* QAK */
if (fspace->tot_sect_count > 0) {
/* Get a pointer to the section info */
if (H5FS__sinfo_lock(f, fspace, H5AC__NO_FLAGS_SET) < 0)
@@ -1893,10 +1805,6 @@ H5FS_sect_find(H5F_t *f, H5FS_t *fspace, hsize_t request, H5FS_section_info_t **
if (ret_value > 0) {
/* Note that we've modified the section info */
sinfo_modified = TRUE;
-#ifdef QAK
- HDfprintf(stderr, "%s: (*node)->size = %Hu, (*node)->addr = %a, (*node)->type = %u\n", FUNC,
- (*node)->size, (*node)->addr, (*node)->type);
-#endif /* QAK */
} /* end if */
} /* end if */
@@ -1912,7 +1820,7 @@ done:
} /* H5FS_sect_find() */
/*-------------------------------------------------------------------------
- * Function: H5FS_iterate_sect_cb
+ * Function: H5FS__iterate_sect_cb
*
* Purpose: Skip list iterator callback to iterate over free space sections
* of a particular size
@@ -1925,13 +1833,13 @@ done:
*-------------------------------------------------------------------------
*/
static herr_t
-H5FS_iterate_sect_cb(void *_item, void H5_ATTR_UNUSED *key, void *_udata)
+H5FS__iterate_sect_cb(void *_item, void H5_ATTR_UNUSED *key, void *_udata)
{
H5FS_section_info_t *sect_info = (H5FS_section_info_t *)_item; /* Free space section to work on */
H5FS_iter_ud_t * udata = (H5FS_iter_ud_t *)_udata; /* Callback info */
herr_t ret_value = SUCCEED; /* Return value */
- FUNC_ENTER_NOAPI_NOINIT
+ FUNC_ENTER_STATIC
/* Check arguments. */
HDassert(sect_info);
@@ -1944,10 +1852,10 @@ H5FS_iterate_sect_cb(void *_item, void H5_ATTR_UNUSED *key, void *_udata)
done:
FUNC_LEAVE_NOAPI(ret_value)
-} /* H5FS_iterate_sect_cb() */
+} /* H5FS__iterate_sect_cb() */
/*-------------------------------------------------------------------------
- * Function: H5FS_iterate_node_cb
+ * Function: H5FS__iterate_node_cb
*
* Purpose: Skip list iterator callback to iterate over free space sections
* in a bin
@@ -1960,13 +1868,13 @@ done:
*-------------------------------------------------------------------------
*/
static herr_t
-H5FS_iterate_node_cb(void *_item, void H5_ATTR_UNUSED *key, void *_udata)
+H5FS__iterate_node_cb(void *_item, void H5_ATTR_UNUSED *key, void *_udata)
{
H5FS_node_t * fspace_node = (H5FS_node_t *)_item; /* Free space size node to work on */
H5FS_iter_ud_t *udata = (H5FS_iter_ud_t *)_udata; /* Callback info */
herr_t ret_value = SUCCEED; /* Return value */
- FUNC_ENTER_NOAPI_NOINIT
+ FUNC_ENTER_STATIC
/* Check arguments. */
HDassert(fspace_node);
@@ -1975,12 +1883,12 @@ H5FS_iterate_node_cb(void *_item, void H5_ATTR_UNUSED *key, void *_udata)
/* Iterate through all the sections of this size */
HDassert(fspace_node->sect_list);
- if (H5SL_iterate(fspace_node->sect_list, H5FS_iterate_sect_cb, udata) < 0)
+ if (H5SL_iterate(fspace_node->sect_list, H5FS__iterate_sect_cb, udata) < 0)
HGOTO_ERROR(H5E_FSPACE, H5E_BADITER, FAIL, "can't iterate over section nodes")
done:
FUNC_LEAVE_NOAPI(ret_value)
-} /* H5FS_iterate_node_cb() */
+} /* H5FS__iterate_node_cb() */
/*-------------------------------------------------------------------------
* Function: H5FS_sect_iterate
@@ -2007,10 +1915,6 @@ H5FS_sect_iterate(H5F_t *f, H5FS_t *fspace, H5FS_operator_t op, void *op_data)
HDassert(fspace);
HDassert(op);
-#ifdef QAK
- HDfprintf(stderr, "%s: fspace->tot_sect_count = %Hu\n", FUNC, fspace->tot_sect_count);
-#endif /* QAK */
-
/* Set up user data for iterator */
udata.fspace = fspace;
udata.op = op;
@@ -2026,14 +1930,11 @@ H5FS_sect_iterate(H5F_t *f, H5FS_t *fspace, H5FS_operator_t op, void *op_data)
sinfo_valid = TRUE;
/* Iterate over all the bins */
-#ifdef QAK
- HDfprintf(stderr, "%s: Iterate over section bins\n", FUNC);
-#endif /* QAK */
for (bin = 0; bin < fspace->sinfo->nbins; bin++) {
/* Check if there are any sections in this bin */
if (fspace->sinfo->bins[bin].bin_list) {
/* Iterate over list of section size nodes for bin */
- if (H5SL_iterate(fspace->sinfo->bins[bin].bin_list, H5FS_iterate_node_cb, &udata) < 0)
+ if (H5SL_iterate(fspace->sinfo->bins[bin].bin_list, H5FS__iterate_node_cb, &udata) < 0)
HGOTO_ERROR(H5E_FSPACE, H5E_BADITER, FAIL, "can't iterate over section size nodes")
} /* end if */
} /* end for */
@@ -2115,10 +2016,6 @@ H5FS_sect_change_class(H5F_t *f, H5FS_t *fspace, H5FS_section_info_t *sect, uint
old_class = sect->type;
old_cls = &fspace->sect_cls[sect->type];
new_cls = &fspace->sect_cls[new_class];
-#ifdef QAK
- HDfprintf(stderr, "%s: old_cls->flags = %x\n", FUNC, old_cls->flags);
- HDfprintf(stderr, "%s: new_cls->flags = %x\n", FUNC, new_cls->flags);
-#endif /* QAK */
/* Check if the section's class change will affect the # of serializable or ghost sections */
if ((old_cls->flags & H5FS_CLS_GHOST_OBJ) != (new_cls->flags & H5FS_CLS_GHOST_OBJ)) {
@@ -2131,9 +2028,6 @@ H5FS_sect_change_class(H5F_t *f, H5FS_t *fspace, H5FS_section_info_t *sect, uint
to_ghost = FALSE;
else
to_ghost = TRUE;
-#ifdef QAK
- HDfprintf(stderr, "%s: to_ghost = %u\n", FUNC, to_ghost);
-#endif /* QAK */
/* Sanity check */
HDassert(fspace->sinfo->bins);
@@ -2197,16 +2091,9 @@ H5FS_sect_change_class(H5F_t *f, H5FS_t *fspace, H5FS_section_info_t *sect, uint
to_mergable = TRUE;
else
to_mergable = FALSE;
-#ifdef QAK
- HDfprintf(stderr, "%s: to_mergable = %u\n", FUNC, to_mergable);
-#endif /* QAK */
/* Add or remove section from merge list, as appropriate */
if (to_mergable) {
-#ifdef QAK
- HDfprintf(stderr, "%s: inserting object into merge list, sect->type = %u\n", FUNC,
- (unsigned)sect->type);
-#endif /* QAK */
if (fspace->sinfo->merge_list == NULL)
if (NULL == (fspace->sinfo->merge_list = H5SL_create(H5SL_TYPE_HADDR, NULL)))
HGOTO_ERROR(H5E_FSPACE, H5E_CANTCREATE, FAIL,
@@ -2218,10 +2105,6 @@ H5FS_sect_change_class(H5F_t *f, H5FS_t *fspace, H5FS_section_info_t *sect, uint
else {
H5FS_section_info_t *tmp_sect_node; /* Temporary section node */
-#ifdef QAK
- HDfprintf(stderr, "%s: removing object from merge list, sect->type = %u\n", FUNC,
- (unsigned)sect->type);
-#endif /* QAK */
tmp_sect_node = (H5FS_section_info_t *)H5SL_remove(fspace->sinfo->merge_list, &sect->addr);
if (tmp_sect_node == NULL || tmp_sect_node != sect)
HGOTO_ERROR(H5E_FSPACE, H5E_NOTFOUND, FAIL, "can't find section node on size list")
@@ -2267,9 +2150,6 @@ H5FS__sect_assert(const H5FS_t *fspace)
hsize_t separate_obj; /* The number of separate objects managed */
FUNC_ENTER_PACKAGE_NOERR
-#ifdef QAK
- HDfprintf(stderr, "%s: fspace->tot_sect_count = %Hu\n", "H5FS__sect_assert", fspace->tot_sect_count);
-#endif /* QAK */
/* Initialize state */
separate_obj = 0;
@@ -2326,10 +2206,6 @@ H5FS__sect_assert(const H5FS_t *fspace)
/* Get section node & it's class */
sect = (H5FS_section_info_t *)H5SL_item(curr_sect_node);
cls = &fspace->sect_cls[sect->type];
-#ifdef QAK
- HDfprintf(stderr, "%s: sect->size = %Hu, sect->addr = %a, sect->type = %u\n",
- "H5FS__sect_assert", sect->size, sect->addr, sect->type);
-#endif /* QAK */
/* Sanity check section */
HDassert(H5F_addr_defined(sect->addr));
@@ -2407,7 +2283,7 @@ H5FS__sect_assert(const H5FS_t *fspace)
*
* Return: TRUE/FALSE/FAIL
*
- * Programmer: Vailin Choi
+ * Programmer: Vailin Choi
*
*-------------------------------------------------------------------------
*/
diff --git a/src/H5Faccum.c b/src/H5Faccum.c
index 894da5e..aed5812 100644
--- a/src/H5Faccum.c
+++ b/src/H5Faccum.c
@@ -15,7 +15,7 @@
*
* Created: H5Faccum.c
* Jan 10 2008
- * Quincey Koziol <koziol@hdfgroup.org>
+ * Quincey Koziol
*
* Purpose: File metadata "accumulator" routines. (Used to
* cache small metadata I/Os and group them into a
@@ -95,7 +95,6 @@ H5FL_BLK_DEFINE_STATIC(meta_accum);
* Return: Non-negative on success/Negative on failure
*
* Programmer: Quincey Koziol
- * koziol@hdfgroup.org
* Jan 10 2008
*
*-------------------------------------------------------------------------
@@ -265,7 +264,6 @@ done:
* Return: Non-negative on success/Negative on failure
*
* Programmer: Quincey Koziol
- * koziol@hdfgroup.org
* Jun 11 2009
*
*-------------------------------------------------------------------------
@@ -407,7 +405,6 @@ done:
* Return: Non-negative on success/Negative on failure
*
* Programmer: Quincey Koziol
- * koziol@hdfgroup.org
* Jan 10 2008
*
*-------------------------------------------------------------------------
@@ -847,7 +844,6 @@ done:
* Return: Non-negative on success/Negative on failure
*
* Programmer: Quincey Koziol
- * koziol@hdfgroup.org
* Jan 10 2008
*
*-------------------------------------------------------------------------
@@ -1014,7 +1010,6 @@ done:
* Return: Non-negative on success/Negative on failure
*
* Programmer: Quincey Koziol
- * koziol@hdfgroup.org
* Jan 10 2008
*
*-------------------------------------------------------------------------
@@ -1057,7 +1052,6 @@ done:
* Return: Non-negative on success/Negative on failure
*
* Programmer: Quincey Koziol
- * koziol@hdfgroup.org
* Jan 10 2008
*
*-------------------------------------------------------------------------
diff --git a/src/H5Fcwfs.c b/src/H5Fcwfs.c
index 073ccb2..d689737 100644
--- a/src/H5Fcwfs.c
+++ b/src/H5Fcwfs.c
@@ -12,7 +12,7 @@
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
/*
- * Programmer: Quincey Koziol <koziol@hdfgroup.org>
+ * Programmer: Quincey Koziol
* Tuesday, July 19, 2011
*
* Purpose: Each file has a small cache of global heap collections called
diff --git a/src/H5Fdbg.c b/src/H5Fdbg.c
index 572849d..5157180 100644
--- a/src/H5Fdbg.c
+++ b/src/H5Fdbg.c
@@ -11,7 +11,7 @@
* help@hdfgroup.org. *
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
-/* Programmer: Quincey Koziol <koziol@ncsa.uiuc.edu>
+/* Programmer: Quincey Koziol
* Wednesday, July 9, 2003
*
* Purpose: File object debugging functions.
@@ -37,7 +37,6 @@
* Return: Non-negative on success/Negative on failure
*
* Programmer: Robb Matzke
- * matzke@llnl.gov
* Aug 1 1997
*
*-------------------------------------------------------------------------
@@ -73,9 +72,10 @@ H5F_debug(H5F_t *f, FILE *stream, int indent, int fwidth)
"File name (after resolving symlinks):", H5F_ACTUAL_NAME(f));
HDfprintf(stream, "%*s%-*s 0x%08x\n", indent, "", fwidth, "File access flags", f->shared->flags);
HDfprintf(stream, "%*s%-*s %u\n", indent, "", fwidth, "File open reference count:", f->shared->nrefs);
- HDfprintf(stream, "%*s%-*s %a (abs)\n", indent, "", fwidth,
+ HDfprintf(stream, "%*s%-*s %" PRIuHADDR " (abs)\n", indent, "", fwidth,
"Address of super block:", f->shared->sblock->base_addr);
- HDfprintf(stream, "%*s%-*s %Hu bytes\n", indent, "", fwidth, "Size of userblock:", userblock_size);
+ HDfprintf(stream, "%*s%-*s %" PRIuHSIZE " bytes\n", indent, "", fwidth,
+ "Size of userblock:", userblock_size);
HDfprintf(stream, "%*s%-*s %u\n", indent, "", fwidth,
"Superblock version number:", f->shared->sblock->super_vers);
@@ -100,16 +100,16 @@ H5F_debug(H5F_t *f, FILE *stream, int indent, int fwidth)
"Indexed storage internal node 1/2 rank:", f->shared->sblock->btree_k[H5B_CHUNK_ID]);
HDfprintf(stream, "%*s%-*s 0x%02x\n", indent, "", fwidth,
"File status flags:", (unsigned)(f->shared->sblock->status_flags));
- HDfprintf(stream, "%*s%-*s %a (rel)\n", indent, "", fwidth,
+ HDfprintf(stream, "%*s%-*s %" PRIuHADDR " (rel)\n", indent, "", fwidth,
"Superblock extension address:", f->shared->sblock->ext_addr);
- HDfprintf(stream, "%*s%-*s %a (rel)\n", indent, "", fwidth,
+ HDfprintf(stream, "%*s%-*s %" PRIuHADDR " (rel)\n", indent, "", fwidth,
"Shared object header message table address:", f->shared->sohm_addr);
HDfprintf(stream, "%*s%-*s %u\n", indent, "", fwidth,
"Shared object header message version number:", (unsigned)f->shared->sohm_vers);
HDfprintf(stream, "%*s%-*s %u\n", indent, "", fwidth,
"Number of shared object header message indexes:", (unsigned)f->shared->sohm_nindexes);
- HDfprintf(stream, "%*s%-*s %a (rel)\n", indent, "", fwidth,
+ HDfprintf(stream, "%*s%-*s %" PRIuHADDR " (rel)\n", indent, "", fwidth,
"Address of driver information block:", f->shared->sblock->driver_addr);
HDfprintf(stream, "%*s%-*s %s\n", indent, "", fwidth,
diff --git a/src/H5Fdeprec.c b/src/H5Fdeprec.c
index 0bd56b3..b482961 100644
--- a/src/H5Fdeprec.c
+++ b/src/H5Fdeprec.c
@@ -15,7 +15,7 @@
*
* Created: H5Fdeprec.c
* October 1 2009
- * Quincey Koziol <koziol@hdfgroup.org>
+ * Quincey Koziol
*
* Purpose: Deprecated functions from the H5F interface. These
* functions are here for compatibility purposes and may be
@@ -87,7 +87,7 @@
*-------------------------------------------------------------------------
*/
herr_t
-H5Fget_info1(hid_t obj_id, H5F_info1_t *finfo)
+H5Fget_info1(hid_t obj_id, H5F_info1_t *finfo /*out*/)
{
H5VL_object_t *vol_obj = NULL;
H5I_type_t type;
@@ -95,7 +95,7 @@ H5Fget_info1(hid_t obj_id, H5F_info1_t *finfo)
herr_t ret_value = SUCCEED; /* Return value */
FUNC_ENTER_API(FAIL)
- H5TRACE2("e", "i*!", obj_id, finfo);
+ H5TRACE2("e", "ix", obj_id, finfo);
/* Check args */
if (!finfo)
diff --git a/src/H5Fefc.c b/src/H5Fefc.c
index 3909743..3f9a22f 100644
--- a/src/H5Fefc.c
+++ b/src/H5Fefc.c
@@ -15,7 +15,7 @@
*
* Created: H5Defc.c
* December 13, 2010
- * Neil Fortner <nfortne2@hdfgroup.org>
+ * Neil Fortner
*
* Purpose: External file caching routines - implements a
* cache of external files to minimize the number of
diff --git a/src/H5Ffake.c b/src/H5Ffake.c
index c3e9257..1aae0fd 100644
--- a/src/H5Ffake.c
+++ b/src/H5Ffake.c
@@ -32,7 +32,6 @@
* Failure: NULL
*
* Programmer: Quincey Koziol
- * koziol@hdfgroup.org
* Oct 2, 2006
*
*-------------------------------------------------------------------------
@@ -76,7 +75,6 @@ done:
* Failure: negative
*
* Programmer: Quincey Koziol
- * koziol@hdfgroup.org
* Oct 2, 2006
*
*-------------------------------------------------------------------------
diff --git a/src/H5Fint.c b/src/H5Fint.c
index 7815a47..f5dc85d 100644
--- a/src/H5Fint.c
+++ b/src/H5Fint.c
@@ -413,16 +413,16 @@ H5F_get_access_plist(H5F_t *f, hbool_t app_ref)
if (f->shared->efc)
efc_size = H5F__efc_max_nfiles(f->shared->efc);
if (H5P_set(new_plist, H5F_ACS_EFC_SIZE_NAME, &efc_size) < 0)
- HGOTO_ERROR(H5E_FILE, H5E_CANTGET, H5I_INVALID_HID, "can't set elink file cache size")
+ HGOTO_ERROR(H5E_FILE, H5E_CANTSET, H5I_INVALID_HID, "can't set elink file cache size")
if (f->shared->pb_ptr != NULL) {
if (H5P_set(new_plist, H5F_ACS_PAGE_BUFFER_SIZE_NAME, &(f->shared->pb_ptr->max_size)) < 0)
- HGOTO_ERROR(H5E_FILE, H5E_CANTGET, H5I_INVALID_HID, "can't set page buffer size")
+ HGOTO_ERROR(H5E_FILE, H5E_CANTSET, H5I_INVALID_HID, "can't set page buffer size")
if (H5P_set(new_plist, H5F_ACS_PAGE_BUFFER_MIN_META_PERC_NAME, &(f->shared->pb_ptr->min_meta_perc)) <
0)
HGOTO_ERROR(H5E_FILE, H5E_CANTGET, H5I_INVALID_HID,
"can't set minimum metadata fraction of page buffer")
if (H5P_set(new_plist, H5F_ACS_PAGE_BUFFER_MIN_RAW_PERC_NAME, &(f->shared->pb_ptr->min_raw_perc)) < 0)
- HGOTO_ERROR(H5E_FILE, H5E_CANTGET, H5I_INVALID_HID,
+ HGOTO_ERROR(H5E_FILE, H5E_CANTSET, H5I_INVALID_HID,
"can't set minimum raw data fraction of page buffer")
} /* end if */
@@ -431,9 +431,9 @@ H5F_get_access_plist(H5F_t *f, hbool_t app_ref)
#ifdef H5_HAVE_PARALLEL
if (H5P_set(new_plist, H5_COLL_MD_READ_FLAG_NAME, &(f->shared->coll_md_read)) < 0)
- HGOTO_ERROR(H5E_FILE, H5E_CANTGET, H5I_INVALID_HID, "can't set collective metadata read flag")
+ HGOTO_ERROR(H5E_FILE, H5E_CANTSET, H5I_INVALID_HID, "can't set collective metadata read flag")
if (H5P_set(new_plist, H5F_ACS_COLL_MD_WRITE_FLAG_NAME, &(f->shared->coll_md_write)) < 0)
- HGOTO_ERROR(H5E_FILE, H5E_CANTGET, H5I_INVALID_HID, "can't set collective metadata read flag")
+ HGOTO_ERROR(H5E_FILE, H5E_CANTSET, H5I_INVALID_HID, "can't set collective metadata read flag")
#endif /* H5_HAVE_PARALLEL */
if (H5P_set(new_plist, H5F_ACS_META_CACHE_INIT_IMAGE_CONFIG_NAME, &(f->shared->mdc_initCacheImageCfg)) <
0)
@@ -2442,6 +2442,31 @@ done:
} /* end H5F__close() */
/*-------------------------------------------------------------------------
+ * Function: H5F_delete
+ *
+ * Purpose: Deletes a file.
+ *
+ * Return: SUCCEED/FAIL
+ *-------------------------------------------------------------------------
+ */
+herr_t
+H5F_delete(const char *filename, hid_t fapl_id)
+{
+ herr_t ret_value = SUCCEED; /* Return value */
+
+ FUNC_ENTER_NOAPI(FAIL)
+
+ HDassert(filename);
+
+ /* Delete the file */
+ if (H5FD_delete(filename, fapl_id) < 0)
+ HGOTO_ERROR(H5E_FILE, H5E_CANTDELETEFILE, FAIL, "unable to delete file")
+
+done:
+ FUNC_LEAVE_NOAPI(ret_value)
+} /* end H5F_delete() */
+
+/*-------------------------------------------------------------------------
* Function: H5F_try_close
*
* Purpose: Attempts to close a file due to one of several actions:
@@ -2559,7 +2584,7 @@ H5F_try_close(H5F_t *f, hbool_t *was_closed /*out*/)
/* Try to close all the open objects in this file */
for (u = 0; u < obj_count; u++)
if (H5I_dec_ref(objs[u]) < 0)
- HGOTO_ERROR(H5E_ATOM, H5E_CLOSEERROR, FAIL, "can't close object")
+ HGOTO_ERROR(H5E_ID, H5E_CLOSEERROR, FAIL, "can't close object")
}
if (result < 0)
HGOTO_ERROR(H5E_FILE, H5E_BADITER, FAIL, "H5F_get_obj_ids failed(1)")
@@ -2577,7 +2602,7 @@ H5F_try_close(H5F_t *f, hbool_t *was_closed /*out*/)
/* Try to close all the open objects in this file */
for (u = 0; u < obj_count; u++)
if (H5I_dec_ref(objs[u]) < 0)
- HGOTO_ERROR(H5E_ATOM, H5E_CLOSEERROR, FAIL, "can't close object")
+ HGOTO_ERROR(H5E_ID, H5E_CLOSEERROR, FAIL, "can't close object")
}
if (result < 0)
HGOTO_ERROR(H5E_INTERNAL, H5E_BADITER, FAIL, "H5F_get_obj_ids failed(2)")
@@ -2680,13 +2705,13 @@ H5F_get_id(H5F_t *file)
if (H5I_find_id(file, H5I_FILE, &ret_value) < 0 || H5I_INVALID_HID == ret_value) {
/* resurrect the ID - Register an ID with the native connector */
if ((ret_value = H5VL_wrap_register(H5I_FILE, file, FALSE)) < 0)
- HGOTO_ERROR(H5E_ATOM, H5E_CANTREGISTER, H5I_INVALID_HID, "unable to register group")
+ HGOTO_ERROR(H5E_ID, H5E_CANTREGISTER, H5I_INVALID_HID, "unable to register group")
file->id_exists = TRUE;
}
else {
/* Increment reference count on existing ID */
if (H5I_inc_ref(ret_value, FALSE) < 0)
- HGOTO_ERROR(H5E_ATOM, H5E_CANTINC, H5I_INVALID_HID, "incrementing file ID failed")
+ HGOTO_ERROR(H5E_ID, H5E_CANTINC, H5I_INVALID_HID, "incrementing file ID failed")
} /* end else */
done:
@@ -3791,7 +3816,7 @@ H5F__start_swmr_write(H5F_t *f)
/* Close the object */
if (H5I_dec_ref(obj_ids[u]) < 0)
- HGOTO_ERROR(H5E_ATOM, H5E_CANTCLOSEOBJ, FAIL, "decrementing object ID failed")
+ HGOTO_ERROR(H5E_ID, H5E_CANTCLOSEOBJ, FAIL, "decrementing object ID failed")
} /* end for */
} /* end if */
@@ -3856,7 +3881,7 @@ H5F__start_swmr_write(H5F_t *f)
* going to sweat it, now.
*/
if (H5O_refresh_metadata_reopen(obj_ids[u], &obj_glocs[u], NULL, vol_connector, TRUE) < 0)
- HGOTO_ERROR(H5E_ATOM, H5E_CLOSEERROR, FAIL, "can't refresh-close object")
+ HGOTO_ERROR(H5E_ID, H5E_CLOSEERROR, FAIL, "can't refresh-close object")
done:
if (ret_value < 0 && setup) {
@@ -4010,7 +4035,7 @@ H5F_get_file_id(H5VL_object_t *vol_obj, H5I_type_t obj_type, hbool_t app_ref)
vol_wrapper_set = TRUE;
if ((file_id = H5VL_wrap_register(H5I_FILE, vol_obj_file, app_ref)) < 0)
- HGOTO_ERROR(H5E_FILE, H5E_CANTREGISTER, H5I_INVALID_HID, "unable to atomize file handle")
+ HGOTO_ERROR(H5E_FILE, H5E_CANTREGISTER, H5I_INVALID_HID, "unable to register file handle")
} /* end if */
else {
/* Increment ref count on existing ID */
diff --git a/src/H5Fio.c b/src/H5Fio.c
index 6265182..ca069e0 100644
--- a/src/H5Fio.c
+++ b/src/H5Fio.c
@@ -15,7 +15,7 @@
*
* Created: H5Fio.c
* Jan 10 2008
- * Quincey Koziol <koziol@hdfgroup.org>
+ * Quincey Koziol
*
* Purpose: File I/O routines.
*
@@ -74,6 +74,10 @@
* address for the file.
*
* Return: Non-negative on success/Negative on failure
+ *
+ * Programmer: Robb Matzke
+ * Jul 10 1997
+ *
*-------------------------------------------------------------------------
*/
herr_t
@@ -108,6 +112,10 @@ done:
* address for the file.
*
* Return: Non-negative on success/Negative on failure
+ *
+ * Programmer: Robb Matzke
+ * Jul 10 1997
+ *
*-------------------------------------------------------------------------
*/
herr_t
@@ -124,6 +132,10 @@ H5F_block_read(H5F_t *f, H5FD_mem_t type, haddr_t addr, size_t size, void *buf /
* address.
*
* Return: Non-negative on success/Negative on failure
+ *
+ * Programmer: Robb Matzke
+ * Jul 10 1997
+ *
*-------------------------------------------------------------------------
*/
herr_t
@@ -159,6 +171,10 @@ done:
* address.
*
* Return: Non-negative on success/Negative on failure
+ *
+ * Programmer: Robb Matzke
+ * Jul 10 1997
+ *
*-------------------------------------------------------------------------
*/
herr_t
diff --git a/src/H5Fmodule.h b/src/H5Fmodule.h
index 33c302a..7f0299a 100644
--- a/src/H5Fmodule.h
+++ b/src/H5Fmodule.h
@@ -31,8 +31,34 @@
/**
* \defgroup H5F H5F
- * \brief File Interface
- * \todo Describe concisely what the functions in this module are about.
+ *
+ * Use the functions in this module to manage HDF5 files.
+ *
+ * In the code snippets below, we show the skeletal life cycle of an HDF5 file,
+ * when creating a new file (left) or when opening an existing file (right).
+ * File creation is essentially controlled through \ref FCPL, and file access to
+ * new and existing files is controlled through \ref FAPL. The file \c name and
+ * creation or access \c mode control the interaction with the underlying
+ * storage such as file systems.
+ *
+ * \Emph{Proper error handling is part of the life cycle.}
+ * <table>
+ * <tr><th>Create</th><th>Open</th></tr>
+ * <tr valign="top">
+ * <td>
+ * \snippet H5F_examples.c life_cycle
+ * </td>
+ * <td>
+ * \snippet H5F_examples.c life_cycle_w_open
+ * </td>
+ * </tr>
+ * </table>
+ *
+ * In addition to general file management functions, there are three categories
+ * of functions that deal with advanced file management tasks and use cases:
+ * 1. The control of the HDF5 \ref MDC
+ * 2. The use of (MPI-) \ref PH5F HDF5
+ * 3. The \ref SWMR pattern
*
* \defgroup MDC Metadata Cache
* \ingroup H5F
diff --git a/src/H5Fmount.c b/src/H5Fmount.c
index 5eeb341..f107c98 100644
--- a/src/H5Fmount.c
+++ b/src/H5Fmount.c
@@ -424,121 +424,6 @@ H5F_is_mount(const H5F_t *file)
} /* end H5F_is_mount() */
/*-------------------------------------------------------------------------
- * Function: H5Fmount
- *
- * Purpose: Mount file CHILD_ID onto the group specified by LOC_ID and
- * NAME using mount properties PLIST_ID.
- *
- * Return: SUCCEED/FAIL
- *
- *-------------------------------------------------------------------------
- */
-herr_t
-H5Fmount(hid_t loc_id, const char *name, hid_t child_id, hid_t plist_id)
-{
- H5VL_object_t *loc_vol_obj = NULL; /* Parent object */
- H5VL_object_t *child_vol_obj = NULL; /* Child object */
- H5I_type_t loc_type; /* ID type of location */
- H5I_type_t child_type; /* ID type of child */
- herr_t ret_value = SUCCEED; /* Return value */
-
- FUNC_ENTER_API(FAIL)
- H5TRACE4("e", "i*sii", loc_id, name, child_id, plist_id);
-
- /* Check arguments */
- loc_type = H5I_get_type(loc_id);
- if (H5I_FILE != loc_type && H5I_GROUP != loc_type)
- HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "loc_id parameter not a file or group ID")
- if (!name)
- HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "name parameter cannot be NULL")
- if (!*name)
- HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "name parameter cannot be the empty string")
- child_type = H5I_get_type(child_id);
- if (H5I_FILE != child_type)
- HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "child_id parameter not a file ID")
- if (H5P_DEFAULT == plist_id)
- plist_id = H5P_FILE_MOUNT_DEFAULT;
- else if (TRUE != H5P_isa_class(plist_id, H5P_FILE_MOUNT))
- HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "plist_id is not a file mount property list ID")
-
- /* Set up collective metadata if appropriate */
- if (H5CX_set_loc(loc_id) < 0)
- HGOTO_ERROR(H5E_FILE, H5E_CANTSET, FAIL, "can't set collective metadata read info")
-
- /* Get the location object */
- if (NULL == (loc_vol_obj = (H5VL_object_t *)H5I_object(loc_id)))
- HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "could not get location object")
-
- /* Get the child object */
- if (NULL == (child_vol_obj = (H5VL_object_t *)H5I_object(child_id)))
- HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "could not get child object")
-
- /* Check if both objects are associated with the same VOL connector */
- if (loc_vol_obj->connector->cls->value != child_vol_obj->connector->cls->value)
- HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "Can't mount file onto object from different VOL connector")
-
- /* Perform the mount operation */
- if (H5VL_file_specific(loc_vol_obj, H5VL_FILE_MOUNT, H5P_DATASET_XFER_DEFAULT, H5_REQUEST_NULL,
- (int)loc_type, name, child_vol_obj->data, plist_id) < 0)
- HGOTO_ERROR(H5E_FILE, H5E_MOUNT, FAIL, "unable to mount file")
-
-done:
- FUNC_LEAVE_API(ret_value)
-} /* end H5Fmount() */
-
-/*-------------------------------------------------------------------------
- * Function: H5Funmount
- *
- * Purpose: Given a mount point, dissassociate the mount point's file
- * from the file mounted there. Do not close either file.
- *
- * The mount point can either be the group in the parent or the
- * root group of the mounted file (both groups have the same
- * name). If the mount point was opened before the mount then
- * it's the group in the parent, but if it was opened after the
- * mount then it's the root group of the child.
- *
- * Return: SUCCEED/FAIL
- *
- *-------------------------------------------------------------------------
- */
-herr_t
-H5Funmount(hid_t loc_id, const char *name)
-{
- H5VL_object_t *vol_obj = NULL; /* Parent object */
- H5I_type_t loc_type; /* ID type of location */
- herr_t ret_value = SUCCEED; /* Return value */
-
- FUNC_ENTER_API(FAIL)
- H5TRACE2("e", "i*s", loc_id, name);
-
- /* Check arguments */
- loc_type = H5I_get_type(loc_id);
- if (H5I_FILE != loc_type && H5I_GROUP != loc_type)
- HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "loc_id parameter not a file or group ID")
- if (!name)
- HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "name parameter cannot be NULL")
- if (!*name)
- HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "name parameter cannot be the empty string")
-
- /* Set up collective metadata if appropriate */
- if (H5CX_set_loc(loc_id) < 0)
- HGOTO_ERROR(H5E_FILE, H5E_CANTSET, FAIL, "can't set collective metadata read info")
-
- /* Get the location object */
- if (NULL == (vol_obj = (H5VL_object_t *)H5I_object(loc_id)))
- HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "could not get location object")
-
- /* Perform the unmount operation */
- if (H5VL_file_specific(vol_obj, H5VL_FILE_UNMOUNT, H5P_DATASET_XFER_DEFAULT, H5_REQUEST_NULL,
- (int)loc_type, name) < 0)
- HGOTO_ERROR(H5E_FILE, H5E_MOUNT, FAIL, "unable to unmount file")
-
-done:
- FUNC_LEAVE_API(ret_value)
-} /* end H5Funmount() */
-
-/*-------------------------------------------------------------------------
* Function: H5F__mount_count_ids_recurse
*
* Purpose: Helper routine for counting number of open IDs in mount
@@ -621,7 +506,7 @@ H5F__mount_count_ids(H5F_t *f, unsigned *nopen_files, unsigned *nopen_objs)
} /* end H5F__mount_count_ids() */
/*-------------------------------------------------------------------------
- * Function: H5F_flush_mounts_recurse
+ * Function: H5F__flush_mounts_recurse
*
* Purpose: Flush a mount hierarchy, recursively
*
@@ -633,20 +518,20 @@ H5F__mount_count_ids(H5F_t *f, unsigned *nopen_files, unsigned *nopen_objs)
*-------------------------------------------------------------------------
*/
static herr_t
-H5F_flush_mounts_recurse(H5F_t *f)
+H5F__flush_mounts_recurse(H5F_t *f)
{
unsigned nerrors = 0; /* Errors from recursive flushes */
unsigned u; /* Index variable */
herr_t ret_value = SUCCEED; /* Return value */
- FUNC_ENTER_NOAPI_NOINIT
+ FUNC_ENTER_STATIC
/* Sanity check */
HDassert(f);
/* Flush all child files, not stopping for errors */
for (u = 0; u < f->shared->mtab.nmounts; u++)
- if (H5F_flush_mounts_recurse(f->shared->mtab.child[u].file) < 0)
+ if (H5F__flush_mounts_recurse(f->shared->mtab.child[u].file) < 0)
nerrors++;
/* Call the "real" flush routine, for this file */
@@ -659,7 +544,7 @@ H5F_flush_mounts_recurse(H5F_t *f)
done:
FUNC_LEAVE_NOAPI(ret_value)
-} /* end H5F_flush_mounts_recurse() */
+} /* end H5F__flush_mounts_recurse() */
/*-------------------------------------------------------------------------
* Function: H5F_flush_mounts
@@ -688,7 +573,7 @@ H5F_flush_mounts(H5F_t *f)
f = f->parent;
/* Flush the mounted file hierarchy */
- if (H5F_flush_mounts_recurse(f) < 0)
+ if (H5F__flush_mounts_recurse(f) < 0)
HGOTO_ERROR(H5E_FILE, H5E_CANTFLUSH, FAIL, "unable to flush mounted file hierarchy")
done:
diff --git a/src/H5Fprivate.h b/src/H5Fprivate.h
index 0c4c51d..901ab7c 100644
--- a/src/H5Fprivate.h
+++ b/src/H5Fprivate.h
@@ -853,6 +853,7 @@ H5_DLL herr_t H5F_init(void);
H5_DLL H5F_t *H5F_open(const char *name, unsigned flags, hid_t fcpl_id, hid_t fapl_id);
H5_DLL herr_t H5F_try_close(H5F_t *f, hbool_t *was_closed /*out*/);
H5_DLL hid_t H5F_get_file_id(H5VL_object_t *vol_obj, H5I_type_t obj_type, hbool_t app_ref);
+H5_DLL herr_t H5F_delete(const char *filename, hid_t fapl_id);
/* Functions that retrieve values from the file struct */
H5_DLL H5F_libver_t H5F_get_low_bound(const H5F_t *f);
diff --git a/src/H5Fquery.c b/src/H5Fquery.c
index c2fce7e..24b25ff 100644
--- a/src/H5Fquery.c
+++ b/src/H5Fquery.c
@@ -723,7 +723,6 @@ H5F_sieve_buf_size(const H5F_t *f)
* Failure: (should not happen)
*
* Programmer: Quincey Koziol
- * koziol@ncsa.uiuc.edu
* Jul 8 2005
*
*-------------------------------------------------------------------------
diff --git a/src/H5Fsfile.c b/src/H5Fsfile.c
index 34bd1b4..be45e78 100644
--- a/src/H5Fsfile.c
+++ b/src/H5Fsfile.c
@@ -135,14 +135,28 @@ done:
H5F_shared_t *
H5F__sfile_search(H5FD_t *lf)
{
- H5F_sfile_node_t *curr;
-
- for (curr = H5F_sfile_head_g; curr != NULL; curr = curr->next) {
- if (curr->shared->lf == lf)
- return curr->shared;
- }
- return NULL;
-}
+ H5F_sfile_node_t *curr; /* Current shared file node */
+ H5F_shared_t * ret_value = NULL; /* Return value */
+
+ FUNC_ENTER_PACKAGE_NOERR
+
+ /* Sanity check */
+ HDassert(lf);
+
+ /* Iterate through low-level files for matching low-level file info */
+ curr = H5F_sfile_head_g;
+ while (curr) {
+ /* Check for match */
+ if (0 == H5FD_cmp(curr->shared->lf, lf))
+ HGOTO_DONE(curr->shared)
+
+ /* Advance to next shared file node */
+ curr = curr->next;
+ } /* end while */
+
+done:
+ FUNC_LEAVE_NOAPI(ret_value)
+} /* end H5F__sfile_search() */
/*-------------------------------------------------------------------------
* Function: H5F__sfile_remove
diff --git a/src/H5Fspace.c b/src/H5Fspace.c
index b92fa64..29495f1 100644
--- a/src/H5Fspace.c
+++ b/src/H5Fspace.c
@@ -15,7 +15,7 @@
*
* Created: H5Fspace.c
* Dec 30 2013
- * Quincey Koziol <koziol@hdfgroup.org>
+ * Quincey Koziol
*
* Purpose: Space allocation routines for the file.
*
diff --git a/src/H5Fsuper.c b/src/H5Fsuper.c
index 470502b..e7a3b53 100644
--- a/src/H5Fsuper.c
+++ b/src/H5Fsuper.c
@@ -310,7 +310,6 @@ done:
* Failure: FAIL
*
* Programmer: Bill Wendling
- * wendling@ncsa.uiuc.edu
* Sept 12, 2003
*
*-------------------------------------------------------------------------
@@ -883,12 +882,12 @@ H5F__super_read(H5F_t *f, H5P_genplist_t *fa_plist, hbool_t initial_read)
/* Do the same kluge until we know for sure. VC */
#if 1 /* bug fix test code -- tidy this up if all goes well */ /* JRM */
- /* KLUGE ALERT!!
- *
- * H5F__super_ext_write_msg() expects f->shared->sblock to
- * be set -- verify that it is NULL, and then set it.
- * Set it back to NULL when we are done.
- */
+ /* KLUGE ALERT!!
+ *
+ * H5F__super_ext_write_msg() expects f->shared->sblock to
+ * be set -- verify that it is NULL, and then set it.
+ * Set it back to NULL when we are done.
+ */
HDassert(f->shared->sblock == NULL);
f->shared->sblock = sblock;
#endif /* JRM */
@@ -1074,7 +1073,6 @@ done:
* Failure: FAIL
*
* Programmer: Quincey Koziol
- * koziol@ncsa.uiuc.edu
* Sept 15, 2003
*
*-------------------------------------------------------------------------
diff --git a/src/H5Fsuper_cache.c b/src/H5Fsuper_cache.c
index 2daa34e..7d1ff86 100644
--- a/src/H5Fsuper_cache.c
+++ b/src/H5Fsuper_cache.c
@@ -15,7 +15,7 @@
*
* Created: H5Fsuper_cache.c
* Aug 15 2009
- * Quincey Koziol <koziol@hdfgroup.org>
+ * Quincey Koziol
*
* Purpose: Implement file superblock & driver info metadata cache methods.
*
@@ -294,7 +294,6 @@ done:
* Return: Non-negative on success/Negative on failure
*
* Programmer: Quincey Koziol
- * koziol@hdfgroup.org
* July 17, 2013
*
*-------------------------------------------------------------------------
@@ -322,7 +321,6 @@ H5F__cache_superblock_get_initial_load_size(void H5_ATTR_UNUSED *_udata, size_t
* Return: Non-negative on success/Negative on failure
*
* Programmer: Quincey Koziol
- * koziol@lbl.gov
* November 17, 2016
*
*-------------------------------------------------------------------------
@@ -410,7 +408,6 @@ H5F__cache_superblock_verify_chksum(const void *_image, size_t len, void *_udata
* Failure: NULL
*
* Programmer: Quincey Koziol
- * koziol@hdfgroup.org
* July 18 2013
*
*-------------------------------------------------------------------------
@@ -603,7 +600,6 @@ done:
* Return: Non-negative on success/Negative on failure
*
* Programmer: Quincey Koziol
- * koziol@hdfgroup.org
* July 19, 2013
*
*-------------------------------------------------------------------------
@@ -635,7 +631,6 @@ H5F__cache_superblock_image_len(const void *_thing, size_t *image_len)
* Return: Non-negative on success/Negative on failure
*
* Programmer: Quincey Koziol
- * koziol@hdfgroup.org
* July 19 2013
*
*-------------------------------------------------------------------------
@@ -777,7 +772,6 @@ done:
* Return: Non-negative on success/Negative on failure
*
* Programmer: Quincey Koziol
- * koziol@hdfgroup.org
* July 20, 2013
*
*-------------------------------------------------------------------------
@@ -811,7 +805,6 @@ done:
* Return: Non-negative on success/Negative on failure
*
* Programmer: Quincey Koziol
- * koziol@hdfgroup.org
* July 20, 2013
*
*-------------------------------------------------------------------------
@@ -838,7 +831,6 @@ H5F__cache_drvrinfo_get_initial_load_size(void H5_ATTR_UNUSED *_udata, size_t *i
* Return: Non-negative on success/Negative on failure
*
* Programmer: Quincey Koziol
- * koziol@lbl.gov
* November 17, 2016
*
*-------------------------------------------------------------------------
@@ -881,7 +873,6 @@ done:
* Failure: NULL
*
* Programmer: Quincey Koziol
- * koziol@hdfgroup.org
* July 20 2013
*
*-------------------------------------------------------------------------
@@ -941,7 +932,6 @@ done:
* Return: Non-negative on success/Negative on failure
*
* Programmer: Quincey Koziol
- * koziol@hdfgroup.org
* July 20, 2013
*
*-------------------------------------------------------------------------
@@ -974,7 +964,6 @@ H5F__cache_drvrinfo_image_len(const void *_thing, size_t *image_len)
* Return: Non-negative on success/Negative on failure
*
* Programmer: Quincey Koziol
- * koziol@hdfgroup.org
* July 20 2013
*
*-------------------------------------------------------------------------
@@ -1036,7 +1025,6 @@ done:
* Return: Non-negative on success/Negative on failure
*
* Programmer: Quincey Koziol
- * koziol@hdfgroup.org
* July 20, 2013
*
*-------------------------------------------------------------------------
diff --git a/src/H5Gbtree2.c b/src/H5Gbtree2.c
index 747abe7..dd147ae 100644
--- a/src/H5Gbtree2.c
+++ b/src/H5Gbtree2.c
@@ -15,7 +15,7 @@
*
* Created: H5Gbtree2.c
* Sep 9 2006
- * Quincey Koziol <koziol@hdfgroup.org>
+ * Quincey Koziol
*
* Purpose: v2 B-tree callbacks for indexing fields on links
*
@@ -70,23 +70,23 @@ typedef struct H5G_fh_ud_cmp_t {
/* v2 B-tree function callbacks */
/* v2 B-tree driver callbacks for 'creation order' index */
-static herr_t H5G_dense_btree2_corder_store(void *native, const void *udata);
-static herr_t H5G_dense_btree2_corder_compare(const void *rec1, const void *rec2, int *result);
-static herr_t H5G_dense_btree2_corder_encode(uint8_t *raw, const void *native, void *ctx);
-static herr_t H5G_dense_btree2_corder_decode(const uint8_t *raw, void *native, void *ctx);
-static herr_t H5G_dense_btree2_corder_debug(FILE *stream, int indent, int fwidth, const void *record,
- const void *_udata);
+static herr_t H5G__dense_btree2_corder_store(void *native, const void *udata);
+static herr_t H5G__dense_btree2_corder_compare(const void *rec1, const void *rec2, int *result);
+static herr_t H5G__dense_btree2_corder_encode(uint8_t *raw, const void *native, void *ctx);
+static herr_t H5G__dense_btree2_corder_decode(const uint8_t *raw, void *native, void *ctx);
+static herr_t H5G__dense_btree2_corder_debug(FILE *stream, int indent, int fwidth, const void *record,
+ const void *_udata);
/* v2 B-tree driver callbacks for 'name' index */
-static herr_t H5G_dense_btree2_name_store(void *native, const void *udata);
+static herr_t H5G__dense_btree2_name_store(void *native, const void *udata);
static herr_t H5G__dense_btree2_name_compare(const void *rec1, const void *rec2, int *result);
-static herr_t H5G_dense_btree2_name_encode(uint8_t *raw, const void *native, void *ctx);
-static herr_t H5G_dense_btree2_name_decode(const uint8_t *raw, void *native, void *ctx);
-static herr_t H5G_dense_btree2_name_debug(FILE *stream, int indent, int fwidth, const void *record,
- const void *_udata);
+static herr_t H5G__dense_btree2_name_encode(uint8_t *raw, const void *native, void *ctx);
+static herr_t H5G__dense_btree2_name_decode(const uint8_t *raw, void *native, void *ctx);
+static herr_t H5G__dense_btree2_name_debug(FILE *stream, int indent, int fwidth, const void *record,
+ const void *_udata);
/* Fractal heap function callbacks */
-static herr_t H5G_dense_fh_name_cmp(const void *obj, size_t obj_len, void *op_data);
+static herr_t H5G__dense_fh_name_cmp(const void *obj, size_t obj_len, void *op_data);
/*********************/
/* Package Variables */
@@ -99,11 +99,11 @@ const H5B2_class_t H5G_BT2_NAME[1] = {{
sizeof(H5G_dense_bt2_name_rec_t), /* Size of native record */
NULL, /* Create client callback context */
NULL, /* Destroy client callback context */
- H5G_dense_btree2_name_store, /* Record storage callback */
+ H5G__dense_btree2_name_store, /* Record storage callback */
H5G__dense_btree2_name_compare, /* Record comparison callback */
- H5G_dense_btree2_name_encode, /* Record encoding callback */
- H5G_dense_btree2_name_decode, /* Record decoding callback */
- H5G_dense_btree2_name_debug /* Record debugging callback */
+ H5G__dense_btree2_name_encode, /* Record encoding callback */
+ H5G__dense_btree2_name_decode, /* Record decoding callback */
+ H5G__dense_btree2_name_debug /* Record debugging callback */
}};
/* v2 B-tree class for indexing 'creation order' field of links */
@@ -114,11 +114,11 @@ const H5B2_class_t H5G_BT2_CORDER[1] = {{
sizeof(H5G_dense_bt2_corder_rec_t), /* Size of native record */
NULL, /* Create client callback context */
NULL, /* Destroy client callback context */
- H5G_dense_btree2_corder_store, /* Record storage callback */
- H5G_dense_btree2_corder_compare, /* Record comparison callback */
- H5G_dense_btree2_corder_encode, /* Record encoding callback */
- H5G_dense_btree2_corder_decode, /* Record decoding callback */
- H5G_dense_btree2_corder_debug /* Record debugging callback */
+ H5G__dense_btree2_corder_store, /* Record storage callback */
+ H5G__dense_btree2_corder_compare, /* Record comparison callback */
+ H5G__dense_btree2_corder_encode, /* Record encoding callback */
+ H5G__dense_btree2_corder_decode, /* Record decoding callback */
+ H5G__dense_btree2_corder_debug /* Record debugging callback */
}};
/*****************************/
@@ -130,7 +130,7 @@ const H5B2_class_t H5G_BT2_CORDER[1] = {{
/*******************/
/*-------------------------------------------------------------------------
- * Function: H5G_dense_fh_name_cmp
+ * Function: H5G__dense_fh_name_cmp
*
* Purpose: Compares the name of a link in a fractal heap to another
* name
@@ -138,19 +138,18 @@ const H5B2_class_t H5G_BT2_CORDER[1] = {{
* Return: SUCCEED/FAIL
*
* Programmer: Quincey Koziol
- * koziol@hdfgroup.org
* Sep 11 2006
*
*-------------------------------------------------------------------------
*/
static herr_t
-H5G_dense_fh_name_cmp(const void *obj, size_t obj_len, void *_udata)
+H5G__dense_fh_name_cmp(const void *obj, size_t obj_len, void *_udata)
{
H5G_fh_ud_cmp_t *udata = (H5G_fh_ud_cmp_t *)_udata; /* User data for 'op' callback */
H5O_link_t * lnk; /* Pointer to link created from heap object */
herr_t ret_value = SUCCEED; /* Return value */
- FUNC_ENTER_NOAPI_NOINIT
+ FUNC_ENTER_STATIC
/* Decode link information */
if (NULL == (lnk = (H5O_link_t *)H5O_msg_decode(udata->f, NULL, H5O_LINK_ID, obj_len,
@@ -171,10 +170,10 @@ H5G_dense_fh_name_cmp(const void *obj, size_t obj_len, void *_udata)
done:
FUNC_LEAVE_NOAPI(ret_value)
-} /* end H5G_dense_fh_name_cmp() */
+} /* end H5G__dense_fh_name_cmp() */
/*-------------------------------------------------------------------------
- * Function: H5G_dense_btree2_name_store
+ * Function: H5G__dense_btree2_name_store
*
* Purpose: Store user information into native record for v2 B-tree
*
@@ -187,19 +186,19 @@ done:
*-------------------------------------------------------------------------
*/
static herr_t
-H5G_dense_btree2_name_store(void *_nrecord, const void *_udata)
+H5G__dense_btree2_name_store(void *_nrecord, const void *_udata)
{
const H5G_bt2_ud_ins_t * udata = (const H5G_bt2_ud_ins_t *)_udata;
H5G_dense_bt2_name_rec_t *nrecord = (H5G_dense_bt2_name_rec_t *)_nrecord;
- FUNC_ENTER_NOAPI_NOINIT_NOERR
+ FUNC_ENTER_STATIC_NOERR
/* Copy user information info native record */
nrecord->hash = udata->common.name_hash;
H5MM_memcpy(nrecord->id, udata->id, (size_t)H5G_DENSE_FHEAP_ID_LEN);
FUNC_LEAVE_NOAPI(SUCCEED)
-} /* H5G_dense_btree2_name_store() */
+} /* H5G__dense_btree2_name_store() */
/*-------------------------------------------------------------------------
* Function: H5G__dense_btree2_name_compare
@@ -228,17 +227,6 @@ H5G__dense_btree2_name_compare(const void *_bt2_udata, const void *_bt2_rec, int
HDassert(bt2_udata);
HDassert(bt2_rec);
-#ifdef QAK
- {
- unsigned u;
-
- HDfprintf(stderr, "%s: bt2_udata = {'%s', %x}\n", "H5G__dense_btree2_name_compare", bt2_udata->name,
- (unsigned)bt2_udata->name_hash);
- HDfprintf(stderr, "%s: bt2_rec = {%x, ", "H5G__dense_btree2_name_compare", (unsigned)bt2_rec->hash);
- for (u = 0; u < H5G_DENSE_FHEAP_ID_LEN; u++)
- HDfprintf(stderr, "%02x%s", bt2_rec->id[u], (u < (H5G_DENSE_FHEAP_ID_LEN - 1) ? " " : "}\n"));
- }
-#endif /* QAK */
/* Check hash value */
if (bt2_udata->name_hash < bt2_rec->hash)
*result = (-1);
@@ -261,7 +249,7 @@ H5G__dense_btree2_name_compare(const void *_bt2_udata, const void *_bt2_rec, int
fh_udata.cmp = 0;
/* Check if the user's link and the B-tree's link have the same name */
- if (H5HF_op(bt2_udata->fheap, bt2_rec->id, H5G_dense_fh_name_cmp, &fh_udata) < 0)
+ if (H5HF_op(bt2_udata->fheap, bt2_rec->id, H5G__dense_fh_name_cmp, &fh_udata) < 0)
HGOTO_ERROR(H5E_HEAP, H5E_CANTCOMPARE, FAIL, "can't compare btree2 records")
/* Callback will set comparison value */
@@ -273,7 +261,7 @@ done:
} /* H5G__dense_btree2_name_compare() */
/*-------------------------------------------------------------------------
- * Function: H5G_dense_btree2_name_encode
+ * Function: H5G__dense_btree2_name_encode
*
* Purpose: Encode native information into raw form for storing on disk
*
@@ -286,21 +274,21 @@ done:
*-------------------------------------------------------------------------
*/
static herr_t
-H5G_dense_btree2_name_encode(uint8_t *raw, const void *_nrecord, void H5_ATTR_UNUSED *ctx)
+H5G__dense_btree2_name_encode(uint8_t *raw, const void *_nrecord, void H5_ATTR_UNUSED *ctx)
{
const H5G_dense_bt2_name_rec_t *nrecord = (const H5G_dense_bt2_name_rec_t *)_nrecord;
- FUNC_ENTER_NOAPI_NOINIT_NOERR
+ FUNC_ENTER_STATIC_NOERR
/* Encode the record's fields */
UINT32ENCODE(raw, nrecord->hash)
H5MM_memcpy(raw, nrecord->id, (size_t)H5G_DENSE_FHEAP_ID_LEN);
FUNC_LEAVE_NOAPI(SUCCEED)
-} /* H5G_dense_btree2_name_encode() */
+} /* H5G__dense_btree2_name_encode() */
/*-------------------------------------------------------------------------
- * Function: H5G_dense_btree2_name_decode
+ * Function: H5G__dense_btree2_name_decode
*
* Purpose: Decode raw disk form of record into native form
*
@@ -313,21 +301,21 @@ H5G_dense_btree2_name_encode(uint8_t *raw, const void *_nrecord, void H5_ATTR_UN
*-------------------------------------------------------------------------
*/
static herr_t
-H5G_dense_btree2_name_decode(const uint8_t *raw, void *_nrecord, void H5_ATTR_UNUSED *ctx)
+H5G__dense_btree2_name_decode(const uint8_t *raw, void *_nrecord, void H5_ATTR_UNUSED *ctx)
{
H5G_dense_bt2_name_rec_t *nrecord = (H5G_dense_bt2_name_rec_t *)_nrecord;
- FUNC_ENTER_NOAPI_NOINIT_NOERR
+ FUNC_ENTER_STATIC_NOERR
/* Decode the record's fields */
UINT32DECODE(raw, nrecord->hash)
H5MM_memcpy(nrecord->id, raw, (size_t)H5G_DENSE_FHEAP_ID_LEN);
FUNC_LEAVE_NOAPI(SUCCEED)
-} /* H5G_dense_btree2_name_decode() */
+} /* H5G__dense_btree2_name_decode() */
/*-------------------------------------------------------------------------
- * Function: H5G_dense_btree2_name_debug
+ * Function: H5G__dense_btree2_name_debug
*
* Purpose: Debug native form of record
*
@@ -340,23 +328,23 @@ H5G_dense_btree2_name_decode(const uint8_t *raw, void *_nrecord, void H5_ATTR_UN
*-------------------------------------------------------------------------
*/
static herr_t
-H5G_dense_btree2_name_debug(FILE *stream, int indent, int fwidth, const void *_nrecord,
- const void H5_ATTR_UNUSED *_udata)
+H5G__dense_btree2_name_debug(FILE *stream, int indent, int fwidth, const void *_nrecord,
+ const void H5_ATTR_UNUSED *_udata)
{
const H5G_dense_bt2_name_rec_t *nrecord = (const H5G_dense_bt2_name_rec_t *)_nrecord;
unsigned u; /* Local index variable */
- FUNC_ENTER_NOAPI_NOINIT_NOERR
+ FUNC_ENTER_STATIC_NOERR
HDfprintf(stream, "%*s%-*s {%x, ", indent, "", fwidth, "Record:", (unsigned)nrecord->hash);
for (u = 0; u < H5G_DENSE_FHEAP_ID_LEN; u++)
HDfprintf(stderr, "%02x%s", nrecord->id[u], (u < (H5G_DENSE_FHEAP_ID_LEN - 1) ? " " : "}\n"));
FUNC_LEAVE_NOAPI(SUCCEED)
-} /* H5G_dense_btree2_name_debug() */
+} /* H5G__dense_btree2_name_debug() */
/*-------------------------------------------------------------------------
- * Function: H5G_dense_btree2_corder_store
+ * Function: H5G__dense_btree2_corder_store
*
* Purpose: Store user information into native record for v2 B-tree
*
@@ -369,22 +357,22 @@ H5G_dense_btree2_name_debug(FILE *stream, int indent, int fwidth, const void *_n
*-------------------------------------------------------------------------
*/
static herr_t
-H5G_dense_btree2_corder_store(void *_nrecord, const void *_udata)
+H5G__dense_btree2_corder_store(void *_nrecord, const void *_udata)
{
const H5G_bt2_ud_ins_t * udata = (const H5G_bt2_ud_ins_t *)_udata;
H5G_dense_bt2_corder_rec_t *nrecord = (H5G_dense_bt2_corder_rec_t *)_nrecord;
- FUNC_ENTER_NOAPI_NOINIT_NOERR
+ FUNC_ENTER_STATIC_NOERR
/* Copy user information info native record */
nrecord->corder = udata->common.corder;
H5MM_memcpy(nrecord->id, udata->id, (size_t)H5G_DENSE_FHEAP_ID_LEN);
FUNC_LEAVE_NOAPI(SUCCEED)
-} /* H5G_dense_btree2_corder_store() */
+} /* H5G__dense_btree2_corder_store() */
/*-------------------------------------------------------------------------
- * Function: H5G_dense_btree2_corder_compare
+ * Function: H5G__dense_btree2_corder_compare
*
* Purpose: Compare two native information records, according to some key
*
@@ -398,29 +386,17 @@ H5G_dense_btree2_corder_store(void *_nrecord, const void *_udata)
*-------------------------------------------------------------------------
*/
static herr_t
-H5G_dense_btree2_corder_compare(const void *_bt2_udata, const void *_bt2_rec, int *result)
+H5G__dense_btree2_corder_compare(const void *_bt2_udata, const void *_bt2_rec, int *result)
{
const H5G_bt2_ud_common_t * bt2_udata = (const H5G_bt2_ud_common_t *)_bt2_udata;
const H5G_dense_bt2_corder_rec_t *bt2_rec = (const H5G_dense_bt2_corder_rec_t *)_bt2_rec;
- FUNC_ENTER_NOAPI_NOINIT_NOERR
+ FUNC_ENTER_STATIC_NOERR
/* Sanity check */
HDassert(bt2_udata);
HDassert(bt2_rec);
-#ifdef QAK
- {
- unsigned u;
-
- HDfprintf(stderr, "%s: bt2_udata->corder = %Hd\n", "H5G_dense_btree2_corder_compare",
- (hsize_t)bt2_udata->corder);
- HDfprintf(stderr, "%s: bt2_rec = {%Hu, ", "H5G_dense_btree2_corder_compare",
- (hsize_t)bt2_rec->corder);
- for (u = 0; u < H5G_DENSE_FHEAP_ID_LEN; u++)
- HDfprintf(stderr, "%02x%s", bt2_rec->id[u], (u < (H5G_DENSE_FHEAP_ID_LEN - 1) ? " " : "}\n"));
- }
-#endif /* QAK */
/* Check creation order value */
if (bt2_udata->corder < bt2_rec->corder)
*result = -1;
@@ -430,10 +406,10 @@ H5G_dense_btree2_corder_compare(const void *_bt2_udata, const void *_bt2_rec, in
*result = 0;
FUNC_LEAVE_NOAPI(SUCCEED)
-} /* H5G_dense_btree2_corder_compare() */
+} /* H5G__dense_btree2_corder_compare() */
/*-------------------------------------------------------------------------
- * Function: H5G_dense_btree2_corder_encode
+ * Function: H5G__dense_btree2_corder_encode
*
* Purpose: Encode native information into raw form for storing on disk
*
@@ -446,21 +422,21 @@ H5G_dense_btree2_corder_compare(const void *_bt2_udata, const void *_bt2_rec, in
*-------------------------------------------------------------------------
*/
static herr_t
-H5G_dense_btree2_corder_encode(uint8_t *raw, const void *_nrecord, void H5_ATTR_UNUSED *ctx)
+H5G__dense_btree2_corder_encode(uint8_t *raw, const void *_nrecord, void H5_ATTR_UNUSED *ctx)
{
const H5G_dense_bt2_corder_rec_t *nrecord = (const H5G_dense_bt2_corder_rec_t *)_nrecord;
- FUNC_ENTER_NOAPI_NOINIT_NOERR
+ FUNC_ENTER_STATIC_NOERR
/* Encode the record's fields */
INT64ENCODE(raw, nrecord->corder)
H5MM_memcpy(raw, nrecord->id, (size_t)H5G_DENSE_FHEAP_ID_LEN);
FUNC_LEAVE_NOAPI(SUCCEED)
-} /* H5G_dense_btree2_corder_encode() */
+} /* H5G__dense_btree2_corder_encode() */
/*-------------------------------------------------------------------------
- * Function: H5G_dense_btree2_corder_decode
+ * Function: H5G__dense_btree2_corder_decode
*
* Purpose: Decode raw disk form of record into native form
*
@@ -473,21 +449,21 @@ H5G_dense_btree2_corder_encode(uint8_t *raw, const void *_nrecord, void H5_ATTR_
*-------------------------------------------------------------------------
*/
static herr_t
-H5G_dense_btree2_corder_decode(const uint8_t *raw, void *_nrecord, void H5_ATTR_UNUSED *ctx)
+H5G__dense_btree2_corder_decode(const uint8_t *raw, void *_nrecord, void H5_ATTR_UNUSED *ctx)
{
H5G_dense_bt2_corder_rec_t *nrecord = (H5G_dense_bt2_corder_rec_t *)_nrecord;
- FUNC_ENTER_NOAPI_NOINIT_NOERR
+ FUNC_ENTER_STATIC_NOERR
/* Decode the record's fields */
INT64DECODE(raw, nrecord->corder)
H5MM_memcpy(nrecord->id, raw, (size_t)H5G_DENSE_FHEAP_ID_LEN);
FUNC_LEAVE_NOAPI(SUCCEED)
-} /* H5G_dense_btree2_corder_decode() */
+} /* H5G__dense_btree2_corder_decode() */
/*-------------------------------------------------------------------------
- * Function: H5G_dense_btree2_corder_debug
+ * Function: H5G__dense_btree2_corder_debug
*
* Purpose: Debug native form of record
*
@@ -500,17 +476,17 @@ H5G_dense_btree2_corder_decode(const uint8_t *raw, void *_nrecord, void H5_ATTR_
*-------------------------------------------------------------------------
*/
static herr_t
-H5G_dense_btree2_corder_debug(FILE *stream, int indent, int fwidth, const void *_nrecord,
- const void H5_ATTR_UNUSED *_udata)
+H5G__dense_btree2_corder_debug(FILE *stream, int indent, int fwidth, const void *_nrecord,
+ const void H5_ATTR_UNUSED *_udata)
{
const H5G_dense_bt2_corder_rec_t *nrecord = (const H5G_dense_bt2_corder_rec_t *)_nrecord;
unsigned u; /* Local index variable */
- FUNC_ENTER_NOAPI_NOINIT_NOERR
+ FUNC_ENTER_STATIC_NOERR
HDfprintf(stream, "%*s%-*s {%llu, ", indent, "", fwidth, "Record:", (unsigned long long)nrecord->corder);
for (u = 0; u < H5G_DENSE_FHEAP_ID_LEN; u++)
HDfprintf(stderr, "%02x%s", nrecord->id[u], (u < (H5G_DENSE_FHEAP_ID_LEN - 1) ? " " : "}\n"));
FUNC_LEAVE_NOAPI(SUCCEED)
-} /* H5G_dense_btree2_corder_debug() */
+} /* H5G__dense_btree2_corder_debug() */
diff --git a/src/H5Gcompact.c b/src/H5Gcompact.c
index 7796420..af188d8 100644
--- a/src/H5Gcompact.c
+++ b/src/H5Gcompact.c
@@ -15,7 +15,7 @@
*
* Created: H5Gcompact.c
* Sep 5 2005
- * Quincey Koziol <koziol@ncsa.uiuc.edu>
+ * Quincey Koziol
*
* Purpose: Functions for handling compact storage.
*
@@ -72,7 +72,6 @@ static herr_t H5G__compact_lookup_cb(const void *_mesg, unsigned H5_ATTR_UNUSED
* Return: SUCCEED/FAIL
*
* Programmer: Quincey Koziol
- * koziol@ncsa.uiuc.edu
* Sep 5 2005
*
*-------------------------------------------------------------------------
@@ -173,7 +172,6 @@ done:
* Return: Non-negative on success/Negative on failure
*
* Programmer: Quincey Koziol
- * koziol@ncsa.uiuc.edu
* Sep 6 2005
*
*-------------------------------------------------------------------------
@@ -249,7 +247,7 @@ done:
} /* end H5G__compact_get_name_by_idx() */
/*-------------------------------------------------------------------------
- * Function: H5G_compact_remove_common_cb
+ * Function: H5G__compact_remove_common_cb
*
* Purpose: Common callback routine for deleting 'link' message for a
* particular name.
@@ -257,19 +255,18 @@ done:
* Return: Non-negative on success/Negative on failure
*
* Programmer: Quincey Koziol
- * koziol@ncsa.uiuc.edu
* Sep 5 2005
*
*-------------------------------------------------------------------------
*/
static herr_t
-H5G_compact_remove_common_cb(const void *_mesg, unsigned H5_ATTR_UNUSED idx, void *_udata)
+H5G__compact_remove_common_cb(const void *_mesg, unsigned H5_ATTR_UNUSED idx, void *_udata)
{
const H5O_link_t *lnk = (const H5O_link_t *)_mesg; /* Pointer to link */
H5G_iter_rm_t * udata = (H5G_iter_rm_t *)_udata; /* 'User data' passed in */
herr_t ret_value = H5_ITER_CONT; /* Return value */
- FUNC_ENTER_NOAPI_NOINIT
+ FUNC_ENTER_STATIC
/* check arguments */
HDassert(lnk);
@@ -287,7 +284,7 @@ H5G_compact_remove_common_cb(const void *_mesg, unsigned H5_ATTR_UNUSED idx, voi
done:
FUNC_LEAVE_NOAPI(ret_value)
-} /* end H5G_compact_remove_common_cb() */
+} /* end H5G__compact_remove_common_cb() */
/*-------------------------------------------------------------------------
* Function: H5G__compact_remove
@@ -318,7 +315,7 @@ H5G__compact_remove(const H5O_loc_t *oloc, H5RS_str_t *grp_full_path_r, const ch
udata.name = name;
/* Iterate over the link messages to delete the right one */
- if (H5O_msg_remove_op(oloc, H5O_LINK_ID, H5O_FIRST, H5G_compact_remove_common_cb, &udata, TRUE) < 0)
+ if (H5O_msg_remove_op(oloc, H5O_LINK_ID, H5O_FIRST, H5G__compact_remove_common_cb, &udata, TRUE) < 0)
HGOTO_ERROR(H5E_SYM, H5E_CANTDELETE, FAIL, "unable to delete link message")
done:
@@ -364,7 +361,7 @@ H5G__compact_remove_by_idx(const H5O_loc_t *oloc, const H5O_linfo_t *linfo, H5RS
udata.name = ltable.lnks[n].name;
/* Iterate over the link messages to delete the right one */
- if (H5O_msg_remove_op(oloc, H5O_LINK_ID, H5O_FIRST, H5G_compact_remove_common_cb, &udata, TRUE) < 0)
+ if (H5O_msg_remove_op(oloc, H5O_LINK_ID, H5O_FIRST, H5G__compact_remove_common_cb, &udata, TRUE) < 0)
HGOTO_ERROR(H5E_SYM, H5E_CANTDELETE, FAIL, "unable to delete link message")
done:
@@ -427,7 +424,6 @@ done:
* Return: SUCCEED/FAIL
*
* Programmer: Quincey Koziol
- * koziol@ncsa.uiuc.edu
* Sep 20 2005
*
*-------------------------------------------------------------------------
@@ -472,7 +468,6 @@ done:
* Return: Non-negative (TRUE/FALSE) on success/Negative on failure
*
* Programmer: Quincey Koziol
- * koziol@ncsa.uiuc.edu
* Sep 20 2005
*
*-------------------------------------------------------------------------
@@ -517,7 +512,6 @@ done:
* Return: Non-negative on success/Negative on failure
*
* Programmer: Quincey Koziol
- * koziol@hdfgroup.org
* Nov 6 2006
*
*-------------------------------------------------------------------------
diff --git a/src/H5Gdense.c b/src/H5Gdense.c
index 84df574..171df9e 100644
--- a/src/H5Gdense.c
+++ b/src/H5Gdense.c
@@ -15,7 +15,7 @@
*
* Created: H5Gdense.c
* Sep 9 2006
- * Quincey Koziol <koziol@hdfgroup.org>
+ * Quincey Koziol
*
* Purpose: Routines for operating on "dense" link storage for a
* group in a file.
@@ -241,7 +241,6 @@ typedef struct {
* Return: Non-negative on success/Negative on failure
*
* Programmer: Quincey Koziol
- * koziol@hdfgroup.org
* Sep 9 2006
*
*-------------------------------------------------------------------------
@@ -285,17 +284,11 @@ H5G__dense_create(H5F_t *f, H5O_linfo_t *linfo, const H5O_pline_t *pline)
/* Retrieve the heap's address in the file */
if (H5HF_get_heap_addr(fheap, &(linfo->fheap_addr)) < 0)
HGOTO_ERROR(H5E_SYM, H5E_CANTGET, FAIL, "can't get fractal heap address")
-#ifdef QAK
- HDfprintf(stderr, "%s: linfo->fheap_addr = %a\n", FUNC, linfo->fheap_addr);
-#endif /* QAK */
/* Retrieve the heap's ID length in the file */
if (H5HF_get_id_len(fheap, &fheap_id_len) < 0)
HGOTO_ERROR(H5E_SYM, H5E_CANTGETSIZE, FAIL, "can't get fractal heap ID length")
HDassert(fheap_id_len == H5G_DENSE_FHEAP_ID_LEN);
-#ifdef QAK
- HDfprintf(stderr, "%s: fheap_id_len = %Zu\n", FUNC, fheap_id_len);
-#endif /* QAK */
/* Create the name index v2 B-tree */
HDmemset(&bt2_cparam, 0, sizeof(bt2_cparam));
@@ -312,9 +305,6 @@ H5G__dense_create(H5F_t *f, H5O_linfo_t *linfo, const H5O_pline_t *pline)
/* Retrieve the v2 B-tree's address in the file */
if (H5B2_get_addr(bt2_name, &(linfo->name_bt2_addr)) < 0)
HGOTO_ERROR(H5E_SYM, H5E_CANTGET, FAIL, "can't get v2 B-tree address for name index")
-#ifdef QAK
- HDfprintf(stderr, "%s: linfo->name_bt2_addr = %a\n", FUNC, linfo->name_bt2_addr);
-#endif /* QAK */
/* Check if we should create a creation order index v2 B-tree */
if (linfo->index_corder) {
@@ -333,10 +323,7 @@ H5G__dense_create(H5F_t *f, H5O_linfo_t *linfo, const H5O_pline_t *pline)
/* Retrieve the v2 B-tree's address in the file */
if (H5B2_get_addr(bt2_corder, &(linfo->corder_bt2_addr)) < 0)
HGOTO_ERROR(H5E_SYM, H5E_CANTGET, FAIL, "can't get v2 B-tree address for creation order index")
-#ifdef QAK
- HDfprintf(stderr, "%s: linfo->corder_bt2_addr = %a\n", FUNC, linfo->corder_bt2_addr);
-#endif /* QAK */
- } /* end if */
+ } /* end if */
done:
/* Close the open objects */
@@ -358,7 +345,6 @@ done:
* Return: Non-negative on success/Negative on failure
*
* Programmer: Quincey Koziol
- * koziol@hdfgroup.org
* Sep 11 2006
*
*-------------------------------------------------------------------------
@@ -384,18 +370,10 @@ H5G__dense_insert(H5F_t *f, const H5O_linfo_t *linfo, const H5O_link_t *lnk)
HDassert(f);
HDassert(linfo);
HDassert(lnk);
-#ifdef QAK
- HDfprintf(stderr, "%s: linfo->fheap_addr = %a\n", FUNC, linfo->fheap_addr);
- HDfprintf(stderr, "%s: linfo->name_bt2_addr = %a\n", FUNC, linfo->name_bt2_addr);
-#endif /* QAK */
/* Find out the size of buffer needed for serialized link */
if ((link_size = H5O_msg_raw_size(f, H5O_LINK_ID, FALSE, lnk)) == 0)
HGOTO_ERROR(H5E_SYM, H5E_CANTGETSIZE, FAIL, "can't get link size")
-#ifdef QAK
- HDfprintf(stderr, "%s: HDstrlen(lnk->name) = %Zu, link_size = %Zu\n", FUNC, HDstrlen(lnk->name),
- link_size);
-#endif /* QAK */
/* Wrap the local buffer for serialized link */
if (NULL == (wb = H5WB_wrap(link_buf, sizeof(link_buf))))
@@ -462,26 +440,25 @@ done:
} /* end H5G__dense_insert() */
/*-------------------------------------------------------------------------
- * Function: H5G_dense_lookup_cb
+ * Function: H5G__dense_lookup_cb
*
* Purpose: Callback when a link is located in an index
*
* Return: Non-negative on success/Negative on failure
*
* Programmer: Quincey Koziol
- * koziol@hdfgroup.org
* Sep 11 2006
*
*-------------------------------------------------------------------------
*/
static herr_t
-H5G_dense_lookup_cb(const void *_lnk, void *_user_lnk)
+H5G__dense_lookup_cb(const void *_lnk, void *_user_lnk)
{
const H5O_link_t *lnk = (const H5O_link_t *)_lnk; /* Record from B-tree */
H5O_link_t * user_lnk = (H5O_link_t *)_user_lnk; /* User data from v2 B-tree link lookup */
herr_t ret_value = SUCCEED; /* Return value */
- FUNC_ENTER_NOAPI_NOINIT
+ FUNC_ENTER_STATIC
/*
* Check arguments.
@@ -495,17 +472,16 @@ H5G_dense_lookup_cb(const void *_lnk, void *_user_lnk)
done:
FUNC_LEAVE_NOAPI(ret_value)
-} /* end H5G_dense_lookup_cb() */
+} /* end H5G__dense_lookup_cb() */
/*-------------------------------------------------------------------------
* Function: H5G__dense_lookup
*
* Purpose: Look up a link within a group that uses dense link storage
*
- * Return: Non-negative (TRUE/FALSE) on success/Negative on failure
+ * Return: SUCCEED/FAIL
*
* Programmer: Quincey Koziol
- * koziol@hdfgroup.org
* Sep 11 2006
*
*-------------------------------------------------------------------------
@@ -541,7 +517,7 @@ H5G__dense_lookup(H5F_t *f, const H5O_linfo_t *linfo, const char *name, H5O_link
udata.fheap = fheap;
udata.name = name;
udata.name_hash = H5_checksum_lookup3(name, HDstrlen(name), 0);
- udata.found_op = H5G_dense_lookup_cb; /* v2 B-tree comparison callback */
+ udata.found_op = H5G__dense_lookup_cb; /* v2 B-tree comparison callback */
udata.found_op_data = lnk;
/* Find & copy the named link in the 'name' index */
@@ -559,7 +535,7 @@ done:
} /* end H5G__dense_lookup() */
/*-------------------------------------------------------------------------
- * Function: H5G_dense_lookup_by_idx_fh_cb
+ * Function: H5G__dense_lookup_by_idx_fh_cb
*
* Purpose: Callback for fractal heap operator, to make copy of link when
* when lookup up a link by index
@@ -567,19 +543,18 @@ done:
* Return: SUCCEED/FAIL
*
* Programmer: Quincey Koziol
- * koziol@hdfgroup.org
* Nov 7 2006
*
*-------------------------------------------------------------------------
*/
static herr_t
-H5G_dense_lookup_by_idx_fh_cb(const void *obj, size_t obj_len, void *_udata)
+H5G__dense_lookup_by_idx_fh_cb(const void *obj, size_t obj_len, void *_udata)
{
H5G_fh_ud_lbi_t *udata = (H5G_fh_ud_lbi_t *)_udata; /* User data for fractal heap 'op' callback */
H5O_link_t * tmp_lnk = NULL; /* Temporary pointer to link */
herr_t ret_value = SUCCEED; /* Return value */
- FUNC_ENTER_NOAPI_NOINIT
+ FUNC_ENTER_STATIC
/* Decode link information & keep a copy */
if (NULL == (tmp_lnk = (H5O_link_t *)H5O_msg_decode(udata->f, NULL, H5O_LINK_ID, obj_len,
@@ -596,30 +571,29 @@ done:
H5O_msg_free(H5O_LINK_ID, tmp_lnk);
FUNC_LEAVE_NOAPI(ret_value)
-} /* end H5G_dense_lookup_by_idx_fh_cb() */
+} /* end H5G__dense_lookup_by_idx_fh_cb() */
/*-------------------------------------------------------------------------
- * Function: H5G_dense_lookup_by_idx_bt2_cb
+ * Function: H5G__dense_lookup_by_idx_bt2_cb
*
* Purpose: v2 B-tree callback for dense link storage lookup by index
*
* Return: H5_ITER_ERROR/H5_ITER_CONT/H5_ITER_STOP
*
* Programmer: Quincey Koziol
- * koziol@hdfgroup.org
* Nov 7 2006
*
*-------------------------------------------------------------------------
*/
static herr_t
-H5G_dense_lookup_by_idx_bt2_cb(const void *_record, void *_bt2_udata)
+H5G__dense_lookup_by_idx_bt2_cb(const void *_record, void *_bt2_udata)
{
const H5G_dense_bt2_name_rec_t *record = (const H5G_dense_bt2_name_rec_t *)_record;
H5G_bt2_ud_lbi_t * bt2_udata = (H5G_bt2_ud_lbi_t *)_bt2_udata; /* User data for callback */
H5G_fh_ud_lbi_t fh_udata; /* User data for fractal heap 'op' callback */
int ret_value = H5_ITER_CONT; /* Return value */
- FUNC_ENTER_NOAPI_NOINIT
+ FUNC_ENTER_STATIC
/* Prepare user data for callback */
/* down */
@@ -627,12 +601,12 @@ H5G_dense_lookup_by_idx_bt2_cb(const void *_record, void *_bt2_udata)
fh_udata.lnk = bt2_udata->lnk;
/* Call fractal heap 'op' routine, to copy the link information */
- if (H5HF_op(bt2_udata->fheap, record->id, H5G_dense_lookup_by_idx_fh_cb, &fh_udata) < 0)
+ if (H5HF_op(bt2_udata->fheap, record->id, H5G__dense_lookup_by_idx_fh_cb, &fh_udata) < 0)
HGOTO_ERROR(H5E_SYM, H5E_CANTOPERATE, H5_ITER_ERROR, "link found callback failed")
done:
FUNC_LEAVE_NOAPI(ret_value)
-} /* end H5G_dense_lookup_by_idx_bt2_cb() */
+} /* end H5G__dense_lookup_by_idx_bt2_cb() */
/*-------------------------------------------------------------------------
* Function: H5G__dense_lookup_by_idx
@@ -643,7 +617,6 @@ done:
* Return: Non-negative on success/Negative on failure
*
* Programmer: Quincey Koziol
- * koziol@hdfgroup.org
* Nov 7 2006
*
*-------------------------------------------------------------------------
@@ -713,7 +686,7 @@ H5G__dense_lookup_by_idx(H5F_t *f, const H5O_linfo_t *linfo, H5_index_t idx_type
udata.lnk = lnk;
/* Find & copy the link in the appropriate index */
- if (H5B2_index(bt2, order, n, H5G_dense_lookup_by_idx_bt2_cb, &udata) < 0)
+ if (H5B2_index(bt2, order, n, H5G__dense_lookup_by_idx_bt2_cb, &udata) < 0)
HGOTO_ERROR(H5E_SYM, H5E_CANTINSERT, FAIL, "unable to locate link in index")
} /* end if */
else { /* Otherwise, we need to build a table of the links and sort it */
@@ -743,7 +716,7 @@ done:
} /* end H5G__dense_lookup_by_idx() */
/*-------------------------------------------------------------------------
- * Function: H5G_dense_build_table_cb
+ * Function: H5G__dense_build_table_cb
*
* Purpose: Callback routine for building table of links from dense
* link storage.
@@ -752,18 +725,17 @@ done:
* Failure: Negative
*
* Programmer: Quincey Koziol
- * koziol@hdfgroup.org
* Sept 25 2006
*
*-------------------------------------------------------------------------
*/
static herr_t
-H5G_dense_build_table_cb(const H5O_link_t *lnk, void *_udata)
+H5G__dense_build_table_cb(const H5O_link_t *lnk, void *_udata)
{
H5G_dense_bt_ud_t *udata = (H5G_dense_bt_ud_t *)_udata; /* 'User data' passed in */
herr_t ret_value = H5_ITER_CONT; /* Return value */
- FUNC_ENTER_NOAPI_NOINIT
+ FUNC_ENTER_STATIC
/* check arguments */
HDassert(lnk);
@@ -779,7 +751,7 @@ H5G_dense_build_table_cb(const H5O_link_t *lnk, void *_udata)
done:
FUNC_LEAVE_NOAPI(ret_value)
-} /* end H5G_dense_build_table_cb() */
+} /* end H5G__dense_build_table_cb() */
/*-------------------------------------------------------------------------
* Function: H5G__dense_build_table
@@ -828,7 +800,7 @@ H5G__dense_build_table(H5F_t *f, const H5O_linfo_t *linfo, H5_index_t idx_type,
/* Iterate over the links in the group, building a table of the link messages */
if (H5G__dense_iterate(f, linfo, H5_INDEX_NAME, H5_ITER_NATIVE, (hsize_t)0, NULL,
- H5G_dense_build_table_cb, &udata) < 0)
+ H5G__dense_build_table_cb, &udata) < 0)
HGOTO_ERROR(H5E_SYM, H5E_CANTNEXT, FAIL, "error iterating over links")
/* Sort link table in correct iteration order */
@@ -843,7 +815,7 @@ done:
} /* end H5G__dense_build_table() */
/*-------------------------------------------------------------------------
- * Function: H5G_dense_iterate_fh_cb
+ * Function: H5G__dense_iterate_fh_cb
*
* Purpose: Callback for fractal heap operator, to make user's callback
* when iterating over links
@@ -851,18 +823,17 @@ done:
* Return: SUCCEED/FAIL
*
* Programmer: Quincey Koziol
- * koziol@hdfgroup.org
* Sep 11 2006
*
*-------------------------------------------------------------------------
*/
static herr_t
-H5G_dense_iterate_fh_cb(const void *obj, size_t obj_len, void *_udata)
+H5G__dense_iterate_fh_cb(const void *obj, size_t obj_len, void *_udata)
{
H5G_fh_ud_it_t *udata = (H5G_fh_ud_it_t *)_udata; /* User data for fractal heap 'op' callback */
herr_t ret_value = SUCCEED; /* Return value */
- FUNC_ENTER_NOAPI_NOINIT
+ FUNC_ENTER_STATIC
/* Decode link information & keep a copy */
/* (we make a copy instead of calling the user/library callback directly in
@@ -877,29 +848,28 @@ H5G_dense_iterate_fh_cb(const void *obj, size_t obj_len, void *_udata)
done:
FUNC_LEAVE_NOAPI(ret_value)
-} /* end H5G_dense_iterate_fh_cb() */
+} /* end H5G__dense_iterate_fh_cb() */
/*-------------------------------------------------------------------------
- * Function: H5G_dense_iterate_bt2_cb
+ * Function: H5G__dense_iterate_bt2_cb
*
* Purpose: v2 B-tree callback for dense link storage iterator
*
* Return: H5_ITER_ERROR/H5_ITER_CONT/H5_ITER_STOP
*
* Programmer: Quincey Koziol
- * koziol@hdfgroup.org
* Sep 11 2006
*
*-------------------------------------------------------------------------
*/
static herr_t
-H5G_dense_iterate_bt2_cb(const void *_record, void *_bt2_udata)
+H5G__dense_iterate_bt2_cb(const void *_record, void *_bt2_udata)
{
const H5G_dense_bt2_name_rec_t *record = (const H5G_dense_bt2_name_rec_t *)_record;
H5G_bt2_ud_it_t * bt2_udata = (H5G_bt2_ud_it_t *)_bt2_udata; /* User data for callback */
herr_t ret_value = H5_ITER_CONT; /* Return value */
- FUNC_ENTER_NOAPI_NOINIT
+ FUNC_ENTER_STATIC
/* Check for skipping links */
if (bt2_udata->skip > 0)
@@ -912,7 +882,7 @@ H5G_dense_iterate_bt2_cb(const void *_record, void *_bt2_udata)
fh_udata.f = bt2_udata->f;
/* Call fractal heap 'op' routine, to copy the link information */
- if (H5HF_op(bt2_udata->fheap, record->id, H5G_dense_iterate_fh_cb, &fh_udata) < 0)
+ if (H5HF_op(bt2_udata->fheap, record->id, H5G__dense_iterate_fh_cb, &fh_udata) < 0)
HGOTO_ERROR(H5E_SYM, H5E_CANTOPERATE, H5_ITER_ERROR, "heap op callback failed")
/* Make the callback */
@@ -932,7 +902,7 @@ H5G_dense_iterate_bt2_cb(const void *_record, void *_bt2_udata)
done:
FUNC_LEAVE_NOAPI(ret_value)
-} /* end H5G_dense_iterate_bt2_cb() */
+} /* end H5G__dense_iterate_bt2_cb() */
/*-------------------------------------------------------------------------
* Function: H5G__dense_iterate
@@ -942,7 +912,6 @@ done:
* Return: Non-negative on success/Negative on failure
*
* Programmer: Quincey Koziol
- * koziol@hdfgroup.org
* Sep 11 2006
*
*-------------------------------------------------------------------------
@@ -1019,7 +988,7 @@ H5G__dense_iterate(H5F_t *f, const H5O_linfo_t *linfo, H5_index_t idx_type, H5_i
/* Iterate over the records in the v2 B-tree's "native" order */
/* (by hash of name) */
- if ((ret_value = H5B2_iterate(bt2, H5G_dense_iterate_bt2_cb, &udata)) < 0)
+ if ((ret_value = H5B2_iterate(bt2, H5G__dense_iterate_bt2_cb, &udata)) < 0)
HERROR(H5E_SYM, H5E_BADITER, "link iteration failed");
/* Update the last link examined, if requested */
@@ -1049,7 +1018,7 @@ done:
} /* end H5G__dense_iterate() */
/*-------------------------------------------------------------------------
- * Function: H5G_dense_get_name_by_idx_fh_cb
+ * Function: H5G__dense_get_name_by_idx_fh_cb
*
* Purpose: Callback for fractal heap operator, to retrieve name according
* to an index
@@ -1057,19 +1026,18 @@ done:
* Return: SUCCEED/FAIL
*
* Programmer: Quincey Koziol
- * koziol@hdfgroup.org
* Sep 19 2006
*
*-------------------------------------------------------------------------
*/
static herr_t
-H5G_dense_get_name_by_idx_fh_cb(const void *obj, size_t obj_len, void *_udata)
+H5G__dense_get_name_by_idx_fh_cb(const void *obj, size_t obj_len, void *_udata)
{
H5G_fh_ud_gnbi_t *udata = (H5G_fh_ud_gnbi_t *)_udata; /* User data for fractal heap 'op' callback */
H5O_link_t * lnk; /* Pointer to link created from heap object */
herr_t ret_value = SUCCEED; /* Return value */
- FUNC_ENTER_NOAPI_NOINIT
+ FUNC_ENTER_STATIC
/* Decode link information */
if (NULL == (lnk = (H5O_link_t *)H5O_msg_decode(udata->f, NULL, H5O_LINK_ID, obj_len,
@@ -1091,30 +1059,29 @@ H5G_dense_get_name_by_idx_fh_cb(const void *obj, size_t obj_len, void *_udata)
done:
FUNC_LEAVE_NOAPI(ret_value)
-} /* end H5G_dense_get_name_by_idx_fh_cb() */
+} /* end H5G__dense_get_name_by_idx_fh_cb() */
/*-------------------------------------------------------------------------
- * Function: H5G_dense_get_name_by_idx_bt2_cb
+ * Function: H5G__dense_get_name_by_idx_bt2_cb
*
* Purpose: v2 B-tree callback for dense link storage 'get name by idx' call
*
* Return: Non-negative on success/Negative on failure
*
* Programmer: Quincey Koziol
- * koziol@hdfgroup.org
* Sep 19 2006
*
*-------------------------------------------------------------------------
*/
static herr_t
-H5G_dense_get_name_by_idx_bt2_cb(const void *_record, void *_bt2_udata)
+H5G__dense_get_name_by_idx_bt2_cb(const void *_record, void *_bt2_udata)
{
const H5G_dense_bt2_name_rec_t *record = (const H5G_dense_bt2_name_rec_t *)_record;
H5G_bt2_ud_gnbi_t * bt2_udata = (H5G_bt2_ud_gnbi_t *)_bt2_udata; /* User data for callback */
H5G_fh_ud_gnbi_t fh_udata; /* User data for fractal heap 'op' callback */
herr_t ret_value = SUCCEED; /* Return value */
- FUNC_ENTER_NOAPI_NOINIT
+ FUNC_ENTER_STATIC
/* Prepare user data for callback */
/* down */
@@ -1123,7 +1090,7 @@ H5G_dense_get_name_by_idx_bt2_cb(const void *_record, void *_bt2_udata)
fh_udata.name_size = bt2_udata->name_size;
/* Call fractal heap 'op' routine, to perform user callback */
- if (H5HF_op(bt2_udata->fheap, record->id, H5G_dense_get_name_by_idx_fh_cb, &fh_udata) < 0)
+ if (H5HF_op(bt2_udata->fheap, record->id, H5G__dense_get_name_by_idx_fh_cb, &fh_udata) < 0)
HGOTO_ERROR(H5E_SYM, H5E_CANTOPERATE, FAIL, "link found callback failed")
/* Set the name's full length to return */
@@ -1131,7 +1098,7 @@ H5G_dense_get_name_by_idx_bt2_cb(const void *_record, void *_bt2_udata)
done:
FUNC_LEAVE_NOAPI(ret_value)
-} /* end H5G_dense_get_name_by_idx_bt2_cb() */
+} /* end H5G__dense_get_name_by_idx_bt2_cb() */
/*-------------------------------------------------------------------------
* Function: H5G__dense_get_name_by_idx
@@ -1142,7 +1109,6 @@ done:
* Failure: Negative
*
* Programmer: Quincey Koziol
- * koziol@hdfgroup.org
* Sep 19 2006
*
*-------------------------------------------------------------------------
@@ -1212,7 +1178,7 @@ H5G__dense_get_name_by_idx(H5F_t *f, H5O_linfo_t *linfo, H5_index_t idx_type, H5
udata.name_size = size;
/* Retrieve the name according to the v2 B-tree's index order */
- if (H5B2_index(bt2, order, n, H5G_dense_get_name_by_idx_bt2_cb, &udata) < 0)
+ if (H5B2_index(bt2, order, n, H5G__dense_get_name_by_idx_bt2_cb, &udata) < 0)
HGOTO_ERROR(H5E_SYM, H5E_CANTLIST, FAIL, "can't locate object in v2 B-tree")
/* Set return value */
@@ -1251,27 +1217,26 @@ done:
} /* end H5G__dense_get_name_by_idx() */
/*-------------------------------------------------------------------------
- * Function: H5G_dense_remove_fh_cb
+ * Function: H5G__dense_remove_fh_cb
*
* Purpose: Callback for fractal heap operator when removing links
*
* Return: SUCCEED/FAIL
*
* Programmer: Quincey Koziol
- * koziol@hdfgroup.org
* Sep 12 2006
*
*-------------------------------------------------------------------------
*/
static herr_t
-H5G_dense_remove_fh_cb(const void *obj, size_t obj_len, void *_udata)
+H5G__dense_remove_fh_cb(const void *obj, size_t obj_len, void *_udata)
{
H5G_fh_ud_rm_t *udata = (H5G_fh_ud_rm_t *)_udata; /* User data for fractal heap 'op' callback */
H5O_link_t * lnk = NULL; /* Pointer to link created from heap object */
H5B2_t * bt2 = NULL; /* v2 B-tree handle for index */
herr_t ret_value = SUCCEED; /* Return value */
- FUNC_ENTER_NOAPI_NOINIT
+ FUNC_ENTER_STATIC
/* Decode link information */
if (NULL == (lnk = (H5O_link_t *)H5O_msg_decode(udata->f, NULL, H5O_LINK_ID, obj_len,
@@ -1314,30 +1279,29 @@ done:
H5O_msg_free(H5O_LINK_ID, lnk);
FUNC_LEAVE_NOAPI(ret_value)
-} /* end H5G_dense_remove_fh_cb() */
+} /* end H5G__dense_remove_fh_cb() */
/*-------------------------------------------------------------------------
- * Function: H5G_dense_remove_bt2_cb
+ * Function: H5G__dense_remove_bt2_cb
*
* Purpose: v2 B-tree callback for dense link storage record removal
*
* Return: Non-negative on success/Negative on failure
*
* Programmer: Quincey Koziol
- * koziol@hdfgroup.org
* Sep 12 2006
*
*-------------------------------------------------------------------------
*/
static herr_t
-H5G_dense_remove_bt2_cb(const void *_record, void *_bt2_udata)
+H5G__dense_remove_bt2_cb(const void *_record, void *_bt2_udata)
{
const H5G_dense_bt2_name_rec_t *record = (const H5G_dense_bt2_name_rec_t *)_record;
H5G_bt2_ud_rm_t * bt2_udata = (H5G_bt2_ud_rm_t *)_bt2_udata; /* User data for callback */
H5G_fh_ud_rm_t fh_udata; /* User data for fractal heap 'op' callback */
herr_t ret_value = SUCCEED; /* Return value */
- FUNC_ENTER_NOAPI_NOINIT
+ FUNC_ENTER_STATIC
/* Set up the user data for fractal heap 'op' callback */
fh_udata.f = bt2_udata->common.f;
@@ -1346,7 +1310,7 @@ H5G_dense_remove_bt2_cb(const void *_record, void *_bt2_udata)
fh_udata.replace_names = bt2_udata->replace_names;
/* Call fractal heap 'op' routine, to perform user callback */
- if (H5HF_op(bt2_udata->common.fheap, record->id, H5G_dense_remove_fh_cb, &fh_udata) < 0)
+ if (H5HF_op(bt2_udata->common.fheap, record->id, H5G__dense_remove_fh_cb, &fh_udata) < 0)
HGOTO_ERROR(H5E_SYM, H5E_CANTOPERATE, FAIL, "link removal callback failed")
/* Remove record from fractal heap, if requested */
@@ -1356,7 +1320,7 @@ H5G_dense_remove_bt2_cb(const void *_record, void *_bt2_udata)
done:
FUNC_LEAVE_NOAPI(ret_value)
-} /* end H5G_dense_remove_bt2_cb() */
+} /* end H5G__dense_remove_bt2_cb() */
/*-------------------------------------------------------------------------
* Function: H5G__dense_remove
@@ -1366,7 +1330,6 @@ done:
* Return: Non-negative on success/Negative on failure
*
* Programmer: Quincey Koziol
- * koziol@hdfgroup.org
* Sep 12 2006
*
*-------------------------------------------------------------------------
@@ -1409,7 +1372,7 @@ H5G__dense_remove(H5F_t *f, const H5O_linfo_t *linfo, H5RS_str_t *grp_full_path_
udata.replace_names = TRUE;
/* Remove the record from the name index v2 B-tree */
- if (H5B2_remove(bt2, &udata, H5G_dense_remove_bt2_cb, &udata) < 0)
+ if (H5B2_remove(bt2, &udata, H5G__dense_remove_bt2_cb, &udata) < 0)
HGOTO_ERROR(H5E_SYM, H5E_CANTREMOVE, FAIL, "unable to remove link from name index v2 B-tree")
done:
@@ -1423,25 +1386,24 @@ done:
} /* end H5G__dense_remove() */
/*-------------------------------------------------------------------------
- * Function: H5G_dense_remove_by_idx_fh_cb
+ * Function: H5G__dense_remove_by_idx_fh_cb
*
* Purpose: Callback for fractal heap operator when removing links by index
*
* Return: SUCCEED/FAIL
*
* Programmer: Quincey Koziol
- * koziol@hdfgroup.org
* Nov 15 2006
*
*-------------------------------------------------------------------------
*/
static herr_t
-H5G_dense_remove_by_idx_fh_cb(const void *obj, size_t obj_len, void *_udata)
+H5G__dense_remove_by_idx_fh_cb(const void *obj, size_t obj_len, void *_udata)
{
H5G_fh_ud_rmbi_t *udata = (H5G_fh_ud_rmbi_t *)_udata; /* User data for fractal heap 'op' callback */
herr_t ret_value = SUCCEED; /* Return value */
- FUNC_ENTER_NOAPI_NOINIT
+ FUNC_ENTER_STATIC
/* Decode link information */
if (NULL == (udata->lnk = (H5O_link_t *)H5O_msg_decode(udata->f, NULL, H5O_LINK_ID, obj_len,
@@ -1452,23 +1414,22 @@ H5G_dense_remove_by_idx_fh_cb(const void *obj, size_t obj_len, void *_udata)
done:
FUNC_LEAVE_NOAPI(ret_value)
-} /* end H5G_dense_remove_by_idx_fh_cb() */
+} /* end H5G__dense_remove_by_idx_fh_cb() */
/*-------------------------------------------------------------------------
- * Function: H5G_dense_remove_by_idx_bt2_cb
+ * Function: H5G__dense_remove_by_idx_bt2_cb
*
* Purpose: v2 B-tree callback for dense link storage record removal by index
*
* Return: Non-negative on success/Negative on failure
*
* Programmer: Quincey Koziol
- * koziol@hdfgroup.org
* Nov 15 2006
*
*-------------------------------------------------------------------------
*/
static herr_t
-H5G_dense_remove_by_idx_bt2_cb(const void *_record, void *_bt2_udata)
+H5G__dense_remove_by_idx_bt2_cb(const void *_record, void *_bt2_udata)
{
H5G_bt2_ud_rmbi_t *bt2_udata = (H5G_bt2_ud_rmbi_t *)_bt2_udata; /* User data for callback */
H5G_fh_ud_rmbi_t fh_udata; /* User data for fractal heap 'op' callback */
@@ -1476,7 +1437,7 @@ H5G_dense_remove_by_idx_bt2_cb(const void *_record, void *_bt2_udata)
const uint8_t * heap_id; /* Heap ID for link */
herr_t ret_value = SUCCEED; /* Return value */
- FUNC_ENTER_NOAPI_NOINIT
+ FUNC_ENTER_STATIC
/* Determine the index being used */
if (bt2_udata->idx_type == H5_INDEX_NAME) {
@@ -1499,7 +1460,7 @@ H5G_dense_remove_by_idx_bt2_cb(const void *_record, void *_bt2_udata)
fh_udata.lnk = NULL;
/* Call fractal heap 'op' routine, to perform user callback */
- if (H5HF_op(bt2_udata->fheap, heap_id, H5G_dense_remove_by_idx_fh_cb, &fh_udata) < 0)
+ if (H5HF_op(bt2_udata->fheap, heap_id, H5G__dense_remove_by_idx_fh_cb, &fh_udata) < 0)
HGOTO_ERROR(H5E_SYM, H5E_CANTOPERATE, FAIL, "link removal callback failed")
HDassert(fh_udata.lnk);
@@ -1559,7 +1520,7 @@ done:
HDONE_ERROR(H5E_SYM, H5E_CLOSEERROR, FAIL, "can't close v2 B-tree for 'other' index")
FUNC_LEAVE_NOAPI(ret_value)
-} /* end H5G_dense_remove_by_idx_bt2_cb() */
+} /* end H5G__dense_remove_by_idx_bt2_cb() */
/*-------------------------------------------------------------------------
* Function: H5G__dense_remove_by_idx
@@ -1570,7 +1531,6 @@ done:
* Return: Non-negative on success/Negative on failure
*
* Programmer: Quincey Koziol
- * koziol@hdfgroup.org
* Nov 14 2006
*
*-------------------------------------------------------------------------
@@ -1641,7 +1601,7 @@ H5G__dense_remove_by_idx(H5F_t *f, const H5O_linfo_t *linfo, H5RS_str_t *grp_ful
udata.grp_full_path_r = grp_full_path_r;
/* Remove the record from the name index v2 B-tree */
- if (H5B2_remove_by_idx(bt2, order, n, H5G_dense_remove_by_idx_bt2_cb, &udata) < 0)
+ if (H5B2_remove_by_idx(bt2, order, n, H5G__dense_remove_by_idx_bt2_cb, &udata) < 0)
HGOTO_ERROR(H5E_SYM, H5E_CANTREMOVE, FAIL, "unable to remove link from indexed v2 B-tree")
} /* end if */
else { /* Otherwise, we need to build a table of the links and sort it */
@@ -1678,7 +1638,6 @@ done:
* Return: Non-negative on success/Negative on failure
*
* Programmer: Quincey Koziol
- * koziol@hdfgroup.org
* Sep 12 2006
*
*-------------------------------------------------------------------------
@@ -1721,7 +1680,7 @@ H5G__dense_delete(H5F_t *f, H5O_linfo_t *linfo, hbool_t adj_link)
udata.replace_names = FALSE;
/* Delete the name index, adjusting the ref. count on links removed */
- if (H5B2_delete(f, linfo->name_bt2_addr, NULL, H5G_dense_remove_bt2_cb, &udata) < 0)
+ if (H5B2_delete(f, linfo->name_bt2_addr, NULL, H5G__dense_remove_bt2_cb, &udata) < 0)
HGOTO_ERROR(H5E_SYM, H5E_CANTDELETE, FAIL, "unable to delete v2 B-tree for name index")
/* Close the fractal heap */
diff --git a/src/H5Gdeprec.c b/src/H5Gdeprec.c
index 04bd2b5..45065e8 100644
--- a/src/H5Gdeprec.c
+++ b/src/H5Gdeprec.c
@@ -828,7 +828,7 @@ H5Giterate(hid_t loc_id, const char *name, int *idx_p, H5G_iterate_t op, void *o
/* Get the object pointer */
if (NULL == (vol_obj = H5VL_vol_object(loc_id)))
- HGOTO_ERROR(H5E_ATOM, H5E_BADTYPE, (-1), "invalid identifier")
+ HGOTO_ERROR(H5E_ID, H5E_BADTYPE, (-1), "invalid identifier")
/* Call private iteration function, through VOL callback */
if ((ret_value = H5VL_group_optional(vol_obj, H5VL_NATIVE_GROUP_ITERATE_OLD, H5P_DATASET_XFER_DEFAULT,
diff --git a/src/H5Gent.c b/src/H5Gent.c
index d57829b..b26e308 100644
--- a/src/H5Gent.c
+++ b/src/H5Gent.c
@@ -12,7 +12,7 @@
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
/*
- * Programmer: Robb Matzke <matzke@llnl.gov>
+ * Programmer: Robb Matzke
* Friday, September 19, 1997
*/
@@ -53,9 +53,6 @@
/* Package Variables */
/*********************/
-/* Declare extern the PQ free list for the wrapped strings */
-H5FL_BLK_EXTERN(str_buf);
-
/*****************************/
/* Library Private Variables */
/*****************************/
@@ -76,7 +73,6 @@ H5FL_BLK_EXTERN(str_buf);
* Failure: Negative
*
* Programmer: Robb Matzke
- * matzke@llnl.gov
* Jul 18 1997
*
*-------------------------------------------------------------------------
@@ -117,7 +113,6 @@ done:
* Failure: Negative
*
* Programmer: Robb Matzke
- * matzke@llnl.gov
* Jul 18 1997
*
*-------------------------------------------------------------------------
@@ -182,7 +177,6 @@ done:
* Failure: Negative
*
* Programmer: Robb Matzke
- * matzke@llnl.gov
* Jul 18 1997
*
*-------------------------------------------------------------------------
@@ -221,7 +215,6 @@ done:
* Failure: Negative
*
* Programmer: Robb Matzke
- * matzke@llnl.gov
* Jul 18 1997
*
*-------------------------------------------------------------------------
@@ -292,7 +285,6 @@ done:
* Failure: Negative
*
* Programmer: Pedro Vicente
- * pvn@ncsa.uiuc.edu
* ???day, August ??, 2002
*
* Notes: 'depth' parameter determines how much of the group entry
@@ -370,7 +362,6 @@ H5G__ent_reset(H5G_entry_t *ent)
* Failure: Negative
*
* Programmer: Quincey Koziol
- * koziol@ncsa.uiuc.edu
* Sep 20 2005
*
*-------------------------------------------------------------------------
@@ -513,7 +504,6 @@ done:
* Return: Non-negative on success/Negative on failure
*
* Programmer: Robb Matzke
- * matzke@llnl.gov
* Aug 29 1997
*
*-------------------------------------------------------------------------
@@ -533,7 +523,7 @@ H5G__ent_debug(const H5G_entry_t *ent, FILE *stream, int indent, int fwidth, con
HDfprintf(stream, "%*s%-*s %lu\n", indent, "", fwidth,
"Name offset into private heap:", (unsigned long)(ent->name_off));
- HDfprintf(stream, "%*s%-*s %a\n", indent, "", fwidth, "Object header address:", ent->header);
+ HDfprintf(stream, "%*s%-*s %" PRIuHADDR "\n", indent, "", fwidth, "Object header address:", ent->header);
HDfprintf(stream, "%*s%-*s ", indent, "", fwidth, "Cache info type:");
switch (ent->type) {
@@ -545,10 +535,10 @@ H5G__ent_debug(const H5G_entry_t *ent, FILE *stream, int indent, int fwidth, con
HDfprintf(stream, "Symbol Table\n");
HDfprintf(stream, "%*s%-*s\n", indent, "", fwidth, "Cached entry information:");
- HDfprintf(stream, "%*s%-*s %a\n", nested_indent, "", nested_fwidth,
+ HDfprintf(stream, "%*s%-*s %" PRIuHADDR "\n", nested_indent, "", nested_fwidth,
"B-tree address:", ent->cache.stab.btree_addr);
- HDfprintf(stream, "%*s%-*s %a\n", nested_indent, "", nested_fwidth,
+ HDfprintf(stream, "%*s%-*s %" PRIuHADDR "\n", nested_indent, "", nested_fwidth,
"Heap address:", ent->cache.stab.heap_addr);
break;
diff --git a/src/H5Gint.c b/src/H5Gint.c
index d11e8ed..57a6144 100644
--- a/src/H5Gint.c
+++ b/src/H5Gint.c
@@ -15,7 +15,7 @@
*
* Created: H5Gint.c
* April 5 2007
- * Quincey Koziol <koziol@hdfgroup.org>
+ * Quincey Koziol
*
* Purpose: General use, "internal" routines for groups.
*
@@ -167,7 +167,6 @@ done:
* Failure: NULL
*
* Programmer: Robb Matzke
- * matzke@llnl.gov
* Aug 11 1997
*
*-------------------------------------------------------------------------
@@ -782,7 +781,7 @@ H5G_iterate(H5G_loc_t *loc, const char *group_name, H5_index_t idx_type, H5_iter
if (NULL == (grp = H5G__open_name(loc, group_name)))
HGOTO_ERROR(H5E_SYM, H5E_CANTOPENOBJ, FAIL, "unable to open group")
if ((gid = H5VL_wrap_register(H5I_GROUP, grp, TRUE)) < 0)
- HGOTO_ERROR(H5E_ATOM, H5E_CANTREGISTER, FAIL, "unable to register group")
+ HGOTO_ERROR(H5E_ID, H5E_CANTREGISTER, FAIL, "unable to register group")
/* Set up user data for callback */
udata.gid = gid;
@@ -1045,7 +1044,7 @@ H5G_visit(H5G_loc_t *loc, const char *group_name, H5_index_t idx_type, H5_iter_o
/* Register an ID for the starting group */
if ((gid = H5VL_wrap_register(H5I_GROUP, grp, TRUE)) < 0)
- HGOTO_ERROR(H5E_ATOM, H5E_CANTREGISTER, FAIL, "unable to register group")
+ HGOTO_ERROR(H5E_ID, H5E_CANTREGISTER, FAIL, "unable to register group")
/* Get the location of the starting group */
if (H5G_loc(gid, &start_loc) < 0)
diff --git a/src/H5Glink.c b/src/H5Glink.c
index 61a8ae9..629cb11 100644
--- a/src/H5Glink.c
+++ b/src/H5Glink.c
@@ -58,10 +58,10 @@
/* Local Prototypes */
/********************/
-static int H5G_link_cmp_name_inc(const void *lnk1, const void *lnk2);
-static int H5G_link_cmp_name_dec(const void *lnk1, const void *lnk2);
-static int H5G_link_cmp_corder_inc(const void *lnk1, const void *lnk2);
-static int H5G_link_cmp_corder_dec(const void *lnk1, const void *lnk2);
+static int H5G__link_cmp_name_inc(const void *lnk1, const void *lnk2);
+static int H5G__link_cmp_name_dec(const void *lnk1, const void *lnk2);
+static int H5G__link_cmp_corder_inc(const void *lnk1, const void *lnk2);
+static int H5G__link_cmp_corder_dec(const void *lnk1, const void *lnk2);
/*********************/
/* Package Variables */
@@ -76,7 +76,7 @@ static int H5G_link_cmp_corder_dec(const void *lnk1, const void *lnk2);
/*******************/
/*-------------------------------------------------------------------------
- * Function: H5G_link_cmp_name_inc
+ * Function: H5G__link_cmp_name_inc
*
* Purpose: Callback routine for comparing two link names, in
* increasing alphabetic order
@@ -93,15 +93,15 @@ static int H5G_link_cmp_corder_dec(const void *lnk1, const void *lnk2);
*-------------------------------------------------------------------------
*/
static int
-H5G_link_cmp_name_inc(const void *lnk1, const void *lnk2)
+H5G__link_cmp_name_inc(const void *lnk1, const void *lnk2)
{
- FUNC_ENTER_NOAPI_NOINIT_NOERR
+ FUNC_ENTER_STATIC_NOERR
FUNC_LEAVE_NOAPI(HDstrcmp(((const H5O_link_t *)lnk1)->name, ((const H5O_link_t *)lnk2)->name))
-} /* end H5G_link_cmp_name_inc() */
+} /* end H5G__link_cmp_name_inc() */
/*-------------------------------------------------------------------------
- * Function: H5G_link_cmp_name_dec
+ * Function: H5G__link_cmp_name_dec
*
* Purpose: Callback routine for comparing two link names, in
* decreasing alphabetic order
@@ -118,15 +118,15 @@ H5G_link_cmp_name_inc(const void *lnk1, const void *lnk2)
*-------------------------------------------------------------------------
*/
static int
-H5G_link_cmp_name_dec(const void *lnk1, const void *lnk2)
+H5G__link_cmp_name_dec(const void *lnk1, const void *lnk2)
{
- FUNC_ENTER_NOAPI_NOINIT_NOERR
+ FUNC_ENTER_STATIC_NOERR
FUNC_LEAVE_NOAPI(HDstrcmp(((const H5O_link_t *)lnk2)->name, ((const H5O_link_t *)lnk1)->name))
-} /* end H5G_link_cmp_name_dec() */
+} /* end H5G__link_cmp_name_dec() */
/*-------------------------------------------------------------------------
- * Function: H5G_link_cmp_corder_inc
+ * Function: H5G__link_cmp_corder_inc
*
* Purpose: Callback routine for comparing two link creation orders, in
* increasing order
@@ -142,11 +142,11 @@ H5G_link_cmp_name_dec(const void *lnk1, const void *lnk2)
*-------------------------------------------------------------------------
*/
static int
-H5G_link_cmp_corder_inc(const void *lnk1, const void *lnk2)
+H5G__link_cmp_corder_inc(const void *lnk1, const void *lnk2)
{
int ret_value = -1; /* Return value */
- FUNC_ENTER_NOAPI_NOINIT_NOERR
+ FUNC_ENTER_STATIC_NOERR
if (((const H5O_link_t *)lnk1)->corder < ((const H5O_link_t *)lnk2)->corder)
ret_value = -1;
@@ -156,10 +156,10 @@ H5G_link_cmp_corder_inc(const void *lnk1, const void *lnk2)
ret_value = 0;
FUNC_LEAVE_NOAPI(ret_value)
-} /* end H5G_link_cmp_corder_inc() */
+} /* end H5G__link_cmp_corder_inc() */
/*-------------------------------------------------------------------------
- * Function: H5G_link_cmp_corder_dec
+ * Function: H5G__link_cmp_corder_dec
*
* Purpose: Callback routine for comparing two link creation orders, in
* decreasing order
@@ -175,11 +175,11 @@ H5G_link_cmp_corder_inc(const void *lnk1, const void *lnk2)
*-------------------------------------------------------------------------
*/
static int
-H5G_link_cmp_corder_dec(const void *lnk1, const void *lnk2)
+H5G__link_cmp_corder_dec(const void *lnk1, const void *lnk2)
{
int ret_value = -1; /* Return value */
- FUNC_ENTER_NOAPI_NOINIT_NOERR
+ FUNC_ENTER_STATIC_NOERR
if (((const H5O_link_t *)lnk1)->corder < ((const H5O_link_t *)lnk2)->corder)
ret_value = 1;
@@ -189,7 +189,7 @@ H5G_link_cmp_corder_dec(const void *lnk1, const void *lnk2)
ret_value = 0;
FUNC_LEAVE_NOAPI(ret_value)
-} /* end H5G_link_cmp_corder_dec() */
+} /* end H5G__link_cmp_corder_dec() */
/*-------------------------------------------------------------------------
* Function: H5G__ent_to_link
@@ -417,18 +417,18 @@ H5G__link_sort_table(H5G_link_table_t *ltable, H5_index_t idx_type, H5_iter_orde
/* Pick appropriate sorting routine */
if (idx_type == H5_INDEX_NAME) {
if (order == H5_ITER_INC)
- HDqsort(ltable->lnks, ltable->nlinks, sizeof(H5O_link_t), H5G_link_cmp_name_inc);
+ HDqsort(ltable->lnks, ltable->nlinks, sizeof(H5O_link_t), H5G__link_cmp_name_inc);
else if (order == H5_ITER_DEC)
- HDqsort(ltable->lnks, ltable->nlinks, sizeof(H5O_link_t), H5G_link_cmp_name_dec);
+ HDqsort(ltable->lnks, ltable->nlinks, sizeof(H5O_link_t), H5G__link_cmp_name_dec);
else
HDassert(order == H5_ITER_NATIVE);
} /* end if */
else {
HDassert(idx_type == H5_INDEX_CRT_ORDER);
if (order == H5_ITER_INC)
- HDqsort(ltable->lnks, ltable->nlinks, sizeof(H5O_link_t), H5G_link_cmp_corder_inc);
+ HDqsort(ltable->lnks, ltable->nlinks, sizeof(H5O_link_t), H5G__link_cmp_corder_inc);
else if (order == H5_ITER_DEC)
- HDqsort(ltable->lnks, ltable->nlinks, sizeof(H5O_link_t), H5G_link_cmp_corder_dec);
+ HDqsort(ltable->lnks, ltable->nlinks, sizeof(H5O_link_t), H5G__link_cmp_corder_dec);
else
HDassert(order == H5_ITER_NATIVE);
} /* end else */
diff --git a/src/H5Gloc.c b/src/H5Gloc.c
index 15d3cf2..7d08b54 100644
--- a/src/H5Gloc.c
+++ b/src/H5Gloc.c
@@ -235,6 +235,9 @@ H5G_loc_real(void *obj, H5I_type_t type, H5G_loc_t *loc)
HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL,
"unable to get group location of a dataspace selection iterator")
+ case H5I_EVENTSET:
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "unable to get group location of a event set")
+
case H5I_UNINIT:
case H5I_BADID:
case H5I_NTYPES:
@@ -597,7 +600,7 @@ done:
} /* end H5G__loc_insert() */
/*-------------------------------------------------------------------------
- * Function: H5G_loc_exists_cb
+ * Function: H5G__loc_exists_cb
*
* Purpose: Callback for checking if an object exists
*
@@ -609,13 +612,13 @@ done:
*-------------------------------------------------------------------------
*/
static herr_t
-H5G_loc_exists_cb(H5G_loc_t H5_ATTR_UNUSED *grp_loc /*in*/, const char H5_ATTR_UNUSED *name,
- const H5O_link_t H5_ATTR_UNUSED *lnk, H5G_loc_t *obj_loc, void *_udata /*in,out*/,
- H5G_own_loc_t *own_loc /*out*/)
+H5G__loc_exists_cb(H5G_loc_t H5_ATTR_UNUSED *grp_loc /*in*/, const char H5_ATTR_UNUSED *name,
+ const H5O_link_t H5_ATTR_UNUSED *lnk, H5G_loc_t *obj_loc, void *_udata /*in,out*/,
+ H5G_own_loc_t *own_loc /*out*/)
{
H5G_loc_exists_t *udata = (H5G_loc_exists_t *)_udata; /* User data passed in */
- FUNC_ENTER_NOAPI_NOINIT_NOERR
+ FUNC_ENTER_STATIC_NOERR
/* Check if the name in this group resolved to a valid object */
if (obj_loc == NULL)
@@ -631,7 +634,7 @@ H5G_loc_exists_cb(H5G_loc_t H5_ATTR_UNUSED *grp_loc /*in*/, const char H5_ATTR_U
*own_loc = H5G_OWN_NONE;
FUNC_LEAVE_NOAPI(SUCCEED)
-} /* end H5G_loc_exists_cb() */
+} /* end H5G__loc_exists_cb() */
/*-------------------------------------------------------------------------
* Function: H5G_loc_exists
@@ -662,7 +665,7 @@ H5G_loc_exists(const H5G_loc_t *loc, const char *name)
udata.exists = FALSE;
/* Traverse group hierarchy to locate object */
- if (H5G_traverse(loc, name, H5G_TARGET_EXISTS, H5G_loc_exists_cb, &udata) < 0)
+ if (H5G_traverse(loc, name, H5G_TARGET_EXISTS, H5G__loc_exists_cb, &udata) < 0)
HGOTO_ERROR(H5E_SYM, H5E_NOTFOUND, FAIL, "can't check if object exists")
/* Set return value */
diff --git a/src/H5Gmodule.h b/src/H5Gmodule.h
index 219342d..fe26bd2 100644
--- a/src/H5Gmodule.h
+++ b/src/H5Gmodule.h
@@ -31,9 +31,94 @@
/**
* \defgroup H5G H5G
- * \brief Group Interface
- * \details The HDF5 Group Interface, H5G, provides a mechanism for managing
- * HDF5 groups and their members, which are other HDF5 objects.
+ *
+ * \details \Bold{Groups in HDF5:} A group associates names with objects and
+ * provides a mechanism for mapping a name to an object. Since all
+ * objects appear in at least one group (with the possible exception of
+ * the root object) and since objects can have names in more than one
+ * group, the set of all objects in an HDF5 file is a directed
+ * graph. The internal nodes (nodes with out-degree greater than zero)
+ * must be groups while the leaf nodes (nodes with out-degree zero) are
+ * either empty groups or objects of some other type. Exactly one
+ * object in every non-empty file is the root object. The root object
+ * always has a positive in-degree because it is pointed to by the file
+ * super block.
+ *
+ * \Bold{Locating objects in the HDF5 file hierarchy:} An object name
+ * consists of one or more components separated from one another by
+ * slashes. An absolute name begins with a slash and the object is
+ * located by looking for the first component in the root object, then
+ * looking for the second component in the first object, etc., until
+ * the entire name is traversed. A relative name does not begin with a
+ * slash and the traversal begins at the location specified by the
+ * create or access function.
+ *
+ * \Bold{Group implementations in HDF5:} The original HDF5 group
+ * implementation provided a single indexed structure for link
+ * storage. A new group implementation, in HDF5 Release 1.8.0, enables
+ * more efficient compact storage for very small groups, improved link
+ * indexing for large groups, and other advanced features.
+ *
+ * \li The \Emph{original indexed} format remains the default. Links
+ * are stored in a B-tree in the group’s local heap.
+ * \li Groups created in the new \Emph{compact-or-indexed} format, the
+ * implementation introduced with Release 1.8.0, can be tuned for
+ * performance, switching between the compact and indexed formats
+ * at thresholds set in the user application.
+ * - The \Emph{compact} format will conserve file space and processing
+ * overhead when working with small groups and is particularly
+ * valuable when a group contains no links. Links are stored
+ * as a list of messages in the group’s header.
+ * - The \Emph{indexed} format will yield improved
+ * performance when working with large groups, e.g., groups
+ * containing thousands to millions of members. Links are stored in
+ * a fractal heap and indexed with an improved B-tree.
+ * \li The new implementation also enables the use of link names consisting of
+ * non-ASCII character sets (see H5Pset_char_encoding()) and is
+ * required for all link types other than hard or soft links, e.g.,
+ * external and user-defined links (see the \ref H5L APIs).
+ *
+ * The original group structure and the newer structures are not
+ * directly interoperable. By default, a group will be created in the
+ * original indexed format. An existing group can be changed to a
+ * compact-or-indexed format if the need arises; there is no capability
+ * to change back. As stated above, once in the compact-or-indexed
+ * format, a group can switch between compact and indexed as needed.
+ *
+ * Groups will be initially created in the compact-or-indexed format
+ * only when one or more of the following conditions is met:
+ * \li The low version bound value of the library version bounds property
+ * has been set to Release 1.8.0 or later in the file access property
+ * list (see H5Pset_libver_bounds()). Currently, that would require an
+ * H5Pset_libver_bounds() call with the low parameter set to
+ * #H5F_LIBVER_LATEST.\n When this property is set for an HDF5 file,
+ * all objects in the file will be created using the latest available
+ * format; no effort will be made to create a file that can be read by
+ * older libraries.
+ * \li The creation order tracking property, #H5P_CRT_ORDER_TRACKED, has been
+ * set in the group creation property list (see H5Pset_link_creation_order()).
+ *
+ * An existing group, currently in the original indexed format, will be
+ * converted to the compact-or-indexed format upon the occurrence of
+ * any of the following events:
+ * \li An external or user-defined link is inserted into the group.
+ * \li A link named with a string composed of non-ASCII characters is
+ * inserted into the group.
+ *
+ * The compact-or-indexed format offers performance improvements that
+ * will be most notable at the extremes, i.e., in groups with zero
+ * members and in groups with tens of thousands of members. But
+ * measurable differences may sometimes appear at a threshold as low as
+ * eight group members. Since these performance thresholds and criteria
+ * differ from application to application, tunable settings are
+ * provided to govern the switch between the compact and indexed
+ * formats (see H5Pset_link_phase_change()). Optimal thresholds will
+ * depend on the application and the operating environment.
+ *
+ * Future versions of HDF5 will retain the ability to create, read,
+ * write, and manipulate all groups stored in either the original
+ * indexed format or the compact-or-indexed format.
+ *
*/
#endif /* H5Gmodule_H */
diff --git a/src/H5Gname.c b/src/H5Gname.c
index fd63cbb..2465f01 100644
--- a/src/H5Gname.c
+++ b/src/H5Gname.c
@@ -729,6 +729,7 @@ H5G__name_replace_cb(void *obj_ptr, hid_t obj_id, void *key)
case H5I_ERROR_MSG:
case H5I_ERROR_STACK:
case H5I_SPACE_SEL_ITER:
+ case H5I_EVENTSET:
case H5I_NTYPES:
default:
HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "unknown data object")
diff --git a/src/H5Gnode.c b/src/H5Gnode.c
index fb4cd48..9a7da0f 100644
--- a/src/H5Gnode.c
+++ b/src/H5Gnode.c
@@ -70,20 +70,20 @@ typedef struct H5G_node_key_t {
/********************/
/* B-tree callbacks */
-static H5UC_t * H5G_node_get_shared(const H5F_t *f, const void *_udata);
+static H5UC_t * H5G__node_get_shared(const H5F_t *f, const void *_udata);
static herr_t H5G__node_create(H5F_t *f, H5B_ins_t op, void *_lt_key, void *_udata, void *_rt_key,
haddr_t *addr_p /*out*/);
-static int H5G_node_cmp2(void *_lt_key, void *_udata, void *_rt_key);
-static int H5G_node_cmp3(void *_lt_key, void *_udata, void *_rt_key);
-static htri_t H5G_node_found(H5F_t *f, haddr_t addr, const void *_lt_key, void *_udata);
+static int H5G__node_cmp2(void *_lt_key, void *_udata, void *_rt_key);
+static int H5G__node_cmp3(void *_lt_key, void *_udata, void *_rt_key);
+static htri_t H5G__node_found(H5F_t *f, haddr_t addr, const void *_lt_key, void *_udata);
static H5B_ins_t H5G__node_insert(H5F_t *f, haddr_t addr, void *_lt_key, hbool_t *lt_key_changed,
void *_md_key, void *_udata, void *_rt_key, hbool_t *rt_key_changed,
haddr_t *new_node_p /*out*/);
-static H5B_ins_t H5G_node_remove(H5F_t *f, haddr_t addr, void *lt_key, hbool_t *lt_key_changed, void *udata,
- void *rt_key, hbool_t *rt_key_changed);
-static herr_t H5G_node_decode_key(const H5B_shared_t *shared, const uint8_t *raw, void *_key);
-static herr_t H5G_node_encode_key(const H5B_shared_t *shared, uint8_t *raw, const void *_key);
-static herr_t H5G_node_debug_key(FILE *stream, int indent, int fwidth, const void *key, const void *udata);
+static H5B_ins_t H5G__node_remove(H5F_t *f, haddr_t addr, void *lt_key, hbool_t *lt_key_changed, void *udata,
+ void *rt_key, hbool_t *rt_key_changed);
+static herr_t H5G__node_decode_key(const H5B_shared_t *shared, const uint8_t *raw, void *_key);
+static herr_t H5G__node_encode_key(const H5B_shared_t *shared, uint8_t *raw, const void *_key);
+static herr_t H5G__node_debug_key(FILE *stream, int indent, int fwidth, const void *key, const void *udata);
/*********************/
/* Package Variables */
@@ -93,19 +93,19 @@ static herr_t H5G_node_debug_key(FILE *stream, int indent, int fwidth, const
H5B_class_t H5B_SNODE[1] = {{
H5B_SNODE_ID, /*id */
sizeof(H5G_node_key_t), /*sizeof_nkey */
- H5G_node_get_shared, /*get_shared */
+ H5G__node_get_shared, /*get_shared */
H5G__node_create, /*new */
- H5G_node_cmp2, /*cmp2 */
- H5G_node_cmp3, /*cmp3 */
- H5G_node_found, /*found */
+ H5G__node_cmp2, /*cmp2 */
+ H5G__node_cmp3, /*cmp3 */
+ H5G__node_found, /*found */
H5G__node_insert, /*insert */
TRUE, /*follow min branch? */
TRUE, /*follow max branch? */
H5B_RIGHT, /*critical key */
- H5G_node_remove, /*remove */
- H5G_node_decode_key, /*decode */
- H5G_node_encode_key, /*encode */
- H5G_node_debug_key /*debug */
+ H5G__node_remove, /*remove */
+ H5G__node_decode_key, /*decode */
+ H5G__node_encode_key, /*encode */
+ H5G__node_debug_key /*debug */
}};
/* Declare a free list to manage the H5G_node_t struct */
@@ -123,7 +123,7 @@ H5FL_SEQ_DEFINE(H5G_entry_t);
/*******************/
/*-------------------------------------------------------------------------
- * Function: H5G_node_get_shared
+ * Function: H5G__node_get_shared
*
* Purpose: Returns the shared B-tree info for the specified UDATA.
*
@@ -137,18 +137,18 @@ H5FL_SEQ_DEFINE(H5G_entry_t);
*-------------------------------------------------------------------------
*/
static H5UC_t *
-H5G_node_get_shared(const H5F_t *f, const void H5_ATTR_UNUSED *_udata)
+H5G__node_get_shared(const H5F_t *f, const void H5_ATTR_UNUSED *_udata)
{
- FUNC_ENTER_NOAPI_NOINIT_NOERR
+ FUNC_ENTER_STATIC_NOERR
HDassert(f);
/* Return the pointer to the ref-count object */
FUNC_LEAVE_NOAPI(H5F_GRP_BTREE_SHARED(f))
-} /* end H5G_node_get_shared() */
+} /* end H5G__node_get_shared() */
/*-------------------------------------------------------------------------
- * Function: H5G_node_decode_key
+ * Function: H5G__node_decode_key
*
* Purpose: Decodes a raw key into a native key.
*
@@ -160,11 +160,11 @@ H5G_node_get_shared(const H5F_t *f, const void H5_ATTR_UNUSED *_udata)
*-------------------------------------------------------------------------
*/
static herr_t
-H5G_node_decode_key(const H5B_shared_t *shared, const uint8_t *raw, void *_key)
+H5G__node_decode_key(const H5B_shared_t *shared, const uint8_t *raw, void *_key)
{
H5G_node_key_t *key = (H5G_node_key_t *)_key;
- FUNC_ENTER_NOAPI_NOINIT_NOERR
+ FUNC_ENTER_STATIC_NOERR
HDassert(shared);
HDassert(raw);
@@ -173,10 +173,10 @@ H5G_node_decode_key(const H5B_shared_t *shared, const uint8_t *raw, void *_key)
H5F_DECODE_LENGTH_LEN(raw, key->offset, shared->sizeof_len);
FUNC_LEAVE_NOAPI(SUCCEED)
-} /* end H5G_node_decode_key() */
+} /* end H5G__node_decode_key() */
/*-------------------------------------------------------------------------
- * Function: H5G_node_encode_key
+ * Function: H5G__node_encode_key
*
* Purpose: Encodes a native key into a raw key.
*
@@ -188,11 +188,11 @@ H5G_node_decode_key(const H5B_shared_t *shared, const uint8_t *raw, void *_key)
*-------------------------------------------------------------------------
*/
static herr_t
-H5G_node_encode_key(const H5B_shared_t *shared, uint8_t *raw, const void *_key)
+H5G__node_encode_key(const H5B_shared_t *shared, uint8_t *raw, const void *_key)
{
const H5G_node_key_t *key = (const H5G_node_key_t *)_key;
- FUNC_ENTER_NOAPI_NOINIT_NOERR
+ FUNC_ENTER_STATIC_NOERR
HDassert(shared);
HDassert(raw);
@@ -201,10 +201,10 @@ H5G_node_encode_key(const H5B_shared_t *shared, uint8_t *raw, const void *_key)
H5F_ENCODE_LENGTH_LEN(raw, key->offset, shared->sizeof_len);
FUNC_LEAVE_NOAPI(SUCCEED)
-} /* end H5G_node_encode_key() */
+} /* end H5G__node_encode_key() */
/*-------------------------------------------------------------------------
- * Function: H5G_node_debug_key
+ * Function: H5G__node_debug_key
*
* Purpose: Prints a key.
*
@@ -216,12 +216,12 @@ H5G_node_encode_key(const H5B_shared_t *shared, uint8_t *raw, const void *_key)
*-------------------------------------------------------------------------
*/
static herr_t
-H5G_node_debug_key(FILE *stream, int indent, int fwidth, const void *_key, const void *_udata)
+H5G__node_debug_key(FILE *stream, int indent, int fwidth, const void *_key, const void *_udata)
{
const H5G_node_key_t * key = (const H5G_node_key_t *)_key;
const H5G_bt_common_t *udata = (const H5G_bt_common_t *)_udata;
- FUNC_ENTER_NOAPI_NOINIT_NOERR
+ FUNC_ENTER_STATIC_NOERR
HDassert(key);
@@ -239,7 +239,7 @@ H5G_node_debug_key(FILE *stream, int indent, int fwidth, const void *_key, const
HDfprintf(stream, "%*s%-*s ", indent, "", fwidth, "Cannot get name; heap address not specified\n");
FUNC_LEAVE_NOAPI(SUCCEED)
-} /* end H5G_node_debug_key() */
+} /* end H5G__node_debug_key() */
/*-------------------------------------------------------------------------
* Function: H5G__node_free
@@ -342,7 +342,7 @@ done:
} /* end H5G__node_create() */
/*-------------------------------------------------------------------------
- * Function: H5G_node_cmp2
+ * Function: H5G__node_cmp2
*
* Purpose: Compares two keys from a B-tree node (LT_KEY and RT_KEY).
* The UDATA pointer supplies extra data not contained in the
@@ -362,7 +362,7 @@ done:
*-------------------------------------------------------------------------
*/
static herr_t
-H5G_node_cmp2(void *_lt_key, void *_udata, void *_rt_key)
+H5G__node_cmp2(void *_lt_key, void *_udata, void *_rt_key)
{
H5G_bt_common_t *udata = (H5G_bt_common_t *)_udata;
H5G_node_key_t * lt_key = (H5G_node_key_t *)_lt_key;
@@ -370,7 +370,7 @@ H5G_node_cmp2(void *_lt_key, void *_udata, void *_rt_key)
const char * s1, *s2;
int ret_value = SUCCEED; /* Return value */
- FUNC_ENTER_NOAPI_NOINIT
+ FUNC_ENTER_STATIC
/* Sanity checks */
HDassert(udata && udata->heap);
@@ -388,10 +388,10 @@ H5G_node_cmp2(void *_lt_key, void *_udata, void *_rt_key)
done:
FUNC_LEAVE_NOAPI(ret_value)
-} /* H5G_node_cmp2() */
+} /* H5G__node_cmp2() */
/*-------------------------------------------------------------------------
- * Function: H5G_node_cmp3
+ * Function: H5G__node_cmp3
*
* Purpose: Compares two keys from a B-tree node (LT_KEY and RT_KEY)
* against another key (not necessarily the same type)
@@ -415,7 +415,7 @@ done:
*-------------------------------------------------------------------------
*/
static herr_t
-H5G_node_cmp3(void *_lt_key, void *_udata, void *_rt_key)
+H5G__node_cmp3(void *_lt_key, void *_udata, void *_rt_key)
{
H5G_bt_common_t *udata = (H5G_bt_common_t *)_udata;
H5G_node_key_t * lt_key = (H5G_node_key_t *)_lt_key;
@@ -423,7 +423,7 @@ H5G_node_cmp3(void *_lt_key, void *_udata, void *_rt_key)
const char * s;
herr_t ret_value = SUCCEED; /* Return value */
- FUNC_ENTER_NOAPI_NOINIT
+ FUNC_ENTER_STATIC
/* Sanity checks */
HDassert(udata && udata->heap);
@@ -445,10 +445,10 @@ H5G_node_cmp3(void *_lt_key, void *_udata, void *_rt_key)
done:
FUNC_LEAVE_NOAPI(ret_value)
-} /* end H5G_node_cmp3() */
+} /* end H5G__node_cmp3() */
/*-------------------------------------------------------------------------
- * Function: H5G_node_found
+ * Function: H5G__node_found
*
* Purpose: The B-tree search engine has found the symbol table node
* which contains the requested symbol if the symbol exists.
@@ -473,7 +473,7 @@ done:
*-------------------------------------------------------------------------
*/
static htri_t
-H5G_node_found(H5F_t *f, haddr_t addr, const void H5_ATTR_UNUSED *_lt_key, void *_udata)
+H5G__node_found(H5F_t *f, haddr_t addr, const void H5_ATTR_UNUSED *_lt_key, void *_udata)
{
H5G_bt_lkp_t *udata = (H5G_bt_lkp_t *)_udata;
H5G_node_t * sn = NULL;
@@ -482,7 +482,7 @@ H5G_node_found(H5F_t *f, haddr_t addr, const void H5_ATTR_UNUSED *_lt_key, void
const char * s;
htri_t ret_value = TRUE; /* Return value */
- FUNC_ENTER_NOAPI_NOINIT
+ FUNC_ENTER_STATIC
/*
* Check arguments.
@@ -526,7 +526,7 @@ done:
HDONE_ERROR(H5E_SYM, H5E_PROTECT, FAIL, "unable to release symbol table node")
FUNC_LEAVE_NOAPI(ret_value)
-} /* end H5G_node_found() */
+} /* end H5G__node_found() */
/*-------------------------------------------------------------------------
* Function: H5G__node_insert
@@ -693,7 +693,7 @@ done:
} /* end H5G__node_insert() */
/*-------------------------------------------------------------------------
- * Function: H5G_node_remove
+ * Function: H5G__node_remove
*
* Purpose: The B-tree removal engine has found the symbol table node
* which should contain the name which is being removed. This
@@ -721,9 +721,9 @@ done:
*-------------------------------------------------------------------------
*/
static H5B_ins_t
-H5G_node_remove(H5F_t *f, haddr_t addr, void H5_ATTR_NDEBUG_UNUSED *_lt_key /*in,out*/,
- hbool_t H5_ATTR_UNUSED *lt_key_changed /*out*/, void *_udata /*in,out*/,
- void *_rt_key /*in,out*/, hbool_t *rt_key_changed /*out*/)
+H5G__node_remove(H5F_t *f, haddr_t addr, void H5_ATTR_NDEBUG_UNUSED *_lt_key /*in,out*/,
+ hbool_t H5_ATTR_UNUSED *lt_key_changed /*out*/, void *_udata /*in,out*/,
+ void *_rt_key /*in,out*/, hbool_t *rt_key_changed /*out*/)
{
H5G_node_key_t *rt_key = (H5G_node_key_t *)_rt_key;
H5G_bt_rm_t * udata = (H5G_bt_rm_t *)_udata;
@@ -733,7 +733,7 @@ H5G_node_remove(H5F_t *f, haddr_t addr, void H5_ATTR_NDEBUG_UNUSED *_lt_key /*in
int cmp = 1;
H5B_ins_t ret_value = H5B_INS_ERROR;
- FUNC_ENTER_NOAPI_NOINIT
+ FUNC_ENTER_STATIC
/* Check arguments */
HDassert(f);
@@ -903,7 +903,7 @@ done:
HDONE_ERROR(H5E_SYM, H5E_CANTUNPROTECT, H5B_INS_ERROR, "unable to release symbol table node")
FUNC_LEAVE_NOAPI(ret_value)
-} /* end H5G_node_remove() */
+} /* end H5G__node_remove() */
/*-------------------------------------------------------------------------
* Function: H5G__node_iterate
diff --git a/src/H5Goh.c b/src/H5Goh.c
index 621456c..ada4887 100644
--- a/src/H5Goh.c
+++ b/src/H5Goh.c
@@ -291,7 +291,7 @@ H5O__group_get_oloc(hid_t obj_id)
/* Get the group */
if (NULL == (grp = (H5G_t *)H5VL_object(obj_id)))
- HGOTO_ERROR(H5E_OHDR, H5E_BADATOM, NULL, "couldn't get object from ID")
+ HGOTO_ERROR(H5E_OHDR, H5E_BADID, NULL, "couldn't get object from ID")
/* Get the group's object header location */
if (NULL == (ret_value = H5G_oloc(grp)))
diff --git a/src/H5Groot.c b/src/H5Groot.c
index 28b94c8..997d187 100644
--- a/src/H5Groot.c
+++ b/src/H5Groot.c
@@ -15,7 +15,7 @@
*
* Created: H5Groot.c
* Apr 8 2009
- * Neil Fortner <nfortne2@hdfgroup.org>
+ * Neil Fortner
*
* Purpose: Functions for operating on the root group.
*
@@ -126,7 +126,6 @@ H5G_rootof(H5F_t *f)
* Return: Non-negative on success/Negative on failure
*
* Programmer: Robb Matzke
- * matzke@llnl.gov
* Aug 11 1997
*
*-------------------------------------------------------------------------
@@ -357,7 +356,6 @@ H5G_root_free(H5G_t *grp)
* Failure: Negative
*
* Programmer: Quincey Koziol
- * koziol@hdfgroup.org
* Mar 5 2007
*
*-------------------------------------------------------------------------
diff --git a/src/H5Gstab.c b/src/H5Gstab.c
index 834ef1f..78981be 100644
--- a/src/H5Gstab.c
+++ b/src/H5Gstab.c
@@ -11,7 +11,7 @@
* help@hdfgroup.org. *
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
-/* Programmer: Robb Matzke <matzke@llnl.gov>
+/* Programmer: Robb Matzke
* Friday, September 19, 1997
*
*/
@@ -117,7 +117,6 @@ typedef struct H5G_bt_it_lbi_t {
* Return: Non-negative on success/Negative on failure
*
* Programmer: Quincey Koziol
- * koziol@ncsa.uiuc.edu
* Nov 7 2005
*
*-------------------------------------------------------------------------
@@ -183,7 +182,6 @@ done:
* Return: Non-negative on success/Negative on failure
*
* Programmer: Robb Matzke
- * matzke@llnl.gov
* Aug 1 1997
*
*-------------------------------------------------------------------------
@@ -240,7 +238,6 @@ done:
* Return: Non-negative on success/Negative on failure
*
* Programmer: Quincey Koziol
- * koziol@uiuc.edu
* Nov 7 2005
*
*-------------------------------------------------------------------------
@@ -294,7 +291,6 @@ done:
* Return: Non-negative on success/Negative on failure
*
* Programmer: Robb Matzke
- * matzke@llnl.gov
* Aug 1 1997
*
*-------------------------------------------------------------------------
@@ -665,7 +661,7 @@ done:
} /* end H5G__stab_bh_size() */
/*-------------------------------------------------------------------------
- * Function: H5G_stab_get_name_by_idx_cb
+ * Function: H5G__stab_get_name_by_idx_cb
*
* Purpose: Callback for B-tree iteration 'by index' info query to
* retrieve the name of a link
@@ -679,14 +675,14 @@ done:
*-------------------------------------------------------------------------
*/
static herr_t
-H5G_stab_get_name_by_idx_cb(const H5G_entry_t *ent, void *_udata)
+H5G__stab_get_name_by_idx_cb(const H5G_entry_t *ent, void *_udata)
{
H5G_bt_it_gnbi_t *udata = (H5G_bt_it_gnbi_t *)_udata;
size_t name_off; /* Offset of name in heap */
const char * name; /* Pointer to name string in heap */
herr_t ret_value = SUCCEED; /* Return value */
- FUNC_ENTER_NOAPI_NOINIT
+ FUNC_ENTER_STATIC
/* Sanity check */
HDassert(ent);
@@ -703,7 +699,7 @@ H5G_stab_get_name_by_idx_cb(const H5G_entry_t *ent, void *_udata)
done:
FUNC_LEAVE_NOAPI(ret_value)
-} /* end H5G_stab_get_name_by_idx_cb */
+} /* end H5G__stab_get_name_by_idx_cb */
/*-------------------------------------------------------------------------
* Function: H5G__stab_get_name_by_idx
@@ -758,7 +754,7 @@ H5G__stab_get_name_by_idx(const H5O_loc_t *oloc, H5_iter_order_t order, hsize_t
/* Set iteration information */
udata.common.idx = n;
udata.common.num_objs = 0;
- udata.common.op = H5G_stab_get_name_by_idx_cb;
+ udata.common.op = H5G__stab_get_name_by_idx_cb;
udata.heap = heap;
udata.name = NULL;
udata_valid = TRUE;
@@ -794,7 +790,7 @@ done:
} /* end H5G__stab_get_name_by_idx() */
/*-------------------------------------------------------------------------
- * Function: H5G_stab_lookup_cb
+ * Function: H5G__stab_lookup_cb
*
* Purpose: B-tree 'find' callback to retrieve location for an object
*
@@ -808,12 +804,12 @@ done:
*-------------------------------------------------------------------------
*/
static herr_t
-H5G_stab_lookup_cb(const H5G_entry_t *ent, void *_udata)
+H5G__stab_lookup_cb(const H5G_entry_t *ent, void *_udata)
{
H5G_stab_fnd_ud_t *udata = (H5G_stab_fnd_ud_t *)_udata; /* 'User data' passed in */
herr_t ret_value = SUCCEED; /* Return value */
- FUNC_ENTER_NOAPI_NOINIT
+ FUNC_ENTER_STATIC
/* Check for setting link info */
if (udata->lnk)
@@ -823,7 +819,7 @@ H5G_stab_lookup_cb(const H5G_entry_t *ent, void *_udata)
done:
FUNC_LEAVE_NOAPI(ret_value)
-} /* end H5G_stab_lookup_cb() */
+} /* end H5G__stab_lookup_cb() */
/*-------------------------------------------------------------------------
* Function: H5G__stab_lookup
@@ -833,7 +829,6 @@ done:
* Return: Non-negative (TRUE/FALSE) on success/Negative on failure
*
* Programmer: Quincey Koziol
- * koziol@ncsa.uiuc.edu
* Sep 20 2005
*
*-------------------------------------------------------------------------
@@ -870,7 +865,7 @@ H5G__stab_lookup(const H5O_loc_t *grp_oloc, const char *name, H5O_link_t *lnk)
/* Set up the user data for actual B-tree find operation */
bt_udata.common.name = name;
bt_udata.common.heap = heap;
- bt_udata.op = H5G_stab_lookup_cb;
+ bt_udata.op = H5G__stab_lookup_cb;
bt_udata.op_data = &udata;
/* Search the B-tree */
@@ -886,7 +881,7 @@ done:
} /* end H5G__stab_lookup() */
/*-------------------------------------------------------------------------
- * Function: H5G_stab_lookup_by_idx_cb
+ * Function: H5G__stab_lookup_by_idx_cb
*
* Purpose: Callback for B-tree iteration 'by index' info query to
* retrieve the link
@@ -900,13 +895,13 @@ done:
*-------------------------------------------------------------------------
*/
static herr_t
-H5G_stab_lookup_by_idx_cb(const H5G_entry_t *ent, void *_udata)
+H5G__stab_lookup_by_idx_cb(const H5G_entry_t *ent, void *_udata)
{
H5G_bt_it_lbi_t *udata = (H5G_bt_it_lbi_t *)_udata;
const char * name; /* Pointer to name string in heap */
herr_t ret_value = SUCCEED; /* Return value */
- FUNC_ENTER_NOAPI_NOINIT
+ FUNC_ENTER_STATIC
/* Sanity check */
HDassert(ent);
@@ -923,7 +918,7 @@ H5G_stab_lookup_by_idx_cb(const H5G_entry_t *ent, void *_udata)
done:
FUNC_LEAVE_NOAPI(ret_value)
-} /* end H5G_stab_lookup_by_idx_cb */
+} /* end H5G__stab_lookup_by_idx_cb */
/*-------------------------------------------------------------------------
* Function: H5G__stab_lookup_by_idx
@@ -933,7 +928,6 @@ done:
* Return: Non-negative on success/Negative on failure
*
* Programmer: Quincey Koziol
- * koziol@hdfgroup.org
* Nov 7 2006
*
*-------------------------------------------------------------------------
@@ -975,7 +969,7 @@ H5G__stab_lookup_by_idx(const H5O_loc_t *grp_oloc, H5_iter_order_t order, hsize_
/* Set iteration information */
udata.common.idx = n;
udata.common.num_objs = 0;
- udata.common.op = H5G_stab_lookup_by_idx_cb;
+ udata.common.op = H5G__stab_lookup_by_idx_cb;
udata.heap = heap;
udata.lnk = lnk;
udata.found = FALSE;
@@ -1015,7 +1009,6 @@ done:
* Return: Non-negative on success/Negative on failure
*
* Programmer: Neil Fortner
- * nfortne2@hdfgroup.org
* Mar 17, 2009
*
*-------------------------------------------------------------------------
diff --git a/src/H5Gtest.c b/src/H5Gtest.c
index 0d21f22..9f0dca2 100644
--- a/src/H5Gtest.c
+++ b/src/H5Gtest.c
@@ -607,6 +607,7 @@ H5G__user_path_test(hid_t obj_id, char *user_path, size_t *user_path_len, unsign
case H5I_ERROR_MSG:
case H5I_ERROR_STACK:
case H5I_SPACE_SEL_ITER:
+ case H5I_EVENTSET:
case H5I_NTYPES:
default:
HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "unknown data object type")
@@ -798,7 +799,6 @@ done:
* Return: Non-negative on success/Negative on failure
*
* Programmer: Neil Fortner
- * nfortne2@hdfgroup.org
* April 6 2011
*
*-------------------------------------------------------------------------
diff --git a/src/H5Gtraverse.c b/src/H5Gtraverse.c
index d88d121..bbd8973 100644
--- a/src/H5Gtraverse.c
+++ b/src/H5Gtraverse.c
@@ -15,7 +15,7 @@
*
* Created: H5Gtraverse.c
* Sep 13 2005
- * Quincey Koziol <koziol@ncsa.uiuc.edu>
+ * Quincey Koziol
*
* Purpose: Functions for traversing group hierarchy
*
@@ -218,7 +218,7 @@ H5G__traverse_ud(const H5G_loc_t *grp_loc /*in,out*/, const H5O_link_t *lnk, H5G
} /* end if */
/* else, we really needed to open the object */
else
- HGOTO_ERROR(H5E_SYM, H5E_BADATOM, FAIL, "traversal callback returned invalid ID")
+ HGOTO_ERROR(H5E_SYM, H5E_BADID, FAIL, "traversal callback returned invalid ID")
} /* end if */
/* Get the object location information from the ID the user callback returned */
@@ -241,16 +241,16 @@ H5G__traverse_ud(const H5G_loc_t *grp_loc /*in,out*/, const H5O_link_t *lnk, H5G
* Close the open ID the user passed back.
*/
if (H5I_dec_ref(cb_return) < 0)
- HGOTO_ERROR(H5E_SYM, H5E_CANTRELEASE, FAIL, "unable to close atom from UD callback")
+ HGOTO_ERROR(H5E_SYM, H5E_CANTRELEASE, FAIL, "unable to close ID from UD callback")
cb_return = (hid_t)(-1);
done:
/* Close location given to callback. */
if (cur_grp > 0 && H5I_dec_ref(cur_grp) < 0)
- HDONE_ERROR(H5E_SYM, H5E_CANTRELEASE, FAIL, "unable to close atom for current location")
+ HDONE_ERROR(H5E_SYM, H5E_CANTRELEASE, FAIL, "unable to close ID for current location")
if (ret_value < 0 && cb_return > 0 && H5I_dec_ref(cb_return) < 0)
- HDONE_ERROR(H5E_SYM, H5E_CANTRELEASE, FAIL, "unable to close atom from UD callback")
+ HDONE_ERROR(H5E_SYM, H5E_CANTRELEASE, FAIL, "unable to close ID from UD callback")
FUNC_LEAVE_NOAPI(ret_value)
} /* end H5G__traverse_ud() */
@@ -345,7 +345,6 @@ done:
* Return: Non-negative on success/Negative on failure
*
* Programmer: Quincey Koziol
- * koziol@hdfgroup.org
* Nov 20 2006
*
*-------------------------------------------------------------------------
@@ -450,7 +449,6 @@ done:
* resolved.
*
* Programmer: Robb Matzke
- * matzke@llnl.gov
* Aug 11 1997
*
*-------------------------------------------------------------------------
@@ -797,7 +795,6 @@ done:
* traversed.
*
* Programmer: Quincey Koziol
- * koziol@ncsa.uiuc.edu
* Sep 13 2005
*
*-------------------------------------------------------------------------
@@ -820,7 +817,7 @@ H5G_traverse(const H5G_loc_t *loc, const char *name, unsigned target, H5G_traver
/* Retrieve the original # of soft / UD links that are able to be traversed
* (So that multiple calls to H5G_traverse don't incorrectly look
- * like they've traversed too many. Nested calls, like in H5L_move(),
+ * like they've traversed too many. Nested calls, like in H5L__move(),
* may need their own mechanism to set & reset the # of links to traverse)
*/
if (H5CX_get_nlinks(&orig_nlinks) < 0)
diff --git a/src/H5HF.c b/src/H5HF.c
index fb03c06..73281a4 100644
--- a/src/H5HF.c
+++ b/src/H5HF.c
@@ -15,7 +15,7 @@
*
* Created: H5HF.c
* Feb 24 2006
- * Quincey Koziol <koziol@ncsa.uiuc.edu>
+ * Quincey Koziol
*
* Purpose: Implements a "fractal heap" for storing variable-
* length objects in a file.
@@ -78,52 +78,50 @@ hbool_t H5_PKG_INIT_VAR = FALSE;
H5FL_DEFINE_STATIC(H5HF_t);
/*-------------------------------------------------------------------------
- * Function: H5HF_op_read
+ * Function: H5HF__op_read
*
* Purpose: Performs a 'read' operation for a heap 'op' callback
*
* Return: SUCCEED/FAIL
*
* Programmer: Quincey Koziol
- * koziol@hdfgroup.org
* Sep 11 2006
*
*-------------------------------------------------------------------------
*/
herr_t
-H5HF_op_read(const void *obj, size_t obj_len, void *op_data)
+H5HF__op_read(const void *obj, size_t obj_len, void *op_data)
{
- FUNC_ENTER_NOAPI_NOINIT_NOERR
+ FUNC_ENTER_PACKAGE_NOERR
/* Perform "read", using memcpy() */
H5MM_memcpy(op_data, obj, obj_len);
FUNC_LEAVE_NOAPI(SUCCEED)
-} /* end H5HF_op_read() */
+} /* end H5HF__op_read() */
/*-------------------------------------------------------------------------
- * Function: H5HF_op_write
+ * Function: H5HF__op_write
*
* Purpose: Performs a 'write' operation for a heap 'op' callback
*
* Return: SUCCEED/FAIL
*
* Programmer: Quincey Koziol
- * koziol@hdfgroup.org
* Dec 18 2006
*
*-------------------------------------------------------------------------
*/
herr_t
-H5HF_op_write(const void *obj, size_t obj_len, void *op_data)
+H5HF__op_write(const void *obj, size_t obj_len, void *op_data)
{
- FUNC_ENTER_NOAPI_NOINIT_NOERR
+ FUNC_ENTER_PACKAGE_NOERR
/* Perform "write", using memcpy() */
H5MM_memcpy((void *)obj, op_data, obj_len); /* Casting away const OK -QAK */
FUNC_LEAVE_NOAPI(SUCCEED)
-} /* end H5HF_op_write() */
+} /* end H5HF__op_write() */
/*-------------------------------------------------------------------------
* Function: H5HF_create
@@ -134,7 +132,6 @@ H5HF_op_write(const void *obj, size_t obj_len, void *op_data)
* NULL on failure
*
* Programmer: Quincey Koziol
- * koziol@ncsa.uiuc.edu
* Feb 24 2006
*
*-------------------------------------------------------------------------
@@ -156,7 +153,7 @@ H5HF_create(H5F_t *f, const H5HF_create_t *cparam)
HDassert(cparam);
/* Create shared fractal heap header */
- if (HADDR_UNDEF == (fh_addr = H5HF_hdr_create(f, cparam)))
+ if (HADDR_UNDEF == (fh_addr = H5HF__hdr_create(f, cparam)))
HGOTO_ERROR(H5E_HEAP, H5E_CANTINIT, NULL, "can't create fractal heap header")
/* Allocate fractal heap wrapper */
@@ -169,11 +166,11 @@ H5HF_create(H5F_t *f, const H5HF_create_t *cparam)
/* Point fractal heap wrapper at header and bump it's ref count */
fh->hdr = hdr;
- if (H5HF_hdr_incr(fh->hdr) < 0)
+ if (H5HF__hdr_incr(fh->hdr) < 0)
HGOTO_ERROR(H5E_HEAP, H5E_CANTINC, NULL, "can't increment reference count on shared heap header")
/* Increment # of files using this heap header */
- if (H5HF_hdr_fuse_incr(fh->hdr) < 0)
+ if (H5HF__hdr_fuse_incr(fh->hdr) < 0)
HGOTO_ERROR(H5E_HEAP, H5E_CANTINC, NULL, "can't increment file reference count on shared heap header")
/* Set file pointer for this heap open context */
@@ -201,7 +198,6 @@ done:
* NULL on failure
*
* Programmer: Quincey Koziol
- * koziol@ncsa.uiuc.edu
* Apr 18 2006
*
*-------------------------------------------------------------------------
@@ -235,11 +231,11 @@ H5HF_open(H5F_t *f, haddr_t fh_addr)
/* Point fractal heap wrapper at header */
fh->hdr = hdr;
- if (H5HF_hdr_incr(fh->hdr) < 0)
+ if (H5HF__hdr_incr(fh->hdr) < 0)
HGOTO_ERROR(H5E_HEAP, H5E_CANTINC, NULL, "can't increment reference count on shared heap header")
/* Increment # of files using this heap header */
- if (H5HF_hdr_fuse_incr(fh->hdr) < 0)
+ if (H5HF__hdr_fuse_incr(fh->hdr) < 0)
HGOTO_ERROR(H5E_HEAP, H5E_CANTINC, NULL, "can't increment file reference count on shared heap header")
/* Set file pointer for this heap open context */
@@ -266,7 +262,6 @@ done:
* Return: SUCCEED/FAIL
*
* Programmer: Quincey Koziol
- * koziol@ncsa.uiuc.edu
* Apr 17 2006
*
*-------------------------------------------------------------------------
@@ -296,7 +291,6 @@ H5HF_get_id_len(H5HF_t *fh, size_t *id_len_p)
* Return: SUCCEED/FAIL
*
* Programmer: Quincey Koziol
- * koziol@ncsa.uiuc.edu
* Apr 18 2006
*
*-------------------------------------------------------------------------
@@ -327,7 +321,6 @@ H5HF_get_heap_addr(const H5HF_t *fh, haddr_t *heap_addr_p)
* filled in), negative on failure
*
* Programmer: Quincey Koziol
- * koziol@ncsa.uiuc.edu
* Feb 24 2006
*
*-------------------------------------------------------------------------
@@ -365,7 +358,7 @@ H5HF_insert(H5HF_t *fh, size_t size, const void *obj, void *id /*out*/)
/* Check for 'tiny' object */
else if (size <= hdr->tiny_max_len) {
/* Store 'tiny' object in heap */
- if (H5HF_tiny_insert(hdr, size, obj, id) < 0)
+ if (H5HF__tiny_insert(hdr, size, obj, id) < 0)
HGOTO_ERROR(H5E_HEAP, H5E_CANTINSERT, FAIL, "can't store 'tiny' object in fractal heap")
} /* end if */
else {
@@ -392,7 +385,6 @@ done:
* Return: SUCCEED/FAIL
*
* Programmer: Quincey Koziol
- * koziol@ncsa.uiuc.edu
* May 9 2006
*
*-------------------------------------------------------------------------
@@ -425,7 +417,7 @@ H5HF_get_obj_len(H5HF_t *fh, const void *_id, size_t *obj_len_p)
/* Check type of object in heap */
if ((id_flags & H5HF_ID_TYPE_MASK) == H5HF_ID_TYPE_MAN) {
- if (H5HF_man_get_obj_len(fh->hdr, id, obj_len_p) < 0)
+ if (H5HF__man_get_obj_len(fh->hdr, id, obj_len_p) < 0)
HGOTO_ERROR(H5E_HEAP, H5E_CANTGET, FAIL, "can't get 'managed' object's length")
} /* end if */
else if ((id_flags & H5HF_ID_TYPE_MASK) == H5HF_ID_TYPE_HUGE) {
@@ -433,7 +425,7 @@ H5HF_get_obj_len(H5HF_t *fh, const void *_id, size_t *obj_len_p)
HGOTO_ERROR(H5E_HEAP, H5E_CANTGET, FAIL, "can't get 'huge' object's length")
} /* end if */
else if ((id_flags & H5HF_ID_TYPE_MASK) == H5HF_ID_TYPE_TINY) {
- if (H5HF_tiny_get_obj_len(fh->hdr, id, obj_len_p) < 0)
+ if (H5HF__tiny_get_obj_len(fh->hdr, id, obj_len_p) < 0)
HGOTO_ERROR(H5E_HEAP, H5E_CANTGET, FAIL, "can't get 'tiny' object's length")
} /* end if */
else {
@@ -453,7 +445,6 @@ done:
* Return: SUCCEED/FAIL
*
* Programmer: Quincey Koziol
- * koziol@hdfgroup.org
* Aug 20 2015
*
*-------------------------------------------------------------------------
@@ -514,7 +505,6 @@ done:
* Return: SUCCEED/FAIL
*
* Programmer: Quincey Koziol
- * koziol@ncsa.uiuc.edu
* Mar 18 2006
*
*-------------------------------------------------------------------------
@@ -558,7 +548,7 @@ H5HF_read(H5HF_t *fh, const void *_id, void *obj /*out*/)
} /* end if */
else if ((id_flags & H5HF_ID_TYPE_MASK) == H5HF_ID_TYPE_TINY) {
/* Read 'tiny' object from file */
- if (H5HF_tiny_read(fh->hdr, id, obj) < 0)
+ if (H5HF__tiny_read(fh->hdr, id, obj) < 0)
HGOTO_ERROR(H5E_HEAP, H5E_CANTGET, FAIL, "can't read 'tiny' object from fractal heap")
} /* end if */
else {
@@ -590,7 +580,6 @@ done:
* Return: SUCCEED/FAIL
*
* Programmer: Quincey Koziol
- * koziol@hdfgroup.org
* Dec 18 2006
*
*-------------------------------------------------------------------------
@@ -660,7 +649,6 @@ done:
* Return: SUCCEED/FAIL
*
* Programmer: Quincey Koziol
- * koziol@hdfgroup.org
* Sept 11 2006
*
*-------------------------------------------------------------------------
@@ -704,7 +692,7 @@ H5HF_op(H5HF_t *fh, const void *_id, H5HF_operator_t op, void *op_data)
} /* end if */
else if ((id_flags & H5HF_ID_TYPE_MASK) == H5HF_ID_TYPE_TINY) {
/* Operate on 'tiny' object from file */
- if (H5HF_tiny_op(fh->hdr, id, op, op_data) < 0)
+ if (H5HF__tiny_op(fh->hdr, id, op, op_data) < 0)
HGOTO_ERROR(H5E_HEAP, H5E_CANTOPERATE, FAIL, "can't operate on 'tiny' object from fractal heap")
} /* end if */
else {
@@ -724,7 +712,6 @@ done:
* Return: SUCCEED/FAIL
*
* Programmer: Quincey Koziol
- * koziol@ncsa.uiuc.edu
* May 15 2006
*
*-------------------------------------------------------------------------
@@ -768,7 +755,7 @@ H5HF_remove(H5HF_t *fh, const void *_id)
} /* end if */
else if ((id_flags & H5HF_ID_TYPE_MASK) == H5HF_ID_TYPE_TINY) {
/* Remove 'tiny' object from heap statistics */
- if (H5HF_tiny_remove(fh->hdr, id) < 0)
+ if (H5HF__tiny_remove(fh->hdr, id) < 0)
HGOTO_ERROR(H5E_HEAP, H5E_CANTREMOVE, FAIL, "can't remove 'tiny' object from fractal heap")
} /* end if */
else {
@@ -788,7 +775,6 @@ done:
* Return: SUCCEED/FAIL
*
* Programmer: Quincey Koziol
- * koziol@ncsa.uiuc.edu
* Apr 17 2006
*
*-------------------------------------------------------------------------
@@ -808,7 +794,7 @@ H5HF_close(H5HF_t *fh)
HDassert(fh);
/* Decrement file reference & check if this is the last open fractal heap using the shared heap header */
- if (0 == H5HF_hdr_fuse_decr(fh->hdr)) {
+ if (0 == H5HF__hdr_fuse_decr(fh->hdr)) {
/* Set the shared heap header's file context for this operation */
fh->hdr->f = fh->f;
@@ -827,8 +813,8 @@ H5HF_close(H5HF_t *fh)
* a reference loop and the objects couldn't be removed from
* the metadata cache - QAK)
*/
- if (H5HF_man_iter_ready(&fh->hdr->next_block))
- if (H5HF_man_iter_reset(&fh->hdr->next_block) < 0)
+ if (H5HF__man_iter_ready(&fh->hdr->next_block))
+ if (H5HF__man_iter_reset(&fh->hdr->next_block) < 0)
HGOTO_ERROR(H5E_HEAP, H5E_CANTRELEASE, FAIL, "can't reset block iterator")
/* Shut down the huge object information */
@@ -850,10 +836,10 @@ H5HF_close(H5HF_t *fh)
} /* end if */
/* Decrement the reference count on the heap header */
- /* (don't put in H5HF_hdr_fuse_decr() as the heap header may be evicted
+ /* (don't put in H5HF__hdr_fuse_decr() as the heap header may be evicted
* immediately -QAK)
*/
- if (H5HF_hdr_decr(fh->hdr) < 0)
+ if (H5HF__hdr_decr(fh->hdr) < 0)
HGOTO_ERROR(H5E_HEAP, H5E_CANTDEC, FAIL, "can't decrement reference count on shared heap header")
/* Check for pending heap deletion */
@@ -884,7 +870,6 @@ done:
* Return: SUCCEED/FAIL
*
* Programmer: Quincey Koziol
- * koziol@ncsa.uiuc.edu
* Aug 4 2006
*
*-------------------------------------------------------------------------
diff --git a/src/H5HFbtree2.c b/src/H5HFbtree2.c
index f8ed4fb..353d7d7 100644
--- a/src/H5HFbtree2.c
+++ b/src/H5HFbtree2.c
@@ -15,7 +15,7 @@
*
* Created: H5HFbtree2.c
* Aug 7 2006
- * Quincey Koziol <koziol@hdfgroup.org>
+ * Quincey Koziol
*
* Purpose: v2 B-tree callbacks for "huge" object tracker
*
@@ -434,8 +434,8 @@ H5HF__huge_bt2_indir_debug(FILE *stream, int indent, int fwidth, const void *_nr
FUNC_ENTER_STATIC_NOERR
- HDfprintf(stream, "%*s%-*s {%a, %Hu, %Hu}\n", indent, "", fwidth, "Record:", nrecord->addr, nrecord->len,
- nrecord->id);
+ HDfprintf(stream, "%*s%-*s {%" PRIuHADDR ", %" PRIuHSIZE ", %" PRIuHSIZE "}\n", indent, "", fwidth,
+ "Record:", nrecord->addr, nrecord->len, nrecord->id);
FUNC_LEAVE_NOAPI(SUCCEED)
} /* H5HF__huge_bt2_indir_debug() */
@@ -636,8 +636,9 @@ H5HF__huge_bt2_filt_indir_debug(FILE *stream, int indent, int fwidth, const void
FUNC_ENTER_STATIC_NOERR
- HDfprintf(stream, "%*s%-*s {%a, %Hu, %x, %Hu, %Hu}\n", indent, "", fwidth, "Record:", nrecord->addr,
- nrecord->len, nrecord->filter_mask, nrecord->obj_size, nrecord->id);
+ HDfprintf(stream, "%*s%-*s {%" PRIuHADDR ", %" PRIuHSIZE ", %x, %" PRIuHSIZE ", %" PRIuHSIZE "}\n",
+ indent, "", fwidth, "Record:", nrecord->addr, nrecord->len, nrecord->filter_mask,
+ nrecord->obj_size, nrecord->id);
FUNC_LEAVE_NOAPI(SUCCEED)
} /* H5HF__huge_bt2_filt_indir_debug() */
@@ -818,7 +819,8 @@ H5HF__huge_bt2_dir_debug(FILE *stream, int indent, int fwidth, const void *_nrec
FUNC_ENTER_STATIC_NOERR
- HDfprintf(stream, "%*s%-*s {%a, %Hu}\n", indent, "", fwidth, "Record:", nrecord->addr, nrecord->len);
+ HDfprintf(stream, "%*s%-*s {%" PRIuHADDR ", %" PRIuHSIZE "}\n", indent, "", fwidth,
+ "Record:", nrecord->addr, nrecord->len);
FUNC_LEAVE_NOAPI(SUCCEED)
} /* H5HF__huge_bt2_dir_debug() */
@@ -1028,8 +1030,8 @@ H5HF__huge_bt2_filt_dir_debug(FILE *stream, int indent, int fwidth, const void *
FUNC_ENTER_STATIC_NOERR
- HDfprintf(stream, "%*s%-*s {%a, %Hu, %x, %Hu}\n", indent, "", fwidth, "Record:", nrecord->addr,
- nrecord->len, nrecord->filter_mask, nrecord->obj_size);
+ HDfprintf(stream, "%*s%-*s {%" PRIuHADDR ", %" PRIuHSIZE ", %x, %" PRIuHSIZE "}\n", indent, "", fwidth,
+ "Record:", nrecord->addr, nrecord->len, nrecord->filter_mask, nrecord->obj_size);
FUNC_LEAVE_NOAPI(SUCCEED)
} /* H5HF__huge_bt2_filt_dir_debug() */
diff --git a/src/H5HFcache.c b/src/H5HFcache.c
index 7e9384d..ea5e730 100644
--- a/src/H5HFcache.c
+++ b/src/H5HFcache.c
@@ -15,7 +15,7 @@
*
* Created: H5HFcache.c
* Feb 24 2006
- * Quincey Koziol <koziol@ncsa.uiuc.edu>
+ * Quincey Koziol
*
* Purpose: Implement fractal heap metadata cache methods.
*
@@ -212,7 +212,7 @@ H5HF__hdr_prefix_decode(H5HF_hdr_t *hdr, const uint8_t **image_ref)
HDassert(image);
/* Magic number */
- if (HDmemcmp(image, H5HF_HDR_MAGIC, (size_t)H5_SIZEOF_MAGIC))
+ if (HDmemcmp(image, H5HF_HDR_MAGIC, (size_t)H5_SIZEOF_MAGIC) != 0)
HGOTO_ERROR(H5E_HEAP, H5E_BADVALUE, FAIL, "wrong fractal heap header signature")
image += H5_SIZEOF_MAGIC;
@@ -241,7 +241,6 @@ done:
* Failure: NULL
*
* Programmer: Quincey Koziol
- * koziol@ncsa.uiuc.edu
* Feb 27 2006
*
*-------------------------------------------------------------------------
@@ -290,7 +289,6 @@ H5HF__dtable_decode(H5F_t *f, const uint8_t **pp, H5HF_dtable_t *dtable)
* Failure: NULL
*
* Programmer: Quincey Koziol
- * koziol@ncsa.uiuc.edu
* Feb 27 2006
*
*-------------------------------------------------------------------------
@@ -337,7 +335,7 @@ H5HF__dtable_encode(H5F_t *f, uint8_t **pp, const H5HF_dtable_t *dtable)
*
* Note also that the value returned by this function presumes that
* there is no I/O filtering data in the header. If there is, the
- * size reported will be too small, and H5C_load_entry()
+ * size reported will be too small, and H5C__load_entry()
* will have to make two tries to load the fractal heap header.
*
* Return: Success: SUCCEED
@@ -487,7 +485,7 @@ H5HF__cache_hdr_deserialize(const void *_image, size_t len, void *_udata, hbool_
HDassert(dirty);
/* Allocate space for the fractal heap data structure */
- if (NULL == (hdr = H5HF_hdr_alloc(udata->f)))
+ if (NULL == (hdr = H5HF__hdr_alloc(udata->f)))
HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "memory allocation failed")
/* Deserialize the fractal heap header's prefix */
@@ -572,7 +570,7 @@ H5HF__cache_hdr_deserialize(const void *_image, size_t len, void *_udata, hbool_
HDassert((size_t)(image - (const uint8_t *)_image) == hdr->heap_size);
/* Finish initialization of heap header */
- if (H5HF_hdr_finish_init(hdr) < 0)
+ if (H5HF__hdr_finish_init(hdr) < 0)
HGOTO_ERROR(H5E_RESOURCE, H5E_CANTINIT, NULL, "can't finish initializing shared fractal heap header")
/* Set return value */
@@ -580,7 +578,7 @@ H5HF__cache_hdr_deserialize(const void *_image, size_t len, void *_udata, hbool_
done:
if (!ret_value && hdr)
- if (H5HF_hdr_free(hdr) < 0)
+ if (H5HF__hdr_free(hdr) < 0)
HDONE_ERROR(H5E_HEAP, H5E_CANTRELEASE, NULL, "unable to release fractal heap header")
FUNC_LEAVE_NOAPI(ret_value)
@@ -856,7 +854,7 @@ H5HF__cache_hdr_free_icr(void *_thing)
HDassert(hdr->cache_info.type == H5AC_FHEAP_HDR);
HDassert(hdr->rc == 0);
- if (H5HF_hdr_free(hdr) < 0)
+ if (H5HF__hdr_free(hdr) < 0)
HGOTO_ERROR(H5E_HEAP, H5E_CANTRELEASE, FAIL, "unable to release fractal heap header")
done:
@@ -982,7 +980,7 @@ H5HF__cache_iblock_deserialize(const void *_image, size_t H5_ATTR_NDEBUG_UNUSED
/* Share common heap information */
iblock->hdr = hdr;
- if (H5HF_hdr_incr(hdr) < 0)
+ if (H5HF__hdr_incr(hdr) < 0)
HGOTO_ERROR(H5E_HEAP, H5E_CANTINC, NULL, "can't increment reference count on shared heap header")
/* Set block's internal information */
@@ -997,7 +995,7 @@ H5HF__cache_iblock_deserialize(const void *_image, size_t H5_ATTR_NDEBUG_UNUSED
HDassert(iblock->size == len);
/* Magic number */
- if (HDmemcmp(image, H5HF_IBLOCK_MAGIC, (size_t)H5_SIZEOF_MAGIC))
+ if (HDmemcmp(image, H5HF_IBLOCK_MAGIC, (size_t)H5_SIZEOF_MAGIC) != 0)
HGOTO_ERROR(H5E_HEAP, H5E_BADVALUE, NULL, "wrong fractal heap indirect block signature")
image += H5_SIZEOF_MAGIC;
@@ -1022,7 +1020,7 @@ H5HF__cache_iblock_deserialize(const void *_image, size_t H5_ATTR_NDEBUG_UNUSED
iblock->par_entry = udata->par_info->entry;
if (iblock->parent) {
/* Share parent block */
- if (H5HF_iblock_incr(iblock->parent) < 0)
+ if (H5HF__iblock_incr(iblock->parent) < 0)
HGOTO_ERROR(H5E_HEAP, H5E_CANTINC, NULL,
"can't increment reference count on shared indirect block")
@@ -1121,7 +1119,7 @@ H5HF__cache_iblock_deserialize(const void *_image, size_t H5_ATTR_NDEBUG_UNUSED
done:
if (!ret_value && iblock)
- if (H5HF_man_iblock_dest(iblock) < 0)
+ if (H5HF__man_iblock_dest(iblock) < 0)
HDONE_ERROR(H5E_HEAP, H5E_CANTFREE, NULL, "unable to destroy fractal heap indirect block")
FUNC_LEAVE_NOAPI(ret_value)
@@ -1256,7 +1254,7 @@ H5HF__cache_iblock_pre_serialize(H5F_t *f, void *_thing, haddr_t addr, size_t H5
hdr->man_dtable.table_addr = iblock_addr;
/* Mark that heap header was modified */
- if (H5HF_hdr_dirty(hdr) < 0)
+ if (H5HF__hdr_dirty(hdr) < 0)
HGOTO_ERROR(H5E_HEAP, H5E_CANTDIRTY, FAIL, "can't mark heap header as dirty")
} /* end if */
else {
@@ -1271,7 +1269,7 @@ H5HF__cache_iblock_pre_serialize(H5F_t *f, void *_thing, haddr_t addr, size_t H5
par_iblock->ents[par_entry].addr = iblock_addr;
/* Mark that parent was modified */
- if (H5HF_iblock_dirty(par_iblock) < 0)
+ if (H5HF__iblock_dirty(par_iblock) < 0)
HGOTO_ERROR(H5E_HEAP, H5E_CANTDIRTY, FAIL, "can't mark heap header as dirty")
} /* end if */
@@ -1534,7 +1532,7 @@ H5HF__cache_iblock_free_icr(void *thing)
HDassert(iblock->hdr);
/* Destroy fractal heap indirect block */
- if (H5HF_man_iblock_dest(iblock) < 0)
+ if (H5HF__man_iblock_dest(iblock) < 0)
HGOTO_ERROR(H5E_HEAP, H5E_CANTFREE, FAIL, "unable to destroy fractal heap indirect block")
done:
@@ -1764,7 +1762,7 @@ H5HF__cache_dblock_deserialize(const void *_image, size_t len, void *_udata, hbo
/* Share common heap information */
dblock->hdr = hdr;
- if (H5HF_hdr_incr(hdr) < 0)
+ if (H5HF__hdr_incr(hdr) < 0)
HGOTO_ERROR(H5E_HEAP, H5E_CANTINC, NULL, "can't increment reference count on shared heap header")
/* Set block's internal information */
@@ -1836,7 +1834,7 @@ H5HF__cache_dblock_deserialize(const void *_image, size_t len, void *_udata, hbo
image = dblock->blk;
/* Magic number */
- if (HDmemcmp(image, H5HF_DBLOCK_MAGIC, (size_t)H5_SIZEOF_MAGIC))
+ if (HDmemcmp(image, H5HF_DBLOCK_MAGIC, (size_t)H5_SIZEOF_MAGIC) != 0)
HGOTO_ERROR(H5E_HEAP, H5E_BADVALUE, NULL, "wrong fractal heap direct block signature")
image += H5_SIZEOF_MAGIC;
@@ -1858,7 +1856,7 @@ H5HF__cache_dblock_deserialize(const void *_image, size_t len, void *_udata, hbo
dblock->par_entry = par_info->entry;
if (dblock->parent) {
/* Share parent block */
- if (H5HF_iblock_incr(dblock->parent) < 0)
+ if (H5HF__iblock_incr(dblock->parent) < 0)
HGOTO_ERROR(H5E_HEAP, H5E_CANTINC, NULL,
"can't increment reference count on shared indirect block")
} /* end if */
@@ -1889,7 +1887,7 @@ done:
/* Cleanup on error */
if (!ret_value && dblock)
- if (H5HF_man_dblock_dest(dblock) < 0)
+ if (H5HF__man_dblock_dest(dblock) < 0)
HDONE_ERROR(H5E_HEAP, H5E_CANTFREE, NULL, "unable to destroy fractal heap direct block")
FUNC_LEAVE_NOAPI(ret_value)
@@ -2244,7 +2242,7 @@ H5HF__cache_dblock_pre_serialize(H5F_t *f, void *_thing, haddr_t addr, size_t le
/* Check if heap header was modified */
if (hdr_changed)
- if (H5HF_hdr_dirty(hdr) < 0)
+ if (H5HF__hdr_dirty(hdr) < 0)
HGOTO_ERROR(H5E_HEAP, H5E_CANTDIRTY, FAIL, "can't mark heap header as dirty")
} /* end if */
else { /* the direct block's parent is an indirect block */
@@ -2299,7 +2297,7 @@ H5HF__cache_dblock_pre_serialize(H5F_t *f, void *_thing, haddr_t addr, size_t le
/* Check if parent was modified */
if (par_changed)
- if (H5HF_iblock_dirty(par_iblock) < 0)
+ if (H5HF__iblock_dirty(par_iblock) < 0)
HGOTO_ERROR(H5E_HEAP, H5E_CANTDIRTY, FAIL, "can't mark heap header as dirty")
} /* end else */
} /* end if */
@@ -2337,7 +2335,7 @@ H5HF__cache_dblock_pre_serialize(H5F_t *f, void *_thing, haddr_t addr, size_t le
hdr->man_dtable.table_addr = dblock_addr;
/* Mark that heap header was modified */
- if (H5HF_hdr_dirty(hdr) < 0)
+ if (H5HF__hdr_dirty(hdr) < 0)
HGOTO_ERROR(H5E_HEAP, H5E_CANTDIRTY, FAIL, "can't mark heap header as dirty")
} /* end if */
else { /* the direct block's parent is an indirect block */
@@ -2351,7 +2349,7 @@ H5HF__cache_dblock_pre_serialize(H5F_t *f, void *_thing, haddr_t addr, size_t le
par_iblock->ents[par_entry].addr = dblock_addr;
/* Mark that parent was modified */
- if (H5HF_iblock_dirty(par_iblock) < 0)
+ if (H5HF__iblock_dirty(par_iblock) < 0)
HGOTO_ERROR(H5E_HEAP, H5E_CANTDIRTY, FAIL, "can't mark heap header as dirty")
} /* end else */
} /* end if */
@@ -2551,7 +2549,7 @@ H5HF__cache_dblock_free_icr(void *_thing)
HDassert(dblock->cache_info.type == H5AC_FHEAP_DBLOCK);
/* Destroy fractal heap direct block */
- if (H5HF_man_dblock_dest(dblock) < 0)
+ if (H5HF__man_dblock_dest(dblock) < 0)
HGOTO_ERROR(H5E_HEAP, H5E_CANTFREE, FAIL, "unable to destroy fractal heap direct block")
done:
diff --git a/src/H5HFdbg.c b/src/H5HFdbg.c
index 115e9d0..cc61aa1 100644
--- a/src/H5HFdbg.c
+++ b/src/H5HFdbg.c
@@ -15,7 +15,7 @@
*
* Created: H5HFdbg.c
* Feb 24 2006
- * Quincey Koziol <koziol@ncsa.uiuc.edu>
+ * Quincey Koziol
*
* Purpose: Dump debugging information about a fractal heap
*
@@ -75,7 +75,7 @@ typedef struct {
/* Local Prototypes */
/********************/
-static herr_t H5HF_dtable_debug(const H5HF_dtable_t *dtable, FILE *stream, int indent, int fwidth);
+static herr_t H5HF__dtable_debug(const H5HF_dtable_t *dtable, FILE *stream, int indent, int fwidth);
/*********************/
/* Package Variables */
@@ -97,7 +97,6 @@ static herr_t H5HF_dtable_debug(const H5HF_dtable_t *dtable, FILE *stream, int i
* Return: Non-negative on success/Negative on failure
*
* Programmer: Quincey Koziol
- * koziol@hdfgroup.org
* Aug 20 2015
*
*-------------------------------------------------------------------------
@@ -154,30 +153,29 @@ H5HF_id_print(H5HF_t *fh, const void *_id, FILE *stream, int indent, int fwidth)
HGOTO_ERROR(H5E_HEAP, H5E_CANTGET, FAIL, "can't retrieve heap ID length")
/* Display the heap ID */
- HDfprintf(stream, "%*s%-*s (%c, %Hu, %Zu)\n", indent, "", fwidth, "Heap ID info: (type, offset, length)",
- id_type, obj_off, obj_len);
+ HDfprintf(stream, "%*s%-*s (%c, %" PRIuHSIZE " , %zu)\n", indent, "", fwidth,
+ "Heap ID info: (type, offset, length)", id_type, obj_off, obj_len);
done:
FUNC_LEAVE_NOAPI(ret_value)
} /* end H5HF_id_print() */
/*-------------------------------------------------------------------------
- * Function: H5HF_dtable_debug
+ * Function: H5HF__dtable_debug
*
* Purpose: Prints debugging info about a doubling table
*
* Return: Non-negative on success/Negative on failure
*
* Programmer: Quincey Koziol
- * koziol@ncsa.uiuc.edu
* Feb 28 2006
*
*-------------------------------------------------------------------------
*/
static herr_t
-H5HF_dtable_debug(const H5HF_dtable_t *dtable, FILE *stream, int indent, int fwidth)
+H5HF__dtable_debug(const H5HF_dtable_t *dtable, FILE *stream, int indent, int fwidth)
{
- FUNC_ENTER_NOAPI_NOINIT_NOERR
+ FUNC_ENTER_STATIC_NOERR
/*
* Check arguments.
@@ -192,9 +190,9 @@ H5HF_dtable_debug(const H5HF_dtable_t *dtable, FILE *stream, int indent, int fwi
*/
/* Creation parameter values */
HDfprintf(stream, "%*s%-*s %u\n", indent, "", fwidth, "Doubling table width:", dtable->cparam.width);
- HDfprintf(stream, "%*s%-*s %Zu\n", indent, "", fwidth,
+ HDfprintf(stream, "%*s%-*s %zu\n", indent, "", fwidth,
"Starting block size:", dtable->cparam.start_block_size);
- HDfprintf(stream, "%*s%-*s %Zu\n", indent, "", fwidth,
+ HDfprintf(stream, "%*s%-*s %zu\n", indent, "", fwidth,
"Max. direct block size:", dtable->cparam.max_direct_size);
HDfprintf(stream, "%*s%-*s %u (bits)\n", indent, "", fwidth,
"Max. index size:", dtable->cparam.max_index);
@@ -202,7 +200,8 @@ H5HF_dtable_debug(const H5HF_dtable_t *dtable, FILE *stream, int indent, int fwi
"Starting # of rows in root indirect block:", dtable->cparam.start_root_rows);
/* Run-time varying parameter values */
- HDfprintf(stream, "%*s%-*s %a\n", indent, "", fwidth, "Table's root address:", dtable->table_addr);
+ HDfprintf(stream, "%*s%-*s %" PRIuHADDR "\n", indent, "", fwidth,
+ "Table's root address:", dtable->table_addr);
HDfprintf(stream, "%*s%-*s %u\n", indent, "", fwidth,
"Current # of rows in root indirect block:", dtable->curr_root_rows);
@@ -213,11 +212,11 @@ H5HF_dtable_debug(const H5HF_dtable_t *dtable, FILE *stream, int indent, int fwi
"Max. # of direct rows in any indirect block:", dtable->max_direct_rows);
HDfprintf(stream, "%*s%-*s %u\n", indent, "", fwidth,
"# of bits for IDs in first row:", dtable->first_row_bits);
- HDfprintf(stream, "%*s%-*s %Hu\n", indent, "", fwidth,
+ HDfprintf(stream, "%*s%-*s %" PRIuHSIZE " \n", indent, "", fwidth,
"# of IDs in first row:", dtable->num_id_first_row);
FUNC_LEAVE_NOAPI(SUCCEED)
-} /* end H5HF_dtable_debug() */
+} /* end H5HF__dtable_debug() */
/*-------------------------------------------------------------------------
* Function: H5HF_hdr_print
@@ -227,7 +226,6 @@ H5HF_dtable_debug(const H5HF_dtable_t *dtable, FILE *stream, int indent, int fwi
* Return: Non-negative on success/Negative on failure
*
* Programmer: Quincey Koziol
- * koziol@hdfgroup.org
* Feb 23 2012
*
*-------------------------------------------------------------------------
@@ -253,42 +251,47 @@ H5HF_hdr_print(const H5HF_hdr_t *hdr, hbool_t dump_internal, FILE *stream, int i
*/
HDfprintf(stream, "%*s%-*s %s\n", indent, "", fwidth,
"Heap is:", hdr->man_dtable.curr_root_rows > 0 ? "Indirect" : "Direct");
- HDfprintf(stream, "%*s%-*s %t\n", indent, "", fwidth,
- "Objects stored in 'debugging' format:", hdr->debug_objs);
- HDfprintf(stream, "%*s%-*s %t\n", indent, "", fwidth, "'Write once' flag:", hdr->write_once);
- HDfprintf(stream, "%*s%-*s %t\n", indent, "", fwidth,
- "'Huge' object IDs have wrapped:", hdr->huge_ids_wrapped);
- HDfprintf(stream, "%*s%-*s %Hu\n", indent, "", fwidth,
+ HDfprintf(stream, "%*s%-*s %s\n", indent, "", fwidth,
+ "Objects stored in 'debugging' format:", hdr->debug_objs ? "TRUE" : "FALSE");
+ HDfprintf(stream, "%*s%-*s %s\n", indent, "", fwidth,
+ "'Write once' flag:", hdr->write_once ? "TRUE" : "FALSE");
+ HDfprintf(stream, "%*s%-*s %s\n", indent, "", fwidth,
+ "'Huge' object IDs have wrapped:", hdr->huge_ids_wrapped ? "TRUE" : "FALSE");
+ HDfprintf(stream, "%*s%-*s %" PRIuHSIZE " \n", indent, "", fwidth,
"Free space in managed blocks:", hdr->total_man_free);
- HDfprintf(stream, "%*s%-*s %Hu\n", indent, "", fwidth, "Managed space data block size:", hdr->man_size);
- HDfprintf(stream, "%*s%-*s %Hu\n", indent, "", fwidth,
+ HDfprintf(stream, "%*s%-*s %" PRIuHSIZE " \n", indent, "", fwidth,
+ "Managed space data block size:", hdr->man_size);
+ HDfprintf(stream, "%*s%-*s %" PRIuHSIZE " \n", indent, "", fwidth,
"Total managed space allocated:", hdr->man_alloc_size);
- HDfprintf(stream, "%*s%-*s %Hu\n", indent, "", fwidth,
+ HDfprintf(stream, "%*s%-*s %" PRIuHSIZE " \n", indent, "", fwidth,
"Offset of managed space iterator:", hdr->man_iter_off);
- HDfprintf(stream, "%*s%-*s %Hu\n", indent, "", fwidth,
+ HDfprintf(stream, "%*s%-*s %" PRIuHSIZE " \n", indent, "", fwidth,
"Number of managed objects in heap:", hdr->man_nobjs);
- HDfprintf(stream, "%*s%-*s %a\n", indent, "", fwidth,
+ HDfprintf(stream, "%*s%-*s %" PRIuHADDR "\n", indent, "", fwidth,
"Address of free space manager for managed blocks:", hdr->fs_addr);
HDfprintf(stream, "%*s%-*s %lu\n", indent, "", fwidth,
"Max. size of managed object:", (unsigned long)hdr->max_man_size);
- HDfprintf(stream, "%*s%-*s %Hu\n", indent, "", fwidth, "'Huge' object space used:", hdr->huge_size);
- HDfprintf(stream, "%*s%-*s %Hu\n", indent, "", fwidth,
+ HDfprintf(stream, "%*s%-*s %" PRIuHSIZE " \n", indent, "", fwidth,
+ "'Huge' object space used:", hdr->huge_size);
+ HDfprintf(stream, "%*s%-*s %" PRIuHSIZE " \n", indent, "", fwidth,
"Number of 'huge' objects in heap:", hdr->huge_nobjs);
- HDfprintf(stream, "%*s%-*s %Hu\n", indent, "", fwidth, "ID of next 'huge' object:", hdr->huge_next_id);
- HDfprintf(stream, "%*s%-*s %a\n", indent, "", fwidth,
+ HDfprintf(stream, "%*s%-*s %" PRIuHSIZE " \n", indent, "", fwidth,
+ "ID of next 'huge' object:", hdr->huge_next_id);
+ HDfprintf(stream, "%*s%-*s %" PRIuHADDR "\n", indent, "", fwidth,
"Address of v2 B-tree for 'huge' objects:", hdr->huge_bt2_addr);
- HDfprintf(stream, "%*s%-*s %Hu\n", indent, "", fwidth, "'Tiny' object space used:", hdr->tiny_size);
- HDfprintf(stream, "%*s%-*s %Hu\n", indent, "", fwidth,
+ HDfprintf(stream, "%*s%-*s %" PRIuHSIZE " \n", indent, "", fwidth,
+ "'Tiny' object space used:", hdr->tiny_size);
+ HDfprintf(stream, "%*s%-*s %" PRIuHSIZE " \n", indent, "", fwidth,
"Number of 'tiny' objects in heap:", hdr->tiny_nobjs);
HDfprintf(stream, "%*sManaged Objects Doubling-Table Info...\n", indent, "");
- H5HF_dtable_debug(&hdr->man_dtable, stream, indent + 3, MAX(0, fwidth - 3));
+ H5HF__dtable_debug(&hdr->man_dtable, stream, indent + 3, MAX(0, fwidth - 3));
/* Print information about I/O filters */
if (hdr->filter_len > 0) {
HDfprintf(stream, "%*sI/O filter Info...\n", indent, "");
if (hdr->man_dtable.curr_root_rows == 0) {
- HDfprintf(stream, "%*s%-*s %Zu\n", indent + 3, "", MAX(0, fwidth - 3),
+ HDfprintf(stream, "%*s%-*s %zu\n", indent + 3, "", MAX(0, fwidth - 3),
"Compressed size of root direct block:", hdr->pline_root_direct_size);
HDfprintf(stream, "%*s%-*s %x\n", indent + 3, "", MAX(0, fwidth - 3),
"Filter mask for root direct block:", hdr->pline_root_direct_filter_mask);
@@ -304,7 +307,7 @@ H5HF_hdr_print(const H5HF_hdr_t *hdr, hbool_t dump_internal, FILE *stream, int i
HDfprintf(stream, "%*s%-*s %x\n", indent + 3, "", MAX(0, fwidth - 3),
"Root indirect block flags:", hdr->root_iblock_flags);
HDfprintf(stream, "%*s%-*s %p\n", indent + 3, "", MAX(0, fwidth - 3),
- "Root indirect block pointer:", hdr->root_iblock);
+ "Root indirect block pointer:", (void *)hdr->root_iblock);
if (hdr->root_iblock)
H5HF_iblock_print(hdr->root_iblock, dump_internal, stream, indent + 3, fwidth);
} /* end if */
@@ -320,7 +323,6 @@ H5HF_hdr_print(const H5HF_hdr_t *hdr, hbool_t dump_internal, FILE *stream, int i
* Return: Non-negative on success/Negative on failure
*
* Programmer: Quincey Koziol
- * koziol@ncsa.uiuc.edu
* Feb 24 2006
*
*-------------------------------------------------------------------------
@@ -364,7 +366,6 @@ done:
* Return: Non-negative on success/Negative on failure
*
* Programmer: Quincey Koziol
- * koziol@ncsa.uiuc.edu
* May 13 2006
*
*-------------------------------------------------------------------------
@@ -417,7 +418,7 @@ H5HF_dblock_debug_cb(H5FS_section_info_t *_sect, void *_udata)
len = end - start;
HDsnprintf(temp_str, sizeof(temp_str), "Section #%u:", (unsigned)udata->sect_count);
- HDfprintf(udata->stream, "%*s%-*s %8Zu, %8Zu\n", udata->indent + 3, "", MAX(0, udata->fwidth - 9),
+ HDfprintf(udata->stream, "%*s%-*s %8zu, %8zu\n", udata->indent + 3, "", MAX(0, udata->fwidth - 9),
temp_str, start, len);
udata->sect_count++;
@@ -447,7 +448,6 @@ H5HF_dblock_debug_cb(H5FS_section_info_t *_sect, void *_udata)
* Return: Non-negative on success/Negative on failure
*
* Programmer: Quincey Koziol
- * koziol@ncsa.uiuc.edu
* Feb 28 2006
*
*-------------------------------------------------------------------------
@@ -492,12 +492,12 @@ H5HF_dblock_debug(H5F_t *f, haddr_t addr, FILE *stream, int indent, int fwidth,
/*
* Print the values.
*/
- HDfprintf(stream, "%*s%-*s %a\n", indent, "", fwidth,
+ HDfprintf(stream, "%*s%-*s %" PRIuHADDR "\n", indent, "", fwidth,
"Address of fractal heap that owns this block:", hdr->heap_addr);
- HDfprintf(stream, "%*s%-*s %Hu\n", indent, "", fwidth,
+ HDfprintf(stream, "%*s%-*s %" PRIuHSIZE " \n", indent, "", fwidth,
"Offset of direct block in heap:", dblock->block_off);
blk_prefix_size = H5HF_MAN_ABS_DIRECT_OVERHEAD(hdr);
- HDfprintf(stream, "%*s%-*s %Zu\n", indent, "", fwidth, "Size of block header:", blk_prefix_size);
+ HDfprintf(stream, "%*s%-*s %zu\n", indent, "", fwidth, "Size of block header:", blk_prefix_size);
/* Allocate space for the free space markers */
if (NULL == (marker = (uint8_t *)H5MM_calloc(dblock->size)))
@@ -569,7 +569,6 @@ done:
* Return: Non-negative on success/Negative on failure
*
* Programmer: Quincey Koziol
- * koziol@hdfgroup.org
* Feb 23 2012
*
*-------------------------------------------------------------------------
@@ -601,11 +600,11 @@ H5HF_iblock_print(const H5HF_indirect_t *iblock, hbool_t dump_internal, FILE *st
/*
* Print the values.
*/
- HDfprintf(stream, "%*s%-*s %a\n", indent, "", fwidth,
+ HDfprintf(stream, "%*s%-*s %" PRIuHADDR "\n", indent, "", fwidth,
"Address of fractal heap that owns this block:", hdr->heap_addr);
- HDfprintf(stream, "%*s%-*s %Hu\n", indent, "", fwidth,
+ HDfprintf(stream, "%*s%-*s %" PRIuHSIZE " \n", indent, "", fwidth,
"Offset of indirect block in heap:", iblock->block_off);
- HDfprintf(stream, "%*s%-*s %Zu\n", indent, "", fwidth, "Size of indirect block:", iblock->size);
+ HDfprintf(stream, "%*s%-*s %zu\n", indent, "", fwidth, "Size of indirect block:", iblock->size);
HDfprintf(stream, "%*s%-*s %u\n", indent, "", fwidth, "Current # of rows:", iblock->nrows);
HDfprintf(stream, "%*s%-*s %u\n", indent, "", fwidth, "Max. # of rows:", iblock->max_rows);
HDfprintf(stream, "%*s%-*s %u\n", indent, "", fwidth,
@@ -625,11 +624,11 @@ H5HF_iblock_print(const H5HF_indirect_t *iblock, hbool_t dump_internal, FILE *st
HDsnprintf(temp_str, sizeof(temp_str), "Col #%u:", (unsigned)v);
if (hdr->filter_len > 0)
- HDfprintf(stream, "%*s%-*s %9a/%6Zu/%x\n", indent + 6, "", MAX(0, fwidth - 6), temp_str,
- iblock->ents[off].addr, iblock->filt_ents[off].size,
+ HDfprintf(stream, "%*s%-*s %9" PRIuHADDR "/%6zu/%x\n", indent + 6, "", MAX(0, fwidth - 6),
+ temp_str, iblock->ents[off].addr, iblock->filt_ents[off].size,
iblock->filt_ents[off].filter_mask);
else
- HDfprintf(stream, "%*s%-*s %9a\n", indent + 6, "", MAX(0, fwidth - 6), temp_str,
+ HDfprintf(stream, "%*s%-*s %9" PRIuHADDR "\n", indent + 6, "", MAX(0, fwidth - 6), temp_str,
iblock->ents[off].addr);
} /* end for */
} /* end for */
@@ -649,7 +648,7 @@ H5HF_iblock_print(const H5HF_indirect_t *iblock, hbool_t dump_internal, FILE *st
size_t off = (u * hdr->man_dtable.cparam.width) + v;
HDsnprintf(temp_str, sizeof(temp_str), "Col #%u:", (unsigned)v);
- HDfprintf(stream, "%*s%-*s %9a\n", indent + 6, "", MAX(0, fwidth - 6), temp_str,
+ HDfprintf(stream, "%*s%-*s %9" PRIuHADDR "\n", indent + 6, "", MAX(0, fwidth - 6), temp_str,
iblock->ents[off].addr);
} /* end for */
} /* end for */
@@ -662,12 +661,12 @@ H5HF_iblock_print(const H5HF_indirect_t *iblock, hbool_t dump_internal, FILE *st
HDfprintf(stream, "%*sFractal Indirect Block Internal Information:\n", indent, "");
/* Print general information */
- HDfprintf(stream, "%*s%-*s %Zu\n", indent + 3, "", MAX(0, fwidth - 3),
+ HDfprintf(stream, "%*s%-*s %zu\n", indent + 3, "", MAX(0, fwidth - 3),
"Reference count:", iblock->rc);
/* Print parent's information */
HDfprintf(stream, "%*s%-*s %p\n", indent + 3, "", MAX(0, fwidth - 3),
- "Parent indirect block address:", iblock->parent);
+ "Parent indirect block address:", (void *)iblock->parent);
if (iblock->parent)
H5HF_iblock_print(iblock->parent, TRUE, stream, indent + 6, fwidth);
} /* end if */
@@ -683,7 +682,6 @@ H5HF_iblock_print(const H5HF_indirect_t *iblock, hbool_t dump_internal, FILE *st
* Return: Non-negative on success/Negative on failure
*
* Programmer: Quincey Koziol
- * koziol@ncsa.uiuc.edu
* Mar 7 2006
*
*-------------------------------------------------------------------------
@@ -692,10 +690,10 @@ herr_t
H5HF_iblock_debug(H5F_t *f, haddr_t addr, FILE *stream, int indent, int fwidth, haddr_t hdr_addr,
unsigned nrows)
{
- H5HF_hdr_t * hdr = NULL; /* Fractal heap header info */
- H5HF_indirect_t *iblock = NULL; /* Fractal heap direct block info */
- hbool_t did_protect; /* Whether we protected the indirect block or not */
- herr_t ret_value = SUCCEED; /* Return value */
+ H5HF_hdr_t * hdr = NULL; /* Fractal heap header info */
+ H5HF_indirect_t *iblock = NULL; /* Fractal heap direct block info */
+ hbool_t did_protect = FALSE; /* Whether we protected the indirect block or not */
+ herr_t ret_value = SUCCEED; /* Return value */
FUNC_ENTER_NOAPI(FAIL)
@@ -741,7 +739,6 @@ done:
* Return: Non-negative on success/Negative on failure
*
* Programmer: Quincey Koziol
- * koziol@ncsa.uiuc.edu
* May 13 2006
*
*-------------------------------------------------------------------------
@@ -769,14 +766,10 @@ H5HF_sects_debug_cb(H5FS_section_info_t *_sect, void *_udata)
: (sect->sect_info.type == H5HF_FSPACE_SECT_FIRST_ROW
? "first row"
: (sect->sect_info.type == H5HF_FSPACE_SECT_NORMAL_ROW ? "normal row" : "unknown"))));
- HDfprintf(udata->stream, "%*s%-*s %a\n", udata->indent, "", udata->fwidth,
+ HDfprintf(udata->stream, "%*s%-*s %" PRIuHADDR "\n", udata->indent, "", udata->fwidth,
"Section address:", sect->sect_info.addr);
- HDfprintf(udata->stream, "%*s%-*s %Hu\n", udata->indent, "", udata->fwidth,
+ HDfprintf(udata->stream, "%*s%-*s %" PRIuHSIZE "\n", udata->indent, "", udata->fwidth,
"Section size:", sect->sect_info.size);
-#ifdef QAK
- HDfprintf(udata->stream, "%*s%-*s %s\n", udata->indent, "", udata->fwidth,
- "Section state:", (sect->sect_info.state == H5FS_SECT_LIVE ? "live" : "serialized"));
-#endif /* QAK */
/* Dump section-specific debugging information */
if (H5FS_sect_debug(udata->fspace, _sect, udata->stream, udata->indent + 3, MAX(0, udata->fwidth - 3)) <
@@ -795,7 +788,6 @@ done:
* Return: Non-negative on success/Negative on failure
*
* Programmer: Quincey Koziol
- * koziol@ncsa.uiuc.edu
* May 9 2006
*
*-------------------------------------------------------------------------
diff --git a/src/H5HFdblock.c b/src/H5HFdblock.c
index 3ad9d67..628dcc4 100644
--- a/src/H5HFdblock.c
+++ b/src/H5HFdblock.c
@@ -15,7 +15,7 @@
*
* Created: H5HFdblock.c
* Apr 10 2006
- * Quincey Koziol <koziol@ncsa.uiuc.edu>
+ * Quincey Koziol
*
* Purpose: Direct block routines for fractal heaps.
*
@@ -77,7 +77,6 @@ H5FL_DEFINE(H5HF_direct_t);
* Return: Pointer to new direct block on success, NULL on failure
*
* Programmer: Quincey Koziol
- * koziol@ncsa.uiuc.edu
* Feb 27 2006
*
*-------------------------------------------------------------------------
@@ -110,7 +109,7 @@ H5HF__man_dblock_create(H5HF_hdr_t *hdr, H5HF_indirect_t *par_iblock, unsigned p
/* Share common heap information */
dblock->hdr = hdr;
- if (H5HF_hdr_incr(hdr) < 0)
+ if (H5HF__hdr_incr(hdr) < 0)
HGOTO_ERROR(H5E_HEAP, H5E_CANTINC, FAIL, "can't increment reference count on shared heap header")
/* Set info for direct block */
@@ -156,7 +155,7 @@ H5HF__man_dblock_create(H5HF_hdr_t *hdr, H5HF_indirect_t *par_iblock, unsigned p
/* Attach to parent indirect block, if there is one */
dblock->parent = par_iblock;
if (dblock->parent) {
- if (H5HF_man_iblock_attach(dblock->parent, par_entry, dblock_addr) < 0)
+ if (H5HF__man_iblock_attach(dblock->parent, par_entry, dblock_addr) < 0)
HGOTO_ERROR(H5E_HEAP, H5E_CANTATTACH, FAIL, "can't attach direct block to parent indirect block")
dblock->fd_parent = par_iblock;
} /* end if */
@@ -165,8 +164,8 @@ H5HF__man_dblock_create(H5HF_hdr_t *hdr, H5HF_indirect_t *par_iblock, unsigned p
dblock->par_entry = par_entry;
/* Create a new 'single' section for the free space in the block */
- if (NULL == (sec_node = H5HF_sect_single_new((dblock->block_off + H5HF_MAN_ABS_DIRECT_OVERHEAD(hdr)),
- free_space, dblock->parent, dblock->par_entry)))
+ if (NULL == (sec_node = H5HF__sect_single_new((dblock->block_off + H5HF_MAN_ABS_DIRECT_OVERHEAD(hdr)),
+ free_space, dblock->parent, dblock->par_entry)))
HGOTO_ERROR(H5E_HEAP, H5E_CANTINIT, FAIL, "can't create section for new direct block's free space")
/* Check what to do with section node */
@@ -184,7 +183,7 @@ H5HF__man_dblock_create(H5HF_hdr_t *hdr, H5HF_indirect_t *par_iblock, unsigned p
HGOTO_ERROR(H5E_HEAP, H5E_CANTINIT, FAIL, "can't add fractal heap direct block to cache")
/* Increase the allocated heap size */
- if (H5HF_hdr_inc_alloc(hdr, dblock->size) < 0)
+ if (H5HF__hdr_inc_alloc(hdr, dblock->size) < 0)
HGOTO_ERROR(H5E_HEAP, H5E_CANTRELEASE, FAIL, "can't increase allocated heap size")
/* Set the address of of direct block, if requested */
@@ -194,7 +193,7 @@ H5HF__man_dblock_create(H5HF_hdr_t *hdr, H5HF_indirect_t *par_iblock, unsigned p
done:
if (ret_value < 0)
if (dblock)
- if (H5HF_man_dblock_dest(dblock) < 0)
+ if (H5HF__man_dblock_dest(dblock) < 0)
HDONE_ERROR(H5E_HEAP, H5E_CANTFREE, FAIL, "unable to destroy fractal heap direct block")
FUNC_LEAVE_NOAPI(ret_value)
@@ -212,7 +211,6 @@ done:
* Return: SUCCEED/FAIL
*
* Programmer: Quincey Koziol
- * koziol@ncsa.uiuc.edu
* May 17 2006
*
*-------------------------------------------------------------------------
@@ -264,7 +262,7 @@ H5HF__man_dblock_destroy(H5HF_hdr_t *hdr, H5HF_direct_t *dblock, haddr_t dblock_
HDassert(hdr->man_dtable.cparam.start_block_size == dblock->size);
/* Sanity check block iterator */
- HDassert(!H5HF_man_iter_ready(&hdr->next_block));
+ HDassert(!H5HF__man_iter_ready(&hdr->next_block));
/* Reset header information back to "empty heap" state */
if (H5HF__hdr_empty(hdr) < 0)
@@ -325,7 +323,6 @@ done:
* Return: SUCCEED/FAIL
*
* Programmer: Quincey Koziol
- * koziol@ncsa.uiuc.edu
* Mar 13 2006
*
*-------------------------------------------------------------------------
@@ -373,8 +370,8 @@ H5HF__man_dblock_new(H5HF_hdr_t *hdr, size_t request, H5HF_free_section_t **ret_
} /* end if */
/* Extend heap to cover new direct block */
- if (H5HF_hdr_adjust_heap(hdr, (hsize_t)hdr->man_dtable.cparam.start_block_size,
- (hssize_t)hdr->man_dtable.row_tot_dblock_free[0]) < 0)
+ if (H5HF__hdr_adjust_heap(hdr, (hsize_t)hdr->man_dtable.cparam.start_block_size,
+ (hssize_t)hdr->man_dtable.row_tot_dblock_free[0]) < 0)
HGOTO_ERROR(H5E_HEAP, H5E_CANTEXTEND, FAIL, "can't increase space to cover root direct block")
} /* end if */
/* Root entry already exists, allocate direct block from root indirect block */
@@ -390,7 +387,7 @@ H5HF__man_dblock_new(H5HF_hdr_t *hdr, size_t request, H5HF_free_section_t **ret_
HGOTO_ERROR(H5E_HEAP, H5E_CANTUPDATE, FAIL, "unable to update block iterator")
/* Retrieve information about current iterator position */
- if (H5HF_man_iter_curr(&hdr->next_block, &next_row, NULL, &next_entry, &iblock) < 0)
+ if (H5HF__man_iter_curr(&hdr->next_block, &next_row, NULL, &next_entry, &iblock) < 0)
HGOTO_ERROR(H5E_HEAP, H5E_CANTGET, FAIL, "unable to retrieve current block iterator location")
HDassert(next_row < iblock->nrows);
H5_CHECKED_ASSIGN(next_size, size_t, hdr->man_dtable.row_block_size[next_row], hsize_t);
@@ -399,13 +396,13 @@ H5HF__man_dblock_new(H5HF_hdr_t *hdr, size_t request, H5HF_free_section_t **ret_
if (min_dblock_size > next_size) {
HDfprintf(
stderr,
- "%s: Skipping direct block sizes not supported, min_dblock_size = %Zu, next_size = %Zu\n",
+ "%s: Skipping direct block sizes not supported, min_dblock_size = %zu, next_size = %zu\n",
FUNC, min_dblock_size, next_size);
HGOTO_ERROR(H5E_HEAP, H5E_UNSUPPORTED, FAIL, "skipping direct block sizes not supported yet")
} /* end if */
/* Advance "next block" iterator to next direct block entry */
- if (H5HF_hdr_inc_iter(hdr, (hsize_t)next_size, 1) < 0)
+ if (H5HF__hdr_inc_iter(hdr, (hsize_t)next_size, 1) < 0)
HGOTO_ERROR(H5E_HEAP, H5E_CANTINC, FAIL, "can't increment 'next block' iterator")
/* Create new direct block at current location*/
@@ -426,7 +423,6 @@ done:
* Return: Pointer to direct block on success, NULL on failure
*
* Programmer: Quincey Koziol
- * koziol@ncsa.uiuc.edu
* Apr 17 2006
*
*-------------------------------------------------------------------------
@@ -508,7 +504,6 @@ done:
* Return: SUCCEED/FAIL
*
* Programmer: Quincey Koziol
- * koziol@ncsa.uiuc.edu
* May 8 2006
*
*-------------------------------------------------------------------------
@@ -538,7 +533,7 @@ H5HF__man_dblock_locate(H5HF_hdr_t *hdr, hsize_t obj_off, H5HF_indirect_t **ret_
HDassert((flags & (unsigned)(~H5AC__READ_ONLY_FLAG)) == 0);
/* Look up row & column for object */
- if (H5HF_dtable_lookup(&hdr->man_dtable, obj_off, &row, &col) < 0)
+ if (H5HF__dtable_lookup(&hdr->man_dtable, obj_off, &row, &col) < 0)
HGOTO_ERROR(H5E_HEAP, H5E_CANTCOMPUTE, FAIL, "can't compute row & column of object")
/* Set initial indirect block info */
@@ -589,7 +584,7 @@ H5HF__man_dblock_locate(H5HF_hdr_t *hdr, hsize_t obj_off, H5HF_indirect_t **ret_
did_protect = new_did_protect;
/* Look up row & column in new indirect block for object */
- if (H5HF_dtable_lookup(&hdr->man_dtable, (obj_off - iblock->block_off), &row, &col) < 0)
+ if (H5HF__dtable_lookup(&hdr->man_dtable, (obj_off - iblock->block_off), &row, &col) < 0)
HGOTO_ERROR(H5E_HEAP, H5E_CANTCOMPUTE, FAIL, "can't compute row & column of object")
HDassert(row < iblock->nrows); /* child must be smaller than parent */
} /* end while */
@@ -617,7 +612,6 @@ done:
* Return: SUCCEED/FAIL
*
* Programmer: Quincey Koziol
- * koziol@hdfgroup.org
* Aug 7 2006
*
*-------------------------------------------------------------------------
@@ -674,24 +668,23 @@ done:
} /* end H5HF__man_dblock_delete() */
/*-------------------------------------------------------------------------
- * Function: H5HF_man_dblock_dest
+ * Function: H5HF__man_dblock_dest
*
* Purpose: Destroys a fractal heap direct block in memory.
*
* Return: Non-negative on success/Negative on failure
*
* Programmer: Quincey Koziol
- * koziol@ncsa.uiuc.edu
* Feb 27 2006
*
*-------------------------------------------------------------------------
*/
herr_t
-H5HF_man_dblock_dest(H5HF_direct_t *dblock)
+H5HF__man_dblock_dest(H5HF_direct_t *dblock)
{
herr_t ret_value = SUCCEED; /* Return value */
- FUNC_ENTER_NOAPI_NOINIT
+ FUNC_ENTER_PACKAGE
/*
* Check arguments.
@@ -700,7 +693,7 @@ H5HF_man_dblock_dest(H5HF_direct_t *dblock)
/* Decrement reference count on shared fractal heap info */
HDassert(dblock->hdr != NULL);
- if (H5HF_hdr_decr(dblock->hdr) < 0)
+ if (H5HF__hdr_decr(dblock->hdr) < 0)
HGOTO_ERROR(H5E_HEAP, H5E_CANTDEC, FAIL, "can't decrement reference count on shared heap header")
if (dblock->parent)
if (H5HF__iblock_decr(dblock->parent) < 0)
@@ -715,4 +708,4 @@ H5HF_man_dblock_dest(H5HF_direct_t *dblock)
done:
FUNC_LEAVE_NOAPI(ret_value)
-} /* end H5HF_man_dblock_dest() */
+} /* end H5HF__man_dblock_dest() */
diff --git a/src/H5HFdtable.c b/src/H5HFdtable.c
index 1f69f70..5a1f950 100644
--- a/src/H5HFdtable.c
+++ b/src/H5HFdtable.c
@@ -15,7 +15,7 @@
*
* Created: H5HFdtable.c
* Apr 10 2006
- * Quincey Koziol <koziol@ncsa.uiuc.edu>
+ * Quincey Koziol
*
* Purpose: "Doubling table" routines for fractal heaps.
*
@@ -66,27 +66,26 @@
/*******************/
/*-------------------------------------------------------------------------
- * Function: H5HF_dtable_init
+ * Function: H5HF__dtable_init
*
* Purpose: Initialize values for doubling table
*
* Return: Non-negative on success/Negative on failure
*
* Programmer: Quincey Koziol
- * koziol@ncsa.uiuc.edu
* Mar 6 2006
*
*-------------------------------------------------------------------------
*/
herr_t
-H5HF_dtable_init(H5HF_dtable_t *dtable)
+H5HF__dtable_init(H5HF_dtable_t *dtable)
{
hsize_t tmp_block_size; /* Temporary block size */
hsize_t acc_block_off; /* Accumulated block offset */
size_t u; /* Local index variable */
herr_t ret_value = SUCCEED; /* Return value */
- FUNC_ENTER_NOAPI_NOINIT
+ FUNC_ENTER_PACKAGE
/*
* Check arguments.
@@ -127,25 +126,24 @@ H5HF_dtable_init(H5HF_dtable_t *dtable)
done:
FUNC_LEAVE_NOAPI(ret_value)
-} /* end H5HF_dtable_init() */
+} /* end H5HF__dtable_init() */
/*-------------------------------------------------------------------------
- * Function: H5HF_dtable_lookup
+ * Function: H5HF__dtable_lookup
*
* Purpose: Compute the row & col of an offset in a doubling-table
*
* Return: Non-negative on success/Negative on failure
*
* Programmer: Quincey Koziol
- * koziol@ncsa.uiuc.edu
* Mar 6 2006
*
*-------------------------------------------------------------------------
*/
herr_t
-H5HF_dtable_lookup(const H5HF_dtable_t *dtable, hsize_t off, unsigned *row, unsigned *col)
+H5HF__dtable_lookup(const H5HF_dtable_t *dtable, hsize_t off, unsigned *row, unsigned *col)
{
- FUNC_ENTER_NOAPI_NOINIT_NOERR
+ FUNC_ENTER_PACKAGE_NOERR
/*
* Check arguments.
@@ -153,9 +151,6 @@ H5HF_dtable_lookup(const H5HF_dtable_t *dtable, hsize_t off, unsigned *row, unsi
HDassert(dtable);
HDassert(row);
HDassert(col);
-#ifdef QAK
- HDfprintf(stderr, "%s: off = %Hu\n", "H5HF_dtable_lookup", off);
-#endif /* QAK */
/* Check for offset in first row */
if (off < dtable->num_id_first_row) {
@@ -166,33 +161,29 @@ H5HF_dtable_lookup(const H5HF_dtable_t *dtable, hsize_t off, unsigned *row, unsi
unsigned high_bit = H5VM_log2_gen(off); /* Determine the high bit in the offset */
hsize_t off_mask = ((hsize_t)1) << high_bit; /* Compute mask for determining column */
-#ifdef QAK
- HDfprintf(stderr, "%s: high_bit = %u, off_mask = %Hu\n", "H5HF_dtable_lookup", high_bit, off_mask);
-#endif /* QAK */
*row = (high_bit - dtable->first_row_bits) + 1;
H5_CHECKED_ASSIGN(*col, unsigned, ((off - off_mask) / dtable->row_block_size[*row]), hsize_t);
} /* end else */
FUNC_LEAVE_NOAPI(SUCCEED)
-} /* end H5HF_dtable_lookup() */
+} /* end H5HF__dtable_lookup() */
/*-------------------------------------------------------------------------
- * Function: H5HF_dtable_dest
+ * Function: H5HF__dtable_dest
*
* Purpose: Release information for doubling table
*
* Return: Non-negative on success/Negative on failure
*
* Programmer: Quincey Koziol
- * koziol@ncsa.uiuc.edu
* Mar 27 2006
*
*-------------------------------------------------------------------------
*/
herr_t
-H5HF_dtable_dest(H5HF_dtable_t *dtable)
+H5HF__dtable_dest(H5HF_dtable_t *dtable)
{
- FUNC_ENTER_NOAPI_NOINIT_NOERR
+ FUNC_ENTER_PACKAGE_NOERR
/*
* Check arguments.
@@ -212,27 +203,26 @@ H5HF_dtable_dest(H5HF_dtable_t *dtable)
H5MM_xfree(dtable->row_max_dblock_free);
FUNC_LEAVE_NOAPI(SUCCEED)
-} /* end H5HF_dtable_dest() */
+} /* end H5HF__dtable_dest() */
/*-------------------------------------------------------------------------
- * Function: H5HF_dtable_size_to_row
+ * Function: H5HF__dtable_size_to_row
*
* Purpose: Compute row that can hold block of a certain size
*
* Return: Non-negative on success (can't fail)
*
* Programmer: Quincey Koziol
- * koziol@ncsa.uiuc.edu
* Apr 25 2006
*
*-------------------------------------------------------------------------
*/
unsigned
-H5HF_dtable_size_to_row(const H5HF_dtable_t *dtable, size_t block_size)
+H5HF__dtable_size_to_row(const H5HF_dtable_t *dtable, size_t block_size)
{
unsigned row = 0; /* Row where block will fit */
- FUNC_ENTER_NOAPI_NOINIT_NOERR
+ FUNC_ENTER_PACKAGE_NOERR
/*
* Check arguments.
@@ -247,27 +237,26 @@ H5HF_dtable_size_to_row(const H5HF_dtable_t *dtable, size_t block_size)
1;
FUNC_LEAVE_NOAPI(row)
-} /* end H5HF_dtable_size_to_row() */
+} /* end H5HF__dtable_size_to_row() */
/*-------------------------------------------------------------------------
- * Function: H5HF_dtable_size_to_rows
+ * Function: H5HF__dtable_size_to_rows
*
* Purpose: Compute # of rows of indirect block of a given size
*
* Return: Non-negative on success (can't fail)
*
* Programmer: Quincey Koziol
- * koziol@ncsa.uiuc.edu
* May 31 2006
*
*-------------------------------------------------------------------------
*/
unsigned
-H5HF_dtable_size_to_rows(const H5HF_dtable_t *dtable, hsize_t size)
+H5HF__dtable_size_to_rows(const H5HF_dtable_t *dtable, hsize_t size)
{
unsigned rows = 0; /* # of rows required for indirect block */
- FUNC_ENTER_NOAPI_NOINIT_NOERR
+ FUNC_ENTER_PACKAGE_NOERR
/*
* Check arguments.
@@ -277,24 +266,23 @@ H5HF_dtable_size_to_rows(const H5HF_dtable_t *dtable, hsize_t size)
rows = (H5VM_log2_gen(size) - dtable->first_row_bits) + 1;
FUNC_LEAVE_NOAPI(rows)
-} /* end H5HF_dtable_size_to_rows() */
+} /* end H5HF__dtable_size_to_rows() */
/*-------------------------------------------------------------------------
- * Function: H5HF_dtable_span_size
+ * Function: H5HF__dtable_span_size
*
* Purpose: Compute the size covered by a span of entries
*
* Return: Non-zero span size on success/zero on failure
*
* Programmer: Quincey Koziol
- * koziol@ncsa.uiuc.edu
* July 25 2006
*
*-------------------------------------------------------------------------
*/
hsize_t
-H5HF_dtable_span_size(const H5HF_dtable_t *dtable, unsigned start_row, unsigned start_col,
- unsigned num_entries)
+H5HF__dtable_span_size(const H5HF_dtable_t *dtable, unsigned start_row, unsigned start_col,
+ unsigned num_entries)
{
unsigned start_entry; /* Entry for first block covered */
unsigned end_row; /* Row for last block covered */
@@ -302,7 +290,7 @@ H5HF_dtable_span_size(const H5HF_dtable_t *dtable, unsigned start_row, unsigned
unsigned end_entry; /* Entry for last block covered */
hsize_t acc_span_size = 0; /* Accumulated span size */
- FUNC_ENTER_NOAPI_NOINIT_NOERR
+ FUNC_ENTER_PACKAGE_NOERR
/*
* Check arguments.
@@ -317,12 +305,6 @@ H5HF_dtable_span_size(const H5HF_dtable_t *dtable, unsigned start_row, unsigned
end_entry = (start_entry + num_entries) - 1;
end_row = end_entry / dtable->cparam.width;
end_col = end_entry % dtable->cparam.width;
-#ifdef QAK
- HDfprintf(stderr, "%s: start_row = %u, start_col = %u, start_entry = %u\n",
- "H5HF_sect_indirect_span_size", start_row, start_col, start_entry);
- HDfprintf(stderr, "%s: end_row = %u, end_col = %u, end_entry = %u\n", "H5HF_sect_indirect_span_size",
- end_row, end_col, end_entry);
-#endif /* QAK */
/* Initialize accumulated span size */
acc_span_size = 0;
@@ -351,8 +333,5 @@ H5HF_dtable_span_size(const H5HF_dtable_t *dtable, unsigned start_row, unsigned
acc_span_size = dtable->row_block_size[start_row] * ((end_col - start_col) + 1);
} /* end else */
-#ifdef QAK
- HDfprintf(stderr, "%s: acc_span_size = %Hu\n", "H5HF_dtable_span_size", acc_span_size);
-#endif /* QAK */
FUNC_LEAVE_NOAPI(acc_span_size)
-} /* end H5HF_sect_indirect_span_size() */
+} /* end H5HF__dtable_span_size() */
diff --git a/src/H5HFhdr.c b/src/H5HFhdr.c
index 84d7d45..cd5ba23 100644
--- a/src/H5HFhdr.c
+++ b/src/H5HFhdr.c
@@ -15,7 +15,7 @@
*
* Created: H5HFhdr.c
* Apr 10 2006
- * Quincey Koziol <koziol@ncsa.uiuc.edu>
+ * Quincey Koziol
*
* Purpose: Heap header routines for fractal heaps.
*
@@ -85,25 +85,24 @@ H5FL_DEFINE_STATIC(H5HF_hdr_t);
/*******************/
/*-------------------------------------------------------------------------
- * Function: H5HF_hdr_alloc
+ * Function: H5HF__hdr_alloc
*
* Purpose: Allocate shared fractal heap header
*
* Return: Non-negative on success/Negative on failure
*
* Programmer: Quincey Koziol
- * koziol@ncsa.uiuc.edu
* Mar 21 2006
*
*-------------------------------------------------------------------------
*/
H5HF_hdr_t *
-H5HF_hdr_alloc(H5F_t *f)
+H5HF__hdr_alloc(H5F_t *f)
{
H5HF_hdr_t *hdr = NULL; /* Shared fractal heap header */
H5HF_hdr_t *ret_value = NULL; /* Return value */
- FUNC_ENTER_NOAPI_NOINIT
+ FUNC_ENTER_PACKAGE
/*
* Check arguments.
@@ -124,7 +123,7 @@ H5HF_hdr_alloc(H5F_t *f)
done:
FUNC_LEAVE_NOAPI(ret_value)
-} /* end H5HF_hdr_alloc() */
+} /* end H5HF__hdr_alloc() */
/*-------------------------------------------------------------------------
* Function: H5HF_hdr_free_space
@@ -135,13 +134,12 @@ done:
* Return: Non-negative on success/Negative on failure
*
* Programmer: Quincey Koziol
- * koziol@ncsa.uiuc.edu
* Mar 21 2006
*
*-------------------------------------------------------------------------
*/
static herr_t
-H5HF_hdr_compute_free_space(H5HF_hdr_t *hdr, unsigned iblock_row)
+H5HF__hdr_compute_free_space(H5HF_hdr_t *hdr, unsigned iblock_row)
{
hsize_t acc_heap_size; /* Accumumated heap space */
hsize_t iblock_size; /* Size of indirect block to calculate for */
@@ -150,7 +148,7 @@ H5HF_hdr_compute_free_space(H5HF_hdr_t *hdr, unsigned iblock_row)
unsigned curr_row; /* Current row in block */
herr_t ret_value = SUCCEED; /* Return value */
- FUNC_ENTER_NOAPI_NOINIT_NOERR
+ FUNC_ENTER_STATIC_NOERR
/*
* Check arguments.
@@ -177,27 +175,26 @@ H5HF_hdr_compute_free_space(H5HF_hdr_t *hdr, unsigned iblock_row)
hdr->man_dtable.row_max_dblock_free[iblock_row] = max_dblock_free;
FUNC_LEAVE_NOAPI(ret_value)
-} /* end H5HF_hdr_compute_free_space() */
+} /* end H5HF__hdr_compute_free_space() */
/*-------------------------------------------------------------------------
- * Function: H5HF_hdr_finish_init_phase1
+ * Function: H5HF__hdr_finish_init_phase1
*
* Purpose: First phase to finish initializing info in shared heap header
*
* Return: Non-negative on success/Negative on failure
*
* Programmer: Quincey Koziol
- * koziol@hdfgroup.org
* Aug 12 2006
*
*-------------------------------------------------------------------------
*/
herr_t
-H5HF_hdr_finish_init_phase1(H5HF_hdr_t *hdr)
+H5HF__hdr_finish_init_phase1(H5HF_hdr_t *hdr)
{
herr_t ret_value = SUCCEED; /* Return value */
- FUNC_ENTER_NOAPI_NOINIT
+ FUNC_ENTER_PACKAGE
/*
* Check arguments.
@@ -206,7 +203,7 @@ H5HF_hdr_finish_init_phase1(H5HF_hdr_t *hdr)
/* Compute/cache some values */
hdr->heap_off_size = (uint8_t)H5HF_SIZEOF_OFFSET_BITS(hdr->man_dtable.cparam.max_index);
- if (H5HF_dtable_init(&hdr->man_dtable) < 0)
+ if (H5HF__dtable_init(&hdr->man_dtable) < 0)
HGOTO_ERROR(H5E_HEAP, H5E_CANTINIT, FAIL, "can't initialize doubling table info")
/* Set the size of heap IDs */
@@ -215,28 +212,27 @@ H5HF_hdr_finish_init_phase1(H5HF_hdr_t *hdr)
done:
FUNC_LEAVE_NOAPI(ret_value)
-} /* end H5HF_hdr_finish_init_phase1() */
+} /* end H5HF__hdr_finish_init_phase1() */
/*-------------------------------------------------------------------------
- * Function: H5HF_hdr_finish_init_phase2
+ * Function: H5HF__hdr_finish_init_phase2
*
* Purpose: Second phase to finish initializing info in shared heap header
*
* Return: Non-negative on success/Negative on failure
*
* Programmer: Quincey Koziol
- * koziol@hdfgroup.org
* Aug 12 2006
*
*-------------------------------------------------------------------------
*/
herr_t
-H5HF_hdr_finish_init_phase2(H5HF_hdr_t *hdr)
+H5HF__hdr_finish_init_phase2(H5HF_hdr_t *hdr)
{
unsigned u; /* Local index variable */
herr_t ret_value = SUCCEED; /* Return value */
- FUNC_ENTER_NOAPI_NOINIT
+ FUNC_ENTER_PACKAGE
/*
* Check arguments.
@@ -251,46 +247,45 @@ H5HF_hdr_finish_init_phase2(H5HF_hdr_t *hdr)
H5_CHECKED_ASSIGN(hdr->man_dtable.row_max_dblock_free[u], size_t,
hdr->man_dtable.row_tot_dblock_free[u], hsize_t);
} /* end if */
- else if (H5HF_hdr_compute_free_space(hdr, u) < 0)
+ else if (H5HF__hdr_compute_free_space(hdr, u) < 0)
HGOTO_ERROR(H5E_HEAP, H5E_CANTINIT, FAIL,
"can't initialize direct block free space for indirect block")
} /* end for */
/* Initialize the block iterator for searching for free space */
- if (H5HF_man_iter_init(&hdr->next_block) < 0)
+ if (H5HF__man_iter_init(&hdr->next_block) < 0)
HGOTO_ERROR(H5E_HEAP, H5E_CANTINIT, FAIL, "can't initialize space search block iterator")
/* Initialize the information for tracking 'huge' objects */
- if (H5HF_huge_init(hdr) < 0)
+ if (H5HF__huge_init(hdr) < 0)
HGOTO_ERROR(H5E_HEAP, H5E_CANTINIT, FAIL, "can't initialize info for tracking huge objects")
/* Initialize the information for tracking 'tiny' objects */
- if (H5HF_tiny_init(hdr) < 0)
+ if (H5HF__tiny_init(hdr) < 0)
HGOTO_ERROR(H5E_HEAP, H5E_CANTINIT, FAIL, "can't initialize info for tracking tiny objects")
done:
FUNC_LEAVE_NOAPI(ret_value)
-} /* end H5HF_hdr_finish_init_phase2() */
+} /* end H5HF__hdr_finish_init_phase2() */
/*-------------------------------------------------------------------------
- * Function: H5HF_hdr_finish_init
+ * Function: H5HF__hdr_finish_init
*
* Purpose: Finish initializing info in shared heap header
*
* Return: Non-negative on success/Negative on failure
*
* Programmer: Quincey Koziol
- * koziol@ncsa.uiuc.edu
* Mar 21 2006
*
*-------------------------------------------------------------------------
*/
herr_t
-H5HF_hdr_finish_init(H5HF_hdr_t *hdr)
+H5HF__hdr_finish_init(H5HF_hdr_t *hdr)
{
herr_t ret_value = SUCCEED; /* Return value */
- FUNC_ENTER_NOAPI_NOINIT
+ FUNC_ENTER_PACKAGE
/*
* Check arguments.
@@ -298,38 +293,37 @@ H5HF_hdr_finish_init(H5HF_hdr_t *hdr)
HDassert(hdr);
/* First phase of header final initialization */
- if (H5HF_hdr_finish_init_phase1(hdr) < 0)
+ if (H5HF__hdr_finish_init_phase1(hdr) < 0)
HGOTO_ERROR(H5E_HEAP, H5E_CANTINIT, FAIL, "can't finish phase #1 of header final initialization")
/* Second phase of header final initialization */
- if (H5HF_hdr_finish_init_phase2(hdr) < 0)
+ if (H5HF__hdr_finish_init_phase2(hdr) < 0)
HGOTO_ERROR(H5E_HEAP, H5E_CANTINIT, FAIL, "can't finish phase #2 of header final initialization")
done:
FUNC_LEAVE_NOAPI(ret_value)
-} /* end H5HF_hdr_finish_init() */
+} /* end H5HF__hdr_finish_init() */
/*-------------------------------------------------------------------------
- * Function: H5HF_hdr_create
+ * Function: H5HF__hdr_create
*
* Purpose: Create new fractal heap header
*
* Return: Non-negative on success/Negative on failure
*
* Programmer: Quincey Koziol
- * koziol@ncsa.uiuc.edu
* Mar 21 2006
*
*-------------------------------------------------------------------------
*/
haddr_t
-H5HF_hdr_create(H5F_t *f, const H5HF_create_t *cparam)
+H5HF__hdr_create(H5F_t *f, const H5HF_create_t *cparam)
{
H5HF_hdr_t *hdr = NULL; /* The new fractal heap header information */
size_t dblock_overhead; /* Direct block's overhead */
haddr_t ret_value = HADDR_UNDEF; /* Return value */
- FUNC_ENTER_NOAPI_NOINIT
+ FUNC_ENTER_PACKAGE
/*
* Check arguments.
@@ -363,7 +357,7 @@ H5HF_hdr_create(H5F_t *f, const H5HF_create_t *cparam)
#endif /* NDEBUG */
/* Allocate & basic initialization for the shared header */
- if (NULL == (hdr = H5HF_hdr_alloc(f)))
+ if (NULL == (hdr = H5HF__hdr_alloc(f)))
HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, HADDR_UNDEF, "can't allocate space for shared heap info")
#ifndef NDEBUG
@@ -387,7 +381,7 @@ H5HF_hdr_create(H5F_t *f, const H5HF_create_t *cparam)
/* First phase of header final initialization */
/* (doesn't need ID length set up) */
- if (H5HF_hdr_finish_init_phase1(hdr) < 0)
+ if (H5HF__hdr_finish_init_phase1(hdr) < 0)
HGOTO_ERROR(H5E_HEAP, H5E_CANTINIT, HADDR_UNDEF,
"can't finish phase #1 of header final initialization")
@@ -475,7 +469,7 @@ H5HF_hdr_create(H5F_t *f, const H5HF_create_t *cparam)
/* Second phase of header final initialization */
/* (needs ID and filter lengths set up) */
- if (H5HF_hdr_finish_init_phase2(hdr) < 0)
+ if (H5HF__hdr_finish_init_phase2(hdr) < 0)
HGOTO_ERROR(H5E_HEAP, H5E_CANTINIT, HADDR_UNDEF,
"can't finish phase #2 of header final initialization")
@@ -499,11 +493,11 @@ H5HF_hdr_create(H5F_t *f, const H5HF_create_t *cparam)
done:
if (!H5F_addr_defined(ret_value) && hdr)
- if (H5HF_hdr_free(hdr) < 0)
+ if (H5HF__hdr_free(hdr) < 0)
HDONE_ERROR(H5E_HEAP, H5E_CANTRELEASE, HADDR_UNDEF, "unable to release fractal heap header")
FUNC_LEAVE_NOAPI(ret_value)
-} /* end H5HF_hdr_create() */
+} /* end H5HF__hdr_create() */
/*-------------------------------------------------------------------------
* Function: H5HF__hdr_protect
@@ -513,7 +507,6 @@ done:
* Return: Pointer to indirect block on success, NULL on failure
*
* Programmer: Quincey Koziol
- * koziol@hdfgroup.org
* May 5 2010
*
*-------------------------------------------------------------------------
@@ -555,24 +548,23 @@ done:
} /* end H5HF__hdr_protect() */
/*-------------------------------------------------------------------------
- * Function: H5HF_hdr_incr
+ * Function: H5HF__hdr_incr
*
* Purpose: Increment component reference count on shared heap header
*
* Return: Non-negative on success/Negative on failure
*
* Programmer: Quincey Koziol
- * koziol@ncsa.uiuc.edu
* Mar 27 2006
*
*-------------------------------------------------------------------------
*/
herr_t
-H5HF_hdr_incr(H5HF_hdr_t *hdr)
+H5HF__hdr_incr(H5HF_hdr_t *hdr)
{
herr_t ret_value = SUCCEED; /* Return value */
- FUNC_ENTER_NOAPI_NOINIT
+ FUNC_ENTER_PACKAGE
/* Sanity check */
HDassert(hdr);
@@ -587,27 +579,26 @@ H5HF_hdr_incr(H5HF_hdr_t *hdr)
done:
FUNC_LEAVE_NOAPI(ret_value)
-} /* end H5HF_hdr_incr() */
+} /* end H5HF__hdr_incr() */
/*-------------------------------------------------------------------------
- * Function: H5HF_hdr_decr
+ * Function: H5HF__hdr_decr
*
* Purpose: Decrement component reference count on shared heap header
*
* Return: Non-negative on success/Negative on failure
*
* Programmer: Quincey Koziol
- * koziol@ncsa.uiuc.edu
* Mar 27 2006
*
*-------------------------------------------------------------------------
*/
herr_t
-H5HF_hdr_decr(H5HF_hdr_t *hdr)
+H5HF__hdr_decr(H5HF_hdr_t *hdr)
{
herr_t ret_value = SUCCEED; /* Return value */
- FUNC_ENTER_NOAPI_NOINIT
+ FUNC_ENTER_PACKAGE
/* Sanity check */
HDassert(hdr);
@@ -625,25 +616,24 @@ H5HF_hdr_decr(H5HF_hdr_t *hdr)
done:
FUNC_LEAVE_NOAPI(ret_value)
-} /* end H5HF_hdr_decr() */
+} /* end H5HF__hdr_decr() */
/*-------------------------------------------------------------------------
- * Function: H5HF_hdr_fuse_incr
+ * Function: H5HF__hdr_fuse_incr
*
* Purpose: Increment file reference count on shared heap header
*
* Return: Non-negative on success/Negative on failure
*
* Programmer: Quincey Koziol
- * koziol@ncsa.uiuc.edu
* Oct 1 2006
*
*-------------------------------------------------------------------------
*/
herr_t
-H5HF_hdr_fuse_incr(H5HF_hdr_t *hdr)
+H5HF__hdr_fuse_incr(H5HF_hdr_t *hdr)
{
- FUNC_ENTER_NOAPI_NOINIT_NOERR
+ FUNC_ENTER_PACKAGE_NOERR
/* Sanity check */
HDassert(hdr);
@@ -652,25 +642,24 @@ H5HF_hdr_fuse_incr(H5HF_hdr_t *hdr)
hdr->file_rc++;
FUNC_LEAVE_NOAPI(SUCCEED)
-} /* end H5HF_hdr_fuse_incr() */
+} /* end H5HF__hdr_fuse_incr() */
/*-------------------------------------------------------------------------
- * Function: H5HF_hdr_fuse_decr
+ * Function: H5HF__hdr_fuse_decr
*
* Purpose: Decrement file reference count on shared heap header
*
* Return: Non-negative on success/Negative on failure
*
* Programmer: Quincey Koziol
- * koziol@ncsa.uiuc.edu
* Oct 1 2006
*
*-------------------------------------------------------------------------
*/
size_t
-H5HF_hdr_fuse_decr(H5HF_hdr_t *hdr)
+H5HF__hdr_fuse_decr(H5HF_hdr_t *hdr)
{
- FUNC_ENTER_NOAPI_NOINIT_NOERR
+ FUNC_ENTER_PACKAGE_NOERR
/* Sanity check */
HDassert(hdr);
@@ -680,36 +669,34 @@ H5HF_hdr_fuse_decr(H5HF_hdr_t *hdr)
hdr->file_rc--;
FUNC_LEAVE_NOAPI(hdr->file_rc)
-} /* end H5HF_hdr_fuse_decr() */
+} /* end H5HF__hdr_fuse_decr() */
/*-------------------------------------------------------------------------
- * Function: H5HF_hdr_dirty
+ * Function: H5HF__hdr_dirty
*
* Purpose: Mark heap header as dirty
*
* Return: Non-negative on success/Negative on failure
*
* Programmer: Quincey Koziol
- * koziol@ncsa.uiuc.edu
* Mar 27 2006
*
*-------------------------------------------------------------------------
*/
herr_t
-H5HF_hdr_dirty(H5HF_hdr_t *hdr)
+H5HF__hdr_dirty(H5HF_hdr_t *hdr)
{
herr_t ret_value = SUCCEED; /* Return value */
- FUNC_ENTER_NOAPI_NOINIT
+ FUNC_ENTER_PACKAGE
/* Sanity check */
HDassert(hdr);
/* Resize pinned header in cache if I/O filter is present. */
- if (hdr->filter_len > 0) {
+ if (hdr->filter_len > 0)
if (H5AC_resize_entry(hdr, (size_t)hdr->heap_size) < 0)
HGOTO_ERROR(H5E_HEAP, H5E_CANTRESIZE, FAIL, "unable to resize fractal heap header")
- } /* end if */
/* Mark header as dirty in cache */
if (H5AC_mark_entry_dirty(hdr) < 0)
@@ -717,27 +704,26 @@ H5HF_hdr_dirty(H5HF_hdr_t *hdr)
done:
FUNC_LEAVE_NOAPI(ret_value)
-} /* end H5HF_hdr_dirty() */
+} /* end H5HF__hdr_dirty() */
/*-------------------------------------------------------------------------
- * Function: H5HF_hdr_adj_free
+ * Function: H5HF__hdr_adj_free
*
* Purpose: Adjust the free space for a heap
*
* Return: SUCCEED/FAIL
*
* Programmer: Quincey Koziol
- * koziol@ncsa.uiuc.edu
* May 9 2006
*
*-------------------------------------------------------------------------
*/
herr_t
-H5HF_hdr_adj_free(H5HF_hdr_t *hdr, ssize_t amt)
+H5HF__hdr_adj_free(H5HF_hdr_t *hdr, ssize_t amt)
{
herr_t ret_value = SUCCEED; /* Return value */
- FUNC_ENTER_NOAPI_NOINIT
+ FUNC_ENTER_PACKAGE
/*
* Check arguments.
@@ -749,32 +735,31 @@ H5HF_hdr_adj_free(H5HF_hdr_t *hdr, ssize_t amt)
hdr->total_man_free = (hsize_t)((hssize_t)hdr->total_man_free + amt);
/* Mark heap header as modified */
- if (H5HF_hdr_dirty(hdr) < 0)
+ if (H5HF__hdr_dirty(hdr) < 0)
HGOTO_ERROR(H5E_HEAP, H5E_CANTDIRTY, FAIL, "can't mark heap header as dirty")
done:
FUNC_LEAVE_NOAPI(ret_value)
-} /* end H5HF_hdr_adj_free() */
+} /* end H5HF__hdr_adj_free() */
/*-------------------------------------------------------------------------
- * Function: H5HF_hdr_adjust_heap
+ * Function: H5HF__hdr_adjust_heap
*
* Purpose: Adjust heap space
*
* Return: Non-negative on success/Negative on failure
*
* Programmer: Quincey Koziol
- * koziol@ncsa.uiuc.edu
* Apr 10 2006
*
*-------------------------------------------------------------------------
*/
herr_t
-H5HF_hdr_adjust_heap(H5HF_hdr_t *hdr, hsize_t new_size, hssize_t extra_free)
+H5HF__hdr_adjust_heap(H5HF_hdr_t *hdr, hsize_t new_size, hssize_t extra_free)
{
herr_t ret_value = SUCCEED; /* Return value */
- FUNC_ENTER_NOAPI_NOINIT
+ FUNC_ENTER_PACKAGE
/*
* Check arguments.
@@ -789,30 +774,29 @@ H5HF_hdr_adjust_heap(H5HF_hdr_t *hdr, hsize_t new_size, hssize_t extra_free)
hdr->total_man_free = (hsize_t)((hssize_t)hdr->total_man_free + extra_free);
/* Mark heap header as modified */
- if (H5HF_hdr_dirty(hdr) < 0)
+ if (H5HF__hdr_dirty(hdr) < 0)
HGOTO_ERROR(H5E_HEAP, H5E_CANTDIRTY, FAIL, "can't mark header as dirty")
done:
FUNC_LEAVE_NOAPI(ret_value)
-} /* end H5HF_hdr_adjust_heap() */
+} /* end H5HF__hdr_adjust_heap() */
/*-------------------------------------------------------------------------
- * Function: H5HF_hdr_inc_alloc
+ * Function: H5HF__hdr_inc_alloc
*
* Purpose: Increase allocated size of heap
*
* Return: Non-negative on success/Negative on failure
*
* Programmer: Quincey Koziol
- * koziol@ncsa.uiuc.edu
* May 23 2006
*
*-------------------------------------------------------------------------
*/
herr_t
-H5HF_hdr_inc_alloc(H5HF_hdr_t *hdr, size_t alloc_size)
+H5HF__hdr_inc_alloc(H5HF_hdr_t *hdr, size_t alloc_size)
{
- FUNC_ENTER_NOAPI_NOINIT_NOERR
+ FUNC_ENTER_PACKAGE_NOERR
/*
* Check arguments.
@@ -824,27 +808,26 @@ H5HF_hdr_inc_alloc(H5HF_hdr_t *hdr, size_t alloc_size)
hdr->man_alloc_size += alloc_size;
FUNC_LEAVE_NOAPI(SUCCEED)
-} /* end H5HF_hdr_inc_alloc() */
+} /* end H5HF__hdr_inc_alloc() */
/*-------------------------------------------------------------------------
- * Function: H5HF_hdr_start_iter
+ * Function: H5HF__hdr_start_iter
*
* Purpose: Start "next block" iterator at an offset/entry in the heap
*
* Return: Non-negative on success/Negative on failure
*
* Programmer: Quincey Koziol
- * koziol@ncsa.uiuc.edu
* May 30 2006
*
*-------------------------------------------------------------------------
*/
herr_t
-H5HF_hdr_start_iter(H5HF_hdr_t *hdr, H5HF_indirect_t *iblock, hsize_t curr_off, unsigned curr_entry)
+H5HF__hdr_start_iter(H5HF_hdr_t *hdr, H5HF_indirect_t *iblock, hsize_t curr_off, unsigned curr_entry)
{
herr_t ret_value = SUCCEED; /* Return value */
- FUNC_ENTER_NOAPI_NOINIT
+ FUNC_ENTER_PACKAGE
/*
* Check arguments.
@@ -853,7 +836,7 @@ H5HF_hdr_start_iter(H5HF_hdr_t *hdr, H5HF_indirect_t *iblock, hsize_t curr_off,
HDassert(iblock);
/* Set up "next block" iterator at correct location */
- if (H5HF_man_iter_start_entry(hdr, &hdr->next_block, iblock, curr_entry) < 0)
+ if (H5HF__man_iter_start_entry(hdr, &hdr->next_block, iblock, curr_entry) < 0)
HGOTO_ERROR(H5E_HEAP, H5E_CANTINIT, FAIL, "can't initialize block iterator")
/* Set the offset of the iterator in the heap */
@@ -861,27 +844,26 @@ H5HF_hdr_start_iter(H5HF_hdr_t *hdr, H5HF_indirect_t *iblock, hsize_t curr_off,
done:
FUNC_LEAVE_NOAPI(ret_value)
-} /* end H5HF_hdr_start_iter() */
+} /* end H5HF__hdr_start_iter() */
/*-------------------------------------------------------------------------
- * Function: H5HF_hdr_reset_iter
+ * Function: H5HF__hdr_reset_iter
*
* Purpose: Reset "next block" iterator
*
* Return: Non-negative on success/Negative on failure
*
* Programmer: Quincey Koziol
- * koziol@ncsa.uiuc.edu
* May 31 2006
*
*-------------------------------------------------------------------------
*/
herr_t
-H5HF_hdr_reset_iter(H5HF_hdr_t *hdr, hsize_t curr_off)
+H5HF__hdr_reset_iter(H5HF_hdr_t *hdr, hsize_t curr_off)
{
herr_t ret_value = SUCCEED; /* Return value */
- FUNC_ENTER_NOAPI_NOINIT
+ FUNC_ENTER_PACKAGE
/*
* Check arguments.
@@ -889,7 +871,7 @@ H5HF_hdr_reset_iter(H5HF_hdr_t *hdr, hsize_t curr_off)
HDassert(hdr);
/* Reset "next block" iterator */
- if (H5HF_man_iter_reset(&hdr->next_block) < 0)
+ if (H5HF__man_iter_reset(&hdr->next_block) < 0)
HGOTO_ERROR(H5E_HEAP, H5E_CANTRELEASE, FAIL, "can't reset block iterator")
/* Set the offset of the iterator in the heap */
@@ -897,7 +879,7 @@ H5HF_hdr_reset_iter(H5HF_hdr_t *hdr, hsize_t curr_off)
done:
FUNC_LEAVE_NOAPI(ret_value)
-} /* end H5HF_hdr_reset_iter() */
+} /* end H5HF__hdr_reset_iter() */
/*-------------------------------------------------------------------------
* Function: H5HF__hdr_skip_blocks
@@ -907,7 +889,6 @@ done:
* Return: SUCCEED/FAIL
*
* Programmer: Quincey Koziol
- * koziol@ncsa.uiuc.edu
* Apr 3 2006
*
*-------------------------------------------------------------------------
@@ -931,11 +912,11 @@ H5HF__hdr_skip_blocks(H5HF_hdr_t *hdr, H5HF_indirect_t *iblock, unsigned start_e
/* Compute the span within the heap to skip */
row = start_entry / hdr->man_dtable.cparam.width;
col = start_entry % hdr->man_dtable.cparam.width;
- sect_size = H5HF_dtable_span_size(&hdr->man_dtable, row, col, nentries);
+ sect_size = H5HF__dtable_span_size(&hdr->man_dtable, row, col, nentries);
HDassert(sect_size > 0);
/* Advance the new block iterator */
- if (H5HF_hdr_inc_iter(hdr, sect_size, nentries) < 0)
+ if (H5HF__hdr_inc_iter(hdr, sect_size, nentries) < 0)
HGOTO_ERROR(H5E_HEAP, H5E_CANTRELEASE, FAIL, "can't increase allocated heap size")
/* Add 'indirect' section for blocks skipped in this row */
@@ -958,7 +939,6 @@ done:
* Return: Non-negative on success/Negative on failure
*
* Programmer: Quincey Koziol
- * koziol@ncsa.uiuc.edu
* Mar 14 2006
*
*-------------------------------------------------------------------------
@@ -989,17 +969,17 @@ H5HF__hdr_update_iter(H5HF_hdr_t *hdr, size_t min_dblock_size)
unsigned min_dblock_row; /* Minimum row for direct block size request */
/* Compute min. row for direct block requested */
- min_dblock_row = H5HF_dtable_size_to_row(&hdr->man_dtable, min_dblock_size);
+ min_dblock_row = H5HF__dtable_size_to_row(&hdr->man_dtable, min_dblock_size);
/* Initialize block iterator, if necessary */
- if (!H5HF_man_iter_ready(&hdr->next_block)) {
+ if (!H5HF__man_iter_ready(&hdr->next_block)) {
/* Start iterator with previous offset of iterator */
if (H5HF__man_iter_start_offset(hdr, &hdr->next_block, hdr->man_iter_off) < 0)
HGOTO_ERROR(H5E_HEAP, H5E_CANTINIT, FAIL, "unable to set block iterator location")
} /* end if */
/* Get information about current iterator location */
- if (H5HF_man_iter_curr(&hdr->next_block, &next_row, NULL, &next_entry, &iblock) < 0)
+ if (H5HF__man_iter_curr(&hdr->next_block, &next_row, NULL, &next_entry, &iblock) < 0)
HGOTO_ERROR(H5E_HEAP, H5E_CANTGET, FAIL, "unable to retrieve current block iterator location")
/* Check for skipping over blocks in the current block */
@@ -1019,7 +999,7 @@ H5HF__hdr_update_iter(H5HF_hdr_t *hdr, size_t min_dblock_size)
HGOTO_ERROR(H5E_HEAP, H5E_CANTDEC, FAIL, "can't add skipped blocks to heap's free space")
/* Get information about new iterator location */
- if (H5HF_man_iter_curr(&hdr->next_block, &next_row, NULL, &next_entry, &iblock) < 0)
+ if (H5HF__man_iter_curr(&hdr->next_block, &next_row, NULL, &next_entry, &iblock) < 0)
HGOTO_ERROR(H5E_HEAP, H5E_CANTGET, FAIL, "unable to retrieve current block iterator location")
} /* end if */
@@ -1037,17 +1017,17 @@ H5HF__hdr_update_iter(H5HF_hdr_t *hdr, size_t min_dblock_size)
} /* end if */
else {
/* Move iterator up one level */
- if (H5HF_man_iter_up(&hdr->next_block) < 0)
+ if (H5HF__man_iter_up(&hdr->next_block) < 0)
HGOTO_ERROR(H5E_HEAP, H5E_CANTNEXT, FAIL,
"unable to advance current block iterator location")
/* Increment location of next block at this level */
- if (H5HF_man_iter_next(hdr, &hdr->next_block, 1) < 0)
+ if (H5HF__man_iter_next(hdr, &hdr->next_block, 1) < 0)
HGOTO_ERROR(H5E_HEAP, H5E_CANTINC, FAIL, "can't advance fractal heap block location")
} /* end else */
/* Get information about new iterator location */
- if (H5HF_man_iter_curr(&hdr->next_block, &next_row, NULL, &next_entry, &iblock) < 0)
+ if (H5HF__man_iter_curr(&hdr->next_block, &next_row, NULL, &next_entry, &iblock) < 0)
HGOTO_ERROR(H5E_HEAP, H5E_CANTGET, FAIL,
"unable to retrieve current block iterator location")
@@ -1064,7 +1044,7 @@ H5HF__hdr_update_iter(H5HF_hdr_t *hdr, size_t min_dblock_size)
/* Compute # of rows in next child indirect block to use */
child_nrows =
- H5HF_dtable_size_to_rows(&hdr->man_dtable, hdr->man_dtable.row_block_size[next_row]);
+ H5HF__dtable_size_to_rows(&hdr->man_dtable, hdr->man_dtable.row_block_size[next_row]);
/* Check for skipping over indirect blocks */
/* (that don't have direct blocks large enough to hold direct block size requested) */
@@ -1106,7 +1086,7 @@ H5HF__hdr_update_iter(H5HF_hdr_t *hdr, size_t min_dblock_size)
"unable to protect fractal heap indirect block")
/* Move iterator down one level (pins indirect block) */
- if (H5HF_man_iter_down(&hdr->next_block, new_iblock) < 0)
+ if (H5HF__man_iter_down(&hdr->next_block, new_iblock) < 0)
HGOTO_ERROR(H5E_HEAP, H5E_CANTNEXT, FAIL,
"unable to advance current block iterator location")
@@ -1130,7 +1110,7 @@ H5HF__hdr_update_iter(H5HF_hdr_t *hdr, size_t min_dblock_size)
} /* end else */
/* Get information about new iterator location */
- if (H5HF_man_iter_curr(&hdr->next_block, &next_row, NULL, &next_entry, &iblock) < 0)
+ if (H5HF__man_iter_curr(&hdr->next_block, &next_row, NULL, &next_entry, &iblock) < 0)
HGOTO_ERROR(H5E_HEAP, H5E_CANTGET, FAIL,
"unable to retrieve current block iterator location")
@@ -1145,24 +1125,23 @@ done:
} /* end H5HF__hdr_update_iter() */
/*-------------------------------------------------------------------------
- * Function: H5HF_hdr_inc_iter
+ * Function: H5HF__hdr_inc_iter
*
* Purpose: Advance "next block" iterator
*
* Return: Non-negative on success/Negative on failure
*
* Programmer: Quincey Koziol
- * koziol@ncsa.uiuc.edu
* May 23 2006
*
*-------------------------------------------------------------------------
*/
herr_t
-H5HF_hdr_inc_iter(H5HF_hdr_t *hdr, hsize_t adv_size, unsigned nentries)
+H5HF__hdr_inc_iter(H5HF_hdr_t *hdr, hsize_t adv_size, unsigned nentries)
{
herr_t ret_value = SUCCEED; /* Return value */
- FUNC_ENTER_NOAPI_NOINIT
+ FUNC_ENTER_PACKAGE
/*
* Check arguments.
@@ -1172,7 +1151,7 @@ H5HF_hdr_inc_iter(H5HF_hdr_t *hdr, hsize_t adv_size, unsigned nentries)
/* Advance the iterator for the current location within the indirect block */
if (hdr->next_block.curr)
- if (H5HF_man_iter_next(hdr, &hdr->next_block, nentries) < 0)
+ if (H5HF__man_iter_next(hdr, &hdr->next_block, nentries) < 0)
HGOTO_ERROR(H5E_HEAP, H5E_CANTNEXT, FAIL, "unable to advance current block iterator location")
/* Increment the offset of the iterator in the heap */
@@ -1180,7 +1159,7 @@ H5HF_hdr_inc_iter(H5HF_hdr_t *hdr, hsize_t adv_size, unsigned nentries)
done:
FUNC_LEAVE_NOAPI(ret_value)
-} /* end H5HF_hdr_inc_iter() */
+} /* end H5HF__hdr_inc_iter() */
/*-------------------------------------------------------------------------
* Function: H5HF__hdr_reverse_iter
@@ -1191,7 +1170,6 @@ done:
* Return: Non-negative on success/Negative on failure
*
* Programmer: Quincey Koziol
- * koziol@ncsa.uiuc.edu
* May 31 2006
*
*-------------------------------------------------------------------------
@@ -1213,7 +1191,7 @@ H5HF__hdr_reverse_iter(H5HF_hdr_t *hdr, haddr_t dblock_addr)
HDassert(hdr);
/* Initialize block iterator, if necessary */
- if (!H5HF_man_iter_ready(&hdr->next_block))
+ if (!H5HF__man_iter_ready(&hdr->next_block))
/* Start iterator with previous offset of iterator */
if (H5HF__man_iter_start_offset(hdr, &hdr->next_block, hdr->man_iter_off) < 0)
HGOTO_ERROR(H5E_HEAP, H5E_CANTINIT, FAIL, "unable to set block iterator location")
@@ -1221,7 +1199,7 @@ H5HF__hdr_reverse_iter(H5HF_hdr_t *hdr, haddr_t dblock_addr)
/* Walk backwards through heap, looking for direct block to place iterator after */
/* Get information about current iterator location */
- if (H5HF_man_iter_curr(&hdr->next_block, NULL, NULL, &curr_entry, &iblock) < 0)
+ if (H5HF__man_iter_curr(&hdr->next_block, NULL, NULL, &curr_entry, &iblock) < 0)
HGOTO_ERROR(H5E_HEAP, H5E_CANTGET, FAIL, "unable to retrieve current block iterator information")
/* Move current iterator position backwards once */
@@ -1246,12 +1224,12 @@ H5HF__hdr_reverse_iter(H5HF_hdr_t *hdr, haddr_t dblock_addr)
/* Check for parent of current indirect block */
if (iblock->parent) {
/* Move iterator to parent of current block */
- if (H5HF_man_iter_up(&hdr->next_block) < 0)
+ if (H5HF__man_iter_up(&hdr->next_block) < 0)
HGOTO_ERROR(H5E_HEAP, H5E_CANTNEXT, FAIL,
"unable to move current block iterator location up")
/* Get information about current iterator location */
- if (H5HF_man_iter_curr(&hdr->next_block, NULL, NULL, &curr_entry, &iblock) < 0)
+ if (H5HF__man_iter_curr(&hdr->next_block, NULL, NULL, &curr_entry, &iblock) < 0)
HGOTO_ERROR(H5E_HEAP, H5E_CANTGET, FAIL,
"unable to retrieve current block iterator information")
@@ -1266,7 +1244,7 @@ H5HF__hdr_reverse_iter(H5HF_hdr_t *hdr, haddr_t dblock_addr)
hdr->man_iter_off = 0;
/* Reset 'next block' iterator */
- if (H5HF_man_iter_reset(&hdr->next_block) < 0)
+ if (H5HF__man_iter_reset(&hdr->next_block) < 0)
HGOTO_ERROR(H5E_HEAP, H5E_CANTRELEASE, FAIL, "can't reset block iterator")
} /* end else */
} /* end if */
@@ -1282,7 +1260,7 @@ H5HF__hdr_reverse_iter(H5HF_hdr_t *hdr, haddr_t dblock_addr)
curr_entry++;
/* Set the current location of the iterator to next entry after the existing direct block */
- if (H5HF_man_iter_set_entry(hdr, &hdr->next_block, curr_entry) < 0)
+ if (H5HF__man_iter_set_entry(hdr, &hdr->next_block, curr_entry) < 0)
HGOTO_ERROR(H5E_HEAP, H5E_CANTSET, FAIL, "unable to set current block iterator location")
/* Update iterator offset */
@@ -1298,7 +1276,8 @@ H5HF__hdr_reverse_iter(H5HF_hdr_t *hdr, haddr_t dblock_addr)
unsigned child_nrows; /* # of rows in child block */
/* Compute # of rows in next child indirect block to use */
- child_nrows = H5HF_dtable_size_to_rows(&hdr->man_dtable, hdr->man_dtable.row_block_size[row]);
+ child_nrows =
+ H5HF__dtable_size_to_rows(&hdr->man_dtable, hdr->man_dtable.row_block_size[row]);
/* Lock child indirect block */
if (NULL == (child_iblock = H5HF__man_iblock_protect(hdr, iblock->ents[curr_entry].addr,
@@ -1308,11 +1287,11 @@ H5HF__hdr_reverse_iter(H5HF_hdr_t *hdr, haddr_t dblock_addr)
"unable to protect fractal heap indirect block")
/* Set the current location of the iterator */
- if (H5HF_man_iter_set_entry(hdr, &hdr->next_block, curr_entry) < 0)
+ if (H5HF__man_iter_set_entry(hdr, &hdr->next_block, curr_entry) < 0)
HGOTO_ERROR(H5E_HEAP, H5E_CANTSET, FAIL, "unable to set current block iterator location")
/* Walk down into child indirect block (pins child block) */
- if (H5HF_man_iter_down(&hdr->next_block, child_iblock) < 0)
+ if (H5HF__man_iter_down(&hdr->next_block, child_iblock) < 0)
HGOTO_ERROR(H5E_HEAP, H5E_CANTNEXT, FAIL,
"unable to advance current block iterator location")
@@ -1343,7 +1322,6 @@ done:
* Return: Non-negative on success/Negative on failure
*
* Programmer: Quincey Koziol
- * koziol@ncsa.uiuc.edu
* May 17 2006
*
*-------------------------------------------------------------------------
@@ -1359,10 +1337,9 @@ H5HF__hdr_empty(H5HF_hdr_t *hdr)
HDassert(hdr);
/* Reset block iterator, if necessary */
- if (H5HF_man_iter_ready(&hdr->next_block)) {
- if (H5HF_man_iter_reset(&hdr->next_block) < 0)
+ if (H5HF__man_iter_ready(&hdr->next_block))
+ if (H5HF__man_iter_reset(&hdr->next_block) < 0)
HGOTO_ERROR(H5E_HEAP, H5E_CANTRELEASE, FAIL, "can't reset block iterator")
- } /* end if */
/* Shrink managed heap size */
hdr->man_size = 0;
@@ -1379,7 +1356,7 @@ H5HF__hdr_empty(H5HF_hdr_t *hdr)
hdr->total_man_free = 0;
/* Mark heap header as modified */
- if (H5HF_hdr_dirty(hdr) < 0)
+ if (H5HF__hdr_dirty(hdr) < 0)
HGOTO_ERROR(H5E_HEAP, H5E_CANTDIRTY, FAIL, "can't mark header as dirty")
done:
@@ -1387,24 +1364,23 @@ done:
} /* end H5HF__hdr_empty() */
/*-------------------------------------------------------------------------
- * Function: H5HF_hdr_free
+ * Function: H5HF__hdr_free
*
* Purpose: Free shared fractal heap header
*
* Return: Non-negative on success/Negative on failure
*
* Programmer: Quincey Koziol
- * koziol@hdfgroup.org
* Oct 27 2009
*
*-------------------------------------------------------------------------
*/
herr_t
-H5HF_hdr_free(H5HF_hdr_t *hdr)
+H5HF__hdr_free(H5HF_hdr_t *hdr)
{
herr_t ret_value = SUCCEED; /* Return value */
- FUNC_ENTER_NOAPI_NOINIT
+ FUNC_ENTER_PACKAGE
/*
* Check arguments.
@@ -1412,7 +1388,7 @@ H5HF_hdr_free(H5HF_hdr_t *hdr)
HDassert(hdr);
/* Free the block size lookup table for the doubling table */
- if (H5HF_dtable_dest(&hdr->man_dtable) < 0)
+ if (H5HF__dtable_dest(&hdr->man_dtable) < 0)
HGOTO_ERROR(H5E_HEAP, H5E_CANTFREE, FAIL, "unable to destroy fractal heap doubling table")
/* Release any I/O pipeline filter information */
@@ -1425,7 +1401,7 @@ H5HF_hdr_free(H5HF_hdr_t *hdr)
done:
FUNC_LEAVE_NOAPI(ret_value)
-} /* end H5HF_hdr_free() */
+} /* end H5HF__hdr_free() */
/*-------------------------------------------------------------------------
* Function: H5HF__hdr_delete
@@ -1435,7 +1411,6 @@ done:
* Return: SUCCEED/FAIL
*
* Programmer: Quincey Koziol
- * koziol@hdfgroup.org
* Jan 5 2007
*
*-------------------------------------------------------------------------
diff --git a/src/H5HFhuge.c b/src/H5HFhuge.c
index 995f400..b1043a6 100644
--- a/src/H5HFhuge.c
+++ b/src/H5HFhuge.c
@@ -15,7 +15,7 @@
*
* Created: H5HFhuge.c
* Aug 7 2006
- * Quincey Koziol <koziol@hdfgroup.org>
+ * Quincey Koziol
*
* Purpose: Routines for "huge" objects in fractal heap
*
@@ -62,7 +62,7 @@
static herr_t H5HF__huge_bt2_create(H5HF_hdr_t *hdr);
/* Local 'huge' object support routines */
-static hsize_t H5HF_huge_new_id(H5HF_hdr_t *hdr);
+static hsize_t H5HF__huge_new_id(H5HF_hdr_t *hdr);
static herr_t H5HF__huge_op_real(H5HF_hdr_t *hdr, const uint8_t *id, hbool_t is_read, H5HF_operator_t op,
void *op_data);
@@ -86,7 +86,6 @@ static herr_t H5HF__huge_op_real(H5HF_hdr_t *hdr, const uint8_t *id, hbool_t is
* Return: SUCCEED/FAIL
*
* Programmer: Quincey Koziol
- * koziol@hdfgroup.org
* Aug 7 2006
*
*-------------------------------------------------------------------------
@@ -114,32 +113,32 @@ H5HF__huge_bt2_create(H5HF_hdr_t *hdr)
if (hdr->huge_ids_direct) {
if (hdr->filter_len > 0) {
bt2_cparam.rrec_size =
- (size_t)((unsigned)hdr->sizeof_addr /* Address of object */
- + (unsigned)hdr->sizeof_size /* Length of object */
- + (unsigned)4 /* Filter mask for filtered object */
- + (unsigned)hdr->sizeof_size); /* Size of de-filtered object in memory */
+ (uint32_t)((unsigned)hdr->sizeof_addr /* Address of object */
+ + (unsigned)hdr->sizeof_size /* Length of object */
+ + (unsigned)4 /* Filter mask for filtered object */
+ + (unsigned)hdr->sizeof_size); /* Size of de-filtered object in memory */
bt2_cparam.cls = H5HF_HUGE_BT2_FILT_DIR;
} /* end if */
else {
- bt2_cparam.rrec_size = (size_t)((unsigned)hdr->sizeof_addr /* Address of object */
- + (unsigned)hdr->sizeof_size); /* Length of object */
+ bt2_cparam.rrec_size = (uint32_t)((unsigned)hdr->sizeof_addr /* Address of object */
+ + (unsigned)hdr->sizeof_size); /* Length of object */
bt2_cparam.cls = H5HF_HUGE_BT2_DIR;
} /* end else */
} /* end if */
else {
if (hdr->filter_len > 0) {
bt2_cparam.rrec_size =
- (size_t)((unsigned)hdr->sizeof_addr /* Address of filtered object */
- + (unsigned)hdr->sizeof_size /* Length of filtered object */
- + (unsigned)4 /* Filter mask for filtered object */
- + (unsigned)hdr->sizeof_size /* Size of de-filtered object in memory */
- + (unsigned)hdr->sizeof_size); /* Unique ID for object */
+ (uint32_t)((unsigned)hdr->sizeof_addr /* Address of filtered object */
+ + (unsigned)hdr->sizeof_size /* Length of filtered object */
+ + (unsigned)4 /* Filter mask for filtered object */
+ + (unsigned)hdr->sizeof_size /* Size of de-filtered object in memory */
+ + (unsigned)hdr->sizeof_size); /* Unique ID for object */
bt2_cparam.cls = H5HF_HUGE_BT2_FILT_INDIR;
} /* end if */
else {
- bt2_cparam.rrec_size = (size_t)((unsigned)hdr->sizeof_addr /* Address of object */
- + (unsigned)hdr->sizeof_size /* Length of object */
- + (unsigned)hdr->sizeof_size); /* Unique ID for object */
+ bt2_cparam.rrec_size = (uint32_t)((unsigned)hdr->sizeof_addr /* Address of object */
+ + (unsigned)hdr->sizeof_size /* Length of object */
+ + (unsigned)hdr->sizeof_size); /* Unique ID for object */
bt2_cparam.cls = H5HF_HUGE_BT2_INDIR;
} /* end else */
} /* end else */
@@ -161,22 +160,21 @@ done:
} /* end H5HF__huge_bt2_create() */
/*-------------------------------------------------------------------------
- * Function: H5HF_huge_init
+ * Function: H5HF__huge_init
*
* Purpose: Initialize information for tracking 'huge' objects
*
* Return: SUCCEED/FAIL
*
* Programmer: Quincey Koziol
- * koziol@hdfgroup.org
* Aug 7 2006
*
*-------------------------------------------------------------------------
*/
herr_t
-H5HF_huge_init(H5HF_hdr_t *hdr)
+H5HF__huge_init(H5HF_hdr_t *hdr)
{
- FUNC_ENTER_NOAPI_NOINIT_NOERR
+ FUNC_ENTER_PACKAGE_NOERR
/*
* Check arguments.
@@ -189,10 +187,6 @@ H5HF_huge_init(H5HF_hdr_t *hdr)
* the file in the heap ID (which will speed up accessing it) and we don't
* have any I/O pipeline filters.
*/
-#ifdef QAK
- HDfprintf(stderr, "%s: hdr->id_len = %u\n", "H5HF_huge_init", (unsigned)hdr->id_len);
- HDfprintf(stderr, "%s: hdr->filter_len = %u\n", "H5HF_huge_init", (unsigned)hdr->filter_len);
-#endif /* QAK */
if (hdr->filter_len > 0) {
if ((hdr->id_len - 1) >= (unsigned)(hdr->sizeof_addr + hdr->sizeof_size + 4 + hdr->sizeof_size)) {
/* Indicate that v2 B-tree doesn't have to be used to locate object */
@@ -231,10 +225,10 @@ H5HF_huge_init(H5HF_hdr_t *hdr)
hdr->huge_bt2 = NULL;
FUNC_LEAVE_NOAPI(SUCCEED)
-} /* end H5HF_huge_init() */
+} /* end H5HF__huge_init() */
/*-------------------------------------------------------------------------
- * Function: H5HF_huge_new_id
+ * Function: H5HF__huge_new_id
*
* Purpose: Determine a new ID for an indirectly accessed 'huge' object
* (either filtered or not)
@@ -242,18 +236,17 @@ H5HF_huge_init(H5HF_hdr_t *hdr)
* Return: SUCCEED/FAIL
*
* Programmer: Quincey Koziol
- * koziol@hdfgroup.org
* Aug 15 2006
*
*-------------------------------------------------------------------------
*/
static hsize_t
-H5HF_huge_new_id(H5HF_hdr_t *hdr)
+H5HF__huge_new_id(H5HF_hdr_t *hdr)
{
hsize_t new_id; /* New object's ID */
hsize_t ret_value = 0; /* Return value */
- FUNC_ENTER_NOAPI_NOINIT
+ FUNC_ENTER_STATIC
/*
* Check arguments.
@@ -279,7 +272,7 @@ H5HF_huge_new_id(H5HF_hdr_t *hdr)
done:
FUNC_LEAVE_NOAPI(ret_value)
-} /* end H5HF_huge_new_id() */
+} /* end H5HF__huge_new_id() */
/*-------------------------------------------------------------------------
* Function: H5HF__huge_insert
@@ -289,7 +282,6 @@ done:
* Return: SUCCEED/FAIL
*
* Programmer: Quincey Koziol
- * koziol@hdfgroup.org
* Aug 7 2006
*
*-------------------------------------------------------------------------
@@ -305,9 +297,6 @@ H5HF__huge_insert(H5HF_hdr_t *hdr, size_t obj_size, void *obj, void *_id)
herr_t ret_value = SUCCEED; /* Return value */
FUNC_ENTER_PACKAGE
-#ifdef QAK
- HDfprintf(stderr, "%s: obj_size = %Zu\n", FUNC, obj_size);
-#endif /* QAK */
/*
* Check arguments.
@@ -355,11 +344,6 @@ H5HF__huge_insert(H5HF_hdr_t *hdr, size_t obj_size, void *obj, void *_id)
if (H5Z_pipeline(&(hdr->pline), 0, &filter_mask, H5Z_NO_EDC, filter_cb, &nbytes, &write_size,
&write_buf) < 0)
HGOTO_ERROR(H5E_HEAP, H5E_CANTFILTER, FAIL, "output pipeline failed")
-#ifdef QAK
- HDfprintf(stderr, "%s: nbytes = %Zu, write_size = %Zu, write_buf = %p\n", FUNC, nbytes, write_size,
- write_buf);
- HDfprintf(stderr, "%s: obj_size = %Zu, obj = %p\n", FUNC, obj_size, obj);
-#endif /* QAK */
/* Update size of object on disk */
write_size = nbytes;
@@ -393,10 +377,6 @@ H5HF__huge_insert(H5HF_hdr_t *hdr, size_t obj_size, void *obj, void *_id)
obj_rec.len = write_size;
obj_rec.filter_mask = filter_mask;
obj_rec.obj_size = obj_size;
-#ifdef QAK
- HDfprintf(stderr, "%s: obj_rec = {%a, %Hu, %x, %Hu}\n", FUNC, obj_rec.addr, obj_rec.len,
- obj_rec.filter_mask, obj_rec.obj_size);
-#endif /* QAK */
/* Insert record for object in v2 B-tree */
if (H5B2_insert(hdr->huge_bt2, &obj_rec) < 0)
@@ -416,9 +396,6 @@ H5HF__huge_insert(H5HF_hdr_t *hdr, size_t obj_size, void *obj, void *_id)
/* Initialize record for tracking object in v2 B-tree */
obj_rec.addr = obj_addr;
obj_rec.len = write_size;
-#ifdef QAK
- HDfprintf(stderr, "%s: obj_rec = {%a, %Hu}\n", FUNC, obj_rec.addr, obj_rec.len);
-#endif /* QAK */
/* Insert record for object in v2 B-tree */
if (H5B2_insert(hdr->huge_bt2, &obj_rec) < 0)
@@ -438,7 +415,7 @@ H5HF__huge_insert(H5HF_hdr_t *hdr, size_t obj_size, void *obj, void *_id)
hsize_t new_id; /* New ID for object */
/* Get new ID for object */
- if (0 == (new_id = H5HF_huge_new_id(hdr)))
+ if (0 == (new_id = H5HF__huge_new_id(hdr)))
HGOTO_ERROR(H5E_HEAP, H5E_CANTINIT, FAIL, "can't generate new ID for object")
if (hdr->filter_len > 0) {
@@ -448,11 +425,6 @@ H5HF__huge_insert(H5HF_hdr_t *hdr, size_t obj_size, void *obj, void *_id)
filt_indir_rec.filter_mask = filter_mask;
filt_indir_rec.obj_size = obj_size;
filt_indir_rec.id = new_id;
-#ifdef QAK
- HDfprintf(stderr, "%s: filt_indir_rec = {%a, %Hu, %x, %Hu, %Hu}\n", FUNC, filt_indir_rec.addr,
- filt_indir_rec.len, filt_indir_rec.filter_mask, filt_indir_rec.obj_size,
- filt_indir_rec.id);
-#endif /* QAK */
/* Set pointer to record to insert */
ins_rec = &filt_indir_rec;
@@ -462,10 +434,6 @@ H5HF__huge_insert(H5HF_hdr_t *hdr, size_t obj_size, void *obj, void *_id)
indir_rec.addr = obj_addr;
indir_rec.len = write_size;
indir_rec.id = new_id;
-#ifdef QAK
- HDfprintf(stderr, "%s: indir_rec = {%a, %Hu, %Hu}\n", FUNC, indir_rec.addr, indir_rec.len,
- indir_rec.id);
-#endif /* QAK */
/* Set pointer to record to insert */
ins_rec = &indir_rec;
@@ -485,7 +453,7 @@ H5HF__huge_insert(H5HF_hdr_t *hdr, size_t obj_size, void *obj, void *_id)
hdr->huge_nobjs++;
/* Mark heap header as modified */
- if (H5HF_hdr_dirty(hdr) < 0)
+ if (H5HF__hdr_dirty(hdr) < 0)
HGOTO_ERROR(H5E_HEAP, H5E_CANTDIRTY, FAIL, "can't mark heap header as dirty")
done:
@@ -500,7 +468,6 @@ done:
* Return: SUCCEED/FAIL
*
* Programmer: Quincey Koziol
- * koziol@hdfgroup.org
* Aug 8 2006
*
*-------------------------------------------------------------------------
@@ -591,7 +558,6 @@ done:
* Return: SUCCEED/FAIL
*
* Programmer: Quincey Koziol
- * koziol@hdfgroup.org
* Aug 8 2006
*
*-------------------------------------------------------------------------
@@ -677,7 +643,6 @@ done:
* Return: SUCCEED/FAIL
*
* Programmer: Quincey Koziol
- * koziol@hdfgroup.org
* Aug 8 2006
*
*-------------------------------------------------------------------------
@@ -828,7 +793,6 @@ done:
* Return: SUCCEED/FAIL
*
* Programmer: Quincey Koziol
- * koziol@hdfgroup.org
* Feb 21 2007
*
*-------------------------------------------------------------------------
@@ -906,7 +870,6 @@ done:
* Return: SUCCEED/FAIL
*
* Programmer: Quincey Koziol
- * koziol@ncsa.uiuc.edu
* Sept 11 2006
*
*-------------------------------------------------------------------------
@@ -941,7 +904,6 @@ done:
* Return: SUCCEED/FAIL
*
* Programmer: Quincey Koziol
- * koziol@ncsa.uiuc.edu
* Sept 11 2006
*
*-------------------------------------------------------------------------
@@ -976,7 +938,6 @@ done:
* Return: SUCCEED/FAIL
*
* Programmer: Quincey Koziol
- * koziol@hdfgroup.org
* Aug 8 2006
*
*-------------------------------------------------------------------------
@@ -1069,7 +1030,7 @@ H5HF__huge_remove(H5HF_hdr_t *hdr, const uint8_t *id)
hdr->huge_nobjs--;
/* Mark heap header as modified */
- if (H5HF_hdr_dirty(hdr) < 0)
+ if (H5HF__hdr_dirty(hdr) < 0)
HGOTO_ERROR(H5E_HEAP, H5E_CANTDIRTY, FAIL, "can't mark heap header as dirty")
done:
@@ -1084,7 +1045,6 @@ done:
* Return: SUCCEED/FAIL
*
* Programmer: Quincey Koziol
- * koziol@hdfgroup.org
* Aug 8 2006
*
*-------------------------------------------------------------------------
@@ -1130,7 +1090,7 @@ H5HF__huge_term(H5HF_hdr_t *hdr)
hdr->huge_ids_wrapped = FALSE;
/* Mark heap header as modified */
- if (H5HF_hdr_dirty(hdr) < 0)
+ if (H5HF__hdr_dirty(hdr) < 0)
HGOTO_ERROR(H5E_HEAP, H5E_CANTDIRTY, FAIL, "can't mark heap header as dirty")
} /* end if */
@@ -1147,7 +1107,6 @@ done:
* Return: SUCCEED/FAIL
*
* Programmer: Quincey Koziol
- * koziol@hdfgroup.org
* Aug 8 2006
*
*-------------------------------------------------------------------------
diff --git a/src/H5HFiblock.c b/src/H5HFiblock.c
index 3a1cf13..9b69ec1 100644
--- a/src/H5HFiblock.c
+++ b/src/H5HFiblock.c
@@ -15,7 +15,7 @@
*
* Created: H5HFiblock.c
* Apr 10 2006
- * Quincey Koziol <koziol@ncsa.uiuc.edu>
+ * Quincey Koziol
*
* Purpose: Indirect block routines for fractal heaps.
*
@@ -90,7 +90,6 @@ H5FL_SEQ_DEFINE(H5HF_indirect_ptr_t);
* Return: Non-negative on success/Negative on failure
*
* Programmer: Quincey Koziol
- * koziol@hdfgroup.org
* Aug 17 2006
*
*-------------------------------------------------------------------------
@@ -156,7 +155,6 @@ done:
* Return: Non-negative on success/Negative on failure
*
* Programmer: Quincey Koziol
- * koziol@hdfgroup.org
* Aug 17 2006
*
*-------------------------------------------------------------------------
@@ -180,24 +178,23 @@ done:
} /* end H5HF__iblock_unpin() */
/*-------------------------------------------------------------------------
- * Function: H5HF_iblock_incr
+ * Function: H5HF__iblock_incr
*
* Purpose: Increment reference count on shared indirect block
*
* Return: Non-negative on success/Negative on failure
*
* Programmer: Quincey Koziol
- * koziol@ncsa.uiuc.edu
* Mar 27 2006
*
*-------------------------------------------------------------------------
*/
herr_t
-H5HF_iblock_incr(H5HF_indirect_t *iblock)
+H5HF__iblock_incr(H5HF_indirect_t *iblock)
{
herr_t ret_value = SUCCEED; /* Return value */
- FUNC_ENTER_NOAPI_NOINIT
+ FUNC_ENTER_PACKAGE
/* Sanity checks */
HDassert(iblock);
@@ -213,7 +210,7 @@ H5HF_iblock_incr(H5HF_indirect_t *iblock)
done:
FUNC_LEAVE_NOAPI(ret_value)
-} /* end H5HF_iblock_incr() */
+} /* end H5HF__iblock_incr() */
/*-------------------------------------------------------------------------
* Function: H5HF__iblock_decr
@@ -223,7 +220,6 @@ done:
* Return: Non-negative on success/Negative on failure
*
* Programmer: Quincey Koziol
- * koziol@ncsa.uiuc.edu
* Mar 27 2006
*
*-------------------------------------------------------------------------
@@ -287,7 +283,7 @@ H5HF__iblock_decr(H5HF_indirect_t *iblock)
} /* end if */
else {
/* Destroy the indirect block */
- if (H5HF_man_iblock_dest(iblock) < 0)
+ if (H5HF__man_iblock_dest(iblock) < 0)
HGOTO_ERROR(H5E_HEAP, H5E_CANTFREE, FAIL, "unable to destroy fractal heap indirect block")
} /* end else */
} /* end if */
@@ -297,24 +293,23 @@ done:
} /* end H5HF__iblock_decr() */
/*-------------------------------------------------------------------------
- * Function: H5HF_iblock_dirty
+ * Function: H5HF__iblock_dirty
*
* Purpose: Mark indirect block as dirty
*
* Return: Non-negative on success/Negative on failure
*
* Programmer: Quincey Koziol
- * koziol@ncsa.uiuc.edu
* Mar 21 2006
*
*-------------------------------------------------------------------------
*/
herr_t
-H5HF_iblock_dirty(H5HF_indirect_t *iblock)
+H5HF__iblock_dirty(H5HF_indirect_t *iblock)
{
herr_t ret_value = SUCCEED; /* Return value */
- FUNC_ENTER_NOAPI_NOINIT
+ FUNC_ENTER_PACKAGE
/* Sanity check */
HDassert(iblock);
@@ -325,7 +320,7 @@ H5HF_iblock_dirty(H5HF_indirect_t *iblock)
done:
FUNC_LEAVE_NOAPI(ret_value)
-} /* end H5HF_iblock_dirty() */
+} /* end H5HF__iblock_dirty() */
/*-------------------------------------------------------------------------
* Function: H5HF__man_iblock_root_create
@@ -335,7 +330,6 @@ done:
* Return: SUCCEED/FAIL
*
* Programmer: Quincey Koziol
- * koziol@ncsa.uiuc.edu
* May 2 2006
*
*-------------------------------------------------------------------------
@@ -408,7 +402,7 @@ H5HF__man_iblock_root_create(H5HF_hdr_t *hdr, size_t min_dblock_size)
HGOTO_ERROR(H5E_HEAP, H5E_CANTDEPEND, FAIL, "unable to create flush dependency")
dblock->fd_parent = iblock;
- if (H5HF_man_iblock_attach(iblock, 0, hdr->man_dtable.table_addr) < 0)
+ if (H5HF__man_iblock_attach(iblock, 0, hdr->man_dtable.table_addr) < 0)
HGOTO_ERROR(H5E_HEAP, H5E_CANTATTACH, FAIL,
"can't attach root direct block to parent indirect block")
@@ -436,9 +430,9 @@ H5HF__man_iblock_root_create(H5HF_hdr_t *hdr, size_t min_dblock_size)
} /* end if */
/* Start iterator at correct location */
- if (H5HF_hdr_start_iter(hdr, iblock,
- (hsize_t)(have_direct_block ? hdr->man_dtable.cparam.start_block_size : 0),
- have_direct_block) < 0)
+ if (H5HF__hdr_start_iter(hdr, iblock,
+ (hsize_t)(have_direct_block ? hdr->man_dtable.cparam.start_block_size : 0),
+ have_direct_block) < 0)
HGOTO_ERROR(H5E_HEAP, H5E_CANTINIT, FAIL, "can't initialize block iterator")
/* Check for skipping over direct blocks, in order to get to large enough block */
@@ -449,7 +443,7 @@ H5HF__man_iblock_root_create(H5HF_hdr_t *hdr, size_t min_dblock_size)
HGOTO_ERROR(H5E_HEAP, H5E_CANTDEC, FAIL, "can't add skipped blocks to heap's free space")
/* Mark indirect block as modified */
- if (H5HF_iblock_dirty(iblock) < 0)
+ if (H5HF__iblock_dirty(iblock) < 0)
HGOTO_ERROR(H5E_HEAP, H5E_CANTDIRTY, FAIL, "can't mark indirect block as dirty")
/* Unprotect root indirect block (it's pinned by the iterator though) */
@@ -471,7 +465,7 @@ H5HF__man_iblock_root_create(H5HF_hdr_t *hdr, size_t min_dblock_size)
acc_dblock_free -= hdr->man_dtable.row_tot_dblock_free[0];
/* Extend heap to cover new root indirect block */
- if (H5HF_hdr_adjust_heap(hdr, hdr->man_dtable.row_block_off[nrows], (hssize_t)acc_dblock_free) < 0)
+ if (H5HF__hdr_adjust_heap(hdr, hdr->man_dtable.row_block_off[nrows], (hssize_t)acc_dblock_free) < 0)
HGOTO_ERROR(H5E_HEAP, H5E_CANTEXTEND, FAIL, "can't increase space to cover root direct block")
done:
@@ -486,7 +480,6 @@ done:
* Return: SUCCEED/FAIL
*
* Programmer: Quincey Koziol
- * koziol@ncsa.uiuc.edu
* Apr 17 2006
*
*-------------------------------------------------------------------------
@@ -512,7 +505,7 @@ H5HF__man_iblock_root_double(H5HF_hdr_t *hdr, size_t min_dblock_size)
FUNC_ENTER_PACKAGE
/* Get "new block" iterator information */
- if (H5HF_man_iter_curr(&hdr->next_block, &next_row, NULL, &next_entry, &iblock) < 0)
+ if (H5HF__man_iter_curr(&hdr->next_block, &next_row, NULL, &next_entry, &iblock) < 0)
HGOTO_ERROR(H5E_HEAP, H5E_CANTGET, FAIL, "unable to retrieve current block iterator location")
next_size = hdr->man_dtable.row_block_size[next_row];
@@ -532,7 +525,7 @@ H5HF__man_iblock_root_double(H5HF_hdr_t *hdr, size_t min_dblock_size)
skip_direct_rows = TRUE;
/* Make certain we allocate at least the required row for the block requested */
- min_nrows = 1 + H5HF_dtable_size_to_row(&hdr->man_dtable, min_dblock_size);
+ min_nrows = 1 + H5HF__dtable_size_to_row(&hdr->man_dtable, min_dblock_size);
/* Set the information for the next block, of the appropriate size */
new_next_entry = (min_nrows - 1) * hdr->man_dtable.cparam.width;
@@ -645,7 +638,7 @@ H5HF__man_iblock_root_double(H5HF_hdr_t *hdr, size_t min_dblock_size)
} /* end if */
/* Mark indirect block as dirty */
- if (H5HF_iblock_dirty(iblock) < 0)
+ if (H5HF__iblock_dirty(iblock) < 0)
HGOTO_ERROR(H5E_HEAP, H5E_CANTDIRTY, FAIL, "can't mark indirect block as dirty")
/* Update other shared header info */
@@ -653,8 +646,8 @@ H5HF__man_iblock_root_double(H5HF_hdr_t *hdr, size_t min_dblock_size)
hdr->man_dtable.table_addr = new_addr;
/* Extend heap to cover new root indirect block */
- if (H5HF_hdr_adjust_heap(hdr, 2 * hdr->man_dtable.row_block_off[new_nrows - 1],
- (hssize_t)acc_dblock_free) < 0)
+ if (H5HF__hdr_adjust_heap(hdr, 2 * hdr->man_dtable.row_block_off[new_nrows - 1],
+ (hssize_t)acc_dblock_free) < 0)
HGOTO_ERROR(H5E_HEAP, H5E_CANTEXTEND, FAIL, "can't increase space to cover root direct block")
done:
@@ -669,7 +662,6 @@ done:
* Return: SUCCEED/FAIL
*
* Programmer: Quincey Koziol
- * koziol@ncsa.uiuc.edu
* Jun 12 2006
*
*-------------------------------------------------------------------------
@@ -777,7 +769,7 @@ H5HF__man_iblock_root_halve(H5HF_indirect_t *iblock)
} /* end if */
/* Mark indirect block as dirty */
- if (H5HF_iblock_dirty(iblock) < 0)
+ if (H5HF__iblock_dirty(iblock) < 0)
HGOTO_ERROR(H5E_HEAP, H5E_CANTDIRTY, FAIL, "can't mark indirect block as dirty")
/* Update other shared header info */
@@ -785,8 +777,8 @@ H5HF__man_iblock_root_halve(H5HF_indirect_t *iblock)
hdr->man_dtable.table_addr = new_addr;
/* Shrink heap to only cover new root indirect block */
- if (H5HF_hdr_adjust_heap(hdr, 2 * hdr->man_dtable.row_block_off[new_nrows - 1],
- -(hssize_t)acc_dblock_free) < 0)
+ if (H5HF__hdr_adjust_heap(hdr, 2 * hdr->man_dtable.row_block_off[new_nrows - 1],
+ -(hssize_t)acc_dblock_free) < 0)
HGOTO_ERROR(H5E_HEAP, H5E_CANTSHRINK, FAIL, "can't reduce space to cover root direct block")
done:
@@ -804,7 +796,6 @@ done:
* Return: SUCCEED/FAIL
*
* Programmer: Quincey Koziol
- * koziol@ncsa.uiuc.edu
* May 31 2006
*
*-------------------------------------------------------------------------
@@ -865,12 +856,12 @@ H5HF__man_iblock_root_revert(H5HF_indirect_t *root_iblock)
hdr->man_dtable.table_addr = dblock_addr;
/* Reset 'next block' iterator */
- if (H5HF_hdr_reset_iter(hdr, (hsize_t)dblock_size) < 0)
+ if (H5HF__hdr_reset_iter(hdr, (hsize_t)dblock_size) < 0)
HGOTO_ERROR(H5E_HEAP, H5E_CANTRELEASE, FAIL, "can't reset block iterator")
/* Extend heap to just cover first direct block */
- if (H5HF_hdr_adjust_heap(hdr, (hsize_t)hdr->man_dtable.cparam.start_block_size,
- (hssize_t)hdr->man_dtable.row_tot_dblock_free[0]) < 0)
+ if (H5HF__hdr_adjust_heap(hdr, (hsize_t)hdr->man_dtable.cparam.start_block_size,
+ (hssize_t)hdr->man_dtable.row_tot_dblock_free[0]) < 0)
HGOTO_ERROR(H5E_HEAP, H5E_CANTEXTEND, FAIL, "can't increase space to cover root direct block")
/* Scan free space sections to reset any 'parent' pointers */
@@ -895,7 +886,6 @@ done:
* Return: Non-negative on success/Negative on failure
*
* Programmer: Quincey Koziol
- * koziol@ncsa.uiuc.edu
* July 6 2006
*
*-------------------------------------------------------------------------
@@ -928,11 +918,11 @@ H5HF__man_iblock_alloc_row(H5HF_hdr_t *hdr, H5HF_free_section_t **sec_node)
HGOTO_ERROR(H5E_HEAP, H5E_CANTREVIVE, FAIL, "can't revive indirect section")
/* Get a pointer to the indirect block covering the section */
- if (NULL == (iblock = H5HF_sect_row_get_iblock(old_sec_node)))
+ if (NULL == (iblock = H5HF__sect_row_get_iblock(old_sec_node)))
HGOTO_ERROR(H5E_HEAP, H5E_CANTGET, FAIL, "can't retrieve indirect block for row section")
/* Hold indirect block in memory, until direct block can point to it */
- if (H5HF_iblock_incr(iblock) < 0)
+ if (H5HF__iblock_incr(iblock) < 0)
HGOTO_ERROR(H5E_HEAP, H5E_CANTINC, FAIL, "can't increment reference count on shared indirect block")
iblock_held = TRUE;
@@ -962,7 +952,6 @@ done:
* Return: SUCCEED/FAIL
*
* Programmer: Quincey Koziol
- * koziol@ncsa.uiuc.edu
* Mar 6 2006
*
*-------------------------------------------------------------------------
@@ -996,7 +985,7 @@ H5HF__man_iblock_create(H5HF_hdr_t *hdr, H5HF_indirect_t *par_iblock, unsigned p
/* Share common heap information */
iblock->hdr = hdr;
- if (H5HF_hdr_incr(hdr) < 0)
+ if (H5HF__hdr_incr(hdr) < 0)
HGOTO_ERROR(H5E_HEAP, H5E_CANTINC, FAIL, "can't increment reference count on shared heap header")
/* Set info for indirect block */
@@ -1065,7 +1054,7 @@ H5HF__man_iblock_create(H5HF_hdr_t *hdr, H5HF_indirect_t *par_iblock, unsigned p
iblock->par_entry = par_entry;
if (iblock->parent) {
/* Attach new block to parent */
- if (H5HF_man_iblock_attach(iblock->parent, par_entry, *addr_p) < 0)
+ if (H5HF__man_iblock_attach(iblock->parent, par_entry, *addr_p) < 0)
HGOTO_ERROR(H5E_HEAP, H5E_CANTATTACH, FAIL,
"can't attach indirect block to parent indirect block")
@@ -1097,7 +1086,7 @@ H5HF__man_iblock_create(H5HF_hdr_t *hdr, H5HF_indirect_t *par_iblock, unsigned p
done:
if (ret_value < 0)
if (iblock)
- if (H5HF_man_iblock_dest(iblock) < 0)
+ if (H5HF__man_iblock_dest(iblock) < 0)
HDONE_ERROR(H5E_HEAP, H5E_CANTFREE, FAIL, "unable to destroy fractal heap indirect block")
FUNC_LEAVE_NOAPI(ret_value)
@@ -1111,7 +1100,6 @@ done:
* Return: Pointer to indirect block on success, NULL on failure
*
* Programmer: Quincey Koziol
- * koziol@ncsa.uiuc.edu
* Apr 17 2006
*
*-------------------------------------------------------------------------
@@ -1240,7 +1228,6 @@ done:
* Return: SUCCEED/FAIL
*
* Programmer: Quincey Koziol
- * koziol@hdfgroup.org
* Aug 17 2006
*
*-------------------------------------------------------------------------
@@ -1285,24 +1272,23 @@ done:
} /* end H5HF__man_iblock_unprotect() */
/*-------------------------------------------------------------------------
- * Function: H5HF_man_iblock_attach
+ * Function: H5HF__man_iblock_attach
*
* Purpose: Attach a child block (direct or indirect) to an indirect block
*
* Return: SUCCEED/FAIL
*
* Programmer: Quincey Koziol
- * koziol@ncsa.uiuc.edu
* May 30 2006
*
*-------------------------------------------------------------------------
*/
herr_t
-H5HF_man_iblock_attach(H5HF_indirect_t *iblock, unsigned entry, haddr_t child_addr)
+H5HF__man_iblock_attach(H5HF_indirect_t *iblock, unsigned entry, haddr_t child_addr)
{
herr_t ret_value = SUCCEED; /* Return value */
- FUNC_ENTER_NOAPI_NOINIT
+ FUNC_ENTER_PACKAGE
/*
* Check arguments.
@@ -1312,7 +1298,7 @@ H5HF_man_iblock_attach(H5HF_indirect_t *iblock, unsigned entry, haddr_t child_ad
HDassert(!H5F_addr_defined(iblock->ents[entry].addr));
/* Increment the reference count on this indirect block */
- if (H5HF_iblock_incr(iblock) < 0)
+ if (H5HF__iblock_incr(iblock) < 0)
HGOTO_ERROR(H5E_HEAP, H5E_CANTINC, FAIL, "can't increment reference count on shared indirect block")
/* Point at the child block */
@@ -1341,12 +1327,12 @@ H5HF_man_iblock_attach(H5HF_indirect_t *iblock, unsigned entry, haddr_t child_ad
iblock->nchildren++;
/* Mark indirect block as modified */
- if (H5HF_iblock_dirty(iblock) < 0)
+ if (H5HF__iblock_dirty(iblock) < 0)
HGOTO_ERROR(H5E_HEAP, H5E_CANTDIRTY, FAIL, "can't mark indirect block as dirty")
done:
FUNC_LEAVE_NOAPI(ret_value)
-} /* end H5HF_man_iblock_attach() */
+} /* end H5HF__man_iblock_attach() */
/*-------------------------------------------------------------------------
* Function: H5HF__man_iblock_detach
@@ -1356,7 +1342,6 @@ done:
* Return: SUCCEED/FAIL
*
* Programmer: Quincey Koziol
- * koziol@ncsa.uiuc.edu
* May 31 2006
*
*-------------------------------------------------------------------------
@@ -1464,7 +1449,7 @@ H5HF__man_iblock_detach(H5HF_indirect_t *iblock, unsigned entry)
/* If the indirect block wasn't removed already (by reverting it) */
if (!iblock->removed_from_cache) {
/* Mark indirect block as modified */
- if (H5HF_iblock_dirty(iblock) < 0)
+ if (H5HF__iblock_dirty(iblock) < 0)
HGOTO_ERROR(H5E_HEAP, H5E_CANTDIRTY, FAIL, "can't mark indirect block as dirty")
/* Check for last child being removed from indirect block */
@@ -1567,22 +1552,21 @@ done:
} /* end H5HF__man_iblock_detach() */
/*-------------------------------------------------------------------------
- * Function: H5HF_man_iblock_entry_addr
+ * Function: H5HF__man_iblock_entry_addr
*
* Purpose: Retrieve the address of an indirect block's child
*
* Return: SUCCEED/FAIL
*
* Programmer: Quincey Koziol
- * koziol@ncsa.uiuc.edu
* July 10 2006
*
*-------------------------------------------------------------------------
*/
herr_t
-H5HF_man_iblock_entry_addr(H5HF_indirect_t *iblock, unsigned entry, haddr_t *child_addr)
+H5HF__man_iblock_entry_addr(H5HF_indirect_t *iblock, unsigned entry, haddr_t *child_addr)
{
- FUNC_ENTER_NOAPI_NOINIT_NOERR
+ FUNC_ENTER_PACKAGE_NOERR
/*
* Check arguments.
@@ -1594,7 +1578,7 @@ H5HF_man_iblock_entry_addr(H5HF_indirect_t *iblock, unsigned entry, haddr_t *chi
*child_addr = iblock->ents[entry].addr;
FUNC_LEAVE_NOAPI(SUCCEED)
-} /* end H5HF_man_iblock_entry_addr() */
+} /* end H5HF__man_iblock_entry_addr() */
/*-------------------------------------------------------------------------
* Function: H5HF__man_iblock_delete
@@ -1608,7 +1592,6 @@ H5HF_man_iblock_entry_addr(H5HF_indirect_t *iblock, unsigned entry, haddr_t *chi
* Return: SUCCEED/FAIL
*
* Programmer: Quincey Koziol
- * koziol@hdfgroup.org
* Aug 7 2006
*
*-------------------------------------------------------------------------
@@ -1670,7 +1653,7 @@ H5HF__man_iblock_delete(H5HF_hdr_t *hdr, haddr_t iblock_addr, unsigned iblock_nr
row_block_size = (hsize_t)hdr->man_dtable.row_block_size[row];
/* Compute # of rows in next child indirect block to use */
- child_nrows = H5HF_dtable_size_to_rows(&hdr->man_dtable, row_block_size);
+ child_nrows = H5HF__dtable_size_to_rows(&hdr->man_dtable, row_block_size);
/* Delete child indirect block */
if (H5HF__man_iblock_delete(hdr, iblock->ents[entry].addr, child_nrows, iblock, entry) <
@@ -1796,7 +1779,6 @@ done:
* Return: Non-negative on success / Negative on failure
*
* Programmer: Quincey Koziol
- * koziol@lbl.gov
* Jan 14 2018
*
*-------------------------------------------------------------------------
@@ -1821,7 +1803,7 @@ H5HF__man_iblock_parent_info(const H5HF_hdr_t *hdr, hsize_t block_off, hsize_t *
HDassert(ret_entry);
/* Look up row & column for object */
- if (H5HF_dtable_lookup(&hdr->man_dtable, block_off, &row, &col) < 0)
+ if (H5HF__dtable_lookup(&hdr->man_dtable, block_off, &row, &col) < 0)
HGOTO_ERROR(H5E_HEAP, H5E_CANTCOMPUTE, FAIL, "can't compute row & column of block")
/* Sanity check - first lookup must be an indirect block */
@@ -1845,7 +1827,7 @@ H5HF__man_iblock_parent_info(const H5HF_hdr_t *hdr, hsize_t block_off, hsize_t *
prev_col = col;
/* Look up row & column in new indirect block for object */
- if (H5HF_dtable_lookup(&hdr->man_dtable, (block_off - par_block_off), &row, &col) < 0)
+ if (H5HF__dtable_lookup(&hdr->man_dtable, (block_off - par_block_off), &row, &col) < 0)
HGOTO_ERROR(H5E_HEAP, H5E_CANTCOMPUTE, FAIL, "can't compute row & column of block")
} /* end while */
@@ -1862,24 +1844,23 @@ done:
} /* end H5HF__man_iblock_par_info() */
/*-------------------------------------------------------------------------
- * Function: H5HF_man_iblock_dest
+ * Function: H5HF__man_iblock_dest
*
* Purpose: Destroys a fractal heap indirect block in memory.
*
* Return: Non-negative on success/Negative on failure
*
* Programmer: Quincey Koziol
- * koziol@ncsa.uiuc.edu
* Mar 6 2006
*
*-------------------------------------------------------------------------
*/
herr_t
-H5HF_man_iblock_dest(H5HF_indirect_t *iblock)
+H5HF__man_iblock_dest(H5HF_indirect_t *iblock)
{
herr_t ret_value = SUCCEED; /* Return value */
- FUNC_ENTER_NOAPI_NOINIT
+ FUNC_ENTER_PACKAGE
/*
* Check arguments.
@@ -1889,7 +1870,7 @@ H5HF_man_iblock_dest(H5HF_indirect_t *iblock)
/* Decrement reference count on shared info */
HDassert(iblock->hdr);
- if (H5HF_hdr_decr(iblock->hdr) < 0)
+ if (H5HF__hdr_decr(iblock->hdr) < 0)
HGOTO_ERROR(H5E_HEAP, H5E_CANTDEC, FAIL, "can't decrement reference count on shared heap header")
if (iblock->parent)
if (H5HF__iblock_decr(iblock->parent) < 0)
@@ -1909,4 +1890,4 @@ H5HF_man_iblock_dest(H5HF_indirect_t *iblock)
done:
FUNC_LEAVE_NOAPI(ret_value)
-} /* end H5HF_man_iblock_dest() */
+} /* end H5HF__man_iblock_dest() */
diff --git a/src/H5HFiter.c b/src/H5HFiter.c
index 810d489..673c543 100644
--- a/src/H5HFiter.c
+++ b/src/H5HFiter.c
@@ -15,7 +15,7 @@
*
* Created: H5HFiter.c
* Apr 24 2006
- * Quincey Koziol <koziol@ncsa.uiuc.edu>
+ * Quincey Koziol
*
* Purpose: Block iteration routines for fractal heaps.
*
@@ -68,7 +68,7 @@
H5FL_DEFINE(H5HF_block_loc_t);
/*-------------------------------------------------------------------------
- * Function: H5HF_man_iter_init
+ * Function: H5HF__man_iter_init
*
* Purpose: Initialize a block iterator for walking over all the blocks
* in a fractal heap. (initialization finishes when iterator is
@@ -77,15 +77,14 @@ H5FL_DEFINE(H5HF_block_loc_t);
* Return: SUCCEED/FAIL
*
* Programmer: Quincey Koziol
- * koziol@ncsa.uiuc.edu
* Apr 24 2006
*
*-------------------------------------------------------------------------
*/
herr_t
-H5HF_man_iter_init(H5HF_block_iter_t *biter)
+H5HF__man_iter_init(H5HF_block_iter_t *biter)
{
- FUNC_ENTER_NOAPI_NOINIT_NOERR
+ FUNC_ENTER_PACKAGE_NOERR
/*
* Check arguments.
@@ -96,7 +95,7 @@ H5HF_man_iter_init(H5HF_block_iter_t *biter)
HDmemset(biter, 0, sizeof(H5HF_block_iter_t));
FUNC_LEAVE_NOAPI(SUCCEED)
-} /* end H5HF_man_iter_init() */
+} /* end H5HF__man_iter_init() */
/*-------------------------------------------------------------------------
* Function: H5HF__man_iter_start_offset
@@ -107,7 +106,6 @@ H5HF_man_iter_init(H5HF_block_iter_t *biter)
* Return: SUCCEED/FAIL
*
* Programmer: Quincey Koziol
- * koziol@ncsa.uiuc.edu
* Apr 24 2006
*
*-------------------------------------------------------------------------
@@ -215,7 +213,7 @@ H5HF__man_iter_start_offset(H5HF_hdr_t *hdr, H5HF_block_iter_t *biter, hsize_t o
biter->curr->context = iblock;
/* Hold the indirect block with the location */
- if (H5HF_iblock_incr(biter->curr->context) < 0)
+ if (H5HF__iblock_incr(biter->curr->context) < 0)
HGOTO_ERROR(H5E_HEAP, H5E_CANTINC, FAIL,
"can't increment reference count on shared indirect block")
@@ -259,22 +257,21 @@ done:
} /* end H5HF__man_iter_start_offset() */
/*-------------------------------------------------------------------------
- * Function: H5HF_man_iter_set_entry
+ * Function: H5HF__man_iter_set_entry
*
* Purpose: Set the current entry for the iterator
*
* Return: SUCCEED/FAIL
*
* Programmer: Quincey Koziol
- * koziol@ncsa.uiuc.edu
* May 31 2006
*
*-------------------------------------------------------------------------
*/
herr_t
-H5HF_man_iter_set_entry(const H5HF_hdr_t *hdr, H5HF_block_iter_t *biter, unsigned entry)
+H5HF__man_iter_set_entry(const H5HF_hdr_t *hdr, H5HF_block_iter_t *biter, unsigned entry)
{
- FUNC_ENTER_NOAPI_NOINIT_NOERR
+ FUNC_ENTER_PACKAGE_NOERR
/*
* Check arguments.
@@ -287,10 +284,10 @@ H5HF_man_iter_set_entry(const H5HF_hdr_t *hdr, H5HF_block_iter_t *biter, unsigne
biter->curr->col = entry % hdr->man_dtable.cparam.width;
FUNC_LEAVE_NOAPI(SUCCEED)
-} /* end H5HF_man_iter_set_entry() */
+} /* end H5HF__man_iter_set_entry() */
/*-------------------------------------------------------------------------
- * Function: H5HF_man_iter_start_entry
+ * Function: H5HF__man_iter_start_entry
*
* Purpose: Initialize a block iterator to a particular location within
* an indirect block
@@ -298,19 +295,18 @@ H5HF_man_iter_set_entry(const H5HF_hdr_t *hdr, H5HF_block_iter_t *biter, unsigne
* Return: SUCCEED/FAIL
*
* Programmer: Quincey Koziol
- * koziol@ncsa.uiuc.edu
* Apr 24 2006
*
*-------------------------------------------------------------------------
*/
herr_t
-H5HF_man_iter_start_entry(H5HF_hdr_t *hdr, H5HF_block_iter_t *biter, H5HF_indirect_t *iblock,
- unsigned start_entry)
+H5HF__man_iter_start_entry(H5HF_hdr_t *hdr, H5HF_block_iter_t *biter, H5HF_indirect_t *iblock,
+ unsigned start_entry)
{
H5HF_block_loc_t *new_loc = NULL; /* Pointer to new block location */
herr_t ret_value = SUCCEED; /* Return value */
- FUNC_ENTER_NOAPI_NOINIT
+ FUNC_ENTER_PACKAGE
/*
* Check arguments.
@@ -333,7 +329,7 @@ H5HF_man_iter_start_entry(H5HF_hdr_t *hdr, H5HF_block_iter_t *biter, H5HF_indire
new_loc->up = NULL;
/* Increment reference count on indirect block */
- if (H5HF_iblock_incr(new_loc->context) < 0)
+ if (H5HF__iblock_incr(new_loc->context) < 0)
HGOTO_ERROR(H5E_HEAP, H5E_CANTINC, FAIL, "can't increment reference count on shared indirect block")
/* Make new location the current location */
@@ -347,10 +343,10 @@ done:
new_loc = H5FL_FREE(H5HF_block_loc_t, new_loc);
FUNC_LEAVE_NOAPI(ret_value)
-} /* end H5HF_man_iter_start_entry() */
+} /* end H5HF__man_iter_start_entry() */
/*-------------------------------------------------------------------------
- * Function: H5HF_man_iter_reset
+ * Function: H5HF__man_iter_reset
*
* Purpose: Reset a block iterator to it's initial state, freeing any
* location context it currently has
@@ -358,17 +354,16 @@ done:
* Return: SUCCEED/FAIL
*
* Programmer: Quincey Koziol
- * koziol@ncsa.uiuc.edu
* Apr 24 2006
*
*-------------------------------------------------------------------------
*/
herr_t
-H5HF_man_iter_reset(H5HF_block_iter_t *biter)
+H5HF__man_iter_reset(H5HF_block_iter_t *biter)
{
herr_t ret_value = SUCCEED; /* Return value */
- FUNC_ENTER_NOAPI_NOINIT
+ FUNC_ENTER_PACKAGE
/*
* Check arguments.
@@ -408,25 +403,24 @@ H5HF_man_iter_reset(H5HF_block_iter_t *biter)
done:
FUNC_LEAVE_NOAPI(ret_value)
-} /* end H5HF_man_iter_reset() */
+} /* end H5HF__man_iter_reset() */
/*-------------------------------------------------------------------------
- * Function: H5HF_man_iter_next
+ * Function: H5HF__man_iter_next
*
* Purpose: Advance to the next block within the current block of the heap
*
* Return: SUCCEED/FAIL
*
* Programmer: Quincey Koziol
- * koziol@ncsa.uiuc.edu
* Apr 24 2006
*
*-------------------------------------------------------------------------
*/
herr_t
-H5HF_man_iter_next(H5HF_hdr_t *hdr, H5HF_block_iter_t *biter, unsigned nentries)
+H5HF__man_iter_next(H5HF_hdr_t *hdr, H5HF_block_iter_t *biter, unsigned nentries)
{
- FUNC_ENTER_NOAPI_NOINIT_NOERR
+ FUNC_ENTER_PACKAGE_NOERR
/*
* Check arguments.
@@ -443,28 +437,27 @@ H5HF_man_iter_next(H5HF_hdr_t *hdr, H5HF_block_iter_t *biter, unsigned nentries)
/* HDassert(biter->curr->row <= biter->curr->context->nrows); */
FUNC_LEAVE_NOAPI(SUCCEED)
-} /* end H5HF_man_iter_next() */
+} /* end H5HF__man_iter_next() */
/*-------------------------------------------------------------------------
- * Function: H5HF_man_iter_up
+ * Function: H5HF__man_iter_up
*
* Purpose: Move iterator up one level
*
* Return: SUCCEED/FAIL
*
* Programmer: Quincey Koziol
- * koziol@ncsa.uiuc.edu
* Apr 24 2006
*
*-------------------------------------------------------------------------
*/
herr_t
-H5HF_man_iter_up(H5HF_block_iter_t *biter)
+H5HF__man_iter_up(H5HF_block_iter_t *biter)
{
H5HF_block_loc_t *up_loc; /* Pointer to 'up' block location */
herr_t ret_value = SUCCEED; /* Return value */
- FUNC_ENTER_NOAPI_NOINIT
+ FUNC_ENTER_PACKAGE
/*
* Check arguments.
@@ -490,28 +483,27 @@ H5HF_man_iter_up(H5HF_block_iter_t *biter)
done:
FUNC_LEAVE_NOAPI(ret_value)
-} /* end H5HF_man_iter_up() */
+} /* end H5HF__man_iter_up() */
/*-------------------------------------------------------------------------
- * Function: H5HF_man_iter_down
+ * Function: H5HF__man_iter_down
*
* Purpose: Move iterator down one level
*
* Return: SUCCEED/FAIL
*
* Programmer: Quincey Koziol
- * koziol@ncsa.uiuc.edu
* Apr 24 2006
*
*-------------------------------------------------------------------------
*/
herr_t
-H5HF_man_iter_down(H5HF_block_iter_t *biter, H5HF_indirect_t *iblock)
+H5HF__man_iter_down(H5HF_block_iter_t *biter, H5HF_indirect_t *iblock)
{
H5HF_block_loc_t *down_loc = NULL; /* Pointer to new 'down' block location */
herr_t ret_value = SUCCEED; /* Return value */
- FUNC_ENTER_NOAPI_NOINIT
+ FUNC_ENTER_PACKAGE
/*
* Check arguments.
@@ -534,7 +526,7 @@ H5HF_man_iter_down(H5HF_block_iter_t *biter, H5HF_indirect_t *iblock)
down_loc->up = biter->curr;
/* Increment reference count on indirect block */
- if (H5HF_iblock_incr(down_loc->context) < 0)
+ if (H5HF__iblock_incr(down_loc->context) < 0)
HGOTO_ERROR(H5E_HEAP, H5E_CANTINC, FAIL, "can't increment reference count on shared indirect block")
/* Make down location the current location */
@@ -545,26 +537,25 @@ done:
down_loc = H5FL_FREE(H5HF_block_loc_t, down_loc);
FUNC_LEAVE_NOAPI(ret_value)
-} /* end H5HF_man_iter_down() */
+} /* end H5HF__man_iter_down() */
/*-------------------------------------------------------------------------
- * Function: H5HF_man_iter_curr
+ * Function: H5HF__man_iter_curr
*
* Purpose: Retrieve information about the current block iterator location
*
* Return: SUCCEED/FAIL
*
* Programmer: Quincey Koziol
- * koziol@ncsa.uiuc.edu
* Apr 24 2006
*
*-------------------------------------------------------------------------
*/
herr_t
-H5HF_man_iter_curr(H5HF_block_iter_t *biter, unsigned *row, unsigned *col, unsigned *entry,
- H5HF_indirect_t **block)
+H5HF__man_iter_curr(H5HF_block_iter_t *biter, unsigned *row, unsigned *col, unsigned *entry,
+ H5HF_indirect_t **block)
{
- FUNC_ENTER_NOAPI_NOINIT_NOERR
+ FUNC_ENTER_PACKAGE_NOERR
/*
* Check arguments.
@@ -583,64 +574,24 @@ H5HF_man_iter_curr(H5HF_block_iter_t *biter, unsigned *row, unsigned *col, unsig
*block = biter->curr->context;
FUNC_LEAVE_NOAPI(SUCCEED)
-} /* end H5HF_man_iter_curr() */
-
-/*-------------------------------------------------------------------------
- * Function: H5HF_man_iter_offset
- *
- * Purpose: Retrieve offset of iterator in heap
- *
- * Return: SUCCEED/FAIL
- *
- * Programmer: Quincey Koziol
- * koziol@ncsa.uiuc.edu
- * Apr 25 2006
- *
- *-------------------------------------------------------------------------
- */
-herr_t
-H5HF_man_iter_offset(H5HF_hdr_t *hdr, H5HF_block_iter_t *biter, hsize_t *offset)
-{
- hsize_t curr_offset; /* For computing offset in heap */
-
- FUNC_ENTER_NOAPI_NOINIT_NOERR
-
- /*
- * Check arguments.
- */
- HDassert(biter);
- HDassert(biter->ready);
- HDassert(biter->curr->context);
- HDassert(offset);
-
- /* Compute the offset in the heap */
- curr_offset = biter->curr->context->block_off;
- curr_offset += hdr->man_dtable.row_block_off[biter->curr->row];
- curr_offset += biter->curr->col * hdr->man_dtable.row_block_size[biter->curr->row];
-
- /* Assign the return value */
- *offset = curr_offset;
-
- FUNC_LEAVE_NOAPI(SUCCEED)
-} /* end H5HF_man_iter_offset() */
+} /* end H5HF__man_iter_curr() */
/*-------------------------------------------------------------------------
- * Function: H5HF_man_iter_ready
+ * Function: H5HF__man_iter_ready
*
* Purpose: Query if iterator is ready to use
*
* Return: SUCCEED/FAIL
*
* Programmer: Quincey Koziol
- * koziol@ncsa.uiuc.edu
* Apr 25 2006
*
*-------------------------------------------------------------------------
*/
hbool_t
-H5HF_man_iter_ready(H5HF_block_iter_t *biter)
+H5HF__man_iter_ready(H5HF_block_iter_t *biter)
{
- FUNC_ENTER_NOAPI_NOINIT_NOERR
+ FUNC_ENTER_PACKAGE_NOERR
/*
* Check arguments.
@@ -648,4 +599,4 @@ H5HF_man_iter_ready(H5HF_block_iter_t *biter)
HDassert(biter);
FUNC_LEAVE_NOAPI(biter->ready)
-} /* end H5HF_man_iter_ready() */
+} /* end H5HF__man_iter_ready() */
diff --git a/src/H5HFman.c b/src/H5HFman.c
index e323d51..427be00 100644
--- a/src/H5HFman.c
+++ b/src/H5HFman.c
@@ -15,7 +15,7 @@
*
* Created: H5HFman.c
* Feb 24 2006
- * Quincey Koziol <koziol@ncsa.uiuc.edu>
+ * Quincey Koziol
*
* Purpose: "Managed" object routines for fractal heaps.
*
@@ -89,7 +89,6 @@ static herr_t H5HF__man_op_real(H5HF_hdr_t *hdr, const uint8_t *id, H5HF_operato
* Return: SUCCEED/FAIL
*
* Programmer: Quincey Koziol
- * koziol@ncsa.uiuc.edu
* Mar 13 2006
*
*-------------------------------------------------------------------------
@@ -146,7 +145,7 @@ H5HF__man_insert(H5HF_hdr_t *hdr, size_t obj_size, const void *obj, void *_id)
HDassert(sec_node->sect_info.state == H5FS_SECT_LIVE);
/* Retrieve direct block address from section */
- if (H5HF_sect_single_dblock_info(hdr, sec_node, &dblock_addr, &dblock_size) < 0)
+ if (H5HF__sect_single_dblock_info(hdr, sec_node, &dblock_addr, &dblock_size) < 0)
HGOTO_ERROR(H5E_HEAP, H5E_CANTGET, FAIL, "can't retrieve direct block information")
/* Lock direct block */
@@ -190,7 +189,7 @@ H5HF__man_insert(H5HF_hdr_t *hdr, size_t obj_size, const void *obj, void *_id)
hdr->man_nobjs++;
/* Reduce space available in heap (marks header dirty) */
- if (H5HF_hdr_adj_free(hdr, -(ssize_t)obj_size) < 0)
+ if (H5HF__hdr_adj_free(hdr, -(ssize_t)obj_size) < 0)
HGOTO_ERROR(H5E_HEAP, H5E_CANTDEC, FAIL, "can't adjust free space for heap")
done:
@@ -207,22 +206,22 @@ done:
} /* end H5HF__man_insert() */
/*-------------------------------------------------------------------------
- * Function: H5HF_man_get_obj_len
+ * Function: H5HF__man_get_obj_len
*
* Purpose: Get the size of a managed heap object
*
* Return: SUCCEED (Can't fail)
*
- * Programmer: Dana Robinson (derobins@hdfgroup.org)
+ * Programmer: Dana Robinson
* August 2012
*
*-------------------------------------------------------------------------
*/
herr_t
-H5HF_man_get_obj_len(H5HF_hdr_t *hdr, const uint8_t *id, size_t *obj_len_p)
+H5HF__man_get_obj_len(H5HF_hdr_t *hdr, const uint8_t *id, size_t *obj_len_p)
{
- FUNC_ENTER_NOAPI_NOINIT_NOERR
+ FUNC_ENTER_PACKAGE_NOERR
/*
* Check arguments.
@@ -241,7 +240,7 @@ H5HF_man_get_obj_len(H5HF_hdr_t *hdr, const uint8_t *id, size_t *obj_len_p)
UINT64DECODE_VAR(id, *obj_len_p, hdr->heap_len_size);
FUNC_LEAVE_NOAPI(SUCCEED)
-} /* end H5HF_man_get_obj_len() */
+} /* end H5HF__man_get_obj_len() */
/*-------------------------------------------------------------------------
* Function: H5HF__man_get_obj_off
@@ -251,7 +250,6 @@ H5HF_man_get_obj_len(H5HF_hdr_t *hdr, const uint8_t *id, size_t *obj_len_p)
* Return: SUCCEED (Can't fail)
*
* Programmer: Quincey Koziol
- * koziol@hdfgroup.org
* Aug 20 2015
*
*-------------------------------------------------------------------------
@@ -286,7 +284,6 @@ H5HF__man_get_obj_off(const H5HF_hdr_t *hdr, const uint8_t *id, hsize_t *obj_off
* Return: SUCCEED/FAIL
*
* Programmer: Quincey Koziol
- * koziol@ncsa.uiuc.edu
* Mar 17 2006
*
*-------------------------------------------------------------------------
@@ -300,9 +297,9 @@ H5HF__man_op_real(H5HF_hdr_t *hdr, const uint8_t *id, H5HF_operator_t op, void *
* H5AC__NO_FLAGS_SET or
* H5AC__READ_ONLY_FLAG
*/
- haddr_t dblock_addr; /* Direct block address */
+ haddr_t dblock_addr = HADDR_UNDEF; /* Direct block address */
size_t dblock_size; /* Direct block size */
- unsigned dblock_cache_flags; /* Flags for unprotecting direct block */
+ unsigned dblock_cache_flags = 0; /* Flags for unprotecting direct block */
hsize_t obj_off; /* Object's offset in heap */
size_t obj_len; /* Object's length in heap */
size_t blk_off; /* Offset of object in block */
@@ -438,7 +435,6 @@ done:
* Return: SUCCEED/FAIL
*
* Programmer: Quincey Koziol
- * koziol@ncsa.uiuc.edu
* Mar 17 2006
*
*-------------------------------------------------------------------------
@@ -458,7 +454,7 @@ H5HF__man_read(H5HF_hdr_t *hdr, const uint8_t *id, void *obj)
HDassert(obj);
/* Call the internal 'op' routine routine */
- if (H5HF__man_op_real(hdr, id, H5HF_op_read, obj, 0) < 0)
+ if (H5HF__man_op_real(hdr, id, H5HF__op_read, obj, 0) < 0)
HGOTO_ERROR(H5E_HEAP, H5E_CANTOPERATE, FAIL, "unable to operate on heap object")
done:
@@ -473,7 +469,6 @@ done:
* Return: SUCCEED/FAIL
*
* Programmer: Quincey Koziol
- * koziol@hdfgroup.org
* Dec 18 2006
*
*-------------------------------------------------------------------------
@@ -494,7 +489,7 @@ H5HF__man_write(H5HF_hdr_t *hdr, const uint8_t *id, const void *obj)
/* Call the internal 'op' routine routine */
/* (Casting away const OK - QAK) */
- if (H5HF__man_op_real(hdr, id, H5HF_op_write, (void *)obj, H5HF_OP_MODIFY) < 0)
+ if (H5HF__man_op_real(hdr, id, H5HF__op_write, (void *)obj, H5HF_OP_MODIFY) < 0)
HGOTO_ERROR(H5E_HEAP, H5E_CANTOPERATE, FAIL, "unable to operate on heap object")
done:
@@ -509,7 +504,6 @@ done:
* Return: SUCCEED/FAIL
*
* Programmer: Quincey Koziol
- * koziol@ncsa.uiuc.edu
* Sept 11 2006
*
*-------------------------------------------------------------------------
@@ -544,7 +538,6 @@ done:
* Return: SUCCEED/FAIL
*
* Programmer: Quincey Koziol
- * koziol@ncsa.uiuc.edu
* May 15 2006
*
*-------------------------------------------------------------------------
@@ -552,9 +545,9 @@ done:
herr_t
H5HF__man_remove(H5HF_hdr_t *hdr, const uint8_t *id)
{
- H5HF_free_section_t *sec_node = NULL; /* Pointer to free space section for block */
- H5HF_indirect_t * iblock = NULL; /* Pointer to indirect block */
- hbool_t did_protect; /* Whether we protected the indirect block or not */
+ H5HF_free_section_t *sec_node = NULL; /* Pointer to free space section for block */
+ H5HF_indirect_t * iblock = NULL; /* Pointer to indirect block */
+ hbool_t did_protect = FALSE; /* Whether we protected the indirect block or not */
hsize_t obj_off; /* Object's offset in heap */
size_t obj_len; /* Object's length in heap */
size_t dblock_size; /* Direct block size */
@@ -636,7 +629,7 @@ H5HF__man_remove(H5HF_hdr_t *hdr, const uint8_t *id)
HGOTO_ERROR(H5E_HEAP, H5E_BADRANGE, FAIL, "object overruns end of direct block")
/* Create free space section node */
- if (NULL == (sec_node = H5HF_sect_single_new(obj_off, obj_len, iblock, dblock_entry)))
+ if (NULL == (sec_node = H5HF__sect_single_new(obj_off, obj_len, iblock, dblock_entry)))
HGOTO_ERROR(H5E_HEAP, H5E_CANTINIT, FAIL, "can't create section for direct block's free space")
/* Unlock indirect block */
@@ -647,7 +640,7 @@ H5HF__man_remove(H5HF_hdr_t *hdr, const uint8_t *id)
} /* end if */
/* Increase space available in heap (marks header dirty) */
- if (H5HF_hdr_adj_free(hdr, (ssize_t)obj_len) < 0)
+ if (H5HF__hdr_adj_free(hdr, (ssize_t)obj_len) < 0)
HGOTO_ERROR(H5E_HEAP, H5E_CANTDEC, FAIL, "can't adjust free space for heap")
/* Update statistics about heap */
diff --git a/src/H5HFpkg.h b/src/H5HFpkg.h
index a18d101..893a65d 100644
--- a/src/H5HFpkg.h
+++ b/src/H5HFpkg.h
@@ -221,9 +221,6 @@ typedef struct H5HF_dtable_t {
/* Fractal heap free list info (forward decl - defined in H5HFflist.c) */
typedef struct H5HF_freelist_t H5HF_freelist_t;
-/* Forward decl indirect block info */
-typedef struct H5HF_indirect_t H5HF_indirect_t;
-
/* Fractal heap block location */
typedef struct H5HF_block_loc_t {
/* Necessary table fields */
@@ -296,7 +293,7 @@ typedef struct H5HF_free_section_t {
/* (Each fractal heap header has certain information that is shared across all
* the instances of blocks in that fractal heap)
*/
-typedef struct H5HF_hdr_t {
+struct H5HF_hdr_t {
/* Information for H5AC cache functions, _must_ be first field in structure */
H5AC_info_t cache_info;
@@ -363,7 +360,7 @@ typedef struct H5HF_hdr_t {
uint8_t heap_off_size; /* Size of heap offsets (in bytes) */
uint8_t heap_len_size; /* Size of heap ID lengths (in bytes) */
hbool_t checked_filters; /* TRUE if pipeline passes can_apply checks */
-} H5HF_hdr_t;
+};
/* Common indirect block doubling table entry */
/* (common between entries pointing to direct & indirect child blocks) */
@@ -609,46 +606,45 @@ H5FL_BLK_EXTERN(direct_block);
/******************************/
/* Doubling table routines */
-H5_DLL herr_t H5HF_dtable_init(H5HF_dtable_t *dtable);
-H5_DLL herr_t H5HF_dtable_dest(H5HF_dtable_t *dtable);
-H5_DLL herr_t H5HF_dtable_lookup(const H5HF_dtable_t *dtable, hsize_t off, unsigned *row, unsigned *col);
-H5_DLL unsigned H5HF_dtable_size_to_row(const H5HF_dtable_t *dtable, size_t block_size);
-H5_DLL unsigned H5HF_dtable_size_to_rows(const H5HF_dtable_t *dtable, hsize_t size);
-H5_DLL hsize_t H5HF_dtable_span_size(const H5HF_dtable_t *dtable, unsigned start_row, unsigned start_col,
- unsigned num_entries);
+H5_DLL herr_t H5HF__dtable_init(H5HF_dtable_t *dtable);
+H5_DLL herr_t H5HF__dtable_dest(H5HF_dtable_t *dtable);
+H5_DLL herr_t H5HF__dtable_lookup(const H5HF_dtable_t *dtable, hsize_t off, unsigned *row, unsigned *col);
+H5_DLL unsigned H5HF__dtable_size_to_row(const H5HF_dtable_t *dtable, size_t block_size);
+H5_DLL unsigned H5HF__dtable_size_to_rows(const H5HF_dtable_t *dtable, hsize_t size);
+H5_DLL hsize_t H5HF__dtable_span_size(const H5HF_dtable_t *dtable, unsigned start_row, unsigned start_col,
+ unsigned num_entries);
/* Heap header routines */
-H5_DLL H5HF_hdr_t *H5HF_hdr_alloc(H5F_t *f);
-H5_DLL haddr_t H5HF_hdr_create(H5F_t *f, const H5HF_create_t *cparam);
+H5_DLL H5HF_hdr_t *H5HF__hdr_alloc(H5F_t *f);
+H5_DLL haddr_t H5HF__hdr_create(H5F_t *f, const H5HF_create_t *cparam);
H5_DLL H5HF_hdr_t *H5HF__hdr_protect(H5F_t *f, haddr_t addr, unsigned flags);
-H5_DLL herr_t H5HF_hdr_finish_init_phase1(H5HF_hdr_t *hdr);
-H5_DLL herr_t H5HF_hdr_finish_init_phase2(H5HF_hdr_t *hdr);
-H5_DLL herr_t H5HF_hdr_finish_init(H5HF_hdr_t *hdr);
-H5_DLL herr_t H5HF_hdr_incr(H5HF_hdr_t *hdr);
-H5_DLL herr_t H5HF_hdr_decr(H5HF_hdr_t *hdr);
-H5_DLL herr_t H5HF_hdr_fuse_incr(H5HF_hdr_t *hdr);
-H5_DLL size_t H5HF_hdr_fuse_decr(H5HF_hdr_t *hdr);
-H5_DLL herr_t H5HF_hdr_dirty(H5HF_hdr_t *hdr);
-H5_DLL herr_t H5HF_hdr_adj_free(H5HF_hdr_t *hdr, ssize_t amt);
-H5_DLL herr_t H5HF_hdr_adjust_heap(H5HF_hdr_t *hdr, hsize_t new_size, hssize_t extra_free);
-H5_DLL herr_t H5HF_hdr_inc_alloc(H5HF_hdr_t *hdr, size_t alloc_size);
-H5_DLL herr_t H5HF_hdr_start_iter(H5HF_hdr_t *hdr, H5HF_indirect_t *iblock, hsize_t curr_off,
- unsigned curr_entry);
+H5_DLL herr_t H5HF__hdr_finish_init_phase1(H5HF_hdr_t *hdr);
+H5_DLL herr_t H5HF__hdr_finish_init_phase2(H5HF_hdr_t *hdr);
+H5_DLL herr_t H5HF__hdr_finish_init(H5HF_hdr_t *hdr);
+H5_DLL herr_t H5HF__hdr_incr(H5HF_hdr_t *hdr);
+H5_DLL herr_t H5HF__hdr_decr(H5HF_hdr_t *hdr);
+H5_DLL herr_t H5HF__hdr_fuse_incr(H5HF_hdr_t *hdr);
+H5_DLL size_t H5HF__hdr_fuse_decr(H5HF_hdr_t *hdr);
+H5_DLL herr_t H5HF__hdr_dirty(H5HF_hdr_t *hdr);
+H5_DLL herr_t H5HF__hdr_adj_free(H5HF_hdr_t *hdr, ssize_t amt);
+H5_DLL herr_t H5HF__hdr_adjust_heap(H5HF_hdr_t *hdr, hsize_t new_size, hssize_t extra_free);
+H5_DLL herr_t H5HF__hdr_inc_alloc(H5HF_hdr_t *hdr, size_t alloc_size);
+H5_DLL herr_t H5HF__hdr_start_iter(H5HF_hdr_t *hdr, H5HF_indirect_t *iblock, hsize_t curr_off,
+ unsigned curr_entry);
H5_DLL herr_t H5HF__hdr_skip_blocks(H5HF_hdr_t *hdr, H5HF_indirect_t *iblock, unsigned start_entry,
unsigned nentries);
H5_DLL herr_t H5HF__hdr_update_iter(H5HF_hdr_t *hdr, size_t min_dblock_size);
-H5_DLL herr_t H5HF_hdr_inc_iter(H5HF_hdr_t *hdr, hsize_t adv_size, unsigned nentries);
+H5_DLL herr_t H5HF__hdr_inc_iter(H5HF_hdr_t *hdr, hsize_t adv_size, unsigned nentries);
H5_DLL herr_t H5HF__hdr_reverse_iter(H5HF_hdr_t *hdr, haddr_t dblock_addr);
-H5_DLL herr_t H5HF_hdr_reset_iter(H5HF_hdr_t *hdr, hsize_t curr_off);
+H5_DLL herr_t H5HF__hdr_reset_iter(H5HF_hdr_t *hdr, hsize_t curr_off);
H5_DLL herr_t H5HF__hdr_empty(H5HF_hdr_t *hdr);
-H5_DLL herr_t H5HF_hdr_free(H5HF_hdr_t *hdr);
+H5_DLL herr_t H5HF__hdr_free(H5HF_hdr_t *hdr);
H5_DLL herr_t H5HF__hdr_delete(H5HF_hdr_t *hdr);
-H5_DLL herr_t H5HF_hdr_dest(H5HF_hdr_t *hdr);
/* Indirect block routines */
-H5_DLL herr_t H5HF_iblock_incr(H5HF_indirect_t *iblock);
+H5_DLL herr_t H5HF__iblock_incr(H5HF_indirect_t *iblock);
H5_DLL herr_t H5HF__iblock_decr(H5HF_indirect_t *iblock);
-H5_DLL herr_t H5HF_iblock_dirty(H5HF_indirect_t *iblock);
+H5_DLL herr_t H5HF__iblock_dirty(H5HF_indirect_t *iblock);
H5_DLL herr_t H5HF__man_iblock_root_create(H5HF_hdr_t *hdr, size_t min_dblock_size);
H5_DLL herr_t H5HF__man_iblock_root_double(H5HF_hdr_t *hdr, size_t min_dblock_size);
H5_DLL herr_t H5HF__man_iblock_alloc_row(H5HF_hdr_t *hdr, H5HF_free_section_t **sec_node);
@@ -658,9 +654,9 @@ H5_DLL H5HF_indirect_t *H5HF__man_iblock_protect(H5HF_hdr_t *hdr, haddr_t iblock
H5HF_indirect_t *par_iblock, unsigned par_entry,
hbool_t must_protect, unsigned flags, hbool_t *did_protect);
H5_DLL herr_t H5HF__man_iblock_unprotect(H5HF_indirect_t *iblock, unsigned cache_flags, hbool_t did_protect);
-H5_DLL herr_t H5HF_man_iblock_attach(H5HF_indirect_t *iblock, unsigned entry, haddr_t dblock_addr);
+H5_DLL herr_t H5HF__man_iblock_attach(H5HF_indirect_t *iblock, unsigned entry, haddr_t dblock_addr);
H5_DLL herr_t H5HF__man_iblock_detach(H5HF_indirect_t *iblock, unsigned entry);
-H5_DLL herr_t H5HF_man_iblock_entry_addr(H5HF_indirect_t *iblock, unsigned entry, haddr_t *child_addr);
+H5_DLL herr_t H5HF__man_iblock_entry_addr(H5HF_indirect_t *iblock, unsigned entry, haddr_t *child_addr);
H5_DLL herr_t H5HF__man_iblock_delete(H5HF_hdr_t *hdr, haddr_t iblock_addr, unsigned iblock_nrows,
H5HF_indirect_t *par_iblock, unsigned par_entry);
H5_DLL herr_t H5HF__man_iblock_size(H5F_t *f, H5HF_hdr_t *hdr, haddr_t iblock_addr, unsigned nrows,
@@ -668,7 +664,7 @@ H5_DLL herr_t H5HF__man_iblock_size(H5F_t *f, H5HF_hdr_t *hdr, haddr_t iblock_ad
hsize_t *heap_size /*out*/);
H5_DLL herr_t H5HF__man_iblock_parent_info(const H5HF_hdr_t *hdr, hsize_t block_off,
hsize_t *ret_par_block_off, unsigned *ret_entry);
-H5_DLL herr_t H5HF_man_iblock_dest(H5HF_indirect_t *iblock);
+H5_DLL herr_t H5HF__man_iblock_dest(H5HF_indirect_t *iblock);
/* Direct block routines */
H5_DLL herr_t H5HF__man_dblock_new(H5HF_hdr_t *fh, size_t request, H5HF_free_section_t **ret_sec_node);
@@ -682,11 +678,11 @@ H5_DLL H5HF_direct_t *H5HF__man_dblock_protect(H5HF_hdr_t *hdr, haddr_t dblock_a
H5_DLL herr_t H5HF__man_dblock_locate(H5HF_hdr_t *hdr, hsize_t obj_off, H5HF_indirect_t **par_iblock,
unsigned *par_entry, hbool_t *par_did_protect, unsigned flags);
H5_DLL herr_t H5HF__man_dblock_delete(H5F_t *f, haddr_t dblock_addr, hsize_t dblock_size);
-H5_DLL herr_t H5HF_man_dblock_dest(H5HF_direct_t *dblock);
+H5_DLL herr_t H5HF__man_dblock_dest(H5HF_direct_t *dblock);
/* Managed object routines */
H5_DLL herr_t H5HF__man_insert(H5HF_hdr_t *fh, size_t obj_size, const void *obj, void *id);
-H5_DLL herr_t H5HF_man_get_obj_len(H5HF_hdr_t *hdr, const uint8_t *id, size_t *obj_len_p);
+H5_DLL herr_t H5HF__man_get_obj_len(H5HF_hdr_t *hdr, const uint8_t *id, size_t *obj_len_p);
H5_DLL void H5HF__man_get_obj_off(const H5HF_hdr_t *hdr, const uint8_t *id, hsize_t *obj_off_p);
H5_DLL herr_t H5HF__man_read(H5HF_hdr_t *fh, const uint8_t *id, void *obj);
H5_DLL herr_t H5HF__man_write(H5HF_hdr_t *hdr, const uint8_t *id, const void *obj);
@@ -694,7 +690,7 @@ H5_DLL herr_t H5HF__man_op(H5HF_hdr_t *hdr, const uint8_t *id, H5HF_operator_t o
H5_DLL herr_t H5HF__man_remove(H5HF_hdr_t *hdr, const uint8_t *id);
/* 'Huge' object routines */
-H5_DLL herr_t H5HF_huge_init(H5HF_hdr_t *hdr);
+H5_DLL herr_t H5HF__huge_init(H5HF_hdr_t *hdr);
H5_DLL herr_t H5HF__huge_insert(H5HF_hdr_t *hdr, size_t obj_size, void *obj, void *id);
H5_DLL herr_t H5HF__huge_get_obj_len(H5HF_hdr_t *hdr, const uint8_t *id, size_t *obj_len_p);
H5_DLL herr_t H5HF__huge_get_obj_off(H5HF_hdr_t *hdr, const uint8_t *id, hsize_t *obj_off_p);
@@ -715,38 +711,26 @@ H5_DLL herr_t H5HF__huge_bt2_filt_dir_found(const void *nrecord, void *op_data);
H5_DLL herr_t H5HF__huge_bt2_filt_dir_remove(const void *nrecord, void *op_data);
/* 'Tiny' object routines */
-H5_DLL herr_t H5HF_tiny_init(H5HF_hdr_t *hdr);
-H5_DLL herr_t H5HF_tiny_insert(H5HF_hdr_t *hdr, size_t obj_size, const void *obj, void *id);
-H5_DLL herr_t H5HF_tiny_get_obj_len(H5HF_hdr_t *hdr, const uint8_t *id, size_t *obj_len_p);
-H5_DLL herr_t H5HF_tiny_read(H5HF_hdr_t *fh, const uint8_t *id, void *obj);
-H5_DLL herr_t H5HF_tiny_op(H5HF_hdr_t *hdr, const uint8_t *id, H5HF_operator_t op, void *op_data);
-H5_DLL herr_t H5HF_tiny_remove(H5HF_hdr_t *fh, const uint8_t *id);
-
-/* Debugging routines for dumping file structures */
-H5_DLL void H5HF_hdr_print(const H5HF_hdr_t *hdr, hbool_t dump_internal, FILE *stream, int indent,
- int fwidth);
-H5_DLL herr_t H5HF_hdr_debug(H5F_t *f, haddr_t addr, FILE *stream, int indent, int fwidth);
-H5_DLL herr_t H5HF_dblock_debug(H5F_t *f, haddr_t addr, FILE *stream, int indent, int fwidth,
- haddr_t hdr_addr, size_t nrec);
-H5_DLL void H5HF_iblock_print(const H5HF_indirect_t *iblock, hbool_t dump_internal, FILE *stream, int indent,
- int fwidth);
-H5_DLL herr_t H5HF_iblock_debug(H5F_t *f, haddr_t addr, FILE *stream, int indent, int fwidth,
- haddr_t hdr_addr, unsigned nrows);
+H5_DLL herr_t H5HF__tiny_init(H5HF_hdr_t *hdr);
+H5_DLL herr_t H5HF__tiny_insert(H5HF_hdr_t *hdr, size_t obj_size, const void *obj, void *id);
+H5_DLL herr_t H5HF__tiny_get_obj_len(H5HF_hdr_t *hdr, const uint8_t *id, size_t *obj_len_p);
+H5_DLL herr_t H5HF__tiny_read(H5HF_hdr_t *fh, const uint8_t *id, void *obj);
+H5_DLL herr_t H5HF__tiny_op(H5HF_hdr_t *hdr, const uint8_t *id, H5HF_operator_t op, void *op_data);
+H5_DLL herr_t H5HF__tiny_remove(H5HF_hdr_t *fh, const uint8_t *id);
/* Block iteration routines */
-H5_DLL herr_t H5HF_man_iter_init(H5HF_block_iter_t *biter);
+H5_DLL herr_t H5HF__man_iter_init(H5HF_block_iter_t *biter);
H5_DLL herr_t H5HF__man_iter_start_offset(H5HF_hdr_t *hdr, H5HF_block_iter_t *biter, hsize_t offset);
-H5_DLL herr_t H5HF_man_iter_start_entry(H5HF_hdr_t *hdr, H5HF_block_iter_t *biter, H5HF_indirect_t *iblock,
- unsigned start_entry);
-H5_DLL herr_t H5HF_man_iter_set_entry(const H5HF_hdr_t *hdr, H5HF_block_iter_t *biter, unsigned entry);
-H5_DLL herr_t H5HF_man_iter_next(H5HF_hdr_t *hdr, H5HF_block_iter_t *biter, unsigned nentries);
-H5_DLL herr_t H5HF_man_iter_up(H5HF_block_iter_t *biter);
-H5_DLL herr_t H5HF_man_iter_down(H5HF_block_iter_t *biter, H5HF_indirect_t *iblock);
-H5_DLL herr_t H5HF_man_iter_reset(H5HF_block_iter_t *biter);
-H5_DLL herr_t H5HF_man_iter_curr(H5HF_block_iter_t *biter, unsigned *row, unsigned *col, unsigned *entry,
- H5HF_indirect_t **block);
-H5_DLL herr_t H5HF_man_iter_offset(H5HF_hdr_t *hdr, H5HF_block_iter_t *biter, hsize_t *offset);
-H5_DLL hbool_t H5HF_man_iter_ready(H5HF_block_iter_t *biter);
+H5_DLL herr_t H5HF__man_iter_start_entry(H5HF_hdr_t *hdr, H5HF_block_iter_t *biter, H5HF_indirect_t *iblock,
+ unsigned start_entry);
+H5_DLL herr_t H5HF__man_iter_set_entry(const H5HF_hdr_t *hdr, H5HF_block_iter_t *biter, unsigned entry);
+H5_DLL herr_t H5HF__man_iter_next(H5HF_hdr_t *hdr, H5HF_block_iter_t *biter, unsigned nentries);
+H5_DLL herr_t H5HF__man_iter_up(H5HF_block_iter_t *biter);
+H5_DLL herr_t H5HF__man_iter_down(H5HF_block_iter_t *biter, H5HF_indirect_t *iblock);
+H5_DLL herr_t H5HF__man_iter_reset(H5HF_block_iter_t *biter);
+H5_DLL herr_t H5HF__man_iter_curr(H5HF_block_iter_t *biter, unsigned *row, unsigned *col, unsigned *entry,
+ H5HF_indirect_t **block);
+H5_DLL hbool_t H5HF__man_iter_ready(H5HF_block_iter_t *biter);
/* Free space manipulation routines */
H5_DLL herr_t H5HF__space_start(H5HF_hdr_t *hdr, hbool_t may_create);
@@ -761,22 +745,22 @@ H5_DLL herr_t H5HF__space_delete(H5HF_hdr_t *hdr);
H5_DLL herr_t H5HF__space_sect_change_class(H5HF_hdr_t *hdr, H5HF_free_section_t *sect, uint16_t new_class);
/* Free space section routines */
-H5_DLL H5HF_free_section_t *H5HF_sect_single_new(hsize_t sect_off, size_t sect_size, H5HF_indirect_t *parent,
- unsigned par_entry);
+H5_DLL H5HF_free_section_t *H5HF__sect_single_new(hsize_t sect_off, size_t sect_size, H5HF_indirect_t *parent,
+ unsigned par_entry);
H5_DLL herr_t H5HF__sect_single_revive(H5HF_hdr_t *hdr, H5HF_free_section_t *sect);
-H5_DLL herr_t H5HF_sect_single_dblock_info(H5HF_hdr_t *hdr, const H5HF_free_section_t *sect,
- haddr_t *dblock_addr, size_t *dblock_size);
+H5_DLL herr_t H5HF__sect_single_dblock_info(H5HF_hdr_t *hdr, const H5HF_free_section_t *sect,
+ haddr_t *dblock_addr, size_t *dblock_size);
H5_DLL herr_t H5HF__sect_single_reduce(H5HF_hdr_t *hdr, H5HF_free_section_t *sect, size_t amt);
H5_DLL herr_t H5HF__sect_row_revive(H5HF_hdr_t *hdr, H5HF_free_section_t *sect);
H5_DLL herr_t H5HF__sect_row_reduce(H5HF_hdr_t *hdr, H5HF_free_section_t *sect, unsigned *entry_p);
-H5_DLL H5HF_indirect_t *H5HF_sect_row_get_iblock(H5HF_free_section_t *sect);
+H5_DLL H5HF_indirect_t *H5HF__sect_row_get_iblock(H5HF_free_section_t *sect);
H5_DLL herr_t H5HF__sect_indirect_add(H5HF_hdr_t *hdr, H5HF_indirect_t *iblock, unsigned start_entry,
unsigned nentries);
H5_DLL herr_t H5HF__sect_single_free(H5FS_section_info_t *sect);
/* Internal operator callbacks */
-H5_DLL herr_t H5HF_op_read(const void *obj, size_t obj_len, void *op_data);
-H5_DLL herr_t H5HF_op_write(const void *obj, size_t obj_len, void *op_data);
+H5_DLL herr_t H5HF__op_read(const void *obj, size_t obj_len, void *op_data);
+H5_DLL herr_t H5HF__op_write(const void *obj, size_t obj_len, void *op_data);
/* Testing routines */
#ifdef H5HF_TESTING
diff --git a/src/H5HFprivate.h b/src/H5HFprivate.h
index ed7cddd..3263b4e 100644
--- a/src/H5HFprivate.h
+++ b/src/H5HFprivate.h
@@ -86,8 +86,10 @@ typedef struct H5HF_stat_t {
hsize_t tiny_nobjs; /* Number of 'tiny' objects in heap */
} H5HF_stat_t;
-/* Fractal heap info (forward decl - defined in H5HFpkg.h) */
-typedef struct H5HF_t H5HF_t;
+/* Fractal heap info (forward decls - defined in H5HFpkg.h) */
+typedef struct H5HF_t H5HF_t;
+typedef struct H5HF_hdr_t H5HF_hdr_t;
+typedef struct H5HF_indirect_t H5HF_indirect_t;
/* Typedef for 'op' operations */
typedef herr_t (*H5HF_operator_t)(const void *obj /*in*/, size_t obj_len, void *op_data /*in,out*/);
@@ -125,4 +127,15 @@ H5_DLL herr_t H5HF_id_print(H5HF_t *fh, const void *id, FILE *stream, int indent
H5_DLL herr_t H5HF_sects_debug(H5F_t *f, haddr_t addr, FILE *stream, int indent, int fwidth);
#endif /* H5HF_DEBUGGING */
+/* Debugging routines for dumping file structures */
+H5_DLL void H5HF_hdr_print(const H5HF_hdr_t *hdr, hbool_t dump_internal, FILE *stream, int indent,
+ int fwidth);
+H5_DLL herr_t H5HF_hdr_debug(H5F_t *f, haddr_t addr, FILE *stream, int indent, int fwidth);
+H5_DLL herr_t H5HF_dblock_debug(H5F_t *f, haddr_t addr, FILE *stream, int indent, int fwidth,
+ haddr_t hdr_addr, size_t nrec);
+H5_DLL void H5HF_iblock_print(const H5HF_indirect_t *iblock, hbool_t dump_internal, FILE *stream, int indent,
+ int fwidth);
+H5_DLL herr_t H5HF_iblock_debug(H5F_t *f, haddr_t addr, FILE *stream, int indent, int fwidth,
+ haddr_t hdr_addr, unsigned nrows);
+
#endif /* H5HFprivate_H */
diff --git a/src/H5HFsection.c b/src/H5HFsection.c
index d80b2f3..eec41a4 100644
--- a/src/H5HFsection.c
+++ b/src/H5HFsection.c
@@ -12,7 +12,7 @@
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
/*
- * Programmer: Quincey Koziol <koziol@hdfgroup.org>
+ * Programmer: Quincey Koziol
* Monday, May 1, 2006
*
* Purpose: Free space section routines for fractal heaps
@@ -64,11 +64,11 @@ typedef struct {
/********************/
/* Shared routines */
-static herr_t H5HF_sect_init_cls(H5FS_section_class_t *cls, H5HF_hdr_t *hdr);
-static herr_t H5HF_sect_term_cls(H5FS_section_class_t *cls);
-static H5HF_free_section_t *H5HF_sect_node_new(unsigned sect_type, haddr_t sect_addr, hsize_t sect_size,
- H5FS_section_state_t state);
-static herr_t H5HF_sect_node_free(H5HF_free_section_t *sect, H5HF_indirect_t *parent);
+static herr_t H5FS__sect_init_cls(H5FS_section_class_t *cls, H5HF_hdr_t *hdr);
+static herr_t H5FS__sect_term_cls(H5FS_section_class_t *cls);
+static H5HF_free_section_t *H5FS__sect_node_new(unsigned sect_type, haddr_t sect_addr, hsize_t sect_size,
+ H5FS_section_state_t state);
+static herr_t H5HF__sect_node_free(H5HF_free_section_t *sect, H5HF_indirect_t *parent);
/* 'single' section routines */
static herr_t H5HF__sect_single_locate_parent(H5HF_hdr_t *hdr, hbool_t refresh, H5HF_free_section_t *sect);
@@ -87,12 +87,12 @@ static herr_t H5HF__sect_single_shrink(H5FS_section_info_t **_sect, void *udata)
static herr_t H5HF__sect_single_valid(const H5FS_section_class_t *cls, const H5FS_section_info_t *sect);
/* 'row' section routines */
-static H5HF_free_section_t *H5HF_sect_row_create(haddr_t sect_off, hsize_t sect_size, hbool_t is_first,
- unsigned row, unsigned col, unsigned nentries,
- H5HF_free_section_t *under_sect);
+static H5HF_free_section_t *H5HF__sect_row_create(haddr_t sect_off, hsize_t sect_size, hbool_t is_first,
+ unsigned row, unsigned col, unsigned nentries,
+ H5HF_free_section_t *under_sect);
static herr_t H5HF__sect_row_first(H5HF_hdr_t *hdr, H5HF_free_section_t *sect);
static herr_t H5HF__sect_row_parent_removed(H5HF_free_section_t *sect);
-static herr_t H5HF_sect_row_from_single(H5HF_hdr_t *hdr, H5HF_free_section_t *sect, H5HF_direct_t *dblock);
+static herr_t H5HF__sect_row_from_single(H5HF_hdr_t *hdr, H5HF_free_section_t *sect, H5HF_direct_t *dblock);
static herr_t H5HF__sect_row_free_real(H5HF_free_section_t *sect);
/* 'row' section callbacks */
@@ -113,16 +113,16 @@ static herr_t H5HF__sect_row_valid(const H5FS_section_class_t *cls, const H5FS_s
static herr_t H5HF__sect_row_debug(const H5FS_section_info_t *sect, FILE *stream, int indent, int fwidth);
/* 'indirect' section routines */
-static H5HF_free_section_t *H5HF_sect_indirect_new(H5HF_hdr_t *hdr, haddr_t sect_off, hsize_t sect_size,
- H5HF_indirect_t *iblock, hsize_t iblock_off, unsigned row,
- unsigned col, unsigned nentries);
+static H5HF_free_section_t *H5HF__sect_indirect_new(H5HF_hdr_t *hdr, haddr_t sect_off, hsize_t sect_size,
+ H5HF_indirect_t *iblock, hsize_t iblock_off, unsigned row,
+ unsigned col, unsigned nentries);
static herr_t H5HF__sect_indirect_init_rows(H5HF_hdr_t *hdr, H5HF_free_section_t *sect, hbool_t first_child,
H5HF_free_section_t **first_row_sect, unsigned space_flags,
unsigned start_row, unsigned start_col, unsigned end_row,
unsigned end_col);
-static H5HF_free_section_t *H5HF_sect_indirect_for_row(H5HF_hdr_t *hdr, H5HF_indirect_t *iblock,
- H5HF_free_section_t *row_sect);
-static herr_t H5HF_sect_indirect_decr(H5HF_free_section_t *sect);
+static H5HF_free_section_t *H5HF__sect_indirect_for_row(H5HF_hdr_t *hdr, H5HF_indirect_t *iblock,
+ H5HF_free_section_t *row_sect);
+static herr_t H5HF__sect_indirect_decr(H5HF_free_section_t *sect);
static herr_t H5HF__sect_indirect_revive_row(H5HF_hdr_t *hdr, H5HF_free_section_t *sect);
static herr_t H5HF__sect_indirect_revive(H5HF_hdr_t *hdr, H5HF_free_section_t *sect,
H5HF_indirect_t *sect_iblock);
@@ -130,25 +130,26 @@ static herr_t H5HF__sect_indirect_reduce_row(H5HF_hdr_t *hdr, H5HF
hbool_t *alloc_from_start);
static herr_t H5HF__sect_indirect_reduce(H5HF_hdr_t *hdr, H5HF_free_section_t *sect, unsigned child_entry);
static herr_t H5HF__sect_indirect_first(H5HF_hdr_t *hdr, H5HF_free_section_t *sect);
-static hbool_t H5HF_sect_indirect_is_first(H5HF_free_section_t *sect);
-static H5HF_indirect_t * H5HF_sect_indirect_get_iblock(H5HF_free_section_t *sect);
-static hsize_t H5HF_sect_indirect_iblock_off(const H5HF_free_section_t *sect);
-static H5HF_free_section_t *H5HF_sect_indirect_top(H5HF_free_section_t *sect);
+static hbool_t H5HF__sect_indirect_is_first(H5HF_free_section_t *sect);
+static H5HF_indirect_t * H5HF__sect_indirect_get_iblock(H5HF_free_section_t *sect);
+static hsize_t H5HF__sect_indirect_iblock_off(const H5HF_free_section_t *sect);
+static H5HF_free_section_t *H5HF__sect_indirect_top(H5HF_free_section_t *sect);
static herr_t H5HF__sect_indirect_merge_row(H5HF_hdr_t *hdr, H5HF_free_section_t *sect1,
H5HF_free_section_t *sect2);
static herr_t H5HF__sect_indirect_build_parent(H5HF_hdr_t *hdr, H5HF_free_section_t *sect);
static herr_t H5HF__sect_indirect_shrink(H5HF_hdr_t *hdr, H5HF_free_section_t *sect);
-static herr_t H5HF_sect_indirect_serialize(H5HF_hdr_t *hdr, const H5HF_free_section_t *sect, uint8_t *buf);
+static herr_t H5HF__sect_indirect_serialize(H5HF_hdr_t *hdr, const H5HF_free_section_t *sect, uint8_t *buf);
static H5FS_section_info_t *H5HF__sect_indirect_deserialize(H5HF_hdr_t *hdr, const uint8_t *buf,
haddr_t sect_addr, hsize_t sect_size,
unsigned *des_flags);
-static herr_t H5HF_sect_indirect_free(H5HF_free_section_t *sect);
-static herr_t H5HF_sect_indirect_valid(const H5HF_hdr_t *hdr, const H5HF_free_section_t *sect);
-static herr_t H5HF_sect_indirect_debug(const H5HF_free_section_t *sect, FILE *stream, int indent, int fwidth);
+static herr_t H5HF__sect_indirect_free(H5HF_free_section_t *sect);
+static herr_t H5HF__sect_indirect_valid(const H5HF_hdr_t *hdr, const H5HF_free_section_t *sect);
+static herr_t H5HF__sect_indirect_debug(const H5HF_free_section_t *sect, FILE *stream, int indent,
+ int fwidth);
/* 'indirect' section callbacks */
-static herr_t H5HF_sect_indirect_init_cls(H5FS_section_class_t *cls, void *udata);
-static herr_t H5HF_sect_indirect_term_cls(H5FS_section_class_t *cls);
+static herr_t H5HF__sect_indirect_init_cls(H5FS_section_class_t *cls, void *udata);
+static herr_t H5HF__sect_indirect_term_cls(H5FS_section_class_t *cls);
/*********************/
/* Package Variables */
@@ -247,8 +248,8 @@ H5FS_section_class_t H5HF_FSPACE_SECT_CLS_INDIRECT[1] = {{
NULL, /* Class private info */
/* Class methods */
- H5HF_sect_indirect_init_cls, /* Initialize section class */
- H5HF_sect_indirect_term_cls, /* Terminate section class */
+ H5HF__sect_indirect_init_cls, /* Initialize section class */
+ H5HF__sect_indirect_term_cls, /* Terminate section class */
/* Object methods */
NULL, /* Add section */
@@ -276,7 +277,7 @@ H5FL_DEFINE(H5HF_free_section_t);
/*******************/
/*-------------------------------------------------------------------------
- * Function: H5HF_sect_init_cls
+ * Function: H5FS__sect_init_cls
*
* Purpose: Initialize the common class structure
*
@@ -289,12 +290,12 @@ H5FL_DEFINE(H5HF_free_section_t);
*-------------------------------------------------------------------------
*/
static herr_t
-H5HF_sect_init_cls(H5FS_section_class_t *cls, H5HF_hdr_t *hdr)
+H5FS__sect_init_cls(H5FS_section_class_t *cls, H5HF_hdr_t *hdr)
{
H5HF_sect_private_t *cls_prvt; /* Pointer to class private info */
herr_t ret_value = SUCCEED; /* Return value */
- FUNC_ENTER_NOAPI_NOINIT
+ FUNC_ENTER_STATIC
/* Check arguments. */
HDassert(cls);
@@ -309,15 +310,15 @@ H5HF_sect_init_cls(H5FS_section_class_t *cls, H5HF_hdr_t *hdr)
cls->cls_private = cls_prvt;
/* Increment reference count on heap header */
- if (H5HF_hdr_incr(hdr) < 0)
+ if (H5HF__hdr_incr(hdr) < 0)
HGOTO_ERROR(H5E_HEAP, H5E_CANTINC, FAIL, "can't increment reference count on shared heap header")
done:
FUNC_LEAVE_NOAPI(ret_value)
-} /* H5HF_sect_init_cls() */
+} /* H5FS__sect_init_cls() */
/*-------------------------------------------------------------------------
- * Function: H5HF_sect_term_cls
+ * Function: H5FS__sect_term_cls
*
* Purpose: Terminate the common class structure
*
@@ -330,12 +331,12 @@ done:
*-------------------------------------------------------------------------
*/
static herr_t
-H5HF_sect_term_cls(H5FS_section_class_t *cls)
+H5FS__sect_term_cls(H5FS_section_class_t *cls)
{
H5HF_sect_private_t *cls_prvt; /* Pointer to class private info */
herr_t ret_value = SUCCEED; /* Return value */
- FUNC_ENTER_NOAPI_NOINIT
+ FUNC_ENTER_STATIC
/* Check arguments. */
HDassert(cls);
@@ -344,7 +345,7 @@ H5HF_sect_term_cls(H5FS_section_class_t *cls)
cls_prvt = (H5HF_sect_private_t *)cls->cls_private;
/* Decrement reference count on heap header */
- if (H5HF_hdr_decr(cls_prvt->hdr) < 0)
+ if (H5HF__hdr_decr(cls_prvt->hdr) < 0)
HGOTO_ERROR(H5E_HEAP, H5E_CANTDEC, FAIL, "can't decrement reference count on shared heap header")
/* Free the class private information */
@@ -352,10 +353,10 @@ H5HF_sect_term_cls(H5FS_section_class_t *cls)
done:
FUNC_LEAVE_NOAPI(ret_value)
-} /* H5HF_sect_term_cls() */
+} /* H5FS__sect_term_cls() */
/*-------------------------------------------------------------------------
- * Function: H5HF_sect_node_new
+ * Function: H5FS__sect_node_new
*
* Purpose: Allocate a free space section node of a particular type
*
@@ -369,12 +370,12 @@ done:
*-------------------------------------------------------------------------
*/
static H5HF_free_section_t *
-H5HF_sect_node_new(unsigned sect_type, haddr_t sect_addr, hsize_t sect_size, H5FS_section_state_t sect_state)
+H5FS__sect_node_new(unsigned sect_type, haddr_t sect_addr, hsize_t sect_size, H5FS_section_state_t sect_state)
{
H5HF_free_section_t *new_sect; /* New section */
H5HF_free_section_t *ret_value = NULL; /* Return value */
- FUNC_ENTER_NOAPI_NOINIT
+ FUNC_ENTER_STATIC
/* Check arguments. */
HDassert(H5F_addr_defined(sect_addr));
@@ -397,10 +398,10 @@ H5HF_sect_node_new(unsigned sect_type, haddr_t sect_addr, hsize_t sect_size, H5F
done:
FUNC_LEAVE_NOAPI(ret_value)
-} /* H5HF_sect_node_new() */
+} /* H5FS__sect_node_new() */
/*-------------------------------------------------------------------------
- * Function: H5HF_sect_node_free
+ * Function: H5HF__sect_node_free
*
* Purpose: Free a section node
*
@@ -414,11 +415,11 @@ done:
*-------------------------------------------------------------------------
*/
static herr_t
-H5HF_sect_node_free(H5HF_free_section_t *sect, H5HF_indirect_t *iblock)
+H5HF__sect_node_free(H5HF_free_section_t *sect, H5HF_indirect_t *iblock)
{
herr_t ret_value = SUCCEED; /* Return value */
- FUNC_ENTER_NOAPI_NOINIT
+ FUNC_ENTER_STATIC
HDassert(sect);
@@ -433,28 +434,27 @@ H5HF_sect_node_free(H5HF_free_section_t *sect, H5HF_indirect_t *iblock)
done:
FUNC_LEAVE_NOAPI(ret_value)
-} /* H5HF_sect_node_free() */
+} /* H5HF__sect_node_free() */
/*-------------------------------------------------------------------------
- * Function: H5HF_sect_single_new
+ * Function: H5HF__sect_single_new
*
* Purpose: Create a new 'single' section and return it to the caller
*
* Return: Pointer to new section on success/NULL on failure
*
* Programmer: Quincey Koziol
- * koziol@ncsa.uiuc.edu
* May 30 2006
*
*-------------------------------------------------------------------------
*/
H5HF_free_section_t *
-H5HF_sect_single_new(hsize_t sect_off, size_t sect_size, H5HF_indirect_t *parent, unsigned par_entry)
+H5HF__sect_single_new(hsize_t sect_off, size_t sect_size, H5HF_indirect_t *parent, unsigned par_entry)
{
H5HF_free_section_t *sect = NULL; /* 'Single' free space section to add */
H5HF_free_section_t *ret_value = NULL; /* Return value */
- FUNC_ENTER_NOAPI_NOINIT
+ FUNC_ENTER_PACKAGE
/*
* Check arguments.
@@ -463,13 +463,13 @@ H5HF_sect_single_new(hsize_t sect_off, size_t sect_size, H5HF_indirect_t *parent
/* Create free space section node */
if (NULL ==
- (sect = H5HF_sect_node_new(H5HF_FSPACE_SECT_SINGLE, sect_off, (hsize_t)sect_size, H5FS_SECT_LIVE)))
+ (sect = H5FS__sect_node_new(H5HF_FSPACE_SECT_SINGLE, sect_off, (hsize_t)sect_size, H5FS_SECT_LIVE)))
HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "memory allocation failed for single section")
/* Set the 'single' specific fields */
sect->u.single.parent = parent;
if (sect->u.single.parent) {
- if (H5HF_iblock_incr(sect->u.single.parent) < 0)
+ if (H5HF__iblock_incr(sect->u.single.parent) < 0)
HGOTO_ERROR(H5E_HEAP, H5E_CANTINC, NULL,
"can't increment reference count on shared indirect block")
} /* end if */
@@ -485,7 +485,7 @@ done:
} /* end if */
FUNC_LEAVE_NOAPI(ret_value)
-} /* end H5HF_sect_single_new() */
+} /* end H5HF__sect_single_new() */
/*-------------------------------------------------------------------------
* Function: H5HF__sect_single_locate_parent
@@ -495,7 +495,6 @@ done:
* Return: Non-negative on success/Negative on failure
*
* Programmer: Quincey Koziol
- * koziol@hdfgroup.org
* October 24 2006
*
*-------------------------------------------------------------------------
@@ -523,7 +522,7 @@ H5HF__sect_single_locate_parent(H5HF_hdr_t *hdr, hbool_t refresh, H5HF_free_sect
HGOTO_ERROR(H5E_HEAP, H5E_CANTCOMPUTE, FAIL, "can't compute row & column of section")
/* Increment reference count on indirect block that free section is in */
- if (H5HF_iblock_incr(sec_iblock) < 0)
+ if (H5HF__iblock_incr(sec_iblock) < 0)
HGOTO_ERROR(H5E_HEAP, H5E_CANTINC, FAIL, "can't increment reference count on shared indirect block")
/* Check for refreshing existing parent information */
@@ -557,7 +556,6 @@ done:
* Return: SUCCEED/FAIL
*
* Programmer: Quincey Koziol
- * koziol@hdfgroup.org
* May 8 2006
*
*-------------------------------------------------------------------------
@@ -597,23 +595,22 @@ done:
} /* end H5HF__sect_single_revive() */
/*-------------------------------------------------------------------------
- * Function: H5HF_sect_single_dblock_info
+ * Function: H5HF__sect_single_dblock_info
*
* Purpose: Retrieve the direct block information for a single section
*
* Return: SUCCEED/FAIL
*
* Programmer: Quincey Koziol
- * koziol@hdfgroup.org
* October 24 2006
*
*-------------------------------------------------------------------------
*/
herr_t
-H5HF_sect_single_dblock_info(H5HF_hdr_t *hdr, const H5HF_free_section_t *sect, haddr_t *dblock_addr,
- size_t *dblock_size)
+H5HF__sect_single_dblock_info(H5HF_hdr_t *hdr, const H5HF_free_section_t *sect, haddr_t *dblock_addr,
+ size_t *dblock_size)
{
- FUNC_ENTER_NOAPI_NOERR
+ FUNC_ENTER_PACKAGE_NOERR
/*
* Check arguments.
@@ -640,7 +637,7 @@ H5HF_sect_single_dblock_info(H5HF_hdr_t *hdr, const H5HF_free_section_t *sect, h
} /* end else */
FUNC_LEAVE_NOAPI(SUCCEED)
-} /* end H5HF_sect_single_dblock_info() */
+} /* end H5HF__sect_single_dblock_info() */
/*-------------------------------------------------------------------------
* Function: H5HF__sect_single_reduce
@@ -652,7 +649,6 @@ H5HF_sect_single_dblock_info(H5HF_hdr_t *hdr, const H5HF_free_section_t *sect, h
* Return: Non-negative on success/Negative on failure
*
* Programmer: Quincey Koziol
- * koziol@ncsa.uiuc.edu
* May 31 2006
*
*-------------------------------------------------------------------------
@@ -717,7 +713,7 @@ H5HF__sect_single_full_dblock(H5HF_hdr_t *hdr, H5HF_free_section_t *sect)
size_t dblock_overhead; /* Direct block's overhead */
herr_t ret_value = SUCCEED; /* Return value */
- FUNC_ENTER_PACKAGE
+ FUNC_ENTER_STATIC
/* Check arguments. */
HDassert(sect);
@@ -725,7 +721,7 @@ H5HF__sect_single_full_dblock(H5HF_hdr_t *hdr, H5HF_free_section_t *sect)
HDassert(hdr);
/* Retrieve direct block address from section */
- if (H5HF_sect_single_dblock_info(hdr, sect, &dblock_addr, &dblock_size) < 0)
+ if (H5HF__sect_single_dblock_info(hdr, sect, &dblock_addr, &dblock_size) < 0)
HGOTO_ERROR(H5E_HEAP, H5E_CANTGET, FAIL, "can't retrieve direct block information")
/* Check for section occupying entire direct block */
@@ -741,7 +737,7 @@ H5HF__sect_single_full_dblock(H5HF_hdr_t *hdr, H5HF_free_section_t *sect)
HDassert(H5F_addr_eq(dblock->block_off + dblock_overhead, sect->sect_info.addr));
/* Convert 'single' section into 'row' section */
- if (H5HF_sect_row_from_single(hdr, sect, dblock) < 0)
+ if (H5HF__sect_row_from_single(hdr, sect, dblock) < 0)
HGOTO_ERROR(H5E_HEAP, H5E_CANTCONVERT, FAIL, "can't convert single section into row section")
/* Destroy direct block */
@@ -840,7 +836,7 @@ H5HF__sect_single_deserialize(const H5FS_section_class_t H5_ATTR_UNUSED *cls,
/* Create free list section node */
if (NULL ==
- (new_sect = H5HF_sect_node_new(H5HF_FSPACE_SECT_SINGLE, sect_addr, sect_size, H5FS_SECT_SERIALIZED)))
+ (new_sect = H5FS__sect_node_new(H5HF_FSPACE_SECT_SINGLE, sect_addr, sect_size, H5FS_SECT_SERIALIZED)))
HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "allocation failed for direct block free list section")
/* Set return value */
@@ -1045,7 +1041,7 @@ H5HF__sect_single_shrink(H5FS_section_info_t **_sect, void *_udata)
HGOTO_ERROR(H5E_HEAP, H5E_CANTINIT, FAIL, "can't revive single free section")
/* Retrieve direct block address from section */
- if (H5HF_sect_single_dblock_info(hdr, (*sect), &dblock_addr, &dblock_size) < 0)
+ if (H5HF__sect_single_dblock_info(hdr, (*sect), &dblock_addr, &dblock_size) < 0)
HGOTO_ERROR(H5E_HEAP, H5E_CANTGET, FAIL, "can't retrieve direct block information")
/* Protect the direct block for the section */
@@ -1099,14 +1095,13 @@ H5HF__sect_single_free(H5FS_section_info_t *_sect)
HDassert(sect);
/* Check for live reference to an indirect block */
- if (sect->sect_info.state == H5FS_SECT_LIVE) {
+ if (sect->sect_info.state == H5FS_SECT_LIVE)
/* Get parent indirect block, if there was one */
if (sect->u.single.parent)
parent = sect->u.single.parent;
- } /* end if */
/* Release the section */
- if (H5HF_sect_node_free(sect, parent) < 0)
+ if (H5HF__sect_node_free(sect, parent) < 0)
HGOTO_ERROR(H5E_HEAP, H5E_CANTRELEASE, FAIL, "can't free section node")
done:
@@ -1152,8 +1147,8 @@ H5HF__sect_single_valid(const H5FS_section_class_t H5_ATTR_UNUSED *cls, const H5
HDassert(H5F_addr_defined(iblock->ents[sect->u.single.par_entry].addr));
/* Retrieve direct block address from section */
- status = H5HF_sect_single_dblock_info(iblock->hdr, (const H5HF_free_section_t *)sect,
- &dblock_addr, &dblock_size);
+ status = H5HF__sect_single_dblock_info(iblock->hdr, (const H5HF_free_section_t *)sect,
+ &dblock_addr, &dblock_size);
HDassert(status >= 0);
HDassert(H5F_addr_eq(iblock->ents[sect->u.single.par_entry].addr, dblock_addr));
HDassert(dblock_size > 0);
@@ -1200,7 +1195,7 @@ H5HF__sect_single_valid(const H5FS_section_class_t H5_ATTR_UNUSED *cls, const H5
} /* H5HF__sect_single_valid() */
/*-------------------------------------------------------------------------
- * Function: H5HF_sect_row_create
+ * Function: H5HF__sect_row_create
*
* Purpose: Create a new 'row' section
*
@@ -1214,13 +1209,13 @@ H5HF__sect_single_valid(const H5FS_section_class_t H5_ATTR_UNUSED *cls, const H5
*-------------------------------------------------------------------------
*/
static H5HF_free_section_t *
-H5HF_sect_row_create(haddr_t sect_off, hsize_t sect_size, hbool_t is_first, unsigned row, unsigned col,
- unsigned nentries, H5HF_free_section_t *under_sect)
+H5HF__sect_row_create(haddr_t sect_off, hsize_t sect_size, hbool_t is_first, unsigned row, unsigned col,
+ unsigned nentries, H5HF_free_section_t *under_sect)
{
H5HF_free_section_t *sect = NULL; /* 'Row' section created */
H5HF_free_section_t *ret_value = NULL; /* Return value */
- FUNC_ENTER_NOAPI_NOINIT
+ FUNC_ENTER_STATIC
/* Check arguments. */
HDassert(sect_size);
@@ -1229,7 +1224,7 @@ H5HF_sect_row_create(haddr_t sect_off, hsize_t sect_size, hbool_t is_first, unsi
/* Create 'row' free space section node */
/* ("inherits" underlying indirect section's state) */
- if (NULL == (sect = H5HF_sect_node_new(
+ if (NULL == (sect = H5FS__sect_node_new(
(unsigned)(is_first ? H5HF_FSPACE_SECT_FIRST_ROW : H5HF_FSPACE_SECT_NORMAL_ROW),
sect_off, sect_size, under_sect->sect_info.state)))
HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "memory allocation failed for row section")
@@ -1246,27 +1241,26 @@ H5HF_sect_row_create(haddr_t sect_off, hsize_t sect_size, hbool_t is_first, unsi
done:
FUNC_LEAVE_NOAPI(ret_value)
-} /* H5HF_sect_row_create() */
+} /* H5HF__sect_row_create() */
/*-------------------------------------------------------------------------
- * Function: H5HF_sect_row_from_single
+ * Function: H5HF__sect_row_from_single
*
* Purpose: Convert a 'single' section into a 'row' section
*
* Return: Non-negative on success/Negative on failure
*
* Programmer: Quincey Koziol
- * koziol@ncsa.uiuc.edu
* July 6 2006
*
*-------------------------------------------------------------------------
*/
static herr_t
-H5HF_sect_row_from_single(H5HF_hdr_t *hdr, H5HF_free_section_t *sect, H5HF_direct_t *dblock)
+H5HF__sect_row_from_single(H5HF_hdr_t *hdr, H5HF_free_section_t *sect, H5HF_direct_t *dblock)
{
herr_t ret_value = SUCCEED; /* Return value */
- FUNC_ENTER_NOAPI_NOINIT
+ FUNC_ENTER_STATIC
/*
* Check arguments.
@@ -1284,7 +1278,7 @@ H5HF_sect_row_from_single(H5HF_hdr_t *hdr, H5HF_free_section_t *sect, H5HF_direc
sect->u.row.checked_out = FALSE;
/* Create indirect section that underlies the row section */
- if (NULL == (sect->u.row.under = H5HF_sect_indirect_for_row(hdr, dblock->parent, sect)))
+ if (NULL == (sect->u.row.under = H5HF__sect_indirect_for_row(hdr, dblock->parent, sect)))
HGOTO_ERROR(H5E_HEAP, H5E_CANTCREATE, FAIL, "serializing row section not supported yet")
/* Release single section's hold on underlying indirect block */
@@ -1293,7 +1287,7 @@ H5HF_sect_row_from_single(H5HF_hdr_t *hdr, H5HF_free_section_t *sect, H5HF_direc
done:
FUNC_LEAVE_NOAPI(ret_value)
-} /* end H5HF_sect_row_from_single() */
+} /* end H5HF__sect_row_from_single() */
/*-------------------------------------------------------------------------
* Function: H5HF__sect_row_revive
@@ -1303,7 +1297,6 @@ done:
* Return: Non-negative on success/Negative on failure
*
* Programmer: Quincey Koziol
- * koziol@ncsa.uiuc.edu
* July 6 2006
*
*-------------------------------------------------------------------------
@@ -1350,7 +1343,6 @@ done:
* Return: Non-negative on success/Negative on failure
*
* Programmer: Quincey Koziol
- * koziol@ncsa.uiuc.edu
* July 6 2006
*
*-------------------------------------------------------------------------
@@ -1424,7 +1416,6 @@ done:
* Return: Non-negative on success/Negative on failure
*
* Programmer: Quincey Koziol
- * koziol@ncsa.uiuc.edu
* July 10 2006
*
*-------------------------------------------------------------------------
@@ -1457,24 +1448,23 @@ done:
} /* end H5HF__sect_row_first() */
/*-------------------------------------------------------------------------
- * Function: H5HF_sect_row_get_iblock
+ * Function: H5HF__sect_row_get_iblock
*
* Purpose: Retrieve the indirect block for a row section
*
* Return: Pointer to indirect block on success/NULL on failure
*
* Programmer: Quincey Koziol
- * koziol@ncsa.uiuc.edu
* July 9 2006
*
*-------------------------------------------------------------------------
*/
H5HF_indirect_t *
-H5HF_sect_row_get_iblock(H5HF_free_section_t *sect)
+H5HF__sect_row_get_iblock(H5HF_free_section_t *sect)
{
H5HF_indirect_t *ret_value = NULL; /* Return value */
- FUNC_ENTER_NOAPI_NOINIT_NOERR
+ FUNC_ENTER_PACKAGE_NOERR
/*
* Check arguments.
@@ -1484,10 +1474,10 @@ H5HF_sect_row_get_iblock(H5HF_free_section_t *sect)
sect->sect_info.type == H5HF_FSPACE_SECT_NORMAL_ROW);
HDassert(sect->sect_info.state == H5FS_SECT_LIVE);
- ret_value = H5HF_sect_indirect_get_iblock(sect->u.row.under);
+ ret_value = H5HF__sect_indirect_get_iblock(sect->u.row.under);
FUNC_LEAVE_NOAPI(ret_value)
-} /* end H5HF_sect_row_get_iblock() */
+} /* end H5HF__sect_row_get_iblock() */
/*-------------------------------------------------------------------------
* Function: H5HF__sect_row_parent_removed
@@ -1498,7 +1488,6 @@ H5HF_sect_row_get_iblock(H5HF_free_section_t *sect)
* Return: Non-negative on success / Negative on failure
*
* Programmer: Quincey Koziol
- * koziol@lbl.gov
* February 4 2018
*
*-------------------------------------------------------------------------
@@ -1571,7 +1560,7 @@ H5HF__sect_row_init_cls(H5FS_section_class_t *cls, void *_udata)
HDassert(hdr);
/* Call common class initialization */
- if (H5HF_sect_init_cls(cls, hdr) < 0)
+ if (H5FS__sect_init_cls(cls, hdr) < 0)
HGOTO_ERROR(H5E_HEAP, H5E_CANTINIT, FAIL, "can't initialize common section class")
/* First row sections actually are proxies for indirection sections on disk */
@@ -1612,7 +1601,7 @@ H5HF__sect_row_term_cls(H5FS_section_class_t *cls)
HDassert(cls);
/* Call common class termination */
- if (H5HF_sect_term_cls(cls) < 0)
+ if (H5FS__sect_term_cls(cls) < 0)
HGOTO_ERROR(H5E_HEAP, H5E_CANTRELEASE, FAIL, "can't terminate common section class")
done:
@@ -1651,7 +1640,7 @@ H5HF__sect_row_serialize(const H5FS_section_class_t *cls, const H5FS_section_inf
/* Forward to indirect routine to serialize underlying section */
hdr = ((H5HF_sect_private_t *)(cls->cls_private))->hdr;
- if (H5HF_sect_indirect_serialize(hdr, sect->u.row.under, buf) < 0)
+ if (H5HF__sect_indirect_serialize(hdr, sect->u.row.under, buf) < 0)
HGOTO_ERROR(H5E_HEAP, H5E_CANTSERIALIZE, FAIL,
"can't serialize row section's underlying indirect section")
@@ -1736,24 +1725,22 @@ H5HF__sect_row_can_merge(const H5FS_section_info_t *_sect1, const H5FS_section_i
HDassert(H5F_addr_lt(sect1->sect_info.addr, sect2->sect_info.addr));
/* Get the top indirect section underlying each row */
- top_indir_sect1 = H5HF_sect_indirect_top(sect1->u.row.under);
+ top_indir_sect1 = H5HF__sect_indirect_top(sect1->u.row.under);
HDassert(top_indir_sect1);
- top_indir_sect2 = H5HF_sect_indirect_top(sect2->u.row.under);
+ top_indir_sect2 = H5HF__sect_indirect_top(sect2->u.row.under);
HDassert(top_indir_sect2);
/* Check if second section shares the same underlying indirect block as
* the first section, but doesn't already have same underlying indirect
* section.
*/
- if (top_indir_sect1 != top_indir_sect2) {
- if (H5HF_sect_indirect_iblock_off(sect1->u.row.under) ==
- H5HF_sect_indirect_iblock_off(sect2->u.row.under)) {
+ if (top_indir_sect1 != top_indir_sect2)
+ if (H5HF__sect_indirect_iblock_off(sect1->u.row.under) ==
+ H5HF__sect_indirect_iblock_off(sect2->u.row.under))
/* Check if second section adjoins first section */
if (H5F_addr_eq((top_indir_sect1->sect_info.addr + top_indir_sect1->u.indirect.span_size),
top_indir_sect2->sect_info.addr))
HGOTO_DONE(TRUE)
- } /* end if */
- } /* end if */
done:
FUNC_LEAVE_NOAPI(ret_value)
@@ -1797,7 +1784,7 @@ H5HF__sect_row_merge(H5FS_section_info_t **_sect1, H5FS_section_info_t *_sect2,
H5HF_free_section_t *top_indir_sect; /* Top indirect section for row */
/* Get the top indirect section underlying second row section */
- top_indir_sect = H5HF_sect_indirect_top(sect2->u.row.under);
+ top_indir_sect = H5HF__sect_indirect_top(sect2->u.row.under);
/* Shrink away underlying indirect section */
if (H5HF__sect_indirect_shrink(hdr, top_indir_sect) < 0)
@@ -1883,7 +1870,7 @@ H5HF__sect_row_shrink(H5FS_section_info_t **_sect, void *_udata)
HDassert((*sect)->sect_info.type == H5HF_FSPACE_SECT_FIRST_ROW);
/* Get the top indirect section underlying each row */
- top_indir_sect = H5HF_sect_indirect_top((*sect)->u.row.under);
+ top_indir_sect = H5HF__sect_indirect_top((*sect)->u.row.under);
/* Shrink away underlying indirect section */
if (H5HF__sect_indirect_shrink(hdr, top_indir_sect) < 0)
@@ -1920,7 +1907,7 @@ H5HF__sect_row_free_real(H5HF_free_section_t *sect)
HDassert(sect);
/* Release the section */
- if (H5HF_sect_node_free(sect, NULL) < 0)
+ if (H5HF__sect_node_free(sect, NULL) < 0)
HGOTO_ERROR(H5E_HEAP, H5E_CANTRELEASE, FAIL, "can't free section node")
done:
@@ -1953,7 +1940,7 @@ H5HF__sect_row_free(H5FS_section_info_t *_sect)
HDassert(sect->u.row.under);
/* Decrement the ref. count on the row section's underlying indirect section */
- if (H5HF_sect_indirect_decr(sect->u.row.under) < 0)
+ if (H5HF__sect_indirect_decr(sect->u.row.under) < 0)
HGOTO_ERROR(H5E_HEAP, H5E_CANTRELEASE, FAIL, "can't detach section node")
/* Release the section */
@@ -2015,10 +2002,10 @@ H5HF__sect_row_valid(const H5FS_section_class_t *cls, const H5FS_section_info_t
HDassert(sect->u.row.row == indir_sect->u.indirect.row);
/* Get the top indirect section underlying row */
- top_indir_sect = H5HF_sect_indirect_top(sect->u.row.under);
+ top_indir_sect = H5HF__sect_indirect_top(sect->u.row.under);
/* Check that the row's underlying indirect section is valid */
- H5HF_sect_indirect_valid(hdr, top_indir_sect);
+ H5HF__sect_indirect_valid(hdr, top_indir_sect);
} /* end if */
FUNC_LEAVE_NOAPI(SUCCEED)
@@ -2057,31 +2044,30 @@ H5HF__sect_row_debug(const H5FS_section_info_t *_sect, FILE *stream, int indent,
/* Print indirect section header */
HDfprintf(stream, "%*s%-*s\n", indent, "", fwidth, "Underlying indirect section:");
- H5HF_sect_indirect_debug(sect->u.row.under, stream, indent + 3, MAX(0, fwidth - 3));
+ H5HF__sect_indirect_debug(sect->u.row.under, stream, indent + 3, MAX(0, fwidth - 3));
} /* end if */
FUNC_LEAVE_NOAPI(SUCCEED)
} /* H5HF__sect_row_debug() */
/*-------------------------------------------------------------------------
- * Function: H5HF_sect_indirect_iblock_off
+ * Function: H5HF__sect_indirect_iblock_off
*
* Purpose: Get the offset of the indirect block for the section
*
* Return: Offset of indirect block in "heap space" (can't fail)
*
* Programmer: Quincey Koziol
- * koziol@ncsa.uiuc.edu
* July 6 2006
*
*-------------------------------------------------------------------------
*/
static hsize_t
-H5HF_sect_indirect_iblock_off(const H5HF_free_section_t *sect)
+H5HF__sect_indirect_iblock_off(const H5HF_free_section_t *sect)
{
hsize_t ret_value = 0; /* Return value */
- FUNC_ENTER_NOAPI_NOINIT_NOERR
+ FUNC_ENTER_STATIC_NOERR
/*
* Check arguments.
@@ -2092,27 +2078,26 @@ H5HF_sect_indirect_iblock_off(const H5HF_free_section_t *sect)
: sect->u.indirect.u.iblock_off;
FUNC_LEAVE_NOAPI(ret_value)
-} /* end H5HF_sect_indirect_iblock_off() */
+} /* end H5HF__sect_indirect_iblock_off() */
/*-------------------------------------------------------------------------
- * Function: H5HF_sect_indirect_top
+ * Function: H5HF__sect_indirect_top
*
* Purpose: Get the "top" indirect section
*
* Return: Pointer to the top indirect section (can't fail)
*
* Programmer: Quincey Koziol
- * koziol@ncsa.uiuc.edu
* July 6 2006
*
*-------------------------------------------------------------------------
*/
static H5HF_free_section_t *
-H5HF_sect_indirect_top(H5HF_free_section_t *sect)
+H5HF__sect_indirect_top(H5HF_free_section_t *sect)
{
H5HF_free_section_t *ret_value = NULL; /* Return value */
- FUNC_ENTER_NOAPI_NOINIT_NOERR
+ FUNC_ENTER_STATIC_NOERR
/*
* Check arguments.
@@ -2120,15 +2105,15 @@ H5HF_sect_indirect_top(H5HF_free_section_t *sect)
HDassert(sect);
if (sect->u.indirect.parent)
- ret_value = H5HF_sect_indirect_top(sect->u.indirect.parent);
+ ret_value = H5HF__sect_indirect_top(sect->u.indirect.parent);
else
ret_value = sect;
FUNC_LEAVE_NOAPI(ret_value)
-} /* end H5HF_sect_indirect_top() */
+} /* end H5HF__sect_indirect_top() */
/*-------------------------------------------------------------------------
- * Function: H5HF_sect_indirect_init_cls
+ * Function: H5HF__sect_indirect_init_cls
*
* Purpose: Initialize the "indirect" class structure
*
@@ -2142,19 +2127,19 @@ H5HF_sect_indirect_top(H5HF_free_section_t *sect)
*-------------------------------------------------------------------------
*/
static herr_t
-H5HF_sect_indirect_init_cls(H5FS_section_class_t *cls, void *_udata)
+H5HF__sect_indirect_init_cls(H5FS_section_class_t *cls, void *_udata)
{
H5HF_hdr_t *hdr = (H5HF_hdr_t *)_udata; /* Fractal heap header */
herr_t ret_value = SUCCEED; /* Return value */
- FUNC_ENTER_NOAPI_NOINIT
+ FUNC_ENTER_STATIC
/* Check arguments. */
HDassert(cls);
HDassert(hdr);
/* Call to common class initialization */
- if (H5HF_sect_init_cls(cls, hdr) < 0)
+ if (H5FS__sect_init_cls(cls, hdr) < 0)
HGOTO_ERROR(H5E_HEAP, H5E_CANTINIT, FAIL, "can't initialize common section class")
/* Set the size of all serialized objects of this class of sections */
@@ -2162,10 +2147,10 @@ H5HF_sect_indirect_init_cls(H5FS_section_class_t *cls, void *_udata)
done:
FUNC_LEAVE_NOAPI(ret_value)
-} /* H5HF_sect_indirect_init_cls() */
+} /* H5HF__sect_indirect_init_cls() */
/*-------------------------------------------------------------------------
- * Function: H5HF_sect_indirect_term_cls
+ * Function: H5HF__sect_indirect_term_cls
*
* Purpose: Terminate the "indirect" class structure
*
@@ -2179,25 +2164,25 @@ done:
*-------------------------------------------------------------------------
*/
static herr_t
-H5HF_sect_indirect_term_cls(H5FS_section_class_t *cls)
+H5HF__sect_indirect_term_cls(H5FS_section_class_t *cls)
{
herr_t ret_value = SUCCEED; /* Return value */
- FUNC_ENTER_NOAPI_NOINIT
+ FUNC_ENTER_STATIC
/* Check arguments. */
HDassert(cls);
/* Call common class termination */
- if (H5HF_sect_term_cls(cls) < 0)
+ if (H5FS__sect_term_cls(cls) < 0)
HGOTO_ERROR(H5E_HEAP, H5E_CANTRELEASE, FAIL, "can't terminate common section class")
done:
FUNC_LEAVE_NOAPI(ret_value)
-} /* H5HF_sect_indirect_term_cls() */
+} /* H5HF__sect_indirect_term_cls() */
/*-------------------------------------------------------------------------
- * Function: H5HF_sect_indirect_new
+ * Function: H5HF__sect_indirect_new
*
* Purpose: Create a new 'indirect' section for other routines to finish
* initializing.
@@ -2205,19 +2190,18 @@ done:
* Return: Non-negative on success/Negative on failure
*
* Programmer: Quincey Koziol
- * koziol@ncsa.uiuc.edu
* July 6 2006
*
*-------------------------------------------------------------------------
*/
static H5HF_free_section_t *
-H5HF_sect_indirect_new(H5HF_hdr_t *hdr, haddr_t sect_off, hsize_t sect_size, H5HF_indirect_t *iblock,
- hsize_t iblock_off, unsigned row, unsigned col, unsigned nentries)
+H5HF__sect_indirect_new(H5HF_hdr_t *hdr, haddr_t sect_off, hsize_t sect_size, H5HF_indirect_t *iblock,
+ hsize_t iblock_off, unsigned row, unsigned col, unsigned nentries)
{
H5HF_free_section_t *sect = NULL; /* 'Indirect' free space section to add */
H5HF_free_section_t *ret_value = NULL; /* Return value */
- FUNC_ENTER_NOAPI_NOINIT
+ FUNC_ENTER_STATIC
/*
* Check arguments.
@@ -2226,15 +2210,15 @@ H5HF_sect_indirect_new(H5HF_hdr_t *hdr, haddr_t sect_off, hsize_t sect_size, H5H
HDassert(nentries);
/* Create free space section node */
- if (NULL == (sect = H5HF_sect_node_new(H5HF_FSPACE_SECT_INDIRECT, sect_off, sect_size,
- (iblock ? H5FS_SECT_LIVE : H5FS_SECT_SERIALIZED))))
+ if (NULL == (sect = H5FS__sect_node_new(H5HF_FSPACE_SECT_INDIRECT, sect_off, sect_size,
+ (iblock ? H5FS_SECT_LIVE : H5FS_SECT_SERIALIZED))))
HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "memory allocation failed for indirect section")
/* Set the 'indirect' specific fields */
if (iblock) {
sect->u.indirect.u.iblock = iblock;
sect->u.indirect.iblock_entries = hdr->man_dtable.cparam.width * sect->u.indirect.u.iblock->max_rows;
- if (H5HF_iblock_incr(sect->u.indirect.u.iblock) < 0)
+ if (H5HF__iblock_incr(sect->u.indirect.u.iblock) < 0)
HGOTO_ERROR(H5E_HEAP, H5E_CANTINC, NULL,
"can't increment reference count on shared indirect block")
} /* end if */
@@ -2247,7 +2231,7 @@ H5HF_sect_indirect_new(H5HF_hdr_t *hdr, haddr_t sect_off, hsize_t sect_size, H5H
sect->u.indirect.num_entries = nentries;
/* Compute span size of indirect section */
- sect->u.indirect.span_size = H5HF_dtable_span_size(&hdr->man_dtable, row, col, nentries);
+ sect->u.indirect.span_size = H5HF__dtable_span_size(&hdr->man_dtable, row, col, nentries);
HDassert(sect->u.indirect.span_size > 0);
/* This indirect section doesn't (currently) have a parent */
@@ -2264,28 +2248,27 @@ done:
} /* end if */
FUNC_LEAVE_NOAPI(ret_value)
-} /* end H5HF_sect_indirect_new() */
+} /* end H5HF__sect_indirect_new() */
/*-------------------------------------------------------------------------
- * Function: H5HF_sect_indirect_for_row
+ * Function: H5HF__sect_indirect_for_row
*
* Purpose: Create the underlying indirect section for a new row section
*
* Return: Non-negative on success/Negative on failure
*
* Programmer: Quincey Koziol
- * koziol@ncsa.uiuc.edu
* July 6 2006
*
*-------------------------------------------------------------------------
*/
static H5HF_free_section_t *
-H5HF_sect_indirect_for_row(H5HF_hdr_t *hdr, H5HF_indirect_t *iblock, H5HF_free_section_t *row_sect)
+H5HF__sect_indirect_for_row(H5HF_hdr_t *hdr, H5HF_indirect_t *iblock, H5HF_free_section_t *row_sect)
{
H5HF_free_section_t *sect = NULL; /* 'Indirect' free space section to add */
H5HF_free_section_t *ret_value = NULL; /* Return value */
- FUNC_ENTER_NOAPI_NOINIT
+ FUNC_ENTER_STATIC
/*
* Check arguments.
@@ -2296,9 +2279,9 @@ H5HF_sect_indirect_for_row(H5HF_hdr_t *hdr, H5HF_indirect_t *iblock, H5HF_free_s
HDassert(row_sect->u.row.row < hdr->man_dtable.max_direct_rows);
/* Create free space section node */
- if (NULL == (sect = H5HF_sect_indirect_new(hdr, row_sect->sect_info.addr, row_sect->sect_info.size,
- iblock, iblock->block_off, row_sect->u.row.row,
- row_sect->u.row.col, row_sect->u.row.num_entries)))
+ if (NULL == (sect = H5HF__sect_indirect_new(hdr, row_sect->sect_info.addr, row_sect->sect_info.size,
+ iblock, iblock->block_off, row_sect->u.row.row,
+ row_sect->u.row.col, row_sect->u.row.num_entries)))
HGOTO_ERROR(H5E_HEAP, H5E_CANTINIT, NULL, "can't create indirect section")
/* Set # of direct rows covered */
@@ -2322,11 +2305,11 @@ H5HF_sect_indirect_for_row(H5HF_hdr_t *hdr, H5HF_indirect_t *iblock, H5HF_free_s
done:
if (!ret_value && sect)
- if (H5HF_sect_indirect_free(sect) < 0)
+ if (H5HF__sect_indirect_free(sect) < 0)
HDONE_ERROR(H5E_HEAP, H5E_CANTRELEASE, NULL, "can't free indirect section node")
FUNC_LEAVE_NOAPI(ret_value)
-} /* end H5HF_sect_indirect_for_row() */
+} /* end H5HF__sect_indirect_for_row() */
/*-------------------------------------------------------------------------
* Function: H5HF__sect_indirect_init_rows
@@ -2337,7 +2320,6 @@ done:
* Return: Non-negative on success/Negative on failure
*
* Programmer: Quincey Koziol
- * koziol@ncsa.uiuc.edu
* July 6 2006
*
*-------------------------------------------------------------------------
@@ -2451,7 +2433,7 @@ H5HF__sect_indirect_init_rows(H5HF_hdr_t *hdr, H5HF_free_section_t *sect, hbool_
H5HF_free_section_t *row_sect = NULL; /* 'Row' free space section to add */
/* Create 'row' free space section node */
- if (NULL == (row_sect = H5HF_sect_row_create(
+ if (NULL == (row_sect = H5HF__sect_row_create(
curr_off, (hdr->man_dtable.row_block_size[u] - dblock_overhead), first_child, u,
row_col, row_entries, sect)))
HGOTO_ERROR(H5E_HEAP, H5E_CANTCREATE, FAIL, "creation failed for child row section")
@@ -2488,20 +2470,20 @@ H5HF__sect_indirect_init_rows(H5HF_hdr_t *hdr, H5HF_free_section_t *sect, hbool_
unsigned v; /* Local index variable */
/* Compute info about row's indirect blocks for child section */
- child_nrows = H5HF_dtable_size_to_rows(&hdr->man_dtable, hdr->man_dtable.row_block_size[u]);
+ child_nrows = H5HF__dtable_size_to_rows(&hdr->man_dtable, hdr->man_dtable.row_block_size[u]);
child_nentries = child_nrows * hdr->man_dtable.cparam.width;
/* Add an indirect section for each indirect block in the row */
for (v = 0; v < row_entries; v++) {
- hbool_t did_protect; /* Whether we protected the indirect block or not */
+ hbool_t did_protect = FALSE; /* Whether we protected the indirect block or not */
/* Try to get the child section's indirect block, if it's available */
if (sect->sect_info.state == H5FS_SECT_LIVE) {
haddr_t child_iblock_addr; /* Child indirect block's address on disk */
/* Get the address of the child indirect block */
- if (H5HF_man_iblock_entry_addr(sect->u.indirect.u.iblock, curr_entry,
- &child_iblock_addr) < 0)
+ if (H5HF__man_iblock_entry_addr(sect->u.indirect.u.iblock, curr_entry,
+ &child_iblock_addr) < 0)
HGOTO_ERROR(H5E_HEAP, H5E_CANTGET, FAIL,
"unable to retrieve child indirect block's address")
@@ -2520,8 +2502,8 @@ H5HF__sect_indirect_init_rows(H5HF_hdr_t *hdr, H5HF_free_section_t *sect, hbool_
child_iblock = NULL;
/* Create free space section node */
- if (NULL == (child_sect = H5HF_sect_indirect_new(hdr, curr_off, (hsize_t)0, child_iblock,
- curr_off, 0, 0, child_nentries)))
+ if (NULL == (child_sect = H5HF__sect_indirect_new(hdr, curr_off, (hsize_t)0, child_iblock,
+ curr_off, 0, 0, child_nentries)))
HGOTO_ERROR(H5E_HEAP, H5E_CANTINIT, FAIL, "can't create indirect section")
/* Initialize rows for new indirect section */
@@ -2592,7 +2574,6 @@ done:
* Return: Non-negative on success/Negative on failure
*
* Programmer: Quincey Koziol
- * koziol@ncsa.uiuc.edu
* July 3 2006
*
*-------------------------------------------------------------------------
@@ -2636,8 +2617,8 @@ H5HF__sect_indirect_add(H5HF_hdr_t *hdr, H5HF_indirect_t *iblock, unsigned start
sect_off += hdr->man_dtable.row_block_size[start_row] * start_col;
/* Create free space section node */
- if (NULL == (sect = H5HF_sect_indirect_new(hdr, sect_off, (hsize_t)0, iblock, iblock->block_off,
- start_row, start_col, nentries)))
+ if (NULL == (sect = H5HF__sect_indirect_new(hdr, sect_off, (hsize_t)0, iblock, iblock->block_off,
+ start_row, start_col, nentries)))
HGOTO_ERROR(H5E_HEAP, H5E_CANTINIT, FAIL, "can't create indirect section")
/* Initialize rows for new indirect section */
@@ -2654,31 +2635,30 @@ H5HF__sect_indirect_add(H5HF_hdr_t *hdr, H5HF_indirect_t *iblock, unsigned start
done:
if (ret_value < 0 && sect)
- if (H5HF_sect_indirect_free(sect) < 0)
+ if (H5HF__sect_indirect_free(sect) < 0)
HDONE_ERROR(H5E_HEAP, H5E_CANTRELEASE, FAIL, "can't free indirect section node")
FUNC_LEAVE_NOAPI(ret_value)
} /* end H5HF__sect_indirect_add() */
/*-------------------------------------------------------------------------
- * Function: H5HF_sect_indirect_decr
+ * Function: H5HF__sect_indirect_decr
*
* Purpose: Decrement ref. count on indirect section
*
* Return: Non-negative on success/Negative on failure
*
* Programmer: Quincey Koziol
- * koziol@ncsa.uiuc.edu
* July 6 2006
*
*-------------------------------------------------------------------------
*/
static herr_t
-H5HF_sect_indirect_decr(H5HF_free_section_t *sect)
+H5HF__sect_indirect_decr(H5HF_free_section_t *sect)
{
herr_t ret_value = SUCCEED; /* Return value */
- FUNC_ENTER_NOAPI_NOINIT
+ FUNC_ENTER_STATIC
/*
* Check arguments.
@@ -2697,19 +2677,19 @@ H5HF_sect_indirect_decr(H5HF_free_section_t *sect)
par_sect = sect->u.indirect.parent;
/* Free indirect section */
- if (H5HF_sect_indirect_free(sect) < 0)
+ if (H5HF__sect_indirect_free(sect) < 0)
HGOTO_ERROR(H5E_HEAP, H5E_CANTRELEASE, FAIL, "can't free indirect section node")
/* Decrement ref. count on indirect section's parent */
if (par_sect)
- if (H5HF_sect_indirect_decr(par_sect) < 0)
+ if (H5HF__sect_indirect_decr(par_sect) < 0)
HGOTO_ERROR(H5E_HEAP, H5E_CANTRELEASE, FAIL,
"can't decrement ref. count on parent indirect section")
} /* end if */
done:
FUNC_LEAVE_NOAPI(ret_value)
-} /* end H5HF_sect_indirect_decr() */
+} /* end H5HF__sect_indirect_decr() */
/*-------------------------------------------------------------------------
* Function: H5HF__sect_indirect_revive_row
@@ -2719,7 +2699,6 @@ done:
* Return: Non-negative on success/Negative on failure
*
* Programmer: Quincey Koziol
- * koziol@ncsa.uiuc.edu
* July 3 2006
*
*-------------------------------------------------------------------------
@@ -2765,7 +2744,6 @@ done:
* Return: Non-negative on success/Negative on failure
*
* Programmer: Quincey Koziol
- * koziol@ncsa.uiuc.edu
* July 10 2006
*
*-------------------------------------------------------------------------
@@ -2787,7 +2765,7 @@ H5HF__sect_indirect_revive(H5HF_hdr_t *hdr, H5HF_free_section_t *sect, H5HF_indi
HDassert(sect_iblock);
/* Increment reference count on indirect block that free section is in */
- if (H5HF_iblock_incr(sect_iblock) < 0)
+ if (H5HF__iblock_incr(sect_iblock) < 0)
HGOTO_ERROR(H5E_HEAP, H5E_CANTDEC, FAIL, "can't decrement reference count on shared indirect block")
/* Set the pointer to the section's indirect block */
@@ -2822,7 +2800,6 @@ done:
* Return: Non-negative on success/Negative on failure
*
* Programmer: Quincey Koziol
- * koziol@ncsa.uiuc.edu
* July 10 2006
*
*-------------------------------------------------------------------------
@@ -2884,7 +2861,7 @@ H5HF__sect_indirect_reduce_row(H5HF_hdr_t *hdr, H5HF_free_section_t *row_sect, h
hbool_t is_first; /* Flag to indicate that this section is the first section in hierarchy */
/* Check if this section is the first section */
- is_first = H5HF_sect_indirect_is_first(sect);
+ is_first = H5HF__sect_indirect_is_first(sect);
/* Remove this indirect section from parent indirect section */
if (H5HF__sect_indirect_reduce(hdr, sect->u.indirect.parent, sect->u.indirect.par_entry) < 0)
@@ -3001,8 +2978,8 @@ H5HF__sect_indirect_reduce_row(H5HF_hdr_t *hdr, H5HF_free_section_t *row_sect, h
/* Create peer indirect section */
if (NULL ==
- (peer_sect = H5HF_sect_indirect_new(hdr, sect->sect_info.addr, sect->sect_info.size, iblock,
- iblock_off, start_row, start_col, peer_nentries)))
+ (peer_sect = H5HF__sect_indirect_new(hdr, sect->sect_info.addr, sect->sect_info.size, iblock,
+ iblock_off, start_row, start_col, peer_nentries)))
HGOTO_ERROR(H5E_HEAP, H5E_CANTINIT, FAIL, "can't create indirect section")
/* Set up direct row & indirect entry information for peer section */
@@ -3076,7 +3053,7 @@ done:
/* Sanity check - we should only be here if an error occurred */
HDassert(ret_value < 0);
- if (H5HF_sect_indirect_free(peer_sect) < 0)
+ if (H5HF__sect_indirect_free(peer_sect) < 0)
HDONE_ERROR(H5E_HEAP, H5E_CANTRELEASE, FAIL, "can't free indirect section node")
} /* end if */
@@ -3093,7 +3070,6 @@ done:
* Return: Non-negative on success/Negative on failure
*
* Programmer: Quincey Koziol
- * koziol@ncsa.uiuc.edu
* July 10 2006
*
*-------------------------------------------------------------------------
@@ -3133,7 +3109,7 @@ H5HF__sect_indirect_reduce(H5HF_hdr_t *hdr, H5HF_free_section_t *sect, unsigned
hbool_t is_first; /* Flag to indicate that this section is the first section in hierarchy */
/* Check if this section is the first section */
- is_first = H5HF_sect_indirect_is_first(sect);
+ is_first = H5HF__sect_indirect_is_first(sect);
/* Reduce parent indirect section */
if (H5HF__sect_indirect_reduce(hdr, sect->u.indirect.parent, sect->u.indirect.par_entry) < 0)
@@ -3229,8 +3205,8 @@ H5HF__sect_indirect_reduce(H5HF_hdr_t *hdr, H5HF_free_section_t *sect, unsigned
/* Update the number of entries in current section & calculate it's span size */
/* (Will use this to compute the section address for the peer section */
sect->u.indirect.num_entries = new_nentries;
- sect->u.indirect.span_size = H5HF_dtable_span_size(&hdr->man_dtable, sect->u.indirect.row,
- sect->u.indirect.col, new_nentries);
+ sect->u.indirect.span_size = H5HF__dtable_span_size(&hdr->man_dtable, sect->u.indirect.row,
+ sect->u.indirect.col, new_nentries);
HDassert(sect->u.indirect.span_size > 0);
/* Compute address of peer indirect section */
@@ -3239,9 +3215,9 @@ H5HF__sect_indirect_reduce(H5HF_hdr_t *hdr, H5HF_free_section_t *sect, unsigned
peer_sect_addr += hdr->man_dtable.row_block_size[child_row];
/* Create peer indirect section */
- if (NULL == (peer_sect = H5HF_sect_indirect_new(hdr, peer_sect_addr, sect->sect_info.size, iblock,
- iblock_off, peer_start_row, peer_start_col,
- peer_nentries)))
+ if (NULL == (peer_sect = H5HF__sect_indirect_new(hdr, peer_sect_addr, sect->sect_info.size,
+ iblock, iblock_off, peer_start_row,
+ peer_start_col, peer_nentries)))
HGOTO_ERROR(H5E_HEAP, H5E_CANTINIT, FAIL, "can't create indirect section")
/* Set up direct row & indirect entry information for peer section */
@@ -3305,7 +3281,7 @@ H5HF__sect_indirect_reduce(H5HF_hdr_t *hdr, H5HF_free_section_t *sect, unsigned
/* Decrement # of sections which depend on this row */
/* (Must be last as section can be freed) */
- if (H5HF_sect_indirect_decr(sect) < 0)
+ if (H5HF__sect_indirect_decr(sect) < 0)
HGOTO_ERROR(H5E_HEAP, H5E_CANTRELEASE, FAIL, "can't decrement section's ref. count ")
done:
@@ -3315,7 +3291,7 @@ done:
/* Sanity check - we should only be here if an error occurred */
HDassert(ret_value < 0);
- if (H5HF_sect_indirect_free(peer_sect) < 0)
+ if (H5HF__sect_indirect_free(peer_sect) < 0)
HDONE_ERROR(H5E_HEAP, H5E_CANTRELEASE, FAIL, "can't free indirect section node")
} /* end if */
@@ -3323,24 +3299,23 @@ done:
} /* end H5HF__sect_indirect_reduce() */
/*-------------------------------------------------------------------------
- * Function: H5HF_sect_indirect_is_first
+ * Function: H5HF__sect_indirect_is_first
*
* Purpose: Check if indirect section is first in all parents
*
* Return: Non-negative (TRUE/FALSE) on success/<can't fail>
*
* Programmer: Quincey Koziol
- * koziol@ncsa.uiuc.edu
* July 17 2006
*
*-------------------------------------------------------------------------
*/
static hbool_t
-H5HF_sect_indirect_is_first(H5HF_free_section_t *sect)
+H5HF__sect_indirect_is_first(H5HF_free_section_t *sect)
{
hbool_t ret_value = FALSE; /* Return value */
- FUNC_ENTER_NOAPI_NOINIT_NOERR
+ FUNC_ENTER_STATIC_NOERR
/* Sanity check */
HDassert(sect);
@@ -3348,13 +3323,13 @@ H5HF_sect_indirect_is_first(H5HF_free_section_t *sect)
/* Recurse to parent */
if (sect->u.indirect.parent) {
if (sect->sect_info.addr == sect->u.indirect.parent->sect_info.addr)
- ret_value = H5HF_sect_indirect_is_first(sect->u.indirect.parent);
+ ret_value = H5HF__sect_indirect_is_first(sect->u.indirect.parent);
} /* end if */
else
ret_value = TRUE;
FUNC_LEAVE_NOAPI(ret_value)
-} /* end H5HF_sect_indirect_is_first() */
+} /* end H5HF__sect_indirect_is_first() */
/*-------------------------------------------------------------------------
* Function: H5HF__sect_indirect_first
@@ -3364,7 +3339,6 @@ H5HF_sect_indirect_is_first(H5HF_free_section_t *sect)
* Return: Non-negative on success/Negative on failure
*
* Programmer: Quincey Koziol
- * koziol@ncsa.uiuc.edu
* July 10 2006
*
*-------------------------------------------------------------------------
@@ -3408,22 +3382,21 @@ done:
} /* end H5HF__sect_indirect_first() */
/*-------------------------------------------------------------------------
- * Function: H5HF_sect_indirect_get_iblock
+ * Function: H5HF__sect_indirect_get_iblock
*
* Purpose: Retrieve the indirect block for a indirect section
*
* Return: Pointer to indirect block on success/NULL on failure
*
* Programmer: Quincey Koziol
- * koziol@ncsa.uiuc.edu
* July 9 2006
*
*-------------------------------------------------------------------------
*/
static H5HF_indirect_t *
-H5HF_sect_indirect_get_iblock(H5HF_free_section_t *sect)
+H5HF__sect_indirect_get_iblock(H5HF_free_section_t *sect)
{
- FUNC_ENTER_NOAPI_NOINIT_NOERR
+ FUNC_ENTER_STATIC_NOERR
/*
* Check arguments.
@@ -3433,7 +3406,7 @@ H5HF_sect_indirect_get_iblock(H5HF_free_section_t *sect)
HDassert(sect->sect_info.state == H5FS_SECT_LIVE);
FUNC_LEAVE_NOAPI(sect->u.indirect.u.iblock)
-} /* end H5HF_sect_indirect_get_iblock() */
+} /* end H5HF__sect_indirect_get_iblock() */
/*-------------------------------------------------------------------------
* Function: H5HF__sect_indirect_merge_row
@@ -3475,9 +3448,9 @@ H5HF__sect_indirect_merge_row(H5HF_hdr_t *hdr, H5HF_free_section_t *row_sect1, H
HDassert(row_sect2->sect_info.type == H5HF_FSPACE_SECT_FIRST_ROW);
/* Set up indirect section information */
- sect1 = H5HF_sect_indirect_top(row_sect1->u.row.under);
+ sect1 = H5HF__sect_indirect_top(row_sect1->u.row.under);
HDassert(sect1);
- sect2 = H5HF_sect_indirect_top(row_sect2->u.row.under);
+ sect2 = H5HF__sect_indirect_top(row_sect2->u.row.under);
HDassert(sect2);
/* Sanity check some assumptions about the indirect sections */
@@ -3653,12 +3626,12 @@ H5HF__sect_indirect_merge_row(H5HF_hdr_t *hdr, H5HF_free_section_t *row_sect1, H
/* Decrement ref. count on second indirect section's parent */
HDassert(sect2->u.indirect.rc == 0);
if (sect2->u.indirect.parent)
- if (H5HF_sect_indirect_decr(sect2->u.indirect.parent) < 0)
+ if (H5HF__sect_indirect_decr(sect2->u.indirect.parent) < 0)
HGOTO_ERROR(H5E_HEAP, H5E_CANTRELEASE, FAIL,
"can't decrement ref. count on parent indirect section")
/* Free second indirect section */
- if (H5HF_sect_indirect_free(sect2) < 0)
+ if (H5HF__sect_indirect_free(sect2) < 0)
HGOTO_ERROR(H5E_HEAP, H5E_CANTRELEASE, FAIL, "can't free indirect section node")
/* Re-add the second section's first row */
@@ -3737,8 +3710,8 @@ H5HF__sect_indirect_build_parent(H5HF_hdr_t *hdr, H5HF_free_section_t *sect)
HDassert(par_row >= hdr->man_dtable.max_direct_rows);
/* Create parent indirect section */
- if (NULL == (par_sect = H5HF_sect_indirect_new(hdr, sect->sect_info.addr, sect->sect_info.size,
- par_iblock, par_block_off, par_row, par_col, 1)))
+ if (NULL == (par_sect = H5HF__sect_indirect_new(hdr, sect->sect_info.addr, sect->sect_info.size,
+ par_iblock, par_block_off, par_row, par_col, 1)))
HGOTO_ERROR(H5E_HEAP, H5E_CANTINIT, FAIL, "can't create indirect section")
/* No rows of direct blocks covered in parent, reset direct row information */
@@ -3759,7 +3732,7 @@ H5HF__sect_indirect_build_parent(H5HF_hdr_t *hdr, H5HF_free_section_t *sect)
done:
if (ret_value < 0)
- if (par_sect && H5HF_sect_indirect_free(par_sect) < 0)
+ if (par_sect && H5HF__sect_indirect_free(par_sect) < 0)
HDONE_ERROR(H5E_HEAP, H5E_CANTRELEASE, FAIL, "can't free indirect section node")
FUNC_LEAVE_NOAPI(ret_value)
@@ -3813,7 +3786,7 @@ H5HF__sect_indirect_shrink(H5HF_hdr_t *hdr, H5HF_free_section_t *sect)
HGOTO_ERROR(H5E_HEAP, H5E_CANTRELEASE, FAIL, "can't free child section node")
/* Free the indirect section itself */
- if (H5HF_sect_indirect_free(sect) < 0)
+ if (H5HF__sect_indirect_free(sect) < 0)
HGOTO_ERROR(H5E_HEAP, H5E_CANTRELEASE, FAIL, "can't free indirect section node")
done:
@@ -3821,7 +3794,7 @@ done:
} /* end H5HF__sect_indirect_shrink() */
/*-------------------------------------------------------------------------
- * Function: H5HF_sect_indirect_serialize
+ * Function: H5HF__sect_indirect_serialize
*
* Purpose: Serialize a "live" indirect section into a buffer
*
@@ -3835,11 +3808,11 @@ done:
*-------------------------------------------------------------------------
*/
static herr_t
-H5HF_sect_indirect_serialize(H5HF_hdr_t *hdr, const H5HF_free_section_t *sect, uint8_t *buf)
+H5HF__sect_indirect_serialize(H5HF_hdr_t *hdr, const H5HF_free_section_t *sect, uint8_t *buf)
{
herr_t ret_value = SUCCEED; /* Return value */
- FUNC_ENTER_NOAPI_NOINIT
+ FUNC_ENTER_STATIC
/* Check arguments. */
HDassert(hdr);
@@ -3849,7 +3822,7 @@ H5HF_sect_indirect_serialize(H5HF_hdr_t *hdr, const H5HF_free_section_t *sect, u
/* Check if this indirect section has a parent & forward if this section is first */
if (sect->u.indirect.parent) {
if (sect->sect_info.addr == sect->u.indirect.parent->sect_info.addr)
- if (H5HF_sect_indirect_serialize(hdr, sect->u.indirect.parent, buf) < 0)
+ if (H5HF__sect_indirect_serialize(hdr, sect->u.indirect.parent, buf) < 0)
HGOTO_ERROR(H5E_HEAP, H5E_CANTSERIALIZE, FAIL,
"can't serialize indirect section's parent indirect section")
} /* end if */
@@ -3874,7 +3847,7 @@ H5HF_sect_indirect_serialize(H5HF_hdr_t *hdr, const H5HF_free_section_t *sect, u
done:
FUNC_LEAVE_NOAPI(ret_value)
-} /* H5HF_sect_indirect_serialize() */
+} /* H5HF__sect_indirect_serialize() */
/*-------------------------------------------------------------------------
* Function: H5HF__sect_indirect_deserialize
@@ -3925,8 +3898,8 @@ H5HF__sect_indirect_deserialize(H5HF_hdr_t *hdr, const uint8_t *buf, haddr_t sec
UINT16DECODE(buf, nentries);
/* Create free space section node */
- if (NULL == (new_sect = H5HF_sect_indirect_new(hdr, sect_addr, sect_size, NULL, iblock_off, start_row,
- start_col, nentries)))
+ if (NULL == (new_sect = H5HF__sect_indirect_new(hdr, sect_addr, sect_size, NULL, iblock_off, start_row,
+ start_col, nentries)))
HGOTO_ERROR(H5E_HEAP, H5E_CANTINIT, NULL, "can't create indirect section")
/* Compute start entry */
@@ -3954,7 +3927,7 @@ done:
} /* H5HF__sect_indirect_deserialize() */
/*-------------------------------------------------------------------------
- * Function: H5HF_sect_indirect_free
+ * Function: H5HF__sect_indirect_free
*
* Purpose: Free a 'indirect' section node
*
@@ -3968,12 +3941,12 @@ done:
*-------------------------------------------------------------------------
*/
static herr_t
-H5HF_sect_indirect_free(H5HF_free_section_t *sect)
+H5HF__sect_indirect_free(H5HF_free_section_t *sect)
{
H5HF_indirect_t *iblock = NULL; /* Indirect block for section */
herr_t ret_value = SUCCEED; /* Return value */
- FUNC_ENTER_NOAPI_NOINIT
+ FUNC_ENTER_STATIC
HDassert(sect);
@@ -3984,22 +3957,21 @@ H5HF_sect_indirect_free(H5HF_free_section_t *sect)
sect->u.indirect.indir_ents = (H5HF_free_section_t **)H5MM_xfree(sect->u.indirect.indir_ents);
/* Check for live reference to an indirect block */
- if (sect->sect_info.state == H5FS_SECT_LIVE) {
+ if (sect->sect_info.state == H5FS_SECT_LIVE)
/* Get indirect block, if there was one */
if (sect->u.indirect.u.iblock)
iblock = sect->u.indirect.u.iblock;
- } /* end if */
/* Release the sections */
- if (H5HF_sect_node_free(sect, iblock) < 0)
+ if (H5HF__sect_node_free(sect, iblock) < 0)
HGOTO_ERROR(H5E_HEAP, H5E_CANTRELEASE, FAIL, "can't free section node")
done:
FUNC_LEAVE_NOAPI(ret_value)
-} /* H5HF_sect_indirect_free() */
+} /* H5HF__sect_indirect_free() */
/*-------------------------------------------------------------------------
- * Function: H5HF_sect_indirect_valid
+ * Function: H5HF__sect_indirect_valid
*
* Purpose: Check the validity of a section
*
@@ -4012,7 +3984,7 @@ done:
*-------------------------------------------------------------------------
*/
static herr_t
-H5HF_sect_indirect_valid(const H5HF_hdr_t *hdr, const H5HF_free_section_t *sect)
+H5HF__sect_indirect_valid(const H5HF_hdr_t *hdr, const H5HF_free_section_t *sect)
{
unsigned start_row; /* Row for first block covered */
unsigned start_col; /* Column for first block covered */
@@ -4021,7 +3993,7 @@ H5HF_sect_indirect_valid(const H5HF_hdr_t *hdr, const H5HF_free_section_t *sect)
unsigned end_entry; /* Entry for last block covered */
unsigned u; /* Local index variable */
- FUNC_ENTER_NOAPI_NOINIT_NOERR
+ FUNC_ENTER_STATIC_NOERR
/* Sanity check arguments */
HDassert(hdr);
@@ -4094,15 +4066,15 @@ H5HF_sect_indirect_valid(const H5HF_hdr_t *hdr, const H5HF_free_section_t *sect)
} /* end if */
/* Recursively check child indirect section */
- H5HF_sect_indirect_valid(hdr, tmp_child_sect);
+ H5HF__sect_indirect_valid(hdr, tmp_child_sect);
} /* end for */
} /* end if */
FUNC_LEAVE_NOAPI(SUCCEED)
-} /* H5HF_sect_indirect_valid() */
+} /* H5HF__sect_indirect_valid() */
/*-------------------------------------------------------------------------
- * Function: H5HF_sect_indirect_debug
+ * Function: H5HF__sect_indirect_debug
*
* Purpose: Dump debugging information about an indirect free space section
*
@@ -4116,9 +4088,9 @@ H5HF_sect_indirect_valid(const H5HF_hdr_t *hdr, const H5HF_free_section_t *sect)
*-------------------------------------------------------------------------
*/
static herr_t
-H5HF_sect_indirect_debug(const H5HF_free_section_t *sect, FILE *stream, int indent, int fwidth)
+H5HF__sect_indirect_debug(const H5HF_free_section_t *sect, FILE *stream, int indent, int fwidth)
{
- FUNC_ENTER_NOAPI_NOINIT_NOERR
+ FUNC_ENTER_STATIC_NOERR
/* Check arguments. */
HDassert(sect);
@@ -4129,4 +4101,4 @@ H5HF_sect_indirect_debug(const H5HF_free_section_t *sect, FILE *stream, int inde
HDfprintf(stream, "%*s%-*s %u\n", indent, "", fwidth, "Number of entries:", sect->u.indirect.num_entries);
FUNC_LEAVE_NOAPI(SUCCEED)
-} /* H5HF_sect_indirect_debug() */
+} /* H5HF__sect_indirect_debug() */
diff --git a/src/H5HFspace.c b/src/H5HFspace.c
index 1994891..d62267c 100644
--- a/src/H5HFspace.c
+++ b/src/H5HFspace.c
@@ -15,7 +15,7 @@
*
* Created: H5HFspace.c
* May 2 2006
- * Quincey Koziol <koziol@ncsa.uiuc.edu>
+ * Quincey Koziol
*
* Purpose: Space allocation routines for fractal heaps.
*
@@ -80,7 +80,6 @@
* Failure: negative
*
* Programmer: Quincey Koziol
- * koziol@ncsa.uiuc.edu
* May 2 2006
*
*-------------------------------------------------------------------------
@@ -142,7 +141,6 @@ done:
* Failure: negative
*
* Programmer: Quincey Koziol
- * koziol@ncsa.uiuc.edu
* May 15 2006
*
*-------------------------------------------------------------------------
@@ -186,7 +184,6 @@ done:
* Failure: negative
*
* Programmer: Quincey Koziol
- * koziol@ncsa.uiuc.edu
* May 2 2006
*
*-------------------------------------------------------------------------
@@ -224,7 +221,7 @@ done:
} /* end H5HF__space_find() */
/*-------------------------------------------------------------------------
- * Function: H5HF_space_revert_root_cb
+ * Function: H5HF__space_revert_root_cb
*
* Purpose: Callback routine from iterator, to reset 'parent' pointers in
* sections, when the heap is changing from having a root indirect
@@ -234,18 +231,17 @@ done:
* Failure: negative
*
* Programmer: Quincey Koziol
- * koziol@hdfgroup.org
* Feb 24 2012
*
*-------------------------------------------------------------------------
*/
static herr_t
-H5HF_space_revert_root_cb(H5FS_section_info_t *_sect, void H5_ATTR_UNUSED *_udata)
+H5HF__space_revert_root_cb(H5FS_section_info_t *_sect, void H5_ATTR_UNUSED *_udata)
{
H5HF_free_section_t *sect = (H5HF_free_section_t *)_sect; /* Section to dump info */
herr_t ret_value = SUCCEED; /* Return value */
- FUNC_ENTER_NOAPI_NOINIT
+ FUNC_ENTER_STATIC
/*
* Check arguments.
@@ -267,7 +263,7 @@ H5HF_space_revert_root_cb(H5FS_section_info_t *_sect, void H5_ATTR_UNUSED *_udat
done:
FUNC_LEAVE_NOAPI(ret_value)
-} /* end H5HF_space_revert_root_cb() */
+} /* end H5HF__space_revert_root_cb() */
/*-------------------------------------------------------------------------
* Function: H5HF__space_revert_root
@@ -279,7 +275,6 @@ done:
* Failure: negative
*
* Programmer: Quincey Koziol
- * koziol@hdfgroup.org
* Feb 23 2012
*
*-------------------------------------------------------------------------
@@ -299,7 +294,7 @@ H5HF__space_revert_root(const H5HF_hdr_t *hdr)
/* Only need to scan the sections if the free space has been initialized */
if (hdr->fspace)
/* Iterate over all sections, resetting the parent pointers in 'single' sections */
- if (H5FS_sect_iterate(hdr->f, hdr->fspace, H5HF_space_revert_root_cb, NULL) < 0)
+ if (H5FS_sect_iterate(hdr->f, hdr->fspace, H5HF__space_revert_root_cb, NULL) < 0)
HGOTO_ERROR(H5E_FSPACE, H5E_BADITER, FAIL, "can't iterate over sections to reset parent pointers")
done:
@@ -307,7 +302,7 @@ done:
} /* end H5HF__space_revert_root() */
/*-------------------------------------------------------------------------
- * Function: H5HF_space_create_root_cb
+ * Function: H5HF__space_create_root_cb
*
* Purpose: Callback routine from iterator, to set 'parent' pointers in
* sections to newly created root indirect block, when the heap
@@ -317,19 +312,18 @@ done:
* Failure: negative
*
* Programmer: Quincey Koziol
- * koziol@hdfgroup.org
* Feb 24 2012
*
*-------------------------------------------------------------------------
*/
static herr_t
-H5HF_space_create_root_cb(H5FS_section_info_t *_sect, void *_udata)
+H5HF__space_create_root_cb(H5FS_section_info_t *_sect, void *_udata)
{
H5HF_free_section_t *sect = (H5HF_free_section_t *)_sect; /* Section to dump info */
H5HF_indirect_t * root_iblock = (H5HF_indirect_t *)_udata; /* User data for callback */
herr_t ret_value = SUCCEED; /* Return value */
- FUNC_ENTER_NOAPI_NOINIT
+ FUNC_ENTER_STATIC
/*
* Check arguments.
@@ -343,7 +337,7 @@ H5HF_space_create_root_cb(H5FS_section_info_t *_sect, void *_udata)
HDassert(sect->sect_info.type == H5HF_FSPACE_SECT_SINGLE);
/* Increment ref. count on new root indirect block */
- if (H5HF_iblock_incr(root_iblock) < 0)
+ if (H5HF__iblock_incr(root_iblock) < 0)
HGOTO_ERROR(H5E_HEAP, H5E_CANTINC, FAIL,
"can't increment reference count on section's indirect block")
@@ -357,7 +351,7 @@ H5HF_space_create_root_cb(H5FS_section_info_t *_sect, void *_udata)
done:
FUNC_LEAVE_NOAPI(ret_value)
-} /* end H5HF_space_create_root_cb() */
+} /* end H5HF__space_create_root_cb() */
/*-------------------------------------------------------------------------
* Function: H5HF__space_create_root
@@ -370,7 +364,6 @@ done:
* Failure: negative
*
* Programmer: Quincey Koziol
- * koziol@hdfgroup.org
* Feb 24 2012
*
*-------------------------------------------------------------------------
@@ -392,7 +385,7 @@ H5HF__space_create_root(const H5HF_hdr_t *hdr, H5HF_indirect_t *root_iblock)
if (hdr->fspace)
/* Iterate over all sections, seting the parent pointers in 'single' sections to the new indirect
* block */
- if (H5FS_sect_iterate(hdr->f, hdr->fspace, H5HF_space_create_root_cb, root_iblock) < 0)
+ if (H5FS_sect_iterate(hdr->f, hdr->fspace, H5HF__space_create_root_cb, root_iblock) < 0)
HGOTO_ERROR(H5E_FSPACE, H5E_BADITER, FAIL, "can't iterate over sections to set parent pointers")
done:
@@ -408,7 +401,6 @@ done:
* Failure: negative
*
* Programmer: Quincey Koziol
- * koziol@hdfgroup.org
* August 14 2007
*
*-------------------------------------------------------------------------
@@ -452,7 +444,6 @@ done:
* Failure: negative
*
* Programmer: Quincey Koziol
- * koziol@ncsa.uiuc.edu
* July 24 2006
*
*-------------------------------------------------------------------------
@@ -489,7 +480,6 @@ done:
* Failure: negative
*
* Programmer: Quincey Koziol
- * koziol@ncsa.uiuc.edu
* May 2 2006
*
*-------------------------------------------------------------------------
@@ -513,9 +503,6 @@ H5HF__space_close(H5HF_hdr_t *hdr)
/* Retrieve the number of sections for this heap */
if (H5FS_sect_stats(hdr->fspace, NULL, &nsects) < 0)
HGOTO_ERROR(H5E_HEAP, H5E_CANTCOUNT, FAIL, "can't query free space section count")
-#ifdef QAK
- HDfprintf(stderr, "%s: nsects = %Hu\n", FUNC, nsects);
-#endif /* QAK */
/* Close the free space for the heap */
if (H5FS_close(hdr->f, hdr->fspace) < 0)
@@ -543,7 +530,6 @@ done:
* Failure: negative
*
* Programmer: Quincey Koziol
- * koziol@ncsa.uiuc.edu
* Aug 7 2006
*
*-------------------------------------------------------------------------
@@ -578,7 +564,6 @@ done:
* Failure: negative
*
* Programmer: Quincey Koziol
- * koziol@ncsa.uiuc.edu
* July 10 2006
*
*-------------------------------------------------------------------------
@@ -589,9 +574,6 @@ H5HF__space_sect_change_class(H5HF_hdr_t *hdr, H5HF_free_section_t *sect, uint16
herr_t ret_value = SUCCEED; /* Return value */
FUNC_ENTER_PACKAGE
-#ifdef QAK
- HDfprintf(stderr, "%s: Called\n", FUNC);
-#endif /* QAK */
/*
* Check arguments.
diff --git a/src/H5HFstat.c b/src/H5HFstat.c
index cd06595..5e5d06a 100644
--- a/src/H5HFstat.c
+++ b/src/H5HFstat.c
@@ -11,7 +11,7 @@
* help@hdfgroup.org. *
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
-/* Programmer: Quincey Koziol <koziol@ncsa.uiuc.edu>
+/* Programmer: Quincey Koziol
* Monday, March 6, 2006
*
* Purpose: Fractal heap metadata statistics functions.
diff --git a/src/H5HFtest.c b/src/H5HFtest.c
index df77926..84734d2 100644
--- a/src/H5HFtest.c
+++ b/src/H5HFtest.c
@@ -11,7 +11,7 @@
* help@hdfgroup.org. *
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
-/* Programmer: Quincey Koziol <koziol@ncsa.uiuc.edu>
+/* Programmer: Quincey Koziol
* Thursday, February 3, 2006
*
* Purpose: Fractal heap testing functions.
@@ -178,24 +178,19 @@ H5HF_cmp_cparam_test(const H5HF_create_t *cparam1, const H5HF_create_t *cparam2)
/* Don't worry about comparing the filter names right now... */
/* (they are expanded during the encode/decode process, but aren't copied
- * during the H5Z_append operation, generating false positive failures)
+ * during the H5Z_append operation, generating false positive failures -QAK)
*/
-#ifdef QAK
+#if 0
/* Check filter name */
- HDfprintf(stderr, "%s: Check 1.0\n", "H5HF_cmp_cparam_test");
- HDfprintf(stderr, "%s: cparam1->pline.filter[%Zu].name = %s\n", "H5HF_cmp_cparam_test", u,
- (cparam1->pline.filter[u].name ? cparam1->pline.filter[u].name : "<nil>"));
- HDfprintf(stderr, "%s: cparam2->pline.filter[%Zu].name = %s\n", "H5HF_cmp_cparam_test", u,
- (cparam2->pline.filter[u].name ? cparam2->pline.filter[u].name : "<nil>"));
- if (!cparam1->pline.filter[u].name && cparam2->pline.filter[u].name)
+ if(!cparam1->pline.filter[u].name && cparam2->pline.filter[u].name)
HGOTO_DONE(-1)
- else if (cparam1->pline.filter[u].name && !cparam2->pline.filter[u].name)
+ else if(cparam1->pline.filter[u].name && !cparam2->pline.filter[u].name)
HGOTO_DONE(1)
- else if (cparam1->pline.filter[u].name && cparam2->pline.filter[u].name) {
- if ((ret_value = HDstrcmp(cparam1->pline.filter[u].name, cparam2->pline.filter[u].name)))
+ else if(cparam1->pline.filter[u].name && cparam2->pline.filter[u].name) {
+ if((ret_value = HDstrcmp(cparam1->pline.filter[u].name, cparam2->pline.filter[u].name)))
HGOTO_DONE(ret_value)
} /* end if */
-#endif /* QAK */
+#endif
/* Check # of filter parameters */
if (cparam1->pline.filter[u].cd_nelmts < cparam2->pline.filter[u].cd_nelmts)
diff --git a/src/H5HFtiny.c b/src/H5HFtiny.c
index 44575d0..eca177c 100644
--- a/src/H5HFtiny.c
+++ b/src/H5HFtiny.c
@@ -15,7 +15,7 @@
*
* Created: H5HFtiny.c
* Aug 14 2006
- * Quincey Koziol <koziol@hdfgroup.org>
+ * Quincey Koziol
*
* Purpose: Routines for "tiny" objects in fractal heap
*
@@ -58,7 +58,7 @@
/********************/
/* Local Prototypes */
/********************/
-static herr_t H5HF_tiny_op_real(H5HF_hdr_t *hdr, const uint8_t *id, H5HF_operator_t op, void *op_data);
+static herr_t H5HF__tiny_op_real(H5HF_hdr_t *hdr, const uint8_t *id, H5HF_operator_t op, void *op_data);
/*********************/
/* Package Variables */
@@ -73,22 +73,21 @@ static herr_t H5HF_tiny_op_real(H5HF_hdr_t *hdr, const uint8_t *id, H5HF_operato
/*******************/
/*-------------------------------------------------------------------------
- * Function: H5HF_tiny_init
+ * Function: H5HF__tiny_init
*
* Purpose: Initialize information for tracking 'tiny' objects
*
* Return: SUCCEED/FAIL
*
* Programmer: Quincey Koziol
- * koziol@hdfgroup.org
* Aug 14 2006
*
*-------------------------------------------------------------------------
*/
herr_t
-H5HF_tiny_init(H5HF_hdr_t *hdr)
+H5HF__tiny_init(H5HF_hdr_t *hdr)
{
- FUNC_ENTER_NOAPI_NOINIT_NOERR
+ FUNC_ENTER_PACKAGE_NOERR
/*
* Check arguments.
@@ -116,32 +115,28 @@ H5HF_tiny_init(H5HF_hdr_t *hdr)
} /* end else */
FUNC_LEAVE_NOAPI(SUCCEED)
-} /* end H5HF_tiny_init() */
+} /* end H5HF__tiny_init() */
/*-------------------------------------------------------------------------
- * Function: H5HF_tiny_insert
+ * Function: H5HF__tiny_insert
*
* Purpose: Pack a 'tiny' object in a heap ID
*
* Return: SUCCEED/FAIL
*
* Programmer: Quincey Koziol
- * koziol@hdfgroup.org
* Aug 14 2006
*
*-------------------------------------------------------------------------
*/
herr_t
-H5HF_tiny_insert(H5HF_hdr_t *hdr, size_t obj_size, const void *obj, void *_id)
+H5HF__tiny_insert(H5HF_hdr_t *hdr, size_t obj_size, const void *obj, void *_id)
{
uint8_t *id = (uint8_t *)_id; /* Pointer to ID buffer */
size_t enc_obj_size; /* Encoded object size */
herr_t ret_value = SUCCEED; /* Return value */
- FUNC_ENTER_NOAPI_NOINIT
-#ifdef QAK
- HDfprintf(stderr, "%s: obj_size = %Zu\n", FUNC, obj_size);
-#endif /* QAK */
+ FUNC_ENTER_PACKAGE
/*
* Check arguments.
@@ -173,32 +168,31 @@ H5HF_tiny_insert(H5HF_hdr_t *hdr, size_t obj_size, const void *obj, void *_id)
hdr->tiny_nobjs++;
/* Mark heap header as modified */
- if (H5HF_hdr_dirty(hdr) < 0)
+ if (H5HF__hdr_dirty(hdr) < 0)
HGOTO_ERROR(H5E_HEAP, H5E_CANTDIRTY, FAIL, "can't mark heap header as dirty")
done:
FUNC_LEAVE_NOAPI(ret_value)
-} /* end H5HF_tiny_insert() */
+} /* end H5HF__tiny_insert() */
/*-------------------------------------------------------------------------
- * Function: H5HF_tiny_get_obj_len
+ * Function: H5HF__tiny_get_obj_len
*
* Purpose: Get the size of a 'tiny' object in a fractal heap
*
* Return: SUCCEED (Can't fail)
*
* Programmer: Quincey Koziol
- * koziol@hdfgroup.org
* Aug 14 2006
*
*-------------------------------------------------------------------------
*/
herr_t
-H5HF_tiny_get_obj_len(H5HF_hdr_t *hdr, const uint8_t *id, size_t *obj_len_p)
+H5HF__tiny_get_obj_len(H5HF_hdr_t *hdr, const uint8_t *id, size_t *obj_len_p)
{
size_t enc_obj_size; /* Encoded object size */
- FUNC_ENTER_NOAPI_NOINIT_NOERR
+ FUNC_ENTER_PACKAGE_NOERR
/*
* Check arguments.
@@ -220,28 +214,27 @@ H5HF_tiny_get_obj_len(H5HF_hdr_t *hdr, const uint8_t *id, size_t *obj_len_p)
*obj_len_p = enc_obj_size + 1;
FUNC_LEAVE_NOAPI(SUCCEED)
-} /* end H5HF_tiny_get_obj_len() */
+} /* end H5HF__tiny_get_obj_len() */
/*-------------------------------------------------------------------------
- * Function: H5HF_tiny_op_real
+ * Function: H5HF__tiny_op_real
*
* Purpose: Internal routine to perform operation on 'tiny' object
*
* Return: SUCCEED/FAIL
*
* Programmer: Quincey Koziol
- * koziol@hdfgroup.org
* Sep 11 2006
*
*-------------------------------------------------------------------------
*/
static herr_t
-H5HF_tiny_op_real(H5HF_hdr_t *hdr, const uint8_t *id, H5HF_operator_t op, void *op_data)
+H5HF__tiny_op_real(H5HF_hdr_t *hdr, const uint8_t *id, H5HF_operator_t op, void *op_data)
{
size_t enc_obj_size; /* Encoded object size */
herr_t ret_value = SUCCEED; /* Return value */
- FUNC_ENTER_NOAPI_NOINIT
+ FUNC_ENTER_STATIC
/*
* Check arguments.
@@ -251,8 +244,8 @@ H5HF_tiny_op_real(H5HF_hdr_t *hdr, const uint8_t *id, H5HF_operator_t op, void *
HDassert(op);
/* Get the object's encoded length */
- /* H5HF_tiny_obj_len can't fail */
- ret_value = H5HF_tiny_get_obj_len(hdr, id, &enc_obj_size);
+ /* H5HF__tiny_obj_len can't fail */
+ ret_value = H5HF__tiny_get_obj_len(hdr, id, &enc_obj_size);
/* Advance past flag byte(s) */
if (!hdr->tiny_len_extended)
@@ -271,27 +264,26 @@ H5HF_tiny_op_real(H5HF_hdr_t *hdr, const uint8_t *id, H5HF_operator_t op, void *
done:
FUNC_LEAVE_NOAPI(ret_value)
-} /* end H5HF_tiny_op_real() */
+} /* end H5HF__tiny_op_real() */
/*-------------------------------------------------------------------------
- * Function: H5HF_tiny_read
+ * Function: H5HF__tiny_read
*
* Purpose: Read a 'tiny' object from the heap
*
* Return: SUCCEED/FAIL
*
* Programmer: Quincey Koziol
- * koziol@hdfgroup.org
* Aug 8 2006
*
*-------------------------------------------------------------------------
*/
herr_t
-H5HF_tiny_read(H5HF_hdr_t *hdr, const uint8_t *id, void *obj)
+H5HF__tiny_read(H5HF_hdr_t *hdr, const uint8_t *id, void *obj)
{
herr_t ret_value = SUCCEED; /* Return value */
- FUNC_ENTER_NOAPI_NOINIT
+ FUNC_ENTER_PACKAGE
/*
* Check arguments.
@@ -301,32 +293,31 @@ H5HF_tiny_read(H5HF_hdr_t *hdr, const uint8_t *id, void *obj)
HDassert(obj);
/* Call the internal 'op' routine */
- if (H5HF_tiny_op_real(hdr, id, H5HF_op_read, obj) < 0)
+ if (H5HF__tiny_op_real(hdr, id, H5HF__op_read, obj) < 0)
HGOTO_ERROR(H5E_HEAP, H5E_CANTOPERATE, FAIL, "unable to operate on heap object")
done:
FUNC_LEAVE_NOAPI(ret_value)
-} /* end H5HF_tiny_read() */
+} /* end H5HF__tiny_read() */
/*-------------------------------------------------------------------------
- * Function: H5HF_tiny_op
+ * Function: H5HF__tiny_op
*
* Purpose: Operate directly on a 'tiny' object
*
* Return: SUCCEED/FAIL
*
* Programmer: Quincey Koziol
- * koziol@hdfgroup.org
* Sept 11 2006
*
*-------------------------------------------------------------------------
*/
herr_t
-H5HF_tiny_op(H5HF_hdr_t *hdr, const uint8_t *id, H5HF_operator_t op, void *op_data)
+H5HF__tiny_op(H5HF_hdr_t *hdr, const uint8_t *id, H5HF_operator_t op, void *op_data)
{
herr_t ret_value = SUCCEED; /* Return value */
- FUNC_ENTER_NOAPI_NOINIT
+ FUNC_ENTER_PACKAGE
/*
* Check arguments.
@@ -336,33 +327,32 @@ H5HF_tiny_op(H5HF_hdr_t *hdr, const uint8_t *id, H5HF_operator_t op, void *op_da
HDassert(op);
/* Call the internal 'op' routine routine */
- if (H5HF_tiny_op_real(hdr, id, op, op_data) < 0)
+ if (H5HF__tiny_op_real(hdr, id, op, op_data) < 0)
HGOTO_ERROR(H5E_HEAP, H5E_CANTOPERATE, FAIL, "unable to operate on heap object")
done:
FUNC_LEAVE_NOAPI(ret_value)
-} /* end H5HF_tiny_op() */
+} /* end H5HF__tiny_op() */
/*-------------------------------------------------------------------------
- * Function: H5HF_tiny_remove
+ * Function: H5HF__tiny_remove
*
* Purpose: Remove a 'tiny' object from the heap statistics
*
* Return: SUCCEED/FAIL
*
* Programmer: Quincey Koziol
- * koziol@hdfgroup.org
* Aug 14 2006
*
*-------------------------------------------------------------------------
*/
herr_t
-H5HF_tiny_remove(H5HF_hdr_t *hdr, const uint8_t *id)
+H5HF__tiny_remove(H5HF_hdr_t *hdr, const uint8_t *id)
{
size_t enc_obj_size; /* Encoded object size */
herr_t ret_value = SUCCEED; /* Return value */
- FUNC_ENTER_NOAPI_NOINIT
+ FUNC_ENTER_PACKAGE
/*
* Check arguments.
@@ -371,17 +361,17 @@ H5HF_tiny_remove(H5HF_hdr_t *hdr, const uint8_t *id)
HDassert(id);
/* Get the object's encoded length */
- /* H5HF_tiny_obj_len can't fail */
- ret_value = H5HF_tiny_get_obj_len(hdr, id, &enc_obj_size);
+ /* H5HF__tiny_obj_len can't fail */
+ ret_value = H5HF__tiny_get_obj_len(hdr, id, &enc_obj_size);
/* Update statistics about heap */
hdr->tiny_size -= enc_obj_size;
hdr->tiny_nobjs--;
/* Mark heap header as modified */
- if (H5HF_hdr_dirty(hdr) < 0)
+ if (H5HF__hdr_dirty(hdr) < 0)
HGOTO_ERROR(H5E_HEAP, H5E_CANTDIRTY, FAIL, "can't mark heap header as dirty")
done:
FUNC_LEAVE_NOAPI(ret_value)
-} /* end H5HF_tiny_remove() */
+} /* end H5HF__tiny_remove() */
diff --git a/src/H5HG.c b/src/H5HG.c
index 23dbce2..c1c574c 100644
--- a/src/H5HG.c
+++ b/src/H5HG.c
@@ -12,7 +12,7 @@
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
/*
- * Programmer: Robb Matzke <matzke@llnl.gov>
+ * Programmer: Robb Matzke
* Friday, March 27, 1998
*
* Purpose: Operations on the global heap. The global heap is the set of
diff --git a/src/H5HGcache.c b/src/H5HGcache.c
index dd7d1cd..a4c55bb 100644
--- a/src/H5HGcache.c
+++ b/src/H5HGcache.c
@@ -15,7 +15,7 @@
*
* Created: H5HGcache.c
* Feb 5 2008
- * Quincey Koziol <koziol@hdfgroup.org>
+ * Quincey Koziol
*
* Purpose: Implement global heap metadata cache methods.
*
@@ -123,7 +123,7 @@ H5HG__hdr_deserialize(H5HG_heap_t *heap, const uint8_t *image, const H5F_t *f)
HDassert(f);
/* Magic number */
- if (HDmemcmp(image, H5HG_MAGIC, (size_t)H5_SIZEOF_MAGIC))
+ if (HDmemcmp(image, H5HG_MAGIC, (size_t)H5_SIZEOF_MAGIC) != 0)
HGOTO_ERROR(H5E_HEAP, H5E_BADVALUE, FAIL, "bad global heap collection signature")
image += H5_SIZEOF_MAGIC;
diff --git a/src/H5HGdbg.c b/src/H5HGdbg.c
index 8c1ae47..51a74ec 100644
--- a/src/H5HGdbg.c
+++ b/src/H5HGdbg.c
@@ -11,7 +11,7 @@
* help@hdfgroup.org. *
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
-/* Programmer: Quincey Koziol <koziol@ncsa.uiuc.edu>
+/* Programmer: Quincey Koziol
* Wednesday, July 9, 2003
*
* Purpose: Global Heap object debugging functions.
@@ -68,7 +68,6 @@
* Return: Non-negative on success/Negative on failure
*
* Programmer: Robb Matzke
- * matzke@llnl.gov
* Mar 27, 1998
*
*-------------------------------------------------------------------------
diff --git a/src/H5HGquery.c b/src/H5HGquery.c
index 2239031..c24a414 100644
--- a/src/H5HGquery.c
+++ b/src/H5HGquery.c
@@ -12,7 +12,7 @@
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
/*
- * Programmer: Quincey Koziol <koziol@hdfgroup.org>
+ * Programmer: Quincey Koziol
* Wednesday, July 20, 2011
*
* Purpose: Query routines for global heaps.
diff --git a/src/H5HL.c b/src/H5HL.c
index 43c6033..50d24c3 100644
--- a/src/H5HL.c
+++ b/src/H5HL.c
@@ -15,7 +15,7 @@
*
* Created: H5HL.c
* Jul 16 1997
- * Robb Matzke <matzke@llnl.gov>
+ * Robb Matzke
*
* Purpose: Heap functions for the local heaps used by symbol
* tables to store names (among other things).
@@ -392,7 +392,7 @@ BEGIN_FUNC(PRIV, ERR, void *, NULL, NULL, H5HL_offset_into(const H5HL_t *heap, s
ret_value = heap->dblk_image + offset;
CATCH
- /* No special processing on errors */
+/* No special processing on errors */
END_FUNC(PRIV) /* end H5HL_offset_into() */
/*-------------------------------------------------------------------------
@@ -930,7 +930,7 @@ BEGIN_FUNC(PRIV, ERR, herr_t, SUCCEED, FAIL, H5HL_get_size(H5F_t *f, haddr_t add
H5HL_cache_prfx_ud_t prfx_udata; /* User data for protecting local heap prefix */
H5HL_prfx_t * prfx = NULL; /* Local heap prefix */
- H5HL_t * heap; /* Heap data structure */
+ H5HL_t * heap = NULL; /* Heap data structure */
/* check arguments */
HDassert(f);
@@ -977,7 +977,7 @@ BEGIN_FUNC(PRIV, ERR, herr_t, SUCCEED, FAIL, H5HL_heapsize(H5F_t *f, haddr_t add
H5HL_cache_prfx_ud_t prfx_udata; /* User data for protecting local heap prefix */
H5HL_prfx_t * prfx = NULL; /* Local heap prefix */
- H5HL_t * heap; /* Heap data structure */
+ H5HL_t * heap = NULL; /* Heap data structure */
/* check arguments */
HDassert(f);
diff --git a/src/H5HLcache.c b/src/H5HLcache.c
index fb5c7a0..989a4f5 100644
--- a/src/H5HLcache.c
+++ b/src/H5HLcache.c
@@ -15,7 +15,7 @@
*
* Created: H5HLcache.c
* Feb 5 2008
- * Quincey Koziol <koziol@hdfgroup.org>
+ * Quincey Koziol
*
* Purpose: Implement local heap metadata cache methods.
*
@@ -163,7 +163,7 @@ H5HL__hdr_deserialize(H5HL_t *heap, const uint8_t *image, H5HL_cache_prfx_ud_t *
HDassert(udata);
/* Check magic number */
- if (HDmemcmp(image, H5HL_MAGIC, (size_t)H5_SIZEOF_MAGIC))
+ if (HDmemcmp(image, H5HL_MAGIC, (size_t)H5_SIZEOF_MAGIC) != 0)
HGOTO_ERROR(H5E_HEAP, H5E_BADVALUE, FAIL, "bad local heap signature")
image += H5_SIZEOF_MAGIC;
@@ -468,11 +468,11 @@ done:
if (!ret_value) {
if (prfx) {
if (FAIL == H5HL__prfx_dest(prfx))
- HGOTO_ERROR(H5E_HEAP, H5E_CANTRELEASE, NULL, "unable to destroy local heap prefix");
+ HDONE_ERROR(H5E_HEAP, H5E_CANTRELEASE, NULL, "unable to destroy local heap prefix");
} /* end if */
else {
if (heap && FAIL == H5HL__dest(heap))
- HGOTO_ERROR(H5E_HEAP, H5E_CANTRELEASE, NULL, "unable to destroy local heap");
+ HDONE_ERROR(H5E_HEAP, H5E_CANTRELEASE, NULL, "unable to destroy local heap");
} /* end else */
} /* end if */
@@ -747,7 +747,7 @@ done:
/* Release the [possibly partially initialized] local heap on errors */
if (!ret_value && dblk)
if (FAIL == H5HL__dblk_dest(dblk))
- HGOTO_ERROR(H5E_HEAP, H5E_CANTRELEASE, NULL, "unable to destroy local heap data block");
+ HDONE_ERROR(H5E_HEAP, H5E_CANTRELEASE, NULL, "unable to destroy local heap data block");
FUNC_LEAVE_NOAPI(ret_value)
} /* end H5HL__cache_datablock_deserialize() */
diff --git a/src/H5HLdbg.c b/src/H5HLdbg.c
index c3bfef7..d0cfa96 100644
--- a/src/H5HLdbg.c
+++ b/src/H5HLdbg.c
@@ -11,7 +11,7 @@
* help@hdfgroup.org. *
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
-/* Programmer: Quincey Koziol <koziol@hdfgroup.org>
+/* Programmer: Quincey Koziol
* Wednesday, July 9, 2003
*
* Purpose: Local Heap object debugging functions.
@@ -64,10 +64,9 @@ BEGIN_FUNC(PRIV, ERR, herr_t, SUCCEED, FAIL,
H5E_THROW(H5E_CANTPROTECT, "unable to load/protect local heap");
HDfprintf(stream, "%*sLocal Heap...\n", indent, "");
- HDfprintf(stream, "%*s%-*s %lu\n", indent, "", fwidth,
- "Header size (in bytes):", (unsigned long)h->prfx_size);
- HDfprintf(stream, "%*s%-*s %a\n", indent, "", fwidth, "Address of heap data:", h->dblk_addr);
- HDfprintf(stream, "%*s%-*s %Zu\n", indent, "", fwidth, "Data bytes allocated for heap:", h->dblk_size);
+ HDfprintf(stream, "%*s%-*s %zu\n", indent, "", fwidth, "Header size (in bytes):", h->prfx_size);
+ HDfprintf(stream, "%*s%-*s %" PRIuHADDR "\n", indent, "", fwidth, "Address of heap data:", h->dblk_addr);
+ HDfprintf(stream, "%*s%-*s %zu\n", indent, "", fwidth, "Data bytes allocated for heap:", h->dblk_size);
/* Traverse the free list and check that all free blocks fall within
* the heap and that no two free blocks point to the same region of
@@ -81,7 +80,7 @@ BEGIN_FUNC(PRIV, ERR, herr_t, SUCCEED, FAIL,
char temp_str[32];
HDsnprintf(temp_str, sizeof(temp_str), "Block #%d:", free_block);
- HDfprintf(stream, "%*s%-*s %8Zu, %8Zu\n", indent + 3, "", MAX(0, fwidth - 9), temp_str,
+ HDfprintf(stream, "%*s%-*s %8zu, %8zu\n", indent + 3, "", MAX(0, fwidth - 9), temp_str,
freelist->offset, freelist->size);
if ((freelist->offset + freelist->size) > h->dblk_size)
HDfprintf(stream, "***THAT FREE BLOCK IS OUT OF BOUNDS!\n");
diff --git a/src/H5HLdblk.c b/src/H5HLdblk.c
index b40d4d6..f771de5 100644
--- a/src/H5HLdblk.c
+++ b/src/H5HLdblk.c
@@ -15,7 +15,7 @@
*
* Created: H5HLdblk.c
* Summer 2012
- * Dana Robinson <derobins@hdfgroup.org>
+ * Dana Robinson
*
* Purpose: Data block routines for local heaps.
*
diff --git a/src/H5HLint.c b/src/H5HLint.c
index ace6a76..069bad8 100644
--- a/src/H5HLint.c
+++ b/src/H5HLint.c
@@ -15,7 +15,7 @@
*
* Created: H5HLint.c
* Oct 12 2008
- * Quincey Koziol <koziol@hdfgroup.org>
+ * Quincey Koziol
*
* Purpose: Local heap internal routines.
*
diff --git a/src/H5HLprfx.c b/src/H5HLprfx.c
index 3a8bcc7..90f6c74 100644
--- a/src/H5HLprfx.c
+++ b/src/H5HLprfx.c
@@ -15,7 +15,7 @@
*
* Created: H5HLprfx.c
* Summer 2012
- * Dana Robinson <derobins@hdfgroup.org>
+ * Dana Robinson
*
* Purpose: Prefix routines for local heaps.
*
diff --git a/src/H5HP.c b/src/H5HP.c
index d5bff56..d164223 100644
--- a/src/H5HP.c
+++ b/src/H5HP.c
@@ -45,10 +45,10 @@ struct H5HP_t {
};
/* Static functions */
-static herr_t H5HP_swim_max(H5HP_t *heap, size_t loc);
-static herr_t H5HP_swim_min(H5HP_t *heap, size_t loc);
-static herr_t H5HP_sink_max(H5HP_t *heap, size_t loc);
-static herr_t H5HP_sink_min(H5HP_t *heap, size_t loc);
+static herr_t H5HP__swim_max(H5HP_t *heap, size_t loc);
+static herr_t H5HP__swim_min(H5HP_t *heap, size_t loc);
+static herr_t H5HP__sink_max(H5HP_t *heap, size_t loc);
+static herr_t H5HP__sink_min(H5HP_t *heap, size_t loc);
/* Declare a free list to manage the H5HP_t struct */
H5FL_DEFINE_STATIC(H5HP_t);
@@ -58,11 +58,11 @@ H5FL_SEQ_DEFINE_STATIC(H5HP_ent_t);
/*--------------------------------------------------------------------------
NAME
- H5HP_swim_max
+ H5HP__swim_max
PURPOSE
Restore heap condition by moving an object upward
USAGE
- herr_t H5HP_swim_max(heap, loc)
+ herr_t H5HP__swim_max(heap, loc)
H5HP_t *heap; IN/OUT: Pointer to heap to modify
size_t loc; IN: Location to start from
@@ -78,13 +78,13 @@ H5FL_SEQ_DEFINE_STATIC(H5HP_ent_t);
REVISION LOG
--------------------------------------------------------------------------*/
static herr_t
-H5HP_swim_max(H5HP_t *heap, size_t loc)
+H5HP__swim_max(H5HP_t *heap, size_t loc)
{
int val; /* Temporary copy value of object to move in heap */
H5HP_info_t *obj; /* Temporary pointer to object to move in heap */
herr_t ret_value = SUCCEED; /* Return value */
- FUNC_ENTER_NOAPI_NOINIT_NOERR
+ FUNC_ENTER_STATIC_NOERR
/* Get copies of the information about the object to move in the heap */
val = heap->heap[loc].val;
@@ -111,15 +111,15 @@ H5HP_swim_max(H5HP_t *heap, size_t loc)
heap->heap[loc].obj->heap_loc = loc;
FUNC_LEAVE_NOAPI(ret_value);
-} /* end H5HP_swim_max() */
+} /* end H5HP__swim_max() */
/*--------------------------------------------------------------------------
NAME
- H5HP_swim_min
+ H5HP__swim_min
PURPOSE
Restore heap condition by moving an object upward
USAGE
- herr_t H5HP_swim_min(heap, loc)
+ herr_t H5HP__swim_min(heap, loc)
H5HP_t *heap; IN/OUT: Pointer to heap to modify
size_t loc; IN: Location to start from
@@ -135,13 +135,13 @@ H5HP_swim_max(H5HP_t *heap, size_t loc)
REVISION LOG
--------------------------------------------------------------------------*/
static herr_t
-H5HP_swim_min(H5HP_t *heap, size_t loc)
+H5HP__swim_min(H5HP_t *heap, size_t loc)
{
int val; /* Temporary copy value of object to move in heap */
H5HP_info_t *obj; /* Temporary pointer to object to move in heap */
herr_t ret_value = SUCCEED; /* Return value */
- FUNC_ENTER_NOAPI_NOINIT_NOERR
+ FUNC_ENTER_STATIC_NOERR
/* Get copies of the information about the object to move in the heap */
val = heap->heap[loc].val;
@@ -168,15 +168,15 @@ H5HP_swim_min(H5HP_t *heap, size_t loc)
heap->heap[loc].obj->heap_loc = loc;
FUNC_LEAVE_NOAPI(ret_value);
-} /* end H5HP_swim_min() */
+} /* end H5HP__swim_min() */
/*--------------------------------------------------------------------------
NAME
- H5HP_sink_max
+ H5HP__sink_max
PURPOSE
Restore heap condition by moving an object downward
USAGE
- herr_t H5HP_sink_max(heap, loc)
+ herr_t H5HP__sink_max(heap, loc)
H5HP_t *heap; IN/OUT: Pointer to heap to modify
size_t loc; IN: Location to start from
@@ -192,13 +192,13 @@ H5HP_swim_min(H5HP_t *heap, size_t loc)
REVISION LOG
--------------------------------------------------------------------------*/
static herr_t
-H5HP_sink_max(H5HP_t *heap, size_t loc)
+H5HP__sink_max(H5HP_t *heap, size_t loc)
{
int val; /* Temporary copy value of object to move in heap */
void * obj; /* Temporary pointer to object to move in heap */
herr_t ret_value = SUCCEED; /* Return value */
- FUNC_ENTER_NOAPI_NOINIT_NOERR
+ FUNC_ENTER_STATIC_NOERR
/* Get copies of the information about the object to move in the heap */
val = heap->heap[loc].val;
@@ -236,15 +236,15 @@ H5HP_sink_max(H5HP_t *heap, size_t loc)
heap->heap[loc].obj->heap_loc = loc;
FUNC_LEAVE_NOAPI(ret_value);
-} /* end H5HP_sink_max() */
+} /* end H5HP__sink_max() */
/*--------------------------------------------------------------------------
NAME
- H5HP_sink_min
+ H5HP__sink_min
PURPOSE
Restore heap condition by moving an object downward
USAGE
- herr_t H5HP_sink_min(heap, loc)
+ herr_t H5HP__sink_min(heap, loc)
H5HP_t *heap; IN/OUT: Pointer to heap to modify
size_t loc; IN: Location to start from
@@ -260,13 +260,13 @@ H5HP_sink_max(H5HP_t *heap, size_t loc)
REVISION LOG
--------------------------------------------------------------------------*/
static herr_t
-H5HP_sink_min(H5HP_t *heap, size_t loc)
+H5HP__sink_min(H5HP_t *heap, size_t loc)
{
int val; /* Temporary copy value of object to move in heap */
void * obj; /* Temporary pointer to object to move in heap */
herr_t ret_value = SUCCEED; /* Return value */
- FUNC_ENTER_NOAPI_NOINIT_NOERR
+ FUNC_ENTER_STATIC_NOERR
/* Get copies of the information about the object to move in the heap */
val = heap->heap[loc].val;
@@ -304,7 +304,7 @@ H5HP_sink_min(H5HP_t *heap, size_t loc)
heap->heap[loc].obj->heap_loc = loc;
FUNC_LEAVE_NOAPI(ret_value);
-} /* end H5HP_sink_min() */
+} /* end H5HP__sink_min() */
/*--------------------------------------------------------------------------
NAME
@@ -485,11 +485,11 @@ H5HP_insert(H5HP_t *heap, int val, void *obj)
/* Restore heap condition */
if (heap->type == H5HP_MAX_HEAP) {
- if (H5HP_swim_max(heap, heap->nobjs) < 0)
+ if (H5HP__swim_max(heap, heap->nobjs) < 0)
HGOTO_ERROR(H5E_HEAP, H5E_CANTINSERT, FAIL, "unable to restore heap condition");
} /* end if */
else {
- if (H5HP_swim_min(heap, heap->nobjs) < 0)
+ if (H5HP__swim_min(heap, heap->nobjs) < 0)
HGOTO_ERROR(H5E_HEAP, H5E_CANTINSERT, FAIL, "unable to restore heap condition");
} /* end else */
@@ -609,11 +609,11 @@ H5HP_remove(H5HP_t *heap, int *val, void **obj)
/* Restore heap condition, if there are objects on the heap */
if (heap->nobjs > 0) {
if (heap->type == H5HP_MAX_HEAP) {
- if (H5HP_sink_max(heap, (size_t)1) < 0)
+ if (H5HP__sink_max(heap, (size_t)1) < 0)
HGOTO_ERROR(H5E_HEAP, H5E_CANTDELETE, FAIL, "unable to restore heap condition");
} /* end if */
else {
- if (H5HP_sink_min(heap, (size_t)1) < 0)
+ if (H5HP__sink_min(heap, (size_t)1) < 0)
HGOTO_ERROR(H5E_HEAP, H5E_CANTDELETE, FAIL, "unable to restore heap condition");
} /* end else */
} /* end if */
@@ -684,21 +684,21 @@ H5HP_change(H5HP_t *heap, int val, void *_obj)
/* Restore heap condition */
if (val < old_val) {
if (heap->type == H5HP_MAX_HEAP) {
- if (H5HP_sink_max(heap, obj_loc) < 0)
+ if (H5HP__sink_max(heap, obj_loc) < 0)
HGOTO_ERROR(H5E_HEAP, H5E_CANTRESTORE, FAIL, "unable to restore heap condition");
} /* end if */
else {
- if (H5HP_swim_min(heap, obj_loc) < 0)
+ if (H5HP__swim_min(heap, obj_loc) < 0)
HGOTO_ERROR(H5E_HEAP, H5E_CANTRESTORE, FAIL, "unable to restore heap condition");
} /* end else */
} /* end if */
else {
if (heap->type == H5HP_MAX_HEAP) {
- if (H5HP_swim_max(heap, obj_loc) < 0)
+ if (H5HP__swim_max(heap, obj_loc) < 0)
HGOTO_ERROR(H5E_HEAP, H5E_CANTRESTORE, FAIL, "unable to restore heap condition");
} /* end if */
else {
- if (H5HP_sink_min(heap, obj_loc) < 0)
+ if (H5HP__sink_min(heap, obj_loc) < 0)
HGOTO_ERROR(H5E_HEAP, H5E_CANTRESTORE, FAIL, "unable to restore heap condition");
} /* end else */
} /* end else */
@@ -766,11 +766,11 @@ H5HP_incr(H5HP_t *heap, unsigned amt, void *_obj)
/* Restore heap condition */
if (H5HP_MAX_HEAP == heap->type) {
- if (H5HP_swim_max(heap, obj_loc) < 0)
+ if (H5HP__swim_max(heap, obj_loc) < 0)
HGOTO_ERROR(H5E_HEAP, H5E_CANTRESTORE, FAIL, "unable to restore heap condition")
} /* end if */
else {
- if (H5HP_sink_min(heap, obj_loc) < 0)
+ if (H5HP__sink_min(heap, obj_loc) < 0)
HGOTO_ERROR(H5E_HEAP, H5E_CANTRESTORE, FAIL, "unable to restore heap condition")
} /* end else */
@@ -838,11 +838,11 @@ H5HP_decr(H5HP_t *heap, unsigned amt, void *_obj)
/* Restore heap condition */
if (heap->type == H5HP_MAX_HEAP) {
- if (H5HP_sink_max(heap, obj_loc) < 0)
+ if (H5HP__sink_max(heap, obj_loc) < 0)
HGOTO_ERROR(H5E_HEAP, H5E_CANTRESTORE, FAIL, "unable to restore heap condition");
} /* end if */
else {
- if (H5HP_swim_min(heap, obj_loc) < 0)
+ if (H5HP__swim_min(heap, obj_loc) < 0)
HGOTO_ERROR(H5E_HEAP, H5E_CANTRESTORE, FAIL, "unable to restore heap condition");
} /* end else */
diff --git a/src/H5I.c b/src/H5I.c
index c9bad09..1973354 100644
--- a/src/H5I.c
+++ b/src/H5I.c
@@ -12,61 +12,32 @@
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
/*
- * FILE: H5I.c - Internal storage routines for handling "IDs"
- *
- * REMARKS: IDs which allow objects (void * currently) to be bundled
- * into "types" for more general storage.
- *
- * DESIGN: The types are stored in an array of pointers to store each
- * type in an element. Each "type" node contains a link to a
- * hash table to manage the IDs in each type. Allowed types are
- * values within the range 1 to H5I_MAX_NUM_TYPES and are given out
- * at run-time. Types used by the library are stored in global
- * variables defined in H5Ipublic.h.
+ * H5I.c - Public routines for handling IDs
*/
+/****************/
+/* Module Setup */
+/****************/
+
#include "H5Imodule.h" /* This source code file is part of the H5I module */
-#define H5T_FRIEND /* Suppress error about including H5Tpkg */
+/***********/
+/* Headers */
+/***********/
#include "H5private.h" /* Generic Functions */
-#include "H5ACprivate.h" /* Metadata cache */
-#include "H5CXprivate.h" /* API Contexts */
-#include "H5Dprivate.h" /* Datasets */
#include "H5Eprivate.h" /* Error handling */
-#include "H5Fprivate.h" /* File access */
-#include "H5FLprivate.h" /* Free Lists */
-#include "H5Gprivate.h" /* Groups */
+#include "H5Fprivate.h" /* Files */
#include "H5Ipkg.h" /* IDs */
#include "H5MMprivate.h" /* Memory management */
-#include "H5Oprivate.h" /* Object headers */
-#include "H5SLprivate.h" /* Skip Lists */
-#include "H5Tpkg.h" /* Datatypes */
-#include "H5VLprivate.h" /* Virtual Object Layer */
+#include "H5Pprivate.h" /* Property lists */
+/****************/
/* Local Macros */
+/****************/
-/* Combine a Type number and an atom index into an atom */
-#define H5I_MAKE(g, i) ((((hid_t)(g)&TYPE_MASK) << ID_BITS) | ((hid_t)(i)&ID_MASK))
-
-/* Local typedefs */
-
-/* Atom information structure used */
-typedef struct H5I_id_info_t {
- hid_t id; /* ID for this info */
- unsigned count; /* ref. count for this atom */
- unsigned app_count; /* ref. count of application visible atoms */
- const void *obj_ptr; /* pointer associated with the atom */
-} H5I_id_info_t;
-
-/* ID type structure used */
-typedef struct {
- const H5I_class_t *cls; /* Pointer to ID class */
- unsigned init_count; /* # of times this type has been initialized*/
- uint64_t id_count; /* Current number of IDs held */
- uint64_t nextid; /* ID to use for the next atom */
- H5I_id_info_t * last_info; /* Info for most recent ID looked up */
- H5SL_t * ids; /* Pointer to skip list that stores IDs */
-} H5I_id_type_t;
+/******************/
+/* Local Typedefs */
+/******************/
typedef struct {
H5I_search_func_t app_cb; /* Application's callback routine */
@@ -79,119 +50,28 @@ typedef struct {
void * op_data; /* Application's user data */
} H5I_iterate_pub_ud_t;
-/* User data for iterator callback for retrieving an ID corresponding to an object pointer */
-typedef struct {
- const void *object; /* object pointer to search for */
- H5I_type_t obj_type; /* type of object we are searching for */
- hid_t ret_id; /* ID returned */
-} H5I_get_id_ud_t;
+/********************/
+/* Package Typedefs */
+/********************/
-/* User data for iterator callback for ID iteration */
-typedef struct {
- H5I_search_func_t user_func; /* 'User' function to invoke */
- void * user_udata; /* User data to pass to 'user' function */
- hbool_t app_ref; /* Whether this is an appl. ref. call */
- H5I_type_t obj_type; /* Type of object we are iterating over */
-} H5I_iterate_ud_t;
+/********************/
+/* Local Prototypes */
+/********************/
-/* User data for H5I__clear_type_cb */
-typedef struct {
- H5I_id_type_t *type_ptr; /* Pointer to the type being cleard */
- hbool_t force; /* Whether to always remove the id */
- hbool_t app_ref; /* Whether this is an appl. ref. call */
-} H5I_clear_type_ud_t;
-
-/* Package initialization variable */
-hbool_t H5_PKG_INIT_VAR = FALSE;
-
-/*-------------------- Locally scoped variables -----------------------------*/
-
-/* Array of pointers to atomic types */
-static H5I_id_type_t *H5I_id_type_list_g[H5I_MAX_NUM_TYPES];
-
-/* Variable to keep track of the number of types allocated. Its value is the */
-/* next type ID to be handed out, so it is always one greater than the number */
-/* of types. */
-/* Starts at 1 instead of 0 because it makes trace output look nicer. If more */
-/* types (or IDs within a type) are needed, adjust TYPE_BITS in H5Ipkg.h */
-/* and/or increase size of hid_t */
-static int H5I_next_type = (int)H5I_NTYPES;
-
-/* Declare a free list to manage the H5I_id_info_t struct */
-H5FL_DEFINE_STATIC(H5I_id_info_t);
-
-/* Declare a free list to manage the H5I_id_type_t struct */
-H5FL_DEFINE_STATIC(H5I_id_type_t);
-
-/* Declare a free list to manage the H5I_class_t struct */
-H5FL_DEFINE_STATIC(H5I_class_t);
-
-H5FL_EXTERN(H5VL_object_t);
-
-/*--------------------- Local function prototypes ---------------------------*/
-static void * H5I__unwrap(void *obj_ptr, H5I_type_t type);
-static htri_t H5I__clear_type_cb(void *_id, void *key, void *udata);
-static int H5I__destroy_type(H5I_type_t type);
-static void * H5I__remove_verify(hid_t id, H5I_type_t id_type);
-static void * H5I__remove_common(H5I_id_type_t *type_ptr, hid_t id);
-static int H5I__inc_type_ref(H5I_type_t type);
-static int H5I__get_type_ref(H5I_type_t type);
-static int H5I__search_cb(void *obj, hid_t id, void *_udata);
-static H5I_id_info_t *H5I__find_id(hid_t id);
-static int H5I__iterate_pub_cb(void *obj, hid_t id, void *udata);
-static int H5I__find_id_cb(void *_item, void *_key, void *_udata);
-static int H5I__id_dump_cb(void *_item, void *_key, void *_udata);
+static int H5I__search_cb(void *obj, hid_t id, void *_udata);
+static int H5I__iterate_pub_cb(void *obj, hid_t id, void *udata);
-/*-------------------------------------------------------------------------
- * Function: H5I_term_package
- *
- * Purpose: Terminate the H5I interface: release all memory, reset all
- * global variables to initial values. This only happens if all
- * types have been destroyed from other interfaces.
- *
- * Return: Success: Positive if any action was taken that might
- * affect some other interface; zero otherwise.
- *
- * Failure: Negative
- *
- *-------------------------------------------------------------------------
- */
-int
-H5I_term_package(void)
-{
- int n = 0;
-
- FUNC_ENTER_NOAPI_NOINIT_NOERR
-
- if (H5_PKG_INIT_VAR) {
- H5I_id_type_t *type_ptr; /* Pointer to ID type */
- int type; /* Type of ID */
-
- /* How many types are still being used? */
- for (type = 0; type < H5I_next_type; type++)
- if ((type_ptr = H5I_id_type_list_g[type]) && type_ptr->ids)
- n++;
-
- /* If no types are used then clean up */
- if (0 == n) {
- for (type = 0; type < H5I_next_type; type++) {
- type_ptr = H5I_id_type_list_g[type];
- if (type_ptr) {
- HDassert(NULL == type_ptr->ids);
- type_ptr = H5FL_FREE(H5I_id_type_t, type_ptr);
- H5I_id_type_list_g[type] = NULL;
- n++;
- } /* end if */
- } /* end for */
-
- /* Mark interface closed */
- if (0 == n)
- H5_PKG_INIT_VAR = FALSE;
- } /* end if */
- } /* end if */
-
- FUNC_LEAVE_NOAPI(n)
-} /* end H5I_term_package() */
+/*********************/
+/* Package Variables */
+/*********************/
+
+/*****************************/
+/* Library Private Variables */
+/*****************************/
+
+/*******************/
+/* Local Variables */
+/*******************/
/*-------------------------------------------------------------------------
* Function: H5Iregister_type
@@ -213,8 +93,8 @@ H5I_term_package(void)
H5I_type_t
H5Iregister_type(size_t H5_ATTR_DEBUG_API_USED hash_size, unsigned reserved, H5I_free_t free_func)
{
- H5I_class_t *cls = NULL; /* New ID class */
- H5I_type_t new_type; /* New ID type value */
+ H5I_class_t *cls = NULL; /* New ID class */
+ H5I_type_t new_type = H5I_BADID; /* New ID type value */
H5I_type_t ret_value = H5I_BADID; /* Return value */
FUNC_ENTER_API(H5I_BADID)
@@ -223,42 +103,42 @@ H5Iregister_type(size_t H5_ATTR_DEBUG_API_USED hash_size, unsigned reserved, H5I
/* Generate a new H5I_type_t value */
/* Increment the number of types */
- if (H5I_next_type < H5I_MAX_NUM_TYPES) {
- new_type = (H5I_type_t)H5I_next_type;
- H5I_next_type++;
- } /* end if */
+ if (H5I_next_type_g < H5I_MAX_NUM_TYPES) {
+ new_type = (H5I_type_t)H5I_next_type_g;
+ H5I_next_type_g++;
+ }
else {
hbool_t done; /* Indicate that search was successful */
- int i; /* Local index variable */
+ int i;
/* Look for a free type to give out */
done = FALSE;
for (i = H5I_NTYPES; i < H5I_MAX_NUM_TYPES && done == FALSE; i++) {
- if (NULL == H5I_id_type_list_g[i]) {
+ if (NULL == H5I_type_info_array_g[i]) {
/* Found a free type ID */
new_type = (H5I_type_t)i;
done = TRUE;
- } /* end if */
- } /* end for */
+ }
+ }
/* Verify that we found a type to give out */
if (done == FALSE)
- HGOTO_ERROR(H5E_ATOM, H5E_NOSPACE, H5I_BADID, "Maximum number of ID types exceeded")
- } /* end else */
+ HGOTO_ERROR(H5E_ID, H5E_NOSPACE, H5I_BADID, "Maximum number of ID types exceeded")
+ }
/* Allocate new ID class */
- if (NULL == (cls = H5FL_CALLOC(H5I_class_t)))
- HGOTO_ERROR(H5E_ATOM, H5E_CANTALLOC, H5I_BADID, "ID class allocation failed")
+ if (NULL == (cls = H5MM_calloc(sizeof(H5I_class_t))))
+ HGOTO_ERROR(H5E_ID, H5E_CANTALLOC, H5I_BADID, "ID class allocation failed")
/* Initialize class fields */
- cls->type_id = new_type;
+ cls->type = new_type;
cls->flags = H5I_CLASS_IS_APPLICATION;
cls->reserved = reserved;
cls->free_func = free_func;
/* Register the new ID class */
if (H5I_register_type(cls) < 0)
- HGOTO_ERROR(H5E_ATOM, H5E_CANTINIT, H5I_BADID, "can't initialize ID class")
+ HGOTO_ERROR(H5E_ID, H5E_CANTINIT, H5I_BADID, "can't initialize ID class")
/* Set return value */
ret_value = new_type;
@@ -267,72 +147,12 @@ done:
/* Clean up on error */
if (ret_value < 0)
if (cls)
- cls = H5FL_FREE(H5I_class_t, cls);
+ cls = H5MM_xfree(cls);
FUNC_LEAVE_API(ret_value)
} /* end H5Iregister_type() */
/*-------------------------------------------------------------------------
- * Function: H5I_register_type
- *
- * Purpose: Creates a new type of ID's to give out.
- * The class is initialized or its reference count is incremented
- * (if it is already initialized).
- *
- * Return: SUCCEED/FAIL
- *
- *-------------------------------------------------------------------------
- */
-herr_t
-H5I_register_type(const H5I_class_t *cls)
-{
- H5I_id_type_t *type_ptr = NULL; /* Ptr to the atomic type*/
- herr_t ret_value = SUCCEED; /* Return value */
-
- FUNC_ENTER_NOAPI(FAIL)
-
- /* Sanity check */
- HDassert(cls);
- HDassert(cls->type_id > 0 && (int)cls->type_id < H5I_MAX_NUM_TYPES);
-
- /* Initialize the type */
- if (NULL == H5I_id_type_list_g[cls->type_id]) {
- /* Allocate the type information for new type */
- if (NULL == (type_ptr = (H5I_id_type_t *)H5FL_CALLOC(H5I_id_type_t)))
- HGOTO_ERROR(H5E_ATOM, H5E_CANTALLOC, FAIL, "ID type allocation failed")
- H5I_id_type_list_g[cls->type_id] = type_ptr;
- } /* end if */
- else {
- /* Get the pointer to the existing type */
- type_ptr = H5I_id_type_list_g[cls->type_id];
- } /* end else */
-
- /* Initialize the ID type structure for new types */
- if (type_ptr->init_count == 0) {
- type_ptr->cls = cls;
- type_ptr->id_count = 0;
- type_ptr->nextid = cls->reserved;
- type_ptr->last_info = NULL;
- if (NULL == (type_ptr->ids = H5SL_create(H5SL_TYPE_HID, NULL)))
- HGOTO_ERROR(H5E_ATOM, H5E_CANTCREATE, FAIL, "skip list creation failed")
- } /* end if */
-
- /* Increment the count of the times this type has been initialized */
- type_ptr->init_count++;
-
-done:
- if (ret_value < 0) { /* Clean up on error */
- if (type_ptr) {
- if (type_ptr->ids)
- H5SL_close(type_ptr->ids);
- (void)H5FL_FREE(H5I_id_type_t, type_ptr);
- } /* end if */
- } /* end if */
-
- FUNC_LEAVE_NOAPI(ret_value)
-} /* end H5I_register_type() */
-
-/*-------------------------------------------------------------------------
* Function: H5Itype_exists
*
* Purpose: Query function to inform the user if a given type is
@@ -352,11 +172,11 @@ H5Itype_exists(H5I_type_t type)
/* Validate parameter */
if (H5I_IS_LIB_TYPE(type))
- HGOTO_ERROR(H5E_ATOM, H5E_BADGROUP, FAIL, "cannot call public function on library type")
- if (type <= H5I_BADID || (int)type >= H5I_next_type)
+ HGOTO_ERROR(H5E_ID, H5E_BADGROUP, FAIL, "cannot call public function on library type")
+ if (type <= H5I_BADID || (int)type >= H5I_next_type_g)
HGOTO_ERROR(H5E_ARGS, H5E_BADRANGE, FAIL, "invalid type number")
- if (NULL == H5I_id_type_list_g[type])
+ if (NULL == H5I_type_info_array_g[type])
ret_value = FALSE;
done:
@@ -373,8 +193,8 @@ done:
*
* Return: SUCCEED/FAIL
*
- * Programmer: James Laird
- * Nathaniel Furrer
+ * Programmer: James Laird
+ * Nathaniel Furrer
* Friday, April 23, 2004
*
*-------------------------------------------------------------------------
@@ -382,116 +202,37 @@ done:
herr_t
H5Inmembers(H5I_type_t type, hsize_t *num_members)
{
- int ret_value = SUCCEED; /* Return value */
+ herr_t ret_value = SUCCEED; /* Return value */
FUNC_ENTER_API(FAIL)
H5TRACE2("e", "It*h", type, num_members);
if (H5I_IS_LIB_TYPE(type))
- HGOTO_ERROR(H5E_ATOM, H5E_BADGROUP, FAIL, "cannot call public function on library type")
+ HGOTO_ERROR(H5E_ID, H5E_BADGROUP, FAIL, "cannot call public function on library type")
/* Validate parameters. This needs to be done here, instead of letting
* the private interface handle it, because the public interface throws
* an error when the supplied type does not exist.
*/
- if (type <= H5I_BADID || (int)type >= H5I_next_type)
+ if (type <= H5I_BADID || (int)type >= H5I_next_type_g)
HGOTO_ERROR(H5E_ARGS, H5E_BADRANGE, FAIL, "invalid type number")
- if (NULL == H5I_id_type_list_g[type])
+ if (NULL == H5I_type_info_array_g[type])
HGOTO_ERROR(H5E_ARGS, H5E_BADRANGE, FAIL, "supplied type does not exist")
if (num_members) {
int64_t members;
if ((members = H5I_nmembers(type)) < 0)
- HGOTO_ERROR(H5E_ATOM, H5E_CANTCOUNT, FAIL, "can't compute number of members")
+ HGOTO_ERROR(H5E_ID, H5E_CANTCOUNT, FAIL, "can't compute number of members")
H5_CHECKED_ASSIGN(*num_members, hsize_t, members, int64_t);
- } /* end if */
+ }
done:
FUNC_LEAVE_API(ret_value)
} /* end H5Inmembers() */
/*-------------------------------------------------------------------------
- * Function: H5I_nmembers
- *
- * Purpose: Returns the number of members in a type.
- *
- * Return: Success: Number of members; zero if the type is empty
- * or has been deleted.
- *
- * Failure: Negative
- *
- * Programmer: Robb Matzke
- * Wednesday, March 24, 1999
- *
- *-------------------------------------------------------------------------
- */
-int64_t
-H5I_nmembers(H5I_type_t type)
-{
- H5I_id_type_t *type_ptr; /* Pointer to the ID type */
- int64_t ret_value = 0; /* Return value */
-
- FUNC_ENTER_NOAPI(FAIL)
-
- /* Validate parameter */
- if (type <= H5I_BADID || (int)type >= H5I_next_type)
- HGOTO_ERROR(H5E_ARGS, H5E_BADRANGE, FAIL, "invalid type number")
- if (NULL == (type_ptr = H5I_id_type_list_g[type]) || type_ptr->init_count <= 0)
- HGOTO_DONE(0);
-
- /* Set return value */
- H5_CHECKED_ASSIGN(ret_value, int64_t, type_ptr->id_count, uint64_t);
-
-done:
- FUNC_LEAVE_NOAPI(ret_value)
-} /* end H5I_nmembers() */
-
-/*-------------------------------------------------------------------------
- * Function: H5I__unwrap
- *
- * Purpose: Unwraps the object pointer for the 'item' that corresponds
- * to an ID.
- *
- * Return: Pointer to the unwrapped pointer (can't fail)
- *
- * Programmer: Quincey Koziol
- * Friday, October 19, 2018
- *
- *-------------------------------------------------------------------------
- */
-static void *
-H5I__unwrap(void *obj_ptr, H5I_type_t type)
-{
- void *ret_value = NULL; /* Return value */
-
- FUNC_ENTER_STATIC_NOERR
-
- /* Sanity checks */
- HDassert(obj_ptr);
-
- /* The stored object pointer might be an H5VL_object_t, in which
- * case we'll need to get the wrapped object struct (H5F_t *, etc.).
- */
- if (H5I_FILE == type || H5I_GROUP == type || H5I_DATASET == type || H5I_ATTR == type) {
- const H5VL_object_t *vol_obj;
-
- vol_obj = (const H5VL_object_t *)obj_ptr;
- ret_value = H5VL_object_data(vol_obj);
- } /* end if */
- else if (H5I_DATATYPE == type) {
- H5T_t *dt = (H5T_t *)obj_ptr;
-
- ret_value = (void *)H5T_get_actual_type(dt);
- } /* end if */
- else
- ret_value = obj_ptr;
-
- FUNC_LEAVE_NOAPI(ret_value)
-} /* end H5I__unwrap() */
-
-/*-------------------------------------------------------------------------
* Function: H5Iclear_type
*
* Purpose: Removes all objects from the type, calling the free
@@ -500,8 +241,8 @@ H5I__unwrap(void *obj_ptr, H5I_type_t type)
*
* Return: SUCCEED/FAIL
*
- * Programmer: James Laird
- * Nathaniel Furrer
+ * Programmer: James Laird
+ * Nathaniel Furrer
* Friday, April 23, 2004
*
*-------------------------------------------------------------------------
@@ -515,7 +256,7 @@ H5Iclear_type(H5I_type_t type, hbool_t force)
H5TRACE2("e", "Itb", type, force);
if (H5I_IS_LIB_TYPE(type))
- HGOTO_ERROR(H5E_ATOM, H5E_BADGROUP, FAIL, "cannot call public function on library type")
+ HGOTO_ERROR(H5E_ID, H5E_BADGROUP, FAIL, "cannot call public function on library type")
ret_value = H5I_clear_type(type, force, TRUE);
@@ -524,116 +265,9 @@ done:
} /* end H5Iclear_type() */
/*-------------------------------------------------------------------------
- * Function: H5I_clear_type
- *
- * Purpose: Removes all objects from the type, calling the free
- * function for each object regardless of the reference count.
- *
- * Return: SUCCEED/FAIL
- *
- * Programmer: Robb Matzke
- * Wednesday, March 24, 1999
- *
- *-------------------------------------------------------------------------
- */
-herr_t
-H5I_clear_type(H5I_type_t type, hbool_t force, hbool_t app_ref)
-{
- H5I_clear_type_ud_t udata; /* udata struct for callback */
- int ret_value = SUCCEED; /* Return value */
-
- FUNC_ENTER_NOAPI(FAIL)
-
- /* Validate parameters */
- if (type <= H5I_BADID || (int)type >= H5I_next_type)
- HGOTO_ERROR(H5E_ARGS, H5E_BADRANGE, FAIL, "invalid type number")
-
- udata.type_ptr = H5I_id_type_list_g[type];
- if (udata.type_ptr == NULL || udata.type_ptr->init_count <= 0)
- HGOTO_ERROR(H5E_ATOM, H5E_BADGROUP, FAIL, "invalid type")
-
- /* Finish constructing udata */
- udata.force = force;
- udata.app_ref = app_ref;
-
- /* Attempt to free all ids in the type */
- if (H5SL_try_free_safe(udata.type_ptr->ids, H5I__clear_type_cb, &udata) < 0)
- HGOTO_ERROR(H5E_ATOM, H5E_CANTDELETE, FAIL, "can't free ids in type")
-
-done:
- FUNC_LEAVE_NOAPI(ret_value)
-} /* end H5I_clear_type() */
-
-/*-------------------------------------------------------------------------
- * Function: H5I__clear_type_cb
- *
- * Purpose: Attempts to free the specified ID, calling the free
- * function for the object.
- *
- * Return: TRUE/FALSE/FAIL
- *
- * Programmer: Neil Fortner
- * Friday, July 10, 2015
- *
- *-------------------------------------------------------------------------
- */
-static htri_t
-H5I__clear_type_cb(void *_id, void H5_ATTR_UNUSED *key, void *_udata)
-{
- H5I_id_info_t * id = (H5I_id_info_t *)_id; /* Current ID being worked with */
- H5I_clear_type_ud_t *udata = (H5I_clear_type_ud_t *)_udata; /* udata struct */
- htri_t ret_value = FALSE; /* Return value */
-
- FUNC_ENTER_STATIC_NOERR
-
- /* Sanity checks */
- HDassert(id);
- HDassert(udata);
- HDassert(udata->type_ptr);
-
- /* Do nothing to the object if the reference count is larger than
- * one and forcing is off.
- */
- if (udata->force || (id->count - (!udata->app_ref * id->app_count)) <= 1) {
- /* Check for a 'free' function and call it, if it exists */
- if (udata->type_ptr->cls->free_func &&
- (udata->type_ptr->cls->free_func)((void *)id->obj_ptr) < 0) { /* (Casting away const OK -QAK) */
- if (udata->force) {
-#ifdef H5I_DEBUG
- if (H5DEBUG(I)) {
- HDfprintf(H5DEBUG(I),
- "H5I: free type=%d obj=0x%08lx "
- "failure ignored\n",
- (int)udata->type_ptr->cls->type_id, (unsigned long)(id->obj_ptr));
- } /* end if */
-#endif /*H5I_DEBUG*/
-
- /* Indicate node should be removed from list */
- ret_value = TRUE;
- } /* end if */
- } /* end if */
- else {
- /* Indicate node should be removed from list */
- ret_value = TRUE;
- } /* end else */
-
- /* Remove ID if requested */
- if (ret_value) {
- /* Free ID info */
- id = H5FL_FREE(H5I_id_info_t, id);
-
- /* Decrement the number of IDs in the type */
- udata->type_ptr->id_count--;
- } /* end if */
- } /* end if */
-
- FUNC_LEAVE_NOAPI(ret_value)
-} /* end H5I__clear_type_cb() */
-
-/*-------------------------------------------------------------------------
* Function: H5Idestroy_type
*
- * Purpose: Destroys a type along with all atoms in that type
+ * Purpose: Destroys a type along with all IDs in that type
* regardless of their reference counts. Destroying IDs
* involves calling the free-func for each ID's object and
* then adding the ID struct to the ID free list. Public
@@ -641,8 +275,8 @@ H5I__clear_type_cb(void *_id, void H5_ATTR_UNUSED *key, void *_udata)
*
* Return: SUCCEED/FAIL
*
- * Programmer: Nathaniel Furrer
- * James Laird
+ * Programmer: Nathaniel Furrer
+ * James Laird
*
*-------------------------------------------------------------------------
*/
@@ -655,7 +289,7 @@ H5Idestroy_type(H5I_type_t type)
H5TRACE1("e", "It", type);
if (H5I_IS_LIB_TYPE(type))
- HGOTO_ERROR(H5E_ATOM, H5E_BADGROUP, FAIL, "cannot call public function on library type")
+ HGOTO_ERROR(H5E_ID, H5E_BADGROUP, FAIL, "cannot call public function on library type")
ret_value = H5I__destroy_type(type);
@@ -664,62 +298,9 @@ done:
} /* end H5Idestroy_type() */
/*-------------------------------------------------------------------------
- * Function: H5I__destroy_type
- *
- * Purpose: Destroys a type along with all atoms in that type
- * regardless of their reference counts. Destroying IDs
- * involves calling the free-func for each ID's object and
- * then adding the ID struct to the ID free list.
- *
- * Return: SUCCEED/FAIL
- *
- * Programmer: Nathaniel Furrer
- * James Laird
- *
- *-------------------------------------------------------------------------
- */
-static herr_t
-H5I__destroy_type(H5I_type_t type)
-{
- H5I_id_type_t *type_ptr; /* ptr to the atomic type */
- herr_t ret_value = SUCCEED; /* Return value */
-
- FUNC_ENTER_STATIC
-
- /* Validate parameter */
- if (type <= H5I_BADID || (int)type >= H5I_next_type)
- HGOTO_ERROR(H5E_ARGS, H5E_BADRANGE, FAIL, "invalid type number")
-
- type_ptr = H5I_id_type_list_g[type];
- if (type_ptr == NULL || type_ptr->init_count <= 0)
- HGOTO_ERROR(H5E_ATOM, H5E_BADGROUP, FAIL, "invalid type")
-
- /* Close/clear/destroy all IDs for this type */
- H5E_BEGIN_TRY
- {
- H5I_clear_type(type, TRUE, FALSE);
- }
- H5E_END_TRY /*don't care about errors*/
-
- /* Check if we should release the ID class */
- if (type_ptr->cls->flags & H5I_CLASS_IS_APPLICATION)
- type_ptr->cls = H5FL_FREE(H5I_class_t, (void *)type_ptr->cls);
-
- if (H5SL_close(type_ptr->ids) < 0)
- HGOTO_ERROR(H5E_ATOM, H5E_CANTCLOSEOBJ, FAIL, "can't close skip list")
- type_ptr->ids = NULL;
-
- type_ptr = H5FL_FREE(H5I_id_type_t, type_ptr);
- H5I_id_type_list_g[type] = NULL;
-
-done:
- FUNC_LEAVE_NOAPI(ret_value)
-} /* end H5I__destroy_type() */
-
-/*-------------------------------------------------------------------------
* Function: H5Iregister
*
- * Purpose: Public interface to H5I_register.
+ * Purpose: Register an object.
*
* Return: Success: New object ID
* Failure: H5I_INVALID_HID
@@ -735,209 +316,48 @@ H5Iregister(H5I_type_t type, const void *object)
H5TRACE2("i", "It*x", type, object);
if (H5I_IS_LIB_TYPE(type))
- HGOTO_ERROR(H5E_ATOM, H5E_BADGROUP, FAIL, "cannot call public function on library type")
+ HGOTO_ERROR(H5E_ID, H5E_BADGROUP, H5I_INVALID_HID, "cannot call public function on library type")
- ret_value = H5I_register(type, object, TRUE);
+ /* Register the object */
+ if ((ret_value = H5I__register(type, object, TRUE, NULL, NULL)) < 0)
+ HGOTO_ERROR(H5E_ID, H5E_CANTREGISTER, H5I_INVALID_HID, "unable to register object")
done:
FUNC_LEAVE_API(ret_value)
} /* end H5Iregister() */
/*-------------------------------------------------------------------------
- * Function: H5I_register
+ * Function: H5Iregister_future
*
- * Purpose: Registers an OBJECT in a TYPE and returns an ID for it.
- * This routine does _not_ check for unique-ness of the objects,
- * if you register an object twice, you will get two different
- * IDs for it. This routine does make certain that each ID in a
- * type is unique. IDs are created by getting a unique number
- * for the type the ID is in and incorporating the type into
- * the ID which is returned to the user.
+ * Purpose: Register a "future" object.
*
- * Return: Success: New object ID
+ * Return: Success: New future object ID
* Failure: H5I_INVALID_HID
*
*-------------------------------------------------------------------------
*/
hid_t
-H5I_register(H5I_type_t type, const void *object, hbool_t app_ref)
+H5Iregister_future(H5I_type_t type, const void *object, H5I_future_realize_func_t realize_cb,
+ H5I_future_discard_func_t discard_cb)
{
- H5I_id_type_t *type_ptr = NULL; /* ptr to the type */
- H5I_id_info_t *id_ptr = NULL; /* ptr to the new ID information */
- hid_t new_id = -1; /* new ID */
- hid_t ret_value = H5I_INVALID_HID; /* return value */
+ hid_t ret_value = H5I_INVALID_HID; /* Return value */
- FUNC_ENTER_NOAPI(FAIL)
+ FUNC_ENTER_API(H5I_INVALID_HID)
+ H5TRACE4("i", "It*xIRID", type, object, realize_cb, discard_cb);
/* Check arguments */
- if (type <= H5I_BADID || (int)type >= H5I_next_type)
- HGOTO_ERROR(H5E_ARGS, H5E_BADRANGE, H5I_INVALID_HID, "invalid type number")
- type_ptr = H5I_id_type_list_g[type];
- if ((NULL == type_ptr) || (type_ptr->init_count <= 0))
- HGOTO_ERROR(H5E_ATOM, H5E_BADGROUP, H5I_INVALID_HID, "invalid type")
- if (NULL == (id_ptr = H5FL_MALLOC(H5I_id_info_t)))
- HGOTO_ERROR(H5E_ATOM, H5E_NOSPACE, H5I_INVALID_HID, "memory allocation failed")
-
- /* Create the struct & its ID */
- new_id = H5I_MAKE(type, type_ptr->nextid);
- id_ptr->id = new_id;
- id_ptr->count = 1; /* initial reference count */
- id_ptr->app_count = !!app_ref;
- id_ptr->obj_ptr = object;
-
- /* Insert into the type */
- if (H5SL_insert(type_ptr->ids, id_ptr, &id_ptr->id) < 0)
- HGOTO_ERROR(H5E_ATOM, H5E_CANTINSERT, H5I_INVALID_HID, "can't insert ID node into skip list")
- type_ptr->id_count++;
- type_ptr->nextid++;
-
- /* Sanity check for the 'nextid' getting too large and wrapping around */
- HDassert(type_ptr->nextid <= ID_MASK);
-
- /* Set the most recent ID to this object */
- type_ptr->last_info = id_ptr;
+ if (NULL == realize_cb)
+ HGOTO_ERROR(H5E_ID, H5E_BADVALUE, H5I_INVALID_HID, "NULL pointer for realize_cb not allowed")
+ if (NULL == discard_cb)
+ HGOTO_ERROR(H5E_ID, H5E_BADVALUE, H5I_INVALID_HID, "NULL pointer for realize_cb not allowed")
- /* Set return value */
- ret_value = new_id;
+ /* Register the future object */
+ if ((ret_value = H5I__register(type, object, TRUE, realize_cb, discard_cb)) < 0)
+ HGOTO_ERROR(H5E_ID, H5E_CANTREGISTER, H5I_INVALID_HID, "unable to register object")
done:
- FUNC_LEAVE_NOAPI(ret_value)
-} /* end H5I_register() */
-
-/*-------------------------------------------------------------------------
- * Function: H5I_register_using_existing_id
- *
- * Purpose: Registers an OBJECT in a TYPE with the supplied ID for it.
- * This routine will check to ensure the supplied ID is not already
- * in use, and ensure that it is a valid ID for the given type,
- * but will NOT check to ensure the OBJECT is not already
- * registered (thus, it is possible to register one object under
- * multiple IDs).
- *
- * NOTE: Intended for use in refresh calls, where we have to close
- * and re-open the underlying data, then hook the object back
- * up to the original ID.
- *
- * Return: SUCCEED/FAIL
- *
- *-------------------------------------------------------------------------
- */
-herr_t
-H5I_register_using_existing_id(H5I_type_t type, void *object, hbool_t app_ref, hid_t existing_id)
-{
- H5I_id_type_t *type_ptr; /* ptr to the type */
- H5I_id_info_t *id_ptr; /* ptr to the new ID information */
- herr_t ret_value = SUCCEED; /* return value */
-
- FUNC_ENTER_NOAPI(FAIL)
-
- /* Check arguments */
- HDassert(object);
-
- /* Make sure ID is not already in use */
- if (NULL != (id_ptr = H5I__find_id(existing_id)))
- HGOTO_ERROR(H5E_ATOM, H5E_BADRANGE, FAIL, "ID already in use")
-
- /* Make sure type number is valid */
- if (type <= H5I_BADID || (int)type >= H5I_next_type)
- HGOTO_ERROR(H5E_ARGS, H5E_BADRANGE, FAIL, "invalid type number")
-
- /* Get type pointer from list of types */
- type_ptr = H5I_id_type_list_g[type];
-
- if (NULL == type_ptr || type_ptr->init_count <= 0)
- HGOTO_ERROR(H5E_ATOM, H5E_BADGROUP, FAIL, "invalid type")
-
- /* Make sure requested ID belongs to object's type */
- if (H5I_TYPE(existing_id) != type)
- HGOTO_ERROR(H5E_ATOM, H5E_BADRANGE, FAIL, "invalid type for provided ID")
-
- /* Allocate new structure to house this ID */
- if (NULL == (id_ptr = H5FL_MALLOC(H5I_id_info_t)))
- HGOTO_ERROR(H5E_ATOM, H5E_NOSPACE, FAIL, "memory allocation failed")
-
- /* Create the struct & insert requested ID */
- id_ptr->id = existing_id;
- id_ptr->count = 1; /* initial reference count*/
- id_ptr->app_count = !!app_ref;
- id_ptr->obj_ptr = object;
-
- /* Insert into the type */
- if (H5SL_insert(type_ptr->ids, id_ptr, &id_ptr->id) < 0)
- HGOTO_ERROR(H5E_ATOM, H5E_CANTINSERT, FAIL, "can't insert ID node into skip list")
- type_ptr->id_count++;
-
- /* Set the most recent ID to this object */
- type_ptr->last_info = id_ptr;
-
-done:
- FUNC_LEAVE_NOAPI(ret_value)
-} /* end H5I_register_using_existing_id() */
-
-/*-------------------------------------------------------------------------
- * Function: H5I_subst
- *
- * Purpose: Substitute a new object pointer for the specified ID.
- *
- * Return: Success: Non-NULL previous object pointer associated
- * with the specified ID.
- * Failure: NULL
- *
- * Programmer: Quincey Koziol
- * Saturday, February 27, 2010
- *
- *-------------------------------------------------------------------------
- */
-void *
-H5I_subst(hid_t id, const void *new_object)
-{
- H5I_id_info_t *id_ptr; /* Pointer to the atom */
- void * ret_value = NULL; /* Return value */
-
- FUNC_ENTER_NOAPI(NULL)
-
- /* General lookup of the ID */
- if (NULL == (id_ptr = H5I__find_id(id)))
- HGOTO_ERROR(H5E_ATOM, H5E_NOTFOUND, NULL, "can't get ID ref count")
-
- /* Get the old object pointer to return */
- ret_value = (void *)id_ptr->obj_ptr; /* (Casting away const OK -QAK) */
-
- /* Set the new object pointer for the ID */
- id_ptr->obj_ptr = new_object;
-
-done:
- FUNC_LEAVE_NOAPI(ret_value)
-} /* end H5I_subst() */
-
-/*-------------------------------------------------------------------------
- * Function: H5I_object
- *
- * Purpose: Find an object pointer for the specified ID.
- *
- * Return: Success: Non-NULL object pointer associated with the
- * specified ID
- *
- * Failure: NULL
- *
- *-------------------------------------------------------------------------
- */
-void *
-H5I_object(hid_t id)
-{
- H5I_id_info_t *id_ptr; /* Pointer to the new atom */
- void * ret_value = NULL; /* Return value */
-
- FUNC_ENTER_NOAPI_NOERR
-
- /* General lookup of the ID */
- if (NULL != (id_ptr = H5I__find_id(id))) {
- /* Get the object pointer to return */
- ret_value = (void *)id_ptr->obj_ptr; /* (Casting away const OK -QAK) */
- }
-
- FUNC_LEAVE_NOAPI(ret_value)
-} /* end H5I_object() */
+ FUNC_LEAVE_API(ret_value)
+} /* end H5Iregister_future() */
/*-------------------------------------------------------------------------
* Function: H5Iobject_verify
@@ -953,93 +373,26 @@ H5I_object(hid_t id)
*-------------------------------------------------------------------------
*/
void *
-H5Iobject_verify(hid_t id, H5I_type_t id_type)
+H5Iobject_verify(hid_t id, H5I_type_t type)
{
void *ret_value = NULL; /* Return value */
FUNC_ENTER_API(NULL)
- H5TRACE2("*x", "iIt", id, id_type);
+ H5TRACE2("*x", "iIt", id, type);
/* Validate parameters */
- if (H5I_IS_LIB_TYPE(id_type))
- HGOTO_ERROR(H5E_ATOM, H5E_BADGROUP, NULL, "cannot call public function on library type")
- if (id_type < 1 || (int)id_type >= H5I_next_type)
- HGOTO_ERROR(H5E_ATOM, H5E_BADGROUP, NULL, "identifier has invalid type")
+ if (H5I_IS_LIB_TYPE(type))
+ HGOTO_ERROR(H5E_ID, H5E_BADGROUP, NULL, "cannot call public function on library type")
+ if (type < 1 || (int)type >= H5I_next_type_g)
+ HGOTO_ERROR(H5E_ID, H5E_BADGROUP, NULL, "identifier has invalid type")
- ret_value = H5I_object_verify(id, id_type);
+ ret_value = H5I_object_verify(id, type);
done:
FUNC_LEAVE_API(ret_value)
} /* end H5Iobject_verify() */
/*-------------------------------------------------------------------------
- * Function: H5I_object_verify
- *
- * Purpose: Find an object pointer for the specified ID, verifying that
- * its in a particular type.
- *
- * Return: Success: Non-NULL object pointer associated with the
- * specified ID.
- * Failure: NULL
- *
- * Programmer: Quincey Koziol
- * Wednesday, July 31, 2002
- *
- *-------------------------------------------------------------------------
- */
-void *
-H5I_object_verify(hid_t id, H5I_type_t id_type)
-{
- H5I_id_info_t *id_ptr = NULL; /* Pointer to the new atom */
- void * ret_value = NULL; /* Return value */
-
- FUNC_ENTER_NOAPI_NOERR
-
- HDassert(id_type >= 1 && (int)id_type < H5I_next_type);
-
- /* Verify that the type of the ID is correct & lookup the ID */
- if (id_type == H5I_TYPE(id) && NULL != (id_ptr = H5I__find_id(id))) {
- /* Get the object pointer to return */
- ret_value = (void *)id_ptr->obj_ptr; /* (Casting away const OK -QAK) */
- }
-
- FUNC_LEAVE_NOAPI(ret_value)
-} /* H5I_object_verify() */
-
-/*-------------------------------------------------------------------------
- * Function: H5I_get_type
- *
- * Purpose: Given an object ID return the type to which it
- * belongs. The ID need not be the ID of an object which
- * currently exists because the type number is encoded
- * in the object ID.
- *
- * Return: Success: A positive integer (corresponding to an H5I_type_t
- * enum value for library ID types, but not for user
- * ID types).
- * Failure: H5I_BADID
- *
- * Programmer: Robb Matzke
- * Friday, February 19, 1999
- *
- *-------------------------------------------------------------------------
- */
-H5I_type_t
-H5I_get_type(hid_t id)
-{
- H5I_type_t ret_value = H5I_BADID; /* Return value */
-
- FUNC_ENTER_NOAPI_NOERR
-
- if (id > 0)
- ret_value = H5I_TYPE(id);
-
- HDassert(ret_value >= H5I_BADID && (int)ret_value < H5I_next_type);
-
- FUNC_LEAVE_NOAPI(ret_value)
-} /* end H5I_get_type() */
-
-/*-------------------------------------------------------------------------
* Function: H5Iget_type
*
* Purpose: The public version of H5I_get_type(), obtains a type number
@@ -1064,7 +417,7 @@ H5Iget_type(hid_t id)
ret_value = H5I_get_type(id);
- if (ret_value <= H5I_BADID || (int)ret_value >= H5I_next_type || NULL == H5I_object(id))
+ if (ret_value <= H5I_BADID || (int)ret_value >= H5I_next_type_g || NULL == H5I_object(id))
HGOTO_DONE(H5I_BADID);
done:
@@ -1072,56 +425,6 @@ done:
} /* end H5Iget_type() */
/*-------------------------------------------------------------------------
- * Function: H5I_is_file_object
- *
- * Purpose: Convenience function to determine if an ID represents
- * a file object.
- *
- * In H5O calls, you can't use object_verify to ensure
- * the ID was of the correct class since there's no
- * H5I_OBJECT ID class.
- *
- * Return: Success: TRUE/FALSE
- * Failure: FAIL
- *
- *-------------------------------------------------------------------------
- */
-htri_t
-H5I_is_file_object(hid_t id)
-{
- H5I_type_t id_type = H5I_get_type(id);
- htri_t ret_value = FAIL;
-
- FUNC_ENTER_NOAPI(FAIL);
-
- /* Fail if the ID type is out of range */
- if (id_type < 1 || id_type >= H5I_NTYPES)
- HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "ID type out of range");
-
- /* Return TRUE if the ID is a file object (dataset, group, map, or committed
- * datatype), FALSE otherwise.
- */
- if (H5I_DATASET == id_type || H5I_GROUP == id_type || H5I_MAP == id_type) {
- ret_value = TRUE;
- }
- else if (H5I_DATATYPE == id_type) {
-
- H5T_t *dt = NULL;
-
- if (NULL == (dt = (H5T_t *)H5I_object(id)))
- HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "unable to get underlying datatype struct");
-
- ret_value = H5T_is_named(dt);
- }
- else {
- ret_value = FALSE;
- }
-
-done:
- FUNC_LEAVE_NOAPI(ret_value);
-} /* H5I_is_file_object() */
-
-/*-------------------------------------------------------------------------
* Function: H5Iremove_verify
*
* Purpose: Removes the specified ID from its type, first checking that the
@@ -1133,145 +436,30 @@ done:
* calling H5I_object().
* Failure: NULL
*
- * Programmer: James Laird
- * Nathaniel Furrer
+ * Programmer: James Laird
+ * Nathaniel Furrer
*
*-------------------------------------------------------------------------
*/
void *
-H5Iremove_verify(hid_t id, H5I_type_t id_type)
+H5Iremove_verify(hid_t id, H5I_type_t type)
{
void *ret_value = NULL; /* Return value */
FUNC_ENTER_API(NULL)
- H5TRACE2("*x", "iIt", id, id_type);
+ H5TRACE2("*x", "iIt", id, type);
- if (H5I_IS_LIB_TYPE(id_type))
- HGOTO_ERROR(H5E_ATOM, H5E_BADGROUP, NULL, "cannot call public function on library type")
+ if (H5I_IS_LIB_TYPE(type))
+ HGOTO_ERROR(H5E_ID, H5E_BADGROUP, NULL, "cannot call public function on library type")
/* Remove the id */
- ret_value = H5I__remove_verify(id, id_type);
+ ret_value = H5I__remove_verify(id, type);
done:
FUNC_LEAVE_API(ret_value)
} /* end H5Iremove_verify() */
/*-------------------------------------------------------------------------
- * Function: H5I__remove_verify
- *
- * Purpose: Removes the specified ID from its type, first checking that
- * the ID's type is the same as the ID type supplied as an argument
- *
- * Return: Success: A pointer to the object that was removed, the
- * same pointer which would have been found by
- * calling H5I_object().
- * Failure: NULL
- *
- * Programmer: James Laird
- * Nat Furrer
- *
- *-------------------------------------------------------------------------
- */
-static void *
-H5I__remove_verify(hid_t id, H5I_type_t id_type)
-{
- void *ret_value = NULL; /*return value */
-
- FUNC_ENTER_STATIC_NOERR
-
- /* Argument checking will be performed by H5I_remove() */
-
- /* Verify that the type of the ID is correct */
- if (id_type == H5I_TYPE(id))
- ret_value = H5I_remove(id);
-
- FUNC_LEAVE_NOAPI(ret_value)
-} /* end H5I__remove_verify() */
-
-/*-------------------------------------------------------------------------
- * Function: H5I__remove_common
- *
- * Purpose: Common code to remove a specified ID from its type.
- *
- * Return: Success: A pointer to the object that was removed, the
- * same pointer which would have been found by
- * calling H5I_object().
- * Failure: NULL
- *
- * Programmer: Quincey Koziol
- * October 3, 2013
- *
- *-------------------------------------------------------------------------
- */
-static void *
-H5I__remove_common(H5I_id_type_t *type_ptr, hid_t id)
-{
- H5I_id_info_t *curr_id; /* Pointer to the current atom */
- void * ret_value = NULL; /* Return value */
-
- FUNC_ENTER_STATIC
-
- /* Sanity check */
- HDassert(type_ptr);
-
- /* Get the ID node for the ID */
- if (NULL == (curr_id = (H5I_id_info_t *)H5SL_remove(type_ptr->ids, &id)))
- HGOTO_ERROR(H5E_ATOM, H5E_CANTDELETE, NULL, "can't remove ID node from skip list")
-
- /* Check if this ID was the last one accessed */
- if (type_ptr->last_info == curr_id)
- type_ptr->last_info = NULL;
-
- ret_value = (void *)curr_id->obj_ptr; /* (Casting away const OK -QAK) */
- curr_id = H5FL_FREE(H5I_id_info_t, curr_id);
-
- /* Decrement the number of IDs in the type */
- (type_ptr->id_count)--;
-
-done:
- FUNC_LEAVE_NOAPI(ret_value)
-} /* end H5I__remove_common() */
-
-/*-------------------------------------------------------------------------
- * Function: H5I_remove
- *
- * Purpose: Removes the specified ID from its type.
- *
- * Return: Success: A pointer to the object that was removed, the
- * same pointer which would have been found by
- * calling H5I_object().
- * Failure: NULL
- *
- * Programmer: Unknown
- *
- *-------------------------------------------------------------------------
- */
-void *
-H5I_remove(hid_t id)
-{
- H5I_id_type_t *type_ptr; /* Pointer to the atomic type */
- H5I_type_t type; /* Atom's atomic type */
- void * ret_value = NULL; /* Return value */
-
- FUNC_ENTER_NOAPI(NULL)
-
- /* Check arguments */
- type = H5I_TYPE(id);
- if (type <= H5I_BADID || (int)type >= H5I_next_type)
- HGOTO_ERROR(H5E_ARGS, H5E_BADRANGE, NULL, "invalid type number")
- type_ptr = H5I_id_type_list_g[type];
- if (type_ptr == NULL || type_ptr->init_count <= 0)
- HGOTO_ERROR(H5E_ATOM, H5E_BADGROUP, NULL, "invalid type")
-
- /* Remove the node from the type */
- if (NULL == (ret_value = H5I__remove_common(type_ptr, id)))
- HGOTO_ERROR(H5E_ATOM, H5E_CANTDELETE, NULL, "can't remove ID node")
-
-done:
- FUNC_LEAVE_NOAPI(ret_value)
-} /* end H5I_remove() */
-
-/*-------------------------------------------------------------------------
* Function: H5Idec_ref
*
* Purpose: Decrements the number of references outstanding for an ID.
@@ -1296,174 +484,17 @@ H5Idec_ref(hid_t id)
/* Check arguments */
if (id < 0)
- HGOTO_ERROR(H5E_ATOM, H5E_BADATOM, (-1), "invalid ID")
+ HGOTO_ERROR(H5E_ID, H5E_BADID, (-1), "invalid ID")
/* Do actual decrement operation */
if ((ret_value = H5I_dec_app_ref(id)) < 0)
- HGOTO_ERROR(H5E_ATOM, H5E_CANTDEC, (-1), "can't decrement ID ref count")
+ HGOTO_ERROR(H5E_ID, H5E_CANTDEC, (-1), "can't decrement ID ref count")
done:
FUNC_LEAVE_API(ret_value)
} /* end H5Idec_ref() */
/*-------------------------------------------------------------------------
- * Function: H5I_dec_ref
- *
- * Purpose: Decrements the number of references outstanding for an ID.
- * This will fail if the type is not a reference counted type.
- * The ID type's 'free' function will be called for the ID
- * if the reference count for the ID reaches 0 and a free
- * function has been defined at type creation time.
- *
- * Return: Success: New reference count
- *
- * Failure: -1
- *
- *-------------------------------------------------------------------------
- */
-int
-H5I_dec_ref(hid_t id)
-{
- H5I_id_info_t *id_ptr; /* Pointer to the new ID */
- int ret_value = 0; /* Return value */
-
- FUNC_ENTER_NOAPI((-1))
-
- /* Sanity check */
- HDassert(id >= 0);
-
- /* General lookup of the ID */
- if (NULL == (id_ptr = H5I__find_id(id)))
- HGOTO_ERROR(H5E_ATOM, H5E_BADATOM, (-1), "can't locate ID")
-
- /* If this is the last reference to the object then invoke the type's
- * free method on the object. If the free method is undefined or
- * successful then remove the object from the type; otherwise leave
- * the object in the type without decrementing the reference
- * count. If the reference count is more than one then decrement the
- * reference count without calling the free method.
- *
- * Beware: the free method may call other H5I functions.
- *
- * If an object is closing, we can remove the ID even though the free
- * method might fail. This can happen when a mandatory filter fails to
- * write when a dataset is closed and the chunk cache is flushed to the
- * file. We have to close the dataset anyway. (SLU - 2010/9/7)
- */
- if (1 == id_ptr->count) {
- H5I_id_type_t *type_ptr; /*ptr to the type */
-
- /* Get the ID's type */
- type_ptr = H5I_id_type_list_g[H5I_TYPE(id)];
-
- /* (Casting away const OK -QAK) */
- if (!type_ptr->cls->free_func || (type_ptr->cls->free_func)((void *)id_ptr->obj_ptr) >= 0) {
- /* Remove the node from the type */
- if (NULL == H5I__remove_common(type_ptr, id))
- HGOTO_ERROR(H5E_ATOM, H5E_CANTDELETE, (-1), "can't remove ID node")
- ret_value = 0;
- } /* end if */
- else
- ret_value = -1;
- } /* end if */
- else {
- --(id_ptr->count);
- ret_value = (int)id_ptr->count;
- } /* end else */
-
-done:
- FUNC_LEAVE_NOAPI(ret_value)
-} /* end H5I_dec_ref() */
-
-/*-------------------------------------------------------------------------
- * Function: H5I_dec_app_ref
- *
- * Purpose: H5I_dec_ref wrapper for case of modifying the application ref.
- * count for an ID as well as normal reference count.
- *
- * Return: Success: New app. reference count
- * Failure: -1
- *
- * Programmer: Quincey Koziol
- * Sept 16, 2010
- *
- *-------------------------------------------------------------------------
- */
-int
-H5I_dec_app_ref(hid_t id)
-{
- H5I_id_info_t *id_ptr; /* Pointer to the new ID */
- int ret_value = 0; /* Return value */
-
- FUNC_ENTER_NOAPI((-1))
-
- /* Sanity check */
- HDassert(id >= 0);
-
- /* Call regular decrement reference count routine */
- if ((ret_value = H5I_dec_ref(id)) < 0)
- HGOTO_ERROR(H5E_ATOM, H5E_CANTDEC, (-1), "can't decrement ID ref count")
-
- /* Check if the ID still exists */
- if (ret_value > 0) {
- /* General lookup of the ID */
- if (NULL == (id_ptr = H5I__find_id(id)))
- HGOTO_ERROR(H5E_ATOM, H5E_BADATOM, (-1), "can't locate ID")
-
- /* Adjust app_ref */
- --(id_ptr->app_count);
- HDassert(id_ptr->count >= id_ptr->app_count);
-
- /* Set return value */
- ret_value = (int)id_ptr->app_count;
- } /* end if */
-
-done:
- FUNC_LEAVE_NOAPI(ret_value)
-} /* end H5I_dec_app_ref() */
-
-/*-------------------------------------------------------------------------
- * Function: H5I_dec_app_ref_always_close
- *
- * Purpose: H5I_dec_app_ref wrapper for case of always closing the ID,
- * even when the free routine fails
- *
- * Return: Success: New app. reference count
- * Failure: -1
- *
- *-------------------------------------------------------------------------
- */
-int
-H5I_dec_app_ref_always_close(hid_t id)
-{
- int ret_value = 0; /* Return value */
-
- FUNC_ENTER_NOAPI((-1))
-
- /* Sanity check */
- HDassert(id >= 0);
-
- /* Call application decrement reference count routine */
- ret_value = H5I_dec_app_ref(id);
-
- /* Check for failure */
- if (ret_value < 0) {
- /*
- * If an object is closing, we can remove the ID even though the free
- * method might fail. This can happen when a mandatory filter fails to
- * write when a dataset is closed and the chunk cache is flushed to the
- * file. We have to close the dataset anyway. (SLU - 2010/9/7)
- */
- H5I_remove(id);
-
- HGOTO_ERROR(H5E_ATOM, H5E_CANTDEC, (-1), "can't decrement ID ref count")
- }
-
-done:
- FUNC_LEAVE_NOAPI(ret_value)
-} /* end H5I_dec_app_ref_always_close() */
-
-/*-------------------------------------------------------------------------
* Function: H5Iinc_ref
*
* Purpose: Increments the number of references outstanding for an ID.
@@ -1476,61 +507,24 @@ done:
int
H5Iinc_ref(hid_t id)
{
- int ret_value; /* Return value */
+ int ret_value = -1; /* Return value */
FUNC_ENTER_API((-1))
H5TRACE1("Is", "i", id);
/* Check arguments */
if (id < 0)
- HGOTO_ERROR(H5E_ATOM, H5E_BADATOM, (-1), "invalid ID")
+ HGOTO_ERROR(H5E_ID, H5E_BADID, (-1), "invalid ID")
/* Do actual increment operation */
if ((ret_value = H5I_inc_ref(id, TRUE)) < 0)
- HGOTO_ERROR(H5E_ATOM, H5E_CANTINC, (-1), "can't increment ID ref count")
+ HGOTO_ERROR(H5E_ID, H5E_CANTINC, (-1), "can't increment ID ref count")
done:
FUNC_LEAVE_API(ret_value)
} /* end H5Iinc_ref() */
/*-------------------------------------------------------------------------
- * Function: H5I_inc_ref
- *
- * Purpose: Increment the reference count for an object.
- *
- * Return: Success: The new reference count
- * Failure: -1
- *
- *-------------------------------------------------------------------------
- */
-int
-H5I_inc_ref(hid_t id, hbool_t app_ref)
-{
- H5I_id_info_t *id_ptr; /* Pointer to the ID */
- int ret_value = 0; /* Return value */
-
- FUNC_ENTER_NOAPI((-1))
-
- /* Sanity check */
- HDassert(id >= 0);
-
- /* General lookup of the ID */
- if (NULL == (id_ptr = H5I__find_id(id)))
- HGOTO_ERROR(H5E_ATOM, H5E_BADATOM, (-1), "can't locate ID")
-
- /* Adjust reference counts */
- ++(id_ptr->count);
- if (app_ref)
- ++(id_ptr->app_count);
-
- /* Set return value */
- ret_value = (int)(app_ref ? id_ptr->app_count : id_ptr->count);
-
-done:
- FUNC_LEAVE_NOAPI(ret_value)
-} /* end H5I_inc_ref() */
-
-/*-------------------------------------------------------------------------
* Function: H5Iget_ref
*
* Purpose: Retrieves the number of references outstanding for an ID.
@@ -1543,56 +537,24 @@ done:
int
H5Iget_ref(hid_t id)
{
- int ret_value; /* Return value */
+ int ret_value = -1; /* Return value */
FUNC_ENTER_API((-1))
H5TRACE1("Is", "i", id);
/* Check arguments */
if (id < 0)
- HGOTO_ERROR(H5E_ATOM, H5E_BADATOM, (-1), "invalid ID")
+ HGOTO_ERROR(H5E_ID, H5E_BADID, (-1), "invalid ID")
/* Do actual retrieve operation */
if ((ret_value = H5I_get_ref(id, TRUE)) < 0)
- HGOTO_ERROR(H5E_ATOM, H5E_CANTGET, (-1), "can't get ID ref count")
+ HGOTO_ERROR(H5E_ID, H5E_CANTGET, (-1), "can't get ID ref count")
done:
FUNC_LEAVE_API(ret_value)
} /* end H5Iget_ref() */
/*-------------------------------------------------------------------------
- * Function: H5I_get_ref
- *
- * Purpose: Retrieve the reference count for an object.
- *
- * Return: Success: The reference count
- * Failure: -1
- *
- *-------------------------------------------------------------------------
- */
-int
-H5I_get_ref(hid_t id, hbool_t app_ref)
-{
- H5I_id_info_t *id_ptr; /* Pointer to the ID */
- int ret_value = 0; /* Return value */
-
- FUNC_ENTER_NOAPI((-1))
-
- /* Sanity check */
- HDassert(id >= 0);
-
- /* General lookup of the ID */
- if (NULL == (id_ptr = H5I__find_id(id)))
- HGOTO_ERROR(H5E_ATOM, H5E_BADATOM, (-1), "can't locate ID")
-
- /* Set return value */
- ret_value = (int)(app_ref ? id_ptr->app_count : id_ptr->count);
-
-done:
- FUNC_LEAVE_NOAPI(ret_value)
-} /* end H5I_get_ref() */
-
-/*-------------------------------------------------------------------------
* Function: H5Iinc_type_ref
*
* Purpose: Increments the number of references outstanding for an ID type.
@@ -1605,64 +567,31 @@ done:
int
H5Iinc_type_ref(H5I_type_t type)
{
- int ret_value; /* Return value */
+ int ret_value = -1; /* Return value */
FUNC_ENTER_API((-1))
H5TRACE1("Is", "It", type);
/* Check arguments */
- if (type <= 0 || (int)type >= H5I_next_type)
- HGOTO_ERROR(H5E_ATOM, H5E_BADATOM, (-1), "invalid ID type")
+ if (type <= 0 || (int)type >= H5I_next_type_g)
+ HGOTO_ERROR(H5E_ID, H5E_BADID, (-1), "invalid ID type")
if (H5I_IS_LIB_TYPE(type))
- HGOTO_ERROR(H5E_ATOM, H5E_BADGROUP, (-1), "cannot call public function on library type")
+ HGOTO_ERROR(H5E_ID, H5E_BADGROUP, (-1), "cannot call public function on library type")
/* Do actual increment operation */
if ((ret_value = H5I__inc_type_ref(type)) < 0)
- HGOTO_ERROR(H5E_ATOM, H5E_CANTINC, (-1), "can't increment ID type ref count")
+ HGOTO_ERROR(H5E_ID, H5E_CANTINC, (-1), "can't increment ID type ref count")
done:
FUNC_LEAVE_API(ret_value)
} /* end H5Iinc_ref() */
/*-------------------------------------------------------------------------
- * Function: H5I__inc_type_ref
- *
- * Purpose: Increment the reference count for an ID type.
- *
- * Return: Success: The new reference count
- * Failure: -1
- *
- *-------------------------------------------------------------------------
- */
-static int
-H5I__inc_type_ref(H5I_type_t type)
-{
- H5I_id_type_t *type_ptr; /* Pointer to the type */
- int ret_value = -1; /* Return value */
-
- FUNC_ENTER_STATIC
-
- /* Sanity check */
- HDassert(type > 0 && (int)type < H5I_next_type);
-
- /* Check arguments */
- type_ptr = H5I_id_type_list_g[type];
- if (NULL == type_ptr)
- HGOTO_ERROR(H5E_ATOM, H5E_BADGROUP, (-1), "invalid type")
-
- /* Set return value */
- ret_value = (int)(++(type_ptr->init_count));
-
-done:
- FUNC_LEAVE_NOAPI(ret_value)
-} /* end H5I__inc_type_ref() */
-
-/*-------------------------------------------------------------------------
* Function: H5Idec_type_ref
*
* Purpose: Decrements the reference count on an entire type of IDs.
* If the type reference count becomes zero then the type is
- * destroyed along with all atoms in that type regardless of
+ * destroyed along with all IDs in that type regardless of
* their reference counts. Destroying IDs involves calling
* the free-func for each ID's object and then adding the ID
* struct to the ID free list. Public interface to
@@ -1690,7 +619,7 @@ H5Idec_type_ref(H5I_type_t type)
H5TRACE1("e", "It", type);
if (H5I_IS_LIB_TYPE(type))
- HGOTO_ERROR(H5E_ATOM, H5E_BADGROUP, (-1), "cannot call public function on library type")
+ HGOTO_ERROR(H5E_ID, H5E_BADGROUP, (-1), "cannot call public function on library type")
ret_value = H5I_dec_type_ref(type);
@@ -1699,58 +628,6 @@ done:
} /* end H5Idec_type_ref() */
/*-------------------------------------------------------------------------
- * Function: H5I_dec_type_ref
- *
- * Purpose: Decrements the reference count on an entire type of IDs.
- * If the type reference count becomes zero then the type is
- * destroyed along with all atoms in that type regardless of
- * their reference counts. Destroying IDs involves calling
- * the free-func for each ID's object and then adding the ID
- * struct to the ID free list.
- * Returns the number of references to the type on success; a
- * return value of 0 means that the type will have to be
- * re-initialized before it can be used again (and should probably
- * be set to H5I_UNINIT).
- *
- * Return: Success: Number of references to type
- * Failure: -1
- *
- *-------------------------------------------------------------------------
- */
-int
-H5I_dec_type_ref(H5I_type_t type)
-{
- H5I_id_type_t *type_ptr; /* Pointer to the ID type */
- herr_t ret_value = 0; /* Return value */
-
- FUNC_ENTER_NOAPI((-1))
-
- if (type <= H5I_BADID || (int)type >= H5I_next_type)
- HGOTO_ERROR(H5E_ARGS, H5E_BADRANGE, (-1), "invalid type number")
-
- type_ptr = H5I_id_type_list_g[type];
- if (type_ptr == NULL || type_ptr->init_count <= 0)
- HGOTO_ERROR(H5E_ATOM, H5E_BADGROUP, (-1), "invalid type")
-
- /* Decrement the number of users of the atomic type. If this is the
- * last user of the type then release all atoms from the type and
- * free all memory it used. The free function is invoked for each atom
- * being freed.
- */
- if (1 == type_ptr->init_count) {
- H5I__destroy_type(type);
- ret_value = 0;
- } /* end if */
- else {
- --(type_ptr->init_count);
- ret_value = (herr_t)type_ptr->init_count;
- } /* end else */
-
-done:
- FUNC_LEAVE_NOAPI(ret_value)
-} /* end H5I_dec_type_ref() */
-
-/*-------------------------------------------------------------------------
* Function: H5Iget_type_ref
*
* Purpose: Retrieves the number of references outstanding for a type.
@@ -1763,60 +640,26 @@ done:
int
H5Iget_type_ref(H5I_type_t type)
{
- int ret_value; /* Return value */
+ int ret_value = -1; /* Return value */
FUNC_ENTER_API((-1))
H5TRACE1("Is", "It", type);
/* Check arguments */
- if (type <= 0 || (int)type >= H5I_next_type)
- HGOTO_ERROR(H5E_ATOM, H5E_BADATOM, (-1), "invalid ID type")
+ if (type <= 0 || (int)type >= H5I_next_type_g)
+ HGOTO_ERROR(H5E_ID, H5E_BADID, (-1), "invalid ID type")
if (H5I_IS_LIB_TYPE(type))
- HGOTO_ERROR(H5E_ATOM, H5E_BADGROUP, (-1), "cannot call public function on library type")
+ HGOTO_ERROR(H5E_ID, H5E_BADGROUP, (-1), "cannot call public function on library type")
/* Do actual retrieve operation */
if ((ret_value = H5I__get_type_ref(type)) < 0)
- HGOTO_ERROR(H5E_ATOM, H5E_CANTGET, (-1), "can't get ID type ref count")
+ HGOTO_ERROR(H5E_ID, H5E_CANTGET, (-1), "can't get ID type ref count")
done:
FUNC_LEAVE_API(ret_value)
} /* end H5Iget_ref() */
/*-------------------------------------------------------------------------
- * Function: H5I__get_type_ref
- *
- * Purpose: Retrieve the reference count for an ID type.
- *
- * Return: Success: The reference count
- *
- * Failure: -1
- *
- *-------------------------------------------------------------------------
- */
-static int
-H5I__get_type_ref(H5I_type_t type)
-{
- H5I_id_type_t *type_ptr; /* Pointer to the type */
- int ret_value = -1; /* Return value */
-
- FUNC_ENTER_STATIC
-
- /* Sanity check */
- HDassert(type >= 0);
-
- /* Check arguments */
- type_ptr = H5I_id_type_list_g[type];
- if (!type_ptr)
- HGOTO_ERROR(H5E_ATOM, H5E_BADGROUP, FAIL, "invalid type")
-
- /* Set return value */
- ret_value = (int)type_ptr->init_count;
-
-done:
- FUNC_LEAVE_NOAPI(ret_value)
-} /* end H5I__get_type_ref() */
-
-/*-------------------------------------------------------------------------
* Function: H5Iis_valid
*
* Purpose: Check if the given id is valid. An id is valid if it is in
@@ -1829,16 +672,16 @@ done:
htri_t
H5Iis_valid(hid_t id)
{
- H5I_id_info_t *id_ptr; /* ptr to the ID */
+ H5I_id_info_t *info = NULL; /* Pointer to the ID info */
htri_t ret_value = TRUE; /* Return value */
FUNC_ENTER_API(FAIL)
H5TRACE1("t", "i", id);
/* Find the ID */
- if (NULL == (id_ptr = H5I__find_id(id)))
+ if (NULL == (info = H5I__find_id(id)))
ret_value = FALSE;
- else if (!id_ptr->app_count) /* Check if the found id is an internal id */
+ else if (!info->app_count) /* Check if the found id is an internal id */
ret_value = FALSE;
done:
@@ -1902,15 +745,15 @@ H5I__search_cb(void *obj, hid_t id, void *_udata)
void *
H5Isearch(H5I_type_t type, H5I_search_func_t func, void *key)
{
- H5I_search_ud_t udata; /* Context for iteration */
- void * ret_value; /* Return value */
+ H5I_search_ud_t udata; /* Context for iteration */
+ void * ret_value = NULL; /* Return value */
FUNC_ENTER_API(NULL)
H5TRACE3("*x", "ItIS*x", type, func, key);
/* Check arguments */
if (H5I_IS_LIB_TYPE(type))
- HGOTO_ERROR(H5E_ATOM, H5E_BADGROUP, NULL, "cannot call public function on library type")
+ HGOTO_ERROR(H5E_ID, H5E_BADGROUP, NULL, "cannot call public function on library type")
/* Set up udata struct */
udata.app_cb = func;
@@ -1948,9 +791,9 @@ done:
static int
H5I__iterate_pub_cb(void H5_ATTR_UNUSED *obj, hid_t id, void *_udata)
{
- H5I_iterate_pub_ud_t *udata = (H5I_iterate_pub_ud_t *)_udata; /* User data for callback */
- herr_t cb_ret_val; /* User callback return value */
- int ret_value = H5_ITER_ERROR; /* Callback return value */
+ H5I_iterate_pub_ud_t *udata = (H5I_iterate_pub_ud_t *)_udata; /* User data for callback */
+ herr_t cb_ret_val = FAIL; /* User callback return value */
+ int ret_value = H5_ITER_ERROR; /* Callback return value */
FUNC_ENTER_STATIC_NOERR
@@ -1994,8 +837,8 @@ H5I__iterate_pub_cb(void H5_ATTR_UNUSED *obj, hid_t id, void *_udata)
herr_t
H5Iiterate(H5I_type_t type, H5I_iterate_func_t op, void *op_data)
{
- H5I_iterate_pub_ud_t int_udata; /* Internal user data */
- herr_t ret_value; /* Return value */
+ H5I_iterate_pub_ud_t int_udata; /* Internal user data */
+ herr_t ret_value = FAIL; /* Return value */
FUNC_ENTER_API(FAIL)
H5TRACE3("e", "ItII*x", type, op, op_data);
@@ -2008,161 +851,55 @@ H5Iiterate(H5I_type_t type, H5I_iterate_func_t op, void *op_data)
* here, as we can't do anything with it without revising the API.
*/
if ((ret_value = H5I_iterate(type, H5I__iterate_pub_cb, &int_udata, TRUE)) < 0)
- HGOTO_ERROR(H5E_ATOM, H5E_BADITER, FAIL, "can't iterate over ids")
+ HGOTO_ERROR(H5E_ID, H5E_BADITER, FAIL, "can't iterate over ids")
done:
FUNC_LEAVE_API(ret_value)
} /* end H5Iiterate() */
/*-------------------------------------------------------------------------
- * Function: H5I__iterate_cb
- *
- * Purpose: Callback routine for H5I_iterate, invokes "user" callback
- * function, and then sets return value, based on the result of
- * that callback.
- *
- * Return: Success: H5_ITER_CONT (0) or H5_ITER_STOP (1)
- * Failure: H5_ITER_ERROR (-1)
- *
- *-------------------------------------------------------------------------
- */
-static int
-H5I__iterate_cb(void *_item, void H5_ATTR_UNUSED *_key, void *_udata)
-{
- H5I_id_info_t * item = (H5I_id_info_t *)_item; /* Pointer to the ID node */
- H5I_iterate_ud_t *udata = (H5I_iterate_ud_t *)_udata; /* User data for callback */
- int ret_value = H5_ITER_CONT; /* Callback return value */
-
- FUNC_ENTER_STATIC_NOERR
-
- /* Only invoke the callback function if this ID is visible externally and
- * its reference count is positive.
- */
- if ((!udata->app_ref) || (item->app_count > 0)) {
- H5I_type_t type = udata->obj_type;
- void * obj_ptr;
- herr_t cb_ret_val;
-
- /* The stored object pointer might be an H5VL_object_t, in which
- * case we'll need to get the wrapped object struct (H5F_t *, etc.).
- */
- obj_ptr = H5I__unwrap((void *)item->obj_ptr, type);
-
- /* Invoke callback function */
- cb_ret_val =
- (*udata->user_func)((void *)obj_ptr, item->id, udata->user_udata); /* (Casting away const OK) */
-
- /* Set the return value based on the callback's return value */
- if (cb_ret_val > 0)
- ret_value = H5_ITER_STOP; /* terminate iteration early */
- else if (cb_ret_val < 0)
- ret_value = H5_ITER_ERROR; /* indicate failure (which terminates iteration) */
- } /* end if */
-
- FUNC_LEAVE_NOAPI(ret_value)
-} /* end H5I__iterate_cb() */
-
-/*-------------------------------------------------------------------------
- * Function: H5I_iterate
- *
- * Purpose: Apply function FUNC to each member of type TYPE (with
- * non-zero application reference count if app_ref is TRUE).
- * Stop if FUNC returns a non zero value (i.e. anything
- * other than H5_ITER_CONT).
- *
- * If FUNC returns a positive value (i.e. H5_ITER_STOP),
- * return SUCCEED.
- *
- * If FUNC returns a negative value (i.e. H5_ITER_ERROR),
- * return FAIL.
+ * Function: H5Iget_file_id
*
- * The FUNC should take a pointer to the object and the
- * udata as arguments and return non-zero to terminate
- * siteration, and zero to continue.
+ * Purpose: Obtains the file ID given an object ID. The user has to
+ * close this ID.
*
- * Limitation: Currently there is no way to start the iteration from
- * where a previous iteration left off.
+ * Return: Success: The file ID associated with the object
*
- * Return: SUCCEED/FAIL
+ * Failure: H5I_INVALID_HID
*
*-------------------------------------------------------------------------
*/
-herr_t
-H5I_iterate(H5I_type_t type, H5I_search_func_t func, void *udata, hbool_t app_ref)
+hid_t
+H5Iget_file_id(hid_t obj_id)
{
- H5I_id_type_t *type_ptr; /* Pointer to the type */
- herr_t ret_value = SUCCEED; /* Return value */
-
- FUNC_ENTER_NOAPI(FAIL)
-
- /* Check arguments */
- if (type <= H5I_BADID || (int)type >= H5I_next_type)
- HGOTO_ERROR(H5E_ARGS, H5E_BADRANGE, FAIL, "invalid type number")
- type_ptr = H5I_id_type_list_g[type];
-
- /* Only iterate through ID list if it is initialized and there are IDs in type */
- if (type_ptr && type_ptr->init_count > 0 && type_ptr->id_count > 0) {
- H5I_iterate_ud_t iter_udata; /* User data for iteration callback */
- herr_t iter_status; /* Iteration status */
-
- /* Set up iterator user data */
- iter_udata.user_func = func;
- iter_udata.user_udata = udata;
- iter_udata.app_ref = app_ref;
- iter_udata.obj_type = type;
-
- /* Iterate over IDs */
- if ((iter_status = H5SL_iterate(type_ptr->ids, H5I__iterate_cb, &iter_udata)) < 0)
- HGOTO_ERROR(H5E_ATOM, H5E_BADITER, FAIL, "iteration failed")
- } /* end if */
+ H5I_type_t type; /* ID type */
+ hid_t ret_value = H5I_INVALID_HID; /* Return value */
-done:
- FUNC_LEAVE_NOAPI(ret_value)
-} /* end H5I_iterate() */
+ FUNC_ENTER_API(H5I_INVALID_HID)
+ H5TRACE1("i", "i", obj_id);
-/*-------------------------------------------------------------------------
- * Function: H5I__find_id
- *
- * Purpose: Given an object ID find the info struct that describes the
- * object.
- *
- * Return: Success: A pointer to the object's info struct.
- *
- * Failure: NULL
- *
- *-------------------------------------------------------------------------
- */
-static H5I_id_info_t *
-H5I__find_id(hid_t id)
-{
- H5I_type_t type; /*ID's type */
- H5I_id_type_t *type_ptr; /*ptr to the type */
- H5I_id_info_t *ret_value = NULL; /* Return value */
+ /* Get object type */
+ type = H5I_TYPE(obj_id);
- FUNC_ENTER_STATIC_NOERR
+ /* Call internal function */
+ if (H5I_FILE == type || H5I_DATATYPE == type || H5I_GROUP == type || H5I_DATASET == type ||
+ H5I_ATTR == type) {
+ H5VL_object_t *vol_obj; /* Object of obj_id */
- /* Check arguments */
- type = H5I_TYPE(id);
- if (type <= H5I_BADID || (int)type >= H5I_next_type)
- HGOTO_DONE(NULL)
- type_ptr = H5I_id_type_list_g[type];
- if (!type_ptr || type_ptr->init_count <= 0)
- HGOTO_DONE(NULL)
-
- /* Check for same ID as we have looked up last time */
- if (type_ptr->last_info && type_ptr->last_info->id == id)
- ret_value = type_ptr->last_info;
- else {
- /* Locate the ID node for the ID */
- ret_value = (H5I_id_info_t *)H5SL_search(type_ptr->ids, &id);
+ /* Get the VOL object */
+ if (NULL == (vol_obj = H5VL_vol_object(obj_id)))
+ HGOTO_ERROR(H5E_ID, H5E_BADTYPE, H5I_INVALID_HID, "invalid location identifier")
- /* Remember this ID */
- type_ptr->last_info = ret_value;
- } /* end else */
+ /* Get the file ID */
+ if ((ret_value = H5F_get_file_id(vol_obj, type, TRUE)) < 0)
+ HGOTO_ERROR(H5E_ID, H5E_CANTGET, H5I_INVALID_HID, "can't retrieve file ID")
+ }
+ else
+ HGOTO_ERROR(H5E_ARGS, H5E_BADRANGE, H5I_INVALID_HID, "not an ID of a file object")
done:
- FUNC_LEAVE_NOAPI(ret_value)
-} /* end H5I__find_id() */
+ FUNC_LEAVE_API(ret_value)
+} /* end H5Iget_file_id() */
/*-------------------------------------------------------------------------
* Function: H5Iget_name
@@ -2173,10 +910,7 @@ done:
*
* Failure: -1
*
- * NOTE: Not safe for arbitrary VOL connectors as it relies on
- * private H5G calls.
- *
- * Comments: Public function
+ * Notes:
* If 'name' is non-NULL then write up to 'size' bytes into that
* buffer and always return the length of the entry name.
* Otherwise 'size' is ignored and the function does not store the name,
@@ -2191,16 +925,16 @@ done:
ssize_t
H5Iget_name(hid_t id, char *name /*out*/, size_t size)
{
- H5VL_object_t * vol_obj; /* Object of loc_id */
+ H5VL_object_t * vol_obj = NULL; /* Object stored in ID */
H5VL_loc_params_t loc_params;
- ssize_t ret_value; /* Return value */
+ ssize_t ret_value = -1; /* Return value */
FUNC_ENTER_API((-1))
H5TRACE3("Zs", "ixz", id, name, size);
/* Get the object pointer */
if (NULL == (vol_obj = H5VL_vol_object(id)))
- HGOTO_ERROR(H5E_ATOM, H5E_BADTYPE, (-1), "invalid identifier")
+ HGOTO_ERROR(H5E_ID, H5E_BADTYPE, (-1), "invalid identifier")
/* Set location parameters */
loc_params.type = H5VL_OBJECT_BY_SELF;
@@ -2209,260 +943,8 @@ H5Iget_name(hid_t id, char *name /*out*/, size_t size)
/* Retrieve object's name */
if (H5VL_object_get(vol_obj, &loc_params, H5VL_OBJECT_GET_NAME, H5P_DATASET_XFER_DEFAULT, H5_REQUEST_NULL,
&ret_value, name, size) < 0)
- HGOTO_ERROR(H5E_ATOM, H5E_CANTGET, (-1), "can't retrieve object name")
+ HGOTO_ERROR(H5E_ID, H5E_CANTGET, (-1), "can't retrieve object name")
done:
FUNC_LEAVE_API(ret_value)
} /* end H5Iget_name() */
-
-/*-------------------------------------------------------------------------
- * Function: H5Iget_file_id
- *
- * Purpose: Obtains the file ID given an object ID. The user has to
- * close this ID.
- *
- * Return: Success: The file ID associated with the object
- *
- * Failure: H5I_INVALID_HID
- *
- *-------------------------------------------------------------------------
- */
-hid_t
-H5Iget_file_id(hid_t obj_id)
-{
- H5I_type_t type; /* ID type */
- hid_t ret_value = H5I_INVALID_HID; /* Return value */
-
- FUNC_ENTER_API(FAIL)
- H5TRACE1("i", "i", obj_id);
-
- /* Get object type */
- type = H5I_TYPE(obj_id);
-
- /* Call internal function */
- if (H5I_FILE == type || H5I_DATATYPE == type || H5I_GROUP == type || H5I_DATASET == type ||
- H5I_ATTR == type) {
- H5VL_object_t *vol_obj; /* Object of obj_id */
-
- /* Get the VOL object */
- if (NULL == (vol_obj = H5VL_vol_object(obj_id)))
- HGOTO_ERROR(H5E_ATOM, H5E_BADTYPE, H5I_INVALID_HID, "invalid location identifier")
-
- /* Get the file ID */
- if ((ret_value = H5F_get_file_id(vol_obj, type, TRUE)) < 0)
- HGOTO_ERROR(H5E_ATOM, H5E_CANTGET, H5I_INVALID_HID, "can't retrieve file ID")
- } /* end if */
- else
- HGOTO_ERROR(H5E_ARGS, H5E_BADRANGE, H5I_INVALID_HID, "not an ID of a file object")
-
-done:
- FUNC_LEAVE_API(ret_value)
-} /* end H5Iget_file_id() */
-
-/*-------------------------------------------------------------------------
- * Function: H5I__find_id_cb
- *
- * Purpose: Callback for searching for an ID with a specific pointer
- *
- * Return: Success: H5_ITER_CONT (0) or H5_ITER_STOP (1)
- * Failure: H5_ITER_ERROR (-1)
- *
- *-------------------------------------------------------------------------
- */
-static int
-H5I__find_id_cb(void *_item, void H5_ATTR_UNUSED *_key, void *_udata)
-{
- H5I_id_info_t * item = (H5I_id_info_t *)_item; /* Pointer to the ID node */
- H5I_get_id_ud_t *udata = (H5I_get_id_ud_t *)_udata; /* Pointer to user data */
- H5I_type_t type = udata->obj_type;
- const void * obj_ptr = NULL;
- int ret_value = H5_ITER_CONT; /* Return value */
-
- FUNC_ENTER_STATIC_NOERR
-
- /* Sanity check */
- HDassert(item);
- HDassert(udata);
-
- /* Get a pointer to the VOL connector's data */
- obj_ptr = H5I__unwrap(item->obj_ptr, type);
-
- /* Check for a match */
- if (obj_ptr == udata->object) {
- udata->ret_id = item->id;
- ret_value = H5_ITER_STOP;
- } /* end if */
-
- FUNC_LEAVE_NOAPI(ret_value)
-} /* end H5I__find_id_cb() */
-
-/*-------------------------------------------------------------------------
- * Function: H5I_find_id
- *
- * Purpose: Return the ID of an object by searching through the ID list
- * for the type.
- *
- * Return: SUCCEED/FAIL
- * (id will be set to H5I_INVALID_HID on errors or not found)
- *
- *-------------------------------------------------------------------------
- */
-herr_t
-H5I_find_id(const void *object, H5I_type_t type, hid_t *id)
-{
- H5I_id_type_t *type_ptr; /* Pointer to the type */
- herr_t ret_value = SUCCEED; /* Return value */
-
- FUNC_ENTER_NOAPI(FAIL)
-
- HDassert(id);
-
- *id = H5I_INVALID_HID;
-
- type_ptr = H5I_id_type_list_g[type];
- if (!type_ptr || type_ptr->init_count <= 0)
- HGOTO_ERROR(H5E_ATOM, H5E_BADGROUP, FAIL, "invalid type")
-
- /* Only iterate through ID list if it is initialized and there are IDs in type */
- if (type_ptr->init_count > 0 && type_ptr->id_count > 0) {
- H5I_get_id_ud_t udata; /* User data */
- herr_t iter_status; /* Iteration status */
-
- /* Set up iterator user data */
- udata.object = object;
- udata.obj_type = type;
- udata.ret_id = H5I_INVALID_HID;
-
- /* Iterate over IDs for the ID type */
- if ((iter_status = H5SL_iterate(type_ptr->ids, H5I__find_id_cb, &udata)) < 0)
- HGOTO_ERROR(H5E_ATOM, H5E_BADITER, FAIL, "iteration failed")
-
- *id = udata.ret_id;
- } /* end if */
-
-done:
- FUNC_LEAVE_NOAPI(ret_value)
-} /* end H5I_find_id() */
-
-/*-------------------------------------------------------------------------
- * Function: H5I__id_dump_cb
- *
- * Purpose: Dump the contents of an ID to stderr for debugging.
- *
- * Return: H5_ITER_CONT (always)
- *
- *-------------------------------------------------------------------------
- */
-static int
-H5I__id_dump_cb(void *_item, void H5_ATTR_UNUSED *_key, void *_udata)
-{
- H5I_id_info_t *item = (H5I_id_info_t *)_item; /* Pointer to the ID node */
- H5I_type_t type = *(H5I_type_t *)_udata; /* User data */
- H5G_name_t * path = NULL; /* Path to file object */
- const void * obj_ptr = NULL; /* Pointer to VOL connector object */
-
- FUNC_ENTER_STATIC_NOERR
-
- HDfprintf(stderr, " id = %lu\n", (unsigned long)(item->id));
- HDfprintf(stderr, " count = %u\n", item->count);
- HDfprintf(stderr, " obj = 0x%08p\n", item->obj_ptr);
-
- /* Get the group location, so we get get the name */
- switch (type) {
- case H5I_GROUP: {
- const H5VL_object_t *vol_obj = (const H5VL_object_t *)item->obj_ptr;
-
- obj_ptr = H5VL_object_data(vol_obj);
- if (H5_VOL_NATIVE == vol_obj->connector->cls->value)
- path = H5G_nameof((const H5G_t *)obj_ptr);
- break;
- }
-
- case H5I_DATASET: {
- const H5VL_object_t *vol_obj = (const H5VL_object_t *)item->obj_ptr;
-
- obj_ptr = H5VL_object_data(vol_obj);
- if (H5_VOL_NATIVE == vol_obj->connector->cls->value)
- path = H5D_nameof((const H5D_t *)obj_ptr);
- break;
- }
-
- case H5I_DATATYPE: {
- const H5T_t *dt = (const H5T_t *)item->obj_ptr;
-
- obj_ptr = (void *)H5T_get_actual_type((H5T_t *)dt); /* Casting away const OK - QAK */
- path = H5T_nameof((const H5T_t *)obj_ptr);
- break;
- }
-
- /* TODO: Maps will have to be added when they are supported in the
- * native VOL connector.
- */
- case H5I_MAP:
-
- case H5I_UNINIT:
- case H5I_BADID:
- case H5I_FILE:
- case H5I_DATASPACE:
- case H5I_ATTR:
- case H5I_VFL:
- case H5I_VOL:
- case H5I_GENPROP_CLS:
- case H5I_GENPROP_LST:
- case H5I_ERROR_CLASS:
- case H5I_ERROR_MSG:
- case H5I_ERROR_STACK:
- case H5I_SPACE_SEL_ITER:
- case H5I_NTYPES:
- default:
- break; /* Other types of IDs are not stored in files */
- }
-
- if (path) {
- if (path->user_path_r)
- HDfprintf(stderr, " user_path = %s\n", H5RS_get_str(path->user_path_r));
- if (path->full_path_r)
- HDfprintf(stderr, " full_path = %s\n", H5RS_get_str(path->full_path_r));
- }
-
- FUNC_LEAVE_NOAPI(H5_ITER_CONT)
-} /* end H5I__id_dump_cb() */
-
-/*-------------------------------------------------------------------------
- * Function: H5I_dump_ids_for_type
- *
- * Purpose: Dump the contents of a type to stderr for debugging.
- *
- * Return: SUCCEED/FAIL
- *
- *-------------------------------------------------------------------------
- */
-herr_t
-H5I_dump_ids_for_type(H5I_type_t type)
-{
- H5I_id_type_t *type_ptr = NULL;
-
- FUNC_ENTER_NOAPI_NOERR
-
- HDfprintf(stderr, "Dumping ID type %d\n", (int)type);
- type_ptr = H5I_id_type_list_g[type];
-
- if (type_ptr) {
-
- /* Header */
- HDfprintf(stderr, " init_count = %u\n", type_ptr->init_count);
- HDfprintf(stderr, " reserved = %u\n", type_ptr->cls->reserved);
- HDfprintf(stderr, " id_count = %llu\n", (unsigned long long)type_ptr->id_count);
- HDfprintf(stderr, " nextid = %llu\n", (unsigned long long)type_ptr->nextid);
-
- /* List */
- if (type_ptr->id_count > 0) {
- HDfprintf(stderr, " List:\n");
- H5SL_iterate(type_ptr->ids, H5I__id_dump_cb, &type);
- }
- }
- else
- HDfprintf(stderr, "Global type info/tracking pointer for that type is NULL\n");
-
- FUNC_LEAVE_NOAPI(SUCCEED)
-} /* end H5I_dump_ids_for_type() */
diff --git a/src/H5Idbg.c b/src/H5Idbg.c
new file mode 100644
index 0000000..7b5eb5a
--- /dev/null
+++ b/src/H5Idbg.c
@@ -0,0 +1,205 @@
+/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
+ * 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 COPYING file, which can be found at the root of the source code *
+ * distribution tree, or in https://www.hdfgroup.org/licenses. *
+ * If you do not have access to either file, you may request a copy from *
+ * help@hdfgroup.org. *
+ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
+
+/*
+ * H5Idbg.c - Debugging routines for handling IDs
+ */
+
+/****************/
+/* Module Setup */
+/****************/
+
+#include "H5Imodule.h" /* This source code file is part of the H5I module */
+
+/***********/
+/* Headers */
+/***********/
+#include "H5private.h" /* Generic Functions */
+#include "H5Dprivate.h" /* Datasets */
+#include "H5Eprivate.h" /* Error handling */
+#include "H5Gprivate.h" /* Groups */
+#include "H5Ipkg.h" /* IDs */
+#include "H5RSprivate.h" /* Reference-counted strings */
+#include "H5Tprivate.h" /* Datatypes */
+#include "H5VLprivate.h" /* Virtual Object Layer */
+
+/****************/
+/* Local Macros */
+/****************/
+
+/******************/
+/* Local Typedefs */
+/******************/
+
+/********************/
+/* Package Typedefs */
+/********************/
+
+/********************/
+/* Local Prototypes */
+/********************/
+
+static int H5I__id_dump_cb(void *_item, void *_key, void *_udata);
+
+/*********************/
+/* Package Variables */
+/*********************/
+
+/*****************************/
+/* Library Private Variables */
+/*****************************/
+
+/*******************/
+/* Local Variables */
+/*******************/
+
+/*-------------------------------------------------------------------------
+ * Function: H5I__id_dump_cb
+ *
+ * Purpose: Dump the contents of an ID to stderr for debugging.
+ *
+ * Return: H5_ITER_CONT (always)
+ *
+ *-------------------------------------------------------------------------
+ */
+static int
+H5I__id_dump_cb(void *_item, void H5_ATTR_UNUSED *_key, void *_udata)
+{
+ H5I_id_info_t * info = (H5I_id_info_t *)_item; /* Pointer to the ID node */
+ H5I_type_t type = *(H5I_type_t *)_udata; /* User data */
+ const H5G_name_t *path = NULL; /* Path to file object */
+ const void * object = NULL; /* Pointer to VOL connector object */
+
+ FUNC_ENTER_STATIC_NOERR
+
+ HDfprintf(stderr, " id = %" PRIdHID "\n", info->id);
+ HDfprintf(stderr, " count = %u\n", info->count);
+ HDfprintf(stderr, " obj = 0x%8p\n", info->object);
+ HDfprintf(stderr, " marked = %d\n", info->marked);
+
+ /* Get the group location, so we get get the name */
+ switch (type) {
+ case H5I_GROUP: {
+ const H5VL_object_t *vol_obj = (const H5VL_object_t *)info->object;
+
+ object = H5VL_object_data(vol_obj);
+ if (H5_VOL_NATIVE == vol_obj->connector->cls->value)
+ path = H5G_nameof((const H5G_t *)object);
+ break;
+ }
+
+ case H5I_DATASET: {
+ const H5VL_object_t *vol_obj = (const H5VL_object_t *)info->object;
+
+ object = H5VL_object_data(vol_obj);
+ if (H5_VOL_NATIVE == vol_obj->connector->cls->value)
+ path = H5D_nameof((const H5D_t *)object);
+ break;
+ }
+
+ case H5I_DATATYPE: {
+ const H5T_t *dt = (const H5T_t *)info->object;
+
+ H5_GCC_DIAG_OFF("cast-qual")
+ object = (void *)H5T_get_actual_type((H5T_t *)dt); /* Casting away const OK - QAK */
+ H5_GCC_DIAG_ON("cast-qual")
+
+ path = H5T_nameof((const H5T_t *)object);
+ break;
+ }
+
+ /* TODO: Maps will have to be added when they are supported in the
+ * native VOL connector.
+ */
+ case H5I_MAP:
+
+ case H5I_UNINIT:
+ case H5I_BADID:
+ case H5I_FILE:
+ case H5I_DATASPACE:
+ case H5I_ATTR:
+ case H5I_VFL:
+ case H5I_VOL:
+ case H5I_GENPROP_CLS:
+ case H5I_GENPROP_LST:
+ case H5I_ERROR_CLASS:
+ case H5I_ERROR_MSG:
+ case H5I_ERROR_STACK:
+ case H5I_SPACE_SEL_ITER:
+ case H5I_EVENTSET:
+ case H5I_NTYPES:
+ default:
+ break; /* Other types of IDs are not stored in files */
+ }
+
+ if (path) {
+ if (path->user_path_r)
+ HDfprintf(stderr, " user_path = %s\n", H5RS_get_str(path->user_path_r));
+ if (path->full_path_r)
+ HDfprintf(stderr, " full_path = %s\n", H5RS_get_str(path->full_path_r));
+ }
+
+ FUNC_LEAVE_NOAPI(H5_ITER_CONT)
+} /* end H5I__id_dump_cb() */
+
+/*-------------------------------------------------------------------------
+ * Function: H5I_dump_ids_for_type
+ *
+ * Purpose: Dump the contents of a type to stderr for debugging.
+ *
+ * Return: SUCCEED/FAIL
+ *
+ *-------------------------------------------------------------------------
+ */
+herr_t
+H5I_dump_ids_for_type(H5I_type_t type)
+{
+ H5I_type_info_t *type_info = NULL;
+
+ FUNC_ENTER_NOAPI_NOERR
+
+ HDfprintf(stderr, "Dumping ID type %d\n", (int)type);
+ type_info = H5I_type_info_array_g[type];
+
+ if (type_info) {
+
+ H5I_id_info_t *item = NULL;
+ H5I_id_info_t *tmp = NULL;
+
+ /* Header */
+ HDfprintf(stderr, " init_count = %u\n", type_info->init_count);
+ HDfprintf(stderr, " reserved = %u\n", type_info->cls->reserved);
+ HDfprintf(stderr, " id_count = %llu\n", (unsigned long long)type_info->id_count);
+ HDfprintf(stderr, " nextid = %llu\n", (unsigned long long)type_info->nextid);
+
+ /* List */
+ if (type_info->id_count > 0) {
+ HDfprintf(stderr, " List:\n");
+ /* Normally we care about the callback's return value
+ * (H5I_ITER_CONT, etc.), but this is an iteration over all
+ * the IDs so we don't care.
+ *
+ * XXX: Update this to emit an error message on errors?
+ */
+ HDfprintf(stderr, " (HASH TABLE)\n");
+ HASH_ITER(hh, type_info->hash_table, item, tmp)
+ {
+ H5I__id_dump_cb((void *)item, NULL, (void *)&type);
+ }
+ }
+ }
+ else
+ HDfprintf(stderr, "Global type info/tracking pointer for that type is NULL\n");
+
+ FUNC_LEAVE_NOAPI(SUCCEED)
+} /* end H5I_dump_ids_for_type() */
diff --git a/src/H5Iint.c b/src/H5Iint.c
new file mode 100644
index 0000000..164fafc
--- /dev/null
+++ b/src/H5Iint.c
@@ -0,0 +1,1790 @@
+/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
+ * 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 COPYING file, which can be found at the root of the source code *
+ * distribution tree, or in https://www.hdfgroup.org/licenses. *
+ * If you do not have access to either file, you may request a copy from *
+ * help@hdfgroup.org. *
+ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
+
+/*
+ * H5Iint.c - Private routines for handling IDs
+ */
+
+/****************/
+/* Module Setup */
+/****************/
+
+#include "H5Imodule.h" /* This source code file is part of the H5I module */
+
+/***********/
+/* Headers */
+/***********/
+#include "H5private.h" /* Generic Functions */
+#include "H5Eprivate.h" /* Error handling */
+#include "H5FLprivate.h" /* Free Lists */
+#include "H5Ipkg.h" /* IDs */
+#include "H5MMprivate.h" /* Memory management */
+#include "H5Tprivate.h" /* Datatypes */
+#include "H5VLprivate.h" /* Virtual Object Layer */
+
+/****************/
+/* Local Macros */
+/****************/
+
+/* Combine a Type number and an ID index into an ID */
+#define H5I_MAKE(g, i) ((((hid_t)(g)&TYPE_MASK) << ID_BITS) | ((hid_t)(i)&ID_MASK))
+
+/******************/
+/* Local Typedefs */
+/******************/
+
+/* User data for iterator callback for retrieving an ID corresponding to an object pointer */
+typedef struct {
+ const void *object; /* object pointer to search for */
+ H5I_type_t obj_type; /* type of object we are searching for */
+ hid_t ret_id; /* ID returned */
+} H5I_get_id_ud_t;
+
+/* User data for iterator callback for ID iteration */
+typedef struct {
+ H5I_search_func_t user_func; /* 'User' function to invoke */
+ void * user_udata; /* User data to pass to 'user' function */
+ hbool_t app_ref; /* Whether this is an appl. ref. call */
+ H5I_type_t obj_type; /* Type of object we are iterating over */
+} H5I_iterate_ud_t;
+
+/* User data for H5I__clear_type_cb */
+typedef struct {
+ H5I_type_info_t *type_info; /* Pointer to the type's info to be cleared */
+ hbool_t force; /* Whether to always remove the ID */
+ hbool_t app_ref; /* Whether this is an appl. ref. call */
+} H5I_clear_type_ud_t;
+
+/********************/
+/* Package Typedefs */
+/********************/
+
+/********************/
+/* Local Prototypes */
+/********************/
+
+static void * H5I__unwrap(void *object, H5I_type_t type);
+static herr_t H5I__mark_node(void *_id, void *key, void *udata);
+static void * H5I__remove_common(H5I_type_info_t *type_info, hid_t id);
+static int H5I__dec_ref(hid_t id, void **request);
+static int H5I__dec_app_ref(hid_t id, void **request);
+static int H5I__dec_app_ref_always_close(hid_t id, void **request);
+static int H5I__find_id_cb(void *_item, void *_key, void *_udata);
+
+/*********************/
+/* Package Variables */
+/*********************/
+
+/* Package initialization variable */
+hbool_t H5_PKG_INIT_VAR = FALSE;
+
+/* Declared extern in H5Ipkg.h and documented there */
+H5I_type_info_t *H5I_type_info_array_g[H5I_MAX_NUM_TYPES];
+int H5I_next_type_g = (int)H5I_NTYPES;
+
+/* Declare a free list to manage the H5I_id_info_t struct */
+H5FL_DEFINE_STATIC(H5I_id_info_t);
+
+/* Whether deletes are actually marks (for mark-and-sweep) */
+hbool_t H5I_marking_g = FALSE;
+
+/*****************************/
+/* Library Private Variables */
+/*****************************/
+
+/*******************/
+/* Local Variables */
+/*******************/
+
+/*-------------------------------------------------------------------------
+ * Function: H5I_term_package
+ *
+ * Purpose: Terminate the H5I interface: release all memory, reset all
+ * global variables to initial values. This only happens if all
+ * types have been destroyed from other interfaces.
+ *
+ * Return: Success: Positive if any action was taken that might
+ * affect some other interface; zero otherwise.
+ *
+ * Failure: Negative
+ *
+ *-------------------------------------------------------------------------
+ */
+int
+H5I_term_package(void)
+{
+ int in_use = 0; /* Number of ID types still in use */
+
+ FUNC_ENTER_NOAPI_NOINIT_NOERR
+
+ if (H5_PKG_INIT_VAR) {
+ H5I_type_info_t *type_info = NULL; /* Pointer to ID type */
+ int i;
+
+ /* Count the number of types still in use */
+ for (i = 0; i < H5I_next_type_g; i++)
+ if ((type_info = H5I_type_info_array_g[i]) && type_info->hash_table)
+ in_use++;
+
+ /* If no types are still being used then clean up */
+ if (0 == in_use) {
+ for (i = 0; i < H5I_next_type_g; i++) {
+ type_info = H5I_type_info_array_g[i];
+ if (type_info) {
+ HDassert(NULL == type_info->hash_table);
+ type_info = H5MM_xfree(type_info);
+ H5I_type_info_array_g[i] = NULL;
+ in_use++;
+ }
+ }
+
+ /* Mark interface closed */
+ if (0 == in_use)
+ H5_PKG_INIT_VAR = FALSE;
+ }
+ }
+
+ FUNC_LEAVE_NOAPI(in_use)
+} /* end H5I_term_package() */
+
+/*-------------------------------------------------------------------------
+ * Function: H5I_register_type
+ *
+ * Purpose: Creates a new type of ID's to give out.
+ * The class is initialized or its reference count is incremented
+ * (if it is already initialized).
+ *
+ * Return: SUCCEED/FAIL
+ *
+ *-------------------------------------------------------------------------
+ */
+herr_t
+H5I_register_type(const H5I_class_t *cls)
+{
+ H5I_type_info_t *type_info = NULL; /* Pointer to the ID type*/
+ herr_t ret_value = SUCCEED; /* Return value */
+
+ FUNC_ENTER_NOAPI(FAIL)
+
+ /* Sanity check */
+ HDassert(cls);
+ HDassert(cls->type > 0 && (int)cls->type < H5I_MAX_NUM_TYPES);
+
+ /* Initialize the type */
+ if (NULL == H5I_type_info_array_g[cls->type]) {
+ /* Allocate the type information for new type */
+ if (NULL == (type_info = (H5I_type_info_t *)H5MM_calloc(sizeof(H5I_type_info_t))))
+ HGOTO_ERROR(H5E_ID, H5E_CANTALLOC, FAIL, "ID type allocation failed")
+ H5I_type_info_array_g[cls->type] = type_info;
+ }
+ else {
+ /* Get the pointer to the existing type */
+ type_info = H5I_type_info_array_g[cls->type];
+ }
+
+ /* Initialize the ID type structure for new types */
+ if (type_info->init_count == 0) {
+ type_info->cls = cls;
+ type_info->id_count = 0;
+ type_info->nextid = cls->reserved;
+ type_info->last_id_info = NULL;
+ type_info->hash_table = NULL;
+ }
+
+ /* Increment the count of the times this type has been initialized */
+ type_info->init_count++;
+
+done:
+ /* Clean up on error */
+ if (ret_value < 0)
+ if (type_info)
+ H5MM_free(type_info);
+
+ FUNC_LEAVE_NOAPI(ret_value)
+} /* end H5I_register_type() */
+
+/*-------------------------------------------------------------------------
+ * Function: H5I_nmembers
+ *
+ * Purpose: Returns the number of members in a type.
+ *
+ * Return: Success: Number of members; zero if the type is empty
+ * or has been deleted.
+ *
+ * Failure: Negative
+ *
+ * Programmer: Robb Matzke
+ * Wednesday, March 24, 1999
+ *
+ *-------------------------------------------------------------------------
+ */
+int64_t
+H5I_nmembers(H5I_type_t type)
+{
+ H5I_type_info_t *type_info = NULL; /* Pointer to the ID type */
+ int64_t ret_value = 0; /* Return value */
+
+ FUNC_ENTER_NOAPI((-1))
+
+ /* Validate parameter */
+ if (type <= H5I_BADID || (int)type >= H5I_next_type_g)
+ HGOTO_ERROR(H5E_ARGS, H5E_BADRANGE, FAIL, "invalid type number")
+ if (NULL == (type_info = H5I_type_info_array_g[type]) || type_info->init_count <= 0)
+ HGOTO_DONE(0);
+
+ /* Set return value */
+ H5_CHECKED_ASSIGN(ret_value, int64_t, type_info->id_count, uint64_t);
+
+done:
+ FUNC_LEAVE_NOAPI(ret_value)
+} /* end H5I_nmembers() */
+
+/*-------------------------------------------------------------------------
+ * Function: H5I__unwrap
+ *
+ * Purpose: Unwraps the object pointer for the 'item' that corresponds
+ * to an ID.
+ *
+ * Return: Pointer to the unwrapped pointer (can't fail)
+ *
+ * Programmer: Quincey Koziol
+ * Friday, October 19, 2018
+ *
+ *-------------------------------------------------------------------------
+ */
+static void *
+H5I__unwrap(void *object, H5I_type_t type)
+{
+ void *ret_value = NULL; /* Return value */
+
+ FUNC_ENTER_STATIC_NOERR
+
+ /* Sanity checks */
+ HDassert(object);
+
+ /* The stored object pointer might be an H5VL_object_t, in which
+ * case we'll need to get the wrapped object struct (H5F_t *, etc.).
+ */
+ if (H5I_FILE == type || H5I_GROUP == type || H5I_DATASET == type || H5I_ATTR == type) {
+ const H5VL_object_t *vol_obj;
+
+ vol_obj = (const H5VL_object_t *)object;
+ ret_value = H5VL_object_data(vol_obj);
+ }
+ else if (H5I_DATATYPE == type) {
+ H5T_t *dt = (H5T_t *)object;
+
+ ret_value = (void *)H5T_get_actual_type(dt);
+ }
+ else
+ ret_value = object;
+
+ FUNC_LEAVE_NOAPI(ret_value)
+} /* end H5I__unwrap() */
+
+/*-------------------------------------------------------------------------
+ * Function: H5I_clear_type
+ *
+ * Purpose: Removes all objects from the type, calling the free
+ * function for each object regardless of the reference count.
+ *
+ * Return: SUCCEED/FAIL
+ *
+ * Programmer: Robb Matzke
+ * Wednesday, March 24, 1999
+ *
+ *-------------------------------------------------------------------------
+ */
+herr_t
+H5I_clear_type(H5I_type_t type, hbool_t force, hbool_t app_ref)
+{
+ H5I_clear_type_ud_t udata; /* udata struct for callback */
+ H5I_id_info_t * item = NULL;
+ H5I_id_info_t * tmp = NULL;
+ herr_t ret_value = SUCCEED; /* Return value */
+
+ FUNC_ENTER_NOAPI(FAIL)
+
+ /* Validate parameters */
+ if (type <= H5I_BADID || (int)type >= H5I_next_type_g)
+ HGOTO_ERROR(H5E_ARGS, H5E_BADRANGE, FAIL, "invalid type number")
+
+ udata.type_info = H5I_type_info_array_g[type];
+ if (udata.type_info == NULL || udata.type_info->init_count <= 0)
+ HGOTO_ERROR(H5E_ID, H5E_BADGROUP, FAIL, "invalid type")
+
+ /* Finish constructing udata */
+ udata.force = force;
+ udata.app_ref = app_ref;
+
+ /* Clearing a type is done in two phases (mark-and-sweep). This is because
+ * the type's free callback can free other IDs, potentially corrupting
+ * the data structure during the traversal.
+ */
+
+ /* Set marking flag */
+ H5I_marking_g = TRUE;
+
+ /* Mark nodes for deletion */
+ HASH_ITER(hh, udata.type_info->hash_table, item, tmp)
+ {
+ if (!item->marked)
+ if (H5I__mark_node((void *)item, NULL, (void *)&udata) < 0)
+ HGOTO_ERROR(H5E_ID, H5E_BADITER, FAIL, "iteration failed while clearing the ID type")
+ }
+
+ /* Unset marking flag */
+ H5I_marking_g = FALSE;
+
+ /* Perform sweep */
+ HASH_ITER(hh, udata.type_info->hash_table, item, tmp)
+ {
+ if (item->marked) {
+ HASH_DELETE(hh, udata.type_info->hash_table, item);
+ item = H5FL_FREE(H5I_id_info_t, item);
+ }
+ }
+
+done:
+ FUNC_LEAVE_NOAPI(ret_value)
+} /* end H5I_clear_type() */
+
+/*-------------------------------------------------------------------------
+ * Function: H5I__mark_node
+ *
+ * Purpose: Attempts to mark the node for freeing and calls the free
+ * function for the object, if any
+ *
+ * Return: SUCCEED/FAIL
+ *
+ * Programmer: Neil Fortner
+ * Friday, July 10, 2015
+ *
+ *-------------------------------------------------------------------------
+ */
+static herr_t
+H5I__mark_node(void *_info, void H5_ATTR_UNUSED *key, void *_udata)
+{
+ H5I_id_info_t * info = (H5I_id_info_t *)_info; /* Current ID info being worked with */
+ H5I_clear_type_ud_t *udata = (H5I_clear_type_ud_t *)_udata; /* udata struct */
+ hbool_t mark = FALSE;
+
+ FUNC_ENTER_STATIC_NOERR
+
+ /* Sanity checks */
+ HDassert(info);
+ HDassert(udata);
+ HDassert(udata->type_info);
+
+ /* Do nothing to the object if the reference count is larger than
+ * one and forcing is off.
+ */
+ if (udata->force || (info->count - (!udata->app_ref * info->app_count)) <= 1) {
+ /* Check if this is an un-realized future object */
+ H5_GCC_DIAG_OFF("cast-qual")
+ if (info->is_future) {
+ /* Discard the future object */
+ if ((info->discard_cb)((void *)info->object) < 0) {
+ if (udata->force) {
+#ifdef H5I_DEBUG
+ if (H5DEBUG(I)) {
+ HDfprintf(H5DEBUG(I),
+ "H5I: discard type=%d obj=0x%08lx "
+ "failure ignored\n",
+ (int)udata->type_info->cls->type, (unsigned long)(info->object));
+ }
+#endif /* H5I_DEBUG */
+
+ /* Indicate node should be removed from list */
+ mark = TRUE;
+ }
+ }
+ else {
+ /* Indicate node should be removed from list */
+ mark = TRUE;
+ }
+ }
+ else {
+ /* Check for a 'free' function and call it, if it exists */
+ if (udata->type_info->cls->free_func &&
+ (udata->type_info->cls->free_func)((void *)info->object, H5_REQUEST_NULL) < 0) {
+ if (udata->force) {
+#ifdef H5I_DEBUG
+ if (H5DEBUG(I)) {
+ HDfprintf(H5DEBUG(I),
+ "H5I: free type=%d obj=0x%08lx "
+ "failure ignored\n",
+ (int)udata->type_info->cls->type, (unsigned long)(info->object));
+ }
+#endif /* H5I_DEBUG */
+
+ /* Indicate node should be removed from list */
+ mark = TRUE;
+ }
+ }
+ else {
+ /* Indicate node should be removed from list */
+ mark = TRUE;
+ }
+ }
+ H5_GCC_DIAG_ON("cast-qual")
+
+ /* Remove ID if requested */
+ if (mark) {
+ /* Mark ID for deletion */
+ info->marked = TRUE;
+
+ /* Decrement the number of IDs in the type */
+ udata->type_info->id_count--;
+ }
+ }
+
+ FUNC_LEAVE_NOAPI(SUCCEED)
+} /* end H5I__mark_node() */
+
+/*-------------------------------------------------------------------------
+ * Function: H5I__destroy_type
+ *
+ * Purpose: Destroys a type along with all IDs in that type
+ * regardless of their reference counts. Destroying IDs
+ * involves calling the free-func for each ID's object and
+ * then adding the ID struct to the ID free list.
+ *
+ * Return: SUCCEED/FAIL
+ *
+ * Programmer: Nathaniel Furrer
+ * James Laird
+ *
+ *-------------------------------------------------------------------------
+ */
+herr_t
+H5I__destroy_type(H5I_type_t type)
+{
+ H5I_type_info_t *type_info = NULL; /* Pointer to the ID type */
+ herr_t ret_value = SUCCEED; /* Return value */
+
+ FUNC_ENTER_PACKAGE
+
+ /* Validate parameter */
+ if (type <= H5I_BADID || (int)type >= H5I_next_type_g)
+ HGOTO_ERROR(H5E_ARGS, H5E_BADRANGE, FAIL, "invalid type number")
+
+ type_info = H5I_type_info_array_g[type];
+ if (type_info == NULL || type_info->init_count <= 0)
+ HGOTO_ERROR(H5E_ID, H5E_BADGROUP, FAIL, "invalid type")
+
+ /* Close/clear/destroy all IDs for this type */
+ H5E_BEGIN_TRY
+ {
+ H5I_clear_type(type, TRUE, FALSE);
+ }
+ H5E_END_TRY /* don't care about errors */
+
+ /* Check if we should release the ID class */
+ if (type_info->cls->flags & H5I_CLASS_IS_APPLICATION)
+ type_info->cls = H5MM_xfree_const(type_info->cls);
+
+ HASH_CLEAR(hh, type_info->hash_table);
+ type_info->hash_table = NULL;
+
+ type_info = H5MM_xfree(type_info);
+
+ H5I_type_info_array_g[type] = NULL;
+
+done:
+ FUNC_LEAVE_NOAPI(ret_value)
+} /* end H5I__destroy_type() */
+
+/*-------------------------------------------------------------------------
+ * Function: H5I__register
+ *
+ * Purpose: Registers an OBJECT in a TYPE and returns an ID for it.
+ * This routine does _not_ check for unique-ness of the objects,
+ * if you register an object twice, you will get two different
+ * IDs for it. This routine does make certain that each ID in a
+ * type is unique. IDs are created by getting a unique number
+ * for the type the ID is in and incorporating the TYPE into
+ * the ID which is returned to the user.
+ *
+ * IDs are marked as "future" if the realize_cb and discard_cb
+ * parameters are non-NULL.
+ *
+ * Return: Success: New object ID
+ * Failure: H5I_INVALID_HID
+ *
+ *-------------------------------------------------------------------------
+ */
+hid_t
+H5I__register(H5I_type_t type, const void *object, hbool_t app_ref, H5I_future_realize_func_t realize_cb,
+ H5I_future_discard_func_t discard_cb)
+{
+ H5I_type_info_t *type_info = NULL; /* Pointer to the type */
+ H5I_id_info_t * info = NULL; /* Pointer to the new ID information */
+ hid_t new_id = H5I_INVALID_HID; /* New ID */
+ hid_t ret_value = H5I_INVALID_HID; /* Return value */
+
+ FUNC_ENTER_PACKAGE
+
+ /* Check arguments */
+ if (type <= H5I_BADID || (int)type >= H5I_next_type_g)
+ HGOTO_ERROR(H5E_ARGS, H5E_BADRANGE, H5I_INVALID_HID, "invalid type number")
+ type_info = H5I_type_info_array_g[type];
+ if ((NULL == type_info) || (type_info->init_count <= 0))
+ HGOTO_ERROR(H5E_ID, H5E_BADGROUP, H5I_INVALID_HID, "invalid type")
+ if (NULL == (info = H5FL_CALLOC(H5I_id_info_t)))
+ HGOTO_ERROR(H5E_ID, H5E_NOSPACE, H5I_INVALID_HID, "memory allocation failed")
+
+ /* Create the struct & its ID */
+ new_id = H5I_MAKE(type, type_info->nextid);
+ info->id = new_id;
+ info->count = 1; /* initial reference count */
+ info->app_count = !!app_ref;
+ info->object = object;
+ info->is_future = (NULL != realize_cb);
+ info->realize_cb = realize_cb;
+ info->discard_cb = discard_cb;
+ info->marked = FALSE;
+
+ /* Insert into the type */
+ HASH_ADD(hh, type_info->hash_table, id, sizeof(hid_t), info);
+ type_info->id_count++;
+ type_info->nextid++;
+
+ /* Sanity check for the 'nextid' getting too large and wrapping around */
+ HDassert(type_info->nextid <= ID_MASK);
+
+ /* Set the most recent ID to this object */
+ type_info->last_id_info = info;
+
+ /* Set return value */
+ ret_value = new_id;
+
+done:
+ FUNC_LEAVE_NOAPI(ret_value)
+} /* end H5I__register() */
+
+/*-------------------------------------------------------------------------
+ * Function: H5I_register
+ *
+ * Purpose: Library-private wrapper for H5I__register.
+ *
+ * Return: Success: New object ID
+ * Failure: H5I_INVALID_HID
+ *
+ *-------------------------------------------------------------------------
+ */
+hid_t
+H5I_register(H5I_type_t type, const void *object, hbool_t app_ref)
+{
+ hid_t ret_value = H5I_INVALID_HID; /* Return value */
+
+ FUNC_ENTER_NOAPI(H5I_INVALID_HID)
+
+ /* Sanity checks */
+ HDassert(type >= H5I_FILE && type < H5I_NTYPES);
+ HDassert(object);
+
+ /* Retrieve ID for object */
+ if (H5I_INVALID_HID == (ret_value = H5I__register(type, object, app_ref, NULL, NULL)))
+ HGOTO_ERROR(H5E_ID, H5E_CANTREGISTER, H5I_INVALID_HID, "unable to register object")
+
+done:
+ FUNC_LEAVE_NOAPI(ret_value)
+} /* end H5I_register() */
+
+/*-------------------------------------------------------------------------
+ * Function: H5I_register_using_existing_id
+ *
+ * Purpose: Registers an OBJECT in a TYPE with the supplied ID for it.
+ * This routine will check to ensure the supplied ID is not already
+ * in use, and ensure that it is a valid ID for the given type,
+ * but will NOT check to ensure the OBJECT is not already
+ * registered (thus, it is possible to register one object under
+ * multiple IDs).
+ *
+ * NOTE: Intended for use in refresh calls, where we have to close
+ * and re-open the underlying data, then hook the object back
+ * up to the original ID.
+ *
+ * Return: SUCCEED/FAIL
+ *
+ *-------------------------------------------------------------------------
+ */
+herr_t
+H5I_register_using_existing_id(H5I_type_t type, void *object, hbool_t app_ref, hid_t existing_id)
+{
+ H5I_type_info_t *type_info = NULL; /* Pointer to the type */
+ H5I_id_info_t * info = NULL; /* Pointer to the new ID information */
+ herr_t ret_value = SUCCEED; /* Return value */
+
+ FUNC_ENTER_NOAPI(FAIL)
+
+ /* Check arguments */
+ HDassert(object);
+
+ /* Make sure ID is not already in use */
+ if (NULL != (info = H5I__find_id(existing_id)))
+ HGOTO_ERROR(H5E_ID, H5E_BADRANGE, FAIL, "ID already in use")
+
+ /* Make sure type number is valid */
+ if (type <= H5I_BADID || (int)type >= H5I_next_type_g)
+ HGOTO_ERROR(H5E_ARGS, H5E_BADRANGE, FAIL, "invalid type number")
+
+ /* Get type pointer from list of types */
+ type_info = H5I_type_info_array_g[type];
+
+ if (NULL == type_info || type_info->init_count <= 0)
+ HGOTO_ERROR(H5E_ID, H5E_BADGROUP, FAIL, "invalid type")
+
+ /* Make sure requested ID belongs to object's type */
+ if (H5I_TYPE(existing_id) != type)
+ HGOTO_ERROR(H5E_ID, H5E_BADRANGE, FAIL, "invalid type for provided ID")
+
+ /* Allocate new structure to house this ID */
+ if (NULL == (info = H5FL_CALLOC(H5I_id_info_t)))
+ HGOTO_ERROR(H5E_ID, H5E_NOSPACE, FAIL, "memory allocation failed")
+
+ /* Create the struct & insert requested ID */
+ info->id = existing_id;
+ info->count = 1; /* initial reference count*/
+ info->app_count = !!app_ref;
+ info->object = object;
+ /* This API call is only used by the native VOL connector, which is
+ * not asynchronous.
+ */
+ info->is_future = FALSE;
+ info->realize_cb = NULL;
+ info->discard_cb = NULL;
+ info->marked = FALSE;
+
+ /* Insert into the type */
+ HASH_ADD(hh, type_info->hash_table, id, sizeof(hid_t), info);
+ type_info->id_count++;
+
+ /* Set the most recent ID to this object */
+ type_info->last_id_info = info;
+
+done:
+ FUNC_LEAVE_NOAPI(ret_value)
+} /* end H5I_register_using_existing_id() */
+
+/*-------------------------------------------------------------------------
+ * Function: H5I_subst
+ *
+ * Purpose: Substitute a new object pointer for the specified ID.
+ *
+ * Return: Success: Non-NULL previous object pointer associated
+ * with the specified ID.
+ * Failure: NULL
+ *
+ * Programmer: Quincey Koziol
+ * Saturday, February 27, 2010
+ *
+ *-------------------------------------------------------------------------
+ */
+void *
+H5I_subst(hid_t id, const void *new_object)
+{
+ H5I_id_info_t *info = NULL; /* Pointer to the ID's info */
+ void * ret_value = NULL; /* Return value */
+
+ FUNC_ENTER_NOAPI(NULL)
+
+ /* General lookup of the ID */
+ if (NULL == (info = H5I__find_id(id)))
+ HGOTO_ERROR(H5E_ID, H5E_NOTFOUND, NULL, "can't get ID ref count")
+
+ /* Get the old object pointer to return */
+ H5_GCC_DIAG_OFF("cast-qual")
+ ret_value = (void *)info->object; /* (Casting away const OK -QAK) */
+ H5_GCC_DIAG_ON("cast-qual")
+
+ /* Set the new object pointer for the ID */
+ info->object = new_object;
+
+done:
+ FUNC_LEAVE_NOAPI(ret_value)
+} /* end H5I_subst() */
+
+/*-------------------------------------------------------------------------
+ * Function: H5I_object
+ *
+ * Purpose: Find an object pointer for the specified ID.
+ *
+ * Return: Success: Non-NULL object pointer associated with the
+ * specified ID
+ *
+ * Failure: NULL
+ *
+ *-------------------------------------------------------------------------
+ */
+void *
+H5I_object(hid_t id)
+{
+ H5I_id_info_t *info = NULL; /* Pointer to the ID info */
+ void * ret_value = NULL; /* Return value */
+
+ FUNC_ENTER_NOAPI_NOERR
+
+ /* General lookup of the ID */
+ if (NULL != (info = H5I__find_id(id))) {
+ /* Get the object pointer to return */
+ H5_GCC_DIAG_OFF("cast-qual")
+ ret_value = (void *)info->object; /* (Casting away const OK -QAK) */
+ H5_GCC_DIAG_ON("cast-qual")
+ }
+
+ FUNC_LEAVE_NOAPI(ret_value)
+} /* end H5I_object() */
+
+/*-------------------------------------------------------------------------
+ * Function: H5I_object_verify
+ *
+ * Purpose: Find an object pointer for the specified ID, verifying that
+ * its in a particular type.
+ *
+ * Return: Success: Non-NULL object pointer associated with the
+ * specified ID.
+ * Failure: NULL
+ *
+ * Programmer: Quincey Koziol
+ * Wednesday, July 31, 2002
+ *
+ *-------------------------------------------------------------------------
+ */
+void *
+H5I_object_verify(hid_t id, H5I_type_t type)
+{
+ H5I_id_info_t *info = NULL; /* Pointer to the ID info */
+ void * ret_value = NULL; /* Return value */
+
+ FUNC_ENTER_NOAPI_NOERR
+
+ HDassert(type >= 1 && (int)type < H5I_next_type_g);
+
+ /* Verify that the type of the ID is correct & lookup the ID */
+ if (type == H5I_TYPE(id) && NULL != (info = H5I__find_id(id))) {
+ /* Get the object pointer to return */
+ H5_GCC_DIAG_OFF("cast-qual")
+ ret_value = (void *)info->object; /* (Casting away const OK -QAK) */
+ H5_GCC_DIAG_ON("cast-qual")
+ }
+
+ FUNC_LEAVE_NOAPI(ret_value)
+} /* H5I_object_verify() */
+
+/*-------------------------------------------------------------------------
+ * Function: H5I_get_type
+ *
+ * Purpose: Given an object ID return the type to which it
+ * belongs. The ID need not be the ID of an object which
+ * currently exists because the type number is encoded
+ * in the object ID.
+ *
+ * Return: Success: A positive integer (corresponding to an H5I_type_t
+ * enum value for library ID types, but not for user
+ * ID types).
+ * Failure: H5I_BADID
+ *
+ * Programmer: Robb Matzke
+ * Friday, February 19, 1999
+ *
+ *-------------------------------------------------------------------------
+ */
+H5I_type_t
+H5I_get_type(hid_t id)
+{
+ H5I_type_t ret_value = H5I_BADID; /* Return value */
+
+ FUNC_ENTER_NOAPI_NOERR
+
+ if (id > 0)
+ ret_value = H5I_TYPE(id);
+
+ HDassert(ret_value >= H5I_BADID && (int)ret_value < H5I_next_type_g);
+
+ FUNC_LEAVE_NOAPI(ret_value)
+} /* end H5I_get_type() */
+
+/*-------------------------------------------------------------------------
+ * Function: H5I_is_file_object
+ *
+ * Purpose: Convenience function to determine if an ID represents
+ * a file object.
+ *
+ * In H5O calls, you can't use object_verify to ensure
+ * the ID was of the correct class since there's no
+ * H5I_OBJECT ID class.
+ *
+ * Return: Success: TRUE/FALSE
+ * Failure: FAIL
+ *
+ *-------------------------------------------------------------------------
+ */
+htri_t
+H5I_is_file_object(hid_t id)
+{
+ H5I_type_t type = H5I_get_type(id);
+ htri_t ret_value = FAIL;
+
+ FUNC_ENTER_NOAPI(FAIL);
+
+ /* Fail if the ID type is out of range */
+ if (type < 1 || type >= H5I_NTYPES)
+ HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "ID type out of range");
+
+ /* Return TRUE if the ID is a file object (dataset, group, map, or committed
+ * datatype), FALSE otherwise.
+ */
+ if (H5I_DATASET == type || H5I_GROUP == type || H5I_MAP == type)
+ ret_value = TRUE;
+ else if (H5I_DATATYPE == type) {
+
+ H5T_t *dt = NULL;
+
+ if (NULL == (dt = (H5T_t *)H5I_object(id)))
+ HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "unable to get underlying datatype struct");
+
+ ret_value = H5T_is_named(dt);
+ }
+ else
+ ret_value = FALSE;
+
+done:
+ FUNC_LEAVE_NOAPI(ret_value);
+} /* H5I_is_file_object() */
+
+/*-------------------------------------------------------------------------
+ * Function: H5I__remove_verify
+ *
+ * Purpose: Removes the specified ID from its type, first checking that
+ * the ID's type is the same as the ID type supplied as an argument
+ *
+ * Return: Success: A pointer to the object that was removed, the
+ * same pointer which would have been found by
+ * calling H5I_object().
+ * Failure: NULL
+ *
+ * Programmer: James Laird
+ * Nat Furrer
+ *
+ *-------------------------------------------------------------------------
+ */
+void *
+H5I__remove_verify(hid_t id, H5I_type_t type)
+{
+ void *ret_value = NULL; /*return value */
+
+ FUNC_ENTER_STATIC_NOERR
+
+ /* Argument checking will be performed by H5I_remove() */
+
+ /* Verify that the type of the ID is correct */
+ if (type == H5I_TYPE(id))
+ ret_value = H5I_remove(id);
+
+ FUNC_LEAVE_NOAPI(ret_value)
+} /* end H5I__remove_verify() */
+
+/*-------------------------------------------------------------------------
+ * Function: H5I__remove_common
+ *
+ * Purpose: Common code to remove a specified ID from its type.
+ *
+ * Return: Success: A pointer to the object that was removed, the
+ * same pointer which would have been found by
+ * calling H5I_object().
+ * Failure: NULL
+ *
+ * Programmer: Quincey Koziol
+ * October 3, 2013
+ *
+ *-------------------------------------------------------------------------
+ */
+static void *
+H5I__remove_common(H5I_type_info_t *type_info, hid_t id)
+{
+ H5I_id_info_t *info = NULL; /* Pointer to the current ID */
+ void * ret_value = NULL; /* Return value */
+
+ FUNC_ENTER_STATIC
+
+ /* Sanity check */
+ HDassert(type_info);
+
+ /* Delete or mark the node */
+ HASH_FIND(hh, type_info->hash_table, &id, sizeof(hid_t), info);
+ if (info) {
+ HDassert(!info->marked);
+ if (!H5I_marking_g)
+ HASH_DELETE(hh, type_info->hash_table, info);
+ else
+ info->marked = TRUE;
+ }
+ else
+ HGOTO_ERROR(H5E_ID, H5E_CANTDELETE, NULL, "can't remove ID node from hash table")
+
+ /* Check if this ID was the last one accessed */
+ if (type_info->last_id_info == info)
+ type_info->last_id_info = NULL;
+
+ H5_GCC_DIAG_OFF("cast-qual")
+ ret_value = (void *)info->object; /* (Casting away const OK -QAK) */
+ H5_GCC_DIAG_ON("cast-qual")
+
+ if (!H5I_marking_g)
+ info = H5FL_FREE(H5I_id_info_t, info);
+
+ /* Decrement the number of IDs in the type */
+ (type_info->id_count)--;
+
+done:
+ FUNC_LEAVE_NOAPI(ret_value)
+} /* end H5I__remove_common() */
+
+/*-------------------------------------------------------------------------
+ * Function: H5I_remove
+ *
+ * Purpose: Removes the specified ID from its type.
+ *
+ * Return: Success: A pointer to the object that was removed, the
+ * same pointer which would have been found by
+ * calling H5I_object().
+ * Failure: NULL
+ *
+ *-------------------------------------------------------------------------
+ */
+void *
+H5I_remove(hid_t id)
+{
+ H5I_type_info_t *type_info = NULL; /* Pointer to the ID type */
+ H5I_type_t type = H5I_BADID; /* ID's type */
+ void * ret_value = NULL; /* Return value */
+
+ FUNC_ENTER_NOAPI(NULL)
+
+ /* Check arguments */
+ type = H5I_TYPE(id);
+ if (type <= H5I_BADID || (int)type >= H5I_next_type_g)
+ HGOTO_ERROR(H5E_ARGS, H5E_BADRANGE, NULL, "invalid type number")
+ type_info = H5I_type_info_array_g[type];
+ if (type_info == NULL || type_info->init_count <= 0)
+ HGOTO_ERROR(H5E_ID, H5E_BADGROUP, NULL, "invalid type")
+
+ /* Remove the node from the type */
+ if (NULL == (ret_value = H5I__remove_common(type_info, id)))
+ HGOTO_ERROR(H5E_ID, H5E_CANTDELETE, NULL, "can't remove ID node")
+
+done:
+ FUNC_LEAVE_NOAPI(ret_value)
+} /* end H5I_remove() */
+
+/*-------------------------------------------------------------------------
+ * Function: H5I__dec_ref
+ *
+ * Purpose: This will fail if the type is not a reference counted type.
+ * The ID type's 'free' function will be called for the ID
+ * if the reference count for the ID reaches 0 and a free
+ * function has been defined at type creation time.
+ *
+ * Note: Allows for asynchronous 'close' operation on object, with
+ * request != H5_REQUEST_NULL.
+ *
+ * Return: Success: New reference count
+ * Failure: -1
+ *
+ *-------------------------------------------------------------------------
+ */
+static int
+H5I__dec_ref(hid_t id, void **request)
+{
+ H5I_id_info_t *info = NULL; /* Pointer to the ID */
+ int ret_value = 0; /* Return value */
+
+ FUNC_ENTER_STATIC
+
+ /* Sanity check */
+ HDassert(id >= 0);
+
+ /* General lookup of the ID */
+ if (NULL == (info = H5I__find_id(id)))
+ HGOTO_ERROR(H5E_ID, H5E_BADID, (-1), "can't locate ID")
+
+ /* If this is the last reference to the object then invoke the type's
+ * free method on the object. If the free method is undefined or
+ * successful then remove the object from the type; otherwise leave
+ * the object in the type without decrementing the reference
+ * count. If the reference count is more than one then decrement the
+ * reference count without calling the free method.
+ *
+ * Beware: the free method may call other H5I functions.
+ *
+ * If an object is closing, we can remove the ID even though the free
+ * method might fail. This can happen when a mandatory filter fails to
+ * write when a dataset is closed and the chunk cache is flushed to the
+ * file. We have to close the dataset anyway. (SLU - 2010/9/7)
+ */
+ if (1 == info->count) {
+ H5I_type_info_t *type_info; /*ptr to the type */
+
+ /* Get the ID's type */
+ type_info = H5I_type_info_array_g[H5I_TYPE(id)];
+
+ H5_GCC_DIAG_OFF("cast-qual")
+ /* (Casting away const OK -QAK) */
+ if (!type_info->cls->free_func || (type_info->cls->free_func)((void *)info->object, request) >= 0) {
+ /* Remove the node from the type */
+ if (NULL == H5I__remove_common(type_info, id))
+ HGOTO_ERROR(H5E_ID, H5E_CANTDELETE, (-1), "can't remove ID node")
+ ret_value = 0;
+ } /* end if */
+ else
+ ret_value = -1;
+ H5_GCC_DIAG_ON("cast-qual")
+ } /* end if */
+ else {
+ --(info->count);
+ ret_value = (int)info->count;
+ } /* end else */
+
+done:
+ FUNC_LEAVE_NOAPI(ret_value)
+} /* end H5I__dec_ref */
+
+/*-------------------------------------------------------------------------
+ * Function: H5I_dec_ref
+ *
+ * Purpose: Decrements the number of references outstanding for an ID.
+ *
+ * Return: Success: New reference count
+ * Failure: -1
+ *
+ *-------------------------------------------------------------------------
+ */
+int
+H5I_dec_ref(hid_t id)
+{
+ int ret_value = 0; /* Return value */
+
+ FUNC_ENTER_NOAPI((-1))
+
+ /* Sanity check */
+ HDassert(id >= 0);
+
+ /* Synchronously decrement refcount on ID */
+ if ((ret_value = H5I__dec_ref(id, H5_REQUEST_NULL)) < 0)
+ HGOTO_ERROR(H5E_ID, H5E_CANTDEC, (-1), "can't decrement ID ref count")
+
+done:
+ FUNC_LEAVE_NOAPI(ret_value)
+} /* end H5I_dec_ref() */
+
+/*-------------------------------------------------------------------------
+ * Function: H5I__dec_app_ref
+ *
+ * Purpose: Wrapper for case of modifying the application ref.
+ * count for an ID as well as normal reference count.
+ *
+ * Note: Allows for asynchronous 'close' operation on object, with
+ * request != H5_REQUEST_NULL.
+ *
+ * Return: Success: New app. reference count
+ * Failure: -1
+ *
+ *-------------------------------------------------------------------------
+ */
+static int
+H5I__dec_app_ref(hid_t id, void **request)
+{
+ int ret_value = 0; /* Return value */
+
+ FUNC_ENTER_STATIC
+
+ /* Sanity check */
+ HDassert(id >= 0);
+
+ /* Call regular decrement reference count routine */
+ if ((ret_value = H5I__dec_ref(id, request)) < 0)
+ HGOTO_ERROR(H5E_ID, H5E_CANTDEC, (-1), "can't decrement ID ref count")
+
+ /* Check if the ID still exists */
+ if (ret_value > 0) {
+ H5I_id_info_t *info = NULL; /* Pointer to the ID info */
+
+ /* General lookup of the ID */
+ if (NULL == (info = H5I__find_id(id)))
+ HGOTO_ERROR(H5E_ID, H5E_BADID, (-1), "can't locate ID")
+
+ /* Adjust app_ref */
+ --(info->app_count);
+ HDassert(info->count >= info->app_count);
+
+ /* Set return value */
+ ret_value = (int)info->app_count;
+ } /* end if */
+
+done:
+ FUNC_LEAVE_NOAPI(ret_value)
+} /* end H5I__dec_app_ref() */
+
+/*-------------------------------------------------------------------------
+ * Function: H5I_dec_app_ref
+ *
+ * Purpose: Wrapper for case of modifying the application ref. count for
+ * an ID as well as normal reference count.
+ *
+ * Return: Success: New app. reference count
+ * Failure: -1
+ *
+ * Programmer: Quincey Koziol
+ * Sept 16, 2010
+ *
+ *-------------------------------------------------------------------------
+ */
+int
+H5I_dec_app_ref(hid_t id)
+{
+ int ret_value = 0; /* Return value */
+
+ FUNC_ENTER_NOAPI((-1))
+
+ /* Sanity check */
+ HDassert(id >= 0);
+
+ /* Synchronously decrement refcount on ID */
+ if ((ret_value = H5I__dec_app_ref(id, H5_REQUEST_NULL)) < 0)
+ HGOTO_ERROR(H5E_ID, H5E_CANTDEC, (-1), "can't decrement ID ref count")
+
+done:
+ FUNC_LEAVE_NOAPI(ret_value)
+} /* end H5I_dec_app_ref() */
+
+/*-------------------------------------------------------------------------
+ * Function: H5I_dec_app_ref_async
+ *
+ * Purpose: Asynchronous wrapper for case of modifying the application ref.
+ * count for an ID as well as normal reference count.
+ *
+ * Note: Allows for asynchronous 'close' operation on object, with
+ * token != H5_REQUEST_NULL.
+ *
+ * Return: Success: New app. reference count
+ * Failure: -1
+ *
+ * Programmer: Houjun Tang
+ * Oct 21, 2019
+ *
+ *-------------------------------------------------------------------------
+ */
+int
+H5I_dec_app_ref_async(hid_t id, void **token)
+{
+ int ret_value = 0; /* Return value */
+
+ FUNC_ENTER_NOAPI((-1))
+
+ /* Sanity check */
+ HDassert(id >= 0);
+
+ /* [Possibly] aynchronously decrement refcount on ID */
+ if ((ret_value = H5I__dec_app_ref(id, token)) < 0)
+ HGOTO_ERROR(H5E_ID, H5E_CANTDEC, (-1), "can't asynchronously decrement ID ref count")
+
+done:
+ FUNC_LEAVE_NOAPI(ret_value)
+} /* end H5I_dec_app_ref_async() */
+
+/*-------------------------------------------------------------------------
+ * Function: H5I__dec_app_ref_always_close
+ *
+ * Purpose: Wrapper for case of always closing the ID, even when the free
+ * routine fails
+ *
+ * Note: Allows for asynchronous 'close' operation on object, with
+ * request != H5_REQUEST_NULL.
+ *
+ * Return: Success: New app. reference count
+ * Failure: -1
+ *
+ *-------------------------------------------------------------------------
+ */
+static int
+H5I__dec_app_ref_always_close(hid_t id, void **request)
+{
+ int ret_value = 0; /* Return value */
+
+ FUNC_ENTER_STATIC
+
+ /* Sanity check */
+ HDassert(id >= 0);
+
+ /* Call application decrement reference count routine */
+ ret_value = H5I__dec_app_ref(id, request);
+
+ /* Check for failure */
+ if (ret_value < 0) {
+ /*
+ * If an object is closing, we can remove the ID even though the free
+ * method might fail. This can happen when a mandatory filter fails to
+ * write when a dataset is closed and the chunk cache is flushed to the
+ * file. We have to close the dataset anyway. (SLU - 2010/9/7)
+ */
+ H5I_remove(id);
+
+ HGOTO_ERROR(H5E_ID, H5E_CANTDEC, (-1), "can't decrement ID ref count")
+ } /* end if */
+
+done:
+ FUNC_LEAVE_NOAPI(ret_value)
+} /* end H5I__dec_app_ref_always_close() */
+
+/*-------------------------------------------------------------------------
+ * Function: H5I_dec_app_ref_always_close
+ *
+ * Purpose: Wrapper for case of always closing the ID, even when the free
+ * routine fails.
+ *
+ * Return: Success: New app. reference count
+ * Failure: -1
+ *
+ *-------------------------------------------------------------------------
+ */
+int
+H5I_dec_app_ref_always_close(hid_t id)
+{
+ int ret_value = 0; /* Return value */
+
+ FUNC_ENTER_NOAPI((-1))
+
+ /* Sanity check */
+ HDassert(id >= 0);
+
+ /* Synchronously decrement refcount on ID */
+ if ((ret_value = H5I__dec_app_ref_always_close(id, H5_REQUEST_NULL)) < 0)
+ HGOTO_ERROR(H5E_ID, H5E_CANTDEC, (-1), "can't decrement ID ref count")
+
+done:
+ FUNC_LEAVE_NOAPI(ret_value)
+} /* end H5I_dec_app_ref_always_close() */
+
+/*-------------------------------------------------------------------------
+ * Function: H5I_dec_app_ref_always_close_async
+ *
+ * Purpose: Asynchronous wrapper for case of always closing the ID, even
+ * when the free routine fails
+ *
+ * Note: Allows for asynchronous 'close' operation on object, with
+ * token != H5_REQUEST_NULL.
+ *
+ * Return: Success: New app. reference count
+ * Failure: -1
+ *
+ *-------------------------------------------------------------------------
+ */
+int
+H5I_dec_app_ref_always_close_async(hid_t id, void **token)
+{
+ int ret_value = 0; /* Return value */
+
+ FUNC_ENTER_NOAPI((-1))
+
+ /* Sanity check */
+ HDassert(id >= 0);
+
+ /* [Possibly] aynchronously decrement refcount on ID */
+ if ((ret_value = H5I__dec_app_ref_always_close(id, token)) < 0)
+ HGOTO_ERROR(H5E_ID, H5E_CANTDEC, (-1), "can't asynchronously decrement ID ref count")
+
+done:
+ FUNC_LEAVE_NOAPI(ret_value)
+} /* end H5I_dec_app_ref_always_close_async() */
+
+/*-------------------------------------------------------------------------
+ * Function: H5I_inc_ref
+ *
+ * Purpose: Increment the reference count for an object.
+ *
+ * Return: Success: The new reference count
+ * Failure: -1
+ *
+ *-------------------------------------------------------------------------
+ */
+int
+H5I_inc_ref(hid_t id, hbool_t app_ref)
+{
+ H5I_id_info_t *info = NULL; /* Pointer to the ID info */
+ int ret_value = 0; /* Return value */
+
+ FUNC_ENTER_NOAPI((-1))
+
+ /* Sanity check */
+ HDassert(id >= 0);
+
+ /* General lookup of the ID */
+ if (NULL == (info = H5I__find_id(id)))
+ HGOTO_ERROR(H5E_ID, H5E_BADID, (-1), "can't locate ID")
+
+ /* Adjust reference counts */
+ ++(info->count);
+ if (app_ref)
+ ++(info->app_count);
+
+ /* Set return value */
+ ret_value = (int)(app_ref ? info->app_count : info->count);
+
+done:
+ FUNC_LEAVE_NOAPI(ret_value)
+} /* end H5I_inc_ref() */
+
+/*-------------------------------------------------------------------------
+ * Function: H5I_get_ref
+ *
+ * Purpose: Retrieve the reference count for an object.
+ *
+ * Return: Success: The reference count
+ * Failure: -1
+ *
+ *-------------------------------------------------------------------------
+ */
+int
+H5I_get_ref(hid_t id, hbool_t app_ref)
+{
+ H5I_id_info_t *info = NULL; /* Pointer to the ID */
+ int ret_value = 0; /* Return value */
+
+ FUNC_ENTER_NOAPI((-1))
+
+ /* Sanity check */
+ HDassert(id >= 0);
+
+ /* General lookup of the ID */
+ if (NULL == (info = H5I__find_id(id)))
+ HGOTO_ERROR(H5E_ID, H5E_BADID, (-1), "can't locate ID")
+
+ /* Set return value */
+ ret_value = (int)(app_ref ? info->app_count : info->count);
+
+done:
+ FUNC_LEAVE_NOAPI(ret_value)
+} /* end H5I_get_ref() */
+
+/*-------------------------------------------------------------------------
+ * Function: H5I__inc_type_ref
+ *
+ * Purpose: Increment the reference count for an ID type.
+ *
+ * Return: Success: The new reference count
+ * Failure: -1
+ *
+ *-------------------------------------------------------------------------
+ */
+int
+H5I__inc_type_ref(H5I_type_t type)
+{
+ H5I_type_info_t *type_info = NULL; /* Pointer to the type */
+ int ret_value = -1; /* Return value */
+
+ FUNC_ENTER_STATIC
+
+ /* Sanity check */
+ HDassert(type > 0 && (int)type < H5I_next_type_g);
+
+ /* Check arguments */
+ type_info = H5I_type_info_array_g[type];
+ if (NULL == type_info)
+ HGOTO_ERROR(H5E_ID, H5E_BADGROUP, (-1), "invalid type")
+
+ /* Set return value */
+ ret_value = (int)(++(type_info->init_count));
+
+done:
+ FUNC_LEAVE_NOAPI(ret_value)
+} /* end H5I__inc_type_ref() */
+
+/*-------------------------------------------------------------------------
+ * Function: H5I_dec_type_ref
+ *
+ * Purpose: Decrements the reference count on an entire type of IDs.
+ * If the type reference count becomes zero then the type is
+ * destroyed along with all IDs in that type regardless of
+ * their reference counts. Destroying IDs involves calling
+ * the free-func for each ID's object and then adding the ID
+ * struct to the ID free list.
+ * Returns the number of references to the type on success; a
+ * return value of 0 means that the type will have to be
+ * re-initialized before it can be used again (and should probably
+ * be set to H5I_UNINIT).
+ *
+ * Return: Success: Number of references to type
+ * Failure: -1
+ *
+ *-------------------------------------------------------------------------
+ */
+int
+H5I_dec_type_ref(H5I_type_t type)
+{
+ H5I_type_info_t *type_info = NULL; /* Pointer to the ID type */
+ herr_t ret_value = 0; /* Return value */
+
+ FUNC_ENTER_NOAPI((-1))
+
+ if (type <= H5I_BADID || (int)type >= H5I_next_type_g)
+ HGOTO_ERROR(H5E_ARGS, H5E_BADRANGE, (-1), "invalid type number")
+
+ type_info = H5I_type_info_array_g[type];
+ if (type_info == NULL || type_info->init_count <= 0)
+ HGOTO_ERROR(H5E_ID, H5E_BADGROUP, (-1), "invalid type")
+
+ /* Decrement the number of users of the ID type. If this is the
+ * last user of the type then release all IDs from the type and
+ * free all memory it used. The free function is invoked for each ID
+ * being freed.
+ */
+ if (1 == type_info->init_count) {
+ H5I__destroy_type(type);
+ ret_value = 0;
+ }
+ else {
+ --(type_info->init_count);
+ ret_value = (herr_t)type_info->init_count;
+ }
+
+done:
+ FUNC_LEAVE_NOAPI(ret_value)
+} /* end H5I_dec_type_ref() */
+
+/*-------------------------------------------------------------------------
+ * Function: H5I__get_type_ref
+ *
+ * Purpose: Retrieve the reference count for an ID type.
+ *
+ * Return: Success: The reference count
+ *
+ * Failure: -1
+ *
+ *-------------------------------------------------------------------------
+ */
+int
+H5I__get_type_ref(H5I_type_t type)
+{
+ H5I_type_info_t *type_info = NULL; /* Pointer to the type */
+ int ret_value = -1; /* Return value */
+
+ FUNC_ENTER_STATIC
+
+ /* Sanity check */
+ HDassert(type >= 0);
+
+ /* Check arguments */
+ type_info = H5I_type_info_array_g[type];
+ if (!type_info)
+ HGOTO_ERROR(H5E_ID, H5E_BADGROUP, (-1), "invalid type")
+
+ /* Set return value */
+ ret_value = (int)type_info->init_count;
+
+done:
+ FUNC_LEAVE_NOAPI(ret_value)
+} /* end H5I__get_type_ref() */
+
+/*-------------------------------------------------------------------------
+ * Function: H5I__iterate_cb
+ *
+ * Purpose: Callback routine for H5I_iterate, invokes "user" callback
+ * function, and then sets return value, based on the result of
+ * that callback.
+ *
+ * Return: Success: H5_ITER_CONT (0) or H5_ITER_STOP (1)
+ * Failure: H5_ITER_ERROR (-1)
+ *
+ *-------------------------------------------------------------------------
+ */
+static int
+H5I__iterate_cb(void *_item, void H5_ATTR_UNUSED *_key, void *_udata)
+{
+ H5I_id_info_t * info = (H5I_id_info_t *)_item; /* Pointer to the ID info */
+ H5I_iterate_ud_t *udata = (H5I_iterate_ud_t *)_udata; /* User data for callback */
+ int ret_value = H5_ITER_CONT; /* Callback return value */
+
+ FUNC_ENTER_STATIC_NOERR
+
+ /* Only invoke the callback function if this ID is visible externally and
+ * its reference count is positive.
+ */
+ if ((!udata->app_ref) || (info->app_count > 0)) {
+ H5I_type_t type = udata->obj_type;
+ void * object;
+ herr_t cb_ret_val;
+
+ /* The stored object pointer might be an H5VL_object_t, in which
+ * case we'll need to get the wrapped object struct (H5F_t *, etc.).
+ */
+ H5_GCC_DIAG_OFF("cast-qual")
+ object = H5I__unwrap((void *)info->object, type); /* Casting away const OK */
+ H5_GCC_DIAG_ON("cast-qual")
+
+ /* Invoke callback function */
+ cb_ret_val = (*udata->user_func)((void *)object, info->id, udata->user_udata);
+
+ /* Set the return value based on the callback's return value */
+ if (cb_ret_val > 0)
+ ret_value = H5_ITER_STOP; /* terminate iteration early */
+ else if (cb_ret_val < 0)
+ ret_value = H5_ITER_ERROR; /* indicate failure (which terminates iteration) */
+ }
+
+ FUNC_LEAVE_NOAPI(ret_value)
+} /* end H5I__iterate_cb() */
+
+/*-------------------------------------------------------------------------
+ * Function: H5I_iterate
+ *
+ * Purpose: Apply function FUNC to each member of type TYPE (with
+ * non-zero application reference count if app_ref is TRUE).
+ * Stop if FUNC returns a non zero value (i.e. anything
+ * other than H5_ITER_CONT).
+ *
+ * If FUNC returns a positive value (i.e. H5_ITER_STOP),
+ * return SUCCEED.
+ *
+ * If FUNC returns a negative value (i.e. H5_ITER_ERROR),
+ * return FAIL.
+ *
+ * The FUNC should take a pointer to the object and the
+ * udata as arguments and return non-zero to terminate
+ * siteration, and zero to continue.
+ *
+ * Limitation: Currently there is no way to start the iteration from
+ * where a previous iteration left off.
+ *
+ * Return: SUCCEED/FAIL
+ *
+ *-------------------------------------------------------------------------
+ */
+herr_t
+H5I_iterate(H5I_type_t type, H5I_search_func_t func, void *udata, hbool_t app_ref)
+{
+ H5I_type_info_t *type_info = NULL; /* Pointer to the type */
+ herr_t ret_value = SUCCEED; /* Return value */
+
+ FUNC_ENTER_NOAPI(FAIL)
+
+ /* Check arguments */
+ if (type <= H5I_BADID || (int)type >= H5I_next_type_g)
+ HGOTO_ERROR(H5E_ARGS, H5E_BADRANGE, FAIL, "invalid type number")
+ type_info = H5I_type_info_array_g[type];
+
+ /* Only iterate through ID list if it is initialized and there are IDs in type */
+ if (type_info && type_info->init_count > 0 && type_info->id_count > 0) {
+ H5I_iterate_ud_t iter_udata; /* User data for iteration callback */
+ H5I_id_info_t * item = NULL;
+ H5I_id_info_t * tmp = NULL;
+
+ /* Set up iterator user data */
+ iter_udata.user_func = func;
+ iter_udata.user_udata = udata;
+ iter_udata.app_ref = app_ref;
+ iter_udata.obj_type = type;
+
+ /* Iterate over IDs */
+ HASH_ITER(hh, type_info->hash_table, item, tmp)
+ {
+ if (!item->marked) {
+ int ret = H5I__iterate_cb((void *)item, NULL, (void *)&iter_udata);
+ if (H5_ITER_ERROR == ret)
+ HGOTO_ERROR(H5E_ID, H5E_BADITER, FAIL, "iteration failed")
+ if (H5_ITER_STOP == ret)
+ break;
+ }
+ }
+ }
+
+done:
+ FUNC_LEAVE_NOAPI(ret_value)
+} /* end H5I_iterate() */
+
+/*-------------------------------------------------------------------------
+ * Function: H5I__find_id
+ *
+ * Purpose: Given an object ID find the info struct that describes the
+ * object.
+ *
+ * Return: Success: A pointer to the object's info struct.
+ *
+ * Failure: NULL
+ *
+ *-------------------------------------------------------------------------
+ */
+H5I_id_info_t *
+H5I__find_id(hid_t id)
+{
+ H5I_type_t type; /* ID's type */
+ H5I_type_info_t *type_info = NULL; /* Pointer to the type */
+ H5I_id_info_t * id_info = NULL; /* ID's info */
+ H5I_id_info_t * ret_value = NULL; /* Return value */
+
+ FUNC_ENTER_PACKAGE_NOERR
+
+ /* Check arguments */
+ type = H5I_TYPE(id);
+ if (type <= H5I_BADID || (int)type >= H5I_next_type_g)
+ HGOTO_DONE(NULL)
+ type_info = H5I_type_info_array_g[type];
+ if (!type_info || type_info->init_count <= 0)
+ HGOTO_DONE(NULL)
+
+ /* Check for same ID as we have looked up last time */
+ if (type_info->last_id_info && type_info->last_id_info->id == id)
+ id_info = type_info->last_id_info;
+ else {
+ HASH_FIND(hh, type_info->hash_table, &id, sizeof(hid_t), id_info);
+
+ /* Remember this ID */
+ type_info->last_id_info = id_info;
+ }
+
+ /* Check if this is a future ID */
+ H5_GCC_DIAG_OFF("cast-qual")
+ if (id_info && id_info->is_future) {
+ hid_t actual_id = H5I_INVALID_HID; /* ID for actual object */
+ void *future_object; /* Pointer to the future object */
+ void *actual_object; /* Pointer to the actual object */
+
+ /* Invoke the realize callback, to get the actual object */
+ if ((id_info->realize_cb)((void *)id_info->object, &actual_id) < 0)
+ HGOTO_DONE(NULL)
+
+ /* Verify that we received a valid ID, of the same type */
+ if (H5I_INVALID_HID == actual_id)
+ HGOTO_DONE(NULL)
+ if (H5I_TYPE(id) != H5I_TYPE(actual_id))
+ HGOTO_DONE(NULL)
+
+ /* Swap the actual object in for the future object */
+ future_object = (void *)id_info->object;
+ actual_object = H5I__remove_common(type_info, actual_id);
+ HDassert(actual_object);
+ id_info->object = actual_object;
+
+ /* Discard the future object */
+ if ((id_info->discard_cb)(future_object) < 0)
+ HGOTO_DONE(NULL)
+ future_object = NULL;
+
+ /* Change the ID from 'future' to 'actual' */
+ id_info->is_future = FALSE;
+ id_info->realize_cb = NULL;
+ id_info->discard_cb = NULL;
+ }
+ H5_GCC_DIAG_ON("cast-qual")
+
+ /* Set return value */
+ ret_value = id_info;
+
+done:
+ FUNC_LEAVE_NOAPI(ret_value)
+} /* end H5I__find_id() */
+
+/*-------------------------------------------------------------------------
+ * Function: H5I__find_id_cb
+ *
+ * Purpose: Callback for searching for an ID with a specific pointer
+ *
+ * Return: Success: H5_ITER_CONT (0) or H5_ITER_STOP (1)
+ * Failure: H5_ITER_ERROR (-1)
+ *
+ *-------------------------------------------------------------------------
+ */
+static int
+H5I__find_id_cb(void *_item, void H5_ATTR_UNUSED *_key, void *_udata)
+{
+ H5I_id_info_t * info = (H5I_id_info_t *)_item; /* Pointer to the ID info */
+ H5I_get_id_ud_t *udata = (H5I_get_id_ud_t *)_udata; /* Pointer to user data */
+ H5I_type_t type = udata->obj_type;
+ const void * object = NULL;
+ int ret_value = H5_ITER_CONT; /* Return value */
+
+ FUNC_ENTER_STATIC_NOERR
+
+ /* Sanity check */
+ HDassert(info);
+ HDassert(udata);
+
+ /* Get a pointer to the VOL connector's data */
+ H5_GCC_DIAG_OFF("cast-qual")
+ object = H5I__unwrap((void *)info->object, type); /* Casting away const OK */
+ H5_GCC_DIAG_ON("cast-qual")
+
+ /* Check for a match */
+ if (object == udata->object) {
+ udata->ret_id = info->id;
+ ret_value = H5_ITER_STOP;
+ }
+
+ FUNC_LEAVE_NOAPI(ret_value)
+} /* end H5I__find_id_cb() */
+
+/*-------------------------------------------------------------------------
+ * Function: H5I_find_id
+ *
+ * Purpose: Return the ID of an object by searching through the ID list
+ * for the type.
+ *
+ * Return: SUCCEED/FAIL
+ * (id will be set to H5I_INVALID_HID on errors or not found)
+ *
+ *-------------------------------------------------------------------------
+ */
+herr_t
+H5I_find_id(const void *object, H5I_type_t type, hid_t *id)
+{
+ H5I_type_info_t *type_info = NULL; /* Pointer to the type */
+ herr_t ret_value = SUCCEED; /* Return value */
+
+ FUNC_ENTER_NOAPI(FAIL)
+
+ HDassert(id);
+
+ *id = H5I_INVALID_HID;
+
+ type_info = H5I_type_info_array_g[type];
+ if (!type_info || type_info->init_count <= 0)
+ HGOTO_ERROR(H5E_ID, H5E_BADGROUP, FAIL, "invalid type")
+
+ /* Only iterate through ID list if it is initialized and there are IDs in type */
+ if (type_info->init_count > 0 && type_info->id_count > 0) {
+ H5I_get_id_ud_t udata; /* User data */
+ H5I_id_info_t * item = NULL;
+ H5I_id_info_t * tmp = NULL;
+
+ /* Set up iterator user data */
+ udata.object = object;
+ udata.obj_type = type;
+ udata.ret_id = H5I_INVALID_HID;
+
+ /* Iterate over IDs for the ID type */
+ HASH_ITER(hh, type_info->hash_table, item, tmp)
+ {
+ int ret = H5I__find_id_cb((void *)item, NULL, (void *)&udata);
+ if (H5_ITER_ERROR == ret)
+ HGOTO_ERROR(H5E_ID, H5E_BADITER, FAIL, "iteration failed")
+ if (H5_ITER_STOP == ret)
+ break;
+ }
+
+ *id = udata.ret_id;
+ }
+
+done:
+ FUNC_LEAVE_NOAPI(ret_value)
+} /* end H5I_find_id() */
diff --git a/src/H5Imodule.h b/src/H5Imodule.h
index a2174d7..8db31c8 100644
--- a/src/H5Imodule.h
+++ b/src/H5Imodule.h
@@ -26,7 +26,7 @@
*/
#define H5I_MODULE
#define H5_MY_PKG H5I
-#define H5_MY_PKG_ERR H5E_ATOM
+#define H5_MY_PKG_ERR H5E_ID
#define H5_MY_PKG_INIT NO
/**\defgroup H5I H5I
diff --git a/src/H5Ipkg.h b/src/H5Ipkg.h
index 5461aa2..e93ec74 100644
--- a/src/H5Ipkg.h
+++ b/src/H5Ipkg.h
@@ -29,7 +29,14 @@
/* Get package's private header */
#include "H5Iprivate.h"
-/* Other private headers needed by this file */
+/* uthash is an external, header-only hash table implementation.
+ *
+ * We include the file directly in src/ and #define a few functions
+ * to use our internal memory calls.
+ */
+#define uthash_malloc(sz) H5MM_malloc(sz)
+#define uthash_free(ptr, sz) H5MM_free(ptr) /* Ignoring sz is intentional */
+#include "uthash.h"
/**************************/
/* Package Private Macros */
@@ -60,10 +67,61 @@
/* Package Private Typedefs */
/****************************/
+/* ID information structure used */
+typedef struct H5I_id_info_t {
+ hid_t id; /* ID for this info */
+ unsigned count; /* Ref. count for this ID */
+ unsigned app_count; /* Ref. count of application visible IDs */
+ const void *object; /* Pointer associated with the ID */
+
+ /* Future ID info */
+ hbool_t is_future; /* Whether this ID represents a future object */
+ H5I_future_realize_func_t realize_cb; /* 'realize' callback for future object */
+ H5I_future_discard_func_t discard_cb; /* 'discard' callback for future object */
+
+ /* Hash table ID fields */
+ hbool_t marked; /* Marked for deletion */
+ UT_hash_handle hh; /* Hash table handle (must be LAST) */
+} H5I_id_info_t;
+
+/* Type information structure used */
+typedef struct H5I_type_info_t {
+ const H5I_class_t *cls; /* Pointer to ID class */
+ unsigned init_count; /* # of times this type has been initialized */
+ uint64_t id_count; /* Current number of IDs held */
+ uint64_t nextid; /* ID to use for the next object */
+ H5I_id_info_t * last_id_info; /* Info for most recent ID looked up */
+ H5I_id_info_t * hash_table; /* Hash table pointer for this ID type */
+} H5I_type_info_t;
+
+/*****************************/
+/* Package Private Variables */
+/*****************************/
+
+/* Array of pointers to ID types */
+H5_DLLVAR H5I_type_info_t *H5I_type_info_array_g[H5I_MAX_NUM_TYPES];
+
+/* Variable to keep track of the number of types allocated. Its value is the
+ * next type ID to be handed out, so it is always one greater than the number
+ * of types.
+ * Starts at 1 instead of 0 because it makes trace output look nicer. If more
+ * types (or IDs within a type) are needed, adjust TYPE_BITS in H5Ipkg.h
+ * and/or increase size of hid_t
+ */
+H5_DLLVAR int H5I_next_type_g;
+
/******************************/
/* Package Private Prototypes */
/******************************/
+H5_DLL hid_t H5I__register(H5I_type_t type, const void *object, hbool_t app_ref,
+ H5I_future_realize_func_t realize_cb, H5I_future_discard_func_t discard_cb);
+H5_DLL int H5I__destroy_type(H5I_type_t type);
+H5_DLL void *H5I__remove_verify(hid_t id, H5I_type_t type);
+H5_DLL int H5I__inc_type_ref(H5I_type_t type);
+H5_DLL int H5I__get_type_ref(H5I_type_t type);
+H5_DLL H5I_id_info_t *H5I__find_id(hid_t id);
+
/* Testing functions */
#ifdef H5I_TESTING
H5_DLL ssize_t H5I__get_name_test(hid_t id, char *name /*out*/, size_t size, hbool_t *cached);
diff --git a/src/H5Iprivate.h b/src/H5Iprivate.h
index 78fd84d..d1b6248 100644
--- a/src/H5Iprivate.h
+++ b/src/H5Iprivate.h
@@ -42,7 +42,7 @@
/****************************/
typedef struct H5I_class_t {
- H5I_type_t type_id; /* Class ID for the type */
+ H5I_type_t type; /* Class "value" for the type */
unsigned flags; /* Class behavior flags */
unsigned reserved; /* Number of reserved IDs for this type */
/* [A specific number of type entries may be
@@ -70,7 +70,9 @@ H5_DLL int H5I_get_ref(hid_t id, hbool_t app_ref);
H5_DLL int H5I_inc_ref(hid_t id, hbool_t app_ref);
H5_DLL int H5I_dec_ref(hid_t id);
H5_DLL int H5I_dec_app_ref(hid_t id);
+H5_DLL int H5I_dec_app_ref_async(hid_t id, void **token);
H5_DLL int H5I_dec_app_ref_always_close(hid_t id);
+H5_DLL int H5I_dec_app_ref_always_close_async(hid_t id, void **token);
H5_DLL int H5I_dec_type_ref(H5I_type_t type);
H5_DLL herr_t H5I_find_id(const void *object, H5I_type_t type, hid_t *id /*out*/);
@@ -86,7 +88,7 @@ H5_DLL herr_t H5I_find_id(const void *object, H5I_type_t type, hid_t *id /*o
/* Functions that manipulate objects */
H5_DLL void * H5I_object(hid_t id);
-H5_DLL void * H5I_object_verify(hid_t id, H5I_type_t id_type);
+H5_DLL void * H5I_object_verify(hid_t id, H5I_type_t type);
H5_DLL void * H5I_remove(hid_t id);
H5_DLL void * H5I_subst(hid_t id, const void *new_object);
H5_DLL htri_t H5I_is_file_object(hid_t id);
diff --git a/src/H5Ipublic.h b/src/H5Ipublic.h
index 69aa455..8e5e167 100644
--- a/src/H5Ipublic.h
+++ b/src/H5Ipublic.h
@@ -21,57 +21,97 @@
/* Public headers needed by this file */
#include "H5public.h"
-/*
- * Library type values. Start with `1' instead of `0' because it makes the
- * tracing output look better when hid_t values are large numbers. Change the
- * TYPE_BITS in H5I.c if the MAXID gets larger than 32 (an assertion will
- * fail otherwise).
+/**
+ * Library type values.
+ * \internal Library type values. Start with `1' instead of `0' because it
+ * makes the tracing output look better when hid_t values are large
+ * numbers. Change the TYPE_BITS in H5I.c if the MAXID gets larger
+ * than 32 (an assertion will fail otherwise).
*
- * When adding types here, add a section to the 'misc19' test in test/tmisc.c
- * to verify that the H5I{inc|dec|get}_ref() routines work correctly with it.
+ * When adding types here, add a section to the 'misc19' test in
+ * test/tmisc.c to verify that the H5I{inc|dec|get}_ref() routines
+ * work correctly with it. \endinternal
*/
+//! <!-- [H5I_type_t_snip] -->
typedef enum H5I_type_t {
- H5I_UNINIT = (-2), /* uninitialized type */
- H5I_BADID = (-1), /* invalid Type */
- H5I_FILE = 1, /* type ID for File objects */
- H5I_GROUP, /* type ID for Group objects */
- H5I_DATATYPE, /* type ID for Datatype objects */
- H5I_DATASPACE, /* type ID for Dataspace objects */
- H5I_DATASET, /* type ID for Dataset objects */
- H5I_MAP, /* type ID for Map objects */
- H5I_ATTR, /* type ID for Attribute objects */
- H5I_VFL, /* type ID for virtual file layer */
- H5I_VOL, /* type ID for virtual object layer */
- H5I_GENPROP_CLS, /* type ID for generic property list classes */
- H5I_GENPROP_LST, /* type ID for generic property lists */
- H5I_ERROR_CLASS, /* type ID for error classes */
- H5I_ERROR_MSG, /* type ID for error messages */
- H5I_ERROR_STACK, /* type ID for error stacks */
- H5I_SPACE_SEL_ITER, /* type ID for dataspace selection iterator */
- H5I_NTYPES /* number of library types, MUST BE LAST! */
+ H5I_UNINIT = (-2), /**< uninitialized type */
+ H5I_BADID = (-1), /**< invalid Type */
+ H5I_FILE = 1, /**< type ID for File objects */
+ H5I_GROUP, /**< type ID for Group objects */
+ H5I_DATATYPE, /**< type ID for Datatype objects */
+ H5I_DATASPACE, /**< type ID for Dataspace objects */
+ H5I_DATASET, /**< type ID for Dataset objects */
+ H5I_MAP, /**< type ID for Map objects */
+ H5I_ATTR, /**< type ID for Attribute objects */
+ H5I_VFL, /**< type ID for virtual file layer */
+ H5I_VOL, /**< type ID for virtual object layer */
+ H5I_GENPROP_CLS, /**< type ID for generic property list classes */
+ H5I_GENPROP_LST, /**< type ID for generic property lists */
+ H5I_ERROR_CLASS, /**< type ID for error classes */
+ H5I_ERROR_MSG, /**< type ID for error messages */
+ H5I_ERROR_STACK, /**< type ID for error stacks */
+ H5I_SPACE_SEL_ITER, /**< type ID for dataspace selection iterator */
+ H5I_EVENTSET, /**< type ID for event sets */
+ H5I_NTYPES /**< number of library types, MUST BE LAST! */
} H5I_type_t;
+//! <!-- [H5I_type_t_snip] -->
-/* Type of atoms to return to users */
+/**
+ * Type of IDs to return to users
+ */
typedef int64_t hid_t;
+
+#define PRIdHID PRId64
+#define PRIxHID PRIx64
+#define PRIXHID PRIX64
+#define PRIoHID PRIo64
+
+/**
+ * The size of identifiers
+ */
#define H5_SIZEOF_HID_T H5_SIZEOF_INT64_T
-/* An invalid object ID. This is also negative for error return. */
+/**
+ * An invalid object ID. This is also negative for error return.
+ */
#define H5I_INVALID_HID (-1)
-/*
- * Function for freeing objects. This function will be called with an object
+/**
+ * A function for freeing objects. This function will be called with an object
* ID type number and a pointer to the object. The function should free the
* object and return non-negative to indicate that the object
* can be removed from the ID type. If the function returns negative
* (failure) then the object will remain in the ID type.
*/
-typedef herr_t (*H5I_free_t)(void *);
+typedef herr_t (*H5I_free_t)(void *, void **);
-/* Type of the function to compare objects & keys */
+/**
+ * The type of a function to compare objects & keys
+ */
+//! <!-- [H5I_search_func_t_snip] -->
typedef int (*H5I_search_func_t)(void *obj, hid_t id, void *key);
+//! <!-- [H5I_search_func_t_snip] -->
-/* Type of the H5Iiterate callback function */
+/**
+ * The type of H5Iiterate() callback functions
+ */
+//! <!-- [H5I_iterate_func_t_snip] -->
typedef herr_t (*H5I_iterate_func_t)(hid_t id, void *udata);
+//! <!-- [H5I_iterate_func_t_snip] -->
+
+/**
+ * The type of the realize_cb callback for H5Iregister_future
+ */
+//! <!-- [H5I_future_realize_func_t_snip] -->
+typedef herr_t (*H5I_future_realize_func_t)(void *future_object, hid_t *actual_object_id);
+//! <!-- [H5I_future_realize_func_t_snip] -->
+
+/**
+ * The type of the discard_cb callback for H5Iregister_future
+ */
+//! <!-- [H5I_future_discard_func_t_snip] -->
+typedef herr_t (*H5I_future_discard_func_t)(void *future_object);
+//! <!-- [H5I_future_discard_func_t_snip] -->
#ifdef __cplusplus
extern "C" {
@@ -79,26 +119,638 @@ extern "C" {
/* Public API functions */
-H5_DLL hid_t H5Iregister(H5I_type_t type, const void *object);
-H5_DLL void * H5Iobject_verify(hid_t id, H5I_type_t id_type);
-H5_DLL void * H5Iremove_verify(hid_t id, H5I_type_t id_type);
+/**
+ * \ingroup H5I
+ *
+ * \brief Registers an object under a type and returns an ID for it
+ *
+ * \param[in] type The identifier of the type of the new ID
+ * \param[in] object Pointer to object for which a new ID is created
+ *
+ * \return \hid_t{object}
+ *
+ * \details H5Iregister() creates and returns a new ID for an object.
+ *
+ * \details The \p type parameter is the identifier for the ID type to which
+ * this new ID will belong. This identifier must have been created by
+ * a call to H5Iregister_type().
+ *
+ * \details The \p object parameter is a pointer to the memory which the new ID
+ * will be a reference to. This pointer will be stored by the library
+ * and returned via a call to H5Iobject_verify().
+ *
+ */
+H5_DLL hid_t H5Iregister(H5I_type_t type, const void *object);
+/**
+ * \ingroup H5I
+ *
+ * \brief Registers a "future" object under a type and returns an ID for it
+ *
+ * \param[in] type The identifier of the type of the new ID
+ * \param[in] object Pointer to "future" object for which a new ID is created
+ * \param[in] realize_cb Function pointer to realize a future object
+ * \param[in] discard_cb Function pointer to destroy a future object
+ *
+ * \return \hid_t{object}
+ *
+ * \details H5Iregister_future() creates and returns a new ID for a "future" object.
+ * Future objects are a special kind of object and represent a
+ * placeholder for an object that has not yet been created or opened.
+ * The \p realize_cb will be invoked by the HDF5 library to 'realize'
+ * the future object as an actual object. A call to H5Iobject_verify()
+ * will invoke the \p realize_cb callback and if it successfully
+ * returns, will return the actual object, not the future object.
+ *
+ * \details The \p type parameter is the identifier for the ID type to which
+ * this new future ID will belong. This identifier may have been created
+ * by a call to H5Iregister_type() or may be one of the HDF5 pre-defined
+ * ID classes (e.g. H5I_FILE, H5I_GROUP, H5I_DATASPACE, etc).
+ *
+ * \details The \p object parameter is a pointer to the memory which the new ID
+ * will be a reference to. This pointer will be stored by the library,
+ * but will not be returned to a call to H5Iobject_verify() until the
+ * \p realize_cb callback has returned the actual pointer for the object.
+ *
+ * A NULL value for \p object is allowed.
+ *
+ * \details The \p realize_cb parameter is a function pointer that will be
+ * invoked by the HDF5 library to convert a future object into an
+ * actual object. The \p realize_cb function may be invoked by
+ * H5Iobject_verify() to return the actual object for a user-defined
+ * ID class (i.e. an ID class registered with H5Iregister_type()) or
+ * internally by the HDF5 library in order to use or get information
+ * from an HDF5 pre-defined ID type. For example, the \p realize_cb
+ * for a future dataspace object will be called during the process
+ * of returning information from H5Sget_simple_extent_dims().
+ *
+ * Note that although the \p realize_cb routine returns
+ * an ID (as a parameter) for the actual object, the HDF5 library
+ * will swap the actual object in that ID for the future object in
+ * the future ID. This ensures that the ID value for the object
+ * doesn't change for the user when the object is realized.
+ *
+ * Note that the \p realize_cb callback could receive a NULL value
+ * for a future object pointer, if one was used when H5Iregister_future()
+ * was initially called. This is permitted as a means of allowing
+ * the \p realize_cb to act as a generator of new objects, without
+ * requiring creation of unnecessary future objects.
+ *
+ * It is an error to pass NULL for \p realize_cb.
+ *
+ * \details The \p discard_cb parameter is a function pointer that will be
+ * invoked by the HDF5 library to destroy a future object. This
+ * callback will always be invoked for _every_ future object, whether
+ * the \p realize_cb is invoked on it or not. It's possible that
+ * the \p discard_cb is invoked on a future object without the
+ * \p realize_cb being invoked, e.g. when a future ID is closed without
+ * requiring the future object to be realized into an actual one.
+ *
+ * Note that the \p discard_cb callback could receive a NULL value
+ * for a future object pointer, if one was used when H5Iregister_future()
+ * was initially called.
+ *
+ * It is an error to pass NULL for \p discard_cb.
+ *
+ * \note The H5Iregister_future() function is primarily targeted at VOL connector
+ * authors and is _not_ designed for general-purpose application use.
+ *
+ */
+H5_DLL hid_t H5Iregister_future(H5I_type_t type, const void *object, H5I_future_realize_func_t realize_cb,
+ H5I_future_discard_func_t discard_cb);
+/**
+ * \ingroup H5I
+ *
+ * \brief Returns the object referenced by an ID
+ *
+ * \param[in] id ID to be dereferenced
+ * \param[in] type The identifier type
+
+ *
+ * \return Pointer to the object referenced by \p id on success, NULL on failure.
+ *
+ * \details H5Iobject_verify() returns a pointer to the memory referenced by id
+ * after verifying that \p id is of type \p type. This function is
+ * analogous to dereferencing a pointer in C with type checking.
+ *
+ * \note H5Iobject_verify() does not change the ID it is called on in any way
+ * (as opposed to H5Iremove_verify(), which removes the ID from its
+ * type’s hash table).
+ *
+ * \see H5Iregister()
+ *
+ */
+H5_DLL void *H5Iobject_verify(hid_t id, H5I_type_t type);
+/**
+ * \ingroup H5I
+ *
+ * \brief Removes an ID from its type
+ *
+ * \param[in] id The ID to be removed from its type
+ * \param[in] type The identifier type
+
+ *
+ * \return Returns a pointer to the memory referred to by \p id on success,
+ * NULL on failure.
+ *
+ * \details H5Iremove_verify() first ensures that \p id belongs to \p type.
+ * If so, it removes \p id from its type and returns the pointer
+ * to the memory it referred to. This pointer is the same pointer that
+ * was placed in storage by H5Iregister(). If id does not belong to
+ * \p type, then NULL is returned.
+ *
+ * The \p id parameter is the ID which is to be removed from its type.
+ *
+ * The \p type parameter is the identifier for the ID type which \p id
+ * is supposed to belong to. This identifier must have been created by
+ * a call to H5Iregister_type().
+ *
+ * \note This function does NOT deallocate the memory that \p id refers to.
+ * The pointer returned by H5Iregister() must be deallocated by the user
+ * to avoid memory leaks.
+ *
+ */
+H5_DLL void *H5Iremove_verify(hid_t id, H5I_type_t type);
+/**
+ * \ingroup H5I
+ *
+ * \brief Retrieves the type of an object
+ *
+ * \obj_id{id}
+ *
+ * \return Returns the object type if successful; otherwise #H5I_BADID.
+ *
+ * \details H5Iget_type() retrieves the type of the object identified by
+ * \p id.
+ *
+ * Valid types returned by the function are:
+ * \id_types
+ *
+ * If no valid type can be determined or the identifier submitted is
+ * invalid, the function returns #H5I_BADID.
+ *
+ * This function is of particular use in determining the type of
+ * object closing function (H5Dclose(), H5Gclose(), etc.) to call
+ * after a call to H5Rdereference().
+ *
+ * \note Note that this function returns only the type of object that \p id
+ * would identify if it were valid; it does not determine whether \p id
+ * is valid identifier. Validity can be determined with a call to
+ * H5Iis_valid().
+ *
+ */
H5_DLL H5I_type_t H5Iget_type(hid_t id);
-H5_DLL hid_t H5Iget_file_id(hid_t id);
-H5_DLL ssize_t H5Iget_name(hid_t id, char *name /*out*/, size_t size);
-H5_DLL int H5Iinc_ref(hid_t id);
-H5_DLL int H5Idec_ref(hid_t id);
-H5_DLL int H5Iget_ref(hid_t id);
+/**
+ * \ingroup H5I
+ *
+ * \brief Retrieves an identifier for the file containing the specified object
+ *
+ * \obj_id{id}
+ *
+ * \return \hid_t{file}
+ *
+ * \details H5Iget_file_id() returns the identifier of the file associated with
+ * the object referenced by \p id.
+ *
+ * \note Note that the HDF5 library permits an application to close a file
+ * while objects within the file remain open. If the file containing the
+ * object \p id is still open, H5Iget_file_id() will retrieve the
+ * existing file identifier. If there is no existing file identifier for
+ * the file, i.e., the file has been closed, H5Iget_file_id() will reopen
+ * the file and return a new file identifier. In either case, the file
+ * identifier must eventually be released using H5Fclose().
+ *
+ * \since 1.6.3
+ *
+ */
+H5_DLL hid_t H5Iget_file_id(hid_t id);
+/**
+ * \ingroup H5I
+ *
+ * \brief Retrieves a name of an object based on the object identifier
+ *
+ * \obj_id{id}
+ * \param[out] name A buffer for thename associated with the identifier
+ * \param[in] size The size of the \p name buffer; usually the size of
+ * the name in bytes plus 1 for a NULL terminator
+ *
+ * \return ssize_t
+ *
+ * \details H5Iget_name() retrieves a name for the object identified by \p id.
+ *
+ * \details Up to size characters of the name are returned in \p name;
+ * additional characters, if any, are not returned to the user
+ * application.
+ *
+ * If the length of the name, which determines the required value of
+ * \p size, is unknown, a preliminary H5Iget_name() call can be made.
+ * The return value of this call will be the size in bytes of the
+ * object name. That value, plus 1 for a NULL terminator, is then
+ * assigned to size for a second H5Iget_name() call, which will
+ * retrieve the actual name.
+ *
+ * If the object identified by \p id is an attribute, as determined
+ * via H5Iget_type(), H5Iget_name() retrieves the name of the object
+ * to which that attribute is attached. To retrieve the name of the
+ * attribute itself, use H5Aget_name().
+ *
+ * If there is no name associated with the object identifier or if the
+ * name is NULL, H5Iget_name() returns 0 (zero).
+ *
+ * \note Note that an object in an HDF5 file may have multiple paths if there
+ * are multiple links pointing to it. This function may return any one of
+ * these paths. When possible, H5Iget_name() returns the path with which
+ * the object was opened.
+ *
+ * \since 1.6.0
+ *
+ */
+H5_DLL ssize_t H5Iget_name(hid_t id, char *name /*out*/, size_t size);
+/**
+ * \ingroup H5I
+ *
+ * \brief Increments the reference count for an object
+ *
+ * \obj_id{id}
+ *
+ * \return Returns a non-negative reference count of the object ID after
+ * incrementing it if successful; otherwise a negative value is
+ * returned.
+ *
+ * \details H5Iinc_ref() increments the reference count of the object
+ * identified by \p id.
+ *
+ * The reference count for an object ID is attached to the information
+ * about an object in memory and has no relation to the number of
+ * links to an object on disk.
+ *
+ * The reference count for a newly created object will be 1. Reference
+ * counts for objects may be explicitly modified with this function or
+ * with H5Idec_ref(). When an object ID's reference count reaches
+ * zero, the object will be closed. Calling an object ID's \c close
+ * function decrements the reference count for the ID which normally
+ * closes the object, but if the reference count for the ID has been
+ * incremented with this function, the object will only be closed when
+ * the reference count reaches zero with further calls to H5Idec_ref()
+ * or the object ID's \c close function.
+ *
+ * If the object ID was created by a collective parallel call (such as
+ * H5Dcreate(), H5Gopen(), etc.), the reference count should be
+ * modified by all the processes which have copies of the ID.
+ * Generally this means that group, dataset, attribute, file and named
+ * datatype IDs should be modified by all the processes and that all
+ * other types of IDs are safe to modify by individual processes.
+ *
+ * This function is of particular value when an application is
+ * maintaining multiple copies of an object ID. The object ID can be
+ * incremented when a copy is made. Each copy of the ID can then be
+ * safely closed or decremented and the HDF5 object will be closed
+ * when the reference count for that that object drops to zero.
+ *
+ * \since 1.6.2
+ *
+ */
+H5_DLL int H5Iinc_ref(hid_t id);
+/**
+ * \ingroup H5I
+ *
+ * \brief Decrements the reference count for an object
+ *
+ * \obj_id{id}
+ *
+ * \return Returns a non-negative reference count of the object ID after
+ * decrementing it, if successful; otherwise a negative value is
+ * returned.
+ *
+ * \details H5Idec_ref() decrements the reference count of the object
+ * identified by \p id.
+ *
+ * The reference count for an object ID is attached to the information
+ * about an object in memory and has no relation to the number of
+ * links to an object on disk.
+ *
+ * The reference count for a newly created object will be 1. Reference
+ * counts for objects may be explicitly modified with this function or
+ * with H5Iinc_ref(). When an object identifier’s reference count
+ * reaches zero, the object will be closed. Calling an object
+ * identifier’s \c close function decrements the reference count for
+ * the identifier which normally closes the object, but if the
+ * reference count for the identifier has been incremented with
+ * H5Iinc_ref(), the object will only be closed when the reference
+ * count reaches zero with further calls to this function or the
+ * object identifier’s \c close function.
+ *
+ * If the object ID was created by a collective parallel call (such as
+ * H5Dcreate(), H5Gopen(), etc.), the reference count should be
+ * modified by all the processes which have copies of the ID.
+ * Generally this means that group, dataset, attribute, file and named
+ * datatype IDs should be modified by all the processes and that all
+ * other types of IDs are safe to modify by individual processes.
+ *
+ * This function is of particular value when an application is
+ * maintaining multiple copies of an object ID. The object ID can be
+ * incremented when a copy is made. Each copy of the ID can then be
+ * safely closed or decremented and the HDF5 object will be closed
+ * when the reference count for that that object drops to zero.
+ *
+ * \since 1.6.2
+ *
+ */
+H5_DLL int H5Idec_ref(hid_t id);
+/**
+ * \ingroup H5I
+ *
+ * \brief Retrieves the reference count for an object
+ *
+ * \obj_id{id}
+ *
+ * \return Returns a non-negative current reference count of the object
+ * identifier if successful; otherwise a negative value is returned.
+ *
+ * \details H5Iget_ref() retrieves the reference count of the object identified
+ * by \p id.
+ *
+ * The reference count for an object identifier is attached to the
+ * information about an object in memory and has no relation to the
+ * number of links to an object on disk.
+ *
+ * The function H5Iis_valid() is used to determine whether a specific
+ * object identifier is valid.
+ *
+ * \since 1.6.2
+ *
+ */
+H5_DLL int H5Iget_ref(hid_t id);
+/**
+ * \ingroup H5I
+ *
+ * \brief Creates and returns a new ID type
+ *
+ * \param[in] hash_size Minimum hash table size (in entries) used to store IDs
+ * for the new type
+ * \param[in] reserved Number of reserved IDs for the new type
+ * \param[in] free_func Function used to deallocate space for a single ID
+ *
+ * \return Returns the type identifier on success, negative on failure.
+ *
+ * \details H5Iregister_type() allocates space for a new ID type and returns an
+ * identifier for it.
+ *
+ * The \p hash_size parameter indicates the minimum size of the hash
+ * table used to store IDs in the new type.
+ *
+ * The \p reserved parameter indicates the number of IDs in this new
+ * type to be reserved. Reserved IDs are valid IDs which are not
+ * associated with any storage within the library.
+ *
+ * The \p free_func parameter is a function pointer to a function
+ * which returns an herr_t and accepts a \c void*. The purpose of this
+ * function is to deallocate memory for a single ID. It will be called
+ * by H5Iclear_type() and H5Idestroy_type() on each ID. This function
+ * is NOT called by H5Iremove_verify(). The \c void* will be the same
+ * pointer which was passed in to the H5Iregister() function. The \p
+ * free_func function should return 0 on success and -1 on failure.
+ *
+ */
H5_DLL H5I_type_t H5Iregister_type(size_t hash_size, unsigned reserved, H5I_free_t free_func);
-H5_DLL herr_t H5Iclear_type(H5I_type_t type, hbool_t force);
-H5_DLL herr_t H5Idestroy_type(H5I_type_t type);
-H5_DLL int H5Iinc_type_ref(H5I_type_t type);
-H5_DLL int H5Idec_type_ref(H5I_type_t type);
-H5_DLL int H5Iget_type_ref(H5I_type_t type);
-H5_DLL void * H5Isearch(H5I_type_t type, H5I_search_func_t func, void *key);
-H5_DLL herr_t H5Iiterate(H5I_type_t type, H5I_iterate_func_t op, void *op_data);
-H5_DLL herr_t H5Inmembers(H5I_type_t type, hsize_t *num_members);
-H5_DLL htri_t H5Itype_exists(H5I_type_t type);
-H5_DLL htri_t H5Iis_valid(hid_t id);
+/**
+ * \ingroup H5I
+ *
+ * \brief Deletes all identifiers of the given type
+ *
+ * \param[in] type Identifier of identifier type which is to be cleared of identifiers
+ * \param[in] force Whether or not to force deletion of all identifiers
+ *
+ * \return \herr_t
+ *
+ * \details H5Iclear_type() deletes all identifiers of the type identified by
+ * the argument \p type.
+ *
+ * The identifier type's free function is first called on all of these
+ * identifiers to free their memory, then they are removed from the
+ * type.
+ *
+ * If the \p force flag is set to false, only those identifiers whose
+ * reference counts are equal to 1 will be deleted, and all other
+ * identifiers will be entirely unchanged. If the force flag is true,
+ * all identifiers of this type will be deleted.
+ *
+ */
+H5_DLL herr_t H5Iclear_type(H5I_type_t type, hbool_t force);
+/**
+ * \ingroup H5I
+ *
+ * \brief Removes an identifier type and all identifiers within that type
+ *
+ * \param[in] type Identifier of identifier type which is to be destroyed
+ *
+ * \return \herr_t
+ *
+ * \details H5Idestroy_type deletes an entire identifier type \p type. All
+ * identifiers of this type are destroyed and no new identifiers of
+ * this type can be registered.
+ *
+ * The type’s free function is called on all of the identifiers which
+ * are deleted by this function, freeing their memory. In addition,
+ * all memory used by this type’s hash table is freed.
+ *
+ * Since the H5I_type_t values of destroyed identifier types are
+ * reused when new types are registered, it is a good idea to set the
+ * variable holding the value of the destroyed type to #H5I_UNINIT.
+ *
+ */
+H5_DLL herr_t H5Idestroy_type(H5I_type_t type);
+/**
+ * \ingroup H5I
+ *
+ * \brief Increments the reference count on an ID type
+ *
+ * \param[in] type The identifier of the type whose reference count is to be incremented
+ *
+ * \return Returns the current reference count on success, negative on failure.
+ *
+ * \details H5Iinc_type_ref() increments the reference count on an ID type. The
+ * reference count is used by the library to indicate when an ID type
+ * can be destroyed.
+ *
+ * The type parameter is the identifier for the ID type whose
+ * reference count is to be incremented. This identifier must have
+ * been created by a call to H5Iregister_type().
+ *
+ */
+H5_DLL int H5Iinc_type_ref(H5I_type_t type);
+/**
+ * \ingroup H5I
+ *
+ * \brief Decrements the reference count on an identifier type
+ *
+ * \param[in] type The identifier of the type whose reference count is to be decremented
+ *
+ * \return Returns the current reference count on success, negative on failure.
+ *
+ * \details H5Idec_type_ref() decrements the reference count on an identifier
+ * type. The reference count is used by the library to indicate when
+ * an identifier type can be destroyed. If the reference count reaches
+ * zero, this function will destroy it.
+ *
+ * The type parameter is the identifier for the identifier type whose
+ * reference count is to be decremented. This identifier must have
+ * been created by a call to H5Iregister_type().
+ *
+ */
+H5_DLL int H5Idec_type_ref(H5I_type_t type);
+/**
+ * \ingroup H5I
+ *
+ * \brief Retrieves the reference count on an ID type
+ *
+ * \param[in] type The identifier of the type whose reference count is to be retieved
+ *
+ * \return Returns the current reference count on success, negative on failure.
+ *
+ * \details H5Iget_type_ref() retrieves the reference count on an ID type. The
+ * reference count is used by the library to indicate when an ID type
+ * can be destroyed.
+ *
+ * The type parameter is the identifier for the ID type whose
+ * reference count is to be retrieved. This identifier must have been
+ * created by a call to H5Iregister_type().
+ *
+ */
+H5_DLL int H5Iget_type_ref(H5I_type_t type);
+/**
+ * \ingroup H5I
+ *
+ * \brief Finds the memory referred to by an ID within the given ID type such
+ * that some criterion is satisfied
+ *
+ * \param[in] type The identifier of the type to be searched
+ * \param[in] func The function defining the search criteria
+ * \param[in] key A key for the search function
+ *
+ * \return Returns a pointer to the object which satisfies the search function
+ * on success, NULL on failure.
+ *
+ * \details H5Isearch() searches through a given ID type to find an object that
+ * satisfies the criteria defined by \p func. If such an object is
+ * found, the pointer to the memory containing this object is
+ * returned. Otherwise, NULL is returned. To do this, \p func is
+ * called on every member of type \p type. The first member to satisfy
+ * \p func is returned.
+ *
+ * The \p type parameter is the identifier for the ID type which is to
+ * be searched. This identifier must have been created by a call to
+ * H5Iregister_type().
+ *
+ * The parameter \p func is a function pointer to a function which
+ * takes three parameters. The first parameter is a \c void* and will
+ * be a pointer to the object to be tested. This is the same object
+ * that was placed in storage using H5Iregister(). The second
+ * parameter is a hid_t and is the ID of the object to be tested. The
+ * last parameter is a \c void*. This is the \p key parameter and can
+ * be used however the user finds helpful, or it can be ignored if it
+ * is not needed. \p func returns 0 if the object it is testing does
+ * not pass its criteria. A non-zero value should be returned if the
+ * object does pass its criteria. H5I_search_func_t is defined in
+ * H5Ipublic.h and is shown below.
+ * \snippet this H5I_search_func_t_snip
+ * The \p key parameter will be passed to the search function as a
+ * parameter. It can be used to further define the search at run-time.
+ *
+ */
+H5_DLL void *H5Isearch(H5I_type_t type, H5I_search_func_t func, void *key);
+/**
+ * \ingroup H5I
+ *
+ * \brief Calls a callback for each member of the identifier type specified
+ *
+ * \param[in] type The identifier type
+ * \param[in] op The callback function
+ * \param[in,out] op_data The data for the callback function
+ *
+ * \return The last value returned by \p op
+ *
+ * \details H5Iiterate() calls the callback function \p op for each member of
+ * the identifier type \p type. The callback function type for \p op,
+ * H5I_iterate_func_t, is defined in H5Ipublic.h as:
+ * \snippet this H5I_iterate_func_t_snip
+ * \p op takes as parameters the identifier and a pass through of
+ * \p op_data, and returns an herr_t.
+ *
+ * A positive return from op will cause the iteration to stop and
+ * H5Iiterate() will return the value returned by \p op. A negative
+ * return from \p op will cause the iteration to stop and H5Iiterate()
+ * will return failure. A zero return from \p op will allow iteration
+ * to continue, as long as there are other identifiers remaining in
+ * type.
+ *
+ * \since 1.12.0
+ *
+ */
+H5_DLL herr_t H5Iiterate(H5I_type_t type, H5I_iterate_func_t op, void *op_data);
+/**
+ * \ingroup H5I
+ *
+ * \brief Returns the number of identifiers in a given identifier type
+ *
+ * \param[in] type The identifier type
+ * \param[out] num_members Number of identifiers of the specified identifier type
+ *
+ * \return \herr_t
+ *
+ * \details H5Inmembers() returns the number of identifiers of the identifier
+ * type specified in \p type.
+ *
+ * The number of identifiers is returned in \p num_members. If no
+ * identifiers of this type have been registered, the type does not
+ * exist, or it has been destroyed, \p num_members is returned with
+ * the value 0.
+ *
+ */
+H5_DLL herr_t H5Inmembers(H5I_type_t type, hsize_t *num_members);
+/**
+ * \ingroup H5I
+ *
+ * \brief Determines whether an identifier type is registered
+ *
+ * \param[in] type Identifier type
+ *
+ * \return \htri_t
+ *
+ * \details H5Itype_exists() determines whether the given identifier type,
+ * \p type, is registered with the library.
+ *
+ * \since 1.8.0
+ *
+ */
+H5_DLL htri_t H5Itype_exists(H5I_type_t type);
+/**
+ * \ingroup H5I
+ *
+ * \brief Determines whether an identifier is valid
+ *
+ * \obj_id{id}
+ *
+ * \return \htri_t
+ *
+ * \details H5Iis_valid() determines whether the identifier \p id is valid.
+ *
+ * \details Valid identifiers are those that have been obtained by an
+ * application and can still be used to access the original target.
+ * Examples of invalid identifiers include:
+ * \li Out of range values: negative, for example
+ * \li Previously-valid identifiers that have been released:
+ * for example, a dataset identifier for which the dataset has
+ * been closed
+ *
+ * H5Iis_valid() can be used with any type of identifier: object
+ * identifier, property list identifier, attribute identifier, error
+ * message identifier, etc. When necessary, a call to H5Iget_type()
+ * can determine the type of the object that \p id identifies.
+ *
+ * \since 1.8.3
+ *
+ */
+H5_DLL htri_t H5Iis_valid(hid_t id);
#ifdef __cplusplus
}
diff --git a/src/H5Itest.c b/src/H5Itest.c
index 6f2c03a..71ef3f8 100644
--- a/src/H5Itest.c
+++ b/src/H5Itest.c
@@ -82,25 +82,25 @@ H5I__get_name_test(hid_t id, char *name /*out*/, size_t size, hbool_t *cached)
/* Get the object pointer */
if (NULL == (vol_obj = H5VL_vol_object(id)))
- HGOTO_ERROR(H5E_ATOM, H5E_BADTYPE, (-1), "invalid identifier")
+ HGOTO_ERROR(H5E_ID, H5E_BADTYPE, (-1), "invalid identifier")
/* Set wrapper info in API context */
if (H5VL_set_vol_wrapper(vol_obj) < 0)
- HGOTO_ERROR(H5E_ATOM, H5E_CANTSET, FAIL, "can't set VOL wrapper info")
+ HGOTO_ERROR(H5E_ID, H5E_CANTSET, FAIL, "can't set VOL wrapper info")
vol_wrapper_set = TRUE;
/* Get object location */
if (H5G_loc(id, &loc) < 0)
- HGOTO_ERROR(H5E_ATOM, H5E_CANTGET, (-1), "can't retrieve object location")
+ HGOTO_ERROR(H5E_ID, H5E_CANTGET, (-1), "can't retrieve object location")
/* Call internal group routine to retrieve object's name */
if ((ret_value = H5G_get_name(&loc, name, size, cached)) < 0)
- HGOTO_ERROR(H5E_ATOM, H5E_CANTGET, (-1), "can't retrieve object name")
+ HGOTO_ERROR(H5E_ID, H5E_CANTGET, (-1), "can't retrieve object name")
done:
/* Reset object wrapping info in API context */
if (vol_wrapper_set && H5VL_reset_vol_wrapper() < 0)
- HDONE_ERROR(H5E_ATOM, H5E_CANTRESET, FAIL, "can't reset VOL wrapper info")
+ HDONE_ERROR(H5E_ID, H5E_CANTRESET, FAIL, "can't reset VOL wrapper info")
if (api_ctx_pushed && H5CX_pop(FALSE) < 0)
HDONE_ERROR(H5E_SYM, H5E_CANTRESET, (-1), "can't reset API context")
diff --git a/src/H5Lexternal.c b/src/H5Lexternal.c
index 9cc8ffa..c1bd83f 100644
--- a/src/H5Lexternal.c
+++ b/src/H5Lexternal.c
@@ -147,7 +147,7 @@ H5L__extern_traverse(const char H5_ATTR_UNUSED *link_name, hid_t cur_group, cons
/* Get the plist structure */
if (NULL == (plist = H5P_object_verify(lapl_id, H5P_LINK_ACCESS)))
- HGOTO_ERROR(H5E_ATOM, H5E_BADATOM, H5I_INVALID_HID, "can't find object for ID")
+ HGOTO_ERROR(H5E_ID, H5E_BADID, H5I_INVALID_HID, "can't find object for ID")
/* Get the fapl_id set for lapl_id if any */
if (H5P_get(plist, H5L_ACS_ELINK_FAPL_NAME, &fapl_id) < 0)
@@ -175,7 +175,7 @@ H5L__extern_traverse(const char H5_ATTR_UNUSED *link_name, hid_t cur_group, cons
/* Get file access property list */
if (NULL == (fa_plist = H5P_object_verify(fapl_id, H5P_FILE_ACCESS)))
- HGOTO_ERROR(H5E_ATOM, H5E_BADATOM, H5I_INVALID_HID, "can't find object for ID")
+ HGOTO_ERROR(H5E_ID, H5E_BADID, H5I_INVALID_HID, "can't find object for ID")
/* Make callback if it exists */
if (cb_info.func) {
@@ -239,7 +239,7 @@ H5L__extern_traverse(const char H5_ATTR_UNUSED *link_name, hid_t cur_group, cons
/* Get an ID for the external link's object */
if ((ext_obj_id = H5VL_wrap_register(opened_type, ext_obj, TRUE)) < 0)
- HGOTO_ERROR(H5E_ATOM, H5E_CANTREGISTER, H5I_INVALID_HID, "unable to register external link object")
+ HGOTO_ERROR(H5E_ID, H5E_CANTREGISTER, H5I_INVALID_HID, "unable to register external link object")
/* Set return value */
ret_value = ext_obj_id;
@@ -248,8 +248,8 @@ done:
/* XXX (VOL MERGE): Probably also want to consider closing ext_obj here on failures */
/* Release resources */
if (fapl_id > 0 && H5I_dec_ref(fapl_id) < 0)
- HDONE_ERROR(H5E_ATOM, H5E_CANTRELEASE, H5I_INVALID_HID,
- "unable to close atom for file access property list")
+ HDONE_ERROR(H5E_ID, H5E_CANTRELEASE, H5I_INVALID_HID,
+ "unable to close ID for file access property list")
if (ext_file && H5F_efc_close(loc.oloc->file, ext_file) < 0)
HDONE_ERROR(H5E_LINK, H5E_CANTCLOSEFILE, H5I_INVALID_HID, "problem closing external file")
if (parent_group_name && parent_group_name != local_group_name)
@@ -257,8 +257,7 @@ done:
if (ret_value < 0) {
/* Close object if it's open and something failed */
if (ext_obj_id >= 0 && H5I_dec_ref(ext_obj_id) < 0)
- HDONE_ERROR(H5E_ATOM, H5E_CANTRELEASE, H5I_INVALID_HID,
- "unable to close atom for external object")
+ HDONE_ERROR(H5E_ID, H5E_CANTRELEASE, H5I_INVALID_HID, "unable to close ID for external object")
} /* end if */
FUNC_LEAVE_NOAPI(ret_value)
@@ -288,7 +287,7 @@ H5L__extern_query(const char H5_ATTR_UNUSED *link_name, const void *_udata, size
const uint8_t *udata = (const uint8_t *)_udata; /* Pointer to external link buffer */
ssize_t ret_value = SUCCEED; /* Return value */
- FUNC_ENTER_NOAPI_NOINIT
+ FUNC_ENTER_STATIC
/* Check external link version & flags */
if (((*udata >> 4) & 0x0F) != H5L_EXT_VERSION)
diff --git a/src/H5Lmodule.h b/src/H5Lmodule.h
index 54b94a4..16f1f34 100644
--- a/src/H5Lmodule.h
+++ b/src/H5Lmodule.h
@@ -35,6 +35,8 @@
*
* \defgroup TRAV Link Traversal
* \ingroup H5L
+ * \defgroup H5LA Advanced Link Functions
+ * \ingroup H5L
*/
#endif /* H5Lmodule_H */
diff --git a/src/H5M.c b/src/H5M.c
index dc85812..24f3a9a 100644
--- a/src/H5M.c
+++ b/src/H5M.c
@@ -108,7 +108,7 @@ H5M__init_package(void)
FUNC_ENTER_PACKAGE
- /* Initialize the atom group for the map IDs */
+ /* Initialize the ID group for the map IDs */
if (H5I_register_type(H5I_MAP_CLS) < 0)
HGOTO_ERROR(H5E_MAP, H5E_CANTINIT, FAIL, "unable to initialize interface")
@@ -354,7 +354,7 @@ H5Mcreate_anon(hid_t loc_id, hid_t key_type_id, hid_t val_type_id, hid_t mcpl_id
H5P_LINK_CREATE_DEFAULT, key_type_id, val_type_id, mcpl_id, mapl_id, &map) < 0)
HGOTO_ERROR(H5E_MAP, H5E_CANTINIT, H5I_INVALID_HID, "unable to create map")
- /* Get an atom for the map */
+ /* Get an ID for the map */
if ((ret_value = H5VL_register(H5I_MAP, map, vol_obj->connector, TRUE)) < 0)
HGOTO_ERROR(H5E_MAP, H5E_CANTREGISTER, H5I_INVALID_HID, "unable to register map")
diff --git a/src/H5MFdbg.c b/src/H5MFdbg.c
index bede18c..7b89fd8 100644
--- a/src/H5MFdbg.c
+++ b/src/H5MFdbg.c
@@ -15,7 +15,7 @@
*
* Created: H5MFdbg.c
* Jan 31 2008
- * Quincey Koziol <koziol@hdfgroup.org>
+ * Quincey Koziol
*
* Purpose: File memory management debugging functions.
*
@@ -84,7 +84,6 @@ static herr_t H5MF__sects_debug_cb(H5FS_section_info_t *_sect, void *_udata);
* Return: Non-negative on success/Negative on failure
*
* Programmer: Quincey Koziol
- * koziol@hdfgroup.org
* January 31 2008
*
*-------------------------------------------------------------------------
@@ -111,11 +110,11 @@ H5MF__sects_debug_cb(H5FS_section_info_t *_sect, void *_udata)
: (sect->sect_info.type == H5MF_FSPACE_SECT_SMALL
? "small"
: (sect->sect_info.type == H5MF_FSPACE_SECT_LARGE ? "large" : "unknown"))));
- HDfprintf(udata->stream, "%*s%-*s %a\n", udata->indent, "", udata->fwidth,
+ HDfprintf(udata->stream, "%*s%-*s %" PRIuHADDR "\n", udata->indent, "", udata->fwidth,
"Section address:", sect->sect_info.addr);
- HDfprintf(udata->stream, "%*s%-*s %Hu\n", udata->indent, "", udata->fwidth,
+ HDfprintf(udata->stream, "%*s%-*s %" PRIuHSIZE "\n", udata->indent, "", udata->fwidth,
"Section size:", sect->sect_info.size);
- HDfprintf(udata->stream, "%*s%-*s %Hu\n", udata->indent, "", udata->fwidth,
+ HDfprintf(udata->stream, "%*s%-*s %" PRIuHADDR "\n", udata->indent, "", udata->fwidth,
"End of section:", (haddr_t)((sect->sect_info.addr + sect->sect_info.size) - 1));
HDfprintf(udata->stream, "%*s%-*s %s\n", udata->indent, "", udata->fwidth,
"Section state:", (sect->sect_info.state == H5FS_SECT_LIVE ? "live" : "serialized"));
@@ -137,7 +136,6 @@ done:
* Return: Non-negative on success/Negative on failure
*
* Programmer: Quincey Koziol
- * koziol@hdfgroup.org
* January 31 2008
*
*-------------------------------------------------------------------------
@@ -198,7 +196,6 @@ done:
* Return: Non-negative on success/Negative on failure
*
* Programmer: Quincey Koziol
- * koziol@hdfgroup.org
* Jan 31 2008
*
*-------------------------------------------------------------------------
@@ -226,7 +223,7 @@ H5MF__sects_dump(H5F_t *f, FILE *stream)
if (HADDR_UNDEF == (eoa = H5F_get_eoa(f, H5FD_MEM_DEFAULT)))
HGOTO_ERROR(H5E_RESOURCE, H5E_CANTGET, FAIL, "driver get_eoa request failed")
#ifdef H5MF_ALLOC_DEBUG
- HDfprintf(stderr, "%s: for type = H5FD_MEM_DEFAULT, eoa = %a\n", FUNC, eoa);
+ HDfprintf(stderr, "%s: for type = H5FD_MEM_DEFAULT, eoa = %" PRIuHADDR "\n", FUNC, eoa);
#endif /* H5MF_ALLOC_DEBUG */
if (H5F_PAGED_AGGR(f)) { /* File space paging */
@@ -268,15 +265,17 @@ H5MF__sects_dump(H5F_t *f, FILE *stream)
/* Retrieve metadata aggregator info, if available */
H5MF__aggr_query(f, &(f->shared->meta_aggr), &ma_addr, &ma_size);
#ifdef H5MF_ALLOC_DEBUG
- HDfprintf(stderr, "%s: ma_addr = %a, ma_size = %Hu, end of ma = %a\n", FUNC, ma_addr, ma_size,
- (haddr_t)((ma_addr + ma_size) - 1));
+ HDfprintf(stderr,
+ "%s: ma_addr = %" PRIuHADDR ", ma_size = %" PRIuHSIZE ", end of ma = %" PRIuHADDR "\n",
+ FUNC, ma_addr, ma_size, (haddr_t)((ma_addr + ma_size) - 1));
#endif /* H5MF_ALLOC_DEBUG */
/* Retrieve 'small data' aggregator info, if available */
H5MF__aggr_query(f, &(f->shared->sdata_aggr), &sda_addr, &sda_size);
#ifdef H5MF_ALLOC_DEBUG
- HDfprintf(stderr, "%s: sda_addr = %a, sda_size = %Hu, end of sda = %a\n", FUNC, sda_addr, sda_size,
- (haddr_t)((sda_addr + sda_size) - 1));
+ HDfprintf(stderr,
+ "%s: sda_addr = %" PRIuHADDR ", sda_size = %" PRIuHSIZE ", end of sda = %" PRIuHADDR "\n",
+ FUNC, sda_addr, sda_size, (haddr_t)((sda_addr + sda_size) - 1));
#endif /* H5MF_ALLOC_DEBUG */
/* Iterate over all the free space types that have managers and dump each free list's space */
@@ -289,7 +288,8 @@ H5MF__sects_dump(H5F_t *f, FILE *stream)
/* Retrieve the 'eoa' for this file memory type */
if (HADDR_UNDEF == (eoa = H5F_get_eoa(f, atype)))
HGOTO_ERROR(H5E_RESOURCE, H5E_CANTGET, FAIL, "driver get_eoa request failed")
- HDfprintf(stream, "%*s%-*s %a\n", indent + 3, "", MAX(0, fwidth - 3), "eoa:", eoa);
+ HDfprintf(stream, "%*s%-*s %" PRIuHADDR "\n", indent + 3, "", MAX(0, fwidth - 3),
+ "eoa:", eoa);
/* Print header for sections */
HDfprintf(stream, "%*sSections:\n", indent + 3, "");
diff --git a/src/H5MM.c b/src/H5MM.c
index 313f900..b4447f6 100644
--- a/src/H5MM.c
+++ b/src/H5MM.c
@@ -15,7 +15,7 @@
*
* Created: H5MM.c
* Jul 10 1997
- * Robb Matzke <matzke@llnl.gov>
+ * Robb Matzke
*
* Purpose: Memory management functions
*
@@ -449,11 +449,17 @@ H5MM_xstrdup(const char *s)
FUNC_ENTER_NOAPI(NULL)
+#if defined H5_MEMORY_ALLOC_SANITY_CHECK
if (s) {
if (NULL == (ret_value = (char *)H5MM_malloc(HDstrlen(s) + 1)))
HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "memory allocation failed")
HDstrcpy(ret_value, s);
- } /* end if */
+ }
+#else
+ if (s)
+ if (NULL == (ret_value = HDstrdup(s)))
+ HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "string duplication failed")
+#endif
done:
FUNC_LEAVE_NOAPI(ret_value)
@@ -483,10 +489,15 @@ H5MM_strdup(const char *s)
FUNC_ENTER_NOAPI(NULL)
if (!s)
- HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, NULL, "null string")
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, NULL, "NULL string not allowed")
+#if defined H5_MEMORY_ALLOC_SANITY_CHECK
if (NULL == (ret_value = (char *)H5MM_malloc(HDstrlen(s) + 1)))
HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "memory allocation failed")
HDstrcpy(ret_value, s);
+#else
+ if (NULL == (ret_value = HDstrdup(s)))
+ HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "string duplication failed")
+#endif
done:
FUNC_LEAVE_NOAPI(ret_value)
diff --git a/src/H5MMpublic.h b/src/H5MMpublic.h
index ebfb377..70ac644 100644
--- a/src/H5MMpublic.h
+++ b/src/H5MMpublic.h
@@ -29,8 +29,13 @@
#include "H5public.h"
/* These typedefs are currently used for VL datatype allocation/freeing */
+//! <!-- [H5MM_allocate_t_snip] -->
typedef void *(*H5MM_allocate_t)(size_t size, void *alloc_info);
+//! <!-- [H5MM_allocate_t_snip] -->
+
+//! <!-- [H5MM_free_t_snip] -->
typedef void (*H5MM_free_t)(void *mem, void *free_info);
+//! <!-- [H5MM_free_t_snip] -->
#ifdef __cplusplus
extern "C" {
diff --git a/src/H5MP.c b/src/H5MP.c
index 1ce4c6d..474a995 100644
--- a/src/H5MP.c
+++ b/src/H5MP.c
@@ -15,7 +15,7 @@
*
* Created: H5MP.c
* May 2 2005
- * Quincey Koziol <koziol@ncsa.uiuc.edu>
+ * Quincey Koziol
*
* Purpose: Implements memory pools. (Similar to Apache's APR
* memory pools)
@@ -76,7 +76,6 @@ H5FL_DEFINE(H5MP_pool_t);
* Return: Pointer to the memory pool "header" on success/NULL on failure
*
* Programmer: Quincey Koziol
- * koziol@ncsa.uiuc.edu
* May 2 2005
*
*-------------------------------------------------------------------------
@@ -118,26 +117,25 @@ done:
} /* end H5MP_create() */
/*-------------------------------------------------------------------------
- * Function: H5MP_new_page
+ * Function: H5MP__new_page
*
* Purpose: Allocate new page for a memory pool
*
* Return: Pointer to the page allocated on success/NULL on failure
*
* Programmer: Quincey Koziol
- * koziol@ncsa.uiuc.edu
* May 4 2005
*
*-------------------------------------------------------------------------
*/
static H5MP_page_t *
-H5MP_new_page(H5MP_pool_t *mp, size_t page_size)
+H5MP__new_page(H5MP_pool_t *mp, size_t page_size)
{
H5MP_page_t * new_page; /* New page created */
H5MP_page_blk_t *first_blk; /* Pointer to first block in page */
H5MP_page_t * ret_value = NULL; /* Return value */
- FUNC_ENTER_NOAPI_NOINIT
+ FUNC_ENTER_STATIC
/* Sanity check */
HDassert(mp);
@@ -156,9 +154,6 @@ H5MP_new_page(H5MP_pool_t *mp, size_t page_size)
new_page->free_size = mp->max_size;
new_page->fac_alloc = TRUE;
} /* end else */
-#ifdef QAK
- HDfprintf(stderr, "%s: Allocating new page = %p\n", FUNC, new_page);
-#endif /* QAK */
/* Initialize page information */
first_blk = H5MP_PAGE_FIRST_BLOCK(new_page);
@@ -184,7 +179,7 @@ H5MP_new_page(H5MP_pool_t *mp, size_t page_size)
done:
FUNC_LEAVE_NOAPI(ret_value)
-} /* end H5MP_new_page() */
+} /* end H5MP__new_page() */
/*-------------------------------------------------------------------------
* Function: H5MP_malloc
@@ -194,7 +189,6 @@ done:
* Return: Pointer to the space allocated on success/NULL on failure
*
* Programmer: Quincey Koziol
- * koziol@ncsa.uiuc.edu
* May 2 2005
*
*-------------------------------------------------------------------------
@@ -215,10 +209,6 @@ H5MP_malloc(H5MP_pool_t *mp, size_t request)
/* Compute actual size needed */
needed = H5MP_BLOCK_ALIGN(request) + H5MP_BLOCK_ALIGN(sizeof(H5MP_page_blk_t));
-#ifdef QAK
- HDfprintf(stderr, "%s: sizeof(H5MP_page_blk_t) = %Zu\n", FUNC, sizeof(H5MP_page_blk_t));
- HDfprintf(stderr, "%s: request = %Zu, needed = %Zu\n", FUNC, request, needed);
-#endif /* QAK */
/* See if the request can be handled by existing free space */
if (needed <= mp->free_size) {
@@ -267,7 +257,7 @@ H5MP_malloc(H5MP_pool_t *mp, size_t request)
(needed > mp->max_size) ? (needed + H5MP_BLOCK_ALIGN(sizeof(H5MP_page_t))) : mp->page_size;
/* Allocate new page */
- if (NULL == (alloc_page = H5MP_new_page(mp, page_size)))
+ if (NULL == (alloc_page = H5MP__new_page(mp, page_size)))
HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "memory allocation failed for page")
/* Set the block to allocate from */
@@ -315,9 +305,6 @@ found:
/* Set new space pointer for the return value */
ret_value = ((unsigned char *)alloc_free) + H5MP_BLOCK_ALIGN(sizeof(H5MP_page_blk_t));
-#ifdef QAK
- HDfprintf(stderr, "%s: Allocating space from page, ret_value = %p\n", FUNC, ret_value);
-#endif /* QAK */
done:
FUNC_LEAVE_NOAPI(ret_value)
@@ -331,7 +318,6 @@ done:
* Return: NULL on success/NULL on failure
*
* Programmer: Quincey Koziol
- * koziol@ncsa.uiuc.edu
* May 3 2005
*
* Note: Should we release pages that have no used blocks?
@@ -361,9 +347,6 @@ H5MP_free(H5MP_pool_t *mp, void *spc)
/* Add it's space to the amount of free space in the page & pool */
spc_page = spc_blk->page;
-#ifdef QAK
- HDfprintf(stderr, "%s: Freeing from page = %p\n", "H5MP_free", spc_page);
-#endif /* QAK */
spc_page->free_size += spc_blk->size;
mp->free_size += spc_blk->size;
@@ -420,7 +403,6 @@ H5MP_free(H5MP_pool_t *mp, void *spc)
* Return: Non-negative on success/negative on failure
*
* Programmer: Quincey Koziol
- * koziol@ncsa.uiuc.edu
* May 3 2005
*
*-------------------------------------------------------------------------
diff --git a/src/H5MPtest.c b/src/H5MPtest.c
index df1c153..27e7bbe 100644
--- a/src/H5MPtest.c
+++ b/src/H5MPtest.c
@@ -11,7 +11,7 @@
* help@hdfgroup.org. *
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
-/* Programmer: Quincey Koziol <koziol@ncsa.uiuc.edu>
+/* Programmer: Quincey Koziol
* Tuesday, May 3, 2005
*
* Purpose: Memory pool testing functions.
@@ -41,8 +41,6 @@
* Programmer: Quincey Koziol
* Tuesday, May 3, 2005
*
- * Modifications:
- *
*-------------------------------------------------------------------------
*/
herr_t
@@ -72,8 +70,6 @@ H5MP_get_pool_free_size(const H5MP_pool_t *mp, size_t *free_size)
* Programmer: Quincey Koziol
* Tuesday, May 3, 2005
*
- * Modifications:
- *
*-------------------------------------------------------------------------
*/
herr_t
@@ -106,8 +102,6 @@ H5MP_get_pool_first_page(const H5MP_pool_t *mp, H5MP_page_t **page)
* Programmer: Quincey Koziol
* Wednesday, May 3, 2005
*
- * Modifications:
- *
*-------------------------------------------------------------------------
*/
htri_t
@@ -141,10 +135,6 @@ H5MP_pool_is_free_size_correct(const H5MP_pool_t *mp)
/* Check that the free space from the blocks on the free list
* corresponds to space in page */
-#ifdef QAK
- HDfprintf(stderr, "%s: page_free = %Zu, page->free_size = %Zu\n", "H5MP_pool_is_free_size_correct",
- page_free, page->free_size);
-#endif /* QAK */
if (page_free != page->free_size)
HGOTO_DONE(FALSE)
@@ -157,10 +147,6 @@ H5MP_pool_is_free_size_correct(const H5MP_pool_t *mp)
/* Check that the free space from the pages
* corresponds to free space in pool */
-#ifdef QAK
- HDfprintf(stderr, "%s: pool_free = %Zu, mp->free_size = %Zu\n", "H5MP_pool_is_free_size_correct",
- pool_free, mp->free_size);
-#endif /* QAK */
if (pool_free != mp->free_size)
HGOTO_DONE(FALSE)
@@ -180,8 +166,6 @@ done:
* Programmer: Quincey Koziol
* Tuesday, May 3, 2005
*
- * Modifications:
- *
*-------------------------------------------------------------------------
*/
herr_t
@@ -211,8 +195,6 @@ H5MP_get_page_free_size(const H5MP_page_t *page, size_t *free_size)
* Programmer: Quincey Koziol
* Tuesday, May 3, 2005
*
- * Modifications:
- *
*-------------------------------------------------------------------------
*/
herr_t
diff --git a/src/H5Mmodule.h b/src/H5Mmodule.h
index 8b4f11f..3dae3e2 100644
--- a/src/H5Mmodule.h
+++ b/src/H5Mmodule.h
@@ -26,4 +26,49 @@
#define H5_MY_PKG_ERR H5E_MAP
#define H5_MY_PKG_INIT YES
+/**
+ * \defgroup H5M H5M
+ * \brief Map Interface
+ *
+ * \details \Bold{The interface can only be used with the HDF5 VOL connectors that
+ * implement map objects.} The native HDF5 library does not support this
+ * feature.
+ *
+ * While the HDF5 data model is a flexible way to store data, some
+ * applications require a more general way to index information. HDF5
+ * effectively uses key-value stores internally for a variety of
+ * purposes, but it does not expose a generic key-value store to the
+ * API. The Map APIs provide this capability to the HDF5 applications
+ * in the form of HDF5 map objects. These Map objects contain
+ * application-defined key-value stores, to which key-value pairs can
+ * be added, and from which values can be retrieved by key.
+ *
+ * HDF5 VOL connectors with support for map objects:
+ * - DAOS
+ *
+ * \par Example:
+ * \code
+ * hid_t file_id, fapl_id, map_id, vls_type_id;
+ * const char *names[2] = ["Alice", "Bob"];
+ * uint64_t IDs[2] = [25385486, 34873275];
+ * uint64_t val_out;
+ *
+ * <HDF5 VOL setup code ....>
+ *
+ * vls_type_id = H5Tcopy(H5T_C_S1);
+ * H5Tset_size(vls_type_id, H5T_VARIABLE);
+ * file_id = H5Fcreate("file.h5", H5F_ACC_TRUNC, H5P_DEFAULT, fapl_id);
+ * map_id = H5Mcreate(file_id, "map", vls_type_id, H5T_NATIVE_UINT64, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
+ * H5Mput(map_id, vls_type_id, &names[0], H5T_NATIVE_UINT64, &IDs[0], H5P_DEFAULT);
+ * H5Mput(map_id, vls_type_id, &names[1], H5T_NATIVE_UINT64, &IDs[1], H5P_DEFAULT);
+ * H5Mget(map_id, vls_type_id, &names[0], H5T_NATIVE_UINT64, &val_out, H5P_DEFAULT);
+ * if(val_out != IDs[0])
+ * ERROR;
+ * H5Mclose(map_id);
+ * H5Tclose(vls_type_id);
+ * H5Fclose(file_id);
+ * \endcode
+ *
+ */
+
#endif /* H5Dmodule_H */
diff --git a/src/H5Mpublic.h b/src/H5Mpublic.h
index 004ff05..88db39a 100644
--- a/src/H5Mpublic.h
+++ b/src/H5Mpublic.h
@@ -61,8 +61,12 @@ typedef enum H5VL_map_specific_t {
H5VL_MAP_DELETE /* H5Mdelete */
} H5VL_map_specific_t;
-/* Callback for H5Miterate() */
+//! <!-- [H5M_iterate_t_snip] -->
+/**
+ * Callback for H5Miterate()
+ */
typedef herr_t (*H5M_iterate_t)(hid_t map_id, const void *key, void *op_data);
+//! <!-- [H5M_iterate_t_snip] -->
/********************/
/* Public Variables */
@@ -81,25 +85,374 @@ extern "C" {
*/
#ifdef H5_HAVE_MAP_API
+/**
+ * \ingroup H5M
+ *
+ * \brief Creates a map object
+ *
+ * \fgdta_loc_id
+ * \param[in] name Map object name
+ * \type_id{key_type_id}
+ * \type_id{val_type_id}
+ * \lcpl_id
+ * \mcpl_id
+ * \mapl_id
+ * \returns \hid_t{map object}
+ *
+ * \details H5Mcreate() creates a new map object for storing key-value
+ * pairs. The in-file datatype for keys is defined by \p key_type_id
+ * and the in-file datatype for values is defined by \p val_type_id. \p
+ * loc_id specifies the location to create the the map object and \p
+ * name specifies the name of the link to the map object relative to
+ * \p loc_id.
+ *
+ * \since 1.12.0
+ *
+ */
H5_DLL hid_t H5Mcreate(hid_t loc_id, const char *name, hid_t key_type_id, hid_t val_type_id, hid_t lcpl_id,
hid_t mcpl_id, hid_t mapl_id);
+/**
+ * --------------------------------------------------------------------------
+ * \ingroup ASYNC
+ * \async_variant_of{H5Mcreate}
+ */
+H5_DLL hid_t H5Mcreate_async(const char *app_file, const char *app_func, unsigned app_line, hid_t loc_id,
+ const char *name, hid_t key_type_id, hid_t val_type_id, hid_t lcpl_id,
+ hid_t mcpl_id, hid_t mapl_id, hid_t es_id);
+
+/**
+ * \ingroup H5M
+ *
+ * \brief
+ *
+ * \details
+ *
+ * \since 1.12.0
+ *
+ */
H5_DLL hid_t H5Mcreate_anon(hid_t loc_id, hid_t key_type_id, hid_t val_type_id, hid_t mcpl_id, hid_t mapl_id);
+
+/**
+ * \ingroup H5M
+ *
+ * \brief Opens a map object
+ *
+ * \fgdta_loc_id{loc_id}
+ * \param[in] name Map object name relative to \p loc_id
+ * \mapl_id
+ * \returns \hid_t{map object}
+ *
+ * \details H5Mopen() finds a map object specified by \p name under the location
+ * specified by \p loc_id. The map object should be close with
+ * H5Mclose() when the application is not longer interested in
+ * accessing it.
+ *
+ * \since 1.12.0
+ *
+ */
H5_DLL hid_t H5Mopen(hid_t loc_id, const char *name, hid_t mapl_id);
+/**
+ * --------------------------------------------------------------------------
+ * \ingroup ASYNC
+ * \async_variant_of{H5Mopen}
+ */
+H5_DLL hid_t H5Mopen_async(const char *app_file, const char *app_func, unsigned app_line, hid_t loc_id,
+ const char *name, hid_t mapl_id, hid_t es_id);
+
+/**
+ * \ingroup H5M
+ *
+ * \brief Terminates access to a map object
+ *
+ * \map_id
+ * \returns \herr_t
+ *
+ * \details H5Mclose() closes access to a map object specified by \p map_id and
+ * releases resources used by it.
+ *
+ * It is illegal to subsequently use that same map identifier in calls
+ * to other map functions.
+ *
+ * \since 1.12.0
+ *
+ */
H5_DLL herr_t H5Mclose(hid_t map_id);
-H5_DLL hid_t H5Mget_key_type(hid_t map_id);
-H5_DLL hid_t H5Mget_val_type(hid_t map_id);
-H5_DLL hid_t H5Mget_create_plist(hid_t map_id);
-H5_DLL hid_t H5Mget_access_plist(hid_t map_id);
+
+/**
+ * \ingroup H5M
+ *
+ * \brief Gets key datatype for a map object
+ *
+ * \map_id
+ * \returns \hid_t{datatype}
+ *
+ * \details H5Mget_key_type() retrieves key datatype as stored in the file for a
+ * map object specified by \p map_id and returns identifier for the
+ * datatype.
+ *
+ * \since 1.12.0
+ *
+ */
+H5_DLL hid_t H5Mget_key_type(hid_t map_id);
+
+/**
+ * \ingroup H5M
+ *
+ * \brief Gets value datatype for a map object
+ *
+ * \map_id
+ * \returns \hid_t{datatype}
+ *
+ * \details H5Mget_val_type() retrieves value datatype as stored in the file for
+ * a map object specified by \p map_id and returns identifier for the
+ * datatype .
+ *
+ * \since 1.12.0
+ *
+ */
+H5_DLL hid_t H5Mget_val_type(hid_t map_id);
+
+/**
+ * \ingroup H5M
+ *
+ * \brief Gets creation property list for a map object
+ *
+ * \map_id
+ * \returns \hid_t{map creation property list}
+ *
+ * \details H5Mget_create_plist() returns an identifier for a copy of the
+ * creation property list for a map object specified by \p map_id.
+ *
+ * \since 1.12.0
+ *
+ */
+H5_DLL hid_t H5Mget_create_plist(hid_t map_id);
+
+/**
+ * \ingroup H5M
+ *
+ * \brief Gets access property list for a map object
+ *
+ * \map_id
+ * \returns \hid_t{map access property list}
+ *
+ * \details H5Mget_access_plist() returns an identifier for a copy of the access
+ * property list for a map object specified by \p map_id.
+ *
+ * \since 1.12.0
+ *
+ */
+H5_DLL hid_t H5Mget_access_plist(hid_t map_id);
+
+/**
+ * \ingroup H5M
+ *
+ * \brief Retrieves the number of key-value pairs in a map object
+ *
+ * \map_id
+ * \param[out] count The number of key-value pairs stored in the map object
+ * \dxpl_id
+ * \returns \herr_t
+ *
+ * \details H5Mget_count() retrieves the number of key-value pairs stored in a
+ * map specified by map_id.
+ *
+ * \since 1.12.0
+ *
+ */
H5_DLL herr_t H5Mget_count(hid_t map_id, hsize_t *count, hid_t dxpl_id);
+
+/**
+ * \ingroup H5M
+ *
+ * \brief Adds a key-value pair to a map object
+ *
+ * \map_id
+ * \type_id{key_mem_type_id}
+ * \param[in] key Pointer to key buffer
+ * \type_id{val_mem_type_id}
+ * \param[in] value Pointer to value buffer
+ * \dxpl_id
+ * \returns \herr_t
+ *
+ * \details H5Mput() adds a key-value pair to a map object specified by \p
+ * map_id, or updates the value for the specified key if one was set
+ * previously.
+ *
+ * \p key_mem_type_id and \p val_mem_type_id specify the datatypes for
+ * the provided key and value buffers, and if different from those used
+ * to create the map object, the key and value will be internally
+ * converted to the datatypes for the map object.
+ *
+ * Any further options can be specified through the property list
+ * \p dxpl_id.
+ *
+ * \since 1.12.0
+ *
+ */
H5_DLL herr_t H5Mput(hid_t map_id, hid_t key_mem_type_id, const void *key, hid_t val_mem_type_id,
const void *value, hid_t dxpl_id);
+
+/**
+ * \ingroup H5M
+ *
+ * \brief Retrieves a key-value pair from a map object
+ *
+ * \map_id
+ * \type_id{key_mem_type_id}
+ * \param[in] key Pointer to key buffer
+ * \type_id{val_mem_type_id}
+ * \param[out] value Pointer to value buffer
+ * \dxpl_id
+ * \returns \herr_t
+ *
+ * \details H5Mget() retrieves from a map object specified by \p map_id, the
+ * value associated with the provided key \p key. \p key_mem_type_id
+ * and \p val_mem_type_id specify the datatypes for the provided key
+ * and value buffers. If if the datatype specified by \p
+ * key_mem_type_id is different from that used to create the map object
+ * the key will be internally converted to the datatype for the map
+ * object for the query, and if the datatype specified by \p
+ * val_mem_type_id is different from that used to create the map object
+ * the returned value will be converted to have a datatype as specified
+ * by \p val_mem_type_id before the function returns.
+ *
+ * Any further options can be specified through the property list
+ * \p dxpl_id.
+ *
+ * \since 1.12.0
+ *
+ */
H5_DLL herr_t H5Mget(hid_t map_id, hid_t key_mem_type_id, const void *key, hid_t val_mem_type_id, void *value,
hid_t dxpl_id);
+
+/**
+ * \ingroup H5M
+ *
+ * \brief Checks if provided key exists in a map object
+ *
+ * \map_id
+ * \type_id{key_mem_type_id}
+ * \param[in] key Pointer to key buffer
+ * \param[out] exists Pointer to a buffer to return the existence status
+ * \dxpl_id
+ * \returns \herr_t
+ *
+ * \details H5Mexists() checks if the provided key is stored in the map object
+ * specified by \p map_id. If \p key_mem_type_id is different from that
+ * used to create the map object the key will be internally converted
+ * to the datatype for the map object for the query.
+ *
+ * Any further options can be specified through the property list
+ * \p dxpl_id.
+ *
+ * \since 1.12.0
+ *
+ */
H5_DLL herr_t H5Mexists(hid_t map_id, hid_t key_mem_type_id, const void *key, hbool_t *exists, hid_t dxpl_id);
+
+/**
+ * \ingroup H5M
+ *
+ * \brief Iterates over all key-value pairs in a map object
+ *
+ * \map_id
+ * \param[in,out] idx iteration index
+ * \type_id{key_mem_type_id}
+ * \param[in] op User-defined iterator function
+ * \op_data
+ * \dxpl_id
+ * \returns \herr_t
+ *
+ * \details H5Miterate() iterates over all key-value pairs stored in the map
+ * object specified by \p map_id, making the callback specified by \p
+ * op for each. The \p idx parameter is an in/out parameter that may be
+ * used to restart a previously interrupted iteration. At the start of
+ * iteration \p idx should be set to 0, and to restart iteration at the
+ * same location on a subsequent call to H5Miterate(), \p idx should be
+ * the same value as returned by the previous call. Iterate callback is
+ * defined as:
+ * \snippet this H5M_iterate_t_snip
+ * The \p key parameter is the buffer for the key for this iteration,
+ * converted to the datatype specified by \p key_mem_type_id. The \p
+ * op_data parameter is a simple pass through of the value passed to
+ * H5Miterate(), which can be used to store application-defined data for
+ * iteration. A negative return value from this function will cause
+ * H5Miterate() to issue an error, while a positive return value will
+ * cause H5Miterate() to stop iterating and return this value without
+ * issuing an error. A return value of zero allows iteration to continue.
+ *
+ * Any further options can be specified through the property list \p dxpl_id.
+ *
+ * \since 1.12.0
+ *
+ */
H5_DLL herr_t H5Miterate(hid_t map_id, hsize_t *idx, hid_t key_mem_type_id, H5M_iterate_t op, void *op_data,
hid_t dxpl_id);
+
+/**
+ * \ingroup H5M
+ *
+ * \brief Iterates over all key-value pairs in a map object
+ *
+ * \loc_id
+ * \param[in] map_name Map object name relative to the location specified by \p loc_id
+ * \param[in,out] idx Iteration index
+ * \type_id{key_mem_type_id}
+ * \param[in] op User-defined iterator function
+ * \op_data
+ * \dxpl_id
+ * \lapl_id
+ * \returns \herr_t
+ *
+ * \details H5Miterate_by_name() iterates over all key-value pairs stored in the
+ * map object specified by \p map_id, making the callback specified by
+ * \p op for each. The \p idx parameter is an in/out parameter that may
+ * be used to restart a previously interrupted iteration. At the start
+ * of iteration \p idx should be set to 0, and to restart iteration at
+ * the same location on a subsequent call to H5Miterate(), \p idx
+ * should be the same value as returned by the previous call. Iterate
+ * callback is defined as:
+ * \snippet this H5M_iterate_t_snip
+ * The\p key parameter is the buffer for the key for this iteration,
+ * converted to the datatype specified by \p key_mem_type_id. The \p
+ * op_data parameter is a simple pass through of the value passed to
+ * H5Miterate(), which can be used to store application-defined data
+ * for iteration. A negative return value from this function will cause
+ * H5Miterate() to issue an error, while a positive return value will cause
+ * H5Miterate() to stop iterating and return this value without issuing an
+ * error. A return value of zero allows iteration to continue.
+ *
+ * Any further options can be specified through the property list \p dxpl_id.
+ *
+ * \since 1.12.0
+ *
+ */
H5_DLL herr_t H5Miterate_by_name(hid_t loc_id, const char *map_name, hsize_t *idx, hid_t key_mem_type_id,
H5M_iterate_t op, void *op_data, hid_t dxpl_id, hid_t lapl_id);
+
+/**
+ * \ingroup H5M
+ *
+ * \brief Deletes a key-value pair from a map object
+ *
+ * \map_id
+ * \type_id{key_mem_type_id}
+ * \param[in] key Pointer to key buffer
+ * \dxpl_id
+ * \returns \herr_t
+ *
+ * \details H5Mdelete() deletes a key-value pair from the map object specified
+ * by \p map_id. \p key_mem_type_id specifies the datatype for the
+ * provided key buffer key, and if different from that used to create
+ * the map object, the key will be internally converted to the datatype
+ * for the map object.
+ *
+ * Any further options can be specified through the property list \p dxpl_id.
+ *
+ * \since 1.12.0
+ *
+ */
H5_DLL herr_t H5Mdelete(hid_t map_id, hid_t key_mem_type_id, const void *key, hid_t dxpl_id);
/* Symbols defined for compatibility with previous versions of the HDF5 API.
diff --git a/src/H5Oainfo.c b/src/H5Oainfo.c
index cc8ac46..10c9ede 100644
--- a/src/H5Oainfo.c
+++ b/src/H5Oainfo.c
@@ -15,7 +15,7 @@
*
* Created: H5Oainfo.c
* Mar 6 2007
- * Quincey Koziol <koziol@hdfgroup.org>
+ * Quincey Koziol
*
* Purpose: Attribute Information messages.
*
@@ -34,13 +34,13 @@
/* PRIVATE PROTOTYPES */
static void * H5O__ainfo_decode(H5F_t *f, H5O_t *open_oh, unsigned mesg_flags, unsigned *ioflags,
size_t p_size, const uint8_t *p);
-static herr_t H5O_ainfo_encode(H5F_t *f, hbool_t disable_shared, uint8_t *p, const void *_mesg);
-static void * H5O_ainfo_copy(const void *_mesg, void *_dest);
-static size_t H5O_ainfo_size(const H5F_t *f, hbool_t disable_shared, const void *_mesg);
+static herr_t H5O__ainfo_encode(H5F_t *f, hbool_t disable_shared, uint8_t *p, const void *_mesg);
+static void * H5O__ainfo_copy(const void *_mesg, void *_dest);
+static size_t H5O__ainfo_size(const H5F_t *f, hbool_t disable_shared, const void *_mesg);
static herr_t H5O__ainfo_free(void *_mesg);
static herr_t H5O__ainfo_delete(H5F_t *f, H5O_t *open_oh, void *_mesg);
-static herr_t H5O_ainfo_pre_copy_file(H5F_t *file_src, const void *mesg_src, hbool_t *deleted,
- const H5O_copy_t *cpy_info, void *udata);
+static herr_t H5O__ainfo_pre_copy_file(H5F_t *file_src, const void *mesg_src, hbool_t *deleted,
+ const H5O_copy_t *cpy_info, void *udata);
static void * H5O__ainfo_copy_file(H5F_t *file_src, void *mesg_src, H5F_t *file_dst, hbool_t *recompute_size,
unsigned *mesg_flags, H5O_copy_t *cpy_info, void *udata);
static herr_t H5O__ainfo_post_copy_file(const H5O_loc_t *src_oloc, const void *mesg_src, H5O_loc_t *dst_oloc,
@@ -54,16 +54,16 @@ const H5O_msg_class_t H5O_MSG_AINFO[1] = {{
sizeof(H5O_ainfo_t), /*native message size */
0, /* messages are sharable? */
H5O__ainfo_decode, /*decode message */
- H5O_ainfo_encode, /*encode message */
- H5O_ainfo_copy, /*copy the native value */
- H5O_ainfo_size, /*size of symbol table entry */
+ H5O__ainfo_encode, /*encode message */
+ H5O__ainfo_copy, /*copy the native value */
+ H5O__ainfo_size, /*size of symbol table entry */
NULL, /*default reset method */
H5O__ainfo_free, /* free method */
H5O__ainfo_delete, /* file delete method */
NULL, /* link method */
NULL, /*set share method */
NULL, /*can share method */
- H5O_ainfo_pre_copy_file, /* pre copy native value to file */
+ H5O__ainfo_pre_copy_file, /* pre copy native value to file */
H5O__ainfo_copy_file, /* copy native value to file */
H5O__ainfo_post_copy_file, /* post copy native value to file */
NULL, /* get creation index */
@@ -91,7 +91,6 @@ H5FL_DEFINE_STATIC(H5O_ainfo_t);
* Failure: NULL
*
* Programmer: Quincey Koziol
- * koziol@hdfgroup.org
* Mar 6 2007
*
*-------------------------------------------------------------------------
@@ -157,25 +156,24 @@ done:
} /* end H5O__ainfo_decode() */
/*-------------------------------------------------------------------------
- * Function: H5O_ainfo_encode
+ * Function: H5O__ainfo_encode
*
* Purpose: Encodes a message.
*
* Return: Non-negative on success/Negative on failure
*
* Programmer: Quincey Koziol
- * koziol@hdfgroup.org
* Mar 6 2007
*
*-------------------------------------------------------------------------
*/
static herr_t
-H5O_ainfo_encode(H5F_t *f, hbool_t H5_ATTR_UNUSED disable_shared, uint8_t *p, const void *_mesg)
+H5O__ainfo_encode(H5F_t *f, hbool_t H5_ATTR_UNUSED disable_shared, uint8_t *p, const void *_mesg)
{
const H5O_ainfo_t *ainfo = (const H5O_ainfo_t *)_mesg;
unsigned char flags; /* Flags for encoding attribute info */
- FUNC_ENTER_NOAPI_NOINIT_NOERR
+ FUNC_ENTER_STATIC_NOERR
/* check args */
HDassert(f);
@@ -207,10 +205,10 @@ H5O_ainfo_encode(H5F_t *f, hbool_t H5_ATTR_UNUSED disable_shared, uint8_t *p, co
HDassert(!H5F_addr_defined(ainfo->corder_bt2_addr));
FUNC_LEAVE_NOAPI(SUCCEED)
-} /* end H5O_ainfo_encode() */
+} /* end H5O__ainfo_encode() */
/*-------------------------------------------------------------------------
- * Function: H5O_ainfo_copy
+ * Function: H5O__ainfo_copy
*
* Purpose: Copies a message from _MESG to _DEST, allocating _DEST if
* necessary.
@@ -219,19 +217,18 @@ H5O_ainfo_encode(H5F_t *f, hbool_t H5_ATTR_UNUSED disable_shared, uint8_t *p, co
* Failure: NULL
*
* Programmer: Quincey Koziol
- * koziol@hdfgroup.org
* Mar 6 2007
*
*-------------------------------------------------------------------------
*/
static void *
-H5O_ainfo_copy(const void *_mesg, void *_dest)
+H5O__ainfo_copy(const void *_mesg, void *_dest)
{
const H5O_ainfo_t *ainfo = (const H5O_ainfo_t *)_mesg;
H5O_ainfo_t * dest = (H5O_ainfo_t *)_dest;
void * ret_value = NULL; /* Return value */
- FUNC_ENTER_NOAPI_NOINIT
+ FUNC_ENTER_STATIC
/* check args */
HDassert(ainfo);
@@ -246,10 +243,10 @@ H5O_ainfo_copy(const void *_mesg, void *_dest)
done:
FUNC_LEAVE_NOAPI(ret_value)
-} /* end H5O_ainfo_copy() */
+} /* end H5O__ainfo_copy() */
/*-------------------------------------------------------------------------
- * Function: H5O_ainfo_size
+ * Function: H5O__ainfo_size
*
* Purpose: Returns the size of the raw message in bytes not counting
* the message type or size fields, but only the data fields.
@@ -259,18 +256,17 @@ done:
* Failure: zero
*
* Programmer: Quincey Koziol
- * koziol@hdfgroup.org
* Mar 6 2007
*
*-------------------------------------------------------------------------
*/
static size_t
-H5O_ainfo_size(const H5F_t *f, hbool_t H5_ATTR_UNUSED disable_shared, const void *_mesg)
+H5O__ainfo_size(const H5F_t *f, hbool_t H5_ATTR_UNUSED disable_shared, const void *_mesg)
{
const H5O_ainfo_t *ainfo = (const H5O_ainfo_t *)_mesg;
size_t ret_value = 0; /* Return value */
- FUNC_ENTER_NOAPI_NOINIT_NOERR
+ FUNC_ENTER_STATIC_NOERR
/* Set return value */
ret_value =
@@ -284,7 +280,7 @@ H5O_ainfo_size(const H5F_t *f, hbool_t H5_ATTR_UNUSED disable_shared, const void
: 0)); /* Address of v2 B-tree for indexing creation order values of attributes */
FUNC_LEAVE_NOAPI(ret_value)
-} /* end H5O_ainfo_size() */
+} /* end H5O__ainfo_size() */
/*-------------------------------------------------------------------------
* Function: H5O__ainfo_free
@@ -348,7 +344,7 @@ done:
} /* end H5O__ainfo_delete() */
/*-------------------------------------------------------------------------
- * Function: H5O_ainfo_pre_copy_file
+ * Function: H5O__ainfo_pre_copy_file
*
* Purpose: Perform any necessary actions before copying message between
* files.
@@ -362,10 +358,10 @@ done:
*-------------------------------------------------------------------------
*/
static herr_t
-H5O_ainfo_pre_copy_file(H5F_t H5_ATTR_UNUSED *file_src, const void H5_ATTR_UNUSED *native_src,
- hbool_t *deleted, const H5O_copy_t *cpy_info, void H5_ATTR_UNUSED *udata)
+H5O__ainfo_pre_copy_file(H5F_t H5_ATTR_UNUSED *file_src, const void H5_ATTR_UNUSED *native_src,
+ hbool_t *deleted, const H5O_copy_t *cpy_info, void H5_ATTR_UNUSED *udata)
{
- FUNC_ENTER_NOAPI_NOINIT_NOERR
+ FUNC_ENTER_STATIC_NOERR
/* check args */
HDassert(deleted);
@@ -378,7 +374,7 @@ H5O_ainfo_pre_copy_file(H5F_t H5_ATTR_UNUSED *file_src, const void H5_ATTR_UNUSE
*deleted = TRUE;
FUNC_LEAVE_NOAPI(SUCCEED)
-} /* end H5O_ainfo_pre_copy_file() */
+} /* end H5O__ainfo_pre_copy_file() */
/*-------------------------------------------------------------------------
* Function: H5O__ainfo_copy_file
@@ -486,7 +482,6 @@ done:
* Return: Non-negative on success/Negative on failure
*
* Programmer: Quincey Koziol
- * koziol@hdfgroup.org
* Mar 6 2007
*
*-------------------------------------------------------------------------
@@ -505,18 +500,18 @@ H5O__ainfo_debug(H5F_t H5_ATTR_UNUSED *f, const void *_mesg, FILE *stream, int i
HDassert(indent >= 0);
HDassert(fwidth >= 0);
- HDfprintf(stream, "%*s%-*s %Hu\n", indent, "", fwidth, "Number of attributes:", ainfo->nattrs);
- HDfprintf(stream, "%*s%-*s %t\n", indent, "", fwidth,
- "Track creation order of attributes:", ainfo->track_corder);
- HDfprintf(stream, "%*s%-*s %t\n", indent, "", fwidth,
- "Index creation order of attributes:", ainfo->index_corder);
+ HDfprintf(stream, "%*s%-*s %" PRIuHSIZE "\n", indent, "", fwidth, "Number of attributes:", ainfo->nattrs);
+ HDfprintf(stream, "%*s%-*s %s\n", indent, "", fwidth,
+ "Track creation order of attributes:", ainfo->track_corder ? "TRUE" : "FALSE");
+ HDfprintf(stream, "%*s%-*s %s\n", indent, "", fwidth,
+ "Index creation order of attributes:", ainfo->index_corder ? "TRUE" : "FALSE");
HDfprintf(stream, "%*s%-*s %u\n", indent, "", fwidth,
"Max. creation index value:", (unsigned)ainfo->max_crt_idx);
- HDfprintf(stream, "%*s%-*s %a\n", indent, "", fwidth,
+ HDfprintf(stream, "%*s%-*s %" PRIuHADDR "\n", indent, "", fwidth,
"'Dense' attribute storage fractal heap address:", ainfo->fheap_addr);
- HDfprintf(stream, "%*s%-*s %a\n", indent, "", fwidth,
+ HDfprintf(stream, "%*s%-*s %" PRIuHADDR "\n", indent, "", fwidth,
"'Dense' attribute storage name index v2 B-tree address:", ainfo->name_bt2_addr);
- HDfprintf(stream, "%*s%-*s %a\n", indent, "", fwidth,
+ HDfprintf(stream, "%*s%-*s %" PRIuHADDR "\n", indent, "", fwidth,
"'Dense' attribute storage creation order index v2 B-tree address:", ainfo->corder_bt2_addr);
FUNC_LEAVE_NOAPI(SUCCEED)
diff --git a/src/H5Oalloc.c b/src/H5Oalloc.c
index 6fffd8d..bad89ae 100644
--- a/src/H5Oalloc.c
+++ b/src/H5Oalloc.c
@@ -15,7 +15,7 @@
*
* Created: H5Oalloc.c
* Nov 17 2006
- * Quincey Koziol <koziol@hdfgroup.org>
+ * Quincey Koziol
*
* Purpose: Object header allocation routines.
*
@@ -94,7 +94,6 @@ H5FL_EXTERN(H5O_cont_t);
* Return: Non-negative on success/Negative on failure
*
* Programmer: Quincey Koziol
- * koziol@hdfgroup.org
* Oct 17 2006
*
*-------------------------------------------------------------------------
@@ -220,7 +219,6 @@ done:
* Return: Non-negative on success/Negative on failure
*
* Programmer: Quincey Koziol
- * koziol@hdfgroup.org
* Oct 17 2006
*
*-------------------------------------------------------------------------
@@ -318,7 +316,6 @@ H5O__eliminate_gap(H5O_t *oh, hbool_t *chk_dirtied, H5O_mesg_t *mesg, uint8_t *g
* Return: Non-negative on success/Negative on failure
*
* Programmer: Quincey Koziol
- * koziol@hdfgroup.org
* Oct 22 2006
*
*-------------------------------------------------------------------------
@@ -428,7 +425,6 @@ done:
* Return: Non-negative on success/Negative on failure
*
* Programmer: Quincey Koziol
- * koziol@ncsa.uiuc.edu
* Nov 21 2005
*
*-------------------------------------------------------------------------
@@ -715,7 +711,6 @@ done:
* Failure: Negative
*
* Programmer: Quincey Koziol
- * koziol@lbl.gov
* Oct 21 2016
*
*-------------------------------------------------------------------------
@@ -865,7 +860,6 @@ H5O__alloc_find_best_nonnull(const H5F_t *f, const H5O_t *oh, size_t *size, H5O_
* Failure: Negative
*
* Programmer: Quincey Koziol
- * koziol@lbl.gov
* Oct 21 2016
*
*-------------------------------------------------------------------------
@@ -1147,7 +1141,6 @@ done:
* Failure: Negative
*
* Programmer: Robb Matzke
- * matzke@llnl.gov
* Aug 7 1997
*
*-------------------------------------------------------------------------
@@ -1197,7 +1190,6 @@ done:
* Return: Non-negative on success/Negative on failure
*
* Programmer: Quincey Koziol
- * koziol@lbl.gov
* Oct 21 2016
*
*-------------------------------------------------------------------------
@@ -1242,10 +1234,10 @@ H5O__alloc_find_best_null(const H5O_t *oh, size_t size, size_t *mesg_idx)
/* Keep first one found */
if (found_null < 0)
found_null = (ssize_t)idx;
- else
- /* Check for better fit */
- if (oh->mesg[idx].raw_size < oh->mesg[found_null].raw_size)
+ /* Check for better fit */
+ else if (oh->mesg[idx].raw_size < oh->mesg[found_null].raw_size) {
found_null = (ssize_t)idx;
+ }
else {
/* If they are the same size, choose the one in the earliest chunk */
if (oh->mesg[idx].raw_size == oh->mesg[found_null].raw_size) {
@@ -1271,7 +1263,6 @@ H5O__alloc_find_best_null(const H5O_t *oh, size_t size, size_t *mesg_idx)
* Return: Non-negative on success/Negative on failure
*
* Programmer: Robb Matzke
- * matzke@llnl.gov
* Aug 6 1997
*
*-------------------------------------------------------------------------
@@ -1355,7 +1346,6 @@ done:
* Return: Non-negative on success/Negative on failure
*
* Programmer: Quincey Koziol
- * koziol@hdfgroup.org
* Oct 22 2006
*
*-------------------------------------------------------------------------
@@ -1597,7 +1587,6 @@ done:
* Return: Non-negative on success/Negative on failure
*
* Programmer: Quincey Koziol
- * koziol@ncsa.uiuc.edu
* Oct 17 2005
*
*-------------------------------------------------------------------------
@@ -1976,7 +1965,6 @@ done:
* Return: Non-negative on success/Negative on failure
*
* Programmer: Quincey Koziol
- * koziol@ncsa.uiuc.edu
* Oct 10 2005
*
*-------------------------------------------------------------------------
@@ -2017,8 +2005,8 @@ H5O__merge_null(H5F_t *f, H5O_t *oh)
for (v = 0, curr_msg2 = &oh->mesg[0]; v < oh->nmesgs; v++, curr_msg2++) {
if (u != v && H5O_NULL_ID == curr_msg2->type->id &&
curr_msg->chunkno == curr_msg2->chunkno) {
- ssize_t adj_raw; /* Amount to adjust raw message pointer */
- size_t adj_raw_size; /* Amount to adjust raw message size */
+ ssize_t adj_raw = 0; /* Amount to adjust raw message pointer */
+ size_t adj_raw_size = 0; /* Amount to adjust raw message size */
/* Check for second message after first message */
if ((curr_msg->raw + curr_msg->raw_size) ==
@@ -2125,7 +2113,6 @@ done:
* Return: Non-negative on success/Negative on failure
*
* Programmer: Quincey Koziol
- * koziol@ncsa.uiuc.edu
* Oct 17 2005
*
*-------------------------------------------------------------------------
@@ -2314,7 +2301,6 @@ done:
* Return: Non-negative on success/Negative on failure
*
* Programmer: Quincey Koziol
- * koziol@ncsa.uiuc.edu
* Oct 4 2005
*
*-------------------------------------------------------------------------
@@ -2374,7 +2360,6 @@ done:
* Return: Non-negative on success/Negative on failure
*
* Programmer: Neil Fortner
- * nfortne2@hdfgroup.org
* Oct 20 2008
*
*-------------------------------------------------------------------------
diff --git a/src/H5Oattr.c b/src/H5Oattr.c
index a8c3c03..db53eaf 100644
--- a/src/H5Oattr.c
+++ b/src/H5Oattr.c
@@ -23,65 +23,65 @@
#include "H5Spkg.h" /* Dataspaces */
/* PRIVATE PROTOTYPES */
-static herr_t H5O_attr_encode(H5F_t *f, uint8_t *p, const void *mesg);
-static void * H5O_attr_decode(H5F_t *f, H5O_t *open_oh, unsigned mesg_flags, unsigned *ioflags, size_t p_size,
+static herr_t H5O__attr_encode(H5F_t *f, uint8_t *p, const void *mesg);
+static void *H5O__attr_decode(H5F_t *f, H5O_t *open_oh, unsigned mesg_flags, unsigned *ioflags, size_t p_size,
const uint8_t *p);
-static void * H5O_attr_copy(const void *_mesg, void *_dest);
-static size_t H5O_attr_size(const H5F_t *f, const void *_mesg);
+static void *H5O__attr_copy(const void *_mesg, void *_dest);
+static size_t H5O__attr_size(const H5F_t *f, const void *_mesg);
static herr_t H5O__attr_free(void *mesg);
-static herr_t H5O_attr_pre_copy_file(H5F_t *file_src, const void *mesg_src, hbool_t *deleted,
- const H5O_copy_t *cpy_info, void *udata);
+static herr_t H5O__attr_pre_copy_file(H5F_t *file_src, const void *mesg_src, hbool_t *deleted,
+ const H5O_copy_t *cpy_info, void *udata);
static void * H5O__attr_copy_file(H5F_t *file_src, const H5O_msg_class_t *mesg_type, void *native_src,
H5F_t *file_dst, hbool_t *recompute_size, H5O_copy_t *cpy_info, void *udata);
static herr_t H5O__attr_post_copy_file(const H5O_loc_t *src_oloc, const void *mesg_src, H5O_loc_t *dst_oloc,
void *mesg_dst, H5O_copy_t *cpy_info);
-static herr_t H5O_attr_get_crt_index(const void *_mesg, H5O_msg_crt_idx_t *crt_idx);
-static herr_t H5O_attr_set_crt_index(void *_mesg, H5O_msg_crt_idx_t crt_idx);
+static herr_t H5O__attr_get_crt_index(const void *_mesg, H5O_msg_crt_idx_t *crt_idx);
+static herr_t H5O__attr_set_crt_index(void *_mesg, H5O_msg_crt_idx_t crt_idx);
static herr_t H5O__attr_debug(H5F_t *f, const void *_mesg, FILE *stream, int indent, int fwidth);
/* Set up & include shared message "interface" info */
#define H5O_SHARED_TYPE H5O_MSG_ATTR
-#define H5O_SHARED_DECODE H5O_attr_shared_decode
-#define H5O_SHARED_DECODE_REAL H5O_attr_decode
-#define H5O_SHARED_ENCODE H5O_attr_shared_encode
-#define H5O_SHARED_ENCODE_REAL H5O_attr_encode
-#define H5O_SHARED_SIZE H5O_attr_shared_size
-#define H5O_SHARED_SIZE_REAL H5O_attr_size
+#define H5O_SHARED_DECODE H5O__attr_shared_decode
+#define H5O_SHARED_DECODE_REAL H5O__attr_decode
+#define H5O_SHARED_ENCODE H5O__attr_shared_encode
+#define H5O_SHARED_ENCODE_REAL H5O__attr_encode
+#define H5O_SHARED_SIZE H5O__attr_shared_size
+#define H5O_SHARED_SIZE_REAL H5O__attr_size
#define H5O_SHARED_DELETE H5O__attr_shared_delete
#define H5O_SHARED_DELETE_REAL H5O__attr_delete
#define H5O_SHARED_LINK H5O__attr_shared_link
#define H5O_SHARED_LINK_REAL H5O__attr_link
#define H5O_SHARED_COPY_FILE H5O__attr_shared_copy_file
#define H5O_SHARED_COPY_FILE_REAL H5O__attr_copy_file
-#define H5O_SHARED_POST_COPY_FILE H5O_attr_shared_post_copy_file
+#define H5O_SHARED_POST_COPY_FILE H5O__attr_shared_post_copy_file
#define H5O_SHARED_POST_COPY_FILE_REAL H5O__attr_post_copy_file
#undef H5O_SHARED_POST_COPY_FILE_UPD
-#define H5O_SHARED_DEBUG H5O_attr_shared_debug
+#define H5O_SHARED_DEBUG H5O__attr_shared_debug
#define H5O_SHARED_DEBUG_REAL H5O__attr_debug
#include "H5Oshared.h" /* Shared Object Header Message Callbacks */
/* This message derives from H5O message class */
const H5O_msg_class_t H5O_MSG_ATTR[1] = {{
- H5O_ATTR_ID, /* message id number */
- "attribute", /* message name for debugging */
- sizeof(H5A_t), /* native message size */
- H5O_SHARE_IS_SHARABLE, /* messages are sharable? */
- H5O_attr_shared_decode, /* decode message */
- H5O_attr_shared_encode, /* encode message */
- H5O_attr_copy, /* copy the native value */
- H5O_attr_shared_size, /* size of raw message */
- H5O__attr_reset, /* reset method */
- H5O__attr_free, /* free method */
- H5O__attr_shared_delete, /* file delete method */
- H5O__attr_shared_link, /* link method */
- NULL, /* set share method */
- NULL, /* can share method */
- H5O_attr_pre_copy_file, /* pre copy native value to file */
- H5O__attr_shared_copy_file, /* copy native value to file */
- H5O_attr_shared_post_copy_file, /* post copy native value to file */
- H5O_attr_get_crt_index, /* get creation index */
- H5O_attr_set_crt_index, /* set creation index */
- H5O_attr_shared_debug /* debug the message */
+ H5O_ATTR_ID, /* message id number */
+ "attribute", /* message name for debugging */
+ sizeof(H5A_t), /* native message size */
+ H5O_SHARE_IS_SHARABLE, /* messages are sharable? */
+ H5O__attr_shared_decode, /* decode message */
+ H5O__attr_shared_encode, /* encode message */
+ H5O__attr_copy, /* copy the native value */
+ H5O__attr_shared_size, /* size of raw message */
+ H5O__attr_reset, /* reset method */
+ H5O__attr_free, /* free method */
+ H5O__attr_shared_delete, /* file delete method */
+ H5O__attr_shared_link, /* link method */
+ NULL, /* set share method */
+ NULL, /* can share method */
+ H5O__attr_pre_copy_file, /* pre copy native value to file */
+ H5O__attr_shared_copy_file, /* copy native value to file */
+ H5O__attr_shared_post_copy_file, /* post copy native value to file */
+ H5O__attr_get_crt_index, /* get creation index */
+ H5O__attr_set_crt_index, /* set creation index */
+ H5O__attr_shared_debug /* debug the message */
}};
/* Flags for attribute flag encoding */
@@ -97,14 +97,17 @@ H5FL_EXTERN(H5S_extent_t);
/*--------------------------------------------------------------------------
NAME
- H5O_attr_decode
+ H5O__attr_decode
PURPOSE
Decode a attribute message and return a pointer to a memory struct
with the decoded information
USAGE
- void *H5O_attr_decode(f, mesg_flags, p)
- H5F_t *f; IN: pointer to the HDF5 file struct
- unsigned mesg_flags; IN: Message flags to influence decoding
+ void *H5O__attr_decode(f, mesg_flags, p)
+ H5F_t *f; IN: pointer to the HDF5 file struct
+ H5O_t *open_oh; IN: pointer to the object header
+ unsigned mesg_flags; IN: message flags to influence decoding
+ unsigned *ioflags; IN/OUT: flags for decoding
+ size_t p_size; IN: size of buffer *p
const uint8_t *p; IN: the raw information buffer
RETURNS
Pointer to the new message in native order on success, NULL on failure
@@ -114,8 +117,8 @@ H5FL_EXTERN(H5S_extent_t);
function using malloc() and is returned to the caller.
--------------------------------------------------------------------------*/
static void *
-H5O_attr_decode(H5F_t *f, H5O_t *open_oh, unsigned H5_ATTR_UNUSED mesg_flags, unsigned *ioflags,
- size_t H5_ATTR_UNUSED p_size, const uint8_t *p)
+H5O__attr_decode(H5F_t *f, H5O_t *open_oh, unsigned H5_ATTR_UNUSED mesg_flags, unsigned *ioflags,
+ size_t p_size, const uint8_t *p)
{
H5A_t * attr = NULL;
H5S_extent_t *extent; /*extent dimensionality information */
@@ -126,7 +129,7 @@ H5O_attr_decode(H5F_t *f, H5O_t *open_oh, unsigned H5_ATTR_UNUSED mesg_flags, un
unsigned flags = 0; /* Attribute flags */
H5A_t * ret_value = NULL; /* Return value */
- FUNC_ENTER_NOAPI_NOINIT
+ FUNC_ENTER_STATIC
/* check args */
HDassert(f);
@@ -264,15 +267,15 @@ done:
} /* end if */
FUNC_LEAVE_NOAPI(ret_value)
-} /* end H5O_attr_decode() */
+} /* end H5O__attr_decode() */
/*--------------------------------------------------------------------------
NAME
- H5O_attr_encode
+ H5O__attr_encode
PURPOSE
Encode a simple attribute message
USAGE
- herr_t H5O_attr_encode(f, p, mesg)
+ herr_t H5O__attr_encode(f, p, mesg)
H5F_t *f; IN: pointer to the HDF5 file struct
const uint8 *p; IN: the raw information buffer
const void *mesg; IN: Pointer to the simple datatype struct
@@ -283,7 +286,7 @@ done:
message in the "raw" disk form.
--------------------------------------------------------------------------*/
static herr_t
-H5O_attr_encode(H5F_t *f, uint8_t *p, const void *mesg)
+H5O__attr_encode(H5F_t *f, uint8_t *p, const void *mesg)
{
const H5A_t *attr = (const H5A_t *)mesg;
size_t name_len; /* Attribute name length */
@@ -292,7 +295,7 @@ H5O_attr_encode(H5F_t *f, uint8_t *p, const void *mesg)
unsigned flags = 0; /* Attribute flags */
herr_t ret_value = SUCCEED; /* Return value */
- FUNC_ENTER_NOAPI_NOINIT
+ FUNC_ENTER_STATIC
/* check args */
HDassert(f);
@@ -372,15 +375,15 @@ H5O_attr_encode(H5F_t *f, uint8_t *p, const void *mesg)
done:
FUNC_LEAVE_NOAPI(ret_value);
-} /* end H5O_attr_encode() */
+} /* end H5O__attr_encode() */
/*--------------------------------------------------------------------------
NAME
- H5O_attr_copy
+ H5O__attr_copy
PURPOSE
Copies a message from MESG to DEST, allocating DEST if necessary.
USAGE
- void *H5O_attr_copy(mesg, dest)
+ void *H5O__attr_copy(mesg, dest)
const void *mesg; IN: Pointer to the source attribute struct
const void *dest; IN: Pointer to the destination attribute struct
RETURNS
@@ -390,11 +393,11 @@ done:
allocating the destination structure if necessary.
--------------------------------------------------------------------------*/
static void *
-H5O_attr_copy(const void *_src, void *_dst)
+H5O__attr_copy(const void *_src, void *_dst)
{
void *ret_value = NULL; /* Return value */
- FUNC_ENTER_NOAPI_NOINIT
+ FUNC_ENTER_STATIC
/* check args */
HDassert(_src);
@@ -405,15 +408,15 @@ H5O_attr_copy(const void *_src, void *_dst)
done:
FUNC_LEAVE_NOAPI(ret_value)
-} /* end H5O_attr_copy() */
+} /* end H5O__attr_copy() */
/*--------------------------------------------------------------------------
NAME
- H5O_attr_size
+ H5O__attr_size
PURPOSE
Return the raw message size in bytes
USAGE
- size_t H5O_attr_size(f, mesg)
+ size_t H5O__attr_size(f, mesg)
H5F_t *f; IN: pointer to the HDF5 file struct
const void *mesg; IN: Pointer to the source attribute struct
RETURNS
@@ -424,13 +427,13 @@ done:
portion of the message). It doesn't take into account alignment.
--------------------------------------------------------------------------*/
static size_t
-H5O_attr_size(const H5F_t H5_ATTR_UNUSED *f, const void *_mesg)
+H5O__attr_size(const H5F_t H5_ATTR_UNUSED *f, const void *_mesg)
{
const H5A_t *attr = (const H5A_t *)_mesg;
size_t name_len;
size_t ret_value = 0;
- FUNC_ENTER_NOAPI_NOINIT_NOERR
+ FUNC_ENTER_STATIC_NOERR
HDassert(attr);
@@ -465,7 +468,7 @@ H5O_attr_size(const H5F_t H5_ATTR_UNUSED *f, const void *_mesg)
HDassert(0 && "Bad attribute version");
FUNC_LEAVE_NOAPI(ret_value)
-} /* end H5O_attr_size() */
+} /* end H5O__attr_size() */
/*-------------------------------------------------------------------------
* Function: H5O__attr_reset
@@ -594,7 +597,7 @@ done:
} /* end H5O__attr_link() */
/*-------------------------------------------------------------------------
- * Function: H5O_attr_pre_copy_file
+ * Function: H5O__attr_pre_copy_file
*
* Purpose: Perform any necessary actions before copying message between
* files for attribute messages.
@@ -607,13 +610,13 @@ done:
*-------------------------------------------------------------------------
*/
static herr_t
-H5O_attr_pre_copy_file(H5F_t H5_ATTR_UNUSED *file_src, const void *native_src, hbool_t *deleted,
- const H5O_copy_t *cpy_info, void H5_ATTR_UNUSED *udata)
+H5O__attr_pre_copy_file(H5F_t H5_ATTR_UNUSED *file_src, const void *native_src, hbool_t *deleted,
+ const H5O_copy_t *cpy_info, void H5_ATTR_UNUSED *udata)
{
const H5A_t *attr_src = (const H5A_t *)native_src; /* Source attribute */
herr_t ret_value = SUCCEED; /* Return value */
- FUNC_ENTER_NOAPI_NOINIT
+ FUNC_ENTER_STATIC
/* check args */
HDassert(deleted);
@@ -634,7 +637,7 @@ H5O_attr_pre_copy_file(H5F_t H5_ATTR_UNUSED *file_src, const void *native_src, h
done:
FUNC_LEAVE_NOAPI(ret_value)
-} /* end H5O_attr_pre_copy_file() */
+} /* end H5O__attr_pre_copy_file() */
/*-------------------------------------------------------------------------
* Function: H5O__attr_copy_file
@@ -710,7 +713,7 @@ done:
} /* H5O__attr_post_copy_file() */
/*-------------------------------------------------------------------------
- * Function: H5O_attr_get_crt_index
+ * Function: H5O__attr_get_crt_index
*
* Purpose: Get creation index from the message
*
@@ -722,11 +725,11 @@ done:
*-------------------------------------------------------------------------
*/
static herr_t
-H5O_attr_get_crt_index(const void *_mesg, H5O_msg_crt_idx_t *crt_idx /*out*/)
+H5O__attr_get_crt_index(const void *_mesg, H5O_msg_crt_idx_t *crt_idx /*out*/)
{
const H5A_t *attr = (const H5A_t *)_mesg;
- FUNC_ENTER_NOAPI_NOINIT_NOERR
+ FUNC_ENTER_STATIC_NOERR
HDassert(attr);
HDassert(crt_idx);
@@ -735,10 +738,10 @@ H5O_attr_get_crt_index(const void *_mesg, H5O_msg_crt_idx_t *crt_idx /*out*/)
*crt_idx = attr->shared->crt_idx;
FUNC_LEAVE_NOAPI(SUCCEED)
-} /* end H5O_attr_get_crt_index() */
+} /* end H5O__attr_get_crt_index() */
/*-------------------------------------------------------------------------
- * Function: H5O_attr_set_crt_index
+ * Function: H5O__attr_set_crt_index
*
* Purpose: Set creation index from the message
*
@@ -750,11 +753,11 @@ H5O_attr_get_crt_index(const void *_mesg, H5O_msg_crt_idx_t *crt_idx /*out*/)
*-------------------------------------------------------------------------
*/
static herr_t
-H5O_attr_set_crt_index(void *_mesg, H5O_msg_crt_idx_t crt_idx)
+H5O__attr_set_crt_index(void *_mesg, H5O_msg_crt_idx_t crt_idx)
{
H5A_t *attr = (H5A_t *)_mesg;
- FUNC_ENTER_NOAPI_NOINIT_NOERR
+ FUNC_ENTER_STATIC_NOERR
HDassert(attr);
@@ -762,7 +765,7 @@ H5O_attr_set_crt_index(void *_mesg, H5O_msg_crt_idx_t crt_idx)
attr->shared->crt_idx = crt_idx;
FUNC_LEAVE_NOAPI(SUCCEED)
-} /* end H5O_attr_set_crt_index() */
+} /* end H5O__attr_set_crt_index() */
/*--------------------------------------------------------------------------
NAME
@@ -833,8 +836,9 @@ H5O__attr_debug(H5F_t *f, const void *_mesg, FILE *stream, int indent, int fwidt
break;
} /* end switch */
HDfprintf(stream, "%*s%-*s %s\n", indent, "", fwidth, "Character Set of Name:", s);
- HDfprintf(stream, "%*s%-*s %t\n", indent, "", fwidth, "Object opened:", mesg->obj_opened);
- HDfprintf(stream, "%*s%-*s %a\n", indent, "", fwidth, "Object:", mesg->oloc.addr);
+ HDfprintf(stream, "%*s%-*s %s\n", indent, "", fwidth,
+ "Object opened:", mesg->obj_opened ? "TRUE" : "FALSE");
+ HDfprintf(stream, "%*s%-*s %" PRIuHADDR "\n", indent, "", fwidth, "Object:", mesg->oloc.addr);
/* Check for attribute creation order index on the attribute */
if (mesg->shared->crt_idx != H5O_MAX_CRT_ORDER_IDX)
diff --git a/src/H5Oattribute.c b/src/H5Oattribute.c
index d1e25b1..4adfaf7 100644
--- a/src/H5Oattribute.c
+++ b/src/H5Oattribute.c
@@ -13,7 +13,7 @@
/*-------------------------------------------------------------------------
*
- * Created: H5Oattribute.c
+ * Created: H5Oattribute.c
*
* Purpose: Object header attribute routines.
*
@@ -141,7 +141,6 @@ static herr_t H5O__attr_exists_cb(H5O_t H5_ATTR_UNUSED *oh, H5O_mesg_t *mesg,
* Return: SUCCEED/FAIL
*
* Programmer: Quincey Koziol
- * koziol@hdfgroup.org
* Dec 4 2006
*
*-------------------------------------------------------------------------
@@ -383,7 +382,6 @@ done:
* Return: SUCCEED/FAIL
*
* Programmer: Quincey Koziol
- * koziol@hdfgroup.org
* Dec 11 2006
*
*-------------------------------------------------------------------------
@@ -528,7 +526,6 @@ done:
* Return: SUCCEED/FAIL
*
* Programmer: Quincey Koziol
- * koziol@hdfgroup.org
* Dec 18 2006
*
*-------------------------------------------------------------------------
@@ -711,7 +708,6 @@ done:
* Return: SUCCEED/FAIL
*
* Programmer: Quincey Koziol
- * koziol@hdfgroup.org
* Jan 2 2007
*
*-------------------------------------------------------------------------
@@ -785,7 +781,6 @@ done:
* Return: SUCCEED/FAIL
*
* Programmer: Quincey Koziol
- * koziol@hdfgroup.org
* Dec 4 2006
*
*-------------------------------------------------------------------------
@@ -943,7 +938,6 @@ done:
* Return: SUCCEED/FAIL
*
* Programmer: Quincey Koziol
- * koziol@hdfgroup.org
* Dec 5 2006
*
*-------------------------------------------------------------------------
@@ -989,7 +983,6 @@ H5O__attr_rename_chk_cb(H5O_t H5_ATTR_UNUSED *oh, H5O_mesg_t *mesg /*in,out*/,
* Return: SUCCEED/FAIL
*
* Programmer: Quincey Koziol
- * koziol@hdfgroup.org
* Dec 5 2006
*
*-------------------------------------------------------------------------
@@ -1451,7 +1444,6 @@ done:
* Return: SUCCEED/FAIL
*
* Programmer: Quincey Koziol
- * koziol@hdfgroup.org
* Dec 11 2006
*
*-------------------------------------------------------------------------
@@ -1723,7 +1715,6 @@ done:
* Return: SUCCEED/FAIL
*
* Programmer: Quincey Koziol
- * koziol@hdfgroup.org
* Dec 11 2006
*
*-------------------------------------------------------------------------
diff --git a/src/H5Obogus.c b/src/H5Obogus.c
index e1cd1b4..c7fcdb9 100644
--- a/src/H5Obogus.c
+++ b/src/H5Obogus.c
@@ -15,7 +15,7 @@
*
* Created: H5Obogus.c
* Jan 21 2003
- * Quincey Koziol <koziol@ncsa.uiuc.edu>
+ * Quincey Koziol
*
* Purpose: "bogus" message. This message is guaranteed to never
* be found in a valid HDF5 file and is only used to
@@ -38,8 +38,8 @@
/* PRIVATE PROTOTYPES */
static void * H5O__bogus_decode(H5F_t *f, H5O_t *open_oh, unsigned mesg_flags, unsigned *ioflags,
size_t p_size, const uint8_t *p);
-static herr_t H5O_bogus_encode(H5F_t *f, hbool_t disable_shared, uint8_t *p, const void *_mesg);
-static size_t H5O_bogus_size(const H5F_t *f, hbool_t disable_shared, const void *_mesg);
+static herr_t H5O__bogus_encode(H5F_t *f, hbool_t disable_shared, uint8_t *p, const void *_mesg);
+static size_t H5O__bogus_size(const H5F_t *f, hbool_t disable_shared, const void *_mesg);
static herr_t H5O__bogus_debug(H5F_t *f, const void *_mesg, FILE *stream, int indent, int fwidth);
/* This message derives from H5O message class */
@@ -49,9 +49,9 @@ const H5O_msg_class_t H5O_MSG_BOGUS_VALID[1] = {{
0, /*native message size */
H5O_SHARE_IS_SHARABLE, /* messages are sharable? */
H5O__bogus_decode, /*decode message */
- H5O_bogus_encode, /*encode message */
+ H5O__bogus_encode, /*encode message */
NULL, /*copy the native value */
- H5O_bogus_size, /*raw message size */
+ H5O__bogus_size, /*raw message size */
NULL, /*free internal memory */
NULL, /*free method */
NULL, /* file delete method */
@@ -73,9 +73,9 @@ const H5O_msg_class_t H5O_MSG_BOGUS_INVALID[1] = {{
0, /*native message size */
H5O_SHARE_IS_SHARABLE, /* messages are sharable? */
H5O__bogus_decode, /*decode message */
- H5O_bogus_encode, /*encode message */
+ H5O__bogus_encode, /*encode message */
NULL, /*copy the native value */
- H5O_bogus_size, /*raw message size */
+ H5O__bogus_size, /*raw message size */
NULL, /*free internal memory */
NULL, /*free method */
NULL, /* file delete method */
@@ -101,7 +101,6 @@ const H5O_msg_class_t H5O_MSG_BOGUS_INVALID[1] = {{
* Failure: NULL
*
* Programmer: Quincey Koziol
- * koziol@ncsa.uiuc.edu
* Jan 21 2003
*
*-------------------------------------------------------------------------
@@ -141,23 +140,22 @@ done:
} /* end H5O__bogus_decode() */
/*-------------------------------------------------------------------------
- * Function: H5O_bogus_encode
+ * Function: H5O__bogus_encode
*
* Purpose: Encodes a "bogus" message.
*
* Return: Non-negative on success/Negative on failure
*
* Programmer: Quincey Koziol
- * koziol@ncsa.uiuc.edu
* Jan 21 2003
*
*-------------------------------------------------------------------------
*/
static herr_t
-H5O_bogus_encode(H5F_t H5_ATTR_UNUSED *f, hbool_t H5_ATTR_UNUSED disable_shared, uint8_t *p,
- const void H5_ATTR_UNUSED *mesg)
+H5O__bogus_encode(H5F_t H5_ATTR_UNUSED *f, hbool_t H5_ATTR_UNUSED disable_shared, uint8_t *p,
+ const void H5_ATTR_UNUSED *mesg)
{
- FUNC_ENTER_NOAPI_NOINIT_NOERR
+ FUNC_ENTER_STATIC_NOERR
/* check args */
HDassert(f);
@@ -168,10 +166,10 @@ H5O_bogus_encode(H5F_t H5_ATTR_UNUSED *f, hbool_t H5_ATTR_UNUSED disable_shared,
UINT32ENCODE(p, H5O_BOGUS_VALUE);
FUNC_LEAVE_NOAPI(SUCCEED)
-} /* end H5O_bogus_encode() */
+} /* end H5O__bogus_encode() */
/*-------------------------------------------------------------------------
- * Function: H5O_bogus_size
+ * Function: H5O__bogus_size
*
* Purpose: Returns the size of the raw message in bytes not
* counting the message typ or size fields, but only the data
@@ -183,19 +181,18 @@ H5O_bogus_encode(H5F_t H5_ATTR_UNUSED *f, hbool_t H5_ATTR_UNUSED disable_shared,
* Failure: Negative
*
* Programmer: Quincey Koziol
- * koziol@ncsa.uiuc.edu
* Jan 21 2003
*
*-------------------------------------------------------------------------
*/
static size_t
-H5O_bogus_size(const H5F_t H5_ATTR_UNUSED *f, hbool_t H5_ATTR_UNUSED disable_shared,
- const void H5_ATTR_UNUSED *mesg)
+H5O__bogus_size(const H5F_t H5_ATTR_UNUSED *f, hbool_t H5_ATTR_UNUSED disable_shared,
+ const void H5_ATTR_UNUSED *mesg)
{
- FUNC_ENTER_NOAPI_NOINIT_NOERR
+ FUNC_ENTER_STATIC_NOERR
FUNC_LEAVE_NOAPI(4)
-} /* end H5O_bogus_size() */
+} /* end H5O__bogus_size() */
/*-------------------------------------------------------------------------
* Function: H5O__bogus_debug
@@ -205,11 +202,8 @@ H5O_bogus_size(const H5F_t H5_ATTR_UNUSED *f, hbool_t H5_ATTR_UNUSED disable_sha
* Return: Non-negative on success/Negative on failure
*
* Programmer: Quincey Koziol
- * koziol@ncsa.uiuc.edu
* Jan 21 2003
*
- * Modifications:
- *
*-------------------------------------------------------------------------
*/
static herr_t
diff --git a/src/H5Obtreek.c b/src/H5Obtreek.c
index 00a506e..a783366 100644
--- a/src/H5Obtreek.c
+++ b/src/H5Obtreek.c
@@ -11,7 +11,7 @@
* help@hdfgroup.org. *
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
-/* Programmer: Quincey Koziol <koziol@hdfgroup.org>
+/* Programmer: Quincey Koziol
* Thursday, March 1, 2007
*
* Purpose: A message holding non-default v1 B-tree 'K' value
@@ -25,11 +25,11 @@
#include "H5Opkg.h" /* Object headers */
#include "H5MMprivate.h" /* Memory management */
-static void * H5O_btreek_decode(H5F_t *f, H5O_t *open_oh, unsigned mesg_flags, unsigned *ioflags,
- size_t p_size, const uint8_t *p);
-static herr_t H5O_btreek_encode(H5F_t *f, hbool_t disable_shared, uint8_t *p, const void *_mesg);
-static void * H5O_btreek_copy(const void *_mesg, void *_dest);
-static size_t H5O_btreek_size(const H5F_t *f, hbool_t disable_shared, const void *_mesg);
+static void * H5O__btreek_decode(H5F_t *f, H5O_t *open_oh, unsigned mesg_flags, unsigned *ioflags,
+ size_t p_size, const uint8_t *p);
+static herr_t H5O__btreek_encode(H5F_t *f, hbool_t disable_shared, uint8_t *p, const void *_mesg);
+static void * H5O__btreek_copy(const void *_mesg, void *_dest);
+static size_t H5O__btreek_size(const H5F_t *f, hbool_t disable_shared, const void *_mesg);
static herr_t H5O__btreek_debug(H5F_t *f, const void *_mesg, FILE *stream, int indent, int fwidth);
/* This message derives from H5O message class */
@@ -37,11 +37,11 @@ const H5O_msg_class_t H5O_MSG_BTREEK[1] = {{
H5O_BTREEK_ID, /*message id number */
"v1 B-tree 'K' values", /*message name for debugging */
sizeof(H5O_btreek_t), /*native message size */
- 0, /* messages are sharable? */
- H5O_btreek_decode, /*decode message */
- H5O_btreek_encode, /*encode message */
- H5O_btreek_copy, /*copy the native value */
- H5O_btreek_size, /*raw message size */
+ 0, /* messages are sharable? */
+ H5O__btreek_decode, /*decode message */
+ H5O__btreek_encode, /*encode message */
+ H5O__btreek_copy, /*copy the native value */
+ H5O__btreek_size, /*raw message size */
NULL, /*free internal memory */
NULL, /* free method */
NULL, /* file delete method */
@@ -60,7 +60,7 @@ const H5O_msg_class_t H5O_MSG_BTREEK[1] = {{
#define H5O_BTREEK_VERSION 0
/*-------------------------------------------------------------------------
- * Function: H5O_btreek_decode
+ * Function: H5O__btreek_decode
*
* Purpose: Decode a shared message table message and return a pointer
* to a newly allocated H5O_btreek_t struct.
@@ -74,13 +74,13 @@ const H5O_msg_class_t H5O_MSG_BTREEK[1] = {{
*-------------------------------------------------------------------------
*/
static void *
-H5O_btreek_decode(H5F_t H5_ATTR_UNUSED *f, H5O_t H5_ATTR_UNUSED *open_oh, unsigned H5_ATTR_UNUSED mesg_flags,
- unsigned H5_ATTR_UNUSED *ioflags, size_t H5_ATTR_UNUSED p_size, const uint8_t *p)
+H5O__btreek_decode(H5F_t H5_ATTR_UNUSED *f, H5O_t H5_ATTR_UNUSED *open_oh, unsigned H5_ATTR_UNUSED mesg_flags,
+ unsigned H5_ATTR_UNUSED *ioflags, size_t H5_ATTR_UNUSED p_size, const uint8_t *p)
{
H5O_btreek_t *mesg; /* Native message */
void * ret_value = NULL; /* Return value */
- FUNC_ENTER_NOAPI_NOINIT
+ FUNC_ENTER_STATIC
/* Sanity check */
HDassert(f);
@@ -104,10 +104,10 @@ H5O_btreek_decode(H5F_t H5_ATTR_UNUSED *f, H5O_t H5_ATTR_UNUSED *open_oh, unsign
done:
FUNC_LEAVE_NOAPI(ret_value)
-} /* end H5O_btreek_decode() */
+} /* end H5O__btreek_decode() */
/*-------------------------------------------------------------------------
- * Function: H5O_btreek_encode
+ * Function: H5O__btreek_encode
*
* Purpose: Encode a v1 B-tree 'K' value message.
*
@@ -119,12 +119,12 @@ done:
*-------------------------------------------------------------------------
*/
static herr_t
-H5O_btreek_encode(H5F_t H5_ATTR_UNUSED *f, hbool_t H5_ATTR_UNUSED disable_shared, uint8_t *p,
- const void *_mesg)
+H5O__btreek_encode(H5F_t H5_ATTR_UNUSED *f, hbool_t H5_ATTR_UNUSED disable_shared, uint8_t *p,
+ const void *_mesg)
{
const H5O_btreek_t *mesg = (const H5O_btreek_t *)_mesg;
- FUNC_ENTER_NOAPI_NOINIT_NOERR
+ FUNC_ENTER_STATIC_NOERR
/* Sanity check */
HDassert(f);
@@ -138,10 +138,10 @@ H5O_btreek_encode(H5F_t H5_ATTR_UNUSED *f, hbool_t H5_ATTR_UNUSED disable_shared
UINT16ENCODE(p, mesg->sym_leaf_k);
FUNC_LEAVE_NOAPI(SUCCEED)
-} /* end H5O_btreek_encode() */
+} /* end H5O__btreek_encode() */
/*-------------------------------------------------------------------------
- * Function: H5O_btreek_copy
+ * Function: H5O__btreek_copy
*
* Purpose: Copies a message from _MESG to _DEST, allocating _DEST if
* necessary.
@@ -155,13 +155,13 @@ H5O_btreek_encode(H5F_t H5_ATTR_UNUSED *f, hbool_t H5_ATTR_UNUSED disable_shared
*-------------------------------------------------------------------------
*/
static void *
-H5O_btreek_copy(const void *_mesg, void *_dest)
+H5O__btreek_copy(const void *_mesg, void *_dest)
{
const H5O_btreek_t *mesg = (const H5O_btreek_t *)_mesg;
H5O_btreek_t * dest = (H5O_btreek_t *)_dest;
void * ret_value = NULL; /* Return value */
- FUNC_ENTER_NOAPI_NOINIT
+ FUNC_ENTER_STATIC
/* Sanity check */
HDassert(mesg);
@@ -178,10 +178,10 @@ H5O_btreek_copy(const void *_mesg, void *_dest)
done:
FUNC_LEAVE_NOAPI(ret_value)
-} /* end H5O_btreek_copy() */
+} /* end H5O__btreek_copy() */
/*-------------------------------------------------------------------------
- * Function: H5O_btreek_size
+ * Function: H5O__btreek_size
*
* Purpose: Returns the size of the raw message in bytes not counting the
* message type or size fields, but only the data fields.
@@ -195,12 +195,12 @@ done:
*-------------------------------------------------------------------------
*/
static size_t
-H5O_btreek_size(const H5F_t H5_ATTR_UNUSED *f, hbool_t H5_ATTR_UNUSED disable_shared,
- const void H5_ATTR_UNUSED *_mesg)
+H5O__btreek_size(const H5F_t H5_ATTR_UNUSED *f, hbool_t H5_ATTR_UNUSED disable_shared,
+ const void H5_ATTR_UNUSED *_mesg)
{
- size_t ret_value;
+ size_t ret_value = 0;
- FUNC_ENTER_NOAPI_NOINIT_NOERR
+ FUNC_ENTER_STATIC_NOERR
/* Sanity check */
HDassert(f);
@@ -211,7 +211,7 @@ H5O_btreek_size(const H5F_t H5_ATTR_UNUSED *f, hbool_t H5_ATTR_UNUSED disable_sh
2; /* Symbol table node leaf 'K' value */
FUNC_LEAVE_NOAPI(ret_value)
-} /* end H5O_btreek_size() */
+} /* end H5O__btreek_size() */
/*-------------------------------------------------------------------------
* Function: H5O__btreek_debug
diff --git a/src/H5Ocache.c b/src/H5Ocache.c
index a5703ae..a968f84 100644
--- a/src/H5Ocache.c
+++ b/src/H5Ocache.c
@@ -15,7 +15,7 @@
*
* Created: H5Ocache.c
* Sep 28 2005
- * Quincey Koziol <koziol@ncsa.uiuc.edu>
+ * Quincey Koziol
*
* Purpose: Object header metadata cache virtual functions.
*
@@ -277,7 +277,7 @@ H5O__cache_verify_chksum(const void *_image, size_t len, void *_udata)
*
* Note that the object header is read with with a speculative read.
* If the initial read is too small, make note of this fact and return
- * without error. H5C_load_entry() will note the size discrepency
+ * without error. H5C__load_entry() will note the size discrepency
* and retry the deserialize operation with the correct size read.
*
* Return: Success: Pointer to in core representation
@@ -1055,7 +1055,6 @@ done:
* Failure: FAIL
*
* Programmer: Quincey Koziol
- * koziol@hdfgroup.org
* July 12, 2008
*
*-------------------------------------------------------------------------
@@ -1273,7 +1272,6 @@ done:
* Failure: FAIL
*
* Programmer: Quincey Koziol
- * koziol@hdfgroup.org
* July 12, 2008
*
*-------------------------------------------------------------------------
@@ -1339,7 +1337,7 @@ H5O__chunk_deserialize(H5O_t *oh, haddr_t addr, size_t len, const uint8_t *image
/* Check for magic # on chunks > 0 in later versions of the format */
else if (chunkno > 0 && oh->version > H5O_VERSION_1) {
/* Magic number */
- if (HDmemcmp(chunk_image, H5O_CHK_MAGIC, (size_t)H5_SIZEOF_MAGIC))
+ if (HDmemcmp(chunk_image, H5O_CHK_MAGIC, (size_t)H5_SIZEOF_MAGIC) != 0)
HGOTO_ERROR(H5E_OHDR, H5E_CANTLOAD, FAIL, "wrong object header chunk signature")
chunk_image += H5_SIZEOF_MAGIC;
} /* end if */
@@ -1619,7 +1617,6 @@ done:
* Failure: FAIL
*
* Programmer: Quincey Koziol
- * koziol@hdfgroup.org
* July 12, 2008
*
*-------------------------------------------------------------------------
diff --git a/src/H5Ocache_image.c b/src/H5Ocache_image.c
index b1b8e09..2603f71 100644
--- a/src/H5Ocache_image.c
+++ b/src/H5Ocache_image.c
@@ -281,37 +281,8 @@ H5O__mdci_delete(H5F_t *f, H5O_t H5_ATTR_UNUSED *open_oh, void *_mesg)
* from the VFD layer at the end of file. As this was the
* last file space allocation before shutdown, the cache image
* should still be the last item in the file.
- *
- * If the hack to work around the self referential free space
- * manager issue is in use, file space for the non-empty self
- * referential free space managers was also allocated from VFD
- * layer at the end of file. Since these allocations directly
- * preceeded the cache image allocation they should be directly
- * adjacent to the cache image block at the end of file.
- *
- * In this case, just call H5MF_tidy_self_referential_fsm_hack().
- *
- * That routine will float the self referential free space
- * managers, and reduce the eoa to its value just prior to
- * allocation of space for same. Since the cache image appears
- * just after the self referential free space managers, this
- * will release the file space for the cache image as well.
- *
- * Note that in this case, there must not have been any file
- * space allocations / deallocations prior to the free of the
- * cache image. Verify this to the extent possible.
- *
- * If the hack to work around the persistent self referential
- * free space manager issue is NOT in use, just call H5MF_xfree()
- * to release the cache iamge. In principle, we should be able
- * to just reduce the EOA to the base address of the cache
- * image block, as there shouldn't be any file space allocation
- * before the first metadata cache access. However, given
- * time constraints, I don't want to go there now.
*/
-
if (f->shared->closing) {
-
/* Get the eoa, and verify that it has the expected value */
if (HADDR_UNDEF == (final_eoa = H5FD_get_eoa(f->shared->lf, H5FD_MEM_DEFAULT)))
HGOTO_ERROR(H5E_CACHE, H5E_CANTGET, FAIL, "unable to get file size")
@@ -321,11 +292,8 @@ H5O__mdci_delete(H5F_t *f, H5O_t H5_ATTR_UNUSED *open_oh, void *_mesg)
if (H5FD_free(f->shared->lf, H5FD_MEM_SUPER, f, mesg->addr, mesg->size) < 0)
HGOTO_ERROR(H5E_CACHE, H5E_CANTFREE, FAIL, "can't free MDC image")
}
- else {
- if (H5MF_xfree(f, H5FD_MEM_SUPER, mesg->addr, mesg->size) < 0)
- HGOTO_ERROR(H5E_OHDR, H5E_CANTFREE, FAIL, "unable to free file space for cache image block")
- }
-
+ else if (H5MF_xfree(f, H5FD_MEM_SUPER, mesg->addr, mesg->size) < 0)
+ HGOTO_ERROR(H5E_OHDR, H5E_CANTFREE, FAIL, "unable to free file space for cache image block")
} /* end if */
done:
@@ -358,9 +326,10 @@ H5O__mdci_debug(H5F_t H5_ATTR_UNUSED *f, const void *_mesg, FILE *stream, int in
HDassert(indent >= 0);
HDassert(fwidth >= 0);
- HDfprintf(stream, "%*s%-*s %a\n", indent, "", fwidth, "Metadata Cache Image Block address:", mdci->addr);
+ HDfprintf(stream, "%*s%-*s %" PRIuHADDR "\n", indent, "", fwidth,
+ "Metadata Cache Image Block address:", mdci->addr);
- HDfprintf(stream, "%*s%-*s %Hu\n", indent, "", fwidth,
+ HDfprintf(stream, "%*s%-*s %" PRIuHSIZE "\n", indent, "", fwidth,
"Metadata Cache Image Block size in bytes:", mdci->size);
FUNC_LEAVE_NOAPI(SUCCEED)
diff --git a/src/H5Ochunk.c b/src/H5Ochunk.c
index 66e11c8..6e31668 100644
--- a/src/H5Ochunk.c
+++ b/src/H5Ochunk.c
@@ -415,9 +415,9 @@ H5O__chunk_dest(H5O_chunk_proxy_t *chk_proxy)
if (chk_proxy->oh && H5O__dec_rc(chk_proxy->oh) < 0)
HGOTO_ERROR(H5E_OHDR, H5E_CANTDEC, FAIL, "can't decrement reference count on object header")
+done:
/* Release the chunk proxy object */
chk_proxy = H5FL_FREE(H5O_chunk_proxy_t, chk_proxy);
-done:
FUNC_LEAVE_NOAPI(ret_value)
} /* H5O__chunk_dest() */
diff --git a/src/H5Ocont.c b/src/H5Ocont.c
index f61ec3f..080225a 100644
--- a/src/H5Ocont.c
+++ b/src/H5Ocont.c
@@ -258,7 +258,7 @@ H5O__cont_debug(H5F_t H5_ATTR_UNUSED *f, const void *_mesg, FILE *stream, int in
HDassert(indent >= 0);
HDassert(fwidth >= 0);
- HDfprintf(stream, "%*s%-*s %a\n", indent, "", fwidth, "Continuation address:", cont->addr);
+ HDfprintf(stream, "%*s%-*s %" PRIuHADDR "\n", indent, "", fwidth, "Continuation address:", cont->addr);
HDfprintf(stream, "%*s%-*s %lu\n", indent, "", fwidth,
"Continuation size in bytes:", (unsigned long)(cont->size));
diff --git a/src/H5Odbg.c b/src/H5Odbg.c
index 3911992..2826bcd 100644
--- a/src/H5Odbg.c
+++ b/src/H5Odbg.c
@@ -15,7 +15,7 @@
*
* Created: H5Odbg.c
* Nov 17 2006
- * Quincey Koziol <koziol@hdfgroup.org>
+ * Quincey Koziol
*
* Purpose: Object header debugging routines.
*
@@ -76,7 +76,6 @@
* Return: SUCCEED (Doesn't fail, just crashes)
*
* Programmer: Quincey Koziol
- * koziol@hdfgroup.org
* Oct 17 2006
*
*-------------------------------------------------------------------------
@@ -232,7 +231,6 @@ H5O__assert(const H5O_t *oh)
* Return: Non-negative on success/Negative on failure
*
* Programmer: Quincey Koziol
- * koziol@ncsa.uiuc.edu
* Feb 13 2003
*
*-------------------------------------------------------------------------
@@ -272,7 +270,6 @@ done:
* Return: SUCCEED/FAIL
*
* Programmer: Robb Matzke
- * matzke@llnl.gov
* Aug 6 1997
*
*-------------------------------------------------------------------------
@@ -298,7 +295,8 @@ H5O__debug_real(H5F_t *f, H5O_t *oh, haddr_t addr, FILE *stream, int indent, int
/* debug */
HDfprintf(stream, "%*sObject Header...\n", indent, "");
- HDfprintf(stream, "%*s%-*s %t\n", indent, "", fwidth, "Dirty:", oh->cache_info.is_dirty);
+ HDfprintf(stream, "%*s%-*s %s\n", indent, "", fwidth,
+ "Dirty:", oh->cache_info.is_dirty ? "TRUE" : "FALSE");
HDfprintf(stream, "%*s%-*s %u\n", indent, "", fwidth, "Version:", oh->version);
HDfprintf(stream, "%*s%-*s %u\n", indent, "", fwidth,
"Header size (in bytes):", (unsigned)H5O_SIZEOF_HDR(oh));
@@ -347,9 +345,9 @@ H5O__debug_real(H5F_t *f, H5O_t *oh, haddr_t addr, FILE *stream, int indent, int
} /* end if */
} /* end if */
- HDfprintf(stream, "%*s%-*s %Zu (%Zu)\n", indent, "", fwidth,
+ HDfprintf(stream, "%*s%-*s %zu (%zu)\n", indent, "", fwidth,
"Number of messages (allocated):", oh->nmesgs, oh->alloc_nmesgs);
- HDfprintf(stream, "%*s%-*s %Zu (%Zu)\n", indent, "", fwidth, "Number of chunks (allocated):", oh->nchunks,
+ HDfprintf(stream, "%*s%-*s %zu (%zu)\n", indent, "", fwidth, "Number of chunks (allocated):", oh->nchunks,
oh->alloc_nchunks);
/* debug each chunk */
@@ -358,7 +356,8 @@ H5O__debug_real(H5F_t *f, H5O_t *oh, haddr_t addr, FILE *stream, int indent, int
HDfprintf(stream, "%*sChunk %d...\n", indent, "", i);
- HDfprintf(stream, "%*s%-*s %a\n", indent + 3, "", MAX(0, fwidth - 3), "Address:", oh->chunk[i].addr);
+ HDfprintf(stream, "%*s%-*s %" PRIuHADDR "\n", indent + 3, "", MAX(0, fwidth - 3),
+ "Address:", oh->chunk[i].addr);
/* Decrement chunk 0's size by the object header prefix size */
if (0 == i) {
@@ -373,9 +372,9 @@ H5O__debug_real(H5F_t *f, H5O_t *oh, haddr_t addr, FILE *stream, int indent, int
chunk_total += chunk_size;
gap_total += oh->chunk[i].gap;
- HDfprintf(stream, "%*s%-*s %Zu\n", indent + 3, "", MAX(0, fwidth - 3), "Size in bytes:", chunk_size);
+ HDfprintf(stream, "%*s%-*s %zu\n", indent + 3, "", MAX(0, fwidth - 3), "Size in bytes:", chunk_size);
- HDfprintf(stream, "%*s%-*s %Zu\n", indent + 3, "", MAX(0, fwidth - 3), "Gap:", oh->chunk[i].gap);
+ HDfprintf(stream, "%*s%-*s %zu\n", indent + 3, "", MAX(0, fwidth - 3), "Gap:", oh->chunk[i].gap);
} /* end for */
/* debug each message */
@@ -404,7 +403,8 @@ H5O__debug_real(H5F_t *f, H5O_t *oh, haddr_t addr, FILE *stream, int indent, int
HDfprintf(stream, "%*s%-*s 0x%04x `%s' (%d)\n", indent + 3, "", MAX(0, fwidth - 3),
"Message ID (sequence number):", (unsigned)(oh->mesg[i].type->id), oh->mesg[i].type->name,
sequence[oh->mesg[i].type->id]++);
- HDfprintf(stream, "%*s%-*s %t\n", indent + 3, "", MAX(0, fwidth - 3), "Dirty:", oh->mesg[i].dirty);
+ HDfprintf(stream, "%*s%-*s %s\n", indent + 3, "", MAX(0, fwidth - 3),
+ "Dirty:", oh->mesg[i].dirty ? "TRUE" : "FALSE");
HDfprintf(stream, "%*s%-*s ", indent + 3, "", MAX(0, fwidth - 3), "Message flags:");
if (oh->mesg[i].flags) {
hbool_t flag_printed = FALSE;
@@ -464,7 +464,7 @@ H5O__debug_real(H5F_t *f, H5O_t *oh, haddr_t addr, FILE *stream, int indent, int
chunkno = oh->mesg[i].chunkno;
if (chunkno >= oh->nchunks)
HDfprintf(stream, "*** BAD CHUNK NUMBER\n");
- HDfprintf(stream, "%*s%-*s (%Zu, %Zu) bytes\n", indent + 3, "", MAX(0, fwidth - 3),
+ HDfprintf(stream, "%*s%-*s (%zu, %zu) bytes\n", indent + 3, "", MAX(0, fwidth - 3),
"Raw message data (offset, size) in chunk:",
(size_t)(oh->mesg[i].raw - oh->chunk[chunkno].image), oh->mesg[i].raw_size);
@@ -505,7 +505,6 @@ done:
* Return: Non-negative on success/Negative on failure
*
* Programmer: Robb Matzke
- * matzke@llnl.gov
* Aug 6 1997
*
*-------------------------------------------------------------------------
diff --git a/src/H5Odeprec.c b/src/H5Odeprec.c
index 9e75e61..5e13f9f 100644
--- a/src/H5Odeprec.c
+++ b/src/H5Odeprec.c
@@ -13,7 +13,7 @@
/*-------------------------------------------------------------------------
*
- * Purpose: Deprecated functions from the H5O interface. These
+ * Purpose: Deprecated functions from the H5O interface. These
* functions are here for compatibility purposes and may be
* removed in the future. Applications should switch to the
* newer APIs.
@@ -240,7 +240,7 @@ H5O__get_info_old(H5VL_object_t *vol_obj, H5VL_loc_params_t *loc_params, H5O_inf
void *vol_obj_data;
if (NULL == (vol_obj_data = H5VL_object_data(vol_obj)))
- HGOTO_ERROR(H5E_VOL, H5E_CANTGET, FAIL, "can't get underlying VOL object")
+ HGOTO_ERROR(H5E_OHDR, H5E_CANTGET, FAIL, "can't get underlying VOL object")
oinfo->fileno = dm_info.fileno;
oinfo->type = dm_info.type;
@@ -368,7 +368,7 @@ H5Oopen_by_addr(hid_t loc_id, haddr_t addr)
/* Register the object's ID */
if ((ret_value = H5VL_register(opened_type, opened_obj, vol_obj->connector, TRUE)) < 0)
- HGOTO_ERROR(H5E_OHDR, H5E_CANTREGISTER, H5I_INVALID_HID, "unable to atomize object handle")
+ HGOTO_ERROR(H5E_OHDR, H5E_CANTREGISTER, H5I_INVALID_HID, "unable to register object handle")
done:
FUNC_LEAVE_API(ret_value)
@@ -385,14 +385,14 @@ done:
*-------------------------------------------------------------------------
*/
herr_t
-H5Oget_info1(hid_t loc_id, H5O_info1_t *oinfo)
+H5Oget_info1(hid_t loc_id, H5O_info1_t *oinfo /*out*/)
{
H5VL_object_t * vol_obj = NULL; /* Object of loc_id */
H5VL_loc_params_t loc_params;
herr_t ret_value = SUCCEED; /* Return value */
FUNC_ENTER_API(FAIL)
- H5TRACE2("e", "i*!", loc_id, oinfo);
+ H5TRACE2("e", "ix", loc_id, oinfo);
/* Check args */
if (!oinfo)
@@ -425,14 +425,14 @@ done:
*-------------------------------------------------------------------------
*/
herr_t
-H5Oget_info_by_name1(hid_t loc_id, const char *name, H5O_info1_t *oinfo, hid_t lapl_id)
+H5Oget_info_by_name1(hid_t loc_id, const char *name, H5O_info1_t *oinfo /*out*/, hid_t lapl_id)
{
H5VL_object_t * vol_obj = NULL; /* object of loc_id */
H5VL_loc_params_t loc_params;
herr_t ret_value = SUCCEED; /* Return value */
FUNC_ENTER_API(FAIL)
- H5TRACE4("e", "i*s*!i", loc_id, name, oinfo, lapl_id);
+ H5TRACE4("e", "i*sxi", loc_id, name, oinfo, lapl_id);
/* Check args */
if (!name)
@@ -480,14 +480,14 @@ done:
*/
herr_t
H5Oget_info_by_idx1(hid_t loc_id, const char *group_name, H5_index_t idx_type, H5_iter_order_t order,
- hsize_t n, H5O_info1_t *oinfo, hid_t lapl_id)
+ hsize_t n, H5O_info1_t *oinfo /*out*/, hid_t lapl_id)
{
H5VL_object_t * vol_obj = NULL; /* object of loc_id */
H5VL_loc_params_t loc_params;
herr_t ret_value = SUCCEED; /* Return value */
FUNC_ENTER_API(FAIL)
- H5TRACE7("e", "i*sIiIoh*!i", loc_id, group_name, idx_type, order, n, oinfo, lapl_id);
+ H5TRACE7("e", "i*sIiIohxi", loc_id, group_name, idx_type, order, n, oinfo, lapl_id);
/* Check args */
if (!group_name || !*group_name)
@@ -538,7 +538,7 @@ done:
*-------------------------------------------------------------------------
*/
herr_t
-H5Oget_info2(hid_t loc_id, H5O_info1_t *oinfo, unsigned fields)
+H5Oget_info2(hid_t loc_id, H5O_info1_t *oinfo /*out*/, unsigned fields)
{
H5VL_object_t * vol_obj; /* Object of loc_id */
H5VL_loc_params_t loc_params;
@@ -546,7 +546,7 @@ H5Oget_info2(hid_t loc_id, H5O_info1_t *oinfo, unsigned fields)
herr_t ret_value = SUCCEED; /* Return value */
FUNC_ENTER_API(FAIL)
- H5TRACE3("e", "i*!Iu", loc_id, oinfo, fields);
+ H5TRACE3("e", "ixIu", loc_id, oinfo, fields);
/* Check args */
if (!oinfo)
@@ -593,7 +593,8 @@ done:
*-------------------------------------------------------------------------
*/
herr_t
-H5Oget_info_by_name2(hid_t loc_id, const char *name, H5O_info1_t *oinfo, unsigned fields, hid_t lapl_id)
+H5Oget_info_by_name2(hid_t loc_id, const char *name, H5O_info1_t *oinfo /*out*/, unsigned fields,
+ hid_t lapl_id)
{
H5VL_object_t * vol_obj; /* Object of loc_id */
H5VL_loc_params_t loc_params;
@@ -601,7 +602,7 @@ H5Oget_info_by_name2(hid_t loc_id, const char *name, H5O_info1_t *oinfo, unsigne
herr_t ret_value = SUCCEED; /* Return value */
FUNC_ENTER_API(FAIL)
- H5TRACE5("e", "i*s*!Iui", loc_id, name, oinfo, fields, lapl_id);
+ H5TRACE5("e", "i*sxIui", loc_id, name, oinfo, fields, lapl_id);
/* Check args */
if (!name)
@@ -661,7 +662,7 @@ done:
*/
herr_t
H5Oget_info_by_idx2(hid_t loc_id, const char *group_name, H5_index_t idx_type, H5_iter_order_t order,
- hsize_t n, H5O_info1_t *oinfo, unsigned fields, hid_t lapl_id)
+ hsize_t n, H5O_info1_t *oinfo /*out*/, unsigned fields, hid_t lapl_id)
{
H5VL_object_t * vol_obj; /* Object of loc_id */
H5VL_loc_params_t loc_params;
@@ -669,7 +670,7 @@ H5Oget_info_by_idx2(hid_t loc_id, const char *group_name, H5_index_t idx_type, H
herr_t ret_value = SUCCEED; /* Return value */
FUNC_ENTER_API(FAIL)
- H5TRACE8("e", "i*sIiIoh*!Iui", loc_id, group_name, idx_type, order, n, oinfo, fields, lapl_id);
+ H5TRACE8("e", "i*sIiIohxIui", loc_id, group_name, idx_type, order, n, oinfo, fields, lapl_id);
/* Check args */
if (!group_name || !*group_name)
diff --git a/src/H5Odrvinfo.c b/src/H5Odrvinfo.c
index 5023d3e..8bebc6d 100644
--- a/src/H5Odrvinfo.c
+++ b/src/H5Odrvinfo.c
@@ -11,7 +11,7 @@
* help@hdfgroup.org. *
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
-/* Programmer: Quincey Koziol <koziol@hdfgroup.org>
+/* Programmer: Quincey Koziol
* Thursday, March 1, 2007
*
* Purpose: A message holding driver info settings
@@ -25,11 +25,11 @@
#include "H5Opkg.h" /* Object headers */
#include "H5MMprivate.h" /* Memory management */
-static void * H5O_drvinfo_decode(H5F_t *f, H5O_t *open_oh, unsigned mesg_flags, unsigned *ioflags,
- size_t p_size, const uint8_t *p);
-static herr_t H5O_drvinfo_encode(H5F_t *f, hbool_t disable_shared, uint8_t *p, const void *_mesg);
-static void * H5O_drvinfo_copy(const void *_mesg, void *_dest);
-static size_t H5O_drvinfo_size(const H5F_t *f, hbool_t disable_shared, const void *_mesg);
+static void * H5O__drvinfo_decode(H5F_t *f, H5O_t *open_oh, unsigned mesg_flags, unsigned *ioflags,
+ size_t p_size, const uint8_t *p);
+static herr_t H5O__drvinfo_encode(H5F_t *f, hbool_t disable_shared, uint8_t *p, const void *_mesg);
+static void * H5O__drvinfo_copy(const void *_mesg, void *_dest);
+static size_t H5O__drvinfo_size(const H5F_t *f, hbool_t disable_shared, const void *_mesg);
static herr_t H5O__drvinfo_reset(void *_mesg);
static herr_t H5O__drvinfo_debug(H5F_t *f, const void *_mesg, FILE *stream, int indent, int fwidth);
@@ -38,16 +38,16 @@ const H5O_msg_class_t H5O_MSG_DRVINFO[1] = {{
H5O_DRVINFO_ID, /*message id number */
"driver info", /*message name for debugging */
sizeof(H5O_drvinfo_t), /*native message size */
- 0, /* messages are sharable? */
- H5O_drvinfo_decode, /*decode message */
- H5O_drvinfo_encode, /*encode message */
- H5O_drvinfo_copy, /*copy the native value */
- H5O_drvinfo_size, /*raw message size */
+ 0, /* messages are sharable? */
+ H5O__drvinfo_decode, /*decode message */
+ H5O__drvinfo_encode, /*encode message */
+ H5O__drvinfo_copy, /*copy the native value */
+ H5O__drvinfo_size, /*raw message size */
H5O__drvinfo_reset, /*free internal memory */
NULL, /* free method */
NULL, /* file delete method */
NULL, /* link method */
- NULL, /*set share method */
+ NULL, /*set share method */
NULL, /*can share method */
NULL, /* pre copy native value to file */
NULL, /* copy native value to file */
@@ -61,7 +61,7 @@ const H5O_msg_class_t H5O_MSG_DRVINFO[1] = {{
#define H5O_DRVINFO_VERSION 0
/*-------------------------------------------------------------------------
- * Function: H5O_drvinfo_decode
+ * Function: H5O__drvinfo_decode
*
* Purpose: Decode a shared message table message and return a pointer
* to a newly allocated H5O_drvinfo_t struct.
@@ -75,13 +75,14 @@ const H5O_msg_class_t H5O_MSG_DRVINFO[1] = {{
*-------------------------------------------------------------------------
*/
static void *
-H5O_drvinfo_decode(H5F_t H5_ATTR_UNUSED *f, H5O_t H5_ATTR_UNUSED *open_oh, unsigned H5_ATTR_UNUSED mesg_flags,
- unsigned H5_ATTR_UNUSED *ioflags, size_t H5_ATTR_UNUSED p_size, const uint8_t *p)
+H5O__drvinfo_decode(H5F_t H5_ATTR_UNUSED *f, H5O_t H5_ATTR_UNUSED *open_oh,
+ unsigned H5_ATTR_UNUSED mesg_flags, unsigned H5_ATTR_UNUSED *ioflags,
+ size_t H5_ATTR_UNUSED p_size, const uint8_t *p)
{
H5O_drvinfo_t *mesg; /* Native message */
void * ret_value = NULL; /* Return value */
- FUNC_ENTER_NOAPI_NOINIT
+ FUNC_ENTER_STATIC
/* Sanity check */
HDassert(f);
@@ -118,10 +119,10 @@ H5O_drvinfo_decode(H5F_t H5_ATTR_UNUSED *f, H5O_t H5_ATTR_UNUSED *open_oh, unsig
done:
FUNC_LEAVE_NOAPI(ret_value)
-} /* end H5O_drvinfo_decode() */
+} /* end H5O__drvinfo_decode() */
/*-------------------------------------------------------------------------
- * Function: H5O_drvinfo_encode
+ * Function: H5O__drvinfo_encode
*
* Purpose: Encode a v1 B-tree 'K' value message.
*
@@ -133,12 +134,12 @@ done:
*-------------------------------------------------------------------------
*/
static herr_t
-H5O_drvinfo_encode(H5F_t H5_ATTR_UNUSED *f, hbool_t H5_ATTR_UNUSED disable_shared, uint8_t *p,
- const void *_mesg)
+H5O__drvinfo_encode(H5F_t H5_ATTR_UNUSED *f, hbool_t H5_ATTR_UNUSED disable_shared, uint8_t *p,
+ const void *_mesg)
{
const H5O_drvinfo_t *mesg = (const H5O_drvinfo_t *)_mesg;
- FUNC_ENTER_NOAPI_NOINIT_NOERR
+ FUNC_ENTER_STATIC_NOERR
/* Sanity check */
HDassert(f);
@@ -154,10 +155,10 @@ H5O_drvinfo_encode(H5F_t H5_ATTR_UNUSED *f, hbool_t H5_ATTR_UNUSED disable_share
H5MM_memcpy(p, mesg->buf, mesg->len);
FUNC_LEAVE_NOAPI(SUCCEED)
-} /* end H5O_drvinfo_encode() */
+} /* end H5O__drvinfo_encode() */
/*-------------------------------------------------------------------------
- * Function: H5O_drvinfo_copy
+ * Function: H5O__drvinfo_copy
*
* Purpose: Copies a message from _MESG to _DEST, allocating _DEST if
* necessary.
@@ -171,13 +172,13 @@ H5O_drvinfo_encode(H5F_t H5_ATTR_UNUSED *f, hbool_t H5_ATTR_UNUSED disable_share
*-------------------------------------------------------------------------
*/
static void *
-H5O_drvinfo_copy(const void *_mesg, void *_dest)
+H5O__drvinfo_copy(const void *_mesg, void *_dest)
{
const H5O_drvinfo_t *mesg = (const H5O_drvinfo_t *)_mesg;
H5O_drvinfo_t * dest = (H5O_drvinfo_t *)_dest;
void * ret_value = NULL; /* Return value */
- FUNC_ENTER_NOAPI_NOINIT
+ FUNC_ENTER_STATIC
/* Sanity check */
HDassert(mesg);
@@ -202,10 +203,10 @@ H5O_drvinfo_copy(const void *_mesg, void *_dest)
done:
FUNC_LEAVE_NOAPI(ret_value)
-} /* end H5O_drvinfo_copy() */
+} /* end H5O__drvinfo_copy() */
/*-------------------------------------------------------------------------
- * Function: H5O_drvinfo_size
+ * Function: H5O__drvinfo_size
*
* Purpose: Returns the size of the raw message in bytes not counting the
* message type or size fields, but only the data fields.
@@ -219,12 +220,12 @@ done:
*-------------------------------------------------------------------------
*/
static size_t
-H5O_drvinfo_size(const H5F_t H5_ATTR_UNUSED *f, hbool_t H5_ATTR_UNUSED disable_shared, const void *_mesg)
+H5O__drvinfo_size(const H5F_t H5_ATTR_UNUSED *f, hbool_t H5_ATTR_UNUSED disable_shared, const void *_mesg)
{
const H5O_drvinfo_t *mesg = (const H5O_drvinfo_t *)_mesg;
size_t ret_value = 0; /* Return value */
- FUNC_ENTER_NOAPI_NOINIT_NOERR
+ FUNC_ENTER_STATIC_NOERR
/* Sanity check */
HDassert(f);
@@ -236,7 +237,7 @@ H5O_drvinfo_size(const H5F_t H5_ATTR_UNUSED *f, hbool_t H5_ATTR_UNUSED disable_s
mesg->len; /* Buffer */
FUNC_LEAVE_NOAPI(ret_value)
-} /* end H5O_drvinfo_size() */
+} /* end H5O__drvinfo_size() */
/*-------------------------------------------------------------------------
* Function: H5O__drvinfo_reset
@@ -247,7 +248,6 @@ H5O_drvinfo_size(const H5F_t H5_ATTR_UNUSED *f, hbool_t H5_ATTR_UNUSED disable_s
* Return: Non-negative on success/Negative on failure
*
* Programmer: Quincey Koziol
- * koziol@hdfgroup.org
* Mar 1 2007
*
*-------------------------------------------------------------------------
@@ -295,7 +295,7 @@ H5O__drvinfo_debug(H5F_t H5_ATTR_UNUSED *f, const void *_mesg, FILE *stream, int
HDassert(fwidth >= 0);
HDfprintf(stream, "%*s%-*s %s\n", indent, "", fwidth, "Driver name:", mesg->name);
- HDfprintf(stream, "%*s%-*s %Zu\n", indent, "", fwidth, "Buffer size:", mesg->len);
+ HDfprintf(stream, "%*s%-*s %zu\n", indent, "", fwidth, "Buffer size:", mesg->len);
FUNC_LEAVE_NOAPI(SUCCEED)
} /* end H5O__drvinfo_debug() */
diff --git a/src/H5Odtype.c b/src/H5Odtype.c
index a0508fd..1be9522 100644
--- a/src/H5Odtype.c
+++ b/src/H5Odtype.c
@@ -26,17 +26,17 @@
#include "H5VMprivate.h" /* Vectors and arrays */
/* PRIVATE PROTOTYPES */
-static herr_t H5O_dtype_encode(H5F_t *f, uint8_t *p, const void *mesg);
-static void *H5O_dtype_decode(H5F_t *f, H5O_t *open_oh, unsigned mesg_flags, unsigned *ioflags, size_t p_size,
- const uint8_t *p);
-static void *H5O_dtype_copy(const void *_mesg, void *_dest);
-static size_t H5O_dtype_size(const H5F_t *f, const void *_mesg);
+static herr_t H5O__dtype_encode(H5F_t *f, uint8_t *p, const void *mesg);
+static void * H5O__dtype_decode(H5F_t *f, H5O_t *open_oh, unsigned mesg_flags, unsigned *ioflags,
+ size_t p_size, const uint8_t *p);
+static void * H5O__dtype_copy(const void *_mesg, void *_dest);
+static size_t H5O__dtype_size(const H5F_t *f, const void *_mesg);
static herr_t H5O__dtype_reset(void *_mesg);
static herr_t H5O__dtype_free(void *_mesg);
-static herr_t H5O_dtype_set_share(void *_mesg, const H5O_shared_t *sh);
-static htri_t H5O_dtype_can_share(const void *_mesg);
-static herr_t H5O_dtype_pre_copy_file(H5F_t *file_src, const void *mesg_src, hbool_t *deleted,
- const H5O_copy_t *cpy_info, void *_udata);
+static herr_t H5O__dtype_set_share(void *_mesg, const H5O_shared_t *sh);
+static htri_t H5O__dtype_can_share(const void *_mesg);
+static herr_t H5O__dtype_pre_copy_file(H5F_t *file_src, const void *mesg_src, hbool_t *deleted,
+ const H5O_copy_t *cpy_info, void *_udata);
static void * H5O__dtype_copy_file(H5F_t *file_src, const H5O_msg_class_t *mesg_type, void *native_src,
H5F_t *file_dst, hbool_t *recompute_size, H5O_copy_t *cpy_info,
void *udata);
@@ -46,22 +46,22 @@ static herr_t H5O__dtype_debug(H5F_t *f, const void *_mesg, FILE *stream, int in
/* Set up & include shared message "interface" info */
#define H5O_SHARED_TYPE H5O_MSG_DTYPE
-#define H5O_SHARED_DECODE H5O_dtype_shared_decode
-#define H5O_SHARED_DECODE_REAL H5O_dtype_decode
-#define H5O_SHARED_ENCODE H5O_dtype_shared_encode
-#define H5O_SHARED_ENCODE_REAL H5O_dtype_encode
-#define H5O_SHARED_SIZE H5O_dtype_shared_size
-#define H5O_SHARED_SIZE_REAL H5O_dtype_size
+#define H5O_SHARED_DECODE H5O__dtype_shared_decode
+#define H5O_SHARED_DECODE_REAL H5O__dtype_decode
+#define H5O_SHARED_ENCODE H5O__dtype_shared_encode
+#define H5O_SHARED_ENCODE_REAL H5O__dtype_encode
+#define H5O_SHARED_SIZE H5O__dtype_shared_size
+#define H5O_SHARED_SIZE_REAL H5O__dtype_size
#define H5O_SHARED_DELETE H5O__dtype_shared_delete
#undef H5O_SHARED_DELETE_REAL
#define H5O_SHARED_LINK H5O__dtype_shared_link
#undef H5O_SHARED_LINK_REAL
#define H5O_SHARED_COPY_FILE H5O__dtype_shared_copy_file
#define H5O_SHARED_COPY_FILE_REAL H5O__dtype_copy_file
-#define H5O_SHARED_POST_COPY_FILE H5O_dtype_shared_post_copy_file
+#define H5O_SHARED_POST_COPY_FILE H5O__dtype_shared_post_copy_file
#undef H5O_SHARED_POST_COPY_FILE_REAL
#define H5O_SHARED_POST_COPY_FILE_UPD H5O__dtype_shared_post_copy_upd
-#define H5O_SHARED_DEBUG H5O_dtype_shared_debug
+#define H5O_SHARED_DEBUG H5O__dtype_shared_debug
#define H5O_SHARED_DEBUG_REAL H5O__dtype_debug
#include "H5Oshared.h" /* Shared Object Header Message Callbacks */
@@ -90,26 +90,26 @@ const H5O_msg_class_t H5O_MSG_DTYPE[1] = {{
"datatype", /* message name for debugging */
sizeof(H5T_t), /* native message size */
H5O_SHARE_IS_SHARABLE | H5O_SHARE_IN_OHDR, /* messages are sharable? */
- H5O_dtype_shared_decode, /* decode message */
- H5O_dtype_shared_encode, /* encode message */
- H5O_dtype_copy, /* copy the native value */
- H5O_dtype_shared_size, /* size of raw message */
+ H5O__dtype_shared_decode, /* decode message */
+ H5O__dtype_shared_encode, /* encode message */
+ H5O__dtype_copy, /* copy the native value */
+ H5O__dtype_shared_size, /* size of raw message */
H5O__dtype_reset, /* reset method */
H5O__dtype_free, /* free method */
H5O__dtype_shared_delete, /* file delete method */
H5O__dtype_shared_link, /* link method */
- H5O_dtype_set_share, /* set share method */
- H5O_dtype_can_share, /* can share method */
- H5O_dtype_pre_copy_file, /* pre copy native value to file */
+ H5O__dtype_set_share, /* set share method */
+ H5O__dtype_can_share, /* can share method */
+ H5O__dtype_pre_copy_file, /* pre copy native value to file */
H5O__dtype_shared_copy_file, /* copy native value to file */
- H5O_dtype_shared_post_copy_file, /* post copy native value to file */
+ H5O__dtype_shared_post_copy_file, /* post copy native value to file */
NULL, /* get creation index */
NULL, /* set creation index */
- H5O_dtype_shared_debug /* debug the message */
+ H5O__dtype_shared_debug /* debug the message */
}};
/*-------------------------------------------------------------------------
- * Function: H5O_dtype_decode_helper
+ * Function: H5O__dtype_decode_helper
*
* Purpose: Decodes a datatype
*
@@ -124,14 +124,14 @@ const H5O_msg_class_t H5O_MSG_DTYPE[1] = {{
*-------------------------------------------------------------------------
*/
static htri_t
-H5O_dtype_decode_helper(unsigned *ioflags /*in,out*/, const uint8_t **pp, H5T_t *dt)
+H5O__dtype_decode_helper(unsigned *ioflags /*in,out*/, const uint8_t **pp, H5T_t *dt)
{
unsigned flags, version;
unsigned i;
size_t z;
htri_t ret_value = FALSE; /* Return value */
- FUNC_ENTER_NOAPI_NOINIT
+ FUNC_ENTER_STATIC
/* check args */
HDassert(pp && *pp);
@@ -327,7 +327,7 @@ H5O_dtype_decode_helper(unsigned *ioflags /*in,out*/, const uint8_t **pp, H5T_t
HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "memory allocation failed")
/* Decode the field's datatype information */
- if ((can_upgrade = H5O_dtype_decode_helper(ioflags, pp, temp_type)) < 0) {
+ if ((can_upgrade = H5O__dtype_decode_helper(ioflags, pp, temp_type)) < 0) {
for (j = 0; j <= i; j++)
H5MM_xfree(dt->shared->u.compnd.memb[j].name);
H5MM_xfree(dt->shared->u.compnd.memb);
@@ -469,7 +469,7 @@ H5O_dtype_decode_helper(unsigned *ioflags /*in,out*/, const uint8_t **pp, H5T_t
dt->shared->u.enumer.nmembs = dt->shared->u.enumer.nalloc = flags & 0xffff;
if (NULL == (dt->shared->parent = H5T__alloc()))
HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "memory allocation failed")
- if (H5O_dtype_decode_helper(ioflags, pp, dt->shared->parent) < 0)
+ if (H5O__dtype_decode_helper(ioflags, pp, dt->shared->parent) < 0)
HGOTO_ERROR(H5E_DATATYPE, H5E_CANTDECODE, FAIL, "unable to decode parent datatype")
/* Check if the parent of this enum has a version greater than the
@@ -512,7 +512,7 @@ H5O_dtype_decode_helper(unsigned *ioflags /*in,out*/, const uint8_t **pp, H5T_t
/* Decode base type of VL information */
if (NULL == (dt->shared->parent = H5T__alloc()))
HGOTO_ERROR(H5E_DATATYPE, H5E_NOSPACE, FAIL, "memory allocation failed")
- if (H5O_dtype_decode_helper(ioflags, pp, dt->shared->parent) < 0)
+ if (H5O__dtype_decode_helper(ioflags, pp, dt->shared->parent) < 0)
HGOTO_ERROR(H5E_DATATYPE, H5E_CANTDECODE, FAIL, "unable to decode VL parent type")
/* Check if the parent of this vlen has a version greater than the
@@ -552,7 +552,7 @@ H5O_dtype_decode_helper(unsigned *ioflags /*in,out*/, const uint8_t **pp, H5T_t
/* Decode base type of array */
if (NULL == (dt->shared->parent = H5T__alloc()))
HGOTO_ERROR(H5E_DATATYPE, H5E_NOSPACE, FAIL, "memory allocation failed")
- if (H5O_dtype_decode_helper(ioflags, pp, dt->shared->parent) < 0)
+ if (H5O__dtype_decode_helper(ioflags, pp, dt->shared->parent) < 0)
HGOTO_ERROR(H5E_DATATYPE, H5E_CANTDECODE, FAIL, "unable to decode array parent type")
/* Check if the parent of this array has a version greater than the
@@ -577,19 +577,20 @@ H5O_dtype_decode_helper(unsigned *ioflags /*in,out*/, const uint8_t **pp, H5T_t
} /* end switch */
done:
- if (ret_value < 0) {
+ if (ret_value < 0)
if (dt != NULL) {
- if (dt->shared != NULL)
+ if (dt->shared != NULL) {
+ HDassert(!dt->shared->owned_vol_obj);
dt->shared = H5FL_FREE(H5T_shared_t, dt->shared);
+ } /* end if */
dt = H5FL_FREE(H5T_t, dt);
} /* end if */
- } /* end if */
FUNC_LEAVE_NOAPI(ret_value)
-} /* end H5O_dtype_decode_helper() */
+} /* end H5O__dtype_decode_helper() */
/*-------------------------------------------------------------------------
- * Function: H5O_dtype_encode_helper
+ * Function: H5O__dtype_encode_helper
*
* Purpose: Encodes a datatype.
*
@@ -605,7 +606,7 @@ done:
*-------------------------------------------------------------------------
*/
static herr_t
-H5O_dtype_encode_helper(uint8_t **pp, const H5T_t *dt)
+H5O__dtype_encode_helper(uint8_t **pp, const H5T_t *dt)
{
unsigned flags = 0;
uint8_t *hdr = (uint8_t *)*pp;
@@ -613,7 +614,7 @@ H5O_dtype_encode_helper(uint8_t **pp, const H5T_t *dt)
size_t n, z;
herr_t ret_value = SUCCEED; /* Return value */
- FUNC_ENTER_NOAPI_NOINIT
+ FUNC_ENTER_STATIC
/* check args */
HDassert(pp && *pp);
@@ -978,7 +979,7 @@ H5O_dtype_encode_helper(uint8_t **pp, const H5T_t *dt)
} /* end if */
/* Subtype */
- if (H5O_dtype_encode_helper(pp, dt->shared->u.compnd.memb[i].type) < 0)
+ if (H5O__dtype_encode_helper(pp, dt->shared->u.compnd.memb[i].type) < 0)
HGOTO_ERROR(H5E_DATATYPE, H5E_CANTENCODE, FAIL, "unable to encode member type")
} /* end for */
} break;
@@ -999,7 +1000,7 @@ H5O_dtype_encode_helper(uint8_t **pp, const H5T_t *dt)
flags = dt->shared->u.enumer.nmembs & 0xffff;
/* Parent type */
- if (H5O_dtype_encode_helper(pp, dt->shared->parent) < 0)
+ if (H5O__dtype_encode_helper(pp, dt->shared->parent) < 0)
HGOTO_ERROR(H5E_DATATYPE, H5E_CANTENCODE, FAIL, "unable to encode parent datatype")
/* Names, each a multiple of eight bytes */
@@ -1036,7 +1037,7 @@ H5O_dtype_encode_helper(uint8_t **pp, const H5T_t *dt)
} /* end if */
/* Encode base type of VL information */
- if (H5O_dtype_encode_helper(pp, dt->shared->parent) < 0)
+ if (H5O__dtype_encode_helper(pp, dt->shared->parent) < 0)
HGOTO_ERROR(H5E_DATATYPE, H5E_CANTENCODE, FAIL, "unable to encode VL parent type")
break;
@@ -1074,7 +1075,7 @@ H5O_dtype_encode_helper(uint8_t **pp, const H5T_t *dt)
} /* end if */
/* Encode base type of array's information */
- if (H5O_dtype_encode_helper(pp, dt->shared->parent) < 0)
+ if (H5O__dtype_encode_helper(pp, dt->shared->parent) < 0)
HGOTO_ERROR(H5E_DATATYPE, H5E_CANTENCODE, FAIL, "unable to encode VL parent type")
break;
@@ -1093,19 +1094,22 @@ H5O_dtype_encode_helper(uint8_t **pp, const H5T_t *dt)
done:
FUNC_LEAVE_NOAPI(ret_value)
-} /* end H5O_dtype_encode_helper() */
+} /* end H5O__dtype_encode_helper() */
/*--------------------------------------------------------------------------
NAME
- H5O_dtype_decode
+ H5O__dtype_decode
PURPOSE
Decode a message and return a pointer to a memory struct
with the decoded information
USAGE
- void *H5O_dtype_decode(f, mesg_flags, p)
- H5F_t *f; IN: pointer to the HDF5 file struct
+ void *H5O__dtype_decode(f, mesg_flags, p)
+ H5F_t *f; IN: pointer to the HDF5 file struct
+ H5O_t *open_oh; IN: pointer to the object header
unsigned mesg_flags; IN: Message flags to influence decoding
- const uint8 *p; IN: the raw information buffer
+ unsigned *ioflags; IN/OUT: flags for decoding
+ size_t p_size; IN: size of buffer *p
+ const uint8_t *p; IN: the raw information buffer
RETURNS
Pointer to the new message in native order on success, NULL on failure
DESCRIPTION
@@ -1114,13 +1118,13 @@ done:
function using malloc() and is returned to the caller.
--------------------------------------------------------------------------*/
static void *
-H5O_dtype_decode(H5F_t H5_ATTR_UNUSED *f, H5O_t H5_ATTR_UNUSED *open_oh, unsigned H5_ATTR_UNUSED mesg_flags,
- unsigned *ioflags /*in,out*/, size_t H5_ATTR_UNUSED p_size, const uint8_t *p)
+H5O__dtype_decode(H5F_t H5_ATTR_UNUSED *f, H5O_t H5_ATTR_UNUSED *open_oh, unsigned H5_ATTR_UNUSED mesg_flags,
+ unsigned *ioflags /*in,out*/, size_t H5_ATTR_UNUSED p_size, const uint8_t *p)
{
H5T_t *dt = NULL;
void * ret_value = NULL; /* Return value */
- FUNC_ENTER_NOAPI_NOINIT
+ FUNC_ENTER_STATIC
/* check args */
HDassert(p);
@@ -1130,7 +1134,7 @@ H5O_dtype_decode(H5F_t H5_ATTR_UNUSED *f, H5O_t H5_ATTR_UNUSED *open_oh, unsigne
HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "memory allocation failed")
/* Perform actual decode of message */
- if (H5O_dtype_decode_helper(ioflags, &p, dt) < 0)
+ if (H5O__dtype_decode_helper(ioflags, &p, dt) < 0)
HGOTO_ERROR(H5E_DATATYPE, H5E_CANTDECODE, NULL, "can't decode type")
/* Set return value */
@@ -1138,15 +1142,15 @@ H5O_dtype_decode(H5F_t H5_ATTR_UNUSED *f, H5O_t H5_ATTR_UNUSED *open_oh, unsigne
done:
FUNC_LEAVE_NOAPI(ret_value)
-} /* end H5O_dtype_decode() */
+} /* end H5O__dtype_decode() */
/*--------------------------------------------------------------------------
NAME
- H5O_dtype_encode
+ H5O__dtype_encode
PURPOSE
Encode a simple datatype message
USAGE
- herr_t H5O_dtype_encode(f, raw_size, p, mesg)
+ herr_t H5O__dtype_encode(f, raw_size, p, mesg)
H5F_t *f; IN: pointer to the HDF5 file struct
size_t raw_size; IN: size of the raw information buffer
const uint8 *p; IN: the raw information buffer
@@ -1158,12 +1162,12 @@ done:
message in the "raw" disk form.
--------------------------------------------------------------------------*/
static herr_t
-H5O_dtype_encode(H5F_t H5_ATTR_UNUSED *f, uint8_t *p, const void *mesg)
+H5O__dtype_encode(H5F_t H5_ATTR_UNUSED *f, uint8_t *p, const void *mesg)
{
const H5T_t *dt = (const H5T_t *)mesg;
herr_t ret_value = SUCCEED; /* Return value */
- FUNC_ENTER_NOAPI_NOINIT
+ FUNC_ENTER_STATIC
/* check args */
HDassert(f);
@@ -1171,20 +1175,20 @@ H5O_dtype_encode(H5F_t H5_ATTR_UNUSED *f, uint8_t *p, const void *mesg)
HDassert(dt);
/* encode */
- if (H5O_dtype_encode_helper(&p, dt) < 0)
+ if (H5O__dtype_encode_helper(&p, dt) < 0)
HGOTO_ERROR(H5E_DATATYPE, H5E_CANTENCODE, FAIL, "can't encode type")
done:
FUNC_LEAVE_NOAPI(ret_value)
-} /* end H5O_dtype_encode() */
+} /* end H5O__dtype_encode() */
/*--------------------------------------------------------------------------
NAME
- H5O_dtype_copy
+ H5O__dtype_copy
PURPOSE
Copies a message from MESG to DEST, allocating DEST if necessary.
USAGE
- void *H5O_dtype_copy(mesg, dest)
+ void *H5O__dtype_copy(mesg, dest)
const void *mesg; IN: Pointer to the source simple datatype
struct
const void *dest; IN: Pointer to the destination simple
@@ -1196,13 +1200,13 @@ done:
allocating the destination structure if necessary.
--------------------------------------------------------------------------*/
static void *
-H5O_dtype_copy(const void *_src, void *_dst)
+H5O__dtype_copy(const void *_src, void *_dst)
{
const H5T_t *src = (const H5T_t *)_src;
H5T_t * dst;
void * ret_value = NULL; /* Return value */
- FUNC_ENTER_NOAPI_NOINIT
+ FUNC_ENTER_STATIC
/* check args */
HDassert(src);
@@ -1223,15 +1227,15 @@ H5O_dtype_copy(const void *_src, void *_dst)
done:
FUNC_LEAVE_NOAPI(ret_value)
-} /* end H5O_dtype_copy() */
+} /* end H5O__dtype_copy() */
/*--------------------------------------------------------------------------
NAME
- H5O_dtype_size
+ H5O__dtype_size
PURPOSE
Return the raw message size in bytes
USAGE
- void *H5O_dtype_size(f, mesg)
+ void *H5O__dtype_size(f, mesg)
H5F_t *f; IN: pointer to the HDF5 file struct
const void *mesg; IN: Pointer to the source simple datatype struct
RETURNS
@@ -1242,13 +1246,13 @@ done:
portion of the message). It doesn't take into account alignment.
--------------------------------------------------------------------------*/
static size_t
-H5O_dtype_size(const H5F_t *f, const void *_mesg)
+H5O__dtype_size(const H5F_t *f, const void *_mesg)
{
const H5T_t *dt = (const H5T_t *)_mesg;
unsigned u; /* Local index variable */
size_t ret_value = 0; /* Return value */
- FUNC_ENTER_NOAPI_NOINIT_NOERR
+ FUNC_ENTER_STATIC_NOERR
HDassert(f);
HDassert(dt);
@@ -1311,12 +1315,12 @@ H5O_dtype_size(const H5F_t *f, const void *_mesg)
4 + /*permutation*/
4 + /*reserved*/
16; /*dimensions*/
- ret_value += H5O_dtype_size(f, dt->shared->u.compnd.memb[u].type);
+ ret_value += H5O__dtype_size(f, dt->shared->u.compnd.memb[u].type);
} /* end for */
} break;
case H5T_ENUM:
- ret_value += H5O_dtype_size(f, dt->shared->parent);
+ ret_value += H5O__dtype_size(f, dt->shared->parent);
for (u = 0; u < dt->shared->u.enumer.nmembs; u++) {
size_t name_len; /* Length of field's name */
@@ -1333,7 +1337,7 @@ H5O_dtype_size(const H5F_t *f, const void *_mesg)
break;
case H5T_VLEN:
- ret_value += H5O_dtype_size(f, dt->shared->parent);
+ ret_value += H5O__dtype_size(f, dt->shared->parent);
break;
case H5T_ARRAY:
@@ -1343,7 +1347,7 @@ H5O_dtype_size(const H5F_t *f, const void *_mesg)
ret_value += 4 * dt->shared->u.array.ndims; /* dimensions */
if (dt->shared->version < H5O_DTYPE_VERSION_3)
ret_value += 4 * dt->shared->u.array.ndims; /* dimension permutations */
- ret_value += H5O_dtype_size(f, dt->shared->parent);
+ ret_value += H5O__dtype_size(f, dt->shared->parent);
break;
case H5T_NO_CLASS:
@@ -1356,7 +1360,7 @@ H5O_dtype_size(const H5F_t *f, const void *_mesg)
} /* end switch */
FUNC_LEAVE_NOAPI(ret_value)
-} /* H5O_dtype_size() */
+} /* H5O__dtype_size() */
/*-------------------------------------------------------------------------
* Function: H5O__dtype_reset
@@ -1415,7 +1419,7 @@ done:
} /* end H5O__dtype_free() */
/*-------------------------------------------------------------------------
- * Function: H5O_dtype_set_share
+ * Function: H5O__dtype_set_share
*
* Purpose: Copies sharing information from SH into the message.
*
@@ -1427,12 +1431,12 @@ done:
*-------------------------------------------------------------------------
*/
static herr_t
-H5O_dtype_set_share(void *_mesg /*in,out*/, const H5O_shared_t *sh)
+H5O__dtype_set_share(void *_mesg /*in,out*/, const H5O_shared_t *sh)
{
H5T_t *dt = (H5T_t *)_mesg;
herr_t ret_value = SUCCEED;
- FUNC_ENTER_NOAPI_NOINIT
+ FUNC_ENTER_STATIC
HDassert(dt);
HDassert(sh);
@@ -1463,10 +1467,10 @@ H5O_dtype_set_share(void *_mesg /*in,out*/, const H5O_shared_t *sh)
done:
FUNC_LEAVE_NOAPI(ret_value)
-} /* end H5O_dtype_set_share() */
+} /* end H5O__dtype_set_share() */
/*-------------------------------------------------------------------------
- * Function: H5O_dtype_can_share
+ * Function: H5O__dtype_can_share
*
* Purpose: Determines if this datatype is allowed to be shared or
* not. Immutable datatypes or datatypes that are already
@@ -1482,13 +1486,13 @@ done:
*-------------------------------------------------------------------------
*/
static htri_t
-H5O_dtype_can_share(const void *_mesg)
+H5O__dtype_can_share(const void *_mesg)
{
const H5T_t *mesg = (const H5T_t *)_mesg;
htri_t tri_ret;
htri_t ret_value = TRUE;
- FUNC_ENTER_NOAPI_NOINIT
+ FUNC_ENTER_STATIC
HDassert(mesg);
@@ -1506,10 +1510,10 @@ H5O_dtype_can_share(const void *_mesg)
done:
FUNC_LEAVE_NOAPI(ret_value)
-} /* end H5O_dtype_can_share() */
+} /* end H5O__dtype_can_share() */
/*-------------------------------------------------------------------------
- * Function: H5O_dtype_pre_copy_file
+ * Function: H5O__dtype_pre_copy_file
*
* Purpose: Perform any necessary actions before copying message between
* files
@@ -1524,14 +1528,14 @@ done:
*-------------------------------------------------------------------------
*/
static herr_t
-H5O_dtype_pre_copy_file(H5F_t *file_src, const void *mesg_src, hbool_t H5_ATTR_UNUSED *deleted,
- const H5O_copy_t *cpy_info, void *_udata)
+H5O__dtype_pre_copy_file(H5F_t *file_src, const void *mesg_src, hbool_t H5_ATTR_UNUSED *deleted,
+ const H5O_copy_t *cpy_info, void *_udata)
{
const H5T_t * dt_src = (const H5T_t *)mesg_src; /* Source datatype */
H5D_copy_file_ud_t *udata = (H5D_copy_file_ud_t *)_udata; /* Dataset copying user data */
herr_t ret_value = SUCCEED; /* Return value */
- FUNC_ENTER_NOAPI_NOINIT
+ FUNC_ENTER_STATIC
/* check args */
HDassert(file_src);
@@ -1563,7 +1567,7 @@ H5O_dtype_pre_copy_file(H5F_t *file_src, const void *mesg_src, hbool_t H5_ATTR_U
done:
FUNC_LEAVE_NOAPI(ret_value)
-} /* end H5O_dtype_pre_copy_file() */
+} /* end H5O__dtype_pre_copy_file() */
/*-------------------------------------------------------------------------
* Function: H5O__dtype_copy_file
@@ -1589,7 +1593,7 @@ H5O__dtype_copy_file(H5F_t H5_ATTR_UNUSED *file_src, const H5O_msg_class_t *mesg
FUNC_ENTER_STATIC
/* Perform a normal copy of the object header message */
- if (NULL == (dst_mesg = (H5T_t *)H5O_dtype_copy(native_src, NULL)))
+ if (NULL == (dst_mesg = (H5T_t *)H5O__dtype_copy(native_src, NULL)))
HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, NULL, "unable to copy")
/* The datatype will be in the new file; set its location. */
@@ -1635,9 +1639,8 @@ H5O__dtype_shared_post_copy_upd(const H5O_loc_t H5_ATTR_UNUSED *src_oloc, const
dt_dst->oloc.file = dt_dst->sh_loc.file;
dt_dst->oloc.addr = dt_dst->sh_loc.u.loc.oh_addr;
} /* end if */
- else {
+ else
HDassert(!H5T_is_named(dt_dst));
- }
done:
FUNC_LEAVE_NOAPI(ret_value)
diff --git a/src/H5Oefl.c b/src/H5Oefl.c
index c39b9b6..1ecaf36 100644
--- a/src/H5Oefl.c
+++ b/src/H5Oefl.c
@@ -12,7 +12,7 @@
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
/*
- * Programmer: Robb Matzke <matzke@llnl.gov>
+ * Programmer: Robb Matzke
* Tuesday, November 25, 1997
*/
@@ -26,11 +26,11 @@
#include "H5Opkg.h" /* Object headers */
/* PRIVATE PROTOTYPES */
-static void * H5O_efl_decode(H5F_t *f, H5O_t *open_oh, unsigned mesg_flags, unsigned *ioflags, size_t p_size,
- const uint8_t *p);
-static herr_t H5O_efl_encode(H5F_t *f, hbool_t disable_shared, uint8_t *p, const void *_mesg);
-static void * H5O_efl_copy(const void *_mesg, void *_dest);
-static size_t H5O_efl_size(const H5F_t *f, hbool_t disable_shared, const void *_mesg);
+static void * H5O__efl_decode(H5F_t *f, H5O_t *open_oh, unsigned mesg_flags, unsigned *ioflags, size_t p_size,
+ const uint8_t *p);
+static herr_t H5O__efl_encode(H5F_t *f, hbool_t disable_shared, uint8_t *p, const void *_mesg);
+static void * H5O__efl_copy(const void *_mesg, void *_dest);
+static size_t H5O__efl_size(const H5F_t *f, hbool_t disable_shared, const void *_mesg);
static herr_t H5O__efl_reset(void *_mesg);
static void * H5O__efl_copy_file(H5F_t *file_src, void *mesg_src, H5F_t *file_dst, hbool_t *recompute_size,
unsigned *mesg_flags, H5O_copy_t *cpy_info, void *udata);
@@ -42,10 +42,10 @@ const H5O_msg_class_t H5O_MSG_EFL[1] = {{
"external file list", /*message name for debugging */
sizeof(H5O_efl_t), /*native message size */
0, /* messages are sharable? */
- H5O_efl_decode, /*decode message */
- H5O_efl_encode, /*encode message */
- H5O_efl_copy, /*copy native value */
- H5O_efl_size, /*size of message on disk */
+ H5O__efl_decode, /*decode message */
+ H5O__efl_encode, /*encode message */
+ H5O__efl_copy, /*copy native value */
+ H5O__efl_size, /*size of message on disk */
H5O__efl_reset, /*reset method */
NULL, /* free method */
NULL, /* file delete method */
@@ -63,7 +63,7 @@ const H5O_msg_class_t H5O_MSG_EFL[1] = {{
#define H5O_EFL_VERSION 1
/*-------------------------------------------------------------------------
- * Function: H5O_efl_decode
+ * Function: H5O__efl_decode
*
* Purpose: Decode an external file list message and return a pointer to
* the message (and some other data).
@@ -83,8 +83,8 @@ const H5O_msg_class_t H5O_MSG_EFL[1] = {{
*-------------------------------------------------------------------------
*/
static void *
-H5O_efl_decode(H5F_t *f, H5O_t H5_ATTR_UNUSED *open_oh, unsigned H5_ATTR_UNUSED mesg_flags,
- unsigned H5_ATTR_UNUSED *ioflags, size_t H5_ATTR_UNUSED p_size, const uint8_t *p)
+H5O__efl_decode(H5F_t *f, H5O_t H5_ATTR_UNUSED *open_oh, unsigned H5_ATTR_UNUSED mesg_flags,
+ unsigned H5_ATTR_UNUSED *ioflags, size_t H5_ATTR_UNUSED p_size, const uint8_t *p)
{
H5O_efl_t * mesg = NULL;
int version;
@@ -93,7 +93,7 @@ H5O_efl_decode(H5F_t *f, H5O_t H5_ATTR_UNUSED *open_oh, unsigned H5_ATTR_UNUSED
size_t u; /* Local index variable */
void * ret_value = NULL; /* Return value */
- FUNC_ENTER_NOAPI_NOINIT
+ FUNC_ENTER_STATIC
/* Check args */
HDassert(f);
@@ -172,10 +172,10 @@ done:
H5MM_xfree(mesg);
FUNC_LEAVE_NOAPI(ret_value)
-} /* end H5O_efl_decode() */
+} /* end H5O__efl_decode() */
/*-------------------------------------------------------------------------
- * Function: H5O_efl_encode
+ * Function: H5O__efl_encode
*
* Purpose: Encodes a message.
*
@@ -187,12 +187,12 @@ done:
*-------------------------------------------------------------------------
*/
static herr_t
-H5O_efl_encode(H5F_t *f, hbool_t H5_ATTR_UNUSED disable_shared, uint8_t *p, const void *_mesg)
+H5O__efl_encode(H5F_t *f, hbool_t H5_ATTR_UNUSED disable_shared, uint8_t *p, const void *_mesg)
{
const H5O_efl_t *mesg = (const H5O_efl_t *)_mesg;
size_t u; /* Local index variable */
- FUNC_ENTER_NOAPI_NOINIT_NOERR
+ FUNC_ENTER_STATIC_NOERR
/* check args */
HDassert(f);
@@ -230,10 +230,10 @@ H5O_efl_encode(H5F_t *f, hbool_t H5_ATTR_UNUSED disable_shared, uint8_t *p, cons
} /* end for */
FUNC_LEAVE_NOAPI(SUCCEED)
-} /* end H5O_efl_encode() */
+} /* end H5O__efl_encode() */
/*-------------------------------------------------------------------------
- * Function: H5O_efl_copy
+ * Function: H5O__efl_copy
*
* Purpose: Copies a message from _MESG to _DEST, allocating _DEST if
* necessary.
@@ -248,7 +248,7 @@ H5O_efl_encode(H5F_t *f, hbool_t H5_ATTR_UNUSED disable_shared, uint8_t *p, cons
*-------------------------------------------------------------------------
*/
static void *
-H5O_efl_copy(const void *_mesg, void *_dest)
+H5O__efl_copy(const void *_mesg, void *_dest)
{
const H5O_efl_t *mesg = (const H5O_efl_t *)_mesg;
H5O_efl_t * dest = (H5O_efl_t *)_dest;
@@ -256,7 +256,7 @@ H5O_efl_copy(const void *_mesg, void *_dest)
hbool_t slot_allocated = FALSE; /* Flag to indicate that dynamic allocation has begun */
void * ret_value = NULL; /* Return value */
- FUNC_ENTER_NOAPI_NOINIT
+ FUNC_ENTER_STATIC
/* check args */
HDassert(mesg);
@@ -296,10 +296,10 @@ done:
} /* end if */
FUNC_LEAVE_NOAPI(ret_value)
-} /* end H5O_efl_copy() */
+} /* end H5O__efl_copy() */
/*-------------------------------------------------------------------------
- * Function: H5O_efl_size
+ * Function: H5O__efl_size
*
* Purpose: Returns the size of the raw message in bytes not counting the
* message type or size fields, but only the data fields. This
@@ -316,12 +316,12 @@ done:
*-------------------------------------------------------------------------
*/
static size_t
-H5O_efl_size(const H5F_t *f, hbool_t H5_ATTR_UNUSED disable_shared, const void *_mesg)
+H5O__efl_size(const H5F_t *f, hbool_t H5_ATTR_UNUSED disable_shared, const void *_mesg)
{
const H5O_efl_t *mesg = (const H5O_efl_t *)_mesg;
size_t ret_value = 0;
- FUNC_ENTER_NOAPI_NOINIT_NOERR
+ FUNC_ENTER_STATIC_NOERR
/* check args */
HDassert(f);
@@ -336,7 +336,7 @@ H5O_efl_size(const H5F_t *f, hbool_t H5_ATTR_UNUSED disable_shared, const void *
(size_t)H5F_SIZEOF_SIZE(f)); /*file size */
FUNC_LEAVE_NOAPI(ret_value)
-} /* end H5O_efl_size() */
+} /* end H5O__efl_size() */
/*-------------------------------------------------------------------------
* Function: H5O__efl_reset
@@ -396,7 +396,7 @@ H5O_efl_total_size(H5O_efl_t *efl)
{
hsize_t ret_value = 0, tmp;
- FUNC_ENTER_NOAPI_NOINIT
+ FUNC_ENTER_NOAPI(0)
if (efl->nused > 0 && H5O_EFL_UNLIMITED == efl->slot[efl->nused - 1].size)
ret_value = H5O_EFL_UNLIMITED;
@@ -529,28 +529,28 @@ H5O__efl_debug(H5F_t H5_ATTR_UNUSED *f, const void *_mesg, FILE *stream, int ind
HDassert(indent >= 0);
HDassert(fwidth >= 0);
- HDfprintf(stream, "%*s%-*s %a\n", indent, "", fwidth, "Heap address:", mesg->heap_addr);
+ HDfprintf(stream, "%*s%-*s %" PRIuHADDR "\n", indent, "", fwidth, "Heap address:", mesg->heap_addr);
- HDfprintf(stream, "%*s%-*s %u/%u\n", indent, "", fwidth, "Slots used/allocated:", mesg->nused,
+ HDfprintf(stream, "%*s%-*s %zu/%zu\n", indent, "", fwidth, "Slots used/allocated:", mesg->nused,
mesg->nalloc);
for (u = 0; u < mesg->nused; u++) {
char buf[64];
- HDsnprintf(buf, sizeof(buf), "File %u", (unsigned)u);
+ HDsnprintf(buf, sizeof(buf), "File %zu", u);
HDfprintf(stream, "%*s%s:\n", indent, "", buf);
HDfprintf(stream, "%*s%-*s \"%s\"\n", indent + 3, "", MAX(fwidth - 3, 0),
"Name:", mesg->slot[u].name);
- HDfprintf(stream, "%*s%-*s %lu\n", indent + 3, "", MAX(fwidth - 3, 0),
- "Name offset:", (unsigned long)(mesg->slot[u].name_offset));
+ HDfprintf(stream, "%*s%-*s %zu\n", indent + 3, "", MAX(fwidth - 3, 0),
+ "Name offset:", mesg->slot[u].name_offset);
- HDfprintf(stream, "%*s%-*s %lu\n", indent + 3, "", MAX(fwidth - 3, 0),
- "Offset of data in file:", (unsigned long)(mesg->slot[u].offset));
+ HDfprintf(stream, "%*s%-*s %" PRIdMAX "\n", indent + 3, "", MAX(fwidth - 3, 0),
+ "Offset of data in file:", (intmax_t)(mesg->slot[u].offset));
- HDfprintf(stream, "%*s%-*s %lu\n", indent + 3, "", MAX(fwidth - 3, 0),
- "Bytes reserved for data:", (unsigned long)(mesg->slot[u].size));
+ HDfprintf(stream, "%*s%-*s %" PRIuHSIZE "\n", indent + 3, "", MAX(fwidth - 3, 0),
+ "Bytes reserved for data:", (mesg->slot[u].size));
} /* end for */
FUNC_LEAVE_NOAPI(SUCCEED)
diff --git a/src/H5Ofill.c b/src/H5Ofill.c
index b3234b7..5068039 100644
--- a/src/H5Ofill.c
+++ b/src/H5Ofill.c
@@ -11,7 +11,7 @@
* help@hdfgroup.org. *
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
-/* Programmer: Robb Matzke <matzke@llnl.gov>
+/* Programmer: Robb Matzke
* Wednesday, September 30, 1998
*
* Purpose: The fill message indicates a bit pattern to use for
@@ -30,15 +30,15 @@
#include "H5Pprivate.h" /* Property lists */
#include "H5Sprivate.h" /* Dataspaces */
-static void * H5O_fill_old_decode(H5F_t *f, H5O_t *open_oh, unsigned mesg_flags, unsigned *ioflags,
- size_t p_size, const uint8_t *p);
-static herr_t H5O_fill_old_encode(H5F_t *f, uint8_t *p, const void *_mesg);
-static size_t H5O_fill_old_size(const H5F_t *f, const void *_mesg);
-static void * H5O_fill_new_decode(H5F_t *f, H5O_t *open_oh, unsigned mesg_flags, unsigned *ioflags,
- size_t p_size, const uint8_t *p);
-static herr_t H5O_fill_new_encode(H5F_t *f, uint8_t *p, const void *_mesg);
-static size_t H5O_fill_new_size(const H5F_t *f, const void *_mesg);
-static void * H5O_fill_copy(const void *_mesg, void *_dest);
+static void * H5O__fill_old_decode(H5F_t *f, H5O_t *open_oh, unsigned mesg_flags, unsigned *ioflags,
+ size_t p_size, const uint8_t *p);
+static herr_t H5O__fill_old_encode(H5F_t *f, uint8_t *p, const void *_mesg);
+static size_t H5O__fill_old_size(const H5F_t *f, const void *_mesg);
+static void * H5O__fill_new_decode(H5F_t *f, H5O_t *open_oh, unsigned mesg_flags, unsigned *ioflags,
+ size_t p_size, const uint8_t *p);
+static herr_t H5O__fill_new_encode(H5F_t *f, uint8_t *p, const void *_mesg);
+static size_t H5O__fill_new_size(const H5F_t *f, const void *_mesg);
+static void * H5O__fill_copy(const void *_mesg, void *_dest);
static herr_t H5O__fill_reset(void *_mesg);
static herr_t H5O__fill_free(void *_mesg);
static herr_t H5O__fill_pre_copy_file(H5F_t *file_src, const void *mesg_src, hbool_t *deleted,
@@ -47,22 +47,22 @@ static herr_t H5O__fill_debug(H5F_t *f, const void *_mesg, FILE *stream, int ind
/* Set up & include shared message "interface" info */
#define H5O_SHARED_TYPE H5O_MSG_FILL
-#define H5O_SHARED_DECODE H5O_fill_shared_decode
-#define H5O_SHARED_DECODE_REAL H5O_fill_old_decode
-#define H5O_SHARED_ENCODE H5O_fill_shared_encode
-#define H5O_SHARED_ENCODE_REAL H5O_fill_old_encode
-#define H5O_SHARED_SIZE H5O_fill_shared_size
-#define H5O_SHARED_SIZE_REAL H5O_fill_old_size
+#define H5O_SHARED_DECODE H5O__fill_shared_decode
+#define H5O_SHARED_DECODE_REAL H5O__fill_old_decode
+#define H5O_SHARED_ENCODE H5O__fill_shared_encode
+#define H5O_SHARED_ENCODE_REAL H5O__fill_old_encode
+#define H5O_SHARED_SIZE H5O__fill_shared_size
+#define H5O_SHARED_SIZE_REAL H5O__fill_old_size
#define H5O_SHARED_DELETE H5O__fill_shared_delete
#undef H5O_SHARED_DELETE_REAL
#define H5O_SHARED_LINK H5O__fill_shared_link
#undef H5O_SHARED_LINK_REAL
#define H5O_SHARED_COPY_FILE H5O__fill_shared_copy_file
#undef H5O_SHARED_COPY_FILE_REAL
-#define H5O_SHARED_POST_COPY_FILE H5O_fill_shared_post_copy_file
+#define H5O_SHARED_POST_COPY_FILE H5O__fill_shared_post_copy_file
#undef H5O_SHARED_POST_COPY_FILE_REAL
#undef H5O_SHARED_POST_COPY_FILE_UPD
-#define H5O_SHARED_DEBUG H5O_fill_shared_debug
+#define H5O_SHARED_DEBUG H5O__fill_shared_debug
#define H5O_SHARED_DEBUG_REAL H5O__fill_debug
#include "H5Oshared.h" /* Shared Object Header Message Callbacks */
@@ -71,17 +71,17 @@ static herr_t H5O__fill_debug(H5F_t *f, const void *_mesg, FILE *stream, int ind
#undef H5O_SHARED_TYPE
#define H5O_SHARED_TYPE H5O_MSG_FILL_NEW
#undef H5O_SHARED_DECODE
-#define H5O_SHARED_DECODE H5O_fill_new_shared_decode
+#define H5O_SHARED_DECODE H5O__fill_new_shared_decode
#undef H5O_SHARED_DECODE_REAL
-#define H5O_SHARED_DECODE_REAL H5O_fill_new_decode
+#define H5O_SHARED_DECODE_REAL H5O__fill_new_decode
#undef H5O_SHARED_ENCODE
-#define H5O_SHARED_ENCODE H5O_fill_new_shared_encode
+#define H5O_SHARED_ENCODE H5O__fill_new_shared_encode
#undef H5O_SHARED_ENCODE_REAL
-#define H5O_SHARED_ENCODE_REAL H5O_fill_new_encode
+#define H5O_SHARED_ENCODE_REAL H5O__fill_new_encode
#undef H5O_SHARED_SIZE
-#define H5O_SHARED_SIZE H5O_fill_new_shared_size
+#define H5O_SHARED_SIZE H5O__fill_new_shared_size
#undef H5O_SHARED_SIZE_REAL
-#define H5O_SHARED_SIZE_REAL H5O_fill_new_size
+#define H5O_SHARED_SIZE_REAL H5O__fill_new_size
#undef H5O_SHARED_DELETE
#define H5O_SHARED_DELETE H5O__fill_new_shared_delete
#undef H5O_SHARED_DELETE_REAL
@@ -92,11 +92,11 @@ static herr_t H5O__fill_debug(H5F_t *f, const void *_mesg, FILE *stream, int ind
#define H5O_SHARED_COPY_FILE H5O__fill_new_shared_copy_file
#undef H5O_SHARED_COPY_FILE_REAL
#undef H5O_SHARED_POST_COPY_FILE
-#define H5O_SHARED_POST_COPY_FILE H5O_fill_new_shared_post_copy_file
+#define H5O_SHARED_POST_COPY_FILE H5O__fill_new_shared_post_copy_file
#undef H5O_SHARED_POST_COPY_FILE_REAL
#undef H5O_SHARED_POST_COPY_FILE_UPD
#undef H5O_SHARED_DEBUG
-#define H5O_SHARED_DEBUG H5O_fill_new_shared_debug
+#define H5O_SHARED_DEBUG H5O__fill_new_shared_debug
#undef H5O_SHARED_DEBUG_REAL
#define H5O_SHARED_DEBUG_REAL H5O__fill_debug
#undef H5Oshared_H
@@ -108,10 +108,10 @@ const H5O_msg_class_t H5O_MSG_FILL[1] = {{
"fill", /*message name for debugging */
sizeof(H5O_fill_t), /*native message size */
H5O_SHARE_IS_SHARABLE | H5O_SHARE_IN_OHDR, /* messages are sharable? */
- H5O_fill_shared_decode, /*decode message */
- H5O_fill_shared_encode, /*encode message */
- H5O_fill_copy, /*copy the native value */
- H5O_fill_shared_size, /*raw message size */
+ H5O__fill_shared_decode, /*decode message */
+ H5O__fill_shared_encode, /*encode message */
+ H5O__fill_copy, /*copy the native value */
+ H5O__fill_shared_size, /*raw message size */
H5O__fill_reset, /*free internal memory */
H5O__fill_free, /* free method */
H5O__fill_shared_delete, /* file delete method */
@@ -120,10 +120,10 @@ const H5O_msg_class_t H5O_MSG_FILL[1] = {{
NULL, /*can share method */
H5O__fill_pre_copy_file, /* pre copy native value to file */
H5O__fill_shared_copy_file, /* copy native value to file */
- H5O_fill_shared_post_copy_file, /* post copy native value to file */
+ H5O__fill_shared_post_copy_file, /* post copy native value to file */
NULL, /* get creation index */
NULL, /* set creation index */
- H5O_fill_shared_debug /*debug the message */
+ H5O__fill_shared_debug /*debug the message */
}};
/* This message derives from H5O message class, for new fill value after version 1.4 */
@@ -132,10 +132,10 @@ const H5O_msg_class_t H5O_MSG_FILL_NEW[1] = {{
"fill_new", /*message name for debugging */
sizeof(H5O_fill_t), /*native message size */
H5O_SHARE_IS_SHARABLE | H5O_SHARE_IN_OHDR, /* messages are sharable? */
- H5O_fill_new_shared_decode, /*decode message */
- H5O_fill_new_shared_encode, /*encode message */
- H5O_fill_copy, /*copy the native value */
- H5O_fill_new_shared_size, /*raw message size */
+ H5O__fill_new_shared_decode, /*decode message */
+ H5O__fill_new_shared_encode, /*encode message */
+ H5O__fill_copy, /*copy the native value */
+ H5O__fill_new_shared_size, /*raw message size */
H5O__fill_reset, /*free internal memory */
H5O__fill_free, /* free method */
H5O__fill_new_shared_delete, /* file delete method */
@@ -144,10 +144,10 @@ const H5O_msg_class_t H5O_MSG_FILL_NEW[1] = {{
NULL, /*can share method */
H5O__fill_pre_copy_file, /* pre copy native value to file */
H5O__fill_new_shared_copy_file, /* copy native value to file */
- H5O_fill_new_shared_post_copy_file, /* post copy native value to file */
+ H5O__fill_new_shared_post_copy_file, /* post copy native value to file */
NULL, /* get creation index */
NULL, /* set creation index */
- H5O_fill_new_shared_debug /*debug the message */
+ H5O__fill_new_shared_debug /*debug the message */
}};
/* Format version bounds for fill value */
@@ -177,7 +177,7 @@ H5FL_DEFINE(H5O_fill_t);
H5FL_BLK_EXTERN(type_conv);
/*-------------------------------------------------------------------------
- * Function: H5O_fill_new_decode
+ * Function: H5O__fill_new_decode
*
* Purpose: Decode a new fill value message. The new fill value
* message is fill value plus space allocation time and
@@ -192,14 +192,15 @@ H5FL_BLK_EXTERN(type_conv);
*-------------------------------------------------------------------------
*/
static void *
-H5O_fill_new_decode(H5F_t H5_ATTR_UNUSED *f, H5O_t H5_ATTR_UNUSED *open_oh,
- unsigned H5_ATTR_UNUSED mesg_flags, unsigned H5_ATTR_UNUSED *ioflags, size_t p_size,
- const uint8_t *p)
+H5O__fill_new_decode(H5F_t H5_ATTR_UNUSED *f, H5O_t H5_ATTR_UNUSED *open_oh,
+ unsigned H5_ATTR_UNUSED mesg_flags, unsigned H5_ATTR_UNUSED *ioflags, size_t p_size,
+ const uint8_t *p)
{
- H5O_fill_t *fill = NULL;
- void * ret_value = NULL; /* Return value */
+ H5O_fill_t * fill = NULL;
+ const uint8_t *p_end = p + p_size - 1; /* End of the p buffer */
+ void * ret_value = NULL; /* Return value */
- FUNC_ENTER_NOAPI_NOINIT
+ FUNC_ENTER_STATIC
HDassert(f);
HDassert(p);
@@ -228,8 +229,11 @@ H5O_fill_new_decode(H5F_t H5_ATTR_UNUSED *f, H5O_t H5_ATTR_UNUSED *open_oh,
INT32DECODE(p, fill->size);
if (fill->size > 0) {
H5_CHECK_OVERFLOW(fill->size, ssize_t, size_t);
- if ((size_t)fill->size > p_size)
- HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "destination buffer too small")
+
+ /* Ensure that fill size doesn't exceed buffer size, due to possible data corruption */
+ if (p + fill->size - 1 > p_end)
+ HGOTO_ERROR(H5E_OHDR, H5E_OVERFLOW, NULL, "fill size exceeds buffer size")
+
if (NULL == (fill->buf = H5MM_malloc((size_t)fill->size)))
HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "memory allocation failed for fill value")
H5MM_memcpy(fill->buf, p, (size_t)fill->size);
@@ -276,11 +280,10 @@ H5O_fill_new_decode(H5F_t H5_ATTR_UNUSED *f, H5O_t H5_ATTR_UNUSED *open_oh,
/* Set the "defined" flag */
fill->fill_defined = TRUE;
} /* end else */
- else {
+ else
/* Set the "defined" flag */
fill->fill_defined = TRUE;
- } /* end else */
- } /* end else */
+ } /* end else */
/* Set return value */
ret_value = (void *)fill;
@@ -293,10 +296,10 @@ done:
} /* end if */
FUNC_LEAVE_NOAPI(ret_value)
-} /* end H5O_fill_new_decode() */
+} /* end H5O__fill_new_decode() */
/*-------------------------------------------------------------------------
- * Function: H5O_fill_old_decode
+ * Function: H5O__fill_old_decode
*
* Purpose: Decode an old fill value message.
*
@@ -309,15 +312,16 @@ done:
*-------------------------------------------------------------------------
*/
static void *
-H5O_fill_old_decode(H5F_t *f, H5O_t *open_oh, unsigned H5_ATTR_UNUSED mesg_flags,
- unsigned H5_ATTR_UNUSED *ioflags, size_t p_size, const uint8_t *p)
+H5O__fill_old_decode(H5F_t *f, H5O_t *open_oh, unsigned H5_ATTR_UNUSED mesg_flags,
+ unsigned H5_ATTR_UNUSED *ioflags, size_t p_size, const uint8_t *p)
{
- H5O_fill_t *fill = NULL; /* Decoded fill value message */
- htri_t exists = FALSE;
- H5T_t * dt = NULL;
- void * ret_value = NULL; /* Return value */
+ H5O_fill_t * fill = NULL; /* Decoded fill value message */
+ htri_t exists = FALSE;
+ H5T_t * dt = NULL;
+ const uint8_t *p_end = p + p_size - 1; /* End of the p buffer */
+ void * ret_value = NULL; /* Return value */
- FUNC_ENTER_NOAPI_NOINIT
+ FUNC_ENTER_STATIC
HDassert(f);
HDassert(p);
@@ -336,8 +340,10 @@ H5O_fill_old_decode(H5F_t *f, H5O_t *open_oh, unsigned H5_ATTR_UNUSED mesg_flags
/* Only decode the fill value itself if there is one */
if (fill->size > 0) {
H5_CHECK_OVERFLOW(fill->size, ssize_t, size_t);
- if ((size_t)fill->size > p_size)
- HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "destination buffer too small")
+
+ /* Ensure that fill size doesn't exceed buffer size, due to possible data corruption */
+ if (p + fill->size - 1 > p_end)
+ HGOTO_ERROR(H5E_OHDR, H5E_OVERFLOW, NULL, "fill size exceeds buffer size")
/* Get the datatype message */
if ((exists = H5O_msg_exists_oh(open_oh, H5O_DTYPE_ID)) < 0)
@@ -372,10 +378,10 @@ done:
} /* end if */
FUNC_LEAVE_NOAPI(ret_value)
-} /* end H5O_fill_old_decode() */
+} /* end H5O__fill_old_decode() */
/*-------------------------------------------------------------------------
- * Function: H5O_fill_new_encode
+ * Function: H5O__fill_new_encode
*
* Purpose: Encode a new fill value message. The new fill value
* message is fill value plus space allocation time and
@@ -389,11 +395,11 @@ done:
*-------------------------------------------------------------------------
*/
static herr_t
-H5O_fill_new_encode(H5F_t H5_ATTR_UNUSED *f, uint8_t *p, const void *_fill)
+H5O__fill_new_encode(H5F_t H5_ATTR_UNUSED *f, uint8_t *p, const void *_fill)
{
const H5O_fill_t *fill = (const H5O_fill_t *)_fill;
- FUNC_ENTER_NOAPI_NOINIT_NOERR
+ FUNC_ENTER_STATIC_NOERR
HDassert(f);
HDassert(p);
@@ -470,10 +476,10 @@ H5O_fill_new_encode(H5F_t H5_ATTR_UNUSED *f, uint8_t *p, const void *_fill)
} /* end else */
FUNC_LEAVE_NOAPI(SUCCEED)
-} /* end H5O_fill_new_encode() */
+} /* end H5O__fill_new_encode() */
/*-------------------------------------------------------------------------
- * Function: H5O_fill_old_encode
+ * Function: H5O__fill_old_encode
*
* Purpose: Encode an old fill value message.
*
@@ -485,11 +491,11 @@ H5O_fill_new_encode(H5F_t H5_ATTR_UNUSED *f, uint8_t *p, const void *_fill)
*-------------------------------------------------------------------------
*/
static herr_t
-H5O_fill_old_encode(H5F_t H5_ATTR_UNUSED *f, uint8_t *p, const void *_fill)
+H5O__fill_old_encode(H5F_t H5_ATTR_UNUSED *f, uint8_t *p, const void *_fill)
{
const H5O_fill_t *fill = (const H5O_fill_t *)_fill;
- FUNC_ENTER_NOAPI_NOINIT_NOERR
+ FUNC_ENTER_STATIC_NOERR
HDassert(f);
HDassert(p);
@@ -500,10 +506,10 @@ H5O_fill_old_encode(H5F_t H5_ATTR_UNUSED *f, uint8_t *p, const void *_fill)
H5MM_memcpy(p, fill->buf, (size_t)fill->size);
FUNC_LEAVE_NOAPI(SUCCEED)
-} /* end H5O_fill_old_encode() */
+} /* end H5O__fill_old_encode() */
/*-------------------------------------------------------------------------
- * Function: H5O_fill_copy
+ * Function: H5O__fill_copy
*
* Purpose: Copies a message from _MESG to _DEST, allocating _DEST if
* necessary. The new fill value message is fill value plus
@@ -519,13 +525,13 @@ H5O_fill_old_encode(H5F_t H5_ATTR_UNUSED *f, uint8_t *p, const void *_fill)
*-------------------------------------------------------------------------
*/
static void *
-H5O_fill_copy(const void *_src, void *_dst)
+H5O__fill_copy(const void *_src, void *_dst)
{
const H5O_fill_t *src = (const H5O_fill_t *)_src;
H5O_fill_t * dst = (H5O_fill_t *)_dst;
void * ret_value = NULL; /* Return value */
- FUNC_ENTER_NOAPI_NOINIT
+ FUNC_ENTER_STATIC
HDassert(src);
@@ -618,10 +624,10 @@ done:
} /* end if */
FUNC_LEAVE_NOAPI(ret_value)
-} /* end H5O_fill_copy() */
+} /* end H5O__fill_copy() */
/*-------------------------------------------------------------------------
- * Function: H5O_fill_new_size
+ * Function: H5O__fill_new_size
*
* Purpose: Returns the size of the raw message in bytes not counting the
* message type or size fields, but only the data fields. This
@@ -638,12 +644,12 @@ done:
*-------------------------------------------------------------------------
*/
static size_t
-H5O_fill_new_size(const H5F_t H5_ATTR_UNUSED *f, const void *_fill)
+H5O__fill_new_size(const H5F_t H5_ATTR_UNUSED *f, const void *_fill)
{
const H5O_fill_t *fill = (const H5O_fill_t *)_fill;
size_t ret_value = 0; /* Return value */
- FUNC_ENTER_NOAPI_NOINIT_NOERR
+ FUNC_ENTER_STATIC_NOERR
HDassert(f);
HDassert(fill);
@@ -655,22 +661,22 @@ H5O_fill_new_size(const H5F_t H5_ATTR_UNUSED *f, const void *_fill)
1 + /* Fill value write time */
1; /* Fill value defined */
if (fill->fill_defined)
- ret_value += 4 + /* Fill value size */
+ ret_value += 4 + /* Fill value size */
(fill->size > 0 ? (size_t)fill->size : 0); /* Size of fill value */
} /* end if */
else {
ret_value = 1 + /* Version number */
1; /* Status flags */
if (fill->size > 0)
- ret_value += 4 + /* Fill value size */
- (size_t)fill->size; /* Size of fill value */
+ ret_value += 4 + /* Fill value size */
+ (size_t)fill->size; /* Size of fill value */
} /* end else */
FUNC_LEAVE_NOAPI(ret_value)
-} /* end H5O_fill_new_size() */
+} /* end H5O__fill_new_size() */
/*-------------------------------------------------------------------------
- * Function: H5O_fill_old_size
+ * Function: H5O__fill_old_size
*
* Purpose: Returns the size of the raw message in bytes not counting the
* message type or size fields, but only the data fields. This
@@ -685,16 +691,16 @@ H5O_fill_new_size(const H5F_t H5_ATTR_UNUSED *f, const void *_fill)
*-------------------------------------------------------------------------
*/
static size_t
-H5O_fill_old_size(const H5F_t H5_ATTR_UNUSED *f, const void *_fill)
+H5O__fill_old_size(const H5F_t H5_ATTR_UNUSED *f, const void *_fill)
{
const H5O_fill_t *fill = (const H5O_fill_t *)_fill;
- FUNC_ENTER_NOAPI_NOINIT_NOERR
+ FUNC_ENTER_STATIC_NOERR
HDassert(fill);
FUNC_LEAVE_NOAPI(4 + (size_t)fill->size)
-} /* end H5O_fill_old_size() */
+} /* end H5O__fill_old_size() */
/*-------------------------------------------------------------------------
* Function: H5O_fill_reset_dyn
@@ -939,7 +945,7 @@ H5O__fill_debug(H5F_t H5_ATTR_UNUSED *f, const void *_fill, FILE *stream, int in
break;
} /* end switch */
- HDfprintf(stream, "%*s%-*s %Zd\n", indent, "", fwidth, "Size:", fill->size);
+ HDfprintf(stream, "%*s%-*s %zd\n", indent, "", fwidth, "Size:", fill->size);
HDfprintf(stream, "%*s%-*s ", indent, "", fwidth, "Data type:");
if (fill->type) {
H5T_debug(fill->type, stream);
@@ -974,7 +980,7 @@ H5O_fill_convert(H5O_fill_t *fill, H5T_t *dset_type, hbool_t *fill_changed)
hid_t src_id = -1, dst_id = -1; /* Datatype identifiers */
herr_t ret_value = SUCCEED; /* Return value */
- FUNC_ENTER_NOAPI_NOINIT
+ FUNC_ENTER_NOAPI(FAIL)
HDassert(fill);
HDassert(dset_type);
diff --git a/src/H5Oflush.c b/src/H5Oflush.c
index 336f356..e1fa5e9 100644
--- a/src/H5Oflush.c
+++ b/src/H5Oflush.c
@@ -15,7 +15,7 @@
*
* Created: H5Oflush.c
* Aug 19, 2010
- * Mike McGreevy <mamcgree@hdfgroup.org>
+ * Mike McGreevy
*
* Purpose: Object flush/refresh routines.
*
@@ -166,7 +166,7 @@ H5O_flush_common(H5O_loc_t *oloc, hid_t obj_id)
/* Flush metadata based on tag value of the object */
if (H5F_flush_tagged_metadata(oloc->file, tag) < 0)
- HGOTO_ERROR(H5E_FILE, H5E_CANTFLUSH, FAIL, "unable to flush tagged metadata")
+ HGOTO_ERROR(H5E_OHDR, H5E_CANTFLUSH, FAIL, "unable to flush tagged metadata")
/* Check to invoke callback */
if (H5F_object_flush_cb(oloc->file, obj_id) < 0)
@@ -410,32 +410,32 @@ H5O__refresh_metadata_close(hid_t oid, H5O_loc_t oloc, H5G_loc_t *obj_loc)
/* Handle close for multiple dataset opens */
if (H5I_get_type(oid) == H5I_DATASET)
if (H5D_mult_refresh_close(oid) < 0)
- HGOTO_ERROR(H5E_DATASET, H5E_CANTOPENOBJ, FAIL, "unable to prepare refresh for dataset")
+ HGOTO_ERROR(H5E_OHDR, H5E_CANTOPENOBJ, FAIL, "unable to prepare refresh for dataset")
/* Retrieve tag for object */
if (H5O__oh_tag(&oloc, &tag) < 0)
- HGOTO_ERROR(H5E_DATASET, H5E_CANTFLUSH, FAIL, "unable to get object header address")
+ HGOTO_ERROR(H5E_OHDR, H5E_CANTFLUSH, FAIL, "unable to get object header address")
/* Get cork status of the object with tag */
if (H5AC_cork(oloc.file, tag, H5AC__GET_CORKED, &corked) < 0)
- HGOTO_ERROR(H5E_ATOM, H5E_SYSTEM, FAIL, "unable to retrieve an object's cork status")
+ HGOTO_ERROR(H5E_OHDR, H5E_SYSTEM, FAIL, "unable to retrieve an object's cork status")
/* Close the object */
if (H5I_dec_ref(oid) < 0)
- HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "unable to close object")
+ HGOTO_ERROR(H5E_OHDR, H5E_CANTINIT, FAIL, "unable to close object")
/* Flush metadata based on tag value of the object */
if (H5F_flush_tagged_metadata(oloc.file, tag) < 0)
- HGOTO_ERROR(H5E_FILE, H5E_CANTFLUSH, FAIL, "unable to flush tagged metadata")
+ HGOTO_ERROR(H5E_OHDR, H5E_CANTFLUSH, FAIL, "unable to flush tagged metadata")
/* Evict the object's tagged metadata */
if (H5F_evict_tagged_metadata(oloc.file, tag) < 0)
- HGOTO_ERROR(H5E_FILE, H5E_CANTFLUSH, FAIL, "unable to evict metadata")
+ HGOTO_ERROR(H5E_OHDR, H5E_CANTFLUSH, FAIL, "unable to evict metadata")
/* Re-cork object with tag */
if (corked)
if (H5AC_cork(oloc.file, tag, H5AC__SET_CORK, &corked) < 0)
- HGOTO_ERROR(H5E_ATOM, H5E_SYSTEM, FAIL, "unable to cork the object")
+ HGOTO_ERROR(H5E_OHDR, H5E_SYSTEM, FAIL, "unable to cork the object")
done:
FUNC_LEAVE_NOAPI(ret_value);
diff --git a/src/H5Ofsinfo.c b/src/H5Ofsinfo.c
index b406386..44c4985 100644
--- a/src/H5Ofsinfo.c
+++ b/src/H5Ofsinfo.c
@@ -15,7 +15,7 @@
*
* Created: H5Ofsinfo.c
* Feb 2009
- * Vailin Choi
+ * Vailin Choi
*
* Purpose: File space info message.
*
@@ -25,17 +25,17 @@
#include "H5Omodule.h" /* This source code file is part of the H5O module */
#include "H5private.h" /* Generic Functions */
-#include "H5Eprivate.h" /* Error handling */
+#include "H5Eprivate.h" /* Error handling */
#include "H5Fpkg.h" /* File access */
-#include "H5FLprivate.h" /* Free lists */
-#include "H5Opkg.h" /* Object headers */
+#include "H5FLprivate.h" /* Free lists */
+#include "H5Opkg.h" /* Object headers */
/* PRIVATE PROTOTYPES */
-static void * H5O_fsinfo_decode(H5F_t *f, H5O_t *open_oh, unsigned mesg_flags, unsigned *ioflags,
- size_t p_size, const uint8_t *p);
-static herr_t H5O_fsinfo_encode(H5F_t *f, hbool_t disable_shared, uint8_t *p, const void *_mesg);
-static void * H5O_fsinfo_copy(const void *_mesg, void *_dest);
-static size_t H5O_fsinfo_size(const H5F_t *f, hbool_t disable_shared, const void *_mesg);
+static void * H5O__fsinfo_decode(H5F_t *f, H5O_t *open_oh, unsigned mesg_flags, unsigned *ioflags,
+ size_t p_size, const uint8_t *p);
+static herr_t H5O__fsinfo_encode(H5F_t *f, hbool_t disable_shared, uint8_t *p, const void *_mesg);
+static void * H5O__fsinfo_copy(const void *_mesg, void *_dest);
+static size_t H5O__fsinfo_size(const H5F_t *f, hbool_t disable_shared, const void *_mesg);
static herr_t H5O__fsinfo_free(void *mesg);
static herr_t H5O__fsinfo_debug(H5F_t *f, const void *_mesg, FILE *stream, int indent, int fwidth);
@@ -45,22 +45,22 @@ const H5O_msg_class_t H5O_MSG_FSINFO[1] = {{
"fsinfo", /* message name for debugging */
sizeof(H5O_fsinfo_t), /* native message size */
0, /* messages are sharable? */
- H5O_fsinfo_decode, /* decode message */
- H5O_fsinfo_encode, /* encode message */
- H5O_fsinfo_copy, /* copy the native value */
- H5O_fsinfo_size, /* size of free-space manager info message */
- NULL, /* default reset method */
- H5O__fsinfo_free, /* free method */
- NULL, /* file delete method */
- NULL, /* link method */
- NULL, /* set share method */
- NULL, /* can share method */
+ H5O__fsinfo_decode, /* decode message */
+ H5O__fsinfo_encode, /* encode message */
+ H5O__fsinfo_copy, /* copy the native value */
+ H5O__fsinfo_size, /* size of free-space manager info message */
+ NULL, /* default reset method */
+ H5O__fsinfo_free, /* free method */
+ NULL, /* file delete method */
+ NULL, /* link method */
+ NULL, /* set share method */
+ NULL, /* can share method */
NULL, /* pre copy native value to file */
- NULL, /* copy native value to file */
+ NULL, /* copy native value to file */
NULL, /* post copy native value to file */
- NULL, /* get creation index */
- NULL, /* set creation index */
- H5O__fsinfo_debug /* debug the message */
+ NULL, /* get creation index */
+ NULL, /* set creation index */
+ H5O__fsinfo_debug /* debug the message */
}};
/* Format version bounds for fsinfo message */
@@ -78,7 +78,7 @@ static const unsigned H5O_fsinfo_ver_bounds[] = {
H5FL_DEFINE_STATIC(H5O_fsinfo_t);
/*-------------------------------------------------------------------------
- * Function: H5O_fsinfo_decode
+ * Function: H5O__fsinfo_decode
*
* Purpose: Decode a message and return a pointer to a newly allocated one.
*
@@ -90,15 +90,15 @@ H5FL_DEFINE_STATIC(H5O_fsinfo_t);
*-------------------------------------------------------------------------
*/
static void *
-H5O_fsinfo_decode(H5F_t *f, H5O_t H5_ATTR_UNUSED *open_oh, unsigned H5_ATTR_UNUSED mesg_flags,
- unsigned H5_ATTR_UNUSED *ioflags, size_t H5_ATTR_UNUSED p_size, const uint8_t *p)
+H5O__fsinfo_decode(H5F_t *f, H5O_t H5_ATTR_UNUSED *open_oh, unsigned H5_ATTR_UNUSED mesg_flags,
+ unsigned H5_ATTR_UNUSED *ioflags, size_t H5_ATTR_UNUSED p_size, const uint8_t *p)
{
H5O_fsinfo_t * fsinfo = NULL; /* File space info message */
H5F_mem_page_t ptype; /* Memory type for iteration */
unsigned vers; /* message version */
void * ret_value = NULL; /* Return value */
- FUNC_ENTER_NOAPI_NOINIT
+ FUNC_ENTER_STATIC
/* check args */
HDassert(f);
@@ -130,7 +130,6 @@ H5O_fsinfo_decode(H5F_t *f, H5O_t H5_ATTR_UNUSED *open_oh, unsigned H5_ATTR_UNUS
/* Map version 0 (deprecated) to version 1 message */
switch (strategy) {
-
case H5F_FILE_SPACE_ALL_PERSIST:
fsinfo->strategy = H5F_FSPACE_STRATEGY_FSM_AGGR;
fsinfo->persist = TRUE;
@@ -177,10 +176,9 @@ H5O_fsinfo_decode(H5F_t *f, H5O_t H5_ATTR_UNUSED *open_oh, unsigned H5_ATTR_UNUS
&(fsinfo->eoa_pre_fsm_fsalloc)); /* EOA before free-space header and section info */
/* Decode addresses of free space managers, if persisting */
- if (fsinfo->persist) {
+ if (fsinfo->persist)
for (ptype = H5F_MEM_PAGE_SUPER; ptype < H5F_MEM_PAGE_NTYPES; ptype++)
H5F_addr_decode(f, &p, &(fsinfo->fs_addr[ptype - 1]));
- } /* end if */
fsinfo->mapped = FALSE;
}
@@ -193,10 +191,10 @@ done:
fsinfo = H5FL_FREE(H5O_fsinfo_t, fsinfo);
FUNC_LEAVE_NOAPI(ret_value)
-} /* end H5O_fsinfo_decode() */
+} /* end H5O__fsinfo_decode() */
/*-------------------------------------------------------------------------
- * Function: H5O_fsinfo_encode
+ * Function: H5O__fsinfo_encode
*
* Purpose: Encodes a message.
*
@@ -207,12 +205,12 @@ done:
*-------------------------------------------------------------------------
*/
static herr_t
-H5O_fsinfo_encode(H5F_t *f, hbool_t H5_ATTR_UNUSED disable_shared, uint8_t *p, const void *_mesg)
+H5O__fsinfo_encode(H5F_t *f, hbool_t H5_ATTR_UNUSED disable_shared, uint8_t *p, const void *_mesg)
{
const H5O_fsinfo_t *fsinfo = (const H5O_fsinfo_t *)_mesg;
H5F_mem_page_t ptype; /* Memory type for iteration */
- FUNC_ENTER_NOAPI_NOINIT_NOERR
+ FUNC_ENTER_STATIC_NOERR
/* check args */
HDassert(f);
@@ -229,17 +227,16 @@ H5O_fsinfo_encode(H5F_t *f, hbool_t H5_ATTR_UNUSED disable_shared, uint8_t *p, c
H5F_addr_encode(f, &p, fsinfo->eoa_pre_fsm_fsalloc); /* EOA before free-space header and section info */
/* Store addresses of free-space managers, if persisting */
- if (fsinfo->persist) {
+ if (fsinfo->persist)
/* Addresses of free-space managers */
for (ptype = H5F_MEM_PAGE_SUPER; ptype < H5F_MEM_PAGE_NTYPES; ptype++)
H5F_addr_encode(f, &p, fsinfo->fs_addr[ptype - 1]);
- } /* end if */
FUNC_LEAVE_NOAPI(SUCCEED)
-} /* end H5O_fsinfo_encode() */
+} /* end H5O__fsinfo_encode() */
/*-------------------------------------------------------------------------
- * Function: H5O_fsinfo_copy
+ * Function: H5O__fsinfo_copy
*
* Purpose: Copies a message from _MESG to _DEST, allocating _DEST if
* necessary.
@@ -252,13 +249,13 @@ H5O_fsinfo_encode(H5F_t *f, hbool_t H5_ATTR_UNUSED disable_shared, uint8_t *p, c
*-------------------------------------------------------------------------
*/
static void *
-H5O_fsinfo_copy(const void *_mesg, void *_dest)
+H5O__fsinfo_copy(const void *_mesg, void *_dest)
{
const H5O_fsinfo_t *fsinfo = (const H5O_fsinfo_t *)_mesg;
H5O_fsinfo_t * dest = (H5O_fsinfo_t *)_dest;
void * ret_value = NULL; /* Return value */
- FUNC_ENTER_NOAPI_NOINIT
+ FUNC_ENTER_STATIC
/* check args */
HDassert(fsinfo);
@@ -273,10 +270,10 @@ H5O_fsinfo_copy(const void *_mesg, void *_dest)
done:
FUNC_LEAVE_NOAPI(ret_value)
-} /* end H5O_fsinfo_copy() */
+} /* end H5O__fsinfo_copy() */
/*-------------------------------------------------------------------------
- * Function: H5O_fsinfo_size
+ * Function: H5O__fsinfo_size
*
* Purpose: Returns the size of the raw message in bytes not counting
* the message type or size fields, but only the data fields.
@@ -290,12 +287,12 @@ done:
*-------------------------------------------------------------------------
*/
static size_t
-H5O_fsinfo_size(const H5F_t *f, hbool_t H5_ATTR_UNUSED disable_shared, const void *_mesg)
+H5O__fsinfo_size(const H5F_t *f, hbool_t H5_ATTR_UNUSED disable_shared, const void *_mesg)
{
const H5O_fsinfo_t *fsinfo = (const H5O_fsinfo_t *)_mesg;
size_t ret_value = 0; /* Return value */
- FUNC_ENTER_NOAPI_NOINIT_NOERR
+ FUNC_ENTER_STATIC_NOERR
ret_value = 3 /* Version, strategy & persist */
+ (size_t)H5F_SIZEOF_SIZE(f) /* Free-space section threshold */
@@ -308,7 +305,7 @@ H5O_fsinfo_size(const H5F_t *f, hbool_t H5_ATTR_UNUSED disable_shared, const voi
ret_value += (H5F_MEM_PAGE_NTYPES - 1) * (size_t)H5F_SIZEOF_ADDR(f);
FUNC_LEAVE_NOAPI(ret_value)
-} /* end H5O_fsinfo_size() */
+} /* end H5O__fsinfo_size() */
/*-------------------------------------------------------------------------
* Function: H5O__fsinfo_free
@@ -334,6 +331,79 @@ H5O__fsinfo_free(void *mesg)
} /* end H5O__fsinfo_free() */
/*-------------------------------------------------------------------------
+ * Function: H5O__fsinfo_debug
+ *
+ * Purpose: Prints debugging info for a message.
+ *
+ * Return: Non-negative on success/Negative on failure
+ *
+ * Programmer: Vailin Choi; Feb 2009
+ *
+ *-------------------------------------------------------------------------
+ */
+static herr_t
+H5O__fsinfo_debug(H5F_t H5_ATTR_UNUSED *f, const void *_mesg, FILE *stream, int indent, int fwidth)
+{
+ const H5O_fsinfo_t *fsinfo = (const H5O_fsinfo_t *)_mesg;
+ H5F_mem_page_t ptype; /* Free-space types for iteration */
+
+ FUNC_ENTER_STATIC_NOERR
+
+ /* check args */
+ HDassert(f);
+ HDassert(fsinfo);
+ HDassert(stream);
+ HDassert(indent >= 0);
+ HDassert(fwidth >= 0);
+
+ HDfprintf(stream, "%*s%-*s ", indent, "", fwidth, "File space strategy:");
+ switch (fsinfo->strategy) {
+ case H5F_FSPACE_STRATEGY_FSM_AGGR:
+ HDfprintf(stream, "%s\n", "H5F_FSPACE_STRATEGY_FSM_AGGR");
+ break;
+
+ case H5F_FSPACE_STRATEGY_PAGE:
+ HDfprintf(stream, "%s\n", "H5F_FSPACE_STRATEGY_PAGE");
+ break;
+
+ case H5F_FSPACE_STRATEGY_AGGR:
+ HDfprintf(stream, "%s\n", "H5F_FSPACE_STRATEGY_AGGR");
+ break;
+
+ case H5F_FSPACE_STRATEGY_NONE:
+ HDfprintf(stream, "%s\n", "H5F_FSPACE_STRATEGY_NONE");
+ break;
+
+ case H5F_FSPACE_STRATEGY_NTYPES:
+ default:
+ HDfprintf(stream, "%s\n", "unknown");
+ } /* end switch */
+
+ HDfprintf(stream, "%*s%-*s %s\n", indent, "", fwidth,
+ "Free-space persist:", fsinfo->persist ? "TRUE" : "FALSE");
+
+ HDfprintf(stream, "%*s%-*s %" PRIuHSIZE "\n", indent, "", fwidth,
+ "Free-space section threshold:", fsinfo->threshold);
+
+ HDfprintf(stream, "%*s%-*s %" PRIuHSIZE "\n", indent, "", fwidth,
+ "File space page size:", fsinfo->page_size);
+
+ HDfprintf(stream, "%*s%-*s %zu\n", indent, "", fwidth,
+ "Page end metadata threshold:", fsinfo->pgend_meta_thres);
+
+ HDfprintf(stream, "%*s%-*s %" PRIuHADDR "\n", indent, "", fwidth,
+ "eoa_pre_fsm_fsalloc:", fsinfo->eoa_pre_fsm_fsalloc);
+
+ if (fsinfo->persist) {
+ for (ptype = H5F_MEM_PAGE_SUPER; ptype < H5F_MEM_PAGE_NTYPES; ptype++)
+ HDfprintf(stream, "%*s%-*s %" PRIuHADDR "\n", indent, "", fwidth,
+ "Free space manager address:", fsinfo->fs_addr[ptype - 1]);
+ } /* end if */
+
+ FUNC_LEAVE_NOAPI(SUCCEED)
+} /* end H5O__fsinfo_debug() */
+
+/*-------------------------------------------------------------------------
* Function: H5O_fsinfo_set_version
*
* Purpose: Set the version to encode the fsinfo message with.
@@ -403,74 +473,3 @@ H5O_fsinfo_check_version(H5F_libver_t high, H5O_fsinfo_t *fsinfo)
done:
FUNC_LEAVE_NOAPI(ret_value)
} /* end H5O_fsinfo_check_version() */
-
-/*-------------------------------------------------------------------------
- * Function: H5O__fsinfo_debug
- *
- * Purpose: Prints debugging info for a message.
- *
- * Return: Non-negative on success/Negative on failure
- *
- * Programmer: Vailin Choi; Feb 2009
- *
- *-------------------------------------------------------------------------
- */
-static herr_t
-H5O__fsinfo_debug(H5F_t H5_ATTR_UNUSED *f, const void *_mesg, FILE *stream, int indent, int fwidth)
-{
- const H5O_fsinfo_t *fsinfo = (const H5O_fsinfo_t *)_mesg;
- H5F_mem_page_t ptype; /* Free-space types for iteration */
-
- FUNC_ENTER_STATIC_NOERR
-
- /* check args */
- HDassert(f);
- HDassert(fsinfo);
- HDassert(stream);
- HDassert(indent >= 0);
- HDassert(fwidth >= 0);
-
- HDfprintf(stream, "%*s%-*s ", indent, "", fwidth, "File space strategy:");
- switch (fsinfo->strategy) {
- case H5F_FSPACE_STRATEGY_FSM_AGGR:
- HDfprintf(stream, "%s\n", "H5F_FSPACE_STRATEGY_FSM_AGGR");
- break;
-
- case H5F_FSPACE_STRATEGY_PAGE:
- HDfprintf(stream, "%s\n", "H5F_FSPACE_STRATEGY_PAGE");
- break;
-
- case H5F_FSPACE_STRATEGY_AGGR:
- HDfprintf(stream, "%s\n", "H5F_FSPACE_STRATEGY_AGGR");
- break;
-
- case H5F_FSPACE_STRATEGY_NONE:
- HDfprintf(stream, "%s\n", "H5F_FSPACE_STRATEGY_NONE");
- break;
-
- case H5F_FSPACE_STRATEGY_NTYPES:
- default:
- HDfprintf(stream, "%s\n", "unknown");
- } /* end switch */
-
- HDfprintf(stream, "%*s%-*s %t\n", indent, "", fwidth, "Free-space persist:", fsinfo->persist);
-
- HDfprintf(stream, "%*s%-*s %Hu\n", indent, "", fwidth,
- "Free-space section threshold:", fsinfo->threshold);
-
- HDfprintf(stream, "%*s%-*s %Hu\n", indent, "", fwidth, "File space page size:", fsinfo->page_size);
-
- HDfprintf(stream, "%*s%-*s %u\n", indent, "", fwidth,
- "Page end metadata threshold:", fsinfo->pgend_meta_thres);
-
- HDfprintf(stream, "%*s%-*s %a\n", indent, "", fwidth,
- "eoa_pre_fsm_fsalloc:", fsinfo->eoa_pre_fsm_fsalloc);
-
- if (fsinfo->persist) {
- for (ptype = H5F_MEM_PAGE_SUPER; ptype < H5F_MEM_PAGE_NTYPES; ptype++)
- HDfprintf(stream, "%*s%-*s %a\n", indent, "", fwidth,
- "Free space manager address:", fsinfo->fs_addr[ptype - 1]);
- } /* end if */
-
- FUNC_LEAVE_NOAPI(SUCCEED)
-} /* end H5O__fsinfo_debug() */
diff --git a/src/H5Oginfo.c b/src/H5Oginfo.c
index b87c7bd..8540cc4 100644
--- a/src/H5Oginfo.c
+++ b/src/H5Oginfo.c
@@ -15,7 +15,7 @@
*
* Created: H5Oginfo.c
* Aug 23 2005
- * Quincey Koziol <koziol@ncsa.uiuc.edu>
+ * Quincey Koziol
*
* Purpose: Group Information messages.
*
@@ -30,11 +30,11 @@
#include "H5Opkg.h" /* Object headers */
/* PRIVATE PROTOTYPES */
-static void *H5O_ginfo_decode(H5F_t *f, H5O_t *open_oh, unsigned mesg_flags, unsigned *ioflags, size_t p_size,
- const uint8_t *p);
-static herr_t H5O_ginfo_encode(H5F_t *f, hbool_t disable_shared, uint8_t *p, const void *_mesg);
-static void * H5O_ginfo_copy(const void *_mesg, void *_dest);
-static size_t H5O_ginfo_size(const H5F_t *f, hbool_t disable_shared, const void *_mesg);
+static void * H5O__ginfo_decode(H5F_t *f, H5O_t *open_oh, unsigned mesg_flags, unsigned *ioflags,
+ size_t p_size, const uint8_t *p);
+static herr_t H5O__ginfo_encode(H5F_t *f, hbool_t disable_shared, uint8_t *p, const void *_mesg);
+static void * H5O__ginfo_copy(const void *_mesg, void *_dest);
+static size_t H5O__ginfo_size(const H5F_t *f, hbool_t disable_shared, const void *_mesg);
static herr_t H5O__ginfo_free(void *_mesg);
static herr_t H5O__ginfo_debug(H5F_t *f, const void *_mesg, FILE *stream, int indent, int fwidth);
@@ -44,10 +44,10 @@ const H5O_msg_class_t H5O_MSG_GINFO[1] = {{
"ginfo", /*message name for debugging */
sizeof(H5O_ginfo_t), /*native message size */
0, /* messages are sharable? */
- H5O_ginfo_decode, /*decode message */
- H5O_ginfo_encode, /*encode message */
- H5O_ginfo_copy, /*copy the native value */
- H5O_ginfo_size, /*size of symbol table entry */
+ H5O__ginfo_decode, /*decode message */
+ H5O__ginfo_encode, /*encode message */
+ H5O__ginfo_copy, /*copy the native value */
+ H5O__ginfo_size, /*size of symbol table entry */
NULL, /*default reset method */
H5O__ginfo_free, /* free method */
NULL, /* file delete method */
@@ -74,7 +74,7 @@ const H5O_msg_class_t H5O_MSG_GINFO[1] = {{
H5FL_DEFINE_STATIC(H5O_ginfo_t);
/*-------------------------------------------------------------------------
- * Function: H5O_ginfo_decode
+ * Function: H5O__ginfo_decode
*
* Purpose: Decode a message and return a pointer to
* a newly allocated one.
@@ -84,20 +84,19 @@ H5FL_DEFINE_STATIC(H5O_ginfo_t);
* Failure: NULL
*
* Programmer: Quincey Koziol
- * koziol@ncsa.uiuc.edu
* Aug 30 2005
*
*-------------------------------------------------------------------------
*/
static void *
-H5O_ginfo_decode(H5F_t H5_ATTR_UNUSED *f, H5O_t H5_ATTR_UNUSED *open_oh, unsigned H5_ATTR_UNUSED mesg_flags,
- unsigned H5_ATTR_UNUSED *ioflags, size_t H5_ATTR_UNUSED p_size, const uint8_t *p)
+H5O__ginfo_decode(H5F_t H5_ATTR_UNUSED *f, H5O_t H5_ATTR_UNUSED *open_oh, unsigned H5_ATTR_UNUSED mesg_flags,
+ unsigned H5_ATTR_UNUSED *ioflags, size_t H5_ATTR_UNUSED p_size, const uint8_t *p)
{
H5O_ginfo_t * ginfo = NULL; /* Pointer to group information message */
unsigned char flags; /* Flags for encoding group info */
void * ret_value = NULL; /* Return value */
- FUNC_ENTER_NOAPI_NOINIT
+ FUNC_ENTER_STATIC
/* check args */
HDassert(p);
@@ -146,29 +145,28 @@ done:
ginfo = H5FL_FREE(H5O_ginfo_t, ginfo);
FUNC_LEAVE_NOAPI(ret_value)
-} /* end H5O_ginfo_decode() */
+} /* end H5O__ginfo_decode() */
/*-------------------------------------------------------------------------
- * Function: H5O_ginfo_encode
+ * Function: H5O__ginfo_encode
*
* Purpose: Encodes a message.
*
* Return: Non-negative on success/Negative on failure
*
* Programmer: Quincey Koziol
- * koziol@ncsa.uiuc.edu
* Aug 30 2005
*
*-------------------------------------------------------------------------
*/
static herr_t
-H5O_ginfo_encode(H5F_t H5_ATTR_UNUSED *f, hbool_t H5_ATTR_UNUSED disable_shared, uint8_t *p,
- const void *_mesg)
+H5O__ginfo_encode(H5F_t H5_ATTR_UNUSED *f, hbool_t H5_ATTR_UNUSED disable_shared, uint8_t *p,
+ const void *_mesg)
{
const H5O_ginfo_t *ginfo = (const H5O_ginfo_t *)_mesg;
unsigned char flags = 0; /* Flags for encoding group info */
- FUNC_ENTER_NOAPI_NOINIT_NOERR
+ FUNC_ENTER_STATIC_NOERR
/* check args */
HDassert(p);
@@ -195,10 +193,10 @@ H5O_ginfo_encode(H5F_t H5_ATTR_UNUSED *f, hbool_t H5_ATTR_UNUSED disable_shared,
} /* end if */
FUNC_LEAVE_NOAPI(SUCCEED)
-} /* end H5O_ginfo_encode() */
+} /* end H5O__ginfo_encode() */
/*-------------------------------------------------------------------------
- * Function: H5O_ginfo_copy
+ * Function: H5O__ginfo_copy
*
* Purpose: Copies a message from _MESG to _DEST, allocating _DEST if
* necessary.
@@ -208,19 +206,18 @@ H5O_ginfo_encode(H5F_t H5_ATTR_UNUSED *f, hbool_t H5_ATTR_UNUSED disable_shared,
* Failure: NULL
*
* Programmer: Quincey Koziol
- * koziol@ncsa.uiuc.edu
* Aug 30 2005
*
*-------------------------------------------------------------------------
*/
static void *
-H5O_ginfo_copy(const void *_mesg, void *_dest)
+H5O__ginfo_copy(const void *_mesg, void *_dest)
{
const H5O_ginfo_t *ginfo = (const H5O_ginfo_t *)_mesg;
H5O_ginfo_t * dest = (H5O_ginfo_t *)_dest;
void * ret_value = NULL; /* Return value */
- FUNC_ENTER_NOAPI_NOINIT
+ FUNC_ENTER_STATIC
/* check args */
HDassert(ginfo);
@@ -235,10 +232,10 @@ H5O_ginfo_copy(const void *_mesg, void *_dest)
done:
FUNC_LEAVE_NOAPI(ret_value)
-} /* end H5O_ginfo_copy() */
+} /* end H5O__ginfo_copy() */
/*-------------------------------------------------------------------------
- * Function: H5O_ginfo_size
+ * Function: H5O__ginfo_size
*
* Purpose: Returns the size of the raw message in bytes not counting
* the message type or size fields, but only the data fields.
@@ -249,18 +246,17 @@ done:
* Failure: zero
*
* Programmer: Quincey Koziol
- * koziol@ncsa.uiuc.edu
* Aug 30 2005
*
*-------------------------------------------------------------------------
*/
static size_t
-H5O_ginfo_size(const H5F_t H5_ATTR_UNUSED *f, hbool_t H5_ATTR_UNUSED disable_shared, const void *_mesg)
+H5O__ginfo_size(const H5F_t H5_ATTR_UNUSED *f, hbool_t H5_ATTR_UNUSED disable_shared, const void *_mesg)
{
const H5O_ginfo_t *ginfo = (const H5O_ginfo_t *)_mesg;
size_t ret_value = 0; /* Return value */
- FUNC_ENTER_NOAPI_NOINIT_NOERR
+ FUNC_ENTER_STATIC_NOERR
/* Set return value */
ret_value = 1 + /* Version */
@@ -275,7 +271,7 @@ H5O_ginfo_size(const H5F_t H5_ATTR_UNUSED *f, hbool_t H5_ATTR_UNUSED disable_sha
: 0);
FUNC_LEAVE_NOAPI(ret_value)
-} /* end H5O_ginfo_size() */
+} /* end H5O__ginfo_size() */
/*-------------------------------------------------------------------------
* Function: H5O__ginfo_free
@@ -292,7 +288,7 @@ H5O_ginfo_size(const H5F_t H5_ATTR_UNUSED *f, hbool_t H5_ATTR_UNUSED disable_sha
static herr_t
H5O__ginfo_free(void *mesg)
{
- FUNC_ENTER_NOAPI_NOINIT_NOERR
+ FUNC_ENTER_STATIC_NOERR
HDassert(mesg);
@@ -309,7 +305,6 @@ H5O__ginfo_free(void *mesg)
* Return: Non-negative on success/Negative on failure
*
* Programmer: Quincey Koziol
- * koziol@ncsa.uiuc.edu
* Aug 30 2005
*
*-------------------------------------------------------------------------
diff --git a/src/H5Oint.c b/src/H5Oint.c
index 6246e9a..a88a026 100644
--- a/src/H5Oint.c
+++ b/src/H5Oint.c
@@ -264,17 +264,8 @@ done:
* Failure: Negative
*
* Programmer: Robb Matzke
- * matzke@llnl.gov
* Aug 5 1997
*
- * Changes: 2018 August 17
- * Jacob Smith
- * Refactor out the operations into two separate steps --
- * preparation and application -- to facilitate overriding the
- * library-default size allocated for the object header. This
- * function is retained as a wrapper, to minimize changes to
- * unaffected calling functions.
- *
*-------------------------------------------------------------------------
*/
herr_t
@@ -580,7 +571,7 @@ H5O_open(H5O_loc_t *loc)
#ifdef H5O_DEBUG
if (H5DEBUG(O))
- HDfprintf(H5DEBUG(O), "> %a\n", loc->addr);
+ HDfprintf(H5DEBUG(O), "> %" PRIuHADDR "\n", loc->addr);
#endif
/* Turn off the variable for holding file or increment open-lock counters */
@@ -811,10 +802,10 @@ H5O_close(H5O_loc_t *loc, hbool_t *file_closed /*out*/)
#ifdef H5O_DEBUG
if (H5DEBUG(O)) {
if (FALSE == H5F_ID_EXISTS(loc->file) && 1 == H5F_NREFS(loc->file))
- HDfprintf(H5DEBUG(O), "< %a auto %lu remaining\n", loc->addr,
+ HDfprintf(H5DEBUG(O), "< %" PRIuHADDR " auto %lu remaining\n", loc->addr,
(unsigned long)H5F_NOPEN_OBJS(loc->file));
else
- HDfprintf(H5DEBUG(O), "< %a\n", loc->addr);
+ HDfprintf(H5DEBUG(O), "< %" PRIuHADDR "\n", loc->addr);
}
#endif
@@ -846,7 +837,6 @@ done:
* Failure: -1
*
* Programmer: Robb Matzke
- * matzke@llnl.gov
* Aug 5 1997
*
*-------------------------------------------------------------------------
@@ -962,7 +952,6 @@ done:
* Failure: Negative
*
* Programmer: Robb Matzke
- * matzke@llnl.gov
* Aug 5 1997
*
*-------------------------------------------------------------------------
@@ -1010,7 +999,6 @@ done:
* Failure: NULL
*
* Programmer: Quincey Koziol
- * koziol@ncsa.uiuc.edu
* Dec 31 2002
*
*-------------------------------------------------------------------------
@@ -1198,7 +1186,6 @@ done:
* Failure: NULL
*
* Programmer: Quincey Koziol
- * koziol@hdfgroup.org
* Jul 13 2008
*
*-------------------------------------------------------------------------
@@ -1244,7 +1231,6 @@ done:
* Failure: Negative
*
* Programmer: Quincey Koziol
- * koziol@hdfgroup.org
* Jul 13 2008
*
*-------------------------------------------------------------------------
@@ -1279,7 +1265,6 @@ done:
* Failure: Negative
*
* Programmer: Quincey Koziol
- * koziol@ncsa.uiuc.edu
* Dec 31 2002
*
*-------------------------------------------------------------------------
@@ -1475,7 +1460,6 @@ done:
* Return: Non-negative on success/Negative on failure
*
* Programmer: Quincey Koziol
- * <koziol@ncsa.uiuc.edu>
* Tuesday, January 21, 2003
*
*-------------------------------------------------------------------------
@@ -1513,7 +1497,7 @@ H5O_bogus_oh(H5F_t *f, H5O_t *oh, unsigned bogus_id, unsigned mesg_flags)
else if (bogus_id == H5O_BOGUS_INVALID_ID)
type = H5O_MSG_BOGUS_INVALID;
else
- HGOTO_ERROR(H5E_ATOM, H5E_BADATOM, FAIL, "invalid ID for 'bogus' message")
+ HGOTO_ERROR(H5E_ID, H5E_BADID, FAIL, "invalid ID for 'bogus' message")
/* Allocate space in the object header for bogus message */
if (H5O__msg_alloc(f, oh, type, &mesg_flags, bogus, &idx) < 0)
@@ -1546,7 +1530,6 @@ done:
* Return: Non-negative on success/Negative on failure
*
* Programmer: Quincey Koziol
- * koziol@ncsa.uiuc.edu
* Mar 19 2003
*
*-------------------------------------------------------------------------
@@ -1608,7 +1591,6 @@ done:
* Return: Non-negative on success/Negative on failure
*
* Programmer: Quincey Koziol
- * koziol@ncsa.uiuc.edu
* Mar 19 2003
*
*-------------------------------------------------------------------------
@@ -1708,10 +1690,9 @@ H5O__obj_type_real(const H5O_t *oh, H5O_type_t *obj_type)
/* Set type to "unknown" */
*obj_type = H5O_TYPE_UNKNOWN;
}
- else {
+ else
/* Set object type */
*obj_type = obj_class->type;
- }
FUNC_LEAVE_NOAPI(SUCCEED)
} /* end H5O__obj_type_real() */
@@ -1892,7 +1873,6 @@ H5O_loc_reset(H5O_loc_t *loc)
* Failure: Negative
*
* Programmer: Quincey Koziol
- * koziol@ncsa.uiuc.edu
* Monday, September 19, 2005
*
*-------------------------------------------------------------------------
@@ -2232,7 +2212,7 @@ H5O_get_info(const H5O_loc_t *loc, H5O_info2_t *oinfo, unsigned fields)
/* Set the object's reference count */
oinfo->rc = oh->nlink;
- } /* end if */
+ }
/* Get time information, if requested */
if (fields & H5O_INFO_TIME) {
@@ -2526,8 +2506,8 @@ H5O_get_oh_addr(const H5O_t *oh)
/*-------------------------------------------------------------------------
* Function: H5O_get_oh_flags
*
- * Programmer: Jacob Smith
- * 2018 August 17
+ * Programmer: Jacob Smith
+ * 2018 August 17
*
*-------------------------------------------------------------------------
*/
@@ -2542,12 +2522,12 @@ H5O_get_oh_flags(const H5O_t *oh)
/*-------------------------------------------------------------------------
* Function: H5O_get_oh_mtime
*
- * Purpose: Retrieve an object's modification time. Assumes that the
+ * Purpose: Retrieve an object's modification time. Assumes that the
* caller has verified that accessing this variable is appropriate
* to the header in question.
*
- * Programmer: Jacob Smith
- * 2018 August 17
+ * Programmer: Jacob Smith
+ * 2018 August 17
*
*-------------------------------------------------------------------------
*/
@@ -2563,8 +2543,8 @@ H5O_get_oh_mtime(const H5O_t *oh)
/*-------------------------------------------------------------------------
* Function: H5O_get_oh_version
*
- * Programmer: Jacob Smith
- * 2018 August 17
+ * Programmer: Jacob Smith
+ * 2018 August 17
*
*-------------------------------------------------------------------------
*/
@@ -2812,7 +2792,7 @@ H5O__visit(H5G_loc_t *loc, const char *obj_name, H5_index_t idx_type, H5_iter_or
/* Get an ID for the visited object */
if ((obj_id = H5VL_wrap_register(opened_type, obj, TRUE)) < 0)
- HGOTO_ERROR(H5E_ATOM, H5E_CANTREGISTER, FAIL, "unable to register visited object")
+ HGOTO_ERROR(H5E_ID, H5E_CANTREGISTER, FAIL, "unable to register visited object")
/* Make callback for starting object */
if ((ret_value = op(obj_id, ".", &oinfo, op_data)) < 0)
@@ -2896,7 +2876,6 @@ done:
* Return: Non-negative on success/Negative on failure
*
* Programmer: Quincey Koziol
- * koziol@hdfgroup.org
* Jul 13 2008
*
*-------------------------------------------------------------------------
@@ -2931,7 +2910,6 @@ done:
* Return: Non-negative on success/Negative on failure
*
* Programmer: Quincey Koziol
- * koziol@hdfgroup.org
* Jul 13 2008
*
*-------------------------------------------------------------------------
@@ -2944,7 +2922,8 @@ H5O__dec_rc(H5O_t *oh)
FUNC_ENTER_PACKAGE
/* check args */
- HDassert(oh);
+ if (!oh)
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "invalid object header")
/* Decrement reference count */
oh->rc--;
@@ -2967,7 +2946,6 @@ done:
* Return: Non-negative on success/Negative on failure
*
* Programmer: Quincey Koziol
- * koziol@hdfgroup.org
* Oct 08 2010
*
*-------------------------------------------------------------------------
@@ -3031,7 +3009,6 @@ H5O_get_proxy(const H5O_t *oh)
* Return: Non-negative on success/Negative on failure
*
* Programmer: Quincey Koziol
- * koziol@ncsa.uiuc.edu
* Jan 15 2003
*
*-------------------------------------------------------------------------
diff --git a/src/H5Olayout.c b/src/H5Olayout.c
index 2ca05e4..651e317 100644
--- a/src/H5Olayout.c
+++ b/src/H5Olayout.c
@@ -11,13 +11,13 @@
* help@hdfgroup.org. *
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
-/* Programmer: Robb Matzke <matzke@llnl.gov>
+/* Programmer: Robb Matzke
* Wednesday, October 8, 1997
*
* Purpose: Messages related to data layout.
*/
-#define H5D_FRIEND /*suppress error about including H5Dpkg */
+#define H5D_FRIEND /*suppress error about including H5Dpkg */
#include "H5Omodule.h" /* This source code file is part of the H5O module */
#include "H5private.h" /* Generic Functions */
@@ -90,12 +90,13 @@ H5FL_DEFINE(H5O_layout_t);
*/
static void *
H5O__layout_decode(H5F_t *f, H5O_t H5_ATTR_UNUSED *open_oh, unsigned H5_ATTR_UNUSED mesg_flags,
- unsigned H5_ATTR_UNUSED *ioflags, size_t H5_ATTR_UNUSED p_size, const uint8_t *p)
+ unsigned H5_ATTR_UNUSED *ioflags, size_t p_size, const uint8_t *p)
{
- H5O_layout_t *mesg = NULL;
- uint8_t * heap_block = NULL;
- unsigned u;
- void * ret_value = NULL; /* Return value */
+ H5O_layout_t * mesg = NULL;
+ uint8_t * heap_block = NULL;
+ unsigned u;
+ const uint8_t *p_end = p + p_size - 1; /* End of the p buffer */
+ void * ret_value = NULL; /* Return value */
FUNC_ENTER_STATIC
@@ -179,6 +180,10 @@ H5O__layout_decode(H5F_t *f, H5O_t H5_ATTR_UNUSED *open_oh, unsigned H5_ATTR_UNU
if (mesg->type == H5D_COMPACT) {
UINT32DECODE(p, mesg->storage.u.compact.size);
if (mesg->storage.u.compact.size > 0) {
+ /* Ensure that size doesn't exceed buffer size, due to possible data corruption */
+ if (p + mesg->storage.u.compact.size - 1 > p_end)
+ HGOTO_ERROR(H5E_OHDR, H5E_OVERFLOW, NULL, "storage size exceeds buffer size")
+
if (NULL == (mesg->storage.u.compact.buf = H5MM_malloc(mesg->storage.u.compact.size)))
HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL,
"memory allocation failed for compact data buffer")
@@ -198,6 +203,10 @@ H5O__layout_decode(H5F_t *f, H5O_t H5_ATTR_UNUSED *open_oh, unsigned H5_ATTR_UNU
UINT16DECODE(p, mesg->storage.u.compact.size);
if (mesg->storage.u.compact.size > 0) {
+ /* Ensure that size doesn't exceed buffer size, due to possible data corruption */
+ if (p + mesg->storage.u.compact.size - 1 > p_end)
+ HGOTO_ERROR(H5E_OHDR, H5E_OVERFLOW, NULL, "storage size exceeds buffer size")
+
/* Allocate space for compact data */
if (NULL == (mesg->storage.u.compact.buf = H5MM_malloc(mesg->storage.u.compact.size)))
HGOTO_ERROR(H5E_OHDR, H5E_CANTALLOC, NULL,
@@ -433,8 +442,7 @@ H5O__layout_decode(H5F_t *f, H5O_t H5_ATTR_UNUSED *open_oh, unsigned H5_ATTR_UNU
(mesg->storage.u.virt.list[i].source_file_name = (char *)H5MM_malloc(tmp_size)))
HGOTO_ERROR(H5E_OHDR, H5E_RESOURCE, NULL,
"unable to allocate memory for source file name")
- (void)H5MM_memcpy(mesg->storage.u.virt.list[i].source_file_name, heap_block_p,
- tmp_size);
+ H5MM_memcpy(mesg->storage.u.virt.list[i].source_file_name, heap_block_p, tmp_size);
heap_block_p += tmp_size;
/* Source dataset name */
@@ -443,8 +451,7 @@ H5O__layout_decode(H5F_t *f, H5O_t H5_ATTR_UNUSED *open_oh, unsigned H5_ATTR_UNU
(mesg->storage.u.virt.list[i].source_dset_name = (char *)H5MM_malloc(tmp_size)))
HGOTO_ERROR(H5E_OHDR, H5E_RESOURCE, NULL,
"unable to allocate memory for source dataset name")
- (void)H5MM_memcpy(mesg->storage.u.virt.list[i].source_dset_name, heap_block_p,
- tmp_size);
+ H5MM_memcpy(mesg->storage.u.virt.list[i].source_dset_name, heap_block_p, tmp_size);
heap_block_p += tmp_size;
/* Source selection */
@@ -889,13 +896,13 @@ done:
} /* end H5O__layout_reset() */
/*-------------------------------------------------------------------------
- * Function: H5O__layout_free
+ * Function: H5O__layout_free
*
- * Purpose: Free's the message
+ * Purpose: Free's the message
*
- * Return: Non-negative on success/Negative on failure
+ * Return: Non-negative on success/Negative on failure
*
- * Programmer: Quincey Koziol
+ * Programmer: Quincey Koziol
* Saturday, March 11, 2000
*
*-------------------------------------------------------------------------
@@ -997,7 +1004,7 @@ H5O__layout_pre_copy_file(H5F_t H5_ATTR_UNUSED *file_src, const void *mesg_src,
const H5O_layout_t *layout_src = (const H5O_layout_t *)mesg_src; /* Source layout */
herr_t ret_value = SUCCEED; /* Return value */
- FUNC_ENTER_NOAPI_NOINIT
+ FUNC_ENTER_STATIC
/* check args */
HDassert(cpy_info);
@@ -1196,31 +1203,32 @@ H5O__layout_debug(H5F_t H5_ATTR_UNUSED *f, const void *_mesg, FILE *stream, int
(unsigned)mesg->u.chunk.idx_type);
break;
} /* end switch */
- HDfprintf(stream, "%*s%-*s %a\n", indent, "", fwidth,
+ HDfprintf(stream, "%*s%-*s %" PRIuHADDR "\n", indent, "", fwidth,
"Index address:", mesg->storage.u.chunk.idx_addr);
break;
case H5D_CONTIGUOUS:
HDfprintf(stream, "%*s%-*s %s\n", indent, "", fwidth, "Type:", "Contiguous");
- HDfprintf(stream, "%*s%-*s %a\n", indent, "", fwidth,
+ HDfprintf(stream, "%*s%-*s %" PRIuHADDR "\n", indent, "", fwidth,
"Data address:", mesg->storage.u.contig.addr);
- HDfprintf(stream, "%*s%-*s %Hu\n", indent, "", fwidth, "Data Size:", mesg->storage.u.contig.size);
+ HDfprintf(stream, "%*s%-*s %" PRIuHSIZE "\n", indent, "", fwidth,
+ "Data Size:", mesg->storage.u.contig.size);
break;
case H5D_COMPACT:
HDfprintf(stream, "%*s%-*s %s\n", indent, "", fwidth, "Type:", "Compact");
- HDfprintf(stream, "%*s%-*s %Zu\n", indent, "", fwidth,
+ HDfprintf(stream, "%*s%-*s %zu\n", indent, "", fwidth,
"Data Size:", mesg->storage.u.compact.size);
break;
case H5D_VIRTUAL:
HDfprintf(stream, "%*s%-*s %s\n", indent, "", fwidth, "Type:", "Virtual");
- HDfprintf(stream, "%*s%-*s %a\n", indent, "", fwidth,
+ HDfprintf(stream, "%*s%-*s %" PRIuHADDR "\n", indent, "", fwidth,
"Global heap address:", mesg->storage.u.virt.serial_list_hobjid.addr);
- HDfprintf(stream, "%*s%-*s %Zu\n", indent, "", fwidth,
+ HDfprintf(stream, "%*s%-*s %zu\n", indent, "", fwidth,
"Global heap index:", mesg->storage.u.virt.serial_list_hobjid.idx);
for (u = 0; u < mesg->storage.u.virt.list_nused; u++) {
- HDfprintf(stream, "%*sMapping %u:\n", indent, "", u);
+ HDfprintf(stream, "%*sMapping %zu:\n", indent, "", u);
HDfprintf(stream, "%*s%-*s %s\n", indent + 3, "", fwidth - 3,
"Virtual selection:", "<Not yet implemented>");
HDfprintf(stream, "%*s%-*s %s\n", indent + 3, "", fwidth - 3,
diff --git a/src/H5Olinfo.c b/src/H5Olinfo.c
index d8bc232..711f199 100644
--- a/src/H5Olinfo.c
+++ b/src/H5Olinfo.c
@@ -15,7 +15,7 @@
*
* Created: H5Olinfo.c
* Aug 23 2005
- * Quincey Koziol <koziol@ncsa.uiuc.edu>
+ * Quincey Koziol
*
* Purpose: Link Information messages.
*
@@ -36,9 +36,9 @@
/* PRIVATE PROTOTYPES */
static void * H5O__linfo_decode(H5F_t *f, H5O_t *open_oh, unsigned mesg_flags, unsigned *ioflags,
size_t p_size, const uint8_t *p);
-static herr_t H5O_linfo_encode(H5F_t *f, hbool_t disable_shared, uint8_t *p, const void *_mesg);
-static void * H5O_linfo_copy(const void *_mesg, void *_dest);
-static size_t H5O_linfo_size(const H5F_t *f, hbool_t disable_shared, const void *_mesg);
+static herr_t H5O__linfo_encode(H5F_t *f, hbool_t disable_shared, uint8_t *p, const void *_mesg);
+static void * H5O__linfo_copy(const void *_mesg, void *_dest);
+static size_t H5O__linfo_size(const H5F_t *f, hbool_t disable_shared, const void *_mesg);
static herr_t H5O__linfo_free(void *_mesg);
static herr_t H5O__linfo_delete(H5F_t *f, H5O_t *open_oh, void *_mesg);
static void *H5O__linfo_copy_file(H5F_t *file_src, void *native_src, H5F_t *file_dst, hbool_t *recompute_size,
@@ -55,9 +55,9 @@ const H5O_msg_class_t H5O_MSG_LINFO[1] = {{
sizeof(H5O_linfo_t), /*native message size */
0, /* messages are sharable? */
H5O__linfo_decode, /*decode message */
- H5O_linfo_encode, /*encode message */
- H5O_linfo_copy, /*copy the native value */
- H5O_linfo_size, /*size of symbol table entry */
+ H5O__linfo_encode, /*encode message */
+ H5O__linfo_copy, /*copy the native value */
+ H5O__linfo_size, /*size of symbol table entry */
NULL, /*default reset method */
H5O__linfo_free, /* free method */
H5O__linfo_delete, /* file delete method */
@@ -100,7 +100,6 @@ H5FL_DEFINE_STATIC(H5O_linfo_t);
* Failure: NULL
*
* Programmer: Quincey Koziol
- * koziol@ncsa.uiuc.edu
* Aug 23 2005
*
*-------------------------------------------------------------------------
@@ -167,25 +166,24 @@ done:
} /* end H5O__linfo_decode() */
/*-------------------------------------------------------------------------
- * Function: H5O_linfo_encode
+ * Function: H5O__linfo_encode
*
* Purpose: Encodes a message.
*
* Return: Non-negative on success/Negative on failure
*
* Programmer: Quincey Koziol
- * koziol@ncsa.uiuc.edu
* Aug 23 2005
*
*-------------------------------------------------------------------------
*/
static herr_t
-H5O_linfo_encode(H5F_t *f, hbool_t H5_ATTR_UNUSED disable_shared, uint8_t *p, const void *_mesg)
+H5O__linfo_encode(H5F_t *f, hbool_t H5_ATTR_UNUSED disable_shared, uint8_t *p, const void *_mesg)
{
const H5O_linfo_t *linfo = (const H5O_linfo_t *)_mesg;
unsigned char index_flags; /* Flags for encoding link index info */
- FUNC_ENTER_NOAPI_NOINIT_NOERR
+ FUNC_ENTER_STATIC_NOERR
/* check args */
HDassert(f);
@@ -217,10 +215,10 @@ H5O_linfo_encode(H5F_t *f, hbool_t H5_ATTR_UNUSED disable_shared, uint8_t *p, co
HDassert(!H5F_addr_defined(linfo->corder_bt2_addr));
FUNC_LEAVE_NOAPI(SUCCEED)
-} /* end H5O_linfo_encode() */
+} /* end H5O__linfo_encode() */
/*-------------------------------------------------------------------------
- * Function: H5O_linfo_copy
+ * Function: H5O__linfo_copy
*
* Purpose: Copies a message from _MESG to _DEST, allocating _DEST if
* necessary.
@@ -229,19 +227,18 @@ H5O_linfo_encode(H5F_t *f, hbool_t H5_ATTR_UNUSED disable_shared, uint8_t *p, co
* Failure: NULL
*
* Programmer: Quincey Koziol
- * koziol@ncsa.uiuc.edu
* Aug 23 2005
*
*-------------------------------------------------------------------------
*/
static void *
-H5O_linfo_copy(const void *_mesg, void *_dest)
+H5O__linfo_copy(const void *_mesg, void *_dest)
{
const H5O_linfo_t *linfo = (const H5O_linfo_t *)_mesg;
H5O_linfo_t * dest = (H5O_linfo_t *)_dest;
void * ret_value = NULL; /* Return value */
- FUNC_ENTER_NOAPI_NOINIT
+ FUNC_ENTER_STATIC
/* check args */
HDassert(linfo);
@@ -256,10 +253,10 @@ H5O_linfo_copy(const void *_mesg, void *_dest)
done:
FUNC_LEAVE_NOAPI(ret_value)
-} /* end H5O_linfo_copy() */
+} /* end H5O__linfo_copy() */
/*-------------------------------------------------------------------------
- * Function: H5O_linfo_size
+ * Function: H5O__linfo_size
*
* Purpose: Returns the size of the raw message in bytes not counting
* the message type or size fields, but only the data fields.
@@ -269,18 +266,17 @@ done:
* Failure: zero
*
* Programmer: Quincey Koziol
- * koziol@ncsa.uiuc.edu
* Aug 23 2005
*
*-------------------------------------------------------------------------
*/
static size_t
-H5O_linfo_size(const H5F_t *f, hbool_t H5_ATTR_UNUSED disable_shared, const void *_mesg)
+H5O__linfo_size(const H5F_t *f, hbool_t H5_ATTR_UNUSED disable_shared, const void *_mesg)
{
const H5O_linfo_t *linfo = (const H5O_linfo_t *)_mesg;
size_t ret_value = 0; /* Return value */
- FUNC_ENTER_NOAPI_NOINIT_NOERR
+ FUNC_ENTER_STATIC_NOERR
/* Set return value */
ret_value =
@@ -293,7 +289,7 @@ H5O_linfo_size(const H5F_t *f, hbool_t H5_ATTR_UNUSED disable_shared, const void
: 0); /* Address of v2 B-tree for indexing creation order values of links */
FUNC_LEAVE_NOAPI(ret_value)
-} /* end H5O_linfo_size() */
+} /* end H5O__linfo_size() */
/*-------------------------------------------------------------------------
* Function: H5O__linfo_free
@@ -383,7 +379,7 @@ H5O__linfo_copy_file(H5F_t H5_ATTR_UNUSED *file_src, void *native_src, H5F_t *fi
HDassert(cpy_info);
/* Copy the source message */
- if (NULL == (linfo_dst = (H5O_linfo_t *)H5O_linfo_copy(linfo_src, NULL)))
+ if (NULL == (linfo_dst = (H5O_linfo_t *)H5O__linfo_copy(linfo_src, NULL)))
HGOTO_ERROR(H5E_OHDR, H5E_CANTCOPY, NULL, "memory allocation failed")
/* If we are performing a 'shallow hierarchy' copy, and the links in this
@@ -430,7 +426,6 @@ done:
* Failure: Negative
*
* Programmer: Quincey Koziol
- * koziol@hdfgroup.org
* Sept 26 2006
*
*-------------------------------------------------------------------------
@@ -535,7 +530,6 @@ done:
* Return: Non-negative on success/Negative on failure
*
* Programmer: Quincey Koziol
- * koziol@ncsa.uiuc.edu
* Aug 23 2005
*
*-------------------------------------------------------------------------
@@ -554,17 +548,18 @@ H5O__linfo_debug(H5F_t H5_ATTR_UNUSED *f, const void *_mesg, FILE *stream, int i
HDassert(indent >= 0);
HDassert(fwidth >= 0);
- HDfprintf(stream, "%*s%-*s %t\n", indent, "", fwidth,
- "Track creation order of links:", linfo->track_corder);
- HDfprintf(stream, "%*s%-*s %t\n", indent, "", fwidth,
- "Index creation order of links:", linfo->index_corder);
- HDfprintf(stream, "%*s%-*s %Hu\n", indent, "", fwidth, "Number of links:", linfo->nlinks);
- HDfprintf(stream, "%*s%-*s %Hd\n", indent, "", fwidth, "Max. creation order value:", linfo->max_corder);
- HDfprintf(stream, "%*s%-*s %a\n", indent, "", fwidth,
+ HDfprintf(stream, "%*s%-*s %s\n", indent, "", fwidth,
+ "Track creation order of links:", linfo->track_corder ? "TRUE" : "FALSE");
+ HDfprintf(stream, "%*s%-*s %s\n", indent, "", fwidth,
+ "Index creation order of links:", linfo->index_corder ? "TRUE" : "FALSE");
+ HDfprintf(stream, "%*s%-*s %" PRIuHSIZE "\n", indent, "", fwidth, "Number of links:", linfo->nlinks);
+ HDfprintf(stream, "%*s%-*s %" PRId64 "\n", indent, "", fwidth,
+ "Max. creation order value:", linfo->max_corder);
+ HDfprintf(stream, "%*s%-*s %" PRIuHADDR "\n", indent, "", fwidth,
"'Dense' link storage fractal heap address:", linfo->fheap_addr);
- HDfprintf(stream, "%*s%-*s %a\n", indent, "", fwidth,
+ HDfprintf(stream, "%*s%-*s %" PRIuHADDR "\n", indent, "", fwidth,
"'Dense' link storage name index v2 B-tree address:", linfo->name_bt2_addr);
- HDfprintf(stream, "%*s%-*s %a\n", indent, "", fwidth,
+ HDfprintf(stream, "%*s%-*s %" PRIuHADDR "\n", indent, "", fwidth,
"'Dense' link storage creation order index v2 B-tree address:", linfo->corder_bt2_addr);
FUNC_LEAVE_NOAPI(SUCCEED)
diff --git a/src/H5Olink.c b/src/H5Olink.c
index e8df427..75456f4 100644
--- a/src/H5Olink.c
+++ b/src/H5Olink.c
@@ -15,7 +15,7 @@
*
* Created: H5Olink.c
* Aug 29 2005
- * Quincey Koziol <koziol@ncsa.uiuc.edu>
+ * Quincey Koziol
*
* Purpose: Link messages.
*
@@ -38,13 +38,13 @@
/* PRIVATE PROTOTYPES */
static void *H5O__link_decode(H5F_t *f, H5O_t *open_oh, unsigned mesg_flags, unsigned *ioflags, size_t p_size,
const uint8_t *p);
-static herr_t H5O_link_encode(H5F_t *f, hbool_t disable_shared, uint8_t *p, const void *_mesg);
-static void * H5O_link_copy(const void *_mesg, void *_dest);
-static size_t H5O_link_size(const H5F_t *f, hbool_t disable_shared, const void *_mesg);
+static herr_t H5O__link_encode(H5F_t *f, hbool_t disable_shared, uint8_t *p, const void *_mesg);
+static void * H5O__link_copy(const void *_mesg, void *_dest);
+static size_t H5O__link_size(const H5F_t *f, hbool_t disable_shared, const void *_mesg);
static herr_t H5O__link_reset(void *_mesg);
static herr_t H5O__link_free(void *_mesg);
-static herr_t H5O_link_pre_copy_file(H5F_t *file_src, const void *mesg_src, hbool_t *deleted,
- const H5O_copy_t *cpy_info, void *udata);
+static herr_t H5O__link_pre_copy_file(H5F_t *file_src, const void *mesg_src, hbool_t *deleted,
+ const H5O_copy_t *cpy_info, void *udata);
static void * H5O__link_copy_file(H5F_t *file_src, void *native_src, H5F_t *file_dst, hbool_t *recompute_size,
unsigned *mesg_flags, H5O_copy_t *cpy_info, void *udata);
static herr_t H5O__link_post_copy_file(const H5O_loc_t *src_oloc, const void *mesg_src, H5O_loc_t *dst_oloc,
@@ -58,16 +58,16 @@ const H5O_msg_class_t H5O_MSG_LINK[1] = {{
sizeof(H5O_link_t), /*native message size */
0, /* messages are sharable? */
H5O__link_decode, /*decode message */
- H5O_link_encode, /*encode message */
- H5O_link_copy, /*copy the native value */
- H5O_link_size, /*size of symbol table entry */
+ H5O__link_encode, /*encode message */
+ H5O__link_copy, /*copy the native value */
+ H5O__link_size, /*size of symbol table entry */
H5O__link_reset, /* reset method */
H5O__link_free, /* free method */
H5O_link_delete, /* file delete method */
NULL, /* link method */
NULL, /*set share method */
NULL, /*can share method */
- H5O_link_pre_copy_file, /* pre copy native value to file */
+ H5O__link_pre_copy_file, /* pre copy native value to file */
H5O__link_copy_file, /* copy native value to file */
H5O__link_post_copy_file, /* post copy native value to file */
NULL, /* get creation index */
@@ -106,7 +106,6 @@ H5FL_DEFINE_STATIC(H5O_link_t);
* Failure: NULL
*
* Programmer: Quincey Koziol
- * koziol@ncsa.uiuc.edu
* Aug 29 2005
*
*-------------------------------------------------------------------------
@@ -276,26 +275,25 @@ done:
} /* end H5O__link_decode() */
/*-------------------------------------------------------------------------
- * Function: H5O_link_encode
+ * Function: H5O__link_encode
*
* Purpose: Encodes a link message.
*
* Return: Non-negative on success/Negative on failure
*
* Programmer: Quincey Koziol
- * koziol@ncsa.uiuc.edu
* Aug 29 2005
*
*-------------------------------------------------------------------------
*/
static herr_t
-H5O_link_encode(H5F_t *f, hbool_t H5_ATTR_UNUSED disable_shared, uint8_t *p, const void *_mesg)
+H5O__link_encode(H5F_t *f, hbool_t H5_ATTR_UNUSED disable_shared, uint8_t *p, const void *_mesg)
{
const H5O_link_t *lnk = (const H5O_link_t *)_mesg;
uint64_t len; /* Length of a string in the message */
unsigned char link_flags; /* Flags for encoding link info */
- FUNC_ENTER_NOAPI_NOINIT_NOERR
+ FUNC_ENTER_STATIC_NOERR
/* check args */
HDassert(f);
@@ -395,10 +393,10 @@ H5O_link_encode(H5F_t *f, hbool_t H5_ATTR_UNUSED disable_shared, uint8_t *p, con
} /* end switch */
FUNC_LEAVE_NOAPI(SUCCEED)
-} /* end H5O_link_encode() */
+} /* end H5O__link_encode() */
/*-------------------------------------------------------------------------
- * Function: H5O_link_copy
+ * Function: H5O__link_copy
*
* Purpose: Copies a message from _MESG to _DEST, allocating _DEST if
* necessary.
@@ -408,19 +406,18 @@ H5O_link_encode(H5F_t *f, hbool_t H5_ATTR_UNUSED disable_shared, uint8_t *p, con
* Failure: NULL
*
* Programmer: Quincey Koziol
- * koziol@ncsa.uiuc.edu
* Aug 29 2005
*
*-------------------------------------------------------------------------
*/
static void *
-H5O_link_copy(const void *_mesg, void *_dest)
+H5O__link_copy(const void *_mesg, void *_dest)
{
const H5O_link_t *lnk = (const H5O_link_t *)_mesg;
H5O_link_t * dest = (H5O_link_t *)_dest;
void * ret_value = NULL; /* Return value */
- FUNC_ENTER_NOAPI_NOINIT
+ FUNC_ENTER_STATIC
/* Check args */
HDassert(lnk);
@@ -461,10 +458,10 @@ done:
} /* end if */
FUNC_LEAVE_NOAPI(ret_value)
-} /* end H5O_link_copy() */
+} /* end H5O__link_copy() */
/*-------------------------------------------------------------------------
- * Function: H5O_link_size
+ * Function: H5O__link_size
*
* Purpose: Returns the size of the raw message in bytes not counting
* the message type or size fields, but only the data fields.
@@ -475,20 +472,19 @@ done:
* Failure: zero
*
* Programmer: Quincey Koziol
- * koziol@ncsa.uiuc.edu
* Aug 29 2005
*
*-------------------------------------------------------------------------
*/
static size_t
-H5O_link_size(const H5F_t *f, hbool_t H5_ATTR_UNUSED disable_shared, const void *_mesg)
+H5O__link_size(const H5F_t *f, hbool_t H5_ATTR_UNUSED disable_shared, const void *_mesg)
{
const H5O_link_t *lnk = (const H5O_link_t *)_mesg;
uint64_t name_len; /* Length of name */
size_t name_size; /* Size of encoded name length */
size_t ret_value = 0; /* Return value */
- FUNC_ENTER_NOAPI_NOINIT_NOERR
+ FUNC_ENTER_STATIC_NOERR
/* Sanity check */
HDcompile_assert(sizeof(uint64_t) >= sizeof(size_t));
@@ -537,7 +533,7 @@ H5O_link_size(const H5F_t *f, hbool_t H5_ATTR_UNUSED disable_shared, const void
} /* end switch */
FUNC_LEAVE_NOAPI(ret_value)
-} /* end H5O_link_size() */
+} /* end H5O__link_size() */
/*-------------------------------------------------------------------------
* Function: H5O__link_reset
@@ -668,7 +664,7 @@ done:
} /* end H5O_link_delete() */
/*-------------------------------------------------------------------------
- * Function: H5O_link_pre_copy_file
+ * Function: H5O__link_pre_copy_file
*
* Purpose: Perform any necessary actions before copying message between
* files for link messages.
@@ -683,10 +679,10 @@ done:
*-------------------------------------------------------------------------
*/
static herr_t
-H5O_link_pre_copy_file(H5F_t H5_ATTR_UNUSED *file_src, const void H5_ATTR_UNUSED *native_src,
- hbool_t *deleted, const H5O_copy_t *cpy_info, void H5_ATTR_UNUSED *udata)
+H5O__link_pre_copy_file(H5F_t H5_ATTR_UNUSED *file_src, const void H5_ATTR_UNUSED *native_src,
+ hbool_t *deleted, const H5O_copy_t *cpy_info, void H5_ATTR_UNUSED *udata)
{
- FUNC_ENTER_NOAPI_NOINIT_NOERR
+ FUNC_ENTER_STATIC_NOERR
/* check args */
HDassert(deleted);
@@ -701,7 +697,7 @@ H5O_link_pre_copy_file(H5F_t H5_ATTR_UNUSED *file_src, const void H5_ATTR_UNUSED
*deleted = TRUE;
FUNC_LEAVE_NOAPI(SUCCEED)
-} /* end H5O_link_pre_copy_file() */
+} /* end H5O__link_pre_copy_file() */
/*-------------------------------------------------------------------------
* Function: H5O__link_copy_file
@@ -792,7 +788,6 @@ done:
* Return: Non-negative on success/Negative on failure
*
* Programmer: Quincey Koziol
- * koziol@ncsa.uiuc.edu
* Aug 29 2005
*
*-------------------------------------------------------------------------
@@ -803,7 +798,7 @@ H5O__link_debug(H5F_t H5_ATTR_UNUSED *f, const void *_mesg, FILE *stream, int in
const H5O_link_t *lnk = (const H5O_link_t *)_mesg;
herr_t ret_value = SUCCEED; /* Return value */
- FUNC_ENTER_NOAPI_NOINIT
+ FUNC_ENTER_STATIC
/* check args */
HDassert(f);
@@ -822,7 +817,7 @@ H5O__link_debug(H5F_t H5_ATTR_UNUSED *f, const void *_mesg, FILE *stream, int in
: (lnk->type >= H5L_TYPE_UD_MIN ? "User-defined" : "Unknown")))));
if (lnk->corder_valid)
- HDfprintf(stream, "%*s%-*s %a\n", indent, "", fwidth, "Creation Order:", lnk->corder);
+ HDfprintf(stream, "%*s%-*s %" PRId64 "\n", indent, "", fwidth, "Creation Order:", lnk->corder);
HDfprintf(stream, "%*s%-*s %s\n", indent, "", fwidth, "Link Name Character Set:",
(lnk->cset == H5T_CSET_ASCII ? "ASCII" : (lnk->cset == H5T_CSET_UTF8 ? "UTF-8" : "Unknown")));
@@ -831,7 +826,8 @@ H5O__link_debug(H5F_t H5_ATTR_UNUSED *f, const void *_mesg, FILE *stream, int in
/* Display link-specific information */
switch (lnk->type) {
case H5L_TYPE_HARD:
- HDfprintf(stream, "%*s%-*s %a\n", indent, "", fwidth, "Object address:", lnk->u.hard.addr);
+ HDfprintf(stream, "%*s%-*s %" PRIuHADDR "\n", indent, "", fwidth,
+ "Object address:", lnk->u.hard.addr);
break;
case H5L_TYPE_SOFT:
@@ -848,11 +844,11 @@ H5O__link_debug(H5F_t H5_ATTR_UNUSED *f, const void *_mesg, FILE *stream, int in
(const char *)lnk->u.ud.udata + (HDstrlen((const char *)lnk->u.ud.udata) + 1);
HDfprintf(stream, "%*s%-*s %s\n", indent, "", fwidth,
- "External File Name:", lnk->u.ud.udata);
+ "External File Name:", (const char *)lnk->u.ud.udata);
HDfprintf(stream, "%*s%-*s %s\n", indent, "", fwidth, "External Object Name:", objname);
} /* end if */
else {
- HDfprintf(stream, "%*s%-*s %Zu\n", indent, "", fwidth,
+ HDfprintf(stream, "%*s%-*s %zu\n", indent, "", fwidth,
"User-Defined Link Size:", lnk->u.ud.size);
} /* end else */
} /* end if */
diff --git a/src/H5Omessage.c b/src/H5Omessage.c
index dd26d21..15edf1e 100644
--- a/src/H5Omessage.c
+++ b/src/H5Omessage.c
@@ -15,7 +15,7 @@
*
* Created: H5Omessage.c
* Dec 3 2006
- * Quincey Koziol <koziol@hdfgroup.org>
+ * Quincey Koziol
*
* Purpose: Object header message routines.
*
@@ -94,7 +94,6 @@ static herr_t H5O__copy_mesg(H5F_t *f, H5O_t *oh, size_t idx, const H5O_msg_clas
* Failure: Negative
*
* Programmer: Quincey Koziol
- * koziol@hdfgroup.org
* Dec 1 2006
*
*-------------------------------------------------------------------------
@@ -140,7 +139,6 @@ done:
* Failure: Negative
*
* Programmer: Quincey Koziol
- * koziol@ncsa.uiuc.edu
* Dec 31 2002
*
*-------------------------------------------------------------------------
@@ -182,7 +180,6 @@ done:
* Failure: Negative
*
* Programmer: Quincey Koziol
- * koziol@hdfgroup.org
* Dec 8 2006
*
*-------------------------------------------------------------------------
@@ -233,7 +230,6 @@ done:
* Failure: Negative
*
* Programmer: Robb Matzke
- * matzke@llnl.gov
* Aug 6 1997
*
*-------------------------------------------------------------------------
@@ -287,7 +283,6 @@ done:
* Failure: Negative
*
* Programmer: Quincey Koziol
- * koziol@hdfgroup.org
* Dec 6 2007
*
*-------------------------------------------------------------------------
@@ -334,7 +329,6 @@ done:
* Failure: Negative
*
* Programmer: Robb Matzke
- * matzke@llnl.gov
* Aug 6 1997
*
*-------------------------------------------------------------------------
@@ -435,7 +429,6 @@ done:
* Failure: NULL
*
* Programmer: Robb Matzke
- * matzke@llnl.gov
* Aug 6 1997
*
*-------------------------------------------------------------------------
@@ -487,7 +480,6 @@ done:
* Failure: NULL
*
* Programmer: Robb Matzke
- * matzke@llnl.gov
* Aug 6 1997
*
*-------------------------------------------------------------------------
@@ -543,7 +535,6 @@ done:
* Return: Non-negative on success/Negative on failure
*
* Programmer: Robb Matzke
- * matzke@llnl.gov
* Aug 12 1997
*
*-------------------------------------------------------------------------
@@ -579,7 +570,6 @@ done:
* Return: Non-negative on success/Negative on failure
*
* Programmer: Robb Matzke
- * matzke@llnl.gov
* Aug 12 1997
*
*-------------------------------------------------------------------------
@@ -921,7 +911,6 @@ done:
* Return: Non-negative on success/Negative on failure
*
* Programmer: Robb Matzke
- * matzke@llnl.gov
* Aug 28 1997
*
*-------------------------------------------------------------------------
@@ -971,7 +960,6 @@ done:
* Return: Non-negative on success/Negative on failure
*
* Programmer: Quincey Koziol
- * koziol@ncsa.uiuc.edu
* Sep 6 2005
*
*-------------------------------------------------------------------------
@@ -1020,7 +1008,6 @@ done:
* Return: Non-negative on success/Negative on failure
*
* Programmer: Quincey Koziol
- * koziol@ncsa.uiuc.edu
* Sep 6 2005
*
*-------------------------------------------------------------------------
@@ -1086,7 +1073,6 @@ done:
* Return: Non-negative on success/Negative on failure
*
* Programmer: Robb Matzke
- * matzke@llnl.gov
* Aug 28 1997
*
*-------------------------------------------------------------------------
@@ -1142,7 +1128,6 @@ done:
* object headers were processed.
*
* Programmer: Quincey Koziol
- * koziol@ncsa.uiuc.edu
* Nov 19 2004
*
* Description:
@@ -1206,7 +1191,6 @@ done:
* object headers were processed.
*
* Programmer: Quincey Koziol
- * koziol@ncsa.uiuc.edu
* Sep 6 2005
*
* Description:
@@ -1304,7 +1288,6 @@ done:
* Return: Size of message on success, 0 on failure
*
* Programmer: Quincey Koziol
- * koziol@ncsa.uiuc.edu
* Feb 13 2003
*
*-------------------------------------------------------------------------
@@ -1345,7 +1328,6 @@ done:
* Return: Size of message on success, 0 on failure
*
* Programmer: Quincey Koziol
- * koziol@ncsa.uiuc.edu
* Sep 6 2005
*
*-------------------------------------------------------------------------
@@ -1406,7 +1388,6 @@ done:
* Return: Size of message on success, 0 on failure
*
* Programmer: Quincey Koziol
- * koziol@hdfgroup.org
* Mar 7 2007
*
*-------------------------------------------------------------------------
@@ -1539,7 +1520,6 @@ H5O_msg_can_share_in_ohdr(unsigned type_id)
* Object is not shared: FALSE
*
* Programmer: James Laird
- * jlaird@ncsa.uiuc.edu
* April 5 2006
*
*-------------------------------------------------------------------------
@@ -1583,7 +1563,6 @@ H5O_msg_is_shared(unsigned type_id, const void *mesg)
* Failure: Negative
*
* Programmer: James Laird
- * jlaird@hdfgroup.org
* November 1 2006
*
*-------------------------------------------------------------------------
@@ -1633,7 +1612,6 @@ done:
* Failure: Negative
*
* Programmer: James Laird
- * jlaird@hdfgroup.org
* Oct 17 2006
*
*-------------------------------------------------------------------------
@@ -1707,7 +1685,6 @@ done:
* Failure: Negative
*
* Programmer: Raymond Lu
- * slu@ncsa.uiuc.edu
* July 13, 2004
*
*-------------------------------------------------------------------------
@@ -1745,14 +1722,8 @@ done:
* Failure: NULL
*
* Programmer: Raymond Lu
- * slu@ncsa.uiuc.edu
* July 14, 2004
*
- * Modifications: Neil Fortner
- * Feb 4 2009
- * Added open_oh parameter. This parameter is optional and
- * contains this message's protected object header
- *
*-------------------------------------------------------------------------
*/
void *
@@ -2010,7 +1981,6 @@ done:
* Return: Non-negative on success/Negative on failure
*
* Programmer: Quincey Koziol
- * koziol@ncsa.uiuc.edu
* September 26 2003
*
*-------------------------------------------------------------------------
@@ -2050,7 +2020,6 @@ done:
* Return: Non-negative on success/Negative on failure
*
* Programmer: Quincey Koziol
- * koziol@hdfgroup.org
* May 14 2007
*
*-------------------------------------------------------------------------
@@ -2150,7 +2119,6 @@ done:
* Return: Non-negative on success/Negative on failure
*
* Programmer: Quincey Koziol
- * koziol@ncsa.uiuc.edu
* Nov 21 2005
*
*-------------------------------------------------------------------------
diff --git a/src/H5Omtime.c b/src/H5Omtime.c
index 39bde5a..163ea32 100644
--- a/src/H5Omtime.c
+++ b/src/H5Omtime.c
@@ -11,10 +11,10 @@
* help@hdfgroup.org. *
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
-/* Programmer: Robb Matzke <matzke@llnl.gov>
- * Friday, July 24, 1998
+/* Programmer: Robb Matzke
+ * Friday, July 24, 1998
*
- * Purpose: The object modification time message.
+ * Purpose: The object modification time message.
*/
#include "H5Omodule.h" /* This source code file is part of the H5O module */
@@ -27,14 +27,14 @@
static void * H5O__mtime_new_decode(H5F_t *f, H5O_t *open_oh, unsigned mesg_flags, unsigned *ioflags,
size_t p_size, const uint8_t *p);
-static herr_t H5O_mtime_new_encode(H5F_t *f, hbool_t disable_shared, uint8_t *p, const void *_mesg);
-static size_t H5O_mtime_new_size(const H5F_t *f, hbool_t disable_shared, const void *_mesg);
+static herr_t H5O__mtime_new_encode(H5F_t *f, hbool_t disable_shared, uint8_t *p, const void *_mesg);
+static size_t H5O__mtime_new_size(const H5F_t *f, hbool_t disable_shared, const void *_mesg);
static void * H5O__mtime_decode(H5F_t *f, H5O_t *open_oh, unsigned mesg_flags, unsigned *ioflags,
size_t p_size, const uint8_t *p);
-static herr_t H5O_mtime_encode(H5F_t *f, hbool_t disable_shared, uint8_t *p, const void *_mesg);
-static void * H5O_mtime_copy(const void *_mesg, void *_dest);
-static size_t H5O_mtime_size(const H5F_t *f, hbool_t disable_shared, const void *_mesg);
+static herr_t H5O__mtime_encode(H5F_t *f, hbool_t disable_shared, uint8_t *p, const void *_mesg);
+static void * H5O__mtime_copy(const void *_mesg, void *_dest);
+static size_t H5O__mtime_size(const H5F_t *f, hbool_t disable_shared, const void *_mesg);
static herr_t H5O__mtime_free(void *_mesg);
static herr_t H5O__mtime_debug(H5F_t *f, const void *_mesg, FILE *stream, int indent, int fwidth);
@@ -45,9 +45,9 @@ const H5O_msg_class_t H5O_MSG_MTIME[1] = {{
sizeof(time_t), /*native message size */
0, /* messages are sharable? */
H5O__mtime_decode, /*decode message */
- H5O_mtime_encode, /*encode message */
- H5O_mtime_copy, /*copy the native value */
- H5O_mtime_size, /*raw message size */
+ H5O__mtime_encode, /*encode message */
+ H5O__mtime_copy, /*copy the native value */
+ H5O__mtime_size, /*raw message size */
NULL, /* reset method */
H5O__mtime_free, /* free method */
NULL, /* file delete method */
@@ -70,9 +70,9 @@ const H5O_msg_class_t H5O_MSG_MTIME_NEW[1] = {{
sizeof(time_t), /*native message size */
0, /* messages are sharable? */
H5O__mtime_new_decode, /*decode message */
- H5O_mtime_new_encode, /*encode message */
- H5O_mtime_copy, /*copy the native value */
- H5O_mtime_new_size, /*raw message size */
+ H5O__mtime_new_encode, /*encode message */
+ H5O__mtime_copy, /*copy the native value */
+ H5O__mtime_new_size, /*raw message size */
NULL, /* reset method */
H5O__mtime_free, /* free method */
NULL, /* file delete method */
@@ -107,7 +107,6 @@ H5FL_DEFINE(time_t);
* Failure: NULL
*
* Programmer: Quincey Koziol
- * koziol@ncsa.uiuc.edu
* Jan 3 2002
*
*-------------------------------------------------------------------------
@@ -163,7 +162,6 @@ done:
* Failure: NULL
*
* Programmer: Robb Matzke
- * matzke@llnl.gov
* Jul 24 1998
*
*-------------------------------------------------------------------------
@@ -213,25 +211,24 @@ done:
} /* end H5O__mtime_decode() */
/*-------------------------------------------------------------------------
- * Function: H5O_mtime_new_encode
+ * Function: H5O__mtime_new_encode
*
* Purpose: Encodes a new modification time message.
*
* Return: Non-negative on success/Negative on failure
*
* Programmer: Quincey Koziol
- * koziol@ncsa.uiuc.edu
* Jan 3 2002
*
*-------------------------------------------------------------------------
*/
static herr_t
-H5O_mtime_new_encode(H5F_t H5_ATTR_UNUSED *f, hbool_t H5_ATTR_UNUSED disable_shared, uint8_t *p,
- const void *_mesg)
+H5O__mtime_new_encode(H5F_t H5_ATTR_UNUSED *f, hbool_t H5_ATTR_UNUSED disable_shared, uint8_t *p,
+ const void *_mesg)
{
const time_t *mesg = (const time_t *)_mesg;
- FUNC_ENTER_NOAPI_NOINIT_NOERR
+ FUNC_ENTER_STATIC_NOERR
/* check args */
HDassert(f);
@@ -250,31 +247,28 @@ H5O_mtime_new_encode(H5F_t H5_ATTR_UNUSED *f, hbool_t H5_ATTR_UNUSED disable_sha
UINT32ENCODE(p, *mesg);
FUNC_LEAVE_NOAPI(SUCCEED)
-} /* end H5O_mtime_new_encode() */
+} /* end H5O__mtime_new_encode() */
/*-------------------------------------------------------------------------
- * Function: H5O_mtime_encode
+ * Function: H5O__mtime_encode
*
* Purpose: Encodes a modification time message.
*
* Return: Non-negative on success/Negative on failure
*
* Programmer: Robb Matzke
- * matzke@llnl.gov
* Jul 24 1998
*
- * Modifications:
- *
*-------------------------------------------------------------------------
*/
static herr_t
-H5O_mtime_encode(H5F_t H5_ATTR_UNUSED *f, hbool_t H5_ATTR_UNUSED disable_shared, uint8_t *p,
- const void *_mesg)
+H5O__mtime_encode(H5F_t H5_ATTR_UNUSED *f, hbool_t H5_ATTR_UNUSED disable_shared, uint8_t *p,
+ const void *_mesg)
{
const time_t *mesg = (const time_t *)_mesg;
struct tm * tm;
- FUNC_ENTER_NOAPI_NOINIT_NOERR
+ FUNC_ENTER_STATIC_NOERR
/* check args */
HDassert(f);
@@ -287,10 +281,10 @@ H5O_mtime_encode(H5F_t H5_ATTR_UNUSED *f, hbool_t H5_ATTR_UNUSED disable_shared,
tm->tm_hour, tm->tm_min, tm->tm_sec);
FUNC_LEAVE_NOAPI(SUCCEED)
-}
+} /* end H5O__mtime_encode() */
/*-------------------------------------------------------------------------
- * Function: H5O_mtime_copy
+ * Function: H5O__mtime_copy
*
* Purpose: Copies a message from _MESG to _DEST, allocating _DEST if
* necessary.
@@ -300,21 +294,18 @@ H5O_mtime_encode(H5F_t H5_ATTR_UNUSED *f, hbool_t H5_ATTR_UNUSED disable_shared,
* Failure: NULL
*
* Programmer: Robb Matzke
- * matzke@llnl.gov
* Jul 24 1998
*
- * Modifications:
- *
*-------------------------------------------------------------------------
*/
static void *
-H5O_mtime_copy(const void *_mesg, void *_dest)
+H5O__mtime_copy(const void *_mesg, void *_dest)
{
const time_t *mesg = (const time_t *)_mesg;
time_t * dest = (time_t *)_dest;
void * ret_value = NULL; /* Return value */
- FUNC_ENTER_NOAPI_NOINIT
+ FUNC_ENTER_STATIC
/* check args */
HDassert(mesg);
@@ -329,10 +320,10 @@ H5O_mtime_copy(const void *_mesg, void *_dest)
done:
FUNC_LEAVE_NOAPI(ret_value)
-}
+} /* end H5O__mtime_copy() */
/*-------------------------------------------------------------------------
- * Function: H5O_mtime_new_size
+ * Function: H5O__mtime_new_size
*
* Purpose: Returns the size of the raw message in bytes not
* counting the message type or size fields, but only the data
@@ -344,28 +335,25 @@ done:
* Failure: 0
*
* Programmer: Quincey Koziol
- * koziol@ncsa.uiuc.edu
* Jan 3 2002
*
- * Modifications:
- *
*-------------------------------------------------------------------------
*/
static size_t
-H5O_mtime_new_size(const H5F_t H5_ATTR_UNUSED *f, hbool_t H5_ATTR_UNUSED disable_shared,
- const void H5_ATTR_UNUSED *mesg)
+H5O__mtime_new_size(const H5F_t H5_ATTR_UNUSED *f, hbool_t H5_ATTR_UNUSED disable_shared,
+ const void H5_ATTR_UNUSED *mesg)
{
- FUNC_ENTER_NOAPI_NOINIT_NOERR
+ FUNC_ENTER_STATIC_NOERR
/* check args */
HDassert(f);
HDassert(mesg);
FUNC_LEAVE_NOAPI(8)
-} /* end H5O_mtime_new_size() */
+} /* end H5O__mtime_new_size() */
/*-------------------------------------------------------------------------
- * Function: H5O_mtime_size
+ * Function: H5O__mtime_size
*
* Purpose: Returns the size of the raw message in bytes not
* counting the message type or size fields, but only the data
@@ -377,25 +365,22 @@ H5O_mtime_new_size(const H5F_t H5_ATTR_UNUSED *f, hbool_t H5_ATTR_UNUSED disable
* Failure: 0
*
* Programmer: Robb Matzke
- * matzke@llnl.gov
* Jul 14 1998
*
- * Modifications:
- *
*-------------------------------------------------------------------------
*/
static size_t
-H5O_mtime_size(const H5F_t H5_ATTR_UNUSED *f, hbool_t H5_ATTR_UNUSED disable_shared,
- const void H5_ATTR_UNUSED *mesg)
+H5O__mtime_size(const H5F_t H5_ATTR_UNUSED *f, hbool_t H5_ATTR_UNUSED disable_shared,
+ const void H5_ATTR_UNUSED *mesg)
{
- FUNC_ENTER_NOAPI_NOINIT_NOERR
+ FUNC_ENTER_STATIC_NOERR
/* check args */
HDassert(f);
HDassert(mesg);
FUNC_LEAVE_NOAPI(16)
-}
+} /* end H5O__mtime_size() */
/*-------------------------------------------------------------------------
* Function: H5O__mtime_free
@@ -429,7 +414,6 @@ H5O__mtime_free(void *mesg)
* Return: Non-negative on success/Negative on failure
*
* Programmer: Robb Matzke
- * matzke@llnl.gov
* Jul 24 1998
*
*-------------------------------------------------------------------------
diff --git a/src/H5Oname.c b/src/H5Oname.c
index 12192fa..1636a0e 100644
--- a/src/H5Oname.c
+++ b/src/H5Oname.c
@@ -15,7 +15,7 @@
*
* Created: H5Oname.c
* Aug 12 1997
- * Robb Matzke <matzke@llnl.gov>
+ * Robb Matzke
*
* Purpose: Object name message.
*
@@ -32,9 +32,9 @@
/* PRIVATE PROTOTYPES */
static void *H5O__name_decode(H5F_t *f, H5O_t *open_oh, unsigned mesg_flags, unsigned *ioflags, size_t p_size,
const uint8_t *p);
-static herr_t H5O_name_encode(H5F_t *f, hbool_t disable_shared, uint8_t *p, const void *_mesg);
-static void * H5O_name_copy(const void *_mesg, void *_dest);
-static size_t H5O_name_size(const H5F_t *f, hbool_t disable_shared, const void *_mesg);
+static herr_t H5O__name_encode(H5F_t *f, hbool_t disable_shared, uint8_t *p, const void *_mesg);
+static void * H5O__name_copy(const void *_mesg, void *_dest);
+static size_t H5O__name_size(const H5F_t *f, hbool_t disable_shared, const void *_mesg);
static herr_t H5O__name_reset(void *_mesg);
static herr_t H5O__name_debug(H5F_t *f, const void *_mesg, FILE *stream, int indent, int fwidth);
@@ -45,9 +45,9 @@ const H5O_msg_class_t H5O_MSG_NAME[1] = {{
sizeof(H5O_name_t), /*native message size */
0, /* messages are sharable? */
H5O__name_decode, /*decode message */
- H5O_name_encode, /*encode message */
- H5O_name_copy, /*copy the native value */
- H5O_name_size, /*raw message size */
+ H5O__name_encode, /*encode message */
+ H5O__name_copy, /*copy the native value */
+ H5O__name_size, /*raw message size */
H5O__name_reset, /*free internal memory */
NULL, /* free method */
NULL, /* file delete method */
@@ -73,7 +73,6 @@ const H5O_msg_class_t H5O_MSG_NAME[1] = {{
* Failure: NULL
*
* Programmer: Robb Matzke
- * matzke@llnl.gov
* Aug 12 1997
*
*-------------------------------------------------------------------------
@@ -109,26 +108,24 @@ done:
} /* end H5O__name_decode() */
/*-------------------------------------------------------------------------
- * Function: H5O_name_encode
+ * Function: H5O__name_encode
*
* Purpose: Encodes a name message.
*
* Return: Non-negative on success/Negative on failure
*
* Programmer: Robb Matzke
- * matzke@llnl.gov
* Aug 12 1997
*
- * Modifications:
- *
*-------------------------------------------------------------------------
*/
static herr_t
-H5O_name_encode(H5F_t H5_ATTR_UNUSED *f, hbool_t H5_ATTR_UNUSED disable_shared, uint8_t *p, const void *_mesg)
+H5O__name_encode(H5F_t H5_ATTR_UNUSED *f, hbool_t H5_ATTR_UNUSED disable_shared, uint8_t *p,
+ const void *_mesg)
{
const H5O_name_t *mesg = (const H5O_name_t *)_mesg;
- FUNC_ENTER_NOAPI_NOINIT_NOERR
+ FUNC_ENTER_STATIC_NOERR
/* check args */
HDassert(f);
@@ -139,10 +136,10 @@ H5O_name_encode(H5F_t H5_ATTR_UNUSED *f, hbool_t H5_ATTR_UNUSED disable_shared,
HDstrcpy((char *)p, mesg->s);
FUNC_LEAVE_NOAPI(SUCCEED)
-}
+} /* end H5O__name_encode() */
/*-------------------------------------------------------------------------
- * Function: H5O_name_copy
+ * Function: H5O__name_copy
*
* Purpose: Copies a message from _MESG to _DEST, allocating _DEST if
* necessary.
@@ -152,21 +149,18 @@ H5O_name_encode(H5F_t H5_ATTR_UNUSED *f, hbool_t H5_ATTR_UNUSED disable_shared,
* Failure: NULL
*
* Programmer: Robb Matzke
- * matzke@llnl.gov
* Aug 12 1997
*
- * Modifications:
- *
*-------------------------------------------------------------------------
*/
static void *
-H5O_name_copy(const void *_mesg, void *_dest)
+H5O__name_copy(const void *_mesg, void *_dest)
{
const H5O_name_t *mesg = (const H5O_name_t *)_mesg;
H5O_name_t * dest = (H5O_name_t *)_dest;
void * ret_value = NULL; /* Return value */
- FUNC_ENTER_NOAPI_NOINIT
+ FUNC_ENTER_STATIC
/* check args */
HDassert(mesg);
@@ -188,10 +182,10 @@ done:
dest = (H5O_name_t *)H5MM_xfree(dest);
FUNC_LEAVE_NOAPI(ret_value)
-} /* end H5O_name_copy() */
+} /* end H5O__name_copy() */
/*-------------------------------------------------------------------------
- * Function: H5O_name_size
+ * Function: H5O__name_size
*
* Purpose: Returns the size of the raw message in bytes not
* counting the message typ or size fields, but only the data
@@ -203,20 +197,17 @@ done:
* Failure: Negative
*
* Programmer: Robb Matzke
- * matzke@llnl.gov
* Aug 12 1997
*
- * Modifications:
- *
*-------------------------------------------------------------------------
*/
static size_t
-H5O_name_size(const H5F_t H5_ATTR_UNUSED *f, hbool_t H5_ATTR_UNUSED disable_shared, const void *_mesg)
+H5O__name_size(const H5F_t H5_ATTR_UNUSED *f, hbool_t H5_ATTR_UNUSED disable_shared, const void *_mesg)
{
const H5O_name_t *mesg = (const H5O_name_t *)_mesg;
size_t ret_value = 0; /* Return value */
- FUNC_ENTER_NOAPI_NOINIT_NOERR
+ FUNC_ENTER_STATIC_NOERR
/* check args */
HDassert(f);
@@ -225,7 +216,7 @@ H5O_name_size(const H5F_t H5_ATTR_UNUSED *f, hbool_t H5_ATTR_UNUSED disable_shar
ret_value = mesg->s ? HDstrlen(mesg->s) + 1 : 0;
FUNC_LEAVE_NOAPI(ret_value)
-}
+} /* end H5O__name_size() */
/*-------------------------------------------------------------------------
* Function: H5O__name_reset
@@ -236,7 +227,6 @@ H5O_name_size(const H5F_t H5_ATTR_UNUSED *f, hbool_t H5_ATTR_UNUSED disable_shar
* Return: Non-negative on success/Negative on failure
*
* Programmer: Robb Matzke
- * matzke@llnl.gov
* Aug 12 1997
*
*-------------------------------------------------------------------------
@@ -265,11 +255,8 @@ H5O__name_reset(void *_mesg)
* Return: Non-negative on success/Negative on failure
*
* Programmer: Robb Matzke
- * matzke@llnl.gov
* Aug 12 1997
*
- * Modifications:
- *
*-------------------------------------------------------------------------
*/
static herr_t
@@ -277,7 +264,7 @@ H5O__name_debug(H5F_t H5_ATTR_UNUSED *f, const void *_mesg, FILE *stream, int in
{
const H5O_name_t *mesg = (const H5O_name_t *)_mesg;
- FUNC_ENTER_NOAPI_NOINIT_NOERR
+ FUNC_ENTER_STATIC_NOERR
/* check args */
HDassert(f);
diff --git a/src/H5Onull.c b/src/H5Onull.c
index cc8fa08..9b377fb 100644
--- a/src/H5Onull.c
+++ b/src/H5Onull.c
@@ -15,7 +15,6 @@
*
* Created: H5Onull.c
* Aug 6 1997
- * Robb Matzke <matzke@llnl.gov>
*
* Purpose: The null message.
*
diff --git a/src/H5Opline.c b/src/H5Opline.c
index 89183f3..221e323 100644
--- a/src/H5Opline.c
+++ b/src/H5Opline.c
@@ -12,78 +12,78 @@
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
/*
- * Programmer: Robb Matzke <matzke@llnl.gov>
- * Wednesday, April 15, 1998
+ * Programmer: Robb Matzke
+ * Wednesday, April 15, 1998
*
- * Purpose: Data filter pipeline message.
+ * Purpose: Data filter pipeline message.
*/
#include "H5Omodule.h" /* This source code file is part of the H5O module */
#define H5Z_FRIEND /*suppress error about including H5Zpkg */
#include "H5private.h" /* Generic Functions */
-#include "H5Dprivate.h" /* Datasets */
-#include "H5Eprivate.h" /* Error handling */
-#include "H5FLprivate.h" /* Free Lists */
+#include "H5Dprivate.h" /* Datasets */
+#include "H5Eprivate.h" /* Error handling */
+#include "H5FLprivate.h" /* Free Lists */
#include "H5MMprivate.h" /* Memory management */
-#include "H5Opkg.h" /* Object headers */
-#include "H5Zpkg.h" /* Data filters */
+#include "H5Opkg.h" /* Object headers */
+#include "H5Zpkg.h" /* Data filters */
/* PRIVATE PROTOTYPES */
-static herr_t H5O_pline_encode(H5F_t *f, uint8_t *p, const void *mesg);
+static herr_t H5O__pline_encode(H5F_t *f, uint8_t *p, const void *mesg);
static void * H5O__pline_decode(H5F_t *f, H5O_t *open_oh, unsigned mesg_flags, unsigned *ioflags,
size_t p_size, const uint8_t *p);
-static void * H5O_pline_copy(const void *_mesg, void *_dest);
-static size_t H5O_pline_size(const H5F_t *f, const void *_mesg);
+static void * H5O__pline_copy(const void *_mesg, void *_dest);
+static size_t H5O__pline_size(const H5F_t *f, const void *_mesg);
static herr_t H5O__pline_reset(void *_mesg);
static herr_t H5O__pline_free(void *_mesg);
-static herr_t H5O_pline_pre_copy_file(H5F_t *file_src, const void *mesg_src, hbool_t *deleted,
- const H5O_copy_t *cpy_info, void *_udata);
+static herr_t H5O__pline_pre_copy_file(H5F_t *file_src, const void *mesg_src, hbool_t *deleted,
+ const H5O_copy_t *cpy_info, void *_udata);
static herr_t H5O__pline_debug(H5F_t *f, const void *_mesg, FILE *stream, int indent, int fwidth);
/* Set up & include shared message "interface" info */
#define H5O_SHARED_TYPE H5O_MSG_PLINE
-#define H5O_SHARED_DECODE H5O_pline_shared_decode
+#define H5O_SHARED_DECODE H5O__pline_shared_decode
#define H5O_SHARED_DECODE_REAL H5O__pline_decode
-#define H5O_SHARED_ENCODE H5O_pline_shared_encode
-#define H5O_SHARED_ENCODE_REAL H5O_pline_encode
-#define H5O_SHARED_SIZE H5O_pline_shared_size
-#define H5O_SHARED_SIZE_REAL H5O_pline_size
+#define H5O_SHARED_ENCODE H5O__pline_shared_encode
+#define H5O_SHARED_ENCODE_REAL H5O__pline_encode
+#define H5O_SHARED_SIZE H5O__pline_shared_size
+#define H5O_SHARED_SIZE_REAL H5O__pline_size
#define H5O_SHARED_DELETE H5O__pline_shared_delete
#undef H5O_SHARED_DELETE_REAL
#define H5O_SHARED_LINK H5O__pline_shared_link
#undef H5O_SHARED_LINK_REAL
#define H5O_SHARED_COPY_FILE H5O__pline_shared_copy_file
#undef H5O_SHARED_COPY_FILE_REAL
-#define H5O_SHARED_POST_COPY_FILE H5O_pline_shared_post_copy_file
+#define H5O_SHARED_POST_COPY_FILE H5O__pline_shared_post_copy_file
#undef H5O_SHARED_POST_COPY_FILE_REAL
#undef H5O_SHARED_POST_COPY_FILE_UPD
-#define H5O_SHARED_DEBUG H5O_pline_shared_debug
+#define H5O_SHARED_DEBUG H5O__pline_shared_debug
#define H5O_SHARED_DEBUG_REAL H5O__pline_debug
#include "H5Oshared.h" /* Shared Object Header Message Callbacks */
/* This message derives from H5O message class */
const H5O_msg_class_t H5O_MSG_PLINE[1] = {{
- H5O_PLINE_ID, /* message id number */
- "filter pipeline", /* message name for debugging */
- sizeof(H5O_pline_t), /* native message size */
+ H5O_PLINE_ID, /* message id number */
+ "filter pipeline", /* message name for debugging */
+ sizeof(H5O_pline_t), /* native message size */
H5O_SHARE_IS_SHARABLE | H5O_SHARE_IN_OHDR, /* messages are sharable? */
- H5O_pline_shared_decode, /* decode message */
- H5O_pline_shared_encode, /* encode message */
- H5O_pline_copy, /* copy the native value */
- H5O_pline_shared_size, /* size of raw message */
- H5O__pline_reset, /* reset method */
- H5O__pline_free, /* free method */
- H5O__pline_shared_delete, /* file delete method */
- H5O__pline_shared_link, /* link method */
- NULL, /* set share method */
- NULL, /*can share method */
- H5O_pline_pre_copy_file, /* pre copy native value to file */
+ H5O__pline_shared_decode, /* decode message */
+ H5O__pline_shared_encode, /* encode message */
+ H5O__pline_copy, /* copy the native value */
+ H5O__pline_shared_size, /* size of raw message */
+ H5O__pline_reset, /* reset method */
+ H5O__pline_free, /* free method */
+ H5O__pline_shared_delete, /* file delete method */
+ H5O__pline_shared_link, /* link method */
+ NULL, /* set share method */
+ NULL, /*can share method */
+ H5O__pline_pre_copy_file, /* pre copy native value to file */
H5O__pline_shared_copy_file, /* copy native value to file */
- H5O_pline_shared_post_copy_file, /* post copy native value to file */
- NULL, /* get creation index */
- NULL, /* set creation index */
- H5O_pline_shared_debug /* debug the message */
+ H5O__pline_shared_post_copy_file, /* post copy native value to file */
+ NULL, /* get creation index */
+ NULL, /* set creation index */
+ H5O__pline_shared_debug /* debug the message */
}};
/* Format version bounds for filter pipleline */
@@ -101,12 +101,12 @@ H5FL_DEFINE(H5O_pline_t);
/*-------------------------------------------------------------------------
* Function: H5O__pline_decode
*
- * Purpose: Decodes a filter pipeline message.
+ * Purpose: Decodes a filter pipeline message.
*
- * Return: Success: Ptr to the native message.
- * Failure: NULL
+ * Return: Success: Ptr to the native message.
+ * Failure: NULL
*
- * Programmer: Robb Matzke
+ * Programmer: Robb Matzke
* Wednesday, April 15, 1998
*
*-------------------------------------------------------------------------
@@ -219,8 +219,8 @@ H5O__pline_decode(H5F_t H5_ATTR_UNUSED *f, H5O_t H5_ATTR_UNUSED *open_oh, unsign
UINT32DECODE(p, filter->cd_values[j])
else
HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL,
- "ran off the end of the buffer: current p = %p, p_size = %zu, p_end = %p", p,
- p_size, p_end)
+ "ran off the end of the buffer: current p = %p, p_size = %zu, p_end = %p",
+ (const void *)p, p_size, (const void *)p_end)
}
if (pline->version == H5O_PLINE_VERSION_1)
@@ -242,7 +242,7 @@ done:
} /* end H5O__pline_decode() */
/*-------------------------------------------------------------------------
- * Function: H5O_pline_encode
+ * Function: H5O__pline_encode
*
* Purpose: Encodes message MESG into buffer P.
*
@@ -254,13 +254,13 @@ done:
*-------------------------------------------------------------------------
*/
static herr_t
-H5O_pline_encode(H5F_t H5_ATTR_UNUSED *f, uint8_t *p /*out*/, const void *mesg)
+H5O__pline_encode(H5F_t H5_ATTR_UNUSED *f, uint8_t *p /*out*/, const void *mesg)
{
const H5O_pline_t * pline = (const H5O_pline_t *)mesg; /* Pipeline message to encode */
const H5Z_filter_info_t *filter; /* Filter to encode */
size_t i, j; /* Local index variables */
- FUNC_ENTER_NOAPI_NOINIT_NOERR
+ FUNC_ENTER_STATIC_NOERR
/* Check args */
HDassert(p);
@@ -336,10 +336,10 @@ H5O_pline_encode(H5F_t H5_ATTR_UNUSED *f, uint8_t *p /*out*/, const void *mesg)
} /* end for */
FUNC_LEAVE_NOAPI(SUCCEED)
-} /* end H5O_pline_encode() */
+} /* end H5O__pline_encode() */
/*-------------------------------------------------------------------------
- * Function: H5O_pline_copy
+ * Function: H5O__pline_copy
*
* Purpose: Copies a filter pipeline message from SRC to DST allocating
* DST if necessary. If DST is already allocated then we assume
@@ -355,14 +355,14 @@ H5O_pline_encode(H5F_t H5_ATTR_UNUSED *f, uint8_t *p /*out*/, const void *mesg)
*-------------------------------------------------------------------------
*/
static void *
-H5O_pline_copy(const void *_src, void *_dst /*out*/)
+H5O__pline_copy(const void *_src, void *_dst /*out*/)
{
const H5O_pline_t *src = (const H5O_pline_t *)_src; /* Source pipeline message */
H5O_pline_t * dst = (H5O_pline_t *)_dst; /* Destination pipeline message */
size_t i; /* Local index variable */
H5O_pline_t * ret_value = NULL; /* Return value */
- FUNC_ENTER_NOAPI_NOINIT
+ FUNC_ENTER_STATIC
/* Allocate pipeline message, if not provided */
if (!dst && NULL == (dst = H5FL_MALLOC(H5O_pline_t)))
@@ -430,10 +430,10 @@ done:
} /* end if */
FUNC_LEAVE_NOAPI(ret_value)
-} /* end H5O_pline_copy() */
+} /* end H5O__pline_copy() */
/*-------------------------------------------------------------------------
- * Function: H5O_pline_size
+ * Function: H5O__pline_size
*
* Purpose: Determines the size of a raw filter pipeline message.
*
@@ -447,13 +447,13 @@ done:
*-------------------------------------------------------------------------
*/
static size_t
-H5O_pline_size(const H5F_t H5_ATTR_UNUSED *f, const void *mesg)
+H5O__pline_size(const H5F_t H5_ATTR_UNUSED *f, const void *mesg)
{
const H5O_pline_t *pline = (const H5O_pline_t *)mesg; /* Pipeline message */
size_t i; /* Local index variable */
size_t ret_value = 0; /* Return value */
- FUNC_ENTER_NOAPI_NOINIT_NOERR
+ FUNC_ENTER_STATIC_NOERR
/* Message header */
ret_value = (size_t)(1 + /*version */
@@ -471,7 +471,7 @@ H5O_pline_size(const H5F_t H5_ATTR_UNUSED *f, const void *mesg)
else {
H5Z_class2_t *cls; /* Filter class */
- /* Get the name of the filter, same as done with H5O_pline_encode() */
+ /* Get the name of the filter, same as done with H5O__pline_encode() */
if (NULL == (name = pline->filter[i].name) && (cls = H5Z_find(pline->filter[i].id)))
name = cls->name;
name_len = name ? HDstrlen(name) + 1 : 0;
@@ -494,7 +494,7 @@ H5O_pline_size(const H5F_t H5_ATTR_UNUSED *f, const void *mesg)
} /* end for */
FUNC_LEAVE_NOAPI(ret_value)
-} /* end H5O_pline_size() */
+} /* end H5O__pline_size() */
/*-------------------------------------------------------------------------
* Function: H5O__pline_reset
@@ -525,7 +525,6 @@ H5O__pline_reset(void *mesg)
/* Free the filter information and array */
if (pline->filter) {
-
/* Free information for each filter */
for (i = 0; i < pline->nused; i++) {
if (pline->filter[i].name && pline->filter[i].name != pline->filter[i]._name)
@@ -576,7 +575,7 @@ H5O__pline_free(void *mesg)
} /* end H5O__pline_free() */
/*-------------------------------------------------------------------------
- * Function: H5O_pline_pre_copy_file
+ * Function: H5O__pline_pre_copy_file
*
* Purpose: Perform any necessary actions before copying message between
* files
@@ -591,14 +590,14 @@ H5O__pline_free(void *mesg)
*-------------------------------------------------------------------------
*/
static herr_t
-H5O_pline_pre_copy_file(H5F_t H5_ATTR_UNUSED *file_src, const void *mesg_src, hbool_t H5_ATTR_UNUSED *deleted,
- const H5O_copy_t *cpy_info, void *_udata)
+H5O__pline_pre_copy_file(H5F_t H5_ATTR_UNUSED *file_src, const void *mesg_src,
+ hbool_t H5_ATTR_UNUSED *deleted, const H5O_copy_t *cpy_info, void *_udata)
{
const H5O_pline_t * pline_src = (const H5O_pline_t *)mesg_src; /* Source pline */
H5O_copy_file_ud_common_t *udata = (H5O_copy_file_ud_common_t *)_udata; /* Object copying user data */
herr_t ret_value = SUCCEED; /* Return value */
- FUNC_ENTER_NOAPI_NOINIT
+ FUNC_ENTER_STATIC
/* check args */
HDassert(pline_src);
@@ -615,12 +614,12 @@ H5O_pline_pre_copy_file(H5F_t H5_ATTR_UNUSED *file_src, const void *mesg_src, hb
* the object copying process.
*/
if (udata)
- if (NULL == (udata->src_pline = (H5O_pline_t *)H5O_pline_copy(pline_src, NULL)))
+ if (NULL == (udata->src_pline = (H5O_pline_t *)H5O__pline_copy(pline_src, NULL)))
HGOTO_ERROR(H5E_PLINE, H5E_CANTINIT, FAIL, "unable to copy")
done:
FUNC_LEAVE_NOAPI(ret_value)
-} /* end H5O_pline_pre_copy_file() */
+} /* end H5O__pline_pre_copy_file() */
/*-------------------------------------------------------------------------
* Function: H5O__pline_debug
@@ -651,14 +650,14 @@ H5O__pline_debug(H5F_t H5_ATTR_UNUSED *f, const void *mesg, FILE *stream, int in
HDassert(indent >= 0);
HDassert(fwidth >= 0);
- HDfprintf(stream, "%*s%-*s %Zu/%Zu\n", indent, "", fwidth, "Number of filters:", pline->nused,
+ HDfprintf(stream, "%*s%-*s %zu/%zu\n", indent, "", fwidth, "Number of filters:", pline->nused,
pline->nalloc);
/* Loop over all the filters */
for (i = 0; i < pline->nused; i++) {
char name[32];
- HDsnprintf(name, sizeof(name), "Filter at position %u", (unsigned)i);
+ HDsnprintf(name, sizeof(name), "Filter at position %zu", i);
HDfprintf(stream, "%*s%-*s\n", indent, "", fwidth, name);
HDfprintf(stream, "%*s%-*s 0x%04x\n", indent + 3, "", MAX(0, fwidth - 3),
"Filter identification:", (unsigned)(pline->filter[i].id));
@@ -669,7 +668,7 @@ H5O__pline_debug(H5F_t H5_ATTR_UNUSED *f, const void *mesg, FILE *stream, int in
HDfprintf(stream, "%*s%-*s NONE\n", indent + 3, "", MAX(0, fwidth - 3), "Filter name:");
HDfprintf(stream, "%*s%-*s 0x%04x\n", indent + 3, "", MAX(0, fwidth - 3),
"Flags:", pline->filter[i].flags);
- HDfprintf(stream, "%*s%-*s %Zu\n", indent + 3, "", MAX(0, fwidth - 3),
+ HDfprintf(stream, "%*s%-*s %zu\n", indent + 3, "", MAX(0, fwidth - 3),
"Num CD values:", pline->filter[i].cd_nelmts);
/* Filter parameters */
diff --git a/src/H5Orefcount.c b/src/H5Orefcount.c
index 047b410..52eee14 100644
--- a/src/H5Orefcount.c
+++ b/src/H5Orefcount.c
@@ -15,7 +15,7 @@
*
* Created: H5Orefcount.c
* Mar 10 2007
- * Quincey Koziol <koziol@hdfgroup.org>
+ * Quincey Koziol
*
* Purpose: Object ref. count messages.
*
@@ -32,36 +32,36 @@
/* PRIVATE PROTOTYPES */
static void * H5O__refcount_decode(H5F_t *f, H5O_t *open_oh, unsigned mesg_flags, unsigned *ioflags,
size_t p_size, const uint8_t *p);
-static herr_t H5O_refcount_encode(H5F_t *f, hbool_t disable_shared, uint8_t *p, const void *_mesg);
-static void * H5O_refcount_copy(const void *_mesg, void *_dest);
-static size_t H5O_refcount_size(const H5F_t *f, hbool_t disable_shared, const void *_mesg);
+static herr_t H5O__refcount_encode(H5F_t *f, hbool_t disable_shared, uint8_t *p, const void *_mesg);
+static void * H5O__refcount_copy(const void *_mesg, void *_dest);
+static size_t H5O__refcount_size(const H5F_t *f, hbool_t disable_shared, const void *_mesg);
static herr_t H5O__refcount_free(void *_mesg);
-static herr_t H5O_refcount_pre_copy_file(H5F_t *file_src, const void *mesg_src, hbool_t *deleted,
- const H5O_copy_t *cpy_info, void *udata);
+static herr_t H5O__refcount_pre_copy_file(H5F_t *file_src, const void *mesg_src, hbool_t *deleted,
+ const H5O_copy_t *cpy_info, void *udata);
static herr_t H5O__refcount_debug(H5F_t *f, const void *_mesg, FILE *stream, int indent, int fwidth);
/* This message derives from H5O message class */
const H5O_msg_class_t H5O_MSG_REFCOUNT[1] = {{
- H5O_REFCOUNT_ID, /*message id number */
- "refcount", /*message name for debugging */
- sizeof(H5O_refcount_t), /*native message size */
- 0, /* messages are sharable? */
- H5O__refcount_decode, /*decode message */
- H5O_refcount_encode, /*encode message */
- H5O_refcount_copy, /*copy the native value */
- H5O_refcount_size, /*size of symbol table entry */
- NULL, /*default reset method */
- H5O__refcount_free, /* free method */
- NULL, /* file delete method */
- NULL, /* link method */
- NULL, /*set share method */
- NULL, /*can share method */
- H5O_refcount_pre_copy_file, /* pre copy native value to file */
- NULL, /* copy native value to file */
- NULL, /* post copy native value to file */
- NULL, /* get creation index */
- NULL, /* set creation index */
- H5O__refcount_debug /*debug the message */
+ H5O_REFCOUNT_ID, /*message id number */
+ "refcount", /*message name for debugging */
+ sizeof(H5O_refcount_t), /*native message size */
+ 0, /* messages are sharable? */
+ H5O__refcount_decode, /*decode message */
+ H5O__refcount_encode, /*encode message */
+ H5O__refcount_copy, /*copy the native value */
+ H5O__refcount_size, /*size of symbol table entry */
+ NULL, /*default reset method */
+ H5O__refcount_free, /* free method */
+ NULL, /* file delete method */
+ NULL, /* link method */
+ NULL, /*set share method */
+ NULL, /*can share method */
+ H5O__refcount_pre_copy_file, /* pre copy native value to file */
+ NULL, /* copy native value to file */
+ NULL, /* post copy native value to file */
+ NULL, /* get creation index */
+ NULL, /* set creation index */
+ H5O__refcount_debug /*debug the message */
}};
/* Current version of ref. count information */
@@ -79,7 +79,6 @@ H5FL_DEFINE_STATIC(H5O_refcount_t);
* Failure: NULL
*
* Programmer: Quincey Koziol
- * koziol@hdfgroup.org
* Mar 10 2007
*
*-------------------------------------------------------------------------
@@ -120,25 +119,24 @@ done:
} /* end H5O__refcount_decode() */
/*-------------------------------------------------------------------------
- * Function: H5O_refcount_encode
+ * Function: H5O__refcount_encode
*
* Purpose: Encodes a message.
*
* Return: Non-negative on success/Negative on failure
*
* Programmer: Quincey Koziol
- * koziol@hdfgroup.org
* Mar 10 2007
*
*-------------------------------------------------------------------------
*/
static herr_t
-H5O_refcount_encode(H5F_t H5_ATTR_UNUSED *f, hbool_t H5_ATTR_UNUSED disable_shared, uint8_t *p,
- const void *_mesg)
+H5O__refcount_encode(H5F_t H5_ATTR_UNUSED *f, hbool_t H5_ATTR_UNUSED disable_shared, uint8_t *p,
+ const void *_mesg)
{
const H5O_refcount_t *refcount = (const H5O_refcount_t *)_mesg;
- FUNC_ENTER_NOAPI_NOINIT_NOERR
+ FUNC_ENTER_STATIC_NOERR
/* check args */
HDassert(f);
@@ -152,10 +150,10 @@ H5O_refcount_encode(H5F_t H5_ATTR_UNUSED *f, hbool_t H5_ATTR_UNUSED disable_shar
UINT32ENCODE(p, *refcount);
FUNC_LEAVE_NOAPI(SUCCEED)
-} /* end H5O_refcount_encode() */
+} /* end H5O__refcount_encode() */
/*-------------------------------------------------------------------------
- * Function: H5O_refcount_copy
+ * Function: H5O__refcount_copy
*
* Purpose: Copies a message from _MESG to _DEST, allocating _DEST if
* necessary.
@@ -164,19 +162,18 @@ H5O_refcount_encode(H5F_t H5_ATTR_UNUSED *f, hbool_t H5_ATTR_UNUSED disable_shar
* Failure: NULL
*
* Programmer: Quincey Koziol
- * koziol@hdfgroup.org
* Mar 10 2007
*
*-------------------------------------------------------------------------
*/
static void *
-H5O_refcount_copy(const void *_mesg, void *_dest)
+H5O__refcount_copy(const void *_mesg, void *_dest)
{
const H5O_refcount_t *refcount = (const H5O_refcount_t *)_mesg;
H5O_refcount_t * dest = (H5O_refcount_t *)_dest;
void * ret_value = NULL; /* Return value */
- FUNC_ENTER_NOAPI_NOINIT
+ FUNC_ENTER_STATIC
/* check args */
HDassert(refcount);
@@ -191,10 +188,10 @@ H5O_refcount_copy(const void *_mesg, void *_dest)
done:
FUNC_LEAVE_NOAPI(ret_value)
-} /* end H5O_refcount_copy() */
+} /* end H5O__refcount_copy() */
/*-------------------------------------------------------------------------
- * Function: H5O_refcount_size
+ * Function: H5O__refcount_size
*
* Purpose: Returns the size of the raw message in bytes not counting
* the message type or size fields, but only the data fields.
@@ -204,25 +201,24 @@ done:
* Failure: zero
*
* Programmer: Quincey Koziol
- * koziol@hdfgroup.org
* Mar 10 2007
*
*-------------------------------------------------------------------------
*/
static size_t
-H5O_refcount_size(const H5F_t H5_ATTR_UNUSED *f, hbool_t H5_ATTR_UNUSED disable_shared,
- const void H5_ATTR_UNUSED *_mesg)
+H5O__refcount_size(const H5F_t H5_ATTR_UNUSED *f, hbool_t H5_ATTR_UNUSED disable_shared,
+ const void H5_ATTR_UNUSED *_mesg)
{
- size_t ret_value; /* Return value */
+ size_t ret_value = 0; /* Return value */
- FUNC_ENTER_NOAPI_NOINIT_NOERR
+ FUNC_ENTER_STATIC_NOERR
/* Set return value */
ret_value = 1 /* Version */
+ 4; /* Ref. count */
FUNC_LEAVE_NOAPI(ret_value)
-} /* end H5O_refcount_size() */
+} /* end H5O__refcount_size() */
/*-------------------------------------------------------------------------
* Function: H5O__refcount_free
@@ -249,7 +245,7 @@ H5O__refcount_free(void *mesg)
} /* end H5O__refcount_free() */
/*-------------------------------------------------------------------------
- * Function: H5O_refcount_pre_copy_file
+ * Function: H5O__refcount_pre_copy_file
*
* Purpose: Perform any necessary actions before copying message between
* files.
@@ -263,11 +259,11 @@ H5O__refcount_free(void *mesg)
*-------------------------------------------------------------------------
*/
static herr_t
-H5O_refcount_pre_copy_file(H5F_t H5_ATTR_UNUSED *file_src, const void H5_ATTR_UNUSED *native_src,
- hbool_t *deleted, const H5O_copy_t H5_ATTR_UNUSED *cpy_info,
- void H5_ATTR_UNUSED *udata)
+H5O__refcount_pre_copy_file(H5F_t H5_ATTR_UNUSED *file_src, const void H5_ATTR_UNUSED *native_src,
+ hbool_t *deleted, const H5O_copy_t H5_ATTR_UNUSED *cpy_info,
+ void H5_ATTR_UNUSED *udata)
{
- FUNC_ENTER_NOAPI_NOINIT_NOERR
+ FUNC_ENTER_STATIC_NOERR
/* check args */
HDassert(deleted);
@@ -279,7 +275,7 @@ H5O_refcount_pre_copy_file(H5F_t H5_ATTR_UNUSED *file_src, const void H5_ATTR_UN
*deleted = TRUE;
FUNC_LEAVE_NOAPI(SUCCEED)
-} /* end H5O_refcount_pre_copy_file() */
+} /* end H5O__refcount_pre_copy_file() */
/*-------------------------------------------------------------------------
* Function: H5O__refcount_debug
@@ -289,7 +285,6 @@ H5O_refcount_pre_copy_file(H5F_t H5_ATTR_UNUSED *file_src, const void H5_ATTR_UN
* Return: Non-negative on success/Negative on failure
*
* Programmer: Quincey Koziol
- * koziol@hdfgroup.org
* Mar 6 2007
*
*-------------------------------------------------------------------------
diff --git a/src/H5Osdspace.c b/src/H5Osdspace.c
index 37b5068..2cdf6ec 100644
--- a/src/H5Osdspace.c
+++ b/src/H5Osdspace.c
@@ -26,33 +26,33 @@
/* PRIVATE PROTOTYPES */
static void * H5O__sdspace_decode(H5F_t *f, H5O_t *open_oh, unsigned mesg_flags, unsigned *ioflags,
size_t p_size, const uint8_t *p);
-static herr_t H5O_sdspace_encode(H5F_t *f, uint8_t *p, const void *_mesg);
-static void * H5O_sdspace_copy(const void *_mesg, void *_dest);
-static size_t H5O_sdspace_size(const H5F_t *f, const void *_mesg);
+static herr_t H5O__sdspace_encode(H5F_t *f, uint8_t *p, const void *_mesg);
+static void * H5O__sdspace_copy(const void *_mesg, void *_dest);
+static size_t H5O__sdspace_size(const H5F_t *f, const void *_mesg);
static herr_t H5O__sdspace_reset(void *_mesg);
static herr_t H5O__sdspace_free(void *_mesg);
-static herr_t H5O_sdspace_pre_copy_file(H5F_t *file_src, const void *mesg_src, hbool_t *deleted,
- const H5O_copy_t *cpy_info, void *_udata);
+static herr_t H5O__sdspace_pre_copy_file(H5F_t *file_src, const void *mesg_src, hbool_t *deleted,
+ const H5O_copy_t *cpy_info, void *_udata);
static herr_t H5O__sdspace_debug(H5F_t *f, const void *_mesg, FILE *stream, int indent, int fwidth);
/* Set up & include shared message "interface" info */
#define H5O_SHARED_TYPE H5O_MSG_SDSPACE
-#define H5O_SHARED_DECODE H5O_sdspace_shared_decode
+#define H5O_SHARED_DECODE H5O__sdspace_shared_decode
#define H5O_SHARED_DECODE_REAL H5O__sdspace_decode
-#define H5O_SHARED_ENCODE H5O_sdspace_shared_encode
-#define H5O_SHARED_ENCODE_REAL H5O_sdspace_encode
-#define H5O_SHARED_SIZE H5O_sdspace_shared_size
-#define H5O_SHARED_SIZE_REAL H5O_sdspace_size
+#define H5O_SHARED_ENCODE H5O__sdspace_shared_encode
+#define H5O_SHARED_ENCODE_REAL H5O__sdspace_encode
+#define H5O_SHARED_SIZE H5O__sdspace_shared_size
+#define H5O_SHARED_SIZE_REAL H5O__sdspace_size
#define H5O_SHARED_DELETE H5O__sdspace_shared_delete
#undef H5O_SHARED_DELETE_REAL
#define H5O_SHARED_LINK H5O__sdspace_shared_link
#undef H5O_SHARED_LINK_REAL
#define H5O_SHARED_COPY_FILE H5O__sdspace_shared_copy_file
#undef H5O_SHARED_COPY_FILE_REAL
-#define H5O_SHARED_POST_COPY_FILE H5O_sdspace_shared_post_copy_file
+#define H5O_SHARED_POST_COPY_FILE H5O__sdspace_shared_post_copy_file
#undef H5O_SHARED_POST_COPY_FILE_REAL
#undef H5O_SHARED_POST_COPY_FILE_UPD
-#define H5O_SHARED_DEBUG H5O_sdspace_shared_debug
+#define H5O_SHARED_DEBUG H5O__sdspace_shared_debug
#define H5O_SHARED_DEBUG_REAL H5O__sdspace_debug
#include "H5Oshared.h" /* Shared Object Header Message Callbacks */
@@ -61,23 +61,23 @@ const H5O_msg_class_t H5O_MSG_SDSPACE[1] = {{
H5O_SDSPACE_ID, /* message id number */
"dataspace", /* message name for debugging */
sizeof(H5S_extent_t), /* native message size */
- H5O_SHARE_IS_SHARABLE | H5O_SHARE_IN_OHDR, /* messages are sharable? */
- H5O_sdspace_shared_decode, /* decode message */
- H5O_sdspace_shared_encode, /* encode message */
- H5O_sdspace_copy, /* copy the native value */
- H5O_sdspace_shared_size, /* size of symbol table entry */
+ H5O_SHARE_IS_SHARABLE | H5O_SHARE_IN_OHDR, /* messages are sharable? */
+ H5O__sdspace_shared_decode, /* decode message */
+ H5O__sdspace_shared_encode, /* encode message */
+ H5O__sdspace_copy, /* copy the native value */
+ H5O__sdspace_shared_size, /* size of symbol table entry */
H5O__sdspace_reset, /* default reset method */
H5O__sdspace_free, /* free method */
- H5O__sdspace_shared_delete, /* file delete method */
- H5O__sdspace_shared_link, /* link method */
- NULL, /* set share method */
- NULL, /*can share method */
- H5O_sdspace_pre_copy_file, /* pre copy native value to file */
- H5O__sdspace_shared_copy_file, /* copy native value to file */
- H5O_sdspace_shared_post_copy_file, /* post copy native value to file */
- NULL, /* get creation index */
- NULL, /* set creation index */
- H5O_sdspace_shared_debug /* debug the message */
+ H5O__sdspace_shared_delete, /* file delete method */
+ H5O__sdspace_shared_link, /* link method */
+ NULL, /* set share method */
+ NULL, /*can share method */
+ H5O__sdspace_pre_copy_file, /* pre copy native value to file */
+ H5O__sdspace_shared_copy_file, /* copy native value to file */
+ H5O__sdspace_shared_post_copy_file, /* post copy native value to file*/
+ NULL, /* get creation index */
+ NULL, /* set creation index */
+ H5O__sdspace_shared_debug /* debug the message */
}};
/* Declare external the free list for H5S_extent_t's */
@@ -138,8 +138,11 @@ H5O__sdspace_decode(H5F_t *f, H5O_t H5_ATTR_UNUSED *open_oh, unsigned H5_ATTR_UN
flags = *p++;
/* Get or determine the type of the extent */
- if (version >= H5O_SDSPACE_VERSION_2)
+ if (version >= H5O_SDSPACE_VERSION_2) {
sdim->type = (H5S_class_t)*p++;
+ if (sdim->type != H5S_SIMPLE && sdim->rank > 0)
+ HGOTO_ERROR(H5E_OHDR, H5E_BADVALUE, NULL, "invalid rank for scalar or NULL dataspace")
+ } /* end if */
else {
/* Set the dataspace type to be simple or scalar as appropriate */
if (sdim->rank > 0)
@@ -194,11 +197,11 @@ done:
/*--------------------------------------------------------------------------
NAME
- H5O_sdspace_encode
+ H5O__sdspace_encode
PURPOSE
Encode a simple dimensionality message
USAGE
- herr_t H5O_sdspace_encode(f, raw_size, p, mesg)
+ herr_t H5O__sdspace_encode(f, raw_size, p, mesg)
H5F_t *f; IN: pointer to the HDF5 file struct
size_t raw_size; IN: size of the raw information buffer
const uint8 *p; IN: the raw information buffer
@@ -209,28 +212,15 @@ done:
This function encodes the native memory form of the simple
dimensionality message in the "raw" disk form.
- MODIFICATIONS
- Robb Matzke, 1998-04-09
- The current and maximum dimensions are now H5F_SIZEOF_SIZET bytes
- instead of just four bytes.
-
- Robb Matzke, 1998-07-20
- Added a version number and reformatted the message for aligment.
-
- Raymond Lu
- April 8, 2004
- Added the type of dataspace into this header message using a reserved
- byte.
-
--------------------------------------------------------------------------*/
static herr_t
-H5O_sdspace_encode(H5F_t *f, uint8_t *p, const void *_mesg)
+H5O__sdspace_encode(H5F_t *f, uint8_t *p, const void *_mesg)
{
const H5S_extent_t *sdim = (const H5S_extent_t *)_mesg;
unsigned flags = 0;
unsigned u; /* Local counting variable */
- FUNC_ENTER_NOAPI_NOINIT_NOERR
+ FUNC_ENTER_STATIC_NOERR
/* check args */
HDassert(f);
@@ -261,26 +251,28 @@ H5O_sdspace_encode(H5F_t *f, uint8_t *p, const void *_mesg)
*p++ = 0; /*reserved*/
} /* end else */
- /* Current & maximum dimensions */
- if (sdim->rank > 0) {
- for (u = 0; u < sdim->rank; u++)
- H5F_ENCODE_LENGTH(f, p, sdim->size[u]);
- if (flags & H5S_VALID_MAX) {
+ /* Encode dataspace dimensions for simple dataspaces */
+ if (H5S_SIMPLE == sdim->type) {
+ /* Encode current & maximum dimensions */
+ if (sdim->rank > 0) {
for (u = 0; u < sdim->rank; u++)
- H5F_ENCODE_LENGTH(f, p, sdim->max[u]);
+ H5F_ENCODE_LENGTH(f, p, sdim->size[u]);
+ if (flags & H5S_VALID_MAX)
+ for (u = 0; u < sdim->rank; u++)
+ H5F_ENCODE_LENGTH(f, p, sdim->max[u]);
} /* end if */
} /* end if */
FUNC_LEAVE_NOAPI(SUCCEED)
-} /* end H5O_sdspace_encode() */
+} /* end H5O__sdspace_encode() */
/*--------------------------------------------------------------------------
NAME
- H5O_sdspace_copy
+ H5O__sdspace_copy
PURPOSE
Copies a message from MESG to DEST, allocating DEST if necessary.
USAGE
- void *H5O_sdspace_copy(_mesg, _dest)
+ void *H5O__sdspace_copy(_mesg, _dest)
const void *_mesg; IN: Pointer to the source extent dimensionality struct
const void *_dest; IN: Pointer to the destination extent dimensionality struct
RETURNS
@@ -290,13 +282,13 @@ H5O_sdspace_encode(H5F_t *f, uint8_t *p, const void *_mesg)
allocating the destination structure if necessary.
--------------------------------------------------------------------------*/
static void *
-H5O_sdspace_copy(const void *_mesg, void *_dest)
+H5O__sdspace_copy(const void *_mesg, void *_dest)
{
const H5S_extent_t *mesg = (const H5S_extent_t *)_mesg;
H5S_extent_t * dest = (H5S_extent_t *)_dest;
void * ret_value = NULL; /* Return value */
- FUNC_ENTER_NOAPI_NOINIT
+ FUNC_ENTER_STATIC
/* check args */
HDassert(mesg);
@@ -316,15 +308,15 @@ done:
dest = H5FL_FREE(H5S_extent_t, dest);
FUNC_LEAVE_NOAPI(ret_value)
-} /* end H5O_sdspace_copy() */
+} /* end H5O__sdspace_copy() */
/*--------------------------------------------------------------------------
NAME
- H5O_sdspace_size
+ H5O__sdspace_size
PURPOSE
Return the raw message size in bytes
USAGE
- void *H5O_sdspace_size(f, mesg)
+ void *H5O__sdspace_size(f, mesg)
H5F_t *f; IN: pointer to the HDF5 file struct
const void *mesg; IN: Pointer to the source extent dimensionality struct
RETURNS
@@ -334,18 +326,14 @@ done:
success. (Not counting the message type or size fields, only the data
portion of the message). It doesn't take into account alignment.
- MODIFICATIONS
- Robb Matzke, 1998-04-09
- The current and maximum dimensions are now H5F_SIZEOF_SIZET bytes
- instead of just four bytes.
--------------------------------------------------------------------------*/
static size_t
-H5O_sdspace_size(const H5F_t *f, const void *_mesg)
+H5O__sdspace_size(const H5F_t *f, const void *_mesg)
{
const H5S_extent_t *space = (const H5S_extent_t *)_mesg;
size_t ret_value = 0; /* Return value */
- FUNC_ENTER_NOAPI_NOINIT_NOERR
+ FUNC_ENTER_STATIC_NOERR
/* Basic information for all dataspace messages */
ret_value = (size_t)(1 + /* Version */
@@ -361,7 +349,7 @@ H5O_sdspace_size(const H5F_t *f, const void *_mesg)
ret_value += space->max ? (space->rank * H5F_SIZEOF_SIZE(f)) : 0;
FUNC_LEAVE_NOAPI(ret_value)
-} /* end H5O_sdspace_size() */
+} /* end H5O__sdspace_size() */
/*-------------------------------------------------------------------------
* Function: H5O__sdspace_reset
@@ -413,7 +401,7 @@ H5O__sdspace_free(void *mesg)
} /* end H5O__sdspace_free() */
/*-------------------------------------------------------------------------
- * Function: H5O_sdspace_pre_copy_file
+ * Function: H5O__sdspace_pre_copy_file
*
* Purpose: Perform any necessary actions before copying message between
* files
@@ -428,14 +416,14 @@ H5O__sdspace_free(void *mesg)
*-------------------------------------------------------------------------
*/
static herr_t
-H5O_sdspace_pre_copy_file(H5F_t H5_ATTR_UNUSED *file_src, const void *mesg_src,
- hbool_t H5_ATTR_UNUSED *deleted, const H5O_copy_t *cpy_info, void *_udata)
+H5O__sdspace_pre_copy_file(H5F_t H5_ATTR_UNUSED *file_src, const void *mesg_src,
+ hbool_t H5_ATTR_UNUSED *deleted, const H5O_copy_t *cpy_info, void *_udata)
{
const H5S_extent_t *src_space_extent = (const H5S_extent_t *)mesg_src; /* Source dataspace extent */
H5D_copy_file_ud_t *udata = (H5D_copy_file_ud_t *)_udata; /* Dataset copying user data */
herr_t ret_value = SUCCEED; /* Return value */
- FUNC_ENTER_NOAPI_NOINIT
+ FUNC_ENTER_STATIC
/* check args */
HDassert(file_src);
@@ -507,7 +495,7 @@ H5O__sdspace_debug(H5F_t H5_ATTR_UNUSED *f, const void *mesg, FILE *stream, int
HDfprintf(stream, "%*s%-*s {", indent, "", fwidth, "Dim Size:");
for (u = 0; u < sdim->rank; u++)
- HDfprintf(stream, "%s%Hu", u ? ", " : "", sdim->size[u]);
+ HDfprintf(stream, "%s%" PRIuHSIZE, u ? ", " : "", sdim->size[u]);
HDfprintf(stream, "}\n");
HDfprintf(stream, "%*s%-*s ", indent, "", fwidth, "Dim Max:");
@@ -517,7 +505,7 @@ H5O__sdspace_debug(H5F_t H5_ATTR_UNUSED *f, const void *mesg, FILE *stream, int
if (H5S_UNLIMITED == sdim->max[u])
HDfprintf(stream, "%sUNLIM", u ? ", " : "");
else
- HDfprintf(stream, "%s%Hu", u ? ", " : "", sdim->max[u]);
+ HDfprintf(stream, "%s%" PRIuHSIZE, u ? ", " : "", sdim->max[u]);
} /* end for */
HDfprintf(stream, "}\n");
} /* end if */
diff --git a/src/H5Oshared.c b/src/H5Oshared.c
index f12ad59..51ea145 100644
--- a/src/H5Oshared.c
+++ b/src/H5Oshared.c
@@ -12,7 +12,7 @@
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
/*
- * Programmer: Robb Matzke <matzke@llnl.gov>
+ * Programmer: Robb Matzke
* Wednesday, April 1, 1998
*
* Purpose: Functions that operate on a shared message. The shared
@@ -95,7 +95,6 @@ static herr_t H5O__shared_link_adj(H5F_t *f, H5O_t *open_oh, const H5O_msg_class
* Failure: NULL
*
* Programmer: Quincey Koziol
- * koziol@ncsa.uiuc.edu
* Sep 24 2003
*
*-------------------------------------------------------------------------
@@ -209,7 +208,6 @@ done:
* Return: SUCCEED/FAIL
*
* Programmer: Quincey Koziol
- * koziol@ncsa.uiuc.edu
* Sep 26 2003
*
*-------------------------------------------------------------------------
@@ -432,7 +430,6 @@ H5O__shared_encode(const H5F_t *f, uint8_t *buf /*out*/, const H5O_shared_t *sh_
* Return: SUCCEED/FAIL
*
* Programmer: Quincey Koziol
- * koziol@ncsa.uiuc.edu
* Sep 26 2003
*
*-------------------------------------------------------------------------
@@ -638,7 +635,6 @@ done:
* Return: SUCCEED/FAIL
*
* Programmer: Peter Cao
- * xcao@hdfgroup.org
* May 24 2007
*
*-------------------------------------------------------------------------
@@ -711,7 +707,8 @@ H5O__shared_debug(const H5O_shared_t *mesg, FILE *stream, int indent, int fwidth
case H5O_SHARE_TYPE_COMMITTED:
HDfprintf(stream, "%*s%-*s %s\n", indent, "", fwidth, "Shared Message type:", "Obj Hdr");
- HDfprintf(stream, "%*s%-*s %a\n", indent, "", fwidth, "Object address:", mesg->u.loc.oh_addr);
+ HDfprintf(stream, "%*s%-*s %" PRIuHADDR "\n", indent, "", fwidth,
+ "Object address:", mesg->u.loc.oh_addr);
break;
case H5O_SHARE_TYPE_SOHM:
diff --git a/src/H5Oshmesg.c b/src/H5Oshmesg.c
index 1a655c6..1c894a5 100644
--- a/src/H5Oshmesg.c
+++ b/src/H5Oshmesg.c
@@ -11,7 +11,7 @@
* help@hdfgroup.org. *
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
-/* Programmer: James Laird <jlaird@hdfgroup.org>
+/* Programmer: James Laird
* Monday, January 29, 2007
*
* Purpose: A message holding "implicitly shared object header message"
@@ -27,9 +27,9 @@
static void * H5O__shmesg_decode(H5F_t *f, H5O_t *open_oh, unsigned mesg_flags, unsigned *ioflags,
size_t p_size, const uint8_t *p);
-static herr_t H5O_shmesg_encode(H5F_t *f, hbool_t disable_shared, uint8_t *p, const void *_mesg);
-static void * H5O_shmesg_copy(const void *_mesg, void *_dest);
-static size_t H5O_shmesg_size(const H5F_t *f, hbool_t disable_shared, const void *_mesg);
+static herr_t H5O__shmesg_encode(H5F_t *f, hbool_t disable_shared, uint8_t *p, const void *_mesg);
+static void * H5O__shmesg_copy(const void *_mesg, void *_dest);
+static size_t H5O__shmesg_size(const H5F_t *f, hbool_t disable_shared, const void *_mesg);
static herr_t H5O__shmesg_debug(H5F_t *f, const void *_mesg, FILE *stream, int indent, int fwidth);
/* This message derives from H5O message class */
@@ -39,9 +39,9 @@ const H5O_msg_class_t H5O_MSG_SHMESG[1] = {{
sizeof(H5O_shmesg_table_t), /*native message size */
0, /* messages are sharable? */
H5O__shmesg_decode, /*decode message */
- H5O_shmesg_encode, /*encode message */
- H5O_shmesg_copy, /*copy the native value */
- H5O_shmesg_size, /*raw message size */
+ H5O__shmesg_encode, /*encode message */
+ H5O__shmesg_copy, /*copy the native value */
+ H5O__shmesg_size, /*raw message size */
NULL, /*free internal memory */
NULL, /* free method */
NULL, /* file delete method */
@@ -100,7 +100,7 @@ done:
} /* end H5O__shmesg_decode() */
/*-------------------------------------------------------------------------
- * Function: H5O_shmesg_encode
+ * Function: H5O__shmesg_encode
*
* Purpose: Encode a shared message table message.
*
@@ -112,11 +112,11 @@ done:
*-------------------------------------------------------------------------
*/
static herr_t
-H5O_shmesg_encode(H5F_t *f, hbool_t H5_ATTR_UNUSED disable_shared, uint8_t *p, const void *_mesg)
+H5O__shmesg_encode(H5F_t *f, hbool_t H5_ATTR_UNUSED disable_shared, uint8_t *p, const void *_mesg)
{
const H5O_shmesg_table_t *mesg = (const H5O_shmesg_table_t *)_mesg;
- FUNC_ENTER_NOAPI_NOINIT_NOERR
+ FUNC_ENTER_STATIC_NOERR
/* Sanity check */
HDassert(f);
@@ -129,10 +129,10 @@ H5O_shmesg_encode(H5F_t *f, hbool_t H5_ATTR_UNUSED disable_shared, uint8_t *p, c
*p++ = (uint8_t)mesg->nindexes;
FUNC_LEAVE_NOAPI(SUCCEED)
-} /* end H5O_shmesg_encode() */
+} /* end H5O__shmesg_encode() */
/*-------------------------------------------------------------------------
- * Function: H5O_shmesg_copy
+ * Function: H5O__shmesg_copy
*
* Purpose: Copies a message from _MESG to _DEST, allocating _DEST if
* necessary.
@@ -146,13 +146,13 @@ H5O_shmesg_encode(H5F_t *f, hbool_t H5_ATTR_UNUSED disable_shared, uint8_t *p, c
*-------------------------------------------------------------------------
*/
static void *
-H5O_shmesg_copy(const void *_mesg, void *_dest)
+H5O__shmesg_copy(const void *_mesg, void *_dest)
{
const H5O_shmesg_table_t *mesg = (const H5O_shmesg_table_t *)_mesg;
H5O_shmesg_table_t * dest = (H5O_shmesg_table_t *)_dest;
void * ret_value = NULL; /* Return value */
- FUNC_ENTER_NOAPI_NOINIT
+ FUNC_ENTER_STATIC
/* Sanity check */
HDassert(mesg);
@@ -169,10 +169,10 @@ H5O_shmesg_copy(const void *_mesg, void *_dest)
done:
FUNC_LEAVE_NOAPI(ret_value)
-} /* end H5O_shmesg_copy() */
+} /* end H5O__shmesg_copy() */
/*-------------------------------------------------------------------------
- * Function: H5O_shmesg_size
+ * Function: H5O__shmesg_size
*
* Purpose: Returns the size of the raw message in bytes not counting the
* message type or size fields, but only the data fields.
@@ -186,11 +186,11 @@ done:
*-------------------------------------------------------------------------
*/
static size_t
-H5O_shmesg_size(const H5F_t *f, hbool_t H5_ATTR_UNUSED disable_shared, const void H5_ATTR_UNUSED *_mesg)
+H5O__shmesg_size(const H5F_t *f, hbool_t H5_ATTR_UNUSED disable_shared, const void H5_ATTR_UNUSED *_mesg)
{
size_t ret_value = 0; /* Return value */
- FUNC_ENTER_NOAPI_NOINIT_NOERR
+ FUNC_ENTER_STATIC_NOERR
/* Sanity check */
HDassert(f);
@@ -200,7 +200,7 @@ H5O_shmesg_size(const H5F_t *f, hbool_t H5_ATTR_UNUSED disable_shared, const voi
1); /* Number of indexes */
FUNC_LEAVE_NOAPI(ret_value)
-} /* end H5O_shmesg_size() */
+} /* end H5O__shmesg_size() */
/*-------------------------------------------------------------------------
* Function: H5O__shmesg_debug
@@ -229,7 +229,8 @@ H5O__shmesg_debug(H5F_t H5_ATTR_UNUSED *f, const void *_mesg, FILE *stream, int
HDassert(fwidth >= 0);
HDfprintf(stream, "%*s%-*s %u\n", indent, "", fwidth, "Version:", mesg->version);
- HDfprintf(stream, "%*s%-*s %a (rel)\n", indent, "", fwidth, "Shared message table address:", mesg->addr);
+ HDfprintf(stream, "%*s%-*s %" PRIuHADDR " (rel)\n", indent, "", fwidth,
+ "Shared message table address:", mesg->addr);
HDfprintf(stream, "%*s%-*s %u\n", indent, "", fwidth, "Number of indexes:", mesg->nindexes);
FUNC_LEAVE_NOAPI(SUCCEED)
diff --git a/src/H5Ostab.c b/src/H5Ostab.c
index fd6149b..fa030bd 100644
--- a/src/H5Ostab.c
+++ b/src/H5Ostab.c
@@ -15,7 +15,7 @@
*
* Created: H5Ostab.c
* Aug 6 1997
- * Robb Matzke <matzke@llnl.gov>
+ * Robb Matzke
*
* Purpose: Symbol table messages.
*
@@ -84,7 +84,6 @@ H5FL_DEFINE_STATIC(H5O_stab_t);
* Failure: NULL
*
* Programmer: Robb Matzke
- * matzke@llnl.gov
* Aug 6 1997
*
*-------------------------------------------------------------------------
@@ -96,7 +95,7 @@ H5O__stab_decode(H5F_t *f, H5O_t H5_ATTR_UNUSED *open_oh, unsigned H5_ATTR_UNUSE
H5O_stab_t *stab = NULL;
void * ret_value = NULL; /* Return value */
- FUNC_ENTER_NOAPI_NOINIT
+ FUNC_ENTER_STATIC
/* check args */
HDassert(f);
@@ -112,10 +111,9 @@ H5O__stab_decode(H5F_t *f, H5O_t H5_ATTR_UNUSED *open_oh, unsigned H5_ATTR_UNUSE
ret_value = stab;
done:
- if (ret_value == NULL) {
+ if (ret_value == NULL)
if (stab != NULL)
stab = H5FL_FREE(H5O_stab_t, stab);
- } /* end if */
FUNC_LEAVE_NOAPI(ret_value)
} /* end H5O__stab_decode() */
@@ -128,7 +126,6 @@ done:
* Return: Non-negative on success/Negative on failure
*
* Programmer: Robb Matzke
- * matzke@llnl.gov
* Aug 6 1997
*
*-------------------------------------------------------------------------
@@ -163,7 +160,6 @@ H5O__stab_encode(H5F_t *f, hbool_t H5_ATTR_UNUSED disable_shared, uint8_t *p, co
* Failure: NULL
*
* Programmer: Robb Matzke
- * matzke@llnl.gov
* Aug 6 1997
*
*-------------------------------------------------------------------------
@@ -204,7 +200,6 @@ done:
* Failure: zero
*
* Programmer: Robb Matzke
- * matzke@llnl.gov
* Aug 6 1997
*
*-------------------------------------------------------------------------
@@ -399,11 +394,8 @@ done:
* Return: Non-negative on success/Negative on failure
*
* Programmer: Robb Matzke
- * matzke@llnl.gov
* Aug 6 1997
*
- * Modifications:
- *
*-------------------------------------------------------------------------
*/
static herr_t
@@ -420,9 +412,9 @@ H5O__stab_debug(H5F_t H5_ATTR_UNUSED *f, const void *_mesg, FILE *stream, int in
HDassert(indent >= 0);
HDassert(fwidth >= 0);
- HDfprintf(stream, "%*s%-*s %a\n", indent, "", fwidth, "B-tree address:", stab->btree_addr);
+ HDfprintf(stream, "%*s%-*s %" PRIuHADDR "\n", indent, "", fwidth, "B-tree address:", stab->btree_addr);
- HDfprintf(stream, "%*s%-*s %a\n", indent, "", fwidth, "Name heap address:", stab->heap_addr);
+ HDfprintf(stream, "%*s%-*s %" PRIuHADDR "\n", indent, "", fwidth, "Name heap address:", stab->heap_addr);
FUNC_LEAVE_NOAPI(SUCCEED)
} /* end H5O__stab_debug() */
diff --git a/src/H5Ounknown.c b/src/H5Ounknown.c
index d086c44..2b8a7bb 100644
--- a/src/H5Ounknown.c
+++ b/src/H5Ounknown.c
@@ -15,7 +15,7 @@
*
* Created: H5Ounknown.c
* Apr 19 2007
- * Quincey Koziol <koziol@hdfgroup.org>
+ * Quincey Koziol
*
* Purpose: Handle unknown message classes in a minimal way.
*
diff --git a/src/H5P.c b/src/H5P.c
index 5774f55..a2d9cfc 100644
--- a/src/H5P.c
+++ b/src/H5P.c
@@ -11,7 +11,7 @@
* help@hdfgroup.org. *
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
-/* Programmer: Quincey Koziol <koziol@ncsa.uiuc.edu>
+/* Programmer: Quincey Koziol
*
* Purpose: Generic Property Functions
*/
@@ -117,11 +117,11 @@ H5Pcopy(hid_t id)
if ((copy_class = H5P__copy_pclass((H5P_genclass_t *)obj)) == NULL)
HGOTO_ERROR(H5E_PLIST, H5E_CANTCOPY, H5I_INVALID_HID, "can't copy property class");
- /* Get an atom for the copied class */
+ /* Get an ID for the copied class */
if ((ret_value = H5I_register(H5I_GENPROP_CLS, copy_class, TRUE)) < 0) {
H5P__close_class(copy_class);
HGOTO_ERROR(H5E_PLIST, H5E_CANTREGISTER, H5I_INVALID_HID,
- "unable to atomize property list class");
+ "unable to register property list class");
} /* end if */
} /* end else */
@@ -196,9 +196,9 @@ H5Pcreate_class(hid_t parent, const char *name, H5P_cls_create_func_t cls_create
copy_data, cls_close, close_data)))
HGOTO_ERROR(H5E_PLIST, H5E_CANTCREATE, H5I_INVALID_HID, "unable to create property list class")
- /* Get an atom for the class */
+ /* Get an ID for the class */
if ((ret_value = H5I_register(H5I_GENPROP_CLS, pclass, TRUE)) < 0)
- HGOTO_ERROR(H5E_PLIST, H5E_CANTREGISTER, H5I_INVALID_HID, "unable to atomize property list class")
+ HGOTO_ERROR(H5E_PLIST, H5E_CANTREGISTER, H5I_INVALID_HID, "unable to register property list class")
done:
if (H5I_INVALID_HID == ret_value && pclass)
@@ -756,14 +756,14 @@ done:
REVISION LOG
--------------------------------------------------------------------------*/
herr_t
-H5Pget_size(hid_t id, const char *name, size_t *size)
+H5Pget_size(hid_t id, const char *name, size_t *size /*out*/)
{
H5P_genclass_t *pclass; /* Property class to query */
H5P_genplist_t *plist; /* Property list to query */
herr_t ret_value; /* return value */
FUNC_ENTER_API(FAIL)
- H5TRACE3("e", "i*s*z", id, name, size);
+ H5TRACE3("e", "i*sx", id, name, size);
/* Check arguments. */
if (H5I_GENPROP_LST != H5I_get_type(id) && H5I_GENPROP_CLS != H5I_get_type(id))
@@ -926,9 +926,9 @@ H5Pget_class(hid_t plist_id)
if (H5P__access_class(pclass, H5P_MOD_INC_REF) < 0)
HGOTO_ERROR(H5E_PLIST, H5E_CANTINIT, H5I_INVALID_HID, "Can't increment class ID ref count");
- /* Get an atom for the class */
+ /* Get an ID for the class */
if ((ret_value = H5I_register(H5I_GENPROP_CLS, pclass, TRUE)) < 0)
- HGOTO_ERROR(H5E_PLIST, H5E_CANTREGISTER, H5I_INVALID_HID, "unable to atomize property list class");
+ HGOTO_ERROR(H5E_PLIST, H5E_CANTREGISTER, H5I_INVALID_HID, "unable to register property list class");
done:
if (H5I_INVALID_HID == ret_value && pclass)
@@ -961,14 +961,14 @@ done:
REVISION LOG
--------------------------------------------------------------------------*/
herr_t
-H5Pget_nprops(hid_t id, size_t *nprops)
+H5Pget_nprops(hid_t id, size_t *nprops /*out*/)
{
H5P_genplist_t *plist; /* Property list to query */
H5P_genclass_t *pclass; /* Property class to query */
herr_t ret_value = SUCCEED; /* return value */
FUNC_ENTER_API(FAIL)
- H5TRACE2("e", "i*z", id, nprops);
+ H5TRACE2("e", "ix", id, nprops);
/* Check arguments. */
if (H5I_GENPROP_LST != H5I_get_type(id) && H5I_GENPROP_CLS != H5I_get_type(id))
@@ -1262,13 +1262,13 @@ done:
REVISION LOG
--------------------------------------------------------------------------*/
herr_t
-H5Pget(hid_t plist_id, const char *name, void *value)
+H5Pget(hid_t plist_id, const char *name, void *value /*out*/)
{
H5P_genplist_t *plist; /* Property list pointer */
herr_t ret_value = SUCCEED; /* return value */
FUNC_ENTER_API(FAIL)
- H5TRACE3("e", "i*s*x", plist_id, name, value);
+ H5TRACE3("e", "i*sx", plist_id, name, value);
/* Check arguments. */
if (NULL == (plist = (H5P_genplist_t *)H5I_object_verify(plist_id, H5I_GENPROP_LST)))
@@ -1580,9 +1580,9 @@ H5Pget_class_parent(hid_t pclass_id)
if (H5P__access_class(parent, H5P_MOD_INC_REF) < 0)
HGOTO_ERROR(H5E_PLIST, H5E_CANTINIT, H5I_INVALID_HID, "Can't increment class ID ref count")
- /* Get an atom for the class */
+ /* Get an ID for the class */
if ((ret_value = H5I_register(H5I_GENPROP_CLS, parent, TRUE)) < 0)
- HGOTO_ERROR(H5E_PLIST, H5E_CANTREGISTER, H5I_INVALID_HID, "unable to atomize property list class")
+ HGOTO_ERROR(H5E_PLIST, H5E_CANTREGISTER, H5I_INVALID_HID, "unable to register property list class")
done:
if (H5I_INVALID_HID == ret_value && parent)
diff --git a/src/H5Pdapl.c b/src/H5Pdapl.c
index a7a541c..c8a97c2 100644
--- a/src/H5Pdapl.c
+++ b/src/H5Pdapl.c
@@ -15,7 +15,7 @@
*
* Created: H5Pdapl.c
* October 27, 2008
- * Neil Fortner <nfortne2@hdfgroup.org>
+ * Neil Fortner
*
* Purpose: Dataset access property list class routines
*
@@ -36,7 +36,7 @@
#include "H5Eprivate.h" /* Error handling */
#include "H5Fprivate.h" /* Files */
#include "H5Iprivate.h" /* IDs */
-#include "H5MMprivate.h" /* Memory management */
+#include "H5MMprivate.h" /* Memory management */
#include "H5Ppkg.h" /* Property lists */
/****************/
@@ -320,7 +320,7 @@ H5P__dapl_vds_file_pref_enc(const void *value, void **_pp, size_t *size)
uint64_t enc_value;
unsigned enc_size;
- FUNC_ENTER_NOAPI_NOINIT_NOERR
+ FUNC_ENTER_STATIC_NOERR
HDcompile_assert(sizeof(size_t) <= sizeof(uint64_t));
@@ -371,7 +371,7 @@ H5P__dapl_vds_file_pref_dec(const void **_pp, void *_value)
unsigned enc_size; /* Size of encoded property */
herr_t ret_value = SUCCEED;
- FUNC_ENTER_NOAPI_NOINIT
+ FUNC_ENTER_STATIC
HDassert(pp);
HDassert(*pp);
@@ -414,7 +414,7 @@ static herr_t
H5P__dapl_vds_file_pref_del(hid_t H5_ATTR_UNUSED prop_id, const char H5_ATTR_UNUSED *name,
size_t H5_ATTR_UNUSED size, void *value)
{
- FUNC_ENTER_NOAPI_NOINIT_NOERR
+ FUNC_ENTER_STATIC_NOERR
HDassert(value);
@@ -434,7 +434,7 @@ H5P__dapl_vds_file_pref_del(hid_t H5_ATTR_UNUSED prop_id, const char H5_ATTR_UNU
static herr_t
H5P__dapl_vds_file_pref_copy(const char H5_ATTR_UNUSED *name, size_t H5_ATTR_UNUSED size, void *value)
{
- FUNC_ENTER_NOAPI_NOINIT_NOERR
+ FUNC_ENTER_STATIC_NOERR
HDassert(value);
@@ -460,7 +460,7 @@ H5P__dapl_vds_file_pref_cmp(const void *value1, const void *value2, size_t H5_AT
const char *pref2 = *(const char *const *)value2;
int ret_value = 0;
- FUNC_ENTER_NOAPI_NOINIT_NOERR
+ FUNC_ENTER_STATIC_NOERR
if (NULL == pref1 && NULL != pref2)
HGOTO_DONE(1);
@@ -484,7 +484,7 @@ done:
static herr_t
H5P__dapl_vds_file_pref_close(const char H5_ATTR_UNUSED *name, size_t H5_ATTR_UNUSED size, void *value)
{
- FUNC_ENTER_NOAPI_NOINIT_NOERR
+ FUNC_ENTER_STATIC_NOERR
HDassert(value);
@@ -560,7 +560,7 @@ H5P__dapl_efile_pref_enc(const void *value, void **_pp, size_t *size)
uint64_t enc_value;
unsigned enc_size;
- FUNC_ENTER_NOAPI_NOINIT_NOERR
+ FUNC_ENTER_STATIC_NOERR
HDcompile_assert(sizeof(size_t) <= sizeof(uint64_t));
@@ -611,7 +611,7 @@ H5P__dapl_efile_pref_dec(const void **_pp, void *_value)
unsigned enc_size; /* Size of encoded property */
herr_t ret_value = SUCCEED;
- FUNC_ENTER_NOAPI_NOINIT
+ FUNC_ENTER_STATIC
HDassert(pp);
HDassert(*pp);
@@ -654,7 +654,7 @@ static herr_t
H5P__dapl_efile_pref_del(hid_t H5_ATTR_UNUSED prop_id, const char H5_ATTR_UNUSED *name,
size_t H5_ATTR_UNUSED size, void *value)
{
- FUNC_ENTER_NOAPI_NOINIT_NOERR
+ FUNC_ENTER_STATIC_NOERR
HDassert(value);
@@ -674,7 +674,7 @@ H5P__dapl_efile_pref_del(hid_t H5_ATTR_UNUSED prop_id, const char H5_ATTR_UNUSED
static herr_t
H5P__dapl_efile_pref_copy(const char H5_ATTR_UNUSED *name, size_t H5_ATTR_UNUSED size, void *value)
{
- FUNC_ENTER_NOAPI_NOINIT_NOERR
+ FUNC_ENTER_STATIC_NOERR
HDassert(value);
@@ -700,7 +700,7 @@ H5P__dapl_efile_pref_cmp(const void *value1, const void *value2, size_t H5_ATTR_
const char *pref2 = *(const char *const *)value2;
int ret_value = 0;
- FUNC_ENTER_NOAPI_NOINIT_NOERR
+ FUNC_ENTER_STATIC_NOERR
if (NULL == pref1 && NULL != pref2)
HGOTO_DONE(1);
@@ -724,7 +724,7 @@ done:
static herr_t
H5P__dapl_efile_pref_close(const char H5_ATTR_UNUSED *name, size_t H5_ATTR_UNUSED size, void *value)
{
- FUNC_ENTER_NOAPI_NOINIT_NOERR
+ FUNC_ENTER_STATIC_NOERR
HDassert(value);
@@ -775,7 +775,7 @@ H5Pset_chunk_cache(hid_t dapl_id, size_t rdcc_nslots, size_t rdcc_nbytes, double
/* Get the plist structure */
if (NULL == (plist = H5P_object_verify(dapl_id, H5P_DATASET_ACCESS)))
- HGOTO_ERROR(H5E_ATOM, H5E_BADATOM, FAIL, "can't find object for ID");
+ HGOTO_ERROR(H5E_ID, H5E_BADID, FAIL, "can't find object for ID");
/* Set sizes */
if (H5P_set(plist, H5D_ACS_DATA_CACHE_NUM_SLOTS_NAME, &rdcc_nslots) < 0)
@@ -804,22 +804,23 @@ done:
*-------------------------------------------------------------------------
*/
herr_t
-H5Pget_chunk_cache(hid_t dapl_id, size_t *rdcc_nslots, size_t *rdcc_nbytes, double *rdcc_w0)
+H5Pget_chunk_cache(hid_t dapl_id, size_t *rdcc_nslots /*out*/, size_t *rdcc_nbytes /*out*/,
+ double *rdcc_w0 /*out*/)
{
H5P_genplist_t *plist; /* Property list pointer */
H5P_genplist_t *def_plist; /* Default file access property list */
herr_t ret_value = SUCCEED; /* return value */
FUNC_ENTER_API(FAIL)
- H5TRACE4("e", "i*z*z*d", dapl_id, rdcc_nslots, rdcc_nbytes, rdcc_w0);
+ H5TRACE4("e", "ixxx", dapl_id, rdcc_nslots, rdcc_nbytes, rdcc_w0);
/* Get the plist structure */
if (NULL == (plist = H5P_object_verify(dapl_id, H5P_DATASET_ACCESS)))
- HGOTO_ERROR(H5E_ATOM, H5E_BADATOM, FAIL, "can't find object for ID");
+ HGOTO_ERROR(H5E_ID, H5E_BADID, FAIL, "can't find object for ID");
/* Get default file access plist */
if (NULL == (def_plist = (H5P_genplist_t *)H5I_object(H5P_FILE_ACCESS_DEFAULT)))
- HGOTO_ERROR(H5E_ATOM, H5E_BADATOM, FAIL, "can't find object for default fapl ID");
+ HGOTO_ERROR(H5E_ID, H5E_BADID, FAIL, "can't find object for default fapl ID");
/* Get the properties. If a property is set to the default value, the value
* from the default fapl is used. */
@@ -865,11 +866,11 @@ done:
static herr_t
H5P__encode_chunk_cache_nslots(const void *value, void **_pp, size_t *size)
{
- uint64_t enc_value; /* Property value to encode */
- uint8_t **pp = (uint8_t **)_pp;
+ uint64_t enc_value = 0; /* Property value to encode */
+ uint8_t **pp = (uint8_t **)_pp;
unsigned enc_size; /* Size of encoded property */
- FUNC_ENTER_PACKAGE_NOERR
+ FUNC_ENTER_STATIC_NOERR
/* Sanity checks */
HDcompile_assert(sizeof(size_t) <= sizeof(uint64_t));
@@ -924,7 +925,7 @@ H5P__decode_chunk_cache_nslots(const void **_pp, void *_value)
uint64_t enc_value; /* Decoded property value */
unsigned enc_size; /* Size of encoded property */
- FUNC_ENTER_PACKAGE_NOERR
+ FUNC_ENTER_STATIC_NOERR
/* Sanity check */
HDcompile_assert(sizeof(size_t) <= sizeof(uint64_t));
@@ -965,11 +966,11 @@ H5P__decode_chunk_cache_nslots(const void **_pp, void *_value)
static herr_t
H5P__encode_chunk_cache_nbytes(const void *value, void **_pp, size_t *size)
{
- uint64_t enc_value; /* Property value to encode */
- uint8_t **pp = (uint8_t **)_pp;
+ uint64_t enc_value = 0; /* Property value to encode */
+ uint8_t **pp = (uint8_t **)_pp;
unsigned enc_size; /* Size of encoded property */
- FUNC_ENTER_PACKAGE_NOERR
+ FUNC_ENTER_STATIC_NOERR
/* Sanity checks */
HDcompile_assert(sizeof(size_t) <= sizeof(uint64_t));
@@ -1024,7 +1025,7 @@ H5P__decode_chunk_cache_nbytes(const void **_pp, void *_value)
uint64_t enc_value; /* Decoded property value */
unsigned enc_size; /* Size of encoded property */
- FUNC_ENTER_PACKAGE_NOERR
+ FUNC_ENTER_STATIC_NOERR
/* Sanity check */
HDcompile_assert(sizeof(size_t) <= sizeof(uint64_t));
@@ -1081,7 +1082,7 @@ H5Pset_virtual_view(hid_t plist_id, H5D_vds_view_t view)
/* Get the plist structure */
if (NULL == (plist = H5P_object_verify(plist_id, H5P_DATASET_ACCESS)))
- HGOTO_ERROR(H5E_ATOM, H5E_BADATOM, FAIL, "can't find object for ID")
+ HGOTO_ERROR(H5E_ID, H5E_BADID, FAIL, "can't find object for ID")
/* Update property list */
if (H5P_set(plist, H5D_ACS_VDS_VIEW_NAME, &view) < 0)
@@ -1103,17 +1104,17 @@ done:
*-------------------------------------------------------------------------
*/
herr_t
-H5Pget_virtual_view(hid_t plist_id, H5D_vds_view_t *view)
+H5Pget_virtual_view(hid_t plist_id, H5D_vds_view_t *view /*out*/)
{
H5P_genplist_t *plist; /* Property list pointer */
herr_t ret_value = SUCCEED; /* Return value */
FUNC_ENTER_API(FAIL)
- H5TRACE2("e", "i*Dv", plist_id, view);
+ H5TRACE2("e", "ix", plist_id, view);
/* Get the plist structure */
if (NULL == (plist = H5P_object_verify(plist_id, H5P_DATASET_ACCESS)))
- HGOTO_ERROR(H5E_ATOM, H5E_BADATOM, FAIL, "can't find object for ID")
+ HGOTO_ERROR(H5E_ID, H5E_BADID, FAIL, "can't find object for ID")
/* Get value from property list */
if (view)
@@ -1223,7 +1224,7 @@ H5Pset_virtual_printf_gap(hid_t plist_id, hsize_t gap_size)
/* Get the plist structure */
if (NULL == (plist = H5P_object_verify(plist_id, H5P_DATASET_ACCESS)))
- HGOTO_ERROR(H5E_ATOM, H5E_BADATOM, FAIL, "can't find object for ID")
+ HGOTO_ERROR(H5E_ID, H5E_BADID, FAIL, "can't find object for ID")
/* Update property list */
if (H5P_set(plist, H5D_ACS_VDS_PRINTF_GAP_NAME, &gap_size) < 0)
@@ -1246,17 +1247,17 @@ done:
*-------------------------------------------------------------------------
*/
herr_t
-H5Pget_virtual_printf_gap(hid_t plist_id, hsize_t *gap_size)
+H5Pget_virtual_printf_gap(hid_t plist_id, hsize_t *gap_size /*out*/)
{
H5P_genplist_t *plist; /* Property list pointer */
herr_t ret_value = SUCCEED; /* Return value */
FUNC_ENTER_API(FAIL)
- H5TRACE2("e", "i*h", plist_id, gap_size);
+ H5TRACE2("e", "ix", plist_id, gap_size);
/* Get the plist structure */
if (NULL == (plist = H5P_object_verify(plist_id, H5P_DATASET_ACCESS)))
- HGOTO_ERROR(H5E_ATOM, H5E_BADATOM, FAIL, "can't find object for ID")
+ HGOTO_ERROR(H5E_ID, H5E_BADID, FAIL, "can't find object for ID")
/* Get value from property list */
if (gap_size)
@@ -1309,7 +1310,7 @@ H5Pset_append_flush(hid_t plist_id, unsigned ndims, const hsize_t *boundary, H5D
/* Get the plist structure */
if (NULL == (plist = H5P_object_verify(plist_id, H5P_DATASET_ACCESS)))
- HGOTO_ERROR(H5E_ATOM, H5E_BADATOM, FAIL, "can't find object for ID")
+ HGOTO_ERROR(H5E_ID, H5E_BADID, FAIL, "can't find object for ID")
/* Set up values */
info.ndims = ndims;
@@ -1345,7 +1346,8 @@ done:
*-------------------------------------------------------------------------
*/
herr_t
-H5Pget_append_flush(hid_t plist_id, unsigned ndims, hsize_t boundary[], H5D_append_cb_t *func, void **udata)
+H5Pget_append_flush(hid_t plist_id, unsigned ndims, hsize_t boundary[], H5D_append_cb_t *func /*out*/,
+ void **udata /*out*/)
{
H5P_genplist_t * plist; /* property list pointer */
H5D_append_flush_t info;
@@ -1353,11 +1355,11 @@ H5Pget_append_flush(hid_t plist_id, unsigned ndims, hsize_t boundary[], H5D_appe
herr_t ret_value = SUCCEED; /* return value */
FUNC_ENTER_API(FAIL)
- H5TRACE5("e", "iIu*h*DA**x", plist_id, ndims, boundary, func, udata);
+ H5TRACE5("e", "iIu*hxx", plist_id, ndims, boundary, func, udata);
/* Get the plist structure */
if (NULL == (plist = H5P_object_verify(plist_id, H5P_DATASET_ACCESS)))
- HGOTO_ERROR(H5E_ATOM, H5E_BADATOM, FAIL, "can't find object for ID")
+ HGOTO_ERROR(H5E_ID, H5E_BADID, FAIL, "can't find object for ID")
/* Retrieve info for append flush */
if (H5P_get(plist, H5D_ACS_APPEND_FLUSH_NAME, &info) < 0)
@@ -1407,7 +1409,7 @@ H5Pset_efile_prefix(hid_t plist_id, const char *prefix)
/* Get the plist structure */
if (NULL == (plist = H5P_object_verify(plist_id, H5P_DATASET_ACCESS)))
- HGOTO_ERROR(H5E_ATOM, H5E_BADATOM, FAIL, "can't find object for ID")
+ HGOTO_ERROR(H5E_ID, H5E_BADID, FAIL, "can't find object for ID")
/* Set prefix */
if (H5P_set(plist, H5D_ACS_EFILE_PREFIX_NAME, &prefix) < 0)
@@ -1428,7 +1430,7 @@ done:
*-------------------------------------------------------------------------
*/
ssize_t
-H5Pget_efile_prefix(hid_t plist_id, char *prefix, size_t size)
+H5Pget_efile_prefix(hid_t plist_id, char *prefix /*out*/, size_t size)
{
H5P_genplist_t *plist; /* Property list pointer */
char * my_prefix; /* Library's copy of the prefix */
@@ -1436,11 +1438,11 @@ H5Pget_efile_prefix(hid_t plist_id, char *prefix, size_t size)
ssize_t ret_value; /* Return value */
FUNC_ENTER_API(FAIL)
- H5TRACE3("Zs", "i*sz", plist_id, prefix, size);
+ H5TRACE3("Zs", "ixz", plist_id, prefix, size);
/* Get the plist structure */
if (NULL == (plist = H5P_object_verify(plist_id, H5P_DATASET_ACCESS)))
- HGOTO_ERROR(H5E_ATOM, H5E_BADATOM, FAIL, "can't find object for ID")
+ HGOTO_ERROR(H5E_ID, H5E_BADID, FAIL, "can't find object for ID")
/* Get the current prefix */
if (H5P_peek(plist, H5D_ACS_EFILE_PREFIX_NAME, &my_prefix) < 0)
@@ -1495,7 +1497,7 @@ H5Pset_virtual_prefix(hid_t plist_id, const char *prefix)
/* Get the plist structure */
if (NULL == (plist = H5P_object_verify(plist_id, H5P_DATASET_ACCESS)))
- HGOTO_ERROR(H5E_ATOM, H5E_BADATOM, FAIL, "can't find object for ID")
+ HGOTO_ERROR(H5E_ID, H5E_BADID, FAIL, "can't find object for ID")
/* Set prefix */
if (H5P_set(plist, H5D_ACS_VDS_PREFIX_NAME, &prefix) < 0)
@@ -1518,7 +1520,7 @@ done:
*-------------------------------------------------------------------------
*/
ssize_t
-H5Pget_virtual_prefix(hid_t plist_id, char *prefix, size_t size)
+H5Pget_virtual_prefix(hid_t plist_id, char *prefix /*out*/, size_t size)
{
H5P_genplist_t *plist; /* Property list pointer */
char * my_prefix; /* Library's copy of the prefix */
@@ -1526,11 +1528,11 @@ H5Pget_virtual_prefix(hid_t plist_id, char *prefix, size_t size)
ssize_t ret_value; /* Return value */
FUNC_ENTER_API(FAIL)
- H5TRACE3("Zs", "i*sz", plist_id, prefix, size);
+ H5TRACE3("Zs", "ixz", plist_id, prefix, size);
/* Get the plist structure */
if (NULL == (plist = H5P_object_verify(plist_id, H5P_DATASET_ACCESS)))
- HGOTO_ERROR(H5E_ATOM, H5E_BADATOM, FAIL, "can't find object for ID")
+ HGOTO_ERROR(H5E_ID, H5E_BADID, FAIL, "can't find object for ID")
/* Get the current prefix */
if (H5P_peek(plist, H5D_ACS_VDS_PREFIX_NAME, &my_prefix) < 0)
diff --git a/src/H5Pdcpl.c b/src/H5Pdcpl.c
index 63402e2..d08d892 100644
--- a/src/H5Pdcpl.c
+++ b/src/H5Pdcpl.c
@@ -1977,13 +1977,6 @@ H5P__init_def_layout(void)
* Programmer: Robb Matzke
* Tuesday, January 6, 1998
*
- * Modifications:
- *
- * Raymond Lu
- * Tuesday, October 2, 2001
- * Changed the way to check parameter and set property for
- * generic property list.
- *
*-------------------------------------------------------------------------
*/
herr_t
@@ -2002,7 +1995,7 @@ H5Pset_layout(hid_t plist_id, H5D_layout_t layout_type)
/* Get the plist structure */
if (NULL == (plist = H5P_object_verify(plist_id, H5P_DATASET_CREATE)))
- HGOTO_ERROR(H5E_ATOM, H5E_BADATOM, FAIL, "can't find object for ID")
+ HGOTO_ERROR(H5E_ID, H5E_BADID, FAIL, "can't find object for ID")
#ifndef H5_HAVE_C99_DESIGNATED_INITIALIZER
/* If the compiler doesn't support C99 designated initializers, check if
@@ -2057,13 +2050,6 @@ done:
* Programmer: Robb Matzke
* Wednesday, January 7, 1998
*
- * Modifications:
- *
- * Raymond Lu
- * Tuesday, October 2, 2001
- * Changed the way to check parameter and get property for
- * generic property list.
- *
*-------------------------------------------------------------------------
*/
H5D_layout_t
@@ -2078,7 +2064,7 @@ H5Pget_layout(hid_t plist_id)
/* Get the plist structure */
if (NULL == (plist = H5P_object_verify(plist_id, H5P_DATASET_CREATE)))
- HGOTO_ERROR(H5E_ATOM, H5E_BADATOM, H5D_LAYOUT_ERROR, "can't find object for ID")
+ HGOTO_ERROR(H5E_ID, H5E_BADID, H5D_LAYOUT_ERROR, "can't find object for ID")
/* Peek at layout property */
if (H5P_peek(plist, H5D_CRT_LAYOUT_NAME, &layout) < 0)
@@ -2106,13 +2092,6 @@ done:
* Programmer: Robb Matzke
* Tuesday, January 6, 1998
*
- * Modifications:
- *
- * Raymond Lu
- * Tuesday, October 2, 2001
- * Changed the way to check parameter and set property for
- * generic property list.
- *
*-------------------------------------------------------------------------
*/
herr_t
@@ -2161,7 +2140,7 @@ H5Pset_chunk(hid_t plist_id, int ndims, const hsize_t dim[/*ndims*/])
/* Get the plist structure */
if (NULL == (plist = H5P_object_verify(plist_id, H5P_DATASET_CREATE)))
- HGOTO_ERROR(H5E_ATOM, H5E_BADATOM, FAIL, "can't find object for ID")
+ HGOTO_ERROR(H5E_ID, H5E_BADID, FAIL, "can't find object for ID")
/* Set chunk information in property list */
chunk_layout.u.chunk.ndims = (unsigned)ndims;
@@ -2187,13 +2166,6 @@ done:
* Programmer: Robb Matzke
* Wednesday, January 7, 1998
*
- * Modifications:
- *
- * Raymond Lu
- * Tuesday, October 2, 2001
- * Changed the way to check parameter and set property for
- * generic property list.
- *
*-------------------------------------------------------------------------
*/
int
@@ -2208,7 +2180,7 @@ H5Pget_chunk(hid_t plist_id, int max_ndims, hsize_t dim[] /*out*/)
/* Get the plist structure */
if (NULL == (plist = H5P_object_verify(plist_id, H5P_DATASET_CREATE)))
- HGOTO_ERROR(H5E_ATOM, H5E_BADATOM, FAIL, "can't find object for ID")
+ HGOTO_ERROR(H5E_ID, H5E_BADID, FAIL, "can't find object for ID")
/* Peek at the layout property */
if (H5P_peek(plist, H5D_CRT_LAYOUT_NAME, &layout) < 0)
@@ -2255,7 +2227,7 @@ herr_t
H5Pset_virtual(hid_t dcpl_id, hid_t vspace_id, const char *src_file_name, const char *src_dset_name,
hid_t src_space_id)
{
- H5P_genplist_t * plist; /* Property list pointer */
+ H5P_genplist_t * plist = NULL; /* Property list pointer */
H5O_layout_t virtual_layout; /* Layout information for setting virtual info */
H5S_t * vspace; /* Virtual dataset space selection */
H5S_t * src_space; /* Source dataset space selection */
@@ -2293,7 +2265,7 @@ H5Pset_virtual(hid_t dcpl_id, hid_t vspace_id, const char *src_file_name, const
/* Get the plist structure */
if (NULL == (plist = H5P_object_verify(dcpl_id, H5P_DATASET_CREATE)))
- HGOTO_ERROR(H5E_ATOM, H5E_BADATOM, FAIL, "can't find object for ID")
+ HGOTO_ERROR(H5E_ID, H5E_BADID, FAIL, "can't find object for ID")
/* Get the current layout */
if (H5P_peek(plist, H5D_CRT_LAYOUT_NAME, &virtual_layout) < 0)
@@ -2447,7 +2419,7 @@ H5Pget_virtual_count(hid_t dcpl_id, size_t *count /*out*/)
if (count) {
/* Get the plist structure */
if (NULL == (plist = H5P_object_verify(dcpl_id, H5P_DATASET_CREATE)))
- HGOTO_ERROR(H5E_ATOM, H5E_BADATOM, FAIL, "can't find object for ID")
+ HGOTO_ERROR(H5E_ID, H5E_BADID, FAIL, "can't find object for ID")
/* Retrieve the layout property */
if (H5P_peek(plist, H5D_CRT_LAYOUT_NAME, &layout) < 0)
@@ -2492,7 +2464,7 @@ H5Pget_virtual_vspace(hid_t dcpl_id, size_t idx)
/* Get the plist structure */
if (NULL == (plist = H5P_object_verify(dcpl_id, H5P_DATASET_CREATE)))
- HGOTO_ERROR(H5E_ATOM, H5E_BADATOM, FAIL, "can't find object for ID")
+ HGOTO_ERROR(H5E_ID, H5E_BADID, FAIL, "can't find object for ID")
/* Retrieve the layout property */
if (H5P_peek(plist, H5D_CRT_LAYOUT_NAME, &layout) < 0)
@@ -2509,7 +2481,7 @@ H5Pget_virtual_vspace(hid_t dcpl_id, size_t idx)
/* Register ID */
if ((ret_value = H5I_register(H5I_DATASPACE, space, TRUE)) < 0)
- HGOTO_ERROR(H5E_ATOM, H5E_CANTREGISTER, FAIL, "unable to register dataspace")
+ HGOTO_ERROR(H5E_ID, H5E_CANTREGISTER, FAIL, "unable to register dataspace")
done:
/* Free space on failure */
@@ -2549,7 +2521,7 @@ H5Pget_virtual_srcspace(hid_t dcpl_id, size_t idx)
/* Get the plist structure */
if (NULL == (plist = H5P_object_verify(dcpl_id, H5P_DATASET_CREATE)))
- HGOTO_ERROR(H5E_ATOM, H5E_BADATOM, FAIL, "can't find object for ID")
+ HGOTO_ERROR(H5E_ID, H5E_BADID, FAIL, "can't find object for ID")
/* Retrieve the layout property */
if (H5P_peek(plist, H5D_CRT_LAYOUT_NAME, &layout) < 0)
@@ -2600,7 +2572,7 @@ H5Pget_virtual_srcspace(hid_t dcpl_id, size_t idx)
/* Register ID */
if ((ret_value = H5I_register(H5I_DATASPACE, space, TRUE)) < 0)
- HGOTO_ERROR(H5E_ATOM, H5E_CANTREGISTER, FAIL, "unable to register dataspace")
+ HGOTO_ERROR(H5E_ID, H5E_CANTREGISTER, FAIL, "unable to register dataspace")
done:
/* Free space on failure */
@@ -2652,7 +2624,7 @@ H5Pget_virtual_filename(hid_t dcpl_id, size_t idx, char *name /*out*/, size_t si
/* Get the plist structure */
if (NULL == (plist = H5P_object_verify(dcpl_id, H5P_DATASET_CREATE)))
- HGOTO_ERROR(H5E_ATOM, H5E_BADATOM, FAIL, "can't find object for ID")
+ HGOTO_ERROR(H5E_ID, H5E_BADID, FAIL, "can't find object for ID")
/* Retrieve the layout property */
if (H5P_peek(plist, H5D_CRT_LAYOUT_NAME, &layout) < 0)
@@ -2713,7 +2685,7 @@ H5Pget_virtual_dsetname(hid_t dcpl_id, size_t idx, char *name /*out*/, size_t si
/* Get the plist structure */
if (NULL == (plist = H5P_object_verify(dcpl_id, H5P_DATASET_CREATE)))
- HGOTO_ERROR(H5E_ATOM, H5E_BADATOM, FAIL, "can't find object for ID")
+ HGOTO_ERROR(H5E_ID, H5E_BADID, FAIL, "can't find object for ID")
/* Retrieve the layout property */
if (H5P_peek(plist, H5D_CRT_LAYOUT_NAME, &layout) < 0)
@@ -2773,7 +2745,7 @@ H5Pset_chunk_opts(hid_t plist_id, unsigned options)
/* Get the plist structure */
if (NULL == (plist = H5P_object_verify(plist_id, H5P_DATASET_CREATE)))
- HGOTO_ERROR(H5E_ATOM, H5E_BADATOM, FAIL, "can't find object for ID")
+ HGOTO_ERROR(H5E_ID, H5E_BADID, FAIL, "can't find object for ID")
/* Retrieve the layout property */
if (H5P_peek(plist, H5D_CRT_LAYOUT_NAME, &layout) < 0)
@@ -2813,14 +2785,14 @@ done:
*-------------------------------------------------------------------------
*/
herr_t
-H5Pget_chunk_opts(hid_t plist_id, unsigned *options)
+H5Pget_chunk_opts(hid_t plist_id, unsigned *options /*out*/)
{
H5P_genplist_t *plist; /* Property list pointer */
H5O_layout_t layout; /* Layout information for setting chunk info */
herr_t ret_value = SUCCEED; /* Return value */
FUNC_ENTER_API(FAIL)
- H5TRACE2("e", "i*Iu", plist_id, options);
+ H5TRACE2("e", "ix", plist_id, options);
#ifndef H5_HAVE_C99_DESIGNATED_INITIALIZER
/* If the compiler doesn't support C99 designated initializers, check if
@@ -2833,7 +2805,7 @@ H5Pget_chunk_opts(hid_t plist_id, unsigned *options)
/* Get the plist structure */
if (NULL == (plist = H5P_object_verify(plist_id, H5P_DATASET_CREATE)))
- HGOTO_ERROR(H5E_ATOM, H5E_BADATOM, FAIL, "can't find object for ID")
+ HGOTO_ERROR(H5E_ID, H5E_BADID, FAIL, "can't find object for ID")
/* Retrieve the layout property */
if (H5P_peek(plist, H5D_CRT_LAYOUT_NAME, &layout) < 0)
@@ -2896,7 +2868,7 @@ H5Pset_external(hid_t plist_id, const char *name, off_t offset, hsize_t size)
/* Get the plist structure */
if (NULL == (plist = H5P_object_verify(plist_id, H5P_DATASET_CREATE)))
- HGOTO_ERROR(H5E_ATOM, H5E_BADATOM, FAIL, "can't find object for ID")
+ HGOTO_ERROR(H5E_ID, H5E_BADID, FAIL, "can't find object for ID")
if (H5P_peek(plist, H5D_CRT_EXT_FILE_LIST_NAME, &efl) < 0)
HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "can't get external file list")
@@ -2947,13 +2919,6 @@ done:
* Programmer: Robb Matzke
* Tuesday, March 3, 1998
*
- * Modifications:
- *
- * Raymond Lu
- * Tuesday, October 2, 2001
- * Changed the way to check parameter and set property for
- * generic property list.
- *
*-------------------------------------------------------------------------
*/
int
@@ -2968,7 +2933,7 @@ H5Pget_external_count(hid_t plist_id)
/* Get the plist structure */
if (NULL == (plist = H5P_object_verify(plist_id, H5P_DATASET_CREATE)))
- HGOTO_ERROR(H5E_ATOM, H5E_BADATOM, FAIL, "can't find object for ID")
+ HGOTO_ERROR(H5E_ID, H5E_BADID, FAIL, "can't find object for ID")
/* Get value */
if (H5P_peek(plist, H5D_CRT_EXT_FILE_LIST_NAME, &efl) < 0)
@@ -3003,13 +2968,6 @@ done:
* Programmer: Robb Matzke
* Tuesday, March 3, 1998
*
- * Modifications:
- *
- * Raymond Lu
- * Tuesday, October 2, 2001
- * Changed the way to check parameter and get property for
- * generic property list.
- *
*-------------------------------------------------------------------------
*/
herr_t
@@ -3025,7 +2983,7 @@ H5Pget_external(hid_t plist_id, unsigned idx, size_t name_size, char *name /*out
/* Get the plist structure */
if (NULL == (plist = H5P_object_verify(plist_id, H5P_DATASET_CREATE)))
- HGOTO_ERROR(H5E_ATOM, H5E_BADATOM, FAIL, "can't find object for ID")
+ HGOTO_ERROR(H5E_ID, H5E_BADID, FAIL, "can't find object for ID")
/* Get value */
if (H5P_peek(plist, H5D_CRT_EXT_FILE_LIST_NAME, &efl) < 0)
@@ -3088,7 +3046,7 @@ H5Pset_szip(hid_t plist_id, unsigned options_mask, unsigned pixels_per_block)
/* Get the plist structure */
if (NULL == (plist = H5P_object_verify(plist_id, H5P_DATASET_CREATE)))
- HGOTO_ERROR(H5E_ATOM, H5E_BADATOM, FAIL, "can't find object for ID")
+ HGOTO_ERROR(H5E_ID, H5E_BADID, FAIL, "can't find object for ID")
/* Always set K13 compression (and un-set CHIP compression) */
options_mask &= (unsigned)(~H5_SZIP_CHIP_OPTION_MASK);
@@ -3129,8 +3087,6 @@ done:
* Programmer: Kent Yang
* Wednesday, November 13, 2002
*
- * Modifications:
- *
*-------------------------------------------------------------------------
*/
herr_t
@@ -3149,7 +3105,7 @@ H5Pset_shuffle(hid_t plist_id)
/* Get the plist structure */
if (NULL == (plist = (H5P_genplist_t *)H5I_object(plist_id)))
- HGOTO_ERROR(H5E_ATOM, H5E_BADATOM, FAIL, "can't find object for ID")
+ HGOTO_ERROR(H5E_ID, H5E_BADID, FAIL, "can't find object for ID")
/* Add the filter */
if (H5P_peek(plist, H5O_CRT_PIPELINE_NAME, &pline) < 0)
@@ -3173,9 +3129,6 @@ done:
* Programmer: Xiaowen Wu
* Wednesday, December 22, 2004
*
- * Modifications:
- *
- *
*-------------------------------------------------------------------------
*/
herr_t
@@ -3194,7 +3147,7 @@ H5Pset_nbit(hid_t plist_id)
/* Get the plist structure */
if (NULL == (plist = (H5P_genplist_t *)H5I_object(plist_id)))
- HGOTO_ERROR(H5E_ATOM, H5E_BADATOM, FAIL, "can't find object for ID")
+ HGOTO_ERROR(H5E_ID, H5E_BADID, FAIL, "can't find object for ID")
/* Add the nbit filter */
if (H5P_peek(plist, H5O_CRT_PIPELINE_NAME, &pline) < 0)
@@ -3234,9 +3187,6 @@ done:
* Programmer: Xiaowen Wu
* Thursday, April 14, 2005
*
- * Modifications:
- *
- *
*-------------------------------------------------------------------------
*/
herr_t
@@ -3261,7 +3211,7 @@ H5Pset_scaleoffset(hid_t plist_id, H5Z_SO_scale_type_t scale_type, int scale_fac
/* Get the plist structure */
if (NULL == (plist = (H5P_genplist_t *)H5I_object(plist_id)))
- HGOTO_ERROR(H5E_ATOM, H5E_BADATOM, FAIL, "can't find object for ID")
+ HGOTO_ERROR(H5E_ID, H5E_BADID, FAIL, "can't find object for ID")
/* Set parameters for the filter
* scale_type = 0: floating-point type, filter uses variable-minimum-bits method,
@@ -3315,7 +3265,7 @@ H5Pset_fill_value(hid_t plist_id, hid_t type_id, const void *value)
/* Get the plist structure */
if (NULL == (plist = H5P_object_verify(plist_id, H5P_DATASET_CREATE)))
- HGOTO_ERROR(H5E_ATOM, H5E_BADATOM, FAIL, "can't find object for ID")
+ HGOTO_ERROR(H5E_ID, H5E_BADID, FAIL, "can't find object for ID")
/* Get the current fill value */
if (H5P_peek(plist, H5D_CRT_FILL_VALUE_NAME, &fill) < 0)
@@ -3504,7 +3454,7 @@ H5Pget_fill_value(hid_t plist_id, hid_t type_id, void *value /*out*/)
/* Get the plist structure */
if (NULL == (plist = H5P_object_verify(plist_id, H5P_DATASET_CREATE)))
- HGOTO_ERROR(H5E_ATOM, H5E_BADATOM, FAIL, "can't find object for ID")
+ HGOTO_ERROR(H5E_ID, H5E_BADID, FAIL, "can't find object for ID")
/* Get the fill value */
if (H5P_get_fill_value(plist, type, value) < 0)
@@ -3613,7 +3563,7 @@ H5Pfill_value_defined(hid_t plist_id, H5D_fill_value_t *status)
/* Get the plist structure */
if (NULL == (plist = H5P_object_verify(plist_id, H5P_DATASET_CREATE)))
- HGOTO_ERROR(H5E_ATOM, H5E_BADATOM, FAIL, "can't find object for ID")
+ HGOTO_ERROR(H5E_ID, H5E_BADID, FAIL, "can't find object for ID")
/* Get the fill-value status */
if (H5P_fill_value_defined(plist, status) < 0)
@@ -3635,9 +3585,6 @@ done:
* Programmer: Raymond Lu
* Wednesday, January 16, 2002
*
- * Modifications:
- *
- *
*-------------------------------------------------------------------------
*/
herr_t
@@ -3657,7 +3604,7 @@ H5Pset_alloc_time(hid_t plist_id, H5D_alloc_time_t alloc_time)
/* Get the property list structure */
if (NULL == (plist = H5P_object_verify(plist_id, H5P_DATASET_CREATE)))
- HGOTO_ERROR(H5E_ATOM, H5E_BADATOM, FAIL, "can't find object for ID")
+ HGOTO_ERROR(H5E_ID, H5E_BADID, FAIL, "can't find object for ID")
/* Check for resetting to default for layout type */
if (alloc_time == H5D_ALLOC_TIME_DEFAULT) {
@@ -3744,7 +3691,7 @@ H5Pget_alloc_time(hid_t plist_id, H5D_alloc_time_t *alloc_time /*out*/)
/* Get the property list structure */
if (NULL == (plist = H5P_object_verify(plist_id, H5P_DATASET_CREATE)))
- HGOTO_ERROR(H5E_ATOM, H5E_BADATOM, FAIL, "can't find object for ID")
+ HGOTO_ERROR(H5E_ID, H5E_BADID, FAIL, "can't find object for ID")
/* Retrieve fill value settings */
if (H5P_peek(plist, H5D_CRT_FILL_VALUE_NAME, &fill) < 0)
@@ -3787,7 +3734,7 @@ H5Pset_fill_time(hid_t plist_id, H5D_fill_time_t fill_time)
/* Get the property list structure */
if (NULL == (plist = H5P_object_verify(plist_id, H5P_DATASET_CREATE)))
- HGOTO_ERROR(H5E_ATOM, H5E_BADATOM, FAIL, "can't find object for ID")
+ HGOTO_ERROR(H5E_ID, H5E_BADID, FAIL, "can't find object for ID")
/* Retrieve previous fill value settings */
if (H5P_peek(plist, H5D_CRT_FILL_VALUE_NAME, &fill) < 0)
@@ -3815,9 +3762,6 @@ done:
* Programmer: Raymond Lu
* Wednesday, January 16, 2002
*
- * Modifications:
- *
- *
*-------------------------------------------------------------------------
*/
herr_t
@@ -3835,7 +3779,7 @@ H5Pget_fill_time(hid_t plist_id, H5D_fill_time_t *fill_time /*out*/)
/* Get the property list structure */
if (NULL == (plist = H5P_object_verify(plist_id, H5P_DATASET_CREATE)))
- HGOTO_ERROR(H5E_ATOM, H5E_BADATOM, FAIL, "can't find object for ID")
+ HGOTO_ERROR(H5E_ID, H5E_BADID, FAIL, "can't find object for ID")
/* Retrieve fill value settings */
if (H5P_peek(plist, H5D_CRT_FILL_VALUE_NAME, &fill) < 0)
@@ -3865,26 +3809,24 @@ done:
* Programmer: Jacob Smith
* 2018 August 14
*
- * Modifications: None.
- *
*-----------------------------------------------------------------------------
*/
herr_t
-H5Pget_dset_no_attrs_hint(hid_t dcpl_id, hbool_t *minimize)
+H5Pget_dset_no_attrs_hint(hid_t dcpl_id, hbool_t *minimize /*out*/)
{
hbool_t setting = FALSE;
H5P_genplist_t *plist = NULL;
herr_t ret_value = SUCCEED;
FUNC_ENTER_API(FAIL)
- H5TRACE2("e", "i*b", dcpl_id, minimize);
+ H5TRACE2("e", "ix", dcpl_id, minimize);
if (NULL == minimize)
HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "receiving pointer cannot be NULL")
plist = H5P_object_verify(dcpl_id, H5P_DATASET_CREATE);
if (NULL == plist)
- HGOTO_ERROR(H5E_ATOM, H5E_BADATOM, FAIL, "can't find object for ID")
+ HGOTO_ERROR(H5E_ID, H5E_BADID, FAIL, "can't find object for ID")
if (H5P_peek(plist, H5D_CRT_MIN_DSET_HDR_SIZE_NAME, &setting) < 0)
HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "can't get dset oh minimize flag value")
@@ -3911,8 +3853,6 @@ done:
* Programmer: Jacob Smith
* 2018 August 14
*
- * Modifications: None.
- *
*-----------------------------------------------------------------------------
*/
herr_t
@@ -3927,7 +3867,7 @@ H5Pset_dset_no_attrs_hint(hid_t dcpl_id, hbool_t minimize)
plist = H5P_object_verify(dcpl_id, H5P_DATASET_CREATE);
if (NULL == plist)
- HGOTO_ERROR(H5E_ATOM, H5E_BADATOM, FAIL, "can't find object for ID")
+ HGOTO_ERROR(H5E_ID, H5E_BADID, FAIL, "can't find object for ID")
if (H5P_peek(plist, H5D_CRT_MIN_DSET_HDR_SIZE_NAME, &prev_set) < 0)
HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "can't get extant dset oh minimize flag value")
diff --git a/src/H5Pdeprec.c b/src/H5Pdeprec.c
index 41eb05e..90c6c5d 100644
--- a/src/H5Pdeprec.c
+++ b/src/H5Pdeprec.c
@@ -15,7 +15,7 @@
*
* Created: H5Pdeprec.c
* October 11 2007
- * Quincey Koziol <koziol@hdfgroup.org>
+ * Quincey Koziol
*
* Purpose: Deprecated functions from the H5P interface. These
* functions are here for compatibility purposes and may be
@@ -459,7 +459,7 @@ H5Pget_version(hid_t plist_id, unsigned *super /*out*/, unsigned *freelist /*out
/* Get the plist structure */
if (NULL == (plist = H5P_object_verify(plist_id, H5P_FILE_CREATE)))
- HGOTO_ERROR(H5E_ATOM, H5E_BADATOM, FAIL, "can't find object for ID")
+ HGOTO_ERROR(H5E_ID, H5E_BADID, FAIL, "can't find object for ID")
/* Get values */
if (super)
@@ -606,7 +606,7 @@ done:
*-------------------------------------------------------------------------
*/
herr_t
-H5Pget_file_space(hid_t plist_id, H5F_file_space_type_t *strategy, hsize_t *threshold)
+H5Pget_file_space(hid_t plist_id, H5F_file_space_type_t *strategy /*out*/, hsize_t *threshold /*out*/)
{
H5F_fspace_strategy_t new_strategy; /* File space strategy type */
hbool_t new_persist; /* Persisting free-space or not */
@@ -614,7 +614,7 @@ H5Pget_file_space(hid_t plist_id, H5F_file_space_type_t *strategy, hsize_t *thre
herr_t ret_value = SUCCEED; /* Return value */
FUNC_ENTER_API(FAIL)
- H5TRACE3("e", "i*Ft*h", plist_id, strategy, threshold);
+ H5TRACE3("e", "ixx", plist_id, strategy, threshold);
/* Get current file space info */
if (H5Pget_file_space_strategy(plist_id, &new_strategy, &new_persist, &new_threshold) < 0)
diff --git a/src/H5Pdxpl.c b/src/H5Pdxpl.c
index 9c08727..70fc982 100644
--- a/src/H5Pdxpl.c
+++ b/src/H5Pdxpl.c
@@ -15,7 +15,7 @@
*
* Created: H5Pdxpl.c
* March 16 1998
- * Robb Matzke <matzke@llnl.gov>
+ * Robb Matzke
*
* Purpose: Data transfer property list class routines
*
@@ -782,7 +782,7 @@ done:
*
* Return: Success: SUCCEED, Failure: FAIL
*
- * Programmer: Leon Arber larber@uiuc.edu
+ * Programmer: Leon Arber
*
* Date: April 9, 2004
*
@@ -813,7 +813,7 @@ done:
*
* Return: Success: SUCCEED, Failure: FAIL
*
- * Programmer: Leon Arber larber@uiuc.edu
+ * Programmer: Leon Arber
*
* Date: April 9, 2004
*
@@ -903,7 +903,7 @@ done:
*
* Return: Success: SUCCEED, Failure: FAIL
*
- * Programmer: Leon Arber larber@uiuc.edu
+ * Programmer: Leon Arber
*
* Date: April 9, 2004
*
@@ -953,7 +953,7 @@ H5Pset_data_transform(hid_t plist_id, const char *expression)
/* Get the plist structure */
if (NULL == (plist = H5P_object_verify(plist_id, H5P_DATASET_XFER)))
- HGOTO_ERROR(H5E_ATOM, H5E_BADATOM, FAIL, "can't find object for ID")
+ HGOTO_ERROR(H5E_ID, H5E_BADID, FAIL, "can't find object for ID")
/* See if a data transform is already set, and free it if it is */
if (H5P_peek(plist, H5D_XFER_XFORM_NAME, &data_xform_prop) < 0)
@@ -1015,7 +1015,7 @@ H5Pget_data_transform(hid_t plist_id, char *expression /*out*/, size_t size)
/* Get the plist structure */
if (NULL == (plist = H5P_object_verify(plist_id, H5P_DATASET_XFER)))
- HGOTO_ERROR(H5E_ATOM, H5E_BADATOM, FAIL, "can't find object for ID")
+ HGOTO_ERROR(H5E_ID, H5E_BADID, FAIL, "can't find object for ID")
if (H5P_peek(plist, H5D_XFER_XFORM_NAME, &data_xform_prop) < 0)
HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "error getting data transform expression")
@@ -1077,7 +1077,7 @@ H5Pset_buffer(hid_t plist_id, size_t size, void *tconv, void *bkg)
/* Get the plist structure */
if (NULL == (plist = H5P_object_verify(plist_id, H5P_DATASET_XFER)))
- HGOTO_ERROR(H5E_ATOM, H5E_BADATOM, FAIL, "can't find object for ID")
+ HGOTO_ERROR(H5E_ID, H5E_BADID, FAIL, "can't find object for ID")
/* Update property list */
if (H5P_set(plist, H5D_XFER_MAX_TEMP_BUF_NAME, &size) < 0)
@@ -1117,7 +1117,7 @@ H5Pget_buffer(hid_t plist_id, void **tconv /*out*/, void **bkg /*out*/)
/* Get the plist structure */
if (NULL == (plist = H5P_object_verify(plist_id, H5P_DATASET_XFER)))
- HGOTO_ERROR(H5E_ATOM, H5E_BADATOM, 0, "can't find object for ID")
+ HGOTO_ERROR(H5E_ID, H5E_BADID, 0, "can't find object for ID")
/* Return values */
if (tconv)
@@ -1166,7 +1166,7 @@ H5Pset_preserve(hid_t plist_id, hbool_t status)
/* Get the plist structure */
if (NULL == (plist = H5P_object_verify(plist_id, H5P_DATASET_XFER)))
- HGOTO_ERROR(H5E_ATOM, H5E_BADATOM, FAIL, "can't find object for ID")
+ HGOTO_ERROR(H5E_ID, H5E_BADID, FAIL, "can't find object for ID")
/* Update property list */
need_bkg = status ? H5T_BKG_YES : H5T_BKG_NO;
@@ -1203,7 +1203,7 @@ H5Pget_preserve(hid_t plist_id)
/* Get the plist structure */
if (NULL == (plist = H5P_object_verify(plist_id, H5P_DATASET_XFER)))
- HGOTO_ERROR(H5E_ATOM, H5E_BADATOM, FAIL, "can't find object for ID")
+ HGOTO_ERROR(H5E_ID, H5E_BADID, FAIL, "can't find object for ID")
/* Get value */
if (H5P_get(plist, H5D_XFER_BKGR_BUF_TYPE_NAME, &need_bkg) < 0)
@@ -1246,7 +1246,7 @@ H5Pset_edc_check(hid_t plist_id, H5Z_EDC_t check)
/* Get the plist structure */
if (NULL == (plist = H5P_object_verify(plist_id, H5P_DATASET_XFER)))
- HGOTO_ERROR(H5E_ATOM, H5E_BADATOM, FAIL, "can't find object for ID")
+ HGOTO_ERROR(H5E_ID, H5E_BADID, FAIL, "can't find object for ID")
/* Update property list */
if (H5P_set(plist, H5D_XFER_EDC_NAME, &check) < 0)
@@ -1282,7 +1282,7 @@ H5Pget_edc_check(hid_t plist_id)
/* Get the plist structure */
if (NULL == (plist = H5P_object_verify(plist_id, H5P_DATASET_XFER)))
- HGOTO_ERROR(H5E_ATOM, H5E_BADATOM, H5Z_ERROR_EDC, "can't find object for ID")
+ HGOTO_ERROR(H5E_ID, H5E_BADID, H5Z_ERROR_EDC, "can't find object for ID")
/* Update property list */
if (H5P_get(plist, H5D_XFER_EDC_NAME, &ret_value) < 0)
@@ -1304,8 +1304,6 @@ done:
* Programmer: Raymond Lu
* Jan 14, 2003
*
- * Modifications:
- *
*-------------------------------------------------------------------------
*/
herr_t
@@ -1320,7 +1318,7 @@ H5Pset_filter_callback(hid_t plist_id, H5Z_filter_func_t func, void *op_data)
/* Get the plist structure */
if (NULL == (plist = H5P_object_verify(plist_id, H5P_DATASET_XFER)))
- HGOTO_ERROR(H5E_ATOM, H5E_BADATOM, FAIL, "can't find object for ID")
+ HGOTO_ERROR(H5E_ID, H5E_BADID, FAIL, "can't find object for ID")
/* Update property list */
cb_struct.func = func;
@@ -1345,8 +1343,6 @@ done:
* Programmer: Raymond Lu
* April 15, 2004
*
- * Modifications:
- *
*-------------------------------------------------------------------------
*/
herr_t
@@ -1361,7 +1357,7 @@ H5Pset_type_conv_cb(hid_t plist_id, H5T_conv_except_func_t op, void *operate_dat
/* Get the plist structure */
if (NULL == (plist = H5P_object_verify(plist_id, H5P_DATASET_XFER)))
- HGOTO_ERROR(H5E_ATOM, H5E_BADATOM, FAIL, "can't find object for ID")
+ HGOTO_ERROR(H5E_ID, H5E_BADID, FAIL, "can't find object for ID")
/* Update property list */
cb_struct.func = op;
@@ -1386,23 +1382,21 @@ done:
* Programmer: Raymond Lu
* April 15, 2004
*
- * Modifications:
- *
*-------------------------------------------------------------------------
*/
herr_t
-H5Pget_type_conv_cb(hid_t plist_id, H5T_conv_except_func_t *op, void **operate_data)
+H5Pget_type_conv_cb(hid_t plist_id, H5T_conv_except_func_t *op /*out*/, void **operate_data /*out*/)
{
H5P_genplist_t *plist; /* Property list pointer */
H5T_conv_cb_t cb_struct;
herr_t ret_value = SUCCEED; /* return value */
FUNC_ENTER_API(FAIL)
- H5TRACE3("e", "i*TE**x", plist_id, op, operate_data);
+ H5TRACE3("e", "ixx", plist_id, op, operate_data);
/* Get the plist structure */
if (NULL == (plist = H5P_object_verify(plist_id, H5P_DATASET_XFER)))
- HGOTO_ERROR(H5E_ATOM, H5E_BADATOM, FAIL, "can't find object for ID")
+ HGOTO_ERROR(H5E_ID, H5E_BADID, FAIL, "can't find object for ID")
/* Get property */
if (H5P_get(plist, H5D_XFER_CONV_CB_NAME, &cb_struct) < 0)
@@ -1443,7 +1437,7 @@ H5Pget_btree_ratios(hid_t plist_id, double *left /*out*/, double *middle /*out*/
/* Get the plist structure */
if (NULL == (plist = H5P_object_verify(plist_id, H5P_DATASET_XFER)))
- HGOTO_ERROR(H5E_ATOM, H5E_BADATOM, FAIL, "can't find object for ID")
+ HGOTO_ERROR(H5E_ID, H5E_BADID, FAIL, "can't find object for ID")
/* Get the split ratios */
if (H5P_get(plist, H5D_XFER_BTREE_SPLIT_RATIO_NAME, &btree_split_ratio) < 0)
@@ -1498,7 +1492,7 @@ H5Pset_btree_ratios(hid_t plist_id, double left, double middle, double right)
/* Get the plist structure */
if (NULL == (plist = H5P_object_verify(plist_id, H5P_DATASET_XFER)))
- HGOTO_ERROR(H5E_ATOM, H5E_BADATOM, FAIL, "can't find object for ID")
+ HGOTO_ERROR(H5E_ID, H5E_BADID, FAIL, "can't find object for ID")
/* Set values */
split_ratio[0] = left;
@@ -1621,7 +1615,7 @@ H5Pget_vlen_mem_manager(hid_t plist_id, H5MM_allocate_t *alloc_func /*out*/, voi
/* Get the plist structure */
if (NULL == (plist = H5P_object_verify(plist_id, H5P_DATASET_XFER)))
- HGOTO_ERROR(H5E_ATOM, H5E_BADATOM, FAIL, "can't find object for ID")
+ HGOTO_ERROR(H5E_ID, H5E_BADID, FAIL, "can't find object for ID")
if (alloc_func)
if (H5P_get(plist, H5D_XFER_VLEN_ALLOC_NAME, alloc_func) < 0)
@@ -1676,7 +1670,7 @@ H5Pset_hyper_vector_size(hid_t plist_id, size_t vector_size)
/* Get the plist structure */
if (NULL == (plist = H5P_object_verify(plist_id, H5P_DATASET_XFER)))
- HGOTO_ERROR(H5E_ATOM, H5E_BADATOM, FAIL, "can't find object for ID")
+ HGOTO_ERROR(H5E_ID, H5E_BADID, FAIL, "can't find object for ID")
/* Update property list */
if (H5P_set(plist, H5D_XFER_HYPER_VECTOR_SIZE_NAME, &vector_size) < 0)
@@ -1709,7 +1703,7 @@ H5Pget_hyper_vector_size(hid_t plist_id, size_t *vector_size /*out*/)
/* Get the plist structure */
if (NULL == (plist = H5P_object_verify(plist_id, H5P_DATASET_XFER)))
- HGOTO_ERROR(H5E_ATOM, H5E_BADATOM, FAIL, "can't find object for ID")
+ HGOTO_ERROR(H5E_ID, H5E_BADID, FAIL, "can't find object for ID")
/* Return values */
if (vector_size)
@@ -1951,17 +1945,18 @@ H5P__dxfr_mpio_chunk_opt_hard_dec(const void **_pp, void *_value)
*-------------------------------------------------------------------------
*/
herr_t
-H5Pget_mpio_actual_chunk_opt_mode(hid_t plist_id, H5D_mpio_actual_chunk_opt_mode_t *actual_chunk_opt_mode)
+H5Pget_mpio_actual_chunk_opt_mode(hid_t plist_id,
+ H5D_mpio_actual_chunk_opt_mode_t *actual_chunk_opt_mode /*out*/)
{
H5P_genplist_t *plist;
herr_t ret_value = SUCCEED; /* return value */
FUNC_ENTER_API(FAIL)
- H5TRACE2("e", "i*Do", plist_id, actual_chunk_opt_mode);
+ H5TRACE2("e", "ix", plist_id, actual_chunk_opt_mode);
/* Get the plist structure */
if (NULL == (plist = H5P_object_verify(plist_id, H5P_DATASET_XFER)))
- HGOTO_ERROR(H5E_ATOM, H5E_BADATOM, FAIL, "can't find object for ID")
+ HGOTO_ERROR(H5E_ID, H5E_BADID, FAIL, "can't find object for ID")
/* Return values */
if (actual_chunk_opt_mode)
@@ -1986,17 +1981,17 @@ done:
*-------------------------------------------------------------------------
*/
herr_t
-H5Pget_mpio_actual_io_mode(hid_t plist_id, H5D_mpio_actual_io_mode_t *actual_io_mode)
+H5Pget_mpio_actual_io_mode(hid_t plist_id, H5D_mpio_actual_io_mode_t *actual_io_mode /*out*/)
{
H5P_genplist_t *plist;
herr_t ret_value = SUCCEED; /* return value */
FUNC_ENTER_API(FAIL)
- H5TRACE2("e", "i*Di", plist_id, actual_io_mode);
+ H5TRACE2("e", "ix", plist_id, actual_io_mode);
/* Get the plist structure */
if (NULL == (plist = H5P_object_verify(plist_id, H5P_DATASET_XFER)))
- HGOTO_ERROR(H5E_ATOM, H5E_BADATOM, FAIL, "can't find object for ID")
+ HGOTO_ERROR(H5E_ID, H5E_BADID, FAIL, "can't find object for ID")
/* Return values */
if (actual_io_mode)
@@ -2019,18 +2014,18 @@ done:
*-------------------------------------------------------------------------
*/
herr_t
-H5Pget_mpio_no_collective_cause(hid_t plist_id, uint32_t *local_no_collective_cause,
- uint32_t *global_no_collective_cause)
+H5Pget_mpio_no_collective_cause(hid_t plist_id, uint32_t *local_no_collective_cause /*out*/,
+ uint32_t *global_no_collective_cause /*out*/)
{
H5P_genplist_t *plist;
herr_t ret_value = SUCCEED; /* return value */
FUNC_ENTER_API(FAIL)
- H5TRACE3("e", "i*Iu*Iu", plist_id, local_no_collective_cause, global_no_collective_cause);
+ H5TRACE3("e", "ixx", plist_id, local_no_collective_cause, global_no_collective_cause);
/* Get the plist structure */
if (NULL == (plist = H5P_object_verify(plist_id, H5P_DATASET_XFER)))
- HGOTO_ERROR(H5E_ATOM, H5E_BADATOM, FAIL, "can't find object for ID")
+ HGOTO_ERROR(H5E_ID, H5E_BADID, FAIL, "can't find object for ID")
/* Return values */
if (local_no_collective_cause)
diff --git a/src/H5Pencdec.c b/src/H5Pencdec.c
index b045210..5b0ecb6 100644
--- a/src/H5Pencdec.c
+++ b/src/H5Pencdec.c
@@ -11,7 +11,7 @@
* help@hdfgroup.org. *
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
-/* Programmer: Quincey Koziol <koziol@hdfgroup.org>
+/* Programmer: Quincey Koziol
*
* Purpose: Generic Property Functions
*/
diff --git a/src/H5Pfapl.c b/src/H5Pfapl.c
index f413bec..6f3884f 100644
--- a/src/H5Pfapl.c
+++ b/src/H5Pfapl.c
@@ -869,7 +869,7 @@ H5Pset_alignment(hid_t fapl_id, hsize_t threshold, hsize_t alignment)
/* Get the plist structure */
if (NULL == (plist = H5P_object_verify(fapl_id, H5P_FILE_ACCESS)))
- HGOTO_ERROR(H5E_ATOM, H5E_BADATOM, FAIL, "can't find object for ID")
+ HGOTO_ERROR(H5E_ID, H5E_BADID, FAIL, "can't find object for ID")
/* Set values */
if (H5P_set(plist, H5F_ACS_ALIGN_THRHD_NAME, &threshold) < 0)
@@ -906,7 +906,7 @@ H5Pget_alignment(hid_t fapl_id, hsize_t *threshold /*out*/, hsize_t *alignment /
/* Get the plist structure */
if (NULL == (plist = H5P_object_verify(fapl_id, H5P_FILE_ACCESS)))
- HGOTO_ERROR(H5E_ATOM, H5E_BADATOM, FAIL, "can't find object for ID")
+ HGOTO_ERROR(H5E_ID, H5E_BADID, FAIL, "can't find object for ID")
/* Get values */
if (threshold)
@@ -1547,7 +1547,7 @@ H5Pset_family_offset(hid_t fapl_id, hsize_t offset)
if (H5P_DEFAULT == fapl_id)
HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "can't modify default property list")
if (NULL == (plist = H5P_object_verify(fapl_id, H5P_FILE_ACCESS)))
- HGOTO_ERROR(H5E_ATOM, H5E_BADATOM, FAIL, "can't find object for ID")
+ HGOTO_ERROR(H5E_ID, H5E_BADID, FAIL, "can't find object for ID")
/* Set value */
if (H5P_set(plist, H5F_ACS_FAMILY_OFFSET_NAME, &offset) < 0)
@@ -1585,7 +1585,7 @@ H5Pget_family_offset(hid_t fapl_id, hsize_t *offset /*out*/)
if (H5P_DEFAULT == fapl_id)
HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "can't modify default property list")
if (NULL == (plist = H5P_object_verify(fapl_id, H5P_FILE_ACCESS)))
- HGOTO_ERROR(H5E_ATOM, H5E_BADATOM, FAIL, "can't find object for ID")
+ HGOTO_ERROR(H5E_ID, H5E_BADID, FAIL, "can't find object for ID")
/* Get value */
if (offset) {
@@ -1625,7 +1625,7 @@ H5Pset_multi_type(hid_t fapl_id, H5FD_mem_t type)
if (H5P_DEFAULT == fapl_id)
HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "can't modify default property list")
if (NULL == (plist = H5P_object_verify(fapl_id, H5P_FILE_ACCESS)))
- HGOTO_ERROR(H5E_ATOM, H5E_BADATOM, FAIL, "can't find object for ID")
+ HGOTO_ERROR(H5E_ID, H5E_BADID, FAIL, "can't find object for ID")
/* Set value */
if (H5P_set(plist, H5F_ACS_MULTI_TYPE_NAME, &type) < 0)
@@ -1663,7 +1663,7 @@ H5Pget_multi_type(hid_t fapl_id, H5FD_mem_t *type /*out*/)
if (H5P_DEFAULT == fapl_id)
HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "can't modify default property list")
if (NULL == (plist = H5P_object_verify(fapl_id, H5P_FILE_ACCESS)))
- HGOTO_ERROR(H5E_ATOM, H5E_BADATOM, FAIL, "can't find object for ID")
+ HGOTO_ERROR(H5E_ID, H5E_BADID, FAIL, "can't find object for ID")
/* Get value */
if (type) {
@@ -1714,7 +1714,7 @@ H5Pset_cache(hid_t plist_id, int H5_ATTR_UNUSED mdc_nelmts, size_t rdcc_nslots,
/* Get the plist structure */
if (NULL == (plist = H5P_object_verify(plist_id, H5P_FILE_ACCESS)))
- HGOTO_ERROR(H5E_ATOM, H5E_BADATOM, FAIL, "can't find object for ID")
+ HGOTO_ERROR(H5E_ID, H5E_BADID, FAIL, "can't find object for ID")
/* Set sizes */
if (H5P_set(plist, H5F_ACS_DATA_CACHE_NUM_SLOTS_NAME, &rdcc_nslots) < 0)
@@ -1756,7 +1756,7 @@ H5Pget_cache(hid_t plist_id, int *mdc_nelmts, size_t *rdcc_nslots /*out*/, size_
/* Get the plist structure */
if (NULL == (plist = H5P_object_verify(plist_id, H5P_FILE_ACCESS)))
- HGOTO_ERROR(H5E_ATOM, H5E_BADATOM, FAIL, "can't find object for ID")
+ HGOTO_ERROR(H5E_ID, H5E_BADID, FAIL, "can't find object for ID")
/* Get sizes */
@@ -1802,7 +1802,7 @@ H5Pset_mdc_image_config(hid_t plist_id, H5AC_cache_image_config_t *config_ptr)
/* Get the plist structure */
if (NULL == (plist = H5P_object_verify(plist_id, H5P_FILE_ACCESS)))
- HGOTO_ERROR(H5E_ATOM, H5E_BADATOM, FAIL, "can't find object for ID")
+ HGOTO_ERROR(H5E_ID, H5E_BADID, FAIL, "can't find object for ID")
/* validate the new configuration */
if (H5AC_validate_cache_image_config(config_ptr) < 0)
@@ -1849,7 +1849,7 @@ H5Pget_mdc_image_config(hid_t plist_id, H5AC_cache_image_config_t *config /*out*
/* Get the plist structure */
if (NULL == (plist = H5P_object_verify(plist_id, H5P_FILE_ACCESS)))
- HGOTO_ERROR(H5E_ATOM, H5E_BADATOM, FAIL, "can't find object for ID")
+ HGOTO_ERROR(H5E_ID, H5E_BADID, FAIL, "can't find object for ID")
/* validate the config ptr */
if (config == NULL)
@@ -1894,7 +1894,7 @@ H5Pset_mdc_config(hid_t plist_id, H5AC_cache_config_t *config_ptr)
/* Get the plist structure */
if (NULL == (plist = H5P_object_verify(plist_id, H5P_FILE_ACCESS)))
- HGOTO_ERROR(H5E_ATOM, H5E_BADATOM, FAIL, "can't find object for ID")
+ HGOTO_ERROR(H5E_ID, H5E_BADID, FAIL, "can't find object for ID")
/* validate the new configuration */
if (H5AC_validate_config(config_ptr) < 0)
@@ -1941,7 +1941,7 @@ H5Pget_mdc_config(hid_t plist_id, H5AC_cache_config_t *config /*out*/)
/* Get the plist structure */
if (NULL == (plist = H5P_object_verify(plist_id, H5P_FILE_ACCESS)))
- HGOTO_ERROR(H5E_ATOM, H5E_BADATOM, FAIL, "can't find object for ID")
+ HGOTO_ERROR(H5E_ID, H5E_BADID, FAIL, "can't find object for ID")
/* validate the config ptr */
if (config == NULL)
@@ -1997,7 +1997,7 @@ H5Pset_gc_references(hid_t plist_id, unsigned gc_ref)
/* Get the plist structure */
if (NULL == (plist = H5P_object_verify(plist_id, H5P_FILE_ACCESS)))
- HGOTO_ERROR(H5E_ATOM, H5E_BADATOM, FAIL, "can't find object for ID")
+ HGOTO_ERROR(H5E_ID, H5E_BADID, FAIL, "can't find object for ID")
/* Set values */
if (H5P_set(plist, H5F_ACS_GARBG_COLCT_REF_NAME, &gc_ref) < 0)
@@ -2031,7 +2031,7 @@ H5Pget_gc_references(hid_t plist_id, unsigned *gc_ref /*out*/)
/* Get the plist structure */
if (NULL == (plist = H5P_object_verify(plist_id, H5P_FILE_ACCESS)))
- HGOTO_ERROR(H5E_ATOM, H5E_BADATOM, FAIL, "can't find object for ID")
+ HGOTO_ERROR(H5E_ID, H5E_BADID, FAIL, "can't find object for ID")
/* Get values */
if (gc_ref)
@@ -2065,7 +2065,7 @@ H5Pset_fclose_degree(hid_t plist_id, H5F_close_degree_t degree)
/* Get the plist structure */
if (NULL == (plist = H5P_object_verify(plist_id, H5P_FILE_ACCESS)))
- HGOTO_ERROR(H5E_ATOM, H5E_BADATOM, FAIL, "can't find object for ID")
+ HGOTO_ERROR(H5E_ID, H5E_BADID, FAIL, "can't find object for ID")
/* Set values */
if (H5P_set(plist, H5F_ACS_CLOSE_DEGREE_NAME, &degree) < 0)
@@ -2098,7 +2098,7 @@ H5Pget_fclose_degree(hid_t plist_id, H5F_close_degree_t *degree /*out*/)
/* Get the plist structure */
if (NULL == (plist = H5P_object_verify(plist_id, H5P_FILE_ACCESS)))
- HGOTO_ERROR(H5E_ATOM, H5E_BADATOM, FAIL, "can't find object for ID")
+ HGOTO_ERROR(H5E_ID, H5E_BADID, FAIL, "can't find object for ID")
if (degree && H5P_get(plist, H5F_ACS_CLOSE_DEGREE_NAME, degree) < 0)
HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "can't get file close degree")
@@ -2140,7 +2140,7 @@ H5Pset_meta_block_size(hid_t plist_id, hsize_t size)
/* Get the plist structure */
if (NULL == (plist = H5P_object_verify(plist_id, H5P_FILE_ACCESS)))
- HGOTO_ERROR(H5E_ATOM, H5E_BADATOM, FAIL, "can't find object for ID")
+ HGOTO_ERROR(H5E_ID, H5E_BADID, FAIL, "can't find object for ID")
/* Set values */
if (H5P_set(plist, H5F_ACS_META_BLOCK_SIZE_NAME, &size) < 0)
@@ -2174,7 +2174,7 @@ H5Pget_meta_block_size(hid_t plist_id, hsize_t *size /*out*/)
/* Get the plist structure */
if (NULL == (plist = H5P_object_verify(plist_id, H5P_FILE_ACCESS)))
- HGOTO_ERROR(H5E_ATOM, H5E_BADATOM, FAIL, "can't find object for ID")
+ HGOTO_ERROR(H5E_ID, H5E_BADID, FAIL, "can't find object for ID")
/* Get values */
if (size) {
@@ -2219,7 +2219,7 @@ H5Pset_sieve_buf_size(hid_t plist_id, size_t size)
/* Get the plist structure */
if (NULL == (plist = H5P_object_verify(plist_id, H5P_FILE_ACCESS)))
- HGOTO_ERROR(H5E_ATOM, H5E_BADATOM, FAIL, "can't find object for ID")
+ HGOTO_ERROR(H5E_ID, H5E_BADID, FAIL, "can't find object for ID")
/* Set values */
if (H5P_set(plist, H5F_ACS_SIEVE_BUF_SIZE_NAME, &size) < 0)
@@ -2253,7 +2253,7 @@ H5Pget_sieve_buf_size(hid_t plist_id, size_t *size /*out*/)
/* Get the plist structure */
if (NULL == (plist = H5P_object_verify(plist_id, H5P_FILE_ACCESS)))
- HGOTO_ERROR(H5E_ATOM, H5E_BADATOM, FAIL, "can't find object for ID")
+ HGOTO_ERROR(H5E_ID, H5E_BADID, FAIL, "can't find object for ID")
/* Get values */
if (size)
@@ -2297,7 +2297,7 @@ H5Pset_small_data_block_size(hid_t plist_id, hsize_t size)
/* Get the plist structure */
if (NULL == (plist = H5P_object_verify(plist_id, H5P_FILE_ACCESS)))
- HGOTO_ERROR(H5E_ATOM, H5E_BADATOM, FAIL, "can't find object for ID")
+ HGOTO_ERROR(H5E_ID, H5E_BADID, FAIL, "can't find object for ID")
/* Set values */
if (H5P_set(plist, H5F_ACS_SDATA_BLOCK_SIZE_NAME, &size) < 0)
@@ -2331,7 +2331,7 @@ H5Pget_small_data_block_size(hid_t plist_id, hsize_t *size /*out*/)
/* Get the plist structure */
if (NULL == (plist = H5P_object_verify(plist_id, H5P_FILE_ACCESS)))
- HGOTO_ERROR(H5E_ATOM, H5E_BADATOM, FAIL, "can't find object for ID")
+ HGOTO_ERROR(H5E_ID, H5E_BADID, FAIL, "can't find object for ID")
/* Get values */
if (size) {
@@ -2472,7 +2472,7 @@ H5Pset_libver_bounds(hid_t plist_id, H5F_libver_t low, H5F_libver_t high)
/* Get the plist structure */
if (NULL == (plist = H5P_object_verify(plist_id, H5P_FILE_ACCESS)))
- HGOTO_ERROR(H5E_ATOM, H5E_BADATOM, FAIL, "can't find object for ID")
+ HGOTO_ERROR(H5E_ID, H5E_BADID, FAIL, "can't find object for ID")
/* Set values */
if (H5P_set(plist, H5F_ACS_LIBVER_LOW_BOUND_NAME, &low) < 0)
@@ -2507,7 +2507,7 @@ H5Pget_libver_bounds(hid_t plist_id, H5F_libver_t *low /*out*/, H5F_libver_t *hi
/* Get the plist structure */
if (NULL == (plist = H5P_object_verify(plist_id, H5P_FILE_ACCESS)))
- HGOTO_ERROR(H5E_ATOM, H5E_BADATOM, FAIL, "can't find object for ID")
+ HGOTO_ERROR(H5E_ID, H5E_BADID, FAIL, "can't find object for ID")
/* Get values */
if (low)
@@ -2549,7 +2549,7 @@ H5Pset_elink_file_cache_size(hid_t plist_id, unsigned efc_size)
/* Get the plist structure */
if (NULL == (plist = H5P_object_verify(plist_id, H5P_FILE_ACCESS)))
- HGOTO_ERROR(H5E_ATOM, H5E_BADATOM, FAIL, "can't find object for ID")
+ HGOTO_ERROR(H5E_ID, H5E_BADID, FAIL, "can't find object for ID")
/* Set value */
if (H5P_set(plist, H5F_ACS_EFC_SIZE_NAME, &efc_size) < 0)
@@ -2586,7 +2586,7 @@ H5Pget_elink_file_cache_size(hid_t plist_id, unsigned *efc_size /*out*/)
/* Get the plist structure */
if (NULL == (plist = H5P_object_verify(plist_id, H5P_FILE_ACCESS)))
- HGOTO_ERROR(H5E_ATOM, H5E_BADATOM, FAIL, "can't find object for ID")
+ HGOTO_ERROR(H5E_ID, H5E_BADID, FAIL, "can't find object for ID")
/* Get value */
if (efc_size)
@@ -2626,7 +2626,7 @@ H5Pset_file_image(hid_t fapl_id, void *buf_ptr, size_t buf_len)
/* Get the plist structure */
if (NULL == (fapl = H5P_object_verify(fapl_id, H5P_FILE_ACCESS)))
- HGOTO_ERROR(H5E_ATOM, H5E_BADATOM, FAIL, "can't find object for ID")
+ HGOTO_ERROR(H5E_ID, H5E_BADID, FAIL, "can't find object for ID")
/* Get old image info */
if (H5P_peek(fapl, H5F_ACS_FILE_IMAGE_INFO_NAME, &image_info) < 0)
@@ -2719,7 +2719,7 @@ H5Pget_file_image(hid_t fapl_id, void **buf /*out*/, size_t *buf_len /*out*/)
/* Get the plist structure */
if (NULL == (fapl = H5P_object_verify(fapl_id, H5P_FILE_ACCESS)))
- HGOTO_ERROR(H5E_ATOM, H5E_BADATOM, FAIL, "can't find object for ID")
+ HGOTO_ERROR(H5E_ID, H5E_BADID, FAIL, "can't find object for ID")
/* Get values */
if (H5P_peek(fapl, H5F_ACS_FILE_IMAGE_INFO_NAME, &image_info) < 0)
@@ -2794,7 +2794,7 @@ H5Pset_file_image_callbacks(hid_t fapl_id, H5FD_file_image_callbacks_t *callback
/* Get the plist structure */
if (NULL == (fapl = H5P_object_verify(fapl_id, H5P_FILE_ACCESS)))
- HGOTO_ERROR(H5E_ATOM, H5E_BADATOM, FAIL, "can't find object for ID")
+ HGOTO_ERROR(H5E_ID, H5E_BADID, FAIL, "can't find object for ID")
/* Get old info */
if (H5P_peek(fapl, H5F_ACS_FILE_IMAGE_INFO_NAME, &info) < 0)
@@ -2870,7 +2870,7 @@ H5Pget_file_image_callbacks(hid_t fapl_id, H5FD_file_image_callbacks_t *callback
/* Get the plist structure */
if (NULL == (fapl = H5P_object_verify(fapl_id, H5P_FILE_ACCESS)))
- HGOTO_ERROR(H5E_ATOM, H5E_BADATOM, FAIL, "can't find object for ID")
+ HGOTO_ERROR(H5E_ID, H5E_BADID, FAIL, "can't find object for ID")
/* Get old info */
if (H5P_peek(fapl, H5F_ACS_FILE_IMAGE_INFO_NAME, &info) < 0)
@@ -4198,7 +4198,7 @@ H5Pset_metadata_read_attempts(hid_t plist_id, unsigned attempts)
/* Get the plist structure */
if (NULL == (plist = H5P_object_verify(plist_id, H5P_FILE_ACCESS)))
- HGOTO_ERROR(H5E_ATOM, H5E_BADATOM, FAIL, "can't find object for ID")
+ HGOTO_ERROR(H5E_ID, H5E_BADID, FAIL, "can't find object for ID")
/* Set values */
if (H5P_set(plist, H5F_ACS_METADATA_READ_ATTEMPTS_NAME, &attempts) < 0)
@@ -4233,7 +4233,7 @@ H5Pget_metadata_read_attempts(hid_t plist_id, unsigned *attempts /*out*/)
/* Get the plist structure */
if (NULL == (plist = H5P_object_verify(plist_id, H5P_FILE_ACCESS)))
- HGOTO_ERROR(H5E_ATOM, H5E_BADATOM, FAIL, "can't find object for ID")
+ HGOTO_ERROR(H5E_ID, H5E_BADID, FAIL, "can't find object for ID")
/* Get the # of read attempts set */
if (H5P_get(plist, H5F_ACS_METADATA_READ_ATTEMPTS_NAME, attempts) < 0)
@@ -4277,7 +4277,7 @@ H5Pset_object_flush_cb(hid_t plist_id, H5F_flush_cb_t func, void *udata)
/* Get the plist structure */
if (NULL == (plist = H5P_object_verify(plist_id, H5P_FILE_ACCESS)))
- HGOTO_ERROR(H5E_ATOM, H5E_BADATOM, FAIL, "can't find object for ID")
+ HGOTO_ERROR(H5E_ID, H5E_BADID, FAIL, "can't find object for ID")
/* Update property list */
flush_info.func = func;
@@ -4315,7 +4315,7 @@ H5Pget_object_flush_cb(hid_t plist_id, H5F_flush_cb_t *func /*out*/, void **udat
/* Get the plist structure */
if (NULL == (plist = H5P_object_verify(plist_id, H5P_FILE_ACCESS)))
- HGOTO_ERROR(H5E_ATOM, H5E_BADATOM, FAIL, "can't find object for ID")
+ HGOTO_ERROR(H5E_ID, H5E_BADID, FAIL, "can't find object for ID")
/* Retrieve the callback function and user data */
if (H5P_get(plist, H5F_ACS_OBJECT_FLUSH_CB_NAME, &flush_info) < 0)
@@ -4663,7 +4663,7 @@ H5Pset_evict_on_close(hid_t fapl_id, hbool_t H5_ATTR_PARALLEL_UNUSED evict_on_cl
/* Get the plist structure */
if (NULL == (plist = (H5P_genplist_t *)H5I_object(fapl_id)))
- HGOTO_ERROR(H5E_ATOM, H5E_BADATOM, FAIL, "can't find object for ID")
+ HGOTO_ERROR(H5E_ID, H5E_BADID, FAIL, "can't find object for ID")
#ifndef H5_HAVE_PARALLEL
/* Set value */
@@ -4711,7 +4711,7 @@ H5Pget_evict_on_close(hid_t fapl_id, hbool_t *evict_on_close /*out*/)
/* Get the plist structure */
if (NULL == (plist = (H5P_genplist_t *)H5I_object(fapl_id)))
- HGOTO_ERROR(H5E_ATOM, H5E_BADATOM, FAIL, "can't find object for ID")
+ HGOTO_ERROR(H5E_ID, H5E_BADID, FAIL, "can't find object for ID")
if (H5P_get(plist, H5F_ACS_EVICT_ON_CLOSE_FLAG_NAME, evict_on_close) < 0)
HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "can't get evict on close property")
@@ -4756,7 +4756,7 @@ H5Pset_file_locking(hid_t fapl_id, hbool_t use_file_locking, hbool_t ignore_when
/* Get the plist structure */
if (NULL == (plist = (H5P_genplist_t *)H5I_object(fapl_id)))
- HGOTO_ERROR(H5E_ATOM, H5E_BADATOM, FAIL, "can't find object for ID")
+ HGOTO_ERROR(H5E_ID, H5E_BADID, FAIL, "can't find object for ID")
/* Set values */
if (H5P_set(plist, H5F_ACS_USE_FILE_LOCKING_NAME, &use_file_locking) < 0)
@@ -4798,7 +4798,7 @@ H5Pget_file_locking(hid_t fapl_id, hbool_t *use_file_locking /*out*/, hbool_t *i
/* Get the plist structure */
if (NULL == (plist = (H5P_genplist_t *)H5I_object(fapl_id)))
- HGOTO_ERROR(H5E_ATOM, H5E_BADATOM, FAIL, "can't find object for ID")
+ HGOTO_ERROR(H5E_ID, H5E_BADID, FAIL, "can't find object for ID")
/* Get values */
if (H5P_get(plist, H5F_ACS_USE_FILE_LOCKING_NAME, use_file_locking) < 0)
@@ -4929,7 +4929,7 @@ H5Pset_all_coll_metadata_ops(hid_t plist_id, hbool_t is_collective)
/* Get the plist structure */
if (NULL == (plist = (H5P_genplist_t *)H5I_object(plist_id)))
- HGOTO_ERROR(H5E_ATOM, H5E_BADATOM, FAIL, "can't find object for ID")
+ HGOTO_ERROR(H5E_ID, H5E_BADID, FAIL, "can't find object for ID")
/* Set values */
if (H5P_set(plist, H5_COLL_MD_READ_FLAG_NAME, &coll_meta_read) < 0)
@@ -4981,7 +4981,7 @@ H5Pget_all_coll_metadata_ops(hid_t plist_id, hbool_t *is_collective /*out*/)
/* Get the plist structure */
if (NULL == (plist = (H5P_genplist_t *)H5I_object(plist_id)))
- HGOTO_ERROR(H5E_ATOM, H5E_BADATOM, FAIL, "can't find object for ID")
+ HGOTO_ERROR(H5E_ID, H5E_BADID, FAIL, "can't find object for ID")
if (H5P_get(plist, H5_COLL_MD_READ_FLAG_NAME, &internal_flag) < 0)
HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "can't get core collective metadata read flag")
@@ -5024,7 +5024,7 @@ H5Pset_coll_metadata_write(hid_t plist_id, hbool_t is_collective)
/* Get the plist structure */
if (NULL == (plist = (H5P_genplist_t *)H5I_object(plist_id)))
- HGOTO_ERROR(H5E_ATOM, H5E_BADATOM, FAIL, "can't find object for ID")
+ HGOTO_ERROR(H5E_ID, H5E_BADID, FAIL, "can't find object for ID")
/* Set values */
if (H5P_set(plist, H5F_ACS_COLL_MD_WRITE_FLAG_NAME, &is_collective) < 0)
@@ -5061,7 +5061,7 @@ H5Pget_mpi_params(hid_t plist_id, MPI_Comm *comm /*out*/, MPI_Info *info /*out*/
/* Get the plist structure */
if (NULL == (plist = (H5P_genplist_t *)H5I_object(plist_id)))
- HGOTO_ERROR(H5E_ATOM, H5E_BADATOM, FAIL, "can't find object for ID")
+ HGOTO_ERROR(H5E_ID, H5E_BADID, FAIL, "can't find object for ID")
/* Get the properties */
if (H5P_get(plist, H5F_ACS_MPI_PARAMS_COMM_NAME, comm) < 0)
@@ -5104,7 +5104,7 @@ H5Pset_mpi_params(hid_t plist_id, MPI_Comm comm, MPI_Info info)
/* Get the plist structure */
if (NULL == (plist = (H5P_genplist_t *)H5I_object(plist_id)))
- HGOTO_ERROR(H5E_ATOM, H5E_BADATOM, FAIL, "can't find object for ID")
+ HGOTO_ERROR(H5E_ID, H5E_BADID, FAIL, "can't find object for ID")
/* Set values */
if (H5P_set(plist, H5F_ACS_MPI_PARAMS_COMM_NAME, &comm) < 0)
@@ -5511,7 +5511,7 @@ H5Pget_coll_metadata_write(hid_t plist_id, hbool_t *is_collective /*out*/)
/* Get the plist structure */
if (NULL == (plist = (H5P_genplist_t *)H5I_object(plist_id)))
- HGOTO_ERROR(H5E_ATOM, H5E_BADATOM, FAIL, "can't find object for ID")
+ HGOTO_ERROR(H5E_ID, H5E_BADID, FAIL, "can't find object for ID")
if (H5P_get(plist, H5F_ACS_COLL_MD_WRITE_FLAG_NAME, is_collective) < 0)
HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "can't get collective metadata write flag")
@@ -5546,7 +5546,7 @@ H5Pset_page_buffer_size(hid_t plist_id, size_t buf_size, unsigned min_meta_perc,
/* Get the plist structure */
if (NULL == (plist = H5P_object_verify(plist_id, H5P_FILE_ACCESS)))
- HGOTO_ERROR(H5E_ATOM, H5E_BADATOM, FAIL, "can't find object for ID")
+ HGOTO_ERROR(H5E_ID, H5E_BADID, FAIL, "can't find object for ID")
if (min_meta_perc > 100)
HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL,
@@ -5595,7 +5595,7 @@ H5Pget_page_buffer_size(hid_t plist_id, size_t *buf_size /*out*/, unsigned *min_
/* Get the plist structure */
if (NULL == (plist = H5P_object_verify(plist_id, H5P_FILE_ACCESS)))
- HGOTO_ERROR(H5E_ATOM, H5E_BADATOM, FAIL, "can't find object for ID")
+ HGOTO_ERROR(H5E_ID, H5E_BADID, FAIL, "can't find object for ID")
/* Get size */
@@ -5679,7 +5679,7 @@ H5Pset_vfd_swmr_config(hid_t plist_id, H5F_vfd_swmr_config_t *config_ptr)
/* Get the plist structure */
if (NULL == (plist = H5P_object_verify(plist_id, H5P_FILE_ACCESS)))
- HGOTO_ERROR(H5E_ATOM, H5E_BADATOM, FAIL, "can't find object for ID")
+ HGOTO_ERROR(H5E_ID, H5E_BADID, FAIL, "can't find object for ID")
/* Validate the input configuration */
@@ -5859,7 +5859,7 @@ H5Pget_vfd_swmr_config(hid_t plist_id, H5F_vfd_swmr_config_t *config_ptr)
/* Get the plist structure */
if (NULL == (plist = H5P_object_verify(plist_id, H5P_FILE_ACCESS)))
- HGOTO_ERROR(H5E_ATOM, H5E_BADATOM, FAIL, "can't find object for ID")
+ HGOTO_ERROR(H5E_ID, H5E_BADID, FAIL, "can't find object for ID")
/* Validate the config_ptr */
if (config_ptr == NULL)
diff --git a/src/H5Pfcpl.c b/src/H5Pfcpl.c
index 47a3cf7..b33fda2 100644
--- a/src/H5Pfcpl.c
+++ b/src/H5Pfcpl.c
@@ -15,7 +15,7 @@
*
* Created: H5Pfcpl.c
* January 6 1998
- * Robb Matzke <matzke@llnl.gov>
+ * Robb Matzke
*
* Purpose: File creation property list class routines
*
@@ -132,7 +132,7 @@
/********************/
/* Property class callbacks */
-static herr_t H5P_fcrt_reg_prop(H5P_genclass_t *pclass);
+static herr_t H5P__fcrt_reg_prop(H5P_genclass_t *pclass);
/* property callbacks */
static herr_t H5P__fcrt_btree_rank_enc(const void *value, void **_pp, size_t *size);
@@ -157,7 +157,7 @@ const H5P_libclass_t H5P_CLS_FCRT[1] = {{
&H5P_CLS_FILE_CREATE_g, /* Pointer to class */
&H5P_CLS_FILE_CREATE_ID_g, /* Pointer to class ID */
&H5P_LST_FILE_CREATE_ID_g, /* Pointer to default property list ID */
- H5P_fcrt_reg_prop, /* Default property registration routine */
+ H5P__fcrt_reg_prop, /* Default property registration routine */
NULL, /* Class creation callback */
NULL, /* Class creation callback info */
@@ -197,7 +197,7 @@ static const hsize_t H5F_def_free_space_threshold_g = H5F_CRT_FREE
static const hsize_t H5F_def_file_space_page_size_g = H5F_CRT_FILE_SPACE_PAGE_SIZE_DEF;
/*-------------------------------------------------------------------------
- * Function: H5P_fcrt_reg_prop
+ * Function: H5P__fcrt_reg_prop
*
* Purpose: Register the file creation property list class's properties
*
@@ -208,11 +208,11 @@ static const hsize_t H5F_def_file_space_page_size_g = H5F_CRT_FILE
*-------------------------------------------------------------------------
*/
static herr_t
-H5P_fcrt_reg_prop(H5P_genclass_t *pclass)
+H5P__fcrt_reg_prop(H5P_genclass_t *pclass)
{
herr_t ret_value = SUCCEED; /* Return value */
- FUNC_ENTER_NOAPI_NOINIT
+ FUNC_ENTER_STATIC
/* Register the user block size */
if (H5P__register_real(pclass, H5F_CRT_USER_BLOCK_NAME, H5F_CRT_USER_BLOCK_SIZE,
@@ -303,7 +303,7 @@ H5P_fcrt_reg_prop(H5P_genclass_t *pclass)
done:
FUNC_LEAVE_NOAPI(ret_value)
-} /* end H5P_fcrt_reg_prop() */
+} /* end H5P__fcrt_reg_prop() */
/*-------------------------------------------------------------------------
* Function: H5Pset_userblock
@@ -340,7 +340,7 @@ H5Pset_userblock(hid_t plist_id, hsize_t size)
/* Get the plist structure */
if (NULL == (plist = H5P_object_verify(plist_id, H5P_FILE_CREATE)))
- HGOTO_ERROR(H5E_ATOM, H5E_BADATOM, FAIL, "can't find object for ID")
+ HGOTO_ERROR(H5E_ID, H5E_BADID, FAIL, "can't find object for ID")
/* Set value */
if (H5P_set(plist, H5F_CRT_USER_BLOCK_NAME, &size) < 0)
@@ -363,25 +363,20 @@ done:
* Programmer: Robb Matzke
* Wednesday, January 7, 1998
*
- * Modifications:
- *
- * Raymond Lu, Oct 14, 2001
- * Changed to the new generic property list.
- *
*-------------------------------------------------------------------------
*/
herr_t
-H5Pget_userblock(hid_t plist_id, hsize_t *size)
+H5Pget_userblock(hid_t plist_id, hsize_t *size /*out*/)
{
H5P_genplist_t *plist; /* Property list pointer */
herr_t ret_value = SUCCEED; /* return value */
FUNC_ENTER_API(FAIL)
- H5TRACE2("e", "i*h", plist_id, size);
+ H5TRACE2("e", "ix", plist_id, size);
/* Get the plist structure */
if (NULL == (plist = H5P_object_verify(plist_id, H5P_FILE_CREATE)))
- HGOTO_ERROR(H5E_ATOM, H5E_BADATOM, FAIL, "can't find object for ID");
+ HGOTO_ERROR(H5E_ID, H5E_BADID, FAIL, "can't find object for ID");
/* Get value */
if (size)
@@ -427,7 +422,7 @@ H5Pset_sizes(hid_t plist_id, size_t sizeof_addr, size_t sizeof_size)
/* Get the plist structure */
if (NULL == (plist = H5P_object_verify(plist_id, H5P_FILE_CREATE)))
- HGOTO_ERROR(H5E_ATOM, H5E_BADATOM, FAIL, "can't find object for ID")
+ HGOTO_ERROR(H5E_ID, H5E_BADID, FAIL, "can't find object for ID")
/* Set value */
if (sizeof_addr) {
@@ -463,17 +458,17 @@ done:
*-------------------------------------------------------------------------
*/
herr_t
-H5Pget_sizes(hid_t plist_id, size_t *sizeof_addr, size_t *sizeof_size)
+H5Pget_sizes(hid_t plist_id, size_t *sizeof_addr /*out*/, size_t *sizeof_size /*out*/)
{
H5P_genplist_t *plist; /* Property list pointer */
herr_t ret_value = SUCCEED; /* return value */
FUNC_ENTER_API(FAIL)
- H5TRACE3("e", "i*z*z", plist_id, sizeof_addr, sizeof_size);
+ H5TRACE3("e", "ixx", plist_id, sizeof_addr, sizeof_size);
/* Get the plist structure */
if (NULL == (plist = H5P_object_verify(plist_id, H5P_FILE_CREATE)))
- HGOTO_ERROR(H5E_ATOM, H5E_BADATOM, FAIL, "can't find object for ID")
+ HGOTO_ERROR(H5E_ID, H5E_BADID, FAIL, "can't find object for ID")
/* Get values */
if (sizeof_addr) {
@@ -518,11 +513,6 @@ done:
* Programmer: Robb Matzke
* Tuesday, January 6, 1998
*
- * Modifications:
- *
- * Raymond Lu, Oct 14, 2001
- * Changed to the new generic property list.
- *
*-------------------------------------------------------------------------
*/
herr_t
@@ -537,7 +527,7 @@ H5Pset_sym_k(hid_t plist_id, unsigned ik, unsigned lk)
/* Get the plist structure */
if (NULL == (plist = H5P_object_verify(plist_id, H5P_FILE_CREATE)))
- HGOTO_ERROR(H5E_ATOM, H5E_BADATOM, FAIL, "can't find object for ID");
+ HGOTO_ERROR(H5E_ID, H5E_BADID, FAIL, "can't find object for ID");
/* Set values */
if (ik > 0) {
@@ -571,15 +561,10 @@ done:
* Programmer: Robb Matzke
* Wednesday, January 7, 1998
*
- * Modifications:
- *
- * Raymond Lu
- * Changed to the new generic property list.
- *
*-------------------------------------------------------------------------
*/
herr_t
-H5Pget_sym_k(hid_t plist_id, unsigned *ik /*out */, unsigned *lk /*out */)
+H5Pget_sym_k(hid_t plist_id, unsigned *ik /*out*/, unsigned *lk /*out*/)
{
unsigned btree_k[H5B_NUM_BTREE_ID];
H5P_genplist_t *plist; /* Property list pointer */
@@ -590,7 +575,7 @@ H5Pget_sym_k(hid_t plist_id, unsigned *ik /*out */, unsigned *lk /*out */)
/* Get the plist structure */
if (NULL == (plist = H5P_object_verify(plist_id, H5P_FILE_CREATE)))
- HGOTO_ERROR(H5E_ATOM, H5E_BADATOM, FAIL, "can't find object for ID");
+ HGOTO_ERROR(H5E_ID, H5E_BADID, FAIL, "can't find object for ID");
/* Get values */
if (ik) {
@@ -618,11 +603,6 @@ done:
* Programmer: Robb Matzke
* Tuesday, January 6, 1998
*
- * Modifications:
- *
- * Raymond Lu, Oct 14, 2001
- * Changed to the new generic property list.
- *
*-------------------------------------------------------------------------
*/
herr_t
@@ -644,7 +624,7 @@ H5Pset_istore_k(hid_t plist_id, unsigned ik)
/* Get the plist structure */
if (NULL == (plist = H5P_object_verify(plist_id, H5P_FILE_CREATE)))
- HGOTO_ERROR(H5E_ATOM, H5E_BADATOM, FAIL, "can't find object for ID");
+ HGOTO_ERROR(H5E_ID, H5E_BADID, FAIL, "can't find object for ID");
/* Set value */
if (H5P_get(plist, H5F_CRT_BTREE_RANK_NAME, btree_k) < 0)
@@ -671,15 +651,10 @@ done:
* Programmer: Robb Matzke
* Wednesday, January 7, 1998
*
- * Modifications:
- *
- * Raymond Lu, Oct 14, 2001
- * Changed to the new generic property list.
- *
*-------------------------------------------------------------------------
*/
herr_t
-H5Pget_istore_k(hid_t plist_id, unsigned *ik /*out */)
+H5Pget_istore_k(hid_t plist_id, unsigned *ik /*out*/)
{
unsigned btree_k[H5B_NUM_BTREE_ID];
H5P_genplist_t *plist; /* Property list pointer */
@@ -690,7 +665,7 @@ H5Pget_istore_k(hid_t plist_id, unsigned *ik /*out */)
/* Get the plist structure */
if (NULL == (plist = H5P_object_verify(plist_id, H5P_FILE_CREATE)))
- HGOTO_ERROR(H5E_ATOM, H5E_BADATOM, FAIL, "can't find object for ID");
+ HGOTO_ERROR(H5E_ID, H5E_BADID, FAIL, "can't find object for ID");
/* Get value */
if (ik) {
@@ -827,7 +802,7 @@ H5Pset_shared_mesg_nindexes(hid_t plist_id, unsigned nindexes)
/* Get the plist structure */
if (NULL == (plist = H5P_object_verify(plist_id, H5P_FILE_CREATE)))
- HGOTO_ERROR(H5E_ATOM, H5E_BADATOM, FAIL, "can't find object for ID");
+ HGOTO_ERROR(H5E_ID, H5E_BADID, FAIL, "can't find object for ID");
if (H5P_set(plist, H5F_CRT_SHMSG_NINDEXES_NAME, &nindexes) < 0)
HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "can't set number of indexes");
@@ -850,17 +825,17 @@ done:
*-------------------------------------------------------------------------
*/
herr_t
-H5Pget_shared_mesg_nindexes(hid_t plist_id, unsigned *nindexes)
+H5Pget_shared_mesg_nindexes(hid_t plist_id, unsigned *nindexes /*out*/)
{
H5P_genplist_t *plist; /* Property list pointer */
herr_t ret_value = SUCCEED; /* Return value */
FUNC_ENTER_API(FAIL)
- H5TRACE2("e", "i*Iu", plist_id, nindexes);
+ H5TRACE2("e", "ix", plist_id, nindexes);
/* Get the plist structure */
if (NULL == (plist = H5P_object_verify(plist_id, H5P_FILE_CREATE)))
- HGOTO_ERROR(H5E_ATOM, H5E_BADATOM, FAIL, "can't find object for ID");
+ HGOTO_ERROR(H5E_ID, H5E_BADID, FAIL, "can't find object for ID");
if (H5P_get(plist, H5F_CRT_SHMSG_NINDEXES_NAME, nindexes) < 0)
HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "can't get number of indexes");
@@ -904,7 +879,7 @@ H5Pset_shared_mesg_index(hid_t plist_id, unsigned index_num, unsigned mesg_type_
/* Get the plist structure */
if (NULL == (plist = H5P_object_verify(plist_id, H5P_FILE_CREATE)))
- HGOTO_ERROR(H5E_ATOM, H5E_BADATOM, FAIL, "can't find object for ID")
+ HGOTO_ERROR(H5E_ID, H5E_BADID, FAIL, "can't find object for ID")
/* Read the current number of indexes */
if (H5P_get(plist, H5F_CRT_SHMSG_NINDEXES_NAME, &nindexes) < 0)
@@ -949,8 +924,8 @@ done:
*-------------------------------------------------------------------------
*/
herr_t
-H5Pget_shared_mesg_index(hid_t plist_id, unsigned index_num, unsigned *mesg_type_flags,
- unsigned *min_mesg_size)
+H5Pget_shared_mesg_index(hid_t plist_id, unsigned index_num, unsigned *mesg_type_flags /*out*/,
+ unsigned *min_mesg_size /*out*/)
{
H5P_genplist_t *plist; /* Property list pointer */
unsigned nindexes; /* Number of SOHM indexes */
@@ -959,11 +934,11 @@ H5Pget_shared_mesg_index(hid_t plist_id, unsigned index_num, unsigned *mesg_type
herr_t ret_value = SUCCEED; /* Return value */
FUNC_ENTER_API(FAIL)
- H5TRACE4("e", "iIu*Iu*Iu", plist_id, index_num, mesg_type_flags, min_mesg_size);
+ H5TRACE4("e", "iIuxx", plist_id, index_num, mesg_type_flags, min_mesg_size);
/* Get the plist structure */
if (NULL == (plist = H5P_object_verify(plist_id, H5P_FILE_CREATE)))
- HGOTO_ERROR(H5E_ATOM, H5E_BADATOM, FAIL, "can't find object for ID")
+ HGOTO_ERROR(H5E_ID, H5E_BADID, FAIL, "can't find object for ID")
/* Read the current number of indexes */
if (H5P_get(plist, H5F_CRT_SHMSG_NINDEXES_NAME, &nindexes) < 0)
@@ -1219,7 +1194,7 @@ H5Pset_shared_mesg_phase_change(hid_t plist_id, unsigned max_list, unsigned min_
/* Get the plist structure */
if (NULL == (plist = H5P_object_verify(plist_id, H5P_FILE_CREATE)))
- HGOTO_ERROR(H5E_ATOM, H5E_BADATOM, FAIL, "can't find object for ID");
+ HGOTO_ERROR(H5E_ID, H5E_BADID, FAIL, "can't find object for ID");
if (H5P_set(plist, H5F_CRT_SHMSG_LIST_MAX_NAME, &max_list) < 0)
HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "can't set list maximum in property list");
@@ -1244,17 +1219,17 @@ done:
*-------------------------------------------------------------------------
*/
herr_t
-H5Pget_shared_mesg_phase_change(hid_t plist_id, unsigned *max_list, unsigned *min_btree)
+H5Pget_shared_mesg_phase_change(hid_t plist_id, unsigned *max_list /*out*/, unsigned *min_btree /*out*/)
{
H5P_genplist_t *plist; /* Property list pointer */
herr_t ret_value = SUCCEED; /* Return value */
FUNC_ENTER_API(FAIL)
- H5TRACE3("e", "i*Iu*Iu", plist_id, max_list, min_btree);
+ H5TRACE3("e", "ixx", plist_id, max_list, min_btree);
/* Get the plist structure */
if (NULL == (plist = H5P_object_verify(plist_id, H5P_FILE_CREATE)))
- HGOTO_ERROR(H5E_ATOM, H5E_BADATOM, FAIL, "can't find object for ID");
+ HGOTO_ERROR(H5E_ID, H5E_BADID, FAIL, "can't find object for ID");
/* Get value(s) */
if (max_list)
@@ -1297,7 +1272,7 @@ H5Pset_file_space_strategy(hid_t plist_id, H5F_fspace_strategy_t strategy, hbool
/* Get the plist structure */
if (NULL == (plist = H5P_object_verify(plist_id, H5P_FILE_CREATE)))
- HGOTO_ERROR(H5E_ATOM, H5E_BADATOM, FAIL, "can't find object for ID")
+ HGOTO_ERROR(H5E_ID, H5E_BADID, FAIL, "can't find object for ID")
/* Set value(s), if non-zero */
if (H5P_set(plist, H5F_CRT_FILE_SPACE_STRATEGY_NAME, &strategy) < 0)
@@ -1329,18 +1304,18 @@ done:
*-------------------------------------------------------------------------
*/
herr_t
-H5Pget_file_space_strategy(hid_t plist_id, H5F_fspace_strategy_t *strategy, hbool_t *persist,
- hsize_t *threshold)
+H5Pget_file_space_strategy(hid_t plist_id, H5F_fspace_strategy_t *strategy /*out*/, hbool_t *persist /*out*/,
+ hsize_t *threshold /*out*/)
{
H5P_genplist_t *plist; /* Property list pointer */
herr_t ret_value = SUCCEED; /* Return value */
FUNC_ENTER_API(FAIL)
- H5TRACE4("e", "i*Ff*b*h", plist_id, strategy, persist, threshold);
+ H5TRACE4("e", "ixxx", plist_id, strategy, persist, threshold);
/* Get the plist structure */
if (NULL == (plist = H5P_object_verify(plist_id, H5P_FILE_CREATE)))
- HGOTO_ERROR(H5E_ATOM, H5E_BADATOM, FAIL, "can't find object for ID")
+ HGOTO_ERROR(H5E_ID, H5E_BADID, FAIL, "can't find object for ID")
/* Get value(s) */
if (strategy)
@@ -1451,13 +1426,13 @@ H5Pset_file_space_page_size(hid_t plist_id, hsize_t fsp_size)
/* Get the plist structure */
if (NULL == (plist = H5P_object_verify(plist_id, H5P_FILE_CREATE)))
- HGOTO_ERROR(H5E_ATOM, H5E_BADATOM, FAIL, "can't find object for ID")
+ HGOTO_ERROR(H5E_ID, H5E_BADID, FAIL, "can't find object for ID")
if (fsp_size < H5F_FILE_SPACE_PAGE_SIZE_MIN)
- HGOTO_ERROR(H5E_ATOM, H5E_BADATOM, FAIL, "cannot set file space page size to less than 512")
+ HGOTO_ERROR(H5E_ID, H5E_BADID, FAIL, "cannot set file space page size to less than 512")
if (fsp_size > H5F_FILE_SPACE_PAGE_SIZE_MAX)
- HGOTO_ERROR(H5E_ATOM, H5E_BADATOM, FAIL, "cannot set file space page size to more than 1GB")
+ HGOTO_ERROR(H5E_ID, H5E_BADID, FAIL, "cannot set file space page size to more than 1GB")
/* Set the value*/
if (H5P_set(plist, H5F_CRT_FILE_SPACE_PAGE_SIZE_NAME, &fsp_size) < 0)
@@ -1480,17 +1455,17 @@ done:
*-------------------------------------------------------------------------
*/
herr_t
-H5Pget_file_space_page_size(hid_t plist_id, hsize_t *fsp_size)
+H5Pget_file_space_page_size(hid_t plist_id, hsize_t *fsp_size /*out*/)
{
H5P_genplist_t *plist; /* Property list pointer */
herr_t ret_value = SUCCEED; /* Return value */
FUNC_ENTER_API(FAIL)
- H5TRACE2("e", "i*h", plist_id, fsp_size);
+ H5TRACE2("e", "ix", plist_id, fsp_size);
/* Get the plist structure */
if (NULL == (plist = H5P_object_verify(plist_id, H5P_FILE_CREATE)))
- HGOTO_ERROR(H5E_ATOM, H5E_BADATOM, FAIL, "can't find object for ID")
+ HGOTO_ERROR(H5E_ID, H5E_BADID, FAIL, "can't find object for ID")
/* Get value */
if (fsp_size)
diff --git a/src/H5Pfmpl.c b/src/H5Pfmpl.c
index 78c4d56..b8dab90 100644
--- a/src/H5Pfmpl.c
+++ b/src/H5Pfmpl.c
@@ -15,7 +15,7 @@
*
* Created: H5Pmtpl.c
* November 1 2006
- * Quincey Koziol <koziol@hdfgroup.org>
+ * Quincey Koziol
*
* Purpose: File mount property list class routines
*
@@ -59,7 +59,7 @@
/********************/
/* Property class callbacks */
-static herr_t H5P_fmnt_reg_prop(H5P_genclass_t *pclass);
+static herr_t H5P__fmnt_reg_prop(H5P_genclass_t *pclass);
/*********************/
/* Package Variables */
@@ -74,7 +74,7 @@ const H5P_libclass_t H5P_CLS_FMNT[1] = {{
&H5P_CLS_FILE_MOUNT_g, /* Pointer to class */
&H5P_CLS_FILE_MOUNT_ID_g, /* Pointer to class ID */
&H5P_LST_FILE_MOUNT_ID_g, /* Pointer to default property list ID */
- H5P_fmnt_reg_prop, /* Default property registration routine */
+ H5P__fmnt_reg_prop, /* Default property registration routine */
NULL, /* Class creation callback */
NULL, /* Class creation callback info */
@@ -96,7 +96,7 @@ const H5P_libclass_t H5P_CLS_FMNT[1] = {{
static const hbool_t H5F_def_local_g = H5F_MNT_SYM_LOCAL_DEF; /* Whether symlinks are local to file */
/*-------------------------------------------------------------------------
- * Function: H5P_fmnt_reg_prop
+ * Function: H5P__fmnt_reg_prop
*
* Purpose: Register the file mount property list class's properties
*
@@ -107,11 +107,11 @@ static const hbool_t H5F_def_local_g = H5F_MNT_SYM_LOCAL_DEF; /* Whether symlink
*-------------------------------------------------------------------------
*/
static herr_t
-H5P_fmnt_reg_prop(H5P_genclass_t *pclass)
+H5P__fmnt_reg_prop(H5P_genclass_t *pclass)
{
herr_t ret_value = SUCCEED; /* Return value */
- FUNC_ENTER_NOAPI_NOINIT
+ FUNC_ENTER_STATIC
/* Register property of whether symlinks is local to file */
if (H5P__register_real(pclass, H5F_MNT_SYM_LOCAL_NAME, H5F_MNT_SYM_LOCAL_SIZE, &H5F_def_local_g, NULL,
@@ -120,4 +120,4 @@ H5P_fmnt_reg_prop(H5P_genclass_t *pclass)
done:
FUNC_LEAVE_NOAPI(ret_value)
-} /* end H5P_fmnt_reg_prop() */
+} /* end H5P__fmnt_reg_prop() */
diff --git a/src/H5Pgcpl.c b/src/H5Pgcpl.c
index c27ee9d..7d671c6 100644
--- a/src/H5Pgcpl.c
+++ b/src/H5Pgcpl.c
@@ -15,7 +15,7 @@
*
* Created: H5Pgcpl.c
* August 29 2006
- * Quincey Koziol <koziol@ncsa.uiuc.edu>
+ * Quincey Koziol
*
* Purpose: Group creation property list class routines
*
@@ -161,7 +161,7 @@ H5Pset_local_heap_size_hint(hid_t plist_id, size_t size_hint)
/* Get the plist structure */
if (NULL == (plist = H5P_object_verify(plist_id, H5P_GROUP_CREATE)))
- HGOTO_ERROR(H5E_ATOM, H5E_BADATOM, FAIL, "can't find object for ID")
+ HGOTO_ERROR(H5E_ID, H5E_BADID, FAIL, "can't find object for ID")
/* Get value */
if (H5P_get(plist, H5G_CRT_GROUP_INFO_NAME, &ginfo) < 0)
@@ -204,7 +204,7 @@ H5Pget_local_heap_size_hint(hid_t plist_id, size_t *size_hint /*out*/)
/* Get the plist structure */
if (NULL == (plist = H5P_object_verify(plist_id, H5P_GROUP_CREATE)))
- HGOTO_ERROR(H5E_ATOM, H5E_BADATOM, FAIL, "can't find object for ID")
+ HGOTO_ERROR(H5E_ID, H5E_BADID, FAIL, "can't find object for ID")
/* Get value */
if (H5P_get(plist, H5G_CRT_GROUP_INFO_NAME, &ginfo) < 0)
@@ -255,7 +255,7 @@ H5Pset_link_phase_change(hid_t plist_id, unsigned max_compact, unsigned min_dens
/* Get the plist structure */
if (NULL == (plist = H5P_object_verify(plist_id, H5P_GROUP_CREATE)))
- HGOTO_ERROR(H5E_ATOM, H5E_BADATOM, FAIL, "can't find object for ID")
+ HGOTO_ERROR(H5E_ID, H5E_BADID, FAIL, "can't find object for ID")
/* Get group info */
if (H5P_get(plist, H5G_CRT_GROUP_INFO_NAME, &ginfo) < 0)
@@ -304,7 +304,7 @@ H5Pget_link_phase_change(hid_t plist_id, unsigned *max_compact /*out*/, unsigned
/* Get the plist structure */
if (NULL == (plist = H5P_object_verify(plist_id, H5P_GROUP_CREATE)))
- HGOTO_ERROR(H5E_ATOM, H5E_BADATOM, FAIL, "can't find object for ID")
+ HGOTO_ERROR(H5E_ID, H5E_BADID, FAIL, "can't find object for ID")
/* Get group info */
if (H5P_get(plist, H5G_CRT_GROUP_INFO_NAME, &ginfo) < 0)
@@ -357,7 +357,7 @@ H5Pset_est_link_info(hid_t plist_id, unsigned est_num_entries, unsigned est_name
/* Get the plist structure */
if (NULL == (plist = H5P_object_verify(plist_id, H5P_GROUP_CREATE)))
- HGOTO_ERROR(H5E_ATOM, H5E_BADATOM, FAIL, "can't find object for ID")
+ HGOTO_ERROR(H5E_ID, H5E_BADID, FAIL, "can't find object for ID")
/* Get group info */
if (H5P_get(plist, H5G_CRT_GROUP_INFO_NAME, &ginfo) < 0)
@@ -406,7 +406,7 @@ H5Pget_est_link_info(hid_t plist_id, unsigned *est_num_entries /*out*/, unsigned
/* Get the plist structure */
if (NULL == (plist = H5P_object_verify(plist_id, H5P_GROUP_CREATE)))
- HGOTO_ERROR(H5E_ATOM, H5E_BADATOM, FAIL, "can't find object for ID")
+ HGOTO_ERROR(H5E_ID, H5E_BADID, FAIL, "can't find object for ID")
/* Get group info */
if (H5P_get(plist, H5G_CRT_GROUP_INFO_NAME, &ginfo) < 0)
@@ -449,7 +449,7 @@ H5Pset_link_creation_order(hid_t plist_id, unsigned crt_order_flags)
/* Get the plist structure */
if (NULL == (plist = H5P_object_verify(plist_id, H5P_GROUP_CREATE)))
- HGOTO_ERROR(H5E_ATOM, H5E_BADATOM, FAIL, "can't find object for ID")
+ HGOTO_ERROR(H5E_ID, H5E_BADID, FAIL, "can't find object for ID")
/* Get link info */
if (H5P_get(plist, H5G_CRT_LINK_INFO_NAME, &linfo) < 0)
@@ -497,7 +497,7 @@ H5Pget_link_creation_order(hid_t plist_id, unsigned *crt_order_flags /*out*/)
/* Get the plist structure */
if (NULL == (plist = H5P_object_verify(plist_id, H5P_GROUP_CREATE)))
- HGOTO_ERROR(H5E_ATOM, H5E_BADATOM, FAIL, "can't find object for ID")
+ HGOTO_ERROR(H5E_ID, H5E_BADID, FAIL, "can't find object for ID")
/* Get link info */
if (H5P_get(plist, H5G_CRT_LINK_INFO_NAME, &linfo) < 0)
diff --git a/src/H5Pint.c b/src/H5Pint.c
index 5fd811c..4215ccb 100644
--- a/src/H5Pint.c
+++ b/src/H5Pint.c
@@ -11,7 +11,7 @@
* help@hdfgroup.org. *
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
-/* Programmer: Quincey Koziol <koziol@ncsa.uiuc.edu>
+/* Programmer: Quincey Koziol
*
* Purpose: Generic Property Functions
*/
@@ -459,9 +459,9 @@ H5P__init_package(void)
* Initialize the Generic Property class & object groups.
*/
if (H5I_register_type(H5I_GENPROPCLS_CLS) < 0)
- HGOTO_ERROR(H5E_ATOM, H5E_CANTINIT, FAIL, "unable to initialize ID group")
+ HGOTO_ERROR(H5E_ID, H5E_CANTINIT, FAIL, "unable to initialize ID group")
if (H5I_register_type(H5I_GENPROPLST_CLS) < 0)
- HGOTO_ERROR(H5E_ATOM, H5E_CANTINIT, FAIL, "unable to initialize ID group")
+ HGOTO_ERROR(H5E_ID, H5E_CANTINIT, FAIL, "unable to initialize ID group")
/* Repeatedly pass over the list of property list classes for the library,
* initializing each class if its parent class is initialized, until no
@@ -533,7 +533,7 @@ done:
RETURNS
Non-negative on success/Negative on failure
DESCRIPTION
- Release the atom group and any other resources allocated.
+ Release the ID group and any other resources allocated.
GLOBAL VARIABLES
COMMENTS, BUGS, ASSUMPTIONS
Can't report errors...
@@ -950,9 +950,9 @@ H5P_copy_plist(const H5P_genplist_t *old_plist, hbool_t app_ref)
if (H5P__access_class(new_plist->pclass, H5P_MOD_INC_LST) < 0)
HGOTO_ERROR(H5E_PLIST, H5E_CANTINIT, H5I_INVALID_HID, "Can't increment class ref count")
- /* Get an atom for the property list */
+ /* Get an ID for the property list */
if ((new_plist_id = H5I_register(H5I_GENPROP_LST, new_plist, app_ref)) < 0)
- HGOTO_ERROR(H5E_PLIST, H5E_CANTREGISTER, H5I_INVALID_HID, "unable to atomize property list")
+ HGOTO_ERROR(H5E_PLIST, H5E_CANTREGISTER, H5I_INVALID_HID, "unable to register property list")
/* Save the property list ID in the property list struct, for use in the property class's 'close' callback
*/
@@ -1855,9 +1855,9 @@ H5P_create_id(H5P_genclass_t *pclass, hbool_t app_ref)
if ((plist = H5P__create(pclass)) == NULL)
HGOTO_ERROR(H5E_PLIST, H5E_CANTCREATE, H5I_INVALID_HID, "unable to create property list")
- /* Get an atom for the property list */
+ /* Get an ID for the property list */
if ((plist_id = H5I_register(H5I_GENPROP_LST, plist, app_ref)) < 0)
- HGOTO_ERROR(H5E_PLIST, H5E_CANTREGISTER, H5I_INVALID_HID, "unable to atomize property list")
+ HGOTO_ERROR(H5E_PLIST, H5E_CANTREGISTER, H5I_INVALID_HID, "unable to register property list")
/* Save the property list ID in the property list struct, for use in the property class's 'close' callback
*/
@@ -3992,7 +3992,7 @@ H5P_object_verify(hid_t plist_id, hid_t pclass_id)
/* Get the plist structure */
if (NULL == (ret_value = (H5P_genplist_t *)H5I_object(plist_id)))
- HGOTO_ERROR(H5E_ATOM, H5E_BADATOM, NULL, "can't find object for ID")
+ HGOTO_ERROR(H5E_ID, H5E_BADID, NULL, "can't find object for ID")
done:
FUNC_LEAVE_NOAPI(ret_value)
@@ -5560,7 +5560,7 @@ done:
* Return: Success: Non-negative ID of property list.
* Failure: H5I_INVALID_HID
*
- * Programmer: Quincey Koziol <koziol@hdfgroup.org>
+ * Programmer: Quincey Koziol
* April 22, 2014
*
*-------------------------------------------------------------------------
@@ -5587,7 +5587,7 @@ H5P_get_plist_id(const H5P_genplist_t *plist)
* Return: Success: Non-NULL class of property list.
* Failure: NULL
*
- * Programmer: Quincey Koziol <koziol@hdfgroup.org>
+ * Programmer: Quincey Koziol
* April 22, 2014
*
*-------------------------------------------------------------------------
diff --git a/src/H5Plapl.c b/src/H5Plapl.c
index b1722bc..879e6ed 100644
--- a/src/H5Plapl.c
+++ b/src/H5Plapl.c
@@ -15,7 +15,7 @@
*
* Created: H5Plapl.c
* July 14 2006
- * James Laird <jlaird@ncsa.uiuc.edu>
+ * James Laird
*
* Purpose: Link access property list class routines
*
@@ -478,7 +478,7 @@ H5P__lacc_elink_fapl_del(hid_t H5_ATTR_UNUSED prop_id, const char H5_ATTR_UNUSED
/* Close the FAPL */
if (l_fapl_id != H5P_DEFAULT && H5I_dec_ref(l_fapl_id) < 0)
- HGOTO_ERROR(H5E_PLIST, H5E_CANTRELEASE, FAIL, "unable to close atom for file access property list")
+ HGOTO_ERROR(H5E_PLIST, H5E_CANTRELEASE, FAIL, "unable to close ID for file access property list")
done:
FUNC_LEAVE_NOAPI(ret_value)
@@ -604,7 +604,7 @@ H5P__lacc_elink_fapl_close(const char H5_ATTR_UNUSED *name, size_t H5_ATTR_UNUSE
/* Close the FAPL */
if ((l_fapl_id > H5P_DEFAULT) && (H5I_dec_ref(l_fapl_id) < 0))
- HGOTO_ERROR(H5E_PLIST, H5E_CANTRELEASE, FAIL, "unable to close atom for file access property list")
+ HGOTO_ERROR(H5E_PLIST, H5E_CANTRELEASE, FAIL, "unable to close ID for file access property list")
done:
FUNC_LEAVE_NOAPI(ret_value)
@@ -919,7 +919,7 @@ H5Pset_nlinks(hid_t plist_id, size_t nlinks)
/* Get the plist structure */
if (NULL == (plist = H5P_object_verify(plist_id, H5P_LINK_ACCESS)))
- HGOTO_ERROR(H5E_ATOM, H5E_BADATOM, FAIL, "can't find object for ID")
+ HGOTO_ERROR(H5E_ID, H5E_BADID, FAIL, "can't find object for ID")
/* Set number of links */
if (H5P_set(plist, H5L_ACS_NLINKS_NAME, &nlinks) < 0)
@@ -946,20 +946,20 @@ done:
*-------------------------------------------------------------------------
*/
herr_t
-H5Pget_nlinks(hid_t plist_id, size_t *nlinks)
+H5Pget_nlinks(hid_t plist_id, size_t *nlinks /*out*/)
{
H5P_genplist_t *plist; /* Property list pointer */
herr_t ret_value = SUCCEED; /* Return value */
FUNC_ENTER_API(FAIL)
- H5TRACE2("e", "i*z", plist_id, nlinks);
+ H5TRACE2("e", "ix", plist_id, nlinks);
if (!nlinks)
HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "invalid pointer passed in");
/* Get the plist structure */
if (NULL == (plist = H5P_object_verify(plist_id, H5P_LINK_ACCESS)))
- HGOTO_ERROR(H5E_ATOM, H5E_BADATOM, FAIL, "can't find object for ID")
+ HGOTO_ERROR(H5E_ID, H5E_BADID, FAIL, "can't find object for ID")
/* Get the current number of links */
if (H5P_get(plist, H5L_ACS_NLINKS_NAME, nlinks) < 0)
@@ -994,7 +994,7 @@ H5Pset_elink_prefix(hid_t plist_id, const char *prefix)
/* Get the plist structure */
if (NULL == (plist = H5P_object_verify(plist_id, H5P_LINK_ACCESS)))
- HGOTO_ERROR(H5E_ATOM, H5E_BADATOM, FAIL, "can't find object for ID")
+ HGOTO_ERROR(H5E_ID, H5E_BADID, FAIL, "can't find object for ID")
/* Set prefix */
if (H5P_set(plist, H5L_ACS_ELINK_PREFIX_NAME, &prefix) < 0)
@@ -1021,7 +1021,7 @@ done:
*-------------------------------------------------------------------------
*/
ssize_t
-H5Pget_elink_prefix(hid_t plist_id, char *prefix, size_t size)
+H5Pget_elink_prefix(hid_t plist_id, char *prefix /*out*/, size_t size)
{
H5P_genplist_t *plist; /* Property list pointer */
char * my_prefix; /* Library's copy of the prefix */
@@ -1029,11 +1029,11 @@ H5Pget_elink_prefix(hid_t plist_id, char *prefix, size_t size)
ssize_t ret_value; /* Return value */
FUNC_ENTER_API(FAIL)
- H5TRACE3("Zs", "i*sz", plist_id, prefix, size);
+ H5TRACE3("Zs", "ixz", plist_id, prefix, size);
/* Get the plist structure */
if (NULL == (plist = H5P_object_verify(plist_id, H5P_LINK_ACCESS)))
- HGOTO_ERROR(H5E_ATOM, H5E_BADATOM, FAIL, "can't find object for ID")
+ HGOTO_ERROR(H5E_ID, H5E_BADID, FAIL, "can't find object for ID")
/* Get the current prefix */
if (H5P_peek(plist, H5L_ACS_ELINK_PREFIX_NAME, &my_prefix) < 0)
@@ -1116,7 +1116,7 @@ H5Pget_elink_fapl(hid_t lapl_id)
/* Get the plist structure */
if (NULL == (plist = H5P_object_verify(lapl_id, H5P_LINK_ACCESS)))
- HGOTO_ERROR(H5E_ATOM, H5E_BADATOM, FAIL, "can't find object for ID")
+ HGOTO_ERROR(H5E_ID, H5E_BADID, FAIL, "can't find object for ID")
if (H5P_get(plist, H5L_ACS_ELINK_FAPL_NAME, &ret_value) < 0)
HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "can't get fapl for links")
@@ -1156,7 +1156,7 @@ H5Pset_elink_acc_flags(hid_t lapl_id, unsigned flags)
/* Get the plist structure */
if (NULL == (plist = H5P_object_verify(lapl_id, H5P_LINK_ACCESS)))
- HGOTO_ERROR(H5E_ATOM, H5E_BADATOM, FAIL, "can't find object for ID")
+ HGOTO_ERROR(H5E_ID, H5E_BADID, FAIL, "can't find object for ID")
/* Set flags */
if (H5P_set(plist, H5L_ACS_ELINK_FLAGS_NAME, &flags) < 0)
@@ -1180,17 +1180,17 @@ done:
*-------------------------------------------------------------------------
*/
herr_t
-H5Pget_elink_acc_flags(hid_t lapl_id, unsigned *flags)
+H5Pget_elink_acc_flags(hid_t lapl_id, unsigned *flags /*out*/)
{
H5P_genplist_t *plist; /* Property list pointer */
herr_t ret_value = SUCCEED; /* Return value */
FUNC_ENTER_API(FAIL)
- H5TRACE2("e", "i*Iu", lapl_id, flags);
+ H5TRACE2("e", "ix", lapl_id, flags);
/* Get the plist structure */
if (NULL == (plist = H5P_object_verify(lapl_id, H5P_LINK_ACCESS)))
- HGOTO_ERROR(H5E_ATOM, H5E_BADATOM, FAIL, "can't find object for ID")
+ HGOTO_ERROR(H5E_ID, H5E_BADID, FAIL, "can't find object for ID")
/* Get flags */
if (flags)
@@ -1232,7 +1232,7 @@ H5Pset_elink_cb(hid_t lapl_id, H5L_elink_traverse_t func, void *op_data)
/* Get the plist structure */
if (NULL == (plist = H5P_object_verify(lapl_id, H5P_LINK_ACCESS)))
- HGOTO_ERROR(H5E_ATOM, H5E_BADATOM, FAIL, "can't find object for ID")
+ HGOTO_ERROR(H5E_ID, H5E_BADID, FAIL, "can't find object for ID")
/* Populate the callback info struct */
cb_info.func = func;
@@ -1260,18 +1260,18 @@ done:
*-------------------------------------------------------------------------
*/
herr_t
-H5Pget_elink_cb(hid_t lapl_id, H5L_elink_traverse_t *func, void **op_data)
+H5Pget_elink_cb(hid_t lapl_id, H5L_elink_traverse_t *func /*out*/, void **op_data /*out*/)
{
H5P_genplist_t *plist; /* Property list pointer */
H5L_elink_cb_t cb_info; /* Callback info struct */
herr_t ret_value = SUCCEED; /* Return value */
FUNC_ENTER_API(FAIL)
- H5TRACE3("e", "i*Lt**x", lapl_id, func, op_data);
+ H5TRACE3("e", "ixx", lapl_id, func, op_data);
/* Get the plist structure */
if (NULL == (plist = H5P_object_verify(lapl_id, H5P_LINK_ACCESS)))
- HGOTO_ERROR(H5E_ATOM, H5E_BADATOM, FAIL, "can't find object for ID")
+ HGOTO_ERROR(H5E_ID, H5E_BADID, FAIL, "can't find object for ID")
/* Get callback_info */
if (H5P_get(plist, H5L_ACS_ELINK_CB_NAME, &cb_info) < 0)
diff --git a/src/H5Plcpl.c b/src/H5Plcpl.c
index 9261244..92077d1 100644
--- a/src/H5Plcpl.c
+++ b/src/H5Plcpl.c
@@ -59,7 +59,7 @@
/********************/
/* Property class callbacks */
-static herr_t H5P_lcrt_reg_prop(H5P_genclass_t *pclass);
+static herr_t H5P__lcrt_reg_prop(H5P_genclass_t *pclass);
/*********************/
/* Package Variables */
@@ -74,7 +74,7 @@ const H5P_libclass_t H5P_CLS_LCRT[1] = {{
&H5P_CLS_LINK_CREATE_g, /* Pointer to class */
&H5P_CLS_LINK_CREATE_ID_g, /* Pointer to class ID */
&H5P_LST_LINK_CREATE_ID_g, /* Pointer to default property list ID */
- H5P_lcrt_reg_prop, /* Default property registration routine */
+ H5P__lcrt_reg_prop, /* Default property registration routine */
NULL, /* Class creation callback */
NULL, /* Class creation callback info */
@@ -97,7 +97,7 @@ static const unsigned H5L_def_intmd_group_g =
H5L_CRT_INTERMEDIATE_GROUP_DEF; /* Default setting for creating intermediate groups */
/*-------------------------------------------------------------------------
- * Function: H5P_lcrt_reg_prop
+ * Function: H5P__lcrt_reg_prop
*
* Purpose: Register the dataset creation property list class's properties
*
@@ -107,12 +107,12 @@ static const unsigned H5L_def_intmd_group_g =
* October 31, 2006
*-------------------------------------------------------------------------
*/
-herr_t
-H5P_lcrt_reg_prop(H5P_genclass_t *pclass)
+static herr_t
+H5P__lcrt_reg_prop(H5P_genclass_t *pclass)
{
herr_t ret_value = SUCCEED; /* Return value */
- FUNC_ENTER_NOAPI(FAIL)
+ FUNC_ENTER_STATIC
/* Register create intermediate groups property */
if (H5P__register_real(pclass, H5L_CRT_INTERMEDIATE_GROUP_NAME, H5L_CRT_INTERMEDIATE_GROUP_SIZE,
@@ -122,7 +122,7 @@ H5P_lcrt_reg_prop(H5P_genclass_t *pclass)
done:
FUNC_LEAVE_NOAPI(ret_value)
-} /* end H5P_lcrt_reg_prop() */
+} /* end H5P__lcrt_reg_prop() */
/*-------------------------------------------------------------------------
* Function: H5Pset_create_intermediate_group
@@ -149,7 +149,7 @@ H5Pset_create_intermediate_group(hid_t plist_id, unsigned crt_intmd_group)
/* Get the plist structure */
if (NULL == (plist = H5P_object_verify(plist_id, H5P_LINK_CREATE)))
- HGOTO_ERROR(H5E_ATOM, H5E_BADATOM, FAIL, "can't find object for ID")
+ HGOTO_ERROR(H5E_ID, H5E_BADID, FAIL, "can't find object for ID")
/* Set value */
crt_intmd_group = (unsigned)(crt_intmd_group > 0 ? 1 : 0);
@@ -183,7 +183,7 @@ H5Pget_create_intermediate_group(hid_t plist_id, unsigned *crt_intmd_group /*out
/* Get the plist structure */
if (NULL == (plist = H5P_object_verify(plist_id, H5P_LINK_CREATE)))
- HGOTO_ERROR(H5E_ATOM, H5E_BADATOM, FAIL, "can't find object for ID")
+ HGOTO_ERROR(H5E_ID, H5E_BADID, FAIL, "can't find object for ID")
/* Get values */
if (crt_intmd_group)
diff --git a/src/H5Pmapl.c b/src/H5Pmapl.c
index 8fdf610..2ce1ec0 100644
--- a/src/H5Pmapl.c
+++ b/src/H5Pmapl.c
@@ -160,7 +160,7 @@ H5Pset_map_iterate_hints(hid_t mapl_id, size_t key_prefetch_size, size_t key_all
/* Get the plist structure */
if (NULL == (plist = H5P_object_verify(mapl_id, H5P_MAP_ACCESS)))
- HGOTO_ERROR(H5E_ATOM, H5E_BADATOM, FAIL, "can't find object for ID");
+ HGOTO_ERROR(H5E_ID, H5E_BADID, FAIL, "can't find object for ID");
/* Set sizes */
if (H5P_set(plist, H5M_ACS_KEY_PREFETCH_SIZE_NAME, &key_prefetch_size) < 0)
@@ -182,17 +182,17 @@ done:
*-------------------------------------------------------------------------
*/
herr_t
-H5Pget_map_iterate_hints(hid_t mapl_id, size_t *key_prefetch_size, size_t *key_alloc_size)
+H5Pget_map_iterate_hints(hid_t mapl_id, size_t *key_prefetch_size /*out*/, size_t *key_alloc_size /*out*/)
{
H5P_genplist_t *plist; /* Property list pointer */
herr_t ret_value = SUCCEED; /* return value */
FUNC_ENTER_API(FAIL)
- H5TRACE3("e", "i*z*z", mapl_id, key_prefetch_size, key_alloc_size);
+ H5TRACE3("e", "ixx", mapl_id, key_prefetch_size, key_alloc_size);
/* Get the plist structure */
if (NULL == (plist = H5P_object_verify(mapl_id, H5P_MAP_ACCESS)))
- HGOTO_ERROR(H5E_ATOM, H5E_BADATOM, FAIL, "can't find object for ID");
+ HGOTO_ERROR(H5E_ID, H5E_BADID, FAIL, "can't find object for ID");
/* Get the properties */
if (key_prefetch_size) {
diff --git a/src/H5Pmodule.h b/src/H5Pmodule.h
index 130cb90..18f30c6 100644
--- a/src/H5Pmodule.h
+++ b/src/H5Pmodule.h
@@ -44,7 +44,6 @@
* and compressed.
*
* \todo Describe concisely what the functions in this module are about.
- * \todo Clicking on "more" after "Property List Interface" at the top does not work
*
* \defgroup GPLO General Property List Operations
* \ingroup H5P
@@ -70,6 +69,10 @@
* \ingroup H5P
* \defgroup OCPPL Object Copy Properties
* \ingroup H5P
+ * \defgroup GACPL General Access Properties
+ * \ingroup H5P
+ * \defgroup MAPL Map Access Properties
+ * \ingroup H5P
*/
#endif /* H5Pmodule_H */
diff --git a/src/H5Pocpl.c b/src/H5Pocpl.c
index b977a35..edb0cca 100644
--- a/src/H5Pocpl.c
+++ b/src/H5Pocpl.c
@@ -15,7 +15,7 @@
*
* Created: H5Pocpl.c
* Nov 28 2006
- * Quincey Koziol <koziol@hdfgroup.org>
+ * Quincey Koziol
*
* Purpose: Object creation property list class routines
*
@@ -226,7 +226,7 @@ H5Pset_attr_phase_change(hid_t plist_id, unsigned max_compact, unsigned min_dens
/* Get the plist structure */
if (NULL == (plist = H5P_object_verify(plist_id, H5P_OBJECT_CREATE)))
- HGOTO_ERROR(H5E_ATOM, H5E_BADATOM, FAIL, "can't find object for ID")
+ HGOTO_ERROR(H5E_ID, H5E_BADID, FAIL, "can't find object for ID")
/* Set property values */
if (H5P_set(plist, H5O_CRT_ATTR_MAX_COMPACT_NAME, &max_compact) < 0)
@@ -251,17 +251,17 @@ done:
*-------------------------------------------------------------------------
*/
herr_t
-H5Pget_attr_phase_change(hid_t plist_id, unsigned *max_compact, unsigned *min_dense)
+H5Pget_attr_phase_change(hid_t plist_id, unsigned *max_compact /*out*/, unsigned *min_dense /*out*/)
{
H5P_genplist_t *plist; /* Property list pointer */
herr_t ret_value = SUCCEED; /* Return value */
FUNC_ENTER_API(FAIL)
- H5TRACE3("e", "i*Iu*Iu", plist_id, max_compact, min_dense);
+ H5TRACE3("e", "ixx", plist_id, max_compact, min_dense);
/* Get the plist structure */
if (NULL == (plist = H5P_object_verify(plist_id, H5P_OBJECT_CREATE)))
- HGOTO_ERROR(H5E_ATOM, H5E_BADATOM, FAIL, "can't find object for ID")
+ HGOTO_ERROR(H5E_ID, H5E_BADID, FAIL, "can't find object for ID")
/* Get values */
if (max_compact) {
@@ -305,7 +305,7 @@ H5Pset_attr_creation_order(hid_t plist_id, unsigned crt_order_flags)
/* Get the plist structure */
if (NULL == (plist = H5P_object_verify(plist_id, H5P_OBJECT_CREATE)))
- HGOTO_ERROR(H5E_ATOM, H5E_BADATOM, FAIL, "can't find object for ID")
+ HGOTO_ERROR(H5E_ID, H5E_BADID, FAIL, "can't find object for ID")
/* Get object header flags */
if (H5P_get(plist, H5O_CRT_OHDR_FLAGS_NAME, &ohdr_flags) < 0)
@@ -342,12 +342,12 @@ done:
*-------------------------------------------------------------------------
*/
herr_t
-H5Pget_attr_creation_order(hid_t plist_id, unsigned *crt_order_flags)
+H5Pget_attr_creation_order(hid_t plist_id, unsigned *crt_order_flags /*out*/)
{
herr_t ret_value = SUCCEED; /* return value */
FUNC_ENTER_API(FAIL)
- H5TRACE2("e", "i*Iu", plist_id, crt_order_flags);
+ H5TRACE2("e", "ix", plist_id, crt_order_flags);
/* Get values */
if (crt_order_flags) {
@@ -359,7 +359,7 @@ H5Pget_attr_creation_order(hid_t plist_id, unsigned *crt_order_flags)
/* Get the plist structure */
if (NULL == (plist = H5P_object_verify(plist_id, H5P_OBJECT_CREATE)))
- HGOTO_ERROR(H5E_ATOM, H5E_BADATOM, FAIL, "can't find object for ID")
+ HGOTO_ERROR(H5E_ID, H5E_BADID, FAIL, "can't find object for ID")
/* Get object header flags */
if (H5P_get(plist, H5O_CRT_OHDR_FLAGS_NAME, &ohdr_flags) < 0)
@@ -412,7 +412,7 @@ H5Pset_obj_track_times(hid_t plist_id, hbool_t track_times)
/* Get the plist structure */
if (NULL == (plist = H5P_object_verify(plist_id, H5P_OBJECT_CREATE)))
- HGOTO_ERROR(H5E_ATOM, H5E_BADATOM, FAIL, "can't find object for ID")
+ HGOTO_ERROR(H5E_ID, H5E_BADID, FAIL, "can't find object for ID")
/* Get object header flags */
if (H5P_get(plist, H5O_CRT_OHDR_FLAGS_NAME, &ohdr_flags) < 0)
@@ -445,12 +445,12 @@ done:
*-------------------------------------------------------------------------
*/
herr_t
-H5Pget_obj_track_times(hid_t plist_id, hbool_t *track_times)
+H5Pget_obj_track_times(hid_t plist_id, hbool_t *track_times /*out*/)
{
herr_t ret_value = SUCCEED; /* return value */
FUNC_ENTER_API(FAIL)
- H5TRACE2("e", "i*b", plist_id, track_times);
+ H5TRACE2("e", "ix", plist_id, track_times);
/* Get values */
if (track_times) {
@@ -459,7 +459,7 @@ H5Pget_obj_track_times(hid_t plist_id, hbool_t *track_times)
/* Get the plist structure */
if (NULL == (plist = H5P_object_verify(plist_id, H5P_OBJECT_CREATE)))
- HGOTO_ERROR(H5E_ATOM, H5E_BADATOM, FAIL, "can't find object for ID")
+ HGOTO_ERROR(H5E_ID, H5E_BADID, FAIL, "can't find object for ID")
/* Get object header flags */
if (H5P_get(plist, H5O_CRT_OHDR_FLAGS_NAME, &ohdr_flags) < 0)
@@ -568,13 +568,6 @@ done:
* Programmer: Quincey Koziol
* Friday, April 5, 2003
*
- * Modifications:
- *
- * Neil Fortner
- * Thursday, March 26, 2009
- * Overloaded to accept gcpl's as well as dcpl's and moved to
- * H5Pocpl.c
- *
*-------------------------------------------------------------------------
*/
herr_t
@@ -597,7 +590,7 @@ H5Pmodify_filter(hid_t plist_id, H5Z_filter_t filter, unsigned int flags, size_t
/* Get the plist structure */
if (NULL == (plist = H5P_object_verify(plist_id, H5P_OBJECT_CREATE)))
- HGOTO_ERROR(H5E_ATOM, H5E_BADATOM, FAIL, "can't find object for ID")
+ HGOTO_ERROR(H5E_ID, H5E_BADID, FAIL, "can't find object for ID")
/* Modify the filter parameters of the I/O pipeline */
if (H5P_modify_filter(plist, filter, flags, cd_nelmts, cd_values) < 0)
@@ -637,18 +630,6 @@ done:
* Programmer: Robb Matzke
* Wednesday, April 15, 1998
*
- * Modifications:
- *
- * Raymond Lu
- * Tuesday, October 2, 2001
- * Changed the way to check parameter and set property for
- * generic property list.
- *
- * Neil Fortner
- * Wednesday, May 20, 2009
- * Overloaded to accept gcpl's as well as dcpl's and moved to
- * H5Pocpl.c
- *
*-------------------------------------------------------------------------
*/
herr_t
@@ -671,7 +652,7 @@ H5Pset_filter(hid_t plist_id, H5Z_filter_t filter, unsigned int flags, size_t cd
/* Get the plist structure */
if (NULL == (plist = H5P_object_verify(plist_id, H5P_OBJECT_CREATE)))
- HGOTO_ERROR(H5E_ATOM, H5E_BADATOM, FAIL, "can't find object for ID")
+ HGOTO_ERROR(H5E_ID, H5E_BADID, FAIL, "can't find object for ID")
/* Call the private function */
if (H5P__set_filter(plist, filter, flags, cd_nelmts, cd_values) < 0)
@@ -764,13 +745,6 @@ done:
* Programmer: Robb Matzke
* Tuesday, August 4, 1998
*
- * Modifications:
- *
- * Neil Fortner
- * Wednesday, May 20, 2009
- * Overloaded to accept gcpl's as well as dcpl's and moved to
- * H5Pocpl.c
- *
*-------------------------------------------------------------------------
*/
int
@@ -785,7 +759,7 @@ H5Pget_nfilters(hid_t plist_id)
/* Get the plist structure */
if (NULL == (plist = H5P_object_verify(plist_id, H5P_OBJECT_CREATE)))
- HGOTO_ERROR(H5E_ATOM, H5E_BADATOM, FAIL, "can't find object for ID")
+ HGOTO_ERROR(H5E_ID, H5E_BADID, FAIL, "can't find object for ID")
/* Get the pipeline property to query */
if (H5P_peek(plist, H5O_CRT_PIPELINE_NAME, &pline) < 0)
@@ -820,13 +794,6 @@ done:
* Programmer: Robb Matzke
* Wednesday, April 15, 1998
*
- * Modifications:
- *
- * Neil Fortner
- * Wednesday, May 20, 2009
- * Overloaded to accept gcpl's as well as dcpl's and moved to
- * H5Pocpl.c
- *
*-------------------------------------------------------------------------
*/
H5Z_filter_t
@@ -866,7 +833,7 @@ H5Pget_filter2(hid_t plist_id, unsigned idx, unsigned int *flags /*out*/, size_t
/* Get the plist structure */
if (NULL == (plist = H5P_object_verify(plist_id, H5P_OBJECT_CREATE)))
- HGOTO_ERROR(H5E_ATOM, H5E_BADATOM, H5Z_FILTER_ERROR, "can't find object for ID")
+ HGOTO_ERROR(H5E_ID, H5E_BADID, H5Z_FILTER_ERROR, "can't find object for ID")
/* Get the pipeline property to query */
if (H5P_peek(plist, H5O_CRT_PIPELINE_NAME, &pline) < 0)
@@ -959,25 +926,18 @@ done:
* Programmer: Quincey Koziol
* Friday, April 5, 2003
*
- * Modifications:
- *
- * Neil Fortner
- * Thursday, May 21, 2009
- * Overloaded to accept gcpl's as well as dcpl's and moved to
- * H5Pocpl.c
- *
*-------------------------------------------------------------------------
*/
herr_t
H5Pget_filter_by_id2(hid_t plist_id, H5Z_filter_t id, unsigned int *flags /*out*/,
size_t *cd_nelmts /*in_out*/, unsigned cd_values[] /*out*/, size_t namelen,
- char name[] /*out*/, unsigned *filter_config)
+ char name[] /*out*/, unsigned *filter_config /*out*/)
{
H5P_genplist_t *plist; /* Property list */
herr_t ret_value = SUCCEED; /* Return value */
FUNC_ENTER_API(FAIL)
- H5TRACE8("e", "iZfx*zxzx*Iu", plist_id, id, flags, cd_nelmts, cd_values, namelen, name, filter_config);
+ H5TRACE8("e", "iZfx*zxzxx", plist_id, id, flags, cd_nelmts, cd_values, namelen, name, filter_config);
/* Check args */
if (cd_nelmts || cd_values) {
@@ -1002,7 +962,7 @@ H5Pget_filter_by_id2(hid_t plist_id, H5Z_filter_t id, unsigned int *flags /*out*
/* Get the plist structure */
if (NULL == (plist = H5P_object_verify(plist_id, H5P_OBJECT_CREATE)))
- HGOTO_ERROR(H5E_ATOM, H5E_BADATOM, FAIL, "can't find object for ID")
+ HGOTO_ERROR(H5E_ID, H5E_BADID, FAIL, "can't find object for ID")
/* Get filter information */
if (H5P_get_filter_by_id(plist, id, flags, cd_nelmts, cd_values, namelen, name, filter_config) < 0)
@@ -1025,13 +985,6 @@ done:
* Programmer: Quincey Koziol
* Tuesday, April 8, 2003
*
- * Modifications:
- *
- * Neil Fortner
- * Thursday, May 21, 2009
- * Overloaded to accept gcpl's as well as dcpl's and moved to
- * H5Pocpl.c
- *
*-------------------------------------------------------------------------
*/
htri_t
@@ -1046,7 +999,7 @@ H5Pall_filters_avail(hid_t plist_id)
/* Get the plist structure */
if (NULL == (plist = H5P_object_verify(plist_id, H5P_OBJECT_CREATE)))
- HGOTO_ERROR(H5E_ATOM, H5E_BADATOM, FAIL, "can't find object for ID")
+ HGOTO_ERROR(H5E_ID, H5E_BADID, FAIL, "can't find object for ID")
/* Get the pipeline property to query */
if (H5P_peek(plist, H5O_CRT_PIPELINE_NAME, &pline) < 0)
@@ -1106,13 +1059,6 @@ done:
* Programmer: Pedro Vicente
* January 26, 2004
*
- * Modifications:
- *
- * Neil Fortner
- * Thursday, May 21, 2009
- * Overloaded to accept gcpl's as well as dcpl's and moved to
- * H5Pocpl.c
- *
*-------------------------------------------------------------------------
*/
herr_t
@@ -1127,7 +1073,7 @@ H5Premove_filter(hid_t plist_id, H5Z_filter_t filter)
/* Get the plist structure */
if (NULL == (plist = H5P_object_verify(plist_id, H5P_OBJECT_CREATE)))
- HGOTO_ERROR(H5E_ATOM, H5E_BADATOM, FAIL, "can't find object for ID")
+ HGOTO_ERROR(H5E_ID, H5E_BADID, FAIL, "can't find object for ID")
/* Get the pipeline property to modify */
if (H5P_peek(plist, H5O_CRT_PIPELINE_NAME, &pline) < 0)
@@ -1164,18 +1110,6 @@ done:
* Programmer: Robb Matzke
* Wednesday, April 15, 1998
*
- * Modifications:
- *
- * Raymond Lu
- * Tuesday, October 2, 2001
- * Changed the way to check parameter and set property for
- * generic property list.
- *
- * Neil Fortner
- * Thursday, March 26, 2009
- * Overloaded to accept gcpl's as well as dcpl's and moved to
- * H5Pocpl.c
- *
*-------------------------------------------------------------------------
*/
herr_t
@@ -1194,7 +1128,7 @@ H5Pset_deflate(hid_t plist_id, unsigned level)
/* Get the plist structure */
if (NULL == (plist = H5P_object_verify(plist_id, H5P_OBJECT_CREATE)))
- HGOTO_ERROR(H5E_ATOM, H5E_BADATOM, FAIL, "can't find object for ID")
+ HGOTO_ERROR(H5E_ID, H5E_BADID, FAIL, "can't find object for ID")
/* Get the pipeline property to append to */
if (H5P_peek(plist, H5O_CRT_PIPELINE_NAME, &pline) < 0)
@@ -1223,13 +1157,6 @@ done:
* Programmer: Raymond Lu
* Dec 19, 2002
*
- * Modifications:
- *
- * Neil Fortner
- * Wednesday, May 6, 2009
- * Overloaded to accept gcpl's as well as dcpl's and moved to
- * H5Pocpl.c
- *
*-------------------------------------------------------------------------
*/
herr_t
@@ -1244,7 +1171,7 @@ H5Pset_fletcher32(hid_t plist_id)
/* Get the plist structure */
if (NULL == (plist = H5P_object_verify(plist_id, H5P_OBJECT_CREATE)))
- HGOTO_ERROR(H5E_ATOM, H5E_BADATOM, FAIL, "can't find object for ID")
+ HGOTO_ERROR(H5E_ID, H5E_BADID, FAIL, "can't find object for ID")
/* Get the pipeline property to append to */
if (H5P_peek(plist, H5O_CRT_PIPELINE_NAME, &pline) < 0)
@@ -1854,7 +1781,7 @@ H5Pget_filter1(hid_t plist_id, unsigned idx, unsigned int *flags /*out*/, size_t
/* Get the plist structure */
if (NULL == (plist = H5P_object_verify(plist_id, H5P_OBJECT_CREATE)))
- HGOTO_ERROR(H5E_ATOM, H5E_BADATOM, H5Z_FILTER_ERROR, "can't find object for ID")
+ HGOTO_ERROR(H5E_ID, H5E_BADID, H5Z_FILTER_ERROR, "can't find object for ID")
/* Get pipeline info */
if (H5P_peek(plist, H5O_CRT_PIPELINE_NAME, &pline) < 0)
@@ -1933,7 +1860,7 @@ H5Pget_filter_by_id1(hid_t plist_id, H5Z_filter_t id, unsigned int *flags /*out*
/* Get the plist structure */
if (NULL == (plist = H5P_object_verify(plist_id, H5P_OBJECT_CREATE)))
- HGOTO_ERROR(H5E_ATOM, H5E_BADATOM, FAIL, "can't find object for ID")
+ HGOTO_ERROR(H5E_ID, H5E_BADID, FAIL, "can't find object for ID")
/* Get filter info */
if (H5P_get_filter_by_id(plist, id, flags, cd_nelmts, cd_values, namelen, name, NULL) < 0)
diff --git a/src/H5Pocpypl.c b/src/H5Pocpypl.c
index 3007ce6..d77e69d 100644
--- a/src/H5Pocpypl.c
+++ b/src/H5Pocpypl.c
@@ -15,7 +15,7 @@
*
* Created: H5Pocpypl.c
* Mar 13 2006
- * Peter Cao <xcao@ncsa.uiuc.edu>
+ * Peter Cao
*
* Purpose: Object copying property list class routines
*
@@ -656,7 +656,7 @@ H5Pset_copy_object(hid_t plist_id, unsigned cpy_option)
/* Get the plist structure */
if (NULL == (plist = H5P_object_verify(plist_id, H5P_OBJECT_COPY)))
- HGOTO_ERROR(H5E_ATOM, H5E_BADATOM, FAIL, "can't find object for ID")
+ HGOTO_ERROR(H5E_ID, H5E_BADID, FAIL, "can't find object for ID")
/* Set value */
if (H5P_set(plist, H5O_CPY_OPTION_NAME, &cpy_option) < 0)
@@ -689,7 +689,7 @@ H5Pget_copy_object(hid_t plist_id, unsigned *cpy_option /*out*/)
/* Get the plist structure */
if (NULL == (plist = H5P_object_verify(plist_id, H5P_OBJECT_COPY)))
- HGOTO_ERROR(H5E_ATOM, H5E_BADATOM, FAIL, "can't find object for ID")
+ HGOTO_ERROR(H5E_ID, H5E_BADID, FAIL, "can't find object for ID")
/* Get values */
if (cpy_option)
@@ -739,7 +739,7 @@ H5Padd_merge_committed_dtype_path(hid_t plist_id, const char *path)
/* Get the plist structure */
if (NULL == (plist = H5P_object_verify(plist_id, H5P_OBJECT_COPY)))
- HGOTO_ERROR(H5E_ATOM, H5E_BADATOM, FAIL, "can't find object for ID")
+ HGOTO_ERROR(H5E_ID, H5E_BADID, FAIL, "can't find object for ID")
/* Get dtype list */
if (H5P_peek(plist, H5O_CPY_MERGE_COMM_DT_LIST_NAME, &old_list) < 0)
@@ -794,7 +794,7 @@ H5Pfree_merge_committed_dtype_paths(hid_t plist_id)
/* Get the plist structure */
if (NULL == (plist = H5P_object_verify(plist_id, H5P_OBJECT_COPY)))
- HGOTO_ERROR(H5E_ATOM, H5E_BADATOM, FAIL, "can't find object for ID")
+ HGOTO_ERROR(H5E_ID, H5E_BADID, FAIL, "can't find object for ID")
/* Get dtype list */
if (H5P_peek(plist, H5O_CPY_MERGE_COMM_DT_LIST_NAME, &dt_list) < 0)
@@ -846,7 +846,7 @@ H5Pset_mcdt_search_cb(hid_t plist_id, H5O_mcdt_search_cb_t func, void *op_data)
/* Get the plist structure */
if (NULL == (plist = H5P_object_verify(plist_id, H5P_OBJECT_COPY)))
- HGOTO_ERROR(H5E_ATOM, H5E_BADATOM, FAIL, "can't find object for ID")
+ HGOTO_ERROR(H5E_ID, H5E_BADID, FAIL, "can't find object for ID")
/* Populate the callback info struct */
cb_info.func = func;
@@ -878,18 +878,18 @@ done:
*-------------------------------------------------------------------------
*/
herr_t
-H5Pget_mcdt_search_cb(hid_t plist_id, H5O_mcdt_search_cb_t *func, void **op_data)
+H5Pget_mcdt_search_cb(hid_t plist_id, H5O_mcdt_search_cb_t *func /*out*/, void **op_data /*out*/)
{
H5P_genplist_t * plist; /* Property list pointer */
H5O_mcdt_cb_info_t cb_info; /* Callback info struct */
herr_t ret_value = SUCCEED; /* Return value */
FUNC_ENTER_API(FAIL)
- H5TRACE3("e", "i*Os**x", plist_id, func, op_data);
+ H5TRACE3("e", "ixx", plist_id, func, op_data);
/* Get the plist structure */
if (NULL == (plist = H5P_object_verify(plist_id, H5P_OBJECT_COPY)))
- HGOTO_ERROR(H5E_ATOM, H5E_BADATOM, FAIL, "can't find object for ID")
+ HGOTO_ERROR(H5E_ID, H5E_BADID, FAIL, "can't find object for ID")
/* Get callback info */
if (H5P_get(plist, H5O_CPY_MCDT_SEARCH_CB_NAME, &cb_info) < 0)
diff --git a/src/H5Pstrcpl.c b/src/H5Pstrcpl.c
index fb187ad..d121d08 100644
--- a/src/H5Pstrcpl.c
+++ b/src/H5Pstrcpl.c
@@ -15,7 +15,7 @@
*
* Created: H5Pstrcpl.c
* October 26 2005
- * James Laird <jlaird@ncsa.uiuc.edu>
+ * James Laird
*
* Purpose: String creation property list class routines
*
@@ -156,7 +156,7 @@ H5Pset_char_encoding(hid_t plist_id, H5T_cset_t encoding)
/* Get the plist structure */
if (NULL == (plist = H5P_object_verify(plist_id, H5P_STRING_CREATE)))
- HGOTO_ERROR(H5E_ATOM, H5E_BADATOM, FAIL, "can't find object for ID")
+ HGOTO_ERROR(H5E_ID, H5E_BADID, FAIL, "can't find object for ID")
/* Set the character encoding */
if (H5P_set(plist, H5P_STRCRT_CHAR_ENCODING_NAME, &encoding) < 0)
@@ -188,7 +188,7 @@ H5Pget_char_encoding(hid_t plist_id, H5T_cset_t *encoding /*out*/)
/* Get the plist structure */
if (NULL == (plist = H5P_object_verify(plist_id, H5P_STRING_CREATE)))
- HGOTO_ERROR(H5E_ATOM, H5E_BADATOM, FAIL, "can't find object for ID")
+ HGOTO_ERROR(H5E_ID, H5E_BADID, FAIL, "can't find object for ID")
/* Get value */
if (encoding)
diff --git a/src/H5Ptest.c b/src/H5Ptest.c
index 1c1c06c..645988a 100644
--- a/src/H5Ptest.c
+++ b/src/H5Ptest.c
@@ -11,7 +11,7 @@
* help@hdfgroup.org. *
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
-/* Programmer: Quincey Koziol <koziol@ncsa.uiuc.edu>
+/* Programmer: Quincey Koziol
* Saturday May 31, 2003
*
* Purpose: Generic Property Testing Functions
@@ -109,9 +109,9 @@ H5P__open_class_path_test(const char *path)
if (NULL == (pclass = H5P__open_class_path(path)))
HGOTO_ERROR(H5E_PLIST, H5E_NOTFOUND, H5I_INVALID_HID, "unable to find class with full path");
- /* Get an atom for the class */
+ /* Get an ID for the class */
if ((ret_value = H5I_register(H5I_GENPROP_CLS, pclass, TRUE)) < 0)
- HGOTO_ERROR(H5E_PLIST, H5E_CANTREGISTER, H5I_INVALID_HID, "unable to atomize property list class");
+ HGOTO_ERROR(H5E_PLIST, H5E_CANTREGISTER, H5I_INVALID_HID, "unable to register property list class");
done:
if (H5I_INVALID_HID == ret_value && pclass)
diff --git a/src/H5S.c b/src/H5S.c
index feeefbb..747d297 100644
--- a/src/H5S.c
+++ b/src/H5S.c
@@ -44,6 +44,7 @@
/********************/
/* Local Prototypes */
/********************/
+static herr_t H5S__close_cb(void *space, void **request);
static htri_t H5S__is_simple(const H5S_t *sdim);
/*****************************/
@@ -81,23 +82,44 @@ H5FL_ARR_DEFINE(hsize_t, H5S_MAX_RANK);
/* Dataspace ID class */
static const H5I_class_t H5I_DATASPACE_CLS[1] = {{
- H5I_DATASPACE, /* ID class value */
- 0, /* Class flags */
- 2, /* # of reserved IDs for class */
- (H5I_free_t)H5S_close /* Callback routine for closing objects of this class */
+ H5I_DATASPACE, /* ID class value */
+ 0, /* Class flags */
+ 2, /* # of reserved IDs for class */
+ (H5I_free_t)H5S__close_cb /* Callback routine for closing objects of this class */
}};
/* Dataspace selection iterator ID class */
static const H5I_class_t H5I_SPACE_SEL_ITER_CLS[1] = {{
- H5I_SPACE_SEL_ITER, /* ID class value */
- 0, /* Class flags */
- 0, /* # of reserved IDs for class */
- (H5I_free_t)H5S_sel_iter_close /* Callback routine for closing objects of this class */
+ H5I_SPACE_SEL_ITER, /* ID class value */
+ 0, /* Class flags */
+ 0, /* # of reserved IDs for class */
+ (H5I_free_t)H5S__sel_iter_close_cb /* Callback routine for closing objects of this class */
}};
/* Flag indicating "top" of interface has been initialized */
static hbool_t H5S_top_package_initialize_s = FALSE;
+/*-------------------------------------------------------------------------
+ * Function: H5S_init
+ *
+ * Purpose: Initialize the interface from some other layer.
+ *
+ * Return: Success: non-negative
+ * Failure: negative
+ *-------------------------------------------------------------------------
+ */
+herr_t
+H5S_init(void)
+{
+ herr_t ret_value = SUCCEED; /* Return value */
+
+ FUNC_ENTER_NOAPI(FAIL)
+ /* FUNC_ENTER() does all the work */
+
+done:
+ FUNC_LEAVE_NOAPI(ret_value)
+} /* end H5S_init() */
+
/*--------------------------------------------------------------------------
NAME
H5S__init_package -- Initialize interface-specific information
@@ -115,11 +137,11 @@ H5S__init_package(void)
FUNC_ENTER_PACKAGE
- /* Initialize the atom group for the dataspace IDs */
+ /* Initialize the ID group for the dataspace IDs */
if (H5I_register_type(H5I_DATASPACE_CLS) < 0)
HGOTO_ERROR(H5E_DATASPACE, H5E_CANTINIT, FAIL, "unable to initialize dataspace ID class")
- /* Initialize the atom group for the dataspace selction iterator IDs */
+ /* Initialize the ID group for the dataspace selction iterator IDs */
if (H5I_register_type(H5I_SPACE_SEL_ITER_CLS) < 0)
HGOTO_ERROR(H5E_DATASPACE, H5E_CANTINIT, FAIL,
"unable to initialize dataspace selection iterator ID class")
@@ -141,7 +163,7 @@ done:
RETURNS
Non-negative on success/Negative on failure
DESCRIPTION
- Release IDs for the atom group, deferring full interface shutdown
+ Release IDs for the ID group, deferring full interface shutdown
until later (in H5S_term_package).
GLOBAL VARIABLES
COMMENTS, BUGS, ASSUMPTIONS
@@ -185,7 +207,7 @@ H5S_top_term_package(void)
RETURNS
Non-negative on success/Negative on failure
DESCRIPTION
- Release the atom group and any other resources allocated.
+ Release the ID group and any other resources allocated.
GLOBAL VARIABLES
COMMENTS, BUGS, ASSUMPTIONS
Can't report errors...
@@ -222,6 +244,37 @@ H5S_term_package(void)
FUNC_LEAVE_NOAPI(n)
} /* end H5S_term_package() */
+/*-------------------------------------------------------------------------
+ * Function: H5S__close_cb
+ *
+ * Purpose: Called when the ref count reaches zero on a dataspace's ID
+ *
+ * Return: SUCCEED / FAIL
+ *
+ * Programmer: Quincey Koziol
+ * Wednesday, April 8, 2020
+ *
+ *-------------------------------------------------------------------------
+ */
+static herr_t
+H5S__close_cb(void *_space, void H5_ATTR_UNUSED **request)
+{
+ H5S_t *space = (H5S_t *)_space; /* The dataspace to close */
+ herr_t ret_value = SUCCEED; /* Return value */
+
+ FUNC_ENTER_STATIC
+
+ /* Sanity check */
+ HDassert(space);
+
+ /* Close the dataspace object */
+ if (H5S_close(space) < 0)
+ HGOTO_ERROR(H5E_DATASPACE, H5E_CLOSEERROR, FAIL, "unable to close dataspace");
+
+done:
+ FUNC_LEAVE_NOAPI(ret_value)
+} /* end H5S__close_cb() */
+
/*--------------------------------------------------------------------------
NAME
H5S_get_validiated_dataspace
@@ -382,9 +435,9 @@ H5Screate(H5S_class_t type)
if (NULL == (new_ds = H5S_create(type)))
HGOTO_ERROR(H5E_DATASPACE, H5E_CANTCREATE, FAIL, "unable to create dataspace")
- /* Atomize */
+ /* Register */
if ((ret_value = H5I_register(H5I_DATASPACE, new_ds, TRUE)) < 0)
- HGOTO_ERROR(H5E_ATOM, H5E_CANTREGISTER, FAIL, "unable to register dataspace atom")
+ HGOTO_ERROR(H5E_ID, H5E_CANTREGISTER, FAIL, "unable to register dataspace ID")
done:
if (ret_value < 0)
@@ -531,9 +584,9 @@ H5Scopy(hid_t space_id)
if (NULL == (dst = H5S_copy(src, FALSE, TRUE)))
HGOTO_ERROR(H5E_DATASPACE, H5E_CANTINIT, H5I_INVALID_HID, "unable to copy dataspace")
- /* Atomize */
+ /* Register */
if ((ret_value = H5I_register(H5I_DATASPACE, dst, TRUE)) < 0)
- HGOTO_ERROR(H5E_ATOM, H5E_CANTREGISTER, H5I_INVALID_HID, "unable to register dataspace atom")
+ HGOTO_ERROR(H5E_ID, H5E_CANTREGISTER, H5I_INVALID_HID, "unable to register dataspace ID")
done:
if (ret_value < 0)
@@ -1230,7 +1283,7 @@ H5Sis_simple(hid_t space_id)
/* Check args and all the boring stuff. */
if (NULL == (space = (H5S_t *)H5I_object_verify(space_id, H5I_DATASPACE)))
- HGOTO_ERROR(H5E_ATOM, H5E_BADATOM, FAIL, "not a dataspace")
+ HGOTO_ERROR(H5E_ID, H5E_BADID, FAIL, "not a dataspace")
ret_value = H5S__is_simple(space);
@@ -1276,7 +1329,7 @@ H5Sset_extent_simple(hid_t space_id, int rank, const hsize_t dims[/*rank*/], con
/* Check args */
if (NULL == (space = (H5S_t *)H5I_object_verify(space_id, H5I_DATASPACE)))
- HGOTO_ERROR(H5E_ATOM, H5E_BADATOM, FAIL, "not a dataspace")
+ HGOTO_ERROR(H5E_ID, H5E_BADID, FAIL, "not a dataspace")
if (rank > 0 && dims == NULL)
HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "no dimensions specified")
if (rank < 0 || rank > H5S_MAX_RANK)
@@ -1432,9 +1485,9 @@ H5Screate_simple(int rank, const hsize_t dims[/*rank*/], const hsize_t maxdims[/
if (NULL == (space = H5S_create_simple((unsigned)rank, dims, maxdims)))
HGOTO_ERROR(H5E_DATASPACE, H5E_CANTCREATE, H5I_INVALID_HID, "can't create simple dataspace")
- /* Atomize */
+ /* Register */
if ((ret_value = H5I_register(H5I_DATASPACE, space, TRUE)) < 0)
- HGOTO_ERROR(H5E_ATOM, H5E_CANTREGISTER, H5I_INVALID_HID, "unable to register dataspace ID")
+ HGOTO_ERROR(H5E_ID, H5E_CANTREGISTER, H5I_INVALID_HID, "unable to register dataspace ID")
done:
if (ret_value < 0)
@@ -1804,7 +1857,7 @@ H5Sset_extent_none(hid_t space_id)
/* Check args */
if (NULL == (space = (H5S_t *)H5I_object_verify(space_id, H5I_DATASPACE)))
- HGOTO_ERROR(H5E_ATOM, H5E_BADATOM, FAIL, "not a dataspace")
+ HGOTO_ERROR(H5E_ID, H5E_BADID, FAIL, "not a dataspace")
/* Clear the previous extent from the dataspace */
if (H5S__extent_release(&space->extent) < 0)
diff --git a/src/H5SM.c b/src/H5SM.c
index 76a1428..fbf4975 100644
--- a/src/H5SM.c
+++ b/src/H5SM.c
@@ -2568,19 +2568,19 @@ H5SM_table_debug(H5F_t *f, haddr_t table_addr, FILE *stream, int indent, int fwi
? "List"
: (table->indexes[x].index_type == H5SM_BTREE ? "B-Tree" : "Unknown")));
- HDfprintf(stream, "%*s%-*s %a\n", indent + 3, "", fwidth,
+ HDfprintf(stream, "%*s%-*s %" PRIuHADDR "\n", indent + 3, "", fwidth,
"Address of index:", table->indexes[x].index_addr);
- HDfprintf(stream, "%*s%-*s %a\n", indent + 3, "", fwidth,
+ HDfprintf(stream, "%*s%-*s %" PRIuHADDR "\n", indent + 3, "", fwidth,
"Address of index's heap:", table->indexes[x].heap_addr);
HDfprintf(stream, "%*s%-*s 0x%08x\n", indent + 3, "", fwidth,
"Message type flags:", table->indexes[x].mesg_types);
- HDfprintf(stream, "%*s%-*s %Zu\n", indent + 3, "", fwidth,
+ HDfprintf(stream, "%*s%-*s %zu\n", indent + 3, "", fwidth,
"Minimum size of messages:", table->indexes[x].min_mesg_size);
- HDfprintf(stream, "%*s%-*s %Zu\n", indent + 3, "", fwidth,
+ HDfprintf(stream, "%*s%-*s %zu\n", indent + 3, "", fwidth,
"Number of messages:", table->indexes[x].num_messages);
- HDfprintf(stream, "%*s%-*s %Zu\n", indent + 3, "", fwidth,
+ HDfprintf(stream, "%*s%-*s %zu\n", indent + 3, "", fwidth,
"Maximum list size:", table->indexes[x].list_max);
- HDfprintf(stream, "%*s%-*s %Zu\n", indent + 3, "", fwidth,
+ HDfprintf(stream, "%*s%-*s %zu\n", indent + 3, "", fwidth,
"Minimum B-tree size:", table->indexes[x].btree_min);
} /* end for */
@@ -2668,16 +2668,16 @@ H5SM_list_debug(H5F_t *f, haddr_t list_addr, FILE *stream, int indent, int fwidt
HDassert(fh);
HDfprintf(stream, "%*s%-*s %s\n", indent + 3, "", fwidth, "Location:", "in heap");
- HDfprintf(stream, "%*s%-*s 0x%Zx\n", indent + 3, "", fwidth,
- "Heap ID:", list->messages[x].u.heap_loc.fheap_id);
- HDfprintf(stream, "%*s%-*s %u\n", indent + 3, "", fwidth,
+ HDfprintf(stream, "%*s%-*s 0x%" PRIx64 "\n", indent + 3, "", fwidth,
+ "Heap ID:", list->messages[x].u.heap_loc.fheap_id.val);
+ HDfprintf(stream, "%*s%-*s %" PRIuHSIZE "\n", indent + 3, "", fwidth,
"Reference count:", list->messages[x].u.heap_loc.ref_count);
} /* end if */
else if (list->messages[x].location == H5SM_IN_OH) {
HDfprintf(stream, "%*s%-*s %s\n", indent + 3, "", fwidth, "Location:", "in object header");
- HDfprintf(stream, "%*s%-*s %a\n", indent + 3, "", fwidth,
+ HDfprintf(stream, "%*s%-*s %" PRIuHADDR "\n", indent + 3, "", fwidth,
"Object header address:", list->messages[x].u.mesg_loc.oh_addr);
- HDfprintf(stream, "%*s%-*s %u\n", indent + 3, "", fwidth,
+ HDfprintf(stream, "%*s%-*s %" PRIuHADDR "\n", indent + 3, "", fwidth,
"Message creation index:", list->messages[x].u.mesg_loc.oh_addr);
HDfprintf(stream, "%*s%-*s %u\n", indent + 3, "", fwidth,
"Message type ID:", list->messages[x].msg_type_id);
diff --git a/src/H5SMbtree2.c b/src/H5SMbtree2.c
index 01c3fe3..6f71966 100644
--- a/src/H5SMbtree2.c
+++ b/src/H5SMbtree2.c
@@ -187,12 +187,12 @@ H5SM__bt2_debug(FILE *stream, int indent, int fwidth, const void *record, const
FUNC_ENTER_STATIC_NOERR
if (sohm->location == H5SM_IN_HEAP)
- HDfprintf(stream, "%*s%-*s {%a, %lo, %Hx}\n", indent, "", fwidth,
- "Shared Message in heap:", sohm->u.heap_loc.fheap_id, sohm->hash,
+ HDfprintf(stream, "%*s%-*s {%" PRIu64 ", %" PRIo32 ", %" PRIxHSIZE "}\n", indent, "", fwidth,
+ "Shared Message in heap:", sohm->u.heap_loc.fheap_id.val, sohm->hash,
sohm->u.heap_loc.ref_count);
else {
HDassert(sohm->location == H5SM_IN_OH);
- HDfprintf(stream, "%*s%-*s {%a, %lo, %Hx, %Hx}\n", indent, "", fwidth,
+ HDfprintf(stream, "%*s%-*s {%" PRIuHADDR ", %" PRIo32 ", %x, %" PRIx32 "}\n", indent, "", fwidth,
"Shared Message in OH:", sohm->u.mesg_loc.oh_addr, sohm->hash, sohm->msg_type_id,
sohm->u.mesg_loc.index);
} /* end else */
diff --git a/src/H5ST.c b/src/H5ST.c
deleted file mode 100644
index 53829b2..0000000
--- a/src/H5ST.c
+++ /dev/null
@@ -1,779 +0,0 @@
-/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
- * Copyright by The HDF Group. *
- * Copyright by the Board of Trustees of the University of Illinois. *
- * All rights reserved. *
- * *
- * This file is part of HDF5. The full HDF5 copyright notice, including *
- * terms governing use, modification, and redistribution, is contained in *
- * the COPYING file, which can be found at the root of the source code *
- * distribution tree, or in https://www.hdfgroup.org/licenses. *
- * If you do not have access to either file, you may request a copy from *
- * help@hdfgroup.org. *
- * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
-
-/* TERNARY SEARCH TREE ALGS
- This code is described in "Ternary Search Trees" by Jon
-Bentley and Robert Sedgewick in the April, 1998, Dr. Dobb's Journal.
-*/
-
-#include "H5Eprivate.h" /* Error handling */
-#include "H5FLprivate.h" /* Free lists */
-#include "H5STprivate.h" /* Ternary search trees */
-
-#ifdef H5ST_DEBUG
-static herr_t H5ST__dump_internal(H5ST_ptr_t p);
-#endif /* H5ST_DEBUG */
-
-/* Declare a free list to manage the H5ST_node_t struct */
-H5FL_DEFINE_STATIC(H5ST_node_t);
-
-/* Declare a free list to manage the H5ST_tree_t struct */
-H5FL_DEFINE_STATIC(H5ST_tree_t);
-
-/*--------------------------------------------------------------------------
- NAME
- H5ST_create
- PURPOSE
- Create a TST
- USAGE
- H5ST_ptr_t H5ST_create()
-
- RETURNS
- Returns a pointer to the new TST tree on success, NULL on failure.
- DESCRIPTION
- Create a TST.
- GLOBAL VARIABLES
- COMMENTS, BUGS, ASSUMPTIONS
- EXAMPLES
- REVISION LOG
---------------------------------------------------------------------------*/
-H5ST_tree_t *
-H5ST_create(void)
-{
- H5ST_tree_t *ret_value; /* Return value */
-
- FUNC_ENTER_NOAPI(NULL)
-
- /* Allocate wrapper for TST */
- if (NULL == (ret_value = H5FL_MALLOC(H5ST_tree_t)))
- HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "memory allocation failed")
-
- /* Set the internal fields */
- ret_value->root = NULL;
-
-done:
- FUNC_LEAVE_NOAPI(ret_value)
-} /* end H5ST_create() */
-
-/*--------------------------------------------------------------------------
- NAME
- H5ST_close_internal
- PURPOSE
- Close a TST, deallocating it.
- USAGE
- herr_t H5ST_close(p)
- H5ST_ptr_t p; IN/OUT: Root of TST to free
-
- RETURNS
- Returns non-negative on success, negative on failure.
- DESCRIPTION
- Close a TST, freeing all nodes.
- GLOBAL VARIABLES
- COMMENTS, BUGS, ASSUMPTIONS
- EXAMPLES
- REVISION LOG
---------------------------------------------------------------------------*/
-static herr_t
-H5ST_close_internal(H5ST_ptr_t p)
-{
- FUNC_ENTER_NOAPI_NOINIT_NOERR
-
- /* Recursively free TST */
- if (p) {
- H5ST_close_internal(p->lokid);
- if (p->splitchar)
- H5ST_close_internal(p->eqkid);
- H5ST_close_internal(p->hikid);
- p = H5FL_FREE(H5ST_node_t, p);
- } /* end if */
-
- FUNC_LEAVE_NOAPI(SUCCEED)
-} /* end H5ST_close_internal() */
-
-/*--------------------------------------------------------------------------
- NAME
- H5ST_close
- PURPOSE
- Close a TST, deallocating it.
- USAGE
- herr_t H5ST_close(tree)
- H5ST_tree_t *tree; IN/OUT: TST tree to free
-
- RETURNS
- Returns non-negative on success, negative on failure.
- DESCRIPTION
- Close a TST, freeing all nodes.
- GLOBAL VARIABLES
- COMMENTS, BUGS, ASSUMPTIONS
- EXAMPLES
- REVISION LOG
---------------------------------------------------------------------------*/
-herr_t
-H5ST_close(H5ST_tree_t *tree)
-{
- herr_t ret_value = SUCCEED; /* Return value */
-
- FUNC_ENTER_NOAPI(FAIL)
-
- /* Check arguments */
- if (NULL == tree)
- HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "invalid TST")
-
- /* Free the TST itself */
- if (H5ST_close_internal(tree->root) < 0)
- HGOTO_ERROR(H5E_TST, H5E_CANTFREE, FAIL, "can't free TST")
-
- /* Free root node itself */
- tree = H5FL_FREE(H5ST_tree_t, tree);
-
-done:
- FUNC_LEAVE_NOAPI(ret_value)
-} /* end H5ST_close() */
-
-/*--------------------------------------------------------------------------
- NAME
- H5ST_insert
- PURPOSE
- Insert a string/object pair into a TST
- USAGE
- herr_t H5ST_insert(tree,s,obj)
- H5ST_tree_t *tree; IN/OUT: TST to insert string into
- const char *s; IN: String to use as key for object
- void *obj; IN: Pointer to object to insert
-
- RETURNS
- Returns non-negative on success, negative on failure.
- DESCRIPTION
- Insert a key (string)/object pair into a TST
- GLOBAL VARIABLES
- COMMENTS, BUGS, ASSUMPTIONS
- EXAMPLES
- REVISION LOG
---------------------------------------------------------------------------*/
-herr_t
-H5ST_insert(H5ST_tree_t *tree, const char *s, void *obj)
-{
- int d; /* Comparison value */
- H5ST_ptr_t pp, *p; /* Pointer to current node and pointer to that */
- H5ST_ptr_t parent = NULL; /* Pointer to parent node */
- H5ST_ptr_t up = NULL; /* Pointer to up node */
- herr_t ret_value = SUCCEED; /* Return value */
-
- FUNC_ENTER_NOAPI(FAIL)
-
- /* Find the correct location to insert object */
- p = &tree->root;
- while ((pp = *p)) {
- /* If this node matches the character in the key, then drop down to the lower tree */
- if (0 == (d = *s - pp->splitchar)) {
- if (*s++ == 0)
- HGOTO_ERROR(H5E_TST, H5E_EXISTS, FAIL, "key already in tree")
- up = pp;
- p = &(pp->eqkid);
- } /* end if */
- else {
- /* Walk through the current tree, searching for the matching character */
- parent = pp;
- if (d < 0)
- p = &(pp->lokid);
- else
- p = &(pp->hikid);
- } /* end else */
- } /* end while */
-
- /* Finish walking through the key string, adding nodes until the end */
- for (;;) {
- if (NULL == (*p = H5FL_MALLOC(H5ST_node_t)))
- HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "memory allocation failed")
- pp = *p;
- pp->splitchar = *s;
- pp->up = up;
- pp->parent = parent;
- pp->lokid = pp->eqkid = pp->hikid = NULL;
-
- /* If this is the end of the key string, break out */
- if (*s++ == 0) {
- pp->eqkid = (H5ST_ptr_t)obj;
- break;
- } /* end if */
-
- /* Continue to next character */
- parent = NULL;
- up = pp;
- p = &(pp->eqkid);
- } /* end for */
-
-done:
- FUNC_LEAVE_NOAPI(ret_value)
-} /* end H5ST_insert() */
-
-/*--------------------------------------------------------------------------
- NAME
- H5ST_search
- PURPOSE
- Determine if a key is in the TST
- USAGE
- hbool_t H5ST_search(tree,s)
- H5ST_tree_t *tree; IN: TST to find string in
- const char *s; IN: String to use as key to locate
-
- RETURNS
- Success: TRUE if key string in TST, FALSE if not
- Failure: negative
- DESCRIPTION
- Locate a key (string) in a TST
- GLOBAL VARIABLES
- COMMENTS, BUGS, ASSUMPTIONS
- EXAMPLES
- REVISION LOG
---------------------------------------------------------------------------*/
-htri_t
-H5ST_search(H5ST_tree_t *tree, const char *s)
-{
- H5ST_ptr_t p; /* Temporary pointer to TST node */
- htri_t ret_value = FALSE; /* Return value */
-
- FUNC_ENTER_NOAPI_NOINIT_NOERR
-
- p = tree->root;
- while (p) {
- if (*s < p->splitchar)
- p = p->lokid;
- else if (*s == p->splitchar) {
- if (*s++ == 0)
- HGOTO_DONE(TRUE);
- p = p->eqkid;
- }
- else
- p = p->hikid;
- } /* end while */
-
-done:
- FUNC_LEAVE_NOAPI(ret_value)
-} /* end H5ST_search() */
-
-/*--------------------------------------------------------------------------
- NAME
- H5ST_find_internal
- PURPOSE
- Find the node matching a particular key string
- USAGE
- H5ST_ptr_t H5ST_find(p,s)
- H5ST_ptr_t p; IN: TST to find string in
- const char *s; IN: String to use as key to locate
-
- RETURNS
- Success: Non-NULL
- Failure: NULL
- DESCRIPTION
- Locate a key (string) in a TST
- GLOBAL VARIABLES
- COMMENTS, BUGS, ASSUMPTIONS
- EXAMPLES
- REVISION LOG
---------------------------------------------------------------------------*/
-static H5ST_ptr_t
-H5ST_find_internal(H5ST_ptr_t p, const char *s)
-{
- H5ST_ptr_t ret_value = NULL; /* Return value */
-
- FUNC_ENTER_NOAPI_NOINIT_NOERR
-
- while (p) {
- if (*s < p->splitchar)
- p = p->lokid;
- else if (*s == p->splitchar) {
- if (*s++ == 0)
- HGOTO_DONE(p);
- p = p->eqkid;
- }
- else
- p = p->hikid;
- } /* end while */
-
-done:
- FUNC_LEAVE_NOAPI(ret_value)
-} /* end H5ST_find_internal() */
-
-/*--------------------------------------------------------------------------
- NAME
- H5ST_find
- PURPOSE
- Find the node matching a particular key string
- USAGE
- H5ST_ptr_t H5ST_find(tree,s)
- H5ST_tree_t *tree; IN: TST to find string in
- const char *s; IN: String to use as key to locate
-
- RETURNS
- Success: Non-NULL
- Failure: NULL
- DESCRIPTION
- Locate a key (string) in a TST
- GLOBAL VARIABLES
- COMMENTS, BUGS, ASSUMPTIONS
- EXAMPLES
- REVISION LOG
---------------------------------------------------------------------------*/
-H5ST_ptr_t
-H5ST_find(H5ST_tree_t *tree, const char *s)
-{
- H5ST_ptr_t ret_value; /* Return value */
-
- FUNC_ENTER_NOAPI(NULL)
-
- if (NULL == (ret_value = H5ST_find_internal(tree->root, s)))
- HGOTO_ERROR(H5E_TST, H5E_NOTFOUND, NULL, "key not found in TST")
-
-done:
- FUNC_LEAVE_NOAPI(ret_value)
-} /* end H5ST_find() */
-
-/*--------------------------------------------------------------------------
- NAME
- H5ST_locate
- PURPOSE
- Find an object in a TST
- USAGE
- void *H5ST_locate(tree,s)
- H5ST_tree_t *tree; IN: TST to locate object within
- const char *s; IN: String of key for object to locate
- RETURNS
- Success: Non-NULL, pointer to object stored for key
- Failure: Negative
- DESCRIPTION
- Locate a node in a TST, returning the object from the node.
- GLOBAL VARIABLES
- COMMENTS, BUGS, ASSUMPTIONS
- EXAMPLES
- REVISION LOG
---------------------------------------------------------------------------*/
-void *
-H5ST_locate(H5ST_tree_t *tree, const char *s)
-{
- H5ST_ptr_t node; /* Pointer to node located */
- void * ret_value; /* Return value */
-
- FUNC_ENTER_NOAPI(NULL)
-
- /* Locate the node to remove */
- if (NULL == (node = H5ST_find_internal(tree->root, s)))
- HGOTO_ERROR(H5E_TST, H5E_NOTFOUND, NULL, "key not found in TST")
-
- /* Get the pointer to the object to return */
- ret_value = node->eqkid;
-
-done:
- FUNC_LEAVE_NOAPI(ret_value)
-} /* H5ST_locate() */
-
-/*--------------------------------------------------------------------------
- NAME
- H5ST_findfirst_internal
- PURPOSE
- Find the first node in a TST
- USAGE
- H5ST_ptr_t H5ST_findfirst_internal(p)
- H5ST_ptr_t p; IN: TST to locate first node within
- RETURNS
- Success: Non-NULL
- Failure: NULL
- DESCRIPTION
- Get the first (lexicographically) node in a TST
- GLOBAL VARIABLES
- COMMENTS, BUGS, ASSUMPTIONS
- EXAMPLES
- REVISION LOG
---------------------------------------------------------------------------*/
-static H5ST_ptr_t
-H5ST_findfirst_internal(H5ST_ptr_t p)
-{
- H5ST_ptr_t ret_value = NULL; /* Return value */
-
- FUNC_ENTER_NOAPI_NOINIT_NOERR
-
- while (p) {
- /* Find least node in current tree */
- while (p->lokid)
- p = p->lokid;
-
- /* Is least node '\0'? */
- if (p->splitchar == '\0') {
- /* Return it */
- HGOTO_DONE(p);
- } /* end if */
- else {
- /* Go down to next level of tree */
- p = p->eqkid;
- } /* end else */
- } /* end while */
-
-done:
- FUNC_LEAVE_NOAPI(ret_value)
-} /* end H5ST_findfirst_internal() */
-
-/*--------------------------------------------------------------------------
- NAME
- H5ST_findfirst
- PURPOSE
- Find the first node in a TST
- USAGE
- H5ST_ptr_t H5ST_findfirst(tree)
- H5ST_tree_t *tree; IN: TST to locate first node within
- RETURNS
- Success: Non-NULL
- Failure: NULL
- DESCRIPTION
- Get the first (lexicographically) node in a TST
- GLOBAL VARIABLES
- COMMENTS, BUGS, ASSUMPTIONS
- EXAMPLES
- REVISION LOG
---------------------------------------------------------------------------*/
-H5ST_ptr_t
-H5ST_findfirst(H5ST_tree_t *tree)
-{
- H5ST_ptr_t ret_value; /* Return value */
-
- FUNC_ENTER_NOAPI(NULL)
-
- if (NULL == (ret_value = H5ST_findfirst_internal(tree->root)))
- HGOTO_ERROR(H5E_TST, H5E_NOTFOUND, NULL, "no nodes in TST");
-
-done:
- FUNC_LEAVE_NOAPI(ret_value)
-} /* end H5ST_findfirst() */
-
-/*--------------------------------------------------------------------------
- NAME
- H5ST_getnext
- PURPOSE
- Internal routine to find the next node in a given level of a TST
- USAGE
- H5ST_ptr_t H5ST_getnext(p)
- H5ST_ptr_t *p; IN: Pointer to node to find next node from
- RETURNS
- Success: Non-NULL
- Failure: NULL
- DESCRIPTION
- Get the next (lexicographically) node in the current level of a TST
- GLOBAL VARIABLES
- COMMENTS, BUGS, ASSUMPTIONS
- EXAMPLES
- REVISION LOG
---------------------------------------------------------------------------*/
-static H5ST_ptr_t
-H5ST_getnext(H5ST_ptr_t p)
-{
- H5ST_ptr_t ret_value = NULL; /* Return value */
-
- FUNC_ENTER_NOAPI_NOINIT_NOERR
-
- /* If the node to continue from has higher-valued nodes attached */
- if (p->hikid) {
- /* Go to first higher-valued node */
- p = p->hikid;
-
- /* Find least node from here */
- while (p->lokid)
- p = p->lokid;
- HGOTO_DONE(p);
- } /* end if */
- else {
- H5ST_ptr_t q; /* Temporary TST node pointer */
-
- /* Go up one level in current tree */
- q = p->parent;
- if (q == NULL)
- HGOTO_DONE(NULL);
-
- /* While the previous node was the higher-valued node, keep backing up the tree */
- while (q->hikid == p) {
- p = q;
- q = p->parent;
- if (NULL == q)
- HGOTO_DONE(NULL);
- } /* end while */
- HGOTO_DONE(q);
- } /* end else */
-
-done:
- FUNC_LEAVE_NOAPI(ret_value)
-} /* end H5ST_getnext() */
-
-/*--------------------------------------------------------------------------
- NAME
- H5ST_findnext
- PURPOSE
- Find the next node from a node in a TST
- USAGE
- H5ST_ptr_t H5ST_findnext(p)
- H5ST_ptr_t p; IN: Current node to continue from
- RETURNS
- Success: Non-NULL
- Failure: NULL
- DESCRIPTION
- Get the next (lexicographically) node in a TST
- GLOBAL VARIABLES
- COMMENTS, BUGS, ASSUMPTIONS
- EXAMPLES
- REVISION LOG
---------------------------------------------------------------------------*/
-H5ST_ptr_t
-H5ST_findnext(H5ST_ptr_t p)
-{
- H5ST_ptr_t q; /* Temporary pointer to TST node */
- H5ST_ptr_t ret_value = NULL; /* Return value */
-
- FUNC_ENTER_NOAPI_NOINIT_NOERR
-
- /* Find the next node at the current level, or go back up the tree */
- do {
- q = H5ST_getnext(p);
- if (q) {
- HGOTO_DONE(H5ST_findfirst_internal(q->eqkid));
- } /* end if */
- else
- p = p->up;
- } while (p);
-
-done:
- FUNC_LEAVE_NOAPI(ret_value)
-} /* end H5ST_findnext() */
-
-/*--------------------------------------------------------------------------
- NAME
- H5ST_delete_internal
- PURPOSE
- Delete a node from a TST
- USAGE
- herr_t H5ST_delete_internal(root,p)
- H5ST_ptr_t *root; IN/OUT: Root of TST to delete node from
- H5ST_ptr_t p; IN: Node to delete
- RETURNS
- Success: Non-negative
- Failure: Negative
- DESCRIPTION
- Delete a node from a TST.
- GLOBAL VARIABLES
- COMMENTS, BUGS, ASSUMPTIONS
- This should be the final node for a string.
- EXAMPLES
- REVISION LOG
---------------------------------------------------------------------------*/
-static herr_t
-H5ST_delete_internal(H5ST_ptr_t *root, H5ST_ptr_t p)
-{
- H5ST_ptr_t q, /* Temporary pointer to TST node */
- newp; /* Pointer to node which will replace deleted node in tree */
-
- FUNC_ENTER_NOAPI_NOINIT_NOERR
-
- /* Find node to replace one being deleted */
- if (p->lokid) {
- /* If the deleted node has lo & hi kids, attach them together */
- if (p->hikid) {
- q = p->lokid;
- while (q->hikid)
- q = q->hikid;
- q->hikid = p->hikid;
- p->hikid->parent = q;
- } /* end if */
- newp = p->lokid;
- } /* end if */
- else if (p->hikid) {
- newp = p->hikid;
- } /* end if */
- else {
- newp = NULL;
- } /* end else */
-
- /* Deleted node is in middle of tree */
- if (p->parent) {
- /* Attach new node to correct side of parent */
- if (p == p->parent->lokid)
- p->parent->lokid = newp;
- else
- p->parent->hikid = newp;
- if (newp)
- newp->parent = p->parent;
- } /* end if */
- else {
- if (newp)
- newp->parent = p->parent;
- if (p->up) {
- p->up->eqkid = newp;
-
- /* If we deleted the last node in the TST, delete the upper node also */
- if (NULL == newp)
- H5ST_delete_internal(root, p->up);
- } /* end if */
- else /* Deleted last node at top level of tree */
- *root = newp;
- } /* end else */
-
- p = H5FL_FREE(H5ST_node_t, p);
-
- FUNC_LEAVE_NOAPI(SUCCEED)
-} /* end H5ST_delete_internal() */
-
-/*--------------------------------------------------------------------------
- NAME
- H5ST_delete
- PURPOSE
- Delete a node from a TST
- USAGE
- herr_t H5ST_delete(tree,p)
- H5ST_tree_t *tree; IN/OUT: TST to delete node from
- H5ST_ptr_t p; IN: Node to delete
- RETURNS
- Success: Non-negative
- Failure: Negative
- DESCRIPTION
- Delete a node from a TST.
- GLOBAL VARIABLES
- COMMENTS, BUGS, ASSUMPTIONS
- This should be the final node for a string.
- EXAMPLES
- REVISION LOG
---------------------------------------------------------------------------*/
-herr_t
-H5ST_delete(H5ST_tree_t *tree, H5ST_ptr_t p)
-{
- herr_t ret_value = SUCCEED; /* Return value */
-
- FUNC_ENTER_NOAPI(FAIL)
-
- if (H5ST_delete_internal(&tree->root, p) < 0)
- HGOTO_ERROR(H5E_TST, H5E_CANTDELETE, FAIL, "can't delete node from TST")
-
-done:
- FUNC_LEAVE_NOAPI(ret_value)
-} /* end H5ST_delete() */
-
-/*--------------------------------------------------------------------------
- NAME
- H5ST_remove
- PURPOSE
- Remove a node from a TST
- USAGE
- void *H5ST_remove(tree,s)
- H5ST_tree_t *tree; IN/OUT: TST to remove node from
- const char *s; IN: String of key for node to remove
- RETURNS
- Success: Non-NULL, pointer to object stored for key
- Failure: Negative
- DESCRIPTION
- Remove a node from a TST, returning the object from the node.
- GLOBAL VARIABLES
- COMMENTS, BUGS, ASSUMPTIONS
- EXAMPLES
- REVISION LOG
---------------------------------------------------------------------------*/
-void *
-H5ST_remove(H5ST_tree_t *tree, const char *s)
-{
- H5ST_ptr_t node; /* Pointer to node to remove */
- void * ret_value; /* Return value */
-
- FUNC_ENTER_NOAPI(NULL)
-
- /* Locate the node to remove */
- if (NULL == (node = H5ST_find_internal(tree->root, s)))
- HGOTO_ERROR(H5E_TST, H5E_NOTFOUND, NULL, "key not found in TST")
-
- /* Get the pointer to the object to return */
- ret_value = node->eqkid;
-
- /* Remove the node from the TST */
- if (H5ST_delete_internal(&tree->root, node) < 0)
- HGOTO_ERROR(H5E_TST, H5E_CANTDELETE, NULL, "can't delete node from TST")
-
-done:
- FUNC_LEAVE_NOAPI(ret_value)
-} /* H5ST_remove() */
-
-#ifdef H5ST_DEBUG
-
-/*--------------------------------------------------------------------------
- NAME
- H5ST__dump_internal
- PURPOSE
- Dump all the nodes of a TST
- USAGE
- herr_t H5ST_dump(p)
- H5ST_ptr_t p; IN: Root of TST to dump
- RETURNS
- Success: Non-negative
- Failure: Negative
- DESCRIPTION
- Dump information for a TST.
- GLOBAL VARIABLES
- COMMENTS, BUGS, ASSUMPTIONS
- EXAMPLES
- REVISION LOG
---------------------------------------------------------------------------*/
-static herr_t
-H5ST__dump_internal(H5ST_ptr_t p)
-{
- FUNC_ENTER_STATIC_NOERR
-
- if (p) {
- HDprintf("p=%p\n", (void *)p);
- HDprintf("\tp->up=%p\n", (void *)p->up);
- HDprintf("\tp->parent=%p\n", (void *)p->parent);
- HDprintf("\tp->lokid=%p\n", (void *)p->lokid);
- HDprintf("\tp->hikid=%p\n", (void *)p->hikid);
- HDprintf("\tp->eqkid=%p\n", (void *)p->eqkid);
- HDprintf("\tp->splitchar=%c\n", p->splitchar);
-
- H5ST__dump_internal(p->lokid);
- if (p->splitchar)
- H5ST__dump_internal(p->eqkid);
- else
- HDprintf("%s\n", (char *)p->eqkid);
- H5ST__dump_internal(p->hikid);
- } /* end if */
-
- FUNC_LEAVE_NOAPI(SUCCEED)
-} /* end H5ST__dump_internal() */
-
-/*--------------------------------------------------------------------------
- NAME
- H5ST_dump
- PURPOSE
- Dump all the nodes of a TST
- USAGE
- herr_t H5ST_dump(tree)
- H5ST_tree_t *tree; IN: TST to dump
- RETURNS
- Success: Non-negative
- Failure: Negative
- DESCRIPTION
- Dump information for a TST.
- GLOBAL VARIABLES
- COMMENTS, BUGS, ASSUMPTIONS
- EXAMPLES
- REVISION LOG
---------------------------------------------------------------------------*/
-herr_t
-H5ST_dump(H5ST_tree_t *tree)
-{
- FUNC_ENTER_NOAPI_NOINIT_NOERR
-
- /* Dump the tree */
- H5ST__dump_internal(tree->root);
-
- FUNC_LEAVE_NOAPI(SUCCEED)
-} /* end H5ST_dump() */
-#endif /* H5ST_DEBUG */
diff --git a/src/H5STprivate.h b/src/H5STprivate.h
deleted file mode 100644
index c9d643e..0000000
--- a/src/H5STprivate.h
+++ /dev/null
@@ -1,63 +0,0 @@
-/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
- * Copyright by The HDF Group. *
- * Copyright by the Board of Trustees of the University of Illinois. *
- * All rights reserved. *
- * *
- * This file is part of HDF5. The full HDF5 copyright notice, including *
- * terms governing use, modification, and redistribution, is contained in *
- * the COPYING file, which can be found at the root of the source code *
- * distribution tree, or in https://www.hdfgroup.org/licenses. *
- * If you do not have access to either file, you may request a copy from *
- * help@hdfgroup.org. *
- * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
-
-/*
- * This file contains private information about the H5ST module
- */
-#ifndef _H5STprivate_H
-#define _H5STprivate_H
-
-#ifdef LATER
-#include "H5STpublic.h"
-#endif /* LATER */
-
-/* Private headers needed by this file */
-#include "H5private.h"
-
-/* Typedefs */
-
-/* Internal nodes for TST */
-typedef struct H5ST_node *H5ST_ptr_t;
-typedef struct H5ST_node {
- char splitchar; /* Character represented at node */
- H5ST_ptr_t up; /* Pointer to the node in the tree above (before) this node */
- H5ST_ptr_t parent; /* Pointer to the next higher tree node in this tree */
- H5ST_ptr_t lokid; /* Pointer to the lower node from this one, in this tree */
- H5ST_ptr_t eqkid; /* Pointer to the parent node in the next tree down (after) this node */
- H5ST_ptr_t hikid; /* Pointer to the higher node from this one, in this tree */
-} H5ST_node_t;
-
-/* Wrapper about TST */
-typedef struct {
- H5ST_ptr_t root; /* Pointer to actual TST */
-} H5ST_tree_t;
-
-/* Macro to access "data" pointer in H5ST_node_t's returned from functions */
-#define H5ST_NODE_DATA(p) ((void *)(p->eqkid))
-
-/* Private routines */
-H5_DLL H5ST_tree_t *H5ST_create(void);
-H5_DLL herr_t H5ST_close(H5ST_tree_t *p);
-H5_DLL herr_t H5ST_insert(H5ST_tree_t *root, const char *s, void *obj);
-H5_DLL htri_t H5ST_search(H5ST_tree_t *root, const char *s);
-H5_DLL H5ST_ptr_t H5ST_find(H5ST_tree_t *root, const char *s);
-H5_DLL void * H5ST_locate(H5ST_tree_t *root, const char *s);
-H5_DLL H5ST_ptr_t H5ST_findfirst(H5ST_tree_t *p);
-H5_DLL H5ST_ptr_t H5ST_findnext(H5ST_ptr_t p);
-H5_DLL void * H5ST_remove(H5ST_tree_t *root, const char *s);
-H5_DLL herr_t H5ST_delete(H5ST_tree_t *root, H5ST_ptr_t p);
-#ifdef H5ST_DEBUG
-H5_DLL herr_t H5ST_dump(H5ST_tree_t *tree);
-#endif /* H5ST_DEBUG */
-
-#endif /* _H5STprivate_H */
diff --git a/src/H5Sall.c b/src/H5Sall.c
index 8eeebbc..35ddf3d 100644
--- a/src/H5Sall.c
+++ b/src/H5Sall.c
@@ -12,7 +12,7 @@
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
/*
- * Programmer: Quincey Koziol <koziol@ncsa.uiuc.edu>
+ * Programmer: Quincey Koziol
* Tuesday, June 16, 1998
*
* Purpose: "All" selection dataspace I/O functions.
diff --git a/src/H5Sdbg.c b/src/H5Sdbg.c
index b4ead95..d20916b 100644
--- a/src/H5Sdbg.c
+++ b/src/H5Sdbg.c
@@ -17,7 +17,6 @@
* Quincey Koziol
* Jul 24 2007
*
- *
* Purpose: Dump debugging information about a dataspace
*
*-------------------------------------------------------------------------
diff --git a/src/H5Sdeprec.c b/src/H5Sdeprec.c
index 3e3909c..d050102 100644
--- a/src/H5Sdeprec.c
+++ b/src/H5Sdeprec.c
@@ -78,7 +78,6 @@
* Failure: negative
*
* Programmer: Raymond Lu
- * slu@ncsa.uiuc.edu
* July 14, 2004
*
*-------------------------------------------------------------------------
diff --git a/src/H5Shyper.c b/src/H5Shyper.c
index f081468..e12ff93 100644
--- a/src/H5Shyper.c
+++ b/src/H5Shyper.c
@@ -1104,10 +1104,10 @@ H5S__hyper_iter_next(H5S_sel_iter_t *iter, size_t nelem)
} /* end if */
/* Must be an irregular hyperslab selection */
else {
- H5S_hyper_span_t * curr_span; /* Current hyperslab span node */
- H5S_hyper_span_t **ispan; /* Iterator's hyperslab span nodes */
- hsize_t * abs_arr; /* Absolute hyperslab span position */
- int curr_dim; /* Temporary rank holder */
+ H5S_hyper_span_t * curr_span = NULL; /* Current hyperslab span node */
+ H5S_hyper_span_t **ispan; /* Iterator's hyperslab span nodes */
+ hsize_t * abs_arr; /* Absolute hyperslab span position */
+ int curr_dim; /* Temporary rank holder */
/* Set the rank of the fastest changing dimension */
ndims = iter->rank;
@@ -1296,10 +1296,10 @@ H5S__hyper_iter_next_block(H5S_sel_iter_t *iter)
} /* end if */
/* Must be an irregular hyperslab selection */
else {
- H5S_hyper_span_t * curr_span; /* Current hyperslab span node */
- H5S_hyper_span_t **ispan; /* Iterator's hyperslab span nodes */
- hsize_t * abs_arr; /* Absolute hyperslab span position */
- int curr_dim; /* Temporary rank holder */
+ H5S_hyper_span_t * curr_span = NULL; /* Current hyperslab span node */
+ H5S_hyper_span_t **ispan; /* Iterator's hyperslab span nodes */
+ hsize_t * abs_arr; /* Absolute hyperslab span position */
+ int curr_dim; /* Temporary rank holder */
/* Set the rank of the fastest changing dimension */
ndims = iter->rank;
@@ -2138,24 +2138,31 @@ H5S__hyper_iter_get_seq_list_opt(H5S_sel_iter_t *iter, size_t maxseq, size_t max
case 0:
do {
DUFF_GUTS
+ /* FALLTHROUGH */
H5_ATTR_FALLTHROUGH
case 7:
DUFF_GUTS
+ /* FALLTHROUGH */
H5_ATTR_FALLTHROUGH
case 6:
DUFF_GUTS
+ /* FALLTHROUGH */
H5_ATTR_FALLTHROUGH
case 5:
DUFF_GUTS
+ /* FALLTHROUGH */
H5_ATTR_FALLTHROUGH
case 4:
DUFF_GUTS
+ /* FALLTHROUGH */
H5_ATTR_FALLTHROUGH
case 3:
DUFF_GUTS
+ /* FALLTHROUGH */
H5_ATTR_FALLTHROUGH
case 2:
DUFF_GUTS
+ /* FALLTHROUGH */
H5_ATTR_FALLTHROUGH
case 1:
DUFF_GUTS
@@ -4766,13 +4773,13 @@ H5S__get_select_hyper_blocklist(H5S_t *space, hsize_t startblock, hsize_t numblo
--------------------------------------------------------------------------*/
herr_t
H5Sget_select_hyper_blocklist(hid_t spaceid, hsize_t startblock, hsize_t numblocks,
- hsize_t buf[/*numblocks*/])
+ hsize_t buf[/*numblocks*/] /*out*/)
{
H5S_t *space; /* Dataspace to modify selection of */
herr_t ret_value; /* return value */
FUNC_ENTER_API(FAIL)
- H5TRACE4("e", "ihh*[a2]h", spaceid, startblock, numblocks, buf);
+ H5TRACE4("e", "ihhx", spaceid, startblock, numblocks, buf);
/* Check args */
if (buf == NULL)
@@ -5388,7 +5395,7 @@ H5S__hyper_spans_shape_same_helper(const H5S_hyper_span_info_t *span_info1,
{
hbool_t ret_value = TRUE; /* Return value */
- FUNC_ENTER_PACKAGE_NOERR
+ FUNC_ENTER_STATIC_NOERR
/* Sanity checks */
HDassert(span_info1);
@@ -7004,9 +7011,8 @@ H5S__hyper_adjust_s(H5S_t *space, const hssize_t *offset)
{
hbool_t non_zero_offset = FALSE; /* Whether any offset is non-zero */
unsigned u; /* Local index variable */
- herr_t ret_value = SUCCEED; /* Return value */
- FUNC_ENTER_NOAPI(FAIL)
+ FUNC_ENTER_STATIC_NOERR
/* Sanity checks */
HDassert(space);
@@ -7053,8 +7059,7 @@ H5S__hyper_adjust_s(H5S_t *space, const hssize_t *offset)
} /* end if */
}
-done:
- FUNC_LEAVE_NOAPI(ret_value)
+ FUNC_LEAVE_NOAPI(SUCCEED)
} /* end H5S__hyper_adjust_s() */
/*--------------------------------------------------------------------------
@@ -9666,7 +9671,7 @@ H5S__hyper_regular_and_single_block(H5S_t *space, const hsize_t start[], const h
unsigned u; /* Local index variable */
herr_t ret_value = SUCCEED; /* Return value */
- FUNC_ENTER_NOAPI(FAIL)
+ FUNC_ENTER_STATIC
/* Check args */
HDassert(space);
@@ -10103,7 +10108,7 @@ H5S_select_hyperslab(H5S_t *space, H5S_seloper_t op, const hsize_t start[], cons
case H5S_SEL_POINTS: /* Can't combine hyperslab operations and point selections currently */
if (op == H5S_SELECT_SET) /* Allow only "set" operation to proceed */
break;
- /* Else fall through to error */
+ /* FALLTHROUGH (to error) */
H5_ATTR_FALLTHROUGH
case H5S_SEL_ERROR:
@@ -10268,7 +10273,7 @@ done:
Specify a hyperslab to combine with the current hyperslab selection, and
store the result in the new hyperslab selection.
USAGE
- herr_t H5S_combine_hyperslab(new_space, old_space, op, start, stride, count, block)
+ herr_t H5S_combine_hyperslab(old_space, op, start, stride, count, block, new_space)
H5S_t *old_space; IN: The old space the selection is performed on
H5S_seloper_t op; IN: Operation to perform on current selection
const hsize_t start[]; IN: Offset of start of hyperslab
@@ -10292,7 +10297,7 @@ done:
REVISION LOG
--------------------------------------------------------------------------*/
herr_t
-H5S_combine_hyperslab(H5S_t *old_space, H5S_seloper_t op, const hsize_t start[], const hsize_t *stride,
+H5S_combine_hyperslab(const H5S_t *old_space, H5S_seloper_t op, const hsize_t start[], const hsize_t *stride,
const hsize_t count[], const hsize_t *block, H5S_t **new_space)
{
unsigned u; /* Local index variable */
@@ -10573,9 +10578,9 @@ H5Scombine_hyperslab(hid_t space_id, H5S_seloper_t op, const hsize_t start[], co
if (H5S_combine_hyperslab(space, op, start, stride, count, block, &new_space) < 0)
HGOTO_ERROR(H5E_DATASPACE, H5E_CANTINIT, H5I_INVALID_HID, "unable to set hyperslab selection")
- /* Atomize */
+ /* Register */
if ((ret_value = H5I_register(H5I_DATASPACE, new_space, TRUE)) < 0)
- HGOTO_ERROR(H5E_ATOM, H5E_CANTREGISTER, H5I_INVALID_HID, "unable to register dataspace atom")
+ HGOTO_ERROR(H5E_ID, H5E_CANTREGISTER, H5I_INVALID_HID, "unable to register dataspace ID")
done:
if (ret_value < 0 && new_space)
@@ -10715,9 +10720,9 @@ H5Scombine_select(hid_t space1_id, H5S_seloper_t op, hid_t space2_id)
if (NULL == (new_space = H5S__combine_select(space1, op, space2)))
HGOTO_ERROR(H5E_DATASPACE, H5E_CANTINIT, H5I_INVALID_HID, "unable to create hyperslab selection")
- /* Atomize */
+ /* Register */
if ((ret_value = H5I_register(H5I_DATASPACE, new_space, TRUE)) < 0)
- HGOTO_ERROR(H5E_ATOM, H5E_CANTREGISTER, H5I_INVALID_HID, "unable to register dataspace atom")
+ HGOTO_ERROR(H5E_ID, H5E_CANTREGISTER, H5I_INVALID_HID, "unable to register dataspace ID")
done:
if (ret_value < 0 && new_space)
@@ -12353,14 +12358,15 @@ done:
REVISION LOG
--------------------------------------------------------------------------*/
herr_t
-H5Sget_regular_hyperslab(hid_t spaceid, hsize_t start[], hsize_t stride[], hsize_t count[], hsize_t block[])
+H5Sget_regular_hyperslab(hid_t spaceid, hsize_t start[] /*out*/, hsize_t stride[] /*out*/,
+ hsize_t count[] /*out*/, hsize_t block[] /*out*/)
{
H5S_t * space; /* Dataspace to query */
unsigned u; /* Local index variable */
herr_t ret_value = SUCCEED; /* Return value */
FUNC_ENTER_API(FAIL)
- H5TRACE5("e", "i*h*h*h*h", spaceid, start, stride, count, block);
+ H5TRACE5("e", "ixxxx", spaceid, start, stride, count, block);
/* Check args */
if (NULL == (space = (H5S_t *)H5I_object_verify(spaceid, H5I_DATASPACE)))
diff --git a/src/H5Smpio.c b/src/H5Smpio.c
index 79eb64e..9a38aaa 100644
--- a/src/H5Smpio.c
+++ b/src/H5Smpio.c
@@ -697,8 +697,10 @@ H5S__mpio_reg_hyper_type(const H5S_t *space, size_t elmt_size, MPI_Datatype *new
#ifdef H5S_DEBUG
if (H5DEBUG(S)) {
- HDfprintf(H5DEBUG(S), "%s: start=%Hd stride=%Hu count=%Hu block=%Hu xtent=%Hu", FUNC,
- d[u].start, d[u].strid, d[u].count, d[u].block, d[u].xtent);
+ HDfprintf(H5DEBUG(S),
+ "%s: start=%" PRIdHSIZE " stride=%" PRIuHSIZE " count=%" PRIuHSIZE
+ " block=%" PRIuHSIZE " xtent=%" PRIuHSIZE,
+ FUNC, d[u].start, d[u].strid, d[u].count, d[u].block, d[u].xtent);
if (u == 0)
HDfprintf(H5DEBUG(S), " rank=%u\n", rank);
else
@@ -729,8 +731,10 @@ H5S__mpio_reg_hyper_type(const H5S_t *space, size_t elmt_size, MPI_Datatype *new
#ifdef H5S_DEBUG
if (H5DEBUG(S)) {
- HDfprintf(H5DEBUG(S), "%s: start=%Hd stride=%Hu count=%Hu block=%Hu xtent=%Hu", FUNC,
- d[u].start, d[u].strid, d[u].count, d[u].block, d[u].xtent);
+ HDfprintf(H5DEBUG(S),
+ "%s: start=%" PRIdHSIZE " stride=%" PRIuHSIZE " count=%" PRIuHSIZE
+ " block=%" PRIuHSIZE " xtent=%" PRIuHSIZE,
+ FUNC, d[u].start, d[u].strid, d[u].count, d[u].block, d[u].xtent);
if (u == 0)
HDfprintf(H5DEBUG(S), " rank=%u\n", rank);
else
@@ -754,7 +758,8 @@ H5S__mpio_reg_hyper_type(const H5S_t *space, size_t elmt_size, MPI_Datatype *new
#ifdef H5S_DEBUG
if (H5DEBUG(S)) {
i = ((int)rank) - 1;
- HDfprintf(H5DEBUG(S), " offset[%2d]=%Hu; max_xtent[%2d]=%Hu\n", i, offset[i], i, max_xtent[i]);
+ HDfprintf(H5DEBUG(S), " offset[%2d]=%" PRIuHSIZE "; max_xtent[%2d]=%" PRIuHSIZE "\n", i, offset[i], i,
+ max_xtent[i]);
}
#endif
for (i = ((int)rank) - 2; i >= 0; --i) {
@@ -762,7 +767,8 @@ H5S__mpio_reg_hyper_type(const H5S_t *space, size_t elmt_size, MPI_Datatype *new
max_xtent[i] = max_xtent[i + 1] * d[i].xtent;
#ifdef H5S_DEBUG
if (H5DEBUG(S))
- HDfprintf(H5DEBUG(S), " offset[%2d]=%Hu; max_xtent[%2d]=%Hu\n", i, offset[i], i, max_xtent[i]);
+ HDfprintf(H5DEBUG(S), " offset[%2d]=%" PRIuHSIZE "; max_xtent[%2d]=%" PRIuHSIZE "\n", i,
+ offset[i], i, max_xtent[i]);
#endif
} /* end for */
@@ -777,9 +783,9 @@ H5S__mpio_reg_hyper_type(const H5S_t *space, size_t elmt_size, MPI_Datatype *new
*******************************************************/
#ifdef H5S_DEBUG
if (H5DEBUG(S)) {
- HDfprintf(H5DEBUG(S), "%s: Making contig type %Zu MPI_BYTEs\n", FUNC, elmt_size);
+ HDfprintf(H5DEBUG(S), "%s: Making contig type %zu MPI_BYTEs\n", FUNC, elmt_size);
for (i = ((int)rank) - 1; i >= 0; --i)
- HDfprintf(H5DEBUG(S), "d[%d].xtent=%Hu \n", i, d[i].xtent);
+ HDfprintf(H5DEBUG(S), "d[%d].xtent=%" PRIuHSIZE "\n", i, d[i].xtent);
}
#endif
@@ -809,7 +815,8 @@ H5S__mpio_reg_hyper_type(const H5S_t *space, size_t elmt_size, MPI_Datatype *new
if (H5DEBUG(S))
HDfprintf(H5DEBUG(S),
"%s: Dimension i=%d \n"
- "start=%Hd count=%Hu block=%Hu stride=%Hu, xtent=%Hu max_xtent=%d\n",
+ "start=%" PRIdHSIZE " count=%" PRIuHSIZE " block=%" PRIuHSIZE " stride=%" PRIuHSIZE
+ ", xtent=%" PRIuHSIZE " max_xtent=%" PRIuHSIZE "\n",
FUNC, i, d[i].start, d[i].count, d[i].block, d[i].strid, d[i].xtent, max_xtent[i]);
#endif
@@ -950,7 +957,8 @@ done:
#ifdef H5S_DEBUG
if (H5DEBUG(S))
- HDfprintf(H5DEBUG(S), "Leave %s, count=%ld is_derived_type=%t\n", FUNC, *count, *is_derived_type);
+ HDfprintf(H5DEBUG(S), "Leave %s, count=%d is_derived_type=%s\n", FUNC, *count,
+ (*is_derived_type) ? "TRUE" : "FALSE");
#endif
FUNC_LEAVE_NOAPI(ret_value)
} /* end H5S__mpio_reg_hyper_type() */
diff --git a/src/H5Snone.c b/src/H5Snone.c
index 58f7b41..82e513e 100644
--- a/src/H5Snone.c
+++ b/src/H5Snone.c
@@ -12,7 +12,7 @@
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
/*
- * Programmer: Quincey Koziol <koziol@ncsa.uiuc.edu>
+ * Programmer: Quincey Koziol
* Tuesday, November 10, 1998
*
* Purpose: "None" selection dataspace I/O functions.
diff --git a/src/H5Spkg.h b/src/H5Spkg.h
index a600c5d..c89b616 100644
--- a/src/H5Spkg.h
+++ b/src/H5Spkg.h
@@ -137,6 +137,11 @@ struct H5S_pnt_list_t {
H5S_pnt_node_t *head; /* Pointer to head of point list */
H5S_pnt_node_t *tail; /* Pointer to tail of point list */
+
+ hsize_t last_idx; /* Index of the point after the last returned from H5S__get_select_elem_pointlist() */
+ H5S_pnt_node_t *last_idx_pnt; /* Point after the last returned from H5S__get_select_elem_pointlist().
+ * If we ever add a way to remove points or add points in the middle of
+ * the pointlist we will need to invalidate these fields. */
};
/* Information about hyperslab spans */
@@ -404,6 +409,9 @@ H5_DLL herr_t H5S__hyper_project_intersection(const H5S_t *src_space, const H5
const H5S_t *src_intersect_space, H5S_t *proj_space,
hbool_t share_space);
+/* Operations on selection iterators */
+H5_DLL herr_t H5S__sel_iter_close_cb(H5S_sel_iter_t *_sel_iter, void **request);
+
/* Testing functions */
#ifdef H5S_TESTING
H5_DLL herr_t H5S__get_rebuild_status_test(hid_t space_id, H5S_diminfo_valid_t *status1,
diff --git a/src/H5Spoint.c b/src/H5Spoint.c
index 21ef966..5991116 100644
--- a/src/H5Spoint.c
+++ b/src/H5Spoint.c
@@ -238,7 +238,7 @@ H5S__point_iter_coords(const H5S_sel_iter_t *iter, hsize_t *coords)
} /* end H5S__point_iter_coords() */
/*-------------------------------------------------------------------------
- * Function: H5S_point_iter_block
+ * Function: H5S__point_iter_block
*
* Purpose: Retrieve the current block of iterator for current
* selection
@@ -843,6 +843,10 @@ H5S__copy_pnt_list(const H5S_pnt_list_t *src, unsigned rank)
H5MM_memcpy(dst->high_bounds, src->high_bounds, (rank * sizeof(hsize_t)));
H5MM_memcpy(dst->low_bounds, src->low_bounds, (rank * sizeof(hsize_t)));
+ /* Clear cached iteration point */
+ dst->last_idx = 0;
+ dst->last_idx_pnt = NULL;
+
/* Set return value */
ret_value = dst;
@@ -1511,8 +1515,9 @@ done:
static herr_t
H5S__get_select_elem_pointlist(const H5S_t *space, hsize_t startpoint, hsize_t numpoints, hsize_t *buf)
{
- H5S_pnt_node_t *node; /* Point node */
- unsigned rank; /* Dataspace rank */
+ const hsize_t endpoint = startpoint + numpoints; /* Index of last point in iteration */
+ H5S_pnt_node_t *node; /* Point node */
+ unsigned rank; /* Dataspace rank */
FUNC_ENTER_STATIC_NOERR
@@ -1522,14 +1527,20 @@ H5S__get_select_elem_pointlist(const H5S_t *space, hsize_t startpoint, hsize_t n
/* Get the dataspace extent rank */
rank = space->extent.rank;
- /* Get the head of the point list */
- node = space->select.sel_info.pnt_lst->head;
+ /* Check for cached point at the correct index */
+ if (space->select.sel_info.pnt_lst->last_idx_pnt &&
+ startpoint == space->select.sel_info.pnt_lst->last_idx)
+ node = space->select.sel_info.pnt_lst->last_idx_pnt;
+ else {
+ /* Get the head of the point list */
+ node = space->select.sel_info.pnt_lst->head;
- /* Iterate to the first point to return */
- while (node != NULL && startpoint > 0) {
- startpoint--;
- node = node->next;
- } /* end while */
+ /* Iterate to the first point to return */
+ while (node != NULL && startpoint > 0) {
+ startpoint--;
+ node = node->next;
+ } /* end while */
+ } /* end else */
/* Iterate through the node, copying each point's information */
while (node != NULL && numpoints > 0) {
@@ -1539,6 +1550,10 @@ H5S__get_select_elem_pointlist(const H5S_t *space, hsize_t startpoint, hsize_t n
node = node->next;
} /* end while */
+ /* Cached next point in iteration */
+ space->select.sel_info.pnt_lst->last_idx = endpoint;
+ space->select.sel_info.pnt_lst->last_idx_pnt = node;
+
FUNC_LEAVE_NOAPI(SUCCEED)
} /* end H5S__get_select_elem_pointlist() */
@@ -1572,13 +1587,14 @@ H5S__get_select_elem_pointlist(const H5S_t *space, hsize_t startpoint, hsize_t n
REVISION LOG
--------------------------------------------------------------------------*/
herr_t
-H5Sget_select_elem_pointlist(hid_t spaceid, hsize_t startpoint, hsize_t numpoints, hsize_t buf[/*numpoints*/])
+H5Sget_select_elem_pointlist(hid_t spaceid, hsize_t startpoint, hsize_t numpoints,
+ hsize_t buf[/*numpoints*/] /*out*/)
{
H5S_t *space; /* Dataspace to modify selection of */
herr_t ret_value; /* return value */
FUNC_ENTER_API(FAIL)
- H5TRACE4("e", "ihh*[a2]h", spaceid, startpoint, numpoints, buf);
+ H5TRACE4("e", "ihhx", spaceid, startpoint, numpoints, buf);
/* Check args */
if (NULL == buf)
@@ -2200,7 +2216,7 @@ done:
} /* end H5S__point_project_scalar() */
/*-------------------------------------------------------------------------
- * Function: H5S_point_project_simple
+ * Function: H5S__point_project_simple
*
* Purpose: Projects a point selection onto/into a simple dataspace
* of a different rank
@@ -2330,6 +2346,10 @@ H5S__point_project_simple(const H5S_t *base_space, H5S_t *new_space, hsize_t *of
} /* end for */
} /* end else */
+ /* Clear cached iteration point */
+ new_space->select.sel_info.pnt_lst->last_idx = 0;
+ new_space->select.sel_info.pnt_lst->last_idx_pnt = NULL;
+
/* Number of elements selected will be the same */
new_space->select.num_elem = base_space->select.num_elem;
diff --git a/src/H5Sprivate.h b/src/H5Sprivate.h
index 76ed237..56c1646 100644
--- a/src/H5Sprivate.h
+++ b/src/H5Sprivate.h
@@ -201,6 +201,7 @@ struct H5O_loc_t;
typedef struct H5S_t H5S_t;
/* Operations on dataspaces */
+H5_DLL herr_t H5S_init(void);
H5_DLL H5S_t * H5S_copy(const H5S_t *src, hbool_t share_selection, hbool_t copy_max);
H5_DLL herr_t H5S_close(H5S_t *ds);
H5_DLL H5S_class_t H5S_get_simple_extent_type(const H5S_t *ds);
@@ -275,7 +276,7 @@ H5_DLL herr_t H5S_select_elements(H5S_t *space, H5S_seloper_t op, size_t num_ele
/* Operations on hyperslab selections */
H5_DLL herr_t H5S_select_hyperslab(H5S_t *space, H5S_seloper_t op, const hsize_t start[],
const hsize_t *stride, const hsize_t count[], const hsize_t *block);
-H5_DLL herr_t H5S_combine_hyperslab(H5S_t *old_space, H5S_seloper_t op, const hsize_t start[],
+H5_DLL herr_t H5S_combine_hyperslab(const H5S_t *old_space, H5S_seloper_t op, const hsize_t start[],
const hsize_t *stride, const hsize_t count[], const hsize_t *block,
H5S_t **new_space);
H5_DLL herr_t H5S_hyper_add_span_element(H5S_t *space, unsigned rank, const hsize_t *coords);
diff --git a/src/H5Spublic.h b/src/H5Spublic.h
index 6befa55..fd85dcc 100644
--- a/src/H5Spublic.h
+++ b/src/H5Spublic.h
@@ -120,59 +120,1220 @@ typedef enum {
extern "C" {
#endif
-/* Operations on dataspaces */
-H5_DLL hid_t H5Screate(H5S_class_t type);
-H5_DLL hid_t H5Screate_simple(int rank, const hsize_t dims[], const hsize_t maxdims[]);
-H5_DLL herr_t H5Sset_extent_simple(hid_t space_id, int rank, const hsize_t dims[], const hsize_t max[]);
-H5_DLL hid_t H5Scopy(hid_t space_id);
-H5_DLL herr_t H5Sclose(hid_t space_id);
-H5_DLL herr_t H5Sencode2(hid_t obj_id, void *buf, size_t *nalloc, hid_t fapl);
-H5_DLL hid_t H5Sdecode(const void *buf);
-H5_DLL hssize_t H5Sget_simple_extent_npoints(hid_t space_id);
-H5_DLL int H5Sget_simple_extent_ndims(hid_t space_id);
-H5_DLL int H5Sget_simple_extent_dims(hid_t space_id, hsize_t dims[], hsize_t maxdims[]);
-H5_DLL htri_t H5Sis_simple(hid_t space_id);
-H5_DLL H5S_class_t H5Sget_simple_extent_type(hid_t space_id);
-H5_DLL herr_t H5Sset_extent_none(hid_t space_id);
-H5_DLL herr_t H5Sextent_copy(hid_t dst_id, hid_t src_id);
-H5_DLL htri_t H5Sextent_equal(hid_t sid1, hid_t sid2);
+/* Operations on dataspaces, dataspace selections and selection iterators */
-/* Operations on dataspace selections */
-H5_DLL H5S_sel_type H5Sget_select_type(hid_t spaceid);
-H5_DLL hssize_t H5Sget_select_npoints(hid_t spaceid);
-H5_DLL herr_t H5Sselect_copy(hid_t dst_id, hid_t src_id);
-H5_DLL htri_t H5Sselect_valid(hid_t spaceid);
-H5_DLL herr_t H5Sselect_adjust(hid_t spaceid, const hssize_t *offset);
-H5_DLL herr_t H5Sget_select_bounds(hid_t spaceid, hsize_t start[], hsize_t end[]);
-H5_DLL htri_t H5Sselect_shape_same(hid_t space1_id, hid_t space2_id);
-H5_DLL htri_t H5Sselect_intersect_block(hid_t space_id, const hsize_t *start, const hsize_t *end);
-H5_DLL herr_t H5Soffset_simple(hid_t space_id, const hssize_t *offset);
-H5_DLL herr_t H5Sselect_all(hid_t spaceid);
-H5_DLL herr_t H5Sselect_none(hid_t spaceid);
-H5_DLL herr_t H5Sselect_elements(hid_t space_id, H5S_seloper_t op, size_t num_elem, const hsize_t *coord);
+/**
+ * \ingroup H5S
+ *
+ * \brief Releases and terminates access to a dataspace
+ *
+ * \space_id
+ *
+ * \return \herr_t
+ *
+ * \details H5Sclose() releases a dataspace. Further access through the
+ * dataspace identifier is illegal. Failure to release a dataspace with this
+ * call will result in resource leaks.
+ *
+ * \version 1.4.0 Fortran subroutine introduced in this release.
+ * \since 1.0.0
+ *
+ */
+H5_DLL herr_t H5Sclose(hid_t space_id);
+/**
+ * \ingroup H5S
+ *
+ * \brief Performs an operation on a hyperslab and an existing selection and
+ * returns the resulting selection
+ *
+ * \space_id
+ * \param[in] op Operation to perform on the current selection
+ * \param[in] start Offset of the start of of the hyperslab
+ * \param[in] stride Hyperslab stride
+ * \param[in] count Number of blocks included in the hyperslab
+ * \param[in] block Size of a block in the hyperslab
+ *
+ * \return \hid_tv{dataspace}
+ *
+ * \details H5Scombine_hyperslab() combines a hyperslab selection specified
+ * by \p start, \p stride, \p count and \p block with the current
+ * selection for the dataspace \p space_id, creating a new dataspace
+ * to return the generated selection. If the current selection is
+ * not a hyperslab, it is freed and the hyperslab parameters passed
+ * in are combined with the #H5S_SEL_ALL hyperslab (ie. a selection
+ * composing the entire current extent). If either \p stride or
+ * \p block is NULL, then it will be set to \p 1.
+ *
+ * \since 1.12.0
+ *
+ */
+H5_DLL hid_t H5Scombine_hyperslab(hid_t space_id, H5S_seloper_t op, const hsize_t start[],
+ const hsize_t stride[], const hsize_t count[], const hsize_t block[]);
+/**
+ * \ingroup H5S
+ *
+ * \brief Combine two hyperslab selections with an operation, returning a
+ * dataspace with the resulting selection
+ *
+ * \space_id{space1_id}
+ * \param[in] op Selection operator
+ * \space_id{space2_id}
+ *
+ * \return \hid_t{dataspace}
+ *
+ * \details H5Scombine_select() combines two hyperslab selections
+ * \p space1_id and \p space2_id with an operation, returning a
+ * new dataspace with the resulting selection. The dataspace extent
+ * from \p space1_id is copied for the dataspace extent of the
+ * newly created dataspace.
+ *
+ * \since 1.12.0
+ *
+ */
+H5_DLL hid_t H5Scombine_select(hid_t space1_id, H5S_seloper_t op, hid_t space2_id);
+/**
+ * \ingroup H5S
+ *
+ * \brief Creates an exact copy of a dataspace
+ *
+ * \space_id
+ *
+ * \return \hid_tv{dataspace}
+ *
+ * \details H5Scopy() creates a new dataspace which is an exact copy of the
+ * dataspace identified by \p space_id. The dataspace identifier
+ * returned from this function should be released with H5Sclose()
+ * or resource leaks will occur.
+ *
+ * \version 1.4.0 Fortran subroutine introduced.
+ * \since 1.0.0
+ *
+ */
+H5_DLL hid_t H5Scopy(hid_t space_id);
+/**
+ * \ingroup H5S
+ *
+ * \brief Creates a new dataspace of a specified type
+ *
+ * \param[in] type Type of dataspace to be created
+ *
+ * \return \hid_t{dataspace}
+ *
+ * \details H5Screate() creates a new dataspace of a particular type. Currently
+ * supported types are #H5S_SCALAR, #H5S_SIMPLE, and #H5S_NULL.
+ *
+ * Further dataspace types may be added later.
+ *
+ * A scalar dataspace, #H5S_SCALAR, has a single element, though that
+ * element may be of a complex datatype, such as a compound or array
+ * datatype. By convention, the rank of a scalar dataspace is always \p 0
+ * (zero); think of it geometrically as a single, dimensionless point,
+ * though that point can be complex.
+ *
+ * A simple dataspace, #H5S_SIMPLE, consists of a regular array of elements.
+ *
+ * A null dataspace, #H5S_NULL, has no data elements.
+ *
+ * The dataspace identifier returned by this function can be released with
+ * H5Sclose() so that resource leaks will not occur.
+ *
+ * \version 1.4.0 Fortran subroutine introduced.
+ * \since 1.0.0
+ *
+ */
+H5_DLL hid_t H5Screate(H5S_class_t type);
+/**
+ * \ingroup H5S
+ * \brief Creates a new simple dataspace and opens it for access
+ *
+ * \param[in] rank Number of dimensions of dataspace
+ * \param[in] dims Array specifying the size of each dimension
+ * \param[in] maxdims Array specifying the maximum size of each dimension
+ *
+ * \return \hid_t{dataspace}
+ *
+ * \details H5Screate_simple() creates a new simple dataspace and opens it
+ * for access, returning a dataspace identifier.
+ *
+ * \p rank is the number of dimensions used in the dataspace.
+ *
+ * \p dims is a one-dimensional array of size rank specifying the
+ * size of each dimension of the dataset. \p maxdims is an array of
+ * the same size specifying the upper limit on the size of each
+ * dimension.
+ *
+ * Any element of \p dims can be \p 0 (zero). Note that no data can
+ * be written to a dataset if the size of any dimension of its current
+ * dataspace is \p 0. This is sometimes a useful initial state for
+ * a dataset.
+ *
+ * \p maxdims may be the null pointer, in which case the upper limit
+ * is the same as \p dims. Otherwise, no element of \p maxdims
+ * should be smaller than the corresponding element of \p dims.
+ *
+ * If an element of \p maxdims is #H5S_UNLIMITED, the maximum size of
+ * the corresponding dimension is unlimited.
+ *
+ * Any dataset with an unlimited dimension must also be chunked; see
+ * H5Pset_chunk(). Similarly, a dataset must be chunked if \p dims
+ * does not equal \p maxdims.
+ *
+ * The dataspace identifier returned from this function must be
+ * released with H5Sclose() or resource leaks will occur.
+ *
+ * \note Once a dataspace has been created, specific regions or elements in
+ * the dataspace can be selected and selections can be removed, as well.
+ * For example, H5Sselect_hyperslab() selects a region in a dataspace and
+ * H5Sselect_elements() selects array elements in a dataspace. These
+ * functions are used for subsetting. H5Sselect_none() removes all
+ * selections from a dataspace and is used in Parallel HDF5 when a process
+ * does not have or need to write data.
+ *
+ * \version 1.4.0 Fortran subroutine introduced.
+ *
+ * \since 1.0.0
+ *
+ */
+H5_DLL hid_t H5Screate_simple(int rank, const hsize_t dims[], const hsize_t maxdims[]);
+/**
+ * \ingroup H5S
+ *
+ * \brief Decodes a binary object description of data space and returns a
+ * new object handle
+ *
+ * \param[in] buf Buffer for the data space object to be decoded
+ *
+ * \return \hid_t{dataspace}
+ *
+ * \details Given an object description of a dataspace in binary in a
+ * buffer, H5Sdecode() reconstructs the HDF5 data type object and
+ * returns a new object handle for it. The binary description of the
+ * object is encoded by H5Sencode(). The user is responsible for
+ * passing in the right buffer. The types of dataspace addressed
+ * in this function are null, scalar, and simple space. For a
+ * simple dataspace, the selection information (for example,
+ * hyperslab selection) is also encoded and decoded. A complex
+ * dataspace has not been implemented in the library.
+ *
+ * \since 1.8.0
+ *
+ */
+H5_DLL hid_t H5Sdecode(const void *buf);
+/**
+ * \ingroup H5S
+ *
+ * \brief Encodes a data space object description into a binary buffer
+ *
+ * \space_id{obj_id}
+ * \param[in,out] buf Buffer for the object to be encoded into;
+ * If the provided buffer is NULL, only the size
+ * of buffer needed is returned through \p nalloc.
+ * \param[in,out] nalloc The size of the allocated buffer
+ * \fapl_id{fapl}
+ *
+ * \return \herr_t
+ *
+ * \details Given the data space identifier \p obj_id, H5Sencode2() converts
+ * a data space description into binary form in a buffer. Using this
+ * binary form in the buffer, a data space object can be
+ * reconstructed with H5Sdecode() to return a new object handle
+ * (#hid_t) for this data space.
+ *
+ * A preliminary H5Sencode2() call can be made to determine the
+ * size of the buffer needed. This value is returned in \p nalloc.
+ * That value can then be assigned to \p nalloc for a second
+ * H5Sencode2() call, which will retrieve the actual encoded object.
+ *
+ * If the library determines that \p nalloc is not big enough for the
+ * object, it simply returns the size of the buffer needed through
+ * \p nalloc without encoding the provided buffer.
+ *
+ * The file access property list \p fapl_id is used to control the
+ * encoding via the \a libver_bounds property (see
+ * H5Pset_libver_bounds()). If the \a libver_bounds property is missing,
+ * H5Sencode2() proceeds as if the \a libver_bounds property were set to
+ * (#H5F_LIBVER_EARLIEST, #H5F_LIBVER_LATEST). (Functionally,
+ * H5Sencode1() is identical to H5Sencode2() with \a libver_bounds set to
+ * (#H5F_LIBVER_EARLIEST, #H5F_LIBVER_LATEST).)
+ *
+ * The types of data space that are addressed in this function are
+ * null, scalar, and simple space. For a simple data space, the
+ * information on the selection, for example, hyperslab selection,
+ * is also encoded and decoded. A complex data space has not been
+ * implemented in the library.
+ *
+ * \note Motivation: This function was introduced in HDF5-1.12 as part of the
+ * H5Sencode() format change to enable 64-bit selection encodings and
+ * a dataspace selection that is tied to a file. See the \ref_news_112
+ * as well as the \ref_sencode_fmt_change.
+ *
+ * \since 1.12.0
+ *
+ */
+H5_DLL herr_t H5Sencode2(hid_t obj_id, void *buf, size_t *nalloc, hid_t fapl);
+/**
+ * \ingroup H5S
+ *
+ * \brief Copies the extent of a dataspace
+ *
+ * \space_id{dst_id}
+ * \space_id{src_id}
+ *
+ * \return \herr_t
+ *
+ * \details H5Sextent_copy() copies the extent from \p src_id to \p dst_id.
+ * This action may change the type of the dataspace.
+ *
+ * \version 1.4.0 Fortran subroutine was introduced.
+ * \since 1.0.0
+ *
+ */
+H5_DLL herr_t H5Sextent_copy(hid_t dst_id, hid_t src_id);
+/**
+ * \ingroup H5S
+ *
+ * \brief Determines whether two dataspace extents are equal
+ *
+ * \space_id{space1_id}
+ * \space_id{space2_id}
+ *
+ * \return \htri_t
+ *
+ * \details H5Sextent_equal() determines whether the dataspace extents of
+ * two dataspaces, \p space1_id and \p space2_id, are equal.
+ *
+ * \since 1.8.0
+ *
+ */
+H5_DLL htri_t H5Sextent_equal(hid_t space1_id, hid_t space2_id);
+/**
+ * \ingroup H5S
+ *
+ * \brief Retrieves a regular hyperslab selection
+ *
+ * \space_id{spaceid}
+ * \param[out] start Offset of the start of the regular hyperslab
+ * \param[out] stride Stride of the regular hyperslab
+ * \param[out] count Number of blocks in the regular hyperslab
+ * \param[out] block Size of a block in the regular hyperslab
+ *
+ * \return \herr_t
+ *
+ * \details H5Sget_regular_hyperslab() takes the dataspace identifier,
+ * \p spaceid, and retrieves the values of \p start, \p stride,
+ * \p count, and \p block for the regular hyperslab selection.
+ *
+ * A regular hyperslab selection is a hyperslab selection
+ * described by setting the \p offset, \p stride, \p count, and
+ * \p block parameters to the H5Sselect_hyperslab() call. If
+ * several calls to H5Sselect_hyperslab() are needed, the
+ * hyperslab selection is irregular.
+ *
+ * See H5Sselect_hyperslab() for descriptions of \p offset,
+ * \p stride, \p count, and \p block.
+ *
+ * \note If a hyperslab selection is originally regular, then becomes
+ * irregular through selection operations, and then becomes regular
+ * again, the final regular selection may be equivalent but not
+ * identical to the original regular selection.
+ *
+ * \since 1.10.0
+ *
+ */
+H5_DLL htri_t H5Sget_regular_hyperslab(hid_t spaceid, hsize_t start[], hsize_t stride[], hsize_t count[],
+ hsize_t block[]);
+/**
+ * \ingroup H5S
+ *
+ * \brief Gets the bounding box containing the current selection
+ *
+ * \space_id{spaceid}
+ * \param[out] start Starting coordinates of the bounding box
+ * \param[out] end Ending coordinates of the bounding box, i.e., the
+ * coordinates of the diagonally opposite corner
+ *
+ * \return \herr_t
+ *
+ * \details H5Sget_select_bounds() retrieves the coordinates of the bounding
+ * box containing the current selection and places them into
+ * user-supplied buffers.
+ *
+ * The \p start and \p end buffers must be large enough to hold
+ * the dataspace rank number of coordinates.
+ *
+ * The bounding box exactly contains the selection. I.e., if a
+ * 2-dimensional element selection is currently defined as containing
+ * the points (4,5), (6,8), and (10,7), then the bounding box
+ * will be (4, 5), (10, 8).
+ *
+ * The bounding box calculation includes the current offset of the
+ * selection within the dataspace extent.
+ *
+ * Calling this function on a \a none selection will fail.
+ *
+ * \version 1.6.0 The \p start and \p end parameters have changed from type
+ * \p hsize_t * to \p hssize_t *.
+ * \version 1.4.0 Fortran subroutine was introduced.
+ * \since 1.2.0
+ *
+ */
+H5_DLL herr_t H5Sget_select_bounds(hid_t spaceid, hsize_t start[], hsize_t end[]);
+/**
+ * \ingroup H5S
+ *
+ * \brief Gets the number of element points in the current selection
+ *
+ * \space_id{spaceid}
+ *
+ * \return Returns the number of element points in the current dataspace
+ * selection if successful. Otherwise returns a negative value.
+ *
+ * \details H5Sget_select_elem_npoints() returns the number of element
+ * points in the current dataspace selection, so that the element
+ * points can be retrieved with H5Sget_select_elem_pointlist().
+ * (This is similar to the way that H5Sget_select_hyper_nblocks()
+ * and H5Sget_select_hyper_blocklist() work with hyperslab
+ * selections.)
+ *
+ * Coincidentally, H5Sget_select_npoints() and
+ * H5Sget_select_elem_npoints() will always return the same value
+ * when an element selection is queried, but
+ * H5Sget_select_elem_npoints() does not work with other selection
+ * types.
+ *
+ * \since 1.2.0
+ *
+ */
H5_DLL hssize_t H5Sget_select_elem_npoints(hid_t spaceid);
-H5_DLL herr_t H5Sget_select_elem_pointlist(hid_t spaceid, hsize_t startpoint, hsize_t numpoints,
- hsize_t buf[/*numpoints*/]);
-H5_DLL herr_t H5Sselect_hyperslab(hid_t space_id, H5S_seloper_t op, const hsize_t start[],
- const hsize_t _stride[], const hsize_t count[], const hsize_t _block[]);
-H5_DLL hid_t H5Scombine_hyperslab(hid_t space_id, H5S_seloper_t op, const hsize_t start[],
- const hsize_t _stride[], const hsize_t count[], const hsize_t _block[]);
-H5_DLL herr_t H5Smodify_select(hid_t space1_id, H5S_seloper_t op, hid_t space2_id);
-H5_DLL hid_t H5Scombine_select(hid_t space1_id, H5S_seloper_t op, hid_t space2_id);
-H5_DLL htri_t H5Sis_regular_hyperslab(hid_t spaceid);
-H5_DLL htri_t H5Sget_regular_hyperslab(hid_t spaceid, hsize_t start[], hsize_t stride[], hsize_t count[],
- hsize_t block[]);
+/**
+ * \ingroup H5S
+ *
+ * \brief Gets the list of element points currently selected
+ *
+ * \space_id{spaceid}
+ * \param[in] startpoint Element point to start with
+ * \param[in] numpoints Number of element points to get
+ * \param[out] buf List of element points selected
+ *
+ * \details H5Sget_select_elem_pointlist() returns the list of element
+ * points in the current dataspace selection \p space_id. Starting
+ * with the \p startpoint in the list of points, \p numpoints
+ * points are put into the user's buffer. If the user's buffer
+ * fills up before \p numpoints points are inserted, the buffer
+ * will contain only as many points as fit.
+ *
+ * The element point coordinates have the same dimensionality
+ * (rank) as the dataspace they are located within. The list of
+ * element points is formatted as follows:\n
+ * \<coordinate\>, followed by\n
+ * the next coordinate,\n
+ * etc.\n
+ * until all of the selected element points have been listed.
+ *
+ * The points are returned in the order they will be iterated
+ * through when the selection is read/written from/to disk.
+ *
+ * \since 1.2.0
+ *
+ */
+H5_DLL herr_t H5Sget_select_elem_pointlist(hid_t spaceid, hsize_t startpoint, hsize_t numpoints,
+ hsize_t buf[/*numpoints*/]);
+/**
+ * \ingroup H5S
+ *
+ * \brief Gets the list of hyperslab blocks currently selected
+ *
+ * \space_id{spaceid}
+ * \param[in] startblock Hyperslab block to start with
+ * \param[in] numblocks Number of hyperslab blocks to get
+ * \param[out] buf List of hyperslab blocks selected
+ *
+ * \return \herr_t
+ *
+ * \details H5Sget_select_hyper_blocklist() returns a list of the hyperslab
+ * blocks currently selected. Starting with the \p startblock-th block
+ * in the list of blocks, \p numblocks blocks are put into the
+ * user's buffer. If the user's buffer fills up before \p numblocks
+ * blocks are inserted, the buffer will contain only as many blocks
+ * as fit.
+ *
+ * The block coordinates have the same dimensionality (rank) as the
+ * dataspace they are located within. The list of blocks is
+ * formatted as follows:\n
+ * \<"start" coordinate\>, immediately followed by\n
+ * \<"opposite" corner coordinate\>, followed by\n
+ * the next "start" and "opposite" coordinates,\n
+ * etc. until all of the selected blocks have been listed.\n
+ * No guarantee of any order of the blocks is implied.
+ *
+ * \since 1.2.0
+ *
+ */
+H5_DLL herr_t H5Sget_select_hyper_blocklist(hid_t spaceid, hsize_t startblock, hsize_t numblocks,
+ hsize_t buf[/*numblocks*/]);
+/**
+ * \ingroup H5S
+ *
+ * \brief Get number of hyperslab blocks
+ *
+ * \space_id{spaceid}
+ *
+ * \return Returns the number of hyperslab blocks in the current dataspace
+ * selection if successful. Otherwise returns a negative value.
+ *
+ * \details H5Sget_select_hyper_nblocks() returns the number of hyperslab
+ * blocks in the current dataspace selection.
+ *
+ * \since 1.2.0
+ *
+ */
H5_DLL hssize_t H5Sget_select_hyper_nblocks(hid_t spaceid);
-H5_DLL herr_t H5Sget_select_hyper_blocklist(hid_t spaceid, hsize_t startblock, hsize_t numblocks,
- hsize_t buf[/*numblocks*/]);
-H5_DLL hid_t H5Sselect_project_intersection(hid_t src_space_id, hid_t dst_space_id,
- hid_t src_intersect_space_id);
-
-/* Operations on dataspace selection iterators */
-H5_DLL hid_t H5Ssel_iter_create(hid_t spaceid, size_t elmt_size, unsigned flags);
+/**
+ * \ingroup H5S
+ *
+ * \brief Determines the number of elements in a dataspace selection
+ *
+ * \space_id{spaceid}
+ *
+ * \return Returns the number of elements in the selection if successful;
+ * otherwise returns a negative value.
+ *
+ * \details H5Sget_select_npoints() determines the number of elements in
+ * the current selection of a dataspace. It works with any
+ * selection type, and is the correct way to retrieve the number
+ * of elements in a selection.
+ *
+ * \version 1.4.0 Fortran subroutine introduced in this release.
+ * \since 1.0.0
+ *
+ */
+H5_DLL hssize_t H5Sget_select_npoints(hid_t spaceid);
+/**
+ * \ingroup H5S
+ *
+ * \brief Determines the type of the dataspace selection
+ *
+ * \space_id{spaceid}
+ *
+ * \return Returns the dataspace selection type, a value of the enumerated
+ * datatype #H5S_sel_type, if successful.
+ *
+ * \details H5Sget_select_type() retrieves the type of dataspace selection
+ * currently defined for the dataspace \p space_id. Valid values
+ * for the dataspace selection type are:
+ *
+ * <table>
+ * <tr>
+ * <td>#H5S_SEL_NONE</td>
+ * <td>No selection is defined</td>
+ * </tr>
+ * <tr>
+ * <td>#H5S_SEL_POINTS</td>
+ * <td>A sequence of points is selected</td>
+ * </tr>
+ * <tr>
+ * <td>#H5S_SEL_HYPERSLABS</td>
+ * <td>A hyperslab or compound hyperslab is selected</td>
+ * </tr>
+ * <tr>
+ * <td>#H5S_SEL_ALL</td>
+ * <td>The entire dataset is selected</td>
+ * </tr>
+ * </table>
+ *
+ * Otherwise returns a negative value.
+ *
+ * \since 1.6.0
+ *
+ */
+H5_DLL H5S_sel_type H5Sget_select_type(hid_t spaceid);
+/**
+ * \ingroup H5S
+ *
+ * \brief Retrieves dataspace dimension size and maximum size
+ *
+ * \space_id
+ * \param[out] dims Pointer to array to store the size of each dimension
+ * \param[out] maxdims Pointer to array to store the maximum size of each
+ * dimension
+ *
+ * \return Returns the number of dimensions in the dataspace if successful;
+ * otherwise returns a negative value.
+ *
+ * \details H5Sget_simple_extent_dims() returns the size and maximum sizes
+ * of each dimension of a dataspace \p space_id through the \p dims
+ * and \p maxdims parameters.
+ *
+ * Either or both of \p dims and \p maxdims may be NULL.
+ *
+ * If a value in the returned array \p maxdims is #H5S_UNLIMITED (-1),
+ * the maximum size of that dimension is unlimited.
+ *
+ * \version 1.4.0 Fortran subroutine introduced.
+ * \since 1.0.0
+ *
+ */
+H5_DLL int H5Sget_simple_extent_dims(hid_t space_id, hsize_t dims[], hsize_t maxdims[]);
+/**
+ * \ingroup H5S
+ *
+ * \brief Determines the dimensionality of a dataspace
+ *
+ * \space_id
+ *
+ * \return Returns the number of dimensions in the dataspace if successful;
+ * otherwise returns a negative value.
+ *
+ * \details H5Sget_simple_extent_ndims() determines the dimensionality (or
+ * rank) of a dataspace.
+ *
+ * \version 1.4.0 Fortran subroutine introduced.
+ * \since 1.0.0
+ *
+ */
+H5_DLL int H5Sget_simple_extent_ndims(hid_t space_id);
+/**
+ * \ingroup H5S
+ *
+ * \brief Determines the number of elements in a dataspace
+ *
+ * \space_id
+ *
+ * \return Returns the number of elements in the dataspace if successful;
+ * otherwise returns a negative value.
+ *
+ * \details H5Sget_simple_extent_npoints() determines the number of elements
+ * in a dataspace \p space_id. For example, a simple 3-dimensional
+ * dataspace with dimensions 2, 3, and 4 would have 24 elements.
+ *
+ * \version 1.4.0 Fortran subroutine introduced.
+ * \since 1.0.0
+ *
+ */
+H5_DLL hssize_t H5Sget_simple_extent_npoints(hid_t space_id);
+/**
+ * \ingroup H5S
+ *
+ * \brief Determines the current class of a dataspace
+ *
+ * \space_id
+ *
+ * \return Returns a dataspace class name if successful;
+ * otherwise #H5S_NO_CLASS (-1).
+ *
+ * \details H5Sget_simple_extent_type() determines the current class of a
+ * dataspace \p space_id.
+ *
+ * \version 1.4.0 Fortran subroutine was introduced.
+ * \since 1.0.0
+ *
+ */
+H5_DLL H5S_class_t H5Sget_simple_extent_type(hid_t space_id);
+/**
+ * \ingroup H5S
+ *
+ * \brief Determines if a hyperslab selection is regular
+ *
+ * \space_id{spaceid}
+ *
+ * \return \htri_t
+ *
+ * \details H5Sis_regular_hyperslab() takes the dataspace identifier,
+ * \p spaceid, and queries the type of the hyperslab selection.
+ *
+ * A regular hyperslab selection is a hyperslab selection described
+ * by setting the offset, stride, count, and block parameters for
+ * a single H5Sselect_hyperslab() call. If several calls to
+ * H5Sselect_hyperslab() are needed, then the hyperslab selection
+ * is irregular.
+ *
+ * \since 1.10.0
+ *
+ */
+H5_DLL htri_t H5Sis_regular_hyperslab(hid_t spaceid);
+/**
+ * \ingroup H5S
+ *
+ * \brief Determines whether a dataspace is a simple dataspace
+ *
+ * \space_id
+ *
+ * \return \htri_t
+ *
+ * \details H5Sis_simple() determines whether or not a dataspace is a simple
+ * dataspace.
+ *
+ * \note Currently, all dataspace objects are simple dataspaces; complex
+ * dataspace support will be added in the future.
+ *
+ * \version 1.4.0 Fortran subroutine was introduced.
+ * \since 1.0.0
+ *
+ */
+H5_DLL htri_t H5Sis_simple(hid_t space_id);
+/**
+ * \ingroup H5S
+ *
+ * \brief Refines a hyperslab selection with an operation, using a second
+ * hyperslab to modify it
+ *
+ * \space_id{space1_id}
+ * \param[in] op Selection operator
+ * \space_id{space2_id}
+ *
+ * \return \herr_t
+ *
+ * \details H5Smodify_select() refines an existing hyperslab selection
+ * \p space1_id with an operation \p op, using a second hyperslab
+ * \p space2_id. The first selection is modified to contain the
+ * result of \p space1_id operated on by \p space2_id.
+ *
+ * \since 1.12.0
+ *
+ */
+H5_DLL herr_t H5Smodify_select(hid_t space1_id, H5S_seloper_t op, hid_t space2_id);
+/**
+ * \ingroup H5S
+ *
+ * \brief Sets the offset of a simple dataspace
+ *
+ * \space_id
+ * \param[in] offset The offset at which to position the selection
+ *
+ * \return \herr_t
+ *
+ * \details H5Soffset_simple() sets the offset of a simple dataspace
+ * \p space_id. The offset array must be the same number of
+ * elements as the number of dimensions for the dataspace. If the
+ * \p offset array is set to NULL, the offset for the dataspace is
+ * reset to 0.
+ *
+ * This function allows the same shaped selection to be moved to
+ * different locations within a dataspace without requiring it to
+ * be redefined.
+ *
+ * \version 1.4.0 Fortran subroutine was introduced.
+ * \since 1.0.0
+ *
+ */
+H5_DLL herr_t H5Soffset_simple(hid_t space_id, const hssize_t *offset);
+/**
+ * \ingroup H5S
+ *
+ * \brief Closes a dataspace selection iterator
+ *
+ * \space_id{sel_iter_id}
+ *
+ * \return \herr_t
+ *
+ * \details H5Ssel_iter_close() closes a dataspace selection iterator
+ * specified by \p sel_iter_id, releasing its state.
+ *
+ * \since 1.12.0
+ *
+ */
+H5_DLL herr_t H5Ssel_iter_close(hid_t sel_iter_id);
+/**\ingroup H5S
+ *
+ * \brief Creates a dataspace selection iterator for a dataspace's selection
+ *
+ * \space_id{spaceid}
+ * \param[in] elmt_size Size of element in the selection
+ * \param[in] flags Selection iterator flag
+ *
+ * \return \hid_t{valid dataspace selection iterator}
+ *
+ * \details H5Ssel_iter_create() creates a selection iterator and initializes
+ * it to start at the first element selected in the dataspace.
+ *
+ * \since 1.12.0
+ *
+ */
+H5_DLL hid_t H5Ssel_iter_create(hid_t spaceid, size_t elmt_size, unsigned flags);
+/**
+ * \ingroup H5S
+ *
+ * \brief Retrieves a list of offset / length sequences for the elements in
+ * an iterator
+ *
+ * \space_id{sel_iter_id}
+ * \param[in] maxseq Maximum number of sequences to retrieve
+ * \param[in] maxbytes Maximum number of bytes to retrieve in sequences
+ * \param[out] nseq Number of sequences retrieved
+ * \param[out] nbytes Number of bytes retrieved, in all sequences
+ * \param[out] off Array of sequence offsets
+ * \param[out] len Array of sequence lengths
+ *
+ * \return \herr_t
+ *
+ * \details H5Ssel_iter_get_seq_list() retrieves a list of offset / length
+ * pairs (a list of "sequences") matching the selected elements for
+ * an iterator \p sel_iter_id, according to the iteration order for
+ * the iterator. The lengths returned are in bytes, not elements.
+ *
+ * Note that the iteration order for "all" and "hyperslab"
+ * selections is row-major (i.e. "C-ordered"), but the iteration
+ * order for "point" selections is "in order selected", unless the
+ * #H5S_SEL_ITER_GET_SEQ_LIST_SORTED flag is passed to
+ * H5Ssel_iter_create() for a point selection.
+ *
+ * \p maxseq and \p maxbytes specify the most sequences or bytes
+ * possible to place into the \p off and \p len arrays. \p nseq and
+ * \p nbytes return the actual number of sequences and bytes put
+ * into the arrays.
+ *
+ * Each call to H5Ssel_iter_get_seq_list() will retrieve the next
+ * set of sequences for the selection being iterated over.
+ *
+ * The total number of bytes possible to retrieve from a selection
+ * iterator is the \p elmt_size passed to H5Ssel_iter_create()
+ * multiplied by the number of elements selected in the dataspace
+ * the iterator was created from (which can be retrieved with
+ * H5Sget_select_npoints(). When there are no further sequences of
+ * elements to retrieve, calls to this routine will set \p nseq
+ * and \p nbytes to zero.
+ *
+ * \since 1.12.0
+ *
+ */
H5_DLL herr_t H5Ssel_iter_get_seq_list(hid_t sel_iter_id, size_t maxseq, size_t maxbytes, size_t *nseq,
size_t *nbytes, hsize_t *off, size_t *len);
-H5_DLL herr_t H5Ssel_iter_close(hid_t sel_iter_id);
+/**
+ * \ingroup H5S
+ *
+ * \brief Resets a dataspace selection iterator back to an initial state
+ *
+ * \param[in] sel_iter_id Identifier of the dataspace selection iterator
+ * to reset
+ * \param[in] space_id Identifier of the dataspace with selection to
+ * iterate over
+ *
+ * \return \herr_t
+ *
+ * \details H5Ssel_iter_reset() resets a dataspace selection iterator back to
+ * an initial state so that the iterator may be used for iteration
+ * once again.
+ *
+ * \since 1.12.1
+ *
+ */
+H5_DLL herr_t H5Ssel_iter_reset(hid_t sel_iter_id, hid_t space_id);
+/**
+ * \ingroup H5S
+ *
+ * \brief Adjusts a selection by subtracting an offset
+ *
+ * \space_id{spaceid}
+ * \param[in] offset Offset to subtract
+ *
+ * \return \herr_t
+ *
+ * \details H5Sselect_adjust() shifts a dataspace selection by a specified
+ * logical offset within the dataspace extent.
+ *
+ * \note This can be useful for VOL developers to implement chunked datasets.
+ *
+ * \since 1.12.0
+ */
+H5_DLL herr_t H5Sselect_adjust(hid_t spaceid, const hssize_t *offset);
+/**
+ * \ingroup H5S
+ *
+ * \brief Selects an entire dataspace
+ *
+ * \space_id{spaceid}
+ *
+ * \return \herr_t
+ *
+ * \details H5Sselect_all() selects the entire extent of the dataspace
+ * \p dspace_id.
+ *
+ * More specifically, H5Sselect_all() sets the selection type to
+ * #H5S_SEL_ALL, which specifies the entire dataspace anywhere it
+ * is applied.
+ *
+ * \since 1.0.0
+ *
+ */
+H5_DLL herr_t H5Sselect_all(hid_t spaceid);
+/**
+ * \ingroup H5S
+ *
+ * \brief Copies a selection from one dataspace to another
+ *
+ * \space_id{dst_id}
+ * \space_id{src_id}
+ *
+ * \return \herr_t
+ *
+ * \details H5Sselect_copy() copies all selection information (including
+ * offset) from the source dataspace \p src_id to the destination
+ * dataspace \p dst_id.
+ *
+ * \since 1.12.0
+ *
+ */
+H5_DLL herr_t H5Sselect_copy(hid_t dst_id, hid_t src_id);
+/**
+ * \ingroup H5S
+ *
+ * \brief Selects array elements to be included in the selection for a
+ * dataspace
+ *
+ * \space_id
+ * \param[in] op Operator specifying how the new selection is to be
+ * combined with the existing selection for the dataspace
+ * \param[in] num_elem Number of elements to be selected
+ * \param[in] coord A pointer to a buffer containing a serialized copy of
+ * a 2-dimensional array of zero-based values specifying
+ * the coordinates of the elements in the point selection
+ *
+ * \return \herr_t
+ *
+ * \details H5Sselect_elements() selects array elements to be included in
+ * the selection for the \p space_id dataspace. This is referred
+ * to as a point selection.
+ *
+ * The number of elements selected is set in the \p num_elements
+ * parameter.
+ *
+ * The \p coord parameter is a pointer to a buffer containing a
+ * serialized 2-dimensional array of size \p num_elements by the
+ * rank of the dataspace. The array lists dataset elements in the
+ * point selection; that is, it’s a list of of zero-based values
+ * specifying the coordinates in the dataset of the selected
+ * elements. The order of the element coordinates in the \p coord
+ * array specifies the order in which the array elements are
+ * iterated through when I/O is performed. Duplicate coordinate
+ * locations are not checked for. See below for examples of the
+ * mapping between the serialized contents of the buffer and the
+ * point selection array that it represents.
+ *
+ * The selection operator \p op determines how the new selection
+ * is to be combined with the previously existing selection for
+ * the dataspace. The following operators are supported:
+ *
+ * <table>
+ * <tr>
+ * <td>#H5S_SELECT_SET</td>
+ * <td>Replaces the existing selection with the parameters from
+ * this call. Overlapping blocks are not supported with this
+ * operator. Adds the new selection to the existing selection.
+ * </td>
+ * </tr>
+ * <tr>
+ * <td>#H5S_SELECT_APPEND</td>
+ * <td>Adds the new selection following the last element of the
+ * existing selection.</td>
+ * </tr>
+ * <tr>
+ * <td>#H5S_SELECT_PREPEND</td>
+ * <td>Adds the new selection preceding the first element of the
+ * existing selection.</td>
+ * </tr>
+ * </table>
+ *
+ * <b>Mapping the serialized \p coord buffer to a 2-dimensional
+ * point selection array:</b>
+ * To illustrate the construction of the contents of the \p coord
+ * buffer, consider two simple examples: a selection of 5 points in
+ * a 1-dimensional array and a selection of 3 points in a
+ * 4-dimensional array.
+ *
+ * In the 1D case, we will be selecting five points and a 1D
+ * dataspace has rank 1, so the selection will be described in a
+ * 5-by-1 array. To select the 1st, 14th, 17th, 23rd, 8th elements
+ * of the dataset, the selection array would be as follows
+ * (remembering that point coordinates are zero-based):
+ * \n 0
+ * \n 13
+ * \n 16
+ * \n 22
+ * \n 7
+ *
+ * This point selection array will be serialized in the \p coord
+ * buffer as:
+ * \n 0 13 16 22 7
+ *
+ * In the 4D case, we will be selecting three points and a 4D
+ * dataspace has rank 4, so the selection will be described in a
+ * 3-by-4 array. To select the points (1,1,1,1), (14,6,12,18), and
+ * (8,22,30,22), the point selection array would be as follows:
+ * \n 0 0 0 0
+ * \n 13 5 11 17
+ * \n 7 21 29 21
+ *
+ * This point selection array will be serialized in the \p coord
+ * buffer as:
+ * \n 0 0 0 0 13 5 11 17 7 21 29 21
+ *
+ * \version 1.6.4 C coord parameter type changed to \p const hsize_t.
+ * \version 1.6.4 Fortran \p coord parameter type changed to \p INTEGER(HSIZE_T).
+ * \since 1.0.0
+ *
+ */
+H5_DLL herr_t H5Sselect_elements(hid_t space_id, H5S_seloper_t op, size_t num_elem, const hsize_t *coord);
+/**
+ * \ingroup H5S
+ *
+ * \brief Selects a hyperslab region to add to the current selected region
+ *
+ * \space_id
+ * \param[in] op Operation to perform on current selection
+ * \param[in] start Offset of start of hyperslab
+ * \param[in] stride Hyperslab stride
+ * \param[in] count Number of blocks included in hyperslab
+ * \param[in] block Size of block in hyperslab
+ *
+ * \return \herr_t
+ *
+ * \details H5Sselect_hyperslab() selects a hyperslab region to add to the
+ * current selected region for the dataspace specified by
+ * \p space_id.
+ *
+ * The \p start, \p stride, \p count, and \p block arrays must be the
+ * same size as the rank of the dataspace. For example, if the
+ * dataspace is 4-dimensional, each of these parameters must be a
+ * 1-dimensional array of size 4.
+ *
+ * The selection operator \p op determines how the new selection
+ * is to be combined with the already existing selection for the
+ * dataspace. The following operators are supported:
+ *
+ * <table>
+ * <tr>
+ * <td>#H5S_SELECT_SET</td>
+ * <td>Replaces the existing selection with the
+ * parameters from this call. Overlapping blocks
+ * are not supported with this operator.</td>
+ * </tr>
+ * <tr>
+ * <td>#H5S_SELECT_OR</td>
+ * <td>Adds the new selection to the existing selection.
+ * (Binary OR)</td>
+ * </tr>
+ * <tr>
+ * <td>#H5S_SELECT_AND</td>
+ * <td>Retains only the overlapping portions of the
+ * new selection and the existing selection.
+ * (Binary AND)</td>
+ * </tr>
+ * <tr>
+ * <td>#H5S_SELECT_XOR</td>
+ * <td>Retains only the elements that are members of
+ * the new selection or the existing selection,
+ * excluding elements that are members of both
+ * selections. (Binary exclusive-OR, XOR)
+ * </td>
+ * </tr>
+ * <tr>
+ * <td>#H5S_SELECT_NOTB</td>
+ * <td>Retains only elements of the existing selection
+ * that are not in the new selection.</td>
+ * </tr>
+ * <tr>
+ * <td>#H5S_SELECT_NOTA</td>
+ * <td>Retains only elements of the new selection that
+ * are not in the existing selection.</td>
+ * </tr>
+ * </table>
+ *
+ * The \p start array specifies the offset of the starting element
+ * of the specified hyperslab.
+ *
+ * The \p stride array chooses array locations from the dataspace with
+ * each value in the \p stride array determining how many elements to
+ * move in each dimension. Setting a value in the \p stride array to
+ * \p 1 moves to each element in that dimension of the dataspace;
+ * setting a value of \p 2 in allocation in the \p stride array moves
+ * to every other element in that dimension of the dataspace. In
+ * other words, the \p stride determines the number of elements to
+ * move from the \p start location in each dimension. Stride values
+ * of \p 0 are not allowed. If the \p stride parameter is NULL, a
+ * contiguous hyperslab is selected (as if each value in the \p stride
+ * array were set to \p 1).
+ *
+ * The \p count array determines how many blocks to select from the
+ * dataspace, in each dimension.
+ *
+ * The \p block array determines the size of the element block
+ * selected from the dataspace. If the \p block parameter is set to
+ * NULL, the block size defaults to a single element in each dimension
+ * (as if each value in the \p block array were set to \p 1).
+ *
+ * For example, consider a 2-dimensional dataspace with hyperslab
+ * selection settings as follows: the \p start offset is specified as
+ * [1,1], \p stride is [4,4], \p count is [3,7], and \p block is [2,2].
+ * In C, these settings will specify a hyperslab consisting of 21
+ * 2x2 blocks of array elements starting with location (1,1) with the
+ * selected blocks at locations (1,1), (5,1), (9,1), (1,5), (5,5), etc.;
+ * in Fortran, they will specify a hyperslab consisting of 21 2x2
+ * blocks of array elements starting with location (2,2) with the
+ * selected blocks at locations (2,2), (6,2), (10,2), (2,6), (6,6), etc.
+ *
+ * Regions selected with this function call default to C order
+ * iteration when I/O is performed.
+ *
+ * \version 1.4.0 Fortran subroutine introduced in this release.
+ * \since 1.0.0
+ *
+ */
+H5_DLL herr_t H5Sselect_hyperslab(hid_t space_id, H5S_seloper_t op, const hsize_t start[],
+ const hsize_t stride[], const hsize_t count[], const hsize_t block[]);
+/*--------------------------------------------------------------------------*/
+/**\ingroup H5S
+ *
+ * \brief Checks if current selection intersects with a block
+ *
+ * \space_id
+ * \param[in] start Starting coordinate of block
+ * \param[in] end Opposite ("ending") coordinate of block
+ *
+ * \return \htri_t
+ *
+ * \details H5Sselect_intersect_block() checks to see if the current
+ * selection \p space_id in the dataspace intersects with the block
+ * specified by \p start and \p end.
+ *
+ * \note Assumes that \p start & \p end block bounds are inclusive, so
+ * \p start == \p end value is OK.
+ *
+ * \since 1.12.0
+ *
+ */
+H5_DLL htri_t H5Sselect_intersect_block(hid_t space_id, const hsize_t *start, const hsize_t *end);
+/*--------------------------------------------------------------------------*/
+/**\ingroup H5S
+ *
+ * \brief Resets the selection region to include no elements
+ *
+ * \space_id{spaceid}
+ *
+ * \return \herr_t
+ *
+ * \details H5Sselect_none() resets the selection region for the dataspace
+ * \p space_id to include no elements.
+ *
+ * \since 1.0.0
+ *
+ */
+H5_DLL herr_t H5Sselect_none(hid_t spaceid);
+/*--------------------------------------------------------------------------*/
+/**\ingroup H5S
+ *
+ * \brief Projects the intersection of two source selections to a
+ * destination selection
+ *
+ * \space_id{src_space_id}
+ * \space_id{dst_space_id}
+ * \space_id{src_intersect_space_id}
+ *
+ * \return Returns a dataspace with a selection equal to the intersection of
+ * \p src_intersect_space_id and \p src_space_id projected from
+ * \p src_space to \p dst_space on success, negative on failure.
+ *
+ * \details H5Sselect_project_intersection() computes the intersection
+ * between two dataspace selections and projects that intersection
+ * into a third selection.This can be useful for VOL developers to
+ * implement chunked or virtual datasets.
+ *
+ * \since 1.12.0
+ *
+ */
+H5_DLL hid_t H5Sselect_project_intersection(hid_t src_space_id, hid_t dst_space_id,
+ hid_t src_intersect_space_id);
+/*--------------------------------------------------------------------------*/
+/**\ingroup H5S
+ *
+ * \brief Checks if two selections are the same shape
+ *
+ * \space_id{space1_id}
+ * \space_id{space2_id}
+ *
+ * \return \htri_t
+ *
+ * \details H5Sselect_shape_same() checks to see if the current selection
+ * in the dataspaces are the same dimensionality and shape.
+ *
+ * This is primarily used for reading the entire selection in
+ * one swoop.
+ *
+ * \since 1.12.0
+ *
+ */
+H5_DLL htri_t H5Sselect_shape_same(hid_t space1_id, hid_t space2_id);
+/*--------------------------------------------------------------------------*/
+/**\ingroup H5S
+ *
+ * \brief Verifies that the selection is within the extent of the dataspace
+ *
+ * \space_id{spaceid}
+ *
+ * \return \htri_t
+ *
+ * \details H5Sselect_valid() verifies that the selection for the dataspace
+ * \p space_id is within the extent of the dataspace if the current
+ * offset for the dataspace is used.
+ *
+ * \version 1.4.0 Fortran subroutine introduced in this release.
+ * \since 1.0.0
+ *
+ */
+H5_DLL htri_t H5Sselect_valid(hid_t spaceid);
+/*--------------------------------------------------------------------------*/
+/**\ingroup H5S
+ *
+ * \brief Resets the extent of a dataspace back to "none"
+ *
+ * \space_id
+ *
+ * \return \herr_t
+ *
+ * \details H5Sset_extent_none() resets the type of a dataspace to
+ * #H5S_NULL with no extent information stored for the dataspace.
+ *
+ * \version 1.10.7, 1.12.1 The function behavior changed. The previous
+ * behavior was to set the class to #H5S_NO_CLASS.
+ * \version 1.4.0 Fortran subroutine was introduced.
+ * \since 1.0.0
+ *
+ */
+H5_DLL herr_t H5Sset_extent_none(hid_t space_id);
+/*--------------------------------------------------------------------------*/
+/**\ingroup H5S
+ *
+ * \brief Sets or resets the size of an existing dataspace
+ *
+ * \space_id
+ * \param[in] rank Rank, or dimensionality, of the dataspace
+ * \param[in] dims Array containing current size of dataspace
+ * \param[in] max Array containing maximum size of dataspace
+ *
+ * \return \herr_t
+ *
+ * \details H5Sset_extent_simple() sets or resets the size of an existing
+ * dataspace.
+ *
+ * \p rank is the dimensionality, or number of dimensions, of the
+ * dataspace.
+ *
+ * \p dims is an array of size \p rank which contains the new size
+ * of each dimension in the dataspace. \p max is an array of size
+ * \p rank which contains the maximum size of each dimension in
+ * the dataspace.
+ *
+ * Any previous extent is removed from the dataspace, the dataspace
+ * type is set to #H5S_SIMPLE, and the extent is set as specified.
+ *
+ * Note that a dataset must be chunked if \p dims does not equal
+ * \p max.
+ *
+ *
+ * \version 1.4.0 Fortran subroutine was introduced.
+ * \since 1.0.0
+ *
+ */
+H5_DLL herr_t H5Sset_extent_simple(hid_t space_id, int rank, const hsize_t dims[], const hsize_t max[]);
/* Symbols defined for compatibility with previous versions of the HDF5 API.
*
@@ -180,6 +1341,47 @@ H5_DLL herr_t H5Ssel_iter_close(hid_t sel_iter_id);
*/
#ifndef H5_NO_DEPRECATED_SYMBOLS
/* Function prototypes */
+/* --------------------------------------------------------------------------*/
+/**\ingroup H5S
+ *
+ * \brief Encodes a data space object description into a binary buffer
+ *
+ * \space_id{obj_id}
+ * \param[in,out] buf Buffer for the object to be encoded into;
+ * If the provided buffer is NULL, only the size of
+ * buffer needed is returned through \p nalloc.
+ * \param[in,out] nalloc The size of the allocated buffer
+ *
+ * \return \herr_t
+ *
+ * \deprecated Deprecated in favor of H5Sencode2()
+ *
+ * \details Given the data space identifier \p obj_id, H5Sencode1() converts
+ * a data space description into binary form in a buffer. Using
+ * this binary form in the buffer, a data space object can be
+ * reconstructed using H5Sdecode() to return a new object handle
+ * (\p hid_t) for this data space.
+ *
+ * A preliminary H5Sencode1() call can be made to find out the size
+ * of the buffer needed. This value is returned as \p nalloc. That
+ * value can then be assigned to \p nalloc for a second H5Sencode1()
+ * call, which will retrieve the actual encoded object.
+ *
+ * If the library finds out \p nalloc is not big enough for the
+ * object, it simply returns the size of the buffer needed through
+ * \p nalloc without encoding the provided buffer.
+ *
+ * The types of data space addressed in this function are null,
+ * scalar, and simple space. For a simple data space, the information
+ * on the selection, for example, hyperslab selection, is also
+ * encoded and decoded. A complex data space has not been
+ * implemented in the library.
+ *
+ * \version 1.12.0 The function H5Sencode() was renamed H5Sencode1() and
+ * deprecated.
+ * \since 1.8.0
+ *
+ */
H5_DLL herr_t H5Sencode1(hid_t obj_id, void *buf, size_t *nalloc);
#endif /* H5_NO_DEPRECATED_SYMBOLS */
diff --git a/src/H5Sselect.c b/src/H5Sselect.c
index f7e4a5e..7a0ea3c 100644
--- a/src/H5Sselect.c
+++ b/src/H5Sselect.c
@@ -11,7 +11,7 @@
* help@hdfgroup.org. *
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
-/* Programmer: Quincey Koziol <koziol@ncsa.uiuc.ued>
+/* Programmer: Quincey Koziol
* Friday, May 29, 1998
*
* Purpose: Dataspace selection functions.
@@ -51,9 +51,9 @@
/********************/
#ifdef LATER
-static herr_t H5S_select_iter_block(const H5S_sel_iter_t *iter, hsize_t *start, hsize_t *end);
-static htri_t H5S_select_iter_has_next_block(const H5S_sel_iter_t *iter);
-static herr_t H5S_select_iter_next_block(H5S_sel_iter_t *iter);
+static herr_t H5S__select_iter_block(const H5S_sel_iter_t *iter, hsize_t *start, hsize_t *end);
+static htri_t H5S__select_iter_has_next_block(const H5S_sel_iter_t *iter);
+static herr_t H5S__select_iter_next_block(H5S_sel_iter_t *iter);
#endif /* LATER */
/*****************************/
@@ -142,10 +142,10 @@ H5Soffset_simple(hid_t space_id, const hssize_t *offset)
/* Check args */
if (NULL == (space = (H5S_t *)H5I_object_verify(space_id, H5I_DATASPACE)))
- HGOTO_ERROR(H5E_ATOM, H5E_BADATOM, FAIL, "not a dataspace")
+ HGOTO_ERROR(H5E_ID, H5E_BADID, FAIL, "not a dataspace")
if (space->extent.rank == 0 ||
(H5S_GET_EXTENT_TYPE(space) == H5S_SCALAR || H5S_GET_EXTENT_TYPE(space) == H5S_NULL))
- HGOTO_ERROR(H5E_ATOM, H5E_UNSUPPORTED, FAIL, "can't set offset on scalar or null dataspace")
+ HGOTO_ERROR(H5E_ID, H5E_UNSUPPORTED, FAIL, "can't set offset on scalar or null dataspace")
if (offset == NULL)
HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "no offset specified")
@@ -602,13 +602,13 @@ done:
REVISION LOG
--------------------------------------------------------------------------*/
herr_t
-H5Sget_select_bounds(hid_t spaceid, hsize_t start[], hsize_t end[])
+H5Sget_select_bounds(hid_t spaceid, hsize_t start[] /*out*/, hsize_t end[] /*out*/)
{
H5S_t *space; /* Dataspace to modify selection of */
herr_t ret_value; /* return value */
FUNC_ENTER_API(FAIL)
- H5TRACE3("e", "i*h*h", spaceid, start, end);
+ H5TRACE3("e", "ixx", spaceid, start, end);
/* Check args */
if (start == NULL || end == NULL)
@@ -1196,11 +1196,11 @@ H5S_select_iter_coords(const H5S_sel_iter_t *sel_iter, hsize_t *coords)
/*--------------------------------------------------------------------------
NAME
- H5S_select_iter_block
+ H5S__select_iter_block
PURPOSE
Get the block of the current iterator position
USAGE
- herr_t H5S_select_iter_block(sel_iter,start,end)
+ herr_t H5S__select_iter_block(sel_iter,start,end)
const H5S_sel_iter_t *sel_iter; IN: Selection iterator to query
hsize_t *start; OUT: Array to place iterator start block coordinates
hsize_t *end; OUT: Array to place iterator end block coordinates
@@ -1218,11 +1218,11 @@ H5S_select_iter_coords(const H5S_sel_iter_t *sel_iter, hsize_t *coords)
REVISION LOG
--------------------------------------------------------------------------*/
static herr_t
-H5S_select_iter_block(const H5S_sel_iter_t *iter, hsize_t *start, hsize_t *end)
+H5S__select_iter_block(const H5S_sel_iter_t *iter, hsize_t *start, hsize_t *end)
{
herr_t ret_value; /* return value */
- FUNC_ENTER_NOAPI_NOINIT_NOERR
+ FUNC_ENTER_STATIC_NOERR
/* Check args */
HDassert(iter);
@@ -1233,7 +1233,7 @@ H5S_select_iter_block(const H5S_sel_iter_t *iter, hsize_t *start, hsize_t *end)
ret_value = (*iter->type->iter_block)(iter, start, end);
FUNC_LEAVE_NOAPI(ret_value)
-} /* end H5S_select_iter_block() */
+} /* end H5S__select_iter_block() */
#endif /* LATER */
/*--------------------------------------------------------------------------
@@ -1276,11 +1276,11 @@ H5S_select_iter_nelmts(const H5S_sel_iter_t *sel_iter)
/*--------------------------------------------------------------------------
NAME
- H5S_select_iter_has_next_block
+ H5S__select_iter_has_next_block
PURPOSE
Check if there is another block available in the selection iterator
USAGE
- htri_t H5S_select_iter_has_next_block(sel_iter)
+ htri_t H5S__select_iter_has_next_block(sel_iter)
const H5S_sel_iter_t *sel_iter; IN: Selection iterator to query
RETURNS
Non-negative on success, negative on failure.
@@ -1296,11 +1296,11 @@ H5S_select_iter_nelmts(const H5S_sel_iter_t *sel_iter)
REVISION LOG
--------------------------------------------------------------------------*/
static htri_t
-H5S_select_iter_has_next_block(const H5S_sel_iter_t *iter)
+H5S__select_iter_has_next_block(const H5S_sel_iter_t *iter)
{
herr_t ret_value; /* return value */
- FUNC_ENTER_NOAPI_NOINIT_NOERR
+ FUNC_ENTER_STATIC_NOERR
/* Check args */
HDassert(iter);
@@ -1309,7 +1309,7 @@ H5S_select_iter_has_next_block(const H5S_sel_iter_t *iter)
ret_value = (*iter->type->iter_has_next_block)(iter);
FUNC_LEAVE_NOAPI(ret_value)
-} /* end H5S_select_iter_has_next_block() */
+} /* end H5S__select_iter_has_next_block() */
#endif /* LATER */
/*--------------------------------------------------------------------------
@@ -1358,11 +1358,11 @@ H5S_select_iter_next(H5S_sel_iter_t *iter, size_t nelem)
/*--------------------------------------------------------------------------
NAME
- H5S_select_iter_next_block
+ H5S__select_iter_next_block
PURPOSE
Advance selection iterator to next block
USAGE
- herr_t H5S_select_iter_next_block(iter)
+ herr_t H5S__select_iter_next_block(iter)
H5S_sel_iter_t *iter; IN/OUT: Selection iterator to change
RETURNS
Non-negative on success, negative on failure.
@@ -1380,11 +1380,11 @@ H5S_select_iter_next(H5S_sel_iter_t *iter, size_t nelem)
REVISION LOG
--------------------------------------------------------------------------*/
static herr_t
-H5S_select_iter_next_block(H5S_sel_iter_t *iter)
+H5S__select_iter_next_block(H5S_sel_iter_t *iter)
{
herr_t ret_value; /* return value */
- FUNC_ENTER_NOAPI_NOINIT_NOERR
+ FUNC_ENTER_STATIC_NOERR
/* Check args */
HDassert(iter);
@@ -1393,7 +1393,7 @@ H5S_select_iter_next_block(H5S_sel_iter_t *iter)
ret_value = (*iter->type->iter_next_block)(iter);
FUNC_LEAVE_NOAPI(ret_value)
-} /* end H5S_select_iter_next_block() */
+} /* end H5S__select_iter_next_block() */
#endif /* LATER */
/*-------------------------------------------------------------------------
@@ -1671,7 +1671,7 @@ H5Sget_select_type(hid_t space_id)
/* Check args */
if (NULL == (space = (H5S_t *)H5I_object_verify(space_id, H5I_DATASPACE)))
- HGOTO_ERROR(H5E_ATOM, H5E_BADATOM, H5S_SEL_ERROR, "not a dataspace")
+ HGOTO_ERROR(H5E_ID, H5E_BADID, H5S_SEL_ERROR, "not a dataspace")
/* Set return value */
ret_value = H5S_GET_SELECT_TYPE(space);
@@ -2851,9 +2851,9 @@ H5Sselect_project_intersection(hid_t src_space_id, hid_t dst_space_id, hid_t src
if (H5S_select_project_intersection(src_space, dst_space, src_intersect_space, &proj_space, FALSE) < 0)
HGOTO_ERROR(H5E_DATASET, H5E_CANTCLIP, FAIL, "can't project dataspace intersection")
- /* Atomize */
+ /* Register */
if ((ret_value = H5I_register(H5I_DATASPACE, proj_space, TRUE)) < 0)
- HGOTO_ERROR(H5E_ATOM, H5E_CANTREGISTER, FAIL, "unable to register dataspace atom")
+ HGOTO_ERROR(H5E_ID, H5E_CANTREGISTER, FAIL, "unable to register dataspace ID")
done:
if (ret_value < 0)
@@ -3000,10 +3000,10 @@ H5Ssel_iter_create(hid_t space_id, size_t elmt_size, unsigned flags)
if (H5S_select_iter_init(sel_iter, space, elmt_size, flags) < 0)
HGOTO_ERROR(H5E_DATASPACE, H5E_CANTINIT, H5I_INVALID_HID, "unable to initialize selection iterator")
- /* Atomize */
+ /* Register */
if ((ret_value = H5I_register(H5I_SPACE_SEL_ITER, sel_iter, TRUE)) < 0)
HGOTO_ERROR(H5E_DATASPACE, H5E_CANTREGISTER, H5I_INVALID_HID,
- "unable to register dataspace selection iterator atom")
+ "unable to register dataspace selection iterator ID")
done:
FUNC_LEAVE_API(ret_value)
@@ -3056,14 +3056,14 @@ done:
REVISION LOG
--------------------------------------------------------------------------*/
herr_t
-H5Ssel_iter_get_seq_list(hid_t sel_iter_id, size_t maxseq, size_t maxbytes, size_t *nseq, size_t *nbytes,
- hsize_t *off, size_t *len)
+H5Ssel_iter_get_seq_list(hid_t sel_iter_id, size_t maxseq, size_t maxbytes, size_t *nseq /*out*/,
+ size_t *nbytes /*out*/, hsize_t *off /*out*/, size_t *len /*out*/)
{
H5S_sel_iter_t *sel_iter; /* Dataspace selection iterator to operate on */
herr_t ret_value = SUCCEED; /* Return value */
FUNC_ENTER_API(FAIL)
- H5TRACE7("e", "izz*z*z*h*z", sel_iter_id, maxseq, maxbytes, nseq, nbytes, off, len);
+ H5TRACE7("e", "izzxxxx", sel_iter_id, maxseq, maxbytes, nseq, nbytes, off, len);
/* Check args */
if (NULL == (sel_iter = (H5S_sel_iter_t *)H5I_object_verify(sel_iter_id, H5I_SPACE_SEL_ITER)))
@@ -3089,6 +3089,87 @@ done:
FUNC_LEAVE_API(ret_value)
} /* end H5Ssel_iter_get_seq_list() */
+/*--------------------------------------------------------------------------
+ NAME
+ H5Ssel_iter_reset
+ PURPOSE
+ Resets a dataspace selection iterator back to an initial state.
+ USAGE
+ herr_t H5Ssel_iter_reset(sel_iter_id)
+ hid_t sel_iter_id; IN: ID of the dataspace selection iterator to
+ reset
+ hid_t space_id; IN: ID of the dataspace with selection to
+ iterate over
+ RETURNS
+ Non-negative on success / Negative on failure
+ DESCRIPTION
+ Resets a dataspace selection iterator back to an initial state so that
+ the iterator may be used for iteration once again.
+ GLOBAL VARIABLES
+ COMMENTS, BUGS, ASSUMPTIONS
+ EXAMPLES
+ REVISION LOG
+--------------------------------------------------------------------------*/
+herr_t
+H5Ssel_iter_reset(hid_t sel_iter_id, hid_t space_id)
+{
+ H5S_sel_iter_t *sel_iter;
+ H5S_t * space;
+ herr_t ret_value = SUCCEED;
+
+ FUNC_ENTER_API(FAIL)
+ H5TRACE2("e", "ii", sel_iter_id, space_id);
+
+ /* Check args */
+ if (NULL == (sel_iter = (H5S_sel_iter_t *)H5I_object_verify(sel_iter_id, H5I_SPACE_SEL_ITER)))
+ HGOTO_ERROR(H5E_DATASPACE, H5E_BADTYPE, FAIL, "not a dataspace selection iterator")
+ if (NULL == (space = (H5S_t *)H5I_object_verify(space_id, H5I_DATASPACE)))
+ HGOTO_ERROR(H5E_DATASPACE, H5E_BADTYPE, FAIL, "not a dataspace")
+
+ /* Call selection type-specific release routine */
+ if (H5S_SELECT_ITER_RELEASE(sel_iter) < 0)
+ HGOTO_ERROR(H5E_DATASPACE, H5E_CANTRELEASE, FAIL,
+ "problem releasing a selection iterator's type-specific info")
+
+ /* Simply re-initialize iterator */
+ if (H5S_select_iter_init(sel_iter, space, sel_iter->elmt_size, sel_iter->flags) < 0)
+ HGOTO_ERROR(H5E_DATASPACE, H5E_CANTINIT, FAIL, "unable to re-initialize selection iterator")
+
+done:
+ FUNC_LEAVE_API(ret_value)
+} /* end H5Ssel_iter_reset() */
+
+/*-------------------------------------------------------------------------
+ * Function: H5S__sel_iter_close_cb
+ *
+ * Purpose: Called when the ref count reaches zero on a selection iterator's ID
+ *
+ * Return: Non-negative on success / Negative on failure
+ *
+ * Programmer: Quincey Koziol
+ * Wednesday, April 8, 2020
+ *
+ *-------------------------------------------------------------------------
+ */
+herr_t
+H5S__sel_iter_close_cb(H5S_sel_iter_t *_sel_iter, void H5_ATTR_UNUSED **request)
+{
+ H5S_sel_iter_t *sel_iter = (H5S_sel_iter_t *)_sel_iter; /* The selection iterator to close */
+ herr_t ret_value = SUCCEED; /* Return value */
+
+ FUNC_ENTER_PACKAGE
+
+ /* Sanity check */
+ HDassert(sel_iter);
+
+ /* Close the selection iterator object */
+ if (H5S_sel_iter_close(sel_iter) < 0)
+ HGOTO_ERROR(H5E_DATASPACE, H5E_CLOSEERROR, FAIL, "unable to close selection iterator");
+
+done:
+ FUNC_LEAVE_NOAPI(ret_value)
+} /* end H5S__sel_iter_close_cb() */
+
/*-------------------------------------------------------------------------
* Function: H5S_sel_iter_close
*
diff --git a/src/H5Stest.c b/src/H5Stest.c
index e6ebe49..a851549 100644
--- a/src/H5Stest.c
+++ b/src/H5Stest.c
@@ -11,7 +11,7 @@
* help@hdfgroup.org. *
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
-/* Programmer: Quincey Koziol <koziol@ncsa.uiuc.edu>
+/* Programmer: Quincey Koziol
* Saturday, May 31, 2003
*
* Purpose: Dataspace selection testing functions.
diff --git a/src/H5T.c b/src/H5T.c
index ce3fbd8..1a3d61f 100644
--- a/src/H5T.c
+++ b/src/H5T.c
@@ -325,7 +325,7 @@
/* Adjust information for this type */ \
H5_GLUE3(H5T_INIT_TYPE_, GUTS, _CORE) \
\
- /* Atomize result */ \
+ /* Register result */ \
if ((GLOBAL = H5I_register(H5I_DATATYPE, dt, FALSE)) < 0) \
HGOTO_ERROR(H5E_DATATYPE, H5E_CANTREGISTER, FAIL, "unable to register datatype atom") \
}
@@ -802,7 +802,7 @@ H5T__init_package(void)
FUNC_ENTER_NOAPI_NOINIT
- /* Initialize the atom group for the file IDs */
+ /* Initialize the ID group for the file IDs */
if (H5I_register_type(H5I_DATATYPE_CLS) < 0)
HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, FAIL, "unable to initialize interface")
@@ -1820,7 +1820,7 @@ done:
* Errors:
* ARGS BADVALUE Invalid size.
* DATATYPE CANTINIT Can't create type.
- * DATATYPE CANTREGISTER Can't register datatype atom.
+ * DATATYPE CANTREGISTER Can't register datatype ID.
*
* Programmer: Robb Matzke
* Friday, December 5, 1997
@@ -1923,6 +1923,7 @@ H5Tcopy(hid_t obj_id)
case H5I_ERROR_MSG:
case H5I_ERROR_STACK:
case H5I_SPACE_SEL_ITER:
+ case H5I_EVENTSET:
case H5I_NTYPES:
default:
HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, H5I_INVALID_HID, "not a datatype or dataset")
@@ -1941,7 +1942,7 @@ done:
/* If we got a type ID from a passed-in dataset, we need to close that */
if (dset_tid != H5I_INVALID_HID)
if (H5I_dec_app_ref(dset_tid) < 0)
- HGOTO_ERROR(H5E_DATATYPE, H5E_BADATOM, FAIL, "problem freeing temporary dataset type ID")
+ HGOTO_ERROR(H5E_DATATYPE, H5E_BADID, FAIL, "problem freeing temporary dataset type ID")
/* Close the new datatype on errors */
if (H5I_INVALID_HID == ret_value)
@@ -1954,12 +1955,12 @@ done:
/*-------------------------------------------------------------------------
* Function: H5Tclose
*
- * Purpose: Frees a datatype and all associated memory.
+ * Purpose: Frees a datatype and all associated memory.
*
- * Return: Non-negative on success/Negative on failure
+ * Return: Non-negative on success/Negative on failure
*
- * Programmer: Robb Matzke
- * Tuesday, December 9, 1997
+ * Programmer: Robb Matzke
+ * Tuesday, December 9, 1997
*-------------------------------------------------------------------------
*/
herr_t
@@ -1979,7 +1980,7 @@ H5Tclose(hid_t type_id)
/* When the reference count reaches zero the resources are freed */
if (H5I_dec_app_ref(type_id) < 0)
- HGOTO_ERROR(H5E_ATOM, H5E_BADATOM, FAIL, "problem freeing id")
+ HGOTO_ERROR(H5E_ID, H5E_BADID, FAIL, "problem freeing id")
done:
FUNC_LEAVE_API(ret_value)
@@ -2037,12 +2038,6 @@ done:
* Programmer: Robb Matzke
* Friday, January 9, 1998
*
- * Modifications:
- *
- * Robb Matzke, 1 Jun 1998
- * It is illegal to lock a named datatype since we must allow named
- * types to be closed (to release file resources) but locking a type
- * prevents that.
*-------------------------------------------------------------------------
*/
herr_t
@@ -2113,9 +2108,6 @@ done:
* Programmer: Robb Matzke
* Monday, December 8, 1997
*
- * Modifications:
- * Broke out from H5Tget_class - QAK - 6/4/99
- *
*-------------------------------------------------------------------------
*/
H5T_class_t
@@ -2779,7 +2771,7 @@ H5T__unregister(H5T_pers_t pers, const char *name, H5T_t *src, H5T_t *dst, H5T_c
for (i = H5T_g.nsoft - 1; i >= 0; --i) {
soft = H5T_g.soft + i;
HDassert(soft);
- if (name && *name && HDstrcmp(name, soft->name))
+ if (name && *name && HDstrcmp(name, soft->name) != 0)
continue;
if (src && src->shared->type != soft->src)
continue;
@@ -2801,7 +2793,7 @@ H5T__unregister(H5T_pers_t pers, const char *name, H5T_t *src, H5T_t *dst, H5T_c
/* Not a match */
if (((H5T_PERS_SOFT == pers && path->is_hard) || (H5T_PERS_HARD == pers && !path->is_hard)) ||
- (name && *name && HDstrcmp(name, path->name)) || (src && H5T_cmp(src, path->src, FALSE)) ||
+ (name && *name && HDstrcmp(name, path->name) != 0) || (src && H5T_cmp(src, path->src, FALSE)) ||
(dst && H5T_cmp(dst, path->dst, FALSE)) || (func && func != path->conv.u.app_func)) {
/*
* Notify all other functions to recalculate private data since some
@@ -2910,14 +2902,14 @@ done:
*-------------------------------------------------------------------------
*/
H5T_conv_t
-H5Tfind(hid_t src_id, hid_t dst_id, H5T_cdata_t **pcdata)
+H5Tfind(hid_t src_id, hid_t dst_id, H5T_cdata_t **pcdata /*out*/)
{
H5T_t * src, *dst;
H5T_path_t *path;
H5T_conv_t ret_value; /* Return value */
FUNC_ENTER_API(NULL)
- H5TRACE3("TC", "ii**!", src_id, dst_id, pcdata);
+ H5TRACE3("TC", "iix", src_id, dst_id, pcdata);
/* Check args */
if (NULL == (src = (H5T_t *)H5I_object_verify(src_id, H5I_DATATYPE)) ||
@@ -3006,7 +2998,7 @@ herr_t
H5Tconvert(hid_t src_id, hid_t dst_id, size_t nelmts, void *buf, void *background, hid_t dxpl_id)
{
H5T_path_t *tpath; /* type conversion info */
- H5T_t * src, *dst; /* unatomized types */
+ H5T_t * src, *dst; /* unregistered types */
herr_t ret_value = SUCCEED; /* Return value */
FUNC_ENTER_API(FAIL)
@@ -3134,10 +3126,6 @@ done:
* Programmer: Raymond Lu
* July 14, 2004
*
- * Modification:Raymond Lu
- * 17 February 2011
- * I changed the value for the APP_REF parameter of H5I_register
- * from FALSE to TRUE.
*-------------------------------------------------------------------------
*/
hid_t
@@ -3297,10 +3285,6 @@ done:
* Programmer: Robb Matzke
* Friday, December 5, 1997
*
- * Modifications:
- * Raymond Lu
- * 19 May 2011
- * We support fixed size or variable-length string now.
*-------------------------------------------------------------------------
*/
H5T_t *
@@ -3422,8 +3406,8 @@ done:
* Note: Common code for both H5T_copy and H5T_copy_reopen, as part of
* the const-correct datatype copying routines.
*
- * Programmer: David Young
- * January 18, 2020
+ * Programmer: David Young
+ * January 18, 2020
*
*-------------------------------------------------------------------------
*/
@@ -3470,8 +3454,8 @@ done:
* Return: Success: Pointer to a new copy of the OLD_DT argument.
* Failure: NULL
*
- * Programmer: David Young
- * January 18, 2020
+ * Programmer: David Young
+ * January 18, 2020
*
*-------------------------------------------------------------------------
*/
@@ -3498,8 +3482,8 @@ done:
* Return: Success: Pointer to a new copy of the OLD_DT argument.
* Failure: NULL
*
- * Programmer: David Young
- * January 18, 2020
+ * Programmer: David Young
+ * January 18, 2020
*
*-------------------------------------------------------------------------
*/
@@ -3529,8 +3513,8 @@ done:
*
* Note: Common code for both H5T_copy and H5T_copy_reopen.
*
- * Programmer: David Young
- * January 18, 2020
+ * Programmer: David Young
+ * January 18, 2020
*
*-------------------------------------------------------------------------
*/
@@ -3800,8 +3784,8 @@ done:
* Return: Success: Pointer to a new copy of the OLD_DT argument.
* Failure: NULL
*
- * Programmer: David Young
- * January 18, 2020
+ * Programmer: David Young
+ * January 18, 2020
*
*-------------------------------------------------------------------------
*/
diff --git a/src/H5Tarray.c b/src/H5Tarray.c
index e2f3f01..d8dc2fb 100644
--- a/src/H5Tarray.c
+++ b/src/H5Tarray.c
@@ -107,7 +107,7 @@ H5Tarray_create2(hid_t base_id, unsigned ndims, const hsize_t dim[/* ndims */])
if (NULL == (dt = H5T__array_create(base, ndims, dim)))
HGOTO_ERROR(H5E_DATATYPE, H5E_CANTREGISTER, H5I_INVALID_HID, "unable to create datatype")
- /* Atomize the type */
+ /* Register the type */
if ((ret_value = H5I_register(H5I_DATATYPE, dt, TRUE)) < 0)
HGOTO_ERROR(H5E_DATATYPE, H5E_CANTREGISTER, H5I_INVALID_HID, "unable to register datatype")
@@ -255,13 +255,13 @@ H5T__get_array_ndims(const H5T_t *dt)
*-------------------------------------------------------------------------
*/
int
-H5Tget_array_dims2(hid_t type_id, hsize_t dims[])
+H5Tget_array_dims2(hid_t type_id, hsize_t dims[] /*out*/)
{
H5T_t *dt; /* pointer to array data type */
int ret_value; /* return value */
FUNC_ENTER_API(FAIL)
- H5TRACE2("Is", "i*h", type_id, dims);
+ H5TRACE2("Is", "ix", type_id, dims);
/* Check args */
if (NULL == (dt = (H5T_t *)H5I_object_verify(type_id, H5I_DATATYPE)))
@@ -357,7 +357,7 @@ H5Tarray_create1(hid_t base_id, int ndims, const hsize_t dim[/* ndims */],
if (NULL == (dt = H5T__array_create(base, (unsigned)ndims, dim)))
HGOTO_ERROR(H5E_DATATYPE, H5E_CANTREGISTER, H5I_INVALID_HID, "unable to create datatype")
- /* Atomize the type */
+ /* Register the type */
if ((ret_value = H5I_register(H5I_DATATYPE, dt, TRUE)) < 0)
HGOTO_ERROR(H5E_DATATYPE, H5E_CANTREGISTER, H5I_INVALID_HID, "unable to register datatype")
@@ -383,13 +383,13 @@ done:
*-------------------------------------------------------------------------
*/
int
-H5Tget_array_dims1(hid_t type_id, hsize_t dims[], int H5_ATTR_UNUSED perm[])
+H5Tget_array_dims1(hid_t type_id, hsize_t dims[] /*out*/, int H5_ATTR_UNUSED perm[] /*out*/)
{
H5T_t *dt; /* Array datatype to query */
int ret_value; /* return value */
FUNC_ENTER_API(FAIL)
- H5TRACE3("Is", "i*h*Is", type_id, dims, perm);
+ H5TRACE3("Is", "ixx", type_id, dims, perm);
/* Check args */
if (NULL == (dt = (H5T_t *)H5I_object_verify(type_id, H5I_DATATYPE)))
diff --git a/src/H5Tcompound.c b/src/H5Tcompound.c
index 87eee18..8dc0582 100644
--- a/src/H5Tcompound.c
+++ b/src/H5Tcompound.c
@@ -83,8 +83,6 @@ static H5T_t *H5T__reopen_member_type(const H5T_t *dt, unsigned membno);
* Programmer: Robb Matzke
* Wednesday, January 7, 1998
*
- * Modifications:
- *
*-------------------------------------------------------------------------
*/
size_t
@@ -151,8 +149,6 @@ H5T_get_member_offset(const H5T_t *dt, unsigned membno)
* Programmer: Quincey Koziol
* Thursday, November 9, 2000
*
- * Modifications:
- *
*-------------------------------------------------------------------------
*/
H5T_class_t
@@ -219,7 +215,7 @@ H5Tget_member_type(hid_t type_id, unsigned membno)
/* Get an ID for the datatype */
if ((ret_value = H5I_register(H5I_DATATYPE, memb_dt, TRUE)) < 0)
- HGOTO_ERROR(H5E_DATATYPE, H5E_CANTREGISTER, H5I_INVALID_HID, "unable register datatype atom")
+ HGOTO_ERROR(H5E_DATATYPE, H5E_CANTREGISTER, H5I_INVALID_HID, "unable register datatype ID")
done:
if (ret_value < 0)
@@ -232,7 +228,7 @@ done:
/*-------------------------------------------------------------------------
* Function: H5T_get_member_type
*
- * Purpose: Returns a copy of the data type of the specified member.
+ * Purpose: Returns a copy of the data type of the specified member.
*
* Return: Success: A copy of the member datatype;
* modifying the returned datatype does not
@@ -344,8 +340,6 @@ H5T__get_member_size(const H5T_t *dt, unsigned membno)
* Programmer: Robb Matzke
* Monday, December 8, 1997
*
- * Modifications:
- *
*-------------------------------------------------------------------------
*/
herr_t
@@ -390,8 +384,6 @@ done:
* Programmer: Robb Matzke
* Wednesday, January 7, 1998
*
- * Modifications:
- *
*-------------------------------------------------------------------------
*/
herr_t
@@ -572,7 +564,7 @@ H5T__pack(const H5T_t *dt)
for (i = 0, offset = 0; i < dt->shared->u.compnd.nmembs; i++) {
dt->shared->u.compnd.memb[i].offset = offset;
offset += dt->shared->u.compnd.memb[i].size;
- } /* end for */
+ }
/* Change total size */
dt->shared->size = MAX(1, offset);
@@ -597,8 +589,6 @@ done:
* Programmer: Quincey Koziol
* Thursday, September 11, 2003
*
- * Modifications:
- *
*-------------------------------------------------------------------------
*/
static htri_t
@@ -634,8 +624,6 @@ H5T__is_packed(const H5T_t *dt)
* Programmer: Neil Fortner
* Monday, October 19, 2009
*
- * Modifications:
- *
*-------------------------------------------------------------------------
*/
void
diff --git a/src/H5Tconv.c b/src/H5Tconv.c
index 9b9d34f..a33a67c 100644
--- a/src/H5Tconv.c
+++ b/src/H5Tconv.c
@@ -12,7 +12,7 @@
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
/*
- * Module Info: Datatype conversions for the H5T interface.
+ * Module Info: Datatype conversions for the H5T interface.
*/
/****************/
@@ -24,15 +24,15 @@
/***********/
/* Headers */
/***********/
-#include "H5private.h" /* Generic Functions */
+#include "H5private.h" /* Generic Functions */
#include "H5CXprivate.h" /* API Contexts */
-#include "H5Dprivate.h" /* Datasets */
-#include "H5Eprivate.h" /* Error handling */
+#include "H5Dprivate.h" /* Datasets */
+#include "H5Eprivate.h" /* Error handling */
#include "H5FLprivate.h" /* Free Lists */
-#include "H5Iprivate.h" /* IDs */
-#include "H5MMprivate.h" /* Memory management */
-#include "H5Pprivate.h" /* Property lists */
-#include "H5Tpkg.h" /* Datatypes */
+#include "H5Iprivate.h" /* IDs */
+#include "H5MMprivate.h" /* Memory management */
+#include "H5Pprivate.h" /* Property lists */
+#include "H5Tpkg.h" /* Datatypes */
/****************/
/* Local Macros */
@@ -54,57 +54,57 @@
* source value has a magnitude that cannot be represented by the destination
* type.
*
- * Suffix Description
- * ------ -----------
- * sS: Signed integers to signed integers where the destination is
- * at least as wide as the source. This case cannot generate
- * overflows.
+ * Suffix Description
+ * ------ -----------
+ * sS: Signed integers to signed integers where the destination is
+ * at least as wide as the source. This case cannot generate
+ * overflows.
*
- * sU: Signed integers to unsigned integers where the destination is
- * at least as wide as the source. This case experiences
- * overflows when the source value is negative.
+ * sU: Signed integers to unsigned integers where the destination is
+ * at least as wide as the source. This case experiences
+ * overflows when the source value is negative.
*
- * uS: Unsigned integers to signed integers where the destination is
- * at least as wide as the source. This case can experience
- * overflows when the source and destination are the same size.
+ * uS: Unsigned integers to signed integers where the destination is
+ * at least as wide as the source. This case can experience
+ * overflows when the source and destination are the same size.
*
- * uU: Unsigned integers to unsigned integers where the destination
- * is at least as wide as the source. Overflows are not
- * possible in this case.
+ * uU: Unsigned integers to unsigned integers where the destination
+ * is at least as wide as the source. Overflows are not
+ * possible in this case.
*
- * Ss: Signed integers to signed integers where the source is at
- * least as large as the destination. Overflows can occur when
- * the destination is narrower than the source.
+ * Ss: Signed integers to signed integers where the source is at
+ * least as large as the destination. Overflows can occur when
+ * the destination is narrower than the source.
*
- * Su: Signed integers to unsigned integers where the source is at
- * least as large as the destination. Overflows occur when the
- * source value is negative and can also occur if the
- * destination is narrower than the source.
+ * Su: Signed integers to unsigned integers where the source is at
+ * least as large as the destination. Overflows occur when the
+ * source value is negative and can also occur if the
+ * destination is narrower than the source.
*
- * Us: Unsigned integers to signed integers where the source is at
- * least as large as the destination. Overflows can occur for
- * all sizes.
+ * Us: Unsigned integers to signed integers where the source is at
+ * least as large as the destination. Overflows can occur for
+ * all sizes.
*
- * Uu: Unsigned integers to unsigned integers where the source is at
- * least as large as the destination. Overflows can occur if the
- * destination is narrower than the source.
+ * Uu: Unsigned integers to unsigned integers where the source is at
+ * least as large as the destination. Overflows can occur if the
+ * destination is narrower than the source.
*
- * su: Conversion from signed integers to unsigned integers where
- * the source and destination are the same size. Overflow occurs
- * when the source value is negative.
+ * su: Conversion from signed integers to unsigned integers where
+ * the source and destination are the same size. Overflow occurs
+ * when the source value is negative.
*
- * us: Conversion from unsigned integers to signed integers where
- * the source and destination are the same size. Overflow
- * occurs when the source magnitude is too large for the
- * destination.
+ * us: Conversion from unsigned integers to signed integers where
+ * the source and destination are the same size. Overflow
+ * occurs when the source magnitude is too large for the
+ * destination.
*
- * fF: Floating-point values to floating-point values where the
- * destination is at least as wide as the source. This case
+ * fF: Floating-point values to floating-point values where the
+ * destination is at least as wide as the source. This case
* cannot generate overflows.
*
- * Ff: Floating-point values to floating-point values the source is at
- * least as large as the destination. Overflows can occur when
- * the destination is narrower than the source.
+ * Ff: Floating-point values to floating-point values the source is at
+ * least as large as the destination. Overflows can occur when
+ * the destination is narrower than the source.
*
* xF: Integers to float-point(float or double) values where the destination
* is at least as wide as the source. This case cannot generate
@@ -116,29 +116,29 @@
*
* The macros take a subset of these arguments in the order listed here:
*
- * CDATA: A pointer to the H5T_cdata_t structure that was passed to the
- * conversion function.
+ * CDATA: A pointer to the H5T_cdata_t structure that was passed to the
+ * conversion function.
*
- * STYPE: The hid_t value for the source datatype.
+ * STYPE: The hid_t value for the source datatype.
*
- * DTYPE: The hid_t value for the destination datatype.
+ * DTYPE: The hid_t value for the destination datatype.
*
- * BUF: A pointer to the conversion buffer.
+ * BUF: A pointer to the conversion buffer.
*
- * NELMTS: The number of values to be converted.
+ * NELMTS: The number of values to be converted.
*
- * ST: The C name for source datatype (e.g., int)
+ * ST: The C name for source datatype (e.g., int)
*
- * DT: The C name for the destination datatype (e.g., signed char)
+ * DT: The C name for the destination datatype (e.g., signed char)
*
- * D_MIN: The minimum possible destination value. For unsigned
- * destination types this should be zero. For signed
- * destination types it's a negative value with a magnitude that
- * is usually one greater than D_MAX. Source values which are
- * smaller than D_MIN generate overflows.
+ * D_MIN: The minimum possible destination value. For unsigned
+ * destination types this should be zero. For signed
+ * destination types it's a negative value with a magnitude that
+ * is usually one greater than D_MAX. Source values which are
+ * smaller than D_MIN generate overflows.
*
- * D_MAX: The maximum possible destination value. Source values which
- * are larger than D_MAX generate overflows.
+ * D_MAX: The maximum possible destination value. Source values which
+ * are larger than D_MAX generate overflows.
*
* The macros are implemented with a generic programming technique, similar
* to templates in C++. The macro which defines the "core" part of the
@@ -153,18 +153,18 @@
*
* The generic "core" macros are: (others are specific to particular conversion)
*
- * Suffix Description
- * ------ -----------
- * xX: Generic Conversion where the destination is at least as
+ * Suffix Description
+ * ------ -----------
+ * xX: Generic Conversion where the destination is at least as
* wide as the source. This case cannot generate overflows.
*
- * Xx: Generic signed conversion where the source is at least as large
+ * Xx: Generic signed conversion where the source is at least as large
* as the destination. Overflows can occur when the destination is
* narrower than the source.
*
- * Ux: Generic conversion for the `Us', `Uu' & `us' cases
- * Overflow occurs when the source magnitude is too large for the
- * destination.
+ * Ux: Generic conversion for the `Us', `Uu' & `us' cases
+ * Overflow occurs when the source magnitude is too large for the
+ * destination.
*
*/
#define H5T_CONV_xX_CORE(STYPE, DTYPE, S, D, ST, DT, D_MIN, D_MAX) \
@@ -983,14 +983,12 @@ done:
#define CI_PRINT_STATS(STYPE, DTYPE) \
{ \
if (H5DEBUG(T) && ((H5T_conv_hw_t *)cdata->priv)->s_aligned) { \
- HDfprintf(H5DEBUG(T), " %Hu src elements aligned on %lu-byte boundaries\n", \
- ((H5T_conv_hw_t *)cdata->priv)->s_aligned, \
- (unsigned long)H5T_NATIVE_##STYPE##_ALIGN_g); \
+ HDfprintf(H5DEBUG(T), " %zu src elements aligned on %zu-byte boundaries\n", \
+ ((H5T_conv_hw_t *)cdata->priv)->s_aligned, H5T_NATIVE_##STYPE##_ALIGN_g); \
} \
if (H5DEBUG(T) && ((H5T_conv_hw_t *)cdata->priv)->d_aligned) { \
- HDfprintf(H5DEBUG(T), " %Hu dst elements aligned on %lu-byte boundaries\n", \
- ((H5T_conv_hw_t *)cdata->priv)->d_aligned, \
- (unsigned long)H5T_NATIVE_##DTYPE##_ALIGN_g); \
+ HDfprintf(H5DEBUG(T), " %zu dst elements aligned on %zu-byte boundaries\n", \
+ ((H5T_conv_hw_t *)cdata->priv)->d_aligned, H5T_NATIVE_##DTYPE##_ALIGN_g); \
} \
}
@@ -1041,8 +1039,8 @@ done:
/* Conversion data for H5T__conv_struct() */
typedef struct H5T_conv_struct_t {
int * src2dst; /*mapping from src to dst member num */
- hid_t * src_memb_id; /*source member type ID's */
- hid_t * dst_memb_id; /*destination member type ID's */
+ hid_t * src_memb_id; /*source member type ID's */
+ hid_t * dst_memb_id; /*destination member type ID's */
H5T_path_t ** memb_path; /*conversion path for each member */
H5T_subset_info_t subset_info; /*info related to compound subsets */
unsigned src_nmembs; /*needed by free function */
@@ -1050,9 +1048,9 @@ typedef struct H5T_conv_struct_t {
/* Conversion data for H5T__conv_enum() */
typedef struct H5T_enum_struct_t {
- int base; /*lowest `in' value */
- unsigned length; /*num elements in arrays */
- int * src2dst; /*map from src to dst index */
+ int base; /*lowest `in' value */
+ unsigned length; /*num elements in arrays */
+ int * src2dst; /*map from src to dst index */
} H5T_enum_struct_t;
/* Conversion data for the hardware conversion functions */
@@ -9312,7 +9310,7 @@ H5T__conv_i_f(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, siz
}
/* Check if the exponent is too big */
- expo_max = (hsize_t)(HDpow((double)2.0f, (double)dst.u.f.esize) - 1);
+ expo_max = (hsize_t)(HDpow(2.0, (double)dst.u.f.esize) - 1);
if (expo > expo_max) { /*overflows*/
if (cb_struct.func) { /*user's exception handler. Reverse back source order*/
@@ -9531,14 +9529,14 @@ H5T_reclaim_cb(void *elem, const H5T_t *dt, unsigned H5_ATTR_UNUSED ndim, const
HDassert(dt);
if (dt->shared->type == H5T_REFERENCE) {
- if (H5T_ref_reclaim(elem, dt) < 0)
+ if (H5T__ref_reclaim(elem, dt) < 0)
HGOTO_ERROR(H5E_DATATYPE, H5E_CANTFREE, FAIL, "can't reclaim ref elements")
}
else {
HDassert(op_data);
/* Allow vlen reclaim to recurse into that routine */
- if (H5T_vlen_reclaim(elem, dt, (H5T_vlen_alloc_info_t *)op_data) < 0)
+ if (H5T__vlen_reclaim(elem, dt, (H5T_vlen_alloc_info_t *)op_data) < 0)
HGOTO_ERROR(H5E_DATATYPE, H5E_CANTFREE, FAIL, "can't reclaim vlen elements")
}
diff --git a/src/H5Tcset.c b/src/H5Tcset.c
index c88f643..dd145c9 100644
--- a/src/H5Tcset.c
+++ b/src/H5Tcset.c
@@ -37,10 +37,6 @@
* Programmer: Robb Matzke
* Friday, January 9, 1998
*
- * Modifications:
- * Robb Matzke, 22 Dec 1998
- * Also works for derived data types.
- *
*-------------------------------------------------------------------------
*/
H5T_cset_t
@@ -83,10 +79,6 @@ done:
* Programmer: Robb Matzke
* Friday, January 9, 1998
*
- * Modifications:
- * Robb Matzke, 22 Dec 1998
- * Also works with derived data types.
- *
*-------------------------------------------------------------------------
*/
herr_t
diff --git a/src/H5Tdbg.c b/src/H5Tdbg.c
index e9cd289..613aa60 100644
--- a/src/H5Tdbg.c
+++ b/src/H5Tdbg.c
@@ -91,6 +91,13 @@ H5T__print_stats(H5T_path_t H5_ATTR_UNUSED *path, int H5_ATTR_UNUSED *nprint /*i
if (H5DEBUG(T) && path->stats.ncalls > 0) {
hsize_t nbytes;
char bandwidth[32];
+ struct {
+ char *user;
+ char *system;
+ char *elapsed;
+ } timestrs = {H5_timer_get_time_string(path->stats.times.user),
+ H5_timer_get_time_string(path->stats.times.system),
+ H5_timer_get_time_string(path->stats.times.elapsed)};
if (nprint && 0 == (*nprint)++) {
HDfprintf(H5DEBUG(T), "H5T: type conversion statistics:\n");
@@ -108,13 +115,15 @@ H5T__print_stats(H5T_path_t H5_ATTR_UNUSED *path, int H5_ATTR_UNUSED *nprint /*i
nbytes = H5T_get_size(path->dst);
else
nbytes = 0;
-
nbytes *= path->stats.nelmts;
H5_bandwidth(bandwidth, (double)nbytes, path->stats.times.elapsed);
- HDfprintf(H5DEBUG(T), " %-16s %10Hd %10d %8T %8T %8T %10s\n", path->name, path->stats.nelmts,
- path->stats.ncalls, path->stats.times.user, path->stats.times.system,
- path->stats.times.elapsed, bandwidth);
- } /* end if */
+ HDfprintf(H5DEBUG(T), " %-16s %10" PRIdHSIZE " %10u %8s %8s %8s %10s\n", path->name,
+ path->stats.nelmts, path->stats.ncalls, timestrs.user, timestrs.system, timestrs.elapsed,
+ bandwidth);
+ HDfree(timestrs.user);
+ HDfree(timestrs.system);
+ HDfree(timestrs.elapsed);
+ }
#endif
FUNC_LEAVE_NOAPI(SUCCEED)
@@ -394,7 +403,8 @@ H5T_debug(const H5T_t *dt, FILE *stream)
HDfprintf(stream, "\n\"%s\" = 0x", dt->shared->u.enumer.name[i]);
for (k = 0; k < base_size; k++)
- HDfprintf(stream, "%02p", ((uint8_t *)dt->shared->u.enumer.value + (i * base_size) + k));
+ HDfprintf(stream, "%02" PRIx8,
+ *((uint8_t *)dt->shared->u.enumer.value + (i * base_size) + k));
} /* end for */
HDfprintf(stream, "\n");
}
diff --git a/src/H5Tdeprec.c b/src/H5Tdeprec.c
index a3c300d..277c9a2 100644
--- a/src/H5Tdeprec.c
+++ b/src/H5Tdeprec.c
@@ -15,7 +15,7 @@
*
* Created: H5Tdeprec.c
* April 5 2007
- * Quincey Koziol <koziol@hdfgroup.org>
+ * Quincey Koziol
*
* Purpose: Deprecated functions from the H5T interface. These
* functions are here for compatibility purposes and may be
diff --git a/src/H5Tenum.c b/src/H5Tenum.c
index b58ad30..72705f2 100644
--- a/src/H5Tenum.c
+++ b/src/H5Tenum.c
@@ -25,8 +25,8 @@
#include "H5Tpkg.h" /*data-type functions */
/* Static local functions */
-static char * H5T_enum_nameof(const H5T_t *dt, const void *value, char *name /*out*/, size_t size);
-static herr_t H5T_enum_valueof(const H5T_t *dt, const char *name, void *value /*out*/);
+static char * H5T__enum_nameof(const H5T_t *dt, const void *value, char *name /*out*/, size_t size);
+static herr_t H5T__enum_valueof(const H5T_t *dt, const char *name, void *value /*out*/);
/*-------------------------------------------------------------------------
* Function: H5Tenum_create
@@ -62,9 +62,9 @@ H5Tenum_create(hid_t parent_id)
if (NULL == (dt = H5T__enum_create(parent)))
HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, H5I_INVALID_HID, "cannot create enum type")
- /* Atomize the type */
+ /* Register the type */
if ((ret_value = H5I_register(H5I_DATATYPE, dt, TRUE)) < 0)
- HGOTO_ERROR(H5E_DATATYPE, H5E_CANTREGISTER, H5I_INVALID_HID, "unable to register data type atom")
+ HGOTO_ERROR(H5E_DATATYPE, H5E_CANTREGISTER, H5I_INVALID_HID, "unable to register data type ID")
done:
FUNC_LEAVE_API(ret_value)
@@ -84,8 +84,6 @@ done:
* Programmer: Raymond Lu
* October 9, 2002
*
- * Modifications:
- *
*-------------------------------------------------------------------------
*/
H5T_t *
@@ -126,8 +124,6 @@ done:
* Programmer: Robb Matzke
* Wednesday, December 23, 1998
*
- * Modifications:
- *
*-------------------------------------------------------------------------
*/
herr_t
@@ -172,8 +168,6 @@ done:
* Programmer: Robb Matzke
* Wednesday, December 23, 1998
*
- * Modifications:
- *
*-------------------------------------------------------------------------
*/
herr_t
@@ -195,7 +189,7 @@ H5T__enum_insert(const H5T_t *dt, const char *name, const void *value)
if (!HDmemcmp((uint8_t *)dt->shared->u.enumer.value + (i * dt->shared->size), value,
dt->shared->size))
HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, FAIL, "value redefinition")
- } /* end for */
+ }
/* Increase table sizes */
if (dt->shared->u.enumer.nmembs >= dt->shared->u.enumer.nalloc) {
@@ -211,7 +205,7 @@ H5T__enum_insert(const H5T_t *dt, const char *name, const void *value)
HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "memory allocation failed")
dt->shared->u.enumer.value = values;
dt->shared->u.enumer.nalloc = n;
- } /* end for */
+ }
/* Insert new member at end of member arrays */
dt->shared->u.enumer.sorted = H5T_SORT_NONE;
@@ -236,8 +230,6 @@ done:
* Programmer: Robb Matzke
* Wednesday, December 23, 1998
*
- * Modifications:
- *
*-------------------------------------------------------------------------
*/
herr_t
@@ -278,8 +270,6 @@ done:
* Programmer: Raymond Lu
* October 9, 2002
*
- * Modifications:
- *
*-------------------------------------------------------------------------
*/
herr_t
@@ -313,8 +303,6 @@ H5T__get_member_value(const H5T_t *dt, unsigned membno, void *value /*out*/)
* Programmer: Robb Matzke
* Monday, January 4, 1999
*
- * Modifications:
- *
*-------------------------------------------------------------------------
*/
herr_t
@@ -336,7 +324,7 @@ H5Tenum_nameof(hid_t type, const void *value, char *name /*out*/, size_t size)
if (!name)
HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "no name buffer supplied")
- if (NULL == H5T_enum_nameof(dt, value, name, size))
+ if (NULL == H5T__enum_nameof(dt, value, name, size))
HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, FAIL, "nameof query failed")
done:
@@ -344,7 +332,7 @@ done:
}
/*-------------------------------------------------------------------------
- * Function: H5T_enum_nameof
+ * Function: H5T__enum_nameof
*
* Purpose: Finds the symbol name that corresponds the the specified
* VALUE of an enumeration data type DT. At most SIZE characters
@@ -364,15 +352,10 @@ done:
* Programmer: Robb Matzke
* Monday, January 4, 1999
*
- * Modifications:
- * Raymond Lu
- * Wednesday, Febuary 9, 2005
- * Made a copy of original datatype and do sorting and search
- * on that copy, to protect the original order of members.
*-------------------------------------------------------------------------
*/
static char *
-H5T_enum_nameof(const H5T_t *dt, const void *value, char *name /*out*/, size_t size)
+H5T__enum_nameof(const H5T_t *dt, const void *value, char *name /*out*/, size_t size)
{
H5T_t * copied_dt = NULL; /* Do sorting in copied datatype */
unsigned lt, md = 0, rt; /* Indices for binary search */
@@ -380,7 +363,7 @@ H5T_enum_nameof(const H5T_t *dt, const void *value, char *name /*out*/, size_t s
hbool_t alloc_name = FALSE; /* Whether name has been allocated */
char * ret_value = NULL; /* Return value */
- FUNC_ENTER_NOAPI_NOINIT
+ FUNC_ENTER_STATIC
/* Check args */
HDassert(dt && H5T_ENUM == dt->shared->type);
@@ -440,7 +423,7 @@ done:
H5MM_free(name);
FUNC_LEAVE_NOAPI(ret_value)
-} /* end H5T_enum_nameof() */
+} /* end H5T__enum_nameof() */
/*-------------------------------------------------------------------------
* Function: H5Tenum_valueof
@@ -457,11 +440,6 @@ done:
* Programmer: Robb Matzke
* Monday, January 4, 1999
*
- * Modifications:
- * Raymond Lu
- * Wednesday, Febuary 9, 2005
- * Made a copy of original datatype and do sorting and search
- * on that copy, to protect the original order of members.
*-------------------------------------------------------------------------
*/
herr_t
@@ -483,7 +461,7 @@ H5Tenum_valueof(hid_t type, const char *name, void *value /*out*/)
if (!value)
HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "no value buffer")
- if (H5T_enum_valueof(dt, name, value) < 0)
+ if (H5T__enum_valueof(dt, name, value) < 0)
HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, FAIL, "valueof query failed")
done:
@@ -491,7 +469,7 @@ done:
} /* H5Tenum_valueof() */
/*-------------------------------------------------------------------------
- * Function: H5T_enum_valueof
+ * Function: H5T__enum_valueof
*
* Purpose: Finds the value that corresponds the the specified symbol
* NAME of an enumeration data type DT and copy it to the VALUE
@@ -505,22 +483,17 @@ done:
* Programmer: Robb Matzke
* Monday, January 4, 1999
*
- * Modifications:
- * Raymond Lu
- * Wednesday, Febuary 9, 2005
- * Made a copy of original datatype and do sorting and search
- * on that copy, to protect the original order of members.
*-------------------------------------------------------------------------
*/
static herr_t
-H5T_enum_valueof(const H5T_t *dt, const char *name, void *value /*out*/)
+H5T__enum_valueof(const H5T_t *dt, const char *name, void *value /*out*/)
{
unsigned lt, md = 0, rt; /*indices for binary search */
int cmp = (-1); /*comparison result */
H5T_t * copied_dt = NULL; /*do sorting in copied datatype */
herr_t ret_value = SUCCEED; /* Return value */
- FUNC_ENTER_NOAPI_NOINIT
+ FUNC_ENTER_STATIC
/* Check args */
HDassert(dt && H5T_ENUM == dt->shared->type);
diff --git a/src/H5Tfields.c b/src/H5Tfields.c
index fc7cde8..baeae6d 100644
--- a/src/H5Tfields.c
+++ b/src/H5Tfields.c
@@ -39,9 +39,6 @@
* Programmer: Robb Matzke
* Monday, December 8, 1997
*
- * Modifications:
- * Robb Matzke, 22 Dec 1998
- * Also works with enumeration datatypes.
*-------------------------------------------------------------------------
*/
int
@@ -80,8 +77,6 @@ done:
* Programmer: Raymond Lu
* October 8, 2002
*
- * Modifications:
- *
*-------------------------------------------------------------------------
*/
int
@@ -120,9 +115,6 @@ done:
* Programmer: Robb Matzke
* Wednesday, January 7, 1998
*
- * Modifications:
- * Robb Matzke, 22 Dec 1998
- * Also works with enumeration datatypes.
*-------------------------------------------------------------------------
*/
char *
@@ -161,7 +153,6 @@ done:
* Programmer: Raymond Lu
* October 9, 2002
*
- * Modifications:
*-------------------------------------------------------------------------
*/
char *
@@ -219,8 +210,6 @@ done:
* Programmer: Raymond Lu
* Thursday, April 4, 2002
*
- * Modifications:
- *
*-------------------------------------------------------------------------
*/
int
@@ -389,8 +378,6 @@ H5T__sort_value(const H5T_t *dt, int *map)
* Programmer: Robb Matzke
* Monday, January 4, 1999
*
- * Modifications:
- *
*-------------------------------------------------------------------------
*/
herr_t
diff --git a/src/H5Tfixed.c b/src/H5Tfixed.c
index 3ff43a6..9527a5a 100644
--- a/src/H5Tfixed.c
+++ b/src/H5Tfixed.c
@@ -35,9 +35,6 @@
* Programmer: Robb Matzke
* Wednesday, January 7, 1998
*
- * Modifications:
- * Robb Matzke, 22 Dec 1998
- * Also works with derived datatypes.
*-------------------------------------------------------------------------
*/
H5T_sign_t
@@ -72,8 +69,6 @@ done:
* Programmer: Raymond Lu
* October 8, 2002
*
- * Modifications:
- *
*-------------------------------------------------------------------------
*/
H5T_sign_t
@@ -110,10 +105,6 @@ done:
* Programmer: Robb Matzke
* Wednesday, January 7, 1998
*
- * Modifications:
- * Robb Matzke, 22 Dec 1998
- * Also works with derived datatypes.
- *
*-------------------------------------------------------------------------
*/
herr_t
diff --git a/src/H5Tfloat.c b/src/H5Tfloat.c
index be49936..b3fa724 100644
--- a/src/H5Tfloat.c
+++ b/src/H5Tfloat.c
@@ -187,10 +187,6 @@ done:
* Programmer: Robb Matzke
* Wednesday, January 7, 1998
*
- * Modifications:
- * Robb Matzke, 22 Dec 1998
- * Also works with derived datatypes.
- *
*-------------------------------------------------------------------------
*/
herr_t
diff --git a/src/H5Tmodule.h b/src/H5Tmodule.h
index 4f9edde..c489edc 100644
--- a/src/H5Tmodule.h
+++ b/src/H5Tmodule.h
@@ -44,12 +44,8 @@
* \ingroup H5T
* \defgroup ENUM Enumeration Datatypes
* \ingroup H5T
- * \defgroup GTO General Datatype Operations
- * \ingroup H5T
* \defgroup OPAQUE Opaque Datatypes
* \ingroup H5T
- * \defgroup STRING String Datatypes
- * \ingroup H5T
* \defgroup VLEN Variable-length Sequence Datatypes
* \ingroup H5T
*
diff --git a/src/H5Tnative.c b/src/H5Tnative.c
index b1f0581..2688b23 100644
--- a/src/H5Tnative.c
+++ b/src/H5Tnative.c
@@ -18,13 +18,13 @@
#include "H5Tmodule.h" /* This source code file is part of the H5T module */
-#include "H5private.h" /* Generic Functions */
+#include "H5private.h" /* Generic Functions */
#include "H5CXprivate.h" /* API Contexts */
-#include "H5Eprivate.h" /* Error handling */
-#include "H5Iprivate.h" /* IDs */
-#include "H5Pprivate.h" /* Property lists */
-#include "H5MMprivate.h" /* Memory management */
-#include "H5Tpkg.h" /* Datatypes */
+#include "H5Eprivate.h" /* Error handling */
+#include "H5Iprivate.h" /* IDs */
+#include "H5Pprivate.h" /* Property lists */
+#include "H5MMprivate.h" /* Memory management */
+#include "H5Tpkg.h" /* Datatypes */
/* Static local functions */
static H5T_t *H5T__get_native_type(H5T_t *dt, H5T_direction_t direction, size_t *struct_align, size_t *offset,
@@ -338,7 +338,7 @@ H5T__get_native_type(H5T_t *dtype, H5T_direction_t direction, size_t *struct_ali
break;
case H5T_ENUM: {
- H5T_path_t *tpath; /* Type conversion info */
+ H5T_path_t *tpath; /* Type conversion info */
hid_t super_type_id, nat_super_type_id;
/* Don't need to do anything special for alignment, offset since the ENUM type usually is integer.
@@ -922,18 +922,18 @@ done:
H5_GCC_DIAG_ON("duplicated-branches")
/*-------------------------------------------------------------------------
- * Function: H5T__cmp_offset
+ * Function: H5T__cmp_offset
*
- * Purpose: This function is only for convenience. It computes the
+ * Purpose: This function is only for convenience. It computes the
* compound type size, offset of the member being considered
* and the alignment for the whole compound type.
*
- * Return: Success: Non-negative value.
+ * Return: Success: Non-negative value.
*
- * Failure: Negative value.
+ * Failure: Negative value.
*
- * Programmer: Raymond Lu
- * December 10, 2002
+ * Programmer: Raymond Lu
+ * December 10, 2002
*
*-------------------------------------------------------------------------
*/
diff --git a/src/H5Toffset.c b/src/H5Toffset.c
index baa9d69..b206dca 100644
--- a/src/H5Toffset.c
+++ b/src/H5Toffset.c
@@ -24,7 +24,7 @@
#include "H5Tpkg.h" /* Datatypes */
/* Static local functions */
-static herr_t H5T_set_offset(const H5T_t *dt, size_t offset);
+static herr_t H5T__set_offset(const H5T_t *dt, size_t offset);
/*-------------------------------------------------------------------------
* Function: H5Tget_offset
@@ -158,10 +158,6 @@ done:
* Programmer: Robb Matzke
* Wednesday, January 7, 1998
*
- * Modifications:
- * Robb Matzke, 22 Dec 1998
- * Moved real work to a private function.
- *
*-------------------------------------------------------------------------
*/
herr_t
@@ -187,7 +183,7 @@ H5Tset_offset(hid_t type_id, size_t offset)
HGOTO_ERROR(H5E_DATATYPE, H5E_UNSUPPORTED, FAIL, "operation not defined for this datatype")
/* Do the real work */
- if (H5T_set_offset(dt, offset) < 0)
+ if (H5T__set_offset(dt, offset) < 0)
HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, FAIL, "unable to set offset")
done:
@@ -195,7 +191,7 @@ done:
}
/*-------------------------------------------------------------------------
- * Function: H5T_set_offset
+ * Function: H5T__set_offset
*
* Purpose: Sets the bit offset of the first significant bit. The
* significant bits of an atomic datum can be offset from the
@@ -227,18 +223,14 @@ done:
* Programmer: Robb Matzke
* Wednesday, January 7, 1998
*
- * Modifications:
- * Robb Matzke, 22 Dec 1998
- * Also works for derived data types.
- *
*-------------------------------------------------------------------------
*/
static herr_t
-H5T_set_offset(const H5T_t *dt, size_t offset)
+H5T__set_offset(const H5T_t *dt, size_t offset)
{
herr_t ret_value = SUCCEED; /* Return value */
- FUNC_ENTER_NOAPI(FAIL)
+ FUNC_ENTER_STATIC
/* Check args */
HDassert(dt);
@@ -249,7 +241,7 @@ H5T_set_offset(const H5T_t *dt, size_t offset)
HDassert(!(H5T_ENUM == dt->shared->type && 0 == dt->shared->u.enumer.nmembs));
if (dt->shared->parent) {
- if (H5T_set_offset(dt->shared->parent, offset) < 0)
+ if (H5T__set_offset(dt->shared->parent, offset) < 0)
HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, FAIL, "unable to set offset for base type")
/* Adjust size of datatype appropriately */
diff --git a/src/H5Toh.c b/src/H5Toh.c
index de011e4..8d1ac63 100644
--- a/src/H5Toh.c
+++ b/src/H5Toh.c
@@ -209,7 +209,7 @@ H5O__dtype_get_oloc(hid_t obj_id)
/* Get the datatype */
if (NULL == (dt = (H5T_t *)H5I_object(obj_id)))
- HGOTO_ERROR(H5E_OHDR, H5E_BADATOM, NULL, "couldn't get object from ID")
+ HGOTO_ERROR(H5E_OHDR, H5E_BADID, NULL, "couldn't get object from ID")
/* If this is a named datatype, get the VOL driver pointer to the datatype */
type = (H5T_t *)H5T_get_actual_type(dt);
diff --git a/src/H5Topaque.c b/src/H5Topaque.c
index 16e38d6..f097fca 100644
--- a/src/H5Topaque.c
+++ b/src/H5Topaque.c
@@ -34,8 +34,6 @@
* Programmer: Robb Matzke
* Thursday, May 20, 1999
*
- * Modifications:
- *
*-------------------------------------------------------------------------
*/
herr_t
@@ -80,8 +78,6 @@ done:
* Programmer: Robb Matzke
* Thursday, May 20, 1999
*
- * Modifications:
- *
*-------------------------------------------------------------------------
*/
char *
diff --git a/src/H5Torder.c b/src/H5Torder.c
index d28bd9e..e0b48b3 100644
--- a/src/H5Torder.c
+++ b/src/H5Torder.c
@@ -45,7 +45,7 @@
/********************/
/* Local Prototypes */
/********************/
-static herr_t H5T_set_order(H5T_t *dtype, H5T_order_t order);
+static herr_t H5T__set_order(H5T_t *dtype, H5T_order_t order);
/*********************/
/* Public Variables */
@@ -204,7 +204,7 @@ H5Tset_order(hid_t type_id, H5T_order_t order)
HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, FAIL, "datatype is read-only")
/* Call internal routine to set the order */
- if (H5T_set_order(dt, order) < 0)
+ if (H5T__set_order(dt, order) < 0)
HGOTO_ERROR(H5E_DATATYPE, H5E_UNSUPPORTED, FAIL, "can't set order")
done:
@@ -212,7 +212,7 @@ done:
} /* end H5Tset_order() */
/*-------------------------------------------------------------------------
- * Function: H5T_set_order
+ * Function: H5T__set_order
*
* Purpose: Private function to set the byte order for a datatype.
*
@@ -224,11 +224,11 @@ done:
*-------------------------------------------------------------------------
*/
static herr_t
-H5T_set_order(H5T_t *dtype, H5T_order_t order)
+H5T__set_order(H5T_t *dtype, H5T_order_t order)
{
herr_t ret_value = SUCCEED; /* Return value */
- FUNC_ENTER_NOAPI(FAIL)
+ FUNC_ENTER_STATIC
if (H5T_ENUM == dtype->shared->type && dtype->shared->u.enumer.nmembs > 0)
HGOTO_ERROR(H5E_DATATYPE, H5E_CANTSET, FAIL, "operation not allowed after enum members are defined")
@@ -262,11 +262,11 @@ H5T_set_order(H5T_t *dtype, H5T_order_t order)
/* Loop through all fields of compound type, setting the order */
for (i = 0; i < nmemb; i++)
- if (H5T_set_order(dtype->shared->u.compnd.memb[i].type, order) < 0)
+ if (H5T__set_order(dtype->shared->u.compnd.memb[i].type, order) < 0)
HGOTO_ERROR(H5E_DATATYPE, H5E_CANTSET, FAIL, "can't set order for compound member")
} /* end if */
} /* end else */
done:
FUNC_LEAVE_NOAPI(ret_value)
-} /* end H5T_set_order() */
+} /* end H5T__set_order() */
diff --git a/src/H5Tpad.c b/src/H5Tpad.c
index 5eaf99c..db1a2cb 100644
--- a/src/H5Tpad.c
+++ b/src/H5Tpad.c
@@ -35,10 +35,6 @@
* Programmer: Robb Matzke
* Friday, January 9, 1998
*
- * Modifications:
- * Robb Matzke, 22 Dec 1998
- * Also works with derived data types.
- *
*-------------------------------------------------------------------------
*/
herr_t
@@ -78,10 +74,6 @@ done:
* Programmer: Robb Matzke
* Friday, January 9, 1998
*
- * Modifications:
- * Robb Matzke, 22 Dec 1998
- * Also works with derived data types.
- *
*-------------------------------------------------------------------------
*/
herr_t
diff --git a/src/H5Tpkg.h b/src/H5Tpkg.h
index d88a379..220adb3b2 100644
--- a/src/H5Tpkg.h
+++ b/src/H5Tpkg.h
@@ -858,6 +858,7 @@ H5_DLL void H5T__bit_neg(uint8_t *buf, size_t start, size_t size);
/* VL functions */
H5_DLL H5T_t *H5T__vlen_create(const H5T_t *base);
+H5_DLL herr_t H5T__vlen_reclaim(void *elem, const H5T_t *dt, H5T_vlen_alloc_info_t *alloc_info);
H5_DLL htri_t H5T__vlen_set_loc(const H5T_t *dt, H5VL_object_t *file, H5T_loc_t loc);
/* Array functions */
@@ -866,6 +867,7 @@ H5_DLL int H5T__get_array_ndims(const H5T_t *dt);
H5_DLL int H5T__get_array_dims(const H5T_t *dt, hsize_t dims[]);
/* Reference functions */
+H5_DLL herr_t H5T__ref_reclaim(void *elem, const H5T_t *dt);
H5_DLL htri_t H5T__ref_set_loc(const H5T_t *dt, H5VL_object_t *file, H5T_loc_t loc);
/* Compound functions */
diff --git a/src/H5Tprecis.c b/src/H5Tprecis.c
index 69ccb84..f992141 100644
--- a/src/H5Tprecis.c
+++ b/src/H5Tprecis.c
@@ -42,10 +42,6 @@ static herr_t H5T_set_precision(const H5T_t *dt, size_t prec);
* Programmer: Robb Matzke
* Wednesday, January 7, 1998
*
- * Modifications:
- * Robb Matzke, 22 Dec 1998
- * Also works for derived datatypes.
- *
*-------------------------------------------------------------------------
*/
size_t
@@ -129,10 +125,6 @@ done:
* Programmer: Robb Matzke
* Wednesday, January 7, 1998
*
- * Modifications:
- * Robb Matzke, 22 Dec 1998
- * Moved real work to a private function.
- *
*-------------------------------------------------------------------------
*/
herr_t
@@ -191,10 +183,6 @@ done:
* Programmer: Robb Matzke
* Wednesday, January 7, 1998
*
- * Modifications:
- * Robb Matzke, 22 Dec 1998
- * Also works for derived datatypes.
- *
*-------------------------------------------------------------------------
*/
static herr_t
diff --git a/src/H5Tprivate.h b/src/H5Tprivate.h
index ecec597..e1d0f88 100644
--- a/src/H5Tprivate.h
+++ b/src/H5Tprivate.h
@@ -24,7 +24,7 @@ typedef struct H5T_t H5T_t;
#include "H5Tpublic.h"
/* Other public headers needed by this file */
-#include "H5MMpublic.h" /* Memory management */
+#include "H5MMpublic.h" /* Memory management */
/* Private headers needed by this file */
#include "H5private.h" /* Generic Functions */
@@ -135,8 +135,6 @@ H5_DLL herr_t H5T_convert(H5T_path_t *tpath, hid_t src_id, hid_t dst_id, size_t
size_t bkg_stride, void *buf, void *bkg);
H5_DLL herr_t H5T_reclaim(hid_t type_id, struct H5S_t *space, void *buf);
H5_DLL herr_t H5T_reclaim_cb(void *elem, const H5T_t *dt, unsigned ndim, const hsize_t *point, void *op_data);
-H5_DLL herr_t H5T_ref_reclaim(void *elem, const H5T_t *dt);
-H5_DLL herr_t H5T_vlen_reclaim(void *elem, const H5T_t *dt, H5T_vlen_alloc_info_t *alloc_info);
H5_DLL herr_t H5T_vlen_reclaim_elmt(void *elem, H5T_t *dt);
H5_DLL htri_t H5T_set_loc(H5T_t *dt, H5VL_object_t *file, H5T_loc_t loc);
H5_DLL htri_t H5T_is_sensible(const H5T_t *dt);
diff --git a/src/H5Tref.c b/src/H5Tref.c
index 213176c..98389e8 100644
--- a/src/H5Tref.c
+++ b/src/H5Tref.c
@@ -40,6 +40,22 @@
#define H5T_REF_OBJ_DISK_SIZE(f) (H5F_SIZEOF_ADDR(f))
#define H5T_REF_DSETREG_DISK_SIZE(f) (H5HG_HEAP_ID_SIZE(f))
+/* Debug */
+// #define H5T_REF_DEBUG
+#ifdef H5T_REF_DEBUG
+#define H5T_REF_LOG_DEBUG(...) \
+ do { \
+ HDfprintf(stdout, " # %s(): ", __func__); \
+ HDfprintf(stdout, __VA_ARGS__); \
+ HDfprintf(stdout, "\n"); \
+ HDfflush(stdout); \
+ } while (0)
+#else
+#define H5T_REF_LOG_DEBUG(...) \
+ do { \
+ } while (0)
+#endif
+
/******************/
/* Local Typedefs */
/******************/
@@ -145,6 +161,7 @@ H5T__ref_set_loc(const H5T_t *dt, H5VL_object_t *file, H5T_loc_t loc)
htri_t ret_value = FALSE; /* Indicate success, but no location change */
FUNC_ENTER_PACKAGE
+ H5T_REF_LOG_DEBUG("loc=%d", (int)loc);
HDassert(dt);
/* f is NULL when loc == H5T_LOC_MEMORY */
@@ -331,6 +348,7 @@ H5T__ref_mem_isnull(const H5VL_object_t H5_ATTR_UNUSED *src_file, const void *sr
herr_t ret_value = SUCCEED;
FUNC_ENTER_STATIC_NOERR
+ H5T_REF_LOG_DEBUG("");
/* Check parameters */
HDassert(src_buf);
@@ -356,6 +374,7 @@ H5T__ref_mem_setnull(H5VL_object_t H5_ATTR_UNUSED *dst_file, void *dst_buf, H5_A
herr_t ret_value = SUCCEED;
FUNC_ENTER_STATIC_NOERR
+ H5T_REF_LOG_DEBUG("");
HDmemset(dst_buf, 0, H5T_REF_MEM_SIZE);
@@ -383,6 +402,7 @@ H5T__ref_mem_getsize(H5VL_object_t H5_ATTR_UNUSED *src_file, const void *src_buf
size_t ret_value = 0; /* Return value */
FUNC_ENTER_STATIC
+ H5T_REF_LOG_DEBUG("");
/* Sanity check */
HDassert(src_buf);
@@ -483,6 +503,7 @@ H5T__ref_mem_read(H5VL_object_t H5_ATTR_UNUSED *src_file, const void *src_buf, s
herr_t ret_value = SUCCEED; /* Return value */
FUNC_ENTER_STATIC
+ H5T_REF_LOG_DEBUG("");
/* Sanity check */
HDassert(src_buf);
@@ -492,7 +513,7 @@ H5T__ref_mem_read(H5VL_object_t H5_ATTR_UNUSED *src_file, const void *src_buf, s
/* Memory-to-memory conversion to support vlen conversion */
if (NULL == dst_file) {
- HDmemcpy(dst_buf, src_buf, dst_size);
+ H5MM_memcpy(dst_buf, src_buf, dst_size);
HGOTO_DONE(ret_value);
}
@@ -565,22 +586,25 @@ H5T__ref_mem_write(H5VL_object_t *src_file, const void *src_buf, size_t src_size
H5VL_object_t H5_ATTR_UNUSED *dst_file, void *dst_buf, size_t dst_size,
void H5_ATTR_UNUSED *bg_buf)
{
- H5F_t * src_f = NULL;
- hid_t file_id = H5I_INVALID_HID;
- H5R_ref_priv_t *dst_ref = (H5R_ref_priv_t *)dst_buf;
+ H5F_t * src_f = NULL;
+ hid_t file_id = H5I_INVALID_HID;
+ H5R_ref_priv_t *dst_ref = (H5R_ref_priv_t *)dst_buf;
+ H5R_ref_priv_t tmp_ref; /* Temporary reference to decode into */
herr_t ret_value = SUCCEED;
FUNC_ENTER_STATIC
+ H5T_REF_LOG_DEBUG("");
/* Sanity check */
HDassert(src_buf);
HDassert(src_size);
HDassert(dst_buf);
HDassert(dst_size == H5T_REF_MEM_SIZE);
+ HDcompile_assert(sizeof(*dst_ref) == sizeof(tmp_ref));
/* Memory-to-memory conversion to support vlen conversion */
if (NULL == src_file) {
- HDmemcpy(dst_buf, src_buf, src_size);
+ H5MM_memcpy(dst_buf, src_buf, src_size);
HGOTO_DONE(ret_value);
}
@@ -602,13 +626,13 @@ H5T__ref_mem_write(H5VL_object_t *src_file, const void *src_buf, size_t src_size
HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "invalid VOL object")
/* Make sure reference buffer is correctly initialized */
- HDmemset(dst_buf, 0, dst_size);
+ HDmemset(&tmp_ref, 0, sizeof(tmp_ref));
switch (src_type) {
case H5R_OBJECT1: {
size_t token_size = H5F_SIZEOF_ADDR(src_f);
- if (H5R__create_object((const H5O_token_t *)src_buf, token_size, dst_ref) < 0)
+ if (H5R__create_object((const H5O_token_t *)src_buf, token_size, &tmp_ref) < 0)
HGOTO_ERROR(H5E_REFERENCE, H5E_CANTCREATE, FAIL, "unable to create object reference")
} break;
@@ -616,7 +640,7 @@ H5T__ref_mem_write(H5VL_object_t *src_file, const void *src_buf, size_t src_size
const struct H5Tref_dsetreg *src_reg = (const struct H5Tref_dsetreg *)src_buf;
size_t token_size = H5F_SIZEOF_ADDR(src_f);
- if (H5R__create_region(&src_reg->token, token_size, src_reg->space, dst_ref) < 0)
+ if (H5R__create_region(&src_reg->token, token_size, src_reg->space, &tmp_ref) < 0)
HGOTO_ERROR(H5E_REFERENCE, H5E_CANTCREATE, FAIL, "unable to create region reference")
/* create_region creates its internal copy of the space */
@@ -628,11 +652,12 @@ H5T__ref_mem_write(H5VL_object_t *src_file, const void *src_buf, size_t src_size
/* Pass the correct encoding version for the selection depending on the
* file libver bounds, this is later retrieved in H5S hyper decode */
H5CX_set_libver_bounds(src_f);
+ /* FALLTHROUGH */
H5_ATTR_FALLTHROUGH
case H5R_OBJECT2:
case H5R_ATTR:
/* Decode reference */
- if (H5R__decode((const unsigned char *)src_buf, &src_size, dst_ref) < 0)
+ if (H5R__decode((const unsigned char *)src_buf, &src_size, &tmp_ref) < 0)
HGOTO_ERROR(H5E_REFERENCE, H5E_CANTDECODE, FAIL, "Cannot decode reference")
break;
@@ -644,17 +669,20 @@ H5T__ref_mem_write(H5VL_object_t *src_file, const void *src_buf, size_t src_size
} /* end switch */
/* If no filename set, this is not an external reference */
- if (NULL == H5R_REF_FILENAME(dst_ref)) {
+ if (NULL == H5R_REF_FILENAME(&tmp_ref)) {
/* TODO temporary hack to retrieve file object */
if ((file_id = H5F_get_file_id(src_file, H5I_FILE, FALSE)) < 0)
HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a file or file object")
/* Attach loc ID to reference and hold reference to it, this is a
* user exposed reference so set app_ref to TRUE. */
- if (H5R__set_loc_id(dst_ref, file_id, TRUE, TRUE) < 0)
+ if (H5R__set_loc_id(&tmp_ref, file_id, TRUE, TRUE) < 0)
HGOTO_ERROR(H5E_REFERENCE, H5E_CANTSET, FAIL, "unable to attach location id to reference")
} /* end if */
+ /* Set output info */
+ HDmemcpy(dst_ref, &tmp_ref, sizeof(tmp_ref));
+
done:
if ((file_id != H5I_INVALID_HID) && (H5I_dec_ref(file_id) < 0))
HDONE_ERROR(H5E_REFERENCE, H5E_CANTDEC, FAIL, "unable to decrement refcount on location id")
@@ -678,6 +706,7 @@ H5T__ref_disk_isnull(const H5VL_object_t *src_file, const void *src_buf, hbool_t
herr_t ret_value = SUCCEED;
FUNC_ENTER_STATIC
+ H5T_REF_LOG_DEBUG("");
/* Check parameters */
HDassert(src_file);
@@ -720,6 +749,7 @@ H5T__ref_disk_setnull(H5VL_object_t *dst_file, void *dst_buf, void *bg_buf)
herr_t ret_value = SUCCEED;
FUNC_ENTER_STATIC
+ H5T_REF_LOG_DEBUG("");
HDassert(dst_file);
HDassert(dst_buf);
@@ -768,6 +798,7 @@ H5T__ref_disk_getsize(H5VL_object_t H5_ATTR_UNUSED *src_file, const void *src_bu
size_t ret_value = 0;
FUNC_ENTER_STATIC
+ H5T_REF_LOG_DEBUG("");
HDassert(src_buf);
@@ -816,6 +847,7 @@ H5T__ref_disk_read(H5VL_object_t *src_file, const void *src_buf, size_t H5_ATTR_
herr_t ret_value = SUCCEED;
FUNC_ENTER_STATIC
+ H5T_REF_LOG_DEBUG("");
HDassert(src_file);
HDassert(src_buf);
@@ -861,6 +893,7 @@ H5T__ref_disk_write(H5VL_object_t H5_ATTR_UNUSED *src_file, const void *src_buf,
herr_t ret_value = SUCCEED;
FUNC_ENTER_STATIC
+ H5T_REF_LOG_DEBUG("");
HDassert(src_buf);
HDassert(src_size);
@@ -919,6 +952,7 @@ H5T__ref_obj_disk_isnull(const H5VL_object_t *src_file, const void *src_buf, hbo
herr_t ret_value = SUCCEED;
FUNC_ENTER_STATIC
+ H5T_REF_LOG_DEBUG("");
/* Check parameters */
HDassert(src_file);
@@ -970,6 +1004,7 @@ H5T__ref_obj_disk_getsize(H5VL_object_t *src_file, const void H5_ATTR_UNUSED *sr
size_t ret_value = 0;
FUNC_ENTER_STATIC
+ H5T_REF_LOG_DEBUG("");
HDassert(src_file);
HDassert(src_buf);
@@ -1016,6 +1051,7 @@ H5T__ref_obj_disk_read(H5VL_object_t *src_file, const void *src_buf, size_t src_
herr_t ret_value = SUCCEED;
FUNC_ENTER_STATIC
+ H5T_REF_LOG_DEBUG("");
HDassert(src_file);
HDassert(src_buf);
@@ -1068,6 +1104,7 @@ H5T__ref_dsetreg_disk_isnull(const H5VL_object_t *src_file, const void *src_buf,
herr_t ret_value = SUCCEED;
FUNC_ENTER_STATIC
+ H5T_REF_LOG_DEBUG("");
/* Check parameters */
HDassert(src_file);
@@ -1122,6 +1159,7 @@ H5T__ref_dsetreg_disk_getsize(H5VL_object_t H5_ATTR_UNUSED *src_file, const void
#else
FUNC_ENTER_STATIC_NOERR
#endif
+ H5T_REF_LOG_DEBUG("");
HDassert(src_buf);
@@ -1170,6 +1208,7 @@ H5T__ref_dsetreg_disk_read(H5VL_object_t *src_file, const void *src_buf, size_t
herr_t ret_value = SUCCEED;
FUNC_ENTER_STATIC
+ H5T_REF_LOG_DEBUG("");
HDassert(src_file);
HDassert(src_buf);
@@ -1205,7 +1244,7 @@ done:
} /* end H5T__ref_dsetreg_disk_read() */
/*-------------------------------------------------------------------------
- * Function: H5T_ref_reclaim
+ * Function: H5T__ref_reclaim
*
* Purpose: Internal routine to free reference datatypes
*
@@ -1214,11 +1253,12 @@ done:
*-------------------------------------------------------------------------
*/
herr_t
-H5T_ref_reclaim(void *elem, const H5T_t *dt)
+H5T__ref_reclaim(void *elem, const H5T_t *dt)
{
herr_t ret_value = SUCCEED; /* Return value */
- FUNC_ENTER_NOAPI_NOINIT
+ FUNC_ENTER_PACKAGE
+ H5T_REF_LOG_DEBUG("");
/* Sanity checks */
HDassert(elem);
@@ -1229,4 +1269,4 @@ H5T_ref_reclaim(void *elem, const H5T_t *dt)
done:
FUNC_LEAVE_NOAPI(ret_value)
-} /* end H5T_ref_reclaim() */
+} /* end H5T__ref_reclaim() */
diff --git a/src/H5Tstrpad.c b/src/H5Tstrpad.c
index d9ad791..5937f74 100644
--- a/src/H5Tstrpad.c
+++ b/src/H5Tstrpad.c
@@ -38,10 +38,6 @@
* Programmer: Robb Matzke
* Friday, January 9, 1998
*
- * Modifications:
- * Robb Matzke, 22 Dec 1998
- * Also works for derived datatypes.
- *
*-------------------------------------------------------------------------
*/
H5T_str_t
@@ -94,10 +90,6 @@ done:
* Programmer: Robb Matzke
* Friday, January 9, 1998
*
- * Modifications:
- * Robb Matzke, 22 Dec 1998
- * Also works for derived datatypes.
- *
*-------------------------------------------------------------------------
*/
herr_t
diff --git a/src/H5Tvisit.c b/src/H5Tvisit.c
index 312d112..7974d49 100644
--- a/src/H5Tvisit.c
+++ b/src/H5Tvisit.c
@@ -22,7 +22,7 @@
*
* Created: H5Tvisit.c
* Jul 19 2007
- * Quincey Koziol <koziol@hdfgroup.org>
+ * Quincey Koziol
*
* Purpose: Visit all the components of a datatype
*
diff --git a/src/H5Tvlen.c b/src/H5Tvlen.c
index 40c208f..e220450 100644
--- a/src/H5Tvlen.c
+++ b/src/H5Tvlen.c
@@ -160,7 +160,7 @@ H5Tvlen_create(hid_t base_id)
if ((dt = H5T__vlen_create(base)) == NULL)
HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, FAIL, "invalid VL location")
- /* Atomize the type */
+ /* Register the type */
if ((ret_value = H5I_register(H5I_DATATYPE, dt, TRUE)) < 0)
HGOTO_ERROR(H5E_DATATYPE, H5E_CANTREGISTER, FAIL, "unable to register datatype")
@@ -1012,7 +1012,7 @@ done:
} /* end H5T__vlen_disk_delete() */
/*-------------------------------------------------------------------------
- * Function: H5T_vlen_reclaim
+ * Function: H5T__vlen_reclaim
*
* Purpose: Internal recursive routine to free VL datatypes
*
@@ -1024,7 +1024,7 @@ done:
*-------------------------------------------------------------------------
*/
herr_t
-H5T_vlen_reclaim(void *elem, const H5T_t *dt, H5T_vlen_alloc_info_t *alloc_info)
+H5T__vlen_reclaim(void *elem, const H5T_t *dt, H5T_vlen_alloc_info_t *alloc_info)
{
unsigned u; /* Local index variable */
H5MM_free_t free_func; /* Free function */
@@ -1133,7 +1133,7 @@ H5T_vlen_reclaim(void *elem, const H5T_t *dt, H5T_vlen_alloc_info_t *alloc_info)
done:
FUNC_LEAVE_NOAPI(ret_value)
-} /* end H5T_vlen_reclaim() */
+} /* end H5T__vlen_reclaim() */
/*-------------------------------------------------------------------------
* Function: H5T_vlen_reclaim_elmt
@@ -1167,7 +1167,7 @@ H5T_vlen_reclaim_elmt(void *elem, H5T_t *dt)
HGOTO_ERROR(H5E_DATATYPE, H5E_CANTGET, FAIL, "unable to retrieve VL allocation info")
/* Recurse on buffer to free dynamic fields */
- if (H5T_vlen_reclaim(elem, dt, &vl_alloc_info) < 0)
+ if (H5T__vlen_reclaim(elem, dt, &vl_alloc_info) < 0)
HGOTO_ERROR(H5E_DATATYPE, H5E_CANTFREE, FAIL, "can't reclaim vlen elements")
done:
diff --git a/src/H5VLconnector.h b/src/H5VLconnector.h
index dca2864..acebe27 100644
--- a/src/H5VLconnector.h
+++ b/src/H5VLconnector.h
@@ -81,7 +81,8 @@ typedef enum H5VL_dataset_get_t {
typedef enum H5VL_dataset_specific_t {
H5VL_DATASET_SET_EXTENT, /* H5Dset_extent */
H5VL_DATASET_FLUSH, /* H5Dflush */
- H5VL_DATASET_REFRESH /* H5Drefresh */
+ H5VL_DATASET_REFRESH, /* H5Drefresh */
+ H5VL_DATASET_WAIT /* H5Dwait */
} H5VL_dataset_specific_t;
/* Typedef for VOL connector dataset optional VOL operations */
@@ -120,7 +121,8 @@ typedef enum H5VL_file_specific_t {
H5VL_FILE_UNMOUNT, /* Unmount a file */
H5VL_FILE_IS_ACCESSIBLE, /* Check if a file is accessible */
H5VL_FILE_DELETE, /* Delete a file */
- H5VL_FILE_IS_EQUAL /* Check if two files are the same */
+ H5VL_FILE_IS_EQUAL, /* Check if two files are the same */
+ H5VL_FILE_WAIT /* Wait for async operations to complete */
} H5VL_file_specific_t;
/* Typedef for VOL connector file optional VOL operations */
@@ -184,11 +186,25 @@ typedef enum H5VL_object_specific_t {
/* Typedef for VOL connector object optional VOL operations */
typedef int H5VL_object_optional_t;
+/* Status values for async request operations */
+typedef enum H5VL_request_status_t {
+ H5VL_REQUEST_STATUS_IN_PROGRESS, /* Operation has not yet completed */
+ H5VL_REQUEST_STATUS_SUCCEED, /* Operation has completed, successfully */
+ H5VL_REQUEST_STATUS_FAIL, /* Operation has completed, but failed */
+ H5VL_REQUEST_STATUS_CANT_CANCEL, /* An attempt to cancel this operation was made, but it */
+ /* can't be canceled immediately. The operation has */
+ /* not completed successfully or failed, and is not yet */
+ /* in progress. Another attempt to cancel it may be */
+ /* attempted and may (or may not) succeed. */
+ H5VL_REQUEST_STATUS_CANCELED /* Operation has not completed and was canceled */
+} H5VL_request_status_t;
+
/* types for async request SPECIFIC callback */
typedef enum H5VL_request_specific_t {
- H5VL_REQUEST_WAITANY, /* Wait until any request completes */
- H5VL_REQUEST_WAITSOME, /* Wait until at least one requesst completes */
- H5VL_REQUEST_WAITALL /* Wait until all requests complete */
+ H5VL_REQUEST_WAITANY, /* Wait until any request completes */
+ H5VL_REQUEST_WAITSOME, /* Wait until at least one requesst completes */
+ H5VL_REQUEST_WAITALL, /* Wait until all requests complete */
+ H5VL_REQUEST_GET_ERR_STACK /* Retrieve error stack for failed operation */
} H5VL_request_specific_t;
/* Typedef and values for native VOL connector request optional VOL operations */
@@ -438,39 +454,45 @@ typedef struct H5VL_token_class_t {
herr_t (*from_str)(void *obj, H5I_type_t obj_type, const char *token_str, H5O_token_t *token);
} H5VL_token_class_t;
-/* Class information for each VOL connector */
+/**
+ * \ingroup H5VLDEV
+ * Class information for each VOL connector
+ */
+//! <!-- [H5VL_class_t_snip] -->
typedef struct H5VL_class_t {
/* Overall connector fields & callbacks */
- unsigned int version; /* VOL connector class struct version # */
- H5VL_class_value_t value; /* Value to identify connector */
- const char * name; /* Connector name (MUST be unique!) */
- unsigned cap_flags; /* Capability flags for connector */
- herr_t (*initialize)(hid_t vipl_id); /* Connector initialization callback */
- herr_t (*terminate)(void); /* Connector termination callback */
+ unsigned version; /**< VOL connector class struct version # */
+ H5VL_class_value_t value; /**< Value to identify connector */
+ const char * name; /**< Connector name (MUST be unique!) */
+ unsigned conn_version; /**< Version # of connector */
+ unsigned cap_flags; /**< Capability flags for connector */
+ herr_t (*initialize)(hid_t vipl_id); /**< Connector initialization callback */
+ herr_t (*terminate)(void); /**< Connector termination callback */
/* VOL framework */
- H5VL_info_class_t info_cls; /* VOL info fields & callbacks */
- H5VL_wrap_class_t wrap_cls; /* VOL object wrap / retrieval callbacks */
+ H5VL_info_class_t info_cls; /**< VOL info fields & callbacks */
+ H5VL_wrap_class_t wrap_cls; /**< VOL object wrap / retrieval callbacks */
/* Data Model */
- H5VL_attr_class_t attr_cls; /* Attribute (H5A*) class callbacks */
- H5VL_dataset_class_t dataset_cls; /* Dataset (H5D*) class callbacks */
- H5VL_datatype_class_t datatype_cls; /* Datatype (H5T*) class callbacks */
- H5VL_file_class_t file_cls; /* File (H5F*) class callbacks */
- H5VL_group_class_t group_cls; /* Group (H5G*) class callbacks */
- H5VL_link_class_t link_cls; /* Link (H5L*) class callbacks */
- H5VL_object_class_t object_cls; /* Object (H5O*) class callbacks */
+ H5VL_attr_class_t attr_cls; /**< Attribute (H5A*) class callbacks */
+ H5VL_dataset_class_t dataset_cls; /**< Dataset (H5D*) class callbacks */
+ H5VL_datatype_class_t datatype_cls; /**< Datatype (H5T*) class callbacks */
+ H5VL_file_class_t file_cls; /**< File (H5F*) class callbacks */
+ H5VL_group_class_t group_cls; /**< Group (H5G*) class callbacks */
+ H5VL_link_class_t link_cls; /**< Link (H5L*) class callbacks */
+ H5VL_object_class_t object_cls; /**< Object (H5O*) class callbacks */
/* Infrastructure / Services */
- H5VL_introspect_class_t introspect_cls; /* Container/connector introspection class callbacks */
- H5VL_request_class_t request_cls; /* Asynchronous request class callbacks */
- H5VL_blob_class_t blob_cls; /* 'Blob' class callbacks */
- H5VL_token_class_t token_cls; /* VOL connector object token class callbacks */
+ H5VL_introspect_class_t introspect_cls; /**< Container/connector introspection class callbacks */
+ H5VL_request_class_t request_cls; /**< Asynchronous request class callbacks */
+ H5VL_blob_class_t blob_cls; /**< 'Blob' class callbacks */
+ H5VL_token_class_t token_cls; /**< VOL connector object token class callbacks */
/* Catch-all */
herr_t (*optional)(void *obj, int op_type, hid_t dxpl_id, void **req,
- va_list arguments); /* Optional callback */
+ va_list arguments); /**< Optional callback */
} H5VL_class_t;
+//! <!-- [H5VL_class_t_snip] -->
/********************/
/* Public Variables */
@@ -485,10 +507,53 @@ extern "C" {
#endif
/* Helper routines for VOL connector authors */
+/**
+ * \ingroup H5VLDEV
+ * \brief Registers a new VOL connector
+ *
+ * \param[in] cls A pointer to the plugin structure to register
+ * \vipl_id
+ * \return \hid_t{VOL connector}
+ *
+ * \details H5VLregister_connector() registers a new VOL connector as a member
+ * of the virtual object layer class. This VOL connector identifier is
+ * good until the library is closed or the connector is unregistered.
+ *
+ * \p vipl_id is either #H5P_DEFAULT or the identifier of a VOL
+ * initialization property list of class #H5P_VOL_INITIALIZE created
+ * with H5Pcreate(). When created, this property list contains no
+ * library properties. If a VOL connector author decides that
+ * initialization-specific data are needed, they can be added to the
+ * empty list and retrieved by the connector in the VOL connector's
+ * initialize callback. Use of the VOL initialization property list is
+ * uncommon, as most VOL-specific properties are added to the file
+ * access property list via the connector's API calls which set the
+ * VOL connector for the file open/create. For more information, see
+ * the \ref_vol_doc.
+ *
+ * H5VL_class_t is defined in H5VLconnector.h in the source code. It
+ * contains class information for each VOL connector:
+ * \snippet this H5VL_class_t_snip
+ *
+ * \since 1.12.0
+ *
+ */
H5_DLL hid_t H5VLregister_connector(const H5VL_class_t *cls, hid_t vipl_id);
+/**
+ * \ingroup H5VLDEV
+ */
H5_DLL void *H5VLobject(hid_t obj_id);
+/**
+ * \ingroup H5VLDEV
+ */
H5_DLL hid_t H5VLget_file_type(void *file_obj, hid_t connector_id, hid_t dtype_id);
+/**
+ * \ingroup H5VLDEV
+ */
H5_DLL hid_t H5VLpeek_connector_id_by_name(const char *name);
+/**
+ * \ingroup H5VLDEV
+ */
H5_DLL hid_t H5VLpeek_connector_id_by_value(H5VL_class_value_t value);
#ifdef __cplusplus
diff --git a/src/H5VLint.c b/src/H5VLint.c
index 289dfef..7b3da7a 100644
--- a/src/H5VLint.c
+++ b/src/H5VLint.c
@@ -453,7 +453,7 @@ H5VL__set_def_conn(void)
/* Get default file access pclass */
if (NULL == (def_fapclass = (H5P_genclass_t *)H5I_object(H5P_FILE_ACCESS)))
- HGOTO_ERROR(H5E_VOL, H5E_BADATOM, FAIL, "can't find object for default file access property class ID")
+ HGOTO_ERROR(H5E_VOL, H5E_BADID, FAIL, "can't find object for default file access property class ID")
/* Change the default VOL for the default file access pclass */
if (H5P_reset_vol_class(def_fapclass, &H5VL_def_conn_s) < 0)
@@ -462,7 +462,7 @@ H5VL__set_def_conn(void)
/* Get default file access plist */
if (NULL == (def_fapl = (H5P_genplist_t *)H5I_object(H5P_FILE_ACCESS_DEFAULT)))
- HGOTO_ERROR(H5E_VOL, H5E_BADATOM, FAIL, "can't find object for default fapl ID")
+ HGOTO_ERROR(H5E_VOL, H5E_BADID, FAIL, "can't find object for default fapl ID")
/* Change the default VOL for the default FAPL */
if (H5P_set_vol(def_fapl, H5VL_def_conn_s.connector_id, H5VL_def_conn_s.connector_info) < 0)
@@ -2315,24 +2315,25 @@ H5VL_wrap_register(H5I_type_t type, void *obj, hbool_t app_ref)
/* Sanity check */
HDassert(obj);
+ /* Retrieve the VOL object wrapping context */
+ if (H5CX_get_vol_wrap_ctx((void **)&vol_wrap_ctx) < 0)
+ HGOTO_ERROR(H5E_VOL, H5E_CANTGET, H5I_INVALID_HID, "can't get VOL object wrap context")
+ if (NULL == vol_wrap_ctx || NULL == vol_wrap_ctx->connector)
+ HGOTO_ERROR(H5E_VOL, H5E_BADVALUE, H5I_INVALID_HID,
+ "VOL object wrap context or its connector is NULL???")
+
/* If the datatype is already VOL-managed, the datatype's vol_obj
* field will get clobbered later, so disallow this.
*/
if (type == H5I_DATATYPE)
- if (TRUE == H5T_already_vol_managed((const H5T_t *)obj))
- HGOTO_ERROR(H5E_VOL, H5E_BADTYPE, H5I_INVALID_HID, "can't wrap an uncommitted datatype")
+ if (vol_wrap_ctx->connector->id == H5VL_NATIVE)
+ if (TRUE == H5T_already_vol_managed((const H5T_t *)obj))
+ HGOTO_ERROR(H5E_VOL, H5E_BADTYPE, H5I_INVALID_HID, "can't wrap an uncommitted datatype")
/* Wrap the object with VOL connector info */
if (NULL == (new_obj = H5VL__wrap_obj(obj, type)))
HGOTO_ERROR(H5E_VOL, H5E_CANTCREATE, H5I_INVALID_HID, "can't wrap library object")
- /* Retrieve the VOL object wrapping context */
- if (H5CX_get_vol_wrap_ctx((void **)&vol_wrap_ctx) < 0)
- HGOTO_ERROR(H5E_VOL, H5E_CANTGET, H5I_INVALID_HID, "can't get VOL object wrap context")
- if (NULL == vol_wrap_ctx || NULL == vol_wrap_ctx->connector)
- HGOTO_ERROR(H5E_VOL, H5E_BADVALUE, H5I_INVALID_HID,
- "VOL object wrap context or its connector is NULL???")
-
/* Get an ID for the object */
if ((ret_value = H5VL_register_using_vol_id(type, new_obj, vol_wrap_ctx->connector->id, app_ref)) < 0)
HGOTO_ERROR(H5E_VOL, H5E_CANTREGISTER, H5I_INVALID_HID, "unable to get an ID for the object")
@@ -2340,3 +2341,273 @@ H5VL_wrap_register(H5I_type_t type, void *obj, hbool_t app_ref)
done:
FUNC_LEAVE_NOAPI(ret_value)
} /* end H5VL_wrap_register() */
+
+/*-------------------------------------------------------------------------
+ * Function: H5VL_setup_args
+ *
+ * Purpose: Set up arguments to access an object
+ *
+ * Return: SUCCEED / FAIL
+ *
+ *-------------------------------------------------------------------------
+ */
+herr_t
+H5VL_setup_args(hid_t loc_id, H5I_type_t id_type, H5VL_object_t **vol_obj)
+{
+ herr_t ret_value = SUCCEED; /* Return value */
+
+ FUNC_ENTER_NOAPI(FAIL)
+
+ /* Sanity check */
+ HDassert(vol_obj);
+
+ /* Get attribute pointer */
+ if (NULL == (*vol_obj = (H5VL_object_t *)H5I_object_verify(loc_id, id_type)))
+ HGOTO_ERROR(H5E_VOL, H5E_BADTYPE, FAIL, "not the correct type of ID")
+
+ /* Set up collective metadata (if appropriate */
+ if (H5CX_set_loc(loc_id) < 0)
+ HGOTO_ERROR(H5E_VOL, H5E_CANTSET, FAIL, "can't set collective metadata read")
+
+done:
+ FUNC_LEAVE_NOAPI(ret_value)
+} /* end H5VL_setup_args() */
+
+/*-------------------------------------------------------------------------
+ * Function: H5VL_setup_loc_args
+ *
+ * Purpose: Set up arguments to access an object
+ *
+ * Return: SUCCEED / FAIL
+ *
+ *-------------------------------------------------------------------------
+ */
+herr_t
+H5VL_setup_loc_args(hid_t loc_id, H5VL_object_t **vol_obj, H5VL_loc_params_t *loc_params)
+{
+ herr_t ret_value = SUCCEED; /* Return value */
+
+ FUNC_ENTER_NOAPI(FAIL)
+
+ /* Sanity check */
+ HDassert(vol_obj);
+ HDassert(loc_params);
+
+ /* Get the location object */
+ if (NULL == (*vol_obj = (H5VL_object_t *)H5VL_vol_object(loc_id)))
+ HGOTO_ERROR(H5E_VOL, H5E_BADTYPE, FAIL, "not the correct type of ID")
+
+ /* Set up collective metadata (if appropriate */
+ if (H5CX_set_loc(loc_id) < 0)
+ HGOTO_ERROR(H5E_VOL, H5E_CANTSET, FAIL, "can't set collective metadata read")
+
+ /* Set location parameters */
+ loc_params->type = H5VL_OBJECT_BY_SELF;
+ loc_params->obj_type = H5I_get_type(loc_id);
+
+done:
+ FUNC_LEAVE_NOAPI(ret_value)
+} /* end H5VL_setup_loc_args() */
+
+/*-------------------------------------------------------------------------
+ * Function: H5VL_setup_acc_args
+ *
+ * Purpose: Set up arguments to access an object
+ *
+ * Return: SUCCEED / FAIL
+ *
+ *-------------------------------------------------------------------------
+ */
+herr_t
+H5VL_setup_acc_args(hid_t loc_id, const H5P_libclass_t *libclass, hbool_t is_collective, hid_t *acspl_id,
+ H5VL_object_t **vol_obj, H5VL_loc_params_t *loc_params)
+{
+ herr_t ret_value = SUCCEED; /* Return value */
+
+ FUNC_ENTER_NOAPI(FAIL)
+
+ /* Sanity check */
+ HDassert(libclass);
+ HDassert(acspl_id);
+ HDassert(vol_obj);
+ HDassert(loc_params);
+
+ /* Verify access property list and set up collective metadata if appropriate */
+ if (H5CX_set_apl(acspl_id, libclass, loc_id, is_collective) < 0)
+ HGOTO_ERROR(H5E_VOL, H5E_CANTSET, FAIL, "can't set access property list info")
+
+ /* Get the location object */
+ if (NULL == (*vol_obj = (H5VL_object_t *)H5VL_vol_object(loc_id)))
+ HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "invalid location identifier")
+
+ /* Set location parameters */
+ loc_params->type = H5VL_OBJECT_BY_SELF;
+ loc_params->obj_type = H5I_get_type(loc_id);
+
+done:
+ FUNC_LEAVE_NOAPI(ret_value)
+} /* end H5VL_setup_acc_args() */
+
+/*-------------------------------------------------------------------------
+ * Function: H5VL_setup_self_args
+ *
+ * Purpose: Set up arguments to access an object "by self"
+ *
+ * Return: SUCCEED / FAIL
+ *
+ *-------------------------------------------------------------------------
+ */
+herr_t
+H5VL_setup_self_args(hid_t loc_id, H5VL_object_t **vol_obj, H5VL_loc_params_t *loc_params)
+{
+ herr_t ret_value = SUCCEED; /* Return value */
+
+ FUNC_ENTER_NOAPI(FAIL)
+
+ /* Sanity check */
+ HDassert(vol_obj);
+ HDassert(loc_params);
+
+ /* Get the location object */
+ if (NULL == (*vol_obj = (H5VL_object_t *)H5VL_vol_object(loc_id)))
+ HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "invalid location identifier")
+
+ /* Set location parameters */
+ loc_params->type = H5VL_OBJECT_BY_SELF;
+ loc_params->obj_type = H5I_get_type(loc_id);
+
+done:
+ FUNC_LEAVE_NOAPI(ret_value)
+} /* end H5VL_setup_self_args() */
+
+/*-------------------------------------------------------------------------
+ * Function: H5VL_setup_name_args
+ *
+ * Purpose: Set up arguments to access an object "by name"
+ *
+ * Return: SUCCEED / FAIL
+ *
+ *-------------------------------------------------------------------------
+ */
+herr_t
+H5VL_setup_name_args(hid_t loc_id, const char *name, const H5P_libclass_t *libclass, hbool_t is_collective,
+ hid_t acspl_id, H5VL_object_t **vol_obj, H5VL_loc_params_t *loc_params)
+{
+ herr_t ret_value = SUCCEED; /* Return value */
+
+ FUNC_ENTER_NOAPI(FAIL)
+
+ /* Sanity check */
+ HDassert(vol_obj);
+ HDassert(loc_params);
+
+ /* Check args */
+ if (!name)
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "name parameter cannot be NULL")
+ if (!*name)
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "name parameter cannot be an empty string")
+
+ /* Verify access property list and set up collective metadata if appropriate */
+ if (H5CX_set_apl(&acspl_id, libclass, loc_id, is_collective) < 0)
+ HGOTO_ERROR(H5E_VOL, H5E_CANTSET, FAIL, "can't set access property list info")
+
+ /* Get the location object */
+ if (NULL == (*vol_obj = (H5VL_object_t *)H5VL_vol_object(loc_id)))
+ HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "invalid location identifier")
+
+ /* Set up location parameters */
+ loc_params->type = H5VL_OBJECT_BY_NAME;
+ loc_params->loc_data.loc_by_name.name = name;
+ loc_params->loc_data.loc_by_name.lapl_id = acspl_id;
+ loc_params->obj_type = H5I_get_type(loc_id);
+
+done:
+ FUNC_LEAVE_NOAPI(ret_value)
+} /* end H5VL_setup_name_args() */
+
+/*-------------------------------------------------------------------------
+ * Function: H5VL_setup_idx_args
+ *
+ * Purpose: Set up arguments to access an object "by idx"
+ *
+ * Return: SUCCEED / FAIL
+ *
+ *-------------------------------------------------------------------------
+ */
+herr_t
+H5VL_setup_idx_args(hid_t loc_id, const char *name, H5_index_t idx_type, H5_iter_order_t order, hsize_t n,
+ const H5P_libclass_t *libclass, hbool_t is_collective, hid_t acspl_id,
+ H5VL_object_t **vol_obj, H5VL_loc_params_t *loc_params)
+{
+ herr_t ret_value = SUCCEED; /* Return value */
+
+ FUNC_ENTER_NOAPI(FAIL)
+
+ /* Sanity check */
+ HDassert(vol_obj);
+ HDassert(loc_params);
+
+ /* Check args */
+ if (!name)
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "name parameter cannot be NULL")
+ if (!*name)
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "name parameter cannot be an empty string")
+ if (idx_type <= H5_INDEX_UNKNOWN || idx_type >= H5_INDEX_N)
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "invalid index type specified")
+ if (order <= H5_ITER_UNKNOWN || order >= H5_ITER_N)
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "invalid iteration order specified")
+
+ /* Verify access property list and set up collective metadata if appropriate */
+ if (H5CX_set_apl(&acspl_id, libclass, loc_id, is_collective) < 0)
+ HGOTO_ERROR(H5E_VOL, H5E_CANTSET, FAIL, "can't set access property list info")
+
+ /* Get the location object */
+ if (NULL == (*vol_obj = (H5VL_object_t *)H5VL_vol_object(loc_id)))
+ HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "invalid location identifier")
+
+ /* Set location parameters */
+ loc_params->type = H5VL_OBJECT_BY_IDX;
+ loc_params->loc_data.loc_by_idx.name = name;
+ loc_params->loc_data.loc_by_idx.idx_type = idx_type;
+ loc_params->loc_data.loc_by_idx.order = order;
+ loc_params->loc_data.loc_by_idx.n = n;
+ loc_params->loc_data.loc_by_idx.lapl_id = acspl_id;
+ loc_params->obj_type = H5I_get_type(loc_id);
+
+done:
+ FUNC_LEAVE_NOAPI(ret_value)
+} /* end H5VL_setup_idx_args() */
+
+/*-------------------------------------------------------------------------
+ * Function: H5VL_setup_token_args
+ *
+ * Purpose: Set up arguments to access an object by token
+ *
+ * Return: SUCCEED / FAIL
+ *
+ *-------------------------------------------------------------------------
+ */
+herr_t
+H5VL_setup_token_args(hid_t loc_id, H5O_token_t *obj_token, H5VL_object_t **vol_obj,
+ H5VL_loc_params_t *loc_params)
+{
+ herr_t ret_value = SUCCEED; /* Return value */
+
+ FUNC_ENTER_NOAPI(FAIL)
+
+ /* Sanity check */
+ HDassert(vol_obj);
+ HDassert(loc_params);
+
+ /* Get the location object */
+ if (NULL == (*vol_obj = (H5VL_object_t *)H5VL_vol_object(loc_id)))
+ HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "invalid location identifier")
+
+ /* Set location parameters */
+ loc_params->type = H5VL_OBJECT_BY_TOKEN;
+ loc_params->loc_data.loc_by_token.token = obj_token;
+ loc_params->obj_type = H5I_get_type(loc_id);
+
+done:
+ FUNC_LEAVE_NOAPI(ret_value)
+} /* end H5VL_setup_token_args() */
diff --git a/src/H5VLmodule.h b/src/H5VLmodule.h
index 78c5986..009c0e5 100644
--- a/src/H5VLmodule.h
+++ b/src/H5VLmodule.h
@@ -32,6 +32,10 @@
* \brief Virtual Object Layer Interface
* \todo Describe concisely what the functions in this module are about.
*
+ * \defgroup ASYNC Asynchronous Functions
+ * \brief Asynchronous Functions
+ * \todo Describe concisely what the functions in this module are about.
+ *
* \defgroup H5VLDEF Definitions
* \ingroup H5VL
* \defgroup H5VLDEV VOL Developer
diff --git a/src/H5VLnative.c b/src/H5VLnative.c
index 0fd220c..4d914b0 100644
--- a/src/H5VLnative.c
+++ b/src/H5VLnative.c
@@ -15,17 +15,27 @@
* using HDF5 VFDs.
*/
-#include "H5private.h" /* Generic Functions */
-#include "H5Aprivate.h" /* Attributes */
-#include "H5Dprivate.h" /* Datasets */
-#include "H5Eprivate.h" /* Error handling */
-#include "H5Fprivate.h" /* Files */
-#include "H5Gprivate.h" /* Groups */
-#include "H5Iprivate.h" /* IDs */
-#include "H5Oprivate.h" /* Object headers */
-#include "H5Pprivate.h" /* Property lists */
-#include "H5Tprivate.h" /* Datatypes */
-#include "H5VLprivate.h" /* Virtual Object Layer */
+/****************/
+/* Module Setup */
+/****************/
+
+#define H5VL_FRIEND /* Suppress error about including H5VLpkg */
+
+/***********/
+/* Headers */
+/***********/
+
+#include "H5private.h" /* Generic Functions */
+#include "H5Aprivate.h" /* Attributes */
+#include "H5Dprivate.h" /* Datasets */
+#include "H5Eprivate.h" /* Error handling */
+#include "H5Fprivate.h" /* Files */
+#include "H5Gprivate.h" /* Groups */
+#include "H5Iprivate.h" /* IDs */
+#include "H5Oprivate.h" /* Object headers */
+#include "H5Pprivate.h" /* Property lists */
+#include "H5Tprivate.h" /* Datatypes */
+#include "H5VLpkg.h" /* Virtual Object Layer */
#include "H5VLnative_private.h" /* Native VOL connector */
@@ -37,9 +47,10 @@ static herr_t H5VL__native_term(void);
/* Native VOL connector class struct */
static const H5VL_class_t H5VL_native_cls_g = {
- H5VL_NATIVE_VERSION, /* version */
+ H5VL_VERSION, /* VOL class struct version */
H5VL_NATIVE_VALUE, /* value */
H5VL_NATIVE_NAME, /* name */
+ H5VL_NATIVE_VERSION, /* connector version */
0, /* capability flags */
NULL, /* initialize */
H5VL__native_term, /* terminate */
@@ -545,6 +556,7 @@ H5VL_native_get_file_struct(void *obj, H5I_type_t type, H5F_t **file)
case H5I_ERROR_MSG:
case H5I_ERROR_STACK:
case H5I_SPACE_SEL_ITER:
+ case H5I_EVENTSET:
case H5I_NTYPES:
default:
HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a file or file object")
diff --git a/src/H5VLnative.h b/src/H5VLnative.h
index b256518..360317d 100644
--- a/src/H5VLnative.h
+++ b/src/H5VLnative.h
@@ -33,11 +33,17 @@
#define H5VL_NATIVE_VERSION 0
/* Values for VOL connector attribute optional VOL operations */
+/* NOTE: If new values are added here, the H5VL__native_introspect_opt_query
+ * routine must be updated.
+ */
#ifndef H5_NO_DEPRECATED_SYMBOLS
#define H5VL_NATIVE_ATTR_ITERATE_OLD 0 /* H5Aiterate (deprecated routine) */
#endif /* H5_NO_DEPRECATED_SYMBOLS */
/* Values for native VOL connector dataset optional VOL operations */
+/* NOTE: If new values are added here, the H5VL__native_introspect_opt_query
+ * routine must be updated.
+ */
#define H5VL_NATIVE_DATASET_FORMAT_CONVERT 0 /* H5Dformat_convert (internal) */
#define H5VL_NATIVE_DATASET_GET_CHUNK_INDEX_TYPE 1 /* H5Dget_chunk_index_type */
#define H5VL_NATIVE_DATASET_GET_CHUNK_STORAGE_SIZE 2 /* H5Dget_chunk_storage_size */
@@ -50,6 +56,9 @@
#define H5VL_NATIVE_DATASET_GET_OFFSET 9 /* H5Dget_offset */
/* Values for native VOL connector file optional VOL operations */
+/* NOTE: If new values are added here, the H5VL__native_introspect_opt_query
+ * routine must be updated.
+ */
#define H5VL_NATIVE_FILE_CLEAR_ELINK_CACHE 0 /* H5Fclear_elink_file_cache */
#define H5VL_NATIVE_FILE_GET_FILE_IMAGE 1 /* H5Fget_file_image */
#define H5VL_NATIVE_FILE_GET_FREE_SECTIONS 2 /* H5Fget_free_sections */
@@ -84,12 +93,18 @@
#define H5VL_NATIVE_FILE_VFD_SWMR_END_TICK 31
/* Values for native VOL connector group optional VOL operations */
+/* NOTE: If new values are added here, the H5VL__native_introspect_opt_query
+ * routine must be updated.
+ */
#ifndef H5_NO_DEPRECATED_SYMBOLS
#define H5VL_NATIVE_GROUP_ITERATE_OLD 0 /* HG5Giterate (deprecated routine) */
#define H5VL_NATIVE_GROUP_GET_OBJINFO 1 /* HG5Gget_objinfo (deprecated routine) */
#endif /* H5_NO_DEPRECATED_SYMBOLS */
/* Values for native VOL connector object optional VOL operations */
+/* NOTE: If new values are added here, the H5VL__native_introspect_opt_query
+ * routine must be updated.
+ */
#define H5VL_NATIVE_OBJECT_GET_COMMENT 0 /* H5G|H5Oget_comment, H5Oget_comment_by_name */
#define H5VL_NATIVE_OBJECT_SET_COMMENT 1 /* H5G|H5Oset_comment, H5Oset_comment_by_name */
#define H5VL_NATIVE_OBJECT_DISABLE_MDC_FLUSHES 2 /* H5Odisable_mdc_flushes */
@@ -126,7 +141,13 @@ extern "C" {
#endif
/* Token <--> address converters */
+/**
+ * \ingroup H5VLNAT
+ */
H5_DLL herr_t H5VLnative_addr_to_token(hid_t loc_id, haddr_t addr, H5O_token_t *token);
+/**
+ * \ingroup H5VLNAT
+ */
H5_DLL herr_t H5VLnative_token_to_addr(hid_t loc_id, H5O_token_t token, haddr_t *addr);
/* Not really public but must be included here */
diff --git a/src/H5VLnative_blob.c b/src/H5VLnative_blob.c
index 4fa8a2a..170a5bc 100644
--- a/src/H5VLnative_blob.c
+++ b/src/H5VLnative_blob.c
@@ -104,7 +104,7 @@ H5VL__native_blob_get(void *obj, const void *blob_id, void *buf, size_t size, vo
H5F_t * f = (H5F_t *)obj; /* Retrieve file pointer */
const uint8_t *id = (const uint8_t *)blob_id; /* Pointer to the disk blob ID */
H5HG_t hobjid; /* Global heap ID for sequence */
- size_t hobj_size; /* Global heap object size returned from H5HG_read() */
+ size_t hobj_size = 0; /* Global heap object size returned from H5HG_read() */
herr_t ret_value = SUCCEED; /* Return value */
FUNC_ENTER_PACKAGE
diff --git a/src/H5VLnative_dataset.c b/src/H5VLnative_dataset.c
index 55fc368..d78388e 100644
--- a/src/H5VLnative_dataset.c
+++ b/src/H5VLnative_dataset.c
@@ -18,6 +18,7 @@
#define H5D_FRIEND /* Suppress error about including H5Dpkg */
#include "H5private.h" /* Generic Functions */
+#include "H5CXprivate.h" /* API Contexts */
#include "H5Dpkg.h" /* Datasets */
#include "H5Eprivate.h" /* Error handling */
#include "H5Fprivate.h" /* Files */
@@ -138,7 +139,7 @@ done:
*/
herr_t
H5VL__native_dataset_read(void *obj, hid_t mem_type_id, hid_t mem_space_id, hid_t file_space_id,
- hid_t H5_ATTR_UNUSED dxpl_id, void *buf, void H5_ATTR_UNUSED **req)
+ hid_t dxpl_id, void *buf, void H5_ATTR_UNUSED **req)
{
H5D_t * dset = (H5D_t *)obj;
const H5S_t *mem_space = NULL;
@@ -157,6 +158,9 @@ H5VL__native_dataset_read(void *obj, hid_t mem_type_id, hid_t mem_space_id, hid_
if (H5S_get_validated_dataspace(file_space_id, &file_space) < 0)
HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "could not get a validated dataspace from file_space_id")
+ /* Set DXPL for operation */
+ H5CX_set_dxpl(dxpl_id);
+
/* Read raw data */
if (H5D__read(dset, mem_type_id, mem_space, file_space, buf /*out*/) < 0)
HGOTO_ERROR(H5E_DATASET, H5E_READERROR, FAIL, "can't read data")
@@ -176,7 +180,7 @@ done:
*/
herr_t
H5VL__native_dataset_write(void *obj, hid_t mem_type_id, hid_t mem_space_id, hid_t file_space_id,
- hid_t H5_ATTR_UNUSED dxpl_id, const void *buf, void H5_ATTR_UNUSED **req)
+ hid_t dxpl_id, const void *buf, void H5_ATTR_UNUSED **req)
{
H5D_t * dset = (H5D_t *)obj;
const H5S_t *mem_space = NULL;
@@ -195,6 +199,9 @@ H5VL__native_dataset_write(void *obj, hid_t mem_type_id, hid_t mem_space_id, hid
if (H5S_get_validated_dataspace(file_space_id, &file_space) < 0)
HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "could not get a validated dataspace from file_space_id")
+ /* Set DXPL for operation */
+ H5CX_set_dxpl(dxpl_id);
+
/* Write the data */
if (H5D__write(dset, mem_type_id, mem_space, file_space, buf) < 0)
HGOTO_ERROR(H5E_DATASET, H5E_WRITEERROR, FAIL, "can't write data")
@@ -339,6 +346,13 @@ H5VL__native_dataset_specific(void *obj, H5VL_dataset_specific_t specific_type,
break;
}
+ case H5VL_DATASET_WAIT: { /* H5Dwait */
+ /* The native VOL connector doesn't support asynchronous
+ * operations, so this is a no-op.
+ */
+ break;
+ }
+
default:
HGOTO_ERROR(H5E_VOL, H5E_UNSUPPORTED, FAIL, "invalid specific operation")
} /* end switch */
@@ -357,7 +371,7 @@ done:
*-------------------------------------------------------------------------
*/
herr_t
-H5VL__native_dataset_optional(void *obj, H5VL_dataset_optional_t optional_type, hid_t H5_ATTR_UNUSED dxpl_id,
+H5VL__native_dataset_optional(void *obj, H5VL_dataset_optional_t optional_type, hid_t dxpl_id,
void H5_ATTR_UNUSED **req, va_list arguments)
{
H5D_t *dset = (H5D_t *)obj; /* Dataset */
@@ -368,6 +382,9 @@ H5VL__native_dataset_optional(void *obj, H5VL_dataset_optional_t optional_type,
/* Sanity checks */
HDassert(dset);
+ /* Set DXPL for operation */
+ H5CX_set_dxpl(dxpl_id);
+
switch (optional_type) {
case H5VL_NATIVE_DATASET_FORMAT_CONVERT: { /* H5Dformat_convert */
switch (dset->shared->layout.type) {
diff --git a/src/H5VLnative_file.c b/src/H5VLnative_file.c
index 8a8bfc2..4f7bb90 100644
--- a/src/H5VLnative_file.c
+++ b/src/H5VLnative_file.c
@@ -387,8 +387,13 @@ H5VL__native_file_specific(void *obj, H5VL_file_specific_t specific_type, hid_t
/* H5Fdelete */
case H5VL_FILE_DELETE: {
- HGOTO_ERROR(H5E_FILE, H5E_UNSUPPORTED, FAIL,
- "H5Fdelete() is currently not supported in the native VOL connector")
+ hid_t fapl_id = HDva_arg(arguments, hid_t);
+ const char *name = HDva_arg(arguments, const char *);
+ herr_t * ret = HDva_arg(arguments, herr_t *);
+
+ /* Call private routine */
+ if ((*ret = H5F_delete(name, fapl_id)) < 0)
+ HGOTO_ERROR(H5E_FILE, H5E_CANTDELETEFILE, FAIL, "error in HDF5 file check")
break;
}
@@ -404,6 +409,14 @@ H5VL__native_file_specific(void *obj, H5VL_file_specific_t specific_type, hid_t
break;
}
+ /* H5Fwait */
+ case H5VL_FILE_WAIT: {
+ /* The native VOL connector doesn't support asynchronous
+ * operations, so this is a no-op.
+ */
+ break;
+ }
+
default:
HGOTO_ERROR(H5E_VOL, H5E_UNSUPPORTED, FAIL, "invalid specific operation")
} /* end switch */
@@ -847,11 +860,11 @@ H5VL__native_file_close(void *file, hid_t H5_ATTR_UNUSED dxpl_id, void H5_ATTR_U
if ((H5F_NREFS(f) > 1) && (H5F_INTENT(f) & H5F_ACC_RDWR)) {
/* Get the file ID corresponding to the H5F_t struct */
if (H5I_find_id(f, H5I_FILE, &file_id) < 0 || H5I_INVALID_HID == file_id)
- HGOTO_ERROR(H5E_ATOM, H5E_CANTGET, FAIL, "invalid atom")
+ HGOTO_ERROR(H5E_ID, H5E_CANTGET, FAIL, "invalid ID")
/* Get the number of references outstanding for this file ID */
if ((nref = H5I_get_ref(file_id, FALSE)) < 0)
- HGOTO_ERROR(H5E_ATOM, H5E_CANTGET, FAIL, "can't get ID ref count")
+ HGOTO_ERROR(H5E_ID, H5E_CANTGET, FAIL, "can't get ID ref count")
if (nref == 1)
if (H5F__flush(f) < 0)
HGOTO_ERROR(H5E_CACHE, H5E_CANTFLUSH, FAIL, "unable to flush cache")
diff --git a/src/H5VLnative_object.c b/src/H5VLnative_object.c
index 90bb129..c985120 100644
--- a/src/H5VLnative_object.c
+++ b/src/H5VLnative_object.c
@@ -122,7 +122,7 @@ H5VL__native_object_copy(void *src_obj, const H5VL_loc_params_t *loc_params1, co
/* Copy the object */
if ((ret_value = H5O_copy(&src_loc, src_name, &dst_loc, dst_name, ocpypl_id, lcpl_id)) < 0)
- HGOTO_ERROR(H5E_SYM, H5E_CANTCOPY, FAIL, "unable to copy object")
+ HGOTO_ERROR(H5E_OHDR, H5E_CANTCOPY, FAIL, "unable to copy object")
done:
FUNC_LEAVE_NOAPI(ret_value)
diff --git a/src/H5VLpassthru.c b/src/H5VLpassthru.c
index 590339d..fa59f4a 100644
--- a/src/H5VLpassthru.c
+++ b/src/H5VLpassthru.c
@@ -263,9 +263,10 @@ static herr_t H5VL_pass_through_optional(void *obj, int op_type, hid_t dxpl_id,
/* Pass through VOL connector class struct */
static const H5VL_class_t H5VL_pass_through_g = {
- H5VL_PASSTHRU_VERSION, /* version */
+ H5VL_VERSION, /* VOL class struct version */
(H5VL_class_value_t)H5VL_PASSTHRU_VALUE, /* value */
H5VL_PASSTHRU_NAME, /* name */
+ H5VL_PASSTHRU_VERSION, /* connector version */
0, /* capability flags */
H5VL_pass_through_init, /* initialize */
H5VL_pass_through_term, /* terminate */
diff --git a/src/H5VLprivate.h b/src/H5VLprivate.h
index 75997df..e116c8f 100644
--- a/src/H5VLprivate.h
+++ b/src/H5VLprivate.h
@@ -114,6 +114,22 @@ H5_DLL hid_t H5VL_register_using_vol_id(H5I_type_t type, void *obj, hid_t conne
H5_DLL herr_t H5VL_register_using_existing_id(H5I_type_t type, void *object, H5VL_t *vol_connector,
hbool_t app_ref, hid_t existing_id);
+/* Object access functions */
+struct H5P_libclass_t;
+H5_DLL herr_t H5VL_setup_args(hid_t loc_id, H5I_type_t id_type, H5VL_object_t **vol_obj);
+H5_DLL herr_t H5VL_setup_loc_args(hid_t loc_id, H5VL_object_t **vol_obj, H5VL_loc_params_t *loc_params);
+H5_DLL herr_t H5VL_setup_acc_args(hid_t loc_id, const struct H5P_libclass_t *libclass, hbool_t is_collective,
+ hid_t *acspl_id, H5VL_object_t **vol_obj, H5VL_loc_params_t *loc_params);
+H5_DLL herr_t H5VL_setup_self_args(hid_t loc_id, H5VL_object_t **vol_obj, H5VL_loc_params_t *loc_params);
+H5_DLL herr_t H5VL_setup_name_args(hid_t loc_id, const char *name, const struct H5P_libclass_t *libclass,
+ hbool_t is_collective, hid_t acspl_id, H5VL_object_t **vol_obj,
+ H5VL_loc_params_t *loc_params);
+H5_DLL herr_t H5VL_setup_idx_args(hid_t loc_id, const char *name, H5_index_t idx_type, H5_iter_order_t order,
+ hsize_t n, const struct H5P_libclass_t *libclass, hbool_t is_collective,
+ hid_t acspl_id, H5VL_object_t **vol_obj, H5VL_loc_params_t *loc_params);
+H5_DLL herr_t H5VL_setup_token_args(hid_t loc_id, H5O_token_t *obj_token, H5VL_object_t **vol_obj,
+ H5VL_loc_params_t *loc_params);
+
/**********************************
* VOL connector callback wrappers
*********************************/
diff --git a/src/H5VLpublic.h b/src/H5VLpublic.h
index 58a8045..63fea64 100644
--- a/src/H5VLpublic.h
+++ b/src/H5VLpublic.h
@@ -25,42 +25,97 @@
/* Public Macros */
/*****************/
+/**
+ * \ingroup H5VLDEF
+ * \brief Version # of VOL class struct & callbacks
+ *
+ * \details Each VOL connector must set the 'version' field in the H5VL_class_t
+ * struct to the version of the H5VL_class_t struct that the connector
+ * implements. The HDF5 library will reject connectors with
+ * incompatible structs.
+ */
+#define H5VL_VERSION 2
+
/* VOL connector identifier values
* These are H5VL_class_value_t values, NOT hid_t values!
*/
-#define H5_VOL_INVALID (-1) /* Invalid ID for VOL connector ID */
-#define H5_VOL_NATIVE 0 /* Native HDF5 file format VOL connector */
-#define H5_VOL_RESERVED 256 /* VOL connector IDs below this value are reserved for library use */
-#define H5_VOL_MAX 65535 /* Maximum VOL connector ID */
+/**
+ * \ingroup H5VLDEF
+ * Invalid ID for VOL connector ID
+ */
+#define H5_VOL_INVALID (-1)
+/**
+ * \ingroup H5VLDEF
+ * Native HDF5 file format VOL connector
+ */
+#define H5_VOL_NATIVE 0
+/**
+ * \ingroup H5VLDEF
+ * VOL connector IDs below this value are reserved for library use
+ */
+#define H5_VOL_RESERVED 256
+/**
+ * \ingroup H5VLDEF
+ * Maximum VOL connector ID
+ */
+#define H5_VOL_MAX 65535
+
+/* Flags to return from H5VLquery_optional API and 'opt_query' callbacks */
+/* Note: Operations which access multiple objects' data or metadata in a
+ * container should be registered as file-level optional operations.
+ * (e.g. "H5Dwrite_multi" takes a list of datasets to write data to, so
+ * a VOL connector that implemented it should register it as an optional
+ * file operation, and pass-through VOL connectors that are stacked above
+ * the connector that registered it should assume that dataset elements
+ * for _any_ dataset in the file could be written to)
+ */
+#define H5VL_OPT_QUERY_SUPPORTED 0x0001 /* VOL connector supports this operation */
+#define H5VL_OPT_QUERY_READ_DATA 0x0002 /* Operation reads data for object */
+#define H5VL_OPT_QUERY_WRITE_DATA 0x0004 /* Operation writes data for object */
+#define H5VL_OPT_QUERY_QUERY_METADATA 0x0008 /* Operation reads metadata for object */
+#define H5VL_OPT_QUERY_MODIFY_METADATA 0x0010 /* Operation modifies metadata for object */
+#define H5VL_OPT_QUERY_COLLECTIVE \
+ 0x0020 /* Operation is collective (operations without this flag are assumed to be independent) */
+#define H5VL_OPT_QUERY_NO_ASYNC 0x0040 /* Operation may NOT be executed asynchronously */
+#define H5VL_OPT_QUERY_MULTI_OBJ 0x0080 /* Operation involves multiple objects */
/*******************/
/* Public Typedefs */
/*******************/
-/*
- * VOL connector identifiers. Values 0 through 255 are for connectors defined
- * by the HDF5 library. Values 256 through 511 are available for testing new
- * connectors. Subsequent values should be obtained from the HDF5 development
- * team at help@hdfgroup.org.
+/**
+ * \ingroup H5VLDEF
+ *
+ * \brief VOL connector identifiers.
+ *
+ * \details Values 0 through 255 are for connectors defined by the HDF5
+ * library. Values 256 through 511 are available for testing new
+ * connectors. Subsequent values should be obtained from the HDF5
+ * development team at mailto:help@hdfgroup.org.
*/
+//! <!-- [H5VL_class_value_t_snip] -->
typedef int H5VL_class_value_t;
+//! <!-- [H5VL_class_value_t_snip] -->
-/* Enum type for each VOL subclass */
-/* (Used for various queries, etc) */
+/**
+ * \ingroup H5VLDEF
+ * \details Enum type for each VOL subclass
+ * (Used for various queries, etc)
+ */
typedef enum H5VL_subclass_t {
- H5VL_SUBCLS_NONE, /* Operations outside of a subclass */
- H5VL_SUBCLS_INFO, /* 'Info' subclass */
- H5VL_SUBCLS_WRAP, /* 'Wrap' subclass */
- H5VL_SUBCLS_ATTR, /* 'Attribute' subclass */
- H5VL_SUBCLS_DATASET, /* 'Dataset' subclass */
- H5VL_SUBCLS_DATATYPE, /* 'Named datatype' subclass */
- H5VL_SUBCLS_FILE, /* 'File' subclass */
- H5VL_SUBCLS_GROUP, /* 'Group' subclass */
- H5VL_SUBCLS_LINK, /* 'Link' subclass */
- H5VL_SUBCLS_OBJECT, /* 'Object' subclass */
- H5VL_SUBCLS_REQUEST, /* 'Request' subclass */
- H5VL_SUBCLS_BLOB, /* 'Blob' subclass */
- H5VL_SUBCLS_TOKEN /* 'Token' subclass */
+ H5VL_SUBCLS_NONE, /**< Operations outside of a subclass */
+ H5VL_SUBCLS_INFO, /**< 'Info' subclass */
+ H5VL_SUBCLS_WRAP, /**< 'Wrap' subclass */
+ H5VL_SUBCLS_ATTR, /**< 'Attribute' subclass */
+ H5VL_SUBCLS_DATASET, /**< 'Dataset' subclass */
+ H5VL_SUBCLS_DATATYPE, /**< 'Named datatype' subclass */
+ H5VL_SUBCLS_FILE, /**< 'File' subclass */
+ H5VL_SUBCLS_GROUP, /**< 'Group' subclass */
+ H5VL_SUBCLS_LINK, /**< 'Link' subclass */
+ H5VL_SUBCLS_OBJECT, /**< 'Object' subclass */
+ H5VL_SUBCLS_REQUEST, /**< 'Request' subclass */
+ H5VL_SUBCLS_BLOB, /**< 'Blob' subclass */
+ H5VL_SUBCLS_TOKEN /**< 'Token' subclass */
} H5VL_subclass_t;
/********************/
@@ -75,17 +130,229 @@ typedef enum H5VL_subclass_t {
extern "C" {
#endif
-H5_DLL hid_t H5VLregister_connector_by_name(const char *connector_name, hid_t vipl_id);
-H5_DLL hid_t H5VLregister_connector_by_value(H5VL_class_value_t connector_value, hid_t vipl_id);
-H5_DLL htri_t H5VLis_connector_registered_by_name(const char *name);
-H5_DLL htri_t H5VLis_connector_registered_by_value(H5VL_class_value_t connector_value);
-H5_DLL hid_t H5VLget_connector_id(hid_t obj_id);
-H5_DLL hid_t H5VLget_connector_id_by_name(const char *name);
-H5_DLL hid_t H5VLget_connector_id_by_value(H5VL_class_value_t connector_value);
+/**
+ * \ingroup H5VL
+ * \brief Registers a new VOL connector by name
+ *
+ * \param[in] connector_name Connector name
+ * \vipl_id
+ * \return \hid_t{VOL connector}
+ *
+ * \details H5VLregister_connector_by_name() registers a new VOL connector with
+ * the name \p connector_name as a member of the virtual object layer
+ * class. This VOL connector identifier is good until the library is
+ * closed or the connector is unregistered.
+ *
+ * \p vipl_id is either #H5P_DEFAULT or the identifier of a VOL
+ * initialization property list of class #H5P_VOL_INITIALIZE created
+ * with H5Pcreate(). When created, this property list contains no
+ * library properties. If a VOL connector author decides that
+ * initialization-specific data are needed, they can be added to the
+ * empty list and retrieved by the connector in the VOL connector's
+ * initialize callback. Use of the VOL initialization property list is
+ * uncommon, as most VOL-specific properties are added to the file
+ * access property list via the connector's API calls which set the
+ * VOL connector for the file open/create. For more information, see
+ * \ref_vol_doc.
+ *
+ * \since 1.12.0
+ *
+ */
+H5_DLL hid_t H5VLregister_connector_by_name(const char *connector_name, hid_t vipl_id);
+/**
+ * \ingroup H5VL
+ * \brief Registers a new VOL connector by value
+ *
+ * \param[in] connector_value Connector value
+ * \vipl_id
+ * \return \hid_t{VOL connector}
+ *
+ * \details H5VLregister_connector_by_value() registers a new VOL connector
+ * with value connector_value as a member of the virtual object layer
+ * class. This VOL connector identifier is good until the library is
+ * closed or the connector is unregistered.
+ *
+ * \p connector_value has a type of H5VL_class_value_t, which is
+ * defined in H5VLpublic.h as follows:
+ * \snippet this H5VL_class_value_t_snip
+ *
+ * Valid VOL connector identifiers can have values from 0 through 255
+ * for connectors defined by the HDF5 library. Values 256 through 511
+ * are available for testing new connectors. Subsequent values should
+ * be obtained by contacting the The HDF Help Desk.
+ *
+ * \p vipl_id is either #H5P_DEFAULT or the identifier of a VOL
+ * initialization property list of class #H5P_VOL_INITIALIZE created
+ * with H5Pcreate(). When created, this property list contains no
+ * library properties. If a VOL connector author decides that
+ * initialization-specific data are needed, they can be added to the
+ * empty list and retrieved by the connector in the VOL connector's
+ * initialize callback. Use of the VOL initialization property list is
+ * uncommon, as most VOL-specific properties are added to the file
+ * access property list via the connector's API calls which set the
+ * VOL connector for the file open/create. For more information, see
+ * the \ref_vol_doc.
+ *
+ * \since 1.12.0
+ *
+ */
+H5_DLL hid_t H5VLregister_connector_by_value(H5VL_class_value_t connector_value, hid_t vipl_id);
+/**
+ * \ingroup H5VL
+ * \brief Tests whether a VOL class has been registered under a certain name
+ *
+ * \param[in] name Alleged name of connector
+ * \return \htri_t
+ *
+ * \details H5VLis_connector_registered_by_name() tests whether a VOL class has
+ * been registered or not, according to the supplied connector name
+ * \p name.
+ *
+ * \since 1.12.0
+ */
+H5_DLL htri_t H5VLis_connector_registered_by_name(const char *name);
+/**
+ * \ingroup H5VL
+ * \brief Tests whether a VOL class has been registered for a given value
+ *
+ * \param[in] connector_value Connector value
+ * \return \htri_t
+ *
+ * \details H5VLis_connector_registered_by_value() tests whether a VOL class
+ * has been registered, according to the supplied connector value \p
+ * connector_value.
+ *
+ * \p connector_value has a type of H5VL_class_value_t, which is
+ * defined in H5VLpublic.h as follows:
+ * \snippet this H5VL_class_value_t_snip
+ *
+ * Valid VOL connector identifiers can have values from 0 through 255
+ * for connectors defined by the HDF5 library. Values 256 through 511
+ * are available for testing new connectors. Subsequent values should
+ * be obtained by contacting the The HDF Help Desk.
+ *
+ * \since 1.12.0
+ */
+H5_DLL htri_t H5VLis_connector_registered_by_value(H5VL_class_value_t connector_value);
+/**
+ * \ingroup H5VL
+ * \brief Retrieves the VOL connector identifier for a given object identifier
+ *
+ * \obj_id
+ * \return \hid_t{VOL connector}
+ *
+ * \details H5VLget_connector_id() retrieves the registered VOL connector
+ * identifier for the specified object identifier \p obj_id. The VOL
+ * connector identifier must be closed with H5VLclose() when no longer
+ * in use.
+ *
+ * \since 1.12.0
+ */
+H5_DLL hid_t H5VLget_connector_id(hid_t obj_id);
+/**
+ * \ingroup H5VL
+ * \brief Retrieves the identifier for a registered VOL connector name
+ *
+ * \param[in] name Connector name
+ * \return \hid_t{VOL connector}
+ *
+ * \details H5VLget_connector_id_by_name() retrieves the identifier for a
+ * registered VOL connector with the name \p name. The identifier must
+ * be closed with H5VLclose() when no longer in use.
+ *
+ * \since 1.12.0
+ */
+H5_DLL hid_t H5VLget_connector_id_by_name(const char *name);
+/**
+ * \ingroup H5VL
+ * \brief Retrieves the identifier for a registered VOL connector value
+ *
+ * \param[in] connector_value Connector value
+ * \return \hid_t{VOL connector}
+ *
+ * \details H5VLget_connector_id_by_value() retrieves the identifier for a
+ * registered VOL connector with the value \p connector_value. The
+ * identifier will need to be closed by H5VLclose().
+ *
+ * \p connector_value has a type of H5VL_class_value_t, which is
+ * defined in H5VLpublic.h as follows:
+ * \snippet this H5VL_class_value_t_snip
+ *
+ * Valid VOL connector identifiers can have values from 0 through 255
+ * for connectors defined by the HDF5 library. Values 256 through 511
+ * are available for testing new connectors. Subsequent values should
+ * be obtained by contacting the The HDF Help Desk.
+ *
+ * \since 1.12.0
+ */
+H5_DLL hid_t H5VLget_connector_id_by_value(H5VL_class_value_t connector_value);
+/**
+ * \ingroup H5VL
+ * \brief Retrieves a connector name for a VOL
+ *
+ * \obj_id{id} or file identifier
+ * \param[out] name Connector name
+ * \param[in] size Maximum length of the name to retrieve
+ * \return Returns the length of the connector name on success, and a negative value on failure.
+ *
+ * \details H5VLget_connector_name() retrieves up to \p size elements of the
+ * VOL name \p name associated with the object or file identifier \p
+ * id.
+ *
+ * Passing in a NULL pointer for size will return the size of the
+ * connector name. This can be used to determine the size of the
+ * buffer to allocate for the name.
+ *
+ * \since 1.12.0
+ */
H5_DLL ssize_t H5VLget_connector_name(hid_t id, char *name /*out*/, size_t size);
-H5_DLL herr_t H5VLclose(hid_t connector_id);
-H5_DLL herr_t H5VLunregister_connector(hid_t connector_id);
-H5_DLL herr_t H5VLquery_optional(hid_t obj_id, H5VL_subclass_t subcls, int opt_type, hbool_t *supported);
+/**
+ * \ingroup H5VL
+ * \brief Closes a VOL connector identifier
+ *
+ * \param[in] connector_id Connector identifier
+ * \return \herr_t
+ *
+ * \details H5VLclose() closes a VOL connector identifier. This does not affect
+ * the file access property lists which have been defined to use this
+ * VOL connector or files which are already opened under this
+ * connector.
+ *
+ * \since 1.12.0
+ */
+H5_DLL herr_t H5VLclose(hid_t connector_id);
+/**
+ * \ingroup H5VL
+ * \brief Removes a VOL connector identifier from the library
+ *
+ * \param[in] connector_id Connector identifier
+ * \return \herr_t
+ *
+ * \details H5VLunregister_connector() removes a VOL connector identifier from
+ * the library. This does not affect the file access property lists
+ * which have been defined to use the VOL connector or any files which
+ * are already opened with this connector.
+ *
+ * \attention H5VLunregister_connector() will fail if attempting to unregister
+ * the native VOL connector.
+ *
+ * \since 1.12.0
+ */
+H5_DLL herr_t H5VLunregister_connector(hid_t connector_id);
+/**
+ * \ingroup H5VL
+ * \brief Determine if a VOL connector supports a particular
+ * optional callback operation.
+ *
+ * \obj_id
+ * \param[in] subcls VOL subclass
+ * \param[in] opt_type Option type
+ * \param[out] flags Operation flags
+ * \return \herr_t
+ *
+ * \since 1.12.0
+ */
+H5_DLL herr_t H5VLquery_optional(hid_t obj_id, H5VL_subclass_t subcls, int opt_type, hbool_t *supported);
#ifdef __cplusplus
}
diff --git a/src/H5VM.c b/src/H5VM.c
index 20b2707..49cad20 100644
--- a/src/H5VM.c
+++ b/src/H5VM.c
@@ -12,7 +12,7 @@
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
/*
- * Programmer: Robb Matzke <matzke@llnl.gov>
+ * Programmer: Robb Matzke
* Friday, October 10, 1997
*/
@@ -32,18 +32,18 @@ typedef struct H5VM_memcpy_ud_t {
#define H5VM_HYPER_NDIMS H5O_LAYOUT_NDIMS
/* Local prototypes */
-static void H5VM_stride_optimize1(unsigned *np /*in,out*/, hsize_t *elmt_size /*in,out*/, const hsize_t *size,
- hsize_t *stride1);
-static void H5VM_stride_optimize2(unsigned *np /*in,out*/, hsize_t *elmt_size /*in,out*/, const hsize_t *size,
- hsize_t *stride1, hsize_t *stride2);
+static void H5VM__stride_optimize1(unsigned *np /*in,out*/, hsize_t *elmt_size /*in,out*/,
+ const hsize_t *size, hsize_t *stride1);
+static void H5VM__stride_optimize2(unsigned *np /*in,out*/, hsize_t *elmt_size /*in,out*/,
+ const hsize_t *size, hsize_t *stride1, hsize_t *stride2);
#ifdef LATER
-static void H5VM_stride_copy2(hsize_t nelmts, hsize_t elmt_size, unsigned dst_n, const hsize_t *dst_size,
- const ssize_t *dst_stride, void *_dst, unsigned src_n, const hsize_t *src_size,
- const ssize_t *src_stride, const void *_src);
+static void H5VM__stride_copy2(hsize_t nelmts, hsize_t elmt_size, unsigned dst_n, const hsize_t *dst_size,
+ const ssize_t *dst_stride, void *_dst, unsigned src_n, const hsize_t *src_size,
+ const ssize_t *src_stride, const void *_src);
#endif /* LATER */
/*-------------------------------------------------------------------------
- * Function: H5VM_stride_optimize1
+ * Function: H5VM__stride_optimize1
*
* Purpose: Given a stride vector which references elements of the
* specified size, optimize the dimensionality, the stride
@@ -58,15 +58,13 @@ static void H5VM_stride_copy2(hsize_t nelmts, hsize_t elmt_size, unsigned dst_n,
* Programmer: Robb Matzke
* Saturday, October 11, 1997
*
- * Modifications:
- *
*-------------------------------------------------------------------------
*/
static void
-H5VM_stride_optimize1(unsigned *np /*in,out*/, hsize_t *elmt_size /*in,out*/, const hsize_t *size,
- hsize_t *stride1)
+H5VM__stride_optimize1(unsigned *np /*in,out*/, hsize_t *elmt_size /*in,out*/, const hsize_t *size,
+ hsize_t *stride1)
{
- FUNC_ENTER_NOAPI_NOINIT_NOERR
+ FUNC_ENTER_STATIC_NOERR
/*
* This has to be true because if we optimize the dimensionality down to
@@ -87,7 +85,7 @@ H5VM_stride_optimize1(unsigned *np /*in,out*/, hsize_t *elmt_size /*in,out*/, co
}
/*-------------------------------------------------------------------------
- * Function: H5VM_stride_optimize2
+ * Function: H5VM__stride_optimize2
*
* Purpose: Given two stride vectors which reference elements of the
* specified size, optimize the dimensionality, the stride
@@ -102,18 +100,13 @@ H5VM_stride_optimize1(unsigned *np /*in,out*/, hsize_t *elmt_size /*in,out*/, co
* Programmer: Robb Matzke
* Saturday, October 11, 1997
*
- * Modifications:
- * Unrolled loops for common cases
- * Quincey Koziol
- * ?, ? ?, 2001?
- *
*-------------------------------------------------------------------------
*/
static void
-H5VM_stride_optimize2(unsigned *np /*in,out*/, hsize_t *elmt_size /*in,out*/, const hsize_t *size,
- hsize_t *stride1, hsize_t *stride2)
+H5VM__stride_optimize2(unsigned *np /*in,out*/, hsize_t *elmt_size /*in,out*/, const hsize_t *size,
+ hsize_t *stride1, hsize_t *stride2)
{
- FUNC_ENTER_NOAPI_NOINIT_NOERR
+ FUNC_ENTER_STATIC_NOERR
/*
* This has to be true because if we optimize the dimensionality down to
@@ -237,11 +230,6 @@ H5VM_stride_optimize2(unsigned *np /*in,out*/, hsize_t *elmt_size /*in,out*/, co
* Programmer: Robb Matzke
* Saturday, October 11, 1997
*
- * Modifications:
- * Unrolled loops for common cases
- * Quincey Koziol
- * ?, ? ?, 2001?
- *
*-------------------------------------------------------------------------
*/
hsize_t
@@ -338,8 +326,6 @@ H5VM_hyper_stride(unsigned n, const hsize_t *size, const hsize_t *total_size, co
* Programmer: Robb Matzke
* Friday, October 17, 1997
*
- * Modifications:
- *
*-------------------------------------------------------------------------
*/
htri_t
@@ -388,8 +374,6 @@ done:
* Programmer: Robb Matzke
* Friday, October 10, 1997
*
- * Modifications:
- *
*-------------------------------------------------------------------------
*/
herr_t
@@ -425,7 +409,7 @@ H5VM_hyper_fill(unsigned n, const hsize_t *_size, const hsize_t *total_size, con
/* Compute an optimal destination stride vector */
dst_start = H5VM_hyper_stride(n, size, total_size, offset, dst_stride);
- H5VM_stride_optimize1(&n, &elmt_size, size, dst_stride);
+ H5VM__stride_optimize1(&n, &elmt_size, size, dst_stride);
/* Copy */
ret_value = H5VM_stride_fill(n, elmt_size, size, dst_stride, dst + dst_start, fill_value);
@@ -460,11 +444,6 @@ H5VM_hyper_fill(unsigned n, const hsize_t *_size, const hsize_t *total_size, con
* Programmer: Robb Matzke
* Friday, October 10, 1997
*
- * Modifications:
- * Unrolled loops for common cases
- * Quincey Koziol
- * ?, ? ?, 2001?
- *
*-------------------------------------------------------------------------
*/
herr_t
@@ -601,7 +580,7 @@ H5VM_hyper_copy(unsigned n, const hsize_t *_size, const hsize_t *dst_size, const
#endif /* NO_INLINED_CODE */
/* Optimize the strides as a pair */
- H5VM_stride_optimize2(&n, &elmt_size, size, dst_stride, src_stride);
+ H5VM__stride_optimize2(&n, &elmt_size, size, dst_stride, src_stride);
/* Perform the copy in terms of stride */
ret_value =
@@ -621,8 +600,6 @@ H5VM_hyper_copy(unsigned n, const hsize_t *_size, const hsize_t *dst_size, const
* Programmer: Robb Matzke
* Saturday, October 11, 1997
*
- * Modifications:
- *
*-------------------------------------------------------------------------
*/
herr_t
@@ -680,8 +657,6 @@ H5VM_stride_fill(unsigned n, hsize_t elmt_size, const hsize_t *size, const hsize
* Programmer: Robb Matzke
* Saturday, October 11, 1997
*
- * Modifications:
- *
*-------------------------------------------------------------------------
*/
herr_t
@@ -748,8 +723,6 @@ H5VM_stride_copy(unsigned n, hsize_t elmt_size, const hsize_t *size, const hsize
* Programmer: Robb Matzke
* Saturday, October 11, 1997
*
- * Modifications:
- *
*-------------------------------------------------------------------------
*/
herr_t
@@ -802,7 +775,7 @@ H5VM_stride_copy_s(unsigned n, hsize_t elmt_size, const hsize_t *size, const hss
#ifdef LATER
/*-------------------------------------------------------------------------
- * Function: H5VM_stride_copy2
+ * Function: H5VM__stride_copy2
*
* Purpose: Similar to H5VM_stride_copy() except the source and
* destination each have their own dimensionality and size and
@@ -814,8 +787,6 @@ H5VM_stride_copy_s(unsigned n, hsize_t elmt_size, const hsize_t *size, const hss
* Programmer: Robb Matzke
* Saturday, October 11, 1997
*
- * Modifications:
- *
*-------------------------------------------------------------------------
*/
static void
@@ -831,7 +802,7 @@ H5VM__stride_copy2(hsize_t nelmts, hsize_t elmt_size, unsigned dst_n, const hsiz
int j; /* Local index variable */
hbool_t carry;
- FUNC_ENTER_NOAPI_NOINIT_NOERR
+ FUNC_ENTER_STATIC_NOERR
HDassert(elmt_size < SIZET_MAX);
HDassert(dst_n > 0);
@@ -883,8 +854,6 @@ H5VM__stride_copy2(hsize_t nelmts, hsize_t elmt_size, unsigned dst_n, const hsiz
* Programmer: Quincey Koziol
* Thursday, June 18, 1998
*
- * Modifications:
- *
*-------------------------------------------------------------------------
*/
herr_t
@@ -938,8 +907,6 @@ H5VM_array_fill(void *_dst, const void *src, size_t size, size_t count)
* Programmer: Quincey Koziol
* Monday, April 28, 2003
*
- * Modifications:
- *
*-------------------------------------------------------------------------
*/
herr_t
@@ -1017,8 +984,6 @@ H5VM_array_offset_pre(unsigned n, const hsize_t *acc, const hsize_t *offset)
* Programmer: Quincey Koziol
* Tuesday, June 22, 1999
*
- * Modifications:
- *
*-------------------------------------------------------------------------
*/
hsize_t
@@ -1098,8 +1063,6 @@ H5VM_array_calc_pre(hsize_t offset, unsigned n, const hsize_t *down, hsize_t *co
* Programmer: Quincey Koziol
* Wednesday, April 16, 2003
*
- * Modifications:
- *
*-------------------------------------------------------------------------
*/
herr_t
diff --git a/src/H5WB.c b/src/H5WB.c
index 93d4080..df7627f 100644
--- a/src/H5WB.c
+++ b/src/H5WB.c
@@ -15,7 +15,7 @@
*
* Created: H5WB.c
* Jun 26 2007
- * Quincey Koziol <koziol@hdfgroup.org>
+ * Quincey Koziol
*
* Purpose: Implements the "wrapped buffer" code for wrapping
* an existing [staticly sized] buffer, in order to
@@ -88,7 +88,6 @@ H5FL_BLK_DEFINE_STATIC(extra_buf);
* NULL on failure
*
* Programmer: Quincey Koziol
- * koziol@hdfgroup.org
* Jun 26 2007
*
*-------------------------------------------------------------------------
@@ -141,7 +140,6 @@ done:
* NULL on failure
*
* Programmer: Quincey Koziol
- * koziol@hdfgroup.org
* Jun 26 2007
*
*-------------------------------------------------------------------------
@@ -208,7 +206,6 @@ done:
* NULL on failure
*
* Programmer: Quincey Koziol
- * koziol@hdfgroup.org
* Jun 26 2007
*
*-------------------------------------------------------------------------
@@ -245,7 +242,6 @@ done:
* Return: SUCCEED/FAIL
*
* Programmer: Quincey Koziol
- * koziol@hdfgroup.org
* Jun 26 2007
*
*-------------------------------------------------------------------------
diff --git a/src/H5Z.c b/src/H5Z.c
index fc7b113..ea92a01 100644
--- a/src/H5Z.c
+++ b/src/H5Z.c
@@ -68,7 +68,7 @@ static H5Z_stats_t *H5Z_stat_table_g = NULL;
#endif /* H5Z_DEBUG */
/* Local functions */
-static int H5Z_find_idx(H5Z_filter_t id);
+static int H5Z__find_idx(H5Z_filter_t id);
static int H5Z__check_unregister_dset_cb(void *obj_ptr, hid_t obj_id, void *key);
static int H5Z__check_unregister_group_cb(void *obj_ptr, hid_t obj_id, void *key);
static int H5Z__flush_file_cb(void *obj_ptr, hid_t obj_id, void *key);
@@ -137,8 +137,15 @@ H5Z_term_package(void)
if (H5DEBUG(Z)) {
for (i = 0; i < H5Z_table_used_g; i++) {
for (dir = 0; dir < 2; dir++) {
+ struct {
+ char *user;
+ char *system;
+ char *elapsed;
+ } timestrs = {H5_timer_get_time_string(H5Z_stat_table_g[i].stats[dir].times.user),
+ H5_timer_get_time_string(H5Z_stat_table_g[i].stats[dir].times.system),
+ H5_timer_get_time_string(H5Z_stat_table_g[i].stats[dir].times.elapsed)};
if (0 == H5Z_stat_table_g[i].stats[dir].total)
- continue;
+ goto next;
if (0 == nprint++) {
/* Print column headers */
@@ -163,12 +170,14 @@ H5Z_term_package(void)
H5Z_stat_table_g[i].stats[dir].times.elapsed);
/* Print the statistics */
- HDfprintf(H5DEBUG(Z), " %s%-15s %10Hd %10Hd %8T %8T %8T %10s\n", (dir ? "<" : ">"),
- comment, H5Z_stat_table_g[i].stats[dir].total,
- H5Z_stat_table_g[i].stats[dir].errors,
- H5Z_stat_table_g[i].stats[dir].times.user,
- H5Z_stat_table_g[i].stats[dir].times.system,
- H5Z_stat_table_g[i].stats[dir].times.elapsed, bandwidth);
+ HDfprintf(H5DEBUG(Z), " %s%-15s %10" PRIdHSIZE " %10" PRIdHSIZE " %8s %8s %8s %10s\n",
+ (dir ? "<" : ">"), comment, H5Z_stat_table_g[i].stats[dir].total,
+ H5Z_stat_table_g[i].stats[dir].errors, timestrs.user, timestrs.system,
+ timestrs.elapsed, bandwidth);
+next:
+ HDfree(timestrs.user);
+ HDfree(timestrs.system);
+ HDfree(timestrs.elapsed);
} /* end for */
} /* end for */
} /* end if */
@@ -334,8 +343,8 @@ done:
*
* Purpose: This function unregisters a filter.
*
- * Return: SUCCEED/FAIL
- *
+ * Return: Non-negative on success
+ * Negative on failure
*-------------------------------------------------------------------------
*/
herr_t
@@ -452,7 +461,7 @@ H5Z__check_unregister(hid_t ocpl_id, H5Z_filter_t filter_id)
/* Get the plist structure of object creation */
if (NULL == (plist = H5P_object_verify(ocpl_id, H5P_OBJECT_CREATE)))
- HGOTO_ERROR(H5E_PLINE, H5E_BADATOM, FAIL, "can't find object for ID")
+ HGOTO_ERROR(H5E_PLINE, H5E_BADID, FAIL, "can't find object for ID")
/* Check if the object creation property list uses the filter */
if ((ret_value = H5P_filter_in_pline(plist, filter_id)) < 0)
@@ -696,7 +705,7 @@ done:
} /* end H5Z_filter_avail() */
/*-------------------------------------------------------------------------
- * Function: H5Z_prelude_callback
+ * Function: H5Z__prelude_callback
*
* Purpose: Makes a dataset creation "prelude" callback for the "can_apply"
* or "set_local" routines.
@@ -709,14 +718,14 @@ done:
*-------------------------------------------------------------------------
*/
static herr_t
-H5Z_prelude_callback(const H5O_pline_t *pline, hid_t dcpl_id, hid_t type_id, hid_t space_id,
- H5Z_prelude_type_t prelude_type)
+H5Z__prelude_callback(const H5O_pline_t *pline, hid_t dcpl_id, hid_t type_id, hid_t space_id,
+ H5Z_prelude_type_t prelude_type)
{
H5Z_class2_t *fclass; /* Individual filter information */
size_t u; /* Local index variable */
htri_t ret_value = TRUE; /* Return value */
- FUNC_ENTER_NOAPI_NOINIT
+ FUNC_ENTER_STATIC
HDassert(pline->nused > 0);
@@ -774,10 +783,10 @@ H5Z_prelude_callback(const H5O_pline_t *pline, hid_t dcpl_id, hid_t type_id, hid
done:
FUNC_LEAVE_NOAPI(ret_value)
-} /* end H5Z_prelude_callback() */
+} /* end H5Z__prelude_callback() */
/*-------------------------------------------------------------------------
- * Function: H5Z_prepare_prelude_callback_dcpl
+ * Function: H5Z__prepare_prelude_callback_dcpl
*
* Purpose: Prepares to make a dataset creation "prelude" callback
* for the "can_apply" or "set_local" routines.
@@ -790,13 +799,13 @@ done:
*-------------------------------------------------------------------------
*/
static herr_t
-H5Z_prepare_prelude_callback_dcpl(hid_t dcpl_id, hid_t type_id, H5Z_prelude_type_t prelude_type)
+H5Z__prepare_prelude_callback_dcpl(hid_t dcpl_id, hid_t type_id, H5Z_prelude_type_t prelude_type)
{
hid_t space_id = -1; /* ID for dataspace describing chunk */
H5O_layout_t *dcpl_layout = NULL; /* Dataset's layout information */
herr_t ret_value = SUCCEED; /* Return value */
- FUNC_ENTER_NOAPI_NOINIT
+ FUNC_ENTER_STATIC
HDassert(H5I_GENPROP_LST == H5I_get_type(dcpl_id));
HDassert(H5I_DATATYPE == H5I_get_type(type_id));
@@ -840,11 +849,11 @@ H5Z_prepare_prelude_callback_dcpl(hid_t dcpl_id, hid_t type_id, H5Z_prelude_type
/* Get ID for dataspace to pass to filter routines */
if ((space_id = H5I_register(H5I_DATASPACE, space, FALSE)) < 0) {
(void)H5S_close(space);
- HGOTO_ERROR(H5E_ATOM, H5E_CANTREGISTER, FAIL, "unable to register dataspace ID")
+ HGOTO_ERROR(H5E_ID, H5E_CANTREGISTER, FAIL, "unable to register dataspace ID")
}
/* Make the callbacks */
- if (H5Z_prelude_callback(&dcpl_pline, dcpl_id, type_id, space_id, prelude_type) < 0)
+ if (H5Z__prelude_callback(&dcpl_pline, dcpl_id, type_id, space_id, prelude_type) < 0)
HGOTO_ERROR(H5E_PLINE, H5E_CANAPPLY, FAIL, "unable to apply filter")
}
}
@@ -858,7 +867,7 @@ done:
dcpl_layout = (H5O_layout_t *)H5MM_xfree(dcpl_layout);
FUNC_LEAVE_NOAPI(ret_value)
-} /* end H5Z_prepare_prelude_callback_dcpl() */
+} /* end H5Z__prepare_prelude_callback_dcpl() */
/*-------------------------------------------------------------------------
* Function: H5Z_can_apply
@@ -883,7 +892,7 @@ H5Z_can_apply(hid_t dcpl_id, hid_t type_id)
FUNC_ENTER_NOAPI(FAIL)
/* Make "can apply" callbacks for filters in pipeline */
- if (H5Z_prepare_prelude_callback_dcpl(dcpl_id, type_id, H5Z_PRELUDE_CAN_APPLY) < 0)
+ if (H5Z__prepare_prelude_callback_dcpl(dcpl_id, type_id, H5Z_PRELUDE_CAN_APPLY) < 0)
HGOTO_ERROR(H5E_PLINE, H5E_CANAPPLY, FAIL, "unable to apply filter")
done:
@@ -913,7 +922,7 @@ H5Z_set_local(hid_t dcpl_id, hid_t type_id)
FUNC_ENTER_NOAPI(FAIL)
/* Make "set local" callbacks for filters in pipeline */
- if (H5Z_prepare_prelude_callback_dcpl(dcpl_id, type_id, H5Z_PRELUDE_SET_LOCAL) < 0)
+ if (H5Z__prepare_prelude_callback_dcpl(dcpl_id, type_id, H5Z_PRELUDE_SET_LOCAL) < 0)
HGOTO_ERROR(H5E_PLINE, H5E_SETLOCAL, FAIL, "local filter parameters not set")
done:
@@ -941,7 +950,7 @@ H5Z_can_apply_direct(const H5O_pline_t *pline)
HDassert(pline->nused > 0);
/* Make "can apply" callbacks for filters in pipeline */
- if (H5Z_prelude_callback(pline, (hid_t)-1, (hid_t)-1, (hid_t)-1, H5Z_PRELUDE_CAN_APPLY) < 0)
+ if (H5Z__prelude_callback(pline, (hid_t)-1, (hid_t)-1, (hid_t)-1, H5Z_PRELUDE_CAN_APPLY) < 0)
HGOTO_ERROR(H5E_PLINE, H5E_CANAPPLY, FAIL, "unable to apply filter")
done:
@@ -973,7 +982,7 @@ H5Z_set_local_direct(const H5O_pline_t *pline)
HDassert(pline->nused > 0);
/* Make "set local" callbacks for filters in pipeline */
- if (H5Z_prelude_callback(pline, (hid_t)-1, (hid_t)-1, (hid_t)-1, H5Z_PRELUDE_SET_LOCAL) < 0)
+ if (H5Z__prelude_callback(pline, (hid_t)-1, (hid_t)-1, (hid_t)-1, H5Z_PRELUDE_SET_LOCAL) < 0)
HGOTO_ERROR(H5E_PLINE, H5E_SETLOCAL, FAIL, "local filter parameters not set")
done:
@@ -981,6 +990,70 @@ done:
} /* end H5Z_set_local_direct() */
/*-------------------------------------------------------------------------
+ * Function: H5Z_ignore_filters
+ *
+ * Purpose: Determine whether filters can be ignored.
+ *
+ * Description:
+ * When the filters are optional (i.e., H5Z_FLAG_OPTIONAL is provided,)
+ * if any of the following conditions is met, the filters will be ignored:
+ * - dataspace is either H5S_NULL or H5S_SCALAR
+ * - datatype is variable-length (string or non-string)
+ * However, if any of these conditions exists and a filter is not
+ * optional, the function will produce an error.
+ *
+ * Return: Non-negative(TRUE/FALSE) on success
+ * Negative on failure
+ *
+ *-------------------------------------------------------------------------
+ */
+htri_t
+H5Z_ignore_filters(hid_t dcpl_id, const H5T_t *type, const H5S_t *space)
+{
+ H5P_genplist_t *dc_plist; /* Dataset creation property list object */
+ H5O_pline_t pline; /* Object's I/O pipeline information */
+ H5S_class_t space_class; /* To check class of space */
+ H5T_class_t type_class; /* To check if type is VL */
+ hbool_t bad_for_filters = FALSE; /* Suitable to have filters */
+ htri_t ret_value = FALSE; /* TRUE for ignoring filters */
+
+ FUNC_ENTER_NOAPI(FAIL)
+
+ if (NULL == (dc_plist = (H5P_genplist_t *)H5I_object(dcpl_id)))
+ HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "can't get dataset creation property list")
+
+ /* Get pipeline information */
+ if (H5P_peek(dc_plist, H5O_CRT_PIPELINE_NAME, &pline) < 0)
+ HGOTO_ERROR(H5E_PLINE, H5E_CANTGET, FAIL, "can't retrieve pipeline filter")
+
+ /* Get datatype and dataspace classes for quick access */
+ space_class = H5S_GET_EXTENT_TYPE(space);
+ type_class = H5T_get_class(type, FALSE);
+
+ /* These conditions are not suitable for filters */
+ bad_for_filters = (H5S_NULL == space_class || H5S_SCALAR == space_class || H5T_VLEN == type_class ||
+ (H5T_STRING == type_class && TRUE == H5T_is_variable_str(type)));
+
+ /* When these conditions occur, if there are required filters in pline,
+ then report a failure, otherwise, set flag that they can be ignored */
+ if (bad_for_filters) {
+ size_t ii;
+ if (pline.nused > 0) {
+ for (ii = 0; ii < pline.nused; ii++) {
+ if (!(pline.filter[ii].flags & H5Z_FLAG_OPTIONAL))
+ HGOTO_ERROR(H5E_PLINE, H5E_CANTFILTER, FAIL, "not suitable for filters")
+ }
+
+ /* All filters are optional, we can ignore them */
+ ret_value = TRUE;
+ }
+ } /* bad for filters */
+
+done:
+ FUNC_LEAVE_NOAPI(ret_value)
+} /* end H5Z_ignore_filters() */
+
+/*-------------------------------------------------------------------------
* Function: H5Z_modify
*
* Purpose: Modify filter parameters for specified pipeline.
@@ -1143,7 +1216,7 @@ done:
} /* end H5Z_append() */
/*-------------------------------------------------------------------------
- * Function: H5Z_find_idx
+ * Function: H5Z__find_idx
*
* Purpose: Given a filter ID return the offset in the global array
* that holds all the registered filters.
@@ -1153,12 +1226,12 @@ done:
*-------------------------------------------------------------------------
*/
static int
-H5Z_find_idx(H5Z_filter_t id)
+H5Z__find_idx(H5Z_filter_t id)
{
size_t i; /* Local index variable */
int ret_value = FAIL; /* Return value */
- FUNC_ENTER_NOAPI_NOINIT_NOERR
+ FUNC_ENTER_STATIC_NOERR
for (i = 0; i < H5Z_table_used_g; i++)
if (H5Z_table_g[i].id == id)
@@ -1166,7 +1239,7 @@ H5Z_find_idx(H5Z_filter_t id)
done:
FUNC_LEAVE_NOAPI(ret_value)
-} /* end H5Z_find_idx() */
+} /* end H5Z__find_idx() */
/*-------------------------------------------------------------------------
* Function: H5Z_find
@@ -1187,7 +1260,7 @@ H5Z_find(H5Z_filter_t id)
FUNC_ENTER_NOAPI(NULL)
/* Get the index in the global table */
- if ((idx = H5Z_find_idx(id)) < 0)
+ if ((idx = H5Z__find_idx(id)) < 0)
HGOTO_ERROR(H5E_PLINE, H5E_NOTFOUND, NULL, "required filter %d is not registered", id)
/* Set return value */
@@ -1263,7 +1336,7 @@ H5Z_pipeline(const H5O_pline_t *pline, unsigned flags, unsigned *filter_mask /*i
* indicate no plugin through HDF5_PRELOAD_PLUG (using the symbol "::"),
* try to load it dynamically and register it. Otherwise, return failure
*/
- if ((fclass_idx = H5Z_find_idx(pline->filter[idx].id)) < 0) {
+ if ((fclass_idx = H5Z__find_idx(pline->filter[idx].id)) < 0) {
H5PL_key_t key;
const H5Z_class2_t *filter_info;
hbool_t issue_error = FALSE;
@@ -1277,7 +1350,7 @@ H5Z_pipeline(const H5O_pline_t *pline, unsigned flags, unsigned *filter_mask /*i
/* Search in the table of registered filters again to find the dynamic filter just loaded
* and registered */
- if ((fclass_idx = H5Z_find_idx(pline->filter[idx].id)) < 0)
+ if ((fclass_idx = H5Z__find_idx(pline->filter[idx].id)) < 0)
issue_error = TRUE;
}
else
@@ -1340,7 +1413,7 @@ H5Z_pipeline(const H5O_pline_t *pline, unsigned flags, unsigned *filter_mask /*i
failed |= (unsigned)1 << idx;
continue; /* filter excluded */
}
- if ((fclass_idx = H5Z_find_idx(pline->filter[idx].id)) < 0) {
+ if ((fclass_idx = H5Z__find_idx(pline->filter[idx].id)) < 0) {
/* Check if filter is optional -- If it isn't, then error */
if ((pline->filter[idx].flags & H5Z_FLAG_OPTIONAL) == 0)
HGOTO_ERROR(H5E_PLINE, H5E_WRITEERROR, FAIL, "required filter is not registered")
@@ -1592,12 +1665,12 @@ done:
*-------------------------------------------------------------------------
*/
herr_t
-H5Zget_filter_info(H5Z_filter_t filter, unsigned int *filter_config_flags)
+H5Zget_filter_info(H5Z_filter_t filter, unsigned *filter_config_flags /*out*/)
{
herr_t ret_value = SUCCEED;
FUNC_ENTER_API(FAIL)
- H5TRACE2("e", "Zf*Iu", filter, filter_config_flags);
+ H5TRACE2("e", "Zfx", filter, filter_config_flags);
/* Get the filter info */
if (H5Z_get_filter_info(filter, filter_config_flags) < 0)
diff --git a/src/H5Zdeflate.c b/src/H5Zdeflate.c
index 4cac005..d8fed41 100644
--- a/src/H5Zdeflate.c
+++ b/src/H5Zdeflate.c
@@ -12,7 +12,7 @@
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
/*
- * Programmer: Robb Matzke <matzke@llnl.gov>
+ * Programmer: Robb Matzke
* Friday, August 27, 1999
*/
@@ -33,25 +33,25 @@
#endif
/* Local function prototypes */
-static size_t H5Z_filter_deflate(unsigned flags, size_t cd_nelmts, const unsigned cd_values[], size_t nbytes,
- size_t *buf_size, void **buf);
+static size_t H5Z__filter_deflate(unsigned flags, size_t cd_nelmts, const unsigned cd_values[], size_t nbytes,
+ size_t *buf_size, void **buf);
/* This message derives from H5Z */
const H5Z_class2_t H5Z_DEFLATE[1] = {{
- H5Z_CLASS_T_VERS, /* H5Z_class_t version */
- H5Z_FILTER_DEFLATE, /* Filter id number */
- 1, /* encoder_present flag (set to true) */
- 1, /* decoder_present flag (set to true) */
- "deflate", /* Filter name for debugging */
- NULL, /* The "can apply" callback */
- NULL, /* The "set local" callback */
- H5Z_filter_deflate, /* The actual filter function */
+ H5Z_CLASS_T_VERS, /* H5Z_class_t version */
+ H5Z_FILTER_DEFLATE, /* Filter id number */
+ 1, /* encoder_present flag (set to true) */
+ 1, /* decoder_present flag (set to true) */
+ "deflate", /* Filter name for debugging */
+ NULL, /* The "can apply" callback */
+ NULL, /* The "set local" callback */
+ H5Z__filter_deflate, /* The actual filter function */
}};
#define H5Z_DEFLATE_SIZE_ADJUST(s) (HDceil(((double)(s)) * (double)1.001f) + 12)
/*-------------------------------------------------------------------------
- * Function: H5Z_filter_deflate
+ * Function: H5Z__filter_deflate
*
* Purpose: Implement an I/O filter around the 'deflate' algorithm in
* libz
@@ -62,19 +62,17 @@ const H5Z_class2_t H5Z_DEFLATE[1] = {{
* Programmer: Robb Matzke
* Thursday, April 16, 1998
*
- * Modifications:
- *
*-------------------------------------------------------------------------
*/
static size_t
-H5Z_filter_deflate(unsigned flags, size_t cd_nelmts, const unsigned cd_values[], size_t nbytes,
- size_t *buf_size, void **buf)
+H5Z__filter_deflate(unsigned flags, size_t cd_nelmts, const unsigned cd_values[], size_t nbytes,
+ size_t *buf_size, void **buf)
{
void * outbuf = NULL; /* Pointer to new buffer */
int status; /* Status from zlib operation */
size_t ret_value = 0; /* Return value */
- FUNC_ENTER_NOAPI(0)
+ FUNC_ENTER_STATIC
/* Sanity check */
HDassert(*buf_size > 0);
diff --git a/src/H5Zfletcher32.c b/src/H5Zfletcher32.c
index 74c1b24..4b0801c 100644
--- a/src/H5Zfletcher32.c
+++ b/src/H5Zfletcher32.c
@@ -25,25 +25,25 @@
#include "H5Zpkg.h" /* Data filters */
/* Local function prototypes */
-static size_t H5Z_filter_fletcher32(unsigned flags, size_t cd_nelmts, const unsigned cd_values[],
- size_t nbytes, size_t *buf_size, void **buf);
+static size_t H5Z__filter_fletcher32(unsigned flags, size_t cd_nelmts, const unsigned cd_values[],
+ size_t nbytes, size_t *buf_size, void **buf);
/* This message derives from H5Z */
const H5Z_class2_t H5Z_FLETCHER32[1] = {{
- H5Z_CLASS_T_VERS, /* H5Z_class_t version */
- H5Z_FILTER_FLETCHER32, /* Filter id number */
- 1, /* encoder_present flag (set to true) */
- 1, /* decoder_present flag (set to true) */
- "fletcher32", /* Filter name for debugging */
- NULL, /* The "can apply" callback */
- NULL, /* The "set local" callback */
- H5Z_filter_fletcher32, /* The actual filter function */
+ H5Z_CLASS_T_VERS, /* H5Z_class_t version */
+ H5Z_FILTER_FLETCHER32, /* Filter id number */
+ 1, /* encoder_present flag (set to true) */
+ 1, /* decoder_present flag (set to true) */
+ "fletcher32", /* Filter name for debugging */
+ NULL, /* The "can apply" callback */
+ NULL, /* The "set local" callback */
+ H5Z__filter_fletcher32, /* The actual filter function */
}};
#define FLETCHER_LEN 4
/*-------------------------------------------------------------------------
- * Function: H5Z_filter_fletcher32
+ * Function: H5Z__filter_fletcher32
*
* Purpose: Implement an I/O filter of Fletcher32 Checksum
*
@@ -53,22 +53,11 @@ const H5Z_class2_t H5Z_FLETCHER32[1] = {{
* Programmer: Raymond Lu
* Jan 3, 2003
*
- * Modifications:
- * Raymond Lu
- * July 8, 2005
- * There was a bug in the calculating code of the Fletcher32
- * checksum in the library before v1.6.3. The checksum
- * value wasn't consistent between big-endian and little-endian
- * systems. This bug was fixed in Release 1.6.3. However,
- * after fixing the bug, the checksum value is no longer the
- * same as before on little-endian system. We'll check both
- * the correct checksum and the wrong checksum to be consistent
- * with Release 1.6.2 and before.
*-------------------------------------------------------------------------
*/
static size_t
-H5Z_filter_fletcher32(unsigned flags, size_t H5_ATTR_UNUSED cd_nelmts,
- const unsigned H5_ATTR_UNUSED cd_values[], size_t nbytes, size_t *buf_size, void **buf)
+H5Z__filter_fletcher32(unsigned flags, size_t H5_ATTR_UNUSED cd_nelmts,
+ const unsigned H5_ATTR_UNUSED cd_values[], size_t nbytes, size_t *buf_size, void **buf)
{
void * outbuf = NULL; /* Pointer to new buffer */
unsigned char *src = (unsigned char *)(*buf);
@@ -78,7 +67,7 @@ H5Z_filter_fletcher32(unsigned flags, size_t H5_ATTR_UNUSED cd_nelmts,
uint8_t tmp;
size_t ret_value = 0; /* Return value */
- FUNC_ENTER_NOAPI(0)
+ FUNC_ENTER_STATIC
HDassert(sizeof(uint32_t) >= 4);
diff --git a/src/H5Zmodule.h b/src/H5Zmodule.h
index 25007b3..76a2380 100644
--- a/src/H5Zmodule.h
+++ b/src/H5Zmodule.h
@@ -77,11 +77,9 @@
* Custom filters that have been registered with the library will have
* additional unique identifiers.
*
- * See \Emph{HDF5 Dynamically Loaded Filters} for more information on
- * how an HDF5 application can apply a filter that is not registered
- * with the HDF5 library.
- *
- * \todo Fix the reference.
+ * See \ref_dld_filters for more information on how an HDF5
+ * application can apply a filter that is not registered with the HDF5
+ * library.
*
* \defgroup H5ZPRE Predefined Filters
* \ingroup H5Z
diff --git a/src/H5Znbit.c b/src/H5Znbit.c
index aa7f507..b696085 100644
--- a/src/H5Znbit.c
+++ b/src/H5Znbit.c
@@ -34,35 +34,37 @@ typedef struct {
} parms_atomic;
/* Local function prototypes */
-static htri_t H5Z_can_apply_nbit(hid_t dcpl_id, hid_t type_id, hid_t space_id);
-static herr_t H5Z_set_local_nbit(hid_t dcpl_id, hid_t type_id, hid_t space_id);
-static size_t H5Z_filter_nbit(unsigned flags, size_t cd_nelmts, const unsigned cd_values[], size_t nbytes,
- size_t *buf_size, void **buf);
-
-static void H5Z_calc_parms_nooptype(size_t *cd_values_actual_nparms);
-static void H5Z_calc_parms_atomic(size_t *cd_values_actual_nparms);
-static herr_t H5Z_calc_parms_array(const H5T_t *type, size_t *cd_values_actual_nparms);
-static herr_t H5Z_calc_parms_compound(const H5T_t *type, size_t *cd_values_actual_nparms);
-
-static herr_t H5Z_set_parms_nooptype(const H5T_t *type, unsigned *cd_values_index, unsigned cd_values[]);
-static herr_t H5Z_set_parms_atomic(const H5T_t *type, unsigned *cd_values_index, unsigned cd_values[],
+static htri_t H5Z__can_apply_nbit(hid_t dcpl_id, hid_t type_id, hid_t space_id);
+static herr_t H5Z__set_local_nbit(hid_t dcpl_id, hid_t type_id, hid_t space_id);
+static size_t H5Z__filter_nbit(unsigned flags, size_t cd_nelmts, const unsigned cd_values[], size_t nbytes,
+ size_t *buf_size, void **buf);
+
+static void H5Z__calc_parms_nooptype(size_t *cd_values_actual_nparms);
+static void H5Z__calc_parms_atomic(size_t *cd_values_actual_nparms);
+static herr_t H5Z__calc_parms_array(const H5T_t *type, size_t *cd_values_actual_nparms);
+static herr_t H5Z__calc_parms_compound(const H5T_t *type, size_t *cd_values_actual_nparms);
+
+static herr_t H5Z__set_parms_nooptype(const H5T_t *type, unsigned *cd_values_index, unsigned cd_values[]);
+static herr_t H5Z__set_parms_atomic(const H5T_t *type, unsigned *cd_values_index, unsigned cd_values[],
+ hbool_t *need_not_compress);
+static herr_t H5Z__set_parms_array(const H5T_t *type, unsigned *cd_values_index, unsigned cd_values[],
hbool_t *need_not_compress);
-static herr_t H5Z_set_parms_array(const H5T_t *type, unsigned *cd_values_index, unsigned cd_values[],
- hbool_t *need_not_compress);
-static herr_t H5Z_set_parms_compound(const H5T_t *type, unsigned *cd_values_index, unsigned cd_values[],
- hbool_t *need_not_compress);
-
-static void H5Z_nbit_next_byte(size_t *j, size_t *buf_len);
-static void H5Z_nbit_decompress_one_byte(unsigned char *data, size_t data_offset, unsigned k,
- unsigned begin_i, unsigned end_i, unsigned char *buffer, size_t *j,
- size_t *buf_len, const parms_atomic *p, size_t datatype_len);
-static void H5Z_nbit_compress_one_byte(unsigned char *data, size_t data_offset, unsigned k, unsigned begin_i,
- unsigned end_i, unsigned char *buffer, size_t *j, size_t *buf_len,
- const parms_atomic *p, size_t datatype_len);
-static void H5Z_nbit_decompress_one_nooptype(unsigned char *data, size_t data_offset, unsigned char *buffer,
- size_t *j, size_t *buf_len, unsigned size);
-static void H5Z_nbit_decompress_one_atomic(unsigned char *data, size_t data_offset, unsigned char *buffer,
- size_t *j, size_t *buf_len, const parms_atomic *p);
+static herr_t H5Z__set_parms_compound(const H5T_t *type, unsigned *cd_values_index, unsigned cd_values[],
+ hbool_t *need_not_compress);
+
+static void H5Z__nbit_next_byte(size_t *j, size_t *buf_len);
+static void H5Z__nbit_decompress_one_byte(unsigned char *data, size_t data_offset, unsigned k,
+ unsigned begin_i, unsigned end_i, const unsigned char *buffer,
+ size_t *j, size_t *buf_len, const parms_atomic *p,
+ size_t datatype_len);
+static void H5Z__nbit_compress_one_byte(const unsigned char *data, size_t data_offset, unsigned k,
+ unsigned begin_i, unsigned end_i, unsigned char *buffer, size_t *j,
+ size_t *buf_len, const parms_atomic *p, size_t datatype_len);
+static void H5Z__nbit_decompress_one_nooptype(unsigned char *data, size_t data_offset,
+ const unsigned char *buffer, size_t *j, size_t *buf_len,
+ unsigned size);
+static void H5Z__nbit_decompress_one_atomic(unsigned char *data, size_t data_offset, unsigned char *buffer,
+ size_t *j, size_t *buf_len, const parms_atomic *p);
static herr_t H5Z__nbit_decompress_one_array(unsigned char *data, size_t data_offset, unsigned char *buffer,
size_t *j, size_t *buf_len, const unsigned parms[],
unsigned *parms_index);
@@ -71,29 +73,27 @@ static herr_t H5Z__nbit_decompress_one_compound(unsigned char *data, size_t data
const unsigned parms[], unsigned *parms_index);
static herr_t H5Z__nbit_decompress(unsigned char *data, unsigned d_nelmts, unsigned char *buffer,
const unsigned parms[]);
-static void H5Z_nbit_compress_one_nooptype(unsigned char *data, size_t data_offset, unsigned char *buffer,
- size_t *j, size_t *buf_len, unsigned size);
-static void H5Z_nbit_compress_one_atomic(unsigned char *data, size_t data_offset, unsigned char *buffer,
- size_t *j, size_t *buf_len, const parms_atomic *p);
-static void H5Z_nbit_compress_one_array(unsigned char *data, size_t data_offset, unsigned char *buffer,
- size_t *j, size_t *buf_len, const unsigned parms[],
- unsigned *parms_index);
-static void H5Z_nbit_compress_one_compound(unsigned char *data, size_t data_offset, unsigned char *buffer,
- size_t *j, size_t *buf_len, const unsigned parms[],
- unsigned *parms_index);
-static void H5Z_nbit_compress(unsigned char *data, unsigned d_nelmts, unsigned char *buffer,
- size_t *buffer_size, const unsigned parms[]);
+static void H5Z__nbit_compress_one_nooptype(const unsigned char *data, size_t data_offset,
+ unsigned char *buffer, size_t *j, size_t *buf_len, unsigned size);
+static void H5Z__nbit_compress_one_array(unsigned char *data, size_t data_offset, unsigned char *buffer,
+ size_t *j, size_t *buf_len, const unsigned parms[],
+ unsigned *parms_index);
+static void H5Z__nbit_compress_one_compound(unsigned char *data, size_t data_offset, unsigned char *buffer,
+ size_t *j, size_t *buf_len, const unsigned parms[],
+ unsigned *parms_index);
+static void H5Z__nbit_compress(unsigned char *data, unsigned d_nelmts, unsigned char *buffer,
+ size_t *buffer_size, const unsigned parms[]);
/* This message derives from H5Z */
H5Z_class2_t H5Z_NBIT[1] = {{
- H5Z_CLASS_T_VERS, /* H5Z_class_t version */
- H5Z_FILTER_NBIT, /* Filter id number */
- 1, /* Assume encoder present: check before registering */
- 1, /* decoder_present flag (set to true) */
- "nbit", /* Filter name for debugging */
- H5Z_can_apply_nbit, /* The "can apply" callback */
- H5Z_set_local_nbit, /* The "set local" callback */
- H5Z_filter_nbit, /* The actual filter function */
+ H5Z_CLASS_T_VERS, /* H5Z_class_t version */
+ H5Z_FILTER_NBIT, /* Filter id number */
+ 1, /* Assume encoder present: check before registering */
+ 1, /* decoder_present flag (set to true) */
+ "nbit", /* Filter name for debugging */
+ H5Z__can_apply_nbit, /* The "can apply" callback */
+ H5Z__set_local_nbit, /* The "set local" callback */
+ H5Z__filter_nbit, /* The actual filter function */
}};
/* Local macros */
@@ -108,7 +108,7 @@ H5Z_class2_t H5Z_NBIT[1] = {{
/* Local variables */
/*-------------------------------------------------------------------------
- * Function: H5Z_can_apply_nbit
+ * Function: H5Z__can_apply_nbit
*
* Purpose: Check the parameters for nbit compression for validity and
* whether they fit a particular dataset.
@@ -119,17 +119,15 @@ H5Z_class2_t H5Z_NBIT[1] = {{
* Programmer: Xiaowen Wu
* Tuesday, December 21, 2004
*
- * Modifications:
- *
*-------------------------------------------------------------------------
*/
static htri_t
-H5Z_can_apply_nbit(hid_t H5_ATTR_UNUSED dcpl_id, hid_t type_id, hid_t H5_ATTR_UNUSED space_id)
+H5Z__can_apply_nbit(hid_t H5_ATTR_UNUSED dcpl_id, hid_t type_id, hid_t H5_ATTR_UNUSED space_id)
{
const H5T_t *type; /* Datatype */
htri_t ret_value = TRUE; /* Return value */
- FUNC_ENTER_NOAPI_NOINIT
+ FUNC_ENTER_STATIC
/* Get datatype */
if (NULL == (type = (H5T_t *)H5I_object_verify(type_id, H5I_DATATYPE)))
@@ -145,10 +143,10 @@ H5Z_can_apply_nbit(hid_t H5_ATTR_UNUSED dcpl_id, hid_t type_id, hid_t H5_ATTR_UN
done:
FUNC_LEAVE_NOAPI(ret_value)
-} /* end H5Z_can_apply_nbit() */
+} /* end H5Z__can_apply_nbit() */
/*-------------------------------------------------------------------------
- * Function: H5Z_calc_parms_nooptype
+ * Function: H5Z__calc_parms_nooptype
*
* Purpose: Calculate the number of parameters of array cd_values[]
* of datatype that is not integer, nor floating-point, nor
@@ -157,12 +155,10 @@ done:
* Programmer: Xiaowen Wu
* Thursday, March 3, 2005
*
- * Modifications:
- *
*-------------------------------------------------------------------------
*/
static void
-H5Z_calc_parms_nooptype(size_t *cd_values_actual_nparms)
+H5Z__calc_parms_nooptype(size_t *cd_values_actual_nparms)
{
/* Store datatype class code */
*cd_values_actual_nparms += 1;
@@ -172,7 +168,7 @@ H5Z_calc_parms_nooptype(size_t *cd_values_actual_nparms)
}
/*-------------------------------------------------------------------------
- * Function: H5Z_calc_parms_atomic
+ * Function: H5Z__calc_parms_atomic
*
* Purpose: Calculate the number of parameters of array cd_values[]
* of atomic datatype whose datatype class is integer
@@ -181,12 +177,10 @@ H5Z_calc_parms_nooptype(size_t *cd_values_actual_nparms)
* Programmer: Xiaowen Wu
* Saturday, January 29, 2005
*
- * Modifications:
- *
*-------------------------------------------------------------------------
*/
static void
-H5Z_calc_parms_atomic(size_t *cd_values_actual_nparms)
+H5Z__calc_parms_atomic(size_t *cd_values_actual_nparms)
{
/* Store datatype class code */
*cd_values_actual_nparms += 1;
@@ -205,7 +199,7 @@ H5Z_calc_parms_atomic(size_t *cd_values_actual_nparms)
}
/*-------------------------------------------------------------------------
- * Function: H5Z_calc_parms_array
+ * Function: H5Z__calc_parms_array
*
* Purpose: Calculate the number of parameters of array cd_values[]
* for a given datatype identifier type_id
@@ -217,18 +211,16 @@ H5Z_calc_parms_atomic(size_t *cd_values_actual_nparms)
* Programmer: Xiaowen Wu
* Wednesday, January 19, 2005
*
- * Modifications:
- *
*-------------------------------------------------------------------------
*/
static herr_t
-H5Z_calc_parms_array(const H5T_t *type, size_t *cd_values_actual_nparms)
+H5Z__calc_parms_array(const H5T_t *type, size_t *cd_values_actual_nparms)
{
H5T_t * dtype_base = NULL; /* Array datatype's base datatype */
H5T_class_t dtype_base_class; /* Array datatype's base datatype's class */
herr_t ret_value = SUCCEED; /* Return value */
- FUNC_ENTER_NOAPI_NOINIT
+ FUNC_ENTER_STATIC
/* Store datatype class code */
*cd_values_actual_nparms += 1;
@@ -248,16 +240,16 @@ H5Z_calc_parms_array(const H5T_t *type, size_t *cd_values_actual_nparms)
switch (dtype_base_class) {
case H5T_INTEGER:
case H5T_FLOAT:
- H5Z_calc_parms_atomic(cd_values_actual_nparms);
+ H5Z__calc_parms_atomic(cd_values_actual_nparms);
break;
case H5T_ARRAY:
- if (H5Z_calc_parms_array(dtype_base, cd_values_actual_nparms) == FAIL)
+ if (H5Z__calc_parms_array(dtype_base, cd_values_actual_nparms) == FAIL)
HGOTO_ERROR(H5E_PLINE, H5E_BADTYPE, FAIL, "nbit cannot compute parameters for datatype")
break;
case H5T_COMPOUND:
- if (H5Z_calc_parms_compound(dtype_base, cd_values_actual_nparms) == FAIL)
+ if (H5Z__calc_parms_compound(dtype_base, cd_values_actual_nparms) == FAIL)
HGOTO_ERROR(H5E_PLINE, H5E_BADTYPE, FAIL, "nbit cannot compute parameters for datatype")
break;
@@ -269,7 +261,7 @@ H5Z_calc_parms_array(const H5T_t *type, size_t *cd_values_actual_nparms)
case H5T_ENUM:
case H5T_VLEN:
/* Other datatype classes: nbit does no compression */
- H5Z_calc_parms_nooptype(cd_values_actual_nparms);
+ H5Z__calc_parms_nooptype(cd_values_actual_nparms);
break;
case H5T_NO_CLASS:
@@ -286,10 +278,10 @@ done:
HDONE_ERROR(H5E_PLINE, H5E_CLOSEERROR, FAIL, "Unable to close base datatype")
FUNC_LEAVE_NOAPI(ret_value)
-} /* end H5Z_calc_parms_array() */
+} /* end H5Z__calc_parms_array() */
/*-------------------------------------------------------------------------
- * Function: H5Z_calc_parms_compound
+ * Function: H5Z__calc_parms_compound
*
* Purpose: Calculate the number of parameters of array cd_values[]
* for a given datatype identifier type_id
@@ -301,19 +293,17 @@ done:
* Programmer: Xiaowen Wu
* Wednesday, January 19, 2005
*
- * Modifications:
- *
*-------------------------------------------------------------------------
*/
static herr_t
-H5Z_calc_parms_compound(const H5T_t *type, size_t *cd_values_actual_nparms)
+H5Z__calc_parms_compound(const H5T_t *type, size_t *cd_values_actual_nparms)
{
int nmembers; /* Compound datatype's number of members */
H5T_t * dtype_member = NULL; /* Compound datatype's member datatype */
unsigned u; /* Local index variable */
herr_t ret_value = SUCCEED; /* Return value */
- FUNC_ENTER_NOAPI_NOINIT
+ FUNC_ENTER_STATIC
/* Store compound datatype class code */
*cd_values_actual_nparms += 1;
@@ -347,16 +337,16 @@ H5Z_calc_parms_compound(const H5T_t *type, size_t *cd_values_actual_nparms)
switch (dtype_member_class) {
case H5T_INTEGER:
case H5T_FLOAT:
- H5Z_calc_parms_atomic(cd_values_actual_nparms);
+ H5Z__calc_parms_atomic(cd_values_actual_nparms);
break;
case H5T_ARRAY:
- if (H5Z_calc_parms_array(dtype_member, cd_values_actual_nparms) == FAIL)
+ if (H5Z__calc_parms_array(dtype_member, cd_values_actual_nparms) == FAIL)
HGOTO_ERROR(H5E_PLINE, H5E_BADTYPE, FAIL, "nbit cannot compute parameters for datatype")
break;
case H5T_COMPOUND:
- if (H5Z_calc_parms_compound(dtype_member, cd_values_actual_nparms) == FAIL)
+ if (H5Z__calc_parms_compound(dtype_member, cd_values_actual_nparms) == FAIL)
HGOTO_ERROR(H5E_PLINE, H5E_BADTYPE, FAIL, "nbit cannot compute parameters for datatype")
break;
@@ -368,7 +358,7 @@ H5Z_calc_parms_compound(const H5T_t *type, size_t *cd_values_actual_nparms)
case H5T_ENUM:
case H5T_VLEN:
/* Other datatype classes: nbit does no compression */
- H5Z_calc_parms_nooptype(cd_values_actual_nparms);
+ H5Z__calc_parms_nooptype(cd_values_actual_nparms);
break;
case H5T_NO_CLASS:
@@ -394,7 +384,7 @@ done:
} /* end H5Z_calc_params_compound */
/*-------------------------------------------------------------------------
- * Function: H5Z_set_parms_nooptype
+ * Function: H5Z__set_parms_nooptype
*
* Purpose: Set the array cd_values[] for a given datatype identifier
* type_id if its datatype class is not integer, nor
@@ -407,17 +397,15 @@ done:
* Programmer: Xiaowen Wu
* Tuesday, April 5, 2005
*
- * Modifications:
- *
*-------------------------------------------------------------------------
*/
static herr_t
-H5Z_set_parms_nooptype(const H5T_t *type, unsigned *cd_values_index, unsigned cd_values[])
+H5Z__set_parms_nooptype(const H5T_t *type, unsigned *cd_values_index, unsigned cd_values[])
{
size_t dtype_size; /* No-op datatype's size (in bytes) */
herr_t ret_value = SUCCEED; /* Return value */
- FUNC_ENTER_NOAPI_NOINIT
+ FUNC_ENTER_STATIC
/* Set datatype class code */
cd_values[(*cd_values_index)++] = H5Z_NBIT_NOOPTYPE;
@@ -432,10 +420,10 @@ H5Z_set_parms_nooptype(const H5T_t *type, unsigned *cd_values_index, unsigned cd
done:
FUNC_LEAVE_NOAPI(ret_value)
-} /* end H5Z_set_parms_nooptype() */
+} /* end H5Z__set_parms_nooptype() */
/*-------------------------------------------------------------------------
- * Function: H5Z_set_parms_atomic
+ * Function: H5Z__set_parms_atomic
*
* Purpose: Set the array cd_values[] for a given datatype identifier
* type_id if its datatype class is integer or floating point
@@ -446,13 +434,11 @@ done:
* Programmer: Xiaowen Wu
* Tuesday, January 11, 2005
*
- * Modifications:
- *
*-------------------------------------------------------------------------
*/
static herr_t
-H5Z_set_parms_atomic(const H5T_t *type, unsigned *cd_values_index, unsigned cd_values[],
- hbool_t *need_not_compress)
+H5Z__set_parms_atomic(const H5T_t *type, unsigned *cd_values_index, unsigned cd_values[],
+ hbool_t *need_not_compress)
{
H5T_order_t dtype_order; /* Atomic datatype's endianness order */
size_t dtype_size; /* Atomic datatype's size (in bytes) */
@@ -461,7 +447,7 @@ H5Z_set_parms_atomic(const H5T_t *type, unsigned *cd_values_index, unsigned cd_v
unsigned dtype_offset; /* Atomic datatype's offset (in bits) */
herr_t ret_value = SUCCEED; /* Return value */
- FUNC_ENTER_NOAPI_NOINIT
+ FUNC_ENTER_STATIC
/* Set datatype class code */
cd_values[(*cd_values_index)++] = H5Z_NBIT_ATOMIC;
@@ -525,10 +511,10 @@ H5Z_set_parms_atomic(const H5T_t *type, unsigned *cd_values_index, unsigned cd_v
*need_not_compress = FALSE;
done:
FUNC_LEAVE_NOAPI(ret_value)
-} /* end H5Z_set_parms_atomic() */
+} /* end H5Z__set_parms_atomic() */
/*-------------------------------------------------------------------------
- * Function: H5Z_set_parms_array
+ * Function: H5Z__set_parms_array
*
* Purpose: Set the array cd_values[] for a given datatype identifier
* type_id if its datatype class is array datatype
@@ -539,13 +525,11 @@ done:
* Programmer: Xiaowen Wu
* Tuesday, April 5, 2005
*
- * Modifications:
- *
*-------------------------------------------------------------------------
*/
static herr_t
-H5Z_set_parms_array(const H5T_t *type, unsigned *cd_values_index, unsigned cd_values[],
- hbool_t *need_not_compress)
+H5Z__set_parms_array(const H5T_t *type, unsigned *cd_values_index, unsigned cd_values[],
+ hbool_t *need_not_compress)
{
H5T_t * dtype_base = NULL; /* Array datatype's base datatype */
H5T_class_t dtype_base_class; /* Array datatype's base datatype's class */
@@ -553,7 +537,7 @@ H5Z_set_parms_array(const H5T_t *type, unsigned *cd_values_index, unsigned cd_va
htri_t is_vlstring; /* flag indicating if datatype is variable-length string */
herr_t ret_value = SUCCEED; /* Return value */
- FUNC_ENTER_NOAPI_NOINIT
+ FUNC_ENTER_STATIC
/* Set datatype class code */
cd_values[(*cd_values_index)++] = H5Z_NBIT_ARRAY;
@@ -578,17 +562,17 @@ H5Z_set_parms_array(const H5T_t *type, unsigned *cd_values_index, unsigned cd_va
switch (dtype_base_class) {
case H5T_INTEGER:
case H5T_FLOAT:
- if (H5Z_set_parms_atomic(dtype_base, cd_values_index, cd_values, need_not_compress) < 0)
+ if (H5Z__set_parms_atomic(dtype_base, cd_values_index, cd_values, need_not_compress) < 0)
HGOTO_ERROR(H5E_PLINE, H5E_BADTYPE, FAIL, "nbit cannot set parameters for datatype")
break;
case H5T_ARRAY:
- if (H5Z_set_parms_array(dtype_base, cd_values_index, cd_values, need_not_compress) < 0)
+ if (H5Z__set_parms_array(dtype_base, cd_values_index, cd_values, need_not_compress) < 0)
HGOTO_ERROR(H5E_PLINE, H5E_BADTYPE, FAIL, "nbit cannot set parameters for datatype")
break;
case H5T_COMPOUND:
- if (H5Z_set_parms_compound(dtype_base, cd_values_index, cd_values, need_not_compress) < 0)
+ if (H5Z__set_parms_compound(dtype_base, cd_values_index, cd_values, need_not_compress) < 0)
HGOTO_ERROR(H5E_PLINE, H5E_BADTYPE, FAIL, "nbit cannot set parameters for datatype")
break;
@@ -602,7 +586,7 @@ H5Z_set_parms_array(const H5T_t *type, unsigned *cd_values_index, unsigned cd_va
if (dtype_base_class == H5T_VLEN || is_vlstring)
HGOTO_ERROR(H5E_PLINE, H5E_BADTYPE, FAIL, "datatype not supported by nbit")
- if (H5Z_set_parms_nooptype(dtype_base, cd_values_index, cd_values) < 0)
+ if (H5Z__set_parms_nooptype(dtype_base, cd_values_index, cd_values) < 0)
HGOTO_ERROR(H5E_PLINE, H5E_BADTYPE, FAIL, "nbit cannot set parameters for datatype")
break;
@@ -612,7 +596,7 @@ H5Z_set_parms_array(const H5T_t *type, unsigned *cd_values_index, unsigned cd_va
case H5T_OPAQUE:
case H5T_REFERENCE:
case H5T_ENUM:
- if (H5Z_set_parms_nooptype(dtype_base, cd_values_index, cd_values) < 0)
+ if (H5Z__set_parms_nooptype(dtype_base, cd_values_index, cd_values) < 0)
HGOTO_ERROR(H5E_PLINE, H5E_BADTYPE, FAIL, "nbit cannot set parameters for datatype")
break;
@@ -630,10 +614,10 @@ done:
HDONE_ERROR(H5E_PLINE, H5E_CLOSEERROR, FAIL, "Unable to close base datatype")
FUNC_LEAVE_NOAPI(ret_value)
-} /* end H5Z_set_parms_array() */
+} /* end H5Z__set_parms_array() */
/*-------------------------------------------------------------------------
- * Function: H5Z_set_parms_compound
+ * Function: H5Z__set_parms_compound
*
* Purpose: Set the array cd_values[] for a given datatype identifier
* type_id if its datatype class is compound datatype
@@ -644,13 +628,11 @@ done:
* Programmer: Xiaowen Wu
* Tuesday, April 5, 2005
*
- * Modifications:
- *
*-------------------------------------------------------------------------
*/
static herr_t
-H5Z_set_parms_compound(const H5T_t *type, unsigned *cd_values_index, unsigned cd_values[],
- hbool_t *need_not_compress)
+H5Z__set_parms_compound(const H5T_t *type, unsigned *cd_values_index, unsigned cd_values[],
+ hbool_t *need_not_compress)
{
int snmembers; /* Compound datatype's number of members */
unsigned nmembers; /* Compound datatype's number of members */
@@ -663,7 +645,7 @@ H5Z_set_parms_compound(const H5T_t *type, unsigned *cd_values_index, unsigned cd
unsigned u; /* Local index variable */
herr_t ret_value = SUCCEED; /* Return value */
- FUNC_ENTER_NOAPI_NOINIT
+ FUNC_ENTER_STATIC
/* Set "local" parameter for compound datatype class code */
cd_values[(*cd_values_index)++] = H5Z_NBIT_COMPOUND;
@@ -705,17 +687,17 @@ H5Z_set_parms_compound(const H5T_t *type, unsigned *cd_values_index, unsigned cd
switch (dtype_member_class) {
case H5T_INTEGER:
case H5T_FLOAT:
- if (H5Z_set_parms_atomic(dtype_member, cd_values_index, cd_values, need_not_compress) < 0)
+ if (H5Z__set_parms_atomic(dtype_member, cd_values_index, cd_values, need_not_compress) < 0)
HGOTO_ERROR(H5E_PLINE, H5E_BADTYPE, FAIL, "nbit cannot set parameters for datatype")
break;
case H5T_ARRAY:
- if (H5Z_set_parms_array(dtype_member, cd_values_index, cd_values, need_not_compress) < 0)
+ if (H5Z__set_parms_array(dtype_member, cd_values_index, cd_values, need_not_compress) < 0)
HGOTO_ERROR(H5E_PLINE, H5E_BADTYPE, FAIL, "nbit cannot set parameters for datatype")
break;
case H5T_COMPOUND:
- if (H5Z_set_parms_compound(dtype_member, cd_values_index, cd_values, need_not_compress) < 0)
+ if (H5Z__set_parms_compound(dtype_member, cd_values_index, cd_values, need_not_compress) < 0)
HGOTO_ERROR(H5E_PLINE, H5E_BADTYPE, FAIL, "nbit cannot set parameters for datatype")
break;
@@ -755,7 +737,7 @@ H5Z_set_parms_compound(const H5T_t *type, unsigned *cd_values_index, unsigned cd
case H5T_REFERENCE:
case H5T_ENUM:
/* other datatype that nbit does no compression */
- if (H5Z_set_parms_nooptype(dtype_member, cd_values_index, cd_values) < 0)
+ if (H5Z__set_parms_nooptype(dtype_member, cd_values_index, cd_values) < 0)
HGOTO_ERROR(H5E_PLINE, H5E_BADTYPE, FAIL, "nbit cannot set parameters for datatype")
break;
@@ -782,7 +764,7 @@ done:
} /* end H5Z_set_params_compound */
/*-------------------------------------------------------------------------
- * Function: H5Z_set_local_nbit
+ * Function: H5Z__set_local_nbit
*
* Purpose: Set the "local" dataset parameters for nbit compression.
*
@@ -792,12 +774,10 @@ done:
* Programmer: Xiaowen Wu
* Tuesday, January 11, 2005
*
- * Modifications:
- *
*-------------------------------------------------------------------------
*/
static herr_t
-H5Z_set_local_nbit(hid_t dcpl_id, hid_t type_id, hid_t space_id)
+H5Z__set_local_nbit(hid_t dcpl_id, hid_t type_id, hid_t space_id)
{
H5P_genplist_t *dcpl_plist; /* Property list pointer */
const H5T_t * type; /* Datatype */
@@ -812,7 +792,7 @@ H5Z_set_local_nbit(hid_t dcpl_id, hid_t type_id, hid_t space_id)
hbool_t need_not_compress; /* Flag if TRUE indicating no need to do nbit compression */
herr_t ret_value = SUCCEED; /* Return value */
- FUNC_ENTER_NOAPI_NOINIT
+ FUNC_ENTER_STATIC
/* Get datatype */
if (NULL == (type = (H5T_t *)H5I_object_verify(type_id, H5I_DATATYPE)))
@@ -832,16 +812,16 @@ H5Z_set_local_nbit(hid_t dcpl_id, hid_t type_id, hid_t space_id)
switch (dtype_class) {
case H5T_INTEGER:
case H5T_FLOAT:
- H5Z_calc_parms_atomic(&cd_values_actual_nparms);
+ H5Z__calc_parms_atomic(&cd_values_actual_nparms);
break;
case H5T_ARRAY:
- if (H5Z_calc_parms_array(type, &cd_values_actual_nparms) < 0)
+ if (H5Z__calc_parms_array(type, &cd_values_actual_nparms) < 0)
HGOTO_ERROR(H5E_PLINE, H5E_BADTYPE, FAIL, "nbit cannot compute parameters for datatype")
break;
case H5T_COMPOUND:
- if (H5Z_calc_parms_compound(type, &cd_values_actual_nparms) < 0)
+ if (H5Z__calc_parms_compound(type, &cd_values_actual_nparms) < 0)
HGOTO_ERROR(H5E_PLINE, H5E_BADTYPE, FAIL, "nbit cannot compute parameters for datatype")
break;
@@ -873,7 +853,7 @@ H5Z_set_local_nbit(hid_t dcpl_id, hid_t type_id, hid_t space_id)
/* Get the plist structure */
if (NULL == (dcpl_plist = H5P_object_verify(dcpl_id, H5P_DATASET_CREATE)))
- HGOTO_ERROR(H5E_ATOM, H5E_BADATOM, FAIL, "can't find object for ID")
+ HGOTO_ERROR(H5E_ID, H5E_BADID, FAIL, "can't find object for ID")
/* Get the filter's current parameters */
if (H5P_get_filter_by_id(dcpl_plist, H5Z_FILTER_NBIT, &flags, &cd_nelmts, cd_values, (size_t)0, NULL,
@@ -903,17 +883,17 @@ H5Z_set_local_nbit(hid_t dcpl_id, hid_t type_id, hid_t space_id)
switch (dtype_class) {
case H5T_INTEGER:
case H5T_FLOAT:
- if (H5Z_set_parms_atomic(type, &cd_values_index, cd_values, &need_not_compress) < 0)
+ if (H5Z__set_parms_atomic(type, &cd_values_index, cd_values, &need_not_compress) < 0)
HGOTO_ERROR(H5E_PLINE, H5E_BADTYPE, FAIL, "nbit cannot set parameters for datatype")
break;
case H5T_ARRAY:
- if (H5Z_set_parms_array(type, &cd_values_index, cd_values, &need_not_compress) < 0)
+ if (H5Z__set_parms_array(type, &cd_values_index, cd_values, &need_not_compress) < 0)
HGOTO_ERROR(H5E_PLINE, H5E_BADTYPE, FAIL, "nbit cannot set parameters for datatype")
break;
case H5T_COMPOUND:
- if (H5Z_set_parms_compound(type, &cd_values_index, cd_values, &need_not_compress) < 0)
+ if (H5Z__set_parms_compound(type, &cd_values_index, cd_values, &need_not_compress) < 0)
HGOTO_ERROR(H5E_PLINE, H5E_BADTYPE, FAIL, "nbit cannot set parameters for datatype")
break;
@@ -952,10 +932,10 @@ done:
H5MM_xfree(cd_values);
FUNC_LEAVE_NOAPI(ret_value)
-} /* end H5Z_set_local_nbit() */
+} /* end H5Z__set_local_nbit() */
/*-------------------------------------------------------------------------
- * Function: H5Z_filter_nbit
+ * Function: H5Z__filter_nbit
*
* Purpose: Implement an I/O filter for storing packed nbit data
*
@@ -968,15 +948,15 @@ done:
*-------------------------------------------------------------------------
*/
static size_t
-H5Z_filter_nbit(unsigned flags, size_t cd_nelmts, const unsigned cd_values[], size_t nbytes, size_t *buf_size,
- void **buf)
+H5Z__filter_nbit(unsigned flags, size_t cd_nelmts, const unsigned cd_values[], size_t nbytes,
+ size_t *buf_size, void **buf)
{
unsigned char *outbuf; /* pointer to new output buffer */
size_t size_out = 0; /* size of output buffer */
unsigned d_nelmts = 0; /* number of elements in the chunk */
size_t ret_value = 0; /* return value */
- FUNC_ENTER_NOAPI_NOINIT
+ FUNC_ENTER_STATIC
/* check arguments
* cd_values[0] stores actual number of parameters in cd_values[]
@@ -1016,7 +996,7 @@ H5Z_filter_nbit(unsigned flags, size_t cd_nelmts, const unsigned cd_values[], si
HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, 0, "memory allocation failed for nbit compression")
/* compress the buffer, size_out will be changed */
- H5Z_nbit_compress((unsigned char *)*buf, d_nelmts, outbuf, &size_out, cd_values);
+ H5Z__nbit_compress((unsigned char *)*buf, d_nelmts, outbuf, &size_out, cd_values);
} /* end else */
/* free the input buffer */
@@ -1029,7 +1009,7 @@ H5Z_filter_nbit(unsigned flags, size_t cd_nelmts, const unsigned cd_values[], si
done:
FUNC_LEAVE_NOAPI(ret_value)
-} /* end H5Z_filter_nbit() */
+} /* end H5Z__filter_nbit() */
/* ======== Nbit Algorithm ===============================================
* assume one byte has 8 bit
@@ -1040,16 +1020,16 @@ done:
*/
static void
-H5Z_nbit_next_byte(size_t *j, size_t *buf_len)
+H5Z__nbit_next_byte(size_t *j, size_t *buf_len)
{
++(*j);
*buf_len = 8 * sizeof(unsigned char);
}
static void
-H5Z_nbit_decompress_one_byte(unsigned char *data, size_t data_offset, unsigned k, unsigned begin_i,
- unsigned end_i, unsigned char *buffer, size_t *j, size_t *buf_len,
- const parms_atomic *p, size_t datatype_len)
+H5Z__nbit_decompress_one_byte(unsigned char *data, size_t data_offset, unsigned k, unsigned begin_i,
+ unsigned end_i, const unsigned char *buffer, size_t *j, size_t *buf_len,
+ const parms_atomic *p, size_t datatype_len)
{
size_t dat_len; /* dat_len is the number of bits to be copied in each data byte */
size_t dat_offset;
@@ -1084,7 +1064,7 @@ H5Z_nbit_decompress_one_byte(unsigned char *data, size_t data_offset, unsigned k
data[data_offset + k] =
(unsigned char)(((val & ~((unsigned)(~0) << *buf_len)) << (dat_len - *buf_len)) << dat_offset);
dat_len -= *buf_len;
- H5Z_nbit_next_byte(j, buf_len);
+ H5Z__nbit_next_byte(j, buf_len);
if (dat_len == 0)
return;
@@ -1097,8 +1077,8 @@ H5Z_nbit_decompress_one_byte(unsigned char *data, size_t data_offset, unsigned k
}
static void
-H5Z_nbit_decompress_one_nooptype(unsigned char *data, size_t data_offset, unsigned char *buffer, size_t *j,
- size_t *buf_len, unsigned size)
+H5Z__nbit_decompress_one_nooptype(unsigned char *data, size_t data_offset, const unsigned char *buffer,
+ size_t *j, size_t *buf_len, unsigned size)
{
unsigned i; /* index */
size_t dat_len; /* dat_len is the number of bits to be copied in each data byte */
@@ -1112,7 +1092,7 @@ H5Z_nbit_decompress_one_nooptype(unsigned char *data, size_t data_offset, unsign
data[data_offset + i] =
(unsigned char)(((val & ~((unsigned)(~0) << *buf_len)) << (dat_len - *buf_len)));
dat_len -= *buf_len;
- H5Z_nbit_next_byte(j, buf_len);
+ H5Z__nbit_next_byte(j, buf_len);
if (dat_len == 0)
continue;
@@ -1124,8 +1104,8 @@ H5Z_nbit_decompress_one_nooptype(unsigned char *data, size_t data_offset, unsign
}
static void
-H5Z_nbit_decompress_one_atomic(unsigned char *data, size_t data_offset, unsigned char *buffer, size_t *j,
- size_t *buf_len, const parms_atomic *p)
+H5Z__nbit_decompress_one_atomic(unsigned char *data, size_t data_offset, unsigned char *buffer, size_t *j,
+ size_t *buf_len, const parms_atomic *p)
{
/* begin_i: the index of byte having first significant bit
end_i: the index of byte having last significant bit */
@@ -1144,8 +1124,8 @@ H5Z_nbit_decompress_one_atomic(unsigned char *data, size_t data_offset, unsigned
end_i = p->offset / 8;
for (k = (int)begin_i; k >= (int)end_i; k--)
- H5Z_nbit_decompress_one_byte(data, data_offset, (unsigned)k, begin_i, end_i, buffer, j, buf_len,
- p, datatype_len);
+ H5Z__nbit_decompress_one_byte(data, data_offset, (unsigned)k, begin_i, end_i, buffer, j, buf_len,
+ p, datatype_len);
}
else { /* big endian */
/* Sanity check */
@@ -1159,8 +1139,8 @@ H5Z_nbit_decompress_one_atomic(unsigned char *data, size_t data_offset, unsigned
end_i = ((unsigned)datatype_len - p->offset) / 8 - 1;
for (k = (int)begin_i; k <= (int)end_i; k++)
- H5Z_nbit_decompress_one_byte(data, data_offset, (unsigned)k, begin_i, end_i, buffer, j, buf_len,
- p, datatype_len);
+ H5Z__nbit_decompress_one_byte(data, data_offset, (unsigned)k, begin_i, end_i, buffer, j, buf_len,
+ p, datatype_len);
}
}
@@ -1190,7 +1170,7 @@ H5Z__nbit_decompress_one_array(unsigned char *data, size_t data_offset, unsigned
n = total_size / p.size;
for (i = 0; i < n; i++)
- H5Z_nbit_decompress_one_atomic(data, data_offset + i * p.size, buffer, j, buf_len, &p);
+ H5Z__nbit_decompress_one_atomic(data, data_offset + i * p.size, buffer, j, buf_len, &p);
break;
case H5Z_NBIT_ARRAY:
@@ -1219,7 +1199,7 @@ H5Z__nbit_decompress_one_array(unsigned char *data, size_t data_offset, unsigned
case H5Z_NBIT_NOOPTYPE:
(*parms_index)++; /* skip size of no-op type */
- H5Z_nbit_decompress_one_nooptype(data, data_offset, buffer, j, buf_len, total_size);
+ H5Z__nbit_decompress_one_nooptype(data, data_offset, buffer, j, buf_len, total_size);
break;
default:
@@ -1265,7 +1245,7 @@ H5Z__nbit_decompress_one_compound(unsigned char *data, size_t data_offset, unsig
if (p.precision > p.size * 8 || (p.precision + p.offset) > p.size * 8)
HGOTO_ERROR(H5E_PLINE, H5E_BADTYPE, FAIL, "invalid datatype precision/offset")
- H5Z_nbit_decompress_one_atomic(data, data_offset + member_offset, buffer, j, buf_len, &p);
+ H5Z__nbit_decompress_one_atomic(data, data_offset + member_offset, buffer, j, buf_len, &p);
break;
case H5Z_NBIT_ARRAY:
@@ -1283,8 +1263,8 @@ H5Z__nbit_decompress_one_compound(unsigned char *data, size_t data_offset, unsig
case H5Z_NBIT_NOOPTYPE:
/* Advance past member size */
(*parms_index)++;
- H5Z_nbit_decompress_one_nooptype(data, data_offset + member_offset, buffer, j, buf_len,
- member_size);
+ H5Z__nbit_decompress_one_nooptype(data, data_offset + member_offset, buffer, j, buf_len,
+ member_size);
break;
default:
@@ -1329,7 +1309,7 @@ H5Z__nbit_decompress(unsigned char *data, unsigned d_nelmts, unsigned char *buff
HGOTO_ERROR(H5E_PLINE, H5E_BADTYPE, FAIL, "invalid datatype precision/offset")
for (i = 0; i < d_nelmts; i++)
- H5Z_nbit_decompress_one_atomic(data, i * p.size, buffer, &j, &buf_len, &p);
+ H5Z__nbit_decompress_one_atomic(data, i * p.size, buffer, &j, &buf_len, &p);
break;
case H5Z_NBIT_ARRAY:
@@ -1363,9 +1343,9 @@ done:
}
static void
-H5Z_nbit_compress_one_byte(unsigned char *data, size_t data_offset, unsigned k, unsigned begin_i,
- unsigned end_i, unsigned char *buffer, size_t *j, size_t *buf_len,
- const parms_atomic *p, size_t datatype_len)
+H5Z__nbit_compress_one_byte(const unsigned char *data, size_t data_offset, unsigned k, unsigned begin_i,
+ unsigned end_i, unsigned char *buffer, size_t *j, size_t *buf_len,
+ const parms_atomic *p, size_t datatype_len)
{
size_t dat_len; /* dat_len is the number of bits to be copied in each data byte */
unsigned char val; /* value to be copied in each data byte */
@@ -1395,7 +1375,7 @@ H5Z_nbit_compress_one_byte(unsigned char *data, size_t data_offset, unsigned k,
buffer[*j] |=
(unsigned char)((unsigned)(val >> (dat_len - *buf_len)) & ~((unsigned)(~0) << *buf_len));
dat_len -= *buf_len;
- H5Z_nbit_next_byte(j, buf_len);
+ H5Z__nbit_next_byte(j, buf_len);
if (dat_len == 0)
return;
@@ -1405,8 +1385,8 @@ H5Z_nbit_compress_one_byte(unsigned char *data, size_t data_offset, unsigned k,
}
static void
-H5Z_nbit_compress_one_nooptype(unsigned char *data, size_t data_offset, unsigned char *buffer, size_t *j,
- size_t *buf_len, unsigned size)
+H5Z__nbit_compress_one_nooptype(const unsigned char *data, size_t data_offset, unsigned char *buffer,
+ size_t *j, size_t *buf_len, unsigned size)
{
unsigned i; /* index */
size_t dat_len; /* dat_len is the number of bits to be copied in each data byte */
@@ -1420,7 +1400,7 @@ H5Z_nbit_compress_one_nooptype(unsigned char *data, size_t data_offset, unsigned
buffer[*j] |=
(unsigned char)((unsigned)(val >> (dat_len - *buf_len)) & ~((unsigned)(~0) << *buf_len));
dat_len -= *buf_len;
- H5Z_nbit_next_byte(j, buf_len);
+ H5Z__nbit_next_byte(j, buf_len);
if (dat_len == 0)
continue;
@@ -1430,8 +1410,8 @@ H5Z_nbit_compress_one_nooptype(unsigned char *data, size_t data_offset, unsigned
}
static void
-H5Z_nbit_compress_one_atomic(unsigned char *data, size_t data_offset, unsigned char *buffer, size_t *j,
- size_t *buf_len, const parms_atomic *p)
+H5Z__nbit_compress_one_atomic(unsigned char *data, size_t data_offset, unsigned char *buffer, size_t *j,
+ size_t *buf_len, const parms_atomic *p)
{
/* begin_i: the index of byte having first significant bit
end_i: the index of byte having last significant bit */
@@ -1450,8 +1430,8 @@ H5Z_nbit_compress_one_atomic(unsigned char *data, size_t data_offset, unsigned c
end_i = p->offset / 8;
for (k = (int)begin_i; k >= (int)end_i; k--)
- H5Z_nbit_compress_one_byte(data, data_offset, (unsigned)k, begin_i, end_i, buffer, j, buf_len, p,
- datatype_len);
+ H5Z__nbit_compress_one_byte(data, data_offset, (unsigned)k, begin_i, end_i, buffer, j, buf_len, p,
+ datatype_len);
}
else { /* big endian */
/* Sanity check */
@@ -1465,14 +1445,14 @@ H5Z_nbit_compress_one_atomic(unsigned char *data, size_t data_offset, unsigned c
end_i = ((unsigned)datatype_len - p->offset) / 8 - 1;
for (k = (int)begin_i; k <= (int)end_i; k++)
- H5Z_nbit_compress_one_byte(data, data_offset, (unsigned)k, begin_i, end_i, buffer, j, buf_len, p,
- datatype_len);
+ H5Z__nbit_compress_one_byte(data, data_offset, (unsigned)k, begin_i, end_i, buffer, j, buf_len, p,
+ datatype_len);
}
}
static void
-H5Z_nbit_compress_one_array(unsigned char *data, size_t data_offset, unsigned char *buffer, size_t *j,
- size_t *buf_len, const unsigned parms[], unsigned *parms_index)
+H5Z__nbit_compress_one_array(unsigned char *data, size_t data_offset, unsigned char *buffer, size_t *j,
+ size_t *buf_len, const unsigned parms[], unsigned *parms_index)
{
unsigned i, total_size, base_class, base_size, n, begin_index;
parms_atomic p;
@@ -1488,7 +1468,7 @@ H5Z_nbit_compress_one_array(unsigned char *data, size_t data_offset, unsigned ch
p.offset = parms[(*parms_index)++];
n = total_size / p.size;
for (i = 0; i < n; i++)
- H5Z_nbit_compress_one_atomic(data, data_offset + i * p.size, buffer, j, buf_len, &p);
+ H5Z__nbit_compress_one_atomic(data, data_offset + i * p.size, buffer, j, buf_len, &p);
break;
case H5Z_NBIT_ARRAY:
@@ -1496,8 +1476,8 @@ H5Z_nbit_compress_one_array(unsigned char *data, size_t data_offset, unsigned ch
n = total_size / base_size; /* number of base_type elements inside the array datatype */
begin_index = *parms_index;
for (i = 0; i < n; i++) {
- H5Z_nbit_compress_one_array(data, data_offset + i * base_size, buffer, j, buf_len, parms,
- parms_index);
+ H5Z__nbit_compress_one_array(data, data_offset + i * base_size, buffer, j, buf_len, parms,
+ parms_index);
*parms_index = begin_index;
}
break;
@@ -1507,15 +1487,15 @@ H5Z_nbit_compress_one_array(unsigned char *data, size_t data_offset, unsigned ch
n = total_size / base_size; /* number of base_type elements inside the array datatype */
begin_index = *parms_index;
for (i = 0; i < n; i++) {
- H5Z_nbit_compress_one_compound(data, data_offset + i * base_size, buffer, j, buf_len, parms,
- parms_index);
+ H5Z__nbit_compress_one_compound(data, data_offset + i * base_size, buffer, j, buf_len, parms,
+ parms_index);
*parms_index = begin_index;
}
break;
case H5Z_NBIT_NOOPTYPE:
(*parms_index)++; /* skip size of no-op type */
- H5Z_nbit_compress_one_nooptype(data, data_offset, buffer, j, buf_len, total_size);
+ H5Z__nbit_compress_one_nooptype(data, data_offset, buffer, j, buf_len, total_size);
break;
default:
@@ -1524,8 +1504,8 @@ H5Z_nbit_compress_one_array(unsigned char *data, size_t data_offset, unsigned ch
}
static void
-H5Z_nbit_compress_one_compound(unsigned char *data, size_t data_offset, unsigned char *buffer, size_t *j,
- size_t *buf_len, const unsigned parms[], unsigned *parms_index)
+H5Z__nbit_compress_one_compound(unsigned char *data, size_t data_offset, unsigned char *buffer, size_t *j,
+ size_t *buf_len, const unsigned parms[], unsigned *parms_index)
{
unsigned i, nmembers, member_offset, member_class, size;
parms_atomic p;
@@ -1543,22 +1523,22 @@ H5Z_nbit_compress_one_compound(unsigned char *data, size_t data_offset, unsigned
p.order = parms[(*parms_index)++];
p.precision = parms[(*parms_index)++];
p.offset = parms[(*parms_index)++];
- H5Z_nbit_compress_one_atomic(data, data_offset + member_offset, buffer, j, buf_len, &p);
+ H5Z__nbit_compress_one_atomic(data, data_offset + member_offset, buffer, j, buf_len, &p);
break;
case H5Z_NBIT_ARRAY:
- H5Z_nbit_compress_one_array(data, data_offset + member_offset, buffer, j, buf_len, parms,
- parms_index);
+ H5Z__nbit_compress_one_array(data, data_offset + member_offset, buffer, j, buf_len, parms,
+ parms_index);
break;
case H5Z_NBIT_COMPOUND:
- H5Z_nbit_compress_one_compound(data, data_offset + member_offset, buffer, j, buf_len, parms,
- parms_index);
+ H5Z__nbit_compress_one_compound(data, data_offset + member_offset, buffer, j, buf_len, parms,
+ parms_index);
break;
case H5Z_NBIT_NOOPTYPE:
size = parms[(*parms_index)++];
- H5Z_nbit_compress_one_nooptype(data, data_offset + member_offset, buffer, j, buf_len, size);
+ H5Z__nbit_compress_one_nooptype(data, data_offset + member_offset, buffer, j, buf_len, size);
break;
default:
@@ -1568,8 +1548,8 @@ H5Z_nbit_compress_one_compound(unsigned char *data, size_t data_offset, unsigned
}
static void
-H5Z_nbit_compress(unsigned char *data, unsigned d_nelmts, unsigned char *buffer, size_t *buffer_size,
- const unsigned parms[])
+H5Z__nbit_compress(unsigned char *data, unsigned d_nelmts, unsigned char *buffer, size_t *buffer_size,
+ const unsigned parms[])
{
/* i: index of data, new_size: index of buffer,
buf_len: number of bits to be filled in current byte */
@@ -1594,14 +1574,15 @@ H5Z_nbit_compress(unsigned char *data, unsigned d_nelmts, unsigned char *buffer,
p.offset = parms[7];
for (i = 0; i < d_nelmts; i++)
- H5Z_nbit_compress_one_atomic(data, i * p.size, buffer, &new_size, &buf_len, &p);
+ H5Z__nbit_compress_one_atomic(data, i * p.size, buffer, &new_size, &buf_len, &p);
break;
case H5Z_NBIT_ARRAY:
size = parms[4];
parms_index = 4;
for (i = 0; i < d_nelmts; i++) {
- H5Z_nbit_compress_one_array(data, i * size, buffer, &new_size, &buf_len, parms, &parms_index);
+ H5Z__nbit_compress_one_array(data, i * size, buffer, &new_size, &buf_len, parms,
+ &parms_index);
parms_index = 4;
}
break;
@@ -1610,8 +1591,8 @@ H5Z_nbit_compress(unsigned char *data, unsigned d_nelmts, unsigned char *buffer,
size = parms[4];
parms_index = 4;
for (i = 0; i < d_nelmts; i++) {
- H5Z_nbit_compress_one_compound(data, i * size, buffer, &new_size, &buf_len, parms,
- &parms_index);
+ H5Z__nbit_compress_one_compound(data, i * size, buffer, &new_size, &buf_len, parms,
+ &parms_index);
parms_index = 4;
}
break;
diff --git a/src/H5Zprivate.h b/src/H5Zprivate.h
index b90fafb..51690b4 100644
--- a/src/H5Zprivate.h
+++ b/src/H5Zprivate.h
@@ -26,6 +26,7 @@ typedef struct H5Z_filter_info_t H5Z_filter_info_t;
/* Private headers needed by this file */
#include "H5Tprivate.h" /* Datatypes */
+#include "H5Sprivate.h" /* Dataspace */
/**************************/
/* Library Private Macros */
@@ -86,6 +87,7 @@ H5_DLL herr_t H5Z_can_apply(hid_t dcpl_id, hid_t type_id);
H5_DLL herr_t H5Z_set_local(hid_t dcpl_id, hid_t type_id);
H5_DLL herr_t H5Z_can_apply_direct(const struct H5O_pline_t *pline);
H5_DLL herr_t H5Z_set_local_direct(const struct H5O_pline_t *pline);
+H5_DLL htri_t H5Z_ignore_filters(hid_t dcpl_id, const H5T_t *type, const H5S_t *space);
H5_DLL H5Z_filter_info_t *H5Z_filter_info(const struct H5O_pline_t *pline, H5Z_filter_t filter);
H5_DLL htri_t H5Z_filter_in_pline(const struct H5O_pline_t *pline, H5Z_filter_t filter);
H5_DLL htri_t H5Z_all_filters_avail(const struct H5O_pline_t *pline);
diff --git a/src/H5Zpublic.h b/src/H5Zpublic.h
index e829eb1..90277cf 100644
--- a/src/H5Zpublic.h
+++ b/src/H5Zpublic.h
@@ -21,111 +21,231 @@
/* Public headers needed by this file */
#include "H5public.h"
-/*
- * Filter identifiers. Values 0 through 255 are for filters defined by the
- * HDF5 library. Values 256 through 511 are available for testing new
- * filters. Subsequent values should be obtained from the HDF5 development
- * team at help@hdfgroup.org. These values will never change because they
- * appear in the HDF5 files.
+/**
+ * \brief Filter identifiers
+ *
+ * \details Values 0 through 255 are for filters defined by the HDF5 library.
+ * Values 256 through 511 are available for testing new filters.
+ * Subsequent values should be obtained from the HDF5 development team
+ * at mailto:help@hdfgroup.org. These values will never change because
+ * they appear in the HDF5 files.
*/
typedef int H5Z_filter_t;
/* Filter IDs */
-#define H5Z_FILTER_ERROR (-1) /*no filter */
-#define H5Z_FILTER_NONE 0 /*reserved indefinitely */
-#define H5Z_FILTER_DEFLATE 1 /*deflation like gzip */
-#define H5Z_FILTER_SHUFFLE 2 /*shuffle the data */
-#define H5Z_FILTER_FLETCHER32 3 /*fletcher32 checksum of EDC */
-#define H5Z_FILTER_SZIP 4 /*szip compression */
-#define H5Z_FILTER_NBIT 5 /*nbit compression */
-#define H5Z_FILTER_SCALEOFFSET 6 /*scale+offset compression */
-#define H5Z_FILTER_RESERVED 256 /*filter ids below this value are reserved for library use */
-
-#define H5Z_FILTER_MAX 65535 /*maximum filter id */
+/**
+ * no filter
+ */
+#define H5Z_FILTER_ERROR (-1)
+/**
+ * reserved indefinitely
+ */
+#define H5Z_FILTER_NONE 0
+/**
+ * deflation like gzip
+ */
+#define H5Z_FILTER_DEFLATE 1
+/**
+ * shuffle the data
+ */
+#define H5Z_FILTER_SHUFFLE 2
+/**
+ * fletcher32 checksum of EDC
+ */
+#define H5Z_FILTER_FLETCHER32 3
+/**
+ * szip compression
+ */
+#define H5Z_FILTER_SZIP 4
+/**
+ * nbit compression
+ */
+#define H5Z_FILTER_NBIT 5
+/**
+ * scale+offset compression
+ */
+#define H5Z_FILTER_SCALEOFFSET 6
+/**
+ * filter ids below this value are reserved for library use
+ */
+#define H5Z_FILTER_RESERVED 256
+/**
+ * maximum filter id
+ */
+#define H5Z_FILTER_MAX 65535
/* General macros */
-#define H5Z_FILTER_ALL 0 /* Symbol to remove all filters in H5Premove_filter */
-#define H5Z_MAX_NFILTERS 32 /* Maximum number of filters allowed in a pipeline */
- /* (should probably be allowed to be an
- * unlimited amount, but currently each
- * filter uses a bit in a 32-bit field,
- * so the format would have to be
- * changed to accommodate that)
- */
+/**
+ * Symbol to remove all filters in H5Premove_filter()
+ */
+#define H5Z_FILTER_ALL 0
+/**
+ * Maximum number of filters allowed in a pipeline
+ *
+ * \internal (should probably be allowed to be an unlimited amount, but
+ * currently each filter uses a bit in a 32-bit field, so the format
+ * would have to be changed to accommodate that)
+ */
+#define H5Z_MAX_NFILTERS 32
/* Flags for filter definition (stored) */
-#define H5Z_FLAG_DEFMASK 0x00ff /*definition flag mask */
-#define H5Z_FLAG_MANDATORY 0x0000 /*filter is mandatory */
-#define H5Z_FLAG_OPTIONAL 0x0001 /*filter is optional */
+/**
+ * definition flag mask
+ */
+#define H5Z_FLAG_DEFMASK 0x00ff
+/**
+ * filter is mandatory
+ */
+#define H5Z_FLAG_MANDATORY 0x0000
+/**
+ * filter is optional
+ */
+#define H5Z_FLAG_OPTIONAL 0x0001
/* Additional flags for filter invocation (not stored) */
-#define H5Z_FLAG_INVMASK 0xff00 /*invocation flag mask */
-#define H5Z_FLAG_REVERSE 0x0100 /*reverse direction; read */
-#define H5Z_FLAG_SKIP_EDC 0x0200 /*skip EDC filters for read */
+/**
+ * invocation flag mask
+ */
+#define H5Z_FLAG_INVMASK 0xff00
+/**
+ * reverse direction; read
+ */
+#define H5Z_FLAG_REVERSE 0x0100
+/**
+ * skip EDC filters for read
+ */
+#define H5Z_FLAG_SKIP_EDC 0x0200
/* Special parameters for szip compression */
/* [These are aliases for the similar definitions in szlib.h, which we can't
* include directly due to the duplication of various symbols with the zlib.h
* header file] */
+/**
+ * \ingroup SZIP */
#define H5_SZIP_ALLOW_K13_OPTION_MASK 1
-#define H5_SZIP_CHIP_OPTION_MASK 2
-#define H5_SZIP_EC_OPTION_MASK 4
-#define H5_SZIP_NN_OPTION_MASK 32
-#define H5_SZIP_MAX_PIXELS_PER_BLOCK 32
+/**
+ * \ingroup SZIP */
+#define H5_SZIP_CHIP_OPTION_MASK 2
+/**
+ * \ingroup SZIP */
+#define H5_SZIP_EC_OPTION_MASK 4
+/**
+ * \ingroup SZIP */
+#define H5_SZIP_NN_OPTION_MASK 32
+/**
+ * \ingroup SZIP */
+#define H5_SZIP_MAX_PIXELS_PER_BLOCK 32
/* Macros for the shuffle filter */
-#define H5Z_SHUFFLE_USER_NPARMS 0 /* Number of parameters that users can set */
-#define H5Z_SHUFFLE_TOTAL_NPARMS 1 /* Total number of parameters for filter */
+/**
+ * \ingroup SHUFFLE
+ * Number of parameters that users can set for the shuffle filter
+ */
+#define H5Z_SHUFFLE_USER_NPARMS 0
+/**
+ * \ingroup SHUFFLE
+ * Total number of parameters for the shuffle filter
+ */
+#define H5Z_SHUFFLE_TOTAL_NPARMS 1
/* Macros for the szip filter */
-#define H5Z_SZIP_USER_NPARMS 2 /* Number of parameters that users can set */
-#define H5Z_SZIP_TOTAL_NPARMS 4 /* Total number of parameters for filter */
-#define H5Z_SZIP_PARM_MASK 0 /* "User" parameter for option mask */
-#define H5Z_SZIP_PARM_PPB 1 /* "User" parameter for pixels-per-block */
-#define H5Z_SZIP_PARM_BPP 2 /* "Local" parameter for bits-per-pixel */
-#define H5Z_SZIP_PARM_PPS 3 /* "Local" parameter for pixels-per-scanline */
+/**
+ * \ingroup SZIP
+ * Number of parameters that users can set for SZIP
+ */
+#define H5Z_SZIP_USER_NPARMS 2
+/**
+ * \ingroup SZIP
+ * Total number of parameters for SZIP filter
+ */
+#define H5Z_SZIP_TOTAL_NPARMS 4
+/**
+ * \ingroup SZIP
+ * "User" parameter for option mask
+ */
+#define H5Z_SZIP_PARM_MASK 0
+/**
+ * \ingroup SZIP
+ * "User" parameter for pixels-per-block
+ */
+#define H5Z_SZIP_PARM_PPB 1
+/**
+ * \ingroup SZIP
+ * "Local" parameter for bits-per-pixel
+ */
+#define H5Z_SZIP_PARM_BPP 2
+/**
+ * \ingroup SZIP
+ * "Local" parameter for pixels-per-scanline
+ */
+#define H5Z_SZIP_PARM_PPS 3
/* Macros for the nbit filter */
+/**
+ * \ingroup NBIT
+ * Number of parameters that users can set for the N-bit filter
+ */
#define H5Z_NBIT_USER_NPARMS 0 /* Number of parameters that users can set */
/* Macros for the scale offset filter */
-#define H5Z_SCALEOFFSET_USER_NPARMS 2 /* Number of parameters that users can set */
+/**
+ * \ingroup SCALEOFFSET
+ * Number of parameters that users can set for the scale-offset filter
+ */
+#define H5Z_SCALEOFFSET_USER_NPARMS 2
/* Special parameters for ScaleOffset filter*/
+/**
+ * \ingroup SCALEOFFSET */
#define H5Z_SO_INT_MINBITS_DEFAULT 0
+/**
+ * \ingroup SCALEOFFSET */
typedef enum H5Z_SO_scale_type_t {
H5Z_SO_FLOAT_DSCALE = 0,
H5Z_SO_FLOAT_ESCALE = 1,
H5Z_SO_INT = 2
} H5Z_SO_scale_type_t;
-/* Current version of the H5Z_class_t struct */
+/**
+ * Current version of the H5Z_class_t struct
+ */
#define H5Z_CLASS_T_VERS (1)
-/* Values to decide if EDC is enabled for reading data */
+/**
+ * \ingroup FLETCHER32
+ * Values to decide if EDC is enabled for reading data
+ */
typedef enum H5Z_EDC_t {
- H5Z_ERROR_EDC = -1, /* error value */
+ H5Z_ERROR_EDC = -1, /**< error value */
H5Z_DISABLE_EDC = 0,
H5Z_ENABLE_EDC = 1,
- H5Z_NO_EDC = 2 /* must be the last */
+ H5Z_NO_EDC = 2 /**< sentinel */
} H5Z_EDC_t;
/* Bit flags for H5Zget_filter_info */
#define H5Z_FILTER_CONFIG_ENCODE_ENABLED (0x0001)
#define H5Z_FILTER_CONFIG_DECODE_ENABLED (0x0002)
-/* Return values for filter callback function */
+/**
+ * Return values for filter callback function
+ */
typedef enum H5Z_cb_return_t {
- H5Z_CB_ERROR = -1,
- H5Z_CB_FAIL = 0, /* I/O should fail if filter fails. */
- H5Z_CB_CONT = 1, /* I/O continues if filter fails. */
- H5Z_CB_NO = 2
+ H5Z_CB_ERROR = -1, /**< error value */
+ H5Z_CB_FAIL = 0, /**< I/O should fail if filter fails. */
+ H5Z_CB_CONT = 1, /**< I/O continues if filter fails. */
+ H5Z_CB_NO = 2 /**< sentinel */
} H5Z_cb_return_t;
-/* Filter callback function definition */
+//! <!-- [H5Z_filter_func_t_snip] -->
+/**
+ * Filter callback function definition
+ */
typedef H5Z_cb_return_t (*H5Z_filter_func_t)(H5Z_filter_t filter, void *buf, size_t buf_size, void *op_data);
+//! <!-- [H5Z_filter_func_t_snip] -->
-/* Structure for filter callback property */
+/**
+ * Structure for filter callback property
+ */
typedef struct H5Z_cb_t {
H5Z_filter_func_t func;
void * op_data;
@@ -135,87 +255,411 @@ typedef struct H5Z_cb_t {
extern "C" {
#endif
-/*
- * Before a dataset gets created, the "can_apply" callbacks for any filters used
- * in the dataset creation property list are called
- * with the dataset's dataset creation property list, the dataset's datatype and
- * a dataspace describing a chunk (for chunked dataset storage).
+/**
+ * \brief This callback determines if a filter can be applied to the dataset
+ * with the characteristics provided
+ *
+ * \dcpl_id
+ * \type_id
+ * \space_id
+ *
+ * \return \htri_t
*
- * The "can_apply" callback must determine if the combination of the dataset
- * creation property list setting, the datatype and the dataspace represent a
- * valid combination to apply this filter to. For example, some cases of
- * invalid combinations may involve the filter not operating correctly on
- * certain datatypes (or certain datatype sizes), or certain sizes of the chunk
- * dataspace.
+ * \details Before a dataset gets created, the \ref H5Z_can_apply_func_t
+ * callbacks for any filters used in the dataset creation property list
+ * are called with the dataset's dataset creation property list, the
+ * dataset's datatype and a dataspace describing a chunk (for chunked
+ * dataset storage).
*
- * The "can_apply" callback can be the NULL pointer, in which case, the library
- * will assume that it can apply to any combination of dataset creation
- * property list values, datatypes and dataspaces.
+ * The \ref H5Z_can_apply_func_t callback must determine if the
+ * combination of the dataset creation property list setting, the
+ * datatype and the dataspace represent a valid combination to apply
+ * this filter to. For example, some cases of invalid combinations may
+ * involve the filter not operating correctly on certain datatypes (or
+ * certain datatype sizes), or certain sizes of the chunk dataspace.
*
- * The "can_apply" callback returns positive a valid combination, zero for an
- * invalid combination and negative for an error.
+ * The \ref H5Z_can_apply_func_t callback can be the NULL pointer, in
+ * which case, the library will assume that it can apply to any
+ * combination of dataset creation property list values, datatypes and
+ * dataspaces.
+ *
+ * The \ref H5Z_can_apply_func_t callback returns positive a valid
+ * combination, zero for an invalid combination and negative for an
+ * error.
*/
+//! <!-- [H5Z_can_apply_func_t_snip] -->
typedef htri_t (*H5Z_can_apply_func_t)(hid_t dcpl_id, hid_t type_id, hid_t space_id);
-
-/*
- * After the "can_apply" callbacks are checked for new datasets, the "set_local"
- * callbacks for any filters used in the dataset creation property list are
- * called. These callbacks receive the dataset's private copy of the dataset
- * creation property list passed in to H5Dcreate (i.e. not the actual property
- * list passed in to H5Dcreate) and the datatype ID passed in to H5Dcreate
- * (which is not copied and should not be modified) and a dataspace describing
- * the chunk (for chunked dataset storage) (which should also not be modified).
+//! <!-- [H5Z_can_apply_func_t_snip] -->
+/**
+ * \brief The filter operation callback function, defining a filter's operation
+ * on data
+ *
+ * \dcpl_id
+ * \type_id
+ * \space_id
*
- * The "set_local" callback must set any parameters that are specific to this
- * dataset, based on the combination of the dataset creation property list
- * values, the datatype and the dataspace. For example, some filters perform
- * different actions based on different datatypes (or datatype sizes) or
- * different number of dimensions or dataspace sizes.
+ * \return \herr_t
*
- * The "set_local" callback can be the NULL pointer, in which case, the library
- * will assume that there are no dataset-specific settings for this filter.
+ * \details After the \ref H5Z_can_apply_func_t callbacks are checked for new
+ * datasets, the \ref H5Z_set_local_func_t callbacks for any filters
+ * used in the dataset creation property list are called. These
+ * callbacks receive the dataset's private copy of the dataset creation
+ * property list passed in to H5Dcreate() (i.e. not the actual property
+ * list passed in to H5Dcreate()) and the datatype ID passed in to
+ * H5Dcreate() (which is not copied and should not be modified) and a
+ * dataspace describing the chunk (for chunked dataset storage) (which
+ * should also not be modified).
*
- * The "set_local" callback must return non-negative on success and negative
- * for an error.
+ * The \ref H5Z_set_local_func_t callback must set any parameters that
+ * are specific to this dataset, based on the combination of the
+ * dataset creation property list values, the datatype and the
+ * dataspace. For example, some filters perform different actions based
+ * on different datatypes (or datatype sizes) or different number of
+ * dimensions or dataspace sizes.
+ *
+ * The \ref H5Z_set_local_func_t callback can be the NULL pointer, in
+ * which case, the library will assume that there are no
+ * dataset-specific settings for this filter.
+ *
+ * The \ref H5Z_set_local_func_t callback must return non-negative on
+ * success and negative for an error.
*/
+//! <!-- [H5Z_set_local_func_t_snip] -->
typedef herr_t (*H5Z_set_local_func_t)(hid_t dcpl_id, hid_t type_id, hid_t space_id);
+//! <!-- [H5Z_set_local_func_t_snip] -->
-/*
- * A filter gets definition flags and invocation flags (defined above), the
- * client data array and size defined when the filter was added to the
- * pipeline, the size in bytes of the data on which to operate, and pointers
- * to a buffer and its allocated size.
+/**
+ * \brief The filter operation callback function, defining a filter's operation
+ * on data
+ *
+ * \param[in] flags Bit vector specifying certain general properties of the filter
+ * \param[in] cd_nelmts Number of elements in \p cd_values
+ * \param[in] cd_values Auxiliary data for the filter
+ * \param[in] nbytes The number of valid bytes in \p buf to be filtered
+ * \param[in,out] buf_size The size of \p buf
+ * \param[in,out] buf The filter buffer
+ *
+ * \return Returns the number of valid bytes of data contained in \p buf. In the
+ * case of failure, the return value is 0 (zero) and all pointer
+ * arguments are left unchanged.
*
- * The filter should store the result in the supplied buffer if possible,
- * otherwise it can allocate a new buffer, freeing the original. The
- * allocated size of the new buffer should be returned through the BUF_SIZE
- * pointer and the new buffer through the BUF pointer.
+ * \details A filter gets definition flags and invocation flags (defined
+ * above), the client data array and size defined when the filter was
+ * added to the pipeline, the size in bytes of the data on which to
+ * operate, and pointers to a buffer and its allocated size.
*
- * The return value from the filter is the number of bytes in the output
- * buffer. If an error occurs then the function should return zero and leave
- * all pointer arguments unchanged.
+ * The filter should store the result in the supplied buffer if
+ * possible, otherwise it can allocate a new buffer, freeing the
+ * original. The allocated size of the new buffer should be returned
+ * through the \p buf_size pointer and the new buffer through the \p
+ * buf pointer.
+ *
+ * The return value from the filter is the number of bytes in the
+ * output buffer. If an error occurs then the function should return
+ * zero and leave all pointer arguments unchanged.
*/
+//! <!-- [H5Z_func_t_snip] -->
typedef size_t (*H5Z_func_t)(unsigned int flags, size_t cd_nelmts, const unsigned int cd_values[],
size_t nbytes, size_t *buf_size, void **buf);
-
-/*
+//! <!-- [H5Z_func_t_snip] -->
+/**
* The filter table maps filter identification numbers to structs that
* contain a pointers to the filter function and timing statistics.
*/
+//! <!-- [H5Z_class2_t_snip] -->
typedef struct H5Z_class2_t {
- int version; /* Version number of the H5Z_class_t struct */
- H5Z_filter_t id; /* Filter ID number */
- unsigned encoder_present; /* Does this filter have an encoder? */
- unsigned decoder_present; /* Does this filter have a decoder? */
- const char * name; /* Comment for debugging */
- H5Z_can_apply_func_t can_apply; /* The "can apply" callback for a filter */
- H5Z_set_local_func_t set_local; /* The "set local" callback for a filter */
- H5Z_func_t filter; /* The actual filter function */
+ int version; /**< Version number of the H5Z_class_t struct */
+ H5Z_filter_t id; /**< Filter ID number */
+ unsigned encoder_present; /**< Does this filter have an encoder? */
+ unsigned decoder_present; /**< Does this filter have a decoder? */
+ const char * name; /**< Comment for debugging */
+ H5Z_can_apply_func_t can_apply; /**< The "can apply" callback for a filter */
+ H5Z_set_local_func_t set_local; /**< The "set local" callback for a filter */
+ H5Z_func_t filter; /**< The actual filter function */
} H5Z_class2_t;
+//! <!-- [H5Z_class2_t_snip] -->
+/**
+ * \ingroup H5Z
+ *
+ * \brief Registers a new filter with the HDF5 library
+ *
+ * \param[in] cls A pointer to a buffer for the struct containing the
+ * filter-definition
+ *
+ * \return \herr_t
+ *
+ * \details H5Zregister() registers a new filter with the HDF5 library.
+ *
+ * \details Making a new filter available to an application is a two-step
+ * process. The first step is to write the three filter callback
+ * functions described below: \c can_apply, \c set_local, and \c
+ * filter. This call to H5Zregister(), registering the filter with the
+ * library, is the second step. The can_apply and set_local fields can
+ * be set to NULL if they are not required for the filter being
+ * registered.
+ *
+ * H5Zregister() accepts a single parameter, a pointer to a buffer for
+ * the \p cls data structure. That data structure must conform to one
+ * of the following definitions:
+ * \snippet this H5Z_class1_t_snip
+ * or
+ * \snippet this H5Z_class2_t_snip
+ *
+ * \c version is a library-defined value reporting the version number
+ * of the #H5Z_class_t struct. This currently must be set to
+ * #H5Z_CLASS_T_VERS.
+ *
+ * \c id is the identifier for the new filter. This is a user-defined
+ * value between #H5Z_FILTER_RESERVED and #H5Z_FILTER_MAX. These
+ * values are defined in the HDF5 source file H5Zpublic.h, but the
+ * symbols #H5Z_FILTER_RESERVED and #H5Z_FILTER_MAX should always be
+ * used instead of the literal values.
+ *
+ * \c encoder_present is a library-defined value indicating whether
+ * the filter’s encoding capability is available to the application.
+ *
+ * \c decoder_present is a library-defined value indicating whether
+ * the filter’s encoding capability is available to the application.
+ *
+ * \c name is a descriptive comment used for debugging, may contain a
+ * descriptive name for the filter, and may be the null pointer.
+ *
+ * \c can_apply, described in detail below, is a user-defined callback
+ * function which determines whether the combination of the dataset
+ * creation property list values, the datatype, and the dataspace
+ * represent a valid combination to apply this filter to.
+ *
+ * \c set_local, described in detail below, is a user-defined callback
+ * function which sets any parameters that are specific to this
+ * dataset, based on the combination of the dataset creation property
+ * list values, the datatype, and the dataspace.
+ *
+ * \c filter, described in detail below, is a user-defined callback
+ * function which performs the action of the filter.
+ *
+ * The statistics associated with a filter are not reset by this
+ * function; they accumulate over the life of the library.
+ *
+ * #H5Z_class_t is a macro which maps to either H5Z_class1_t or
+ * H5Z_class2_t, depending on the needs of the application. To affect
+ * only this macro, H5Z_class_t_vers may be defined to either 1 or 2.
+ * Otherwise, it will behave in the same manner as other API
+ * compatibility macros. See API Compatibility Macros in HDF5 for more
+ * information. H5Z_class1_t matches the #H5Z_class_t structure that is
+ * used in the 1.6.x versions of the HDF5 library.
+ *
+ * H5Zregister() will automatically detect which structure type has
+ * been passed in, regardless of the mapping of the #H5Z_class_t macro.
+ * However, the application must make sure that the fields are filled
+ * in according to the correct structure definition if the macro is
+ * used to declare the structure.
+ *
+ * \Bold{The callback functions:}\n Before H5Zregister() can link a
+ * filter into an application, three callback functions must be
+ * defined as described in the HDF5 library header file H5Zpublic.h.
+ *
+ * When a filter is applied to the fractal heap for a group (e.g.,
+ * when compressing group metadata) and if the can apply and set local
+ * callback functions have been defined for that filter, HDF5 passes
+ * the value -1 for all parameters for those callback functions. This
+ * is done to ensure that the filter will not be applied to groups if
+ * it relies on these parameters, as they are not applicable to group
+ * fractal heaps; to operate on group fractal heaps, a filter must be
+ * capable of operating on an opaque block of binary data.
+ *
+ * The \Emph{can apply} callback function must return a positive value
+ * for a valid combination, zero for an invalid combination, and a
+ * negative value for an error.
+ * \snippet this H5Z_can_apply_func_t_snip
+ *
+ * Before a dataset is created, the \Emph{can apply} callbacks for any
+ * filters used in the dataset creation property list are called with
+ * the dataset's dataset creation property list, \c dcpl_id, the
+ * dataset's datatype, \p type_id, and a dataspace describing a chunk,
+ * \p space_id, (for chunked dataset storage).
+ *
+ * This callback must determine whether the combination of the dataset
+ * creation property list settings, the datatype, and the dataspace
+ * represent a valid combination to which to apply this filter. For
+ * example, an invalid combination may involve the filter not
+ * operating correctly on certain datatypes, on certain datatype
+ * sizes, or on certain sizes of the chunk dataspace. If this filter
+ * is enabled through H5Pset_filter() as optional and the can apply
+ * function returns 0, the library will skip the filter in the filter
+ * pipeline.
+ *
+ * This callback can be the NULL pointer, in which case the library
+ * will assume that the filter can be applied to a dataset with any
+ * combination of dataset creation property list values, datatypes,
+ * and dataspaces.
+ *
+ * The \Emph{set local} callback function is defined as follows:
+ * \snippet this H5Z_set_local_func_t_snip
+ *
+ * After the can apply callbacks are checked for a new dataset, the
+ * \Emph{set local} callback functions for any filters used in the
+ * dataset creation property list are called. These callbacks receive
+ * \c dcpl_id, the dataset's private copy of the dataset creation
+ * property list passed in to H5Dcreate() (i.e. not the actual
+ * property list passed in to H5Dcreate()); \c type_id, the datatype
+ * identifier passed in to H5Dcreate(), which is not copied and should
+ * not be modified; and \c space_id, a dataspace describing the chunk
+ * (for chunked dataset storage), which should also not be modified.
+ *
+ * The set local callback must set any filter parameters that are
+ * specific to this dataset, based on the combination of the dataset
+ * creation property list values, the datatype, and the dataspace. For
+ * example, some filters perform different actions based on different
+ * datatypes, datatype sizes, numbers of dimensions, or dataspace
+ * sizes.
+ *
+ * The \Emph{set local} callback may be the NULL pointer, in which
+ * case, the library will assume that there are no dataset-specific
+ * settings for this filter.
+ *
+ * The \Emph{set local} callback function must return a non-negative
+ * value on success and a negative value for an error.
+ *
+ * The \Emph{filter operation} callback function, defining the
+ * filter's operation on the data, is defined as follows:
+ * \snippet this H5Z_func_t_snip
+ *
+ * The parameters \c flags, \c cd_nelmts, and \c cd_values are the
+ * same as for the function H5Pset_filter(). The one exception is that
+ * an additional flag, #H5Z_FLAG_REVERSE, is set when the filter is
+ * called as part of the input pipeline.
+ *
+ * The parameter \c buf points to the input buffer which has a size of
+ * \c buf_size bytes, \c nbytes of which are valid data.
+ *
+ * The filter should perform the transformation in place if possible.
+ * If the transformation cannot be done in place, then the filter
+ * should allocate a new buffer with malloc() and assign it to \c buf,
+ * assigning the allocated size of that buffer to \c buf_size. The old
+ * buffer should be freed by calling free().
+ *
+ * If successful, the \Emph{filter operation} callback function
+ * returns the number of valid bytes of data contained in \c buf. In
+ * the case of failure, the return value is 0 (zero) and all pointer
+ * arguments are left unchanged.
+ *
+ * \version 1.8.6 Return type for the \Emph{can apply} callback function,
+ * \ref H5Z_can_apply_func_t, changed to \ref htri_t.
+ * \version 1.8.5 Semantics of the \Emph{can apply} and \Emph{set local}
+ * callback functions changed to accommodate the use of filters
+ * with group fractal heaps.
+ * \version 1.8.3 #H5Z_class_t renamed to H5Z_class2_t, H5Z_class1_t structure
+ * introduced for backwards compatibility with release 1.6.x,
+ * and #H5Z_class_t macro introduced in this release. Function
+ * modified to accept either structure type.
+ * \version 1.8.0 The fields \c version, \c encoder_present, and
+ * \c decoder_present were added to the #H5Z_class_t \c struct
+ * in this release.
+ * \version 1.6.0 This function was substantially revised in Release 1.6.0 with
+ * a new #H5Z_class_t struct and new set local and can apply
+ * callback functions.
+ *
+ */
H5_DLL herr_t H5Zregister(const void *cls);
+/**
+ * \ingroup H5Z
+ *
+ * \brief Unregisters a filter.
+ *
+ * \param[in] id Identifier of the filter to be unregistered.
+ * \return \herr_t
+ *
+ * \details H5Zunregister() unregisters the filter specified in \p id.
+ *
+ * \details This function first iterates through all opened datasets and
+ * groups. If an open object that uses this filter is found, the
+ * function will fail with a message indicating that an object using
+ * the filter is still open. All open files are then flushed to make
+ * sure that all cached data that may use this filter are written out.
+ *
+ * If the application is a parallel program, all processes that
+ * participate in collective data write should call this function to
+ * ensure that all data is flushed.
+ *
+ * After a call to H5Zunregister(), the filter specified in filter
+ * will no longer be available to the application.
+ *
+ * \version 1.8.12 Function modified to check for open objects using the
+ * filter.
+ * \since 1.6.0
+ */
H5_DLL herr_t H5Zunregister(H5Z_filter_t id);
+/**
+ * \ingroup H5Z
+ *
+ * \brief Determines whether a filter is available
+ *
+ * \param[in] id Filter identifier
+ * \return \htri_t
+ *
+ * \details H5Zfilter_avail() determines whether the filter specified in \p id
+ * is available to the application.
+ *
+ * \since 1.6.0
+ */
H5_DLL htri_t H5Zfilter_avail(H5Z_filter_t id);
+/**
+ * \ingroup H5Z
+ *
+ * \brief Retrieves information about a filter
+ *
+ * \param[in] filter Filter identifier
+ * \param[out] filter_config_flags A bit field encoding the returned filter
+ * information
+ * \return \herr_t
+ *
+ * \details H5Zget_filter_info() retrieves information about a filter. At
+ * present, this means that the function retrieves a filter's
+ * configuration flags, indicating whether the filter is configured to
+ * decode data, to encode data, neither, or both.
+ *
+ * If \p filter_config_flags is not set to NULL prior to the function
+ * call, the returned parameter contains a bit field specifying the
+ * available filter configuration. The configuration flag values can
+ * then be determined through a series of bitwise AND operations, as
+ * described below.
+ *
+ * Valid filter configuration flags include the following:
+ * <table>
+ * <tr><td>#H5Z_FILTER_CONFIG_ENCODE_ENABLED</td>
+ * <td>Encoding is enabled for this filter</td></tr>
+ * <tr><td>#H5Z_FILTER_CONFIG_DECODE_ENABLED</td>
+ * <td>Decoding is enabled for this filter</td></tr>
+ * </table>
+ *
+ * A bitwise AND of the returned \p filter_config_flags and a valid
+ * filter configuration flag will reveal whether the related
+ * configuration option is available. For example, if the value of
+ * \code
+ * H5Z_FILTER_CONFIG_ENCODE_ENABLED & filter_config_flags
+ * \endcode
+ * is true, i.e., greater than 0 (zero), the queried filter
+ * is configured to encode data; if the value is \c FALSE, i.e., equal to
+ * 0 (zero), the filter is not so configured.
+ *
+ * If a filter is not encode-enabled, the corresponding \c H5Pset_*
+ * function will return an error if the filter is added to a dataset
+ * creation property list (which is required if the filter is to be
+ * used to encode that dataset). For example, if the
+ * #H5Z_FILTER_CONFIG_ENCODE_ENABLED flag is not returned for the SZIP
+ * filter, #H5Z_FILTER_SZIP, a call to H5Pset_szip() will fail.
+ *
+ * If a filter is not decode-enabled, the application will not be able
+ * to read an existing file encoded with that filter.
+ *
+ * This function should be called, and the returned \p
+ * filter_config_flags analyzed, before calling any other function,
+ * such as H5Pset_szip() , that might require a particular filter
+ * configuration.
+ *
+ * \since 1.6.3
+ */
H5_DLL herr_t H5Zget_filter_info(H5Z_filter_t filter, unsigned int *filter_config_flags);
/* Symbols defined for compatibility with previous versions of the HDF5 API.
@@ -224,17 +668,19 @@ H5_DLL herr_t H5Zget_filter_info(H5Z_filter_t filter, unsigned int *filter_confi
*/
#ifndef H5_NO_DEPRECATED_SYMBOLS
-/*
+/**
* The filter table maps filter identification numbers to structs that
* contain a pointers to the filter function and timing statistics.
*/
+//! <!-- [H5Z_class1_t_snip] -->
typedef struct H5Z_class1_t {
- H5Z_filter_t id; /* Filter ID number */
- const char * name; /* Comment for debugging */
- H5Z_can_apply_func_t can_apply; /* The "can apply" callback for a filter */
- H5Z_set_local_func_t set_local; /* The "set local" callback for a filter */
- H5Z_func_t filter; /* The actual filter function */
+ H5Z_filter_t id; /**< Filter ID number */
+ const char * name; /**< Comment for debugging */
+ H5Z_can_apply_func_t can_apply; /**< The "can apply" callback for a filter */
+ H5Z_set_local_func_t set_local; /**< The "set local" callback for a filter */
+ H5Z_func_t filter; /**< The actual filter function */
} H5Z_class1_t;
+//! <!-- [H5Z_class1_t_snip] -->
#endif /* H5_NO_DEPRECATED_SYMBOLS */
diff --git a/src/H5Zscaleoffset.c b/src/H5Zscaleoffset.c
index 6577f73..5310f7d 100644
--- a/src/H5Zscaleoffset.c
+++ b/src/H5Zscaleoffset.c
@@ -48,57 +48,57 @@ enum H5Z_scaleoffset_t {
};
/* Local function prototypes */
-static htri_t H5Z_can_apply_scaleoffset(hid_t dcpl_id, hid_t type_id, hid_t space_id);
-static enum H5Z_scaleoffset_t H5Z_scaleoffset_get_type(unsigned dtype_class, unsigned dtype_size,
- unsigned dtype_sign);
-static herr_t H5Z_scaleoffset_set_parms_fillval(H5P_genplist_t *dcpl_plist, H5T_t *type,
- enum H5Z_scaleoffset_t scale_type, unsigned cd_values[],
- int need_convert);
-static herr_t H5Z_set_local_scaleoffset(hid_t dcpl_id, hid_t type_id, hid_t space_id);
-static size_t H5Z_filter_scaleoffset(unsigned flags, size_t cd_nelmts, const unsigned cd_values[],
- size_t nbytes, size_t *buf_size, void **buf);
-static void H5Z_scaleoffset_convert(void *buf, unsigned d_nelmts, unsigned dtype_size);
-static H5_ATTR_CONST unsigned H5Z_scaleoffset_log2(unsigned long long num);
-static void H5Z_scaleoffset_precompress_i(void *data, unsigned d_nelmts, enum H5Z_scaleoffset_t type,
- unsigned filavail, const unsigned cd_values[], uint32_t *minbits,
- unsigned long long *minval);
-static void H5Z_scaleoffset_postdecompress_i(void *data, unsigned d_nelmts, enum H5Z_scaleoffset_t type,
- unsigned filavail, const unsigned cd_values[], uint32_t minbits,
- unsigned long long minval);
-static herr_t H5Z_scaleoffset_precompress_fd(void *data, unsigned d_nelmts, enum H5Z_scaleoffset_t type,
+static htri_t H5Z__can_apply_scaleoffset(hid_t dcpl_id, hid_t type_id, hid_t space_id);
+static enum H5Z_scaleoffset_t H5Z__scaleoffset_get_type(unsigned dtype_class, unsigned dtype_size,
+ unsigned dtype_sign);
+static herr_t H5Z__scaleoffset_set_parms_fillval(H5P_genplist_t *dcpl_plist, H5T_t *type,
+ enum H5Z_scaleoffset_t scale_type, unsigned cd_values[],
+ int need_convert);
+static herr_t H5Z__set_local_scaleoffset(hid_t dcpl_id, hid_t type_id, hid_t space_id);
+static size_t H5Z__filter_scaleoffset(unsigned flags, size_t cd_nelmts, const unsigned cd_values[],
+ size_t nbytes, size_t *buf_size, void **buf);
+static void H5Z__scaleoffset_convert(void *buf, unsigned d_nelmts, unsigned dtype_size);
+static H5_ATTR_CONST unsigned H5Z__scaleoffset_log2(unsigned long long num);
+static void H5Z__scaleoffset_precompress_i(void *data, unsigned d_nelmts, enum H5Z_scaleoffset_t type,
unsigned filavail, const unsigned cd_values[], uint32_t *minbits,
- unsigned long long *minval, double D_val);
-static herr_t H5Z_scaleoffset_postdecompress_fd(void *data, unsigned d_nelmts, enum H5Z_scaleoffset_t type,
- unsigned filavail, const unsigned cd_values[],
- uint32_t minbits, unsigned long long minval, double D_val);
-static void H5Z_scaleoffset_next_byte(size_t *j, unsigned *buf_len);
-static void H5Z_scaleoffset_decompress_one_byte(unsigned char *data, size_t data_offset, unsigned k,
- unsigned begin_i, unsigned char *buffer, size_t *j,
- unsigned *buf_len, parms_atomic p, unsigned dtype_len);
-static void H5Z_scaleoffset_compress_one_byte(unsigned char *data, size_t data_offset, unsigned k,
- unsigned begin_i, unsigned char *buffer, size_t *j,
- unsigned *buf_len, parms_atomic p, unsigned dtype_len);
-static void H5Z_scaleoffset_decompress_one_atomic(unsigned char *data, size_t data_offset,
- unsigned char *buffer, size_t *j, unsigned *buf_len,
- parms_atomic p);
-static void H5Z_scaleoffset_compress_one_atomic(unsigned char *data, size_t data_offset,
- unsigned char *buffer, size_t *j, unsigned *buf_len,
- parms_atomic p);
-static void H5Z_scaleoffset_decompress(unsigned char *data, unsigned d_nelmts, unsigned char *buffer,
- parms_atomic p);
-static void H5Z_scaleoffset_compress(unsigned char *data, unsigned d_nelmts, unsigned char *buffer,
- size_t buffer_size, parms_atomic p);
+ unsigned long long *minval);
+static void H5Z__scaleoffset_postdecompress_i(void *data, unsigned d_nelmts, enum H5Z_scaleoffset_t type,
+ unsigned filavail, const unsigned cd_values[], uint32_t minbits,
+ unsigned long long minval);
+static herr_t H5Z__scaleoffset_precompress_fd(void *data, unsigned d_nelmts, enum H5Z_scaleoffset_t type,
+ unsigned filavail, const unsigned cd_values[],
+ uint32_t *minbits, unsigned long long *minval, double D_val);
+static herr_t H5Z__scaleoffset_postdecompress_fd(void *data, unsigned d_nelmts, enum H5Z_scaleoffset_t type,
+ unsigned filavail, const unsigned cd_values[],
+ uint32_t minbits, unsigned long long minval, double D_val);
+static void H5Z__scaleoffset_next_byte(size_t *j, unsigned *buf_len);
+static void H5Z__scaleoffset_decompress_one_byte(unsigned char *data, size_t data_offset, unsigned k,
+ unsigned begin_i, const unsigned char *buffer, size_t *j,
+ unsigned *buf_len, parms_atomic p, unsigned dtype_len);
+static void H5Z__scaleoffset_compress_one_byte(const unsigned char *data, size_t data_offset, unsigned k,
+ unsigned begin_i, unsigned char *buffer, size_t *j,
+ unsigned *buf_len, parms_atomic p, unsigned dtype_len);
+static void H5Z__scaleoffset_decompress_one_atomic(unsigned char *data, size_t data_offset,
+ unsigned char *buffer, size_t *j, unsigned *buf_len,
+ parms_atomic p);
+static void H5Z__scaleoffset_compress_one_atomic(unsigned char *data, size_t data_offset,
+ unsigned char *buffer, size_t *j, unsigned *buf_len,
+ parms_atomic p);
+static void H5Z__scaleoffset_decompress(unsigned char *data, unsigned d_nelmts, unsigned char *buffer,
+ parms_atomic p);
+static void H5Z__scaleoffset_compress(unsigned char *data, unsigned d_nelmts, unsigned char *buffer,
+ size_t buffer_size, parms_atomic p);
/* This message derives from H5Z */
H5Z_class2_t H5Z_SCALEOFFSET[1] = {{
- H5Z_CLASS_T_VERS, /* H5Z_class_t version */
- H5Z_FILTER_SCALEOFFSET, /* Filter id number */
- 1, /* Assume encoder present: check before registering */
- 1, /* decoder_present flag (set to true) */
- "scaleoffset", /* Filter name for debugging */
- H5Z_can_apply_scaleoffset, /* The "can apply" callback */
- H5Z_set_local_scaleoffset, /* The "set local" callback */
- H5Z_filter_scaleoffset, /* The actual filter function */
+ H5Z_CLASS_T_VERS, /* H5Z_class_t version */
+ H5Z_FILTER_SCALEOFFSET, /* Filter id number */
+ 1, /* Assume encoder present: check before registering */
+ 1, /* decoder_present flag (set to true) */
+ "scaleoffset", /* Filter name for debugging */
+ H5Z__can_apply_scaleoffset, /* The "can apply" callback */
+ H5Z__set_local_scaleoffset, /* The "set local" callback */
+ H5Z__filter_scaleoffset, /* The actual filter function */
}};
/* Local macros */
@@ -198,7 +198,7 @@ H5Z_class2_t H5Z_SCALEOFFSET[1] = {{
/* Set the fill value parameter in cd_values[] for unsigned integer type */
#define H5Z_scaleoffset_set_filval_1(type, dcpl_plist, dt, cd_values, need_convert) \
- { \
+ do { \
type fill_val; \
\
/* Get dataset fill value */ \
@@ -206,14 +206,14 @@ H5Z_class2_t H5Z_SCALEOFFSET[1] = {{
HGOTO_ERROR(H5E_PLINE, H5E_CANTGET, FAIL, "unable to get fill value") \
\
if (need_convert) \
- H5Z_scaleoffset_convert(&fill_val, 1, sizeof(type)); \
+ H5Z__scaleoffset_convert(&fill_val, 1, sizeof(type)); \
\
H5Z_scaleoffset_save_filval(type, cd_values, fill_val) \
- }
+ } while (0)
/* Set the fill value parameter in cd_values[] for signed integer type */
#define H5Z_scaleoffset_set_filval_2(type, dcpl_plist, dt, cd_values, need_convert) \
- { \
+ do { \
type fill_val; \
\
/* Get dataset fill value */ \
@@ -221,14 +221,14 @@ H5Z_class2_t H5Z_SCALEOFFSET[1] = {{
HGOTO_ERROR(H5E_PLINE, H5E_CANTGET, FAIL, "unable to get fill value") \
\
if (need_convert) \
- H5Z_scaleoffset_convert(&fill_val, 1, sizeof(type)); \
+ H5Z__scaleoffset_convert(&fill_val, 1, sizeof(type)); \
\
H5Z_scaleoffset_save_filval(unsigned type, cd_values, fill_val) \
- }
+ } while (0)
/* Set the fill value parameter in cd_values[] for character integer type */
#define H5Z_scaleoffset_set_filval_3(type, dcpl_plist, dt, cd_values, need_convert) \
- { \
+ do { \
type fill_val; \
\
/* Get dataset fill value */ \
@@ -237,11 +237,11 @@ H5Z_class2_t H5Z_SCALEOFFSET[1] = {{
\
/* Store the fill value as the last entry in cd_values[] */ \
(cd_values)[H5Z_SCALEOFFSET_PARM_FILVAL] = (unsigned)((unsigned char)fill_val); \
- }
+ } while (0)
/* Set the fill value parameter in cd_values[] for floating-point type */
#define H5Z_scaleoffset_set_filval_4(type, dcpl_plist, dt, cd_values, need_convert) \
- { \
+ do { \
type fill_val; \
\
/* Get dataset fill value */ \
@@ -249,10 +249,10 @@ H5Z_class2_t H5Z_SCALEOFFSET[1] = {{
HGOTO_ERROR(H5E_PLINE, H5E_CANTGET, FAIL, "unable to get fill value") \
\
if (need_convert) \
- H5Z_scaleoffset_convert(&fill_val, 1, sizeof(type)); \
+ H5Z__scaleoffset_convert(&fill_val, 1, sizeof(type)); \
\
H5Z_scaleoffset_save_filval(type, cd_values, fill_val) \
- }
+ } while (0)
/* Get the fill value for integer type */
#define H5Z_scaleoffset_get_filval_1(type, cd_values, fill_val) \
@@ -364,12 +364,12 @@ H5Z_class2_t H5Z_SCALEOFFSET[1] = {{
#define H5Z_scaleoffset_max_min_3(i, d_nelmts, buf, filval, max, min, D_val) \
{ \
i = 0; \
- while (i < d_nelmts && HDfabs(buf[i] - filval) < HDpow(10.0f, -D_val)) \
+ while (i < d_nelmts && HDfabs(buf[i] - filval) < HDpow(10.0, -D_val)) \
i++; \
if (i < d_nelmts) \
min = max = buf[i]; \
for (; i < d_nelmts; i++) { \
- if (HDfabs(buf[i] - filval) < HDpow(10.0f, -D_val)) \
+ if (HDfabs(buf[i] - filval) < HDpow(10.0, -D_val)) \
continue; /* ignore fill value */ \
if (buf[i] > max) \
max = buf[i]; \
@@ -451,7 +451,7 @@ H5Z_class2_t H5Z_SCALEOFFSET[1] = {{
/* Precompress for unsigned integer type */
#define H5Z_scaleoffset_precompress_1(type, data, d_nelmts, filavail, cd_values, minbits, minval) \
- { \
+ do { \
type * buf = (type *)data, min = 0, max = 0, span, filval = 0; \
unsigned i; \
\
@@ -461,7 +461,7 @@ H5Z_class2_t H5Z_SCALEOFFSET[1] = {{
{ /* minbits not set yet, calculate max, min, and minbits */ \
H5Z_scaleoffset_max_min_1(i, d_nelmts, buf, filval, max, min) \
H5Z_scaleoffset_check_1(type, max, min, minbits) span = (type)(max - min + 1); \
- *minbits = H5Z_scaleoffset_log2((unsigned long long)(span + 1)); \
+ *minbits = H5Z__scaleoffset_log2((unsigned long long)(span + 1)); \
} \
else /* minbits already set, only calculate min */ \
H5Z_scaleoffset_min_1( \
@@ -475,7 +475,7 @@ H5Z_class2_t H5Z_SCALEOFFSET[1] = {{
H5Z_SO_INT_MINBITS_DEFAULT) { /* minbits not set yet, calculate max, min, and minbits */ \
H5Z_scaleoffset_max_min_2(i, d_nelmts, buf, max, min) \
H5Z_scaleoffset_check_1(type, max, min, minbits) span = (type)(max - min + 1); \
- *minbits = H5Z_scaleoffset_log2((unsigned long long)span); \
+ *minbits = H5Z__scaleoffset_log2((unsigned long long)span); \
} \
else /* minbits already set, only calculate min */ \
H5Z_scaleoffset_min_2( \
@@ -484,11 +484,11 @@ H5Z_class2_t H5Z_SCALEOFFSET[1] = {{
for (i = 0; i < d_nelmts; i++) buf[i] = (type)(buf[i] - min); \
} \
*minval = min; \
- }
+ } while (0)
/* Precompress for signed integer type */
#define H5Z_scaleoffset_precompress_2(type, data, d_nelmts, filavail, cd_values, minbits, minval) \
- { \
+ do { \
type * buf = (type *)data, min = 0, max = 0, filval = 0; \
unsigned type span; \
unsigned i; \
@@ -499,7 +499,7 @@ H5Z_class2_t H5Z_SCALEOFFSET[1] = {{
{ /* minbits not set yet, calculate max, min, and minbits */ \
H5Z_scaleoffset_max_min_1(i, d_nelmts, buf, filval, max, min) \
H5Z_scaleoffset_check_2(type, max, min, minbits) span = (unsigned type)(max - min + 1); \
- *minbits = H5Z_scaleoffset_log2((unsigned long long)(span + 1)); \
+ *minbits = H5Z__scaleoffset_log2((unsigned long long)(span + 1)); \
} \
else /* minbits already set, only calculate min */ \
H5Z_scaleoffset_min_1( \
@@ -513,7 +513,7 @@ H5Z_class2_t H5Z_SCALEOFFSET[1] = {{
H5Z_SO_INT_MINBITS_DEFAULT) { /* minbits not set yet, calculate max, min, and minbits */ \
H5Z_scaleoffset_max_min_2(i, d_nelmts, buf, max, min) \
H5Z_scaleoffset_check_2(type, max, min, minbits) span = (unsigned type)(max - min + 1); \
- *minbits = H5Z_scaleoffset_log2((unsigned long long)span); \
+ *minbits = H5Z__scaleoffset_log2((unsigned long long)span); \
} \
else /* minbits already set, only calculate min */ \
H5Z_scaleoffset_min_2( \
@@ -522,7 +522,7 @@ H5Z_class2_t H5Z_SCALEOFFSET[1] = {{
for (i = 0; i < d_nelmts; i++) buf[i] = (type)(buf[i] - min); \
} \
*minval = (unsigned long long)min; \
- }
+ } while (0)
/* Modify values of data in precompression if fill value defined for floating-point type */
#define H5Z_scaleoffset_modify_1(i, type, pow_fun, abs_fun, lround_fun, llround_fun, buf, d_nelmts, filval, \
@@ -596,7 +596,7 @@ H5Z_class2_t H5Z_SCALEOFFSET[1] = {{
/* Precompress for floating-point type using variable-minimum-bits method */
#define H5Z_scaleoffset_precompress_3(type, pow_fun, abs_fun, round_fun, lround_fun, llround_fun, data, \
d_nelmts, filavail, cd_values, minbits, minval, D_val) \
- { \
+ do { \
type * buf = (type *)data, min = 0, max = 0, filval = 0; \
unsigned long long span; \
unsigned i; \
@@ -609,7 +609,7 @@ H5Z_class2_t H5Z_SCALEOFFSET[1] = {{
(unsigned long long)(llround_fun(max * pow_fun(10.0f, (type)D_val) - \
min * pow_fun(10.0f, (type)D_val)) + \
1); \
- *minbits = H5Z_scaleoffset_log2(span + 1); \
+ *minbits = H5Z__scaleoffset_log2(span + 1); \
if (*minbits != sizeof(type) * 8) /* change values if minbits != full precision */ \
H5Z_scaleoffset_modify_1(i, type, pow_fun, abs_fun, lround_fun, llround_fun, buf, d_nelmts, \
filval, minbits, min, D_val) \
@@ -620,17 +620,17 @@ H5Z_class2_t H5Z_SCALEOFFSET[1] = {{
(unsigned long long)(llround_fun(max * pow_fun(10.0f, (type)D_val) - \
min * pow_fun(10.0f, (type)D_val)) + \
1); \
- *minbits = H5Z_scaleoffset_log2(span); \
+ *minbits = H5Z__scaleoffset_log2(span); \
if (*minbits != sizeof(type) * 8) /* change values if minbits != full precision */ \
H5Z_scaleoffset_modify_2(i, type, pow_fun, lround_fun, llround_fun, buf, d_nelmts, min, \
D_val) \
} \
H5Z_scaleoffset_save_min(i, type, minval, min) \
- }
+ } while (0)
/* Postdecompress for unsigned integer type */
#define H5Z_scaleoffset_postdecompress_1(type, data, d_nelmts, filavail, cd_values, minbits, minval) \
- { \
+ do { \
type * buf = (type *)data, filval = 0; \
unsigned i; \
\
@@ -641,11 +641,11 @@ H5Z_class2_t H5Z_SCALEOFFSET[1] = {{
else /* fill value undefined */ \
for (i = 0; i < d_nelmts; i++) \
buf[i] = (type)(buf[i] + (type)(minval)); \
- }
+ } while (0)
/* Postdecompress for signed integer type */
#define H5Z_scaleoffset_postdecompress_2(type, data, d_nelmts, filavail, cd_values, minbits, minval) \
- { \
+ do { \
type * buf = (type *)data, filval = 0; \
unsigned i; \
\
@@ -657,7 +657,7 @@ H5Z_class2_t H5Z_SCALEOFFSET[1] = {{
else /* fill value undefined */ \
for (i = 0; i < d_nelmts; i++) \
buf[i] = (type)(buf[i] + (type)(minval)); \
- }
+ } while (0)
/* Retrive minimum value of floating-point type */
#define H5Z_scaleoffset_get_min(type, minval, min) \
@@ -721,7 +721,7 @@ H5Z_class2_t H5Z_SCALEOFFSET[1] = {{
/* Postdecompress for floating-point type using variable-minimum-bits method */
#define H5Z_scaleoffset_postdecompress_3(type, pow_fun, data, d_nelmts, filavail, cd_values, minbits, \
minval, D_val) \
- { \
+ do { \
type * buf = (type *)data, filval = 0, min = 0; \
unsigned i; \
\
@@ -734,10 +734,10 @@ H5Z_class2_t H5Z_SCALEOFFSET[1] = {{
} \
else /* fill value undefined */ \
H5Z_scaleoffset_modify_4(i, type, pow_fun, buf, d_nelmts, min, D_val) \
- }
+ } while (0)
/*-------------------------------------------------------------------------
- * Function: H5Z_can_apply_scaleoffset
+ * Function: H5Z__can_apply_scaleoffset
*
* Purpose: Check the parameters for scaleoffset compression for
* validity and whether they fit a particular dataset.
@@ -748,19 +748,17 @@ H5Z_class2_t H5Z_SCALEOFFSET[1] = {{
* Programmer: Xiaowen Wu
* Friday, February 4, 2005
*
- * Modifications:
- *
*-------------------------------------------------------------------------
*/
static htri_t
-H5Z_can_apply_scaleoffset(hid_t H5_ATTR_UNUSED dcpl_id, hid_t type_id, hid_t H5_ATTR_UNUSED space_id)
+H5Z__can_apply_scaleoffset(hid_t H5_ATTR_UNUSED dcpl_id, hid_t type_id, hid_t H5_ATTR_UNUSED space_id)
{
const H5T_t *type; /* Datatype */
H5T_class_t dtype_class; /* Datatype's class */
H5T_order_t dtype_order; /* Datatype's endianness order */
htri_t ret_value = TRUE; /* Return value */
- FUNC_ENTER_NOAPI_NOINIT
+ FUNC_ENTER_STATIC
/* Get datatype */
if (NULL == (type = (H5T_t *)H5I_object_verify(type_id, H5I_DATATYPE)))
@@ -788,10 +786,10 @@ H5Z_can_apply_scaleoffset(hid_t H5_ATTR_UNUSED dcpl_id, hid_t type_id, hid_t H5_
done:
FUNC_LEAVE_NOAPI(ret_value)
-} /* end H5Z_can_apply_scaleoffset() */
+} /* end H5Z__can_apply_scaleoffset() */
/*-------------------------------------------------------------------------
- * Function: H5Z_scaleoffset_get_type
+ * Function: H5Z__scaleoffset_get_type
*
* Purpose: Get the specific integer type based on datatype size and sign
* or floating-point type based on size
@@ -802,17 +800,15 @@ done:
* Programmer: Xiaowen Wu
* Wednesday, April 13, 2005
*
- * Modifications:
- *
*-------------------------------------------------------------------------
*/
static enum H5Z_scaleoffset_t
-H5Z_scaleoffset_get_type(unsigned dtype_class, unsigned dtype_size, unsigned dtype_sign)
+H5Z__scaleoffset_get_type(unsigned dtype_class, unsigned dtype_size, unsigned dtype_sign)
{
enum H5Z_scaleoffset_t type = t_bad; /* integer type */
enum H5Z_scaleoffset_t ret_value = t_bad; /* Return value */
- FUNC_ENTER_NOAPI_NOINIT
+ FUNC_ENTER_STATIC
if (dtype_class == H5Z_SCALEOFFSET_CLS_INTEGER) {
if (dtype_sign == H5Z_SCALEOFFSET_SGN_NONE) { /* unsigned integer */
@@ -867,7 +863,7 @@ done:
}
/*-------------------------------------------------------------------------
- * Function: H5Z_scaleoffset_set_parms_fillval
+ * Function: H5Z__scaleoffset_set_parms_fillval
*
* Purpose: Get the fill value of the dataset and store in cd_values[]
*
@@ -880,47 +876,44 @@ done:
*-------------------------------------------------------------------------
*/
static herr_t
-H5Z_scaleoffset_set_parms_fillval(H5P_genplist_t *dcpl_plist, H5T_t *type, enum H5Z_scaleoffset_t scale_type,
- unsigned cd_values[], int need_convert)
+H5Z__scaleoffset_set_parms_fillval(H5P_genplist_t *dcpl_plist, H5T_t *type, enum H5Z_scaleoffset_t scale_type,
+ unsigned cd_values[], int need_convert)
{
herr_t ret_value = SUCCEED; /* Return value */
- FUNC_ENTER_NOAPI_NOINIT
+ FUNC_ENTER_STATIC
if (scale_type == t_uchar)
- H5Z_scaleoffset_set_filval_3(unsigned char, dcpl_plist, type, cd_values,
- need_convert) else if (scale_type == t_ushort)
- H5Z_scaleoffset_set_filval_1(unsigned short, dcpl_plist, type, cd_values,
- need_convert) else if (scale_type == t_uint)
- H5Z_scaleoffset_set_filval_1(unsigned int, dcpl_plist, type, cd_values,
- need_convert) else if (scale_type == t_ulong)
- H5Z_scaleoffset_set_filval_1(unsigned long, dcpl_plist, type, cd_values,
- need_convert) else if (scale_type == t_ulong_long)
- H5Z_scaleoffset_set_filval_1(unsigned long long, dcpl_plist, type, cd_values,
- need_convert) else if (scale_type == t_schar)
- H5Z_scaleoffset_set_filval_3(signed char, dcpl_plist, type, cd_values,
- need_convertd) else if (scale_type == t_short)
- H5Z_scaleoffset_set_filval_2(short, dcpl_plist, type, cd_values,
- need_convert) else if (scale_type == t_int)
- H5Z_scaleoffset_set_filval_2(int, dcpl_plist, type, cd_values,
- need_convert) else if (scale_type == t_long)
- H5Z_scaleoffset_set_filval_2(long, dcpl_plist, type, cd_values,
- need_convert) else if (scale_type ==
- t_long_long)
- H5Z_scaleoffset_set_filval_2(
- long long, dcpl_plist, type, cd_values,
- need_convert) else if (scale_type == t_float)
- H5Z_scaleoffset_set_filval_4(
- float, dcpl_plist, type, cd_values,
- need_convert) else if (scale_type == t_double)
- H5Z_scaleoffset_set_filval_4(double, dcpl_plist, type,
- cd_values, need_convert)
-
- done : FUNC_LEAVE_NOAPI(ret_value)
-} /* end H5Z_scaleoffset_set_parms_fillval() */
+ H5Z_scaleoffset_set_filval_3(unsigned char, dcpl_plist, type, cd_values, need_convert);
+ else if (scale_type == t_ushort)
+ H5Z_scaleoffset_set_filval_1(unsigned short, dcpl_plist, type, cd_values, need_convert);
+ else if (scale_type == t_uint)
+ H5Z_scaleoffset_set_filval_1(unsigned int, dcpl_plist, type, cd_values, need_convert);
+ else if (scale_type == t_ulong)
+ H5Z_scaleoffset_set_filval_1(unsigned long, dcpl_plist, type, cd_values, need_convert);
+ else if (scale_type == t_ulong_long)
+ H5Z_scaleoffset_set_filval_1(unsigned long long, dcpl_plist, type, cd_values, need_convert);
+ else if (scale_type == t_schar)
+ H5Z_scaleoffset_set_filval_3(signed char, dcpl_plist, type, cd_values, need_convertd);
+ else if (scale_type == t_short)
+ H5Z_scaleoffset_set_filval_2(short, dcpl_plist, type, cd_values, need_convert);
+ else if (scale_type == t_int)
+ H5Z_scaleoffset_set_filval_2(int, dcpl_plist, type, cd_values, need_convert);
+ else if (scale_type == t_long)
+ H5Z_scaleoffset_set_filval_2(long, dcpl_plist, type, cd_values, need_convert);
+ else if (scale_type == t_long_long)
+ H5Z_scaleoffset_set_filval_2(long long, dcpl_plist, type, cd_values, need_convert);
+ else if (scale_type == t_float)
+ H5Z_scaleoffset_set_filval_4(float, dcpl_plist, type, cd_values, need_convert);
+ else if (scale_type == t_double)
+ H5Z_scaleoffset_set_filval_4(double, dcpl_plist, type, cd_values, need_convert);
+
+done:
+ FUNC_LEAVE_NOAPI(ret_value)
+} /* end H5Z__scaleoffset_set_parms_fillval() */
/*-------------------------------------------------------------------------
- * Function: H5Z_set_local_scaleoffset
+ * Function: H5Z__set_local_scaleoffset
*
* Purpose: Set the "local" dataset parameters for scaleoffset
* compression.
@@ -931,12 +924,10 @@ H5Z_scaleoffset_set_parms_fillval(H5P_genplist_t *dcpl_plist, H5T_t *type, enum
* Programmer: Xiaowen Wu
* Friday, February 4, 2005
*
- * Modifications:
- *
*-------------------------------------------------------------------------
*/
static herr_t
-H5Z_set_local_scaleoffset(hid_t dcpl_id, hid_t type_id, hid_t space_id)
+H5Z__set_local_scaleoffset(hid_t dcpl_id, hid_t type_id, hid_t space_id)
{
H5P_genplist_t * dcpl_plist; /* Property list pointer */
H5T_t * type; /* Datatype */
@@ -953,11 +944,11 @@ H5Z_set_local_scaleoffset(hid_t dcpl_id, hid_t type_id, hid_t space_id)
H5D_fill_value_t status; /* Status of fill value in property list */
herr_t ret_value = SUCCEED; /* Return value */
- FUNC_ENTER_NOAPI_NOINIT
+ FUNC_ENTER_STATIC
/* Get the plist structure */
if (NULL == (dcpl_plist = H5P_object_verify(dcpl_id, H5P_DATASET_CREATE)))
- HGOTO_ERROR(H5E_ATOM, H5E_BADATOM, FAIL, "can't find object for ID")
+ HGOTO_ERROR(H5E_ID, H5E_BADID, FAIL, "can't find object for ID")
/* Get datatype */
if (NULL == (type = (H5T_t *)H5I_object_verify(type_id, H5I_DATATYPE)))
@@ -1080,13 +1071,13 @@ H5Z_set_local_scaleoffset(hid_t dcpl_id, hid_t type_id, hid_t space_id)
need_convert = TRUE;
/* Before getting fill value, get its type */
- if ((scale_type = H5Z_scaleoffset_get_type(cd_values[H5Z_SCALEOFFSET_PARM_CLASS],
- cd_values[H5Z_SCALEOFFSET_PARM_SIZE],
- cd_values[H5Z_SCALEOFFSET_PARM_SIGN])) == 0)
+ if ((scale_type = H5Z__scaleoffset_get_type(cd_values[H5Z_SCALEOFFSET_PARM_CLASS],
+ cd_values[H5Z_SCALEOFFSET_PARM_SIZE],
+ cd_values[H5Z_SCALEOFFSET_PARM_SIGN])) == 0)
HGOTO_ERROR(H5E_PLINE, H5E_BADTYPE, FAIL, "cannot use C integer datatype for cast")
/* Get dataset fill value and store in cd_values[] */
- if (H5Z_scaleoffset_set_parms_fillval(dcpl_plist, type, scale_type, cd_values, need_convert) < 0)
+ if (H5Z__scaleoffset_set_parms_fillval(dcpl_plist, type, scale_type, cd_values, need_convert) < 0)
HGOTO_ERROR(H5E_PLINE, H5E_CANTSET, FAIL, "unable to set fill value")
} /* end else */
@@ -1097,10 +1088,10 @@ H5Z_set_local_scaleoffset(hid_t dcpl_id, hid_t type_id, hid_t space_id)
done:
FUNC_LEAVE_NOAPI(ret_value)
-} /* end H5Z_set_local_scaleoffset() */
+} /* end H5Z__set_local_scaleoffset() */
/*-------------------------------------------------------------------------
- * Function: H5Z_filter_scaleoffset
+ * Function: H5Z__filter_scaleoffset
*
* Purpose: Implement an I/O filter for storing packed integer
* data using scale and offset method.
@@ -1111,13 +1102,11 @@ done:
* Programmer: Xiaowen Wu
* Monday, February 7, 2005
*
- * Modifications:
- *
*-------------------------------------------------------------------------
*/
static size_t
-H5Z_filter_scaleoffset(unsigned flags, size_t cd_nelmts, const unsigned cd_values[], size_t nbytes,
- size_t *buf_size, void **buf)
+H5Z__filter_scaleoffset(unsigned flags, size_t cd_nelmts, const unsigned cd_values[], size_t nbytes,
+ size_t *buf_size, void **buf)
{
size_t ret_value = 0; /* return value */
size_t size_out = 0; /* size of output buffer */
@@ -1137,7 +1126,7 @@ H5Z_filter_scaleoffset(unsigned flags, size_t cd_nelmts, const unsigned cd_value
unsigned i; /* index */
parms_atomic p; /* parameters needed for compress/decompress functions */
- FUNC_ENTER_NOAPI_NOINIT
+ FUNC_ENTER_STATIC
/* check arguments */
if (cd_nelmts != H5Z_SCALEOFFSET_TOTAL_NPARMS)
@@ -1266,7 +1255,7 @@ H5Z_filter_scaleoffset(unsigned flags, size_t cd_nelmts, const unsigned cd_value
/* convert to dataset datatype endianness order if needed */
if (need_convert)
- H5Z_scaleoffset_convert(outbuf, d_nelmts, p.size);
+ H5Z__scaleoffset_convert(outbuf, d_nelmts, p.size);
*buf = outbuf;
outbuf = NULL;
@@ -1277,7 +1266,7 @@ H5Z_filter_scaleoffset(unsigned flags, size_t cd_nelmts, const unsigned cd_value
/* decompress the buffer if minbits not equal to zero */
if (minbits != 0)
- H5Z_scaleoffset_decompress(outbuf, d_nelmts, (unsigned char *)(*buf) + buf_offset, p);
+ H5Z__scaleoffset_decompress(outbuf, d_nelmts, (unsigned char *)(*buf) + buf_offset, p);
else {
/* fill value is not defined and all data elements have the same value */
for (i = 0; i < size_out; i++)
@@ -1285,23 +1274,23 @@ H5Z_filter_scaleoffset(unsigned flags, size_t cd_nelmts, const unsigned cd_value
}
/* before postprocess, get memory type */
- if ((type = H5Z_scaleoffset_get_type(dtype_class, p.size, dtype_sign)) == 0)
+ if ((type = H5Z__scaleoffset_get_type(dtype_class, p.size, dtype_sign)) == 0)
HGOTO_ERROR(H5E_PLINE, H5E_BADTYPE, 0, "cannot use C integer datatype for cast")
/* postprocess after decompression */
if (dtype_class == H5Z_SCALEOFFSET_CLS_INTEGER)
- H5Z_scaleoffset_postdecompress_i(outbuf, d_nelmts, type, filavail, cd_values, minbits, minval);
+ H5Z__scaleoffset_postdecompress_i(outbuf, d_nelmts, type, filavail, cd_values, minbits, minval);
if (dtype_class == H5Z_SCALEOFFSET_CLS_FLOAT)
if (scale_type == 0) { /* variable-minimum-bits method */
- if (H5Z_scaleoffset_postdecompress_fd(outbuf, d_nelmts, type, filavail, cd_values, minbits,
- minval, D_val) == FAIL)
+ if (H5Z__scaleoffset_postdecompress_fd(outbuf, d_nelmts, type, filavail, cd_values, minbits,
+ minval, D_val) == FAIL)
HGOTO_ERROR(H5E_PLINE, H5E_BADTYPE, 0, "post-decompression failed")
}
/* after postprocess, convert to dataset datatype endianness order if needed */
if (need_convert)
- H5Z_scaleoffset_convert(outbuf, d_nelmts, p.size);
+ H5Z__scaleoffset_convert(outbuf, d_nelmts, p.size);
}
/* output; compress */
else {
@@ -1309,20 +1298,20 @@ H5Z_filter_scaleoffset(unsigned flags, size_t cd_nelmts, const unsigned cd_value
/* before preprocess, convert to memory endianness order if needed */
if (need_convert)
- H5Z_scaleoffset_convert(*buf, d_nelmts, p.size);
+ H5Z__scaleoffset_convert(*buf, d_nelmts, p.size);
/* before preprocess, get memory type */
- if ((type = H5Z_scaleoffset_get_type(dtype_class, p.size, dtype_sign)) == 0)
+ if ((type = H5Z__scaleoffset_get_type(dtype_class, p.size, dtype_sign)) == 0)
HGOTO_ERROR(H5E_PLINE, H5E_BADTYPE, 0, "cannot use C integer datatype for cast")
/* preprocess before compression */
if (dtype_class == H5Z_SCALEOFFSET_CLS_INTEGER)
- H5Z_scaleoffset_precompress_i(*buf, d_nelmts, type, filavail, cd_values, &minbits, &minval);
+ H5Z__scaleoffset_precompress_i(*buf, d_nelmts, type, filavail, cd_values, &minbits, &minval);
if (dtype_class == H5Z_SCALEOFFSET_CLS_FLOAT)
if (scale_type == 0) { /* variable-minimum-bits method */
- if (H5Z_scaleoffset_precompress_fd(*buf, d_nelmts, type, filavail, cd_values, &minbits,
- &minval, D_val) == FAIL)
+ if (H5Z__scaleoffset_precompress_fd(*buf, d_nelmts, type, filavail, cd_values, &minbits,
+ &minval, D_val) == FAIL)
HGOTO_ERROR(H5E_PLINE, H5E_BADTYPE, 0, "pre-compression failed")
}
@@ -1376,8 +1365,8 @@ H5Z_filter_scaleoffset(unsigned flags, size_t cd_nelmts, const unsigned cd_value
* all data elements have the same value
*/
if (minbits != 0)
- H5Z_scaleoffset_compress((unsigned char *)*buf, d_nelmts, outbuf + buf_offset,
- size_out - buf_offset, p);
+ H5Z__scaleoffset_compress((unsigned char *)*buf, d_nelmts, outbuf + buf_offset,
+ size_out - buf_offset, p);
}
/* free the input buffer */
@@ -1407,7 +1396,7 @@ done:
* or from big-endian to little-endian 2/21/2005
*/
static void
-H5Z_scaleoffset_convert(void *buf, unsigned d_nelmts, unsigned dtype_size)
+H5Z__scaleoffset_convert(void *buf, unsigned d_nelmts, unsigned dtype_size)
{
if (dtype_size > 1) {
size_t i, j;
@@ -1422,13 +1411,13 @@ H5Z_scaleoffset_convert(void *buf, unsigned d_nelmts, unsigned dtype_size)
buffer[i + dtype_size - 1 - j] = temp;
} /* end for */
} /* end if */
-} /* end H5Z_scaleoffset_convert() */
+} /* end H5Z__scaleoffset_convert() */
/* return ceiling of floating-point log2 function
* receive unsigned integer as argument 3/10/2005
*/
static unsigned
-H5Z_scaleoffset_log2(unsigned long long num)
+H5Z__scaleoffset_log2(unsigned long long num)
{
unsigned v = 0;
unsigned long long lower_bound = 1; /* is power of 2, largest value <= num */
@@ -1447,178 +1436,180 @@ H5Z_scaleoffset_log2(unsigned long long num)
/* precompress for integer type */
static void
-H5Z_scaleoffset_precompress_i(void *data, unsigned d_nelmts, enum H5Z_scaleoffset_t type, unsigned filavail,
- const unsigned cd_values[], uint32_t *minbits, unsigned long long *minval)
+H5Z__scaleoffset_precompress_i(void *data, unsigned d_nelmts, enum H5Z_scaleoffset_t type, unsigned filavail,
+ const unsigned cd_values[], uint32_t *minbits, unsigned long long *minval)
{
if (type == t_uchar)
- H5Z_scaleoffset_precompress_1(unsigned char, data, d_nelmts, filavail, cd_values, minbits,
- minval) else if (type == t_ushort)
- H5Z_scaleoffset_precompress_1(unsigned short, data, d_nelmts, filavail, cd_values, minbits,
- minval) else if (type == t_uint)
- H5Z_scaleoffset_precompress_1(unsigned int, data, d_nelmts, filavail, cd_values, minbits,
- minval) else if (type == t_ulong)
- H5Z_scaleoffset_precompress_1(unsigned long, data, d_nelmts, filavail, cd_values, minbits,
- minval) else if (type == t_ulong_long)
- H5Z_scaleoffset_precompress_1(unsigned long long, data, d_nelmts, filavail, cd_values,
- minbits, minval) else if (type == t_schar)
- {
- signed char * buf = (signed char *)data, min = 0, max = 0, filval = 0;
- unsigned char span;
- unsigned i;
-
- if (filavail == H5Z_SCALEOFFSET_FILL_DEFINED) { /* fill value defined */
- H5Z_scaleoffset_get_filval_1(signed char, cd_values, filval);
- if (*minbits ==
- H5Z_SO_INT_MINBITS_DEFAULT) { /* minbits not set yet, calculate max, min, and minbits */
- H5Z_scaleoffset_max_min_1(i, d_nelmts, buf, filval, max,
- min) if ((unsigned char)(max - min) >
- (unsigned char)(~(unsigned char)0 - 2))
- {
- *minbits = sizeof(signed char) * 8;
- return;
- }
- span = (unsigned char)(max - min + 1);
- *minbits = H5Z_scaleoffset_log2((unsigned long long)(span + 1));
+ H5Z_scaleoffset_precompress_1(unsigned char, data, d_nelmts, filavail, cd_values, minbits, minval);
+ else if (type == t_ushort)
+ H5Z_scaleoffset_precompress_1(unsigned short, data, d_nelmts, filavail, cd_values, minbits, minval);
+ else if (type == t_uint)
+ H5Z_scaleoffset_precompress_1(unsigned int, data, d_nelmts, filavail, cd_values, minbits, minval);
+ else if (type == t_ulong)
+ H5Z_scaleoffset_precompress_1(unsigned long, data, d_nelmts, filavail, cd_values, minbits, minval);
+ else if (type == t_ulong_long)
+ H5Z_scaleoffset_precompress_1(unsigned long long, data, d_nelmts, filavail, cd_values, minbits,
+ minval);
+ else if (type == t_schar) {
+ signed char * buf = (signed char *)data, min = 0, max = 0, filval = 0;
+ unsigned char span;
+ unsigned i;
+
+ if (filavail == H5Z_SCALEOFFSET_FILL_DEFINED) { /* fill value defined */
+ H5Z_scaleoffset_get_filval_1(signed char, cd_values, filval);
+ if (*minbits ==
+ H5Z_SO_INT_MINBITS_DEFAULT) { /* minbits not set yet, calculate max, min, and minbits */
+ H5Z_scaleoffset_max_min_1(i, d_nelmts, buf, filval, max,
+ min) if ((unsigned char)(max - min) >
+ (unsigned char)(~(unsigned char)0 - 2))
+ {
+ *minbits = sizeof(signed char) * 8;
+ return;
}
- else /* minbits already set, only calculate min */
- H5Z_scaleoffset_min_1(i, d_nelmts, buf, filval,
- min) if (*minbits !=
- sizeof(signed char) *
- 8) /* change values if minbits != full precision */
- for (i = 0; i < d_nelmts; i++) buf[i] =
- (signed char)((buf[i] == filval) ? (((unsigned char)1 << *minbits) - 1)
- : (buf[i] - min));
+ span = (unsigned char)(max - min + 1);
+ *minbits = H5Z__scaleoffset_log2((unsigned long long)(span + 1));
}
- else { /* fill value undefined */
- if (*minbits ==
- H5Z_SO_INT_MINBITS_DEFAULT) { /* minbits not set yet, calculate max, min, and minbits */
- H5Z_scaleoffset_max_min_2(i, d_nelmts, buf, max,
- min) if ((unsigned char)(max - min) >
- (unsigned char)(~(unsigned char)0 - 2))
- {
- *minbits = sizeof(signed char) * 8;
- *minval = (unsigned long long)min;
- return;
- }
- span = (unsigned char)(max - min + 1);
- *minbits = H5Z_scaleoffset_log2((unsigned long long)span);
+ else /* minbits already set, only calculate min */
+ H5Z_scaleoffset_min_1(i, d_nelmts, buf, filval,
+ min) if (*minbits !=
+ sizeof(signed char) *
+ 8) /* change values if minbits != full precision */
+ for (i = 0; i < d_nelmts; i++) buf[i] =
+ (signed char)((buf[i] == filval) ? (((unsigned char)1 << *minbits) - 1)
+ : (buf[i] - min));
+ }
+ else { /* fill value undefined */
+ if (*minbits ==
+ H5Z_SO_INT_MINBITS_DEFAULT) { /* minbits not set yet, calculate max, min, and minbits */
+ H5Z_scaleoffset_max_min_2(i, d_nelmts, buf, max,
+ min) if ((unsigned char)(max - min) >
+ (unsigned char)(~(unsigned char)0 - 2))
+ {
+ *minbits = sizeof(signed char) * 8;
+ *minval = (unsigned long long)min;
+ return;
}
- else /* minbits already set, only calculate min */
- H5Z_scaleoffset_min_2(i, d_nelmts, buf,
- min) if (*minbits !=
- sizeof(signed char) *
- 8) /* change values if minbits != full precision */
- for (i = 0; i < d_nelmts; i++) buf[i] = (signed char)(buf[i] - min);
+ span = (unsigned char)(max - min + 1);
+ *minbits = H5Z__scaleoffset_log2((unsigned long long)span);
}
- *minval = (unsigned long long)min;
+ else /* minbits already set, only calculate min */
+ H5Z_scaleoffset_min_2(i, d_nelmts, buf,
+ min) if (*minbits !=
+ sizeof(signed char) *
+ 8) /* change values if minbits != full precision */
+ for (i = 0; i < d_nelmts; i++) buf[i] = (signed char)(buf[i] - min);
}
+ *minval = (unsigned long long)min;
+ }
else if (type == t_short)
- H5Z_scaleoffset_precompress_2(short, data, d_nelmts, filavail, cd_values, minbits,
- minval) else if (type == t_int)
- H5Z_scaleoffset_precompress_2(int, data, d_nelmts, filavail, cd_values, minbits,
- minval) else if (type == t_long)
- H5Z_scaleoffset_precompress_2(long, data, d_nelmts, filavail, cd_values, minbits,
- minval) else if (type == t_long_long)
- H5Z_scaleoffset_precompress_2(long long, data, d_nelmts, filavail, cd_values, minbits,
- minval)
+ H5Z_scaleoffset_precompress_2(short, data, d_nelmts, filavail, cd_values, minbits, minval);
+ else if (type == t_int)
+ H5Z_scaleoffset_precompress_2(int, data, d_nelmts, filavail, cd_values, minbits, minval);
+ else if (type == t_long)
+ H5Z_scaleoffset_precompress_2(long, data, d_nelmts, filavail, cd_values, minbits, minval);
+ else if (type == t_long_long)
+ H5Z_scaleoffset_precompress_2(long long, data, d_nelmts, filavail, cd_values, minbits, minval);
}
/* postdecompress for integer type */
static void
-H5Z_scaleoffset_postdecompress_i(void *data, unsigned d_nelmts, enum H5Z_scaleoffset_t type,
- unsigned filavail, const unsigned cd_values[], uint32_t minbits,
- unsigned long long minval)
+H5Z__scaleoffset_postdecompress_i(void *data, unsigned d_nelmts, enum H5Z_scaleoffset_t type,
+ unsigned filavail, const unsigned cd_values[], uint32_t minbits,
+ unsigned long long minval)
{
long long sminval = *(long long *)&minval; /* for signed integer types */
if (type == t_uchar)
- H5Z_scaleoffset_postdecompress_1(unsigned char, data, d_nelmts, filavail, cd_values, minbits,
- minval) else if (type == t_ushort)
- H5Z_scaleoffset_postdecompress_1(unsigned short, data, d_nelmts, filavail, cd_values, minbits,
- minval) else if (type == t_uint)
- H5Z_scaleoffset_postdecompress_1(unsigned int, data, d_nelmts, filavail, cd_values, minbits,
- minval) else if (type == t_ulong)
- H5Z_scaleoffset_postdecompress_1(unsigned long, data, d_nelmts, filavail, cd_values,
- minbits, minval) else if (type == t_ulong_long)
- H5Z_scaleoffset_postdecompress_1(unsigned long long, data, d_nelmts, filavail,
- cd_values, minbits, minval) else if (type == t_schar)
- {
- signed char *buf = (signed char *)data, filval = 0;
- unsigned i;
-
- if (filavail == H5Z_SCALEOFFSET_FILL_DEFINED) { /* fill value defined */
- H5Z_scaleoffset_get_filval_1(signed char, cd_values, filval) for (i = 0; i < d_nelmts; i++)
- buf[i] =
- (signed char)((buf[i] == (((unsigned char)1 << minbits) - 1)) ? filval
- : (buf[i] + sminval));
- }
- else /* fill value undefined */
- for (i = 0; i < d_nelmts; i++)
- buf[i] = (signed char)(buf[i] + sminval);
+ H5Z_scaleoffset_postdecompress_1(unsigned char, data, d_nelmts, filavail, cd_values, minbits, minval);
+ else if (type == t_ushort)
+ H5Z_scaleoffset_postdecompress_1(unsigned short, data, d_nelmts, filavail, cd_values, minbits,
+ minval);
+ else if (type == t_uint)
+ H5Z_scaleoffset_postdecompress_1(unsigned int, data, d_nelmts, filavail, cd_values, minbits, minval);
+ else if (type == t_ulong)
+ H5Z_scaleoffset_postdecompress_1(unsigned long, data, d_nelmts, filavail, cd_values, minbits, minval);
+ else if (type == t_ulong_long)
+ H5Z_scaleoffset_postdecompress_1(unsigned long long, data, d_nelmts, filavail, cd_values, minbits,
+ minval);
+ else if (type == t_schar) {
+ signed char *buf = (signed char *)data, filval = 0;
+ unsigned i;
+
+ if (filavail == H5Z_SCALEOFFSET_FILL_DEFINED) { /* fill value defined */
+ H5Z_scaleoffset_get_filval_1(signed char, cd_values, filval) for (i = 0; i < d_nelmts;
+ i++) buf[i] =
+ (signed char)((buf[i] == (((unsigned char)1 << minbits) - 1)) ? filval : (buf[i] + sminval));
}
+ else /* fill value undefined */
+ for (i = 0; i < d_nelmts; i++)
+ buf[i] = (signed char)(buf[i] + sminval);
+ }
else if (type == t_short)
- H5Z_scaleoffset_postdecompress_2(short, data, d_nelmts, filavail, cd_values, minbits,
- sminval) else if (type == t_int)
- H5Z_scaleoffset_postdecompress_2(int, data, d_nelmts, filavail, cd_values, minbits,
- sminval) else if (type == t_long)
- H5Z_scaleoffset_postdecompress_2(long, data, d_nelmts, filavail, cd_values, minbits,
- sminval) else if (type == t_long_long)
- H5Z_scaleoffset_postdecompress_2(long long, data, d_nelmts, filavail, cd_values, minbits,
- sminval)
+ H5Z_scaleoffset_postdecompress_2(short, data, d_nelmts, filavail, cd_values, minbits, sminval);
+ else if (type == t_int)
+ H5Z_scaleoffset_postdecompress_2(int, data, d_nelmts, filavail, cd_values, minbits, sminval);
+ else if (type == t_long)
+ H5Z_scaleoffset_postdecompress_2(long, data, d_nelmts, filavail, cd_values, minbits, sminval);
+ else if (type == t_long_long)
+ H5Z_scaleoffset_postdecompress_2(long long, data, d_nelmts, filavail, cd_values, minbits, sminval);
}
/* precompress for floating-point type, variable-minimum-bits method
success: non-negative, failure: negative 4/15/05 */
static herr_t
-H5Z_scaleoffset_precompress_fd(void *data, unsigned d_nelmts, enum H5Z_scaleoffset_t type, unsigned filavail,
- const unsigned cd_values[], uint32_t *minbits, unsigned long long *minval,
- double D_val)
+H5Z__scaleoffset_precompress_fd(void *data, unsigned d_nelmts, enum H5Z_scaleoffset_t type, unsigned filavail,
+ const unsigned cd_values[], uint32_t *minbits, unsigned long long *minval,
+ double D_val)
{
herr_t ret_value = SUCCEED; /* Return value */
- FUNC_ENTER_NOAPI_NOINIT
+ FUNC_ENTER_STATIC
if (type == t_float)
H5Z_scaleoffset_precompress_3(float, HDpowf, HDfabsf, HDroundf, HDlroundf, HDllroundf, data, d_nelmts,
- filavail, cd_values, minbits, minval, D_val) else if (type == t_double)
- H5Z_scaleoffset_precompress_3(double, HDpow, HDfabs, HDround, HDlround, HDllround, data, d_nelmts,
- filavail, cd_values, minbits, minval, D_val)
+ filavail, cd_values, minbits, minval, D_val);
+ else if (type == t_double)
+ H5Z_scaleoffset_precompress_3(double, HDpow, HDfabs, HDround, HDlround, HDllround, data, d_nelmts,
+ filavail, cd_values, minbits, minval, D_val);
- done : FUNC_LEAVE_NOAPI(ret_value)
+done:
+ FUNC_LEAVE_NOAPI(ret_value)
}
/* postdecompress for floating-point type, variable-minimum-bits method
success: non-negative, failure: negative 4/15/05 */
static herr_t
-H5Z_scaleoffset_postdecompress_fd(void *data, unsigned d_nelmts, enum H5Z_scaleoffset_t type,
- unsigned filavail, const unsigned cd_values[], uint32_t minbits,
- unsigned long long minval, double D_val)
+H5Z__scaleoffset_postdecompress_fd(void *data, unsigned d_nelmts, enum H5Z_scaleoffset_t type,
+ unsigned filavail, const unsigned cd_values[], uint32_t minbits,
+ unsigned long long minval, double D_val)
{
long long sminval = (long long)minval; /* for signed integer types */
herr_t ret_value = SUCCEED; /* Return value */
- FUNC_ENTER_NOAPI_NOINIT
+ FUNC_ENTER_STATIC
if (type == t_float)
H5Z_scaleoffset_postdecompress_3(float, HDpowf, data, d_nelmts, filavail, cd_values, minbits, sminval,
- D_val) else if (type == t_double)
- H5Z_scaleoffset_postdecompress_3(double, HDpow, data, d_nelmts, filavail, cd_values, minbits,
- sminval, D_val)
+ D_val);
+ else if (type == t_double)
+ H5Z_scaleoffset_postdecompress_3(double, HDpow, data, d_nelmts, filavail, cd_values, minbits, sminval,
+ D_val);
- done : FUNC_LEAVE_NOAPI(ret_value)
+done:
+ FUNC_LEAVE_NOAPI(ret_value)
}
static void
-H5Z_scaleoffset_next_byte(size_t *j, unsigned *buf_len)
+H5Z__scaleoffset_next_byte(size_t *j, unsigned *buf_len)
{
++(*j);
*buf_len = 8 * sizeof(unsigned char);
}
static void
-H5Z_scaleoffset_decompress_one_byte(unsigned char *data, size_t data_offset, unsigned k, unsigned begin_i,
- unsigned char *buffer, size_t *j, unsigned *buf_len, parms_atomic p,
- unsigned dtype_len)
+H5Z__scaleoffset_decompress_one_byte(unsigned char *data, size_t data_offset, unsigned k, unsigned begin_i,
+ const unsigned char *buffer, size_t *j, unsigned *buf_len,
+ parms_atomic p, unsigned dtype_len)
{
unsigned dat_len; /* dat_len is the number of bits to be copied in each data byte */
unsigned char val; /* value to be copied in each data byte */
@@ -1639,7 +1630,7 @@ H5Z_scaleoffset_decompress_one_byte(unsigned char *data, size_t data_offset, uns
data[data_offset + k] =
(unsigned char)((val & ~((unsigned)(~0) << *buf_len)) << (dat_len - *buf_len));
dat_len -= *buf_len;
- H5Z_scaleoffset_next_byte(j, buf_len);
+ H5Z__scaleoffset_next_byte(j, buf_len);
if (dat_len == 0)
return;
@@ -1651,8 +1642,8 @@ H5Z_scaleoffset_decompress_one_byte(unsigned char *data, size_t data_offset, uns
}
static void
-H5Z_scaleoffset_decompress_one_atomic(unsigned char *data, size_t data_offset, unsigned char *buffer,
- size_t *j, unsigned *buf_len, parms_atomic p)
+H5Z__scaleoffset_decompress_one_atomic(unsigned char *data, size_t data_offset, unsigned char *buffer,
+ size_t *j, unsigned *buf_len, parms_atomic p)
{
/* begin_i: the index of byte having first significant bit */
unsigned begin_i;
@@ -1667,8 +1658,8 @@ H5Z_scaleoffset_decompress_one_atomic(unsigned char *data, size_t data_offset, u
begin_i = p.size - 1 - (dtype_len - p.minbits) / 8;
for (k = (int)begin_i; k >= 0; k--)
- H5Z_scaleoffset_decompress_one_byte(data, data_offset, (unsigned)k, begin_i, buffer, j, buf_len,
- p, dtype_len);
+ H5Z__scaleoffset_decompress_one_byte(data, data_offset, (unsigned)k, begin_i, buffer, j, buf_len,
+ p, dtype_len);
}
else { /* big endian */
HDassert(p.mem_order == H5Z_SCALEOFFSET_ORDER_BE);
@@ -1676,13 +1667,13 @@ H5Z_scaleoffset_decompress_one_atomic(unsigned char *data, size_t data_offset, u
begin_i = (dtype_len - p.minbits) / 8;
for (k = (int)begin_i; k <= (int)(p.size - 1); k++)
- H5Z_scaleoffset_decompress_one_byte(data, data_offset, (unsigned)k, begin_i, buffer, j, buf_len,
- p, dtype_len);
+ H5Z__scaleoffset_decompress_one_byte(data, data_offset, (unsigned)k, begin_i, buffer, j, buf_len,
+ p, dtype_len);
}
}
static void
-H5Z_scaleoffset_decompress(unsigned char *data, unsigned d_nelmts, unsigned char *buffer, parms_atomic p)
+H5Z__scaleoffset_decompress(unsigned char *data, unsigned d_nelmts, unsigned char *buffer, parms_atomic p)
{
/* i: index of data, j: index of buffer,
buf_len: number of bits to be filled in current byte */
@@ -1699,13 +1690,13 @@ H5Z_scaleoffset_decompress(unsigned char *data, unsigned d_nelmts, unsigned char
/* decompress */
for (i = 0; i < d_nelmts; i++)
- H5Z_scaleoffset_decompress_one_atomic(data, i * p.size, buffer, &j, &buf_len, p);
+ H5Z__scaleoffset_decompress_one_atomic(data, i * p.size, buffer, &j, &buf_len, p);
}
static void
-H5Z_scaleoffset_compress_one_byte(unsigned char *data, size_t data_offset, unsigned k, unsigned begin_i,
- unsigned char *buffer, size_t *j, unsigned *buf_len, parms_atomic p,
- unsigned dtype_len)
+H5Z__scaleoffset_compress_one_byte(const unsigned char *data, size_t data_offset, unsigned k,
+ unsigned begin_i, unsigned char *buffer, size_t *j, unsigned *buf_len,
+ parms_atomic p, unsigned dtype_len)
{
unsigned dat_len; /* dat_len is the number of bits to be copied in each data byte */
unsigned char val; /* value to be copied in each data byte */
@@ -1725,7 +1716,7 @@ H5Z_scaleoffset_compress_one_byte(unsigned char *data, size_t data_offset, unsig
buffer[*j] |=
(unsigned char)((unsigned)(val >> (dat_len - *buf_len)) & ~((unsigned)(~0) << *buf_len));
dat_len -= *buf_len;
- H5Z_scaleoffset_next_byte(j, buf_len);
+ H5Z__scaleoffset_next_byte(j, buf_len);
if (dat_len == 0)
return;
@@ -1735,8 +1726,8 @@ H5Z_scaleoffset_compress_one_byte(unsigned char *data, size_t data_offset, unsig
}
static void
-H5Z_scaleoffset_compress_one_atomic(unsigned char *data, size_t data_offset, unsigned char *buffer, size_t *j,
- unsigned *buf_len, parms_atomic p)
+H5Z__scaleoffset_compress_one_atomic(unsigned char *data, size_t data_offset, unsigned char *buffer,
+ size_t *j, unsigned *buf_len, parms_atomic p)
{
/* begin_i: the index of byte having first significant bit */
unsigned begin_i;
@@ -1751,22 +1742,22 @@ H5Z_scaleoffset_compress_one_atomic(unsigned char *data, size_t data_offset, uns
begin_i = p.size - 1 - (dtype_len - p.minbits) / 8;
for (k = (int)begin_i; k >= 0; k--)
- H5Z_scaleoffset_compress_one_byte(data, data_offset, (unsigned)k, begin_i, buffer, j, buf_len, p,
- dtype_len);
+ H5Z__scaleoffset_compress_one_byte(data, data_offset, (unsigned)k, begin_i, buffer, j, buf_len, p,
+ dtype_len);
}
else { /* big endian */
HDassert(p.mem_order == H5Z_SCALEOFFSET_ORDER_BE);
begin_i = (dtype_len - p.minbits) / 8;
for (k = (int)begin_i; k <= (int)(p.size - 1); k++)
- H5Z_scaleoffset_compress_one_byte(data, data_offset, (unsigned)k, begin_i, buffer, j, buf_len, p,
- dtype_len);
+ H5Z__scaleoffset_compress_one_byte(data, data_offset, (unsigned)k, begin_i, buffer, j, buf_len, p,
+ dtype_len);
}
}
static void
-H5Z_scaleoffset_compress(unsigned char *data, unsigned d_nelmts, unsigned char *buffer, size_t buffer_size,
- parms_atomic p)
+H5Z__scaleoffset_compress(unsigned char *data, unsigned d_nelmts, unsigned char *buffer, size_t buffer_size,
+ parms_atomic p)
{
/* i: index of data, j: index of buffer,
buf_len: number of bits to be filled in current byte */
@@ -1783,5 +1774,5 @@ H5Z_scaleoffset_compress(unsigned char *data, unsigned d_nelmts, unsigned char *
/* compress */
for (i = 0; i < d_nelmts; i++)
- H5Z_scaleoffset_compress_one_atomic(data, i * p.size, buffer, &j, &buf_len, p);
+ H5Z__scaleoffset_compress_one_atomic(data, i * p.size, buffer, &j, &buf_len, p);
}
diff --git a/src/H5Zshuffle.c b/src/H5Zshuffle.c
index 619fe2f..df164b3 100644
--- a/src/H5Zshuffle.c
+++ b/src/H5Zshuffle.c
@@ -22,27 +22,27 @@
#include "H5Zpkg.h" /* Data filters */
/* Local function prototypes */
-static herr_t H5Z_set_local_shuffle(hid_t dcpl_id, hid_t type_id, hid_t space_id);
-static size_t H5Z_filter_shuffle(unsigned flags, size_t cd_nelmts, const unsigned cd_values[], size_t nbytes,
- size_t *buf_size, void **buf);
+static herr_t H5Z__set_local_shuffle(hid_t dcpl_id, hid_t type_id, hid_t space_id);
+static size_t H5Z__filter_shuffle(unsigned flags, size_t cd_nelmts, const unsigned cd_values[], size_t nbytes,
+ size_t *buf_size, void **buf);
/* This message derives from H5Z */
const H5Z_class2_t H5Z_SHUFFLE[1] = {{
- H5Z_CLASS_T_VERS, /* H5Z_class_t version */
- H5Z_FILTER_SHUFFLE, /* Filter id number */
- 1, /* encoder_present flag (set to true) */
- 1, /* decoder_present flag (set to true) */
- "shuffle", /* Filter name for debugging */
- NULL, /* The "can apply" callback */
- H5Z_set_local_shuffle, /* The "set local" callback */
- H5Z_filter_shuffle, /* The actual filter function */
+ H5Z_CLASS_T_VERS, /* H5Z_class_t version */
+ H5Z_FILTER_SHUFFLE, /* Filter id number */
+ 1, /* encoder_present flag (set to true) */
+ 1, /* decoder_present flag (set to true) */
+ "shuffle", /* Filter name for debugging */
+ NULL, /* The "can apply" callback */
+ H5Z__set_local_shuffle, /* The "set local" callback */
+ H5Z__filter_shuffle, /* The actual filter function */
}};
/* Local macros */
#define H5Z_SHUFFLE_PARM_SIZE 0 /* "Local" parameter for shuffling size */
/*-------------------------------------------------------------------------
- * Function: H5Z_set_local_shuffle
+ * Function: H5Z__set_local_shuffle
*
* Purpose: Set the "local" dataset parameter for data shuffling to be
* the size of the datatype.
@@ -53,12 +53,10 @@ const H5Z_class2_t H5Z_SHUFFLE[1] = {{
* Programmer: Quincey Koziol
* Monday, April 7, 2003
*
- * Modifications:
- *
*-------------------------------------------------------------------------
*/
static herr_t
-H5Z_set_local_shuffle(hid_t dcpl_id, hid_t type_id, hid_t H5_ATTR_UNUSED space_id)
+H5Z__set_local_shuffle(hid_t dcpl_id, hid_t type_id, hid_t H5_ATTR_UNUSED space_id)
{
H5P_genplist_t *dcpl_plist; /* Property list pointer */
const H5T_t * type; /* Datatype */
@@ -67,11 +65,11 @@ H5Z_set_local_shuffle(hid_t dcpl_id, hid_t type_id, hid_t H5_ATTR_UNUSED space_i
unsigned cd_values[H5Z_SHUFFLE_TOTAL_NPARMS]; /* Filter parameters */
herr_t ret_value = SUCCEED; /* Return value */
- FUNC_ENTER_NOAPI(FAIL)
+ FUNC_ENTER_STATIC
/* Get the plist structure */
if (NULL == (dcpl_plist = H5P_object_verify(dcpl_id, H5P_DATASET_CREATE)))
- HGOTO_ERROR(H5E_ATOM, H5E_BADATOM, FAIL, "can't find object for ID")
+ HGOTO_ERROR(H5E_ID, H5E_BADID, FAIL, "can't find object for ID")
/* Get datatype */
if (NULL == (type = (const H5T_t *)H5I_object_verify(type_id, H5I_DATATYPE)))
@@ -93,10 +91,10 @@ H5Z_set_local_shuffle(hid_t dcpl_id, hid_t type_id, hid_t H5_ATTR_UNUSED space_i
done:
FUNC_LEAVE_NOAPI(ret_value)
-} /* end H5Z_set_local_shuffle() */
+} /* end H5Z__set_local_shuffle() */
/*-------------------------------------------------------------------------
- * Function: H5Z_filter_shuffle
+ * Function: H5Z__filter_shuffle
*
* Purpose: Implement an I/O filter which "de-interlaces" a block of data
* by putting all the bytes in a byte-position for each element
@@ -111,15 +109,11 @@ done:
* Programmer: Kent Yang
* Wednesday, November 13, 2002
*
- * Modifications:
- * Quincey Koziol, November 13, 2002
- * Cleaned up code.
- *
*-------------------------------------------------------------------------
*/
static size_t
-H5Z_filter_shuffle(unsigned flags, size_t cd_nelmts, const unsigned cd_values[], size_t nbytes,
- size_t *buf_size, void **buf)
+H5Z__filter_shuffle(unsigned flags, size_t cd_nelmts, const unsigned cd_values[], size_t nbytes,
+ size_t *buf_size, void **buf)
{
void * dest = NULL; /* Buffer to deposit [un]shuffled bytes into */
unsigned char *_src = NULL; /* Alias for source buffer */
@@ -133,7 +127,7 @@ H5Z_filter_shuffle(unsigned flags, size_t cd_nelmts, const unsigned cd_values[],
size_t leftover; /* Extra bytes at end of buffer */
size_t ret_value = 0; /* Return value */
- FUNC_ENTER_NOAPI(0)
+ FUNC_ENTER_STATIC
/* Check arguments */
if (cd_nelmts != H5Z_SHUFFLE_TOTAL_NPARMS || cd_values[H5Z_SHUFFLE_PARM_SIZE] == 0)
@@ -183,24 +177,31 @@ H5Z_filter_shuffle(unsigned flags, size_t cd_nelmts, const unsigned cd_values[],
case 0:
do {
DUFF_GUTS
+ /* FALLTHROUGH */
H5_ATTR_FALLTHROUGH
case 7:
DUFF_GUTS
+ /* FALLTHROUGH */
H5_ATTR_FALLTHROUGH
case 6:
DUFF_GUTS
+ /* FALLTHROUGH */
H5_ATTR_FALLTHROUGH
case 5:
DUFF_GUTS
+ /* FALLTHROUGH */
H5_ATTR_FALLTHROUGH
case 4:
DUFF_GUTS
+ /* FALLTHROUGH */
H5_ATTR_FALLTHROUGH
case 3:
DUFF_GUTS
+ /* FALLTHROUGH */
H5_ATTR_FALLTHROUGH
case 2:
DUFF_GUTS
+ /* FALLTHROUGH */
H5_ATTR_FALLTHROUGH
case 1:
DUFF_GUTS
@@ -247,24 +248,31 @@ H5Z_filter_shuffle(unsigned flags, size_t cd_nelmts, const unsigned cd_values[],
case 0:
do {
DUFF_GUTS
+ /* FALLTHROUGH */
H5_ATTR_FALLTHROUGH
case 7:
DUFF_GUTS
+ /* FALLTHROUGH */
H5_ATTR_FALLTHROUGH
case 6:
DUFF_GUTS
+ /* FALLTHROUGH */
H5_ATTR_FALLTHROUGH
case 5:
DUFF_GUTS
+ /* FALLTHROUGH */
H5_ATTR_FALLTHROUGH
case 4:
DUFF_GUTS
+ /* FALLTHROUGH */
H5_ATTR_FALLTHROUGH
case 3:
DUFF_GUTS
+ /* FALLTHROUGH */
H5_ATTR_FALLTHROUGH
case 2:
DUFF_GUTS
+ /* FALLTHROUGH */
H5_ATTR_FALLTHROUGH
case 1:
DUFF_GUTS
diff --git a/src/H5Zszip.c b/src/H5Zszip.c
index 031487e..a5b544a 100644
--- a/src/H5Zszip.c
+++ b/src/H5Zszip.c
@@ -31,25 +31,25 @@
#endif
/* Local function prototypes */
-static htri_t H5Z_can_apply_szip(hid_t dcpl_id, hid_t type_id, hid_t space_id);
-static herr_t H5Z_set_local_szip(hid_t dcpl_id, hid_t type_id, hid_t space_id);
-static size_t H5Z_filter_szip(unsigned flags, size_t cd_nelmts, const unsigned cd_values[], size_t nbytes,
- size_t *buf_size, void **buf);
+static htri_t H5Z__can_apply_szip(hid_t dcpl_id, hid_t type_id, hid_t space_id);
+static herr_t H5Z__set_local_szip(hid_t dcpl_id, hid_t type_id, hid_t space_id);
+static size_t H5Z__filter_szip(unsigned flags, size_t cd_nelmts, const unsigned cd_values[], size_t nbytes,
+ size_t *buf_size, void **buf);
/* This message derives from H5Z */
H5Z_class2_t H5Z_SZIP[1] = {{
- H5Z_CLASS_T_VERS, /* H5Z_class_t version */
- H5Z_FILTER_SZIP, /* Filter id number */
- 1, /* Assume encoder present: check before registering */
- 1, /* decoder_present flag (set to true) */
- "szip", /* Filter name for debugging */
- H5Z_can_apply_szip, /* The "can apply" callback */
- H5Z_set_local_szip, /* The "set local" callback */
- H5Z_filter_szip, /* The actual filter function */
+ H5Z_CLASS_T_VERS, /* H5Z_class_t version */
+ H5Z_FILTER_SZIP, /* Filter id number */
+ 1, /* Assume encoder present: check before registering */
+ 1, /* decoder_present flag (set to true) */
+ "szip", /* Filter name for debugging */
+ H5Z__can_apply_szip, /* The "can apply" callback */
+ H5Z__set_local_szip, /* The "set local" callback */
+ H5Z__filter_szip, /* The actual filter function */
}};
/*-------------------------------------------------------------------------
- * Function: H5Z_can_apply_szip
+ * Function: H5Z__can_apply_szip
*
* Purpose: Check the parameters for szip compression for validity and
* whether they fit a particular dataset.
@@ -70,14 +70,14 @@ H5Z_class2_t H5Z_SZIP[1] = {{
*-------------------------------------------------------------------------
*/
static htri_t
-H5Z_can_apply_szip(hid_t H5_ATTR_UNUSED dcpl_id, hid_t type_id, hid_t H5_ATTR_UNUSED space_id)
+H5Z__can_apply_szip(hid_t H5_ATTR_UNUSED dcpl_id, hid_t type_id, hid_t H5_ATTR_UNUSED space_id)
{
const H5T_t *type; /* Datatype */
unsigned dtype_size; /* Datatype's size (in bits) */
H5T_order_t dtype_order; /* Datatype's endianness order */
htri_t ret_value = TRUE; /* Return value */
- FUNC_ENTER_NOAPI(FAIL)
+ FUNC_ENTER_STATIC
/* Get datatype */
if (NULL == (type = (H5T_t *)H5I_object_verify(type_id, H5I_DATATYPE)))
@@ -102,10 +102,10 @@ H5Z_can_apply_szip(hid_t H5_ATTR_UNUSED dcpl_id, hid_t type_id, hid_t H5_ATTR_UN
done:
FUNC_LEAVE_NOAPI(ret_value)
-} /* end H5Z_can_apply_szip() */
+} /* end H5Z__can_apply_szip() */
/*-------------------------------------------------------------------------
- * Function: H5Z_set_local_szip
+ * Function: H5Z__set_local_szip
*
* Purpose: Set the "local" dataset parameters for szip compression.
*
@@ -115,18 +115,10 @@ done:
* Programmer: Quincey Koziol
* Monday, April 7, 2003
*
- * Modifications: Used new logic to set the size of the scanline parameter.
- * Now SZIP compression can be applied to the chunk
- * of any shape and size with only one restriction: the number
- * of elements in the chunk has to be not less than number
- * of elements (pixels) in the block (cd_values[H5Z_SZIP_PARM_PPB]
- * parameter).
- * Elena Pourmal, July 20, 2004
- *
*-------------------------------------------------------------------------
*/
static herr_t
-H5Z_set_local_szip(hid_t dcpl_id, hid_t type_id, hid_t space_id)
+H5Z__set_local_szip(hid_t dcpl_id, hid_t type_id, hid_t space_id)
{
H5P_genplist_t *dcpl_plist; /* Property list pointer */
const H5T_t * type; /* Datatype */
@@ -143,11 +135,11 @@ H5Z_set_local_szip(hid_t dcpl_id, hid_t type_id, hid_t space_id)
hsize_t scanline; /* Size of dataspace's fastest changing dimension */
herr_t ret_value = SUCCEED; /* Return value */
- FUNC_ENTER_NOAPI(FAIL)
+ FUNC_ENTER_STATIC
/* Get the plist structure */
if (NULL == (dcpl_plist = H5P_object_verify(dcpl_id, H5P_DATASET_CREATE)))
- HGOTO_ERROR(H5E_ATOM, H5E_BADATOM, FAIL, "can't find object for ID")
+ HGOTO_ERROR(H5E_ID, H5E_BADID, FAIL, "can't find object for ID")
/* Get datatype */
if (NULL == (type = (H5T_t *)H5I_object_verify(type_id, H5I_DATATYPE)))
@@ -250,10 +242,10 @@ H5Z_set_local_szip(hid_t dcpl_id, hid_t type_id, hid_t space_id)
done:
FUNC_LEAVE_NOAPI(ret_value)
-} /* end H5Z_set_local_szip() */
+} /* end H5Z__set_local_szip() */
/*-------------------------------------------------------------------------
- * Function: H5Z_filter_szip
+ * Function: H5Z__filter_szip
*
* Purpose: Implement an I/O filter around the 'rice' algorithm in
* libsz
@@ -267,8 +259,8 @@ done:
*-------------------------------------------------------------------------
*/
static size_t
-H5Z_filter_szip(unsigned flags, size_t cd_nelmts, const unsigned cd_values[], size_t nbytes, size_t *buf_size,
- void **buf)
+H5Z__filter_szip(unsigned flags, size_t cd_nelmts, const unsigned cd_values[], size_t nbytes,
+ size_t *buf_size, void **buf)
{
size_t ret_value = 0; /* Return value */
size_t size_out = 0; /* Size of output buffer */
@@ -276,7 +268,7 @@ H5Z_filter_szip(unsigned flags, size_t cd_nelmts, const unsigned cd_values[], si
unsigned char *newbuf = NULL; /* Pointer to input buffer */
SZ_com_t sz_param; /* szip parameter block */
- FUNC_ENTER_NOAPI(0)
+ FUNC_ENTER_STATIC
/* Sanity check to make certain that we haven't drifted out of date with
* the mask options from the szlib.h header */
diff --git a/src/H5Ztrans.c b/src/H5Ztrans.c
index 9a24639..7d55efd 100644
--- a/src/H5Ztrans.c
+++ b/src/H5Ztrans.c
@@ -13,12 +13,12 @@
#include "H5Zmodule.h" /* This source code file is part of the H5Z module */
-#include "H5private.h" /* Generic Functions */
-#include "H5Eprivate.h" /* Error handling */
-#include "H5Iprivate.h" /* IDs */
-#include "H5MMprivate.h" /* Memory management */
-#include "H5VMprivate.h" /* H5VM_array_fill */
-#include "H5Zpkg.h" /* Data filters */
+#include "H5private.h" /* Generic Functions */
+#include "H5Eprivate.h" /* Error handling */
+#include "H5Iprivate.h" /* IDs */
+#include "H5MMprivate.h" /* Memory management */
+#include "H5VMprivate.h" /* H5VM_array_fill */
+#include "H5Zpkg.h" /* Data filters */
/* Token types */
typedef enum {
@@ -81,26 +81,21 @@ typedef struct {
} H5Z_token;
/* Local function prototypes */
-static H5Z_token *H5Z_get_token(H5Z_token *current);
-static H5Z_node * H5Z_parse_expression(H5Z_token *current, H5Z_datval_ptrs *dat_val_pointers);
-static H5Z_node * H5Z_parse_term(H5Z_token *current, H5Z_datval_ptrs *dat_val_pointers);
-static H5Z_node * H5Z_parse_factor(H5Z_token *current, H5Z_datval_ptrs *dat_val_pointers);
-static H5Z_node * H5Z_new_node(H5Z_token_type type);
-static void H5Z_do_op(H5Z_node *tree);
-static hbool_t H5Z_op_is_numbs(H5Z_node *_tree);
-static hbool_t H5Z_op_is_numbs2(H5Z_node *_tree);
-static hid_t H5Z_xform_find_type(const H5T_t *type);
-static herr_t H5Z_xform_eval_full(H5Z_node *tree, const size_t array_size, const hid_t array_type,
- H5Z_result *res);
-static void H5Z_xform_destroy_parse_tree(H5Z_node *tree);
-static void * H5Z_xform_parse(const char *expression, H5Z_datval_ptrs *dat_val_pointers);
-static void * H5Z_xform_copy_tree(H5Z_node *tree, H5Z_datval_ptrs *dat_val_pointers,
- H5Z_datval_ptrs *new_dat_val_pointers);
-static void H5Z_xform_reduce_tree(H5Z_node *tree);
-#ifdef H5Z_XFORM_DEBUG
-static void H5Z_XFORM_DEBUG(H5Z_node *tree);
-static void H5Z_print(H5Z_node *tree, FILE *stream);
-#endif /* H5Z_XFORM_DEBUG */
+static H5Z_token *H5Z__get_token(H5Z_token *current);
+static H5Z_node * H5Z__parse_expression(H5Z_token *current, H5Z_datval_ptrs *dat_val_pointers);
+static H5Z_node * H5Z__parse_term(H5Z_token *current, H5Z_datval_ptrs *dat_val_pointers);
+static H5Z_node * H5Z__parse_factor(H5Z_token *current, H5Z_datval_ptrs *dat_val_pointers);
+static H5Z_node * H5Z__new_node(H5Z_token_type type);
+static void H5Z__do_op(H5Z_node *tree);
+static hbool_t H5Z__op_is_numbs(H5Z_node *_tree);
+static hbool_t H5Z__op_is_numbs2(H5Z_node *_tree);
+static hid_t H5Z__xform_find_type(const H5T_t *type);
+static herr_t H5Z__xform_eval_full(H5Z_node *tree, size_t array_size, hid_t array_type, H5Z_result *res);
+static void H5Z__xform_destroy_parse_tree(H5Z_node *tree);
+static void * H5Z__xform_parse(const char *expression, H5Z_datval_ptrs *dat_val_pointers);
+static void * H5Z__xform_copy_tree(H5Z_node *tree, H5Z_datval_ptrs *dat_val_pointers,
+ H5Z_datval_ptrs *new_dat_val_pointers);
+static void H5Z__xform_reduce_tree(H5Z_node *tree);
/* PGCC (11.8-0) has trouble with the command *p++ = *p OP tree_val. It increments P first before
* doing the operation. So I break down the command into two lines:
@@ -310,12 +305,12 @@ static void H5Z_print(H5Z_node *tree, FILE *stream);
ret_value->type = (TYPE); \
if (tree->lchild) \
ret_value->lchild = \
- (H5Z_node *)H5Z_xform_copy_tree(tree->lchild, dat_val_pointers, new_dat_val_pointers); \
+ (H5Z_node *)H5Z__xform_copy_tree(tree->lchild, dat_val_pointers, new_dat_val_pointers); \
else \
ret_value->lchild = NULL; \
if (tree->rchild) \
ret_value->rchild = \
- (H5Z_node *)H5Z_xform_copy_tree(tree->rchild, dat_val_pointers, new_dat_val_pointers); \
+ (H5Z_node *)H5Z__xform_copy_tree(tree->rchild, dat_val_pointers, new_dat_val_pointers); \
else \
ret_value->rchild = NULL; \
} \
@@ -330,7 +325,7 @@ static void H5Z_print(H5Z_node *tree, FILE *stream);
/* The difference of this macro from H5Z_XFORM_DO_OP3 is that it handles the operations when the left operand
* is empty, like -x or +x. The reason that it's separated from H5Z_XFORM_DO_OP3 is because compilers don't
- * accept operations like *x or /x. So in H5Z_do_op, these two macros are called in different ways. (SLU
+ * accept operations like *x or /x. So in H5Z__do_op, these two macros are called in different ways. (SLU
* 2012/3/20)
*/
#define H5Z_XFORM_DO_OP6(OP) \
@@ -371,7 +366,7 @@ static void H5Z_print(H5Z_node *tree, FILE *stream);
}
/*
- * Programmer: Bill Wendling <wendling@ncsa.uiuc.edu>
+ * Programmer: Bill Wendling
* 25. August 2003
*/
@@ -392,20 +387,23 @@ static void H5Z_print(H5Z_node *tree, FILE *stream);
*/
/*-------------------------------------------------------------------------
- * Function: H5Z_unget_token
+ * Function: H5Z__unget_token
+ *
* Purpose: Rollback the H5Z_token to the previous H5Z_token retrieved. There
* should only need to be one level of rollback necessary
* for our grammar.
+ *
* Return: Always succeeds.
+ *
* Programmer: Bill Wendling
* 26. August 2003
*
*-------------------------------------------------------------------------
*/
static void
-H5Z_unget_token(H5Z_token *current)
+H5Z__unget_token(H5Z_token *current)
{
- FUNC_ENTER_NOAPI_NOINIT_NOERR
+ FUNC_ENTER_STATIC_NOERR
/* check args */
HDassert(current);
@@ -418,7 +416,7 @@ H5Z_unget_token(H5Z_token *current)
}
/*-------------------------------------------------------------------------
- * Function: H5Z_get_token
+ * Function: H5Z__get_token
*
* Purpose: Determine what the next valid H5Z_token is in the expression
* string. The current position within the H5Z_token string is
@@ -436,11 +434,11 @@ H5Z_unget_token(H5Z_token *current)
*-------------------------------------------------------------------------
*/
static H5Z_token *
-H5Z_get_token(H5Z_token *current)
+H5Z__get_token(H5Z_token *current)
{
H5Z_token *ret_value = current;
- FUNC_ENTER_NOAPI_NOINIT
+ FUNC_ENTER_STATIC
/* check args */
HDassert(current);
@@ -567,7 +565,7 @@ done:
}
/*-------------------------------------------------------------------------
- * Function: H5Z_xform_destroy_parse_tree
+ * Function: H5Z__xform_destroy_parse_tree
* Purpose: Recursively destroys the expression tree.
* Return: Nothing
* Programmer: Bill Wendling
@@ -576,13 +574,13 @@ done:
*-------------------------------------------------------------------------
*/
static void
-H5Z_xform_destroy_parse_tree(H5Z_node *tree)
+H5Z__xform_destroy_parse_tree(H5Z_node *tree)
{
- FUNC_ENTER_NOAPI_NOINIT_NOERR
+ FUNC_ENTER_STATIC_NOERR
if (tree) {
- H5Z_xform_destroy_parse_tree(tree->lchild);
- H5Z_xform_destroy_parse_tree(tree->rchild);
+ H5Z__xform_destroy_parse_tree(tree->lchild);
+ H5Z__xform_destroy_parse_tree(tree->rchild);
H5MM_xfree(tree);
tree = NULL;
}
@@ -596,7 +594,7 @@ H5Z_xform_destroy_parse_tree(H5Z_node *tree)
* Purpose: Entry function for parsing the expression string.
*
* Return: Success: Valid H5Z_node ptr to an expression tree.
- * NULLure: NULL
+ * Failure: NULL
*
* Programmer: Bill Wendling
* 26. August 2003
@@ -604,12 +602,12 @@ H5Z_xform_destroy_parse_tree(H5Z_node *tree)
*-------------------------------------------------------------------------
*/
static void *
-H5Z_xform_parse(const char *expression, H5Z_datval_ptrs *dat_val_pointers)
+H5Z__xform_parse(const char *expression, H5Z_datval_ptrs *dat_val_pointers)
{
H5Z_token tok;
void * ret_value = NULL; /* Return value */
- FUNC_ENTER_NOAPI(NULL)
+ FUNC_ENTER_STATIC
if (!expression)
HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, NULL, "No expression provided?")
@@ -617,57 +615,58 @@ H5Z_xform_parse(const char *expression, H5Z_datval_ptrs *dat_val_pointers)
/* Set up the initial H5Z_token for parsing */
tok.tok_expr = tok.tok_begin = tok.tok_end = expression;
- ret_value = (void *)H5Z_parse_expression(&tok, dat_val_pointers);
+ ret_value = (void *)H5Z__parse_expression(&tok, dat_val_pointers);
- H5Z_xform_reduce_tree((H5Z_node *)ret_value);
+ H5Z__xform_reduce_tree((H5Z_node *)ret_value);
done:
FUNC_LEAVE_NOAPI(ret_value)
}
/*-------------------------------------------------------------------------
- * Function: H5Z_parse_expression
+ * Function: H5Z__parse_expression
* Purpose: Beginning of the recursive descent parser to parse the
* expression. An expression is:
*
* expr := term | term '+' term | term '-' term
*
* Return: Success: Valid H5Z_node ptr to expression tree
- * NULLure: NULL
+ * Failure: NULL
+ *
* Programmer: Bill Wendling
* 26. August 2003
*
*-------------------------------------------------------------------------
*/
static H5Z_node *
-H5Z_parse_expression(H5Z_token *current, H5Z_datval_ptrs *dat_val_pointers)
+H5Z__parse_expression(H5Z_token *current, H5Z_datval_ptrs *dat_val_pointers)
{
H5Z_node *expr;
H5Z_node *ret_value = NULL; /* Return value */
- FUNC_ENTER_NOAPI_NOINIT
+ FUNC_ENTER_STATIC
- expr = H5Z_parse_term(current, dat_val_pointers);
+ expr = H5Z__parse_term(current, dat_val_pointers);
for (;;) {
H5Z_node *new_node;
- current = H5Z_get_token(current);
+ current = H5Z__get_token(current);
switch (current->tok_type) {
case H5Z_XFORM_PLUS:
- new_node = H5Z_new_node(H5Z_XFORM_PLUS);
+ new_node = H5Z__new_node(H5Z_XFORM_PLUS);
if (!new_node) {
- H5Z_xform_destroy_parse_tree(expr);
+ H5Z__xform_destroy_parse_tree(expr);
HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "Unable to allocate new node")
}
new_node->lchild = expr;
- new_node->rchild = H5Z_parse_term(current, dat_val_pointers);
+ new_node->rchild = H5Z__parse_term(current, dat_val_pointers);
if (!new_node->rchild) {
- H5Z_xform_destroy_parse_tree(new_node);
+ H5Z__xform_destroy_parse_tree(new_node);
HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, NULL, "Error parsing data transform expression")
}
@@ -675,18 +674,18 @@ H5Z_parse_expression(H5Z_token *current, H5Z_datval_ptrs *dat_val_pointers)
break;
case H5Z_XFORM_MINUS:
- new_node = H5Z_new_node(H5Z_XFORM_MINUS);
+ new_node = H5Z__new_node(H5Z_XFORM_MINUS);
if (!new_node) {
- H5Z_xform_destroy_parse_tree(expr);
+ H5Z__xform_destroy_parse_tree(expr);
HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "Unable to allocate new node")
}
new_node->lchild = expr;
- new_node->rchild = H5Z_parse_term(current, dat_val_pointers);
+ new_node->rchild = H5Z__parse_term(current, dat_val_pointers);
if (!new_node->rchild) {
- H5Z_xform_destroy_parse_tree(new_node);
+ H5Z__xform_destroy_parse_tree(new_node);
HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, NULL, "Error parsing data transform expression")
}
@@ -694,7 +693,7 @@ H5Z_parse_expression(H5Z_token *current, H5Z_datval_ptrs *dat_val_pointers)
break;
case H5Z_XFORM_RPAREN:
- H5Z_unget_token(current);
+ H5Z__unget_token(current);
HGOTO_DONE(expr)
case H5Z_XFORM_END:
@@ -708,7 +707,7 @@ H5Z_parse_expression(H5Z_token *current, H5Z_datval_ptrs *dat_val_pointers)
case H5Z_XFORM_DIVIDE:
case H5Z_XFORM_LPAREN:
default:
- H5Z_xform_destroy_parse_tree(expr);
+ H5Z__xform_destroy_parse_tree(expr);
HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, NULL, "Error parsing data transform expression")
}
}
@@ -718,47 +717,48 @@ done:
}
/*-------------------------------------------------------------------------
- * Function: H5Z_parse_term
+ * Function: H5Z__parse_term
* Purpose: Parses a term in our expression language. A term is:
*
* term := factor | factor '*' factor | factor '/' factor
*
* Return: Success: Valid H5Z_node ptr to expression tree
- * NULLure: NULL
+ * Failure: NULL
+ *
* Programmer: Bill Wendling
* 26. August 2003
*
*-------------------------------------------------------------------------
*/
static H5Z_node *
-H5Z_parse_term(H5Z_token *current, H5Z_datval_ptrs *dat_val_pointers)
+H5Z__parse_term(H5Z_token *current, H5Z_datval_ptrs *dat_val_pointers)
{
H5Z_node *term = NULL;
H5Z_node *ret_value = NULL; /* Return value */
- FUNC_ENTER_NOAPI_NOINIT
+ FUNC_ENTER_STATIC
- term = H5Z_parse_factor(current, dat_val_pointers);
+ term = H5Z__parse_factor(current, dat_val_pointers);
for (;;) {
H5Z_node *new_node;
- current = H5Z_get_token(current);
+ current = H5Z__get_token(current);
switch (current->tok_type) {
case H5Z_XFORM_MULT:
- new_node = H5Z_new_node(H5Z_XFORM_MULT);
+ new_node = H5Z__new_node(H5Z_XFORM_MULT);
if (!new_node) {
- H5Z_xform_destroy_parse_tree(term);
+ H5Z__xform_destroy_parse_tree(term);
HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "Unable to allocate new node")
}
new_node->lchild = term;
- new_node->rchild = H5Z_parse_factor(current, dat_val_pointers);
+ new_node->rchild = H5Z__parse_factor(current, dat_val_pointers);
if (!new_node->rchild) {
- H5Z_xform_destroy_parse_tree(new_node);
+ H5Z__xform_destroy_parse_tree(new_node);
HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, NULL, "Error parsing data transform expression")
}
@@ -766,25 +766,25 @@ H5Z_parse_term(H5Z_token *current, H5Z_datval_ptrs *dat_val_pointers)
break;
case H5Z_XFORM_DIVIDE:
- new_node = H5Z_new_node(H5Z_XFORM_DIVIDE);
+ new_node = H5Z__new_node(H5Z_XFORM_DIVIDE);
if (!new_node) {
- H5Z_xform_destroy_parse_tree(term);
+ H5Z__xform_destroy_parse_tree(term);
HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "Unable to allocate new node")
}
new_node->lchild = term;
- new_node->rchild = H5Z_parse_factor(current, dat_val_pointers);
+ new_node->rchild = H5Z__parse_factor(current, dat_val_pointers);
term = new_node;
if (!new_node->rchild) {
- H5Z_xform_destroy_parse_tree(new_node);
+ H5Z__xform_destroy_parse_tree(new_node);
HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, NULL, "Error parsing data transform expression")
}
break;
case H5Z_XFORM_RPAREN:
- H5Z_unget_token(current);
+ H5Z__unget_token(current);
HGOTO_DONE(term)
case H5Z_XFORM_END:
@@ -796,12 +796,12 @@ H5Z_parse_term(H5Z_token *current, H5Z_datval_ptrs *dat_val_pointers)
case H5Z_XFORM_PLUS:
case H5Z_XFORM_MINUS:
case H5Z_XFORM_LPAREN:
- H5Z_unget_token(current);
+ H5Z__unget_token(current);
HGOTO_DONE(term)
case H5Z_XFORM_ERROR:
default:
- H5Z_xform_destroy_parse_tree(term);
+ H5Z__xform_destroy_parse_tree(term);
HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, NULL,
"bad transform type passed to data transform expression")
} /* end switch */
@@ -812,7 +812,7 @@ done:
}
/*-------------------------------------------------------------------------
- * Function: H5Z_parse_factor
+ * Function: H5Z__parse_factor
* Purpose: Parses a factor in our expression language. A factor is:
*
* factor := number | // C long or double
@@ -822,26 +822,27 @@ done:
* '(' expr ')'
*
* Return: Success: Valid H5Z_node ptr to expression tree
- * NULLure: NULL
+ * Failure: NULL
+ *
* Programmer: Bill Wendling
* 26. August 2003
*
*-------------------------------------------------------------------------
*/
static H5Z_node *
-H5Z_parse_factor(H5Z_token *current, H5Z_datval_ptrs *dat_val_pointers)
+H5Z__parse_factor(H5Z_token *current, H5Z_datval_ptrs *dat_val_pointers)
{
H5Z_node *factor = NULL;
H5Z_node *new_node;
H5Z_node *ret_value = NULL; /* Return value */
- FUNC_ENTER_NOAPI_NOINIT
+ FUNC_ENTER_STATIC
- current = H5Z_get_token(current);
+ current = H5Z__get_token(current);
switch (current->tok_type) {
case H5Z_XFORM_INTEGER:
- factor = H5Z_new_node(H5Z_XFORM_INTEGER);
+ factor = H5Z__new_node(H5Z_XFORM_INTEGER);
if (!factor)
HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "Unable to allocate new node")
@@ -849,7 +850,7 @@ H5Z_parse_factor(H5Z_token *current, H5Z_datval_ptrs *dat_val_pointers)
break;
case H5Z_XFORM_FLOAT:
- factor = H5Z_new_node(H5Z_XFORM_FLOAT);
+ factor = H5Z__new_node(H5Z_XFORM_FLOAT);
if (!factor)
HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "Unable to allocate new node")
@@ -857,7 +858,7 @@ H5Z_parse_factor(H5Z_token *current, H5Z_datval_ptrs *dat_val_pointers)
break;
case H5Z_XFORM_SYMBOL:
- factor = H5Z_new_node(H5Z_XFORM_SYMBOL);
+ factor = H5Z__new_node(H5Z_XFORM_SYMBOL);
if (!factor)
HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "Unable to allocate new node")
@@ -867,41 +868,41 @@ H5Z_parse_factor(H5Z_token *current, H5Z_datval_ptrs *dat_val_pointers)
break;
case H5Z_XFORM_LPAREN:
- factor = H5Z_parse_expression(current, dat_val_pointers);
+ factor = H5Z__parse_expression(current, dat_val_pointers);
if (!factor)
HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "Unable to allocate new node")
- current = H5Z_get_token(current);
+ current = H5Z__get_token(current);
if (current->tok_type != H5Z_XFORM_RPAREN) {
- H5Z_xform_destroy_parse_tree(factor);
+ H5Z__xform_destroy_parse_tree(factor);
HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, NULL, "Syntax error in data transform expression")
}
break;
case H5Z_XFORM_RPAREN:
/* We shouldn't see a ) right now */
- H5Z_xform_destroy_parse_tree(factor);
+ H5Z__xform_destroy_parse_tree(factor);
HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, NULL, "Syntax error: unexpected ')' ")
case H5Z_XFORM_PLUS:
/* unary + */
- new_node = H5Z_parse_factor(current, dat_val_pointers);
+ new_node = H5Z__parse_factor(current, dat_val_pointers);
if (new_node) {
if (new_node->type != H5Z_XFORM_INTEGER && new_node->type != H5Z_XFORM_FLOAT &&
new_node->type != H5Z_XFORM_SYMBOL) {
- H5Z_xform_destroy_parse_tree(new_node);
- H5Z_xform_destroy_parse_tree(factor);
+ H5Z__xform_destroy_parse_tree(new_node);
+ H5Z__xform_destroy_parse_tree(factor);
HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, NULL, "Error parsing data transform expression")
}
factor = new_node;
- new_node = H5Z_new_node(H5Z_XFORM_PLUS);
+ new_node = H5Z__new_node(H5Z_XFORM_PLUS);
if (!new_node) {
- H5Z_xform_destroy_parse_tree(factor);
+ H5Z__xform_destroy_parse_tree(factor);
HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, NULL, "Error parsing data transform expression")
}
@@ -909,28 +910,28 @@ H5Z_parse_factor(H5Z_token *current, H5Z_datval_ptrs *dat_val_pointers)
factor = new_node;
}
else {
- H5Z_xform_destroy_parse_tree(factor);
+ H5Z__xform_destroy_parse_tree(factor);
HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, NULL, "Error parsing data transform expression")
}
break;
case H5Z_XFORM_MINUS:
/* unary - */
- new_node = H5Z_parse_factor(current, dat_val_pointers);
+ new_node = H5Z__parse_factor(current, dat_val_pointers);
if (new_node) {
if (new_node->type != H5Z_XFORM_INTEGER && new_node->type != H5Z_XFORM_FLOAT &&
new_node->type != H5Z_XFORM_SYMBOL) {
- H5Z_xform_destroy_parse_tree(new_node);
- H5Z_xform_destroy_parse_tree(factor);
+ H5Z__xform_destroy_parse_tree(new_node);
+ H5Z__xform_destroy_parse_tree(factor);
HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, NULL, "Error parsing data transform expression")
}
factor = new_node;
- new_node = H5Z_new_node(H5Z_XFORM_MINUS);
+ new_node = H5Z__new_node(H5Z_XFORM_MINUS);
if (!new_node) {
- H5Z_xform_destroy_parse_tree(factor);
+ H5Z__xform_destroy_parse_tree(factor);
HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, NULL, "Error parsing data transform expression")
}
@@ -938,7 +939,7 @@ H5Z_parse_factor(H5Z_token *current, H5Z_datval_ptrs *dat_val_pointers)
factor = new_node;
}
else {
- H5Z_xform_destroy_parse_tree(factor);
+ H5Z__xform_destroy_parse_tree(factor);
HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, NULL, "Error parsing data transform expression")
}
break;
@@ -961,21 +962,24 @@ done:
}
/*-------------------------------------------------------------------------
- * Function: H5Z_new_node
+ * Function: H5Z__new_node
+ *
* Purpose: Create and initialize a new H5Z_node structure.
+ *
* Return: Success: Valid H5Z_node ptr
- * NULLure: NULL
+ * Failure: NULL
+ *
* Programmer: Bill Wendling
* 26. August 2003
*
*-------------------------------------------------------------------------
*/
static H5Z_node *
-H5Z_new_node(H5Z_token_type type)
+H5Z__new_node(H5Z_token_type type)
{
H5Z_node *ret_value = NULL; /* Return value */
- FUNC_ENTER_NOAPI_NOINIT
+ FUNC_ENTER_STATIC
if (NULL == (ret_value = (H5Z_node *)H5MM_calloc(sizeof(H5Z_node))))
HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL,
@@ -989,12 +993,12 @@ done:
/*-------------------------------------------------------------------------
* Function: H5Z_xform_eval
- * Purpose: If the transform is trivial, this function applies it.
- * Otherwise, it calls H5Z_xform_eval_full to do the full
- * transform.
+ * Purpose: If the transform is trivial, this function applies it.
+ * Otherwise, it calls H5Z__xform_eval_full to do the full
+ * transform.
* Return: SUCCEED if transform applied successfully, FAIL otherwise
* Programmer: Leon Arber
- * 5/1/04
+ * 5/1/04
*
*-------------------------------------------------------------------------
*/
@@ -1014,7 +1018,7 @@ H5Z_xform_eval(H5Z_data_xform_t *data_xform_prop, void *array, size_t array_size
tree = data_xform_prop->parse_root;
/* Get the datatype ID for the buffer's type */
- if ((array_type = H5Z_xform_find_type(buf_type)) < 0)
+ if ((array_type = H5Z__xform_find_type(buf_type)) < 0)
HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "Cannot perform data transform on this type.")
/* After this point, we're assured that the type of the array is handled by the eval code,
@@ -1077,7 +1081,7 @@ H5Z_xform_eval(H5Z_data_xform_t *data_xform_prop, void *array, size_t array_size
} /* end for */
} /* end else */
- if (H5Z_xform_eval_full(tree, array_size, array_type, &res) < 0)
+ if (H5Z__xform_eval_full(tree, array_size, array_type, &res) < 0)
HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "error while performing data transform")
if (data_xform_prop->dat_val_pointers->num_ptrs > 1)
@@ -1103,25 +1107,30 @@ done:
} /* end H5Z_xform_eval() */
/*-------------------------------------------------------------------------
- * Function: H5Z_xform_eval_full
- * Purpose: Does a full evaluation of the parse tree contained in tree
- * and applies this transform to array.
+ * Function: H5Z__xform_eval_full
+ *
+ * Purpose: Does a full evaluation of the parse tree contained in tree
+ * and applies this transform to array.
+ *
+ * Notes: In the case of a polynomial data transform (ie, the left and right
+ * subtree are both of type H5Z_XFORM_SYMBOL), the convention is
+ * that the left hand side will accumulate changes and, at the end,
+ * the new data will be copied from the lhs.
+ *
* Return: Nothing
+ *
* Programmer: Leon Arber
- * 5/1/04
+ * 5/1/04
*
- * Notes: In the case of a polynomial data transform (ie, the left and right subtree
- * are both of type H5Z_XFORM_SYMBOL), the convention is that the left hand side
- * will accumulate changes and, at the end, the new data will be copied from the lhs.
*-------------------------------------------------------------------------
*/
static herr_t
-H5Z_xform_eval_full(H5Z_node *tree, const size_t array_size, const hid_t array_type, H5Z_result *res)
+H5Z__xform_eval_full(H5Z_node *tree, const size_t array_size, const hid_t array_type, H5Z_result *res)
{
H5Z_result resl, resr;
herr_t ret_value = SUCCEED; /* Return value */
- FUNC_ENTER_NOAPI_NOINIT
+ FUNC_ENTER_STATIC
/* check args */
HDassert(tree);
@@ -1146,9 +1155,9 @@ H5Z_xform_eval_full(H5Z_node *tree, const size_t array_size, const hid_t array_t
res->value.dat_val = *((void **)(tree->value.dat_val));
} /* end if */
else {
- if (tree->lchild && H5Z_xform_eval_full(tree->lchild, array_size, array_type, &resl) < 0)
+ if (tree->lchild && H5Z__xform_eval_full(tree->lchild, array_size, array_type, &resl) < 0)
HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "error while performing data transform")
- if (H5Z_xform_eval_full(tree->rchild, array_size, array_type, &resr) < 0)
+ if (H5Z__xform_eval_full(tree->rchild, array_size, array_type, &resr) < 0)
HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "error while performing data transform")
res->type = H5Z_XFORM_SYMBOL;
@@ -1198,22 +1207,24 @@ H5Z_xform_eval_full(H5Z_node *tree, const size_t array_size, const hid_t array_t
done:
FUNC_LEAVE_NOAPI(ret_value)
-} /* end H5Z_xform_eval_full() */
+} /* end H5Z__xform_eval_full() */
/*-------------------------------------------------------------------------
* Function: H5Z_find_type
+ *
* Return: Native type of datatype that is passed in
+ *
* Programmer: Leon Arber, 4/20/04
*
*-------------------------------------------------------------------------
*/
static hid_t
-H5Z_xform_find_type(const H5T_t *type)
+H5Z__xform_find_type(const H5T_t *type)
{
H5T_t *tmp; /* Temporary datatype */
hid_t ret_value = SUCCEED; /* Return value */
- FUNC_ENTER_NOAPI_NOINIT
+ FUNC_ENTER_STATIC
HDassert(type);
@@ -1266,24 +1277,27 @@ H5Z_xform_find_type(const H5T_t *type)
done:
FUNC_LEAVE_NOAPI(ret_value)
-} /* end H5Z_xform_find_type() */
+} /* end H5Z__xform_find_type() */
/*-------------------------------------------------------------------------
- * Function: H5Z_xform_copy_tree
+ * Function: H5Z__xform_copy_tree
+ *
* Purpose: Makes a copy of the parse tree passed in.
+ *
* Return: A pointer to a root for a new parse tree which is a copy
* of the one passed in.
+ *
* Programmer: Leon Arber
* April 1, 2004.
*
*-------------------------------------------------------------------------
*/
static void *
-H5Z_xform_copy_tree(H5Z_node *tree, H5Z_datval_ptrs *dat_val_pointers, H5Z_datval_ptrs *new_dat_val_pointers)
+H5Z__xform_copy_tree(H5Z_node *tree, H5Z_datval_ptrs *dat_val_pointers, H5Z_datval_ptrs *new_dat_val_pointers)
{
H5Z_node *ret_value = NULL;
- FUNC_ENTER_NOAPI(NULL)
+ FUNC_ENTER_STATIC
HDassert(tree);
@@ -1335,21 +1349,24 @@ done:
}
/*-------------------------------------------------------------------------
- * Function: H5Z_op_is_numbs
+ * Function: H5Z__op_is_numbs
+ *
* Purpose: Internal function to facilitate the condition check in
- * H5Z_xform_reduce_tree to reduce the bulkiness of the code.
+ * H5Z__xform_reduce_tree to reduce the bulkiness of the code.
+ *
* Return: TRUE or FALSE
+ *
* Programmer: Raymond Lu
* 15 March 2012
*
*-------------------------------------------------------------------------
*/
static hbool_t
-H5Z_op_is_numbs(H5Z_node *_tree)
+H5Z__op_is_numbs(H5Z_node *_tree)
{
hbool_t ret_value = FALSE;
- FUNC_ENTER_NOAPI_NOINIT_NOERR
+ FUNC_ENTER_STATIC_NOERR
HDassert(_tree);
@@ -1361,23 +1378,26 @@ H5Z_op_is_numbs(H5Z_node *_tree)
}
/*-------------------------------------------------------------------------
- * Function: H5Z_op_is_numbs2
+ * Function: H5Z__op_is_numbs2
+ *
* Purpose: Internal function to facilitate the condition check in
- * H5Z_xform_reduce_tree to reduce the bulkiness of the code.
- * The difference from H5Z_op_is_numbs is that the left child
+ * H5Z__xform_reduce_tree to reduce the bulkiness of the code.
+ * The difference from H5Z__op_is_numbs is that the left child
* can be empty, like -x or +x.
+ *
* Return: TRUE or FALSE
+ *
* Programmer: Raymond Lu
* 15 March 2012
*
*-------------------------------------------------------------------------
*/
static hbool_t
-H5Z_op_is_numbs2(H5Z_node *_tree)
+H5Z__op_is_numbs2(H5Z_node *_tree)
{
hbool_t ret_value = FALSE;
- FUNC_ENTER_NOAPI_NOINIT_NOERR
+ FUNC_ENTER_STATIC_NOERR
HDassert(_tree);
@@ -1393,48 +1413,49 @@ H5Z_op_is_numbs2(H5Z_node *_tree)
}
/*-------------------------------------------------------------------------
- * Function: H5Z_xform_reduce_tree
+ * Function: H5Z__xform_reduce_tree
+ *
* Purpose: Simplifies parse tree passed in by performing any obvious
* and trivial arithemtic calculations.
*
* Return: None.
+ *
* Programmer: Leon Arber
* April 1, 2004.
- * Modifications:
*
*-------------------------------------------------------------------------
*/
static void
-H5Z_xform_reduce_tree(H5Z_node *tree)
+H5Z__xform_reduce_tree(H5Z_node *tree)
{
- FUNC_ENTER_NOAPI_NOINIT_NOERR
+ FUNC_ENTER_STATIC_NOERR
if (tree) {
if ((tree->type == H5Z_XFORM_DIVIDE) || (tree->type == H5Z_XFORM_MULT)) {
- if (H5Z_op_is_numbs(tree))
- H5Z_do_op(tree);
+ if (H5Z__op_is_numbs(tree))
+ H5Z__do_op(tree);
else {
- H5Z_xform_reduce_tree(tree->lchild);
- if (H5Z_op_is_numbs(tree))
- H5Z_do_op(tree);
+ H5Z__xform_reduce_tree(tree->lchild);
+ if (H5Z__op_is_numbs(tree))
+ H5Z__do_op(tree);
else {
- H5Z_xform_reduce_tree(tree->rchild);
- if (H5Z_op_is_numbs(tree))
- H5Z_do_op(tree);
+ H5Z__xform_reduce_tree(tree->rchild);
+ if (H5Z__op_is_numbs(tree))
+ H5Z__do_op(tree);
}
}
}
else if ((tree->type == H5Z_XFORM_PLUS) || (tree->type == H5Z_XFORM_MINUS)) {
- if (H5Z_op_is_numbs2(tree))
- H5Z_do_op(tree);
+ if (H5Z__op_is_numbs2(tree))
+ H5Z__do_op(tree);
else {
- H5Z_xform_reduce_tree(tree->lchild);
- if (H5Z_op_is_numbs2(tree))
- H5Z_do_op(tree);
+ H5Z__xform_reduce_tree(tree->lchild);
+ if (H5Z__op_is_numbs2(tree))
+ H5Z__do_op(tree);
else {
- H5Z_xform_reduce_tree(tree->rchild);
- if (H5Z_op_is_numbs2(tree))
- H5Z_do_op(tree);
+ H5Z__xform_reduce_tree(tree->rchild);
+ if (H5Z__op_is_numbs2(tree))
+ H5Z__do_op(tree);
}
}
}
@@ -1444,22 +1465,25 @@ H5Z_xform_reduce_tree(H5Z_node *tree)
}
/*-------------------------------------------------------------------------
- * Function: H5Z_do_op
+ * Function: H5Z__do_op
+ *
* Purpose: If the root of the tree passed in points to a simple
* arithmetic operation and the left and right subtrees are both
* integer or floating point values, this function does that
* operation, free the left and right subtrees, and replaces
* the root with the result of the operation.
+ *
* Return: None.
+ *
* Programmer: Leon Arber
* April 1, 2004.
*
*-------------------------------------------------------------------------
*/
static void
-H5Z_do_op(H5Z_node *tree)
+H5Z__do_op(H5Z_node *tree)
{
- FUNC_ENTER_NOAPI_NOINIT_NOERR
+ FUNC_ENTER_STATIC_NOERR
if (tree->type == H5Z_XFORM_DIVIDE)
H5Z_XFORM_DO_OP3(/)
@@ -1474,7 +1498,7 @@ H5Z_do_op(H5Z_node *tree)
}
/*-------------------------------------------------------------------------
- * Function: H5D_xform_create
+ * Function: H5Z_xform_create
*
* Purpose: Create a new data transform object from a string.
*
@@ -1514,10 +1538,20 @@ H5Z_xform_create(const char *expr)
"unable to allocate memory for data transform expression")
/* Find the number of times "x" is used in this equation, and allocate room for storing that many points
+ * A more sophisticated check is needed to support scientific notation.
*/
- for (i = 0; i < HDstrlen(expr); i++)
- if (HDisalpha(expr[i]))
+ for (i = 0; i < HDstrlen(expr); i++) {
+ if (HDisalpha(expr[i])) {
+ if ((i > 0) && (i < (HDstrlen(expr) - 1))) {
+ if (((expr[i] == 'E') || (expr[i] == 'e')) &&
+ (HDisdigit(expr[i - 1]) || (expr[i - 1] == '.')) &&
+ (HDisdigit(expr[i + 1]) || (expr[i + 1] == '-') || (expr[i + 1] == '+')))
+ continue;
+ }
+
count++;
+ }
+ }
/* When there are no "x"'s in the equation (ie, simple transform case),
* we don't need to allocate any space since no array will have to be
@@ -1534,7 +1568,7 @@ H5Z_xform_create(const char *expr)
/* we generate the parse tree right here and store a pointer to its root in the property. */
if ((data_xform_prop->parse_root =
- (H5Z_node *)H5Z_xform_parse(expr, data_xform_prop->dat_val_pointers)) == NULL)
+ (H5Z_node *)H5Z__xform_parse(expr, data_xform_prop->dat_val_pointers)) == NULL)
HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "unable to generate parse tree from expression")
/* Sanity check
@@ -1551,7 +1585,7 @@ done:
if (ret_value == NULL) {
if (data_xform_prop) {
if (data_xform_prop->parse_root)
- H5Z_xform_destroy_parse_tree(data_xform_prop->parse_root);
+ H5Z__xform_destroy_parse_tree(data_xform_prop->parse_root);
if (data_xform_prop->xform_exp)
H5MM_xfree(data_xform_prop->xform_exp);
if (count > 0 && data_xform_prop->dat_val_pointers->ptr_dat_val)
@@ -1587,7 +1621,7 @@ H5Z_xform_destroy(H5Z_data_xform_t *data_xform_prop)
if (data_xform_prop) {
/* Destroy the parse tree */
- H5Z_xform_destroy_parse_tree(data_xform_prop->parse_root);
+ H5Z__xform_destroy_parse_tree(data_xform_prop->parse_root);
/* Free the expression */
H5MM_xfree(data_xform_prop->xform_exp);
@@ -1667,7 +1701,7 @@ H5Z_xform_copy(H5Z_data_xform_t **data_xform_prop)
new_data_xform_prop->dat_val_pointers->num_ptrs = 0;
/* Copy parse tree */
- if ((new_data_xform_prop->parse_root = (H5Z_node *)H5Z_xform_copy_tree(
+ if ((new_data_xform_prop->parse_root = (H5Z_node *)H5Z__xform_copy_tree(
(*data_xform_prop)->parse_root, (*data_xform_prop)->dat_val_pointers,
new_data_xform_prop->dat_val_pointers)) == NULL)
HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "error copying the parse tree")
@@ -1687,7 +1721,7 @@ done:
if (ret_value < 0) {
if (new_data_xform_prop) {
if (new_data_xform_prop->parse_root)
- H5Z_xform_destroy_parse_tree(new_data_xform_prop->parse_root);
+ H5Z__xform_destroy_parse_tree(new_data_xform_prop->parse_root);
if (new_data_xform_prop->xform_exp)
H5MM_xfree(new_data_xform_prop->xform_exp);
H5MM_xfree(new_data_xform_prop);
@@ -1728,7 +1762,7 @@ H5Z_xform_noop(const H5Z_data_xform_t *data_xform_prop)
* Function: H5Z_xform_extract_xform_str
*
* Purpose: Extracts the pointer to the data transform strings from the
- * data transform property.`
+ * data transform property.`
* Return:
* Pointer to a copy of the string in the data_xform property.
*
diff --git a/src/H5err.txt b/src/H5err.txt
index 24e9b2a..64452ec 100644
--- a/src/H5err.txt
+++ b/src/H5err.txt
@@ -50,7 +50,7 @@ MAJOR, H5E_LIB, General library infrastructure
MAJOR, H5E_FILE, File accessibility
MAJOR, H5E_IO, Low-level I/O
MAJOR, H5E_FUNC, Function entry/exit
-MAJOR, H5E_ATOM, Object atom
+MAJOR, H5E_ID, Object ID
MAJOR, H5E_CACHE, Object cache
MAJOR, H5E_LINK, Links
MAJOR, H5E_BTREE, B-Tree node
@@ -80,6 +80,7 @@ MAJOR, H5E_PLUGIN, Plugin for dynamically loaded library
MAJOR, H5E_PAGEBUF, Page Buffering
MAJOR, H5E_CONTEXT, API Context
MAJOR, H5E_MAP, Map
+MAJOR, H5E_EVENTSET, Event Set
MAJOR, H5E_NONE_MAJOR, No error
# Sections (for grouping minor errors)
@@ -88,7 +89,7 @@ SECTION, RESOURCE, Resource errors
SECTION, FILEACC, File accessibility errors
SECTION, FILE, Generic low-level file I/O errors
SECTION, FUNC, Function entry/exit interface errors
-SECTION, ATOM, Object atom related errors
+SECTION, ID, Object ID related errors
SECTION, CACHE, Cache related errors
SECTION, LINK, Link related errors
SECTION, BTREE, B-tree related errors
@@ -104,6 +105,7 @@ SECTION, PIPELINE, I/O pipeline errors
SECTION, SYSTEM, System level errors
SECTION, PLUGIN, Plugin errors
SECTION, MAP, Map related errors
+SECTION, ASYNC, Asynchronous I/O errors
SECTION, NONE, No error
# Minor errors
@@ -154,13 +156,13 @@ MINOR, FUNC, H5E_CANTINIT, Unable to initialize object
MINOR, FUNC, H5E_ALREADYINIT, Object already initialized
MINOR, FUNC, H5E_CANTRELEASE, Unable to release object
-# Object atom related errors
-MINOR, ATOM, H5E_BADATOM, Unable to find atom information (already closed?)
-MINOR, ATOM, H5E_BADGROUP, Unable to find ID group information
-MINOR, ATOM, H5E_CANTREGISTER, Unable to register new atom
-MINOR, ATOM, H5E_CANTINC, Unable to increment reference count
-MINOR, ATOM, H5E_CANTDEC, Unable to decrement reference count
-MINOR, ATOM, H5E_NOIDS, Out of IDs for group
+# Object ID related errors
+MINOR, ID, H5E_BADID, Unable to find ID information (already closed?)
+MINOR, ID, H5E_BADGROUP, Unable to find ID group information
+MINOR, ID, H5E_CANTREGISTER, Unable to register new ID
+MINOR, ID, H5E_CANTINC, Unable to increment reference count
+MINOR, ID, H5E_CANTDEC, Unable to decrement reference count
+MINOR, ID, H5E_NOIDS, Out of IDs for group
# Cache related errors
MINOR, CACHE, H5E_CANTFLUSH, Unable to flush data from cache
@@ -203,6 +205,7 @@ MINOR, BTREE, H5E_CANTINSERT, Unable to insert object
MINOR, BTREE, H5E_CANTLIST, Unable to list node
MINOR, BTREE, H5E_CANTMODIFY, Unable to modify record
MINOR, BTREE, H5E_CANTREMOVE, Unable to remove object
+MINOR, BTREE, H5E_CANTFIND, Unable to check for record
# Object header related errors
MINOR, OHDR, H5E_LINKCOUNT, Bad object header link count
@@ -282,5 +285,11 @@ MINOR, SYSTEM, H5E_SYSERRSTR, System error message
# Plugin errors
MINOR, PLUGIN, H5E_OPENERROR, Can't open directory or file
+# Map related errors
+MINOR, MAP, H5E_CANTPUT, Can't put value
+
+# Asynchronous operation errors
+MINOR, ASYNC, H5E_CANTWAIT, Can't wait on operation
+
# No error, for backward compatibility */
MINOR, NONE, H5E_NONE_MINOR, No error
diff --git a/src/H5private.h b/src/H5private.h
index 0e824c8..8a9f5c9 100644
--- a/src/H5private.h
+++ b/src/H5private.h
@@ -890,10 +890,12 @@ H5_DLL H5_ATTR_CONST int Nflock(int fd, int operation);
#ifndef HDfork
#define HDfork() fork()
#endif /* HDfork */
+#ifndef HDfprintf
+#define HDfprintf fprintf
+#endif
#ifndef HDfpathconf
#define HDfpathconf(F, N) fpathconf(F, N)
#endif /* HDfpathconf */
-H5_DLL int HDfprintf(FILE *stream, const char *fmt, ...);
#ifndef HDfputc
#define HDfputc(C, F) fputc(C, F)
#endif /* HDfputc */
@@ -1229,7 +1231,7 @@ typedef off_t h5_stat_size_t;
#define HDpread(F, B, C, O) pread(F, B, C, O)
#endif /* HDpread */
#ifndef HDprintf
-#define HDprintf(...) HDfprintf(stdout, __VA_ARGS__)
+#define HDprintf printf
#endif /* HDprintf */
#ifndef HDpthread_attr_destroy
#define HDpthread_attr_destroy(A) pthread_attr_destroy(A)
@@ -1492,6 +1494,9 @@ H5_DLL void HDsrand(unsigned int seed);
#ifndef HDstrcspn
#define HDstrcspn(X, Y) strcspn(X, Y)
#endif /* HDstrcspn */
+#ifndef HDstrdup
+#define HDstrdup(S) strdup(S)
+#endif /* HDstrdup */
#ifndef HDstrerror
#define HDstrerror(N) strerror(N)
#endif /* HDstrerror */
@@ -1547,6 +1552,9 @@ H5_DLL int64_t HDstrtoll(const char *s, const char **rest, int base);
#ifndef HDstrtoull
#define HDstrtoull(S, R, N) strtoull(S, R, N)
#endif /* HDstrtoul */
+#ifndef HDstrtoumax
+#define HDstrtoumax(S, R, N) strtoumax(S, R, N)
+#endif /* HDstrtoumax */
#ifndef HDstrxfrm
#define HDstrxfrm(X, Y, Z) strxfrm(X, Y, Z)
#endif /* HDstrxfrm */
@@ -1638,6 +1646,13 @@ H5_DLL int64_t HDstrtoll(const char *s, const char **rest, int base);
#ifndef HDutime
#define HDutime(S, T) utime(S, T)
#endif /* HDutime */
+#ifndef HDvasprintf
+#ifdef H5_HAVE_VASPRINTF
+#define HDvasprintf(RET, FMT, A) vasprintf(RET, FMT, A)
+#else
+H5_DLL int HDvasprintf(char **bufp, const char *fmt, va_list _ap);
+#endif /* H5_HAVE_VASPRINTF */
+#endif /* HDvasprintf */
#ifndef HDva_arg
#define HDva_arg(A, T) va_arg(A, T)
#endif /* HDva_arg */
@@ -1650,9 +1665,6 @@ H5_DLL int64_t HDstrtoll(const char *s, const char **rest, int base);
#ifndef HDva_start
#define HDva_start(A, P) va_start(A, P)
#endif /* HDva_start */
-#ifndef HDvasprintf
-#define HDvasprintf(RET, FMT, A) vasprintf(RET, FMT, A)
-#endif /* HDvasprintf */
#ifndef HDvfprintf
#define HDvfprintf(F, FMT, A) vfprintf(F, FMT, A)
#endif /* HDvfprintf */
@@ -1681,18 +1693,6 @@ H5_DLL int64_t HDstrtoll(const char *s, const char **rest, int base);
#define HDwrite(F, M, Z) write(F, M, Z)
#endif /* HDwrite */
-/*
- * And now for a couple non-Posix functions... Watch out for systems that
- * define these in terms of macros.
- */
-#if !defined strdup && !defined H5_HAVE_STRDUP
-extern char * strdup(const char *s);
-#endif
-
-#ifndef HDstrdup
-#define HDstrdup(S) strdup(S)
-#endif /* HDstrdup */
-
/* Macro for "stringizing" an integer in the C preprocessor (use H5_TOSTRING) */
/* (use H5_TOSTRING, H5_STRINGIZE is just part of the implementation) */
#define H5_STRINGIZE(x) #x
diff --git a/src/H5public.h b/src/H5public.h
index 8aadddc..ada15a7 100644
--- a/src/H5public.h
+++ b/src/H5public.h
@@ -95,50 +95,130 @@ extern "C" {
#define H5_NO_EXPAND(x) (x)
/* Version numbers */
-#define H5_VERS_MAJOR 1 /* For major interface/format changes */
-#define H5_VERS_MINOR 13 /* For minor interface/format changes */
-#define H5_VERS_RELEASE 0 /* For tweaks, bug-fixes, or development */
-#define H5_VERS_SUBRELEASE "" /* For pre-releases like snap0 */
-/* Empty string for real releases. */
-#define H5_VERS_INFO "HDF5 library version: 1.13.0" /* Full version string */
+/**
+ * For major interface/format changes
+ */
+#define H5_VERS_MAJOR 1
+/**
+ * For minor interface/format changes
+ */
+#define H5_VERS_MINOR 13
+/**
+ * For tweaks, bug-fixes, or development
+ */
+#define H5_VERS_RELEASE 0
+/**
+ * For pre-releases like \c snap0. Empty string for official releases.
+ */
+#define H5_VERS_SUBRELEASE ""
+/**
+ * Full version string
+ */
+#define H5_VERS_INFO "HDF5 library version: 1.13.0"
#define H5check() H5check_version(H5_VERS_MAJOR, H5_VERS_MINOR, H5_VERS_RELEASE)
/* macros for comparing the version */
+/**
+ * \brief Determines whether the version of the library being used is greater
+ * than or equal to the specified version
+ *
+ * \param[in] Maj Major version number - A non-negative integer value
+ * \param[in] Min Minor version number - A non-negative integer value
+ * \param[in] Rel Release version number - A non-negative integer value
+ * \returns A value of 1 is returned if the library version is greater than
+ * or equal to the version number specified.\n
+ * A value of 0 is returned if the library version is less than the
+ * version number specified.\n
+ * A library version is greater than the specified version number if
+ * its major version is larger than the specified major version
+ * number. If the major version numbers are the same, it is greater
+ * than the specified version number if its minor version is larger
+ * than the specified minor version number. If the minor version
+ * numbers are the same, then a library version would be greater than
+ * the specified version number if its release number is larger than
+ * the specified release number.
+ *
+ * \details The #H5_VERSION_GE and #H5_VERSION_LE macros are used at compile
+ * time to conditionally include or exclude code based on the version
+ * of the HDF5 library against which an application will be linked.
+ *
+ * The #H5_VERSION_GE macro compares the version of the HDF5 library
+ * being used against the version number specified in the parameters.
+ *
+ * For more information about release versioning, see \ref_h5lib_relver.
+ *
+ * \since 1.8.7
+ *
+ */
#define H5_VERSION_GE(Maj, Min, Rel) \
(((H5_VERS_MAJOR == Maj) && (H5_VERS_MINOR == Min) && (H5_VERS_RELEASE >= Rel)) || \
((H5_VERS_MAJOR == Maj) && (H5_VERS_MINOR > Min)) || (H5_VERS_MAJOR > Maj))
+/**
+ * \brief Determines whether the version of the library being used is less
+ * than or equal to the specified version
+ *
+ * \param[in] Maj Major version number - A non-negative integer value
+ * \param[in] Min Minor version number - A non-negative integer value
+ * \param[in] Rel Release version number - A non-negative integer value
+ * \returns A value of 1 is returned if the library version is less than
+ * or equal to the version number specified.\n
+ * A value of 0 is returned if the library version is greater than the
+ * version number specified.\n
+ * A library version is less than the specified version number if
+ * its major version is smaller than the specified major version
+ * number. If the major version numbers are the same, it is smaller
+ * than the specified version number if its minor version is smaller
+ * than the specified minor version number. If the minor version
+ * numbers are the same, then a library version would be smaller than
+ * the specified version number if its release number is smaller than
+ * the specified release number.
+ *
+ * \details The #H5_VERSION_GE and #H5_VERSION_LE macros are used at compile
+ * time to conditionally include or exclude code based on the version
+ * of the HDF5 library against which an application will be linked.
+ *
+ * The #H5_VERSION_LE macro compares the version of the HDF5 library
+ * being used against the version number specified in the parameters.
+ *
+ * For more information about release versioning, see \ref_h5lib_relver.
+ *
+ * \since 1.8.7
+ *
+ */
#define H5_VERSION_LE(Maj, Min, Rel) \
(((H5_VERS_MAJOR == Maj) && (H5_VERS_MINOR == Min) && (H5_VERS_RELEASE <= Rel)) || \
((H5_VERS_MAJOR == Maj) && (H5_VERS_MINOR < Min)) || (H5_VERS_MAJOR < Maj))
-/*
+/**
* Status return values. Failed integer functions in HDF5 result almost
* always in a negative value (unsigned failing functions sometimes return
* zero for failure) while successful return is non-negative (often zero).
* The negative failure value is most commonly -1, but don't bet on it. The
* proper way to detect failure is something like:
- *
- * if((dset = H5Dopen2(file, name)) < 0)
- * fprintf(stderr, "unable to open the requested dataset\n");
+ * \code
+ * if((dset = H5Dopen2(file, name)) < 0)
+ * fprintf(stderr, "unable to open the requested dataset\n");
+ * \endcode
*/
typedef int herr_t;
-/*
+/**
* Boolean type. Successful return values are zero (false) or positive
* (true). The typical true value is 1 but don't bet on it. Boolean
- * functions cannot fail. Functions that return `htri_t' however return zero
+ * functions cannot fail. Functions that return #htri_t however return zero
* (false), positive (true), or negative (failure). The proper way to test
- * for truth from a htri_t function is:
- *
- * if ((retval = H5Tcommitted(type)) > 0) {
- * printf("data type is committed\n");
- * } else if (!retval) {
- * printf("data type is not committed\n");
- * } else {
- * printf("error determining whether data type is committed\n");
- * }
+ * for truth from a #htri_t function is:
+ * \code
+ * if ((retval = H5Tcommitted(type)) > 0) {
+ * printf("data type is committed\n");
+ * } else if (!retval) {
+ * printf("data type is not committed\n");
+ * } else {
+ * printf("error determining whether data type is committed\n");
+ * }
+ * \endcode
*/
#ifdef H5_HAVE_STDBOOL_H
#include <stdbool.h>
@@ -198,16 +278,22 @@ typedef long long int64_t;
* defined in Posix.1g, otherwise it is defined here.
*/
#if H5_SIZEOF_UINT64_T >= 8
+#ifndef UINT64_MAX
+#define UINT64_MAX ((uint64_t)-1)
+#endif
#elif H5_SIZEOF_INT >= 8
typedef unsigned uint64_t;
+#define UINT64_MAX UINT_MAX
#undef H5_SIZEOF_UINT64_T
#define H5_SIZEOF_UINT64_T H5_SIZEOF_INT
#elif H5_SIZEOF_LONG >= 8
typedef unsigned long uint64_t;
+#define UINT64_MAX ULONG_MAX
#undef H5_SIZEOF_UINT64_T
#define H5_SIZEOF_UINT64_T H5_SIZEOF_LONG
#elif H5_SIZEOF_LONG_LONG >= 8
typedef unsigned long long uint64_t;
+#define UINT64_MAX ULLONG_MAX
#undef H5_SIZEOF_UINT64_T
#define H5_SIZEOF_UINT64_T H5_SIZEOF_LONG_LONG
#else
@@ -215,20 +301,26 @@ typedef unsigned long long uint64_t;
#endif
/*
- * The sizes of file objects have their own types defined here, use a 64-bit
- * type.
- */
-typedef uint64_t hsize_t;
-typedef int64_t hssize_t;
-#define PRIXHSIZE PRIX64
-#define PRIdHSIZE PRId64
-#define PRIiHSIZE PRIi64
-#define PRIoHSIZE PRIo64
-#define PRIuHSIZE PRIu64
-#define PRIxHSIZE PRIx64
-#define H5_SIZEOF_HSIZE_T H5_SIZEOF_UINT64_T
-#define H5_SIZEOF_HSSIZE_T H5_SIZEOF_INT64_T
-#define HSIZE_UNDEF UINT64_MAX
+ * The sizes of file objects have their own types defined here, use a minimum
+ * 64-bit type.
+ */
+#if H5_SIZEOF_LONG_LONG >= 8
+H5_GCC_DIAG_OFF("long-long")
+typedef unsigned long long hsize_t;
+typedef signed long long hssize_t;
+H5_GCC_DIAG_ON("long-long")
+#define PRIdHSIZE H5_PRINTF_LL_WIDTH "d"
+#define PRIiHSIZE H5_PRINTF_LL_WIDTH "i"
+#define PRIoHSIZE H5_PRINTF_LL_WIDTH "o"
+#define PRIuHSIZE H5_PRINTF_LL_WIDTH "u"
+#define PRIxHSIZE H5_PRINTF_LL_WIDTH "x"
+#define PRIXHSIZE H5_PRINTF_LL_WIDTH "X"
+#define H5_SIZEOF_HSIZE_T H5_SIZEOF_LONG_LONG
+#define H5_SIZEOF_HSSIZE_T H5_SIZEOF_LONG_LONG
+#define HSIZE_UNDEF ULLONG_MAX
+#else
+#error "nothing appropriate for hsize_t"
+#endif
/*
* File addresses have their own types.
@@ -240,6 +332,11 @@ typedef unsigned haddr_t;
#ifdef H5_HAVE_PARALLEL
#define HADDR_AS_MPI_TYPE MPI_UNSIGNED
#endif /* H5_HAVE_PARALLEL */
+#define PRIdHADDR "d"
+#define PRIoHADDR "o"
+#define PRIuHADDR "u"
+#define PRIxHADDR "x"
+#define PRIXHADDR "X"
#elif H5_SIZEOF_LONG >= 8
typedef unsigned long haddr_t;
#define HADDR_UNDEF ULONG_MAX
@@ -247,6 +344,11 @@ typedef unsigned long haddr_t;
#ifdef H5_HAVE_PARALLEL
#define HADDR_AS_MPI_TYPE MPI_UNSIGNED_LONG
#endif /* H5_HAVE_PARALLEL */
+#define PRIdHADDR "ld"
+#define PRIoHADDR "lo"
+#define PRIuHADDR "lu"
+#define PRIxHADDR "lx"
+#define PRIXHADDR "lX"
#elif H5_SIZEOF_LONG_LONG >= 8
typedef unsigned long long haddr_t;
#define HADDR_UNDEF ULLONG_MAX
@@ -254,26 +356,13 @@ typedef unsigned long long haddr_t;
#ifdef H5_HAVE_PARALLEL
#define HADDR_AS_MPI_TYPE MPI_LONG_LONG_INT
#endif /* H5_HAVE_PARALLEL */
-#else
-#error "nothing appropriate for haddr_t"
-#endif
-#if H5_SIZEOF_HADDR_T == H5_SIZEOF_INT
-#define PRIXHADDR "X"
-#define PRIoHADDR "o"
-#define PRIuHADDR "u"
-#define PRIxHADDR "x"
-#elif H5_SIZEOF_HADDR_T == H5_SIZEOF_LONG
-#define PRIXHADDR "lX"
-#define PRIoHADDR "lo"
-#define PRIuHADDR "lu"
-#define PRIxHADDR "lx"
-#elif H5_SIZEOF_HADDR_T == H5_SIZEOF_LONG_LONG
-#define PRIXHADDR H5_PRINTF_LL_WIDTH "X"
+#define PRIdHADDR H5_PRINTF_LL_WIDTH "d"
#define PRIoHADDR H5_PRINTF_LL_WIDTH "o"
#define PRIuHADDR H5_PRINTF_LL_WIDTH "u"
#define PRIxHADDR H5_PRINTF_LL_WIDTH "x"
+#define PRIXHADDR H5_PRINTF_LL_WIDTH "X"
#else
-#error "nothing appropriate for H5_PRINTF_HADDR_FMT"
+#error "nothing appropriate for haddr_t"
#endif
#define H5_PRINTF_HADDR_FMT "%" PRIuHADDR
#define HADDR_MAX (HADDR_UNDEF - 1)
@@ -298,8 +387,7 @@ typedef unsigned long uint32_t;
#error "nothing appropriate for uint32_t"
#endif
-//! [H5_iter_order_t_snip]
-
+//! <!-- [H5_iter_order_t_snip] -->
/**
* Common iteration orders
*/
@@ -310,8 +398,7 @@ typedef enum {
H5_ITER_NATIVE, /**< No particular order, whatever is fastest */
H5_ITER_N /**< Number of iteration orders */
} H5_iter_order_t;
-
-//! [H5_iter_order_t_snip]
+//! <!-- [H5_iter_order_t_snip] -->
/* Iteration callback values */
/* (Actually, any positive value will cause the iterator to stop and pass back
@@ -321,8 +408,7 @@ typedef enum {
#define H5_ITER_CONT (0)
#define H5_ITER_STOP (1)
-//! [H5_index_t_snip]
-
+//! <!-- [H5_index_t_snip] -->
/**
* The types of indices on links in groups/attributes on objects.
* Primarily used for "<do> <foo> by index" routines and for iterating over
@@ -334,18 +420,17 @@ typedef enum H5_index_t {
H5_INDEX_CRT_ORDER, /**< Index on creation order */
H5_INDEX_N /**< Number of indices defined */
} H5_index_t;
-
-//! [H5_index_t_snip]
+//! <!-- [H5_index_t_snip] -->
/**
* Storage info struct used by H5O_info_t and H5F_info_t
*/
-//! [H5_ih_info_t_snip]
+//! <!-- [H5_ih_info_t_snip] -->
typedef struct H5_ih_info_t {
hsize_t index_size; /**< btree and/or list */
hsize_t heap_size;
} H5_ih_info_t;
-//! [H5_ih_info_t_snip]
+//! <!-- [H5_ih_info_t_snip] -->
/**
* The maximum size allowed for tokens
@@ -355,28 +440,17 @@ typedef struct H5_ih_info_t {
*/
#define H5O_MAX_TOKEN_SIZE (16)
-static inline const char *
-htri_to_string(htri_t v)
-{
- if (v == 0)
- return "false";
- else if (v < 0)
- return "error";
- else
- return "true";
-}
-
-//! [H5O_token_t_snip]
-
+//! <!-- [H5O_token_t_snip] -->
/**
+ * Type for object tokens
+ *
* \internal (Hoisted here, since it's used by both the
- * H5Lpublic.h and H5Opublic.h headers) */
-/* Type for object tokens */
+ * H5Lpublic.h and H5Opublic.h headers)
+ */
typedef struct H5O_token_t {
uint8_t __data[H5O_MAX_TOKEN_SIZE];
} H5O_token_t;
-
-//! [H5O_token_t_snip]
+//! <!-- [H5O_token_t_snip] -->
/**
* Allocation statistics info struct
@@ -437,7 +511,7 @@ H5_DLL herr_t H5open(void);
* If the HDF5 library is initialized and closed more than once, the
* \p func callback must be registered within each open/close cycle.
*
- * \since 1.12.1
+ * \since 1.13.0
*/
H5_DLL herr_t H5atclose(H5_atclose_func_t func, void *ctx);
/**
@@ -661,7 +735,7 @@ H5_DLL herr_t H5check_version(unsigned majnum, unsigned minnum, unsigned relnum)
* after it has been closed. The value of \p is_terminating is
* undefined if this routine fails.
*
- * \since 1.12.1
+ * \since 1.13.0
*/
H5_DLL herr_t H5is_library_terminating(hbool_t *is_terminating);
/**
diff --git a/src/H5system.c b/src/H5system.c
index e7fe422..52bb930 100644
--- a/src/H5system.c
+++ b/src/H5system.c
@@ -66,406 +66,35 @@
/* Track whether tzset routine was called */
static hbool_t H5_ntzset = FALSE;
-/*-------------------------------------------------------------------------
- * Function: HDfprintf
- *
- * Purpose: Prints the optional arguments under the control of the format
- * string FMT to the stream STREAM. This function takes the
- * same format as fprintf(3c) with a few added features:
- *
- * The conversion modifier `H' refers to the size of an
- * `hsize_t' or `hssize_t' type. For instance, "0x%018Hx"
- * prints an `hsize_t' value as a hex number right justified and
- * zero filled in an 18-character field.
- *
- * The conversion 'a' refers to an haddr_t type.
- *
- * The conversion 't' refers to an htri_t type.
- *
- * The conversion 'k' refers to an H5O_token_t type.
- *
- * Return: Success: Number of characters printed
- *
- * Failure: -1
- *
- * Programmer: Robb Matzke
- * Thursday, April 9, 1998
- *
- *-------------------------------------------------------------------------
- */
-/* Disable warning for "format not a string literal" here -QAK */
-/*
- * This pragma only needs to surround the fprintf() calls with
- * format_templ in the code below, but early (4.4.7, at least) gcc only
- * allows diagnostic pragmas to be toggled outside of functions.
+#ifndef H5_HAVE_VASPRINTF
+/* HDvasprintf provides vasprintf-like function on targets where it is
+ * unavailable.
*/
-H5_GCC_DIAG_OFF("format-nonliteral")
int
-HDfprintf(FILE *stream, const char *fmt, ...)
+HDvasprintf(char **bufp, const char *fmt, va_list _ap)
{
- int n = 0, nout = 0;
- int fwidth, prec;
- int zerofill;
- int leftjust;
- int plussign;
- int ldspace;
- int prefix;
- char modifier[8];
- int conv;
- char * rest, format_templ[128];
- int len;
- const char *s;
- va_list ap;
-
- HDassert(stream);
- HDassert(fmt);
-
- HDva_start(ap, fmt);
- while (*fmt) {
- fwidth = prec = 0;
- zerofill = 0;
- leftjust = 0;
- plussign = 0;
- prefix = 0;
- ldspace = 0;
- modifier[0] = '\0';
-
- if ('%' == fmt[0] && '%' == fmt[1]) {
- HDputc('%', stream);
- fmt += 2;
- nout++;
- }
- else if ('%' == fmt[0]) {
- s = fmt + 1;
-
- /* Flags */
- while (HDstrchr("-+ #", *s)) {
- switch (*s) {
- case '-':
- leftjust = 1;
- break;
-
- case '+':
- plussign = 1;
- break;
-
- case ' ':
- ldspace = 1;
- break;
-
- case '#':
- prefix = 1;
- break;
-
- default:
- HDassert(0 && "Unknown format flag");
- } /* end switch */ /*lint !e744 Switch statement doesn't _need_ default */
- s++;
- } /* end while */
-
- /* Field width */
- if (HDisdigit(*s)) {
- zerofill = ('0' == *s);
- fwidth = (int)HDstrtol(s, &rest, 10);
- s = rest;
- } /* end if */
- else if ('*' == *s) {
- fwidth = HDva_arg(ap, int);
- if (fwidth < 0) {
- leftjust = 1;
- fwidth = -fwidth;
- }
- s++;
- }
-
- /* Precision */
- if ('.' == *s) {
- s++;
- if (HDisdigit(*s)) {
- prec = (int)HDstrtol(s, &rest, 10);
- s = rest;
- }
- else if ('*' == *s) {
- prec = HDva_arg(ap, int);
- s++;
- }
- if (prec < 1)
- prec = 1;
- }
-
- /* Extra type modifiers */
- if (HDstrchr("zZHhlqLI", *s)) {
- switch (*s) {
- /*lint --e{506} Don't issue warnings about constant value booleans */
- /*lint --e{774} Don't issue warnings boolean within 'if' always evaluates false/true */
- case 'H':
- if (sizeof(hsize_t) < sizeof(long))
- modifier[0] = '\0';
- else if (sizeof(hsize_t) == sizeof(long)) {
- HDstrncpy(modifier, "l", sizeof(modifier));
- modifier[sizeof(modifier) - 1] = '\0';
- } /* end if */
- else {
- HDstrncpy(modifier, H5_PRINTF_LL_WIDTH, sizeof(modifier));
- modifier[sizeof(modifier) - 1] = '\0';
- } /* end else */
- break;
-
- case 'Z':
- case 'z':
- if (sizeof(size_t) < sizeof(long))
- modifier[0] = '\0';
- else if (sizeof(size_t) == sizeof(long)) {
- HDstrncpy(modifier, "l", sizeof(modifier));
- modifier[sizeof(modifier) - 1] = '\0';
- } /* end if */
- else {
- HDstrncpy(modifier, H5_PRINTF_LL_WIDTH, sizeof(modifier));
- modifier[sizeof(modifier) - 1] = '\0';
- } /* end else */
- break;
-
- default:
- /* Handle 'I64' modifier for Microsoft's "__int64" type */
- if (*s == 'I' && *(s + 1) == '6' && *(s + 2) == '4') {
- modifier[0] = *s;
- modifier[1] = *(s + 1);
- modifier[2] = *(s + 2);
- modifier[3] = '\0';
- s += 2; /* Increment over 'I6', the '4' is taken care of below */
- } /* end if */
- else {
- /* Handle 'll' for long long types */
- if (*s == 'l' && *(s + 1) == 'l') {
- modifier[0] = *s;
- modifier[1] = *s;
- modifier[2] = '\0';
- s++; /* Increment over first 'l', second is taken care of below */
- } /* end if */
- else {
- modifier[0] = *s;
- modifier[1] = '\0';
- } /* end else */
- } /* end else */
- break;
- }
- s++;
- }
-
- /* Conversion */
- conv = *s++;
-
- /* Create the format template */
- len = 0;
- len += HDsnprintf(format_templ, (sizeof(format_templ) - (size_t)(len + 1)), "%%%s%s%s%s%s",
- (leftjust ? "-" : ""), (plussign ? "+" : ""), (ldspace ? " " : ""),
- (prefix ? "#" : ""), (zerofill ? "0" : ""));
- if (fwidth > 0)
- len +=
- HDsnprintf(format_templ + len, (sizeof(format_templ) - (size_t)(len + 1)), "%d", fwidth);
- if (prec > 0)
- len +=
- HDsnprintf(format_templ + len, (sizeof(format_templ) - (size_t)(len + 1)), ".%d", prec);
- if (*modifier)
- len += HDsnprintf(format_templ + len, (sizeof(format_templ) - (size_t)(len + 1)), "%s",
- modifier);
- HDsnprintf(format_templ + len, (sizeof(format_templ) - (size_t)(len + 1)), "%c", conv);
-
- /* Conversion */
- switch (conv) {
- case 'd':
- case 'i':
- if (!HDstrcmp(modifier, "h")) {
- short x = (short)HDva_arg(ap, int);
- n = fprintf(stream, format_templ, x);
- }
- else if (!*modifier) {
- int x = HDva_arg(ap, int);
- n = fprintf(stream, format_templ, x);
- }
- else if (!HDstrcmp(modifier, "l")) {
- long x = HDva_arg(ap, long);
- n = fprintf(stream, format_templ, x);
- }
- else {
- int64_t x = HDva_arg(ap, int64_t);
- n = fprintf(stream, format_templ, x);
- }
- break;
-
- case 'o':
- case 'u':
- case 'x':
- case 'X':
- if (!HDstrcmp(modifier, "h")) {
- unsigned short x = (unsigned short)HDva_arg(ap, unsigned int);
- n = fprintf(stream, format_templ, x);
- }
- else if (!*modifier) {
- unsigned int x = HDva_arg(ap, unsigned int);
- n = fprintf(stream, format_templ, x);
- }
- else if (!HDstrcmp(modifier, "l")) {
- unsigned long x = HDva_arg(ap, unsigned long);
- n = fprintf(stream, format_templ, x);
- }
- else {
- uint64_t x = HDva_arg(ap, uint64_t);
- n = fprintf(stream, format_templ, x);
- }
- break;
-
- case 'f':
- case 'e':
- case 'E':
- case 'g':
- case 'G':
- if (!HDstrcmp(modifier, "h")) {
- float x = (float)HDva_arg(ap, double);
- n = fprintf(stream, format_templ, (double)x);
- }
- else if (!*modifier || !HDstrcmp(modifier, "l")) {
- double x = HDva_arg(ap, double);
- n = fprintf(stream, format_templ, x);
- }
- else {
- /*
- * Some compilers complain when `long double' and
- * `double' are the same thing.
- */
-#if H5_SIZEOF_LONG_DOUBLE != H5_SIZEOF_DOUBLE
- long double x = HDva_arg(ap, long double);
- n = fprintf(stream, format_templ, x);
-#else
- double x = HDva_arg(ap, double);
- n = fprintf(stream, format_templ, x);
-#endif
- }
- break;
-
- case 'a': {
- haddr_t x = HDva_arg(ap, haddr_t);
-
- if (H5F_addr_defined(x)) {
- len = 0;
- len += HDsnprintf(format_templ, (sizeof(format_templ) - (size_t)(len + 1)),
- "%%%s%s%s%s%s", (leftjust ? "-" : ""), (plussign ? "+" : ""),
- (ldspace ? " " : ""), (prefix ? "#" : ""), (zerofill ? "0" : ""));
- if (fwidth > 0)
- len += HDsnprintf(format_templ + len, (sizeof(format_templ) - (size_t)(len + 1)),
- "%d", fwidth);
-
- /*lint --e{506} Don't issue warnings about constant value booleans */
- /*lint --e{774} Don't issue warnings boolean within 'if' always evaluates false/true
- */
- if (sizeof(x) == H5_SIZEOF_INT) {
- HDstrncat(format_templ, "u", (sizeof(format_templ) - (size_t)(len + 1)));
- len++;
- } /* end if */
- else if (sizeof(x) == H5_SIZEOF_LONG) {
- HDstrncat(format_templ, "lu", (sizeof(format_templ) - (size_t)(len + 1)));
- len++;
- } /* end if */
- else if (sizeof(x) == H5_SIZEOF_LONG_LONG) {
- HDstrncat(format_templ, H5_PRINTF_LL_WIDTH,
- (sizeof(format_templ) - (size_t)(len + 1)));
- len += (int)sizeof(H5_PRINTF_LL_WIDTH);
- HDstrncat(format_templ, "u", (sizeof(format_templ) - (size_t)(len + 1)));
- len++;
- }
- n = fprintf(stream, format_templ, x);
- }
- else {
- len = 0;
- HDstrncpy(format_templ, "%", (sizeof(format_templ) - (size_t)(len + 1)));
- len++;
- if (leftjust) {
- HDstrncat(format_templ, "-", (sizeof(format_templ) - (size_t)(len + 1)));
- len++;
- } /* end if */
- if (fwidth)
- len += HDsnprintf(format_templ + len, (sizeof(format_templ) - (size_t)(len + 1)),
- "%d", fwidth);
- HDstrncat(format_templ, "s", (sizeof(format_templ) - (size_t)(len + 1)));
- n = fprintf(stream, format_templ, "UNDEF");
- }
- } break;
-
- case 'c': {
- char x = (char)HDva_arg(ap, int);
- n = fprintf(stream, format_templ, x);
- } break;
-
- case 's':
- case 'p': {
- char *x = HDva_arg(ap, char *);
- n = fprintf(stream, format_templ, x);
- } break;
-
- case 'n':
- format_templ[HDstrlen(format_templ) - 1] = 'u';
- n = fprintf(stream, format_templ, nout);
- break;
-
- case 't': {
- htri_t tri_var = HDva_arg(ap, htri_t);
-
- if (tri_var > 0)
- n = fprintf(stream, "TRUE");
- else if (!tri_var)
- n = fprintf(stream, "FALSE");
- else
- n = fprintf(stream, "FAIL(%d)", (int)tri_var);
- } break;
-
- case 'T': /* Elapsed time, in seconds */
- {
- double seconds = HDva_arg(ap, double);
- char * time_string = H5_timer_get_time_string(seconds);
-
- if (time_string) {
- n = fprintf(stream, format_templ, time_string);
- HDfree(time_string);
- } /* end if */
- else
- n = fprintf(stream, format_templ, "(error)");
- } break;
-
- case 'k': {
- H5O_token_t token = HDva_arg(ap, H5O_token_t);
-
- /* Print the raw token. */
- n = fprintf(
- stream,
- "%02X:%02X:%02X:%02X:%02X:%02X:%02X:%02X:%02X:%02X:%02X:%02X:%02X:%02X:%02X:%02X",
- (unsigned char)token.__data[15], (unsigned char)token.__data[14],
- (unsigned char)token.__data[13], (unsigned char)token.__data[12],
- (unsigned char)token.__data[11], (unsigned char)token.__data[10],
- (unsigned char)token.__data[9], (unsigned char)token.__data[8],
- (unsigned char)token.__data[7], (unsigned char)token.__data[6],
- (unsigned char)token.__data[5], (unsigned char)token.__data[4],
- (unsigned char)token.__data[3], (unsigned char)token.__data[2],
- (unsigned char)token.__data[1], (unsigned char)token.__data[0]);
- } break;
-
- default:
- HDfputs(format_templ, stream);
- n = (int)HDstrlen(format_templ);
- break;
- }
- nout += n;
- fmt = s;
- }
- else {
- HDputc(*fmt, stream);
- fmt++;
- nout++;
+ char * buf; /* buffer to receive formatted string */
+ size_t bufsz; /* size of buffer to allocate */
+
+ for (bufsz = 32; (buf = HDmalloc(bufsz)) != NULL;) {
+ int ret;
+ va_list ap;
+
+ HDva_copy(ap, _ap);
+ ret = HDvsnprintf(buf, bufsz, fmt, ap);
+ va_end(ap);
+ if (ret >= 0 && (size_t)ret < bufsz) {
+ *bufp = buf;
+ return ret;
}
+ HDfree(buf);
+ if (ret < 0)
+ return ret;
+ bufsz = (size_t)ret + 1;
}
- HDva_end(ap);
- return nout;
-} /* end HDfprintf() */
-H5_GCC_DIAG_ON("format-nonliteral")
+ return -1;
+}
+#endif /* H5_HAVE_VASPRINTF */
/*-------------------------------------------------------------------------
* Function: HDstrtoll
@@ -1466,7 +1095,7 @@ done:
static size_t
H5__find_last_file_separator(const char *path, size_t len, hbool_t *no_separator)
{
- size_t i;
+ size_t i = len;
FUNC_ENTER_STATIC_NOERR
diff --git a/src/H5trace.c b/src/H5trace.c
index 6a570b6..d587853 100644
--- a/src/H5trace.c
+++ b/src/H5trace.c
@@ -25,7 +25,8 @@
/****************/
/* Module Setup */
/****************/
-#define H5I_FRIEND /*suppress error about including H5Ipkg */
+#include "H5module.h" /* This source code file is part of the H5 module */
+#define H5I_FRIEND /*suppress error about including H5Ipkg */
/***********/
/* Headers */
@@ -1658,6 +1659,10 @@ H5_trace_args(H5RS_str_t *rs, const char *type, va_list ap)
(unsigned long long)obj);
break;
+ case H5I_EVENTSET:
+ H5RS_asprintf_cat(rs, "0x%0llx (event set)", (unsigned long long)obj);
+ break;
+
case H5I_NTYPES:
H5RS_asprintf_cat(rs, "0x%0llx (ntypes - error)", (unsigned long long)obj);
break;
@@ -1672,6 +1677,15 @@ H5_trace_args(H5RS_str_t *rs, const char *type, va_list ap)
case 'I':
switch (type[1]) {
+ case 'D': /* H5I_future_discard_func_t */
+ {
+ H5I_future_discard_func_t ifdisc =
+ (H5I_future_discard_func_t)HDva_arg(ap, H5I_future_discard_func_t);
+
+ H5RS_asprintf_cat(rs, "%p", (void *)(uintptr_t)ifdisc);
+ } /* end block */
+ break;
+
case 'f': /* H5I_free_t */
{
H5I_free_t ifree = (H5I_free_t)HDva_arg(ap, H5I_free_t);
@@ -1748,6 +1762,15 @@ H5_trace_args(H5RS_str_t *rs, const char *type, va_list ap)
} /* end block */
break;
+ case 'R': /* H5I_future_realize_func_t */
+ {
+ H5I_future_realize_func_t ifreal =
+ (H5I_future_realize_func_t)HDva_arg(ap, H5I_future_realize_func_t);
+
+ H5RS_asprintf_cat(rs, "%p", (void *)(uintptr_t)ifreal);
+ } /* end block */
+ break;
+
case 's': /* int / int32_t */
{
int is = HDva_arg(ap, int);
@@ -1838,6 +1861,10 @@ H5_trace_args(H5RS_str_t *rs, const char *type, va_list ap)
H5RS_acat(rs, "H5I_SPACE_SEL_ITER");
break;
+ case H5I_EVENTSET:
+ H5RS_acat(rs, "H5I_EVENTSET");
+ break;
+
case H5I_NTYPES:
H5RS_acat(rs, "H5I_NTYPES");
break;
@@ -2958,6 +2985,10 @@ H5_trace_args(H5RS_str_t *rs, const char *type, va_list ap)
H5RS_acat(rs, "H5VL_DATASET_REFRESH");
break;
+ case H5VL_DATASET_WAIT:
+ H5RS_acat(rs, "H5VL_DATASET_WAIT");
+ break;
+
default:
H5RS_asprintf_cat(rs, "%ld", (long)specific);
break;
@@ -3082,6 +3113,10 @@ H5_trace_args(H5RS_str_t *rs, const char *type, va_list ap)
H5RS_acat(rs, "H5VL_FILE_IS_EQUAL");
break;
+ case H5VL_FILE_WAIT:
+ H5RS_acat(rs, "H5VL_FILE_WAIT");
+ break;
+
default:
H5RS_asprintf_cat(rs, "%ld", (long)specific);
break;
@@ -3294,6 +3329,34 @@ H5_trace_args(H5RS_str_t *rs, const char *type, va_list ap)
} /* end block */
break;
+ case 'r': /* H5VL_request_specific_t */
+ {
+ H5VL_request_specific_t specific = (H5VL_request_specific_t)HDva_arg(ap, int);
+
+ switch (specific) {
+ case H5VL_REQUEST_WAITANY:
+ H5RS_acat(rs, "H5VL_REQUEST_WAITANY");
+ break;
+
+ case H5VL_REQUEST_WAITSOME:
+ H5RS_acat(rs, "H5VL_REQUEST_WAITSOME");
+ break;
+
+ case H5VL_REQUEST_WAITALL:
+ H5RS_acat(rs, "H5VL_REQUEST_WAITALL");
+ break;
+
+ case H5VL_REQUEST_GET_ERR_STACK:
+ H5RS_acat(rs, "H5VL_REQUEST_GET_ERR_STACK");
+ break;
+
+ default:
+ H5RS_asprintf_cat(rs, "%ld", (long)specific);
+ break;
+ } /* end switch */
+ } /* end block */
+ break;
+
case 's': /* H5VL_attr_optional_t */
{
H5VL_attr_optional_t optional = (H5VL_attr_optional_t)HDva_arg(ap, int);
diff --git a/src/Makefile.am b/src/Makefile.am
index 08c420f..65002c1 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -19,9 +19,6 @@
include $(top_srcdir)/config/commence.am
include $(top_srcdir)/config/lt_vers.am
-# include Doxygen rules (requires autoconf-archive >2016-03-20)
-@DX_RULES@
-
# How to build H5detect for number format detection.
# Use -g to force no optimization since many compilers (e.g., Intel) takes
# a long time to compile it with any optimization on. H5detect is used
@@ -79,7 +76,7 @@ libhdf5_la_SOURCES= H5.c H5checksum.c H5dbg.c H5lib_settings.c H5system.c \
H5HG.c H5HGcache.c H5HGdbg.c H5HGquery.c H5HGtrap.c \
H5HL.c H5HLcache.c H5HLdbg.c H5HLint.c H5HLprfx.c H5HLdblk.c \
H5HP.c \
- H5I.c H5Itest.c \
+ H5I.c H5Idbg.c H5Iint.c H5Itest.c \
H5L.c H5Ldeprec.c H5Lexternal.c \
H5M.c \
H5MF.c H5MFaggr.c H5MFdbg.c H5MFsection.c \
@@ -104,7 +101,6 @@ libhdf5_la_SOURCES= H5.c H5checksum.c H5dbg.c H5lib_settings.c H5system.c \
H5Sselect.c H5Stest.c \
H5SL.c \
H5SM.c H5SMbtree2.c H5SMcache.c H5SMmessage.c H5SMtest.c \
- H5ST.c \
H5T.c H5Tarray.c H5Tbit.c H5Tcommit.c H5Tcompound.c H5Tconv.c \
H5Tcset.c H5Tdbg.c H5Tdeprec.c H5Tenum.c H5Tfields.c H5Tfixed.c \
H5Tfloat.c H5Tinit.c H5Tnative.c H5Toffset.c H5Toh.c H5Topaque.c \
diff --git a/src/hdf5.h b/src/hdf5.h
index 2e7caf9..ab799e2 100644
--- a/src/hdf5.h
+++ b/src/hdf5.h
@@ -24,6 +24,7 @@
#include "H5ACpublic.h" /* Metadata cache */
#include "H5Dpublic.h" /* Datasets */
#include "H5Epublic.h" /* Errors */
+#include "H5ESpublic.h" /* Event Sets */
#include "H5Fpublic.h" /* Files */
#include "H5FDpublic.h" /* File drivers */
#include "H5Gpublic.h" /* Groups */
diff --git a/src/uthash.h b/src/uthash.h
new file mode 100644
index 0000000..8bdca55
--- /dev/null
+++ b/src/uthash.h
@@ -0,0 +1,1184 @@
+/*
+Copyright (c) 2003-2018, Troy D. Hanson http://troydhanson.github.com/uthash/
+All rights reserved.
+
+Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions are met:
+
+ * Redistributions of source code must retain the above copyright
+ notice, this list of conditions and the following disclaimer.
+
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
+IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
+PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER
+OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+*/
+
+#ifndef UTHASH_H
+#define UTHASH_H
+
+#define UTHASH_VERSION 2.1.0
+
+#include <string.h> /* memcmp, memset, strlen */
+#include <stddef.h> /* ptrdiff_t */
+#include <stdlib.h> /* exit */
+
+/* These macros use decltype or the earlier __typeof GNU extension.
+ As decltype is only available in newer compilers (VS2010 or gcc 4.3+
+ when compiling c++ source) this code uses whatever method is needed
+ or, for VS2008 where neither is available, uses casting workarounds. */
+#if !defined(DECLTYPE) && !defined(NO_DECLTYPE)
+#if defined(_MSC_VER) /* MS compiler */
+#if _MSC_VER >= 1600 && defined(__cplusplus) /* VS2010 or newer in C++ mode */
+#define DECLTYPE(x) (decltype(x))
+#else /* VS2008 or older (or VS2010 in C mode) */
+#define NO_DECLTYPE
+#endif
+#elif defined(__BORLANDC__) || defined(__ICCARM__) || defined(__LCC__) || defined(__WATCOMC__)
+#define NO_DECLTYPE
+#else /* GNU, Sun and other compilers */
+#define DECLTYPE(x) (__typeof(x))
+#endif
+#endif
+
+#ifdef NO_DECLTYPE
+#define DECLTYPE(x)
+#define DECLTYPE_ASSIGN(dst, src) \
+ do { \
+ char **_da_dst = (char **)(&(dst)); \
+ *_da_dst = (char *)(src); \
+ } while (0)
+#else
+#define DECLTYPE_ASSIGN(dst, src) \
+ do { \
+ (dst) = DECLTYPE(dst)(src); \
+ } while (0)
+#endif
+
+/* a number of the hash function use uint32_t which isn't defined on Pre VS2010 */
+#if defined(_WIN32)
+#if defined(_MSC_VER) && _MSC_VER >= 1600
+#include <stdint.h>
+#elif defined(__WATCOMC__) || defined(__MINGW32__) || defined(__CYGWIN__)
+#include <stdint.h>
+#else
+typedef unsigned int uint32_t;
+typedef unsigned char uint8_t;
+#endif
+#elif defined(__GNUC__) && !defined(__VXWORKS__)
+#include <stdint.h>
+#else
+typedef unsigned int uint32_t;
+typedef unsigned char uint8_t;
+#endif
+
+#ifndef uthash_malloc
+#define uthash_malloc(sz) malloc(sz) /* malloc fcn */
+#endif
+#ifndef uthash_free
+#define uthash_free(ptr, sz) free(ptr) /* free fcn */
+#endif
+#ifndef uthash_bzero
+#define uthash_bzero(a, n) memset(a, '\0', n)
+#endif
+#ifndef uthash_strlen
+#define uthash_strlen(s) strlen(s)
+#endif
+
+#ifdef uthash_memcmp
+/* This warning will not catch programs that define uthash_memcmp AFTER including uthash.h. */
+#warning "uthash_memcmp is deprecated; please use HASH_KEYCMP instead"
+#else
+#define uthash_memcmp(a, b, n) memcmp(a, b, n)
+#endif
+
+#ifndef HASH_KEYCMP
+#define HASH_KEYCMP(a, b, n) uthash_memcmp(a, b, n)
+#endif
+
+#ifndef uthash_noexpand_fyi
+#define uthash_noexpand_fyi(tbl) /* can be defined to log noexpand */
+#endif
+#ifndef uthash_expand_fyi
+#define uthash_expand_fyi(tbl) /* can be defined to log expands */
+#endif
+
+#ifndef HASH_NONFATAL_OOM
+#define HASH_NONFATAL_OOM 0
+#endif
+
+#if HASH_NONFATAL_OOM
+/* malloc failures can be recovered from */
+
+#ifndef uthash_nonfatal_oom
+#define uthash_nonfatal_oom(obj) \
+ do { \
+ } while (0) /* non-fatal OOM error */
+#endif
+
+#define HASH_RECORD_OOM(oomed) \
+ do { \
+ (oomed) = 1; \
+ } while (0)
+#define IF_HASH_NONFATAL_OOM(x) x
+
+#else
+/* malloc failures result in lost memory, hash tables are unusable */
+
+#ifndef uthash_fatal
+#define uthash_fatal(msg) exit(-1) /* fatal OOM error */
+#endif
+
+#define HASH_RECORD_OOM(oomed) uthash_fatal("out of memory")
+#define IF_HASH_NONFATAL_OOM(x)
+
+#endif
+
+/* initial number of buckets */
+#define HASH_INITIAL_NUM_BUCKETS 32U /* initial number of buckets */
+#define HASH_INITIAL_NUM_BUCKETS_LOG2 5U /* lg2 of initial number of buckets */
+#define HASH_BKT_CAPACITY_THRESH 10U /* expand when bucket count reaches */
+
+/* calculate the element whose hash handle address is hhp */
+#define ELMT_FROM_HH(tbl, hhp) ((void *)(((char *)(hhp)) - ((tbl)->hho)))
+/* calculate the hash handle from element address elp */
+#define HH_FROM_ELMT(tbl, elp) ((UT_hash_handle *)(void *)(((char *)(elp)) + ((tbl)->hho)))
+
+#define HASH_ROLLBACK_BKT(hh, head, itemptrhh) \
+ do { \
+ struct UT_hash_handle *_hd_hh_item = (itemptrhh); \
+ unsigned _hd_bkt; \
+ HASH_TO_BKT(_hd_hh_item->hashv, (head)->hh.tbl->num_buckets, _hd_bkt); \
+ (head)->hh.tbl->buckets[_hd_bkt].count++; \
+ _hd_hh_item->hh_next = NULL; \
+ _hd_hh_item->hh_prev = NULL; \
+ } while (0)
+
+#define HASH_VALUE(keyptr, keylen, hashv) \
+ do { \
+ HASH_FCN(keyptr, keylen, hashv); \
+ } while (0)
+
+#define HASH_FIND_BYHASHVALUE(hh, head, keyptr, keylen, hashval, out) \
+ do { \
+ (out) = NULL; \
+ if (head) { \
+ unsigned _hf_bkt; \
+ HASH_TO_BKT(hashval, (head)->hh.tbl->num_buckets, _hf_bkt); \
+ if (HASH_BLOOM_TEST((head)->hh.tbl, hashval) != 0) { \
+ HASH_FIND_IN_BKT((head)->hh.tbl, hh, (head)->hh.tbl->buckets[_hf_bkt], keyptr, keylen, \
+ hashval, out); \
+ } \
+ } \
+ } while (0)
+
+#define HASH_FIND(hh, head, keyptr, keylen, out) \
+ do { \
+ (out) = NULL; \
+ if (head) { \
+ unsigned _hf_hashv; \
+ HASH_VALUE(keyptr, keylen, _hf_hashv); \
+ HASH_FIND_BYHASHVALUE(hh, head, keyptr, keylen, _hf_hashv, out); \
+ } \
+ } while (0)
+
+#ifdef HASH_BLOOM
+#define HASH_BLOOM_BITLEN (1UL << HASH_BLOOM)
+#define HASH_BLOOM_BYTELEN (HASH_BLOOM_BITLEN / 8UL) + (((HASH_BLOOM_BITLEN % 8UL) != 0UL) ? 1UL : 0UL)
+#define HASH_BLOOM_MAKE(tbl, oomed) \
+ do { \
+ (tbl)->bloom_nbits = HASH_BLOOM; \
+ (tbl)->bloom_bv = (uint8_t *)uthash_malloc(HASH_BLOOM_BYTELEN); \
+ if (!(tbl)->bloom_bv) { \
+ HASH_RECORD_OOM(oomed); \
+ } \
+ else { \
+ uthash_bzero((tbl)->bloom_bv, HASH_BLOOM_BYTELEN); \
+ (tbl)->bloom_sig = HASH_BLOOM_SIGNATURE; \
+ } \
+ } while (0)
+
+#define HASH_BLOOM_FREE(tbl) \
+ do { \
+ uthash_free((tbl)->bloom_bv, HASH_BLOOM_BYTELEN); \
+ } while (0)
+
+#define HASH_BLOOM_BITSET(bv, idx) (bv[(idx) / 8U] |= (1U << ((idx) % 8U)))
+#define HASH_BLOOM_BITTEST(bv, idx) (bv[(idx) / 8U] & (1U << ((idx) % 8U)))
+
+#define HASH_BLOOM_ADD(tbl, hashv) \
+ HASH_BLOOM_BITSET((tbl)->bloom_bv, ((hashv) & (uint32_t)((1UL << (tbl)->bloom_nbits) - 1U)))
+
+#define HASH_BLOOM_TEST(tbl, hashv) \
+ HASH_BLOOM_BITTEST((tbl)->bloom_bv, ((hashv) & (uint32_t)((1UL << (tbl)->bloom_nbits) - 1U)))
+
+#else
+#define HASH_BLOOM_MAKE(tbl, oomed)
+#define HASH_BLOOM_FREE(tbl)
+#define HASH_BLOOM_ADD(tbl, hashv)
+#define HASH_BLOOM_TEST(tbl, hashv) (1)
+#define HASH_BLOOM_BYTELEN 0U
+#endif
+
+#define HASH_MAKE_TABLE(hh, head, oomed) \
+ do { \
+ (head)->hh.tbl = (UT_hash_table *)uthash_malloc(sizeof(UT_hash_table)); \
+ if (!(head)->hh.tbl) { \
+ HASH_RECORD_OOM(oomed); \
+ } \
+ else { \
+ uthash_bzero((head)->hh.tbl, sizeof(UT_hash_table)); \
+ (head)->hh.tbl->tail = &((head)->hh); \
+ (head)->hh.tbl->num_buckets = HASH_INITIAL_NUM_BUCKETS; \
+ (head)->hh.tbl->log2_num_buckets = HASH_INITIAL_NUM_BUCKETS_LOG2; \
+ (head)->hh.tbl->hho = (char *)(&(head)->hh) - (char *)(head); \
+ (head)->hh.tbl->buckets = \
+ (UT_hash_bucket *)uthash_malloc(HASH_INITIAL_NUM_BUCKETS * sizeof(struct UT_hash_bucket)); \
+ (head)->hh.tbl->signature = HASH_SIGNATURE; \
+ if (!(head)->hh.tbl->buckets) { \
+ HASH_RECORD_OOM(oomed); \
+ uthash_free((head)->hh.tbl, sizeof(UT_hash_table)); \
+ } \
+ else { \
+ uthash_bzero((head)->hh.tbl->buckets, \
+ HASH_INITIAL_NUM_BUCKETS * sizeof(struct UT_hash_bucket)); \
+ HASH_BLOOM_MAKE((head)->hh.tbl, oomed); \
+ IF_HASH_NONFATAL_OOM(if (oomed) { \
+ uthash_free((head)->hh.tbl->buckets, \
+ HASH_INITIAL_NUM_BUCKETS * sizeof(struct UT_hash_bucket)); \
+ uthash_free((head)->hh.tbl, sizeof(UT_hash_table)); \
+ }) \
+ } \
+ } \
+ } while (0)
+
+#define HASH_REPLACE_BYHASHVALUE_INORDER(hh, head, fieldname, keylen_in, hashval, add, replaced, cmpfcn) \
+ do { \
+ (replaced) = NULL; \
+ HASH_FIND_BYHASHVALUE(hh, head, &((add)->fieldname), keylen_in, hashval, replaced); \
+ if (replaced) { \
+ HASH_DELETE(hh, head, replaced); \
+ } \
+ HASH_ADD_KEYPTR_BYHASHVALUE_INORDER(hh, head, &((add)->fieldname), keylen_in, hashval, add, cmpfcn); \
+ } while (0)
+
+#define HASH_REPLACE_BYHASHVALUE(hh, head, fieldname, keylen_in, hashval, add, replaced) \
+ do { \
+ (replaced) = NULL; \
+ HASH_FIND_BYHASHVALUE(hh, head, &((add)->fieldname), keylen_in, hashval, replaced); \
+ if (replaced) { \
+ HASH_DELETE(hh, head, replaced); \
+ } \
+ HASH_ADD_KEYPTR_BYHASHVALUE(hh, head, &((add)->fieldname), keylen_in, hashval, add); \
+ } while (0)
+
+#define HASH_REPLACE(hh, head, fieldname, keylen_in, add, replaced) \
+ do { \
+ unsigned _hr_hashv; \
+ HASH_VALUE(&((add)->fieldname), keylen_in, _hr_hashv); \
+ HASH_REPLACE_BYHASHVALUE(hh, head, fieldname, keylen_in, _hr_hashv, add, replaced); \
+ } while (0)
+
+#define HASH_REPLACE_INORDER(hh, head, fieldname, keylen_in, add, replaced, cmpfcn) \
+ do { \
+ unsigned _hr_hashv; \
+ HASH_VALUE(&((add)->fieldname), keylen_in, _hr_hashv); \
+ HASH_REPLACE_BYHASHVALUE_INORDER(hh, head, fieldname, keylen_in, _hr_hashv, add, replaced, cmpfcn); \
+ } while (0)
+
+#define HASH_APPEND_LIST(hh, head, add) \
+ do { \
+ (add)->hh.next = NULL; \
+ (add)->hh.prev = ELMT_FROM_HH((head)->hh.tbl, (head)->hh.tbl->tail); \
+ (head)->hh.tbl->tail->next = (add); \
+ (head)->hh.tbl->tail = &((add)->hh); \
+ } while (0)
+
+#define HASH_AKBI_INNER_LOOP(hh, head, add, cmpfcn) \
+ do { \
+ do { \
+ if (cmpfcn(DECLTYPE(head)(_hs_iter), add) > 0) { \
+ break; \
+ } \
+ } while ((_hs_iter = HH_FROM_ELMT((head)->hh.tbl, _hs_iter)->next)); \
+ } while (0)
+
+#ifdef NO_DECLTYPE
+#undef HASH_AKBI_INNER_LOOP
+#define HASH_AKBI_INNER_LOOP(hh, head, add, cmpfcn) \
+ do { \
+ char *_hs_saved_head = (char *)(head); \
+ do { \
+ DECLTYPE_ASSIGN(head, _hs_iter); \
+ if (cmpfcn(head, add) > 0) { \
+ DECLTYPE_ASSIGN(head, _hs_saved_head); \
+ break; \
+ } \
+ DECLTYPE_ASSIGN(head, _hs_saved_head); \
+ } while ((_hs_iter = HH_FROM_ELMT((head)->hh.tbl, _hs_iter)->next)); \
+ } while (0)
+#endif
+
+#if HASH_NONFATAL_OOM
+
+#define HASH_ADD_TO_TABLE(hh, head, keyptr, keylen_in, hashval, add, oomed) \
+ do { \
+ if (!(oomed)) { \
+ unsigned _ha_bkt; \
+ (head)->hh.tbl->num_items++; \
+ HASH_TO_BKT(hashval, (head)->hh.tbl->num_buckets, _ha_bkt); \
+ HASH_ADD_TO_BKT((head)->hh.tbl->buckets[_ha_bkt], hh, &(add)->hh, oomed); \
+ if (oomed) { \
+ HASH_ROLLBACK_BKT(hh, head, &(add)->hh); \
+ HASH_DELETE_HH(hh, head, &(add)->hh); \
+ (add)->hh.tbl = NULL; \
+ uthash_nonfatal_oom(add); \
+ } \
+ else { \
+ HASH_BLOOM_ADD((head)->hh.tbl, hashval); \
+ HASH_EMIT_KEY(hh, head, keyptr, keylen_in); \
+ } \
+ } \
+ else { \
+ (add)->hh.tbl = NULL; \
+ uthash_nonfatal_oom(add); \
+ } \
+ } while (0)
+
+#else
+
+#define HASH_ADD_TO_TABLE(hh, head, keyptr, keylen_in, hashval, add, oomed) \
+ do { \
+ unsigned _ha_bkt; \
+ (head)->hh.tbl->num_items++; \
+ HASH_TO_BKT(hashval, (head)->hh.tbl->num_buckets, _ha_bkt); \
+ HASH_ADD_TO_BKT((head)->hh.tbl->buckets[_ha_bkt], hh, &(add)->hh, oomed); \
+ HASH_BLOOM_ADD((head)->hh.tbl, hashval); \
+ HASH_EMIT_KEY(hh, head, keyptr, keylen_in); \
+ } while (0)
+
+#endif
+
+#define HASH_ADD_KEYPTR_BYHASHVALUE_INORDER(hh, head, keyptr, keylen_in, hashval, add, cmpfcn) \
+ do { \
+ IF_HASH_NONFATAL_OOM(int _ha_oomed = 0;) \
+ (add)->hh.hashv = (hashval); \
+ (add)->hh.key = (char *)(keyptr); \
+ (add)->hh.keylen = (unsigned)(keylen_in); \
+ if (!(head)) { \
+ (add)->hh.next = NULL; \
+ (add)->hh.prev = NULL; \
+ HASH_MAKE_TABLE(hh, add, _ha_oomed); \
+ IF_HASH_NONFATAL_OOM(if (!_ha_oomed) { ) \
+ (head) = (add); \
+ IF_HASH_NONFATAL_OOM( \
+ }) \
+ } \
+ else { \
+ void *_hs_iter = (head); \
+ (add)->hh.tbl = (head)->hh.tbl; \
+ HASH_AKBI_INNER_LOOP(hh, head, add, cmpfcn); \
+ if (_hs_iter) { \
+ (add)->hh.next = _hs_iter; \
+ if (((add)->hh.prev = HH_FROM_ELMT((head)->hh.tbl, _hs_iter)->prev)) { \
+ HH_FROM_ELMT((head)->hh.tbl, (add)->hh.prev)->next = (add); \
+ } \
+ else { \
+ (head) = (add); \
+ } \
+ HH_FROM_ELMT((head)->hh.tbl, _hs_iter)->prev = (add); \
+ } \
+ else { \
+ HASH_APPEND_LIST(hh, head, add); \
+ } \
+ } \
+ HASH_ADD_TO_TABLE(hh, head, keyptr, keylen_in, hashval, add, _ha_oomed); \
+ HASH_FSCK(hh, head, "HASH_ADD_KEYPTR_BYHASHVALUE_INORDER"); \
+ } while (0)
+
+#define HASH_ADD_KEYPTR_INORDER(hh, head, keyptr, keylen_in, add, cmpfcn) \
+ do { \
+ unsigned _hs_hashv; \
+ HASH_VALUE(keyptr, keylen_in, _hs_hashv); \
+ HASH_ADD_KEYPTR_BYHASHVALUE_INORDER(hh, head, keyptr, keylen_in, _hs_hashv, add, cmpfcn); \
+ } while (0)
+
+#define HASH_ADD_BYHASHVALUE_INORDER(hh, head, fieldname, keylen_in, hashval, add, cmpfcn) \
+ HASH_ADD_KEYPTR_BYHASHVALUE_INORDER(hh, head, &((add)->fieldname), keylen_in, hashval, add, cmpfcn)
+
+#define HASH_ADD_INORDER(hh, head, fieldname, keylen_in, add, cmpfcn) \
+ HASH_ADD_KEYPTR_INORDER(hh, head, &((add)->fieldname), keylen_in, add, cmpfcn)
+
+#define HASH_ADD_KEYPTR_BYHASHVALUE(hh, head, keyptr, keylen_in, hashval, add) \
+ do { \
+ IF_HASH_NONFATAL_OOM(int _ha_oomed = 0;) \
+ (add)->hh.hashv = (hashval); \
+ (add)->hh.key = (char *)(keyptr); \
+ (add)->hh.keylen = (unsigned)(keylen_in); \
+ if (!(head)) { \
+ (add)->hh.next = NULL; \
+ (add)->hh.prev = NULL; \
+ HASH_MAKE_TABLE(hh, add, _ha_oomed); \
+ IF_HASH_NONFATAL_OOM(if (!_ha_oomed) { ) \
+ (head) = (add); \
+ IF_HASH_NONFATAL_OOM( \
+ }) \
+ } \
+ else { \
+ (add)->hh.tbl = (head)->hh.tbl; \
+ HASH_APPEND_LIST(hh, head, add); \
+ } \
+ HASH_ADD_TO_TABLE(hh, head, keyptr, keylen_in, hashval, add, _ha_oomed); \
+ HASH_FSCK(hh, head, "HASH_ADD_KEYPTR_BYHASHVALUE"); \
+ } while (0)
+
+#define HASH_ADD_KEYPTR(hh, head, keyptr, keylen_in, add) \
+ do { \
+ unsigned _ha_hashv; \
+ HASH_VALUE(keyptr, keylen_in, _ha_hashv); \
+ HASH_ADD_KEYPTR_BYHASHVALUE(hh, head, keyptr, keylen_in, _ha_hashv, add); \
+ } while (0)
+
+#define HASH_ADD_BYHASHVALUE(hh, head, fieldname, keylen_in, hashval, add) \
+ HASH_ADD_KEYPTR_BYHASHVALUE(hh, head, &((add)->fieldname), keylen_in, hashval, add)
+
+#define HASH_ADD(hh, head, fieldname, keylen_in, add) \
+ HASH_ADD_KEYPTR(hh, head, &((add)->fieldname), keylen_in, add)
+
+#define HASH_TO_BKT(hashv, num_bkts, bkt) \
+ do { \
+ bkt = ((hashv) & ((num_bkts)-1U)); \
+ } while (0)
+
+/* delete "delptr" from the hash table.
+ * "the usual" patch-up process for the app-order doubly-linked-list.
+ * The use of _hd_hh_del below deserves special explanation.
+ * These used to be expressed using (delptr) but that led to a bug
+ * if someone used the same symbol for the head and deletee, like
+ * HASH_DELETE(hh,users,users);
+ * We want that to work, but by changing the head (users) below
+ * we were forfeiting our ability to further refer to the deletee (users)
+ * in the patch-up process. Solution: use scratch space to
+ * copy the deletee pointer, then the latter references are via that
+ * scratch pointer rather than through the repointed (users) symbol.
+ */
+#define HASH_DELETE(hh, head, delptr) HASH_DELETE_HH(hh, head, &(delptr)->hh)
+
+#define HASH_DELETE_HH(hh, head, delptrhh) \
+ do { \
+ struct UT_hash_handle *_hd_hh_del = (delptrhh); \
+ if ((_hd_hh_del->prev == NULL) && (_hd_hh_del->next == NULL)) { \
+ HASH_BLOOM_FREE((head)->hh.tbl); \
+ uthash_free((head)->hh.tbl->buckets, \
+ (head)->hh.tbl->num_buckets * sizeof(struct UT_hash_bucket)); \
+ uthash_free((head)->hh.tbl, sizeof(UT_hash_table)); \
+ (head) = NULL; \
+ } \
+ else { \
+ unsigned _hd_bkt; \
+ if (_hd_hh_del == (head)->hh.tbl->tail) { \
+ (head)->hh.tbl->tail = HH_FROM_ELMT((head)->hh.tbl, _hd_hh_del->prev); \
+ } \
+ if (_hd_hh_del->prev != NULL) { \
+ HH_FROM_ELMT((head)->hh.tbl, _hd_hh_del->prev)->next = _hd_hh_del->next; \
+ } \
+ else { \
+ DECLTYPE_ASSIGN(head, _hd_hh_del->next); \
+ } \
+ if (_hd_hh_del->next != NULL) { \
+ HH_FROM_ELMT((head)->hh.tbl, _hd_hh_del->next)->prev = _hd_hh_del->prev; \
+ } \
+ HASH_TO_BKT(_hd_hh_del->hashv, (head)->hh.tbl->num_buckets, _hd_bkt); \
+ HASH_DEL_IN_BKT((head)->hh.tbl->buckets[_hd_bkt], _hd_hh_del); \
+ (head)->hh.tbl->num_items--; \
+ } \
+ HASH_FSCK(hh, head, "HASH_DELETE_HH"); \
+ } while (0)
+
+/* convenience forms of HASH_FIND/HASH_ADD/HASH_DEL */
+#define HASH_FIND_STR(head, findstr, out) \
+ do { \
+ unsigned _uthash_hfstr_keylen = (unsigned)uthash_strlen(findstr); \
+ HASH_FIND(hh, head, findstr, _uthash_hfstr_keylen, out); \
+ } while (0)
+#define HASH_ADD_STR(head, strfield, add) \
+ do { \
+ unsigned _uthash_hastr_keylen = (unsigned)uthash_strlen((add)->strfield); \
+ HASH_ADD(hh, head, strfield[0], _uthash_hastr_keylen, add); \
+ } while (0)
+#define HASH_REPLACE_STR(head, strfield, add, replaced) \
+ do { \
+ unsigned _uthash_hrstr_keylen = (unsigned)uthash_strlen((add)->strfield); \
+ HASH_REPLACE(hh, head, strfield[0], _uthash_hrstr_keylen, add, replaced); \
+ } while (0)
+#define HASH_FIND_INT(head, findint, out) HASH_FIND(hh, head, findint, sizeof(int), out)
+#define HASH_ADD_INT(head, intfield, add) HASH_ADD(hh, head, intfield, sizeof(int), add)
+#define HASH_REPLACE_INT(head, intfield, add, replaced) \
+ HASH_REPLACE(hh, head, intfield, sizeof(int), add, replaced)
+#define HASH_FIND_PTR(head, findptr, out) HASH_FIND(hh, head, findptr, sizeof(void *), out)
+#define HASH_ADD_PTR(head, ptrfield, add) HASH_ADD(hh, head, ptrfield, sizeof(void *), add)
+#define HASH_REPLACE_PTR(head, ptrfield, add, replaced) \
+ HASH_REPLACE(hh, head, ptrfield, sizeof(void *), add, replaced)
+#define HASH_DEL(head, delptr) HASH_DELETE(hh, head, delptr)
+
+/* HASH_FSCK checks hash integrity on every add/delete when HASH_DEBUG is defined.
+ * This is for uthash developer only; it compiles away if HASH_DEBUG isn't defined.
+ */
+#ifdef HASH_DEBUG
+#include <stdio.h> /* fprintf, stderr */
+#define HASH_OOPS(...) \
+ do { \
+ fprintf(stderr, __VA_ARGS__); \
+ exit(-1); \
+ } while (0)
+#define HASH_FSCK(hh, head, where) \
+ do { \
+ struct UT_hash_handle *_thh; \
+ if (head) { \
+ unsigned _bkt_i; \
+ unsigned _count = 0; \
+ char * _prev; \
+ for (_bkt_i = 0; _bkt_i < (head)->hh.tbl->num_buckets; ++_bkt_i) { \
+ unsigned _bkt_count = 0; \
+ _thh = (head)->hh.tbl->buckets[_bkt_i].hh_head; \
+ _prev = NULL; \
+ while (_thh) { \
+ if (_prev != (char *)(_thh->hh_prev)) { \
+ HASH_OOPS("%s: invalid hh_prev %p, actual %p\n", (where), (void *)_thh->hh_prev, \
+ (void *)_prev); \
+ } \
+ _bkt_count++; \
+ _prev = (char *)(_thh); \
+ _thh = _thh->hh_next; \
+ } \
+ _count += _bkt_count; \
+ if ((head)->hh.tbl->buckets[_bkt_i].count != _bkt_count) { \
+ HASH_OOPS("%s: invalid bucket count %u, actual %u\n", (where), \
+ (head)->hh.tbl->buckets[_bkt_i].count, _bkt_count); \
+ } \
+ } \
+ if (_count != (head)->hh.tbl->num_items) { \
+ HASH_OOPS("%s: invalid hh item count %u, actual %u\n", (where), (head)->hh.tbl->num_items, \
+ _count); \
+ } \
+ _count = 0; \
+ _prev = NULL; \
+ _thh = &(head)->hh; \
+ while (_thh) { \
+ _count++; \
+ if (_prev != (char *)_thh->prev) { \
+ HASH_OOPS("%s: invalid prev %p, actual %p\n", (where), (void *)_thh->prev, \
+ (void *)_prev); \
+ } \
+ _prev = (char *)ELMT_FROM_HH((head)->hh.tbl, _thh); \
+ _thh = (_thh->next ? HH_FROM_ELMT((head)->hh.tbl, _thh->next) : NULL); \
+ } \
+ if (_count != (head)->hh.tbl->num_items) { \
+ HASH_OOPS("%s: invalid app item count %u, actual %u\n", (where), (head)->hh.tbl->num_items, \
+ _count); \
+ } \
+ } \
+ } while (0)
+#else
+#define HASH_FSCK(hh, head, where)
+#endif
+
+/* When compiled with -DHASH_EMIT_KEYS, length-prefixed keys are emitted to
+ * the descriptor to which this macro is defined for tuning the hash function.
+ * The app can #include <unistd.h> to get the prototype for write(2). */
+#ifdef HASH_EMIT_KEYS
+#define HASH_EMIT_KEY(hh, head, keyptr, fieldlen) \
+ do { \
+ unsigned _klen = fieldlen; \
+ write(HASH_EMIT_KEYS, &_klen, sizeof(_klen)); \
+ write(HASH_EMIT_KEYS, keyptr, (unsigned long)fieldlen); \
+ } while (0)
+#else
+#define HASH_EMIT_KEY(hh, head, keyptr, fieldlen)
+#endif
+
+/* default to Jenkin's hash unless overridden e.g. DHASH_FUNCTION=HASH_SAX */
+#ifdef HASH_FUNCTION
+#define HASH_FCN HASH_FUNCTION
+#else
+#define HASH_FCN HASH_JEN
+#endif
+
+/* The Bernstein hash function, used in Perl prior to v5.6. Note (x<<5+x)=x*33. */
+#define HASH_BER(key, keylen, hashv) \
+ do { \
+ unsigned _hb_keylen = (unsigned)keylen; \
+ const unsigned char *_hb_key = (const unsigned char *)(key); \
+ (hashv) = 0; \
+ while (_hb_keylen-- != 0U) { \
+ (hashv) = (((hashv) << 5) + (hashv)) + *_hb_key++; \
+ } \
+ } while (0)
+
+/* SAX/FNV/OAT/JEN hash functions are macro variants of those listed at
+ * http://eternallyconfuzzled.com/tuts/algorithms/jsw_tut_hashing.aspx */
+#define HASH_SAX(key, keylen, hashv) \
+ do { \
+ unsigned _sx_i; \
+ const unsigned char *_hs_key = (const unsigned char *)(key); \
+ hashv = 0; \
+ for (_sx_i = 0; _sx_i < keylen; _sx_i++) { \
+ hashv ^= (hashv << 5) + (hashv >> 2) + _hs_key[_sx_i]; \
+ } \
+ } while (0)
+/* FNV-1a variation */
+#define HASH_FNV(key, keylen, hashv) \
+ do { \
+ unsigned _fn_i; \
+ const unsigned char *_hf_key = (const unsigned char *)(key); \
+ (hashv) = 2166136261U; \
+ for (_fn_i = 0; _fn_i < keylen; _fn_i++) { \
+ hashv = hashv ^ _hf_key[_fn_i]; \
+ hashv = hashv * 16777619U; \
+ } \
+ } while (0)
+
+#define HASH_OAT(key, keylen, hashv) \
+ do { \
+ unsigned _ho_i; \
+ const unsigned char *_ho_key = (const unsigned char *)(key); \
+ hashv = 0; \
+ for (_ho_i = 0; _ho_i < keylen; _ho_i++) { \
+ hashv += _ho_key[_ho_i]; \
+ hashv += (hashv << 10); \
+ hashv ^= (hashv >> 6); \
+ } \
+ hashv += (hashv << 3); \
+ hashv ^= (hashv >> 11); \
+ hashv += (hashv << 15); \
+ } while (0)
+
+#define HASH_JEN_MIX(a, b, c) \
+ do { \
+ a -= b; \
+ a -= c; \
+ a ^= (c >> 13); \
+ b -= c; \
+ b -= a; \
+ b ^= (a << 8); \
+ c -= a; \
+ c -= b; \
+ c ^= (b >> 13); \
+ a -= b; \
+ a -= c; \
+ a ^= (c >> 12); \
+ b -= c; \
+ b -= a; \
+ b ^= (a << 16); \
+ c -= a; \
+ c -= b; \
+ c ^= (b >> 5); \
+ a -= b; \
+ a -= c; \
+ a ^= (c >> 3); \
+ b -= c; \
+ b -= a; \
+ b ^= (a << 10); \
+ c -= a; \
+ c -= b; \
+ c ^= (b >> 15); \
+ } while (0)
+
+#define HASH_JEN(key, keylen, hashv) \
+ do { \
+ unsigned _hj_i, _hj_j, _hj_k; \
+ unsigned const char *_hj_key = (unsigned const char *)(key); \
+ hashv = 0xfeedbeefu; \
+ _hj_i = _hj_j = 0x9e3779b9u; \
+ _hj_k = (unsigned)(keylen); \
+ while (_hj_k >= 12U) { \
+ _hj_i += (_hj_key[0] + ((unsigned)_hj_key[1] << 8) + ((unsigned)_hj_key[2] << 16) + \
+ ((unsigned)_hj_key[3] << 24)); \
+ _hj_j += (_hj_key[4] + ((unsigned)_hj_key[5] << 8) + ((unsigned)_hj_key[6] << 16) + \
+ ((unsigned)_hj_key[7] << 24)); \
+ hashv += (_hj_key[8] + ((unsigned)_hj_key[9] << 8) + ((unsigned)_hj_key[10] << 16) + \
+ ((unsigned)_hj_key[11] << 24)); \
+ \
+ HASH_JEN_MIX(_hj_i, _hj_j, hashv); \
+ \
+ _hj_key += 12; \
+ _hj_k -= 12U; \
+ } \
+ hashv += (unsigned)(keylen); \
+ switch (_hj_k) { \
+ case 11: \
+ hashv += ((unsigned)_hj_key[10] << 24); /* FALLTHROUGH */ \
+ case 10: \
+ hashv += ((unsigned)_hj_key[9] << 16); /* FALLTHROUGH */ \
+ case 9: \
+ hashv += ((unsigned)_hj_key[8] << 8); /* FALLTHROUGH */ \
+ case 8: \
+ _hj_j += ((unsigned)_hj_key[7] << 24); /* FALLTHROUGH */ \
+ case 7: \
+ _hj_j += ((unsigned)_hj_key[6] << 16); /* FALLTHROUGH */ \
+ case 6: \
+ _hj_j += ((unsigned)_hj_key[5] << 8); /* FALLTHROUGH */ \
+ case 5: \
+ _hj_j += _hj_key[4]; /* FALLTHROUGH */ \
+ case 4: \
+ _hj_i += ((unsigned)_hj_key[3] << 24); /* FALLTHROUGH */ \
+ case 3: \
+ _hj_i += ((unsigned)_hj_key[2] << 16); /* FALLTHROUGH */ \
+ case 2: \
+ _hj_i += ((unsigned)_hj_key[1] << 8); /* FALLTHROUGH */ \
+ case 1: \
+ _hj_i += _hj_key[0]; \
+ } \
+ HASH_JEN_MIX(_hj_i, _hj_j, hashv); \
+ } while (0)
+
+/* The Paul Hsieh hash function */
+#undef get16bits
+#if (defined(__GNUC__) && defined(__i386__)) || defined(__WATCOMC__) || defined(_MSC_VER) || \
+ defined(__BORLANDC__) || defined(__TURBOC__)
+#define get16bits(d) (*((const uint16_t *)(d)))
+#endif
+
+#if !defined(get16bits)
+#define get16bits(d) ((((uint32_t)(((const uint8_t *)(d))[1])) << 8) + (uint32_t)(((const uint8_t *)(d))[0]))
+#endif
+#define HASH_SFH(key, keylen, hashv) \
+ do { \
+ unsigned const char *_sfh_key = (unsigned const char *)(key); \
+ uint32_t _sfh_tmp, _sfh_len = (uint32_t)keylen; \
+ \
+ unsigned _sfh_rem = _sfh_len & 3U; \
+ _sfh_len >>= 2; \
+ hashv = 0xcafebabeu; \
+ \
+ /* Main loop */ \
+ for (; _sfh_len > 0U; _sfh_len--) { \
+ hashv += get16bits(_sfh_key); \
+ _sfh_tmp = ((uint32_t)(get16bits(_sfh_key + 2)) << 11) ^ hashv; \
+ hashv = (hashv << 16) ^ _sfh_tmp; \
+ _sfh_key += 2U * sizeof(uint16_t); \
+ hashv += hashv >> 11; \
+ } \
+ \
+ /* Handle end cases */ \
+ switch (_sfh_rem) { \
+ case 3: \
+ hashv += get16bits(_sfh_key); \
+ hashv ^= hashv << 16; \
+ hashv ^= (uint32_t)(_sfh_key[sizeof(uint16_t)]) << 18; \
+ hashv += hashv >> 11; \
+ break; \
+ case 2: \
+ hashv += get16bits(_sfh_key); \
+ hashv ^= hashv << 11; \
+ hashv += hashv >> 17; \
+ break; \
+ case 1: \
+ hashv += *_sfh_key; \
+ hashv ^= hashv << 10; \
+ hashv += hashv >> 1; \
+ } \
+ \
+ /* Force "avalanching" of final 127 bits */ \
+ hashv ^= hashv << 3; \
+ hashv += hashv >> 5; \
+ hashv ^= hashv << 4; \
+ hashv += hashv >> 17; \
+ hashv ^= hashv << 25; \
+ hashv += hashv >> 6; \
+ } while (0)
+
+/* iterate over items in a known bucket to find desired item */
+#define HASH_FIND_IN_BKT(tbl, hh, head, keyptr, keylen_in, hashval, out) \
+ do { \
+ if ((head).hh_head != NULL) { \
+ DECLTYPE_ASSIGN(out, ELMT_FROM_HH(tbl, (head).hh_head)); \
+ } \
+ else { \
+ (out) = NULL; \
+ } \
+ while ((out) != NULL) { \
+ if ((out)->hh.hashv == (hashval) && (out)->hh.keylen == (keylen_in)) { \
+ if (HASH_KEYCMP((out)->hh.key, keyptr, keylen_in) == 0) { \
+ break; \
+ } \
+ } \
+ if ((out)->hh.hh_next != NULL) { \
+ DECLTYPE_ASSIGN(out, ELMT_FROM_HH(tbl, (out)->hh.hh_next)); \
+ } \
+ else { \
+ (out) = NULL; \
+ } \
+ } \
+ } while (0)
+
+/* add an item to a bucket */
+#define HASH_ADD_TO_BKT(head, hh, addhh, oomed) \
+ do { \
+ UT_hash_bucket *_ha_head = &(head); \
+ _ha_head->count++; \
+ (addhh)->hh_next = _ha_head->hh_head; \
+ (addhh)->hh_prev = NULL; \
+ if (_ha_head->hh_head != NULL) { \
+ _ha_head->hh_head->hh_prev = (addhh); \
+ } \
+ _ha_head->hh_head = (addhh); \
+ if ((_ha_head->count >= ((_ha_head->expand_mult + 1U) * HASH_BKT_CAPACITY_THRESH)) && \
+ !(addhh)->tbl->noexpand) { \
+ HASH_EXPAND_BUCKETS(addhh, (addhh)->tbl, oomed); \
+ IF_HASH_NONFATAL_OOM(if (oomed) { HASH_DEL_IN_BKT(head, addhh); }) \
+ } \
+ } while (0)
+
+/* remove an item from a given bucket */
+#define HASH_DEL_IN_BKT(head, delhh) \
+ do { \
+ UT_hash_bucket *_hd_head = &(head); \
+ _hd_head->count--; \
+ if (_hd_head->hh_head == (delhh)) { \
+ _hd_head->hh_head = (delhh)->hh_next; \
+ } \
+ if ((delhh)->hh_prev) { \
+ (delhh)->hh_prev->hh_next = (delhh)->hh_next; \
+ } \
+ if ((delhh)->hh_next) { \
+ (delhh)->hh_next->hh_prev = (delhh)->hh_prev; \
+ } \
+ } while (0)
+
+/* Bucket expansion has the effect of doubling the number of buckets
+ * and redistributing the items into the new buckets. Ideally the
+ * items will distribute more or less evenly into the new buckets
+ * (the extent to which this is true is a measure of the quality of
+ * the hash function as it applies to the key domain).
+ *
+ * With the items distributed into more buckets, the chain length
+ * (item count) in each bucket is reduced. Thus by expanding buckets
+ * the hash keeps a bound on the chain length. This bounded chain
+ * length is the essence of how a hash provides constant time lookup.
+ *
+ * The calculation of tbl->ideal_chain_maxlen below deserves some
+ * explanation. First, keep in mind that we're calculating the ideal
+ * maximum chain length based on the *new* (doubled) bucket count.
+ * In fractions this is just n/b (n=number of items,b=new num buckets).
+ * Since the ideal chain length is an integer, we want to calculate
+ * ceil(n/b). We don't depend on floating point arithmetic in this
+ * hash, so to calculate ceil(n/b) with integers we could write
+ *
+ * ceil(n/b) = (n/b) + ((n%b)?1:0)
+ *
+ * and in fact a previous version of this hash did just that.
+ * But now we have improved things a bit by recognizing that b is
+ * always a power of two. We keep its base 2 log handy (call it lb),
+ * so now we can write this with a bit shift and logical AND:
+ *
+ * ceil(n/b) = (n>>lb) + ( (n & (b-1)) ? 1:0)
+ *
+ */
+#define HASH_EXPAND_BUCKETS(hh, tbl, oomed) \
+ do { \
+ unsigned _he_bkt; \
+ unsigned _he_bkt_i; \
+ struct UT_hash_handle *_he_thh, *_he_hh_nxt; \
+ UT_hash_bucket * _he_new_buckets, *_he_newbkt; \
+ _he_new_buckets = \
+ (UT_hash_bucket *)uthash_malloc(2UL * (tbl)->num_buckets * sizeof(struct UT_hash_bucket)); \
+ if (!_he_new_buckets) { \
+ HASH_RECORD_OOM(oomed); \
+ } \
+ else { \
+ uthash_bzero(_he_new_buckets, 2UL * (tbl)->num_buckets * sizeof(struct UT_hash_bucket)); \
+ (tbl)->ideal_chain_maxlen = \
+ ((tbl)->num_items >> ((tbl)->log2_num_buckets + 1U)) + \
+ ((((tbl)->num_items & (((tbl)->num_buckets * 2U) - 1U)) != 0U) ? 1U : 0U); \
+ (tbl)->nonideal_items = 0; \
+ for (_he_bkt_i = 0; _he_bkt_i < (tbl)->num_buckets; _he_bkt_i++) { \
+ _he_thh = (tbl)->buckets[_he_bkt_i].hh_head; \
+ while (_he_thh != NULL) { \
+ _he_hh_nxt = _he_thh->hh_next; \
+ HASH_TO_BKT(_he_thh->hashv, (tbl)->num_buckets * 2U, _he_bkt); \
+ _he_newbkt = &(_he_new_buckets[_he_bkt]); \
+ if (++(_he_newbkt->count) > (tbl)->ideal_chain_maxlen) { \
+ (tbl)->nonideal_items++; \
+ if (_he_newbkt->count > _he_newbkt->expand_mult * (tbl)->ideal_chain_maxlen) { \
+ _he_newbkt->expand_mult++; \
+ } \
+ } \
+ _he_thh->hh_prev = NULL; \
+ _he_thh->hh_next = _he_newbkt->hh_head; \
+ if (_he_newbkt->hh_head != NULL) { \
+ _he_newbkt->hh_head->hh_prev = _he_thh; \
+ } \
+ _he_newbkt->hh_head = _he_thh; \
+ _he_thh = _he_hh_nxt; \
+ } \
+ } \
+ uthash_free((tbl)->buckets, (tbl)->num_buckets * sizeof(struct UT_hash_bucket)); \
+ (tbl)->num_buckets *= 2U; \
+ (tbl)->log2_num_buckets++; \
+ (tbl)->buckets = _he_new_buckets; \
+ (tbl)->ineff_expands = \
+ ((tbl)->nonideal_items > ((tbl)->num_items >> 1)) ? ((tbl)->ineff_expands + 1U) : 0U; \
+ if ((tbl)->ineff_expands > 1U) { \
+ (tbl)->noexpand = 1; \
+ uthash_noexpand_fyi(tbl); \
+ } \
+ uthash_expand_fyi(tbl); \
+ } \
+ } while (0)
+
+/* This is an adaptation of Simon Tatham's O(n log(n)) mergesort */
+/* Note that HASH_SORT assumes the hash handle name to be hh.
+ * HASH_SRT was added to allow the hash handle name to be passed in. */
+#define HASH_SORT(head, cmpfcn) HASH_SRT(hh, head, cmpfcn)
+#define HASH_SRT(hh, head, cmpfcn) \
+ do { \
+ unsigned _hs_i; \
+ unsigned _hs_looping, _hs_nmerges, _hs_insize, _hs_psize, _hs_qsize; \
+ struct UT_hash_handle *_hs_p, *_hs_q, *_hs_e, *_hs_list, *_hs_tail; \
+ if (head != NULL) { \
+ _hs_insize = 1; \
+ _hs_looping = 1; \
+ _hs_list = &((head)->hh); \
+ while (_hs_looping != 0U) { \
+ _hs_p = _hs_list; \
+ _hs_list = NULL; \
+ _hs_tail = NULL; \
+ _hs_nmerges = 0; \
+ while (_hs_p != NULL) { \
+ _hs_nmerges++; \
+ _hs_q = _hs_p; \
+ _hs_psize = 0; \
+ for (_hs_i = 0; _hs_i < _hs_insize; ++_hs_i) { \
+ _hs_psize++; \
+ _hs_q = ((_hs_q->next != NULL) ? HH_FROM_ELMT((head)->hh.tbl, _hs_q->next) : NULL); \
+ if (_hs_q == NULL) { \
+ break; \
+ } \
+ } \
+ _hs_qsize = _hs_insize; \
+ while ((_hs_psize != 0U) || ((_hs_qsize != 0U) && (_hs_q != NULL))) { \
+ if (_hs_psize == 0U) { \
+ _hs_e = _hs_q; \
+ _hs_q = \
+ ((_hs_q->next != NULL) ? HH_FROM_ELMT((head)->hh.tbl, _hs_q->next) : NULL); \
+ _hs_qsize--; \
+ } \
+ else if ((_hs_qsize == 0U) || (_hs_q == NULL)) { \
+ _hs_e = _hs_p; \
+ if (_hs_p != NULL) { \
+ _hs_p = ((_hs_p->next != NULL) ? HH_FROM_ELMT((head)->hh.tbl, _hs_p->next) \
+ : NULL); \
+ } \
+ _hs_psize--; \
+ } \
+ else if ((cmpfcn(DECLTYPE(head)(ELMT_FROM_HH((head)->hh.tbl, _hs_p)), \
+ DECLTYPE(head)(ELMT_FROM_HH((head)->hh.tbl, _hs_q)))) <= 0) { \
+ _hs_e = _hs_p; \
+ if (_hs_p != NULL) { \
+ _hs_p = ((_hs_p->next != NULL) ? HH_FROM_ELMT((head)->hh.tbl, _hs_p->next) \
+ : NULL); \
+ } \
+ _hs_psize--; \
+ } \
+ else { \
+ _hs_e = _hs_q; \
+ _hs_q = \
+ ((_hs_q->next != NULL) ? HH_FROM_ELMT((head)->hh.tbl, _hs_q->next) : NULL); \
+ _hs_qsize--; \
+ } \
+ if (_hs_tail != NULL) { \
+ _hs_tail->next = ((_hs_e != NULL) ? ELMT_FROM_HH((head)->hh.tbl, _hs_e) : NULL); \
+ } \
+ else { \
+ _hs_list = _hs_e; \
+ } \
+ if (_hs_e != NULL) { \
+ _hs_e->prev = \
+ ((_hs_tail != NULL) ? ELMT_FROM_HH((head)->hh.tbl, _hs_tail) : NULL); \
+ } \
+ _hs_tail = _hs_e; \
+ } \
+ _hs_p = _hs_q; \
+ } \
+ if (_hs_tail != NULL) { \
+ _hs_tail->next = NULL; \
+ } \
+ if (_hs_nmerges <= 1U) { \
+ _hs_looping = 0; \
+ (head)->hh.tbl->tail = _hs_tail; \
+ DECLTYPE_ASSIGN(head, ELMT_FROM_HH((head)->hh.tbl, _hs_list)); \
+ } \
+ _hs_insize *= 2U; \
+ } \
+ HASH_FSCK(hh, head, "HASH_SRT"); \
+ } \
+ } while (0)
+
+/* This function selects items from one hash into another hash.
+ * The end result is that the selected items have dual presence
+ * in both hashes. There is no copy of the items made; rather
+ * they are added into the new hash through a secondary hash
+ * hash handle that must be present in the structure. */
+#define HASH_SELECT(hh_dst, dst, hh_src, src, cond) \
+ do { \
+ unsigned _src_bkt, _dst_bkt; \
+ void * _last_elt = NULL, *_elt; \
+ UT_hash_handle *_src_hh, *_dst_hh, *_last_elt_hh = NULL; \
+ ptrdiff_t _dst_hho = ((char *)(&(dst)->hh_dst) - (char *)(dst)); \
+ if ((src) != NULL) { \
+ for (_src_bkt = 0; _src_bkt < (src)->hh_src.tbl->num_buckets; _src_bkt++) { \
+ for (_src_hh = (src)->hh_src.tbl->buckets[_src_bkt].hh_head; _src_hh != NULL; \
+ _src_hh = _src_hh->hh_next) { \
+ _elt = ELMT_FROM_HH((src)->hh_src.tbl, _src_hh); \
+ if (cond(_elt)) { \
+ IF_HASH_NONFATAL_OOM(int _hs_oomed = 0;) \
+ _dst_hh = (UT_hash_handle *)(void *)(((char *)_elt) + _dst_hho); \
+ _dst_hh->key = _src_hh->key; \
+ _dst_hh->keylen = _src_hh->keylen; \
+ _dst_hh->hashv = _src_hh->hashv; \
+ _dst_hh->prev = _last_elt; \
+ _dst_hh->next = NULL; \
+ if (_last_elt_hh != NULL) { \
+ _last_elt_hh->next = _elt; \
+ } \
+ if ((dst) == NULL) { \
+ DECLTYPE_ASSIGN(dst, _elt); \
+ HASH_MAKE_TABLE(hh_dst, dst, _hs_oomed); \
+ IF_HASH_NONFATAL_OOM(if (_hs_oomed) { \
+ uthash_nonfatal_oom(_elt); \
+ (dst) = NULL; \
+ continue; \
+ }) \
+ } \
+ else { \
+ _dst_hh->tbl = (dst)->hh_dst.tbl; \
+ } \
+ HASH_TO_BKT(_dst_hh->hashv, _dst_hh->tbl->num_buckets, _dst_bkt); \
+ HASH_ADD_TO_BKT(_dst_hh->tbl->buckets[_dst_bkt], hh_dst, _dst_hh, _hs_oomed); \
+ (dst)->hh_dst.tbl->num_items++; \
+ IF_HASH_NONFATAL_OOM(if (_hs_oomed) { \
+ HASH_ROLLBACK_BKT(hh_dst, dst, _dst_hh); \
+ HASH_DELETE_HH(hh_dst, dst, _dst_hh); \
+ _dst_hh->tbl = NULL; \
+ uthash_nonfatal_oom(_elt); \
+ continue; \
+ }) \
+ HASH_BLOOM_ADD(_dst_hh->tbl, _dst_hh->hashv); \
+ _last_elt = _elt; \
+ _last_elt_hh = _dst_hh; \
+ } \
+ } \
+ } \
+ } \
+ HASH_FSCK(hh_dst, dst, "HASH_SELECT"); \
+ } while (0)
+
+#define HASH_CLEAR(hh, head) \
+ do { \
+ if ((head) != NULL) { \
+ HASH_BLOOM_FREE((head)->hh.tbl); \
+ uthash_free((head)->hh.tbl->buckets, \
+ (head)->hh.tbl->num_buckets * sizeof(struct UT_hash_bucket)); \
+ uthash_free((head)->hh.tbl, sizeof(UT_hash_table)); \
+ (head) = NULL; \
+ } \
+ } while (0)
+
+#define HASH_OVERHEAD(hh, head) \
+ (((head) != NULL) ? ((size_t)(((head)->hh.tbl->num_items * sizeof(UT_hash_handle)) + \
+ ((head)->hh.tbl->num_buckets * sizeof(UT_hash_bucket)) + \
+ sizeof(UT_hash_table) + (HASH_BLOOM_BYTELEN))) \
+ : 0U)
+
+#ifdef NO_DECLTYPE
+#define HASH_ITER(hh, head, el, tmp) \
+ for (((el) = (head)), ((*(char **)(&(tmp))) = (char *)((head != NULL) ? (head)->hh.next : NULL)); \
+ (el) != NULL; \
+ ((el) = (tmp)), ((*(char **)(&(tmp))) = (char *)((tmp != NULL) ? (tmp)->hh.next : NULL)))
+#else
+#define HASH_ITER(hh, head, el, tmp) \
+ for (((el) = (head)), ((tmp) = DECLTYPE(el)((head != NULL) ? (head)->hh.next : NULL)); (el) != NULL; \
+ ((el) = (tmp)), ((tmp) = DECLTYPE(el)((tmp != NULL) ? (tmp)->hh.next : NULL)))
+#endif
+
+/* obtain a count of items in the hash */
+#define HASH_COUNT(head) HASH_CNT(hh, head)
+#define HASH_CNT(hh, head) ((head != NULL) ? ((head)->hh.tbl->num_items) : 0U)
+
+typedef struct UT_hash_bucket {
+ struct UT_hash_handle *hh_head;
+ unsigned count;
+
+ /* expand_mult is normally set to 0. In this situation, the max chain length
+ * threshold is enforced at its default value, HASH_BKT_CAPACITY_THRESH. (If
+ * the bucket's chain exceeds this length, bucket expansion is triggered).
+ * However, setting expand_mult to a non-zero value delays bucket expansion
+ * (that would be triggered by additions to this particular bucket)
+ * until its chain length reaches a *multiple* of HASH_BKT_CAPACITY_THRESH.
+ * (The multiplier is simply expand_mult+1). The whole idea of this
+ * multiplier is to reduce bucket expansions, since they are expensive, in
+ * situations where we know that a particular bucket tends to be overused.
+ * It is better to let its chain length grow to a longer yet-still-bounded
+ * value, than to do an O(n) bucket expansion too often.
+ */
+ unsigned expand_mult;
+
+} UT_hash_bucket;
+
+/* random signature used only to find hash tables in external analysis */
+#define HASH_SIGNATURE 0xa0111fe1u
+#define HASH_BLOOM_SIGNATURE 0xb12220f2u
+
+typedef struct UT_hash_table {
+ UT_hash_bucket * buckets;
+ unsigned num_buckets, log2_num_buckets;
+ unsigned num_items;
+ struct UT_hash_handle *tail; /* tail hh in app order, for fast append */
+ ptrdiff_t hho; /* hash handle offset (byte pos of hash handle in element */
+
+ /* in an ideal situation (all buckets used equally), no bucket would have
+ * more than ceil(#items/#buckets) items. that's the ideal chain length. */
+ unsigned ideal_chain_maxlen;
+
+ /* nonideal_items is the number of items in the hash whose chain position
+ * exceeds the ideal chain maxlen. these items pay the penalty for an uneven
+ * hash distribution; reaching them in a chain traversal takes >ideal steps */
+ unsigned nonideal_items;
+
+ /* ineffective expands occur when a bucket doubling was performed, but
+ * afterward, more than half the items in the hash had nonideal chain
+ * positions. If this happens on two consecutive expansions we inhibit any
+ * further expansion, as it's not helping; this happens when the hash
+ * function isn't a good fit for the key domain. When expansion is inhibited
+ * the hash will still work, albeit no longer in constant time. */
+ unsigned ineff_expands, noexpand;
+
+ uint32_t signature; /* used only to find hash tables in external analysis */
+#ifdef HASH_BLOOM
+ uint32_t bloom_sig; /* used only to test bloom exists in external analysis */
+ uint8_t *bloom_bv;
+ uint8_t bloom_nbits;
+#endif
+
+} UT_hash_table;
+
+typedef struct UT_hash_handle {
+ struct UT_hash_table * tbl;
+ void * prev; /* prev element in app order */
+ void * next; /* next element in app order */
+ struct UT_hash_handle *hh_prev; /* previous hh in bucket order */
+ struct UT_hash_handle *hh_next; /* next hh in bucket order */
+ void * key; /* ptr to enclosing struct's key */
+ unsigned keylen; /* enclosing struct's key len */
+ unsigned hashv; /* result of hash-fcn(key) */
+} UT_hash_handle;
+
+#endif /* UTHASH_H */
diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt
index 5b4302e..6770666 100644
--- a/test/CMakeLists.txt
+++ b/test/CMakeLists.txt
@@ -245,7 +245,6 @@ set (testhdf5_SOURCES
${HDF5_TEST_SOURCE_DIR}/tskiplist.c
${HDF5_TEST_SOURCE_DIR}/tsohm.c
${HDF5_TEST_SOURCE_DIR}/ttime.c
- ${HDF5_TEST_SOURCE_DIR}/ttst.c
${HDF5_TEST_SOURCE_DIR}/tunicode.c
${HDF5_TEST_SOURCE_DIR}/tvltypes.c
${HDF5_TEST_SOURCE_DIR}/tvlstr.c
diff --git a/test/Makefile.am b/test/Makefile.am
index d6e030b..8aeb9ac 100644
--- a/test/Makefile.am
+++ b/test/Makefile.am
@@ -50,6 +50,7 @@ SCRIPT_DEPEND = error_test$(EXEEXT) err_compat$(EXEEXT) links_env$(EXEEXT) \
vfd_swmr_addrem_writer$(EXEEXT) vfd_swmr_sparse_reader$(EXEEXT) \
vfd_swmr_sparse_writer$(EXEEXT) \
vfd_swmr_bigset_reader$(EXEEXT) vfd_swmr_bigset_writer$(EXEEXT) \
+ vfd_swmr_dsetops_reader$(EXEEXT) vfd_swmr_dsetops_writer$(EXEEXT) \
vfd_swmr_group_reader$(EXEEXT) vfd_swmr_group_writer$(EXEEXT) \
vfd_swmr_vlstr_reader$(EXEEXT) vfd_swmr_vlstr_writer$(EXEEXT) \
vfd_swmr_zoo_reader$(EXEEXT) vfd_swmr_zoo_writer$(EXEEXT) \
@@ -104,6 +105,7 @@ check_PROGRAMS=$(TEST_PROG) error_test err_compat tcheck_version \
vfd_swmr_remove_reader vfd_swmr_remove_writer vfd_swmr_addrem_writer \
vfd_swmr_sparse_reader vfd_swmr_sparse_writer \
vfd_swmr_bigset_reader vfd_swmr_bigset_writer \
+ vfd_swmr_dsetops_reader vfd_swmr_dsetops_writer \
vfd_swmr_group_reader vfd_swmr_group_writer \
vfd_swmr_vlstr_reader vfd_swmr_vlstr_writer \
vfd_swmr_zoo_reader vfd_swmr_zoo_writer \
@@ -173,6 +175,7 @@ vfd_swmr_zoo_reader_SOURCES=vfd_swmr_zoo_writer.c genall5.c
vfd_swmr_bigset_reader_SOURCES=vfd_swmr_bigset_writer.c
vfd_swmr_group_reader_SOURCES=vfd_swmr_group_writer.c
+vfd_swmr_dsetops_reader_SOURCES=vfd_swmr_dsetops_writer.c
vfd_swmr_attrdset_writer_SOURCES=vfd_swmr_attrdset_writer.c
vfd_swmr_attrdset_reader_SOURCES=vfd_swmr_attrdset_writer.c
@@ -242,7 +245,7 @@ CHECK_CLEANFILES+=accum.h5 cmpd_dset.h5 compact_dataset.h5 dataset.h5 dset_offse
# Sources for testhdf5 executable
testhdf5_SOURCES=testhdf5.c tarray.c tattr.c tchecksum.c tconfig.c tfile.c \
tgenprop.c th5o.c th5s.c tcoords.c theap.c tid.c titerate.c tmeta.c tmisc.c \
- trefer.c trefer_deprec.c trefstr.c tselect.c tskiplist.c tsohm.c ttime.c ttst.c tunicode.c \
+ trefer.c trefer_deprec.c trefstr.c tselect.c tskiplist.c tsohm.c ttime.c tunicode.c \
tvlstr.c tvltypes.c
# Sources for Use Cases
diff --git a/test/SWMR_UseCase_UG.txt b/test/SWMR_UseCase_UG.txt
index 18d4927..1e3d1e6 100644
--- a/test/SWMR_UseCase_UG.txt
+++ b/test/SWMR_UseCase_UG.txt
@@ -6,8 +6,8 @@
case program and explain how to run them.
2.1. Author and Dates:
- Version 2: By Albert Cheng (acheng@hdfgroup.org), 2013/06/18.
- Version 1: By Albert Cheng (acheng@hdfgroup.org), 2013/06/01.
+ Version 2: By Albert Cheng, 2013/06/18.
+ Version 1: By Albert Cheng, 2013/06/01.
%%%%Use Case 1.7%%%%
diff --git a/test/big.c b/test/big.c
index 989e4bc..36fb27d 100644
--- a/test/big.c
+++ b/test/big.c
@@ -429,7 +429,7 @@ writer(char *filename, hid_t fapl, fsizes_t testsize, int wrt_n)
for (i = 0; i < wrt_n; i++) {
/* start position must be at least hs_size from the end */
hs_start[0] = randll(size2[0] - hs_size[0], i);
- HDfprintf(out, "#%03d 0x%016Hx\n", i, hs_start[0]);
+ HDfprintf(out, "#%03d 0x%016" PRIxHSIZE "\n", i, hs_start[0]);
if (H5Sselect_hyperslab(space2, H5S_SELECT_SET, hs_start, NULL, hs_size, NULL) < 0)
goto error;
for (j = 0; j < WRT_SIZE; j++) {
@@ -524,7 +524,7 @@ reader(char *filename, hid_t fapl)
break;
i = (int)HDstrtol(ln + 1, &s, 10);
hs_offset[0] = HDstrtoull(s, NULL, 0);
- HDfprintf(stdout, "#%03d 0x%016Hx%47s", i, hs_offset[0], "");
+ HDfprintf(stdout, "#%03d 0x%016" PRIxHSIZE "%47s", i, hs_offset[0], "");
HDfflush(stdout);
if (H5Sselect_hyperslab(fspace, H5S_SELECT_SET, hs_offset, NULL, hs_size, NULL) < 0)
@@ -605,7 +605,7 @@ usage(void)
"\t-c\tFile system Checking skipped. Caution: this test generates\n"
"\t\tmany big files and may fill up the file system.\n"
"\t-fsize\tChange family size default to <fsize> where <fsize> is\n"
- "\t\ta positive float point number. Default value is %Hu.\n"
+ "\t\ta positive float point number. Default value is %" PRIuHSIZE ".\n"
"Examples:\n"
"\tbig -fsize 2.1e9 \t# test with file size just under 2GB\n"
"\tbig -fsize 2.2e9 \t# test with file size just above 2GB\n"
diff --git a/test/chunk_info.c b/test/chunk_info.c
index 4a661eb..ada2d80 100644
--- a/test/chunk_info.c
+++ b/test/chunk_info.c
@@ -127,7 +127,7 @@ void reinit_vars(unsigned *read_flt_msk, haddr_t *addr, hsize_t *size);
static int verify_idx_nchunks(hid_t dset, hid_t dspace, H5D_chunk_index_t exp_idx_type,
hsize_t exp_num_chunks);
static int verify_get_chunk_info(hid_t dset, hid_t dspace, hsize_t chk_index, hsize_t exp_chk_size,
- hsize_t *exp_offset, unsigned exp_flt_msk);
+ const hsize_t *exp_offset, unsigned exp_flt_msk);
static int verify_get_chunk_info_by_coord(hid_t dset, hsize_t *offset, hsize_t exp_chk_size,
unsigned exp_flt_msk);
static int verify_empty_chunk_info(hid_t dset, hsize_t *offset);
@@ -169,8 +169,8 @@ reinit_vars(unsigned *read_flt_msk, haddr_t *addr, hsize_t *size)
*-------------------------------------------------------------------------
*/
static int
-verify_get_chunk_info(hid_t dset, hid_t dspace, hsize_t chk_index, hsize_t exp_chk_size, hsize_t *exp_offset,
- unsigned exp_flt_msk)
+verify_get_chunk_info(hid_t dset, hid_t dspace, hsize_t chk_index, hsize_t exp_chk_size,
+ const hsize_t *exp_offset, unsigned exp_flt_msk)
{
unsigned read_flt_msk = 0; /* Read filter mask */
hsize_t out_offset[2] = {0, 0}; /* Buffer to get offset coordinates */
@@ -302,7 +302,7 @@ index_type_str(H5D_chunk_index_t idx_type)
*-------------------------------------------------------------------------
*/
static int
-verify_selected_chunks(hid_t dset, hid_t plist, hsize_t *start, hsize_t *end)
+verify_selected_chunks(hid_t dset, hid_t plist, const hsize_t *start, const hsize_t *end)
{
int read_buf[CHUNK_NX][CHUNK_NY];
int expected_buf[NUM_CHUNKS][CHUNK_NX][CHUNK_NY]; /* Expected data */
@@ -335,8 +335,9 @@ verify_selected_chunks(hid_t dset, hid_t plist, hsize_t *start, hsize_t *end)
/* Verify that read chunk is the same as the corresponding written one */
if (HDmemcmp(expected_buf[chk_index], read_buf, CHUNK_NX * CHUNK_NY) != 0) {
- HDfprintf(stderr, "Read chunk differs from written chunk at offset (%d,%d)\n", offset[0],
- offset[1]);
+ HDfprintf(stderr,
+ "Read chunk differs from written chunk at offset (%" PRIuHSIZE ",%" PRIuHSIZE ")\n",
+ offset[0], offset[1]);
return FAIL;
}
}
@@ -363,7 +364,7 @@ error:
*-------------------------------------------------------------------------
*/
static int
-write_selected_chunks(hid_t dset, hid_t plist, hsize_t *start, hsize_t *end, unsigned flt_msk)
+write_selected_chunks(hid_t dset, hid_t plist, const hsize_t *start, const hsize_t *end, unsigned flt_msk)
{
int direct_buf[NUM_CHUNKS][CHUNK_NX][CHUNK_NY]; /* Data in chunks */
hsize_t offset[2]; /* Offset coordinates of a chunk */
@@ -420,7 +421,7 @@ verify_idx_nchunks(hid_t dset, hid_t dspace, H5D_chunk_index_t exp_idx_type, hsi
/* Ensure the correct chunk indexing scheme is used */
if (idx_type != exp_idx_type) {
char msg[256];
- sprintf(msg, "Should be using %s.\n", index_type_str(idx_type));
+ HDsprintf(msg, "Should be using %s.\n", index_type_str(idx_type));
FAIL_PUTS_ERROR(msg);
}
diff --git a/test/dsets.c b/test/dsets.c
index 5452e8d..e38f253 100644
--- a/test/dsets.c
+++ b/test/dsets.c
@@ -110,6 +110,8 @@ const char *FILENAME[] = {"dataset", /* 0 */
#define DSET_FLETCHER32_NAME_3 "fletcher32_3"
#define DSET_SHUF_DEF_FLET_NAME "shuffle+deflate+fletcher32"
#define DSET_SHUF_DEF_FLET_NAME_2 "shuffle+deflate+fletcher32_2"
+#define DSET_OPTIONAL_SCALAR "dataset_with_scalar_space"
+#define DSET_OPTIONAL_VLEN "dataset_with_vlen_type"
#ifdef H5_HAVE_FILTER_SZIP
#define DSET_SZIP_NAME "szip"
#define DSET_SHUF_SZIP_FLET_NAME "shuffle+szip+fletcher32"
@@ -4599,7 +4601,7 @@ test_nbit_int_size(hid_t file)
if ((dset_size = H5Dget_storage_size(dataset)) < DSET_DIM1 * DSET_DIM2 * (precision / 8) ||
dset_size > DSET_DIM1 * DSET_DIM2 * (precision / 8) + 1 * KB) {
H5_FAILED();
- HDfprintf(stdout, " Line %d: wrong dataset size: %Hu\n", __LINE__, dset_size);
+ HDfprintf(stdout, " Line %d: wrong dataset size: %" PRIuHSIZE "\n", __LINE__, dset_size);
goto error;
}
@@ -4809,7 +4811,7 @@ test_nbit_flt_size(hid_t file)
if ((dset_size = H5Dget_storage_size(dataset)) < DSET_DIM1 * DSET_DIM2 * (precision / 8) ||
dset_size > DSET_DIM1 * DSET_DIM2 * (precision / 8) + 1 * KB) {
H5_FAILED();
- HDfprintf(stdout, " Line %d: wrong dataset size: %Hu\n", __LINE__, dset_size);
+ HDfprintf(stdout, " Line %d: wrong dataset size: %" PRIuHSIZE "\n", __LINE__, dset_size);
goto error;
} /* end if */
@@ -6162,6 +6164,115 @@ error:
} /* end test_can_apply2() */
/*-------------------------------------------------------------------------
+ * Function: test_optional_filters
+ *
+ * Purpose: Tests that H5Dcreate2 will not fail when a combination of
+ * type, space, etc... doesn't work for a filter and filter is
+ * optional.
+ *
+ * Return: Success: SUCCEED
+ * Failure: FAIL
+ *
+ * Programmer: Binh-Minh Ribler
+ * 24 July 2020
+ *
+ *-------------------------------------------------------------------------
+ */
+static herr_t
+test_optional_filters(hid_t file)
+{
+ unsigned int level = 9;
+ unsigned int cd_values[1] = {level};
+ size_t cd_nelmts = 1;
+ hsize_t dim1d[1]; /* Dataspace dimensions */
+ hid_t dsid = H5I_INVALID_HID; /* Dataset ID */
+ hid_t sid = H5I_INVALID_HID; /* Dataspace ID */
+ hid_t strtid = H5I_INVALID_HID; /* Datatype ID for string */
+ hid_t vlentid = H5I_INVALID_HID; /* Datatype ID for vlen */
+ hid_t dcplid = H5I_INVALID_HID; /* Dataspace creation property list ID */
+
+ TESTING("dataset with optional filters");
+
+ /* Create dcpl with special filter */
+ if ((dcplid = H5Pcreate(H5P_DATASET_CREATE)) < 0)
+ TEST_ERROR;
+
+ /* Create the datatype */
+ if ((strtid = H5Tcreate(H5T_STRING, H5T_VARIABLE)) < 0)
+ TEST_ERROR;
+
+ /* Create the data space */
+ if ((sid = H5Screate(H5S_SCALAR)) < 0)
+ TEST_ERROR;
+
+ /* The filter is optional. */
+ if (H5Pset_filter(dcplid, H5Z_FILTER_DEFLATE, H5Z_FLAG_OPTIONAL, cd_nelmts, cd_values) < 0)
+ TEST_ERROR;
+
+ /* Create dataset with optional filter */
+ if ((dsid = H5Dcreate2(file, DSET_OPTIONAL_SCALAR, strtid, sid, H5P_DEFAULT, dcplid, H5P_DEFAULT)) < 0)
+ TEST_ERROR;
+
+ /* Close dataset */
+ if (H5Dclose(dsid) < 0)
+ TEST_ERROR;
+
+ /* Close dataspace */
+ if (H5Sclose(sid) < 0)
+ TEST_ERROR;
+
+ /* Close datatype */
+ if (H5Tclose(strtid) < 0)
+ TEST_ERROR;
+
+ /* Set dataspace dimensions */
+ dim1d[0] = DIM1;
+
+ /* Create a non-scalar dataspace */
+ if ((sid = H5Screate_simple(1, dim1d, NULL)) < 0)
+ TEST_ERROR;
+
+ /* Create a vlen datatype */
+ if ((vlentid = H5Tvlen_create(H5T_NATIVE_INT)) < 0)
+ TEST_ERROR;
+
+ /* Create dataset with optional filter */
+ if ((dsid = H5Dcreate2(file, DSET_OPTIONAL_VLEN, vlentid, sid, H5P_DEFAULT, dcplid, H5P_DEFAULT)) < 0)
+ TEST_ERROR;
+
+ /* Close dataset */
+ if (H5Dclose(dsid) < 0)
+ TEST_ERROR;
+
+ /* Close dataspace */
+ if (H5Sclose(sid) < 0)
+ TEST_ERROR;
+
+ /* Close datatype */
+ if (H5Tclose(vlentid) < 0)
+ TEST_ERROR;
+
+ /* Close dataset creation property list */
+ if (H5Pclose(dcplid) < 0)
+ TEST_ERROR;
+
+ PASSED();
+ return SUCCEED;
+
+error:
+ H5E_BEGIN_TRY
+ {
+ H5Dclose(dsid);
+ H5Sclose(sid);
+ H5Pclose(dcplid);
+ H5Tclose(strtid);
+ H5Tclose(vlentid);
+ }
+ H5E_END_TRY;
+ return FAIL;
+} /* end test_optional_filters() */
+
+/*-------------------------------------------------------------------------
* Function: test_can_apply_szip
*
* Purpose: Tests library behavior when szip filter indicates it can't
@@ -15238,6 +15349,7 @@ main(void)
nerrors += (test_missing_filter(file) < 0 ? 1 : 0);
nerrors += (test_can_apply(file) < 0 ? 1 : 0);
nerrors += (test_can_apply2(file) < 0 ? 1 : 0);
+ nerrors += (test_optional_filters(file) < 0 ? 1 : 0);
nerrors += (test_set_local(my_fapl) < 0 ? 1 : 0);
nerrors += (test_can_apply_szip(file) < 0 ? 1 : 0);
nerrors += (test_compare_dcpl(file) < 0 ? 1 : 0);
diff --git a/test/dtypes.c b/test/dtypes.c
index 58b8b26..626c58c 100644
--- a/test/dtypes.c
+++ b/test/dtypes.c
@@ -12,7 +12,7 @@
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
/*
- * Programmer: Robb Matzke <matzke@llnl.gov>
+ * Programmer: Robb Matzke
* Tuesday, December 9, 1997
*
* Purpose: Tests the datatype interface (H5T)
@@ -1183,7 +1183,7 @@ test_compound_5(void)
H5Tclose(int_array);
/* Check results */
- if (HDmemcmp(src[1].name, dst[1].name, sizeof(src[1].name)) || src[1].tdim != dst[1].tdim ||
+ if (HDmemcmp(src[1].name, dst[1].name, sizeof(src[1].name)) != 0 || src[1].tdim != dst[1].tdim ||
src[1].coll_ids[0] != dst[1].coll_ids[0] || src[1].coll_ids[1] != dst[1].coll_ids[1] ||
src[1].coll_ids[2] != dst[1].coll_ids[2] || src[1].coll_ids[3] != dst[1].coll_ids[3]) {
H5_FAILED();
@@ -1482,10 +1482,10 @@ test_compound_8(void)
int b;
} s1;
- typedef struct s2 {
+ struct s2 {
char c;
s1 d;
- } s2;
+ };
hid_t tid1, tid1_copy, tid2, tid2_copy, tid3, arr_tid;
size_t tsize;
hsize_t dims[1] = {ARRAY_DIM};
@@ -1868,7 +1868,7 @@ test_compound_9(void)
goto error;
} /* end if */
- if (rdata.i1 != wdata.i1 || rdata.i2 != wdata.i2 || HDstrcmp(rdata.str, wdata.str)) {
+ if (rdata.i1 != wdata.i1 || rdata.i2 != wdata.i2 || HDstrcmp(rdata.str, wdata.str) != 0) {
H5_FAILED();
AT();
HDprintf("incorrect read data\n");
@@ -1942,7 +1942,7 @@ test_compound_9(void)
goto error;
} /* end if */
- if (rdata.i1 != wdata.i1 || rdata.i2 != wdata.i2 || strcmp(rdata.str, wdata.str)) {
+ if (rdata.i1 != wdata.i1 || rdata.i2 != wdata.i2 || HDstrcmp(rdata.str, wdata.str) != 0) {
H5_FAILED();
AT();
HDprintf("incorrect read data\n");
@@ -2132,7 +2132,7 @@ test_compound_10(void)
for (i = 0; i < ARRAY_DIM; i++) {
if (rdata[i].i1 != wdata[i].i1 || rdata[i].i2 != wdata[i].i2 ||
- HDstrcmp(rdata[i].str, wdata[i].str)) {
+ HDstrcmp(rdata[i].str, wdata[i].str) != 0) {
H5_FAILED();
AT();
HDprintf("incorrect read data\n");
@@ -2148,7 +2148,7 @@ test_compound_10(void)
t1 = rdata[i].text.p;
t2 = wdata[i].text.p;
- if (strcmp((char *)t1, (char *)t2)) {
+ if (HDstrcmp((char *)t1, (char *)t2) != 0) {
H5_FAILED();
AT();
HDprintf("incorrect VL read data\n");
@@ -2333,7 +2333,7 @@ test_compound_11(void)
((big_t *)buf_orig)[u].s1, (unsigned)u, ((little_t *)buf)[u].s1);
TEST_ERROR
} /* end if */
- else if (HDstrcmp(((big_t *)buf_orig)[u].s1, ((little_t *)buf)[u].s1)) {
+ else if (HDstrcmp(((big_t *)buf_orig)[u].s1, ((little_t *)buf)[u].s1) != 0) {
HDprintf("Error, line #%d: buf_orig[%u].s1=%s, buf[%u].s1=%s\n", __LINE__, (unsigned)u,
((big_t *)buf_orig)[u].s1, (unsigned)u, ((little_t *)buf)[u].s1);
TEST_ERROR
@@ -2384,7 +2384,7 @@ test_compound_11(void)
((big_t *)buf_orig)[u].s1, (unsigned)u, ((little_t *)buf)[u].s1);
TEST_ERROR
} /* end if */
- else if (HDstrcmp(((big_t *)buf_orig)[u].s1, ((little_t *)buf)[u].s1)) {
+ else if (HDstrcmp(((big_t *)buf_orig)[u].s1, ((little_t *)buf)[u].s1) != 0) {
HDprintf("Error, line #%d: buf_orig[%u].s1=%s, buf[%u].s1=%s\n", __LINE__, (unsigned)u,
((big_t *)buf_orig)[u].s1, (unsigned)u, ((little_t *)buf)[u].s1);
TEST_ERROR
@@ -2425,7 +2425,7 @@ test_compound_11(void)
((big_t *)buf_orig)[u].s1, (unsigned)u, ((little_t *)buf)[u].s1);
TEST_ERROR
} /* end if */
- else if (HDstrcmp(((big_t *)buf_orig)[u].s1, ((little_t *)buf)[u].s1)) {
+ else if (HDstrcmp(((big_t *)buf_orig)[u].s1, ((little_t *)buf)[u].s1) != 0) {
HDprintf("Error, line #%d: buf_orig[%u].s1=%s, buf[%u].s1=%s\n", __LINE__, (unsigned)u,
((big_t *)buf_orig)[u].s1, (unsigned)u, ((little_t *)buf)[u].s1);
TEST_ERROR
@@ -2556,7 +2556,7 @@ test_compound_12(void)
H5E_END_TRY;
if (ret >= 0) {
H5_FAILED();
- puts(" Tries to cut off the last member. Should have failed.");
+ HDputs(" Tries to cut off the last member. Should have failed.");
goto error;
}
@@ -3010,14 +3010,14 @@ test_compound_14(void)
goto error;
} /* end if */
- if (rdata1.c1 != wdata1.c1 || rdata1.c2 != wdata1.c2 || HDstrcmp(rdata1.str, wdata1.str)) {
+ if (rdata1.c1 != wdata1.c1 || rdata1.c2 != wdata1.c2 || HDstrcmp(rdata1.str, wdata1.str) != 0) {
H5_FAILED();
AT();
HDprintf("incorrect read data\n");
goto error;
} /* end if */
- if (rdata2.c1 != wdata2.c1 || rdata2.c2 != wdata2.c2 || HDstrcmp(rdata2.str, wdata2.str) ||
+ if (rdata2.c1 != wdata2.c1 || rdata2.c2 != wdata2.c2 || HDstrcmp(rdata2.str, wdata2.str) != 0 ||
rdata2.l1 != wdata2.l1 || rdata2.l2 != wdata2.l2 || rdata2.l3 != wdata2.l3 ||
rdata2.l4 != wdata2.l4) {
H5_FAILED();
@@ -3108,14 +3108,14 @@ test_compound_14(void)
goto error;
} /* end if */
- if (rdata1.c1 != wdata1.c1 || rdata1.c2 != wdata1.c2 || strcmp(rdata1.str, wdata1.str)) {
+ if (rdata1.c1 != wdata1.c1 || rdata1.c2 != wdata1.c2 || HDstrcmp(rdata1.str, wdata1.str) != 0) {
H5_FAILED();
AT();
HDprintf("incorrect read data\n");
goto error;
} /* end if */
- if (rdata2.c1 != wdata2.c1 || rdata2.c2 != wdata2.c2 || HDstrcmp(rdata2.str, wdata2.str) ||
+ if (rdata2.c1 != wdata2.c1 || rdata2.c2 != wdata2.c2 || HDstrcmp(rdata2.str, wdata2.str) != 0 ||
rdata2.l1 != wdata2.l1 || rdata2.l2 != wdata2.l2 || rdata2.l3 != wdata2.l3 ||
rdata2.l4 != wdata2.l4) {
H5_FAILED();
@@ -3957,7 +3957,7 @@ test_query(void)
HDprintf("Can't get name for enum member\n");
goto error;
} /* end if */
- if (strcmp("YELLOW", enum_name)) {
+ if (HDstrcmp("YELLOW", enum_name) != 0) {
H5_FAILED();
HDprintf("Incorrect name for enum member\n");
goto error;
@@ -4597,14 +4597,14 @@ test_conv_str_1(void)
HDmemcpy(buf, "abcdefghi\0abcdefghi\0", (size_t)20);
if (H5Tconvert(src_type, dst_type, (size_t)2, buf, NULL, H5P_DEFAULT) < 0)
goto error;
- if (HDmemcmp(buf, "abcd\0abcd\0abcdefghi\0", (size_t)20)) {
+ if (HDmemcmp(buf, "abcd\0abcd\0abcdefghi\0", (size_t)20) != 0) {
H5_FAILED();
HDputs(" Truncated C-string test failed");
goto error;
}
if (H5Tconvert(dst_type, src_type, (size_t)2, buf, NULL, H5P_DEFAULT) < 0)
goto error;
- if (HDmemcmp(buf, "abcd\0\0\0\0\0\0abcd\0\0\0\0\0\0", (size_t)20)) {
+ if (HDmemcmp(buf, "abcd\0\0\0\0\0\0abcd\0\0\0\0\0\0", (size_t)20) != 0) {
H5_FAILED();
HDputs(" Extended C-string test failed");
goto error;
@@ -4628,14 +4628,14 @@ test_conv_str_1(void)
HDmemcpy(buf, "abcdefghijabcdefghij", (size_t)20);
if (H5Tconvert(src_type, dst_type, (size_t)2, buf, NULL, H5P_DEFAULT) < 0)
goto error;
- if (HDmemcmp(buf, "abcdeabcdeabcdefghij", (size_t)20)) {
+ if (HDmemcmp(buf, "abcdeabcdeabcdefghij", (size_t)20) != 0) {
H5_FAILED();
HDputs(" Truncated C buffer test failed");
goto error;
}
if (H5Tconvert(dst_type, src_type, (size_t)2, buf, NULL, H5P_DEFAULT) < 0)
goto error;
- if (HDmemcmp(buf, "abcde\0\0\0\0\0abcde\0\0\0\0\0", (size_t)20)) {
+ if (HDmemcmp(buf, "abcde\0\0\0\0\0abcde\0\0\0\0\0", (size_t)20) != 0) {
H5_FAILED();
HDputs(" Extended C buffer test failed");
goto error;
@@ -4659,14 +4659,14 @@ test_conv_str_1(void)
HDmemcpy(buf, "abcdefghijabcdefghij", (size_t)20);
if (H5Tconvert(src_type, dst_type, (size_t)2, buf, NULL, H5P_DEFAULT) < 0)
goto error;
- if (HDmemcmp(buf, "abcdeabcdeabcdefghij", (size_t)20)) {
+ if (HDmemcmp(buf, "abcdeabcdeabcdefghij", (size_t)20) != 0) {
H5_FAILED();
HDputs(" Truncated Fortran-string test failed");
goto error;
}
if (H5Tconvert(dst_type, src_type, (size_t)2, buf, NULL, H5P_DEFAULT) < 0)
goto error;
- if (HDmemcmp(buf, "abcde abcde ", (size_t)20)) {
+ if (HDmemcmp(buf, "abcde abcde ", (size_t)20) != 0) {
H5_FAILED();
HDputs(" Extended Fortran-string test failed");
goto error;
@@ -4693,7 +4693,7 @@ test_conv_str_1(void)
HDmemcpy(buf, "abcdefghijabcdefghij", (size_t)20);
if (H5Tconvert(src_type, dst_type, (size_t)2, buf, NULL, H5P_DEFAULT) < 0)
goto error;
- if (HDmemcmp(buf, "abcdefghijabcdefghij", (size_t)20)) {
+ if (HDmemcmp(buf, "abcdefghijabcdefghij", (size_t)20) != 0) {
H5_FAILED();
HDputs(" Non-terminated string test 1");
goto error;
@@ -4704,7 +4704,7 @@ test_conv_str_1(void)
HDmemcpy(buf, "abcdefghijabcdefghij", (size_t)20);
if (H5Tconvert(src_type, dst_type, (size_t)2, buf, NULL, H5P_DEFAULT) < 0)
goto error;
- if (HDmemcmp(buf, "abcd\0abcd\0abcdefghij", (size_t)20)) {
+ if (HDmemcmp(buf, "abcd\0abcd\0abcdefghij", (size_t)20) != 0) {
H5_FAILED();
HDputs(" Non-terminated string test 2");
goto error;
@@ -4712,7 +4712,7 @@ test_conv_str_1(void)
HDmemcpy(buf, "abcdeabcdexxxxxxxxxx", (size_t)20);
if (H5Tconvert(dst_type, src_type, (size_t)2, buf, NULL, H5P_DEFAULT) < 0)
goto error;
- if (HDmemcmp(buf, "abcde\0\0\0\0\0abcde\0\0\0\0\0", (size_t)20)) {
+ if (HDmemcmp(buf, "abcde\0\0\0\0\0abcde\0\0\0\0\0", (size_t)20) != 0) {
H5_FAILED();
HDputs(" Non-terminated string test 2");
goto error;
@@ -4736,14 +4736,14 @@ test_conv_str_1(void)
HDmemcpy(buf, "abcdefghi\0abcdefghi\0", (size_t)20);
if (H5Tconvert(src_type, dst_type, (size_t)2, buf, NULL, H5P_DEFAULT) < 0)
goto error;
- if (HDmemcmp(buf, "abcdefghi abcdefghi ", (size_t)20)) {
+ if (HDmemcmp(buf, "abcdefghi abcdefghi ", (size_t)20) != 0) {
H5_FAILED();
HDputs(" C string to Fortran test 1");
goto error;
}
if (H5Tconvert(dst_type, src_type, (size_t)2, buf, NULL, H5P_DEFAULT) < 0)
goto error;
- if (HDmemcmp(buf, "abcdefghi\0abcdefghi\0", (size_t)20)) {
+ if (HDmemcmp(buf, "abcdefghi\0abcdefghi\0", (size_t)20) != 0) {
H5_FAILED();
HDputs(" Fortran to C string test 1");
goto error;
@@ -4755,14 +4755,14 @@ test_conv_str_1(void)
HDmemcpy(buf, "abcdefgh\0\0abcdefgh\0\0", (size_t)20);
if (H5Tconvert(src_type, dst_type, (size_t)2, buf, NULL, H5P_DEFAULT) < 0)
goto error;
- if (HDmemcmp(buf, "abcdeabcdeabcdefgh\0\0", (size_t)20)) {
+ if (HDmemcmp(buf, "abcdeabcdeabcdefgh\0\0", (size_t)20) != 0) {
H5_FAILED();
HDputs(" C string to Fortran test 2");
goto error;
}
if (H5Tconvert(dst_type, src_type, (size_t)2, buf, NULL, H5P_DEFAULT) < 0)
goto error;
- if (HDmemcmp(buf, "abcde\0\0\0\0\0abcde\0\0\0\0\0", (size_t)20)) {
+ if (HDmemcmp(buf, "abcde\0\0\0\0\0abcde\0\0\0\0\0", (size_t)20) != 0) {
H5_FAILED();
HDputs(" Fortran to C string test 2");
goto error;
@@ -4778,14 +4778,14 @@ test_conv_str_1(void)
HDmemcpy(buf, "abcd\0abcd\0xxxxxxxxxx", (size_t)20);
if (H5Tconvert(src_type, dst_type, (size_t)2, buf, NULL, H5P_DEFAULT) < 0)
goto error;
- if (HDmemcmp(buf, "abcd abcd ", (size_t)20)) {
+ if (HDmemcmp(buf, "abcd abcd ", (size_t)20) != 0) {
H5_FAILED();
HDputs(" C string to Fortran test 3");
goto error;
}
if (H5Tconvert(dst_type, src_type, (size_t)2, buf, NULL, H5P_DEFAULT) < 0)
goto error;
- if (HDmemcmp(buf, "abcd\0abcd\0abcd ", (size_t)20)) {
+ if (HDmemcmp(buf, "abcd\0abcd\0abcd ", (size_t)20) != 0) {
H5_FAILED();
HDputs(" Fortran to C string test 3");
goto error;
@@ -4809,14 +4809,14 @@ test_conv_str_1(void)
HDmemcpy(buf, "abcdefghijabcdefghij", (size_t)20);
if (H5Tconvert(src_type, dst_type, (size_t)2, buf, NULL, H5P_DEFAULT) < 0)
goto error;
- if (HDmemcmp(buf, "abcdefghijabcdefghij", (size_t)20)) {
+ if (HDmemcmp(buf, "abcdefghijabcdefghij", (size_t)20) != 0) {
H5_FAILED();
HDputs(" C buffer to Fortran test 1");
goto error;
}
if (H5Tconvert(dst_type, src_type, (size_t)2, buf, NULL, H5P_DEFAULT) < 0)
goto error;
- if (HDmemcmp(buf, "abcdefghijabcdefghij", (size_t)20)) {
+ if (HDmemcmp(buf, "abcdefghijabcdefghij", (size_t)20) != 0) {
H5_FAILED();
HDputs(" Fortran to C buffer test 1");
goto error;
@@ -4828,14 +4828,14 @@ test_conv_str_1(void)
HDmemcpy(buf, "abcdefgh\0\0abcdefgh\0\0", (size_t)20);
if (H5Tconvert(src_type, dst_type, (size_t)2, buf, NULL, H5P_DEFAULT) < 0)
goto error;
- if (HDmemcmp(buf, "abcdeabcdeabcdefgh\0\0", (size_t)20)) {
+ if (HDmemcmp(buf, "abcdeabcdeabcdefgh\0\0", (size_t)20) != 0) {
H5_FAILED();
HDputs(" C buffer to Fortran test 2");
goto error;
}
if (H5Tconvert(dst_type, src_type, (size_t)2, buf, NULL, H5P_DEFAULT) < 0)
goto error;
- if (HDmemcmp(buf, "abcde\0\0\0\0\0abcde\0\0\0\0\0", (size_t)20)) {
+ if (HDmemcmp(buf, "abcde\0\0\0\0\0abcde\0\0\0\0\0", (size_t)20) != 0) {
H5_FAILED();
HDputs(" Fortran to C buffer test 2");
goto error;
@@ -4851,14 +4851,14 @@ test_conv_str_1(void)
HDmemcpy(buf, "abcd\0abcd\0xxxxxxxxxx", (size_t)20);
if (H5Tconvert(src_type, dst_type, (size_t)2, buf, NULL, H5P_DEFAULT) < 0)
goto error;
- if (HDmemcmp(buf, "abcd abcd ", (size_t)20)) {
+ if (HDmemcmp(buf, "abcd abcd ", (size_t)20) != 0) {
H5_FAILED();
HDputs(" C buffer to Fortran test 3");
goto error;
}
if (H5Tconvert(dst_type, src_type, (size_t)2, buf, NULL, H5P_DEFAULT) < 0)
goto error;
- if (HDmemcmp(buf, "abcd\0abcd\0abcd ", (size_t)20)) {
+ if (HDmemcmp(buf, "abcd\0abcd\0abcd ", (size_t)20) != 0) {
H5_FAILED();
HDputs(" Fortran to C buffer test 3");
goto error;
@@ -7373,7 +7373,7 @@ test_named_indirect_reopen(hid_t fapl)
TEST_ERROR
if (NULL == (tag_ret = H5Tget_tag(type)))
TEST_ERROR
- if (HDstrcmp(tag, tag_ret))
+ if (HDstrcmp(tag, tag_ret) != 0)
TEST_ERROR
H5free_memory(tag_ret);
tag_ret = NULL;
@@ -7389,7 +7389,7 @@ test_named_indirect_reopen(hid_t fapl)
TEST_ERROR
if (NULL == (tag_ret = H5Tget_tag(type)))
TEST_ERROR
- if (HDstrcmp(tag, tag_ret))
+ if (HDstrcmp(tag, tag_ret) != 0)
TEST_ERROR
H5free_memory(tag_ret);
tag_ret = NULL;
diff --git a/test/earray.c b/test/earray.c
index fc0b87e..bf7dcf3 100644
--- a/test/earray.c
+++ b/test/earray.c
@@ -332,52 +332,63 @@ check_stats(const H5EA_t *ea, const earray_state_t *state)
/* Compare information */
if (earray_stats.stored.max_idx_set != state->max_idx_set) {
- HDfprintf(stdout, "earray_stats.stored.max_idx_set = %Hu, state->max_idx_set = %Hu\n",
+ HDfprintf(stdout,
+ "earray_stats.stored.max_idx_set = %" PRIuHSIZE ", state->max_idx_set = %" PRIuHSIZE "\n",
earray_stats.stored.max_idx_set, state->max_idx_set);
TEST_ERROR
} /* end if */
if (earray_stats.stored.nelmts != state->nelmts) {
- HDfprintf(stdout, "earray_stats.stored.nelmts = %Hu, state->nelmts = %Hu\n",
+ HDfprintf(stdout, "earray_stats.stored.nelmts = %" PRIuHSIZE ", state->nelmts = %" PRIuHSIZE "\n",
earray_stats.stored.nelmts, state->nelmts);
TEST_ERROR
} /* end if */
if (earray_stats.computed.hdr_size != state->hdr_size) {
- HDfprintf(stdout, "earray_stats.computed.hdr_size = %Hu, state->hdr_size = %Hu\n",
+ HDfprintf(stdout,
+ "earray_stats.computed.hdr_size = %" PRIuHSIZE ", state->hdr_size = %" PRIuHSIZE "\n",
earray_stats.computed.hdr_size, state->hdr_size);
TEST_ERROR
} /* end if */
if (earray_stats.computed.nindex_blks != state->nindex_blks) {
- HDfprintf(stdout, "earray_stats.computed.nindex_blks = %Hu, state->nindex_blks = %Hu\n",
+ HDfprintf(stdout,
+ "earray_stats.computed.nindex_blks = %" PRIuHSIZE ", state->nindex_blks = %" PRIuHSIZE "\n",
earray_stats.computed.nindex_blks, state->nindex_blks);
TEST_ERROR
} /* end if */
if (earray_stats.computed.index_blk_size != state->index_blk_size) {
- HDfprintf(stdout, "earray_stats.computed.index_blk_size = %Hu, state->index_blk_size = %Hu\n",
+ HDfprintf(stdout,
+ "earray_stats.computed.index_blk_size = %" PRIuHSIZE ", state->index_blk_size = %" PRIuHSIZE
+ "\n",
earray_stats.computed.index_blk_size, state->index_blk_size);
TEST_ERROR
} /* end if */
if (earray_stats.stored.ndata_blks != state->ndata_blks) {
- HDfprintf(stdout, "earray_stats.stored.ndata_blks = %Hu, state->ndata_blks = %Hu\n",
+ HDfprintf(stdout,
+ "earray_stats.stored.ndata_blks = %" PRIuHSIZE ", state->ndata_blks = %" PRIuHSIZE "\n",
earray_stats.stored.ndata_blks, state->ndata_blks);
TEST_ERROR
} /* end if */
/* Don't compare this currently, it's very hard to compute */
#ifdef NOT_YET
if (earray_stats.stored.data_blk_size != state->data_blk_size) {
- HDfprintf(stdout, "earray_stats.stored.data_blk_size = %Hu, state->data_blk_size = %Hu\n",
+ HDfprintf(stdout,
+ "earray_stats.stored.data_blk_size = %" PRIuHSIZE ", state->data_blk_size = %" PRIuHSIZE
+ "\n",
earray_stats.stored.data_blk_size, state->data_blk_size);
TEST_ERROR
} /* end if */
#endif /* NOT_YET */
if (earray_stats.stored.nsuper_blks != state->nsuper_blks) {
- HDfprintf(stdout, "earray_stats.stored.nsuper_blks = %Hu, state->nsuper_blks = %Hu\n",
+ HDfprintf(stdout,
+ "earray_stats.stored.nsuper_blks = %" PRIuHSIZE ", state->nsuper_blks = %" PRIuHSIZE "\n",
earray_stats.stored.nsuper_blks, state->nsuper_blks);
TEST_ERROR
} /* end if */
/* Don't compare this currently, it's very hard to compute */
#ifdef NOT_YET
if (earray_stats.stored.super_blk_size != state->super_blk_size) {
- HDfprintf(stdout, "earray_stats.stored.super_blk_size = %Hu, state->super_blk_size = %Hu\n",
+ HDfprintf(stdout,
+ "earray_stats.stored.super_blk_size = %" PRIuHSIZE ", state->super_blk_size = %" PRIuHSIZE
+ "\n",
earray_stats.stored.super_blk_size, state->super_blk_size);
TEST_ERROR
} /* end if */
diff --git a/test/error_test.c b/test/error_test.c
index c8205ff8..d1ce00b 100644
--- a/test/error_test.c
+++ b/test/error_test.c
@@ -573,6 +573,123 @@ error:
} /* end test_copy() */
/*-------------------------------------------------------------------------
+ * Function: test_append
+ *
+ * Purpose: Test appending one error stack to another
+ *
+ * Return: Success: 0
+ * Failure: -1
+ *
+ *-------------------------------------------------------------------------
+ */
+static herr_t
+test_append(void)
+{
+ const char *err_func = "test_append"; /* Function name for pushing error */
+ const char *err_msg1 = "Error message #1"; /* Error message #1 for pushing error */
+ const char *err_msg2 = "Error message #2"; /* Error message #2 for pushing error */
+ ssize_t err_num; /* Number of errors on stack */
+ hid_t estack_id1 = -1; /* Error stack ID */
+ hid_t estack_id2 = -1; /* Error stack ID */
+ herr_t ret; /* Generic return value */
+
+ /* Push an error */
+ if (H5Epush(H5E_DEFAULT, __FILE__, err_func, __LINE__, ERR_CLS, ERR_MAJ_TEST, ERR_MIN_SUBROUTINE, "%s",
+ err_msg1) < 0)
+ TEST_ERROR;
+
+ /* Copy error stack, which clears the original */
+ if ((estack_id1 = H5Eget_current_stack()) < 0)
+ TEST_ERROR
+
+ /* Check the number of errors on stack #1 */
+ err_num = H5Eget_num(estack_id1);
+ if (err_num != 1)
+ TEST_ERROR
+
+ /* Create another stack, from scratch */
+ if ((estack_id2 = H5Ecreate_stack()) < 0)
+ TEST_ERROR
+
+ /* Check the number of errors on stack #2 */
+ err_num = H5Eget_num(estack_id2);
+ if (err_num != 0)
+ TEST_ERROR
+
+ /* Push an error on stack #2 */
+ if (H5Epush(estack_id2, __FILE__, err_func, __LINE__, ERR_CLS, ERR_MAJ_IO, ERR_MIN_CREATE, "%s",
+ err_msg2) < 0)
+ TEST_ERROR;
+
+ /* Check the number of errors on stack #2 */
+ err_num = H5Eget_num(estack_id2);
+ if (err_num != 1)
+ TEST_ERROR
+
+ /* Try to append bad error stack IDs */
+ H5E_BEGIN_TRY
+ {
+ ret = H5Eappend_stack(H5E_DEFAULT, H5E_DEFAULT, FALSE);
+ }
+ H5E_END_TRY
+ if (ret >= 0)
+ TEST_ERROR
+ H5E_BEGIN_TRY
+ {
+ ret = H5Eappend_stack(estack_id1, H5E_DEFAULT, FALSE);
+ }
+ H5E_END_TRY
+ if (ret >= 0)
+ TEST_ERROR
+ H5E_BEGIN_TRY
+ {
+ ret = H5Eappend_stack(H5E_DEFAULT, estack_id2, FALSE);
+ }
+ H5E_END_TRY
+ if (ret >= 0)
+ TEST_ERROR
+
+ /* Append error stack #2 to error stack #1, without closing stack #2 */
+ if (H5Eappend_stack(estack_id1, estack_id2, FALSE) < 0)
+ TEST_ERROR
+
+ /* Check the number of errors on stack #1 */
+ err_num = H5Eget_num(estack_id1);
+ if (err_num != 2)
+ TEST_ERROR
+
+ /* Check the number of errors on stack #2 */
+ err_num = H5Eget_num(estack_id2);
+ if (err_num != 1)
+ TEST_ERROR
+
+ /* Append error stack #2 to error stack #1, and close stack #2 */
+ if (H5Eappend_stack(estack_id1, estack_id2, TRUE) < 0)
+ TEST_ERROR
+
+ /* Try to close error stack #2. Should fail because H5Eappend_stack
+ * should have already closed it.
+ */
+ H5E_BEGIN_TRY
+ {
+ ret = H5Eclose_stack(estack_id2);
+ }
+ H5E_END_TRY
+ if (ret >= 0)
+ TEST_ERROR
+
+ /* Check the number of errors on stack #1 */
+ err_num = H5Eget_num(estack_id1);
+ if (err_num != 3)
+ TEST_ERROR
+
+ return 0;
+
+error:
+ return -1;
+} /* end test_append() */
+
+/*-------------------------------------------------------------------------
* Function: close_error
*
* Purpose: Closes error information.
@@ -747,6 +864,10 @@ main(void)
if (H5Fclose(file) < 0)
TEST_ERROR;
+ /* Test appending error stacks */
+ if (test_append() < 0)
+ TEST_ERROR;
+
/* Close error information */
if (close_error() < 0)
TEST_ERROR;
diff --git a/test/farray.c b/test/farray.c
index 81f839f..bb5e3fc 100644
--- a/test/farray.c
+++ b/test/farray.c
@@ -178,20 +178,20 @@ check_stats(const H5FA_t *fa, const farray_state_t *state)
/* Compare information */
if (farray_stats.hdr_size != state->hdr_size) {
- HDfprintf(stdout, "farray_stats.hdr_size = %Hu, state->hdr_size = %Hu\n", farray_stats.hdr_size,
- state->hdr_size);
+ HDfprintf(stdout, "farray_stats.hdr_size = %" PRIuHSIZE ", state->hdr_size = %" PRIuHSIZE "\n",
+ farray_stats.hdr_size, state->hdr_size);
TEST_ERROR
}
if (farray_stats.dblk_size != state->dblk_size) {
- HDfprintf(stdout, "farray_stats.dblk_size = %Hu, state->dblk_size = %Hu\n", farray_stats.dblk_size,
- state->dblk_size);
+ HDfprintf(stdout, "farray_stats.dblk_size = %" PRIuHSIZE ", state->dblk_size = %" PRIuHSIZE "\n",
+ farray_stats.dblk_size, state->dblk_size);
TEST_ERROR
}
if (farray_stats.nelmts != state->nelmts) {
- HDfprintf(stdout, "farray_stats.nelmts = %Hu, state->nelmts = %Hu\n", farray_stats.nelmts,
- state->nelmts);
+ HDfprintf(stdout, "farray_stats.nelmts = %" PRIuHSIZE ", state->nelmts = %" PRIuHSIZE "\n",
+ farray_stats.nelmts, state->nelmts);
TEST_ERROR
}
diff --git a/test/fheap.c b/test/fheap.c
index e8cde89..cb9c080 100644
--- a/test/fheap.c
+++ b/test/fheap.c
@@ -69,20 +69,22 @@
/* #define ALL_INSERT_TESTS */
/* Heap metadata macros */
-#define MAX_HEAP_ID_LEN 64 /* Max. # of bytes to use for heap ID */
-#define HEAP_ID_LEN 7 /* # of bytes to use for heap ID */
-#define SMALL_HEAP_ID_LEN 7 /* # of bytes to use for "small" heap's IDs */
-#define LARGE_HEAP_ID_LEN 12 /* # of bytes to use for "large" heap's IDs */
-#define HEAP_MAX_ROOT_ROWS(fh) H5HF_get_max_root_rows(fh) /* Max. # of rows in root indirect block */
-#define DTABLE_WIDTH(fh) H5HF_get_dtable_width_test(fh) /* Width of doubling table for heap */
-#define DTABLE_MAX_DROWS(fh) \
- H5HF_get_dtable_max_drows_test(fh) /* Max. # of direct block rows in any indirect block */
-#define IBLOCK_MAX_DROWS(fh, pos) \
- H5HF_get_iblock_max_drows_test(fh, pos) /* Max. # of direct block rows in a indirect block */
-#define DBLOCK_SIZE(fh, r) H5HF_get_dblock_size_test(fh, r) /* Size of a direct block in a given row */
-#define DBLOCK_FREE(fh, r) \
- H5HF_get_dblock_free_test(fh, r) /* Free space in a direct block of a given row \
- */
+#define MAX_HEAP_ID_LEN 64 /* Max. # of bytes to use for heap ID */
+#define HEAP_ID_LEN 7 /* # of bytes to use for heap ID */
+#define SMALL_HEAP_ID_LEN 7 /* # of bytes to use for "small" heap's IDs */
+#define LARGE_HEAP_ID_LEN 12 /* # of bytes to use for "large" heap's IDs */
+/* Max. # of rows in root indirect block */
+#define HEAP_MAX_ROOT_ROWS(fh) H5HF_get_max_root_rows(fh)
+/* Width of doubling table for heap */
+#define DTABLE_WIDTH(fh) H5HF_get_dtable_width_test(fh)
+/* Max. # of direct block rows in any indirect block */
+#define DTABLE_MAX_DROWS(fh) H5HF_get_dtable_max_drows_test(fh)
+/* Max. # of direct block rows in a indirect block */
+#define IBLOCK_MAX_DROWS(fh, pos) H5HF_get_iblock_max_drows_test(fh, pos)
+/* Size of a direct block in a given row */
+#define DBLOCK_SIZE(fh, r) H5HF_get_dblock_size_test(fh, r)
+/* Free space in a direct block of a given row */
+#define DBLOCK_FREE(fh, r) H5HF_get_dblock_free_test(fh, r)
/* The number of settings for testing: page buffering, file space strategy and persisting free-space */
#define NUM_PB_FS 6
@@ -176,16 +178,16 @@ static int del_objs(H5F_t *f, H5HF_t **fh, fheap_test_param_t *tparam, fheap_hea
fheap_heap_ids_t *keep_ids);
/*-------------------------------------------------------------------------
- * Function: init_small_cparam
+ * Function: init_small_cparam
*
- * Purpose: Initialize heap creation parameter structure with small
+ * Purpose: Initialize heap creation parameter structure with small
* settings
*
- * Return: Success: 0
+ * Return: Success: 0
*
- * Failure: 1
+ * Failure: 1
*
- * Programmer: Quincey Koziol
+ * Programmer: Quincey Koziol
* Tuesday, March 21, 2006
*
*-------------------------------------------------------------------------
@@ -212,16 +214,16 @@ init_small_cparam(H5HF_create_t *cparam)
} /* init_small_cparam() */
/*-------------------------------------------------------------------------
- * Function: init_large_cparam
+ * Function: init_large_cparam
*
- * Purpose: Initialize heap creation parameter structure with large
+ * Purpose: Initialize heap creation parameter structure with large
* settings
*
- * Return: Success: 0
+ * Return: Success: 0
*
- * Failure: 1
+ * Failure: 1
*
- * Programmer: Quincey Koziol
+ * Programmer: Quincey Koziol
* Tuesday, March 21, 2006
*
*-------------------------------------------------------------------------
@@ -248,15 +250,15 @@ init_large_cparam(H5HF_create_t *cparam)
} /* init_large_cparam() */
/*-------------------------------------------------------------------------
- * Function: check_stats
+ * Function: check_stats
*
- * Purpose: Verify stats for a heap
+ * Purpose: Verify stats for a heap
*
- * Return: Success: 0
+ * Return: Success: 0
*
- * Failure: 1
+ * Failure: 1
*
- * Programmer: Quincey Koziol
+ * Programmer: Quincey Koziol
* Monday, March 6, 2006
*
*-------------------------------------------------------------------------
@@ -270,43 +272,45 @@ check_stats(const H5HF_t *fh, const fheap_heap_state_t *state)
if (H5HF_stat_info(fh, &heap_stats) < 0)
FAIL_STACK_ERROR
if (heap_stats.man_nobjs != state->man_nobjs) {
- HDfprintf(stdout, "heap_stats.man_nobjs = %Hu, state->man_nobjs = %Zu\n", heap_stats.man_nobjs,
- state->man_nobjs);
+ HDfprintf(stdout, "heap_stats.man_nobjs = %" PRIuHSIZE ", state->man_nobjs = %zu\n",
+ heap_stats.man_nobjs, state->man_nobjs);
TEST_ERROR
} /* end if */
if (heap_stats.man_size != state->man_size) {
- HDfprintf(stdout, "heap_stats.man_size = %Hu, state->man_size = %Hu\n", heap_stats.man_size,
- state->man_size);
+ HDfprintf(stdout, "heap_stats.man_size = %" PRIuHSIZE ", state->man_size = %" PRIuHSIZE "\n",
+ heap_stats.man_size, state->man_size);
TEST_ERROR
} /* end if */
if (heap_stats.man_alloc_size != state->man_alloc_size) {
- HDfprintf(stdout, "heap_stats.man_alloc_size = %Hu, state->man_alloc_size = %Hu\n",
+ HDfprintf(stdout,
+ "heap_stats.man_alloc_size = %" PRIuHSIZE ", state->man_alloc_size = %" PRIuHSIZE "\n",
heap_stats.man_alloc_size, state->man_alloc_size);
TEST_ERROR
} /* end if */
if (heap_stats.man_free_space != state->man_free_space) {
- HDfprintf(stdout, "heap_stats.man_free_space = %Hu, state->man_free_space = %Hu\n",
+ HDfprintf(stdout,
+ "heap_stats.man_free_space = %" PRIuHSIZE ", state->man_free_space = %" PRIuHSIZE "\n",
heap_stats.man_free_space, state->man_free_space);
TEST_ERROR
} /* end if */
if (heap_stats.huge_nobjs != state->huge_nobjs) {
- HDfprintf(stdout, "heap_stats.huge_nobjs = %Hu, state->huge_nobjs = %Zu\n", heap_stats.huge_nobjs,
- state->huge_nobjs);
+ HDfprintf(stdout, "heap_stats.huge_nobjs = %" PRIuHSIZE ", state->huge_nobjs = %zu\n",
+ heap_stats.huge_nobjs, state->huge_nobjs);
TEST_ERROR
} /* end if */
if (heap_stats.huge_size != state->huge_size) {
- HDfprintf(stdout, "heap_stats.huge_size = %Hu, state->huge_size = %Hu\n", heap_stats.huge_size,
- state->huge_size);
+ HDfprintf(stdout, "heap_stats.huge_size = %" PRIuHSIZE ", state->huge_size = %" PRIuHSIZE "\n",
+ heap_stats.huge_size, state->huge_size);
TEST_ERROR
} /* end if */
if (heap_stats.tiny_nobjs != state->tiny_nobjs) {
- HDfprintf(stdout, "heap_stats.tiny_nobjs = %Hu, state->tiny_nobjs = %Zu\n", heap_stats.tiny_nobjs,
- state->tiny_nobjs);
+ HDfprintf(stdout, "heap_stats.tiny_nobjs = %" PRIuHSIZE ", state->tiny_nobjs = %zu\n",
+ heap_stats.tiny_nobjs, state->tiny_nobjs);
TEST_ERROR
} /* end if */
if (heap_stats.tiny_size != state->tiny_size) {
- HDfprintf(stdout, "heap_stats.tiny_size = %Hu, state->tiny_size = %Hu\n", heap_stats.tiny_size,
- state->tiny_size);
+ HDfprintf(stdout, "heap_stats.tiny_size = %" PRIuHSIZE ", state->tiny_size = %" PRIuHSIZE "\n",
+ heap_stats.tiny_size, state->tiny_size);
TEST_ERROR
} /* end if */
@@ -318,15 +322,15 @@ error:
} /* check_stats() */
/*-------------------------------------------------------------------------
- * Function: op_memcpy
+ * Function: op_memcpy
*
- * Purpose: Perform 'memcpy' for an object
+ * Purpose: Perform 'memcpy' for an object
*
- * Return: Success: 0
+ * Return: Success: 0
*
- * Failure: 1
+ * Failure: 1
*
- * Programmer: Quincey Koziol
+ * Programmer: Quincey Koziol
* Monday, September 11, 2006
*
*-------------------------------------------------------------------------
@@ -341,9 +345,9 @@ op_memcpy(const void *obj, size_t obj_len, void *op_data)
} /* op_memcpy() */
/*-------------------------------------------------------------------------
- * Function: add_obj
+ * Function: add_obj
*
- * Purpose: Add an object to heap
+ * Purpose: Add an object to heap
*
* Note: The following fields in the 'state' structure are set to
* the values expected _after_ any block created for the object:
@@ -355,11 +359,11 @@ op_memcpy(const void *obj, size_t obj_len, void *op_data)
* the current state, before any block has been created:
* nobjs
*
- * Return: Success: 0
+ * Return: Success: 0
*
- * Failure: 1
+ * Failure: 1
*
- * Programmer: Quincey Koziol
+ * Programmer: Quincey Koziol
* Monday, April 10, 2006
*
*-------------------------------------------------------------------------
@@ -420,7 +424,7 @@ add_obj(H5HF_t *fh, size_t obj_off, size_t obj_size, fheap_heap_state_t *state,
TEST_ERROR
if (H5HF_read(fh, heap_id, shared_robj_g) < 0)
FAIL_STACK_ERROR
- if (HDmemcmp(obj, shared_robj_g, obj_size))
+ if (HDmemcmp(obj, shared_robj_g, obj_size) != 0)
TEST_ERROR
/* If the heap IDs are to be retained, append them to the list */
@@ -463,15 +467,15 @@ error:
} /* add_obj() */
/*-------------------------------------------------------------------------
- * Function: get_del_string
+ * Function: get_del_string
*
- * Purpose: Return string describing the kind of deletion to perform
+ * Purpose: Return string describing the kind of deletion to perform
*
- * Return: Success: 0
+ * Return: Success: 0
*
- * Failure: 1
+ * Failure: 1
*
- * Programmer: Quincey Koziol
+ * Programmer: Quincey Koziol
* Monday, June 6, 2006
*
*-------------------------------------------------------------------------
@@ -499,14 +503,14 @@ get_del_string(const fheap_test_param_t *tparam)
} /* get_del_string() */
/*-------------------------------------------------------------------------
- * Function: get_fill_size
+ * Function: get_fill_size
*
- * Purpose: Retrieve the size of objects to "bulk" fill blocks with
+ * Purpose: Retrieve the size of objects to "bulk" fill blocks with
*
- * Return: Size of object to pass down to "fill_heap" routine on
+ * Return: Size of object to pass down to "fill_heap" routine on
* success/can't fail
*
- * Programmer: Quincey Koziol
+ * Programmer: Quincey Koziol
* Thursday, July 27, 2006
*
*-------------------------------------------------------------------------
@@ -530,15 +534,15 @@ get_fill_size(const fheap_test_param_t *tparam)
} /* get_fill_size() */
/*-------------------------------------------------------------------------
- * Function: begin_test
+ * Function: begin_test
*
- * Purpose: Perform common "test being" operations
+ * Purpose: Perform common "test being" operations
*
- * Return: Success: 0
+ * Return: Success: 0
*
- * Failure: 1
+ * Failure: 1
*
- * Programmer: Quincey Koziol
+ * Programmer: Quincey Koziol
* Friday, August 4, 2006
*
*-------------------------------------------------------------------------
@@ -561,8 +565,11 @@ begin_test(fheap_test_param_t *tparam, const char *base_desc, fheap_heap_ids_t *
*/
del_str = get_del_string(tparam);
HDassert(del_str);
- TESTING(base_desc, del_str);
+ test_desc = (char *)H5MM_malloc(HDstrlen(del_str) + HDstrlen(base_desc));
+ HDsprintf(test_desc, base_desc, del_str);
+ TESTING(test_desc);
H5MM_xfree(del_str);
+ H5MM_xfree(test_desc);
/* Initialize the heap ID structure */
HDmemset(keep_ids, 0, sizeof(fheap_heap_ids_t));
@@ -577,14 +584,14 @@ begin_test(fheap_test_param_t *tparam, const char *base_desc, fheap_heap_ids_t *
H5_GCC_DIAG_ON("format-nonliteral")
/*-------------------------------------------------------------------------
- * Function: reopen_file
+ * Function: reopen_file
*
- * Purpose: Perform common "re-open" operations on file & heap for testing
+ * Purpose: Perform common "re-open" operations on file & heap for testing
*
- * Return: Success: 0
- * Failure: 1
+ * Return: Success: 0
+ * Failure: 1
*
- * Programmer: Quincey Koziol
+ * Programmer: Quincey Koziol
* Friday, August 18, 2006
*
*-------------------------------------------------------------------------
@@ -632,15 +639,15 @@ error:
} /* end reopen_file() */
/*-------------------------------------------------------------------------
- * Function: open_heap
+ * Function: open_heap
*
- * Purpose: Perform common "open" operations on file & heap for testing
+ * Purpose: Perform common "open" operations on file & heap for testing
*
- * Return: Success: 0
+ * Return: Success: 0
*
- * Failure: 1
+ * Failure: 1
*
- * Programmer: Quincey Koziol
+ * Programmer: Quincey Koziol
* Friday, August 4, 2006
*
*-------------------------------------------------------------------------
@@ -743,15 +750,15 @@ error:
} /* end open_heap() */
/*-------------------------------------------------------------------------
- * Function: reopen_heap
+ * Function: reopen_heap
*
- * Purpose: Perform common "re-open" operations on heap for testing
+ * Purpose: Perform common "re-open" operations on heap for testing
*
- * Return: Success: 0
+ * Return: Success: 0
*
- * Failure: 1
+ * Failure: 1
*
- * Programmer: Quincey Koziol
+ * Programmer: Quincey Koziol
* Friday, August 4, 2006
*
*-------------------------------------------------------------------------
@@ -779,14 +786,14 @@ error:
} /* end reopen_heap() */
/*-------------------------------------------------------------------------
- * Function: close_heap
+ * Function: close_heap
*
- * Purpose: Perform common "close" operations on file & heap for testing
+ * Purpose: Perform common "close" operations on file & heap for testing
*
- * Return: Success: 0
- * Failure: 1
+ * Return: Success: 0
+ * Failure: 1
*
- * Programmer: Quincey Koziol
+ * Programmer: Quincey Koziol
* Friday, August 4, 2006
*
*-------------------------------------------------------------------------
@@ -844,15 +851,15 @@ error:
} /* end close_heap() */
/*-------------------------------------------------------------------------
- * Function: del_objs_half_refill
+ * Function: del_objs_half_refill
*
- * Purpose: Remove half of objects from heap and refill
+ * Purpose: Remove half of objects from heap and refill
*
- * Return: Success: 0
+ * Return: Success: 0
*
- * Failure: 1
+ * Failure: 1
*
- * Programmer: Quincey Koziol
+ * Programmer: Quincey Koziol
* Monday, June 6, 2006
*
*-------------------------------------------------------------------------
@@ -936,15 +943,15 @@ error:
} /* del_objs_half_refill() */
/*-------------------------------------------------------------------------
- * Function: del_objs
+ * Function: del_objs
*
- * Purpose: Remove objects from heap
+ * Purpose: Remove objects from heap
*
- * Return: Success: 0
+ * Return: Success: 0
*
- * Failure: 1
+ * Failure: 1
*
- * Programmer: Quincey Koziol
+ * Programmer: Quincey Koziol
* Monday, June 6, 2006
*
*-------------------------------------------------------------------------
@@ -1017,9 +1024,9 @@ error:
} /* del_objs() */
/*-------------------------------------------------------------------------
- * Function: fill_heap
+ * Function: fill_heap
*
- * Purpose: Insert (small) objects to fill up the free space in a heap block
+ * Purpose: Insert (small) objects to fill up the free space in a heap block
*
* Note: The following fields in the 'state' structure are set to
* the values expected _after_ the block has been created:
@@ -1031,11 +1038,11 @@ error:
* the current state, before the block has been created:
* nobjs
*
- * Return: Success: 0
+ * Return: Success: 0
*
- * Failure: 1
+ * Failure: 1
*
- * Programmer: Quincey Koziol
+ * Programmer: Quincey Koziol
* Tuesday, March 7, 2006
*
*-------------------------------------------------------------------------
@@ -1185,7 +1192,7 @@ fill_heap(H5HF_t *fh, unsigned block_row, size_t obj_size, fheap_heap_state_t *s
/* Check that object is correct */
wobj = &shared_wobj_g[*curr_off_ptr];
- if (HDmemcmp(wobj, shared_robj_g, *curr_len_ptr))
+ if (HDmemcmp(wobj, shared_robj_g, *curr_len_ptr) != 0)
TEST_ERROR
/* Adjust object & ID pointers */
@@ -1227,15 +1234,15 @@ error:
} /* fill_heap() */
/*-------------------------------------------------------------------------
- * Function: fill_root_row
+ * Function: fill_root_row
*
- * Purpose: Fill up a row of direct blocks in the root indirect block
+ * Purpose: Fill up a row of direct blocks in the root indirect block
*
- * Return: Success: 0
+ * Return: Success: 0
*
- * Failure: 1
+ * Failure: 1
*
- * Programmer: Quincey Koziol
+ * Programmer: Quincey Koziol
* Monday, April 10, 2006
*
*-------------------------------------------------------------------------
@@ -1323,15 +1330,15 @@ error:
} /* fill_root_row() */
/*-------------------------------------------------------------------------
- * Function: fill_partial row
+ * Function: fill_partial row
*
- * Purpose: Fill up part of a row of direct blocks in an non-root indirect block
+ * Purpose: Fill up part of a row of direct blocks in an non-root indirect block
*
- * Return: Success: 0
+ * Return: Success: 0
*
- * Failure: 1
+ * Failure: 1
*
- * Programmer: Quincey Koziol
+ * Programmer: Quincey Koziol
* Tuesday, July 11, 2006
*
*-------------------------------------------------------------------------
@@ -1368,15 +1375,15 @@ error:
} /* fill_partial_row() */
/*-------------------------------------------------------------------------
- * Function: fill_row
+ * Function: fill_row
*
- * Purpose: Fill up entire row of direct blocks in an non-root indirect block
+ * Purpose: Fill up entire row of direct blocks in an non-root indirect block
*
- * Return: Success: 0
+ * Return: Success: 0
*
- * Failure: 1
+ * Failure: 1
*
- * Programmer: Quincey Koziol
+ * Programmer: Quincey Koziol
* Monday, April 10, 2006
*
*-------------------------------------------------------------------------
@@ -1400,18 +1407,18 @@ error:
} /* fill_row() */
/*-------------------------------------------------------------------------
- * Function: fill_root_direct
+ * Function: fill_root_direct
*
- * Purpose: Insert (small) objects to fill up the free space in all direct
+ * Purpose: Insert (small) objects to fill up the free space in all direct
* heap blocks in the root indirect block
* (Generally used to create & fill up direct blocks in a new
* indirect block)
*
- * Return: Success: 0
+ * Return: Success: 0
*
- * Failure: 1
+ * Failure: 1
*
- * Programmer: Quincey Koziol
+ * Programmer: Quincey Koziol
* Monday, April 3, 2006
*
*-------------------------------------------------------------------------
@@ -1439,17 +1446,17 @@ error:
} /* fill_root_direct() */
/*-------------------------------------------------------------------------
- * Function: fill_2nd_indirect
+ * Function: fill_2nd_indirect
*
- * Purpose: Insert (small) objects to fill up the free space in all direct
+ * Purpose: Insert (small) objects to fill up the free space in all direct
* heap blocks in a second-level indirect block (which only has
* direct blocks)
*
- * Return: Success: 0
+ * Return: Success: 0
*
- * Failure: 1
+ * Failure: 1
*
- * Programmer: Quincey Koziol
+ * Programmer: Quincey Koziol
* Monday, April 10, 2006
*
*-------------------------------------------------------------------------
@@ -1478,16 +1485,16 @@ error:
} /* fill_2nd_direct() */
/*-------------------------------------------------------------------------
- * Function: fill_all_direct
+ * Function: fill_all_direct
*
- * Purpose: Insert (small) objects to fill up the free space in all direct
+ * Purpose: Insert (small) objects to fill up the free space in all direct
* heap blocks up to the maximum direct block size
*
- * Return: Success: 0
+ * Return: Success: 0
*
- * Failure: 1
+ * Failure: 1
*
- * Programmer: Quincey Koziol
+ * Programmer: Quincey Koziol
* Monday, April 10, 2006
*
*-------------------------------------------------------------------------
@@ -1515,17 +1522,17 @@ error:
} /* fill_all_direct() */
/*-------------------------------------------------------------------------
- * Function: fill_2nd_indirect_row
+ * Function: fill_2nd_indirect_row
*
- * Purpose: Insert (small) objects to fill up the free space in all direct
+ * Purpose: Insert (small) objects to fill up the free space in all direct
* heap blocks in a row of second-level indirect block (which only
* have direct blocks)
*
- * Return: Success: 0
+ * Return: Success: 0
*
- * Failure: 1
+ * Failure: 1
*
- * Programmer: Quincey Koziol
+ * Programmer: Quincey Koziol
* Monday, April 10, 2006
*
*-------------------------------------------------------------------------
@@ -1553,17 +1560,17 @@ error:
} /* fill_2nd_direct_row() */
/*-------------------------------------------------------------------------
- * Function: fill_all_2nd_indirect_rows
+ * Function: fill_all_2nd_indirect_rows
*
- * Purpose: Insert (small) objects to fill up the free space in all direct
+ * Purpose: Insert (small) objects to fill up the free space in all direct
* heap blocks in all rows of second-level indirect blocks (which only
* have direct blocks)
*
- * Return: Success: 0
+ * Return: Success: 0
*
- * Failure: 1
+ * Failure: 1
*
- * Programmer: Quincey Koziol
+ * Programmer: Quincey Koziol
* Monday, April 10, 2006
*
*-------------------------------------------------------------------------
@@ -1590,17 +1597,17 @@ error:
} /* fill_2nd_direct_row() */
/*-------------------------------------------------------------------------
- * Function: fill_3rd_indirect
+ * Function: fill_3rd_indirect
*
- * Purpose: Insert (small) objects to fill up the free space in all direct
+ * Purpose: Insert (small) objects to fill up the free space in all direct
* heap blocks in a third-level indirect block (which
* has one more level of indirect blocks)
*
- * Return: Success: 0
+ * Return: Success: 0
*
- * Failure: 1
+ * Failure: 1
*
- * Programmer: Quincey Koziol
+ * Programmer: Quincey Koziol
* Tuesday, April 18, 2006
*
*-------------------------------------------------------------------------
@@ -1628,17 +1635,17 @@ error:
} /* fill_3rd_indirect() */
/*-------------------------------------------------------------------------
- * Function: fill_3rd_indirect_row
+ * Function: fill_3rd_indirect_row
*
- * Purpose: Insert (small) objects to fill up the free space in all direct
+ * Purpose: Insert (small) objects to fill up the free space in all direct
* heap blocks in a row of third-level indirect block (which
* have one more level of indirect blocks)
*
- * Return: Success: 0
+ * Return: Success: 0
*
- * Failure: 1
+ * Failure: 1
*
- * Programmer: Quincey Koziol
+ * Programmer: Quincey Koziol
* Monday, April 10, 2006
*
*-------------------------------------------------------------------------
@@ -1667,17 +1674,17 @@ error:
} /* fill_3rd_direct_row() */
/*-------------------------------------------------------------------------
- * Function: fill_all_3rd_indirect_rows
+ * Function: fill_all_3rd_indirect_rows
*
- * Purpose: Insert (small) objects to fill up the free space in all direct
+ * Purpose: Insert (small) objects to fill up the free space in all direct
* heap blocks in all rows of third-level indirect blocks (which
* have one more level of indirect blocks)
*
- * Return: Success: 0
+ * Return: Success: 0
*
- * Failure: 1
+ * Failure: 1
*
- * Programmer: Quincey Koziol
+ * Programmer: Quincey Koziol
* Monday, April 10, 2006
*
*-------------------------------------------------------------------------
@@ -1705,17 +1712,17 @@ error:
} /* fill_all_3rd_direct_rows() */
/*-------------------------------------------------------------------------
- * Function: fill_4th_indirect_row
+ * Function: fill_4th_indirect_row
*
- * Purpose: Insert (small) objects to fill up the free space in all direct
+ * Purpose: Insert (small) objects to fill up the free space in all direct
* heap blocks in a row of fourth-level indirect blocks (which
* have two more levels of indirect blocks)
*
- * Return: Success: 0
+ * Return: Success: 0
*
- * Failure: 1
+ * Failure: 1
*
- * Programmer: Quincey Koziol
+ * Programmer: Quincey Koziol
* Monday, April 10, 2006
*
*-------------------------------------------------------------------------
@@ -1754,17 +1761,17 @@ error:
} /* fill_4th_direct_row() */
/*-------------------------------------------------------------------------
- * Function: fill_all_4th_indirect_rows
+ * Function: fill_all_4th_indirect_rows
*
- * Purpose: Insert (small) objects to fill up the free space in all direct
+ * Purpose: Insert (small) objects to fill up the free space in all direct
* heap blocks in all rows of fourth-level indirect blocks (which
* have two more levels of indirect blocks)
*
- * Return: Success: 0
+ * Return: Success: 0
*
- * Failure: 1
+ * Failure: 1
*
- * Programmer: Quincey Koziol
+ * Programmer: Quincey Koziol
* Monday, April 10, 2006
*
*-------------------------------------------------------------------------
@@ -1810,14 +1817,14 @@ error:
} /* fill_all_4th_direct_rows() */
/*-------------------------------------------------------------------------
- * Function: test_create
+ * Function: test_create
*
- * Purpose: Create fractal heap
+ * Purpose: Create fractal heap
*
- * Return: Success: 0
- * Failure: 1
+ * Return: Success: 0
+ * Failure: 1
*
- * Programmer: Quincey Koziol
+ * Programmer: Quincey Koziol
* Friday, February 24, 2006
*
*-------------------------------------------------------------------------
@@ -1929,14 +1936,14 @@ error:
} /* test_create() */
/*-------------------------------------------------------------------------
- * Function: test_reopen
+ * Function: test_reopen
*
- * Purpose: Create & reopen a fractal heap
+ * Purpose: Create & reopen a fractal heap
*
- * Return: Success: 0
- * Failure: 1
+ * Return: Success: 0
+ * Failure: 1
*
- * Programmer: Quincey Koziol
+ * Programmer: Quincey Koziol
* Tuesday, April 18, 2006
*
*-------------------------------------------------------------------------
@@ -2082,14 +2089,14 @@ error:
} /* test_reopen() */
/*-------------------------------------------------------------------------
- * Function: test_open_twice
+ * Function: test_open_twice
*
- * Purpose: Open a fractal heap twice
+ * Purpose: Open a fractal heap twice
*
- * Return: Success: 0
- * Failure: 1
+ * Return: Success: 0
+ * Failure: 1
*
- * Programmer: Quincey Koziol
+ * Programmer: Quincey Koziol
* Friday, August 18, 2006
*
*-------------------------------------------------------------------------
@@ -2260,14 +2267,14 @@ error:
} /* test_open_twice() */
/*-------------------------------------------------------------------------
- * Function: test_delete_open
+ * Function: test_delete_open
*
- * Purpose: Delete opened fractal heap (& open deleted heap)
+ * Purpose: Delete opened fractal heap (& open deleted heap)
*
- * Return: Success: 0
- * Failure: 1
+ * Return: Success: 0
+ * Failure: 1
*
- * Programmer: Quincey Koziol
+ * Programmer: Quincey Koziol
* Friday, January 5, 2007
*
*-------------------------------------------------------------------------
@@ -2438,14 +2445,14 @@ error:
} /* test_delete_open() */
/*-------------------------------------------------------------------------
- * Function: test_id_limits
+ * Function: test_id_limits
*
- * Purpose: Test limits for heap ID lengths
+ * Purpose: Test limits for heap ID lengths
*
- * Return: Success: 0
- * Failure: 1
+ * Return: Success: 0
+ * Failure: 1
*
- * Programmer: Quincey Koziol
+ * Programmer: Quincey Koziol
* Monday, August 14, 2006
*
*-------------------------------------------------------------------------
@@ -2776,14 +2783,14 @@ error:
} /* test_id_limits() */
/*-------------------------------------------------------------------------
- * Function: test_filtered_create
+ * Function: test_filtered_create
*
- * Purpose: Test creating a heap with I/O filters
+ * Purpose: Test creating a heap with I/O filters
*
- * Return: Success: 0
- * Failure: 1
+ * Return: Success: 0
+ * Failure: 1
*
- * Programmer: Quincey Koziol
+ * Programmer: Quincey Koziol
* Monday, August 14, 2006
*
*-------------------------------------------------------------------------
@@ -2898,14 +2905,14 @@ error:
} /* test_filtered_create() */
/*-------------------------------------------------------------------------
- * Function: test_size
+ * Function: test_size
*
- * Purpose: Test querying heap size
+ * Purpose: Test querying heap size
*
- * Return: Success: 0
- * Failure: 1
+ * Return: Success: 0
+ * Failure: 1
*
- * Programmer: Quincey Koziol
+ * Programmer: Quincey Koziol
* Tuesday, August 14, 2007
*
*-------------------------------------------------------------------------
@@ -3171,17 +3178,15 @@ error:
return (1);
} /* test_reopen_hdr() */
-#ifndef QAK2
-
/*-------------------------------------------------------------------------
- * Function: test_man_insert_weird
+ * Function: test_man_insert_weird
*
- * Purpose: Test inserting "weird" sized objects into absolute heap
+ * Purpose: Test inserting "weird" sized objects into absolute heap
*
- * Return: Success: 0
- * Failure: 1
+ * Return: Success: 0
+ * Failure: 1
*
- * Programmer: Quincey Koziol
+ * Programmer: Quincey Koziol
* Friday, August 18, 2006
*
*-------------------------------------------------------------------------
@@ -3288,15 +3293,15 @@ error:
#ifdef ALL_INSERT_TESTS
/*-------------------------------------------------------------------------
- * Function: test_man_insert_first
+ * Function: test_man_insert_first
*
- * Purpose: Test inserting first object into absolute heap
+ * Purpose: Test inserting first object into absolute heap
*
- * Return: Success: 0
+ * Return: Success: 0
*
- * Failure: 1
+ * Failure: 1
*
- * Programmer: Quincey Koziol
+ * Programmer: Quincey Koziol
* Friday, February 24, 2006
*
*-------------------------------------------------------------------------
@@ -3389,15 +3394,15 @@ error:
} /* test_man_insert_first() */
/*-------------------------------------------------------------------------
- * Function: test_man_insert_second
+ * Function: test_man_insert_second
*
- * Purpose: Test inserting two objects into absolute heap
+ * Purpose: Test inserting two objects into absolute heap
*
- * Return: Success: 0
+ * Return: Success: 0
*
- * Failure: 1
+ * Failure: 1
*
- * Programmer: Quincey Koziol
+ * Programmer: Quincey Koziol
* Monday, March 6, 2006
*
*-------------------------------------------------------------------------
@@ -3484,16 +3489,16 @@ error:
} /* test_man_insert_second() */
/*-------------------------------------------------------------------------
- * Function: test_man_insert_root_mult
+ * Function: test_man_insert_root_mult
*
- * Purpose: Test inserting mult. objects into absolute heap, up to the
+ * Purpose: Test inserting mult. objects into absolute heap, up to the
* limit of a root direct block
*
- * Return: Success: 0
+ * Return: Success: 0
*
- * Failure: 1
+ * Failure: 1
*
- * Programmer: Quincey Koziol
+ * Programmer: Quincey Koziol
* Monday, March 6, 2006
*
*-------------------------------------------------------------------------
@@ -3582,17 +3587,17 @@ error:
} /* test_man_insert_root_mult() */
/*-------------------------------------------------------------------------
- * Function: test_man_insert_force_indirect
+ * Function: test_man_insert_force_indirect
*
- * Purpose: Test inserting mult. objects into absolute heap, filling the
+ * Purpose: Test inserting mult. objects into absolute heap, filling the
* root direct block and forcing the root block to be converted
* into an indirect block
*
- * Return: Success: 0
+ * Return: Success: 0
*
- * Failure: 1
+ * Failure: 1
*
- * Programmer: Quincey Koziol
+ * Programmer: Quincey Koziol
* Monday, March 6, 2006
*
*-------------------------------------------------------------------------
@@ -3688,17 +3693,17 @@ error:
} /* test_man_insert_force_indirect() */
/*-------------------------------------------------------------------------
- * Function: test_man_insert_fill_second
+ * Function: test_man_insert_fill_second
*
- * Purpose: Test inserting mult. objects into absolute heap, filling the
+ * Purpose: Test inserting mult. objects into absolute heap, filling the
* root direct block, forcing the root block to be converted
* into an indirect block and filling the secnod indirect block
*
- * Return: Success: 0
+ * Return: Success: 0
*
- * Failure: 1
+ * Failure: 1
*
- * Programmer: Quincey Koziol
+ * Programmer: Quincey Koziol
* Tuesday, March 7, 2006
*
*-------------------------------------------------------------------------
@@ -3794,18 +3799,18 @@ error:
} /* test_man_insert_fill_second() */
/*-------------------------------------------------------------------------
- * Function: test_man_insert_third_direct
+ * Function: test_man_insert_third_direct
*
- * Purpose: Test inserting mult. objects into absolute heap, filling the
+ * Purpose: Test inserting mult. objects into absolute heap, filling the
* root direct block, forcing the root block to be converted
* into an indirect block, filling the secnod indirect block and
* creating a third direct block
*
- * Return: Success: 0
+ * Return: Success: 0
*
- * Failure: 1
+ * Failure: 1
*
- * Programmer: Quincey Koziol
+ * Programmer: Quincey Koziol
* Tuesday, March 7, 2006
*
*-------------------------------------------------------------------------
@@ -3906,17 +3911,17 @@ error:
} /* test_man_insert_third_direct() */
/*-------------------------------------------------------------------------
- * Function: test_man_fill_first_row
+ * Function: test_man_fill_first_row
*
- * Purpose: Test inserting mult. objects into absolute heap, creating
+ * Purpose: Test inserting mult. objects into absolute heap, creating
* enough direct blocks to fill first row of root indirect
* block.
*
- * Return: Success: 0
+ * Return: Success: 0
*
- * Failure: 1
+ * Failure: 1
*
- * Programmer: Quincey Koziol
+ * Programmer: Quincey Koziol
* Monday, March 13, 2006
*
*-------------------------------------------------------------------------
@@ -4002,17 +4007,17 @@ error:
} /* test_man_fill_first_row() */
/*-------------------------------------------------------------------------
- * Function: test_man_start_second_row
+ * Function: test_man_start_second_row
*
- * Purpose: Test inserting mult. objects into absolute heap, creating
+ * Purpose: Test inserting mult. objects into absolute heap, creating
* enough direct blocks to fill first row of root indirect
* block, then add another object to start second row.
*
- * Return: Success: 0
+ * Return: Success: 0
*
- * Failure: 1
+ * Failure: 1
*
- * Programmer: Quincey Koziol
+ * Programmer: Quincey Koziol
* Tuesday, March 14, 2006
*
*-------------------------------------------------------------------------
@@ -4105,17 +4110,17 @@ error:
} /* test_man_start_second_row() */
/*-------------------------------------------------------------------------
- * Function: test_man_fill_second_row
+ * Function: test_man_fill_second_row
*
- * Purpose: Test inserting mult. objects into absolute heap, creating
+ * Purpose: Test inserting mult. objects into absolute heap, creating
* enough direct blocks to fill first row of root indirect
* block, then fill the second row also.
*
- * Return: Success: 0
+ * Return: Success: 0
*
- * Failure: 1
+ * Failure: 1
*
- * Programmer: Quincey Koziol
+ * Programmer: Quincey Koziol
* Tuesday, March 14, 2006
*
*-------------------------------------------------------------------------
@@ -4205,18 +4210,18 @@ error:
} /* test_man_fill_second_row() */
/*-------------------------------------------------------------------------
- * Function: test_man_start_third_row
+ * Function: test_man_start_third_row
*
- * Purpose: Test inserting mult. objects into absolute heap, creating
+ * Purpose: Test inserting mult. objects into absolute heap, creating
* enough direct blocks to fill first row of root indirect
* block, fill the second row also, then add another object to
* start the third row.
*
- * Return: Success: 0
+ * Return: Success: 0
*
- * Failure: 1
+ * Failure: 1
*
- * Programmer: Quincey Koziol
+ * Programmer: Quincey Koziol
* Monday, March 20, 2006
*
*-------------------------------------------------------------------------
@@ -4316,17 +4321,17 @@ error:
} /* test_man_start_third_row() */
/*-------------------------------------------------------------------------
- * Function: test_man_fill_fourth_row
+ * Function: test_man_fill_fourth_row
*
- * Purpose: Test inserting mult. objects into absolute heap, creating
+ * Purpose: Test inserting mult. objects into absolute heap, creating
* enough direct blocks to fill first four rows of root indirect
* block.
*
- * Return: Success: 0
+ * Return: Success: 0
*
- * Failure: 1
+ * Failure: 1
*
- * Programmer: Quincey Koziol
+ * Programmer: Quincey Koziol
* Monday, March 20, 2006
*
*-------------------------------------------------------------------------
@@ -4414,17 +4419,17 @@ error:
} /* test_man_fill_fourth_row() */
/*-------------------------------------------------------------------------
- * Function: test_man_fill_all_root_direct
+ * Function: test_man_fill_all_root_direct
*
- * Purpose: Test inserting mult. objects into absolute heap, creating
+ * Purpose: Test inserting mult. objects into absolute heap, creating
* enough direct blocks to fill all direct rows of root indirect
* block.
*
- * Return: Success: 0
+ * Return: Success: 0
*
- * Failure: 1
+ * Failure: 1
*
- * Programmer: Quincey Koziol
+ * Programmer: Quincey Koziol
* Monday, March 20, 2006
*
*-------------------------------------------------------------------------
@@ -4510,17 +4515,17 @@ error:
} /* test_man_fill_all_root_direct() */
/*-------------------------------------------------------------------------
- * Function: test_man_first_recursive_indirect
+ * Function: test_man_first_recursive_indirect
*
- * Purpose: Test inserting mult. objects into absolute heap, creating
+ * Purpose: Test inserting mult. objects into absolute heap, creating
* enough direct blocks to fill all direct rows of root indirect
* block and create first recursive indirect block.
*
- * Return: Success: 0
+ * Return: Success: 0
*
- * Failure: 1
+ * Failure: 1
*
- * Programmer: Quincey Koziol
+ * Programmer: Quincey Koziol
* Monday, March 20, 2006
*
*-------------------------------------------------------------------------
@@ -4611,18 +4616,18 @@ error:
} /* test_man_first_recursive_indirect() */
/*-------------------------------------------------------------------------
- * Function: test_man_second_direct_recursive_indirect
+ * Function: test_man_second_direct_recursive_indirect
*
- * Purpose: Test inserting mult. objects into absolute heap, creating
+ * Purpose: Test inserting mult. objects into absolute heap, creating
* enough direct blocks to fill all direct rows of root indirect
* block, create first recursive indirect block and start second
* direct block in that indirect block.
*
- * Return: Success: 0
+ * Return: Success: 0
*
- * Failure: 1
+ * Failure: 1
*
- * Programmer: Quincey Koziol
+ * Programmer: Quincey Koziol
* Tuesday, March 21, 2006
*
*-------------------------------------------------------------------------
@@ -4721,18 +4726,18 @@ error:
} /* test_man_second_direct_recursive_indirect() */
/*-------------------------------------------------------------------------
- * Function: test_man_fill_first_recursive_indirect
+ * Function: test_man_fill_first_recursive_indirect
*
- * Purpose: Test inserting mult. objects into absolute heap, creating
+ * Purpose: Test inserting mult. objects into absolute heap, creating
* enough direct blocks to fill all direct rows of root indirect
* block, create first recursive indirect block and filling all
* direct blocks in that indirect block.
*
- * Return: Success: 0
+ * Return: Success: 0
*
- * Failure: 1
+ * Failure: 1
*
- * Programmer: Quincey Koziol
+ * Programmer: Quincey Koziol
* Tuesday, March 21, 2006
*
*-------------------------------------------------------------------------
@@ -4823,19 +4828,19 @@ error:
} /* test_man_fill_first_recursive_indirect() */
/*-------------------------------------------------------------------------
- * Function: test_man_second_recursive_indirect
+ * Function: test_man_second_recursive_indirect
*
- * Purpose: Test inserting mult. objects into absolute heap, creating
+ * Purpose: Test inserting mult. objects into absolute heap, creating
* enough direct blocks to fill all direct rows of root indirect
* block, create first recursive indirect block, filling all
* direct blocks in that indirect block and adding another
* object to force creation of second recursive indirect block.
*
- * Return: Success: 0
+ * Return: Success: 0
*
- * Failure: 1
+ * Failure: 1
*
- * Programmer: Quincey Koziol
+ * Programmer: Quincey Koziol
* Tuesday, March 21, 2006
*
*-------------------------------------------------------------------------
@@ -4933,20 +4938,20 @@ error:
} /* test_man_second_recursive_indirect() */
/*-------------------------------------------------------------------------
- * Function: test_man_fill_second_recursive_indirect
+ * Function: test_man_fill_second_recursive_indirect
*
- * Purpose: Test inserting mult. objects into absolute heap, creating
+ * Purpose: Test inserting mult. objects into absolute heap, creating
* enough direct blocks to fill all direct rows of root indirect
* block, create first recursive indirect block, filling all
* direct blocks in that indirect block and then create second
* recursive indirect block and fill all direct blocks in that
* indirect block.
*
- * Return: Success: 0
+ * Return: Success: 0
*
- * Failure: 1
+ * Failure: 1
*
- * Programmer: Quincey Koziol
+ * Programmer: Quincey Koziol
* Tuesday, March 21, 2006
*
*-------------------------------------------------------------------------
@@ -5041,20 +5046,20 @@ error:
} /* test_man_fill_second_recursive_indirect() */
/*-------------------------------------------------------------------------
- * Function: test_man_fill_recursive_indirect_row
+ * Function: test_man_fill_recursive_indirect_row
*
- * Purpose: Test inserting mult. objects into absolute heap, creating
+ * Purpose: Test inserting mult. objects into absolute heap, creating
* enough direct blocks to fill all direct rows of root indirect
* block, create first recursive indirect block, filling all
* direct blocks in that indirect block and then create second
* recursive indirect block and fill all direct blocks in that
* indirect block.
*
- * Return: Success: 0
+ * Return: Success: 0
*
- * Failure: 1
+ * Failure: 1
*
- * Programmer: Quincey Koziol
+ * Programmer: Quincey Koziol
* Tuesday, March 21, 2006
*
*-------------------------------------------------------------------------
@@ -5141,18 +5146,18 @@ error:
} /* test_man_fill_recursive_indirect_row() */
/*-------------------------------------------------------------------------
- * Function: test_man_start_2nd_recursive_indirect
+ * Function: test_man_start_2nd_recursive_indirect
*
- * Purpose: Test inserting mult. objects into absolute heap, creating
+ * Purpose: Test inserting mult. objects into absolute heap, creating
* enough direct blocks to fill all direct rows of root indirect
* block, fill all direct blocks in the first row of indirect
* blocks and start on first block in second row of indirect blocks
*
- * Return: Success: 0
+ * Return: Success: 0
*
- * Failure: 1
+ * Failure: 1
*
- * Programmer: Quincey Koziol
+ * Programmer: Quincey Koziol
* Monday, March 27, 2006
*
*-------------------------------------------------------------------------
@@ -5250,18 +5255,18 @@ error:
} /* test_man_start_2nd_recursive_indirect() */
/*-------------------------------------------------------------------------
- * Function: test_man_recursive_indirect_two_deep
+ * Function: test_man_recursive_indirect_two_deep
*
- * Purpose: Test inserting mult. objects into absolute heap, creating
+ * Purpose: Test inserting mult. objects into absolute heap, creating
* enough direct blocks to fill all direct rows of root indirect
* block, fill all direct blocks in the row of indirect
* blocks that are 2 levels deep
*
- * Return: Success: 0
+ * Return: Success: 0
*
- * Failure: 1
+ * Failure: 1
*
- * Programmer: Quincey Koziol
+ * Programmer: Quincey Koziol
* Monday, March 27, 2006
*
*-------------------------------------------------------------------------
@@ -5352,19 +5357,19 @@ error:
} /* test_man_recursive_indirect_two_deep() */
/*-------------------------------------------------------------------------
- * Function: test_man_start_3rd_recursive_indirect
+ * Function: test_man_start_3rd_recursive_indirect
*
- * Purpose: Test inserting mult. objects into absolute heap, creating
+ * Purpose: Test inserting mult. objects into absolute heap, creating
* enough direct blocks to fill all direct rows of root indirect
* block, fill all direct blocks in the row of indirect
* blocks that are 2 levels deep and start first direct block
* in 3rd level of indirect blocks
*
- * Return: Success: 0
+ * Return: Success: 0
*
- * Failure: 1
+ * Failure: 1
*
- * Programmer: Quincey Koziol
+ * Programmer: Quincey Koziol
* Monday, March 27, 2006
*
*-------------------------------------------------------------------------
@@ -5462,19 +5467,19 @@ error:
} /* test_man_start_3rd_recursive_indirect() */
/*-------------------------------------------------------------------------
- * Function: test_man_fill_first_3rd_recursive_indirect
+ * Function: test_man_fill_first_3rd_recursive_indirect
*
- * Purpose: Test inserting mult. objects into absolute heap, creating
+ * Purpose: Test inserting mult. objects into absolute heap, creating
* enough direct blocks to fill all direct rows of root indirect
* block, fill all direct blocks in the row of indirect
* blocks that are 2 levels deep and fill first indirect block
* in 3rd level of indirect blocks
*
- * Return: Success: 0
+ * Return: Success: 0
*
- * Failure: 1
+ * Failure: 1
*
- * Programmer: Quincey Koziol
+ * Programmer: Quincey Koziol
* Monday, March 27, 2006
*
*-------------------------------------------------------------------------
@@ -5573,19 +5578,19 @@ error:
} /* test_man_fill_first_3rd_recursive_indirect() */
/*-------------------------------------------------------------------------
- * Function: test_man_fill_3rd_recursive_indirect_row
+ * Function: test_man_fill_3rd_recursive_indirect_row
*
- * Purpose: Test inserting mult. objects into absolute heap, creating
+ * Purpose: Test inserting mult. objects into absolute heap, creating
* enough direct blocks to fill all direct rows of root indirect
* block, fill all direct blocks in the row of indirect
* blocks that are 2 levels deep and fill all indirect blocks
* first row of 3rd level of indirect blocks
*
- * Return: Success: 0
+ * Return: Success: 0
*
- * Failure: 1
+ * Failure: 1
*
- * Programmer: Quincey Koziol
+ * Programmer: Quincey Koziol
* Monday, March 27, 2006
*
*-------------------------------------------------------------------------
@@ -5681,19 +5686,19 @@ error:
} /* test_man_fill_3rd_recursive_indirect_row() */
/*-------------------------------------------------------------------------
- * Function: test_man_fill_all_3rd_recursive_indirect
+ * Function: test_man_fill_all_3rd_recursive_indirect
*
- * Purpose: Test inserting mult. objects into absolute heap, creating
+ * Purpose: Test inserting mult. objects into absolute heap, creating
* enough direct blocks to fill all direct rows of root indirect
* block, fill all direct blocks in the row of indirect
* blocks that are 2 levels deep and fill all indirect blocks
* that are three levels deep
*
- * Return: Success: 0
+ * Return: Success: 0
*
- * Failure: 1
+ * Failure: 1
*
- * Programmer: Quincey Koziol
+ * Programmer: Quincey Koziol
* Monday, March 27, 2006
*
*-------------------------------------------------------------------------
@@ -5789,20 +5794,20 @@ error:
} /* test_man_fill_all_3rd_recursive_indirect() */
/*-------------------------------------------------------------------------
- * Function: test_man_start_4th_recursive_indirect
+ * Function: test_man_start_4th_recursive_indirect
*
- * Purpose: Test inserting mult. objects into absolute heap, creating
+ * Purpose: Test inserting mult. objects into absolute heap, creating
* enough direct blocks to fill all direct rows of root indirect
* block, fill all direct blocks in the row of indirect
* blocks that are 2 levels deep, fill all indirect blocks
* that are three levels deep and start first direct block that
* is four levels deep
*
- * Return: Success: 0
+ * Return: Success: 0
*
- * Failure: 1
+ * Failure: 1
*
- * Programmer: Quincey Koziol
+ * Programmer: Quincey Koziol
* Monday, March 27, 2006
*
*-------------------------------------------------------------------------
@@ -5904,20 +5909,20 @@ error:
} /* test_man_start_4th_recursive_indirect() */
/*-------------------------------------------------------------------------
- * Function: test_man_fill_first_4th_recursive_indirect
+ * Function: test_man_fill_first_4th_recursive_indirect
*
- * Purpose: Test inserting mult. objects into absolute heap, creating
+ * Purpose: Test inserting mult. objects into absolute heap, creating
* enough direct blocks to fill all direct rows of root indirect
* block, fill all direct blocks in the row of indirect
* blocks that are 2 levels deep, fill all indirect blocks
* that are three levels deep and fill the first (3rd level)
* indirect block that is four levels deep
*
- * Return: Success: 0
+ * Return: Success: 0
*
- * Failure: 1
+ * Failure: 1
*
- * Programmer: Quincey Koziol
+ * Programmer: Quincey Koziol
* Monday, March 27, 2006
*
*-------------------------------------------------------------------------
@@ -6025,20 +6030,20 @@ error:
} /* test_man_fill_first_4th_recursive_indirect() */
/*-------------------------------------------------------------------------
- * Function: test_man_fill_4th_recursive_indirect_row
+ * Function: test_man_fill_4th_recursive_indirect_row
*
- * Purpose: Test inserting mult. objects into absolute heap, creating
+ * Purpose: Test inserting mult. objects into absolute heap, creating
* enough direct blocks to fill all direct rows of root indirect
* block, fill all direct blocks in the row of indirect
* blocks that are 2 levels deep, fill all indirect blocks
* that are three levels deep and fill the first row of
* indirect block that is four levels deep
*
- * Return: Success: 0
+ * Return: Success: 0
*
- * Failure: 1
+ * Failure: 1
*
- * Programmer: Quincey Koziol
+ * Programmer: Quincey Koziol
* Monday, March 27, 2006
*
*-------------------------------------------------------------------------
@@ -6137,20 +6142,20 @@ error:
} /* test_man_fill_4th_recursive_indirect_row() */
/*-------------------------------------------------------------------------
- * Function: test_man_fill_all_4th_recursive_indirect
+ * Function: test_man_fill_all_4th_recursive_indirect
*
- * Purpose: Test inserting mult. objects into absolute heap, creating
+ * Purpose: Test inserting mult. objects into absolute heap, creating
* enough direct blocks to fill all direct rows of root indirect
* block, fill all direct blocks in the row of indirect
* blocks that are 2 levels deep, fill all indirect blocks
* that are three levels deep and fill all rows of
* indirect blocks that are four levels deep
*
- * Return: Success: 0
+ * Return: Success: 0
*
- * Failure: 1
+ * Failure: 1
*
- * Programmer: Quincey Koziol
+ * Programmer: Quincey Koziol
* Monday, March 27, 2006
*
*-------------------------------------------------------------------------
@@ -6249,12 +6254,10 @@ error:
} /* test_man_fill_all_4th_recursive_indirect() */
#endif /* ALL_INSERT_TESTS */
-#ifndef QAK
-
/*-------------------------------------------------------------------------
- * Function: test_man_start_5th_recursive_indirect
+ * Function: test_man_start_5th_recursive_indirect
*
- * Purpose: Test inserting mult. objects into absolute heap, creating
+ * Purpose: Test inserting mult. objects into absolute heap, creating
* enough direct blocks to fill all direct rows of root indirect
* block, fill all direct blocks in the row of indirect
* blocks that are 2 levels deep, fill all indirect blocks
@@ -6262,11 +6265,11 @@ error:
* that are four levels deep and start first direct block in
* indirect blocks five levels deep
*
- * Return: Success: 0
+ * Return: Success: 0
*
- * Failure: 1
+ * Failure: 1
*
- * Programmer: Quincey Koziol
+ * Programmer: Quincey Koziol
* Monday, March 27, 2006
*
*-------------------------------------------------------------------------
@@ -6383,20 +6386,17 @@ error:
H5E_END_TRY;
return (1);
} /* test_man_start_5th_recursive_indirect() */
-#endif /* QAK */
-
-#ifndef QAK
/*-------------------------------------------------------------------------
- * Function: test_man_remove_bogus
+ * Function: test_man_remove_bogus
*
- * Purpose: Test removing bogus heap IDs
+ * Purpose: Test removing bogus heap IDs
*
- * Return: Success: 0
+ * Return: Success: 0
*
- * Failure: 1
+ * Failure: 1
*
- * Programmer: Quincey Koziol
+ * Programmer: Quincey Koziol
* Monday, May 15, 2006
*
*-------------------------------------------------------------------------
@@ -6462,10 +6462,10 @@ test_man_remove_bogus(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tpa
/* Choose random # seed */
seed = (unsigned long)HDtime(NULL);
-#ifdef QAK
- /* seed = (unsigned long)1155438845; */
- HDfprintf(stderr, "Random # seed was: %lu\n", seed);
-#endif /* QAK */
+#if 0
+/* seed = (unsigned long)1155438845; */
+HDfprintf(stderr, "Random # seed was: %lu\n", seed);
+#endif
HDsrandom((unsigned)seed);
/* Set heap ID to random (non-null) value */
@@ -6548,15 +6548,15 @@ error:
} /* test_man_remove_bogus() */
/*-------------------------------------------------------------------------
- * Function: test_man_remove_one
+ * Function: test_man_remove_one
*
- * Purpose: Test removing single object from heap
+ * Purpose: Test removing single object from heap
*
- * Return: Success: 0
+ * Return: Success: 0
*
- * Failure: 1
+ * Failure: 1
*
- * Programmer: Quincey Koziol
+ * Programmer: Quincey Koziol
* Monday, May 15, 2006
*
*-------------------------------------------------------------------------
@@ -6712,15 +6712,15 @@ error:
} /* test_man_remove_one() */
/*-------------------------------------------------------------------------
- * Function: test_man_remove_two
+ * Function: test_man_remove_two
*
- * Purpose: Test removing two objects from heap
+ * Purpose: Test removing two objects from heap
*
- * Return: Success: 0
+ * Return: Success: 0
*
- * Failure: 1
+ * Failure: 1
*
- * Programmer: Quincey Koziol
+ * Programmer: Quincey Koziol
* Monday, May 22, 2006
*
*-------------------------------------------------------------------------
@@ -6905,16 +6905,16 @@ error:
} /* test_man_remove_two() */
/*-------------------------------------------------------------------------
- * Function: test_man_remove_one_larger
+ * Function: test_man_remove_one_larger
*
- * Purpose: Test removing single larger (but < standalone size) object
+ * Purpose: Test removing single larger (but < standalone size) object
* from heap
*
- * Return: Success: 0
+ * Return: Success: 0
*
- * Failure: 1
+ * Failure: 1
*
- * Programmer: Quincey Koziol
+ * Programmer: Quincey Koziol
* Tuesday, June 6, 2006
*
*-------------------------------------------------------------------------
@@ -7074,16 +7074,16 @@ error:
} /* test_man_remove_one_larger() */
/*-------------------------------------------------------------------------
- * Function: test_man_remove_two_larger
+ * Function: test_man_remove_two_larger
*
- * Purpose: Test removing two larger (but < standalone size) objects
+ * Purpose: Test removing two larger (but < standalone size) objects
* from heap
*
- * Return: Success: 0
+ * Return: Success: 0
*
- * Failure: 1
+ * Failure: 1
*
- * Programmer: Quincey Koziol
+ * Programmer: Quincey Koziol
* Saturday, June 10, 2006
*
*-------------------------------------------------------------------------
@@ -7293,11 +7293,7 @@ test_man_remove_two_larger(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t
if ((file_size = h5_get_file_size(filename, fapl)) < 0)
TEST_ERROR
- /* Verify the file is correct size */
-#ifdef QAK
- HDfprintf(stderr, "empty_size = %lu\n", (unsigned long)empty_size);
- HDfprintf(stderr, "file_size = %lu\n", (unsigned long)file_size);
-#endif /* QAK */
+ /* Verify the file is correct size */
if (file_size != empty_size)
TEST_ERROR
@@ -7318,16 +7314,16 @@ error:
} /* test_man_remove_two_larger() */
/*-------------------------------------------------------------------------
- * Function: test_man_remove_three_larger
+ * Function: test_man_remove_three_larger
*
- * Purpose: Test removing three larger (but < standalone size) objects
+ * Purpose: Test removing three larger (but < standalone size) objects
* from heap
*
- * Return: Success: 0
+ * Return: Success: 0
*
- * Failure: 1
+ * Failure: 1
*
- * Programmer: Quincey Koziol
+ * Programmer: Quincey Koziol
* Monday, June 12, 2006
*
*-------------------------------------------------------------------------
@@ -7597,11 +7593,7 @@ test_man_remove_three_larger(hid_t fapl, H5HF_create_t *cparam, fheap_test_param
if ((file_size = h5_get_file_size(filename, fapl)) < 0)
TEST_ERROR
- /* Verify the file is correct size */
-#ifdef QAK
- HDfprintf(stderr, "empty_size = %lu\n", (unsigned long)empty_size);
- HDfprintf(stderr, "file_size = %lu\n", (unsigned long)file_size);
-#endif /* QAK */
+ /* Verify the file is correct size */
if (file_size != empty_size)
TEST_ERROR
@@ -7622,14 +7614,14 @@ error:
} /* test_man_remove_three_larger() */
/*-------------------------------------------------------------------------
- * Function: test_man_incr_insert_remove
+ * Function: test_man_incr_insert_remove
*
- * Purpose: Test incremental insert & removal of objects in heap
+ * Purpose: Test incremental insert & removal of objects in heap
*
- * Return: Success: 0
- * Failure: 1
+ * Return: Success: 0
+ * Failure: 1
*
- * Programmer: Quincey Koziol
+ * Programmer: Quincey Koziol
* Sunday, April 1, 2012
*
*-------------------------------------------------------------------------
@@ -7748,21 +7740,18 @@ error:
return 1;
} /* test_man_incr_insert_remove() */
-#endif /* QAK */
-
-#ifndef QAK
/*-------------------------------------------------------------------------
- * Function: test_man_remove_root_direct
+ * Function: test_man_remove_root_direct
*
- * Purpose: Test filling and removing all objects from root direct block in
+ * Purpose: Test filling and removing all objects from root direct block in
* heap
*
- * Return: Success: 0
+ * Return: Success: 0
*
- * Failure: 1
+ * Failure: 1
*
- * Programmer: Quincey Koziol
+ * Programmer: Quincey Koziol
* Monday, May 22, 2006
*
*-------------------------------------------------------------------------
@@ -7779,8 +7768,8 @@ test_man_remove_root_direct(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_
h5_stat_size_t empty_size; /* Size of a file with an empty heap */
size_t fill_size; /* Size of objects for "bulk" filled blocks */
fheap_heap_state_t state; /* State of fractal heap */
- const char * base_desc =
- "removing all objects from root direct block of absolute heap %s"; /* Test description */
+ /* Test description */
+ const char *base_desc = "removing all objects from root direct block of absolute heap %s";
/* Perform common test initialization operations */
if (begin_test(tparam, base_desc, &keep_ids, &fill_size) < 0)
@@ -7826,16 +7815,16 @@ error:
} /* test_man_remove_root_direct() */
/*-------------------------------------------------------------------------
- * Function: test_man_remove_two_direct
+ * Function: test_man_remove_two_direct
*
- * Purpose: Test filling and removing all objects from (first) two direct
+ * Purpose: Test filling and removing all objects from (first) two direct
* blocks in heap
*
- * Return: Success: 0
+ * Return: Success: 0
*
- * Failure: 1
+ * Failure: 1
*
- * Programmer: Quincey Koziol
+ * Programmer: Quincey Koziol
* Monday, May 22, 2006
*
*-------------------------------------------------------------------------
@@ -7852,8 +7841,8 @@ test_man_remove_two_direct(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t
h5_stat_size_t empty_size; /* Size of a file with an empty heap */
size_t fill_size; /* Size of objects for "bulk" filled blocks */
fheap_heap_state_t state; /* State of fractal heap */
- const char * base_desc =
- "removing all objects from two direct blocks of absolute heap %s"; /* Test description */
+ /* Test description */
+ const char *base_desc = "removing all objects from two direct blocks of absolute heap %s";
/* Perform common test initialization operations */
if (begin_test(tparam, base_desc, &keep_ids, &fill_size) < 0)
@@ -7914,16 +7903,16 @@ error:
} /* test_man_remove_two_direct() */
/*-------------------------------------------------------------------------
- * Function: test_man_remove_first_row
+ * Function: test_man_remove_first_row
*
- * Purpose: Test filling and removing all objects from first row of direct
+ * Purpose: Test filling and removing all objects from first row of direct
* blocks in heap
*
- * Return: Success: 0
+ * Return: Success: 0
*
- * Failure: 1
+ * Failure: 1
*
- * Programmer: Quincey Koziol
+ * Programmer: Quincey Koziol
* Monday, June 5, 2006
*
*-------------------------------------------------------------------------
@@ -7940,8 +7929,8 @@ test_man_remove_first_row(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t
h5_stat_size_t empty_size; /* Size of a file with an empty heap */
size_t fill_size; /* Size of objects for "bulk" filled blocks */
fheap_heap_state_t state; /* State of fractal heap */
- const char * base_desc =
- "removing all objects from first row of direct blocks of absolute heap %s"; /* Test description */
+ /* Test description */
+ const char *base_desc = "removing all objects from first row of direct blocks of absolute heap %s";
/* Perform common test initialization operations */
if (begin_test(tparam, base_desc, &keep_ids, &fill_size) < 0)
@@ -7984,16 +7973,16 @@ error:
} /* test_man_remove_first_row() */
/*-------------------------------------------------------------------------
- * Function: test_man_remove_first_two_rows
+ * Function: test_man_remove_first_two_rows
*
- * Purpose: Test filling and removing all objects from first two rows of
+ * Purpose: Test filling and removing all objects from first two rows of
* direct blocks in heap
*
- * Return: Success: 0
+ * Return: Success: 0
*
- * Failure: 1
+ * Failure: 1
*
- * Programmer: Quincey Koziol
+ * Programmer: Quincey Koziol
* Monday, June 12, 2006
*
*-------------------------------------------------------------------------
@@ -8010,9 +7999,8 @@ test_man_remove_first_two_rows(hid_t fapl, H5HF_create_t *cparam, fheap_test_par
h5_stat_size_t empty_size; /* Size of a file with an empty heap */
size_t fill_size; /* Size of objects for "bulk" filled blocks */
fheap_heap_state_t state; /* State of fractal heap */
- const char * base_desc =
- "removing all objects from first two rows of direct blocks of absolute heap %s"; /* Test description
- */
+ /* Test description */
+ const char *base_desc = "removing all objects from first two rows of direct blocks of absolute heap %s";
/* Perform common test initialization operations */
if (begin_test(tparam, base_desc, &keep_ids, &fill_size) < 0)
@@ -8057,16 +8045,16 @@ error:
} /* test_man_remove_first_two_rows() */
/*-------------------------------------------------------------------------
- * Function: test_man_remove_first_four_rows
+ * Function: test_man_remove_first_four_rows
*
- * Purpose: Test filling and removing all objects from first four rows of
+ * Purpose: Test filling and removing all objects from first four rows of
* direct blocks in heap
*
- * Return: Success: 0
+ * Return: Success: 0
*
- * Failure: 1
+ * Failure: 1
*
- * Programmer: Quincey Koziol
+ * Programmer: Quincey Koziol
* Tuesday, June 13, 2006
*
*-------------------------------------------------------------------------
@@ -8083,9 +8071,8 @@ test_man_remove_first_four_rows(hid_t fapl, H5HF_create_t *cparam, fheap_test_pa
h5_stat_size_t empty_size; /* Size of a file with an empty heap */
size_t fill_size; /* Size of objects for "bulk" filled blocks */
fheap_heap_state_t state; /* State of fractal heap */
- const char * base_desc =
- "removing all objects from first four rows of direct blocks of absolute heap %s"; /* Test description
- */
+ /* Test description */
+ const char *base_desc = "removing all objects from first four rows of direct blocks of absolute heap %s";
/* Perform common test initialization operations */
if (begin_test(tparam, base_desc, &keep_ids, &fill_size) < 0)
@@ -8134,16 +8121,16 @@ error:
} /* test_man_remove_first_four_rows() */
/*-------------------------------------------------------------------------
- * Function: test_man_remove_all_root_direct
+ * Function: test_man_remove_all_root_direct
*
- * Purpose: Test filling and removing all objects from all direct blocks
+ * Purpose: Test filling and removing all objects from all direct blocks
* in root indirect block of heap
*
- * Return: Success: 0
+ * Return: Success: 0
*
- * Failure: 1
+ * Failure: 1
*
- * Programmer: Quincey Koziol
+ * Programmer: Quincey Koziol
* Tuesday, June 13, 2006
*
*-------------------------------------------------------------------------
@@ -8160,9 +8147,8 @@ test_man_remove_all_root_direct(hid_t fapl, H5HF_create_t *cparam, fheap_test_pa
h5_stat_size_t empty_size; /* Size of a file with an empty heap */
size_t fill_size; /* Size of objects for "bulk" filled blocks */
fheap_heap_state_t state; /* State of fractal heap */
- const char * base_desc =
- "removing all objects from all direct blocks of root group in absolute heap %s"; /* Test description
- */
+ /* Test description */
+ const char *base_desc = "removing all objects from all direct blocks of root group in absolute heap %s";
/* Perform common test initialization operations */
if (begin_test(tparam, base_desc, &keep_ids, &fill_size) < 0)
@@ -8205,16 +8191,16 @@ error:
} /* test_man_remove_all_root_direct() */
/*-------------------------------------------------------------------------
- * Function: test_man_remove_2nd_indirect
+ * Function: test_man_remove_2nd_indirect
*
- * Purpose: Test filling and removing all objects up to 2nd level indirect
+ * Purpose: Test filling and removing all objects up to 2nd level indirect
* blocks of heap
*
- * Return: Success: 0
+ * Return: Success: 0
*
- * Failure: 1
+ * Failure: 1
*
- * Programmer: Quincey Koziol
+ * Programmer: Quincey Koziol
* Tuesday, June 13, 2006
*
*-------------------------------------------------------------------------
@@ -8231,8 +8217,8 @@ test_man_remove_2nd_indirect(hid_t fapl, H5HF_create_t *cparam, fheap_test_param
h5_stat_size_t empty_size; /* Size of a file with an empty heap */
size_t fill_size; /* Size of objects for "bulk" filled blocks */
fheap_heap_state_t state; /* State of fractal heap */
- const char * base_desc =
- "removing all objects from 2nd level indirect blocks of absolute heap %s"; /* Test description */
+ /* Test description */
+ const char *base_desc = "removing all objects from 2nd level indirect blocks of absolute heap %s";
/* Perform common test initialization operations */
if (begin_test(tparam, base_desc, &keep_ids, &fill_size) < 0)
@@ -8279,16 +8265,16 @@ error:
} /* test_man_remove_2nd_indirect() */
/*-------------------------------------------------------------------------
- * Function: test_man_remove_3rd_indirect
+ * Function: test_man_remove_3rd_indirect
*
- * Purpose: Test filling and removing all objects up to 3rd level indirect
+ * Purpose: Test filling and removing all objects up to 3rd level indirect
* blocks of heap
*
- * Return: Success: 0
+ * Return: Success: 0
*
- * Failure: 1
+ * Failure: 1
*
- * Programmer: Quincey Koziol
+ * Programmer: Quincey Koziol
* Monday, July 24, 2006
*
*-------------------------------------------------------------------------
@@ -8305,8 +8291,8 @@ test_man_remove_3rd_indirect(hid_t fapl, H5HF_create_t *cparam, fheap_test_param
h5_stat_size_t empty_size; /* Size of a file with an empty heap */
size_t fill_size; /* Size of objects for "bulk" filled blocks */
fheap_heap_state_t state; /* State of fractal heap */
- const char * base_desc =
- "removing all objects from 3rd level indirect blocks of absolute heap %s"; /* Test description */
+ /* Test description */
+ const char *base_desc = "removing all objects from 3rd level indirect blocks of absolute heap %s";
/* Perform common test initialization operations */
if (begin_test(tparam, base_desc, &keep_ids, &fill_size) < 0)
@@ -8355,24 +8341,21 @@ error:
H5E_END_TRY;
return (1);
} /* test_man_remove_3rd_indirect() */
-#endif /* QAK */
-
-#ifndef QAK
/*-------------------------------------------------------------------------
- * Function: test_man_skip_start_block
+ * Function: test_man_skip_start_block
*
- * Purpose: Test inserting object into absolute heap which is too large
+ * Purpose: Test inserting object into absolute heap which is too large
* for starting block size, which forces root indirect block
* creation
*
* Then, remove all the objects, in various ways
*
- * Return: Success: 0
+ * Return: Success: 0
*
- * Failure: 1
+ * Failure: 1
*
- * Programmer: Quincey Koziol
+ * Programmer: Quincey Koziol
* Monday, March 27, 2006
*
*-------------------------------------------------------------------------
@@ -8389,9 +8372,9 @@ test_man_skip_start_block(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t
h5_stat_size_t empty_size; /* Size of a file with an empty heap */
size_t obj_size; /* Size of object */
fheap_heap_state_t state; /* State of fractal heap */
- const char * base_desc =
- "inserting object that is too large for starting block, then remove all objects %s"; /* Test
- description */
+ /* Test description */
+ const char *base_desc =
+ "inserting object that is too large for starting block, then remove all objects %s";
/* Perform common test initialization operations */
if (begin_test(tparam, base_desc, &keep_ids, NULL) < 0)
@@ -8441,17 +8424,17 @@ error:
} /* test_man_skip_start_block() */
/*-------------------------------------------------------------------------
- * Function: test_man_skip_start_block_add_back
+ * Function: test_man_skip_start_block_add_back
*
- * Purpose: Test inserting object into absolute heap which is too large
+ * Purpose: Test inserting object into absolute heap which is too large
* for starting block size, which forces root indirect block
* creation, then add object which fits in skipped direct block
*
- * Return: Success: 0
+ * Return: Success: 0
*
- * Failure: 1
+ * Failure: 1
*
- * Programmer: Quincey Koziol
+ * Programmer: Quincey Koziol
* Tuesday, March 28, 2006
*
*-------------------------------------------------------------------------
@@ -8468,10 +8451,9 @@ test_man_skip_start_block_add_back(hid_t fapl, H5HF_create_t *cparam, fheap_test
h5_stat_size_t empty_size; /* Size of a file with an empty heap */
size_t obj_size; /* Size of object */
fheap_heap_state_t state; /* State of fractal heap */
- const char *base_desc = "skipping starting block, then adding object back to first block, then remove "
- "all objects %s"; /* Test
- description
- */
+ /* Test description */
+ const char *base_desc =
+ "skipping starting block, then adding object back to first block, then remove all objects %s";
/* Perform common test initialization operations */
if (begin_test(tparam, base_desc, &keep_ids, NULL) < 0)
@@ -8540,18 +8522,18 @@ error:
} /* test_man_skip_start_block_add_back() */
/*-------------------------------------------------------------------------
- * Function: test_man_skip_start_block_add_skipped
+ * Function: test_man_skip_start_block_add_skipped
*
- * Purpose: Test inserting object into absolute heap which is too large
+ * Purpose: Test inserting object into absolute heap which is too large
* for starting block size, which forces root indirect block
* creation, then add objects to fill skipped direct blocks
* and add another object to start on next "normal" block
*
- * Return: Success: 0
+ * Return: Success: 0
*
- * Failure: 1
+ * Failure: 1
*
- * Programmer: Quincey Koziol
+ * Programmer: Quincey Koziol
* Tuesday, March 28, 2006
*
*-------------------------------------------------------------------------
@@ -8569,8 +8551,9 @@ test_man_skip_start_block_add_skipped(hid_t fapl, H5HF_create_t *cparam, fheap_t
size_t obj_size; /* Size of object */
size_t fill_size; /* Size of objects for "bulk" filled blocks */
fheap_heap_state_t state; /* State of fractal heap */
- const char *base_desc = "skipping starting block, then adding objects to backfill and extend, then "
- "remove all objects %s"; /* Test description */
+ /* Test description */
+ const char *base_desc =
+ "skipping starting block, then adding objects to backfill and extend, then remove all objects %s";
/* Perform common test initialization operations */
if (begin_test(tparam, base_desc, &keep_ids, &fill_size) < 0)
@@ -8649,18 +8632,18 @@ error:
} /* test_man_skip_start_block_add_skipped() */
/*-------------------------------------------------------------------------
- * Function: test_man_skip_2nd_block
+ * Function: test_man_skip_2nd_block
*
- * Purpose: Test inserting object into absolute heap which is small
+ * Purpose: Test inserting object into absolute heap which is small
* enough for starting block size, then add object too large
* for any blocks in first row of direct blocks, to force
* early creation of indirect block (and range of skipped blocks)
*
- * Return: Success: 0
+ * Return: Success: 0
*
- * Failure: 1
+ * Failure: 1
*
- * Programmer: Quincey Koziol
+ * Programmer: Quincey Koziol
* Saturday, April 1, 2006
*
*-------------------------------------------------------------------------
@@ -8677,8 +8660,9 @@ test_man_skip_2nd_block(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *t
h5_stat_size_t empty_size; /* Size of a file with an empty heap */
size_t obj_size; /* Size of object */
fheap_heap_state_t state; /* State of fractal heap */
+ /* Test description */
const char *base_desc = "insert object to initial block, then add object too large for starting direct "
- "blocks, then remove all objects %s"; /* Test description */
+ "blocks, then remove all objects %s";
/* Perform common test initialization operations */
if (begin_test(tparam, base_desc, &keep_ids, NULL) < 0)
@@ -8742,9 +8726,9 @@ error:
} /* test_man_skip_2nd_block() */
/*-------------------------------------------------------------------------
- * Function: test_man_skip_2nd_block_add_skipped
+ * Function: test_man_skip_2nd_block_add_skipped
*
- * Purpose: Test inserting object into absolute heap which is small
+ * Purpose: Test inserting object into absolute heap which is small
* enough for starting block size, then add object too large
* for any blocks in first row of direct blocks, to force
* early creation of indirect block (and range of skipped blocks).
@@ -8752,11 +8736,11 @@ error:
* block and all the skipped blocks, and one more object (to
* start next "normal" block).
*
- * Return: Success: 0
+ * Return: Success: 0
*
- * Failure: 1
+ * Failure: 1
*
- * Programmer: Quincey Koziol
+ * Programmer: Quincey Koziol
* Saturday, April 1, 2006
*
*-------------------------------------------------------------------------
@@ -8774,10 +8758,10 @@ test_man_skip_2nd_block_add_skipped(hid_t fapl, H5HF_create_t *cparam, fheap_tes
size_t obj_size; /* Size of object */
size_t fill_size; /* Size of objects for "bulk" filled blocks */
fheap_heap_state_t state; /* State of fractal heap */
- const char * base_desc =
- "insert object to initial block, then add object too large for starting direct blocks, then backfill "
- "and extend, then remove all objects %s"; /* Test description */
- unsigned v; /* Local index variables */
+ unsigned v; /* Local index variables */
+ /* Test description */
+ const char *base_desc = "insert object to initial block, then add object too large for starting direct "
+ "blocks, then backfill and extend, then remove all objects %s";
/* Perform common test initialization operations */
if (begin_test(tparam, base_desc, &keep_ids, &fill_size) < 0)
@@ -8885,9 +8869,9 @@ error:
} /* test_man_skip_2nd_block_add_skipped() */
/*-------------------------------------------------------------------------
- * Function: test_man_fill_one_partial_skip_2nd_block_add_skipped
+ * Function: test_man_fill_one_partial_skip_2nd_block_add_skipped
*
- * Purpose: Test filling initial direct block, then add object small enough
+ * Purpose: Test filling initial direct block, then add object small enough
* for initial block size (to create root indirect block), then
* add object too large for any blocks in first three rows of
* direct blocks, to force extension of indirect block (and range
@@ -8897,11 +8881,11 @@ error:
* block and all the skipped blocks, and one more object (to
* start next "normal" block).
*
- * Return: Success: 0
+ * Return: Success: 0
*
- * Failure: 1
+ * Failure: 1
*
- * Programmer: Quincey Koziol
+ * Programmer: Quincey Koziol
* Monday, April 3, 2006
*
*-------------------------------------------------------------------------
@@ -8920,11 +8904,10 @@ test_man_fill_one_partial_skip_2nd_block_add_skipped(hid_t fapl, H5HF_create_t *
size_t obj_size; /* Size of object */
size_t fill_size; /* Size of objects for "bulk" filled blocks */
fheap_heap_state_t state; /* State of fractal heap */
- const char *base_desc = "skipping blocks with indirect root, then backfill and extend, then remove all "
- "objects %s"; /* Test
- description
- */
- unsigned u; /* Local index variable */
+ unsigned u; /* Local index variable */
+ /* Test description */
+ const char *base_desc =
+ "skipping blocks with indirect root, then backfill and extend, then remove all objects %s";
/* Perform common test initialization operations */
if (begin_test(tparam, base_desc, &keep_ids, &fill_size) < 0)
@@ -9054,9 +9037,9 @@ error:
} /* test_man_fill_one_partial_skip_2nd_block_add_skipped() */
/*-------------------------------------------------------------------------
- * Function: test_man_fill_row_skip_add_skipped
+ * Function: test_man_fill_row_skip_add_skipped
*
- * Purpose: Test filling first row of direct blocks, then
+ * Purpose: Test filling first row of direct blocks, then
* add object too large for any blocks in first three rows of
* direct blocks, to force extension of indirect block (and range
* of skipped blocks).
@@ -9065,11 +9048,11 @@ error:
* block and all the skipped blocks, and one more object (to
* start next "normal" block).
*
- * Return: Success: 0
+ * Return: Success: 0
*
- * Failure: 1
+ * Failure: 1
*
- * Programmer: Quincey Koziol
+ * Programmer: Quincey Koziol
* Monday, May 15, 2006
*
*-------------------------------------------------------------------------
@@ -9087,10 +9070,9 @@ test_man_fill_row_skip_add_skipped(hid_t fapl, H5HF_create_t *cparam, fheap_test
size_t obj_size; /* Size of object */
size_t fill_size; /* Size of objects for "bulk" filled blocks */
fheap_heap_state_t state; /* State of fractal heap */
- const char *base_desc = "filling first row, then skipping rows, then backfill and extend, then remove "
- "all objects %s"; /* Test
- description
- */
+ /* Test description */
+ const char *base_desc =
+ "filling first row, then skipping rows, then backfill and extend, then remove all objects %s";
/* Perform common test initialization operations */
if (begin_test(tparam, base_desc, &keep_ids, &fill_size) < 0)
@@ -9185,19 +9167,19 @@ error:
} /* test_man_fill_row_skip_add_skipped() */
/*-------------------------------------------------------------------------
- * Function: test_man_skip_direct_skip_indirect_two_rows_add_skipped
+ * Function: test_man_skip_direct_skip_indirect_two_rows_add_skipped
*
- * Purpose: Test adding object too large for all but the last row in the
+ * Purpose: Test adding object too large for all but the last row in the
* direct blocks in root indirect block, then
* add object too large for initial block in first two rows of
* indirect blocks, to force extension of non-root
* indirect block (and range of skipped blocks).
*
- * Return: Success: 0
+ * Return: Success: 0
*
- * Failure: 1
+ * Failure: 1
*
- * Programmer: Quincey Koziol
+ * Programmer: Quincey Koziol
* Saturday, April 15, 2006
*
*-------------------------------------------------------------------------
@@ -9217,10 +9199,10 @@ test_man_skip_direct_skip_indirect_two_rows_add_skipped(hid_t fapl, H5HF_create_
h5_stat_size_t empty_size; /* Size of a file with an empty heap */
size_t obj_size; /* Size of object */
fheap_heap_state_t state; /* State of fractal heap */
- const char * base_desc =
- "skipping direct blocks to last row and skipping two rows of root indirect block, then backfill and "
- "extend, then remove all objects %s"; /* Test description */
- unsigned v; /* Local index variables */
+ unsigned v; /* Local index variables */
+ /* Test description */
+ const char *base_desc = "skipping direct blocks to last row and skipping two rows of root indirect "
+ "block, then backfill and extend, then remove all objects %s";
/* Perform common test initialization operations */
if (begin_test(tparam, base_desc, &keep_ids, NULL) < 0)
@@ -9314,18 +9296,18 @@ error:
} /* test_man_skip_direct_skip_indirect_two_rows_add_skipped() */
/*-------------------------------------------------------------------------
- * Function: test_man_fill_direct_skip_indirect_start_block_add_skipped
+ * Function: test_man_fill_direct_skip_indirect_start_block_add_skipped
*
- * Purpose: Test filling all direct blocks in root indirect block, then
+ * Purpose: Test filling all direct blocks in root indirect block, then
* add object too large for initial block in first row of direct
* blocks in indirect block, to force extension of non-root
* indirect block (and range of skipped blocks).
*
- * Return: Success: 0
+ * Return: Success: 0
*
- * Failure: 1
+ * Failure: 1
*
- * Programmer: Quincey Koziol
+ * Programmer: Quincey Koziol
* Monday, April 3, 2006
*
*-------------------------------------------------------------------------
@@ -9344,8 +9326,9 @@ test_man_fill_direct_skip_indirect_start_block_add_skipped(hid_t fapl, H5HF_crea
size_t obj_size; /* Size of object */
size_t fill_size; /* Size of objects for "bulk" filled blocks */
fheap_heap_state_t state; /* State of fractal heap */
+ /* Test description */
const char *base_desc = "filling direct blocks and skipping blocks in non-root indirect block, then "
- "backfill and extend, then remove all objects %s"; /* Test description */
+ "backfill and extend, then remove all objects %s";
/* Perform common test initialization operations */
if (begin_test(tparam, base_desc, &keep_ids, &fill_size) < 0)
@@ -9437,19 +9420,19 @@ error:
} /* test_man_fill_direct_skip_indirect_start_block_add_skipped() */
/*-------------------------------------------------------------------------
- * Function: test_man_fill_direct_skip_2nd_indirect_start_block_add_skipped
+ * Function: test_man_fill_direct_skip_2nd_indirect_start_block_add_skipped
*
- * Purpose: Test filling all direct blocks in root indirect block, then
+ * Purpose: Test filling all direct blocks in root indirect block, then
* add object too large for all direct blocks in first row of
* indirect blocks, to force skipping a row of indirect blocks
* (and range of skipped blocks), then backfill all direct blocks
* skipped and extend to next "normal" direct block.
*
- * Return: Success: 0
+ * Return: Success: 0
*
- * Failure: 1
+ * Failure: 1
*
- * Programmer: Quincey Koziol
+ * Programmer: Quincey Koziol
* Monday, April 3, 2006
*
*-------------------------------------------------------------------------
@@ -9464,16 +9447,17 @@ test_man_fill_direct_skip_2nd_indirect_start_block_add_skipped(hid_t fapl, H5HF_
H5HF_t * fh = NULL; /* Fractal heap wrapper */
haddr_t fh_addr; /* Address of fractal heap */
fheap_heap_ids_t keep_ids; /* Structure to retain heap IDs */
- unsigned
- num_first_indirect_rows; /* Number of rows (of direct blocks) in each of the first indirect blocks */
- unsigned row; /* Current row in indirect block */
- h5_stat_size_t empty_size; /* Size of a file with an empty heap */
- size_t obj_size; /* Size of object */
- size_t fill_size; /* Size of objects for "bulk" filled blocks */
- fheap_heap_state_t state; /* State of fractal heap */
- const char * base_desc = "filling direct blocks and skipping row of non-root indirect blocks, then "
- "backfill and extend, then remove all objects %s"; /* Test description */
- unsigned u; /* Local index variable */
+ unsigned num_first_indirect_rows; /* Number of rows (of direct blocks) in each of the */
+ /* first indirect blocks */
+ unsigned row; /* Current row in indirect block */
+ h5_stat_size_t empty_size; /* Size of a file with an empty heap */
+ size_t obj_size; /* Size of object */
+ size_t fill_size; /* Size of objects for "bulk" filled blocks */
+ fheap_heap_state_t state; /* State of fractal heap */
+ unsigned u; /* Local index variable */
+ /* Test description */
+ const char *base_desc = "filling direct blocks and skipping row of non-root indirect blocks, then "
+ "backfill and extend, then remove all objects %s";
/* Perform common test initialization operations */
if (begin_test(tparam, base_desc, &keep_ids, &fill_size) < 0)
@@ -9567,20 +9551,20 @@ error:
} /* test_man_fill_direct_skip_2nd_indirect_start_block_add_skipped() */
/*-------------------------------------------------------------------------
- * Function: test_man_fill_2nd_direct_less_one_wrap_start_block_add_skipped
+ * Function: test_man_fill_2nd_direct_less_one_wrap_start_block_add_skipped
*
- * Purpose: Test filling all direct blocks in root indirect block and all
+ * Purpose: Test filling all direct blocks in root indirect block and all
* direct blocks in 2nd level indirect blocks, except the last
* one, then insert object insert object that is too large to
* hold in row of 2nd level indirect blocks (forcing the use of
* the next row of 2nd level blocks), then backfill all skipped
* direct blocks & extend.
*
- * Return: Success: 0
+ * Return: Success: 0
*
- * Failure: 1
+ * Failure: 1
*
- * Programmer: Quincey Koziol
+ * Programmer: Quincey Koziol
* Tuesday, April 18, 2006
*
*-------------------------------------------------------------------------
@@ -9601,13 +9585,11 @@ test_man_fill_2nd_direct_less_one_wrap_start_block_add_skipped(hid_t fapl, H5HF_
size_t obj_size; /* Size of object */
size_t fill_size; /* Size of objects for "bulk" filled blocks */
fheap_heap_state_t state; /* State of fractal heap */
- const char *base_desc = "filling direct blocks, filling 2nd level indirect blocks, except last one, and "
- "insert object too "
- "large for 2nd level indirect blocks, then backfill and extend, then remove all "
- "objects %s"; /* Test
- description
- */
- unsigned u; /* Local index variables */
+ unsigned u; /* Local index variables */
+ /* Test description */
+ const char *base_desc =
+ "filling direct blocks, filling 2nd level indirect blocks, except last one, and insert object too "
+ "large for 2nd level indirect blocks, then backfill and extend, then remove all objects %s";
/* Perform common test initialization operations */
if (begin_test(tparam, base_desc, &keep_ids, &fill_size) < 0)
@@ -9643,9 +9625,6 @@ test_man_fill_2nd_direct_less_one_wrap_start_block_add_skipped(hid_t fapl, H5HF_
* object
*/
obj_size = (size_t)DBLOCK_SIZE(fh, num_first_indirect_rows - 1) + 1;
-#ifdef QAK
- HDfprintf(stderr, "obj_size = %Zu\n", obj_size);
-#endif /* QAK */
state.man_alloc_size += DBLOCK_SIZE(fh, num_first_indirect_rows);
if (add_obj(fh, (size_t)20, obj_size, &state, &keep_ids))
TEST_ERROR
@@ -9715,9 +9694,9 @@ error:
} /* test_man_fill_2nd_direct_less_one_wrap_start_block_add_skipped() */
/*-------------------------------------------------------------------------
- * Function: test_man_fill_direct_skip_2nd_indirect_skip_2nd_block_add_skipped
+ * Function: test_man_fill_direct_skip_2nd_indirect_skip_2nd_block_add_skipped
*
- * Purpose: Test filling all direct blocks in root indirect block, then
+ * Purpose: Test filling all direct blocks in root indirect block, then
* add object too large for all direct blocks in first row of
* indirect blocks, to force skipping a row of indirect blocks
* (and range of skipped blocks), then add object that is too
@@ -9727,11 +9706,11 @@ error:
* too large for initial block size in skipped indirect block
* row's direct blocks).
*
- * Return: Success: 0
+ * Return: Success: 0
*
- * Failure: 1
+ * Failure: 1
*
- * Programmer: Quincey Koziol
+ * Programmer: Quincey Koziol
* Tuesday, April 11, 2006
*
*-------------------------------------------------------------------------
@@ -9753,10 +9732,10 @@ test_man_fill_direct_skip_2nd_indirect_skip_2nd_block_add_skipped(hid_t fapl, H5
size_t obj_size; /* Size of object */
size_t fill_size; /* Size of objects for "bulk" filled blocks */
fheap_heap_state_t state; /* State of fractal heap */
- const char * base_desc =
- "filling direct blocks and skipping row of non-root indirect blocks, then skip row of direct blocks, "
- "then backfill and extend, then remove all objects %s"; /* Test description */
- unsigned u; /* Local index variable */
+ unsigned u; /* Local index variable */
+ /* Test description */
+ const char *base_desc = "filling direct blocks and skipping row of non-root indirect blocks, then skip "
+ "row of direct blocks, then backfill and extend, then remove all objects %s";
/* Perform common test initialization operations */
if (begin_test(tparam, base_desc, &keep_ids, &fill_size) < 0)
@@ -9782,9 +9761,6 @@ test_man_fill_direct_skip_2nd_indirect_skip_2nd_block_add_skipped(hid_t fapl, H5
* object
*/
obj_size = (size_t)DBLOCK_SIZE(fh, num_first_indirect_rows - 1) + 1;
-#ifdef QAK
- HDfprintf(stderr, "obj_size = %Zu\n", obj_size);
-#endif /* QAK */
state.man_alloc_size += DBLOCK_SIZE(fh, num_first_indirect_rows);
if (add_obj(fh, (size_t)20, obj_size, &state, &keep_ids))
TEST_ERROR
@@ -9804,9 +9780,6 @@ test_man_fill_direct_skip_2nd_indirect_skip_2nd_block_add_skipped(hid_t fapl, H5
/* Insert object too large for initial block size in skipped indirect blocks */
obj_size = (size_t)DBLOCK_SIZE(fh, 3) + 1;
-#ifdef QAK
- HDfprintf(stderr, "obj_size = %Zu\n", obj_size);
-#endif /* QAK */
state.man_alloc_size += DBLOCK_SIZE(fh, 4);
if (add_obj(fh, (size_t)10, obj_size, &state, &keep_ids))
TEST_ERROR
@@ -9817,9 +9790,6 @@ test_man_fill_direct_skip_2nd_indirect_skip_2nd_block_add_skipped(hid_t fapl, H5
/* Insert object to fill space in (medium) block just created */
obj_size = (size_t)DBLOCK_FREE(fh, 4) - obj_size;
-#ifdef QAK
- HDfprintf(stderr, "obj_size = %Zu\n", obj_size);
-#endif /* QAK */
if (add_obj(fh, (size_t)20, obj_size, &state, &keep_ids))
TEST_ERROR
@@ -9892,18 +9862,18 @@ error:
} /* test_man_fill_direct_skip_2nd_indirect_skip_2nd_block_add_skipped() */
/*-------------------------------------------------------------------------
- * Function: test_man_fill_direct_skip_indirect_two_rows_add_skipped
+ * Function: test_man_fill_direct_skip_indirect_two_rows_add_skipped
*
- * Purpose: Test filling all direct blocks in root indirect block, then
+ * Purpose: Test filling all direct blocks in root indirect block, then
* add object too large for initial block in first two rows of
* indirect blocks, to force extension of non-root
* indirect block (and range of skipped blocks).
*
- * Return: Success: 0
+ * Return: Success: 0
*
- * Failure: 1
+ * Failure: 1
*
- * Programmer: Quincey Koziol
+ * Programmer: Quincey Koziol
* Saturday, April 15, 2006
*
*-------------------------------------------------------------------------
@@ -9925,9 +9895,10 @@ test_man_fill_direct_skip_indirect_two_rows_add_skipped(hid_t fapl, H5HF_create_
size_t obj_size; /* Size of object */
size_t fill_size; /* Size of objects for "bulk" filled blocks */
fheap_heap_state_t state; /* State of fractal heap */
- const char * base_desc = "filling direct blocks and skipping two rows of root indirect block, then "
- "backfill and extend, then remove all objects %s"; /* Test description */
- unsigned u, v; /* Local index variables */
+ unsigned u, v; /* Local index variables */
+ /* Test description */
+ const char *base_desc = "filling direct blocks and skipping two rows of root indirect block, then "
+ "backfill and extend, then remove all objects %s";
/* Perform common test initialization operations */
if (begin_test(tparam, base_desc, &keep_ids, &fill_size) < 0)
@@ -10045,20 +10016,20 @@ error:
} /* test_man_fill_direct_skip_indirect_two_rows_add_skipped() */
/*-------------------------------------------------------------------------
- * Function: test_man_fill_direct_skip_indirect_two_rows_skip_indirect_row_add_skipped
+ * Function: test_man_fill_direct_skip_indirect_two_rows_skip_indirect_row_add_skipped
*
- * Purpose: Test filling all direct blocks in root indirect block, then
+ * Purpose: Test filling all direct blocks in root indirect block, then
* add object too large for initial block in first two rows of
* indirect blocks, to force extension of non-root
* indirect block, then add object too large for first row of
* indirect blocks, (and ranges of skipped blocks), then backfill
* and extend.
*
- * Return: Success: 0
+ * Return: Success: 0
*
- * Failure: 1
+ * Failure: 1
*
- * Programmer: Quincey Koziol
+ * Programmer: Quincey Koziol
* Tuesday, July 11, 2006
*
*-------------------------------------------------------------------------
@@ -10080,10 +10051,11 @@ test_man_fill_direct_skip_indirect_two_rows_skip_indirect_row_add_skipped(hid_t
size_t obj_size; /* Size of object */
size_t fill_size; /* Size of objects for "bulk" filled blocks */
fheap_heap_state_t state; /* State of fractal heap */
- const char * base_desc =
+ unsigned u, v; /* Local index variables */
+ /* Test description */
+ const char *base_desc =
"filling direct blocks and skipping two rows of root indirect block, skip one row of root indirect "
- "block, then backfill and extend, then remove all objects %s"; /* Test description */
- unsigned u, v; /* Local index variables */
+ "block, then backfill and extend, then remove all objects %s";
/* Perform common test initialization operations */
if (begin_test(tparam, base_desc, &keep_ids, &fill_size) < 0)
@@ -10229,19 +10201,19 @@ error:
} /* test_man_fill_direct_skip_indirect_two_rows_skip_indirect_row_add_skipped() */
/*-------------------------------------------------------------------------
- * Function: test_man_fill_2nd_direct_skip_start_block_add_skipped
+ * Function: test_man_fill_2nd_direct_skip_start_block_add_skipped
*
- * Purpose: Test filling all direct blocks in root indirect block and all
+ * Purpose: Test filling all direct blocks in root indirect block and all
* direct blocks in 2nd level indirect blocks, the insert object
* that is too large to hold in first row of direct blocks of
* 3rd level indirect block, then backfill & extend all skipped
* 3rd level indirect block's direct blocks.
*
- * Return: Success: 0
+ * Return: Success: 0
*
- * Failure: 1
+ * Failure: 1
*
- * Programmer: Quincey Koziol
+ * Programmer: Quincey Koziol
* Tuesday, April 11, 2006
*
*-------------------------------------------------------------------------
@@ -10260,10 +10232,10 @@ test_man_fill_2nd_direct_skip_start_block_add_skipped(hid_t fapl, H5HF_create_t
size_t obj_size; /* Size of object */
size_t fill_size; /* Size of objects for "bulk" filled blocks */
fheap_heap_state_t state; /* State of fractal heap */
- const char * base_desc =
+ /* Test description */
+ const char *base_desc =
"filling direct blocks, filling 2nd level indirect blocks, and skip first rows of direct blocks of "
- "3rd level indirect block, then backfill and extend, then remove all objects %s"; /* Test description
- */
+ "3rd level indirect block, then backfill and extend, then remove all objects %s";
/* Perform common test initialization operations */
if (begin_test(tparam, base_desc, &keep_ids, &fill_size) < 0)
@@ -10358,9 +10330,9 @@ error:
} /* test_man_fill_2nd_direct_skip_start_block_add_skipped() */
/*-------------------------------------------------------------------------
- * Function: test_man_fill_2nd_direct_skip_2nd_indirect_start_block_add_skipped
+ * Function: test_man_fill_2nd_direct_skip_2nd_indirect_start_block_add_skipped
*
- * Purpose: Test filling all direct blocks in root indirect block and all
+ * Purpose: Test filling all direct blocks in root indirect block and all
* direct blocks in 2nd level indirect blocks, fill all direct
* blocks in 3rd level indirect block, then insert object
* that is too large to hold in first row of direct blocks of
@@ -10368,11 +10340,11 @@ error:
* backfill & extend all skipped 2nd level indirect block's direct
* blocks.
*
- * Return: Success: 0
+ * Return: Success: 0
*
- * Failure: 1
+ * Failure: 1
*
- * Programmer: Quincey Koziol
+ * Programmer: Quincey Koziol
* Tuesday, April 11, 2006
*
*-------------------------------------------------------------------------
@@ -10391,10 +10363,11 @@ test_man_fill_2nd_direct_skip_2nd_indirect_start_block_add_skipped(hid_t fapl, H
size_t obj_size; /* Size of object */
size_t fill_size; /* Size of objects for "bulk" filled blocks */
fheap_heap_state_t state; /* State of fractal heap */
- const char * base_desc =
+ /* Test description */
+ const char *base_desc =
"filling direct blocks, filling 2nd level indirect blocks, filling 3rd level indirect block's direct "
"blocks, and skip first rows of direct blocks of 3rd level indirect block's 2nd level indirect "
- "block, then backfill and extend, then remove all objects %s"; /* Test description */
+ "block, then backfill and extend, then remove all objects %s";
/* Perform common test initialization operations */
if (begin_test(tparam, base_desc, &keep_ids, &fill_size) < 0)
@@ -10499,20 +10472,20 @@ error:
} /* test_man_fill_2nd_direct_skip_2nd_indirect_start_block_add_skipped() */
/*-------------------------------------------------------------------------
- * Function: test_man_fill_2nd_direct_fill_direct_skip_3rd_indirect_start_block_add_skipped
+ * Function: test_man_fill_2nd_direct_fill_direct_skip_3rd_indirect_start_block_add_skipped
*
- * Purpose: Test filling all direct blocks in root indirect block and all
+ * Purpose: Test filling all direct blocks in root indirect block and all
* direct blocks in 2nd level indirect blocks, fill all direct
* blocks in 3rd level indirect block, then insert object
* that is too large to hold in first row of 2nd level indirect
* blocks of 3rd level indirect block, then backfill & extend all
* skipped direct blocks.
*
- * Return: Success: 0
+ * Return: Success: 0
*
- * Failure: 1
+ * Failure: 1
*
- * Programmer: Quincey Koziol
+ * Programmer: Quincey Koziol
* Tuesday, April 11, 2006
*
*-------------------------------------------------------------------------
@@ -10534,11 +10507,11 @@ test_man_fill_2nd_direct_fill_direct_skip_3rd_indirect_start_block_add_skipped(h
size_t obj_size; /* Size of object */
size_t fill_size; /* Size of objects for "bulk" filled blocks */
fheap_heap_state_t state; /* State of fractal heap */
- const char * base_desc =
- "filling direct blocks, filling 2nd level indirect blocks, filling 3rd level indirect block's direct "
- "blocks, and skip first row of indirect blocks of 3rd level indirect block, then backfill and "
- "extend, then remove all objects %s"; /* Test description */
- unsigned u, v; /* Local index variables */
+ unsigned u, v; /* Local index variables */
+ /* Test description */
+ const char *base_desc = "filling direct blocks, filling 2nd level indirect blocks, filling 3rd level "
+ "indirect block's direct blocks, and skip first row of indirect blocks of 3rd "
+ "level indirect block, then backfill and extend, then remove all objects %s";
/* Perform common test initialization operations */
if (begin_test(tparam, base_desc, &keep_ids, &fill_size) < 0)
@@ -10580,9 +10553,6 @@ test_man_fill_2nd_direct_fill_direct_skip_3rd_indirect_start_block_add_skipped(h
* object
*/
obj_size = (size_t)DBLOCK_SIZE(fh, num_first_indirect_rows - 1) + 1;
-#ifdef QAK
- HDfprintf(stderr, "obj_size = %Zu\n", obj_size);
-#endif /* QAK */
state.man_alloc_size += DBLOCK_SIZE(fh, num_first_indirect_rows);
if (add_obj(fh, (size_t)20, obj_size, &state, &keep_ids))
TEST_ERROR
@@ -10654,21 +10624,21 @@ error:
} /* test_man_fill_2nd_direct_fill_direct_skip_3rd_indirect_start_block_add_skipped() */
/*-------------------------------------------------------------------------
- * Function: test_man_fill_2nd_direct_fill_direct_skip2_3rd_indirect_start_block_add_skipped
+ * Function: test_man_fill_2nd_direct_fill_direct_skip2_3rd_indirect_start_block_add_skipped
*
- * Purpose: Test filling all direct blocks in root indirect block and all
+ * Purpose: Test filling all direct blocks in root indirect block and all
* direct blocks in 2nd level indirect blocks, fill all direct
* blocks in 3rd level indirect block, then insert object
* that is too large to hold in first & second rows of 2nd level
* indirect blocks (although this 3rd level indirect block only
* has one row of 2nd level indirect blocks) of 3rd level indirect
- * block, then backfill & extend all skipped direct blocks.
+ * block, then backfill & extend all skipped direct blocks.
*
- * Return: Success: 0
+ * Return: Success: 0
*
- * Failure: 1
+ * Failure: 1
*
- * Programmer: Quincey Koziol
+ * Programmer: Quincey Koziol
* Tuesday, April 11, 2006
*
*-------------------------------------------------------------------------
@@ -10690,11 +10660,11 @@ test_man_fill_2nd_direct_fill_direct_skip2_3rd_indirect_start_block_add_skipped(
size_t obj_size; /* Size of object */
size_t fill_size; /* Size of objects for "bulk" filled blocks */
fheap_heap_state_t state; /* State of fractal heap */
- const char * base_desc =
- "filling direct blocks, filling 2nd level indirect blocks, filling 3rd level indirect block's direct "
- "blocks, and skip first two rows of indirect blocks of 3rd level indirect block, then backfill and "
- "extend, then remove all objects %s"; /* Test description */
- unsigned u, v; /* Local index variables */
+ unsigned u, v; /* Local index variables */
+ /* Test description */
+ const char *base_desc = "filling direct blocks, filling 2nd level indirect blocks, filling 3rd level "
+ "indirect block's direct blocks, and skip first two rows of indirect blocks of "
+ "3rd level indirect block, then backfill and extend, then remove all objects %s";
/* Perform common test initialization operations */
if (begin_test(tparam, base_desc, &keep_ids, &fill_size) < 0)
@@ -10706,9 +10676,6 @@ test_man_fill_2nd_direct_fill_direct_skip2_3rd_indirect_start_block_add_skipped(
/* Retrieve info about heap */
num_first_indirect_rows = IBLOCK_MAX_DROWS(fh, 1);
-#ifdef QAK
- HDfprintf(stderr, "num_first_indirect_rows = %u\n", num_first_indirect_rows);
-#endif /* QAK */
/* Fill direct blocks in root indirect block */
if (fill_root_direct(fh, fill_size, &state, &keep_ids))
@@ -10739,9 +10706,6 @@ test_man_fill_2nd_direct_fill_direct_skip2_3rd_indirect_start_block_add_skipped(
* object
*/
obj_size = (size_t)DBLOCK_SIZE(fh, num_first_indirect_rows) + 1;
-#ifdef QAK
- HDfprintf(stderr, "obj_size = %Zu\n", obj_size);
-#endif /* QAK */
state.man_alloc_size += DBLOCK_SIZE(fh, num_first_indirect_rows + 1);
if (add_obj(fh, (size_t)20, obj_size, &state, &keep_ids))
TEST_ERROR
@@ -10752,9 +10716,6 @@ test_man_fill_2nd_direct_fill_direct_skip2_3rd_indirect_start_block_add_skipped(
/* Insert object to fill space in (large) block created */
obj_size = (size_t)DBLOCK_FREE(fh, num_first_indirect_rows + 1) - obj_size;
-#ifdef QAK
- HDfprintf(stderr, "obj_size = %Zu\n", obj_size);
-#endif /* QAK */
if (add_obj(fh, (size_t)20, obj_size, &state, &keep_ids))
TEST_ERROR
@@ -10820,9 +10781,9 @@ error:
} /* test_man_fill_2nd_direct_fill_direct_skip2_3rd_indirect_start_block_add_skipped() */
/*-------------------------------------------------------------------------
- * Function: test_man_fill_3rd_direct_less_one_fill_direct_wrap_start_block_add_skipped
+ * Function: test_man_fill_3rd_direct_less_one_fill_direct_wrap_start_block_add_skipped
*
- * Purpose: Test filling all direct blocks in root indirect block and all
+ * Purpose: Test filling all direct blocks in root indirect block and all
* direct blocks in 2nd level indirect blocks, all 3rd level
* indirect blocks in first row except the last one, fill direct
* blocks in last 3rd level indirect block, then insert object
@@ -10831,11 +10792,11 @@ error:
* use of the next row of 3rd level blocks), then backfill all
* skipped direct blocks & extend.
*
- * Return: Success: 0
+ * Return: Success: 0
*
- * Failure: 1
+ * Failure: 1
*
- * Programmer: Quincey Koziol
+ * Programmer: Quincey Koziol
* Tues, April 18, 2006
*
*-------------------------------------------------------------------------
@@ -10856,12 +10817,12 @@ test_man_fill_3rd_direct_less_one_fill_direct_wrap_start_block_add_skipped(hid_t
size_t obj_size; /* Size of object */
size_t fill_size; /* Size of objects for "bulk" filled blocks */
fheap_heap_state_t state; /* State of fractal heap */
- const char * base_desc =
- "filling direct blocks, filling 2nd level indirect blocks, filling first row of 3rd "
- "level indirect blocks, except last one, fill all direct blocks in last 3rd level "
- "indirect block, and insert object too large for it's 2nd level indirect blocks, then "
- "backfill and extend, then remove all objects %s"; /* Test description */
- unsigned u, v; /* Local index variables */
+ unsigned u, v; /* Local index variables */
+ /* Test description */
+ const char *base_desc =
+ "filling direct blocks, filling 2nd level indirect blocks, filling first row of 3rd level indirect "
+ "blocks, except last one, fill all direct blocks in last 3rd level indirect block, and insert object "
+ "too large for it's 2nd level indirect blocks, then backfill and extend, then remove all objects %s";
/* Perform common test initialization operations */
if (begin_test(tparam, base_desc, &keep_ids, &fill_size) < 0)
@@ -10913,9 +10874,6 @@ test_man_fill_3rd_direct_less_one_fill_direct_wrap_start_block_add_skipped(hid_t
* object
*/
obj_size = (size_t)DBLOCK_SIZE(fh, num_first_indirect_rows - 1) + 1;
-#ifdef QAK
- HDfprintf(stderr, "obj_size = %Zu\n", obj_size);
-#endif /* QAK */
state.man_alloc_size += DBLOCK_SIZE(fh, num_first_indirect_rows);
if (add_obj(fh, (size_t)20, obj_size, &state, &keep_ids))
TEST_ERROR
@@ -10986,9 +10944,9 @@ error:
} /* test_man_fill_3rd_direct_less_one_fill_direct_wrap_start_block_add_skipped() */
/*-------------------------------------------------------------------------
- * Function: test_man_fill_1st_row_3rd_direct_fill_2nd_direct_less_one_wrap_start_block_add_skipped
+ * Function: test_man_fill_1st_row_3rd_direct_fill_2nd_direct_less_one_wrap_start_block_add_skipped
*
- * Purpose: Test filling all direct blocks in root indirect block and all
+ * Purpose: Test filling all direct blocks in root indirect block and all
* direct blocks in 2nd level indirect blocks, all 3rd level
* indirect blocks in first row, fill direct blocks in 2nd row 3rd
* level indirect block, fill all direct blocks in 1st row of
@@ -10998,11 +10956,11 @@ error:
* next row of 2nd level blocks), then backfill all skipped direct
* blocks & extend.
*
- * Return: Success: 0
+ * Return: Success: 0
*
- * Failure: 1
+ * Failure: 1
*
- * Programmer: Quincey Koziol
+ * Programmer: Quincey Koziol
* Tues, April 18, 2006
*
*-------------------------------------------------------------------------
@@ -11019,16 +10977,16 @@ test_man_fill_1st_row_3rd_direct_fill_2nd_direct_less_one_wrap_start_block_add_s
fheap_heap_ids_t keep_ids; /* Structure to retain heap IDs */
unsigned
num_first_indirect_rows; /* Number of rows (of direct blocks) in each of the first indirect blocks */
- h5_stat_size_t empty_size; /* Size of a file with an empty heap */
- size_t obj_size; /* Size of object */
- size_t fill_size; /* Size of objects for "bulk" filled blocks */
- fheap_heap_state_t state; /* State of fractal heap */
+ h5_stat_size_t empty_size; /* Size of a file with an empty heap */
+ size_t obj_size; /* Size of object */
+ size_t fill_size; /* Size of objects for "bulk" filled blocks */
+ fheap_heap_state_t state; /* State of fractal heap */
+ unsigned u; /* Local index variables */ /* Test description */
const char * base_desc =
"filling direct blocks, filling 2nd level indirect blocks, filling first row of 3rd level indirect "
"blocks, fill all direct blocks in next 3rd level indirect block, fill all 1st row of 2nd level "
"indirect blocks, except last one, and insert object too large for 2nd level indirect block, then "
- "backfill and extend, then remove all objects %s"; /* Test description */
- unsigned u; /* Local index variables */
+ "backfill and extend, then remove all objects %s";
/* Perform common test initialization operations */
if (begin_test(tparam, base_desc, &keep_ids, &fill_size) < 0)
@@ -11087,9 +11045,6 @@ test_man_fill_1st_row_3rd_direct_fill_2nd_direct_less_one_wrap_start_block_add_s
* object
*/
obj_size = (size_t)DBLOCK_SIZE(fh, num_first_indirect_rows - 1) + 1;
-#ifdef QAK
- HDfprintf(stderr, "obj_size = %Zu\n", obj_size);
-#endif /* QAK */
state.man_alloc_size += DBLOCK_SIZE(fh, num_first_indirect_rows);
if (add_obj(fh, (size_t)20, obj_size, &state, &keep_ids))
TEST_ERROR
@@ -11159,9 +11114,9 @@ error:
} /* test_man_fill_1st_row_3rd_direct_fill_2nd_direct_less_one_wrap_start_block_add_skipped() */
/*-------------------------------------------------------------------------
- * Function: test_man_fill_3rd_direct_fill_direct_skip_start_block_add_skipped
+ * Function: test_man_fill_3rd_direct_fill_direct_skip_start_block_add_skipped
*
- * Purpose: Test filling all direct blocks in root indirect block and all
+ * Purpose: Test filling all direct blocks in root indirect block and all
* direct blocks in 2nd level indirect blocks, fill all direct
* blocks and indirect blocks in 3rd level indirect block, then
* fill all direct blocks in 4th level indirect block, then
@@ -11169,11 +11124,11 @@ error:
* level indirect blocks of 4th level indirect block, then
* backfill all skipped direct blocks & extend.
*
- * Return: Success: 0
+ * Return: Success: 0
*
- * Failure: 1
+ * Failure: 1
*
- * Programmer: Quincey Koziol
+ * Programmer: Quincey Koziol
* Saturday, April 15, 2006
*
*-------------------------------------------------------------------------
@@ -11194,11 +11149,12 @@ test_man_fill_3rd_direct_fill_direct_skip_start_block_add_skipped(hid_t fapl, H5
size_t obj_size; /* Size of object */
size_t fill_size; /* Size of objects for "bulk" filled blocks */
fheap_heap_state_t state; /* State of fractal heap */
- const char * base_desc =
+ unsigned u, v; /* Local index variables */
+ /* Test description */
+ const char *base_desc =
"filling direct blocks, filling 2nd level indirect blocks, filling 3rd level indirect blocks, fill "
"4th level indirect block's direct blocks, and skip first row of 2nd indirect blocks of 4th level "
- "indirect block, then backfill and extend, then remove all objects %s"; /* Test description */
- unsigned u, v; /* Local index variables */
+ "indirect block, then backfill and extend, then remove all objects %s";
/* Perform common test initialization operations */
if (begin_test(tparam, base_desc, &keep_ids, &fill_size) < 0)
@@ -11248,9 +11204,6 @@ test_man_fill_3rd_direct_fill_direct_skip_start_block_add_skipped(hid_t fapl, H5
* object
*/
obj_size = (size_t)DBLOCK_SIZE(fh, num_first_indirect_rows - 1) + 1;
-#ifdef QAK
- HDfprintf(stderr, "obj_size = %Zu\n", obj_size);
-#endif /* QAK */
state.man_alloc_size += DBLOCK_SIZE(fh, num_first_indirect_rows);
if (add_obj(fh, (size_t)20, obj_size, &state, &keep_ids))
TEST_ERROR
@@ -11322,9 +11275,9 @@ error:
} /* test_man_fill_3rd_direct_fill_direct_skip_start_block_add_skipped() */
/*-------------------------------------------------------------------------
- * Function: test_man_fill_3rd_direct_fill_2nd_direct_fill_direct_skip_3rd_indirect_start_block_add_skipped
+ * Function: test_man_fill_3rd_direct_fill_2nd_direct_fill_direct_skip_3rd_indirect_start_block_add_skipped
*
- * Purpose: Test filling all direct blocks in root indirect block and all
+ * Purpose: Test filling all direct blocks in root indirect block and all
* direct blocks in 2nd level indirect blocks, fill all direct
* blocks and indirect blocks in 3rd level indirect block, then
* fill all direct blocks and 2nd level indirect blocks in 4th
@@ -11334,11 +11287,11 @@ error:
* 3rd level indirect block, then
* backfill all skipped direct blocks & extend.
*
- * Return: Success: 0
+ * Return: Success: 0
*
- * Failure: 1
+ * Failure: 1
*
- * Programmer: Quincey Koziol
+ * Programmer: Quincey Koziol
* Monday, April 17, 2006
*
*-------------------------------------------------------------------------
@@ -11359,12 +11312,13 @@ test_man_fill_3rd_direct_fill_2nd_direct_fill_direct_skip_3rd_indirect_start_blo
size_t obj_size; /* Size of object */
size_t fill_size; /* Size of objects for "bulk" filled blocks */
fheap_heap_state_t state; /* State of fractal heap */
- const char * base_desc =
+ unsigned u, v; /* Local index variables */
+ /* Test description */
+ const char *base_desc =
"filling direct blocks, filling 2nd level indirect blocks, filling 3rd level indirect blocks, fill "
"4th level indirect block's direct, 2nd level indirect blocks and 3rd level direct block, and skip "
"first row of 2nd indirect blocks of 4th level indirect block's 3rd level indirect block, then "
- "backfill and extend, then remove all objects %s"; /* Test description */
- unsigned u, v; /* Local index variables */
+ "backfill and extend, then remove all objects %s";
/* Perform common test initialization operations */
if (begin_test(tparam, base_desc, &keep_ids, &fill_size) < 0)
@@ -11430,9 +11384,6 @@ test_man_fill_3rd_direct_fill_2nd_direct_fill_direct_skip_3rd_indirect_start_blo
* object
*/
obj_size = (size_t)DBLOCK_SIZE(fh, num_first_indirect_rows - 1) + 1;
-#ifdef QAK
- HDfprintf(stderr, "obj_size = %Zu\n", obj_size);
-#endif /* QAK */
state.man_alloc_size += DBLOCK_SIZE(fh, num_first_indirect_rows);
if (add_obj(fh, (size_t)20, obj_size, &state, &keep_ids))
TEST_ERROR
@@ -11507,7 +11458,7 @@ error:
* Function:
*test_man_fill_3rd_direct_fill_2nd_direct_fill_direct_skip_3rd_indirect_two_rows_start_block_add_skipped
*
- * Purpose: Test filling all direct blocks in root indirect block and all
+ * Purpose: Test filling all direct blocks in root indirect block and all
* direct blocks in 2nd level indirect blocks, fill all direct
* blocks and indirect blocks in 3rd level indirect block, fill all
* direct & indirect blocks in first row of 4th level indirect
@@ -11519,11 +11470,11 @@ error:
* 3rd level indirect block (in 4th level indirect block), then
* backfill all skipped direct blocks & extend.
*
- * Return: Success: 0
+ * Return: Success: 0
*
- * Failure: 1
+ * Failure: 1
*
- * Programmer: Quincey Koziol
+ * Programmer: Quincey Koziol
* Monday, April 17, 2006
*
*-------------------------------------------------------------------------
@@ -11544,13 +11495,14 @@ test_man_fill_3rd_direct_fill_2nd_direct_fill_direct_skip_3rd_indirect_two_rows_
size_t obj_size; /* Size of object */
size_t fill_size; /* Size of objects for "bulk" filled blocks */
fheap_heap_state_t state; /* State of fractal heap */
- const char * base_desc =
+ unsigned u, v; /* Local index variables */
+ /* Test description */
+ const char *base_desc =
"filling direct blocks, filling 2nd level indirect blocks, filling 3rd level indirect blocks, fill "
"first row of 4th level indirect blocks, fill 2nd row 4th level indirect block's direct, 2nd level "
"indirect blocks, first row of 3rd level indirect blocks, 3rd level direct block in 2nd row, and "
"skip first row of 2nd indirect blocks of 4th level indirect block's 3rd level indirect block, then "
- "backfill and extend, then remove all objects %s"; /* Test description */
- unsigned u, v; /* Local index variables */
+ "backfill and extend, then remove all objects %s";
/* Perform common test initialization operations */
if (begin_test(tparam, base_desc, &keep_ids, &fill_size) < 0)
@@ -11649,9 +11601,6 @@ test_man_fill_3rd_direct_fill_2nd_direct_fill_direct_skip_3rd_indirect_two_rows_
* object
*/
obj_size = (size_t)DBLOCK_SIZE(fh, num_first_indirect_rows - 1) + 1;
-#ifdef QAK
- HDfprintf(stderr, "obj_size = %Zu\n", obj_size);
-#endif /* QAK */
state.man_alloc_size += DBLOCK_SIZE(fh, num_first_indirect_rows);
if (add_obj(fh, (size_t)20, obj_size, &state, &keep_ids))
TEST_ERROR
@@ -11727,7 +11676,7 @@ error:
* Function:
*test_man_fill_3rd_direct_fill_2nd_direct_fill_direct_skip_3rd_indirect_wrap_start_block_add_skipped
*
- * Purpose: Test filling all direct blocks in root indirect block and all
+ * Purpose: Test filling all direct blocks in root indirect block and all
* direct blocks in 2nd level indirect blocks, fill all direct
* blocks and indirect blocks in 3rd level indirect block, fill all
* direct & indirect blocks in 4th level indirect
@@ -11741,11 +11690,11 @@ error:
* 4th level block), then backfill all skipped direct blocks &
* extend.
*
- * Return: Success: 0
+ * Return: Success: 0
*
- * Failure: 1
+ * Failure: 1
*
- * Programmer: Quincey Koziol
+ * Programmer: Quincey Koziol
* Monday, April 17, 2006
*
*-------------------------------------------------------------------------
@@ -11766,17 +11715,13 @@ test_man_fill_3rd_direct_fill_2nd_direct_fill_direct_skip_3rd_indirect_wrap_star
size_t obj_size; /* Size of object */
size_t fill_size; /* Size of objects for "bulk" filled blocks */
fheap_heap_state_t state; /* State of fractal heap */
- const char *base_desc = "filling direct blocks, filling 2nd level indirect blocks, filling 3rd level "
- "indirect blocks, fill "
- "first row of 3rd level indirect blocks in 4th level indirect block except last "
- "3rd level block, "
- "fill direct blocks in 3rd level block, and skip row of 2nd indirect blocks of "
- "4th level indirect "
- "block's 3rd level indirect block, then backfill and extend, then remove all "
- "objects %s"; /* Test
- description
- */
- unsigned u, v; /* Local index variables */
+ unsigned u, v; /* Local index variables */
+ /* Test description */
+ const char *base_desc =
+ "filling direct blocks, filling 2nd level indirect blocks, filling 3rd level indirect blocks, fill "
+ "first row of 3rd level indirect blocks in 4th level indirect block except last 3rd level block, "
+ "fill direct blocks in 3rd level block, and skip row of 2nd indirect blocks of 4th level indirect "
+ "block's 3rd level indirect block, then backfill and extend, then remove all objects %s";
/* Perform common test initialization operations */
if (begin_test(tparam, base_desc, &keep_ids, &fill_size) < 0)
@@ -11857,9 +11802,6 @@ test_man_fill_3rd_direct_fill_2nd_direct_fill_direct_skip_3rd_indirect_wrap_star
* object
*/
obj_size = (size_t)DBLOCK_SIZE(fh, num_first_indirect_rows - 1) + 1;
-#ifdef QAK
- HDfprintf(stderr, "obj_size = %Zu\n", obj_size);
-#endif /* QAK */
state.man_alloc_size += DBLOCK_SIZE(fh, num_first_indirect_rows);
if (add_obj(fh, (size_t)20, obj_size, &state, &keep_ids))
TEST_ERROR
@@ -11934,7 +11876,7 @@ error:
* Function:
*test_man_fill_4th_direct_less_one_fill_2nd_direct_fill_direct_skip_3rd_indirect_wrap_start_block_add_skipped
*
- * Purpose: Test filling all direct blocks in root indirect block and all
+ * Purpose: Test filling all direct blocks in root indirect block and all
* direct blocks in 2nd level indirect blocks, fill all direct
* blocks and indirect blocks in 3rd level indirect block, fill all
* direct & indirect blocks in first row of 4th level indirect
@@ -11948,11 +11890,11 @@ error:
* next row of 4th level blocks), then backfill all skipped direct
* blocks & extend.
*
- * Return: Success: 0
+ * Return: Success: 0
*
- * Failure: 1
+ * Failure: 1
*
- * Programmer: Quincey Koziol
+ * Programmer: Quincey Koziol
* Monday, April 17, 2006
*
*-------------------------------------------------------------------------
@@ -11973,13 +11915,14 @@ test_man_fill_4th_direct_less_one_fill_2nd_direct_fill_direct_skip_3rd_indirect_
size_t obj_size; /* Size of object */
size_t fill_size; /* Size of objects for "bulk" filled blocks */
fheap_heap_state_t state; /* State of fractal heap */
- const char * base_desc =
+ unsigned u, v; /* Local index variables */
+ /* Test description */
+ const char *base_desc =
"filling direct blocks, filling 2nd level indirect blocks, filling 3rd level indirect blocks, fill "
"first row of 4th level indirect blocks, except last one, fill first row of 3rd level indirect "
"blocks in last 4th level indirect block except last 3rd level block, fill direct blocks in 3rd "
"level block, and skip row of 2nd indirect blocks of 4th level indirect block's 3rd level indirect "
- "block, then backfill and extend, then remove all objects %s"; /* Test description */
- unsigned u, v; /* Local index variables */
+ "block, then backfill and extend, then remove all objects %s";
/* Perform common test initialization operations */
if (begin_test(tparam, base_desc, &keep_ids, &fill_size) < 0)
@@ -12096,9 +12039,6 @@ test_man_fill_4th_direct_less_one_fill_2nd_direct_fill_direct_skip_3rd_indirect_
* object
*/
obj_size = (size_t)DBLOCK_SIZE(fh, num_first_indirect_rows - 1) + 1;
-#ifdef QAK
- HDfprintf(stderr, "obj_size = %Zu\n", obj_size);
-#endif /* QAK */
state.man_alloc_size += DBLOCK_SIZE(fh, num_first_indirect_rows);
if (add_obj(fh, (size_t)20, obj_size, &state, &keep_ids))
TEST_ERROR
@@ -12169,25 +12109,22 @@ error:
return (1);
} /* test_man_fill_4th_direct_less_one_fill_2nd_direct_fill_direct_skip_3rd_indirect_wrap_start_block_add_skipped()
*/
-#endif /* QAK */
-
-#ifndef QAK
/*-------------------------------------------------------------------------
- * Function: test_man_frag_simple
+ * Function: test_man_frag_simple
*
- * Purpose: Test inserting objects small enough to fit into first row of
+ * Purpose: Test inserting objects small enough to fit into first row of
* direct blocks, but not to share a block with another object,
* until start-block-size * 2 blocks are reached. Then, go back
* and fill in the space in the blocks skipped.
*
* Then, remove all the objects, in various ways
*
- * Return: Success: 0
+ * Return: Success: 0
*
- * Failure: 1
+ * Failure: 1
*
- * Programmer: Quincey Koziol
+ * Programmer: Quincey Koziol
* Monday, July 24, 2006
*
*-------------------------------------------------------------------------
@@ -12204,10 +12141,9 @@ test_man_frag_simple(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tpar
h5_stat_size_t empty_size; /* Size of a file with an empty heap */
size_t obj_size; /* Size of object */
fheap_heap_state_t state; /* State of fractal heap */
- const char * base_desc =
- "fragmenting small blocks, then backfill and extend, then remove all objects %s"; /* Test description
- */
- unsigned u; /* Local index variables */
+ unsigned u; /* Local index variables */
+ /* Test description */
+ const char *base_desc = "fragmenting small blocks, then backfill and extend, then remove all objects %s";
/* Perform common test initialization operations */
if (begin_test(tparam, base_desc, &keep_ids, NULL) < 0)
@@ -12307,19 +12243,19 @@ error:
} /* test_man_frag_simple() */
/*-------------------------------------------------------------------------
- * Function: test_man_frag_direct
+ * Function: test_man_frag_direct
*
- * Purpose: Test inserting small object to fit into each direct block
+ * Purpose: Test inserting small object to fit into each direct block
* in root block, but not to share a block with another object,
* Then, go back and fill in the space in the blocks skipped.
*
* Then, go back and remove all objects
*
- * Return: Success: 0
+ * Return: Success: 0
*
- * Failure: 1
+ * Failure: 1
*
- * Programmer: Quincey Koziol
+ * Programmer: Quincey Koziol
* Tuesday, July 25, 2006
*
*-------------------------------------------------------------------------
@@ -12337,10 +12273,9 @@ test_man_frag_direct(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tpar
h5_stat_size_t empty_size; /* Size of a file with an empty heap */
size_t obj_size; /* Size of object */
fheap_heap_state_t state; /* State of fractal heap */
- const char * base_desc =
- "fragmenting direct blocks, then backfill and extend, then remove all objects %s"; /* Test description
- */
- unsigned u, v; /* Local index variables */
+ unsigned u, v; /* Local index variables */
+ /* Test description */
+ const char *base_desc = "fragmenting direct blocks, then backfill and extend, then remove all objects %s";
/* Perform common test initialization operations */
if (begin_test(tparam, base_desc, &keep_ids, NULL) < 0)
@@ -12477,9 +12412,9 @@ error:
} /* test_man_frag_direct() */
/*-------------------------------------------------------------------------
- * Function: test_man_frag_2nd_direct
+ * Function: test_man_frag_2nd_direct
*
- * Purpose: Test filling all direct blocks in root indirect block, then
+ * Purpose: Test filling all direct blocks in root indirect block, then
* inserting small object to fit into each direct block
* in 2nd level indirect block, but not to share a block with
* another object.
@@ -12487,11 +12422,11 @@ error:
*
* Then, go back and remove all the objects
*
- * Return: Success: 0
+ * Return: Success: 0
*
- * Failure: 1
+ * Failure: 1
*
- * Programmer: Quincey Koziol
+ * Programmer: Quincey Koziol
* Tuesday, July 25, 2006
*
*-------------------------------------------------------------------------
@@ -12511,10 +12446,10 @@ test_man_frag_2nd_direct(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *
size_t obj_size; /* Size of object */
size_t fill_size; /* Size of objects for "bulk" filled blocks */
fheap_heap_state_t state; /* State of fractal heap */
- const char * base_desc =
- "fill root direct blocks, then fragment 2nd level indirect block's direct blocks, then backfill and "
- "extend, then remove all objects %s"; /* Test description */
- unsigned u, v; /* Local index variables */
+ unsigned u, v; /* Local index variables */
+ /* Test description */
+ const char *base_desc = "fill root direct blocks, then fragment 2nd level indirect block's direct "
+ "blocks, then backfill and extend, then remove all objects %s";
/* Perform common test initialization operations */
if (begin_test(tparam, base_desc, &keep_ids, &fill_size) < 0)
@@ -12526,9 +12461,6 @@ test_man_frag_2nd_direct(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *
/* Compute # of bits used in first row */
num_first_indirect_rows = IBLOCK_MAX_DROWS(fh, 1);
-#ifdef QAK
- HDfprintf(stderr, "num_first_indirect_rows = %u\n", num_first_indirect_rows);
-#endif /* QAK */
/* Fill direct blocks in root indirect block */
if (fill_root_direct(fh, fill_size, &state, &keep_ids))
@@ -12591,9 +12523,9 @@ error:
} /* test_man_frag_2nd_direct() */
/*-------------------------------------------------------------------------
- * Function: test_man_frag_3rd_direct
+ * Function: test_man_frag_3rd_direct
*
- * Purpose: Test filling all direct blocks in root indirect block and
+ * Purpose: Test filling all direct blocks in root indirect block and
* all 2nd level indirect blocks, then
* inserting small object to fit into each direct block
* in 3rd level indirect block, but not to share a block with
@@ -12602,11 +12534,11 @@ error:
*
* Then, go back and remove all objects
*
- * Return: Success: 0
+ * Return: Success: 0
*
- * Failure: 1
+ * Failure: 1
*
- * Programmer: Quincey Koziol
+ * Programmer: Quincey Koziol
* Tuesday, July 25, 2006
*
*-------------------------------------------------------------------------
@@ -12625,10 +12557,11 @@ test_man_frag_3rd_direct(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *
size_t obj_size; /* Size of object */
size_t fill_size; /* Size of objects for "bulk" filled blocks */
fheap_heap_state_t state; /* State of fractal heap */
- const char * base_desc =
+ unsigned u, v; /* Local index variables */
+ /* Test description */
+ const char *base_desc =
"fill root direct blocks and 2nd level indirect blocks, then fragment 3rd level indirect block's "
- "direct blocks, then backfill and extend, then remove all objects %s"; /* Test description */
- unsigned u, v; /* Local index variables */
+ "direct blocks, then backfill and extend, then remove all objects %s";
/* Perform common test initialization operations */
if (begin_test(tparam, base_desc, &keep_ids, &fill_size) < 0)
@@ -12708,21 +12641,18 @@ error:
H5E_END_TRY;
return (1);
} /* test_man_frag_3rd_direct() */
-#endif /* QAK */
-
-#ifndef QAK
/*-------------------------------------------------------------------------
- * Function: test_huge_insert_one
+ * Function: test_huge_insert_one
*
- * Purpose: Test inserting one huge object in the heap
+ * Purpose: Test inserting one huge object in the heap
*
* Then, remove all the objects, in various ways
*
- * Return: Success: 0
- * Failure: 1
+ * Return: Success: 0
+ * Failure: 1
*
- * Programmer: Quincey Koziol
+ * Programmer: Quincey Koziol
* Monday, August 7, 2006
*
*-------------------------------------------------------------------------
@@ -12744,7 +12674,8 @@ test_huge_insert_one(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tpar
size_t robj_size; /* Size of object read */
unsigned char obj_type; /* Type of storage for object */
fheap_heap_state_t state; /* State of fractal heap */
- const char * base_desc = "insert one huge object, then remove %s"; /* Test description */
+ /* Test description */
+ const char *base_desc = "insert one huge object, then remove %s";
/* Perform common test initialization operations */
if (begin_test(tparam, base_desc, &keep_ids, NULL) < 0)
@@ -12791,7 +12722,7 @@ test_huge_insert_one(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tpar
HDmemset(shared_robj_g, 0, obj_size);
if (H5HF_read(fh, heap_id, shared_robj_g) < 0)
FAIL_STACK_ERROR
- if (HDmemcmp(shared_wobj_g, shared_robj_g, obj_size))
+ if (HDmemcmp(shared_wobj_g, shared_robj_g, obj_size) != 0)
TEST_ERROR
/* Delete individual objects, if we won't be deleting the entire heap later */
@@ -12830,9 +12761,6 @@ test_huge_insert_one(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tpar
/* Get the size of the file */
if ((file_size = h5_get_file_size(filename, fapl)) < 0)
TEST_ERROR
-#ifdef QAK
- HDfprintf(stderr, "file_size = %lu\n", (unsigned long)file_size);
-#endif /* QAK */
/* Verify the file is correct size */
if (file_size != empty_size)
@@ -12865,16 +12793,16 @@ error:
} /* test_huge_insert_one() */
/*-------------------------------------------------------------------------
- * Function: test_huge_insert_two
+ * Function: test_huge_insert_two
*
- * Purpose: Test inserting two huge objects in the heap
+ * Purpose: Test inserting two huge objects in the heap
*
* Then, remove all the objects, in various ways
*
- * Return: Success: 0
- * Failure: 1
+ * Return: Success: 0
+ * Failure: 1
*
- * Programmer: Quincey Koziol
+ * Programmer: Quincey Koziol
* Friday, August 11, 2006
*
*-------------------------------------------------------------------------
@@ -12897,7 +12825,8 @@ test_huge_insert_two(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tpar
size_t robj_size; /* Size of object read */
unsigned char obj_type; /* Type of storage for object */
fheap_heap_state_t state; /* State of fractal heap */
- const char * base_desc = "insert two huge objects, then remove %s"; /* Test description */
+ /* Test description */
+ const char *base_desc = "insert two huge objects, then remove %s";
/* Perform common test initialization operations */
if (begin_test(tparam, base_desc, &keep_ids, NULL) < 0)
@@ -12946,7 +12875,7 @@ test_huge_insert_two(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tpar
HDmemset(shared_robj_g, 0, obj_size);
if (H5HF_read(fh, heap_id, shared_robj_g) < 0)
FAIL_STACK_ERROR
- if (HDmemcmp(shared_wobj_g, shared_robj_g, obj_size))
+ if (HDmemcmp(shared_wobj_g, shared_robj_g, obj_size) != 0)
TEST_ERROR
/* Insert second object too large for managed heap blocks */
@@ -12976,7 +12905,7 @@ test_huge_insert_two(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tpar
HDmemset(shared_robj_g, 0, obj_size);
if (H5HF_read(fh, heap_id2, shared_robj_g) < 0)
FAIL_STACK_ERROR
- if (HDmemcmp(shared_wobj_g, shared_robj_g, obj_size))
+ if (HDmemcmp(shared_wobj_g, shared_robj_g, obj_size) != 0)
TEST_ERROR
/* Delete individual objects, if we won't be deleting the entire heap later */
@@ -13060,9 +12989,6 @@ test_huge_insert_two(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tpar
/* Get the size of the file */
if ((file_size = h5_get_file_size(filename, fapl)) < 0)
TEST_ERROR
-#ifdef QAK
- HDfprintf(stderr, "file_size = %lu\n", (unsigned long)file_size);
-#endif /* QAK */
/* Verify the file is correct size */
if (file_size != empty_size)
@@ -13097,16 +13023,16 @@ error:
} /* test_huge_insert_two() */
/*-------------------------------------------------------------------------
- * Function: test_huge_insert_three
+ * Function: test_huge_insert_three
*
- * Purpose: Test inserting three huge objects in the heap
+ * Purpose: Test inserting three huge objects in the heap
*
* Then, remove all the objects, in various ways
*
- * Return: Success: 0
- * Failure: 1
+ * Return: Success: 0
+ * Failure: 1
*
- * Programmer: Quincey Koziol
+ * Programmer: Quincey Koziol
* Friday, August 11, 2006
*
*-------------------------------------------------------------------------
@@ -13130,7 +13056,8 @@ test_huge_insert_three(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tp
size_t robj_size; /* Size of object read */
unsigned char obj_type; /* Type of storage for object */
fheap_heap_state_t state; /* State of fractal heap */
- const char * base_desc = "insert three huge objects, then remove %s"; /* Test description */
+ /* Test description */
+ const char *base_desc = "insert three huge objects, then remove %s";
/* Perform common test initialization operations */
if (begin_test(tparam, base_desc, &keep_ids, NULL) < 0)
@@ -13181,7 +13108,7 @@ test_huge_insert_three(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tp
HDmemset(shared_robj_g, 0, obj_size);
if (H5HF_read(fh, heap_id, shared_robj_g) < 0)
FAIL_STACK_ERROR
- if (HDmemcmp(shared_wobj_g, shared_robj_g, obj_size))
+ if (HDmemcmp(shared_wobj_g, shared_robj_g, obj_size) != 0)
TEST_ERROR
/* Insert second object too large for managed heap blocks */
@@ -13211,7 +13138,7 @@ test_huge_insert_three(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tp
HDmemset(shared_robj_g, 0, obj_size);
if (H5HF_read(fh, heap_id2, shared_robj_g) < 0)
FAIL_STACK_ERROR
- if (HDmemcmp(shared_wobj_g, shared_robj_g, obj_size))
+ if (HDmemcmp(shared_wobj_g, shared_robj_g, obj_size) != 0)
TEST_ERROR
/* Insert third object too large for managed heap blocks */
@@ -13241,7 +13168,7 @@ test_huge_insert_three(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tp
HDmemset(shared_robj_g, 0, obj_size);
if (H5HF_read(fh, heap_id3, shared_robj_g) < 0)
FAIL_STACK_ERROR
- if (HDmemcmp(shared_wobj_g, shared_robj_g, obj_size))
+ if (HDmemcmp(shared_wobj_g, shared_robj_g, obj_size) != 0)
TEST_ERROR
/* Delete individual objects, if we won't be deleting the entire heap later */
@@ -13365,9 +13292,6 @@ test_huge_insert_three(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tp
/* Get the size of the file */
if ((file_size = h5_get_file_size(filename, fapl)) < 0)
TEST_ERROR
-#ifdef QAK
- HDfprintf(stderr, "file_size = %lu\n", (unsigned long)file_size);
-#endif /* QAK */
/* Verify the file is correct size */
if (file_size != empty_size)
@@ -13404,16 +13328,16 @@ error:
} /* test_huge_insert_three() */
/*-------------------------------------------------------------------------
- * Function: test_huge_insert_mix
+ * Function: test_huge_insert_mix
*
- * Purpose: Test inserting a mix of 'normal' & 'huge' objects in the heap
+ * Purpose: Test inserting a mix of 'normal' & 'huge' objects in the heap
*
* Then, remove all the objects, in various ways
*
- * Return: Success: 0
- * Failure: 1
+ * Return: Success: 0
+ * Failure: 1
*
- * Programmer: Quincey Koziol
+ * Programmer: Quincey Koziol
* Friday, August 11, 2006
*
*-------------------------------------------------------------------------
@@ -13439,7 +13363,8 @@ test_huge_insert_mix(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tpar
size_t robj_size; /* Size of object read */
unsigned char obj_type; /* Type of storage for object */
fheap_heap_state_t state; /* State of fractal heap */
- const char *base_desc = "insert mix of normal & huge objects, then remove %s"; /* Test description */
+ /* Test description */
+ const char *base_desc = "insert mix of normal & huge objects, then remove %s";
/* Perform common test initialization operations */
if (begin_test(tparam, base_desc, &keep_ids, NULL) < 0)
@@ -13494,7 +13419,7 @@ test_huge_insert_mix(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tpar
HDmemset(shared_robj_g, 0, obj_size);
if (H5HF_read(fh, heap_id, shared_robj_g) < 0)
FAIL_STACK_ERROR
- if (HDmemcmp(shared_wobj_g, shared_robj_g, obj_size))
+ if (HDmemcmp(shared_wobj_g, shared_robj_g, obj_size) != 0)
TEST_ERROR
/* Insert second object too large for managed heap blocks */
@@ -13524,7 +13449,7 @@ test_huge_insert_mix(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tpar
HDmemset(shared_robj_g, 0, obj_size);
if (H5HF_read(fh, heap_id2, shared_robj_g) < 0)
FAIL_STACK_ERROR
- if (HDmemcmp(shared_wobj_g, shared_robj_g, obj_size))
+ if (HDmemcmp(shared_wobj_g, shared_robj_g, obj_size) != 0)
TEST_ERROR
/* Insert third object too large for managed heap blocks */
@@ -13554,7 +13479,7 @@ test_huge_insert_mix(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tpar
HDmemset(shared_robj_g, 0, obj_size);
if (H5HF_read(fh, heap_id3, shared_robj_g) < 0)
FAIL_STACK_ERROR
- if (HDmemcmp(shared_wobj_g, shared_robj_g, obj_size))
+ if (HDmemcmp(shared_wobj_g, shared_robj_g, obj_size) != 0)
TEST_ERROR
/* Insert fourth object small enough to fit into 'normal' heap blocks */
@@ -13591,7 +13516,7 @@ test_huge_insert_mix(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tpar
HDmemset(shared_robj_g, 0, obj_size);
if (H5HF_read(fh, heap_id4, shared_robj_g) < 0)
FAIL_STACK_ERROR
- if (HDmemcmp(shared_wobj_g, shared_robj_g, obj_size))
+ if (HDmemcmp(shared_wobj_g, shared_robj_g, obj_size) != 0)
TEST_ERROR
/* Insert fifth object small enough to fit into 'normal' heap blocks */
@@ -13629,7 +13554,7 @@ test_huge_insert_mix(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tpar
HDmemset(shared_robj_g, 0, obj_size);
if (H5HF_read(fh, heap_id5, shared_robj_g) < 0)
FAIL_STACK_ERROR
- if (HDmemcmp(shared_wobj_g, shared_robj_g, obj_size))
+ if (HDmemcmp(shared_wobj_g, shared_robj_g, obj_size) != 0)
TEST_ERROR
/* Delete individual objects, if we won't be deleting the entire heap later */
@@ -13788,9 +13713,6 @@ test_huge_insert_mix(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tpar
/* Get the size of the file */
if ((file_size = h5_get_file_size(filename, fapl)) < 0)
TEST_ERROR
-#ifdef QAK
- HDfprintf(stderr, "file_size = %lu\n", (unsigned long)file_size);
-#endif /* QAK */
/* Verify the file is correct size */
if (file_size != empty_size)
@@ -13831,14 +13753,14 @@ error:
} /* test_huge_insert_mix() */
/*-------------------------------------------------------------------------
- * Function: test_filtered_huge
+ * Function: test_filtered_huge
*
- * Purpose: Test storing 'huge' object in a heap with I/O filters
+ * Purpose: Test storing 'huge' object in a heap with I/O filters
*
- * Return: Success: 0
- * Failure: 1
+ * Return: Success: 0
+ * Failure: 1
*
- * Programmer: Quincey Koziol
+ * Programmer: Quincey Koziol
* Tuesday, August 15, 2006
*
*-------------------------------------------------------------------------
@@ -13865,8 +13787,8 @@ test_filtered_huge(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tparam
size_t old_actual_id_len = 0; /* Old actual ID length */
hbool_t huge_ids_direct; /* Are 'huge' objects directly acccessed? */
hbool_t pline_init = FALSE; /* Whether the I/O pipeline has been initialized */
- const char * base_desc =
- "insert 'huge' object into heap with I/O filters, then remove %s"; /* Test description */
+ /* Test description */
+ const char *base_desc = "insert 'huge' object into heap with I/O filters, then remove %s";
/* Copy heap creation properties */
HDmemcpy(&tmp_cparam, cparam, sizeof(H5HF_create_t));
@@ -13929,7 +13851,6 @@ test_filtered_huge(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tparam
if (reopen_heap(f, &fh, fh_addr, tparam) < 0)
TEST_ERROR
-/* QAK */
#ifdef QAK
/* Close the fractal heap */
if (H5HF_close(fh) < 0)
@@ -13956,7 +13877,6 @@ test_filtered_huge(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tparam
if (NULL == (fh = H5HF_open(f, fh_addr)))
FAIL_STACK_ERROR
#endif /* QAK */
- /* QAK */
/* Check up on heap... */
state.huge_size = obj_size;
@@ -13972,7 +13892,7 @@ test_filtered_huge(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tparam
HDmemset(shared_robj_g, 0, obj_size);
if (H5HF_read(fh, heap_id, shared_robj_g) < 0)
FAIL_STACK_ERROR
- if (HDmemcmp(shared_wobj_g, shared_robj_g, obj_size))
+ if (HDmemcmp(shared_wobj_g, shared_robj_g, obj_size) != 0)
TEST_ERROR
/* Delete individual objects, if we won't be deleting the entire heap later */
@@ -14011,10 +13931,6 @@ test_filtered_huge(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tparam
/* Get the size of the file */
if ((file_size = h5_get_file_size(filename, fapl)) < 0)
TEST_ERROR
-#ifdef QAK
- HDfprintf(stderr, "empty_size = %lu, file_size = %lu\n", (unsigned long)empty_size,
- (unsigned long)file_size);
-#endif /* QAK */
/* Verify the file is correct size */
if (file_size != empty_size)
@@ -14046,21 +13962,18 @@ error:
H5E_END_TRY;
return (1);
} /* test_filtered_huge() */
-#endif /* QAK */
-
-#ifndef QAK
/*-------------------------------------------------------------------------
- * Function: test_tiny_insert_one
+ * Function: test_tiny_insert_one
*
- * Purpose: Test inserting one tiny object in the heap
+ * Purpose: Test inserting one tiny object in the heap
*
* Then, remove all the objects, in various ways
*
- * Return: Success: 0
- * Failure: 1
+ * Return: Success: 0
+ * Failure: 1
*
- * Programmer: Quincey Koziol
+ * Programmer: Quincey Koziol
* Monday, August 14, 2006
*
*-------------------------------------------------------------------------
@@ -14082,7 +13995,8 @@ test_tiny_insert_one(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tpar
size_t robj_size; /* Size of object read */
unsigned char obj_type; /* Type of storage for object */
fheap_heap_state_t state; /* State of fractal heap */
- const char * base_desc = "insert one tiny object, then remove %s"; /* Test description */
+ /* Test description */
+ const char *base_desc = "insert one tiny object, then remove %s";
/* Perform common test initialization operations */
if (begin_test(tparam, base_desc, &keep_ids, NULL) < 0)
@@ -14129,7 +14043,7 @@ test_tiny_insert_one(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tpar
HDmemset(shared_robj_g, 0, obj_size);
if (H5HF_read(fh, heap_id, shared_robj_g) < 0)
FAIL_STACK_ERROR
- if (HDmemcmp(shared_wobj_g, shared_robj_g, obj_size))
+ if (HDmemcmp(shared_wobj_g, shared_robj_g, obj_size) != 0)
TEST_ERROR
/* Delete individual objects, if we won't be deleting the entire heap later */
@@ -14168,9 +14082,6 @@ test_tiny_insert_one(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tpar
/* Get the size of the file */
if ((file_size = h5_get_file_size(filename, fapl)) < 0)
TEST_ERROR
-#ifdef QAK
- HDfprintf(stderr, "file_size = %lu\n", (unsigned long)file_size);
-#endif /* QAK */
/* Verify the file is correct size */
if (file_size != empty_size)
@@ -14203,16 +14114,16 @@ error:
} /* test_tiny_insert_one() */
/*-------------------------------------------------------------------------
- * Function: test_tiny_insert_two
+ * Function: test_tiny_insert_two
*
- * Purpose: Test inserting two tiny objects in the heap
+ * Purpose: Test inserting two tiny objects in the heap
*
* Then, remove all the objects, in various ways
*
- * Return: Success: 0
- * Failure: 1
+ * Return: Success: 0
+ * Failure: 1
*
- * Programmer: Quincey Koziol
+ * Programmer: Quincey Koziol
* Monday, August 14, 2006
*
*-------------------------------------------------------------------------
@@ -14235,7 +14146,8 @@ test_tiny_insert_two(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tpar
size_t robj_size; /* Size of object read */
unsigned char obj_type; /* Type of storage for object */
fheap_heap_state_t state; /* State of fractal heap */
- const char * base_desc = "insert two tiny objects, then remove %s"; /* Test description */
+ /* Test description */
+ const char *base_desc = "insert two tiny objects, then remove %s";
/* Perform common test initialization operations */
if (begin_test(tparam, base_desc, &keep_ids, NULL) < 0)
@@ -14284,7 +14196,7 @@ test_tiny_insert_two(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tpar
HDmemset(shared_robj_g, 0, obj_size);
if (H5HF_read(fh, heap_id, shared_robj_g) < 0)
FAIL_STACK_ERROR
- if (HDmemcmp(shared_wobj_g, shared_robj_g, obj_size))
+ if (HDmemcmp(shared_wobj_g, shared_robj_g, obj_size) != 0)
TEST_ERROR
/* Insert second object small enough to encode in heap ID */
@@ -14314,7 +14226,7 @@ test_tiny_insert_two(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tpar
HDmemset(shared_robj_g, 0, obj_size);
if (H5HF_read(fh, heap_id2, shared_robj_g) < 0)
FAIL_STACK_ERROR
- if (HDmemcmp(shared_wobj_g, shared_robj_g, obj_size))
+ if (HDmemcmp(shared_wobj_g, shared_robj_g, obj_size) != 0)
TEST_ERROR
/* Delete individual objects, if we won't be deleting the entire heap later */
@@ -14398,9 +14310,6 @@ test_tiny_insert_two(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tpar
/* Get the size of the file */
if ((file_size = h5_get_file_size(filename, fapl)) < 0)
TEST_ERROR
-#ifdef QAK
- HDfprintf(stderr, "file_size = %lu\n", (unsigned long)file_size);
-#endif /* QAK */
/* Verify the file is correct size */
if (file_size != empty_size)
@@ -14435,17 +14344,17 @@ error:
} /* test_tiny_insert_two() */
/*-------------------------------------------------------------------------
- * Function: test_tiny_insert_mix
+ * Function: test_tiny_insert_mix
*
- * Purpose: Test inserting a mix of 'normal', 'huge' & 'tiny' objects in
+ * Purpose: Test inserting a mix of 'normal', 'huge' & 'tiny' objects in
* the heap
*
* Then, remove all the objects, in various ways
*
- * Return: Success: 0
- * Failure: 1
+ * Return: Success: 0
+ * Failure: 1
*
- * Programmer: Quincey Koziol
+ * Programmer: Quincey Koziol
* Monday, August 14, 2006
*
*-------------------------------------------------------------------------
@@ -14473,8 +14382,8 @@ test_tiny_insert_mix(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tpar
size_t robj_size; /* Size of object read */
unsigned char obj_type; /* Type of storage for object */
fheap_heap_state_t state; /* State of fractal heap */
- const char * base_desc =
- "insert mix of normal, huge & tiny objects, then remove %s"; /* Test description */
+ /* Test description */
+ const char *base_desc = "insert mix of normal, huge & tiny objects, then remove %s";
/* Perform common test initialization operations */
if (begin_test(tparam, base_desc, &keep_ids, NULL) < 0)
@@ -14533,14 +14442,14 @@ test_tiny_insert_mix(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tpar
HDmemset(shared_robj_g, 0, obj_size);
if (H5HF_read(fh, heap_id, shared_robj_g) < 0)
FAIL_STACK_ERROR
- if (HDmemcmp(shared_wobj_g, shared_robj_g, obj_size))
+ if (HDmemcmp(shared_wobj_g, shared_robj_g, obj_size) != 0)
TEST_ERROR
/* Check 'op' functionality on first huge object */
HDmemset(shared_robj_g, 0, obj_size);
if (H5HF_op(fh, heap_id, op_memcpy, shared_robj_g) < 0)
FAIL_STACK_ERROR
- if (HDmemcmp(shared_wobj_g, shared_robj_g, obj_size))
+ if (HDmemcmp(shared_wobj_g, shared_robj_g, obj_size) != 0)
TEST_ERROR
/* Insert second object too large for managed heap blocks */
@@ -14570,14 +14479,14 @@ test_tiny_insert_mix(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tpar
HDmemset(shared_robj_g, 0, obj_size);
if (H5HF_read(fh, heap_id2, shared_robj_g) < 0)
FAIL_STACK_ERROR
- if (HDmemcmp(shared_wobj_g, shared_robj_g, obj_size))
+ if (HDmemcmp(shared_wobj_g, shared_robj_g, obj_size) != 0)
TEST_ERROR
/* Check 'op' functionality on second huge object */
HDmemset(shared_robj_g, 0, obj_size);
if (H5HF_op(fh, heap_id2, op_memcpy, shared_robj_g) < 0)
FAIL_STACK_ERROR
- if (HDmemcmp(shared_wobj_g, shared_robj_g, obj_size))
+ if (HDmemcmp(shared_wobj_g, shared_robj_g, obj_size) != 0)
TEST_ERROR
/* Insert third object too large for managed heap blocks */
@@ -14607,14 +14516,14 @@ test_tiny_insert_mix(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tpar
HDmemset(shared_robj_g, 0, obj_size);
if (H5HF_read(fh, heap_id3, shared_robj_g) < 0)
FAIL_STACK_ERROR
- if (HDmemcmp(shared_wobj_g, shared_robj_g, obj_size))
+ if (HDmemcmp(shared_wobj_g, shared_robj_g, obj_size) != 0)
TEST_ERROR
/* Check 'op' functionality on third huge object */
HDmemset(shared_robj_g, 0, obj_size);
if (H5HF_op(fh, heap_id3, op_memcpy, shared_robj_g) < 0)
FAIL_STACK_ERROR
- if (HDmemcmp(shared_wobj_g, shared_robj_g, obj_size))
+ if (HDmemcmp(shared_wobj_g, shared_robj_g, obj_size) != 0)
TEST_ERROR
/* Insert fourth object small enough to fit into 'normal' heap blocks */
@@ -14651,14 +14560,14 @@ test_tiny_insert_mix(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tpar
HDmemset(shared_robj_g, 0, obj_size);
if (H5HF_read(fh, heap_id4, shared_robj_g) < 0)
FAIL_STACK_ERROR
- if (HDmemcmp(shared_wobj_g, shared_robj_g, obj_size))
+ if (HDmemcmp(shared_wobj_g, shared_robj_g, obj_size) != 0)
TEST_ERROR
/* Check 'op' functionality on fourth ('normal') object */
HDmemset(shared_robj_g, 0, obj_size);
if (H5HF_op(fh, heap_id4, op_memcpy, shared_robj_g) < 0)
FAIL_STACK_ERROR
- if (HDmemcmp(shared_wobj_g, shared_robj_g, obj_size))
+ if (HDmemcmp(shared_wobj_g, shared_robj_g, obj_size) != 0)
TEST_ERROR
/* Insert fifth object small enough to fit into 'normal' heap blocks */
@@ -14696,14 +14605,14 @@ test_tiny_insert_mix(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tpar
HDmemset(shared_robj_g, 0, obj_size);
if (H5HF_read(fh, heap_id5, shared_robj_g) < 0)
FAIL_STACK_ERROR
- if (HDmemcmp(shared_wobj_g, shared_robj_g, obj_size))
+ if (HDmemcmp(shared_wobj_g, shared_robj_g, obj_size) != 0)
TEST_ERROR
/* Check 'op' functionality on fifth ('normal') object */
HDmemset(shared_robj_g, 0, obj_size);
if (H5HF_op(fh, heap_id5, op_memcpy, shared_robj_g) < 0)
FAIL_STACK_ERROR
- if (HDmemcmp(shared_wobj_g, shared_robj_g, obj_size))
+ if (HDmemcmp(shared_wobj_g, shared_robj_g, obj_size) != 0)
TEST_ERROR
/* Insert sixth object small enough to encode in heap ID */
@@ -14733,14 +14642,14 @@ test_tiny_insert_mix(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tpar
HDmemset(shared_robj_g, 0, obj_size);
if (H5HF_read(fh, heap_id6, shared_robj_g) < 0)
FAIL_STACK_ERROR
- if (HDmemcmp(shared_wobj_g, shared_robj_g, obj_size))
+ if (HDmemcmp(shared_wobj_g, shared_robj_g, obj_size) != 0)
TEST_ERROR
/* Check 'op' functionality on sixth ('tiny') object */
HDmemset(shared_robj_g, 0, obj_size);
if (H5HF_op(fh, heap_id6, op_memcpy, shared_robj_g) < 0)
FAIL_STACK_ERROR
- if (HDmemcmp(shared_wobj_g, shared_robj_g, obj_size))
+ if (HDmemcmp(shared_wobj_g, shared_robj_g, obj_size) != 0)
TEST_ERROR
/* Insert seventh object small enough to encode in heap ID */
@@ -14770,14 +14679,14 @@ test_tiny_insert_mix(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tpar
HDmemset(shared_robj_g, 0, obj_size);
if (H5HF_read(fh, heap_id7, shared_robj_g) < 0)
FAIL_STACK_ERROR
- if (HDmemcmp(shared_wobj_g, shared_robj_g, obj_size))
+ if (HDmemcmp(shared_wobj_g, shared_robj_g, obj_size) != 0)
TEST_ERROR
/* Check 'op' functionality on seventh ('tiny') object */
HDmemset(shared_robj_g, 0, obj_size);
if (H5HF_op(fh, heap_id7, op_memcpy, shared_robj_g) < 0)
FAIL_STACK_ERROR
- if (HDmemcmp(shared_wobj_g, shared_robj_g, obj_size))
+ if (HDmemcmp(shared_wobj_g, shared_robj_g, obj_size) != 0)
TEST_ERROR
/* Delete individual objects, if we won't be deleting the entire heap later */
@@ -14998,9 +14907,6 @@ test_tiny_insert_mix(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tpar
/* Get the size of the file */
if ((file_size = h5_get_file_size(filename, fapl)) < 0)
TEST_ERROR
-#ifdef QAK
- HDfprintf(stderr, "file_size = %lu\n", (unsigned long)file_size);
-#endif /* QAK */
/* Verify the file is correct size */
if (file_size != empty_size)
@@ -15043,20 +14949,16 @@ error:
H5E_END_TRY;
return (1);
} /* test_tiny_insert_mix() */
-#endif /* QAK */
-#endif /* QAK2 */
-
-#ifndef QAK
/*-------------------------------------------------------------------------
- * Function: test_filtered_man_root_direct
+ * Function: test_filtered_man_root_direct
*
- * Purpose: Test storing one 'managed' object in a heap with I/O filters
+ * Purpose: Test storing one 'managed' object in a heap with I/O filters
*
- * Return: Success: 0
- * Failure: 1
+ * Return: Success: 0
+ * Failure: 1
*
- * Programmer: Quincey Koziol
+ * Programmer: Quincey Koziol
* Monday, August 14, 2006
*
*-------------------------------------------------------------------------
@@ -15081,8 +14983,8 @@ test_filtered_man_root_direct(hid_t fapl, H5HF_create_t *cparam, fheap_test_para
unsigned char obj_type; /* Type of storage for object */
fheap_heap_state_t state; /* State of fractal heap */
unsigned deflate_level; /* Deflation level */
- const char * base_desc =
- "insert one 'managed' object into heap with I/O filters, then remove %s"; /* Test description */
+ /* Test description */
+ const char *base_desc = "insert one 'managed' object into heap with I/O filters, then remove %s";
/* Copy heap creation properties */
HDmemcpy(&tmp_cparam, cparam, sizeof(H5HF_create_t));
@@ -15154,7 +15056,7 @@ test_filtered_man_root_direct(hid_t fapl, H5HF_create_t *cparam, fheap_test_para
HDmemset(shared_robj_g, 0, obj_size);
if (H5HF_read(fh, heap_id, shared_robj_g) < 0)
FAIL_STACK_ERROR
- if (HDmemcmp(shared_wobj_g, shared_robj_g, obj_size))
+ if (HDmemcmp(shared_wobj_g, shared_robj_g, obj_size) != 0)
TEST_ERROR
/* Delete individual objects, if we won't be deleting the entire heap later */
@@ -15196,10 +15098,6 @@ test_filtered_man_root_direct(hid_t fapl, H5HF_create_t *cparam, fheap_test_para
/* Get the size of the file */
if ((file_size = h5_get_file_size(filename, fapl)) < 0)
TEST_ERROR
-#ifdef QAK
- HDfprintf(stderr, "empty_size = %lu, file_size = %lu\n", (unsigned long)empty_size,
- (unsigned long)file_size);
-#endif /* QAK */
/* Verify the file is correct size */
if (file_size != empty_size)
@@ -15226,14 +15124,14 @@ error:
} /* test_filtered_man_root_direct() */
/*-------------------------------------------------------------------------
- * Function: test_filtered_man_root_indirect
+ * Function: test_filtered_man_root_indirect
*
- * Purpose: Test storing several objects in a 'managed heap with I/O filters
+ * Purpose: Test storing several objects in a 'managed heap with I/O filters
*
- * Return: Success: 0
- * Failure: 1
+ * Return: Success: 0
+ * Failure: 1
*
- * Programmer: Quincey Koziol
+ * Programmer: Quincey Koziol
* Tuesday, October 24, 2006
*
*-------------------------------------------------------------------------
@@ -15259,8 +15157,8 @@ test_filtered_man_root_indirect(hid_t fapl, H5HF_create_t *cparam, fheap_test_pa
unsigned char obj_type; /* Type of storage for object */
fheap_heap_state_t state; /* State of fractal heap */
unsigned deflate_level; /* Deflation level */
- const char * base_desc =
- "insert two 'managed' objects into heap with I/O filters, then remove %s"; /* Test description */
+ /* Test description */
+ const char *base_desc = "insert two 'managed' objects into heap with I/O filters, then remove %s";
/* Copy heap creation properties */
HDmemcpy(&tmp_cparam, cparam, sizeof(H5HF_create_t));
@@ -15341,7 +15239,7 @@ test_filtered_man_root_indirect(hid_t fapl, H5HF_create_t *cparam, fheap_test_pa
HDmemset(shared_robj_g, 0, obj_size);
if (H5HF_read(fh, heap_id1, shared_robj_g) < 0)
FAIL_STACK_ERROR
- if (HDmemcmp(shared_wobj_g, shared_robj_g, obj_size))
+ if (HDmemcmp(shared_wobj_g, shared_robj_g, obj_size) != 0)
TEST_ERROR
/* Read in ('normal') object #2 */
@@ -15352,7 +15250,7 @@ test_filtered_man_root_indirect(hid_t fapl, H5HF_create_t *cparam, fheap_test_pa
HDmemset(shared_robj_g, 0, obj_size);
if (H5HF_read(fh, heap_id2, shared_robj_g) < 0)
FAIL_STACK_ERROR
- if (HDmemcmp(shared_wobj_g, shared_robj_g, obj_size))
+ if (HDmemcmp(shared_wobj_g, shared_robj_g, obj_size) != 0)
TEST_ERROR
/* Delete individual objects, if we won't be deleting the entire heap later */
@@ -15526,10 +15424,6 @@ test_filtered_man_root_indirect(hid_t fapl, H5HF_create_t *cparam, fheap_test_pa
/* Get the size of the file */
if ((file_size = h5_get_file_size(filename, fapl)) < 0)
TEST_ERROR
-#ifdef QAK
- HDfprintf(stderr, "empty_size = %lu, file_size = %lu\n", (unsigned long)empty_size,
- (unsigned long)file_size);
-#endif /* QAK */
/* Verify the file is correct size */
if (file_size != empty_size)
@@ -15554,23 +15448,20 @@ error:
H5E_END_TRY;
return (1);
} /* test_filtered_man_root_indirect() */
-#endif /* QAK */
-
-#ifndef QAK
/*-------------------------------------------------------------------------
- * Function: test_random
+ * Function: test_random
*
- * Purpose: Test inserting random sized objects into a heap, and read
+ * Purpose: Test inserting random sized objects into a heap, and read
* them back.
*
* Then, go back and remove all objects
*
- * Return: Success: 0
+ * Return: Success: 0
*
- * Failure: 1
+ * Failure: 1
*
- * Programmer: Quincey Koziol
+ * Programmer: Quincey Koziol
* Tuesday, May 9, 2006
*
*-------------------------------------------------------------------------
@@ -15642,10 +15533,10 @@ test_random(hsize_t size_limit, hid_t fapl, H5HF_create_t *cparam, fheap_test_pa
/* Choose random # seed */
seed = (unsigned long)HDtime(NULL);
-#ifdef QAK
- /* seed = (unsigned long)1156158635; */
- HDfprintf(stderr, "Random # seed was: %lu\n", seed);
-#endif /* QAK */
+#if 0
+/* seed = (unsigned long)1156158635; */
+HDfprintf(stderr, "Random # seed was: %lu\n", seed);
+#endif
HDsrandom((unsigned)seed);
/* Loop over adding objects to the heap, until the size limit is reached */
@@ -15666,10 +15557,6 @@ test_random(hsize_t size_limit, hid_t fapl, H5HF_create_t *cparam, fheap_test_pa
/* Increment the amount of objects added */
total_obj_added += obj_size;
} /* end while */
-#ifdef QAK
- HDfprintf(stderr, "keep_ids.num_ids = %Zu, total_obj_added = %Hu, size_limit = %Hu\n", keep_ids.num_ids,
- total_obj_added, size_limit);
-#endif /* QAK */
/* Randomize the order of the IDs kept */
for (u = 0; u < keep_ids.num_ids; u++) {
@@ -15728,9 +15615,6 @@ test_random(hsize_t size_limit, hid_t fapl, H5HF_create_t *cparam, fheap_test_pa
/* Get the size of the file */
if ((file_size = h5_get_file_size(filename, fapl)) < 0)
TEST_ERROR
-#ifdef QAK
- HDfprintf(stderr, "file_size = %lu\n", (unsigned long)file_size);
-#endif /* QAK */
/* Verify the file is correct size */
if (file_size != empty_size)
@@ -15769,19 +15653,19 @@ error:
} /* test_random() */
/*-------------------------------------------------------------------------
- * Function: test_random_pow2
+ * Function: test_random_pow2
*
- * Purpose: Test inserting random sized objects with a "power of 2
+ * Purpose: Test inserting random sized objects with a "power of 2
* distribution" (which favors small objects) into a heap,
* and read them back.
*
* Then, go back and remove all objects
*
- * Return: Success: 0
+ * Return: Success: 0
*
- * Failure: 1
+ * Failure: 1
*
- * Programmer: Quincey Koziol
+ * Programmer: Quincey Koziol
* Monday, May 15, 2006
*
*-------------------------------------------------------------------------
@@ -15855,10 +15739,10 @@ test_random_pow2(hsize_t size_limit, hid_t fapl, H5HF_create_t *cparam, fheap_te
/* Choose random # seed */
seed = (unsigned long)HDtime(NULL);
-#ifdef QAK
- /* seed = (unsigned long)1155181717; */
- HDfprintf(stderr, "Random # seed was: %lu\n", seed);
-#endif /* QAK */
+#if 0
+/* seed = (unsigned long)1155181717; */
+HDfprintf(stderr, "Random # seed was: %lu\n", seed);
+#endif
HDsrandom((unsigned)seed);
/* Loop over adding objects to the heap, until the size limit is reached */
@@ -15891,10 +15775,6 @@ test_random_pow2(hsize_t size_limit, hid_t fapl, H5HF_create_t *cparam, fheap_te
/* Increment the amount of objects added */
total_obj_added += obj_size;
} /* end while */
-#ifdef QAK
- HDfprintf(stderr, "keep_ids.num_ids = %Zu, total_obj_added = %Hu, size_limit = %Hu\n", keep_ids.num_ids,
- total_obj_added, size_limit);
-#endif /* QAK */
/* Randomize the order of the IDs kept */
for (u = 0; u < keep_ids.num_ids; u++) {
@@ -15953,10 +15833,6 @@ test_random_pow2(hsize_t size_limit, hid_t fapl, H5HF_create_t *cparam, fheap_te
/* Get the size of the file */
if ((file_size = h5_get_file_size(filename, fapl)) < 0)
TEST_ERROR
-#ifdef QAK
- HDfprintf(stderr, "empty_size = %lu\n", (unsigned long)empty_size);
- HDfprintf(stderr, "file_size = %lu\n", (unsigned long)file_size);
-#endif /* QAK */
/* Verify the file is correct size */
if (file_size != empty_size)
@@ -15992,19 +15868,16 @@ error:
H5E_END_TRY;
return (1);
} /* test_random_pow2() */
-#endif /* QAK */
-
-#ifndef QAK
/*-------------------------------------------------------------------------
- * Function: test_write
+ * Function: test_write
*
- * Purpose: Test inserting objects, then changing the value for them.
+ * Purpose: Test inserting objects, then changing the value for them.
*
- * Return: Success: 0
- * Failure: 1
+ * Return: Success: 0
+ * Failure: 1
*
- * Programmer: Quincey Koziol
+ * Programmer: Quincey Koziol
* Monday, December 18, 2006
*
*-------------------------------------------------------------------------
@@ -16189,7 +16062,7 @@ test_write(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tparam)
FAIL_STACK_ERROR
/* Compare data read in */
- if (HDmemcmp(rewrite_obj, shared_robj_g, obj_size))
+ if (HDmemcmp(rewrite_obj, shared_robj_g, obj_size) != 0)
TEST_ERROR
/* Change size of data to write */
@@ -16238,7 +16111,7 @@ test_write(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tparam)
FAIL_STACK_ERROR
/* Compare data read in */
- if (HDmemcmp(rewrite_obj, shared_robj_g, obj_size))
+ if (HDmemcmp(rewrite_obj, shared_robj_g, obj_size) != 0)
TEST_ERROR
/* Change size of data to write */
@@ -16286,21 +16159,18 @@ error:
H5E_END_TRY;
return (1);
} /* test_write() */
-#endif /* QAK */
-
-#ifndef QAK
/*-------------------------------------------------------------------------
- * Function: test_bug1
+ * Function: test_bug1
*
- * Purpose: Test inserting several objects, then deleting one and
+ * Purpose: Test inserting several objects, then deleting one and
* re-inserting an object, along with opening and closing
* the file.
*
- * Return: Success: 0
- * Failure: 1
+ * Return: Success: 0
+ * Failure: 1
*
- * Programmer: Quincey Koziol
+ * Programmer: Quincey Koziol
* Tuesday, November 28, 2006
*
*-------------------------------------------------------------------------
@@ -16461,18 +16331,17 @@ error:
H5E_END_TRY;
return (1);
} /* test_bug1() */
-#endif /* QAK */
/*-------------------------------------------------------------------------
- * Function: main
+ * Function: main
*
- * Purpose: Test the fractal heap code
+ * Purpose: Test the fractal heap code
*
- * Return: Success:
+ * Return: Success:
*
- * Failure:
+ * Failure:
*
- * Programmer: Quincey Koziol
+ * Programmer: Quincey Koziol
* Friday, February 24, 2006
*
*-------------------------------------------------------------------------
@@ -16501,7 +16370,7 @@ main(void)
envval = "nomatch";
/* Current VFD that does not support contigous address space */
- contig_addr_vfd = (hbool_t)(HDstrcmp(envval, "split") && HDstrcmp(envval, "multi"));
+ contig_addr_vfd = (hbool_t)(HDstrcmp(envval, "split") != 0 && HDstrcmp(envval, "multi") != 0);
/* Reset library */
h5_reset();
diff --git a/test/fillval.c b/test/fillval.c
index 673b267..4215c89 100644
--- a/test/fillval.c
+++ b/test/fillval.c
@@ -935,7 +935,8 @@ test_rdwr_cases(hid_t file, hid_t dcpl, const char *dname, void *_fillval, H5D_f
H5_FAILED();
HDfprintf(stdout, "%u: Value read was not a fill value.\n", (unsigned)__LINE__);
HDfprintf(stdout,
- " Elmt={%Hu,%Hu,%Hu,%Hu,%Hu}, read: %u, "
+ " Elmt={%" PRIuHSIZE ",%" PRIuHSIZE ",%" PRIuHSIZE ",%" PRIuHSIZE ",%" PRIuHSIZE
+ "}, read: %u, "
"Fill value: %u\n",
hs_offset[0], hs_offset[1], hs_offset[2], hs_offset[3], hs_offset[4], val_rd,
fillval);
@@ -952,7 +953,8 @@ test_rdwr_cases(hid_t file, hid_t dcpl, const char *dname, void *_fillval, H5D_f
H5_FAILED();
HDfprintf(stdout, "%u: Value read was not a fill value.\n", (unsigned)__LINE__);
HDfprintf(stdout,
- " Elmt={%Hu,%Hu,%Hu,%Hu,%Hu}, read: %f, %d, %f, %c"
+ " Elmt={%" PRIuHSIZE ",%" PRIuHSIZE ",%" PRIuHSIZE ",%" PRIuHSIZE ",%" PRIuHSIZE
+ "}, read: %f, %d, %f, %c"
"Fill value: %f, %d, %f, %c\n",
hs_offset[0], hs_offset[1], hs_offset[2], hs_offset[3], hs_offset[4],
(double)rd_c.a, rd_c.x, rd_c.y, rd_c.z, (double)fill_c.a, fill_c.x, fill_c.y,
@@ -994,7 +996,8 @@ test_rdwr_cases(hid_t file, hid_t dcpl, const char *dname, void *_fillval, H5D_f
H5_FAILED();
HDfprintf(stdout, "%u: Value read was not a fill value.\n", (unsigned)__LINE__);
HDfprintf(stdout,
- " Elmt={%Hu, %Hu, %Hu, %Hu, %Hu}, read: %u, "
+ " Elmt={%" PRIuHSIZE ", %" PRIuHSIZE ", %" PRIuHSIZE ", %" PRIuHSIZE
+ ", %" PRIuHSIZE "}, read: %u, "
"Fill value: %u\n",
hs_offset[0], hs_offset[1], hs_offset[2], hs_offset[3], hs_offset[4], buf[u],
fillval);
@@ -1020,7 +1023,8 @@ test_rdwr_cases(hid_t file, hid_t dcpl, const char *dname, void *_fillval, H5D_f
H5_FAILED();
HDfprintf(stdout, "%u: Value read was not a fill value.\n", (unsigned)__LINE__);
HDfprintf(stdout,
- " Elmt={%Hu, %Hu, %Hu, %Hu, %Hu}, read: %f, %d, %f, %c"
+ " Elmt={%" PRIuHSIZE ", %" PRIuHSIZE ", %" PRIuHSIZE ", %" PRIuHSIZE
+ ", %" PRIuHSIZE "}, read: %f, %d, %f, %c"
"Fill value: %f, %d, %f, %c\n",
hs_offset[0], hs_offset[1], hs_offset[2], hs_offset[3], hs_offset[4],
(double)buf_c[u].a, buf_c[u].x, buf_c[u].y, buf_c[u].z, (double)fill_c.a,
@@ -1445,7 +1449,8 @@ test_extend_verify_integer(unsigned lineno, const hsize_t *offset, const void *_
if (*test_val != *compare_val) {
HDfprintf(stdout, "%u: Value read was not expected.\n", lineno);
HDfprintf(stdout,
- " Elmt = {%Hu, %Hu, %Hu, %Hu, %Hu}, read: %d, "
+ " Elmt = {%" PRIuHSIZE ", %" PRIuHSIZE ", %" PRIuHSIZE ", %" PRIuHSIZE ", %" PRIuHSIZE
+ "}, read: %d, "
"expected: %d\n",
offset[0], offset[1], offset[2], offset[3], offset[4], *test_val, *compare_val);
goto error;
@@ -1536,7 +1541,8 @@ test_extend_verify_cmpd_vl(unsigned lineno, const hsize_t *offset, const void *_
HDstrcmp(test_val->b, compare_val->b) != 0 || (test_val->y != compare_val->y)) {
HDfprintf(stdout, "%u: Value read was not expected.\n", lineno);
HDfprintf(stdout,
- " Elmt = {%Hu, %Hu, %Hu, %Hu, %Hu}, read: {%d, '%s', '%s', %d} "
+ " Elmt = {%" PRIuHSIZE ", %" PRIuHSIZE ", %" PRIuHSIZE ", %" PRIuHSIZE ", %" PRIuHSIZE
+ "}, read: {%d, '%s', '%s', %d} "
"expected: {%d, '%s', '%s', %d}\n",
offset[0], offset[1], offset[2], offset[3], offset[4], test_val->x, test_val->a,
test_val->b, test_val->y, compare_val->x, compare_val->a, compare_val->b, compare_val->y);
diff --git a/test/filter_plugin1_dsets.c b/test/filter_plugin1_dsets.c
index 7f9a664..5d6c1ef 100644
--- a/test/filter_plugin1_dsets.c
+++ b/test/filter_plugin1_dsets.c
@@ -26,14 +26,14 @@ static size_t add_sub_value(unsigned int flags, size_t cd_nelmts, const unsigned
/* Filter class struct */
const H5Z_class2_t FILTER_INFO[1] = {{
- H5Z_CLASS_T_VERS, /* H5Z_class_t version */
- FILTER1_ID, /* Filter ID number */
- 1, /* Encoding enabled */
- 1, /* Decoding enabled */
- "test filter plugin 1", /* Filter name for debugging */
- NULL, /* The "can apply" callback */
- NULL, /* The "set local" callback */
- (H5Z_func_t)add_sub_value, /* The actual filter function */
+ H5Z_CLASS_T_VERS, /* H5Z_class_t version */
+ FILTER1_ID, /* Filter ID number */
+ 1, /* Encoding enabled */
+ 1, /* Decoding enabled */
+ "test filter plugin 1", /* Filter name for debugging */
+ NULL, /* The "can apply" callback */
+ NULL, /* The "set local" callback */
+ add_sub_value, /* The actual filter function */
}};
H5PL_type_t
diff --git a/test/filter_plugin2_dsets.c b/test/filter_plugin2_dsets.c
index 08be78c..d2011d4 100644
--- a/test/filter_plugin2_dsets.c
+++ b/test/filter_plugin2_dsets.c
@@ -27,14 +27,14 @@ static size_t mult_div_value(unsigned int flags, size_t cd_nelmts, const unsigne
/* Filter class struct */
const H5Z_class2_t FILTER_INFO[1] = {{
- H5Z_CLASS_T_VERS, /* H5Z_class_t version */
- FILTER2_ID, /* Filter ID number */
- 1, /* Encoding enabled */
- 1, /* Decoding enabled */
- "test filter plugin 2", /* Filter name for debugging */
- NULL, /* The "can apply" callback */
- NULL, /* The "set local" callback */
- (H5Z_func_t)mult_div_value, /* The actual filter function */
+ H5Z_CLASS_T_VERS, /* H5Z_class_t version */
+ FILTER2_ID, /* Filter ID number */
+ 1, /* Encoding enabled */
+ 1, /* Decoding enabled */
+ "test filter plugin 2", /* Filter name for debugging */
+ NULL, /* The "can apply" callback */
+ NULL, /* The "set local" callback */
+ mult_div_value, /* The actual filter function */
}};
H5PL_type_t
@@ -73,7 +73,7 @@ mult_div_value(unsigned int flags, size_t cd_nelmts, const unsigned int *cd_valu
return 0;
/* Assignment to eliminate unused parameter warning */
- cd_values = cd_values;
+ (void)cd_values;
if (flags & H5Z_FLAG_REVERSE) {
/* READ - Divide the original value by MULTIPLIER */
diff --git a/test/filter_plugin3_dsets.c b/test/filter_plugin3_dsets.c
index 5d8d57f..618ce06 100644
--- a/test/filter_plugin3_dsets.c
+++ b/test/filter_plugin3_dsets.c
@@ -30,14 +30,14 @@ static size_t add_sub_value_hdf5(unsigned int flags, size_t cd_nelmts, const uns
/* Filter class struct */
const H5Z_class2_t FILTER_INFO[1] = {{
- H5Z_CLASS_T_VERS, /* H5Z_class_t version */
- FILTER3_ID, /* Filter ID number */
- 1, /* Encoding enabled */
- 1, /* Decoding enabled */
- "test filter plugin 3", /* Filter name for debugging */
- NULL, /* The "can apply" callback */
- NULL, /* The "set local" callback */
- (H5Z_func_t)add_sub_value_hdf5, /* The actual filter function */
+ H5Z_CLASS_T_VERS, /* H5Z_class_t version */
+ FILTER3_ID, /* Filter ID number */
+ 1, /* Encoding enabled */
+ 1, /* Decoding enabled */
+ "test filter plugin 3", /* Filter name for debugging */
+ NULL, /* The "can apply" callback */
+ NULL, /* The "set local" callback */
+ add_sub_value_hdf5, /* The actual filter function */
}};
H5PL_type_t
diff --git a/test/filter_plugin4_groups.c b/test/filter_plugin4_groups.c
index 237642d..630dcd6 100644
--- a/test/filter_plugin4_groups.c
+++ b/test/filter_plugin4_groups.c
@@ -29,14 +29,14 @@ static size_t append_to_group_name(unsigned int flags, size_t cd_nelmts, const u
/* Filter class struct */
const H5Z_class2_t FILTER_INFO[1] = {{
- H5Z_CLASS_T_VERS, /* H5Z_class_t version */
- FILTER4_ID, /* Filter ID number */
- 1, /* Encoding enabled */
- 1, /* Decoding enabled */
- "test filter plugin 4", /* Filter name for debugging */
- NULL, /* The "can apply" callback */
- NULL, /* The "set local" callback */
- (H5Z_func_t)append_to_group_name, /* The actual filter function */
+ H5Z_CLASS_T_VERS, /* H5Z_class_t version */
+ FILTER4_ID, /* Filter ID number */
+ 1, /* Encoding enabled */
+ 1, /* Decoding enabled */
+ "test filter plugin 4", /* Filter name for debugging */
+ NULL, /* The "can apply" callback */
+ NULL, /* The "set local" callback */
+ append_to_group_name, /* The actual filter function */
}};
H5PL_type_t
@@ -74,7 +74,7 @@ append_to_group_name(unsigned int flags, size_t cd_nelmts, const unsigned int *c
return 0;
/* Assignment to eliminate unused parameter warning. */
- cd_values = cd_values;
+ (void)cd_values;
if (flags & H5Z_FLAG_REVERSE) {
/* READ - Remove the suffix from the group name */
diff --git a/test/freespace.c b/test/freespace.c
index 52fd097..e888b2b 100644
--- a/test/freespace.c
+++ b/test/freespace.c
@@ -400,22 +400,27 @@ check_stats(const H5F_t *f, const H5FS_t *frsp, frspace_state_t *state)
FAIL_STACK_ERROR
if (frspace_stats.tot_space != state->tot_space) {
- HDfprintf(stdout, "frspace_stats.tot_space = %Hu, state->tot_space = %Zu\n", frspace_stats.tot_space,
- state->tot_space);
+ HDfprintf(stdout, "frspace_stats.tot_space = %" PRIuHSIZE ", state->tot_space = %" PRIuHSIZE "\n",
+ frspace_stats.tot_space, state->tot_space);
TEST_ERROR
} /* end if */
if (frspace_stats.tot_sect_count != state->tot_sect_count) {
- HDfprintf(stdout, "frspace_stats.tot_sect_count = %Hu, state->tot_sect_count = %Hu\n",
+ HDfprintf(stdout,
+ "frspace_stats.tot_sect_count = %" PRIuHSIZE ", state->tot_sect_count = %" PRIuHSIZE "\n",
frspace_stats.tot_sect_count, state->tot_sect_count);
TEST_ERROR
} /* end if */
if (frspace_stats.serial_sect_count != state->serial_sect_count) {
- HDfprintf(stdout, "frspace_stats.serial_sect_count = %Hu, state->serial_sect_count = %Hu\n",
+ HDfprintf(stdout,
+ "frspace_stats.serial_sect_count = %" PRIuHSIZE ", state->serial_sect_count = %" PRIuHSIZE
+ "\n",
frspace_stats.serial_sect_count, state->serial_sect_count);
TEST_ERROR
} /* end if */
if (frspace_stats.ghost_sect_count != state->ghost_sect_count) {
- HDfprintf(stdout, "frspace_stats.ghost_sect_count = %Hu, state->ghost_sect_count = %Hu\n",
+ HDfprintf(stdout,
+ "frspace_stats.ghost_sect_count = %" PRIuHSIZE ", state->ghost_sect_count = %" PRIuHSIZE
+ "\n",
frspace_stats.ghost_sect_count, state->ghost_sect_count);
TEST_ERROR
} /* end if */
diff --git a/test/gen_new_array.c b/test/gen_new_array.c
index 7fe4686..5811106 100644
--- a/test/gen_new_array.c
+++ b/test/gen_new_array.c
@@ -12,7 +12,7 @@
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
/*
- * Programmer: Quincey Koziol <koziol@ncsa.uiuc.edu>
+ * Programmer: Quincey Koziol
* Thursday, November 09, 2000
*
* Purpose: Create a two datasets, one with a compound datatypes with array
diff --git a/test/gen_new_fill.c b/test/gen_new_fill.c
index 58afecb..2c18f59 100644
--- a/test/gen_new_fill.c
+++ b/test/gen_new_fill.c
@@ -12,7 +12,7 @@
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
/*
- * Programmer: Raymond Lu <slu@ncsa.uiuc.edu>
+ * Programmer: Raymond Lu
* Feb 27, 2002
*
* Purpose: This program is run to generate a HDF5 data file with fill
diff --git a/test/gen_new_group.c b/test/gen_new_group.c
index 489f409..3557192 100644
--- a/test/gen_new_group.c
+++ b/test/gen_new_group.c
@@ -12,7 +12,7 @@
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
/*
- * Programmer: Quincey Koziol <koziol@ncsa.uiuc.edu>
+ * Programmer: Quincey Koziol
* Oct 24, 2005
*
* Purpose: This program is run to generate an HDF5 data file with both
diff --git a/test/gen_new_mtime.c b/test/gen_new_mtime.c
index baf4dd0..bb977ad 100644
--- a/test/gen_new_mtime.c
+++ b/test/gen_new_mtime.c
@@ -12,7 +12,7 @@
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
/*
- * Programmer: Quincey Koziol <koziol@ncsa.uiuc.edu>
+ * Programmer: Quincey Koziol
* Friday, January 3, 2003
*
* Purpose: Create a dataset, which should have the newer mtime information
diff --git a/test/gen_new_super.c b/test/gen_new_super.c
index ec2e93b..ce2f88a 100644
--- a/test/gen_new_super.c
+++ b/test/gen_new_super.c
@@ -12,7 +12,7 @@
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
/*
- * Programmer: Quincey Koziol <koziol@ncsa.uiuc.edu>
+ * Programmer: Quincey Koziol
* Tuesday, July 15, 2003
*
* Purpose: Create a file which will have the newer superblock format.
diff --git a/test/gen_old_array.c b/test/gen_old_array.c
index ad798a8..9755896 100644
--- a/test/gen_old_array.c
+++ b/test/gen_old_array.c
@@ -12,7 +12,7 @@
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
/*
- * Programmer: Quincey Koziol <koziol@ncsa.uiuc.edu>
+ * Programmer: Quincey Koziol
* Thursday, November 09, 2000
*
* Purpose: Create a two datasets with compound datatypes, one with no array
diff --git a/test/gen_old_group.c b/test/gen_old_group.c
index faa9532..1b4e0b2 100644
--- a/test/gen_old_group.c
+++ b/test/gen_old_group.c
@@ -12,7 +12,7 @@
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
/*
- * Programmer: Quincey Koziol <koziol@ncsa.uiuc.edu>
+ * Programmer: Quincey Koziol
* Oct 24, 2005
*
* Purpose: This program is run to generate an HDF5 data file with an
diff --git a/test/gen_old_layout.c b/test/gen_old_layout.c
index 34eb2f5..4412078 100644
--- a/test/gen_old_layout.c
+++ b/test/gen_old_layout.c
@@ -12,7 +12,7 @@
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
/*
- * Programmer: Quincey Koziol <koziol@ncsa.uiuc.edu>
+ * Programmer: Quincey Koziol
* Thursday, May 27, 2004
*
* Purpose: Create two datasets (one for version 1 and one for version 2 of
diff --git a/test/gen_old_mtime.c b/test/gen_old_mtime.c
index 90fc561..0ec3486 100644
--- a/test/gen_old_mtime.c
+++ b/test/gen_old_mtime.c
@@ -12,7 +12,7 @@
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
/*
- * Programmer: Quincey Koziol <koziol@ncsa.uiuc.edu>
+ * Programmer: Quincey Koziol
* Friday, January 3, 2003
*
* Purpose: Create a dataset, which should have the older mtime information
diff --git a/test/gen_plist.c b/test/gen_plist.c
index 8bae408..7a67c56 100644
--- a/test/gen_plist.c
+++ b/test/gen_plist.c
@@ -459,7 +459,7 @@ encode_plist(hid_t plist_id, int little_endian, int word_length, const char *fil
if ((ret = H5Pencode2(plist_id, NULL, &temp_size, H5P_DEFAULT)) < 0)
HDassert(ret > 0);
- temp_buf = HDcalloc(1, temp_size);
+ temp_buf = (void *)HDmalloc(temp_size);
HDassert(temp_buf);
if ((ret = H5Pencode2(plist_id, temp_buf, &temp_size, H5P_DEFAULT)) < 0)
diff --git a/test/gen_sizes_lheap.c b/test/gen_sizes_lheap.c
index a94789b..8f090e8 100644
--- a/test/gen_sizes_lheap.c
+++ b/test/gen_sizes_lheap.c
@@ -12,7 +12,7 @@
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
/*
- * Programmer: Neil Fortner <nfortne2@hdfgroup.org>
+ * Programmer: Neil Fortner
* Thursday, July 15, 2010
*
* Purpose: Creates a file with non-default sizes of lengths and addresses.
diff --git a/test/gen_specmetaread.c b/test/gen_specmetaread.c
index 0664390..5ec1f98 100644
--- a/test/gen_specmetaread.c
+++ b/test/gen_specmetaread.c
@@ -12,7 +12,7 @@
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
/*
- * Programmer: Quincey Koziol <koziol@hdfgroup.org>
+ * Programmer: Quincey Koziol
* Thursday, October 8, 2009
*
* Purpose: Create a file with a dataset who's raw data immediately follows
diff --git a/test/gen_udlinks.c b/test/gen_udlinks.c
index 4b68647..d41625a 100644
--- a/test/gen_udlinks.c
+++ b/test/gen_udlinks.c
@@ -12,7 +12,7 @@
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
/*
- * Programmer: James Laird <jlaird@hdfgroup.org>
+ * Programmer: James Laird
* Tuesday, June 6, 2006
*
* This program creates HDF5 files with user-defined links. These files
diff --git a/test/h5test.c b/test/h5test.c
index 0d9fccd..3c37cf9 100644
--- a/test/h5test.c
+++ b/test/h5test.c
@@ -183,8 +183,6 @@ h5_clean_files(const char *base_name[], hid_t fapl)
/* Close the FAPL used to access the file */
H5Pclose(fapl);
-
- return;
} /* end h5_clean_files() */
/*-------------------------------------------------------------------------
@@ -204,66 +202,22 @@ h5_clean_files(const char *base_name[], hid_t fapl)
*
*-------------------------------------------------------------------------
*/
-/* Disable warning for "format not a string literal" here -QAK */
-/*
- * This pragma only needs to surround the snprintf() calls with
- * sub_filename in the code below, but early (4.4.7, at least) gcc only
- * allows diagnostic pragmas to be toggled outside of functions.
- */
-H5_GCC_DIAG_OFF("format-nonliteral")
void
h5_delete_test_file(const char *base_name, hid_t fapl)
{
- char filename[1024]; /* VFD-dependent filename to delete */
- char sub_filename[2048]; /* sub-files in multi & family VFDs */
- hid_t driver = -1; /* VFD ID */
+ char filename[1024]; /* VFD-dependent filename to delete */
/* Get the VFD-dependent filename */
if (NULL == h5_fixname(base_name, fapl, filename, sizeof(filename)))
return;
- driver = H5Pget_driver(fapl);
-
- if (driver == H5FD_FAMILY) {
- int j;
- for (j = 0; /*void*/; j++) {
- HDsnprintf(sub_filename, sizeof(sub_filename), filename, j);
-
- /* If we can't access the file, it probably doesn't exist
- * and we are done deleting the sub-files.
- */
- if (HDaccess(sub_filename, F_OK) < 0)
- break;
-
- HDremove(sub_filename);
- } /* end for */
- }
- else if (driver == H5FD_CORE) {
- hbool_t backing; /* Whether the core file has backing store */
-
- H5Pget_fapl_core(fapl, NULL, &backing);
-
- /* If the file was stored to disk with bacing store, remove it */
- if (backing)
- HDremove(filename);
- }
- else if (driver == H5FD_MULTI) {
- H5FD_mem_t mt;
-
- HDassert(HDstrlen(multi_letters) == H5FD_MEM_NTYPES);
-
- for (mt = H5FD_MEM_DEFAULT; mt < H5FD_MEM_NTYPES; mt++) {
- HDsnprintf(sub_filename, sizeof(sub_filename), "%s-%c.h5", filename, multi_letters[mt]);
- HDremove(sub_filename);
- }
+ H5E_BEGIN_TRY
+ {
+ H5Fdelete(filename, fapl);
}
- else {
- HDremove(filename);
- } /* end driver selection tree */
+ H5E_END_TRY;
- return;
} /* end h5_delete_test_file() */
-H5_GCC_DIAG_ON("format-nonliteral")
/*-------------------------------------------------------------------------
* Function: h5_delete_all_test_files
@@ -294,7 +248,6 @@ h5_delete_all_test_files(const char *base_name[], hid_t fapl)
h5_delete_test_file(base_name[i], fapl);
} /* end for */
- return;
} /* end h5_delete_all_test_files() */
/*-------------------------------------------------------------------------
@@ -353,8 +306,6 @@ h5_test_shutdown(void)
/* Restore the original error reporting routine */
h5_restore_err();
-
- return;
} /* end h5_test_shutdown() */
/*-------------------------------------------------------------------------
@@ -461,8 +412,6 @@ h5_test_init(void)
HDassert(err_func == NULL);
H5Eget_auto2(H5E_DEFAULT, &err_func, NULL);
H5Eset_auto2(H5E_DEFAULT, h5_errors, NULL);
-
- return;
} /* end h5_test_init() */
/*-------------------------------------------------------------------------
@@ -1983,6 +1932,7 @@ static const H5FD_class_t H5FD_dummy_g = {
NULL, /* truncate */
NULL, /* lock */
NULL, /* unlock */
+ NULL, /* del */
NULL, /* dedup */
H5FD_FLMAP_DICHOTOMY /* fl_map */
};
@@ -2059,7 +2009,8 @@ h5_get_dummy_vol_class(void)
/* Fill in the minimum parameters to make a VOL connector class that
* can be registered.
*/
- vol_class->name = "dummy";
+ vol_class->version = H5VL_VERSION;
+ vol_class->name = "dummy";
return vol_class;
diff --git a/test/hyperslab.c b/test/hyperslab.c
index a867430..41528ad 100644
--- a/test/hyperslab.c
+++ b/test/hyperslab.c
@@ -1114,8 +1114,8 @@ test_array_offset_n_calc(size_t n, size_t x, size_t y, size_t z)
/* Check computed coordinates */
for (v = 0; v < ARRAY_OFFSET_NDIMS; v++)
if (coords[v] != new_coords[v]) {
- HDfprintf(stderr, "coords[%u]=%Hu, new_coords[%u]=%Hu\n", (unsigned)v, coords[v], (unsigned)v,
- new_coords[v]);
+ HDfprintf(stderr, "coords[%zu]=%" PRIuHSIZE ", new_coords[%zu]=%" PRIuHSIZE "\n", v,
+ coords[v], v, new_coords[v]);
TEST_ERROR;
} /* end if */
} /* end for */
diff --git a/test/links_env.c b/test/links_env.c
index 250e786..590be20 100644
--- a/test/links_env.c
+++ b/test/links_env.c
@@ -69,7 +69,7 @@ external_link_env(hid_t fapl, hbool_t new_format)
if ((envval = HDgetenv("HDF5_EXT_PREFIX")) == NULL)
envval = "nomatch";
- if (HDstrcmp(envval, ".:tmp_links_env"))
+ if (HDstrcmp(envval, ".:tmp_links_env") != 0)
TEST_ERROR
/* Set up name for main file:"extlinks_env0" */
@@ -115,7 +115,7 @@ external_link_env(hid_t fapl, hbool_t new_format)
/* Should be able to find the target file from pathnames set via HDF5_EXT_PREFIX */
if (gid < 0) {
H5_FAILED();
- puts(" Should have found the file in tmp_links_env directory.");
+ HDputs(" Should have found the file in tmp_links_env directory.");
goto error;
}
diff --git a/test/mf.c b/test/mf.c
index c53b6f1..c753c2b 100644
--- a/test/mf.c
+++ b/test/mf.c
@@ -168,22 +168,27 @@ check_stats(const H5F_t *f, const H5FS_t *frsp, H5FS_stat_t *state)
FAIL_STACK_ERROR
if (frspace_stats.tot_space != state->tot_space) {
- HDfprintf(stdout, "frspace_stats.tot_space = %Hu, state->tot_space = %Zu\n", frspace_stats.tot_space,
- state->tot_space);
+ HDfprintf(stdout, "frspace_stats.tot_space = %" PRIuHSIZE ", state->tot_space = %" PRIuHSIZE "\n",
+ frspace_stats.tot_space, state->tot_space);
TEST_ERROR
} /* end if */
if (frspace_stats.tot_sect_count != state->tot_sect_count) {
- HDfprintf(stdout, "frspace_stats.tot_sect_count = %Hu, state->tot_sect_count = %Hu\n",
+ HDfprintf(stdout,
+ "frspace_stats.tot_sect_count = %" PRIuHSIZE ", state->tot_sect_count = %" PRIuHSIZE "\n",
frspace_stats.tot_sect_count, state->tot_sect_count);
TEST_ERROR
} /* end if */
if (frspace_stats.serial_sect_count != state->serial_sect_count) {
- HDfprintf(stdout, "frspace_stats.serial_sect_count = %Hu, state->serial_sect_count = %Hu\n",
+ HDfprintf(stdout,
+ "frspace_stats.serial_sect_count = %" PRIuHSIZE ", state->serial_sect_count = %" PRIuHSIZE
+ "\n",
frspace_stats.serial_sect_count, state->serial_sect_count);
TEST_ERROR
} /* end if */
if (frspace_stats.ghost_sect_count != state->ghost_sect_count) {
- HDfprintf(stdout, "frspace_stats.ghost_sect_count = %Hu, state->ghost_sect_count = %Hu\n",
+ HDfprintf(stdout,
+ "frspace_stats.ghost_sect_count = %" PRIuHSIZE ", state->ghost_sect_count = %" PRIuHSIZE
+ "\n",
frspace_stats.ghost_sect_count, state->ghost_sect_count);
TEST_ERROR
} /* end if */
@@ -225,7 +230,7 @@ test_mf_eoa(const char *env_h5_drvr, hid_t fapl)
/* Skip test when using VFDs that has different address spaces for each
* type of metadata allocation.
*/
- contig_addr_vfd = (hbool_t)(HDstrcmp(env_h5_drvr, "split") && HDstrcmp(env_h5_drvr, "multi"));
+ contig_addr_vfd = (hbool_t)(HDstrcmp(env_h5_drvr, "split") != 0 && HDstrcmp(env_h5_drvr, "multi") != 0);
if (contig_addr_vfd) {
/* Set the filename to use for this test */
h5_fixname(FILENAME[0], fapl, filename, sizeof(filename));
@@ -373,7 +378,7 @@ test_mf_eoa_shrink(const char *env_h5_drvr, hid_t fapl)
/* Skip test when using VFDs that has different address spaces for each
* type of metadata allocation.
*/
- contig_addr_vfd = (hbool_t)(HDstrcmp(env_h5_drvr, "split") && HDstrcmp(env_h5_drvr, "multi"));
+ contig_addr_vfd = (hbool_t)(HDstrcmp(env_h5_drvr, "split") != 0 && HDstrcmp(env_h5_drvr, "multi") != 0);
if (contig_addr_vfd) {
/* Set the filename to use for this test (dependent on fapl) */
h5_fixname(FILENAME[0], fapl, filename, sizeof(filename));
@@ -660,7 +665,7 @@ test_mf_eoa_extend(const char *env_h5_drvr, hid_t fapl)
/* Skip test when using VFDs that has different address spaces for each
* type of metadata allocation.
*/
- contig_addr_vfd = (hbool_t)(HDstrcmp(env_h5_drvr, "split") && HDstrcmp(env_h5_drvr, "multi"));
+ contig_addr_vfd = (hbool_t)(HDstrcmp(env_h5_drvr, "split") != 0 && HDstrcmp(env_h5_drvr, "multi") != 0);
if (contig_addr_vfd) {
/* Set the filename to use for this test (dependent on fapl) */
h5_fixname(FILENAME[0], fapl, filename, sizeof(filename));
@@ -867,7 +872,8 @@ test_mf_tmp(const char *env_h5_drvr, hid_t fapl, hbool_t new_format)
TESTING("'temporary' file space allocation with old library format")
/* Can't run this test with multi-file VFDs */
- if (HDstrcmp(env_h5_drvr, "split") && HDstrcmp(env_h5_drvr, "multi") && HDstrcmp(env_h5_drvr, "family")) {
+ if (HDstrcmp(env_h5_drvr, "split") != 0 && HDstrcmp(env_h5_drvr, "multi") != 0 &&
+ HDstrcmp(env_h5_drvr, "family") != 0) {
char filename[FILENAME_LEN]; /* Filename to use */
H5F_t * f = NULL; /* Internal file object pointer */
h5_stat_size_t file_size, new_file_size; /* file size */
@@ -2011,7 +2017,7 @@ test_mf_fs_absorb(const char *env_h5_drvr, hid_t fapl)
TESTING("A free-space section absorbs an aggregator: test 1");
/* Skip test when using VFDs that don't use the metadata aggregator */
- contig_addr_vfd = (hbool_t)(HDstrcmp(env_h5_drvr, "split") && HDstrcmp(env_h5_drvr, "multi"));
+ contig_addr_vfd = (hbool_t)(HDstrcmp(env_h5_drvr, "split") != 0 && HDstrcmp(env_h5_drvr, "multi") != 0);
if (contig_addr_vfd) {
/* Set the filename to use for this test (dependent on fapl) */
h5_fixname(FILENAME[0], fapl, filename, sizeof(filename));
@@ -2187,7 +2193,7 @@ test_mf_aggr_alloc1(const char *env_h5_drvr, hid_t fapl)
TESTING("H5MF_alloc() of meta/sdata aggregator:test 1");
/* Skip test when using VFDs that don't use the metadata aggregator */
- contig_addr_vfd = (hbool_t)(HDstrcmp(env_h5_drvr, "split") && HDstrcmp(env_h5_drvr, "multi"));
+ contig_addr_vfd = (hbool_t)(HDstrcmp(env_h5_drvr, "split") != 0 && HDstrcmp(env_h5_drvr, "multi") != 0);
if (contig_addr_vfd) {
/* Set the filename to use for this test (dependent on fapl) */
h5_fixname(FILENAME[0], fapl, filename, sizeof(filename));
@@ -2338,7 +2344,7 @@ test_mf_aggr_alloc2(const char *env_h5_drvr, hid_t fapl)
TESTING("H5MF_alloc() of meta/sdata aggregator:test 2");
/* Skip test when using VFDs that don't use the metadata aggregator */
- contig_addr_vfd = (hbool_t)(HDstrcmp(env_h5_drvr, "split") && HDstrcmp(env_h5_drvr, "multi"));
+ contig_addr_vfd = (hbool_t)(HDstrcmp(env_h5_drvr, "split") != 0 && HDstrcmp(env_h5_drvr, "multi") != 0);
if (contig_addr_vfd) {
/* Set the filename to use for this test (dependent on fapl) */
h5_fixname(FILENAME[0], fapl, filename, sizeof(filename));
@@ -2496,7 +2502,7 @@ test_mf_aggr_alloc3(const char *env_h5_drvr, hid_t fapl)
TESTING("H5MF_alloc() of meta/sdata aggregator: test 3");
/* Skip test when using VFDs that don't use the metadata aggregator */
- contig_addr_vfd = (hbool_t)(HDstrcmp(env_h5_drvr, "split") && HDstrcmp(env_h5_drvr, "multi"));
+ contig_addr_vfd = (hbool_t)(HDstrcmp(env_h5_drvr, "split") != 0 && HDstrcmp(env_h5_drvr, "multi") != 0);
if (contig_addr_vfd) {
/* Set the filename to use for this test (dependent on fapl) */
h5_fixname(FILENAME[0], fapl, filename, sizeof(filename));
@@ -2664,7 +2670,7 @@ test_mf_aggr_alloc4(const char *env_h5_drvr, hid_t fapl)
TESTING("H5MF_alloc() of meta/sdata aggregator:test 4");
/* Skip test when using VFDs that don't use the metadata aggregator */
- contig_addr_vfd = (hbool_t)(HDstrcmp(env_h5_drvr, "split") && HDstrcmp(env_h5_drvr, "multi"));
+ contig_addr_vfd = (hbool_t)(HDstrcmp(env_h5_drvr, "split") != 0 && HDstrcmp(env_h5_drvr, "multi") != 0);
if (contig_addr_vfd) {
/* Set the filename to use for this test (dependent on fapl) */
h5_fixname(FILENAME[0], fapl, filename, sizeof(filename));
@@ -2813,7 +2819,7 @@ test_mf_aggr_alloc5(const char *env_h5_drvr, hid_t fapl)
TESTING("H5MF_alloc() of meta/sdata aggregator:test 5");
/* Skip test when using VFDs that don't use the metadata aggregator */
- contig_addr_vfd = (hbool_t)(HDstrcmp(env_h5_drvr, "split") && HDstrcmp(env_h5_drvr, "multi"));
+ contig_addr_vfd = (hbool_t)(HDstrcmp(env_h5_drvr, "split") != 0 && HDstrcmp(env_h5_drvr, "multi") != 0);
if (contig_addr_vfd) {
/* Set the filename to use for this test (dependent on fapl) */
h5_fixname(FILENAME[0], fapl, filename, sizeof(filename));
@@ -2951,7 +2957,7 @@ test_mf_aggr_alloc6(const char *env_h5_drvr, hid_t fapl)
TESTING("H5MF_alloc() of meta/sdata aggregator:test 6");
/* Skip test when using VFDs that don't use the metadata aggregator */
- contig_addr_vfd = (hbool_t)(HDstrcmp(env_h5_drvr, "split") && HDstrcmp(env_h5_drvr, "multi"));
+ contig_addr_vfd = (hbool_t)(HDstrcmp(env_h5_drvr, "split") != 0 && HDstrcmp(env_h5_drvr, "multi") != 0);
if (contig_addr_vfd) {
/* Set the filename to use for this test (dependent on fapl) */
h5_fixname(FILENAME[0], fapl, filename, sizeof(filename));
@@ -3125,7 +3131,7 @@ test_mf_aggr_alloc7(const char *env_h5_drvr, hid_t fapl)
TESTING("H5MF_alloc() of meta/sdata aggregator:test 7");
/* Skip test when using VFDs that don't use the metadata aggregator */
- contig_addr_vfd = (hbool_t)(HDstrcmp(env_h5_drvr, "split") && HDstrcmp(env_h5_drvr, "multi"));
+ contig_addr_vfd = (hbool_t)(HDstrcmp(env_h5_drvr, "split") != 0 && HDstrcmp(env_h5_drvr, "multi") != 0);
if (contig_addr_vfd) {
/* Set the filename to use for this test (dependent on fapl) */
h5_fixname(FILENAME[0], fapl, filename, sizeof(filename));
@@ -3296,7 +3302,7 @@ test_mf_aggr_extend(const char *env_h5_drvr, hid_t fapl)
TESTING("H5MF_try_extend() of meta/sdata aggregator: test 1");
/* Skip test when using VFDs that don't use the metadata aggregator */
- contig_addr_vfd = (hbool_t)(HDstrcmp(env_h5_drvr, "split") && HDstrcmp(env_h5_drvr, "multi"));
+ contig_addr_vfd = (hbool_t)(HDstrcmp(env_h5_drvr, "split") != 0 && HDstrcmp(env_h5_drvr, "multi") != 0);
if (contig_addr_vfd) {
/* Set the filename to use for this test (dependent on fapl) */
h5_fixname(FILENAME[0], fapl, filename, sizeof(filename));
@@ -3594,7 +3600,7 @@ test_mf_aggr_absorb(const char *env_h5_drvr, hid_t fapl)
TESTING("H5MF_try_shrink() of meta/sdata aggregator: test 1");
/* Skip test when using VFDs that don't use the metadata aggregator */
- contig_addr_vfd = (hbool_t)(HDstrcmp(env_h5_drvr, "split") && HDstrcmp(env_h5_drvr, "multi"));
+ contig_addr_vfd = (hbool_t)(HDstrcmp(env_h5_drvr, "split") != 0 && HDstrcmp(env_h5_drvr, "multi") != 0);
if (contig_addr_vfd) {
/* Set the filename to use for this test (dependent on fapl) */
h5_fixname(FILENAME[0], fapl, filename, sizeof(filename));
@@ -3848,8 +3854,8 @@ test_mf_align_eoa(const char *env_h5_drvr, hid_t fapl, hid_t new_fapl)
/* Skip test when using VFDs that have their own 'alloc' callback, which
* don't push mis-aligned space fragments on the file free space list
*/
- have_alloc_vfd = (hbool_t)(HDstrcmp(env_h5_drvr, "stdio") && HDstrcmp(env_h5_drvr, "split") &&
- HDstrcmp(env_h5_drvr, "multi"));
+ have_alloc_vfd = (hbool_t)(HDstrcmp(env_h5_drvr, "stdio") != 0 && HDstrcmp(env_h5_drvr, "split") != 0 &&
+ HDstrcmp(env_h5_drvr, "multi") != 0);
if (have_alloc_vfd) {
/* Set the filename to use for this test (dependent on fapl) */
h5_fixname(FILENAME[0], fapl, filename, sizeof(filename));
@@ -4292,8 +4298,8 @@ test_mf_align_fs(const char *env_h5_drvr, hid_t fapl, hid_t new_fapl)
/* Skip test when using VFDs that have their own 'alloc' callback, which
* don't push mis-aligned space fragments on the file free space list
*/
- have_alloc_vfd = (hbool_t)(HDstrcmp(env_h5_drvr, "stdio") && HDstrcmp(env_h5_drvr, "split") &&
- HDstrcmp(env_h5_drvr, "multi"));
+ have_alloc_vfd = (hbool_t)(HDstrcmp(env_h5_drvr, "stdio") != 0 && HDstrcmp(env_h5_drvr, "split") != 0 &&
+ HDstrcmp(env_h5_drvr, "multi") != 0);
if (have_alloc_vfd) {
if ((file_size = h5_get_file_size(filename, new_fapl)) < 0)
TEST_ERROR
@@ -4498,8 +4504,8 @@ test_mf_align_alloc1(const char *env_h5_drvr, hid_t fapl, hid_t new_fapl)
/* Skip test when using VFDs that have their own 'alloc' callback, which
* don't push mis-aligned space fragments on the file free space list
*/
- have_alloc_vfd = (hbool_t)(HDstrcmp(env_h5_drvr, "stdio") && HDstrcmp(env_h5_drvr, "split") &&
- HDstrcmp(env_h5_drvr, "multi"));
+ have_alloc_vfd = (hbool_t)(HDstrcmp(env_h5_drvr, "stdio") != 0 && HDstrcmp(env_h5_drvr, "split") != 0 &&
+ HDstrcmp(env_h5_drvr, "multi") != 0);
if (have_alloc_vfd) {
/* Set the filename to use for this test (dependent on fapl) */
h5_fixname(FILENAME[0], fapl, filename, sizeof(filename));
@@ -4760,8 +4766,8 @@ test_mf_align_alloc2(const char *env_h5_drvr, hid_t fapl, hid_t new_fapl)
/* Skip test when using VFDs that have their own 'alloc' callback, which
* don't push mis-aligned space fragments on the file free space list
*/
- have_alloc_vfd = (hbool_t)(HDstrcmp(env_h5_drvr, "stdio") && HDstrcmp(env_h5_drvr, "split") &&
- HDstrcmp(env_h5_drvr, "multi"));
+ have_alloc_vfd = (hbool_t)(HDstrcmp(env_h5_drvr, "stdio") != 0 && HDstrcmp(env_h5_drvr, "split") != 0 &&
+ HDstrcmp(env_h5_drvr, "multi") != 0);
if (have_alloc_vfd) {
/* Set the filename to use for this test (dependent on fapl) */
h5_fixname(FILENAME[0], fapl, filename, sizeof(filename));
@@ -5105,8 +5111,8 @@ test_mf_align_alloc3(const char *env_h5_drvr, hid_t fapl, hid_t new_fapl)
/* Skip test when using VFDs that have their own 'alloc' callback, which
* don't push mis-aligned space fragments on the file free space list
*/
- have_alloc_vfd = (hbool_t)(HDstrcmp(env_h5_drvr, "stdio") && HDstrcmp(env_h5_drvr, "split") &&
- HDstrcmp(env_h5_drvr, "multi"));
+ have_alloc_vfd = (hbool_t)(HDstrcmp(env_h5_drvr, "stdio") != 0 && HDstrcmp(env_h5_drvr, "split") != 0 &&
+ HDstrcmp(env_h5_drvr, "multi") != 0);
if (have_alloc_vfd) {
/* Set the filename to use for this test (dependent on fapl) */
h5_fixname(FILENAME[0], fapl, filename, sizeof(filename));
@@ -5418,8 +5424,8 @@ test_mf_align_alloc4(const char *env_h5_drvr, hid_t fapl, hid_t new_fapl)
/* Skip test when using VFDs that have their own 'alloc' callback, which
* don't push mis-aligned space fragments on the file free space list
*/
- have_alloc_vfd = (hbool_t)(HDstrcmp(env_h5_drvr, "stdio") && HDstrcmp(env_h5_drvr, "split") &&
- HDstrcmp(env_h5_drvr, "multi"));
+ have_alloc_vfd = (hbool_t)(HDstrcmp(env_h5_drvr, "stdio") != 0 && HDstrcmp(env_h5_drvr, "split") != 0 &&
+ HDstrcmp(env_h5_drvr, "multi") != 0);
if (have_alloc_vfd) {
/* Set the filename to use for this test (dependent on fapl) */
h5_fixname(FILENAME[0], fapl, filename, sizeof(filename));
@@ -5636,8 +5642,8 @@ test_mf_align_alloc5(const char *env_h5_drvr, hid_t fapl, hid_t new_fapl)
/* Skip test when using VFDs that have their own 'alloc' callback, which
* don't push mis-aligned space fragments on the file free space list
*/
- have_alloc_vfd = (hbool_t)(HDstrcmp(env_h5_drvr, "stdio") && HDstrcmp(env_h5_drvr, "split") &&
- HDstrcmp(env_h5_drvr, "multi"));
+ have_alloc_vfd = (hbool_t)(HDstrcmp(env_h5_drvr, "stdio") != 0 && HDstrcmp(env_h5_drvr, "split") != 0 &&
+ HDstrcmp(env_h5_drvr, "multi") != 0);
if (have_alloc_vfd) {
/* Set the filename to use for this test (dependent on fapl) */
h5_fixname(FILENAME[0], fapl, filename, sizeof(filename));
@@ -5906,8 +5912,8 @@ test_mf_align_alloc6(const char *env_h5_drvr, hid_t fapl, hid_t new_fapl)
/* Skip test when using VFDs that have their own 'alloc' callback, which
* don't push mis-aligned space fragments on the file free space list
*/
- have_alloc_vfd = (hbool_t)(HDstrcmp(env_h5_drvr, "stdio") && HDstrcmp(env_h5_drvr, "split") &&
- HDstrcmp(env_h5_drvr, "multi"));
+ have_alloc_vfd = (hbool_t)(HDstrcmp(env_h5_drvr, "stdio") != 0 && HDstrcmp(env_h5_drvr, "split") != 0 &&
+ HDstrcmp(env_h5_drvr, "multi") != 0);
if (have_alloc_vfd) {
/* Set the filename to use for this test (dependent on fapl) */
h5_fixname(FILENAME[0], fapl, filename, sizeof(filename));
@@ -6176,7 +6182,7 @@ test_mf_bug1(const char *env_h5_drvr, hid_t fapl)
/* Free memb_name */
for (mt = H5FD_MEM_DEFAULT; mt < H5FD_MEM_NTYPES; mt++)
- free(memb_name[mt]);
+ HDfree(memb_name[mt]);
} /* end else */
/* Close memb_fapl */
@@ -6923,7 +6929,7 @@ test_mf_fs_persist(const char *env_h5_drvr, hid_t fapl, hbool_t new_format)
else
TESTING("File's free-space is persistent with old library format")
- if (HDstrcmp(env_h5_drvr, "split") && HDstrcmp(env_h5_drvr, "multi")) {
+ if (HDstrcmp(env_h5_drvr, "split") != 0 && HDstrcmp(env_h5_drvr, "multi") != 0) {
/* File creation property list template */
if ((fcpl = H5Pcreate(H5P_FILE_CREATE)) < 0)
@@ -7100,7 +7106,7 @@ test_mf_fs_gone(const char *env_h5_drvr, hid_t fapl, hbool_t new_format)
TESTING("File's free-space is going away with old library format")
/* Current VFD that does not support contigous address space */
- contig_addr_vfd = (hbool_t)(HDstrcmp(env_h5_drvr, "split") && HDstrcmp(env_h5_drvr, "multi"));
+ contig_addr_vfd = (hbool_t)(HDstrcmp(env_h5_drvr, "split") != 0 && HDstrcmp(env_h5_drvr, "multi") != 0);
if (contig_addr_vfd) {
@@ -7291,7 +7297,7 @@ test_mf_strat_thres_persist(const char *env_h5_drvr, hid_t fapl, hbool_t new_for
TESTING("File space strategy/persisting/threshold with old library format")
/* Current VFD that does not support contigous address space */
- contig_addr_vfd = (hbool_t)(HDstrcmp(env_h5_drvr, "split") && HDstrcmp(env_h5_drvr, "multi"));
+ contig_addr_vfd = (hbool_t)(HDstrcmp(env_h5_drvr, "split") != 0 && HDstrcmp(env_h5_drvr, "multi") != 0);
/* Set the filename to use for this test (dependent on fapl) */
h5_fixname(FILENAME[0], fapl, filename, sizeof(filename));
@@ -7461,7 +7467,7 @@ test_mf_strat_thres_gone(const char *env_h5_drvr, hid_t fapl, hbool_t new_format
TESTING("File space merge/shrink for section size < threshold with old library format")
/* Current VFD that does not support contigous address space */
- contig_addr_vfd = (hbool_t)(HDstrcmp(env_h5_drvr, "split") && HDstrcmp(env_h5_drvr, "multi"));
+ contig_addr_vfd = (hbool_t)(HDstrcmp(env_h5_drvr, "split") != 0 && HDstrcmp(env_h5_drvr, "multi") != 0);
/* Set the filename to use for this test (dependent on fapl) */
h5_fixname(FILENAME[0], fapl, filename, sizeof(filename));
@@ -7755,7 +7761,7 @@ set_multi_split(hid_t fapl, hsize_t pagesize, hbool_t is_multi_or_split)
/* Free memb_name */
for (mt = H5FD_MEM_DEFAULT; mt < H5FD_MEM_NTYPES; mt++)
- free(memb_name[mt]);
+ HDfree(memb_name[mt]);
return 0;
@@ -8018,7 +8024,7 @@ test_page_try_shrink(const char *env_h5_drvr, hid_t fapl)
TESTING("Paged aggregation for file space: H5MF_try_shrink()");
/* Current VFD that does not support continuous address space */
- contig_addr_vfd = (hbool_t)(HDstrcmp(env_h5_drvr, "split") && HDstrcmp(env_h5_drvr, "multi"));
+ contig_addr_vfd = (hbool_t)(HDstrcmp(env_h5_drvr, "split") != 0 && HDstrcmp(env_h5_drvr, "multi") != 0);
if (contig_addr_vfd) {
@@ -8147,8 +8153,8 @@ test_page_small_try_extend(const char *env_h5_drvr, hid_t fapl)
TESTING("Paged aggregation for file space: H5MF_try_extend() a small block");
/* Current VFD that does not support continuous address space */
- contig_addr_vfd = (hbool_t)(HDstrcmp(env_h5_drvr, "split") && HDstrcmp(env_h5_drvr, "multi") &&
- HDstrcmp(env_h5_drvr, "family"));
+ contig_addr_vfd = (hbool_t)(HDstrcmp(env_h5_drvr, "split") != 0 && HDstrcmp(env_h5_drvr, "multi") != 0 &&
+ HDstrcmp(env_h5_drvr, "family") != 0);
if (contig_addr_vfd) {
@@ -8326,7 +8332,7 @@ test_page_large_try_extend(const char *env_h5_drvr, hid_t fapl)
TESTING("Paged aggregation for file space: H5MF_try_extend() a large block");
/* Current VFD that does not support continuous address space */
- contig_addr_vfd = (hbool_t)(HDstrcmp(env_h5_drvr, "split") && HDstrcmp(env_h5_drvr, "multi"));
+ contig_addr_vfd = (hbool_t)(HDstrcmp(env_h5_drvr, "split") != 0 && HDstrcmp(env_h5_drvr, "multi") != 0);
if (contig_addr_vfd) {
@@ -8490,7 +8496,7 @@ test_page_large(const char *env_h5_drvr, hid_t fapl)
TESTING("Paged aggregation for file space: large allocations and de-allocations");
/* Current VFD that does not support continuous address space */
- contig_addr_vfd = (hbool_t)(HDstrcmp(env_h5_drvr, "split") && HDstrcmp(env_h5_drvr, "multi"));
+ contig_addr_vfd = (hbool_t)(HDstrcmp(env_h5_drvr, "split") != 0 && HDstrcmp(env_h5_drvr, "multi") != 0);
if (contig_addr_vfd) {
@@ -8906,7 +8912,7 @@ test_page_alignment(const char *env_h5_drvr, hid_t fapl)
/* Free memb_name */
for (mt = H5FD_MEM_DEFAULT; mt < H5FD_MEM_NTYPES; mt++)
- free(memb_name[mt]);
+ HDfree(memb_name[mt]);
/* Close memb_fapl */
if (H5Pclose(memb_fapl) < 0)
diff --git a/test/mount.c b/test/mount.c
index d59f458..c5ac9b3 100644
--- a/test/mount.c
+++ b/test/mount.c
@@ -12,7 +12,7 @@
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
/*
- * Programmer: Robb Matzke <matzke@llnl.gov>
+ * Programmer: Robb Matzke
* Wednesday, October 7, 1998
*
* Purpose: Tests file mounting.
@@ -1583,7 +1583,7 @@ test_mount_after_close(hid_t fapl)
*objname = '\0';
if (H5Iget_name(gidABMX, objname, (size_t)NAME_BUF_SIZE) < 0)
FAIL_STACK_ERROR
- if (HDstrcmp(objname, "/A/B/M/X"))
+ if (HDstrcmp(objname, "/A/B/M/X") != 0)
TEST_ERROR
/* Close object in mounted file */
@@ -1598,7 +1598,7 @@ test_mount_after_close(hid_t fapl)
*objname = '\0';
if (H5Iget_name(gidABC, objname, (size_t)NAME_BUF_SIZE) < 0)
FAIL_STACK_ERROR
- if (HDstrcmp(objname, "/A/B/C"))
+ if (HDstrcmp(objname, "/A/B/C") != 0)
TEST_ERROR
/* Close object in mounted file */
@@ -1613,7 +1613,7 @@ test_mount_after_close(hid_t fapl)
*objname = '\0';
if (H5Iget_name(gidABT, objname, (size_t)NAME_BUF_SIZE) < 0)
FAIL_STACK_ERROR
- if (HDstrcmp(objname, "/A/B/T"))
+ if (HDstrcmp(objname, "/A/B/T") != 0)
TEST_ERROR
/* Close object in original file */
@@ -1628,7 +1628,7 @@ test_mount_after_close(hid_t fapl)
*objname = '\0';
if (H5Iget_name(didABMXYD, objname, (size_t)NAME_BUF_SIZE) < 0)
FAIL_STACK_ERROR
- if (HDstrcmp(objname, "/A/B/M/X/Y/D"))
+ if (HDstrcmp(objname, "/A/B/M/X/Y/D") != 0)
TEST_ERROR
/* Close object in mounted file */
@@ -1801,7 +1801,7 @@ test_mount_after_unmount(hid_t fapl)
*objname = '\0';
if (H5Iget_name(gidAMXX, objname, (size_t)NAME_BUF_SIZE) < 0)
TEST_ERROR
- if (HDstrcmp(objname, "/A/M/X/X"))
+ if (HDstrcmp(objname, "/A/M/X/X") != 0)
TEST_ERROR
/* Open group in mounted file #2 */
@@ -1821,7 +1821,7 @@ test_mount_after_unmount(hid_t fapl)
*objname = '\0';
if (H5Iget_name(gidAMXMY, objname, (size_t)NAME_BUF_SIZE) < 0)
TEST_ERROR
- if (HDstrcmp(objname, "/A/M/X/M/Y"))
+ if (HDstrcmp(objname, "/A/M/X/M/Y") != 0)
TEST_ERROR
/* Unmount second file */
@@ -1832,7 +1832,7 @@ test_mount_after_unmount(hid_t fapl)
*objname = '\0';
if (H5Iget_name(gidAMXMY, objname, (size_t)NAME_BUF_SIZE) < 0)
TEST_ERROR
- if (HDstrcmp(objname, "/X/M/Y"))
+ if (HDstrcmp(objname, "/X/M/Y") != 0)
TEST_ERROR
/* Rename object in file #3 that is "disconnected" from name hiearchy */
@@ -1852,7 +1852,7 @@ test_mount_after_unmount(hid_t fapl)
*objname = '\0';
if (H5Iget_name(gidAMXMY, objname, (size_t)NAME_BUF_SIZE) < 0)
TEST_ERROR
- if (HDstrcmp(objname, "/X/M/Z"))
+ if (HDstrcmp(objname, "/X/M/Z") != 0)
TEST_ERROR
/* Mount fourth file */
@@ -1868,7 +1868,7 @@ test_mount_after_unmount(hid_t fapl)
*objname = '\0';
if (H5Iget_name(gidBMZ, objname, (size_t)NAME_BUF_SIZE) < 0)
TEST_ERROR
- if (HDstrcmp(objname, "/B/M/Z"))
+ if (HDstrcmp(objname, "/B/M/Z") != 0)
TEST_ERROR
/* Unmount third file */
@@ -3140,7 +3140,7 @@ test_mult_mount(hid_t fapl)
*name = '\0';
if (H5Iget_name(gidAMT, name, (size_t)NAME_BUF_SIZE) < 0)
TEST_ERROR
- if (HDstrcmp(name, "/A/M/T"))
+ if (HDstrcmp(name, "/A/M/T") != 0)
TEST_ERROR
/* Create object in file #3 */
@@ -3158,7 +3158,7 @@ test_mult_mount(hid_t fapl)
*name = '\0';
if (H5Iget_name(gidBS, name, (size_t)NAME_BUF_SIZE) < 0)
TEST_ERROR
- if (HDstrcmp(name, "/B/S"))
+ if (HDstrcmp(name, "/B/S") != 0)
TEST_ERROR
/* Re-open object created in file #3 through file #1 mount path */
@@ -3339,7 +3339,7 @@ test_nested_survive(hid_t fapl)
*name = '\0';
if ((name_len = H5Iget_name(gidAM, name, (size_t)NAME_BUF_SIZE)) < 0)
TEST_ERROR
- if (name_len == 0 || HDstrcmp(name, "/A/M"))
+ if (name_len == 0 || HDstrcmp(name, "/A/M") != 0)
TEST_ERROR
/* Unmount file #2 from file #1 */
@@ -3350,7 +3350,7 @@ test_nested_survive(hid_t fapl)
*name = '\0';
if ((name_len = H5Iget_name(gidAM, name, (size_t)NAME_BUF_SIZE)) < 0)
TEST_ERROR
- if (name_len != 0 || HDstrcmp(name, ""))
+ if (name_len != 0 || HDstrcmp(name, "") != 0)
TEST_ERROR
/* Open object in file #3 through file #1 mount path (should fail) */
@@ -3370,7 +3370,7 @@ test_nested_survive(hid_t fapl)
*name = '\0';
if (H5Iget_name(gidMS, name, (size_t)NAME_BUF_SIZE) < 0)
TEST_ERROR
- if (HDstrcmp(name, "/M/S"))
+ if (HDstrcmp(name, "/M/S") != 0)
TEST_ERROR
/* Close group in file #3 */
@@ -3389,7 +3389,7 @@ test_nested_survive(hid_t fapl)
*name = '\0';
if (H5Iget_name(gidAMS, name, (size_t)NAME_BUF_SIZE) < 0)
TEST_ERROR
- if (HDstrcmp(name, "/A/M/S"))
+ if (HDstrcmp(name, "/A/M/S") != 0)
TEST_ERROR
/* Close group in file #3 */
@@ -3538,7 +3538,7 @@ test_close_parent(hid_t fapl)
*name = '\0';
if ((name_len = H5Iget_name(gidM, name, (size_t)NAME_BUF_SIZE)) < 0)
TEST_ERROR
- if (name_len == 0 || HDstrcmp(name, "/A/M"))
+ if (name_len == 0 || HDstrcmp(name, "/A/M") != 0)
TEST_ERROR
/* Unmount file #2 from file #1, closing file #1 */
@@ -3549,7 +3549,7 @@ test_close_parent(hid_t fapl)
*name = '\0';
if ((name_len = H5Iget_name(gidM, name, (size_t)NAME_BUF_SIZE)) < 0)
TEST_ERROR
- if (name_len == 0 || HDstrcmp(name, "/M"))
+ if (name_len == 0 || HDstrcmp(name, "/M") != 0)
TEST_ERROR
/* Just file #2's underlying shared file should be open still */
@@ -3816,7 +3816,7 @@ test_cut_graph(hid_t fapl)
*name = '\0';
if ((name_len = H5Iget_name(gidM, name, (size_t)NAME_BUF_SIZE)) < 0)
TEST_ERROR
- if (name_len == 0 || HDstrcmp(name, "/A/E/M"))
+ if (name_len == 0 || HDstrcmp(name, "/A/E/M") != 0)
TEST_ERROR
/* Open object in file #7 */
@@ -3827,7 +3827,7 @@ test_cut_graph(hid_t fapl)
*name = '\0';
if ((name_len = H5Iget_name(gidQ, name, (size_t)NAME_BUF_SIZE)) < 0)
TEST_ERROR
- if (name_len == 0 || HDstrcmp(name, "/B/I/Q"))
+ if (name_len == 0 || HDstrcmp(name, "/B/I/Q") != 0)
TEST_ERROR
/* Close file #1 */
@@ -3887,7 +3887,7 @@ test_cut_graph(hid_t fapl)
*name = '\0';
if ((name_len = H5Iget_name(gidK, name, (size_t)NAME_BUF_SIZE)) < 0)
TEST_ERROR
- if (name_len == 0 || HDstrcmp(name, "/D/K"))
+ if (name_len == 0 || HDstrcmp(name, "/D/K") != 0)
TEST_ERROR
if (H5Gclose(gidK) < 0)
@@ -3910,7 +3910,7 @@ test_cut_graph(hid_t fapl)
*name = '\0';
if ((name_len = H5Iget_name(gidO, name, (size_t)NAME_BUF_SIZE)) < 0)
TEST_ERROR
- if (name_len == 0 || HDstrcmp(name, "/B/H/O"))
+ if (name_len == 0 || HDstrcmp(name, "/B/H/O") != 0)
TEST_ERROR
if (H5Gclose(gidO) < 0)
@@ -3920,14 +3920,14 @@ test_cut_graph(hid_t fapl)
*name = '\0';
if ((name_len = H5Iget_name(gidM, name, (size_t)NAME_BUF_SIZE)) < 0)
TEST_ERROR
- if (name_len == 0 || HDstrcmp(name, "/E/M"))
+ if (name_len == 0 || HDstrcmp(name, "/E/M") != 0)
TEST_ERROR
/* Check the name of "Q" is still defined */
*name = '\0';
if ((name_len = H5Iget_name(gidQ, name, (size_t)NAME_BUF_SIZE)) < 0)
TEST_ERROR
- if (name_len == 0 || HDstrcmp(name, "/B/I/Q"))
+ if (name_len == 0 || HDstrcmp(name, "/B/I/Q") != 0)
TEST_ERROR
/* Check that all seven underlying files are still opened */
@@ -3952,7 +3952,7 @@ test_cut_graph(hid_t fapl)
*name = '\0';
if ((name_len = H5Iget_name(gidQ, name, (size_t)NAME_BUF_SIZE)) < 0)
TEST_ERROR
- if (name_len == 0 || HDstrcmp(name, "/I/Q"))
+ if (name_len == 0 || HDstrcmp(name, "/I/Q") != 0)
TEST_ERROR
/* Open object in file #6 from file #7 */
@@ -3963,7 +3963,7 @@ test_cut_graph(hid_t fapl)
*name = '\0';
if ((name_len = H5Iget_name(gidO, name, (size_t)NAME_BUF_SIZE)) < 0)
TEST_ERROR
- if (name_len == 0 || HDstrcmp(name, "/H/O"))
+ if (name_len == 0 || HDstrcmp(name, "/H/O") != 0)
TEST_ERROR
if (H5Gclose(gidO) < 0)
@@ -4132,7 +4132,7 @@ test_symlink(hid_t fapl)
*name = '\0';
if ((name_len = H5Iget_name(gidL, name, (size_t)NAME_BUF_SIZE)) < 0)
TEST_ERROR
- if (name_len == 0 || HDstrcmp(name, "/L"))
+ if (name_len == 0 || HDstrcmp(name, "/L") != 0)
TEST_ERROR
/* Close file #1 */
diff --git a/test/mtime.c b/test/mtime.c
index 7172dea..78f9065 100644
--- a/test/mtime.c
+++ b/test/mtime.c
@@ -12,7 +12,7 @@
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
/*
- * Programmer: Robb Matzke <matzke@llnl.gov>
+ * Programmer: Robb Matzke
* Thursday, July 30, 1998
*
* Purpose: Determines if the modification time message is working
@@ -147,7 +147,7 @@ main(void)
H5_FAILED();
/* If this fails, examine H5Omtime.c. Modification time is very
* system dependent (e.g., on Windows DST must be hardcoded). */
- puts(" Old modification time incorrect");
+ HDputs(" Old modification time incorrect");
goto error;
}
if (H5Fclose(file) < 0)
diff --git a/test/ntypes.c b/test/ntypes.c
index 541670b..13cc72a 100644
--- a/test/ntypes.c
+++ b/test/ntypes.c
@@ -12,10 +12,10 @@
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
/*
- * Programmer: Raymond Lu
+ * Programmer: Raymond Lu
* October 14, 2001
*
- * Purpose: Tests the H5Tget_native_type function.
+ * Purpose: Tests the H5Tget_native_type function.
*/
#include "h5test.h"
@@ -57,16 +57,16 @@ int ipoints3[DIM0][DIM1][5], icheck3[DIM0][DIM1][5];
#define BITFIELD_ENUMB 8
/*-------------------------------------------------------------------------
- * Function: test_atomic_dtype
+ * Function: test_atomic_dtype
*
- * Purpose: Test H5Tget_native_type for atomic datatype
+ * Purpose: Test H5Tget_native_type for atomic datatype
*
- * Return: Success: 0
+ * Return: Success: 0
*
- * Failure: -1
+ * Failure: -1
*
- * Programmer: Raymond Lu
- * October 15, 2002
+ * Programmer: Raymond Lu
+ * October 15, 2002
*
* Modifications:
*
@@ -291,16 +291,16 @@ error:
}
/*-------------------------------------------------------------------------
- * Function: test_compound_dtype2
+ * Function: test_compound_dtype2
*
- * Purpose: Test H5Tget_native_type for compound datatype
+ * Purpose: Test H5Tget_native_type for compound datatype
*
- * Return: Success: 0
+ * Return: Success: 0
*
- * Failure: -1
+ * Failure: -1
*
- * Programmer: Raymond Lu
- * October 15, 2002
+ * Programmer: Raymond Lu
+ * October 15, 2002
*
* Modifications:
*
@@ -621,16 +621,16 @@ error:
}
/*-------------------------------------------------------------------------
- * Function: test_compound_dtype
+ * Function: test_compound_dtype
*
- * Purpose: Test H5Tget_native_type for compound datatype
+ * Purpose: Test H5Tget_native_type for compound datatype
*
- * Return: Success: 0
+ * Return: Success: 0
*
- * Failure: -1
+ * Failure: -1
*
- * Programmer: Raymond Lu
- * October 15, 2002
+ * Programmer: Raymond Lu
+ * October 15, 2002
*
* Modifications:
*
@@ -834,16 +834,16 @@ error:
}
/*-------------------------------------------------------------------------
- * Function: test_compound_dtype3
+ * Function: test_compound_dtype3
*
- * Purpose: Test H5Tget_native_type for compound datatype
+ * Purpose: Test H5Tget_native_type for compound datatype
*
- * Return: Success: 0
+ * Return: Success: 0
*
- * Failure: -1
+ * Failure: -1
*
- * Programmer: Raymond Lu
- * October 15, 2002
+ * Programmer: Raymond Lu
+ * October 15, 2002
*
* Modifications:
*
@@ -1075,16 +1075,16 @@ error:
}
/*-------------------------------------------------------------------------
- * Function: test_compound_opaque
+ * Function: test_compound_opaque
*
- * Purpose: Test H5Tget_native_type for compound datatype with opaque field
+ * Purpose: Test H5Tget_native_type for compound datatype with opaque field
*
- * Return: Success: 0
+ * Return: Success: 0
*
- * Failure: -1
+ * Failure: -1
*
- * Programmer: Quincey Koziol
- * January 31, 2004
+ * Programmer: Quincey Koziol
+ * January 31, 2004
*
* Modifications:
*
@@ -1302,16 +1302,16 @@ error:
}
/*-------------------------------------------------------------------------
- * Function: test_enum_dtype
+ * Function: test_enum_dtype
*
- * Purpose: Test H5Tget_native_type for enumerate datatype
+ * Purpose: Test H5Tget_native_type for enumerate datatype
*
- * Return: Success: 0
+ * Return: Success: 0
*
- * Failure: -1
+ * Failure: -1
*
- * Programmer: Raymond Lu
- * October 15, 2002
+ * Programmer: Raymond Lu
+ * October 15, 2002
*
* Modifications:
*
@@ -1446,16 +1446,16 @@ error:
}
/*-------------------------------------------------------------------------
- * Function: test_array_dtype
+ * Function: test_array_dtype
*
- * Purpose: Test H5Tget_native_type for array datatype
+ * Purpose: Test H5Tget_native_type for array datatype
*
- * Return: Success: 0
+ * Return: Success: 0
*
- * Failure: -1
+ * Failure: -1
*
- * Programmer: Raymond Lu
- * October 15, 2002
+ * Programmer: Raymond Lu
+ * October 15, 2002
*
* Modifications:
*
@@ -1634,16 +1634,16 @@ error:
}
/*-------------------------------------------------------------------------
- * Function: test_array_dtype2
+ * Function: test_array_dtype2
*
- * Purpose: Test H5Tget_native_type for array datatype
+ * Purpose: Test H5Tget_native_type for array datatype
*
- * Return: Success: 0
+ * Return: Success: 0
*
- * Failure: -1
+ * Failure: -1
*
- * Programmer: Raymond Lu
- * October 15, 2002
+ * Programmer: Raymond Lu
+ * October 15, 2002
*
* Modifications:
*
@@ -1769,16 +1769,16 @@ error:
}
/*-------------------------------------------------------------------------
- * Function: test_vl_dtype
+ * Function: test_vl_dtype
*
- * Purpose: Test H5Tget_native_type for variable length datatype
+ * Purpose: Test H5Tget_native_type for variable length datatype
*
- * Return: Success: 0
+ * Return: Success: 0
*
- * Failure: -1
+ * Failure: -1
*
- * Programmer: Raymond Lu
- * October 15, 2002
+ * Programmer: Raymond Lu
+ * October 15, 2002
*
* Modifications:
*
@@ -1975,16 +1975,16 @@ error:
} /* end test_vl_type() */
/*-------------------------------------------------------------------------
- * Function: test_vlstr_dtype
+ * Function: test_vlstr_dtype
*
- * Purpose: Test H5Tget_native_type for variable length string datatype
+ * Purpose: Test H5Tget_native_type for variable length string datatype
*
- * Return: Success: 0
+ * Return: Success: 0
*
- * Failure: -1
+ * Failure: -1
*
- * Programmer: Raymond Lu
- * October 15, 2002
+ * Programmer: Raymond Lu
+ * October 15, 2002
*
* Modifications:
*
@@ -1993,21 +1993,17 @@ error:
static herr_t
test_vlstr_dtype(hid_t file)
{
+ /* Information to write */
const char *wdata[SPACE1_DIM1] = {
- "Four score and seven years ago our forefathers brought forth on this continent a new "
- "nation,",
+ "Four score and seven years ago our forefathers brought forth on this continent a new nation,",
"conceived in liberty and dedicated to the 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."}; /* Information
- to
- write
- */
+ "testing whether that nation or any nation so conceived and so dedicated can long endure."};
char * rdata[SPACE1_DIM1]; /* Information read in */
hbool_t rdata_alloc = FALSE; /* Whether the read data is allocated */
- hid_t dataset = -1; /* Dataset ID */
- hid_t sid1 = -1; /* Dataspace ID */
- hid_t tid1 = -1, dtype = -1, native_type = -1; /* Datatype ID */
+ hid_t dataset = -1; /* Dataset ID */
+ hid_t sid1 = -1; /* Dataspace ID */
+ hid_t tid1 = -1, dtype = -1, native_type = -1; /* Datatype ID */
hsize_t dims1[] = {SPACE1_DIM1};
unsigned i; /* counting variable */
@@ -2119,16 +2115,16 @@ error:
} /* end test_vlstr_dtype() */
/*-------------------------------------------------------------------------
- * Function: test_str_dtype
+ * Function: test_str_dtype
*
- * Purpose: Test H5Tget_native_type for fixed-length string datatype
+ * Purpose: Test H5Tget_native_type for fixed-length string datatype
*
- * Return: Success: 0
+ * Return: Success: 0
*
- * Failure: -1
+ * Failure: -1
*
- * Programmer: Raymond Lu
- * October 15, 2002
+ * Programmer: Raymond Lu
+ * October 15, 2002
*
* Modifications:
*
@@ -2139,9 +2135,9 @@ test_str_dtype(hid_t file)
{
const char wdata[SPACE1_DIM1][4] = {"one", "two", "3rd", "4th"}; /* Information to write */
char rdata[SPACE1_DIM1][4]; /* Information read in */
- hid_t dataset = -1; /* Dataset ID */
- hid_t sid1 = -1; /* Dataspace ID */
- hid_t tid1 = -1, dtype = -1, native_type = -1; /* Datatype ID */
+ hid_t dataset = -1; /* Dataset ID */
+ hid_t sid1 = -1; /* Dataspace ID */
+ hid_t tid1 = -1, dtype = -1, native_type = -1; /* Datatype ID */
hsize_t dims1[] = {SPACE1_DIM1};
unsigned i; /* counting variable */
@@ -2241,16 +2237,16 @@ error:
} /* end test_str_dtype() */
/*-------------------------------------------------------------------------
- * Function: test_refer_dtype
+ * Function: test_refer_dtype
*
- * Purpose: Test H5Tget_native_type for reference datatype
+ * Purpose: Test H5Tget_native_type for reference datatype
*
- * Return: Success: 0
+ * Return: Success: 0
*
- * Failure: -1
+ * Failure: -1
*
- * Programmer: Raymond Lu
- * October 15, 2002
+ * Programmer: Raymond Lu
+ * October 15, 2002
*
* Modifications:
*
@@ -2266,10 +2262,10 @@ test_refer_dtype(hid_t file)
float c;
} s1_t;
- hid_t dataset = -1; /* Dataset ID */
+ hid_t dataset = -1; /* Dataset ID */
hid_t group = -1; /* Group ID */
- hid_t sid1 = -1; /* Dataspace ID */
- hid_t tid1 = -1, dtype = -1, native_type = -1; /* Datatype ID */
+ hid_t sid1 = -1; /* Dataspace ID */
+ hid_t tid1 = -1, dtype = -1, native_type = -1; /* Datatype ID */
hsize_t dims1[] = {1};
H5O_type_t obj_type; /* Object type */
hobj_ref_t *wbuf = NULL, /* buffer to write to disk */
@@ -2414,16 +2410,16 @@ error:
} /* test_refer_dtype() */
/*-------------------------------------------------------------------------
- * Function: test_refer_dtype2
+ * Function: test_refer_dtype2
*
- * Purpose: Test H5Tget_native_type for reference
+ * Purpose: Test H5Tget_native_type for reference
*
- * Return: Success: 0
+ * Return: Success: 0
*
- * Failure: -1
+ * Failure: -1
*
- * Programmer: Raymond Lu
- * October 15, 2002
+ * Programmer: Raymond Lu
+ * October 15, 2002
*
* Modifications:
*
@@ -2432,10 +2428,10 @@ error:
static herr_t
test_refer_dtype2(hid_t file)
{
- hid_t dset1 = -1, /* Dataset ID */
+ hid_t dset1 = -1, /* Dataset ID */
dset2 = -1; /* Dereferenced dataset ID */
- hid_t sid1 = -1, /* Dataspace ID #1 */
- sid2 = -1; /* Dataspace ID #2 */
+ hid_t sid1 = -1, /* Dataspace ID #1 */
+ sid2 = -1; /* Dataspace ID #2 */
hid_t dtype = -1, native_type = -1;
hsize_t dims1[] = {1}, dims2[] = {SPACE2_DIM1, SPACE2_DIM2};
hsize_t start[SPACE2_RANK]; /* Starting location of hyperslab */
@@ -2628,16 +2624,16 @@ error:
} /* test_refer_dtype2() */
/*-------------------------------------------------------------------------
- * Function: test_opaque_dtype
+ * Function: test_opaque_dtype
*
- * Purpose: Test H5Tget_native_type for opaque datatype
+ * Purpose: Test H5Tget_native_type for opaque datatype
*
- * Return: Success: 0
+ * Return: Success: 0
*
- * Failure: -1
+ * Failure: -1
*
- * Programmer: Raymond Lu
- * October 15, 2002
+ * Programmer: Raymond Lu
+ * October 15, 2002
*
* Modifications:
*
@@ -2727,16 +2723,16 @@ error:
} /* test_opaque_dtype */
/*-------------------------------------------------------------------------
- * Function: test_bitfield_dtype
+ * Function: test_bitfield_dtype
*
- * Purpose: Test H5Tget_native_type for bitfield datatype
+ * Purpose: Test H5Tget_native_type for bitfield datatype
*
- * Return: Success: 0
+ * Return: Success: 0
*
- * Failure: -1
+ * Failure: -1
*
- * Programmer: Raymond Lu
- * October 15, 2002
+ * Programmer: Raymond Lu
+ * October 15, 2002
*
* Modifications:
* Raymond Lu
@@ -2894,7 +2890,7 @@ error:
* Return: Success: 0
* Failure: -1
*
- * Programmer: pvn@ncsa.uiuc.edu
+ * Programmer: Pedro Vicente
* September 3, 2004
*
* Modifications:
@@ -3102,12 +3098,12 @@ error:
} /* end test_ninteger() */
/*-------------------------------------------------------------------------
- * Function: main
+ * Function: main
*
- * Purpose: Test H5Tget_native_type for different datatype
+ * Purpose: Test H5Tget_native_type for different datatype
*
- * Programmer: Raymond Lu
- * October 15, 2002
+ * Programmer: Raymond Lu
+ * October 15, 2002
*
* Modifications:
*
diff --git a/test/null_vol_connector.c b/test/null_vol_connector.c
index 5f75ce4..b574a8e 100644
--- a/test/null_vol_connector.c
+++ b/test/null_vol_connector.c
@@ -26,9 +26,10 @@
/* The VOL class struct */
static const H5VL_class_t null_vol_g = {
- 0, /* version */
+ H5VL_VERSION, /* VOL class struct version */
NULL_VOL_CONNECTOR_VALUE, /* value */
NULL_VOL_CONNECTOR_NAME, /* name */
+ 0, /* connector version */
0, /* capability flags */
NULL, /* initialize */
NULL, /* terminate */
diff --git a/test/null_vol_connector.h b/test/null_vol_connector.h
index 0e48e75..8fe9abe 100644
--- a/test/null_vol_connector.h
+++ b/test/null_vol_connector.h
@@ -15,10 +15,10 @@
* (registration, etc.).
*/
-#ifndef _null_vol_connector_H
-#define _null_vol_connector_H
+#ifndef NULL_VOL_CONNECTOR_H
+#define NULL_VOL_CONNECTOR_H
#define NULL_VOL_CONNECTOR_VALUE ((H5VL_class_value_t)160)
#define NULL_VOL_CONNECTOR_NAME "null_vol_connector"
-#endif /* _null_vol_connector_H */
+#endif /* NULL_VOL_CONNECTOR_H */
diff --git a/test/pool.c b/test/pool.c
index b6e3765..9ce1846 100644
--- a/test/pool.c
+++ b/test/pool.c
@@ -11,7 +11,7 @@
* help@hdfgroup.org. *
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
-/* Programmer: Quincey Koziol <koziol@ncsa.uiuc.edu>
+/* Programmer: Quincey Koziol
* Tuesday, May 3, 2005
*/
#include "h5test.h"
@@ -660,10 +660,10 @@ test_allocate_random(void)
/* Initialize random number seed */
curr_time = HDtime(NULL);
-#ifdef QAK
- curr_time = 1115412944;
- HDfprintf(stderr, "curr_time=%lu\n", (unsigned long)curr_time);
-#endif /* QAK */
+#if 0
+curr_time=1115412944;
+HDfprintf(stderr,"curr_time=%lu\n",(unsigned long)curr_time);
+#endif
HDsrandom((unsigned)curr_time);
/* Create a memory pool */
@@ -784,11 +784,11 @@ main(void)
if (nerrors)
goto error;
- puts("All memory pool tests passed.");
+ HDputs("All memory pool tests passed.");
return 0;
error:
- puts("*** TESTS FAILED ***");
+ HDputs("*** TESTS FAILED ***");
return 1;
}
diff --git a/test/reserved.c b/test/reserved.c
index 1ea73a6..6e41a16 100644
--- a/test/reserved.c
+++ b/test/reserved.c
@@ -126,7 +126,7 @@ rsrv_heap(void)
/* If we can read a dataset from the file, the file has been flushed to disk
* (if the heap or object headers weren't flushed, the file would be empty).
*/
- if (dataset_id == H5I_BADID)
+ if (dataset_id == H5I_INVALID_HID)
TEST_ERROR;
if (H5Dclose(dataset_id) < 0)
@@ -268,7 +268,7 @@ rsrv_ohdr(void)
/* If we can read the dataset from the file, the file has been flushed to disk
* (if the heap or object headers weren't flushed, the file would be empty).
*/
- if (dataset_id == H5I_BADID)
+ if (dataset_id == H5I_INVALID_HID)
TEST_ERROR;
if (H5Dclose(dataset_id) < 0)
@@ -432,7 +432,7 @@ rsrv_vlen(void)
/* If we can read the dataset from the file, the file has been flushed to disk
* (if the heap or object headers weren't flushed, the file would be empty).
*/
- if (dataset_id == H5I_BADID)
+ if (dataset_id == H5I_INVALID_HID)
TEST_ERROR;
if (H5Dclose(dataset_id) < 0)
diff --git a/test/ros3.c b/test/ros3.c
index 9eb8768..54518f4 100644
--- a/test/ros3.c
+++ b/test/ros3.c
@@ -20,7 +20,7 @@
*
* Demonstrates basic use cases and fapl/dxpl interaction.
*
- * Programmer: Jacob Smith <jake.smith@hdfgroup.org>
+ * Programmer: Jacob Smith
* 2017-10-11
*/
@@ -193,15 +193,21 @@
*
*----------------------------------------------------------------------------
*/
+static inline void
+jserr_long(long expected, long actual, const char *reason)
+{
+ if (reason != NULL) {
+ HDprintf("%s\n", reason);
+ }
+ else {
+ HDprintf(" ! Expected %ld\n ! Actual %ld\n", expected, actual);
+ }
+}
+
#define JSERR_LONG(expected, actual, reason) \
{ \
JSFAILED_AT() \
- if (reason != NULL) { \
- HDprintf("%s\n", (reason)); \
- } \
- else { \
- HDprintf(" ! Expected %ld\n ! Actual %ld\n", (long)(expected), (long)(actual)); \
- } \
+ jserr_long((long)(expected), (long)(actual), (reason)); \
}
/*----------------------------------------------------------------------------
@@ -232,15 +238,21 @@
*
*----------------------------------------------------------------------------
*/
+static inline void
+jserr_str(const char *expected, const char *actual, const char *reason)
+{
+ if (reason != NULL) {
+ HDprintf("%s\n", reason);
+ }
+ else {
+ HDprintf("!!! Expected:\n%s\n!!!Actual:\n%s\n", expected, actual);
+ }
+}
+
#define JSERR_STR(expected, actual, reason) \
{ \
JSFAILED_AT() \
- if ((reason) != NULL) { \
- HDprintf("%s\n", (reason)); \
- } \
- else { \
- HDprintf("!!! Expected:\n%s\n!!!Actual:\n%s\n", (expected), (actual)); \
- } \
+ jserr_str((expected), (actual), (reason)); \
}
#ifdef JSVERIFY_EXP_ACT
@@ -306,7 +318,7 @@
*----------------------------------------------------------------------------
*/
#define JSVERIFY_STR(expected, actual, reason) \
- if (strcmp((actual), (expected)) != 0) { \
+ if (HDstrcmp((actual), (expected)) != 0) { \
JSERR_STR((expected), (actual), (reason)); \
goto error; \
} /* JSVERIFY_STR */
@@ -351,7 +363,7 @@
*----------------------------------------------------------------------------
*/
#define JSVERIFY_STR(actual, expected, reason) \
- if (strcmp((actual), (expected)) != 0) { \
+ if (HDstrcmp((actual), (expected)) != 0) { \
JSERR_STR((expected), (actual), (reason)); \
goto error; \
} /* JSVERIFY_STR */
@@ -548,8 +560,8 @@ test_fapl_config_validation(void)
if (FALSE == s3_test_bucket_defined) {
SKIPPED();
- puts(" environment variable HDF5_ROS3_TEST_BUCKET_URL not defined");
- fflush(stdout);
+ HDputs(" environment variable HDF5_ROS3_TEST_BUCKET_URL not defined");
+ HDfflush(stdout);
return 0;
}
@@ -829,8 +841,8 @@ test_vfd_open(void)
if (FALSE == s3_test_bucket_defined) {
SKIPPED();
- puts(" environment variable HDF5_ROS3_TEST_BUCKET_URL not defined");
- fflush(stdout);
+ HDputs(" environment variable HDF5_ROS3_TEST_BUCKET_URL not defined");
+ HDfflush(stdout);
return 0;
}
@@ -972,15 +984,15 @@ test_eof_eoa(void)
if (s3_test_credentials_loaded == 0) {
SKIPPED();
- puts(" s3 credentials are not loaded");
- fflush(stdout);
+ HDputs(" s3 credentials are not loaded");
+ HDfflush(stdout);
return 0;
}
if (FALSE == s3_test_bucket_defined) {
SKIPPED();
- puts(" environment variable HDF5_ROS3_TEST_BUCKET_URL not defined");
- fflush(stdout);
+ HDputs(" environment variable HDF5_ROS3_TEST_BUCKET_URL not defined");
+ HDfflush(stdout);
return 0;
}
@@ -1083,15 +1095,15 @@ test_H5FDread_without_eoa_set_fails(void)
if (s3_test_credentials_loaded == 0) {
SKIPPED();
- puts(" s3 credentials are not loaded");
- fflush(stdout);
+ HDputs(" s3 credentials are not loaded");
+ HDfflush(stdout);
return 0;
}
if (FALSE == s3_test_bucket_defined) {
SKIPPED();
- puts(" environment variable HDF5_ROS3_TEST_BUCKET_URL not defined");
- fflush(stdout);
+ HDputs(" environment variable HDF5_ROS3_TEST_BUCKET_URL not defined");
+ HDfflush(stdout);
return 0;
}
@@ -1257,15 +1269,15 @@ test_read(void)
if (s3_test_credentials_loaded == 0) {
SKIPPED();
- puts(" s3 credentials are not loaded");
- fflush(stdout);
+ HDputs(" s3 credentials are not loaded");
+ HDfflush(stdout);
return 0;
}
if (FALSE == s3_test_bucket_defined) {
SKIPPED();
- puts(" environment variable HDF5_ROS3_TEST_BUCKET_URL not defined");
- fflush(stdout);
+ HDputs(" environment variable HDF5_ROS3_TEST_BUCKET_URL not defined");
+ HDfflush(stdout);
return 0;
}
@@ -1401,8 +1413,8 @@ test_noops_and_autofails(void)
if (FALSE == s3_test_bucket_defined) {
SKIPPED();
- puts(" environment variable HDF5_ROS3_TEST_BUCKET_URL not defined");
- fflush(stdout);
+ HDputs(" environment variable HDF5_ROS3_TEST_BUCKET_URL not defined");
+ HDfflush(stdout);
return 0;
}
@@ -1438,15 +1450,6 @@ test_noops_and_autofails(void)
H5E_BEGIN_TRY{
JSVERIFY(FAIL, H5FDtruncate(file, H5P_DEFAULT, TRUE), "truncate must fail (closing)")} H5E_END_TRY;
- /* no-op calls to `lock()` and `unlock()`
- */
- JSVERIFY(SUCCEED, H5FDlock(file, TRUE), "lock always succeeds; has no effect")
- JSVERIFY(SUCCEED, H5FDlock(file, FALSE), NULL)
- JSVERIFY(SUCCEED, H5FDunlock(file), NULL)
- /* Lock/unlock with null file or similar error crashes tests.
- * HDassert in calling heirarchy, `H5FD[un]lock()` and `H5FD_[un]lock()`
- */
-
/************
* TEARDOWN *
************/
@@ -1530,15 +1533,15 @@ test_cmp(void)
if (s3_test_credentials_loaded == 0) {
SKIPPED();
- puts(" s3 credentials are not loaded");
- fflush(stdout);
+ HDputs(" s3 credentials are not loaded");
+ HDfflush(stdout);
return 0;
}
if (FALSE == s3_test_bucket_defined) {
SKIPPED();
- puts(" environment variable HDF5_ROS3_TEST_BUCKET_URL not defined");
- fflush(stdout);
+ HDputs(" environment variable HDF5_ROS3_TEST_BUCKET_URL not defined");
+ HDfflush(stdout);
return 0;
}
@@ -1654,15 +1657,15 @@ test_H5F_integration(void)
if (s3_test_credentials_loaded == 0) {
SKIPPED();
- puts(" s3 credentials are not loaded");
- fflush(stdout);
+ HDputs(" s3 credentials are not loaded");
+ HDfflush(stdout);
return 0;
}
if (FALSE == s3_test_bucket_defined) {
SKIPPED();
- puts(" environment variable HDF5_ROS3_TEST_BUCKET_URL not defined");
- fflush(stdout);
+ HDputs(" environment variable HDF5_ROS3_TEST_BUCKET_URL not defined");
+ HDfflush(stdout);
return 0;
}
@@ -1709,7 +1712,7 @@ error:
* CLEANUP *
***********/
HDprintf("\nerror!");
- fflush(stdout);
+ HDfflush(stdout);
if (fapl_id >= 0) {
H5E_BEGIN_TRY
diff --git a/test/s3comms.c b/test/s3comms.c
index 6ddb8a3..6202af3 100644
--- a/test/s3comms.c
+++ b/test/s3comms.c
@@ -15,7 +15,7 @@
*
* Purpose: Unit tests for the S3 Communications (s3comms) module.
*
- * Programmer: Jacob Smith <jake.smith@hdfgroup.org>
+ * Programmer: Jacob Smith
* 2017-10-11
*/
@@ -181,15 +181,21 @@
*
*----------------------------------------------------------------------------
*/
+static inline void
+jserr_long(long expected, long actual, const char *reason)
+{
+ if (reason != NULL) {
+ HDprintf("%s\n", reason);
+ }
+ else {
+ HDprintf(" ! Expected %ld\n ! Actual %ld\n", expected, actual);
+ }
+}
+
#define JSERR_LONG(expected, actual, reason) \
{ \
JSFAILED_AT() \
- if (reason != NULL) { \
- HDprintf("%s\n", (reason)); \
- } \
- else { \
- HDprintf(" ! Expected %ld\n ! Actual %ld\n", (long)(expected), (long)(actual)); \
- } \
+ jserr_long((long)(expected), (long)(actual), reason); \
}
/*----------------------------------------------------------------------------
@@ -220,15 +226,21 @@
*
*----------------------------------------------------------------------------
*/
+static inline void
+jserr_str(const char *expected, const char *actual, const char *reason)
+{
+ if (reason != NULL) {
+ HDprintf("%s\n", reason);
+ }
+ else {
+ HDprintf("!!! Expected:\n%s\n!!!Actual:\n%s\n", expected, actual);
+ }
+}
+
#define JSERR_STR(expected, actual, reason) \
{ \
JSFAILED_AT() \
- if ((reason) != NULL) { \
- HDprintf("%s\n", (reason)); \
- } \
- else { \
- HDprintf("!!! Expected:\n%s\n!!!Actual:\n%s\n", (expected), (actual)); \
- } \
+ jserr_str((expected), (actual), (reason)); \
}
#ifdef JSVERIFY_EXP_ACT
@@ -299,7 +311,7 @@
*----------------------------------------------------------------------------
*/
#define JSVERIFY_STR(expected, actual, reason) \
- if (strcmp((actual), (expected)) != 0) { \
+ if (HDstrcmp((actual), (expected)) != 0) { \
JSERR_STR((expected), (actual), (reason)); \
goto error; \
} /* JSVERIFY_STR */
@@ -347,7 +359,7 @@
*----------------------------------------------------------------------------
*/
#define JSVERIFY_STR(actual, expected, reason) \
- if (strcmp((actual), (expected)) != 0) { \
+ if (HDstrcmp((actual), (expected)) != 0) { \
JSERR_STR((expected), (actual), (reason)); \
goto error; \
} /* JSVERIFY_STR */
@@ -1269,10 +1281,10 @@ test_HMAC_SHA256(void)
cases[i].msg);
if (cases[i].ret == SUCCEED) {
#ifdef VERBOSE
- if (0 != strncmp(cases[i].exp, dest, HDstrlen(cases[i].exp))) {
+ if (0 != HDstrncmp(cases[i].exp, dest, HDstrlen(cases[i].exp))) {
/* print out how wrong things are, and then fail
*/
- dest = (char *)realloc(dest, cases[i].dest_size + 1);
+ dest = (char *)HDrealloc(dest, cases[i].dest_size + 1);
HDassert(dest != NULL);
dest[cases[i].dest_size] = 0;
HDfprintf(stdout, "ERROR:\n!!! \"%s\"\n != \"%s\"\n", cases[i].exp, dest);
@@ -1281,17 +1293,17 @@ test_HMAC_SHA256(void)
#else /* VERBOSE not defined */
/* simple pass/fail test
*/
- JSVERIFY(0, strncmp(cases[i].exp, dest, HDstrlen(cases[i].exp)), NULL);
+ JSVERIFY(0, HDstrncmp(cases[i].exp, dest, HDstrlen(cases[i].exp)), NULL);
#endif /* VERBOSE */
}
- free(dest);
+ HDfree(dest);
}
PASSED();
return 0;
error:
- free(dest);
+ HDfree(dest);
return -1;
} /* end test_HMAC_SHA256() */
@@ -1357,9 +1369,9 @@ test_nlowercase(void)
JSVERIFY(SUCCEED, H5FD_s3comms_nlowercase(dest, cases[i].in, cases[i].len), cases[i].in)
if (cases[i].len > 0) {
- JSVERIFY(0, strncmp(dest, cases[i].exp, cases[i].len), NULL)
+ JSVERIFY(0, HDstrncmp(dest, cases[i].exp, cases[i].len), NULL)
}
- free(dest);
+ HDfree(dest);
} /* end for each testcase */
JSVERIFY(FAIL, H5FD_s3comms_nlowercase(NULL, cases[0].in, cases[0].len), "null distination should fail")
@@ -1368,7 +1380,7 @@ test_nlowercase(void)
return 0;
error:
- free(dest);
+ HDfree(dest);
return -1;
} /* end test_nlowercase() */
@@ -1729,7 +1741,7 @@ test_percent_encode_char(void)
JSVERIFY(SUCCEED, H5FD_s3comms_percent_encode_char(dest, (const unsigned char)cases[i].c, &dest_len),
NULL)
JSVERIFY(cases[i].exp_len, dest_len, NULL)
- JSVERIFY(0, strncmp(dest, cases[i].exp, dest_len), NULL)
+ JSVERIFY(0, HDstrncmp(dest, cases[i].exp, dest_len), NULL)
JSVERIFY_STR(cases[i].exp, dest, NULL)
}
@@ -1768,8 +1780,8 @@ test_s3r_get_filesize(void)
*/
if (FALSE == s3_test_bucket_defined) {
SKIPPED();
- puts(" environment variable HDF5_ROS3_TEST_BUCKET_URL not defined");
- fflush(stdout);
+ HDputs(" environment variable HDF5_ROS3_TEST_BUCKET_URL not defined");
+ HDfflush(stdout);
return 0;
}
@@ -1828,14 +1840,14 @@ test_s3r_open(void)
if (s3_test_credentials_loaded == 0) {
SKIPPED();
- puts(" s3 credentials are not loaded");
- fflush(stdout);
+ HDputs(" s3 credentials are not loaded");
+ HDfflush(stdout);
return 0;
}
if (FALSE == s3_test_bucket_defined) {
SKIPPED();
- puts(" environment variable HDF5_ROS3_TEST_BUCKET_URL not defined");
- fflush(stdout);
+ HDputs(" environment variable HDF5_ROS3_TEST_BUCKET_URL not defined");
+ HDfflush(stdout);
return 0;
}
@@ -1861,7 +1873,7 @@ test_s3r_open(void)
FAIL_IF(purl->port == NULL);
FAIL_IF(5 < HDsnprintf(purl->port, 5, "9000"))
}
- else if (strcmp(purl->port, "9000") != 0) {
+ else if (HDstrcmp(purl->port, "9000") != 0) {
FAIL_IF(5 < HDsnprintf(purl->port, 5, "9000"))
}
else {
@@ -2032,8 +2044,8 @@ test_s3r_read(void)
*/
if (FALSE == s3_test_bucket_defined) {
SKIPPED();
- puts(" environment variable HDF5_ROS3_TEST_BUCKET_URL not defined");
- fflush(stdout);
+ HDputs(" environment variable HDF5_ROS3_TEST_BUCKET_URL not defined");
+ HDfflush(stdout);
return 0;
}
@@ -2093,7 +2105,7 @@ test_s3r_read(void)
JSVERIFY(SUCCEED, H5FD_s3comms_s3r_read(handle, (haddr_t)6370, (size_t)0, buffer), NULL)
JSVERIFY(
0,
- strncmp(
+ HDstrncmp(
buffer,
"And my soul from out that shadow that lies floating on the floor\nShall be lifted—nevermore!\n",
94),
@@ -2110,7 +2122,7 @@ test_s3r_read(void)
H5FD_s3comms_s3r_read(handle, (haddr_t)6400, (size_t)100, /* 6400+100 > 6464 */
buffer),
NULL)
- JSVERIFY(0, strcmp("", buffer), NULL)
+ JSVERIFY(0, HDstrcmp("", buffer), NULL)
/************************
* read starts past eof *
@@ -2120,14 +2132,14 @@ test_s3r_read(void)
H5FD_s3comms_s3r_read(handle, (haddr_t)1200699, /* 1200699 > 6464 */
(size_t)100, buffer),
NULL)
- JSVERIFY(0, strcmp("", buffer), NULL)
+ JSVERIFY(0, HDstrcmp("", buffer), NULL)
/**********************
* read starts on eof *
**********************/
JSVERIFY(FAIL, H5FD_s3comms_s3r_read(handle, (haddr_t)6464, (size_t)0, buffer), NULL)
- JSVERIFY(0, strcmp("", buffer), NULL)
+ JSVERIFY(0, HDstrcmp("", buffer), NULL)
/*************
* TEAR DOWN *
@@ -2217,10 +2229,10 @@ test_signing_key(void)
JSVERIFY(SUCCEED, H5FD_s3comms_signing_key(key, cases[i].secret_key, cases[i].region, cases[i].when),
NULL)
- JSVERIFY(0, strncmp((const char *)cases[i].exp, (const char *)key, SHA256_DIGEST_LENGTH),
- cases[i].exp)
+ JSVERIFY(0, HDstrncmp((const char *)cases[i].exp, (const char *)key, SHA256_DIGEST_LENGTH),
+ (const char *)cases[i].exp)
- free(key);
+ HDfree(key);
key = NULL;
}
@@ -2243,7 +2255,7 @@ test_signing_key(void)
JSVERIFY(FAIL, H5FD_s3comms_signing_key(key, cases[0].secret_key, cases[0].region, NULL),
"time string cannot be NULL")
- free(key);
+ HDfree(key);
key = NULL;
PASSED();
@@ -2251,7 +2263,7 @@ test_signing_key(void)
error:
if (key != NULL) {
- free(key);
+ HDfree(key);
}
return -1;
@@ -2399,9 +2411,9 @@ test_trim(void)
JSVERIFY(SUCCEED, H5FD_s3comms_trim(dest, str, cases[i].in_len, &dest_len), NULL)
JSVERIFY(cases[i].exp_len, dest_len, cases[i].in)
if (dest_len > 0) {
- JSVERIFY(0, strncmp(cases[i].exp, dest, dest_len), cases[i].exp)
+ JSVERIFY(0, HDstrncmp(cases[i].exp, dest, dest_len), cases[i].exp)
}
- free(str);
+ HDfree(str);
str = NULL;
} /* end for each testcase */
@@ -2412,9 +2424,9 @@ test_trim(void)
HDassert(str == NULL);
str = (char *)HDmalloc(sizeof(char *) * 11);
HDassert(str != NULL);
- memcpy(str, "some text ", 11); /* string with null terminator */
+ HDmemcpy(str, "some text ", 11); /* string with null terminator */
JSVERIFY(FAIL, H5FD_s3comms_trim(NULL, str, 10, &dest_len), "destination for trim cannot be NULL");
- free(str);
+ HDfree(str);
str = NULL;
PASSED();
@@ -2422,7 +2434,7 @@ test_trim(void)
error:
if (str != NULL) {
- free(str);
+ HDfree(str);
}
return -1;
@@ -2513,9 +2525,9 @@ test_uriencode(void)
H5FD_s3comms_uriencode(dest, cases[i].str, str_len, cases[i].encode_slash, &dest_written),
NULL);
JSVERIFY(HDstrlen(cases[i].expected), dest_written, NULL)
- JSVERIFY(0, strncmp(dest, cases[i].expected, dest_written), cases[i].expected);
+ JSVERIFY(0, HDstrncmp(dest, cases[i].expected, dest_written), cases[i].expected);
- free(dest);
+ HDfree(dest);
dest = NULL;
} /* end for each testcase */
@@ -2526,12 +2538,12 @@ test_uriencode(void)
dest = (char *)HDmalloc(sizeof(char) * 15);
HDassert(dest != NULL);
- JSVERIFY(FAIL, H5FD_s3comms_uriencode(NULL, "word$", 5, false, &dest_written),
+ JSVERIFY(FAIL, H5FD_s3comms_uriencode(NULL, "word$", 5, FALSE, &dest_written),
"destination cannot be NULL");
- JSVERIFY(FAIL, H5FD_s3comms_uriencode(dest, NULL, 5, false, &dest_written),
+ JSVERIFY(FAIL, H5FD_s3comms_uriencode(dest, NULL, 5, FALSE, &dest_written),
"source string cannot be NULL");
- free(dest);
+ HDfree(dest);
dest = NULL;
PASSED();
@@ -2539,7 +2551,7 @@ test_uriencode(void)
error:
if (dest != NULL) {
- free(dest);
+ HDfree(dest);
}
return -1;
diff --git a/test/set_extent.c b/test/set_extent.c
index fc22137..5a07362 100644
--- a/test/set_extent.c
+++ b/test/set_extent.c
@@ -12,7 +12,7 @@
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
/*
- * Programmer: Pedro Vicente <pvn@ncsa.uiuc.edu>
+ * Programmer: Pedro Vicente
* April 12, 2002
*
* Purpose: Tests the H5Dset_extent call
@@ -121,7 +121,7 @@ main(void)
if (env_h5_drvr == NULL)
env_h5_drvr = "nomatch";
/* Current VFD that does not support contigous address space */
- contig_addr_vfd = (hbool_t)(HDstrcmp(env_h5_drvr, "split") && HDstrcmp(env_h5_drvr, "multi"));
+ contig_addr_vfd = (hbool_t)(HDstrcmp(env_h5_drvr, "split") != 0 && HDstrcmp(env_h5_drvr, "multi") != 0);
/* Initialize random number seed */
HDsrandom((unsigned)HDtime(NULL));
@@ -2086,7 +2086,6 @@ test_layouts(H5D_layout_t layout, hid_t fapl)
H5E_BEGIN_TRY
{
-
ret = H5Dset_extent(did, dims_e);
}
H5E_END_TRY;
@@ -2136,7 +2135,6 @@ test_layouts(H5D_layout_t layout, hid_t fapl)
H5E_BEGIN_TRY
{
-
ret = H5Dset_extent(did, dims_s);
}
H5E_END_TRY;
@@ -2638,7 +2636,7 @@ test_random_rank4_vl(hid_t fapl, hid_t dcpl, hbool_t do_fillvalue, hbool_t disab
TEST_ERROR
if (H5Treclaim(type, mspace, H5P_DEFAULT, wbuf) < 0)
TEST_ERROR
- free(fill_value.p);
+ HDfree(fill_value.p);
if (H5Sclose(mspace) < 0)
TEST_ERROR
if (H5Pclose(my_dcpl) < 0)
@@ -2694,6 +2692,4 @@ test_random_rank4_dump(unsigned ndim_sets, hsize_t dim_log[][4], hsize_t cdims[4
(unsigned)dim_log[i][1], (unsigned)dim_log[i][2], (unsigned)dim_log[i][3]);
if (j >= 0)
HDprintf(" First incorrect value read: ( %d, %d, %d, %d )\n", j, k, l, m);
-
- return;
} /* end test_random_rank4_dump */
diff --git a/test/space_overflow.c b/test/space_overflow.c
index 720e9d0..f235670 100644
--- a/test/space_overflow.c
+++ b/test/space_overflow.c
@@ -12,7 +12,7 @@
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
/*
- * Programmer: Robb Matzke <matzke@llnl.gov>
+ * Programmer: Robb Matzke
* Monday, October 26, 1998
*
* Purpose: Create a dataset with a simple data space that has the
diff --git a/test/stab.c b/test/stab.c
index 682ed84..798619d 100644
--- a/test/stab.c
+++ b/test/stab.c
@@ -12,7 +12,7 @@
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
/*
- * Programmer: Robb Matzke <matzke@llnl.gov>
+ * Programmer: Robb Matzke
* Tuesday, November 24, 1998
*/
@@ -134,7 +134,7 @@ test_misc(hid_t fcpl, hid_t fapl, hbool_t new_format)
TEST_ERROR
if (H5Oget_comment_by_name(g3, "././.", comment, sizeof comment, H5P_DEFAULT) < 0)
TEST_ERROR
- if (HDstrcmp(comment, "hello world")) {
+ if (HDstrcmp(comment, "hello world") != 0) {
H5_FAILED();
HDputs(" Read the wrong comment string from the group.");
HDprintf(" got: \"%s\"\n ans: \"hello world\"\n", comment);
@@ -190,7 +190,7 @@ error:
*
* Failure: number of errors
*
- * Programmer: Robb Matzke <matzke@llnl.gov> 2002-03-28
+ * Programmer: Robb Matzke 2002-03-28
*
* Modifications:
*-------------------------------------------------------------------------
@@ -1279,7 +1279,7 @@ old_api(hid_t fapl)
PASSED();
#else /* H5_NO_DEPRECATED_SYMBOLS */
/* Shut compiler up */
- fapl = fapl;
+ (void)fapl;
SKIPPED();
HDputs(" Deprecated API symbols not enabled");
@@ -1425,7 +1425,7 @@ main(void)
env_h5_drvr = "nomatch";
/* VFD that does not support contigous address space */
- contig_addr_vfd = (hbool_t)(HDstrcmp(env_h5_drvr, "split") && HDstrcmp(env_h5_drvr, "multi"));
+ contig_addr_vfd = (hbool_t)(HDstrcmp(env_h5_drvr, "split") != 0 && HDstrcmp(env_h5_drvr, "multi") != 0);
/* Reset library */
h5_reset();
diff --git a/test/swmr_addrem_writer.c b/test/swmr_addrem_writer.c
index eaecd14..9455653 100644
--- a/test/swmr_addrem_writer.c
+++ b/test/swmr_addrem_writer.c
@@ -86,26 +86,6 @@ open_skeleton(const char *filename, unsigned verbose)
if (H5Pset_libver_bounds(fapl, H5F_LIBVER_LATEST, H5F_LIBVER_LATEST) < 0)
return -1;
-#ifdef QAK
- /* Increase the initial size of the metadata cache */
- {
- H5AC_cache_config_t mdc_config;
-
- mdc_config.version = H5AC__CURR_CACHE_CONFIG_VERSION;
- H5Pget_mdc_config(fapl, &mdc_config);
- HDfprintf(stderr, "mdc_config.initial_size = %lu\n", (unsigned long)mdc_config.initial_size);
- HDfprintf(stderr, "mdc_config.epoch_length = %lu\n", (unsigned long)mdc_config.epoch_length);
- mdc_config.set_initial_size = 1;
- mdc_config.initial_size = 16 * 1024 * 1024;
- /* mdc_config.epoch_length = 5000; */
- H5Pset_mdc_config(fapl, &mdc_config);
- }
-#endif /* QAK */
-
-#ifdef QAK
- H5Pset_fapl_log(fapl, "append.log", H5FD_LOG_ALL, (size_t)(512 * 1024 * 1024));
-#endif /* QAK */
-
/* Open the file */
if ((fid = H5Fopen(filename, H5F_ACC_RDWR | H5F_ACC_SWMR_WRITE, fapl)) < 0)
return -1;
diff --git a/test/swmr_generator.c b/test/swmr_generator.c
index 9267616..2bff12c 100644
--- a/test/swmr_generator.c
+++ b/test/swmr_generator.c
@@ -119,38 +119,10 @@ gen_skeleton(const char *filename, hbool_t verbose, hbool_t swmr_write, int comp
if (!HDstrcmp(index_type, "b2"))
max_dims[0] = H5S_UNLIMITED;
-#ifdef QAK
- /* Increase the initial size of the metadata cache */
- {
- H5AC_cache_config_t mdc_config;
-
- mdc_config.version = H5AC__CURR_CACHE_CONFIG_VERSION;
- H5Pget_mdc_config(fapl, &mdc_config);
- HDfprintf(stderr, "mdc_config.initial_size = %lu\n", (unsigned long)mdc_config.initial_size);
- HDfprintf(stderr, "mdc_config.epoch_length = %lu\n", (unsigned long)mdc_config.epoch_length);
- mdc_config.set_initial_size = 1;
- mdc_config.initial_size = 16 * 1024 * 1024;
- /* mdc_config.epoch_length = 5000; */
- H5Pset_mdc_config(fapl, &mdc_config);
- }
-#endif /* QAK */
-
-#ifdef QAK
- H5Pset_small_data_block_size(fapl, (hsize_t)(50 * CHUNK_SIZE * DTYPE_SIZE));
-#endif /* QAK */
-
-#ifdef QAK
- H5Pset_fapl_log(fapl, "append.log", H5FD_LOG_ALL, (size_t)(512 * 1024 * 1024));
-#endif /* QAK */
-
/* Create file creation property list */
if ((fcpl = H5Pcreate(H5P_FILE_CREATE)) < 0)
return -1;
-#ifdef QAK
- H5Pset_link_phase_change(fcpl, 0, 0);
-#endif /* QAK */
-
/* Emit informational message */
if (verbose)
HDfprintf(stderr, "Creating file\n");
@@ -314,7 +286,7 @@ main(int argc, const char *argv[])
/* Chunk index type */
case 'i':
index_type = argv[u + 1];
- if (HDstrcmp(index_type, "ea") && HDstrcmp(index_type, "b2"))
+ if (HDstrcmp(index_type, "ea") != 0 && HDstrcmp(index_type, "b2") != 0)
usage();
u += 2;
break;
diff --git a/test/swmr_remove_writer.c b/test/swmr_remove_writer.c
index bca4ec8..fddff12 100644
--- a/test/swmr_remove_writer.c
+++ b/test/swmr_remove_writer.c
@@ -88,26 +88,6 @@ open_skeleton(const char *filename, unsigned verbose, unsigned old)
return -1;
}
-#ifdef QAK
- /* Increase the initial size of the metadata cache */
- {
- H5AC_cache_config_t mdc_config;
-
- mdc_config.version = H5AC__CURR_CACHE_CONFIG_VERSION;
- H5Pget_mdc_config(fapl, &mdc_config);
- HDfprintf(stderr, "mdc_config.initial_size = %lu\n", (unsigned long)mdc_config.initial_size);
- HDfprintf(stderr, "mdc_config.epoch_length = %lu\n", (unsigned long)mdc_config.epoch_length);
- mdc_config.set_initial_size = 1;
- mdc_config.initial_size = 16 * 1024 * 1024;
- /* mdc_config.epoch_length = 5000; */
- H5Pset_mdc_config(fapl, &mdc_config);
- }
-#endif /* QAK */
-
-#ifdef QAK
- H5Pset_fapl_log(fapl, "append.log", H5FD_LOG_ALL, (size_t)(512 * 1024 * 1024));
-#endif /* QAK */
-
/* Open the file */
if ((fid = H5Fopen(filename, H5F_ACC_RDWR | H5F_ACC_SWMR_WRITE, fapl)) < 0)
return -1;
diff --git a/test/swmr_sparse_writer.c b/test/swmr_sparse_writer.c
index 795dcee..f7460ee 100644
--- a/test/swmr_sparse_writer.c
+++ b/test/swmr_sparse_writer.c
@@ -84,26 +84,6 @@ open_skeleton(const char *filename, unsigned verbose)
if (H5Pset_libver_bounds(fapl, H5F_LIBVER_LATEST, H5F_LIBVER_LATEST) < 0)
return -1;
-#ifdef QAK
- /* Increase the initial size of the metadata cache */
- {
- H5AC_cache_config_t mdc_config;
-
- mdc_config.version = H5AC__CURR_CACHE_CONFIG_VERSION;
- H5Pget_mdc_config(fapl, &mdc_config);
- HDfprintf(stderr, "mdc_config.initial_size = %lu\n", (unsigned long)mdc_config.initial_size);
- HDfprintf(stderr, "mdc_config.epoch_length = %lu\n", (unsigned long)mdc_config.epoch_length);
- mdc_config.set_initial_size = 1;
- mdc_config.initial_size = 16 * 1024 * 1024;
- /* mdc_config.epoch_length = 5000; */
- H5Pset_mdc_config(fapl, &mdc_config);
- }
-#endif /* QAK */
-
-#ifdef QAK
- H5Pset_fapl_log(fapl, "append.log", H5FD_LOG_ALL, (size_t)(512 * 1024 * 1024));
-#endif /* QAK */
-
/* Open the file */
if ((fid = H5Fopen(filename, H5F_ACC_RDWR | H5F_ACC_SWMR_WRITE, fapl)) < 0)
return -1;
diff --git a/test/swmr_start_write.c b/test/swmr_start_write.c
index 3f83e45..bc0d0d2 100644
--- a/test/swmr_start_write.c
+++ b/test/swmr_start_write.c
@@ -82,16 +82,6 @@ create_file(const char *filename, hbool_t verbose, FILE *verbose_file, unsigned
if (H5Pset_libver_bounds(fapl, H5F_LIBVER_LATEST, H5F_LIBVER_LATEST) < 0)
return -1;
-#ifdef QAK
- if (verbose) {
- char verbose_name[1024];
-
- HDsnprintf(verbose_name, sizeof(verbose_name), "swmr_start_write.log.%u", random_seed);
-
- H5Pset_fapl_log(fapl, verbose_name, H5FD_LOG_ALL, (size_t)(512 * 1024 * 1024));
- } /* end if */
-#endif /* QAK */
-
/* Create file creation property list */
if ((fcpl = H5Pcreate(H5P_FILE_CREATE)) < 0)
return -1;
diff --git a/test/swmr_writer.c b/test/swmr_writer.c
index 7465faa..40f4d68 100644
--- a/test/swmr_writer.c
+++ b/test/swmr_writer.c
@@ -88,22 +88,6 @@ open_skeleton(const char *filename, hbool_t verbose, FILE *verbose_file, unsigne
return -1;
}
-#ifdef QAK
- /* Increase the initial size of the metadata cache */
- {
- H5AC_cache_config_t mdc_config;
-
- mdc_config.version = H5AC__CURR_CACHE_CONFIG_VERSION;
- H5Pget_mdc_config(fapl, &mdc_config);
- HDfprintf(stderr, "mdc_config.initial_size = %lu\n", (unsigned long)mdc_config.initial_size);
- HDfprintf(stderr, "mdc_config.epoch_length = %lu\n", (unsigned long)mdc_config.epoch_length);
- mdc_config.set_initial_size = 1;
- mdc_config.initial_size = 16 * 1024 * 1024;
- /* mdc_config.epoch_length = 5000; */
- H5Pset_mdc_config(fapl, &mdc_config);
- }
-#endif /* QAK */
-
if (use_log_vfd) {
char verbose_name[1024];
diff --git a/test/tarray.c b/test/tarray.c
index c8fc45b..8b518cf 100644
--- a/test/tarray.c
+++ b/test/tarray.c
@@ -157,8 +157,8 @@ test_array_atomic_1d(void)
/* Check the array dimensions */
for (i = 0; i < ndims; i++)
if (rdims1[i] != tdims1[i]) {
- TestErrPrintf("Array dimension information doesn't match!, rdims1[%d]=%d, tdims1[%d]=%d\n",
- (int)i, (int)rdims1[i], (int)i, (int)tdims1[i]);
+ TestErrPrintf("Array dimension information doesn't match!, rdims1[%d]=%llu, tdims1[%d]=%llu\n", i,
+ rdims1[i], i, tdims1[i]);
continue;
} /* end if */
@@ -490,8 +490,8 @@ test_array_array_atomic(void)
/* Check the array dimensions */
for (i = 0; i < ndims1; i++)
if (rdims1[i] != tdims1[i]) {
- TestErrPrintf("Array dimension information doesn't match!, rdims1[%d]=%d, tdims1[%d]=%d\n",
- (int)i, (int)rdims1[i], (int)i, (int)tdims1[i]);
+ TestErrPrintf("Array dimension information doesn't match!, rdims1[%d]=%llu, tdims1[%d]=%llu\n", i,
+ rdims1[i], i, tdims1[i]);
continue;
} /* end if */
@@ -668,8 +668,8 @@ test_array_compound_atomic(void)
/* Check the array dimensions */
for (i = 0; i < ndims; i++)
if (rdims1[i] != tdims1[i]) {
- TestErrPrintf("Array dimension information doesn't match!, rdims1[%d]=%d, tdims1[%d]=%d\n",
- (int)i, (int)rdims1[i], (int)i, (int)tdims1[i]);
+ TestErrPrintf("Array dimension information doesn't match!, rdims1[%d]=%llu, tdims1[%d]=%llu\n", i,
+ rdims1[i], i, tdims1[i]);
continue;
} /* end if */
@@ -889,8 +889,8 @@ test_array_compound_array(void)
/* Check the array dimensions */
for (i = 0; i < ndims; i++)
if (rdims1[i] != tdims1[i]) {
- TestErrPrintf("Array dimension information doesn't match!, rdims1[%d]=%d, tdims1[%d]=%d\n",
- (int)i, (int)rdims1[i], (int)i, (int)tdims1[i]);
+ TestErrPrintf("Array dimension information doesn't match!, rdims1[%d]=%llu, tdims1[%d]=%llu\n", i,
+ rdims1[i], i, tdims1[i]);
continue;
} /* end if */
@@ -951,8 +951,9 @@ test_array_compound_array(void)
/* Check the array dimensions */
for (i = 0; i < ndims; i++)
if (rdims1[i] != tdims1[i]) {
- TestErrPrintf("Nested array dimension information doesn't match!, rdims1[%d]=%d, tdims1[%d]=%d\n",
- (int)i, (int)rdims1[i], (int)i, (int)tdims1[i]);
+ TestErrPrintf(
+ "Nested array dimension information doesn't match!, rdims1[%d]=%llu, tdims1[%d]=%llu\n", i,
+ rdims1[i], i, tdims1[i]);
continue;
} /* end if */
@@ -1092,7 +1093,6 @@ test_array_free_custom(void *_mem, void *info)
HDfree(mem);
} /* end if */
- return;
} /* end test_array_free_custom() */
/*-------------------------------------------------------------------------
@@ -1210,8 +1210,8 @@ test_array_vlen_atomic(void)
/* Check the array dimensions */
for (i = 0; i < ndims; i++)
if (rdims1[i] != tdims1[i]) {
- TestErrPrintf("Array dimension information doesn't match!, rdims1[%d]=%d, tdims1[%d]=%d\n",
- (int)i, (int)rdims1[i], (int)i, (int)tdims1[i]);
+ TestErrPrintf("Array dimension information doesn't match!, rdims1[%d]=%llu, tdims1[%d]=%llu\n", i,
+ rdims1[i], i, tdims1[i]);
continue;
} /* end if */
@@ -1440,8 +1440,8 @@ test_array_vlen_array(void)
/* Check the array dimensions */
for (i = 0; i < ndims; i++)
if (rdims1[i] != tdims1[i]) {
- TestErrPrintf("Array dimension information doesn't match!, rdims1[%d]=%d, tdims1[%d]=%d\n",
- (int)i, (int)rdims1[i], (int)i, (int)tdims1[i]);
+ TestErrPrintf("Array dimension information doesn't match!, rdims1[%d]=%llu, tdims1[%d]=%llu\n", i,
+ rdims1[i], i, tdims1[i]);
continue;
} /* end if */
@@ -1472,8 +1472,8 @@ test_array_vlen_array(void)
/* Check the array dimensions */
for (i = 0; i < ndims; i++)
if (rdims1[i] != tdims1[i]) {
- TestErrPrintf("Array dimension information doesn't match!, rdims1[%d]=%d, tdims1[%d]=%d\n",
- (int)i, (int)rdims1[i], (int)i, (int)tdims1[i]);
+ TestErrPrintf("Array dimension information doesn't match!, rdims1[%d]=%llu, tdims1[%d]=%llu\n", i,
+ rdims1[i], i, tdims1[i]);
continue;
} /* end if */
@@ -2081,8 +2081,9 @@ test_compat(void)
/* Check the array dimensions */
for (i = 0; i < ndims; i++)
if (rdims1[i] != tdims1[i]) {
- TestErrPrintf("Array dimension information doesn't match!, rdims1[%d]=%d, tdims1[%d]=%d\n",
- (int)i, (int)rdims1[i], (int)i, (int)tdims1[i]);
+ TestErrPrintf(
+ "Array dimension information doesn't match!, rdims1[%d]=%llu, tdims1[%d]=%llu\n", i,
+ rdims1[i], i, tdims1[i]);
continue;
} /* end if */
@@ -2128,8 +2129,9 @@ test_compat(void)
/* Check the array dimensions */
for (i = 0; i < ndims; i++)
if (rdims1[i] != tdims1[i]) {
- TestErrPrintf("Array dimension information doesn't match!, rdims1[%d]=%d, tdims1[%d]=%d\n",
- (int)i, (int)rdims1[i], (int)i, (int)tdims1[i]);
+ TestErrPrintf(
+ "Array dimension information doesn't match!, rdims1[%d]=%llu, tdims1[%d]=%llu\n", i,
+ rdims1[i], i, tdims1[i]);
continue;
} /* end if */
@@ -2228,5 +2230,5 @@ test_array(void)
void
cleanup_array(void)
{
- remove(FILENAME);
+ HDremove(FILENAME);
} /* end cleanup_array() */
diff --git a/test/tattr.c b/test/tattr.c
index 8429477..c30b0f5 100644
--- a/test/tattr.c
+++ b/test/tattr.c
@@ -859,8 +859,8 @@ test_attr_compound_read(hid_t fapl)
VERIFY(fields, 3, "H5Tget_nmembers");
for (i = 0; i < fields; i++) {
fieldname = H5Tget_member_name(type, (unsigned)i);
- if (!(HDstrcmp(fieldname, ATTR4_FIELDNAME1) || HDstrcmp(fieldname, ATTR4_FIELDNAME2) ||
- HDstrcmp(fieldname, ATTR4_FIELDNAME3)))
+ if (!(HDstrcmp(fieldname, ATTR4_FIELDNAME1) != 0 || HDstrcmp(fieldname, ATTR4_FIELDNAME2) != 0 ||
+ HDstrcmp(fieldname, ATTR4_FIELDNAME3) != 0))
TestErrPrintf("invalid field name for field #%d: %s\n", i, fieldname);
H5free_memory(fieldname);
} /* end for */
@@ -907,7 +907,7 @@ test_attr_compound_read(hid_t fapl)
/* Verify values read in */
for (i = 0; i < ATTR4_DIM1; i++)
for (j = 0; j < ATTR4_DIM2; j++)
- if (HDmemcmp(&attr_data4[i][j], &read_data4[i][j], sizeof(struct attr4_struct))) {
+ if (HDmemcmp(&attr_data4[i][j], &read_data4[i][j], sizeof(struct attr4_struct)) != 0) {
HDprintf("%d: attribute data different: attr_data4[%d][%d].i=%d, read_data4[%d][%d].i=%d\n",
__LINE__, i, j, attr_data4[i][j].i, i, j, read_data4[i][j].i);
HDprintf("%d: attribute data different: attr_data4[%d][%d].d=%f, read_data4[%d][%d].d=%f\n",
@@ -920,7 +920,7 @@ test_attr_compound_read(hid_t fapl)
/* Verify Name */
name_len = H5Aget_name(attr, (size_t)ATTR_NAME_LEN, attr_name);
VERIFY(name_len, HDstrlen(ATTR4_NAME), "H5Aget_name");
- if (HDstrcmp(attr_name, ATTR4_NAME))
+ if (HDstrcmp(attr_name, ATTR4_NAME) != 0)
TestErrPrintf("attribute name different: attr_name=%s, should be %s\n", attr_name, ATTR4_NAME);
/* Close attribute datatype */
@@ -1279,7 +1279,7 @@ test_attr_mult_read(hid_t fapl)
/* Verify Name */
name_len = H5Aget_name(attr, (size_t)ATTR_NAME_LEN, attr_name);
VERIFY(name_len, HDstrlen(ATTR1_NAME), "H5Aget_name");
- if (HDstrcmp(attr_name, ATTR1_NAME))
+ if (HDstrcmp(attr_name, ATTR1_NAME) != 0)
TestErrPrintf("attribute name different: attr_name=%s, should be %s\n", attr_name, ATTR1_NAME);
/* Verify Name with too small of a buffer */
@@ -1287,7 +1287,7 @@ test_attr_mult_read(hid_t fapl)
VERIFY(name_len, HDstrlen(ATTR1_NAME), "H5Aget_name");
HDstrcpy(temp_name, ATTR1_NAME); /* make a copy of the name */
temp_name[HDstrlen(ATTR1_NAME) - 1] = '\0'; /* truncate it to match the one retrieved */
- if (HDstrcmp(attr_name, temp_name))
+ if (HDstrcmp(attr_name, temp_name) != 0)
TestErrPrintf("attribute name different: attr_name=%s, should be %s\n", attr_name, temp_name);
/* Close attribute */
@@ -1337,7 +1337,7 @@ test_attr_mult_read(hid_t fapl)
/* Verify Name */
name_len = H5Aget_name(attr, (size_t)ATTR_NAME_LEN, attr_name);
VERIFY(name_len, HDstrlen(ATTR2_NAME), "H5Aget_name");
- if (HDstrcmp(attr_name, ATTR2_NAME))
+ if (HDstrcmp(attr_name, ATTR2_NAME) != 0)
TestErrPrintf("attribute name different: attr_name=%s, should be %s\n", attr_name, ATTR2_NAME);
/* Verify Name with too small of a buffer */
@@ -1345,7 +1345,7 @@ test_attr_mult_read(hid_t fapl)
VERIFY(name_len, HDstrlen(ATTR2_NAME), "H5Aget_name");
HDstrcpy(temp_name, ATTR2_NAME); /* make a copy of the name */
temp_name[HDstrlen(ATTR2_NAME) - 1] = '\0'; /* truncate it to match the one retrieved */
- if (HDstrcmp(attr_name, temp_name))
+ if (HDstrcmp(attr_name, temp_name) != 0)
TestErrPrintf("attribute name different: attr_name=%s, should be %s\n", attr_name, temp_name);
/* Close attribute */
@@ -1399,7 +1399,7 @@ test_attr_mult_read(hid_t fapl)
/* Verify Name */
name_len = H5Aget_name(attr, (size_t)ATTR_NAME_LEN, attr_name);
VERIFY(name_len, HDstrlen(ATTR3_NAME), "H5Aget_name");
- if (HDstrcmp(attr_name, ATTR3_NAME))
+ if (HDstrcmp(attr_name, ATTR3_NAME) != 0)
TestErrPrintf("attribute name different: attr_name=%s, should be %s\n", attr_name, ATTR3_NAME);
/* Verify Name with too small of a buffer */
@@ -1407,7 +1407,7 @@ test_attr_mult_read(hid_t fapl)
VERIFY(name_len, HDstrlen(ATTR3_NAME), "H5Aget_name");
HDstrcpy(temp_name, ATTR3_NAME); /* make a copy of the name */
temp_name[HDstrlen(ATTR3_NAME) - 1] = '\0'; /* truncate it to match the one retrieved */
- if (HDstrcmp(attr_name, temp_name))
+ if (HDstrcmp(attr_name, temp_name) != 0)
TestErrPrintf("attribute name different: attr_name=%s, should be %s\n", attr_name, temp_name);
/* Close attribute */
@@ -1436,19 +1436,19 @@ attr_op1(hid_t H5_ATTR_UNUSED loc_id, const char *name, const H5A_info_t H5_ATTR
switch (*count) {
case 0:
- if (HDstrcmp(name, ATTR1_NAME))
+ if (HDstrcmp(name, ATTR1_NAME) != 0)
TestErrPrintf("attribute name different: name=%s, should be %s\n", name, ATTR1_NAME);
(*count)++;
break;
case 1:
- if (HDstrcmp(name, ATTR2_NAME))
+ if (HDstrcmp(name, ATTR2_NAME) != 0)
TestErrPrintf("attribute name different: name=%s, should be %s\n", name, ATTR2_NAME);
(*count)++;
break;
case 2:
- if (HDstrcmp(name, ATTR3_NAME))
+ if (HDstrcmp(name, ATTR3_NAME) != 0)
TestErrPrintf("attribute name different: name=%s, should be %s\n", name, ATTR3_NAME);
(*count)++;
break;
@@ -1590,7 +1590,7 @@ test_attr_delete(hid_t fapl)
/* Verify Name */
name_len = H5Aget_name(attr, (size_t)ATTR_NAME_LEN, attr_name);
VERIFY(name_len, HDstrlen(ATTR1_NAME), "H5Aget_name");
- if (HDstrcmp(attr_name, ATTR1_NAME))
+ if (HDstrcmp(attr_name, ATTR1_NAME) != 0)
TestErrPrintf("attribute name different: attr_name=%s, should be %s\n", attr_name, ATTR1_NAME);
/* Close attribute */
@@ -1605,7 +1605,7 @@ test_attr_delete(hid_t fapl)
/* Verify Name */
name_len = H5Aget_name(attr, (size_t)ATTR_NAME_LEN, attr_name);
VERIFY(name_len, HDstrlen(ATTR3_NAME), "H5Aget_name");
- if (HDstrcmp(attr_name, ATTR3_NAME))
+ if (HDstrcmp(attr_name, ATTR3_NAME) != 0)
TestErrPrintf("attribute name different: attr_name=%s, should be %s\n", attr_name, ATTR3_NAME);
/* Close attribute */
@@ -1629,7 +1629,7 @@ test_attr_delete(hid_t fapl)
/* Verify Name */
name_len = H5Aget_name(attr, (size_t)ATTR_NAME_LEN, attr_name);
VERIFY(name_len, HDstrlen(ATTR3_NAME), "H5Aget_name");
- if (HDstrcmp(attr_name, ATTR3_NAME))
+ if (HDstrcmp(attr_name, ATTR3_NAME) != 0)
TestErrPrintf("attribute name different: attr_name=%s, should be %s\n", attr_name, ATTR3_NAME);
/* Close attribute */
@@ -2123,7 +2123,7 @@ test_attr_dense_verify(hid_t loc_id, unsigned max_attr)
HDsprintf(attrname, "attr %02u", u);
name_len = H5Aget_name(attr, (size_t)ATTR_NAME_LEN, check_name);
VERIFY(name_len, HDstrlen(attrname), "H5Aget_name");
- if (HDstrcmp(check_name, attrname))
+ if (HDstrcmp(check_name, attrname) != 0)
TestErrPrintf("attribute name different: attrname = '%s', should be '%s'\n", check_name,
attrname);
@@ -4206,8 +4206,8 @@ test_attr_deprec(hid_t fcpl, hid_t fapl)
CHECK(ret, FAIL, "H5Fclose");
#else /* H5_NO_DEPRECATED_SYMBOLS */
/* Shut compiler up */
- fcpl = fcpl;
- fapl = fapl;
+ (void)fcpl;
+ (void)fapl;
/* Output message about test being skipped */
MESSAGE(5, ("Skipping Test On Deprecated Attribute Routines\n"));
@@ -5658,7 +5658,7 @@ attr_info_by_idx_check(hid_t obj_id, const char *attrname, hsize_t n, hbool_t us
ret = (herr_t)H5Aget_name_by_idx(obj_id, ".", H5_INDEX_CRT_ORDER, H5_ITER_INC, n, tmpname,
(size_t)NAME_BUF_SIZE, H5P_DEFAULT);
CHECK(ret, FAIL, "H5Aget_name_by_idx");
- if (HDstrcmp(attrname, tmpname))
+ if (HDstrcmp(attrname, tmpname) != 0)
TestErrPrintf("Line %d: attribute name size wrong!\n", __LINE__);
/* Don't test "native" order if there is no creation order index, since
@@ -5684,7 +5684,7 @@ attr_info_by_idx_check(hid_t obj_id, const char *attrname, hsize_t n, hbool_t us
ret = (herr_t)H5Aget_name_by_idx(obj_id, ".", H5_INDEX_CRT_ORDER, H5_ITER_NATIVE, n, tmpname,
(size_t)NAME_BUF_SIZE, H5P_DEFAULT);
CHECK(ret, FAIL, "H5Aget_name_by_idx");
- if (HDstrcmp(attrname, tmpname))
+ if (HDstrcmp(attrname, tmpname) != 0)
TestErrPrintf("Line %d: attribute name size wrong!\n", __LINE__);
} /* end if */
@@ -5705,7 +5705,7 @@ attr_info_by_idx_check(hid_t obj_id, const char *attrname, hsize_t n, hbool_t us
ret = (herr_t)H5Aget_name_by_idx(obj_id, ".", H5_INDEX_CRT_ORDER, H5_ITER_DEC, (hsize_t)0, tmpname,
(size_t)NAME_BUF_SIZE, H5P_DEFAULT);
CHECK(ret, FAIL, "H5Aget_name_by_idx");
- if (HDstrcmp(attrname, tmpname))
+ if (HDstrcmp(attrname, tmpname) != 0)
TestErrPrintf("Line %d: attribute name size wrong!\n", __LINE__);
/* Verify the information for first attribute, in increasing name order */
@@ -5725,7 +5725,7 @@ attr_info_by_idx_check(hid_t obj_id, const char *attrname, hsize_t n, hbool_t us
ret = (herr_t)H5Aget_name_by_idx(obj_id, ".", H5_INDEX_NAME, H5_ITER_INC, n, tmpname,
(size_t)NAME_BUF_SIZE, H5P_DEFAULT);
CHECK(ret, FAIL, "H5Aget_name_by_idx");
- if (HDstrcmp(attrname, tmpname))
+ if (HDstrcmp(attrname, tmpname) != 0)
TestErrPrintf("Line %d: attribute name size wrong!\n", __LINE__);
/* Don't test "native" order queries on link name order, since there's not
@@ -5749,7 +5749,7 @@ attr_info_by_idx_check(hid_t obj_id, const char *attrname, hsize_t n, hbool_t us
ret = (herr_t)H5Aget_name_by_idx(obj_id, ".", H5_INDEX_NAME, H5_ITER_DEC, (hsize_t)0, tmpname,
(size_t)NAME_BUF_SIZE, H5P_DEFAULT);
CHECK(ret, FAIL, "H5Aget_name_by_idx");
- if (HDstrcmp(attrname, tmpname))
+ if (HDstrcmp(attrname, tmpname) != 0)
TestErrPrintf("Line %d: attribute name size wrong!\n", __LINE__);
/* Retrieve current # of errors */
@@ -6778,13 +6778,6 @@ attr_iterate2_cb(hid_t loc_id, const char *attr_name, const H5A_info_t *info, vo
char attrname[NAME_BUF_SIZE]; /* Object name */
H5A_info_t my_info; /* Local attribute info */
-#ifdef QAK
- HDfprintf(stderr, "attr_name = '%s'\n", attr_name);
- if (info)
- HDfprintf(stderr, "info->corder = %u\n", (unsigned)info->corder);
- HDfprintf(stderr, "op_data->curr = %Hd\n", op_data->curr);
-#endif /* QAK */
-
/* Increment # of times the callback was called */
op_data->ncalled++;
@@ -6813,7 +6806,7 @@ attr_iterate2_cb(hid_t loc_id, const char *attr_name, const H5A_info_t *info, vo
/* Verify name of link */
HDsprintf(attrname, "attr %02u", (unsigned)my_info.corder);
- if (HDstrcmp(attr_name, attrname))
+ if (HDstrcmp(attr_name, attrname) != 0)
return (H5_ITER_ERROR);
/* Check if we've visited this link before */
diff --git a/test/tchecksum.c b/test/tchecksum.c
index 15667e3..f96d810 100644
--- a/test/tchecksum.c
+++ b/test/tchecksum.c
@@ -15,7 +15,7 @@
*
* Created: tchecksum.c
* Aug 21 2006
- * Quincey Koziol <koziol@hdfgroup.org>
+ * Quincey Koziol
*
* Purpose: Test internal checksum routine(s)
*
diff --git a/test/tcoords.c b/test/tcoords.c
index 855b383..fef8689 100644
--- a/test/tcoords.c
+++ b/test/tcoords.c
@@ -87,10 +87,10 @@ test_singleEnd_selElements(hid_t file, hbool_t is_chunked)
}
/* Construct dataset's name */
- memset(dset_name, 0, (size_t)NAME_LEN);
- strcat(dset_name, SINGLE_END_DSET);
+ HDmemset(dset_name, 0, (size_t)NAME_LEN);
+ HDstrcat(dset_name, SINGLE_END_DSET);
if (is_chunked)
- strcat(dset_name, "_chunked");
+ HDstrcat(dset_name, "_chunked");
did = H5Dcreate2(file, dset_name, H5T_NATIVE_INT, sid, H5P_DEFAULT, plid, H5P_DEFAULT);
CHECK(did, FAIL, "H5Dcreate2");
@@ -259,10 +259,10 @@ test_singleEnd_selHyperslab(hid_t file, hbool_t is_chunked)
hsize_t mem3_block[4] = {1, 3, 6, 1};
/* Construct dataset's name */
- memset(dset_name, 0, NAME_LEN);
- strcat(dset_name, SINGLE_END_DSET);
+ HDmemset(dset_name, 0, NAME_LEN);
+ HDstrcat(dset_name, SINGLE_END_DSET);
if (is_chunked)
- strcat(dset_name, "_chunked");
+ HDstrcat(dset_name, "_chunked");
/* Dataspace for the dataset in file */
sid = H5Screate_simple(4, da_dims, da_dims);
@@ -436,10 +436,10 @@ test_multiple_ends(hid_t file, hbool_t is_chunked)
}
/* Construct dataset's name */
- memset(dset_name, 0, NAME_LEN);
- strcat(dset_name, MULTI_ENDS_SEL_HYPER_DSET);
+ HDmemset(dset_name, 0, NAME_LEN);
+ HDstrcat(dset_name, MULTI_ENDS_SEL_HYPER_DSET);
if (is_chunked)
- strcat(dset_name, "_chunked");
+ HDstrcat(dset_name, "_chunked");
did = H5Dcreate2(file, dset_name, H5T_NATIVE_INT, sid, H5P_DEFAULT, plid, H5P_DEFAULT);
CHECK(did, FAIL, "H5Dcreate2");
@@ -687,5 +687,5 @@ test_coords(void)
void
cleanup_coords(void)
{
- remove(FILENAME);
+ HDremove(FILENAME);
}
diff --git a/test/testerror.sh.in b/test/testerror.sh.in
index d284355..4fb2a81 100644
--- a/test/testerror.sh.in
+++ b/test/testerror.sh.in
@@ -64,6 +64,12 @@ TEST() {
# Skip the plugin for testing missing filter.
$ENVCMD $RUNSERIAL $TEST_ERR_BIN
) >$actual 2>$actual_err
+
+ # Check for core dump
+ if [ $? != 0 ]; then
+ nerrors=`expr $nerrors + 1`
+ fi
+
# 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)/' \
diff --git a/test/testexternal_env.sh.in b/test/testexternal_env.sh.in
index 618c4ff..94fbb88 100644
--- a/test/testexternal_env.sh.in
+++ b/test/testexternal_env.sh.in
@@ -34,9 +34,9 @@ ENVCMD="env HDF5_EXTFILE_PREFIX=\${ORIGIN}" # The environment variable & valu
$ENVCMD $RUNSERIAL $TEST_BIN
exitcode=$?
if [ $exitcode -eq 0 ]; then
- echo "Test prefix for HDF5_EXTFILE_PREFIX PASSED"
- else
- nerrors="`expr $nerrors + 1`"
- echo "***Error encountered for HDF5_EXTFILE_PREFIX test***"
+ echo "Test prefix for HDF5_EXTFILE_PREFIX PASSED"
+else
+ nerrors="`expr $nerrors + 1`"
+ echo "***Error encountered for HDF5_EXTFILE_PREFIX test***"
fi
exit $nerrors
diff --git a/test/testflushrefresh.sh.in b/test/testflushrefresh.sh.in
index 06a5031..83685e8 100644
--- a/test/testflushrefresh.sh.in
+++ b/test/testflushrefresh.sh.in
@@ -82,7 +82,7 @@ fi
# different, occasionally the wrong file is deleted, interrupting the flow of
# the test. Running each of these tests in its own directory should eliminate
# the problem.
-mkdir flushrefresh_test
+mkdir -p flushrefresh_test
cp flushrefresh flushrefresh_test
# With the --disable-shared option, flushrefresh is built in the test directory,
@@ -90,7 +90,7 @@ cp flushrefresh flushrefresh_test
# the test directory. test/flushrefresh should always be copied,
# .libs/flushrefresh should be copied only if it exists.
if [ -f .libs/flushrefresh ]; then
- mkdir flushrefresh_test/.libs
+ mkdir -p flushrefresh_test/.libs
for FILE in .libs/flushrefresh*; do
case "$FILE" in
*.o) continue ;; ## don't copy the .o files
@@ -156,6 +156,12 @@ until [ $verification_done -eq 1 ]; do
echo "all flush verification complete" > $endsignal
else
./flushrefresh $param1 $param2
+
+ # Check for core dump
+ if [ $? -gt 0 ]; then
+ nerrors=`expr $nerrors + 1`
+ fi
+
echo "verification flush process done" > $endsignal
fi
@@ -195,6 +201,12 @@ if [ $timedout -eq 0 ]; then
echo "all refresh verification complete" > $endsignal
else
./flushrefresh $param1
+
+ # Check for core dump
+ if [ $? -gt 0 ]; then
+ nerrors=`expr $nerrors + 1`
+ fi
+
echo "refresh verifiction process done" > $endsignal
fi
diff --git a/test/testframe.c b/test/testframe.c
index ff7cdc5..f805997 100644
--- a/test/testframe.c
+++ b/test/testframe.c
@@ -12,7 +12,7 @@
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
/*
- * Programmer: Quincey Koziol <koziol@ncsa.uiuc.edu>
+ * Programmer: Quincey Koziol
* Tuesday, January 6, 2004
*
* Purpose: Provides support functions for the testing framework.
@@ -442,15 +442,15 @@ GetTestExpress(void)
/* set it here for now. Should be done in something like h5test_init(). */
if (TestExpress == -1) {
- env_val = getenv("HDF5TestExpress");
+ env_val = HDgetenv("HDF5TestExpress");
if (env_val == NULL)
SetTestExpress(1);
- else if (strcmp(env_val, "0") == 0)
+ else if (HDstrcmp(env_val, "0") == 0)
SetTestExpress(0);
- else if (strcmp(env_val, "1") == 0)
+ else if (HDstrcmp(env_val, "1") == 0)
SetTestExpress(1);
- else if (strcmp(env_val, "2") == 0)
+ else if (HDstrcmp(env_val, "2") == 0)
SetTestExpress(2);
else
SetTestExpress(3);
@@ -521,7 +521,7 @@ ParseTestVerbosity(char *argv)
else if (*argv == 'h')
SetTestVerbosity(VERBO_HI);
else
- SetTestVerbosity(atoi(argv));
+ SetTestVerbosity(HDatoi(argv));
}
/*
diff --git a/test/testhdf5.c b/test/testhdf5.c
index 5e413f3..45c0f9f 100644
--- a/test/testhdf5.c
+++ b/test/testhdf5.c
@@ -45,7 +45,6 @@ main(int argc, char *argv[])
AddTest("config", test_configure, cleanup_configure, "Configure definitions", NULL);
AddTest("metadata", test_metadata, cleanup_metadata, "Encoding/decoding metadata", NULL);
AddTest("checksum", test_checksum, cleanup_checksum, "Checksum algorithm", NULL);
- AddTest("tst", test_tst, NULL, "Ternary Search Trees", NULL);
AddTest("heap", test_heap, NULL, "Memory Heaps", NULL);
AddTest("skiplist", test_skiplist, NULL, "Skip Lists", NULL);
AddTest("refstr", test_refstr, NULL, "Reference Counted Strings", NULL);
diff --git a/test/testhdf5.h b/test/testhdf5.h
index f3cb995..5fb01a8 100644
--- a/test/testhdf5.h
+++ b/test/testhdf5.h
@@ -203,7 +203,6 @@ extern "C" {
/* Prototypes for the test routines */
void test_metadata(void);
void test_checksum(void);
-void test_tst(void);
void test_heap(void);
void test_refstr(void);
void test_file(void);
diff --git a/test/testlinks_env.sh.in b/test/testlinks_env.sh.in
index dd83d7b..09074c3 100644
--- a/test/testlinks_env.sh.in
+++ b/test/testlinks_env.sh.in
@@ -34,8 +34,8 @@ echo "$ENVCMD $RUNSERIAL $TEST_BIN"
$ENVCMD $RUNSERIAL $TEST_BIN
exitcode=$?
if [ $exitcode -eq 0 ]; then
- echo "Test for HDF5_EXT_PREFIX PASSED"
- else
+ echo "Test for HDF5_EXT_PREFIX PASSED"
+else
nerrors="`expr $nerrors + 1`"
echo "***Error encountered for HDF5_EXT_PREFIX test***"
fi
diff --git a/test/testmeta.c b/test/testmeta.c
index 370547b..c59c6cb 100644
--- a/test/testmeta.c
+++ b/test/testmeta.c
@@ -83,7 +83,7 @@ main(void)
for (i = 0; i < NEXTARRAYS; i++) {
/* Create dataset */
- sprintf(name, "/ExtArray%06d", i);
+ HDsprintf(name, "/ExtArray%06d", i);
dataset_id =
H5Dcreate2(file_id, name, H5T_NATIVE_FLOAT, dataspace_id, H5P_DEFAULT, prop_id, H5P_DEFAULT);
@@ -103,7 +103,7 @@ main(void)
/* Removed print statement as it would lock system resources on Windows */
/*
* HDprintf("\rWriting Object #%d of %d", j+1, NDATAOBJECTS);
- * fflush(stdout);
+ * HDfflush(stdout);
*/
floatval = (float)j;
diff --git a/test/testvds_env.sh.in b/test/testvds_env.sh.in
index 7ba0e42..39f13a5 100644
--- a/test/testvds_env.sh.in
+++ b/test/testvds_env.sh.in
@@ -35,8 +35,8 @@ UNENVCMD="unset HDF5_VDS_PREFIX" # Unset the environment variable
$ENVCMD $RUNSERIAL $TEST_BIN
exitcode=$?
if [ $exitcode -eq 0 ]; then
- echo "Test prefix for HDF5_VDS_PREFIX PASSED"
- else
+ echo "Test prefix for HDF5_VDS_PREFIX PASSED"
+else
nerrors="`expr $nerrors + 1`"
echo "***Error encountered for HDF5_VDS_PREFIX test***"
fi
diff --git a/test/testvfdswmr.sh.in b/test/testvfdswmr.sh.in
index 4885d94..819d51a 100644
--- a/test/testvfdswmr.sh.in
+++ b/test/testvfdswmr.sh.in
@@ -83,8 +83,14 @@ MESSAGE_TIMEOUT=300 # Message timeout length in secs
###############################################################################
## For attrdset test: definitions for fifo files to coordinate test runs
###############################################################################
-FIFO_WRITER_TO_READER=fifo_attrdset_writer_to_reader
-FIFO_READER_TO_WRITER=fifo_attrdset_reader_to_writer
+ATTRDSET_FIFO_WRITER_TO_READER=fifo_attrdset_writer_to_reader
+ATTRDSET_FIFO_READER_TO_WRITER=fifo_attrdset_reader_to_writer
+
+###############################################################################
+## For dsetops test: definitions for fifo files to coordinate test runs
+###############################################################################
+DSETOPS_FIFO_WRITER_TO_READER=fifo_dsetops_writer_to_reader
+DSETOPS_FIFO_READER_TO_WRITER=fifo_dsetops_reader_to_writer
###############################################################################
## short hands and function definitions
@@ -157,7 +163,7 @@ if [ $rc -ne 0 ] ; then
exit 0
fi
-all_tests="generator expand shrink expand_shrink sparse vlstr_null vlstr_oob zoo groups attrdset"
+all_tests="generator expand shrink expand_shrink sparse vlstr_null vlstr_oob zoo groups attrdset dsetops"
all_tests="${all_tests} groups_attrs os_groups_attrs groups_ops os_groups_ops few_big many_small"
tests=${all_tests}
@@ -203,6 +209,7 @@ mkdir vfd_swmr_test
cd vfd_swmr_test
+
# Loop over index types
for index_type in "-i ea" "-i b2"
do
@@ -633,11 +640,11 @@ for options in "-p -g -a 10 -v -m -d 10 -c 3 -u 5" "-k -a 20 -v -m -d 5"; do
fi
# Clean up any existing fifo files from previous runs
- if [ -e ./$FIFO_WRITER_TO_READER ]; then # If writer fifo file is found
- rm -f ./$FIFO_WRITER_TO_READER
+ if [ -e ./$ATTRDSET_FIFO_WRITER_TO_READER ]; then # If writer fifo file is found
+ rm -f ./$ATTRDSET_FIFO_WRITER_TO_READER
fi
- if [ -e ./$FIFO_READER_TO_WRITER ]; then # If reader fifo file is found
- rm -f ./$FIFO_READER_TO_WRITER
+ if [ -e ./$ATTRDSET_FIFO_READER_TO_WRITER ]; then # If reader fifo file is found
+ rm -f ./$ATTRDSET_FIFO_READER_TO_WRITER
fi
echo launch vfd_swmr_attrdset_writer attrdset, options $options
@@ -673,6 +680,54 @@ for options in "-p -g -a 10 -v -m -d 10 -c 3 -u 5" "-k -a 20 -v -m -d 5"; do
rm -f vfd_swmr_attrdset_reader.*.{out,rc}
done
+# dsetops test
+for options in "-p -e 20 -t" "-g -m 5 -n 2 -s 10 -w 7" "-k -m 10 -n 5 -r 5 -l 10"; do
+ #
+ #
+ if [ ${do_dsetops:-no} = no ]; then
+ continue
+ fi
+ # Clean up any existing fifo files from previous runs
+ if [ -e ./$DSETOPS_FIFO_WRITER_TO_READER ]; then # If writer fifo file is found
+ rm -f ./$DSETOPS_FIFO_WRITER_TO_READER
+ fi
+ if [ -e ./$DSETOPS_FIFO_READER_TO_WRITER ]; then # If reader fifo file is found
+ rm -f ./$DSETOPS_FIFO_READER_TO_WRITER
+ fi
+ #
+ echo launch vfd_swmr_dsetops_writer dsetops, options $options
+ catch_out_err_and_rc vfd_swmr_dsetops_writer \
+ ../vfd_swmr_dsetops_writer $options &
+ pid_writer=$!
+
+ catch_out_err_and_rc vfd_swmr_dsetops_reader \
+ ../vfd_swmr_dsetops_reader $options &
+ pid_reader=$!
+
+ # Wait for the reader to finish before signaling the
+ # writer to quit: the writer holds the file open so that the
+ # reader will find the shadow file when it opens
+ # the .h5 file.
+ wait $pid_reader
+ wait $pid_writer
+
+ # Collect exit code of the reader
+ if [ $(cat vfd_swmr_dsetops_reader.rc) -ne 0 ]; then
+ echo reader had error
+ nerrors=$((nerrors + 1))
+ fi
+
+ # Collect exit code of the writer
+ if [ $(cat vfd_swmr_dsetops_writer.rc) -ne 0 ]; then
+ echo writer had error
+ nerrors=$((nerrors + 1))
+ fi
+
+ # Clean up output files
+ rm -f vfd_swmr_dsetops_writer.{out,rc}
+ rm -f vfd_swmr_dsetops_reader.*.{out,rc}
+done
+
#
# Make sure that we can create GROUP_n groups (20, 40, or 400 depending on the HDF5TestExpress level)
# while a reader waits for each to appear.
diff --git a/test/tfile.c b/test/tfile.c
index e22e730..19263e8 100644
--- a/test/tfile.c
+++ b/test/tfile.c
@@ -1923,10 +1923,6 @@ test_file_delete(hid_t fapl_id)
/* HDF5 FILE */
/*************/
- /* This is just a placeholder until the native VOL connector supports
- * H5Fdelete().
- */
-
/* Get fapl-dependent filename */
h5_fixname(FILE_DELETE, fapl_id, filename, sizeof(filename));
@@ -1942,19 +1938,20 @@ test_file_delete(hid_t fapl_id)
is_hdf5 = H5Fis_accessible(filename, fapl_id);
VERIFY(is_hdf5, TRUE, "H5Fis_accessible");
- /* Attempt to delete the file - should fail */
+ /* Delete the file */
+ ret = H5Fdelete(filename, fapl_id);
+ VERIFY(ret, SUCCEED, "H5Fdelete");
+
+ /* Verify that the file is NO LONGER an HDF5 file */
+ /* This should fail since there is no file */
H5E_BEGIN_TRY
{
- ret = H5Fdelete(filename, fapl_id);
+ is_hdf5 = H5Fis_accessible(filename, fapl_id);
}
H5E_END_TRY;
- VERIFY(ret, FAIL, "H5Fdelete");
-
- /* Verify that the file still exists */
- is_hdf5 = H5Fis_accessible(filename, fapl_id);
- VERIFY(is_hdf5, TRUE, "H5Fis_accessible");
+ VERIFY(is_hdf5, FAIL, "H5Fis_accessible");
- /* Actually delete the test file */
+ /* Just in case deletion fails - silent on errors */
h5_delete_test_file(FILE_DELETE, fapl_id);
/*****************/
diff --git a/test/tid.c b/test/tid.c
index 0c7c4ab..fc8c4a6 100644
--- a/test/tid.c
+++ b/test/tid.c
@@ -569,197 +569,301 @@ out:
/* There was a rare bug where, if an id free callback being called by
* H5I_clear_type() removed another id in that type, a segfault could occur.
* This test tests for that error (and freeing ids "out of order" within
- * H5Iclear_type() in general). */
+ * H5Iclear_type() in general).
+ *
+ * NB: RCT = "remove clear type"
+ */
+
/* Macro definitions */
-#define TEST_RCT_MAX_NOBJS 25
-#define TEST_RCT_MIN_NOBJS 5
-#define TEST_RCT_NITER 50
+#define RCT_MAX_NOBJS 25 /* Maximum number of objects in the list */
+#define RCT_MIN_NOBJS 5
+#define RCT_NITER 50 /* Number of times we cycle through object creation and deletion */
+
+/* Structure to hold the master list of objects */
+typedef struct rct_obj_list_t {
+
+ /* Pointer to the objects */
+ struct rct_obj_t *objects;
+
+ /* The number of objects in the list */
+ long count;
-/* Structure to hold the list of objects */
-typedef struct {
- struct test_rct_obj_t *list; /* List of objects */
- long nobjs; /* Number of objects in list */
- long nobjs_rem; /* Number of objects in list that have not been freed */
-} test_rct_list_t;
+ /* The number of objects in the list that have not been freed */
+ long remaining;
+} rct_obj_list_t;
/* Structure for an object */
-typedef struct test_rct_obj_t {
- hid_t id; /* ID for this object */
- int nfrees; /* Number of times this object has been freed */
- hbool_t freeing; /* Whether we are currently freeing this object directly (through H5Idec_ref()) */
- test_rct_list_t *obj_list; /* List of all objects */
-} test_rct_obj_t;
-
-/* Free callback */
+typedef struct rct_obj_t {
+ /* The ID for this object */
+ hid_t id;
+
+ /* The number of times this object has been freed */
+ int nfrees;
+
+ /* Whether we are currently freeing this object directly
+ * through H5Idec_ref().
+ */
+ hbool_t freeing;
+
+ /* Pointer to the master list of all objects */
+ rct_obj_list_t *list;
+} rct_obj_t;
+
+/* Free callback passed to H5Iclear_type()
+ *
+ * When invoked on a closing object, frees a random unfreed ID in the
+ * master list of objects.
+ */
static herr_t
-test_rct_free(void *_obj)
+rct_free_cb(void *_obj, void H5_ATTR_UNUSED **_ctx)
{
- test_rct_obj_t *obj = (test_rct_obj_t *)_obj;
- long rem_idx, i;
- herr_t ret; /* return value */
+ rct_obj_t *obj = (rct_obj_t *)_obj;
+ long remove_nth;
+ long i;
+ herr_t ret;
/* Mark this object as freed */
obj->nfrees++;
- obj->obj_list->nobjs_rem--;
-
- /* Check freeing and nobjs_rem */
- if (!obj->freeing && (obj->obj_list->nobjs_rem > 0)) {
- /* Remove a random object from the list */
- rem_idx = HDrandom() % obj->obj_list->nobjs_rem;
-
- /* Scan the list, finding the rem_idx'th object that has not been
- * freed */
- for (i = 0; i < obj->obj_list->nobjs; i++)
- if (obj->obj_list->list[i].nfrees == 0) {
- if (rem_idx == 0)
+
+ /* Decrement the number of objects in the list that have not been freed */
+ obj->list->remaining--;
+
+ /* If this object isn't already being freed by a callback free call and
+ * the master object list still contains objects to free, pick another
+ * object and free it.
+ */
+ if (!obj->freeing && (obj->list->remaining > 0)) {
+
+ /* Pick a random object from the list. This is done by picking a
+ * random number between 0 and the # of remaining unfreed objects
+ * and then scanning through the list to find that nth unfreed
+ * object.
+ */
+ remove_nth = HDrandom() % obj->list->remaining;
+ for (i = 0; i < obj->list->count; i++)
+ if (obj->list->objects[i].nfrees == 0) {
+ if (remove_nth == 0)
break;
else
- rem_idx--;
- } /* end if */
- if (i == obj->obj_list->nobjs) {
+ remove_nth--;
+ }
+
+ /* Badness if we scanned through the list and didn't manage to
+ * select one to delete (the list stats were probably updated
+ * incorrectly).
+ */
+ if (i == obj->list->count) {
ERROR("invalid obj_list");
- goto out;
- } /* end if */
- else {
- /* Remove the object. Mark as "freeing" so its own callback does
- * not free another object. */
- obj->obj_list->list[i].freeing = TRUE;
- ret = H5Idec_ref(obj->obj_list->list[i].id);
- CHECK(ret, FAIL, "H5Idec_ref");
- if (ret == FAIL)
- goto out;
- obj->obj_list->list[i].freeing = FALSE;
- } /* end else */
- } /* end if */
-
- /* Verify nobjs_rem is non-negative */
- if (obj->obj_list->nobjs_rem < 0) {
- ERROR("invalid nobjs_rem");
- goto out;
- } /* end if */
+ goto error;
+ }
+
+ /* Mark the object we're about to free so its own callback does
+ * not free another object. We don't want to recursively free the
+ * entire list when we free the first ID.
+ */
+ obj->list->objects[i].freeing = TRUE;
+
+ /* Decrement the reference count on the object */
+ ret = H5Idec_ref(obj->list->objects[i].id);
+ CHECK(ret, FAIL, "H5Idec_ref");
+ if (ret == FAIL)
+ goto error;
+
+ /* Unset the "freeing" flag */
+ obj->list->objects[i].freeing = FALSE;
+ }
+
+ /* Verify the number of objects remaining in the master list is non-negative */
+ if (obj->list->remaining < 0) {
+ ERROR("invalid number of objects remaining");
+ goto error;
+ }
return 0;
-out:
+error:
return -1;
-} /* end test_rct_free() */
+} /* end rct_free_cb() */
/* Test function */
static int
test_remove_clear_type(void)
{
- H5I_type_t obj_type;
- test_rct_list_t obj_list;
- test_rct_obj_t list[TEST_RCT_MAX_NOBJS];
- long i, j;
- long nobjs_found;
- hsize_t nmembers;
- herr_t ret; /* return value */
-
- /* Register type */
- obj_type = H5Iregister_type((size_t)8, 0, test_rct_free);
+ H5I_type_t obj_type;
+ rct_obj_list_t obj_list;
+ rct_obj_t * objects = NULL; /* Convenience pointer to objects stored in master list */
+ size_t list_size;
+ long i, j;
+ herr_t ret; /* return value */
+
+ /* Register a user-defined type with our custom ID-deleting callback */
+ obj_type = H5Iregister_type((size_t)8, 0, rct_free_cb);
CHECK(obj_type, H5I_BADID, "H5Iregister_type");
if (obj_type == H5I_BADID)
- goto out;
+ goto error;
+
+ /* Create an array to hold the objects in the master list */
+ list_size = RCT_MAX_NOBJS * sizeof(rct_obj_t);
+ obj_list.objects = HDmalloc(list_size);
+ CHECK_PTR(obj_list.objects, "HDcalloc");
+ if (NULL == obj_list.objects)
+ goto error;
+
+ /* Set a convenience pointer to the object array */
+ objects = obj_list.objects;
+
+ for (i = 0; i < RCT_NITER; i++) {
+
+ /* The number of members in the type, according to the HDF5 library */
+ hsize_t nmembers = 1234567; /* (init to fake number) */
+
+ /* The number of objects found while scanning through the object list */
+ int found;
+
+ /*********************
+ * Build object list *
+ *********************/
+
+ HDmemset(obj_list.objects, 0, list_size);
- /* Init obj_list.list */
- obj_list.list = list;
-
- for (i = 0; i < TEST_RCT_NITER; i++) {
- /* Build object list */
- obj_list.nobjs = obj_list.nobjs_rem =
- TEST_RCT_MIN_NOBJS + (HDrandom() % (long)(TEST_RCT_MAX_NOBJS - TEST_RCT_MIN_NOBJS + 1));
- for (j = 0; j < obj_list.nobjs; j++) {
- list[j].nfrees = 0;
- list[j].freeing = FALSE;
- list[j].obj_list = &obj_list;
- list[j].id = H5Iregister(obj_type, &list[j]);
- CHECK(list[j].id, FAIL, "H5Iregister");
- if (list[j].id == FAIL)
- goto out;
+ /* The number of objects used is a random number between the min and max */
+ obj_list.count = obj_list.remaining =
+ RCT_MIN_NOBJS + (HDrandom() % (long)(RCT_MAX_NOBJS - RCT_MIN_NOBJS + 1));
+
+ /* Create the actual objects */
+ for (j = 0; j < obj_list.count; j++) {
+
+ /* Object setup */
+ objects[j].nfrees = 0;
+ objects[j].freeing = FALSE;
+ objects[j].list = &obj_list;
+
+ /* Register an ID for it */
+ objects[j].id = H5Iregister(obj_type, &objects[j]);
+ CHECK(objects[j].id, FAIL, "H5Iregister");
+ if (objects[j].id == FAIL)
+ goto error;
+
+ /* Bump the reference count by 1 (to 2) 50% of the time */
if (HDrandom() % 2) {
- ret = H5Iinc_ref(list[j].id);
+ ret = H5Iinc_ref(objects[j].id);
CHECK(ret, FAIL, "H5Iinc_ref");
if (ret == FAIL)
- goto out;
- } /* end if */
- } /* end for */
+ goto error;
+ }
+ }
- /* Clear the type */
+ /******************************************
+ * Clear the type with force set to FALSE *
+ ******************************************/
+
+ /* Clear the type. Since force is FALSE, only
+ * IDs with a reference count of 1 will be cleared.
+ */
ret = H5Iclear_type(obj_type, FALSE);
CHECK(ret, FAIL, "H5Iclear_type");
if (ret == FAIL)
- goto out;
-
- /* Verify list */
- nobjs_found = 0;
- for (j = 0; j < obj_list.nobjs; j++) {
- if (list[j].nfrees == 0)
- nobjs_found++;
+ goto error;
+
+ /* Verify that the object struct fields are sane and count the
+ * number of unfreed objects
+ */
+ found = 0;
+ for (j = 0; j < obj_list.count; j++) {
+
+ if (objects[j].nfrees == 0) {
+ /* Count unfreed objects */
+ found++;
+ }
else {
- VERIFY(list[j].nfrees, (long)1, "list[j].nfrees");
- if (list[j].nfrees != (long)1)
- goto out;
- } /* end else */
- VERIFY(list[j].freeing, FALSE, "list[j].freeing");
- if (list[j].freeing != FALSE)
- goto out;
- } /* end for */
-
- /* Verify number of objects */
- VERIFY(obj_list.nobjs_rem, nobjs_found, "obj_list.nobjs_rem");
- if (obj_list.nobjs_rem != nobjs_found)
- goto out;
+ /* Every freed object should have been freed exactly once */
+ VERIFY(objects[j].nfrees, 1, "object freed more than once");
+ if (objects[j].nfrees != 1)
+ goto error;
+ }
+
+ /* No object should still be marked as "freeing" */
+ VERIFY(objects[j].freeing, FALSE, "object marked as freeing");
+ if (objects[j].freeing != FALSE)
+ goto error;
+ }
+
+ /* Verify the number of unfreed objects we found during our scan
+ * matches the number stored in the list
+ */
+ VERIFY(obj_list.remaining, found, "incorrect number of objects remaining");
+ if (obj_list.remaining != found)
+ goto error;
+
+ /* Make sure the HDF5 library confirms our count */
ret = H5Inmembers(obj_type, &nmembers);
CHECK(ret, FAIL, "H5Inmembers");
if (ret == FAIL)
- goto out;
- VERIFY(nmembers, (size_t)nobjs_found, "H5Inmembers");
- if (nmembers != (size_t)nobjs_found)
- goto out;
+ goto error;
+ VERIFY(nmembers, found, "The number of members remaining in the type did not match our count");
+ if (nmembers != (hsize_t)found)
+ goto error;
- /* Clear the type with force set to TRUE */
+ /*****************************************
+ * Clear the type with force set to TRUE *
+ *****************************************/
+
+ /* Clear the type. Since force is TRUE, all IDs will be cleared. */
ret = H5Iclear_type(obj_type, TRUE);
CHECK(ret, FAIL, "H5Iclear_type");
if (ret == FAIL)
- goto out;
+ goto error;
- /* Verify list */
- for (j = 0; j < obj_list.nobjs; j++) {
- VERIFY(list[j].nfrees, (long)1, "list[j].nfrees");
- if (list[j].nfrees != (long)1)
- goto out;
- VERIFY(list[j].freeing, FALSE, "list[j].freeing");
- if (list[j].freeing != FALSE)
- goto out;
- } /* end for */
-
- /* Verify number of objects is 0 */
- VERIFY(obj_list.nobjs_rem, (long)0, "obj_list.nobjs_rem");
- if (obj_list.nobjs_rem != (long)0)
- goto out;
+ /* Verify that the object struct fields are sane */
+ for (j = 0; j < obj_list.count; j++) {
+
+ /* Every object should have been freed exactly once */
+ VERIFY(objects[j].nfrees, 1, "object freed more than once");
+ if (objects[j].nfrees != 1)
+ goto error;
+
+ /* No object should still be marked as "freeing" */
+ VERIFY(objects[j].freeing, FALSE, "object marked as freeing");
+ if (objects[j].freeing != FALSE)
+ goto error;
+ }
+
+ /* Verify the number of objects is 0 */
+ VERIFY(obj_list.remaining, 0, "objects remaining was not zero");
+ if (obj_list.remaining != 0)
+ goto error;
+
+ /* Make sure the HDF5 library confirms zero members in the type */
ret = H5Inmembers(obj_type, &nmembers);
CHECK(ret, FAIL, "H5Inmembers");
if (ret == FAIL)
- goto out;
- VERIFY(nmembers, (size_t)0, "H5Inmembers");
- if (nmembers != (size_t)0)
- goto out;
- } /* end for */
+ goto error;
+ VERIFY(nmembers, 0, "The number of members remaining in the type was not zero");
+ if (nmembers != 0)
+ goto error;
+ }
- /* Destroy type */
+ /* Destroy the type */
ret = H5Idestroy_type(obj_type);
CHECK(ret, FAIL, "H5Idestroy_type");
if (ret == FAIL)
- goto out;
+ goto error;
+
+ /* Free the object array */
+ HDfree(obj_list.objects);
return 0;
-out:
- /* Cleanup. For simplicity, just destroy the types and ignore errors. */
+error:
+ /* Cleanup. For simplicity, just destroy the types and ignore errors. */
H5E_BEGIN_TRY
- H5Idestroy_type(obj_type);
+ {
+ H5Idestroy_type(obj_type);
+ }
H5E_END_TRY
+
+ HDfree(obj_list.objects);
+
return -1;
} /* end test_remove_clear_type() */
diff --git a/test/tselect.c b/test/tselect.c
index 73cc771..1bfb663 100644
--- a/test/tselect.c
+++ b/test/tselect.c
@@ -1533,7 +1533,7 @@ test_select_hyper_contig(hid_t dset_type, hid_t xfer_plist)
CHECK(ret, FAIL, "H5Dread");
/* Compare data read with data written out */
- if (HDmemcmp(rbuf, wbuf, sizeof(uint16_t) * 30 * 12))
+ if (HDmemcmp(rbuf, wbuf, sizeof(uint16_t) * 30 * 12) != 0)
TestErrPrintf("hyperslab values don't match! Line=%d\n", __LINE__);
/* Close memory dataspace */
@@ -1676,7 +1676,7 @@ test_select_hyper_contig2(hid_t dset_type, hid_t xfer_plist)
CHECK(ret, FAIL, "H5Dread");
/* Compare data read with data written out */
- if (HDmemcmp(rbuf, wbuf, sizeof(uint16_t) * 2 * SPACE8_DIM3 * SPACE8_DIM2 * SPACE8_DIM1))
+ if (HDmemcmp(rbuf, wbuf, sizeof(uint16_t) * 2 * SPACE8_DIM3 * SPACE8_DIM2 * SPACE8_DIM1) != 0)
TestErrPrintf("Error: hyperslab values don't match!\n");
/* Close memory dataspace */
@@ -2579,7 +2579,7 @@ test_select_hyper_contig_dr(hid_t dset_type, hid_t xfer_plist)
static void
test_select_hyper_checker_board_dr__select_checker_board(hid_t tgt_n_cube_sid, unsigned tgt_n_cube_rank,
unsigned edge_size, unsigned checker_edge_size,
- unsigned sel_rank, hsize_t sel_start[])
+ unsigned sel_rank, const hsize_t sel_start[])
{
hbool_t first_selection = TRUE;
unsigned n_cube_offset;
@@ -3783,7 +3783,7 @@ test_select_hyper_copy(void)
CHECK(ret, FAIL, "H5Dread");
/* Compare data read with data written out */
- if (HDmemcmp(rbuf, rbuf2, sizeof(uint16_t) * SPACE3_DIM1 * SPACE3_DIM2))
+ if (HDmemcmp(rbuf, rbuf2, sizeof(uint16_t) * SPACE3_DIM1 * SPACE3_DIM2) != 0)
TestErrPrintf("hyperslab values don't match! Line=%d\n", __LINE__);
/* Close memory dataspace */
@@ -3996,7 +3996,7 @@ test_select_point_copy(void)
CHECK(ret, FAIL, "H5Dread");
/* Compare data read with data written out */
- if (HDmemcmp(rbuf, rbuf2, sizeof(uint16_t) * SPACE3_DIM1 * SPACE3_DIM2))
+ if (HDmemcmp(rbuf, rbuf2, sizeof(uint16_t) * SPACE3_DIM1 * SPACE3_DIM2) != 0)
TestErrPrintf("point values don't match!\n");
/* Close memory dataspace */
@@ -5257,7 +5257,7 @@ test_select_hyper_union_stagger(void)
CHECK(error, FAIL, "H5Fclose");
/* Initialize intput buffer */
- memset(data_out, 0, 7 * 7 * sizeof(int));
+ HDmemset(data_out, 0, 7 * 7 * sizeof(int));
/* Open file */
file_id = H5Fopen(FILENAME, H5F_ACC_RDONLY, H5P_DEFAULT);
@@ -5381,9 +5381,9 @@ test_select_hyper_union_3d(void)
/* Allocate write & read buffers */
wbuf = (uint8_t *)HDmalloc(sizeof(uint8_t) * SPACE4_DIM1 * SPACE4_DIM2 * SPACE4_DIM3);
- CHECK(wbuf, NULL, "HDmalloc");
+ CHECK_PTR(wbuf, "HDmalloc");
rbuf = (uint8_t *)HDcalloc(sizeof(uint8_t), SPACE3_DIM1 * SPACE3_DIM2);
- CHECK(rbuf, NULL, "HDcalloc");
+ CHECK_PTR(rbuf, "HDcalloc");
/* Initialize write buffer */
for (i = 0, tbuf = wbuf; i < SPACE4_DIM1; i++)
@@ -5555,7 +5555,7 @@ test_select_hyper_valid_combination(void)
/* Output message about test being performed */
MESSAGE(6, ("Testing Selection Combination Validity\n"));
- assert(SPACE9_DIM2 >= POINT1_NPOINTS);
+ HDassert(SPACE9_DIM2 >= POINT1_NPOINTS);
/* Create dataspace for single point selection */
single_pt_sid = H5Screate_simple(SPACE9_RANK, dims2D, NULL);
@@ -8401,7 +8401,7 @@ test_shape_same(void)
/* Output message about test being performed */
MESSAGE(6, ("Testing Same Shape Comparisons\n"));
- assert(SPACE9_DIM2 >= POINT1_NPOINTS);
+ HDassert(SPACE9_DIM2 >= POINT1_NPOINTS);
/* Create dataspace for "all" selection */
all_sid = H5Screate_simple(SPACE9_RANK, dims, NULL);
@@ -14277,18 +14277,18 @@ test_hyper_unlim_check(hid_t sid, hsize_t *dims, hssize_t enpoints, hssize_t enb
/* Verify blocklist */
if (nblocks == (hssize_t)1) {
- if (HDmemcmp(blocklist, eblock1, 6 * sizeof(eblock1[0])))
+ if (HDmemcmp(blocklist, eblock1, 6 * sizeof(eblock1[0])) != 0)
ERROR("H5Sget_select_hyper_blocklist");
} /* end if */
else {
HDassert(nblocks == (hssize_t)2);
- if (HDmemcmp(blocklist, eblock1, 6 * sizeof(eblock1[0]))) {
- if (HDmemcmp(blocklist, eblock2, 6 * sizeof(eblock2[0])))
+ if (HDmemcmp(blocklist, eblock1, 6 * sizeof(eblock1[0])) != 0) {
+ if (HDmemcmp(blocklist, eblock2, 6 * sizeof(eblock2[0])) != 0)
ERROR("H5Sget_select_hyper_blocklist");
- if (HDmemcmp(&blocklist[6], eblock1, 6 * sizeof(eblock1[0])))
+ if (HDmemcmp(&blocklist[6], eblock1, 6 * sizeof(eblock1[0])) != 0)
ERROR("H5Sget_select_hyper_blocklist");
} /* end if */
- else if (HDmemcmp(&blocklist[6], eblock2, 6 * sizeof(eblock2[0])))
+ else if (HDmemcmp(&blocklist[6], eblock2, 6 * sizeof(eblock2[0])) != 0)
ERROR("H5Sget_select_hyper_blocklist");
} /* end else */
} /* end if */
@@ -14705,7 +14705,7 @@ test_internal_consistency(void)
/* Output message about test being performed */
MESSAGE(6, ("Testing Consistency of Internal States\n"));
- assert(SPACE9_DIM2 >= POINT1_NPOINTS);
+ HDassert(SPACE9_DIM2 >= POINT1_NPOINTS);
/* Create dataspace for "all" selection */
all_sid = H5Screate_simple(SPACE9_RANK, dims, NULL);
@@ -15164,6 +15164,20 @@ test_sel_iter(void)
iter_id = H5Ssel_iter_create(sid, (size_t)1, (unsigned)sel_iter_flags);
CHECK(iter_id, FAIL, "H5Ssel_iter_create");
+ /* Try resetting selection iterator with bad parameters */
+ H5E_BEGIN_TRY
+ {
+ ret = H5Ssel_iter_reset(H5I_INVALID_HID, sid);
+ }
+ H5E_END_TRY;
+ VERIFY(ret, FAIL, "H5Ssel_iter_reset");
+ H5E_BEGIN_TRY
+ {
+ ret = H5Ssel_iter_reset(iter_id, H5I_INVALID_HID);
+ }
+ H5E_END_TRY;
+ VERIFY(ret, FAIL, "H5Ssel_iter_reset");
+
/* Try retrieving sequences, with bad parameters */
H5E_BEGIN_TRY
{ /* Invalid ID */
@@ -15314,6 +15328,167 @@ test_sel_iter(void)
CHECK(ret, FAIL, "H5Ssel_iter_close");
} /* end for */
+ /* Create selection iterator object */
+ iter_id = H5Ssel_iter_create(sid, (size_t)1, (unsigned)sel_iter_flags);
+ CHECK(iter_id, FAIL, "H5Ssel_iter_create");
+
+ /* Test iterators on various basic selection types using
+ * H5Ssel_iter_reset instead of creating multiple iterators */
+ for (sel_type = H5S_SEL_NONE; sel_type <= H5S_SEL_ALL; sel_type = (H5S_sel_type)(sel_type + 1)) {
+ switch (sel_type) {
+ case H5S_SEL_NONE: /* "None" selection */
+ ret = H5Sselect_none(sid);
+ CHECK(ret, FAIL, "H5Sselect_none");
+ break;
+
+ case H5S_SEL_POINTS: /* Point selection */
+ /* Select sequence of ten points */
+ coord1[0][0] = 0;
+ coord1[0][1] = 9;
+ coord1[1][0] = 1;
+ coord1[1][1] = 2;
+ coord1[2][0] = 2;
+ coord1[2][1] = 4;
+ coord1[3][0] = 0;
+ coord1[3][1] = 6;
+ coord1[4][0] = 1;
+ coord1[4][1] = 8;
+ coord1[5][0] = 2;
+ coord1[5][1] = 10;
+ coord1[6][0] = 0;
+ coord1[6][1] = 11;
+ coord1[7][0] = 1;
+ coord1[7][1] = 4;
+ coord1[8][0] = 2;
+ coord1[8][1] = 1;
+ coord1[9][0] = 0;
+ coord1[9][1] = 3;
+ ret = H5Sselect_elements(sid, H5S_SELECT_SET, (size_t)POINT1_NPOINTS,
+ (const hsize_t *)coord1);
+ CHECK(ret, FAIL, "H5Sselect_elements");
+ break;
+
+ case H5S_SEL_HYPERSLABS: /* Hyperslab selection */
+ /* Select regular hyperslab */
+ start[0] = 3;
+ start[1] = 0;
+ stride[0] = 2;
+ stride[1] = 2;
+ count[0] = 2;
+ count[1] = 5;
+ block[0] = 1;
+ block[1] = 1;
+ ret = H5Sselect_hyperslab(sid, H5S_SELECT_SET, start, stride, count, block);
+ CHECK(ret, FAIL, "H5Sselect_hyperslab");
+ break;
+
+ case H5S_SEL_ALL: /* "All" selection */
+ ret = H5Sselect_all(sid);
+ CHECK(ret, FAIL, "H5Sselect_all");
+ break;
+
+ case H5S_SEL_ERROR:
+ case H5S_SEL_N:
+ default:
+ HDassert(0 && "Can't occur");
+ break;
+ } /* end switch */
+
+ /* Try retrieving no sequences, with 0 for maxseq & maxbytes */
+ ret = H5Ssel_iter_get_seq_list(iter_id, (size_t)0, (size_t)1, &nseq, &nbytes, off, len);
+ CHECK(ret, FAIL, "H5Ssel_iter_get_seq_list");
+ VERIFY(nseq, 0, "H5Ssel_iter_get_seq_list");
+ VERIFY(nbytes, 0, "H5Ssel_iter_get_seq_list");
+ ret = H5Ssel_iter_get_seq_list(iter_id, (size_t)1, (size_t)0, &nseq, &nbytes, off, len);
+ CHECK(ret, FAIL, "H5Ssel_iter_get_seq_list");
+ VERIFY(nseq, 0, "H5Ssel_iter_get_seq_list");
+ VERIFY(nbytes, 0, "H5Ssel_iter_get_seq_list");
+
+ /* Reset iterator */
+ ret = H5Ssel_iter_reset(iter_id, sid);
+ CHECK(ret, FAIL, "H5Ssel_iter_reset");
+
+ /* Try retrieving all sequences */
+ ret = H5Ssel_iter_get_seq_list(iter_id, (size_t)SEL_ITER_MAX_SEQ, (size_t)(1024 * 1024), &nseq,
+ &nbytes, off, len);
+ CHECK(ret, FAIL, "H5Ssel_iter_get_seq_list");
+
+ /* Check results from retrieving sequence list */
+ switch (sel_type) {
+ case H5S_SEL_NONE: /* "None" selection */
+ VERIFY(nseq, 0, "H5Ssel_iter_get_seq_list");
+ VERIFY(nbytes, 0, "H5Ssel_iter_get_seq_list");
+ break;
+
+ case H5S_SEL_POINTS: /* Point selection */
+ VERIFY(nseq, 10, "H5Ssel_iter_get_seq_list");
+ VERIFY(nbytes, 10, "H5Ssel_iter_get_seq_list");
+ break;
+
+ case H5S_SEL_HYPERSLABS: /* Hyperslab selection */
+ VERIFY(nseq, 10, "H5Ssel_iter_get_seq_list");
+ VERIFY(nbytes, 10, "H5Ssel_iter_get_seq_list");
+ break;
+
+ case H5S_SEL_ALL: /* "All" selection */
+ VERIFY(nseq, 1, "H5Ssel_iter_get_seq_list");
+ VERIFY(nbytes, 72, "H5Ssel_iter_get_seq_list");
+ break;
+
+ case H5S_SEL_ERROR:
+ case H5S_SEL_N:
+ default:
+ HDassert(0 && "Can't occur");
+ break;
+ } /* end switch */
+
+ /* Reset iterator */
+ ret = H5Ssel_iter_reset(iter_id, sid);
+ CHECK(ret, FAIL, "H5Ssel_iter_reset");
+
+ /* Try retrieving all sequences again */
+ ret = H5Ssel_iter_get_seq_list(iter_id, (size_t)SEL_ITER_MAX_SEQ, (size_t)(1024 * 1024), &nseq,
+ &nbytes, off, len);
+ CHECK(ret, FAIL, "H5Ssel_iter_get_seq_list");
+
+ /* Check results from retrieving sequence list */
+ switch (sel_type) {
+ case H5S_SEL_NONE: /* "None" selection */
+ VERIFY(nseq, 0, "H5Ssel_iter_get_seq_list");
+ VERIFY(nbytes, 0, "H5Ssel_iter_get_seq_list");
+ break;
+
+ case H5S_SEL_POINTS: /* Point selection */
+ VERIFY(nseq, 10, "H5Ssel_iter_get_seq_list");
+ VERIFY(nbytes, 10, "H5Ssel_iter_get_seq_list");
+ break;
+
+ case H5S_SEL_HYPERSLABS: /* Hyperslab selection */
+ VERIFY(nseq, 10, "H5Ssel_iter_get_seq_list");
+ VERIFY(nbytes, 10, "H5Ssel_iter_get_seq_list");
+ break;
+
+ case H5S_SEL_ALL: /* "All" selection */
+ VERIFY(nseq, 1, "H5Ssel_iter_get_seq_list");
+ VERIFY(nbytes, 72, "H5Ssel_iter_get_seq_list");
+ break;
+
+ case H5S_SEL_ERROR:
+ case H5S_SEL_N:
+ default:
+ HDassert(0 && "Can't occur");
+ break;
+ } /* end switch */
+
+ /* Reset iterator */
+ ret = H5Ssel_iter_reset(iter_id, sid);
+ CHECK(ret, FAIL, "H5Ssel_iter_reset");
+ } /* end for */
+
+ /* Close selection iterator */
+ ret = H5Ssel_iter_close(iter_id);
+ CHECK(ret, FAIL, "H5Ssel_iter_close");
+
/* Point selection which will merge into smaller # of sequences */
coord1[0][0] = 0;
coord1[0][1] = 9;
@@ -15349,6 +15524,17 @@ test_sel_iter(void)
VERIFY(nseq, 6, "H5Ssel_iter_get_seq_list");
VERIFY(nbytes, 10, "H5Ssel_iter_get_seq_list");
+ /* Reset iterator */
+ ret = H5Ssel_iter_reset(iter_id, sid);
+ CHECK(ret, FAIL, "H5Ssel_iter_reset");
+
+ /* Try retrieving all sequences again */
+ ret = H5Ssel_iter_get_seq_list(iter_id, (size_t)SEL_ITER_MAX_SEQ, (size_t)(1024 * 1024), &nseq,
+ &nbytes, off, len);
+ CHECK(ret, FAIL, "H5Ssel_iter_get_seq_list");
+ VERIFY(nseq, 6, "H5Ssel_iter_get_seq_list");
+ VERIFY(nbytes, 10, "H5Ssel_iter_get_seq_list");
+
/* Close selection iterator */
ret = H5Ssel_iter_close(iter_id);
CHECK(ret, FAIL, "H5Ssel_iter_close");
@@ -15387,6 +15573,17 @@ test_sel_iter(void)
VERIFY(nseq, 6, "H5Ssel_iter_get_seq_list");
VERIFY(nbytes, 20, "H5Ssel_iter_get_seq_list");
+ /* Reset iterator */
+ ret = H5Ssel_iter_reset(iter_id, sid);
+ CHECK(ret, FAIL, "H5Ssel_iter_reset");
+
+ /* Try retrieving all sequences again */
+ ret = H5Ssel_iter_get_seq_list(iter_id, (size_t)SEL_ITER_MAX_SEQ, (size_t)(1024 * 1024), &nseq,
+ &nbytes, off, len);
+ CHECK(ret, FAIL, "H5Ssel_iter_get_seq_list");
+ VERIFY(nseq, 6, "H5Ssel_iter_get_seq_list");
+ VERIFY(nbytes, 20, "H5Ssel_iter_get_seq_list");
+
/* Close selection iterator */
ret = H5Ssel_iter_close(iter_id);
CHECK(ret, FAIL, "H5Ssel_iter_close");
diff --git a/test/ttst.c b/test/ttst.c
deleted file mode 100644
index 53aab5e..0000000
--- a/test/ttst.c
+++ /dev/null
@@ -1,391 +0,0 @@
-/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
- * Copyright by The HDF Group. *
- * Copyright by the Board of Trustees of the University of Illinois. *
- * All rights reserved. *
- * *
- * This file is part of HDF5. The full HDF5 copyright notice, including *
- * terms governing use, modification, and redistribution, is contained in *
- * the COPYING file, which can be found at the root of the source code *
- * distribution tree, or in https://www.hdfgroup.org/licenses. *
- * If you do not have access to either file, you may request a copy from *
- * help@hdfgroup.org. *
- * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
-
-/*
- FILE
- tst.c
- Test HDF Ternary Search Tree (tst) routines.
-
- REMARKS
-
- DESIGN
-
- BUGS/LIMITATIONS
-
- EXPORTED ROUTINES
-
- AUTHOR
- Quincey Koziol
-
- MODIFICATION HISTORY
- 12/9/02 - Started coding
- */
-
-#include "testhdf5.h"
-#include "H5STprivate.h"
-
-/* Test words to insert into s TST */
-static const char *words[] = {
- "We", "hold", "these", "truths", "to", "be", "self-evident,",
- "that", "all", "men", "are", "created", "equal,", "that",
- "they", "are", "endowed", "by", "their", "Creator", "with",
- "certain", "unalienable", "Rights,", "that", "among", "these", "are",
- "Life,", "Liberty", "and", "the", "pursuit", "of", "Happiness."};
-/* Number of words in test words set */
-size_t num_words;
-
-/* Number of unique words in test word set */
-size_t num_uniq_words;
-/* Unique words in test word set */
-char **uniq_words;
-/* Randomized order version of words in test word set */
-char **rand_uniq_words;
-/* Sorted order version of words in test word set */
-char **sort_uniq_words;
-
-static int
-tst_strcmp(const void *_s1, const void *_s2)
-{
- return (HDstrcmp(*(const char *const *)_s1, *(const char *const *)_s2));
-}
-
-/****************************************************************
-**
-** test_tst_init(): Test basic H5ST (ternary search tree) selection code.
-** Initialize data for TST testing
-**
-****************************************************************/
-static void
-test_tst_init(void)
-{
- time_t curr_time; /* Current time, for seeding random number generator */
- char * tmp_word; /* Temporary pointer to word in word set */
- size_t u, v, w; /* Local index variables */
-
- /* Compute the number of words in the test set */
- num_words = sizeof(words) / sizeof(words[0]);
-
- /* Determine the number of unique words in test set */
- /* (Not particularly efficient, be careful if many words are added to set) */
- num_uniq_words = 0;
- for (u = 0; u < num_words; u++) {
- /* Assume word is unique */
- num_uniq_words++;
- for (v = 0; v < u; v++)
- /* If word is already found in words looked at, decrement unique count */
- if (!HDstrcmp(words[u], words[v])) {
- num_uniq_words--;
- break;
- } /* end if */
- } /* end for */
-
- /* Allocate space for the array of unique words */
- uniq_words = (char **)HDmalloc(sizeof(char *) * num_uniq_words);
-
- /* Allocate space for the array of randomized order unique words also */
- rand_uniq_words = (char **)HDmalloc(sizeof(char *) * num_uniq_words);
-
- /* Allocate space for the array of sorted order unique words also */
- sort_uniq_words = (char **)HDmalloc(sizeof(char *) * num_uniq_words);
-
- /* Insert unique words from test set into unique word set */
- w = 0;
- for (u = 0; u < num_words; u++) {
- /* Assume word is unique */
- tmp_word = (char *)words[u];
- for (v = 0; v < u; v++)
- /* If word is already found in words looked at, decrement unique count */
- if (!HDstrcmp(words[u], words[v])) {
- tmp_word = NULL;
- break;
- } /* end if */
-
- /* Check if word was actually unique */
- if (tmp_word != NULL)
- uniq_words[w++] = tmp_word;
- } /* end for */
-
- /* Create randomized set of unique words */
- for (u = 0; u < num_uniq_words; u++)
- rand_uniq_words[u] = uniq_words[u];
- curr_time = HDtime(NULL);
- HDsrandom((unsigned)curr_time);
- for (u = 0; u < num_uniq_words; u++) {
- v = u + ((size_t)HDrandom() % (num_uniq_words - u));
- if (u != v) {
- tmp_word = rand_uniq_words[u];
- rand_uniq_words[u] = rand_uniq_words[v];
- rand_uniq_words[v] = tmp_word;
- } /* end if */
- } /* end for */
-
- /* Create sorted set of unique words */
- for (u = 0; u < num_uniq_words; u++)
- sort_uniq_words[u] = uniq_words[u];
- HDqsort(sort_uniq_words, num_uniq_words, sizeof(char *), tst_strcmp);
-} /* end test_tst_init() */
-
-/****************************************************************
-**
-** test_tst_create(): Test basic H5ST (ternary search tree) selection code.
-** Tests creating and closing TSTs.
-**
-****************************************************************/
-static void
-test_tst_create(void)
-{
- H5ST_tree_t *tree; /* TST created */
- herr_t ret; /* Generic return value */
-
- /* Output message about test being performed */
- MESSAGE(5, ("Testing Creating & Closing TSTs\n"));
-
- /* Try closing a NULL tree */
- tree = NULL;
- ret = H5ST_close(tree);
- VERIFY(ret, FAIL, "H5ST_close");
-
- /* Try creating a TST */
- tree = H5ST_create();
- CHECK_PTR(tree, "H5ST_create");
-
- /* Try closing a real tree */
- ret = H5ST_close(tree);
- CHECK(ret, FAIL, "H5ST_close");
-
-} /* end test_tst_create() */
-
-/****************************************************************
-**
-** test_tst_insert(): Test basic H5ST (ternary search tree) selection code.
-** Tests inserting key/value pairs into TST
-**
-****************************************************************/
-static void
-test_tst_insert(void)
-{
- H5ST_tree_t *tree; /* TST created */
- H5ST_ptr_t found; /* Pointer to TST node found */
- void * obj; /* Pointer to object located in TST */
- size_t u; /* Local index counter */
- htri_t check; /* Is string in TST? */
- herr_t ret; /* Generic return value */
-
- /* Output message about test being performed */
- MESSAGE(5, ("Testing Inserting Values into TSTs\n"));
-
- /* Create the TST */
- tree = H5ST_create();
- CHECK_PTR(tree, "H5ST_create");
-
- /* Insert unique words into TST, in random order */
- for (u = 0; u < num_uniq_words; u++) {
- ret = H5ST_insert(tree, rand_uniq_words[u], rand_uniq_words[u]);
- CHECK(ret, FAIL, "H5ST_insert");
- } /* end for */
-
- /* Verify that all words were inserted into TST properly */
- for (u = 0; u < num_uniq_words; u++) {
- /* Check that the word is present */
- check = H5ST_search(tree, uniq_words[u]);
- VERIFY(check, TRUE, "H5ST_search");
-
- /* Check that the value "payloads" are correct */
- found = H5ST_find(tree, uniq_words[u]);
- CHECK_PTR(found, "H5ST_find");
-
- if (HDstrcmp((const char *)found->eqkid, uniq_words[u]))
- TestErrPrintf("%d: TST node values don't match!, found->eqkid=%s, uniq_words[%u]=%s\n", __LINE__,
- (char *)found->eqkid, (unsigned)u, uniq_words[u]);
-
- obj = H5ST_locate(tree, uniq_words[u]);
- CHECK_PTR(obj, "H5ST_locate");
-
- if (HDstrcmp((const char *)obj, uniq_words[u]))
- TestErrPrintf("%d: TST objects don't match!, obj=%s, uniq_words[%u]=%s\n", __LINE__, (char *)obj,
- (unsigned)u, uniq_words[u]);
- } /* end for */
-
- /* Verify that words not in the TST aren't found */
- check = H5ST_search(tree, "foo");
- VERIFY(check, FALSE, "H5ST_search");
- check = H5ST_search(tree, "bar");
- VERIFY(check, FALSE, "H5ST_search");
- check = H5ST_search(tree, "baz");
- VERIFY(check, FALSE, "H5ST_search");
-
- /* Close the TST */
- ret = H5ST_close(tree);
- CHECK(ret, FAIL, "H5ST_close");
-} /* end test_tst_insert() */
-
-/****************************************************************
-**
-** test_tst_iterate(): Test basic H5ST (ternary search tree) code.
-** Tests iterating through key/value pairs in TST
-**
-****************************************************************/
-static void
-test_tst_iterate(void)
-{
- H5ST_tree_t *tree; /* TST created */
- H5ST_ptr_t found; /* Pointer to TST node found */
- size_t u; /* Local index counter */
- herr_t ret; /* Generic return value */
-
- /* Output message about test being performed */
- MESSAGE(5, ("Testing Iterating Over TSTs\n"));
-
- /* Create the TST */
- tree = H5ST_create();
- CHECK_PTR(tree, "H5ST_create");
-
- /* Insert unique words into TST, in random order */
- for (u = 0; u < num_uniq_words; u++) {
- ret = H5ST_insert(tree, rand_uniq_words[u], rand_uniq_words[u]);
- CHECK(ret, FAIL, "H5ST_insert");
- } /* end for */
-
- /* Use findfirst/findnext calls to iterate through TST */
- found = H5ST_findfirst(tree);
- CHECK_PTR(found, "H5ST_findfirst");
- u = 0;
- do {
- /* Check that the strings in the TST are in the correct order */
- if (HDstrcmp((const char *)found->eqkid, sort_uniq_words[u]))
- TestErrPrintf("%d: TST node values don't match!, found->eqkid=%s, sort_uniq_words[%u]=%s\n",
- __LINE__, (char *)found->eqkid, (unsigned)u, sort_uniq_words[u]);
-
- /* Advance to next string in TST */
- found = H5ST_findnext(found);
- u++;
- } while (found != NULL);
-
- /* Close the TST */
- ret = H5ST_close(tree);
- CHECK(ret, FAIL, "H5ST_close");
-} /* end test_tst_iterate() */
-
-/****************************************************************
-**
-** test_tst_remove(): Test basic H5ST (ternary search tree) code.
-** Tests removing key/value pairs by string value in TST
-**
-****************************************************************/
-static void
-test_tst_remove(void)
-{
- H5ST_tree_t *tree; /* TST created */
- H5ST_ptr_t found; /* Pointer to TST node found */
- void * obj; /* Pointer to object removed from TST */
- htri_t check; /* Is string in TST? */
- size_t u; /* Local index counter */
- herr_t ret; /* Generic return value */
-
- /* Output message about test being performed */
- MESSAGE(5, ("Testing Removing String Values from TSTs\n"));
-
- /* Create the TST */
- tree = H5ST_create();
- CHECK_PTR(tree, "H5ST_create");
-
- /* Insert unique words into TST, in random order */
- for (u = 0; u < num_uniq_words; u++) {
- ret = H5ST_insert(tree, rand_uniq_words[u], rand_uniq_words[u]);
- CHECK(ret, FAIL, "H5ST_insert");
- } /* end for */
-
- /* Remove strings from TST in random order */
- for (u = 0; u < num_uniq_words; u++) {
- obj = H5ST_remove(tree, rand_uniq_words[u]);
- CHECK_PTR(obj, "H5ST_remove");
-
- /* Check that the correct string was removed from TST */
- if (HDstrcmp((const char *)obj, rand_uniq_words[u]))
- TestErrPrintf("%d: TST node values don't match!, obj=%s, rand_uniq_words[%u]=%s\n", __LINE__,
- (char *)obj, (unsigned)u, rand_uniq_words[u]);
-
- /* Check that the string can't be found in the TST any longer */
- check = H5ST_search(tree, rand_uniq_words[u]);
- VERIFY(check, FALSE, "H5ST_search");
- } /* end for */
-
- /* Re-insert unique words into TST, in random order */
- for (u = 0; u < num_uniq_words; u++) {
- ret = H5ST_insert(tree, rand_uniq_words[u], rand_uniq_words[u]);
- CHECK(ret, FAIL, "H5ST_insert");
- } /* end for */
-
- /* Remove TST nodes from TST in random order */
- for (u = 0; u < num_uniq_words; u++) {
- /* Get the pointer to the node to delete */
- found = H5ST_find(tree, rand_uniq_words[u]);
- CHECK_PTR(found, "H5ST_find");
-
- /* Check that the correct object will be removed from TST */
- if (HDstrcmp((const char *)found->eqkid, rand_uniq_words[u]))
- TestErrPrintf("%d: TST node values don't match!, found->eqkid=%s, rand_uniq_words[%u]=%s\n",
- __LINE__, (char *)found->eqkid, (unsigned)u, rand_uniq_words[u]);
-
- /* Remove the node */
- ret = H5ST_delete(tree, found);
- CHECK(ret, FAIL, "H5ST_delete");
-
- /* Check that the string can't be found in the TST any longer */
- check = H5ST_search(tree, rand_uniq_words[u]);
- VERIFY(check, FALSE, "H5ST_search");
- } /* end for */
-
- /* Close the TST */
- ret = H5ST_close(tree);
- CHECK(ret, FAIL, "H5ST_close");
-} /* end test_tst_remove() */
-
-/****************************************************************
-**
-** test_tst_finalize(): Test basic H5ST (ternary search tree) selection code.
-** Wrap up data for TST testing
-**
-****************************************************************/
-static void
-test_tst_finalize(void)
-{
- /* Release memory for unordered, randomized and sorted order unique words */
- HDfree(uniq_words);
- HDfree(rand_uniq_words);
- HDfree(sort_uniq_words);
-} /* end test_tst_finalize() */
-
-/****************************************************************
-**
-** test_tst(): Main H5ST selection testing routine.
-**
-****************************************************************/
-void
-test_tst(void)
-{
- /* Output message about test being performed */
- MESSAGE(5, ("Testing Ternary Search Trees\n"));
-
- /* Initialize TST testing data */
- test_tst_init();
-
- /* Actual TST tests */
- test_tst_create(); /* Test TST creation */
- test_tst_insert(); /* Test TST insertion */
- test_tst_iterate(); /* Test TST iteration */
- test_tst_remove(); /* Test TST deletion */
-
- /* Finalize TST testing data */
- test_tst_finalize();
-} /* end test_tst() */
diff --git a/test/tunicode.c b/test/tunicode.c
index 6483e13..52341bb 100644
--- a/test/tunicode.c
+++ b/test/tunicode.c
@@ -532,7 +532,7 @@ test_attrname(hid_t fid, const char *string)
CHECK(attr_id, FAIL, "H5Acreate2");
size = H5Aget_name(attr_id, (size_t)MAX_STRING_LENGTH, read_buf);
CHECK(size, FAIL, "H5Aget_name");
- ret = strcmp(read_buf, string);
+ ret = HDstrcmp(read_buf, string);
VERIFY(ret, 0, "strcmp");
read_buf[0] = '\0';
@@ -541,7 +541,7 @@ test_attrname(hid_t fid, const char *string)
CHECK(ret, FAIL, "H5Awrite");
ret = H5Aread(attr_id, dtype_id, read_buf);
CHECK(ret, FAIL, "H5Aread");
- ret = strcmp(read_buf, string);
+ ret = HDstrcmp(read_buf, string);
VERIFY(ret, 0, "strcmp");
/* Clean up */
@@ -682,7 +682,7 @@ test_enum(hid_t H5_ATTR_UNUSED fid, const char *string)
VERIFY(val, E1_WHITE, "H5Tenum_valueof");
ret = H5Tenum_nameof(type_id, &val, readbuf, (size_t)MAX_STRING_LENGTH);
CHECK(ret, FAIL, "H5Tenum_nameof");
- ret = strcmp(readbuf, string);
+ ret = HDstrcmp(readbuf, string);
VERIFY(ret, 0, "strcmp");
/* Close the datatype */
@@ -709,7 +709,7 @@ test_opaque(hid_t H5_ATTR_UNUSED fid, const char *string)
/* Read the tag back. */
read_buf = H5Tget_tag(type_id);
- ret = strcmp(read_buf, string);
+ ret = HDstrcmp(read_buf, string);
VERIFY(ret, 0, "H5Tget_tag");
H5free_memory(read_buf);
diff --git a/test/tvlstr.c b/test/tvlstr.c
index fb6a876..7e47c7b 100644
--- a/test/tvlstr.c
+++ b/test/tvlstr.c
@@ -110,16 +110,13 @@ test_vlstr_free_custom(void *_mem, void *info)
static void
test_vlstrings_basic(void)
{
+ /* Information to write */
const char *wdata[SPACE1_DIM1] = {
- "Four score and seven years ago our forefathers brought forth on this continent a new "
- "nation,",
+ "Four score and seven years ago our forefathers brought forth on this continent a new nation,",
"conceived in liberty and dedicated to the 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."}; /* Information
- to
- write
- */
+ "testing whether that nation or any nation so conceived and so dedicated can long endure."};
+
char * rdata[SPACE1_DIM1]; /* Information read in */
char * wdata2;
hid_t dataspace, dataset2;
@@ -206,7 +203,7 @@ test_vlstrings_basic(void)
for (i = 0; i < SPACE1_DIM1; i++) {
if (HDstrlen(wdata[i]) != HDstrlen(rdata[i])) {
TestErrPrintf("VL data length don't match!, strlen(wdata[%d])=%d, strlen(rdata[%d])=%d\n", (int)i,
- (int)strlen(wdata[i]), (int)i, (int)HDstrlen(rdata[i]));
+ (int)HDstrlen(wdata[i]), (int)i, (int)HDstrlen(rdata[i]));
continue;
} /* end if */
if (HDstrcmp(wdata[i], rdata[i]) != 0) {
@@ -310,7 +307,7 @@ test_vlstrings_special(void)
for (i = 0; i < SPACE1_DIM1; i++) {
if (HDstrlen(wdata[i]) != HDstrlen(rdata[i])) {
TestErrPrintf("VL data length don't match!, strlen(wdata[%d])=%d, strlen(rdata[%d])=%d\n", (int)i,
- (int)strlen(wdata[i]), (int)i, (int)HDstrlen(rdata[i]));
+ (int)HDstrlen(wdata[i]), (int)i, (int)HDstrlen(rdata[i]));
continue;
} /* end if */
if ((wdata[i] == NULL && rdata[i] != NULL) || (rdata[i] == NULL && wdata[i] != NULL)) {
@@ -539,7 +536,7 @@ test_compact_vlstring(void)
for (i = 0; i < SPACE1_DIM1; i++) {
if (HDstrlen(wdata[i]) != HDstrlen(rdata[i])) {
TestErrPrintf("VL data length don't match!, strlen(wdata[%d])=%d, strlen(rdata[%d])=%d\n", (int)i,
- (int)strlen(wdata[i]), (int)i, (int)HDstrlen(rdata[i]));
+ (int)HDstrlen(wdata[i]), (int)i, (int)HDstrlen(rdata[i]));
continue;
} /* end if */
if (HDstrcmp(wdata[i], rdata[i]) != 0) {
@@ -662,8 +659,6 @@ test_write_vl_string_attribute(void)
ret = H5Fclose(file);
CHECK(ret, FAIL, "H5Fclose");
-
- return;
}
/****************************************************************
@@ -742,8 +737,6 @@ test_read_vl_string_attribute(void)
ret = H5Fclose(file);
CHECK(ret, FAIL, "H5Fclose");
-
- return;
}
/* Helper routine for test_vl_rewrite() */
@@ -780,7 +773,7 @@ read_scalar_dset(hid_t file, hid_t type, hid_t space, char *name, char *data)
ret = H5Dclose(dset);
CHECK(ret, FAIL, "H5Dclose");
- if (HDstrcmp(data, data_read))
+ if (HDstrcmp(data, data_read) != 0)
TestErrPrintf("Expected %s for dataset %s but read %s\n", data, name, data_read);
ret = H5Treclaim(type, space, H5P_DEFAULT, &data_read);
@@ -867,8 +860,6 @@ test_vl_rewrite(void)
ret = H5Fclose(file2);
CHECK(ret, FAIL, "H5Fclose");
-
- return;
} /* end test_vl_rewrite() */
/****************************************************************
diff --git a/test/tvltypes.c b/test/tvltypes.c
index 514da53..50b2d7a 100644
--- a/test/tvltypes.c
+++ b/test/tvltypes.c
@@ -1385,7 +1385,7 @@ test_vltypes_compound_vlstr(void)
for (t1 = (s2 *)(wdata[i].v.p), t2 = (s2 *)(rdata[i].v.p), j = 0; j < rdata[i].v.len;
j++, t1++, t2++) {
- if (HDstrcmp(t1->string, t2->string)) {
+ if (HDstrcmp(t1->string, t2->string) != 0) {
TestErrPrintf("VL data values don't match!, t1->string=%s, t2->string=%s\n", t1->string,
t2->string);
continue;
@@ -1446,7 +1446,7 @@ test_vltypes_compound_vlstr(void)
for (t1 = (s2 *)(wdata2[i].v.p), t2 = (s2 *)(rdata2[i].v.p), j = 0; j < rdata2[i].v.len;
j++, t1++, t2++) {
- if (HDstrcmp(t1->string, t2->string)) {
+ if (HDstrcmp(t1->string, t2->string) != 0) {
TestErrPrintf("VL data values don't match!, t1->string=%s, t2->string=%s\n", t1->string,
t2->string);
continue;
@@ -2508,8 +2508,8 @@ test_vltypes_fill_value(void)
hid_t large_dspace_id; /* Dataspace ID for large datasets */
hid_t small_select_dspace_id; /* Dataspace ID for selection in small datasets */
hid_t large_select_dspace_id; /* Dataspace ID for selection in large datasets */
- hid_t dset_dspace_id; /* Dataspace ID for a particular dataset */
- hid_t dset_select_dspace_id; /* Dataspace ID for selection in a particular dataset */
+ hid_t dset_dspace_id = -1; /* Dataspace ID for a particular dataset */
+ hid_t dset_select_dspace_id = -1; /* Dataspace ID for selection in a particular dataset */
hid_t scalar_dspace_id; /* Dataspace ID for scalar dataspace */
hid_t single_dspace_id; /* Dataspace ID for single element selection */
hsize_t single_offset[] = {2}; /* Offset of single element selection */
@@ -2525,8 +2525,8 @@ test_vltypes_fill_value(void)
hid_t dset_id;
hsize_t small_dims[] = {SPACE4_DIM_SMALL};
hsize_t large_dims[] = {SPACE4_DIM_LARGE};
- size_t dset_elmts; /* Number of elements in a particular dataset */
- const dtype1_struct fill1 = {1, 2, "foobar", "", NULL, "\0", "dead",
+ size_t dset_elmts = 0; /* Number of elements in a particular dataset */
+ const dtype1_struct fill1 = {1, 2, "foobar", "", NULL, "\0", "dead",
3, 4.0F, 100.0F, 1.0F, "liquid", "meter"};
const dtype1_struct wdata = {3, 4, "", NULL, "\0", "foo", "two", 6, 8.0F, 200.0F, 2.0F, "solid", "yard"};
dtype1_struct * rbuf = NULL; /* Buffer for reading data */
@@ -2691,13 +2691,13 @@ test_vltypes_fill_value(void)
} break;
case H5D_VIRTUAL:
- assert(0 && "Invalid layout type!");
+ HDassert(0 && "Invalid layout type!");
break;
case H5D_LAYOUT_ERROR:
case H5D_NLAYOUTS:
default:
- assert(0 && "Unknown layout type!");
+ HDassert(0 && "Unknown layout type!");
break;
} /* end switch */
@@ -2799,13 +2799,13 @@ test_vltypes_fill_value(void)
break;
case H5D_VIRTUAL:
- assert(0 && "Invalid layout type!");
+ HDassert(0 && "Invalid layout type!");
break;
case H5D_LAYOUT_ERROR:
case H5D_NLAYOUTS:
default:
- assert(0 && "Unknown layout type!");
+ HDassert(0 && "Unknown layout type!");
break;
} /* end switch */
@@ -2819,10 +2819,10 @@ test_vltypes_fill_value(void)
/* Compare data read in */
for (i = 0; i < dset_elmts; i++) {
- if (HDstrcmp(rbuf[i].str_id, "foobar") || HDstrcmp(rbuf[i].str_name, "") ||
- rbuf[i].str_desc || HDstrcmp(rbuf[i].str_orig, "\0") ||
- HDstrcmp(rbuf[i].str_stat, "dead") || HDstrcmp(rbuf[i].str_form, "liquid") ||
- HDstrcmp(rbuf[i].str_unit, "meter")) {
+ if (HDstrcmp(rbuf[i].str_id, "foobar") != 0 || HDstrcmp(rbuf[i].str_name, "") != 0 ||
+ rbuf[i].str_desc || HDstrcmp(rbuf[i].str_orig, "\0") != 0 ||
+ HDstrcmp(rbuf[i].str_stat, "dead") != 0 || HDstrcmp(rbuf[i].str_form, "liquid") != 0 ||
+ HDstrcmp(rbuf[i].str_unit, "meter") != 0) {
TestErrPrintf("%d: VL data doesn't match!, index(i) = %d\n", __LINE__, (int)i);
continue;
} /* end if */
@@ -2842,10 +2842,11 @@ test_vltypes_fill_value(void)
/* Compare data read in */
for (i = 0; i < dset_elmts; i++) {
if ((i % 2) == select_offset[0]) {
- if (HDstrcmp(rbuf[i].str_id, "foobar") || HDstrcmp(rbuf[i].str_name, "") ||
- rbuf[i].str_desc || HDstrcmp(rbuf[i].str_orig, "\0") ||
- HDstrcmp(rbuf[i].str_stat, "dead") || HDstrcmp(rbuf[i].str_form, "liquid") ||
- HDstrcmp(rbuf[i].str_unit, "meter")) {
+ if (HDstrcmp(rbuf[i].str_id, "foobar") != 0 || HDstrcmp(rbuf[i].str_name, "") != 0 ||
+ rbuf[i].str_desc || HDstrcmp(rbuf[i].str_orig, "\0") != 0 ||
+ HDstrcmp(rbuf[i].str_stat, "dead") != 0 ||
+ HDstrcmp(rbuf[i].str_form, "liquid") != 0 ||
+ HDstrcmp(rbuf[i].str_unit, "meter") != 0) {
TestErrPrintf("%d: VL data doesn't match!, index(i) = %d\n", __LINE__, (int)i);
continue;
} /* end if */
@@ -2876,10 +2877,10 @@ test_vltypes_fill_value(void)
/* Compare data read in */
for (i = 0; i < dset_elmts; i++) {
- if (HDstrcmp(rbuf[i].str_id, "foobar") || HDstrcmp(rbuf[i].str_name, "") ||
- rbuf[i].str_desc || HDstrcmp(rbuf[i].str_orig, "\0") ||
- HDstrcmp(rbuf[i].str_stat, "dead") || HDstrcmp(rbuf[i].str_form, "liquid") ||
- HDstrcmp(rbuf[i].str_unit, "meter")) {
+ if (HDstrcmp(rbuf[i].str_id, "foobar") != 0 || HDstrcmp(rbuf[i].str_name, "") != 0 ||
+ rbuf[i].str_desc || HDstrcmp(rbuf[i].str_orig, "\0") != 0 ||
+ HDstrcmp(rbuf[i].str_stat, "dead") != 0 || HDstrcmp(rbuf[i].str_form, "liquid") != 0 ||
+ HDstrcmp(rbuf[i].str_unit, "meter") != 0) {
TestErrPrintf("%d: VL data doesn't match!, index(i)=%d\n", __LINE__, (int)i);
continue;
} /* end if */
@@ -2899,10 +2900,11 @@ test_vltypes_fill_value(void)
/* Compare data read in */
for (i = 0; i < dset_elmts; i++) {
if ((i % 2) == select_offset[0]) {
- if (HDstrcmp(rbuf[i].str_id, "foobar") || HDstrcmp(rbuf[i].str_name, "") ||
- rbuf[i].str_desc || HDstrcmp(rbuf[i].str_orig, "\0") ||
- HDstrcmp(rbuf[i].str_stat, "dead") || HDstrcmp(rbuf[i].str_form, "liquid") ||
- HDstrcmp(rbuf[i].str_unit, "meter")) {
+ if (HDstrcmp(rbuf[i].str_id, "foobar") != 0 || HDstrcmp(rbuf[i].str_name, "") != 0 ||
+ rbuf[i].str_desc || HDstrcmp(rbuf[i].str_orig, "\0") != 0 ||
+ HDstrcmp(rbuf[i].str_stat, "dead") != 0 ||
+ HDstrcmp(rbuf[i].str_form, "liquid") != 0 ||
+ HDstrcmp(rbuf[i].str_unit, "meter") != 0) {
TestErrPrintf("%d: VL data doesn't match!, index(i) = %d\n", __LINE__, (int)i);
continue;
} /* end if */
@@ -2984,13 +2986,13 @@ test_vltypes_fill_value(void)
break;
case H5D_VIRTUAL:
- assert(0 && "Invalid layout type!");
+ HDassert(0 && "Invalid layout type!");
break;
case H5D_LAYOUT_ERROR:
case H5D_NLAYOUTS:
default:
- assert(0 && "Unknown layout type!");
+ HDassert(0 && "Unknown layout type!");
break;
} /* end switch */
@@ -3017,21 +3019,22 @@ test_vltypes_fill_value(void)
/* Compare data read in */
for (i = 0; i < dset_elmts; i++) {
if (i == single_offset[0]) {
- if (HDstrcmp(rbuf[i].str_id, wdata.str_id) || rbuf[i].str_name ||
- HDstrcmp(rbuf[i].str_desc, wdata.str_desc) ||
- HDstrcmp(rbuf[i].str_orig, wdata.str_orig) ||
- HDstrcmp(rbuf[i].str_stat, wdata.str_stat) ||
- HDstrcmp(rbuf[i].str_form, wdata.str_form) ||
- HDstrcmp(rbuf[i].str_unit, wdata.str_unit)) {
+ if (HDstrcmp(rbuf[i].str_id, wdata.str_id) != 0 || rbuf[i].str_name ||
+ HDstrcmp(rbuf[i].str_desc, wdata.str_desc) != 0 ||
+ HDstrcmp(rbuf[i].str_orig, wdata.str_orig) != 0 ||
+ HDstrcmp(rbuf[i].str_stat, wdata.str_stat) != 0 ||
+ HDstrcmp(rbuf[i].str_form, wdata.str_form) != 0 ||
+ HDstrcmp(rbuf[i].str_unit, wdata.str_unit) != 0) {
TestErrPrintf("%d: VL data doesn't match!, index(i)=%d\n", __LINE__, (int)i);
continue;
} /* end if */
} /* end if */
else {
- if (HDstrcmp(rbuf[i].str_id, "foobar") || HDstrcmp(rbuf[i].str_name, "") ||
- rbuf[i].str_desc || HDstrcmp(rbuf[i].str_orig, "\0") ||
- HDstrcmp(rbuf[i].str_stat, "dead") || HDstrcmp(rbuf[i].str_form, "liquid") ||
- HDstrcmp(rbuf[i].str_unit, "meter")) {
+ if (HDstrcmp(rbuf[i].str_id, "foobar") != 0 || HDstrcmp(rbuf[i].str_name, "") != 0 ||
+ rbuf[i].str_desc || HDstrcmp(rbuf[i].str_orig, "\0") != 0 ||
+ HDstrcmp(rbuf[i].str_stat, "dead") != 0 ||
+ HDstrcmp(rbuf[i].str_form, "liquid") != 0 ||
+ HDstrcmp(rbuf[i].str_unit, "meter") != 0) {
TestErrPrintf("%d: VL data doesn't match!, index(i)=%d\n", __LINE__, (int)i);
continue;
} /* end if */
@@ -3052,22 +3055,23 @@ test_vltypes_fill_value(void)
/* Compare data read in */
for (i = 0; i < dset_elmts; i++) {
if (i == single_offset[0]) {
- if (HDstrcmp(rbuf[i].str_id, wdata.str_id) || rbuf[i].str_name ||
- HDstrcmp(rbuf[i].str_desc, wdata.str_desc) ||
- HDstrcmp(rbuf[i].str_orig, wdata.str_orig) ||
- HDstrcmp(rbuf[i].str_stat, wdata.str_stat) ||
- HDstrcmp(rbuf[i].str_form, wdata.str_form) ||
- HDstrcmp(rbuf[i].str_unit, wdata.str_unit)) {
+ if (HDstrcmp(rbuf[i].str_id, wdata.str_id) != 0 || rbuf[i].str_name ||
+ HDstrcmp(rbuf[i].str_desc, wdata.str_desc) != 0 ||
+ HDstrcmp(rbuf[i].str_orig, wdata.str_orig) != 0 ||
+ HDstrcmp(rbuf[i].str_stat, wdata.str_stat) != 0 ||
+ HDstrcmp(rbuf[i].str_form, wdata.str_form) != 0 ||
+ HDstrcmp(rbuf[i].str_unit, wdata.str_unit) != 0) {
TestErrPrintf("%d: VL data doesn't match!, index(i)=%d\n", __LINE__, (int)i);
continue;
} /* end if */
} /* end if */
else {
if ((i % 2) == select_offset[0]) {
- if (HDstrcmp(rbuf[i].str_id, "foobar") || HDstrcmp(rbuf[i].str_name, "") ||
- rbuf[i].str_desc || HDstrcmp(rbuf[i].str_orig, "\0") ||
- HDstrcmp(rbuf[i].str_stat, "dead") || HDstrcmp(rbuf[i].str_form, "liquid") ||
- HDstrcmp(rbuf[i].str_unit, "meter")) {
+ if (HDstrcmp(rbuf[i].str_id, "foobar") != 0 || HDstrcmp(rbuf[i].str_name, "") != 0 ||
+ rbuf[i].str_desc || HDstrcmp(rbuf[i].str_orig, "\0") != 0 ||
+ HDstrcmp(rbuf[i].str_stat, "dead") != 0 ||
+ HDstrcmp(rbuf[i].str_form, "liquid") != 0 ||
+ HDstrcmp(rbuf[i].str_unit, "meter") != 0) {
TestErrPrintf("%d: VL data doesn't match!, index(i) = %d\n", __LINE__, (int)i);
continue;
} /* end if */
@@ -3103,21 +3107,22 @@ test_vltypes_fill_value(void)
/* Compare data read in */
for (i = 0; i < dset_elmts; i++) {
if (i == single_offset[0]) {
- if (HDstrcmp(rbuf[i].str_id, wdata.str_id) || rbuf[i].str_name ||
- HDstrcmp(rbuf[i].str_desc, wdata.str_desc) ||
- HDstrcmp(rbuf[i].str_orig, wdata.str_orig) ||
- HDstrcmp(rbuf[i].str_stat, wdata.str_stat) ||
- HDstrcmp(rbuf[i].str_form, wdata.str_form) ||
- HDstrcmp(rbuf[i].str_unit, wdata.str_unit)) {
+ if (HDstrcmp(rbuf[i].str_id, wdata.str_id) != 0 || rbuf[i].str_name ||
+ HDstrcmp(rbuf[i].str_desc, wdata.str_desc) != 0 ||
+ HDstrcmp(rbuf[i].str_orig, wdata.str_orig) != 0 ||
+ HDstrcmp(rbuf[i].str_stat, wdata.str_stat) != 0 ||
+ HDstrcmp(rbuf[i].str_form, wdata.str_form) != 0 ||
+ HDstrcmp(rbuf[i].str_unit, wdata.str_unit) != 0) {
TestErrPrintf("%d: VL data doesn't match!, index(i)=%d\n", __LINE__, (int)i);
continue;
} /* end if */
} /* end if */
else {
- if (HDstrcmp(rbuf[i].str_id, "foobar") || HDstrcmp(rbuf[i].str_name, "") ||
- rbuf[i].str_desc || HDstrcmp(rbuf[i].str_orig, "\0") ||
- HDstrcmp(rbuf[i].str_stat, "dead") || HDstrcmp(rbuf[i].str_form, "liquid") ||
- HDstrcmp(rbuf[i].str_unit, "meter")) {
+ if (HDstrcmp(rbuf[i].str_id, "foobar") != 0 || HDstrcmp(rbuf[i].str_name, "") != 0 ||
+ rbuf[i].str_desc || HDstrcmp(rbuf[i].str_orig, "\0") != 0 ||
+ HDstrcmp(rbuf[i].str_stat, "dead") != 0 ||
+ HDstrcmp(rbuf[i].str_form, "liquid") != 0 ||
+ HDstrcmp(rbuf[i].str_unit, "meter") != 0) {
TestErrPrintf("%d: VL data doesn't match!, index(i)=%d\n", __LINE__, (int)i);
continue;
} /* end if */
@@ -3138,22 +3143,23 @@ test_vltypes_fill_value(void)
/* Compare data read in */
for (i = 0; i < dset_elmts; i++) {
if (i == single_offset[0]) {
- if (HDstrcmp(rbuf[i].str_id, wdata.str_id) || rbuf[i].str_name ||
- HDstrcmp(rbuf[i].str_desc, wdata.str_desc) ||
- HDstrcmp(rbuf[i].str_orig, wdata.str_orig) ||
- HDstrcmp(rbuf[i].str_stat, wdata.str_stat) ||
- HDstrcmp(rbuf[i].str_form, wdata.str_form) ||
- HDstrcmp(rbuf[i].str_unit, wdata.str_unit)) {
+ if (HDstrcmp(rbuf[i].str_id, wdata.str_id) != 0 || rbuf[i].str_name ||
+ HDstrcmp(rbuf[i].str_desc, wdata.str_desc) != 0 ||
+ HDstrcmp(rbuf[i].str_orig, wdata.str_orig) != 0 ||
+ HDstrcmp(rbuf[i].str_stat, wdata.str_stat) != 0 ||
+ HDstrcmp(rbuf[i].str_form, wdata.str_form) != 0 ||
+ HDstrcmp(rbuf[i].str_unit, wdata.str_unit) != 0) {
TestErrPrintf("%d: VL data doesn't match!, index(i)=%d\n", __LINE__, (int)i);
continue;
} /* end if */
} /* end if */
else {
if ((i % 2) == select_offset[0]) {
- if (HDstrcmp(rbuf[i].str_id, "foobar") || HDstrcmp(rbuf[i].str_name, "") ||
- rbuf[i].str_desc || HDstrcmp(rbuf[i].str_orig, "\0") ||
- HDstrcmp(rbuf[i].str_stat, "dead") || HDstrcmp(rbuf[i].str_form, "liquid") ||
- HDstrcmp(rbuf[i].str_unit, "meter")) {
+ if (HDstrcmp(rbuf[i].str_id, "foobar") != 0 || HDstrcmp(rbuf[i].str_name, "") != 0 ||
+ rbuf[i].str_desc || HDstrcmp(rbuf[i].str_orig, "\0") != 0 ||
+ HDstrcmp(rbuf[i].str_stat, "dead") != 0 ||
+ HDstrcmp(rbuf[i].str_form, "liquid") != 0 ||
+ HDstrcmp(rbuf[i].str_unit, "meter") != 0) {
TestErrPrintf("%d: VL data doesn't match!, index(i) = %d\n", __LINE__, (int)i);
continue;
} /* end if */
@@ -3256,5 +3262,5 @@ test_vltypes(void)
void
cleanup_vltypes(void)
{
- remove(FILENAME);
+ HDremove(FILENAME);
}
diff --git a/test/twriteorder.c b/test/twriteorder.c
index 4097c80..e792487 100644
--- a/test/twriteorder.c
+++ b/test/twriteorder.c
@@ -61,11 +61,9 @@
#include "h5test.h"
/* This test uses many POSIX things that are not available on
- * Windows. We're using a check for fork(2) here as a proxy for
- * all POSIX/Unix/Linux things until this test can be made
- * more platform-independent.
+ * Windows.
*/
-#ifdef H5_HAVE_FORK
+#ifdef H5_HAVE_UNISTD_H
#define DATAFILE "twriteorder.dat"
/* #define READERS_MAX 10 */ /* max number of readers */
@@ -141,21 +139,21 @@ parse_option(int argc, char *const argv[])
HDexit(EXIT_SUCCESS);
break;
case 'b': /* number of planes to write/read */
- if ((blocksize_g = atoi(optarg)) <= 0) {
+ if ((blocksize_g = HDatoi(optarg)) <= 0) {
HDfprintf(stderr, "bad blocksize %s, must be a positive integer\n", optarg);
usage(progname_g);
Hgoto_error(-1);
};
break;
case 'n': /* number of planes to write/read */
- if ((nlinkedblock_g = atoi(optarg)) < 2) {
+ if ((nlinkedblock_g = HDatoi(optarg)) < 2) {
HDfprintf(stderr, "bad number of linked blocks %s, must be greater than 1.\n", optarg);
usage(progname_g);
Hgoto_error(-1);
};
break;
case 'p': /* number of planes to write/read */
- if ((part_size_g = atoi(optarg)) <= 0) {
+ if ((part_size_g = HDatoi(optarg)) <= 0) {
HDfprintf(stderr, "bad partition size %s, must be a positive integer\n", optarg);
usage(progname_g);
Hgoto_error(-1);
@@ -404,7 +402,7 @@ main(int argc, char *argv[])
Hgoto_error(1);
};
};
- mypid = getpid();
+ mypid = HDgetpid();
/* ============= */
/* launch reader */
@@ -440,7 +438,7 @@ main(int argc, char *argv[])
/* If readwrite, collect exit code of child process */
/* ================================================ */
if (launch_g == UC_READWRITE) {
- if ((tmppid = waitpid(childpid, &child_status, child_wait_option)) < 0) {
+ if ((tmppid = HDwaitpid(childpid, &child_status, child_wait_option)) < 0) {
HDperror("waitpid");
Hgoto_error(1);
}
@@ -468,7 +466,7 @@ done:
return ret_value;
}
-#else /* H5_HAVE_FORK */
+#else /* H5_HAVE_UNISTD_H */
int
main(void)
@@ -477,4 +475,4 @@ main(void)
return EXIT_SUCCESS;
} /* end main() */
-#endif /* H5_HAVE_FORK */
+#endif /* H5_HAVE_UNISTD_H */
diff --git a/test/unlink.c b/test/unlink.c
index 40f7a00..73e3b25 100644
--- a/test/unlink.c
+++ b/test/unlink.c
@@ -12,7 +12,7 @@
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
/*
- * Programmer: Robb Matzke <matzke@llnl.gov>
+ * Programmer: Robb Matzke
* Friday, September 25, 1998
*
* Purpose: Test unlinking operations.
@@ -516,7 +516,7 @@ check_new_move(hid_t fapl)
/* Check soft links */
if (H5Lget_val(file, "group2/soft", linkval, sizeof(linkval), H5P_DEFAULT) < 0)
FAIL_STACK_ERROR
- if (HDstrcmp(linkval, "/group1/group_move"))
+ if (HDstrcmp(linkval, "/group1/group_move") != 0)
FAIL_PUTS_ERROR(" Soft link test failed. Wrong link value")
/* Cleanup */
@@ -581,7 +581,7 @@ test_filespace(hid_t fapl)
size_t rdcc_nbytes;
double rdcc_w0;
- puts("Testing file space gets reused:");
+ HDputs("Testing file space gets reused:");
/* Open file */
h5_fixname(FILENAME[4], fapl, filename, sizeof filename);
diff --git a/test/use_append_chunk.c b/test/use_append_chunk.c
index 3699a56..107615a 100644
--- a/test/use_append_chunk.c
+++ b/test/use_append_chunk.c
@@ -61,11 +61,9 @@
#include "h5test.h"
/* This test uses many POSIX things that are not available on
- * Windows. We're using a check for fork(2) here as a proxy for
- * all POSIX/Unix/Linux things until this test can be made
- * more platform-independent.
+ * Windows.
*/
-#ifdef H5_HAVE_FORK
+#ifdef H5_HAVE_UNISTD_H
#include "use.h"
@@ -272,7 +270,7 @@ done:
return (ret_value);
}
-#else /* H5_HAVE_FORK */
+#else /* H5_HAVE_UNISTD_H */
int
main(void)
@@ -281,4 +279,4 @@ main(void)
return EXIT_SUCCESS;
} /* end main() */
-#endif /* H5_HAVE_FORK */
+#endif /* H5_HAVE_UNISTD_H */
diff --git a/test/use_append_chunk_mirror.c b/test/use_append_chunk_mirror.c
index 59a7732..b19c510 100644
--- a/test/use_append_chunk_mirror.c
+++ b/test/use_append_chunk_mirror.c
@@ -91,11 +91,9 @@
#include "use.h"
/* This test uses many POSIX things that are not available on
- * Windows. We're using a check for fork(2) here as a proxy for
- * all POSIX/Unix/Linux things until this test can be made
- * more platform-independent.
+ * Windows.
*/
-#ifdef H5_HAVE_FORK
+#ifdef H5_HAVE_UNISTD_H
#ifdef H5_HAVE_MIRROR_VFD
@@ -391,7 +389,7 @@ main(void)
#endif /* H5_HAVE_MIRROR_VFD */
-#else /* H5_HAVE_FORK */
+#else /* H5_HAVE_UNISTD_H */
int
main(void)
@@ -400,4 +398,4 @@ main(void)
return EXIT_SUCCESS;
} /* end main() */
-#endif /* H5_HAVE_FORK */
+#endif /* H5_HAVE_UNISTD_H */
diff --git a/test/use_append_mchunks.c b/test/use_append_mchunks.c
index 705e690..47c9f92 100644
--- a/test/use_append_mchunks.c
+++ b/test/use_append_mchunks.c
@@ -53,11 +53,9 @@
#include "h5test.h"
/* This test uses many POSIX things that are not available on
- * Windows. We're using a check for fork(2) here as a proxy for
- * all POSIX/Unix/Linux things until this test can be made
- * more platform-independent.
+ * Windows.
*/
-#ifdef H5_HAVE_FORK
+#ifdef H5_HAVE_UNISTD_H
#include "use.h"
@@ -165,12 +163,12 @@ main(int argc, char *argv[])
/* Fork process */
/* ============ */
if (UC_opts.launch == UC_READWRITE) {
- if ((childpid = fork()) < 0) {
- perror("fork");
+ if ((childpid = HDfork()) < 0) {
+ HDperror("fork");
Hgoto_error(1);
}
}
- mypid = getpid();
+ mypid = HDgetpid();
/* ============= */
/* launch reader */
@@ -239,8 +237,8 @@ main(int argc, char *argv[])
/* If readwrite, collect exit code of child process */
/* ================================================ */
if (UC_opts.launch == UC_READWRITE) {
- if ((tmppid = waitpid(childpid, &child_status, child_wait_option)) < 0) {
- perror("waitpid");
+ if ((tmppid = HDwaitpid(childpid, &child_status, child_wait_option)) < 0) {
+ HDperror("waitpid");
Hgoto_error(1);
}
@@ -267,7 +265,7 @@ done:
return (ret_value);
} /* end main() */
-#else /* H5_HAVE_FORK */
+#else /* H5_HAVE_UNISTD_H */
int
main(void)
@@ -276,4 +274,4 @@ main(void)
return EXIT_SUCCESS;
} /* end main() */
-#endif /* H5_HAVE_FORK */
+#endif /* H5_HAVE_UNISTD_H */
diff --git a/test/use_common.c b/test/use_common.c
index b407434..0ea2c83 100644
--- a/test/use_common.c
+++ b/test/use_common.c
@@ -13,11 +13,9 @@
#include "h5test.h"
/* This test uses many POSIX things that are not available on
- * Windows. We're using a check for fork(2) here as a proxy for
- * all POSIX/Unix/Linux things until this test can be made
- * more platform-independent.
+ * Windows.
*/
-#ifdef H5_HAVE_FORK
+#ifdef H5_HAVE_UNISTD_H
#include "use.h"
@@ -68,7 +66,7 @@ parse_option(int argc, char *const argv[], options_t *opts)
switch (c) {
case 'h':
usage(opts->progname);
- exit(EXIT_SUCCESS);
+ HDexit(EXIT_SUCCESS);
break;
case 'f': /* usecase data file name */
opts->filename = HDstrdup(optarg);
@@ -442,7 +440,7 @@ read_uc_file(hbool_t towait, options_t *opts)
{
hid_t fid; /* File ID for new HDF5 file */
hid_t dsid; /* dataset ID */
- UC_CTYPE *buffer, *bufptr; /* read data buffer */
+ UC_CTYPE *buffer = NULL, *bufptr = NULL; /* read data buffer */
hid_t f_sid; /* dataset file space id */
hid_t m_sid; /* memory space id */
int rank; /* rank */
@@ -605,10 +603,12 @@ read_uc_file(hbool_t towait, options_t *opts)
return -1;
}
+ HDfree(buffer);
+
if (nreadererr)
return -1;
else
return 0;
} /* end read_uc_file() */
-#endif /* H5_HAVE_FORK */
+#endif /* H5_HAVE_UNISTD_H */
diff --git a/test/use_disable_mdc_flushes.c b/test/use_disable_mdc_flushes.c
index 1f2976f..f28e574 100644
--- a/test/use_disable_mdc_flushes.c
+++ b/test/use_disable_mdc_flushes.c
@@ -18,11 +18,9 @@
#include "h5test.h"
/* This test uses many POSIX things that are not available on
- * Windows. We're using a check for fork(2) here as a proxy for
- * all POSIX/Unix/Linux things until this test can be made
- * more platform-independent.
+ * Windows.
*/
-#ifdef H5_HAVE_FORK
+#ifdef H5_HAVE_UNISTD_H
#define H5D_FRIEND /*suppress error about including H5Dpkg */
#define H5D_TESTING
@@ -539,7 +537,7 @@ done:
return (ret_value);
}
-#else /* H5_HAVE_FORK */
+#else /* H5_HAVE_UNISTD_H */
int
main(void)
@@ -548,4 +546,4 @@ main(void)
HDexit(EXIT_SUCCESS);
} /* end main() */
-#endif /* H5_HAVE_FORK */
+#endif /* H5_HAVE_UNISTD_H */
diff --git a/test/vds.c b/test/vds.c
index 43d1fab..56973f8 100644
--- a/test/vds.c
+++ b/test/vds.c
@@ -11,7 +11,7 @@
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
/*
- * Programmer: Neil Fortner <nfortne2@hdfgroup.org>
+ * Programmer: Neil Fortner
* Monday, February 16, 2015
*
* Purpose: Tests datasets with virtual layout.
diff --git a/test/vds_env.c b/test/vds_env.c
index ba91c69..58d90fc 100644
--- a/test/vds_env.c
+++ b/test/vds_env.c
@@ -11,7 +11,7 @@
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
/*
- * Programmer: Neil Fortner <nfortne2@hdfgroup.org>
+ * Programmer: Neil Fortner
* Monday, February 16, 2015
*
* Purpose: Tests datasets with virtual layout.
diff --git a/test/vfd.c b/test/vfd.c
index 56bbe1b..8484bfd 100644
--- a/test/vfd.c
+++ b/test/vfd.c
@@ -99,7 +99,7 @@ static int splitter_create_single_file_at(const char *filename, hid_t fapl_id,
const struct splitter_dataset_def *data);
static int splitter_compare_expected_data(hid_t file_id, const struct splitter_dataset_def *data);
static int run_splitter_test(const struct splitter_dataset_def *data, hbool_t ignore_wo_errors,
- hbool_t provide_logfile_path, hid_t sub_fapl_ids[2]);
+ hbool_t provide_logfile_path, const hid_t sub_fapl_ids[2]);
static int splitter_RO_test(const struct splitter_dataset_def *data, hid_t child_fapl_id);
static int splitter_tentative_open_test(hid_t child_fapl_id);
static int file_exists(const char *filename, hid_t fapl_id);
@@ -340,7 +340,7 @@ test_core(void)
if ((fid = H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl_id)) < 0)
TEST_ERROR;
- /* Retrieve the access property list... */
+ /* Retrieve the access property list */
if ((fapl_id_out = H5Fget_access_plist(fid)) < 0)
TEST_ERROR;
@@ -553,6 +553,38 @@ test_core(void)
TEST_ERROR;
h5_delete_test_file(FILENAME[1], fapl_id);
+ /************************************************************************
+ * Check that delete behavior works correctly
+ ************************************************************************/
+
+ /* Create and close a file */
+ if (H5Pset_fapl_core(fapl_id, (size_t)CORE_INCREMENT, TRUE) < 0)
+ TEST_ERROR;
+ if ((fid = H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl_id)) < 0)
+ TEST_ERROR;
+ if (H5Fclose(fid) < 0)
+ TEST_ERROR;
+
+ /* Try to delete the file with the backing store off (shouldn't delete anything) */
+ if (H5Pset_fapl_core(fapl_id, (size_t)CORE_INCREMENT, FALSE) < 0)
+ TEST_ERROR;
+ if (H5Fdelete(filename, fapl_id) < 0)
+ TEST_ERROR;
+ if (-1 == HDaccess(filename, F_OK))
+ FAIL_PUTS_ERROR("file deleted when backing store set to FALSE");
+
+ /* Try to delete the file with the backing store on (should work) */
+ if (H5Pset_fapl_core(fapl_id, (size_t)CORE_INCREMENT, TRUE) < 0)
+ TEST_ERROR;
+ if (H5Fdelete(filename, fapl_id) < 0)
+ TEST_ERROR;
+ if (0 == HDaccess(filename, F_OK))
+ FAIL_PUTS_ERROR("file not deleted when backing store set to TRUE");
+
+ /************************************************************************
+ * Clean up
+ ************************************************************************/
+
/* Close the fapl */
if (H5Pclose(fapl_id) < 0)
TEST_ERROR;
@@ -1835,12 +1867,23 @@ test_log(void)
hsize_t file_size = 0;
unsigned int flags = H5FD_LOG_ALL;
size_t buf_size = 4 * KB;
+ herr_t ret = SUCCEED;
TESTING("LOG file driver");
- /* Set property list and file name for log driver. */
if ((fapl = H5Pcreate(H5P_FILE_ACCESS)) < 0)
TEST_ERROR;
+
+ /* Make sure calling with an invalid fapl doesn't crash */
+ H5E_BEGIN_TRY
+ {
+ ret = H5Pset_fapl_log(H5I_INVALID_HID, LOG_FILENAME, 0, 0);
+ }
+ H5E_END_TRY;
+ if (SUCCEED == ret)
+ TEST_ERROR;
+
+ /* Set property list and file name for log driver. */
if (H5Pset_fapl_log(fapl, LOG_FILENAME, flags, buf_size) < 0)
TEST_ERROR;
h5_fixname(FILENAME[6], fapl, filename, sizeof filename);
@@ -2180,14 +2223,12 @@ static herr_t
test_ros3(void)
{
#ifdef H5_HAVE_ROS3_VFD
- hid_t fid = -1; /* file ID */
- hid_t fapl_id = -1; /* file access property list ID */
- hid_t fapl_id_out = -1; /* from H5Fget_access_plist */
- hid_t driver_id = -1; /* ID for this VFD */
- unsigned long driver_flags = 0; /* VFD feature flags */
- char filename[1024]; /* filename */
- void * os_file_handle = NULL; /* OS file handle */
- hsize_t file_size; /* file size */
+ hid_t fid = -1; /* file ID */
+ hid_t fapl_id = -1; /* file access property list ID */
+ hid_t fapl_id_out = -1; /* from H5Fget_access_plist */
+ hid_t driver_id = -1; /* ID for this VFD */
+ unsigned long driver_flags = 0; /* VFD feature flags */
+ char filename[1024]; /* filename */
H5FD_ros3_fapl_t test_ros3_fa;
H5FD_ros3_fapl_t ros3_fa_0 = {
/* version = */ H5FD_CURR_ROS3_FAPL_T_VERSION,
@@ -2219,9 +2260,9 @@ test_ros3(void)
/* need a macro to compare instances of H5FD_ros3_fapl_t */
if ((test_ros3_fa.version != ros3_fa_0.version) ||
(test_ros3_fa.authenticate != ros3_fa_0.authenticate) ||
- (strcmp(test_ros3_fa.aws_region, ros3_fa_0.aws_region) != 0) ||
- (strcmp(test_ros3_fa.secret_id, ros3_fa_0.secret_id) != 0) ||
- (strcmp(test_ros3_fa.secret_key, ros3_fa_0.secret_key) != 0))
+ (HDstrcmp(test_ros3_fa.aws_region, ros3_fa_0.aws_region) != 0) ||
+ (HDstrcmp(test_ros3_fa.secret_id, ros3_fa_0.secret_id) != 0) ||
+ (HDstrcmp(test_ros3_fa.secret_key, ros3_fa_0.secret_key) != 0))
TEST_ERROR;
h5_fixname(FILENAME[10], fapl_id, filename, sizeof(filename));
@@ -2270,7 +2311,7 @@ error:
AT(); \
HDfprintf(stderr, mesg); \
H5Eprint2(H5E_DEFAULT, stderr); \
- fflush(stderr); \
+ HDfflush(stderr); \
ret_value = -1; \
goto done; \
}
@@ -2289,46 +2330,51 @@ error:
static int
compare_splitter_config_info(hid_t fapl_id, H5FD_splitter_vfd_config_t *info)
{
- int ret_value = 0;
- H5FD_splitter_vfd_config_t fetched_info;
+ int ret_value = 0;
+ H5FD_splitter_vfd_config_t *fetched_info = NULL;
+
+ if (NULL == (fetched_info = HDcalloc(1, sizeof(H5FD_splitter_vfd_config_t))))
+ SPLITTER_TEST_FAULT("memory allocation for fetched_info struct failed");
- fetched_info.magic = H5FD_SPLITTER_MAGIC;
- fetched_info.version = H5FD_CURR_SPLITTER_VFD_CONFIG_VERSION;
- fetched_info.rw_fapl_id = H5I_INVALID_HID;
- fetched_info.wo_fapl_id = H5I_INVALID_HID;
+ fetched_info->magic = H5FD_SPLITTER_MAGIC;
+ fetched_info->version = H5FD_CURR_SPLITTER_VFD_CONFIG_VERSION;
+ fetched_info->rw_fapl_id = H5I_INVALID_HID;
+ fetched_info->wo_fapl_id = H5I_INVALID_HID;
- if (H5Pget_fapl_splitter(fapl_id, &fetched_info) < 0) {
- SPLITTER_TEST_FAULT("can't get splitter info\n");
+ if (H5Pget_fapl_splitter(fapl_id, fetched_info) < 0) {
+ SPLITTER_TEST_FAULT("can't get splitter info");
}
if (info->rw_fapl_id == H5P_DEFAULT) {
- if (H5Pget_driver(fetched_info.rw_fapl_id) != H5Pget_driver(H5P_FILE_ACCESS_DEFAULT)) {
+ if (H5Pget_driver(fetched_info->rw_fapl_id) != H5Pget_driver(H5P_FILE_ACCESS_DEFAULT)) {
SPLITTER_TEST_FAULT("Read-Write driver mismatch (default)\n");
}
}
else {
- if (H5Pget_driver(fetched_info.rw_fapl_id) != H5Pget_driver(info->rw_fapl_id)) {
+ if (H5Pget_driver(fetched_info->rw_fapl_id) != H5Pget_driver(info->rw_fapl_id)) {
SPLITTER_TEST_FAULT("Read-Write driver mismatch\n");
}
}
if (info->wo_fapl_id == H5P_DEFAULT) {
- if (H5Pget_driver(fetched_info.wo_fapl_id) != H5Pget_driver(H5P_FILE_ACCESS_DEFAULT)) {
+ if (H5Pget_driver(fetched_info->wo_fapl_id) != H5Pget_driver(H5P_FILE_ACCESS_DEFAULT)) {
SPLITTER_TEST_FAULT("Write-Only driver mismatch (default)\n");
}
}
else {
- if (H5Pget_driver(fetched_info.wo_fapl_id) != H5Pget_driver(info->wo_fapl_id)) {
+ if (H5Pget_driver(fetched_info->wo_fapl_id) != H5Pget_driver(info->wo_fapl_id)) {
SPLITTER_TEST_FAULT("Write-Only driver mismatch\n");
}
}
- if ((HDstrlen(info->wo_path) != HDstrlen(fetched_info.wo_path)) ||
- HDstrncmp(info->wo_path, fetched_info.wo_path, H5FD_SPLITTER_PATH_MAX)) {
- HDfprintf(stderr, "MISMATCH: '%s' :: '%s'\n", info->wo_path, fetched_info.wo_path);
+ if ((HDstrlen(info->wo_path) != HDstrlen(fetched_info->wo_path)) ||
+ HDstrncmp(info->wo_path, fetched_info->wo_path, H5FD_SPLITTER_PATH_MAX) != 0) {
+ HDfprintf(stderr, "MISMATCH: '%s' :: '%s'\n", info->wo_path, fetched_info->wo_path);
HEXPRINT(H5FD_SPLITTER_PATH_MAX, info->wo_path);
- HEXPRINT(H5FD_SPLITTER_PATH_MAX, fetched_info.wo_path);
+ HEXPRINT(H5FD_SPLITTER_PATH_MAX, fetched_info->wo_path);
SPLITTER_TEST_FAULT("Write-Only file path mismatch\n");
}
done:
+ HDfree(fetched_info);
+
return ret_value;
} /* end compare_splitter_config_info() */
@@ -2351,45 +2397,50 @@ done:
*/
static int
run_splitter_test(const struct splitter_dataset_def *data, hbool_t ignore_wo_errors,
- hbool_t provide_logfile_path, hid_t sub_fapl_ids[2])
+ hbool_t provide_logfile_path, const hid_t sub_fapl_ids[2])
{
- hid_t file_id = H5I_INVALID_HID;
- hid_t fapl_id = H5I_INVALID_HID;
- hid_t dset_id = H5I_INVALID_HID;
- hid_t space_id = H5I_INVALID_HID;
- hid_t fapl_id_out = H5I_INVALID_HID;
- hid_t fapl_id_cpy = H5I_INVALID_HID;
- H5FD_splitter_vfd_config_t vfd_config;
- char filename_rw[H5FD_SPLITTER_PATH_MAX + 1];
- FILE * logfile = NULL;
- int ret_value = 0;
-
- vfd_config.magic = H5FD_SPLITTER_MAGIC;
- vfd_config.version = H5FD_CURR_SPLITTER_VFD_CONFIG_VERSION;
- vfd_config.ignore_wo_errs = ignore_wo_errors;
- vfd_config.rw_fapl_id = sub_fapl_ids[0];
- vfd_config.wo_fapl_id = sub_fapl_ids[1];
-
- if (splitter_prepare_file_paths(&vfd_config, filename_rw) < 0) {
+ hid_t file_id = H5I_INVALID_HID;
+ hid_t fapl_id = H5I_INVALID_HID;
+ hid_t dset_id = H5I_INVALID_HID;
+ hid_t space_id = H5I_INVALID_HID;
+ hid_t fapl_id_out = H5I_INVALID_HID;
+ hid_t fapl_id_cpy = H5I_INVALID_HID;
+ H5FD_splitter_vfd_config_t *vfd_config = NULL;
+ char * filename_rw = NULL;
+ FILE * logfile = NULL;
+ int ret_value = 0;
+
+ if (NULL == (vfd_config = HDcalloc(1, sizeof(H5FD_splitter_vfd_config_t))))
+ SPLITTER_TEST_FAULT("memory allocation for vfd_config struct failed");
+ if (NULL == (filename_rw = HDcalloc(H5FD_SPLITTER_PATH_MAX + 1, sizeof(char))))
+ SPLITTER_TEST_FAULT("memory allocation for filename_rw string failed");
+
+ vfd_config->magic = H5FD_SPLITTER_MAGIC;
+ vfd_config->version = H5FD_CURR_SPLITTER_VFD_CONFIG_VERSION;
+ vfd_config->ignore_wo_errs = ignore_wo_errors;
+ vfd_config->rw_fapl_id = sub_fapl_ids[0];
+ vfd_config->wo_fapl_id = sub_fapl_ids[1];
+
+ if (splitter_prepare_file_paths(vfd_config, filename_rw) < 0) {
SPLITTER_TEST_FAULT("can't prepare file paths\n");
}
if (provide_logfile_path == FALSE) {
- *vfd_config.log_file_path = '\0'; /* reset as empty string */
+ vfd_config->log_file_path[0] = '\0'; /* reset as empty string */
}
/* Create a new fapl to use the SPLITTER file driver */
if ((fapl_id = H5Pcreate(H5P_FILE_ACCESS)) == H5I_INVALID_HID) {
SPLITTER_TEST_FAULT("can't create FAPL ID\n");
}
- if (H5Pset_fapl_splitter(fapl_id, &vfd_config) < 0) {
+ if (H5Pset_fapl_splitter(fapl_id, vfd_config) < 0) {
SPLITTER_TEST_FAULT("can't set splitter FAPL\n");
}
if (H5Pget_driver(fapl_id) != H5FD_SPLITTER) {
SPLITTER_TEST_FAULT("set FAPL not SPLITTER\n");
}
- if (compare_splitter_config_info(fapl_id, &vfd_config) < 0) {
+ if (compare_splitter_config_info(fapl_id, vfd_config) < 0) {
SPLITTER_TEST_FAULT("information mismatch\n");
}
@@ -2402,7 +2453,7 @@ run_splitter_test(const struct splitter_dataset_def *data, hbool_t ignore_wo_err
if (H5I_INVALID_HID == fapl_id_cpy) {
SPLITTER_TEST_FAULT("can't copy FAPL\n");
}
- if (compare_splitter_config_info(fapl_id_cpy, &vfd_config) < 0) {
+ if (compare_splitter_config_info(fapl_id_cpy, vfd_config) < 0) {
SPLITTER_TEST_FAULT("information mismatch\n");
}
if (H5Pclose(fapl_id_cpy) < 0) {
@@ -2428,7 +2479,7 @@ run_splitter_test(const struct splitter_dataset_def *data, hbool_t ignore_wo_err
if (H5Pget_driver(fapl_id_out) != H5FD_SPLITTER) {
SPLITTER_TEST_FAULT("wrong file FAPL driver\n");
}
- if (compare_splitter_config_info(fapl_id_out, &vfd_config) < 0) {
+ if (compare_splitter_config_info(fapl_id_out, vfd_config) < 0) {
SPLITTER_TEST_FAULT("information mismatch\n");
}
if (H5Pclose(fapl_id_out) < 0) {
@@ -2467,12 +2518,12 @@ run_splitter_test(const struct splitter_dataset_def *data, hbool_t ignore_wo_err
}
/* Verify that the R/W and W/O files are identical */
- if (h5_compare_file_bytes(filename_rw, vfd_config.wo_path) < 0) {
+ if (h5_compare_file_bytes(filename_rw, vfd_config->wo_path) < 0) {
SPLITTER_TEST_FAULT("files are not byte-for-byte equivalent\n");
}
/* Verify existence of logfile if appropriate */
- logfile = fopen(vfd_config.log_file_path, "r");
+ logfile = HDfopen(vfd_config->log_file_path, "r");
if ((TRUE == provide_logfile_path && NULL == logfile) ||
(FALSE == provide_logfile_path && NULL != logfile)) {
SPLITTER_TEST_FAULT("no logfile when one was expected\n");
@@ -2482,20 +2533,23 @@ done:
if (ret_value < 0) {
H5E_BEGIN_TRY
{
- (void)H5Dclose(dset_id);
- (void)H5Sclose(space_id);
- (void)H5Pclose(fapl_id_out);
- (void)H5Pclose(fapl_id_cpy);
- (void)H5Pclose(fapl_id);
- (void)H5Fclose(file_id);
+ H5Dclose(dset_id);
+ H5Sclose(space_id);
+ H5Pclose(fapl_id_out);
+ H5Pclose(fapl_id_cpy);
+ H5Pclose(fapl_id);
+ H5Fclose(file_id);
}
H5E_END_TRY;
}
- if (logfile != NULL) {
- fclose(logfile);
- }
- return ret_value;
+ if (logfile != NULL)
+ HDfclose(logfile);
+
+ HDfree(vfd_config);
+ HDfree(filename_rw);
+
+ return ret_value;
} /* end run_splitter_test() */
/*-------------------------------------------------------------------------
@@ -2516,26 +2570,29 @@ done:
static int
driver_is_splitter_compatible(hid_t fapl_id)
{
- H5FD_splitter_vfd_config_t vfd_config;
- hid_t split_fapl_id = H5I_INVALID_HID;
- herr_t ret = SUCCEED;
- int ret_value = 0;
+ H5FD_splitter_vfd_config_t *vfd_config = NULL;
+ hid_t split_fapl_id = H5I_INVALID_HID;
+ herr_t ret = SUCCEED;
+ int ret_value = 0;
- split_fapl_id = H5Pcreate(H5P_FILE_ACCESS);
- if (H5I_INVALID_HID == split_fapl_id) {
+ if (NULL == (vfd_config = HDcalloc(1, sizeof(H5FD_splitter_vfd_config_t)))) {
+ FAIL_PUTS_ERROR("memory allocation for vfd_config struct failed");
+ }
+
+ if (H5I_INVALID_HID == (split_fapl_id = H5Pcreate(H5P_FILE_ACCESS))) {
FAIL_PUTS_ERROR("Can't create contained FAPL");
}
- vfd_config.magic = H5FD_SPLITTER_MAGIC;
- vfd_config.version = H5FD_CURR_SPLITTER_VFD_CONFIG_VERSION;
- vfd_config.ignore_wo_errs = FALSE;
- vfd_config.rw_fapl_id = H5P_DEFAULT;
- vfd_config.wo_fapl_id = fapl_id;
- HDstrncpy(vfd_config.wo_path, "nonesuch", H5FD_SPLITTER_PATH_MAX);
- *vfd_config.log_file_path = '\0';
+ vfd_config->magic = H5FD_SPLITTER_MAGIC;
+ vfd_config->version = H5FD_CURR_SPLITTER_VFD_CONFIG_VERSION;
+ vfd_config->ignore_wo_errs = FALSE;
+ vfd_config->rw_fapl_id = H5P_DEFAULT;
+ vfd_config->wo_fapl_id = fapl_id;
+ HDstrncpy(vfd_config->wo_path, "nonesuch", H5FD_SPLITTER_PATH_MAX);
+ vfd_config->log_file_path[0] = '\0';
H5E_BEGIN_TRY
{
- ret = H5Pset_fapl_splitter(split_fapl_id, &vfd_config);
+ ret = H5Pset_fapl_splitter(split_fapl_id, vfd_config);
}
H5E_END_TRY;
if (SUCCEED == ret) {
@@ -2547,14 +2604,19 @@ driver_is_splitter_compatible(hid_t fapl_id)
}
split_fapl_id = H5I_INVALID_HID;
+ HDfree(vfd_config);
+
return ret_value;
error:
H5E_BEGIN_TRY
{
- (void)H5Pclose(split_fapl_id);
+ H5Pclose(split_fapl_id);
}
H5E_END_TRY;
+
+ HDfree(vfd_config);
+
return -1;
} /* end driver_is_splitter_compatible() */
@@ -2574,19 +2636,24 @@ error:
static int
splitter_RO_test(const struct splitter_dataset_def *data, hid_t child_fapl_id)
{
- char filename_rw[H5FD_SPLITTER_PATH_MAX + 1];
- H5FD_splitter_vfd_config_t vfd_config;
- hid_t fapl_id = H5I_INVALID_HID;
- int ret_value = 0;
- hid_t file_id = H5I_INVALID_HID;
-
- vfd_config.magic = H5FD_SPLITTER_MAGIC;
- vfd_config.version = H5FD_CURR_SPLITTER_VFD_CONFIG_VERSION;
- vfd_config.ignore_wo_errs = FALSE;
- vfd_config.rw_fapl_id = child_fapl_id;
- vfd_config.wo_fapl_id = child_fapl_id;
-
- if (splitter_prepare_file_paths(&vfd_config, filename_rw) < 0) {
+ char * filename_rw = NULL;
+ H5FD_splitter_vfd_config_t *vfd_config = NULL;
+ hid_t fapl_id = H5I_INVALID_HID;
+ hid_t file_id = H5I_INVALID_HID;
+ int ret_value = 0;
+
+ if (NULL == (vfd_config = HDcalloc(1, sizeof(H5FD_splitter_vfd_config_t))))
+ SPLITTER_TEST_FAULT("memory allocation for vfd_config struct failed");
+ if (NULL == (filename_rw = HDcalloc(H5FD_SPLITTER_PATH_MAX + 1, sizeof(char))))
+ SPLITTER_TEST_FAULT("memory allocation for filename_rw string failed");
+
+ vfd_config->magic = H5FD_SPLITTER_MAGIC;
+ vfd_config->version = H5FD_CURR_SPLITTER_VFD_CONFIG_VERSION;
+ vfd_config->ignore_wo_errs = FALSE;
+ vfd_config->rw_fapl_id = child_fapl_id;
+ vfd_config->wo_fapl_id = child_fapl_id;
+
+ if (splitter_prepare_file_paths(vfd_config, filename_rw) < 0) {
SPLITTER_TEST_FAULT("can't prepare splitter file paths\n");
}
@@ -2595,7 +2662,7 @@ splitter_RO_test(const struct splitter_dataset_def *data, hid_t child_fapl_id)
if (H5I_INVALID_HID == fapl_id) {
SPLITTER_TEST_FAULT("can't create FAPL ID\n");
}
- if (H5Pset_fapl_splitter(fapl_id, &vfd_config) < 0) {
+ if (H5Pset_fapl_splitter(fapl_id, vfd_config) < 0) {
SPLITTER_TEST_FAULT("can't set splitter FAPL\n");
}
if (H5Pget_driver(fapl_id) != H5FD_SPLITTER) {
@@ -2619,7 +2686,7 @@ splitter_RO_test(const struct splitter_dataset_def *data, hid_t child_fapl_id)
* Should fail.
*/
- if (splitter_create_single_file_at(vfd_config.wo_path, vfd_config.wo_fapl_id, data) < 0) {
+ if (splitter_create_single_file_at(vfd_config->wo_path, vfd_config->wo_fapl_id, data) < 0) {
SPLITTER_TEST_FAULT("can't write W/O file\n");
}
H5E_BEGIN_TRY
@@ -2630,13 +2697,13 @@ splitter_RO_test(const struct splitter_dataset_def *data, hid_t child_fapl_id)
if (file_id >= 0) {
SPLITTER_TEST_FAULT("R/O open with extant W/O file unexpectedly successful\n");
}
- HDremove(vfd_config.wo_path);
+ HDremove(vfd_config->wo_path);
/* Attempt R/O open when only R/W file exists
* Should fail.
*/
- if (splitter_create_single_file_at(filename_rw, vfd_config.rw_fapl_id, data) < 0) {
+ if (splitter_create_single_file_at(filename_rw, vfd_config->rw_fapl_id, data) < 0) {
SPLITTER_TEST_FAULT("can't create R/W file\n");
}
H5E_BEGIN_TRY
@@ -2651,7 +2718,7 @@ splitter_RO_test(const struct splitter_dataset_def *data, hid_t child_fapl_id)
/* Attempt R/O open when both R/W and W/O files exist
*/
- if (splitter_create_single_file_at(vfd_config.wo_path, vfd_config.wo_fapl_id, data) < 0) {
+ if (splitter_create_single_file_at(vfd_config->wo_path, vfd_config->wo_fapl_id, data) < 0) {
SPLITTER_TEST_FAULT("can't create W/O file\n");
}
file_id = H5Fopen(filename_rw, H5F_ACC_RDONLY, fapl_id);
@@ -2678,11 +2745,15 @@ done:
if (ret_value < 0) {
H5E_BEGIN_TRY
{
- (void)H5Pclose(fapl_id);
- (void)H5Fclose(file_id);
+ H5Pclose(fapl_id);
+ H5Fclose(file_id);
}
H5E_END_TRY;
- } /* end if error */
+ }
+
+ HDfree(vfd_config);
+ HDfree(filename_rw);
+
return ret_value;
} /* end splitter_RO_test() */
@@ -2812,9 +2883,9 @@ done:
if (ret_value < 0) {
H5E_BEGIN_TRY
{
- (void)H5Dclose(dset_id);
- (void)H5Sclose(space_id);
- (void)H5Fclose(file_id);
+ H5Dclose(dset_id);
+ H5Sclose(space_id);
+ H5Fclose(file_id);
}
H5E_END_TRY;
} /* end if error */
@@ -2875,7 +2946,7 @@ done:
if (ret_value < 0) {
H5E_BEGIN_TRY
{
- (void)H5Dclose(dset_id);
+ H5Dclose(dset_id);
}
H5E_END_TRY;
}
@@ -2908,11 +2979,11 @@ done:
static int
splitter_tentative_open_test(hid_t child_fapl_id)
{
- const char filename_tmp[H5FD_SPLITTER_PATH_MAX + 1] = "splitter_tmp.h5";
- char filename_rw[H5FD_SPLITTER_PATH_MAX + 1];
- H5FD_splitter_vfd_config_t vfd_config;
- hid_t fapl_id = H5I_INVALID_HID;
- hid_t file_id = H5I_INVALID_HID;
+ const char * filename_tmp = "splitter_tmp.h5";
+ char * filename_rw = NULL;
+ H5FD_splitter_vfd_config_t *vfd_config = NULL;
+ hid_t fapl_id = H5I_INVALID_HID;
+ hid_t file_id = H5I_INVALID_HID;
int buf[SPLITTER_SIZE][SPLITTER_SIZE]; /* for comparison */
hsize_t dims[2] = {SPLITTER_SIZE, SPLITTER_SIZE}; /* for comparison */
int i = 0; /* for comparison */
@@ -2920,6 +2991,11 @@ splitter_tentative_open_test(hid_t child_fapl_id)
struct splitter_dataset_def data; /* for comparison */
int ret_value = 0;
+ if (NULL == (vfd_config = HDcalloc(1, sizeof(H5FD_splitter_vfd_config_t))))
+ SPLITTER_TEST_FAULT("memory allocation for vfd_config struct failed");
+ if (NULL == (filename_rw = HDcalloc(H5FD_SPLITTER_PATH_MAX + 1, sizeof(char))))
+ SPLITTER_TEST_FAULT("memory allocation for filename_rw string failed");
+
/* pre-fill data buffer to write */
for (i = 0; i < SPLITTER_SIZE; i++) {
for (j = 0; j < SPLITTER_SIZE; j++) {
@@ -2934,13 +3010,13 @@ splitter_tentative_open_test(hid_t child_fapl_id)
data.n_dims = 2;
data.dset_name = SPLITTER_DATASET_NAME;
- vfd_config.magic = H5FD_SPLITTER_MAGIC;
- vfd_config.version = H5FD_CURR_SPLITTER_VFD_CONFIG_VERSION;
- vfd_config.ignore_wo_errs = FALSE;
- vfd_config.rw_fapl_id = child_fapl_id;
- vfd_config.wo_fapl_id = child_fapl_id;
+ vfd_config->magic = H5FD_SPLITTER_MAGIC;
+ vfd_config->version = H5FD_CURR_SPLITTER_VFD_CONFIG_VERSION;
+ vfd_config->ignore_wo_errs = FALSE;
+ vfd_config->rw_fapl_id = child_fapl_id;
+ vfd_config->wo_fapl_id = child_fapl_id;
- if (splitter_prepare_file_paths(&vfd_config, filename_rw) < 0) {
+ if (splitter_prepare_file_paths(vfd_config, filename_rw) < 0) {
SPLITTER_TEST_FAULT("can't prepare splitter file paths\n");
}
@@ -2948,7 +3024,7 @@ splitter_tentative_open_test(hid_t child_fapl_id)
if ((fapl_id = H5Pcreate(H5P_FILE_ACCESS)) == H5I_INVALID_HID) {
SPLITTER_TEST_FAULT("can't create FAPL ID\n");
}
- if (H5Pset_fapl_splitter(fapl_id, &vfd_config) < 0) {
+ if (H5Pset_fapl_splitter(fapl_id, vfd_config) < 0) {
SPLITTER_TEST_FAULT("can't set splitter FAPL\n");
}
if (H5Pget_driver(fapl_id) != H5FD_SPLITTER) {
@@ -2980,7 +3056,7 @@ splitter_tentative_open_test(hid_t child_fapl_id)
if (file_exists(filename_rw, child_fapl_id)) {
SPLITTER_TEST_FAULT("R/W file unexpectedly created\n");
}
- if (file_exists(vfd_config.wo_path, child_fapl_id)) {
+ if (file_exists(vfd_config->wo_path, child_fapl_id)) {
SPLITTER_TEST_FAULT("W/O file unexpectedly created\n");
}
@@ -2990,7 +3066,7 @@ splitter_tentative_open_test(hid_t child_fapl_id)
* Should fail.
*/
- if (h5_duplicate_file_by_bytes(filename_tmp, vfd_config.wo_path) < 0) {
+ if (h5_duplicate_file_by_bytes(filename_tmp, vfd_config->wo_path) < 0) {
SPLITTER_TEST_FAULT("Can't create W/O file copy.\n");
}
H5E_BEGIN_TRY
@@ -3004,11 +3080,11 @@ splitter_tentative_open_test(hid_t child_fapl_id)
if (file_exists(filename_rw, child_fapl_id)) {
SPLITTER_TEST_FAULT("R/W file unexpectedly created\n");
}
- if (!file_exists(vfd_config.wo_path, child_fapl_id)) {
+ if (!file_exists(vfd_config->wo_path, child_fapl_id)) {
SPLITTER_TEST_FAULT("W/O file mysteriously disappeared\n");
}
- HDremove(vfd_config.wo_path);
- if (file_exists(vfd_config.wo_path, child_fapl_id)) {
+ HDremove(vfd_config->wo_path);
+ if (file_exists(vfd_config->wo_path, child_fapl_id)) {
SPLITTER_TEST_FAULT("failed to remove W/O file\n");
}
@@ -3032,7 +3108,7 @@ splitter_tentative_open_test(hid_t child_fapl_id)
if (!file_exists(filename_rw, child_fapl_id)) {
SPLITTER_TEST_FAULT("R/W file mysteriously disappeared\n");
}
- if (file_exists(vfd_config.wo_path, child_fapl_id)) {
+ if (file_exists(vfd_config->wo_path, child_fapl_id)) {
SPLITTER_TEST_FAULT("W/O file unexpectedly created\n");
}
@@ -3041,7 +3117,7 @@ splitter_tentative_open_test(hid_t child_fapl_id)
* Both files present.
*/
- if (h5_duplicate_file_by_bytes(filename_tmp, vfd_config.wo_path) < 0) {
+ if (h5_duplicate_file_by_bytes(filename_tmp, vfd_config->wo_path) < 0) {
SPLITTER_TEST_FAULT("Can't create W/O file copy.\n");
}
file_id = H5Fopen(filename_rw, H5F_ACC_RDWR, fapl_id);
@@ -3055,7 +3131,7 @@ splitter_tentative_open_test(hid_t child_fapl_id)
if (!file_exists(filename_rw, child_fapl_id)) {
SPLITTER_TEST_FAULT("R/W file mysteriously disappared\n");
}
- if (!file_exists(vfd_config.wo_path, child_fapl_id)) {
+ if (!file_exists(vfd_config->wo_path, child_fapl_id)) {
SPLITTER_TEST_FAULT("W/O file mysteriously disappeared\n");
}
@@ -3075,14 +3151,14 @@ splitter_tentative_open_test(hid_t child_fapl_id)
if (!file_exists(filename_rw, child_fapl_id)) {
SPLITTER_TEST_FAULT("R/W file mysteriously disappared\n");
}
- if (!file_exists(vfd_config.wo_path, child_fapl_id)) {
+ if (!file_exists(vfd_config->wo_path, child_fapl_id)) {
SPLITTER_TEST_FAULT("W/O file mysteriously disappeared\n");
}
- if (h5_compare_file_bytes(filename_rw, vfd_config.wo_path) < 0) {
+ if (h5_compare_file_bytes(filename_rw, vfd_config->wo_path) < 0) {
SPLITTER_TEST_FAULT("files are not byte-for-byte equivalent\n");
}
HDremove(filename_rw);
- HDremove(vfd_config.wo_path);
+ HDremove(vfd_config->wo_path);
/*
* H5Fcreate() with TRUNC access.
@@ -3092,7 +3168,7 @@ splitter_tentative_open_test(hid_t child_fapl_id)
if (h5_duplicate_file_by_bytes(filename_tmp, filename_rw) < 0) {
SPLITTER_TEST_FAULT("Can't create R/W file copy.\n");
}
- if (file_exists(vfd_config.wo_path, child_fapl_id)) {
+ if (file_exists(vfd_config->wo_path, child_fapl_id)) {
SPLITTER_TEST_FAULT("failed to remove W/O file\n");
}
file_id = H5Fcreate(filename_rw, H5F_ACC_TRUNC, H5P_DEFAULT, fapl_id);
@@ -3106,21 +3182,21 @@ splitter_tentative_open_test(hid_t child_fapl_id)
if (!file_exists(filename_rw, child_fapl_id)) {
SPLITTER_TEST_FAULT("R/W file mysteriously disappared\n");
}
- if (!file_exists(vfd_config.wo_path, child_fapl_id)) {
+ if (!file_exists(vfd_config->wo_path, child_fapl_id)) {
SPLITTER_TEST_FAULT("W/O file mysteriously disappeared\n");
}
- if (h5_compare_file_bytes(filename_rw, vfd_config.wo_path) < 0) {
+ if (h5_compare_file_bytes(filename_rw, vfd_config->wo_path) < 0) {
SPLITTER_TEST_FAULT("files are not byte-for-byte equivalent\n");
}
HDremove(filename_rw);
- HDremove(vfd_config.wo_path);
+ HDremove(vfd_config->wo_path);
/*
* H5Fcreate() with TRUNC access.
* Only W/O present.
*/
- if (h5_duplicate_file_by_bytes(filename_tmp, vfd_config.wo_path) < 0) {
+ if (h5_duplicate_file_by_bytes(filename_tmp, vfd_config->wo_path) < 0) {
SPLITTER_TEST_FAULT("Can't create W/O file copy.\n");
}
if (file_exists(filename_rw, child_fapl_id)) {
@@ -3137,14 +3213,14 @@ splitter_tentative_open_test(hid_t child_fapl_id)
if (!file_exists(filename_rw, child_fapl_id)) {
SPLITTER_TEST_FAULT("R/W file mysteriously disappared\n");
}
- if (!file_exists(vfd_config.wo_path, child_fapl_id)) {
+ if (!file_exists(vfd_config->wo_path, child_fapl_id)) {
SPLITTER_TEST_FAULT("W/O file mysteriously disappeared\n");
}
- if (h5_compare_file_bytes(filename_rw, vfd_config.wo_path) < 0) {
+ if (h5_compare_file_bytes(filename_rw, vfd_config->wo_path) < 0) {
SPLITTER_TEST_FAULT("files are not byte-for-byte equivalent\n");
}
HDremove(filename_rw);
- HDremove(vfd_config.wo_path);
+ HDremove(vfd_config->wo_path);
/* H5Fcreate with both files absent is tested elsewhere */
@@ -3160,11 +3236,15 @@ done:
if (ret_value < 0) {
H5E_BEGIN_TRY
{
- (void)H5Pclose(fapl_id);
- (void)H5Fclose(file_id);
+ H5Pclose(fapl_id);
+ H5Fclose(file_id);
}
H5E_END_TRY;
- } /* end if error */
+ }
+
+ HDfree(vfd_config);
+ HDfree(filename_rw);
+
return ret_value;
} /* end splitter_tentative_open_test() */
@@ -3203,7 +3283,7 @@ file_exists(const char *filename, hid_t fapl_id)
error:
H5E_BEGIN_TRY
{
- (void)H5Fclose(file_id);
+ H5Fclose(file_id);
}
H5E_END_TRY;
return ret_value;
@@ -3310,9 +3390,9 @@ test_splitter(void)
return 0;
error:
- if (child_fapl_id != H5I_INVALID_HID) {
- (void)H5Pclose(child_fapl_id);
- }
+ if (child_fapl_id != H5I_INVALID_HID)
+ H5Pclose(child_fapl_id);
+
return -1;
} /* end test_splitter() */
diff --git a/test/vfd_swmr_dsetops_writer.c b/test/vfd_swmr_dsetops_writer.c
new file mode 100644
index 0000000..8c21806
--- /dev/null
+++ b/test/vfd_swmr_dsetops_writer.c
@@ -0,0 +1,1835 @@
+/*
+ * 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 COPYING file, which can be found at the root of the source code
+ * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases.
+ * If you do not have access to either file, you may request a copy from
+ * help@hdfgroup.org.
+ */
+
+/*
+ * Purpose: To test writing operations for different dataset types.
+ * Dataset types:
+ * --dataset with compact layout
+ * --dataset with contiguous layout
+ * --datasets with chunked layout: single/implicit/fixed array/extensible array/btree2 indexes
+ *
+ * Types of writes:
+ * -- Sequential writes
+ * -- Random writes
+ * -- Regular hyperslab writes
+ * -- Raw data modifications
+ */
+
+#include "hdf5.h"
+#include "testhdf5.h"
+#include "vfd_swmr_common.h"
+
+#ifndef H5_HAVE_WIN32_API
+
+#define READER_WAIT_TICKS 4
+#define MAX_COMPACT_SIZE 65520 /* max obj header message size 65536) - other layout message fields (16) */
+#define MAX_COMPACT_ELMS (MAX_COMPACT_SIZE / sizeof(unsigned int))
+#define RANDOM_SEED 9 /* Random seed used by both writer and reader for random writes */
+
+/* Structure to hold info for options specified */
+typedef struct {
+ char filename[PATH_MAX]; /* File name */
+ char progname[PATH_MAX]; /* Program name */
+ hid_t file; /* File ID */
+ hid_t filetype; /* Datatype ID */
+ unsigned int update_interval; /* For -u option */
+ unsigned int csteps; /* For -c <csteps> option */
+ bool use_np; /* For -N option */
+ bool use_vfd_swmr; /* For -S option */
+ bool compact; /* -p option: create compact dataset */
+ bool compact_write; /* -o option: write to the whole compact dataset */
+ unsigned int compact_elmts; /* -e <elmts> option: # of elments for the compact dataset */
+ bool contig; /* -g option: create contiguous dataset */
+ bool chunked; /* -k option: create chunked datasets with 5 indexing types */
+ unsigned int rows; /* -m <rows> option for contiguous and/or chunked datasets */
+ unsigned int cols; /* -n <cols option for contiguous and/or chunked datasets */
+ unsigned int swrites; /* -s <swrites> option: sequential writes to contiguous and/or chunked datasets */
+ unsigned int rwrites; /* -r <rwrites> option: random writes to contiguous and/or chunked datasets */
+ unsigned int lwrites; /* -l <lwrites> option: hyperslab writes to contiguous and/or chunked datasets */
+ unsigned int wwrites; /* -w <wwrites> option: modify raw data to contiguous and/or chunked datasets */
+} state_t;
+
+/* Initializations for state_t */
+#define ALL_HID_INITIALIZER \
+ (state_t) \
+ { \
+ .filename = "", .file = H5I_INVALID_HID, .filetype = H5T_NATIVE_UINT32, \
+ .update_interval = READER_WAIT_TICKS, .csteps = 1, .use_np = true, .use_vfd_swmr = true, \
+ .compact = false, .compact_write = false, .compact_elmts = MAX_COMPACT_ELMS, .contig = false, \
+ .rows = 256, .cols = 512, .swrites = 0, .rwrites = 0, .lwrites = 0, .wwrites = 0 \
+ }
+
+/* Structure to hold info for different dataset types */
+typedef struct {
+ hid_t compact_did; /* ID for compact dataset */
+ hid_t contig_did; /* ID for contiguous dataset */
+ hid_t single_did; /* ID for chunked dataset: single index */
+ hid_t implicit_did; /* ID for chunked dataset: implicit index */
+ hid_t fa_did; /* ID for chunked dataset: fixed array index */
+ hid_t ea_did; /* ID for chunked dataset: extensible array index */
+ hid_t bt2_did; /* ID for chunked dataset: version 2 btree index */
+ hid_t compact_sid; /* Dataspace ID for compact dataset */
+ hid_t contig_sid; /* Dataspace ID for contiguous dataset */
+ hid_t single_sid; /* Dataspace ID for chunked dataset */
+ hid_t implicit_sid; /* Dataspace ID for chunked dataset */
+ hid_t fa_sid; /* Dataspace ID for chunked dataset */
+ hid_t ea_sid; /* Dataspace ID for chunked dataset */
+ hid_t bt2_sid; /* Dataspace ID for chunked dataset */
+} dsets_state_t;
+
+/* Initializations for dsets_state_t */
+#define DSETS_INITIALIZER \
+ (dsets_state_t) \
+ { \
+ .compact_did = H5I_INVALID_HID, .compact_sid = H5I_INVALID_HID, .contig_did = H5I_INVALID_HID, \
+ .contig_sid = H5I_INVALID_HID, .single_did = H5I_INVALID_HID, .single_sid = H5I_INVALID_HID, \
+ .implicit_did = H5I_INVALID_HID, .implicit_sid = H5I_INVALID_HID, .fa_did = H5I_INVALID_HID, \
+ .fa_sid = H5I_INVALID_HID, .ea_did = H5I_INVALID_HID, .ea_sid = H5I_INVALID_HID, \
+ .bt2_did = H5I_INVALID_HID, .bt2_sid = H5I_INVALID_HID \
+ }
+
+/* Structure to hold info for named pipes */
+typedef struct {
+ const char *fifo_writer_to_reader; /* Name of fifo for writer to reader */
+ const char *fifo_reader_to_writer; /* Name of fifo for reader to writer */
+ int fd_writer_to_reader; /* File ID for fifo from writer to reader */
+ int fd_reader_to_writer; /* File ID for fifo from reader to writer */
+ int notify; /* Value to notify between writer and reader */
+ int verify; /* Value to verify between writer and reader */
+} np_state_t;
+
+/* Initializations for np_state_t */
+#define NP_INITIALIZER \
+ (np_state_t) \
+ { \
+ .fifo_writer_to_reader = "./fifo_dsetops_writer_to_reader", \
+ .fifo_reader_to_writer = "./fifo_dsetops_reader_to_writer", .fd_writer_to_reader = -1, \
+ .fd_reader_to_writer = -1, .notify = 0, .verify = 0 \
+ }
+
+static bool state_init(state_t *, int, char **);
+
+static bool np_init(np_state_t *np, bool writer);
+static bool np_close(np_state_t *np, bool writer);
+static bool np_writer(bool result, unsigned step, const state_t *s, np_state_t *np,
+ H5F_vfd_swmr_config_t *config);
+static bool np_reader(bool result, unsigned step, const state_t *s, np_state_t *np);
+static bool np_confirm_verify_notify(int fd, unsigned step, const state_t *s, np_state_t *np);
+
+static bool create_dsets(const state_t *s, dsets_state_t *ds);
+static bool open_dsets(const state_t *s, dsets_state_t *ds);
+static bool open_dset_real(const state_t *s, hid_t *did, hid_t *sid, const char *name);
+static bool close_dsets(const dsets_state_t *ds);
+static bool close_dset_real(hid_t did, hid_t sid);
+
+static bool write_dset_contig_chunked(state_t *s, dsets_state_t *ds, H5F_vfd_swmr_config_t *config,
+ np_state_t *np);
+static bool dsets_action(unsigned action, const state_t *s, const dsets_state_t *ds, unsigned step);
+static bool dset_setup(unsigned action, unsigned which, const state_t *s, hsize_t *start, hsize_t *stride,
+ hsize_t *count, hsize_t *block, hid_t *mem_sid, unsigned int **buf);
+static bool write_dset(hid_t did, hid_t tid, hid_t mem_sid, hid_t file_sid, hsize_t *start, hsize_t *stride,
+ hsize_t *count, hsize_t *block, unsigned int *buf);
+static bool write_dset_compact(const state_t *s, const dsets_state_t *ds);
+
+static bool verify_write_dset_contig_chunked(state_t *s, dsets_state_t *ds, H5F_vfd_swmr_config_t *config,
+ np_state_t *np);
+static bool verify_dsets_action(unsigned action, const state_t *s, const dsets_state_t *ds, unsigned which);
+static bool verify_read_dset(hid_t did, hid_t tid, hid_t mem_sid, hid_t file_sid, hsize_t *start,
+ hsize_t *stride, hsize_t *count, hsize_t *block, unsigned int *vbuf);
+static bool verify_read_dset_compact(const state_t *s, const dsets_state_t *ds);
+
+static const hid_t badhid = H5I_INVALID_HID;
+
+/* Names for datasets */
+#define DSET_COMPACT_NAME "compact_dset"
+#define DSET_CONTIG_NAME "contig_dset"
+#define DSET_SINGLE_NAME "chunked_single"
+#define DSET_IMPLICIT_NAME "chunked_implicit"
+#define DSET_FA_NAME "chunked_fa"
+#define DSET_EA_NAME "chunked_ea"
+#define DSET_BT2_NAME "chunked_bt2"
+
+/* Action for writes */
+#define SEQ_WRITE 1 /* Sequential write */
+#define RANDOM_WRITE 2 /* Random write */
+#define HYPER_WRITE 3 /* Hyperslab write */
+#define MODIFY_DATA 4 /* Modify raw data */
+
+/* Test program usage info */
+static void
+usage(const char *progname)
+{
+ fprintf(stderr,
+ "usage: %s \n"
+ " [-p] [-e elmts] [-o]\n"
+ " [-g] [-k] [-m rows] [-n cols]\n"
+ " [-s swrites] [-r rwrites] [-l lwrites] [-w writes]\n"
+ " [-u nticks] [-c csteps] [-S] [-N] [-q] [-b]\n"
+ "\n"
+ "-p: create a dataset with compact layout\n"
+ "-e elmts: # of <elmts> for the compact dataset\n"
+ " (default is 16380)\n"
+ "-t: perform write to the compact dataset\n"
+ "-g: create a dataset with contiguous layout\n"
+ "-k: create 5 datasets with chunked layout for the 5 indexing types\n"
+ "-m rows: # of <rows> rows for the contiguous and/or chunked datasets\n"
+ "-n cols: # of <cols> columns for the contiguous and/or chunked datasets\n"
+ "-s swrites: perform sequential writes to all datasets\n"
+ "-r rwrites: perform random writes to all datasets\n"
+ "-l lwrites: perform hyperslab writes to all datasets\n"
+ " # of rows to write: every other element is selected per row\n"
+ "-w wwrites: perform raw data modifications to all datasets\n"
+ "-u nticks: `nticks` ticks for the reader to wait before verification\n"
+ " (default is 4)\n"
+ "-c csteps: `csteps` steps communication interval between reader and writer\n"
+ " (default is 1)\n"
+ "-S: do not use VFD SWMR\n"
+ "-N: do not use named pipes for test synchronization\n"
+ "-q: silence printouts, few messages\n"
+ "-b: write data in big-endian byte order\n"
+ " (default is H5T_NATIVE_UINT32)\n\n"
+ "Note:\n"
+ "1. Require to specify at least -p, -g or -k option\n"
+ "2. -c <csteps> option cannot exceed -s <swrites> or -r <rwrites>\n"
+ " or -l <lwrites> or -w <wwrites> option\n"
+ "\n",
+ progname);
+ exit(EXIT_FAILURE);
+} /* usage() */
+
+/*
+ * Initialize option info in state_t
+ */
+static bool
+state_init(state_t *s, int argc, char **argv)
+{
+ unsigned long tmp;
+ int ch;
+ char * tfile;
+ char * end;
+
+ *s = ALL_HID_INITIALIZER;
+
+ if (H5_basename(argv[0], &tfile) < 0) {
+ printf("H5_basename failed\n");
+ TEST_ERROR;
+ }
+
+ esnprintf(s->progname, sizeof(s->progname), "%s", tfile);
+
+ while ((ch = getopt(argc, argv, "pte:gkm:n:s:r:l:w:bqSNu:c:")) != -1) {
+ switch (ch) {
+
+ case 'p': /* compact dataset */
+ s->compact = true;
+ break;
+
+ case 't': /* compact write */
+ s->compact_write = true;
+ break;
+
+ case 'g': /* contiguous dataset */
+ s->contig = true;
+ break;
+
+ case 'k': /* chunked datasets */
+ s->chunked = true;
+ break;
+
+ case 'q':
+ verbosity = 0;
+ break;
+
+ case 'b':
+ s->filetype = H5T_STD_U32BE;
+ break;
+
+ case 'S':
+ s->use_vfd_swmr = false;
+ break;
+
+ case 'N':
+ s->use_np = false;
+ break;
+
+ case 'e': /* # of elements for compact dataset */
+ case 'm': /* # of rows for -g and/or -k */
+ case 'n': /* # of cols for -g and/or -k */
+ case 's': /* # of sequential writes for -g and/or -k */
+ case 'r': /* # of random writes for -g and/or -k */
+ case 'l': /* # of hyperslab writes for -g and/or -k */
+ case 'w': /* # of raw data modifications for -g and/or -k */
+ case 'u': /* ticks for raeder to wait before verification */
+ case 'c': /* communication interval */
+ errno = 0;
+ tmp = strtoul(optarg, &end, 0);
+ if (end == optarg || *end != '\0') {
+ printf("couldn't parse `-%c` argument `%s`\n", ch, optarg);
+ TEST_ERROR;
+ }
+ else if (errno != 0) {
+ printf("couldn't parse `-%c` argument `%s`\n", ch, optarg);
+ TEST_ERROR;
+ }
+ else if (tmp > UINT_MAX) {
+ printf("`-%c` argument `%lu` too large\n", ch, tmp);
+ TEST_ERROR;
+ }
+
+ if (ch == 'e')
+ s->compact_elmts = (unsigned)tmp;
+ else if (ch == 'm')
+ s->rows = (unsigned)tmp;
+ else if (ch == 'n')
+ s->cols = (unsigned)tmp;
+ else if (ch == 's')
+ s->swrites = (unsigned)tmp;
+ else if (ch == 'r')
+ s->rwrites = (unsigned)tmp;
+ else if (ch == 'l')
+ s->lwrites = (unsigned)tmp;
+ else if (ch == 'w')
+ s->wwrites = (unsigned)tmp;
+ else if (ch == 'u')
+ s->update_interval = (unsigned)tmp;
+ else if (ch == 'c')
+ s->csteps = (unsigned)tmp;
+
+ break;
+
+ case '?':
+ default:
+ usage(s->progname);
+ break;
+ }
+ }
+ argc -= optind;
+ argv += optind;
+
+ /* Require to specify at least -p or -g or -k option */
+ if (!s->compact && !s->contig && !s->chunked) {
+ printf("Require to specify at least -p or -g or -k option\n");
+ usage(s->progname);
+ goto error;
+ }
+
+ /* -e <elmts> */
+ if (s->compact_elmts > MAX_COMPACT_ELMS) {
+ printf("size of compact dataset cannot exceed 16380 elements\n");
+ TEST_ERROR;
+ }
+
+ /* -c <csteps> cannot be zero */
+ if (!s->csteps) {
+ printf("communication interval cannot be zero\n");
+ TEST_ERROR;
+ }
+
+ /* -c <csteps> and -s <swrites> options */
+ if (s->swrites && s->csteps > s->swrites) {
+ printf("communication interval with sequential writes is out of bounds\n");
+ TEST_ERROR;
+ }
+
+ /* -c <csteps> and -r <rwrites> options */
+ if (s->rwrites && s->csteps > s->rwrites) {
+ printf("communication interval with random writes is out of bounds\n");
+ TEST_ERROR;
+ }
+
+ /* -c <csteps> and -l <lwrites> options */
+ if (s->lwrites && s->csteps > s->lwrites) {
+ printf("communication interval with hyperslab writes is out of bounds\n");
+ TEST_ERROR;
+ }
+
+ /* -c <csteps> and -w <wwrites> options */
+ if (s->wwrites && s->csteps > s->wwrites) {
+ printf("communication interval with raw data modification is out of bounds\n");
+ TEST_ERROR;
+ }
+
+ /* The test file name */
+ esnprintf(s->filename, sizeof(s->filename), "vfd_swmr_dsetops.h5");
+
+ return true;
+
+error:
+ return false;
+
+} /* state_init() */
+
+/*
+ * Create the datasets as specified on the command line.
+ */
+static bool
+create_dsets(const state_t *s, dsets_state_t *ds)
+{
+ hid_t dcpl = badhid;
+ hid_t dtid = badhid;
+
+ *ds = DSETS_INITIALIZER;
+
+ /* Create the named datatype that will be used by compact and contiguous datasets */
+ if ((dtid = H5Tcopy(s->filetype)) < 0) {
+ printf("H5Tcopy failed\n");
+ TEST_ERROR;
+ }
+
+ if (H5Tcommit2(s->file, "named_dtype", dtid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT) < 0) {
+ printf("H5Tcommit2 failed\n");
+ TEST_ERROR;
+ }
+
+ /* Dataset with compact layout, 1d, named datatype */
+ if (s->compact) {
+ hsize_t dims[1];
+
+ if ((dcpl = H5Pcreate(H5P_DATASET_CREATE)) < 0) {
+ printf("H5Pcreate failed\n");
+ TEST_ERROR;
+ }
+ if (H5Pset_layout(dcpl, H5D_COMPACT) < 0) {
+ printf("H5Pset_layout failed\n");
+ TEST_ERROR;
+ }
+
+ dims[0] = s->compact_elmts;
+
+ /* Dataspace for compact dataset */
+ if ((ds->compact_sid = H5Screate_simple(1, dims, dims)) < 0) {
+ printf("H5Screate_simple failed\n");
+ TEST_ERROR;
+ }
+
+ /* Create the compact dataset with named datatype */
+ if ((ds->compact_did = H5Dcreate2(s->file, DSET_COMPACT_NAME, dtid, ds->compact_sid, H5P_DEFAULT,
+ dcpl, H5P_DEFAULT)) < 0) {
+ printf("H5Dcreate2 compact dataset failed\n");
+ TEST_ERROR;
+ }
+
+ if (H5Pclose(dcpl) < 0) {
+ printf("H5Pclose failed\n");
+ TEST_ERROR;
+ }
+ }
+
+ /* Dataset with contiguous layout, 2d, named datatype */
+ if (s->contig) {
+ hsize_t dims[2];
+
+ dims[0] = s->rows;
+ dims[1] = s->cols;
+
+ /* Dataspace for contiguous dataset */
+ if ((ds->contig_sid = H5Screate_simple(2, dims, dims)) < 0) {
+ printf("H5Screate_simple failed\n");
+ TEST_ERROR;
+ }
+
+ if ((dcpl = H5Pcreate(H5P_DATASET_CREATE)) < 0) {
+ printf("H5Pcreate failed\n");
+ TEST_ERROR;
+ }
+
+ if (H5Pset_layout(dcpl, H5D_CONTIGUOUS) < 0) {
+ printf("H5Pset_layout failed\n");
+ TEST_ERROR;
+ }
+
+ /* Create the contiguous dataset with the named datatype */
+ if ((ds->contig_did = H5Dcreate2(s->file, DSET_CONTIG_NAME, dtid, ds->contig_sid, H5P_DEFAULT, dcpl,
+ H5P_DEFAULT)) < 0) {
+ printf("H5Dcreate2 contiguous dataset failed\n");
+ TEST_ERROR;
+ }
+
+ if (H5Pclose(dcpl) < 0) {
+ printf("H5Pclose failed\n");
+ TEST_ERROR;
+ }
+ }
+
+ /* Dataset with chunked layout, 2d, named datatype */
+ if (s->chunked) {
+ hsize_t dims[2];
+ hsize_t max_dims[2];
+ hsize_t chunk_dims[2];
+
+ dims[0] = s->rows;
+ dims[1] = s->cols;
+
+ /* Default chunk size is 2x2 unless s->rows or s->cols indicates otherwise */
+ chunk_dims[0] = MAX(1, s->rows / 2);
+ chunk_dims[1] = MAX(1, s->cols / 2);
+
+ if ((dcpl = H5Pcreate(H5P_DATASET_CREATE)) < 0) {
+ printf("H5Pcreate failed\n");
+ TEST_ERROR;
+ }
+
+ if (H5Pset_layout(dcpl, H5D_CHUNKED) < 0) {
+ printf("H5Pset_layout failed\n");
+ TEST_ERROR;
+ }
+
+ /* Create 2-D chunked dataset with single index */
+ /* Chunked, dims=max_dims=chunk_dims */
+
+ if (H5Pset_chunk(dcpl, 2, dims) < 0) {
+ printf("H5Pset_chunk failed\n");
+ TEST_ERROR;
+ }
+
+ if ((ds->single_sid = H5Screate_simple(2, dims, dims)) < 0) {
+ printf("H5Screate_simple failed\n");
+ TEST_ERROR;
+ }
+
+ /* Create the chunked dataset (single index) with the named datatype */
+ if ((ds->single_did = H5Dcreate2(s->file, DSET_SINGLE_NAME, dtid, ds->single_sid, H5P_DEFAULT, dcpl,
+ H5P_DEFAULT)) < 0) {
+ printf("H5Dcreate2 chunked dataset:single index failed\n");
+ TEST_ERROR;
+ }
+
+ /* Create 2-D chunked dataset with implicit index */
+ /* Chunked, dims=max_dims, early allocation */
+
+ if (H5Pset_alloc_time(dcpl, H5D_ALLOC_TIME_EARLY) < 0) {
+ printf("H5Pset_alloc_time\n");
+ TEST_ERROR;
+ }
+
+ if (H5Pset_chunk(dcpl, 2, chunk_dims) < 0) {
+ printf("H5Pset_chunk failed\n");
+ TEST_ERROR;
+ }
+
+ if ((ds->implicit_sid = H5Screate_simple(2, dims, dims)) < 0) {
+ printf("H5Screate_simple failed\n");
+ TEST_ERROR;
+ }
+
+ /* Create the chunked dataset (implicit index) with the named datatype */
+ if ((ds->implicit_did = H5Dcreate2(s->file, DSET_IMPLICIT_NAME, dtid, ds->implicit_sid, H5P_DEFAULT,
+ dcpl, H5P_DEFAULT)) < 0) {
+ printf("H5Dcreate2 chunked dataset:implicit index failed\n");
+ TEST_ERROR;
+ }
+
+ if (H5Pclose(dcpl) < 0) {
+ printf("H5Pclose failed\n");
+ TEST_ERROR;
+ }
+
+ /* Create 2-D chunked dataset with fixed array index */
+ /* Chunked, fixed max_dims */
+
+ if ((dcpl = H5Pcreate(H5P_DATASET_CREATE)) < 0) {
+ printf("H5Pcreate failed\n");
+ TEST_ERROR;
+ }
+
+ if (H5Pset_chunk(dcpl, 2, chunk_dims) < 0) {
+ printf("H5Pset_chunk failed\n");
+ TEST_ERROR;
+ }
+
+ max_dims[0] = dims[0] + 10;
+ max_dims[1] = dims[1] + 10;
+
+ if ((ds->fa_sid = H5Screate_simple(2, dims, max_dims)) < 0) {
+ printf("H5Screate_simple failed\n");
+ TEST_ERROR;
+ }
+
+ /* Create the chunked dataset (fixed array index) with the named datatype */
+ if ((ds->fa_did =
+ H5Dcreate2(s->file, DSET_FA_NAME, dtid, ds->fa_sid, H5P_DEFAULT, dcpl, H5P_DEFAULT)) < 0) {
+ printf("H5Dcreaet2 chunked dataset: fa index failed\n");
+ TEST_ERROR;
+ }
+
+ /* Create 2-D chunked dataset with extensible array index */
+ /* Chunked, 1 unlimited max_dims */
+
+ max_dims[1] = H5S_UNLIMITED;
+ if ((ds->ea_sid = H5Screate_simple(2, dims, max_dims)) < 0) {
+ printf("H5Screate_simple failed\n");
+ TEST_ERROR;
+ }
+
+ /* Create the chunked dataset (extensible array index) with the named datatype */
+ if ((ds->ea_did =
+ H5Dcreate2(s->file, DSET_EA_NAME, dtid, ds->ea_sid, H5P_DEFAULT, dcpl, H5P_DEFAULT)) < 0) {
+ printf("H5Dcreate2 chunked dataset: ea index failed\n");
+ TEST_ERROR;
+ }
+
+ /* Create 2-D chunked dataset with bt2 index */
+ /* Chunked, 2 unlimited max_dims */
+ max_dims[0] = H5S_UNLIMITED;
+
+ if ((ds->bt2_sid = H5Screate_simple(2, dims, max_dims)) < 0) {
+ printf("H5Screate_simple failed\n");
+ TEST_ERROR;
+ }
+
+ /* Create the chunked dataset (btree2 index) with the named datatype */
+ if ((ds->bt2_did =
+ H5Dcreate2(s->file, DSET_BT2_NAME, dtid, ds->bt2_sid, H5P_DEFAULT, dcpl, H5P_DEFAULT)) < 0) {
+ printf("H5Dcreate2 chunked dataset: bt2 index failed\n");
+ TEST_ERROR;
+ }
+
+ if (H5Pclose(dcpl) < 0) {
+ printf("H5Pclose failed\n");
+ TEST_ERROR;
+ }
+ }
+
+ if (H5Tclose(dtid) < 0) {
+ printf("H5Tclose failed\n");
+ TEST_ERROR;
+ }
+
+ return true;
+
+error:
+ H5E_BEGIN_TRY
+ {
+ H5Pclose(dcpl);
+ H5Tclose(dtid);
+ H5Sclose(ds->compact_sid);
+ H5Sclose(ds->contig_sid);
+ H5Sclose(ds->single_sid);
+ H5Sclose(ds->implicit_sid);
+ H5Sclose(ds->fa_sid);
+ H5Sclose(ds->ea_sid);
+ H5Sclose(ds->bt2_sid);
+ H5Dclose(ds->compact_did);
+ H5Dclose(ds->contig_did);
+ H5Dclose(ds->single_did);
+ H5Dclose(ds->implicit_did);
+ H5Dclose(ds->fa_did);
+ H5Dclose(ds->ea_did);
+ H5Dclose(ds->bt2_did);
+ }
+ H5E_END_TRY;
+
+ return false;
+
+} /* create_dsets() */
+
+/*
+ * Open the datasets as specified.
+ */
+static bool
+open_dsets(const state_t *s, dsets_state_t *ds)
+{
+ *ds = DSETS_INITIALIZER;
+
+ if (s->compact) {
+ if (!open_dset_real(s, &ds->compact_did, &ds->compact_sid, DSET_COMPACT_NAME)) {
+ printf("open_dset_real() for compact dataset failed\n");
+ TEST_ERROR;
+ }
+ }
+
+ if (s->contig) {
+
+ if (!open_dset_real(s, &ds->contig_did, &ds->contig_sid, DSET_CONTIG_NAME)) {
+ printf("open_dset_real() for contiguous dataset failed\n");
+ TEST_ERROR;
+ }
+ }
+
+ if (s->chunked) {
+
+ if (!open_dset_real(s, &ds->single_did, &ds->single_sid, DSET_SINGLE_NAME)) {
+ printf("open_dset_real() for chunked dataset: single index failed\n");
+ TEST_ERROR;
+ }
+
+ if (!open_dset_real(s, &ds->implicit_did, &ds->implicit_sid, DSET_IMPLICIT_NAME)) {
+ printf("open_dset_real() for chunked dataset: implicit index failed\n");
+ TEST_ERROR;
+ }
+
+ if (!open_dset_real(s, &ds->fa_did, &ds->fa_sid, DSET_FA_NAME)) {
+ printf("open_dset_real() for chunked dataset: fa index failed\n");
+ TEST_ERROR;
+ }
+
+ if (!open_dset_real(s, &ds->ea_did, &ds->ea_sid, DSET_EA_NAME)) {
+ printf("open_dset_real() for chunked dataset: ea index failed\n");
+ TEST_ERROR;
+ }
+
+ if (!open_dset_real(s, &ds->bt2_did, &ds->bt2_sid, DSET_BT2_NAME)) {
+ printf("open_dset_real() for chunked dataset: bt2 index failed\n");
+ TEST_ERROR;
+ }
+ }
+
+ return true;
+
+error:
+ return false;
+
+} /* open_dsets() */
+
+/*
+ * Do the real work of opening the dataset.
+ * Verify the dimension sizes are as expected.
+ */
+static bool
+open_dset_real(const state_t *s, hid_t *did, hid_t *sid, const char *name)
+{
+ hsize_t dims[2];
+
+ if ((*did = H5Dopen2(s->file, name, H5P_DEFAULT)) < 0) {
+ printf("H5Dopen dataset failed\n");
+ TEST_ERROR;
+ }
+
+ if ((*sid = H5Dget_space(*did)) < 0) {
+ printf("H5Dget_space failed\n");
+ TEST_ERROR;
+ }
+ if (H5Sget_simple_extent_dims(*sid, dims, NULL) < 0)
+ TEST_ERROR;
+
+ if (!HDstrcmp(name, DSET_COMPACT_NAME)) {
+ if (dims[0] != s->compact_elmts)
+ TEST_ERROR;
+ }
+ else { /* contiguous or chunked dataset */
+ if (dims[0] != s->rows)
+ TEST_ERROR;
+ if (dims[1] != s->cols)
+ TEST_ERROR;
+ }
+
+ return true;
+
+error:
+ H5E_BEGIN_TRY
+ {
+ H5Dclose(*did);
+ H5Dclose(*sid);
+ }
+ H5E_END_TRY;
+
+ return false;
+} /* open_dset_real() */
+
+/*
+ * Close all the datasets and dataspaces as specified.
+ */
+static bool
+close_dsets(const dsets_state_t *ds)
+{
+ if (!close_dset_real(ds->compact_did, ds->compact_sid)) {
+ printf("H5Dclose compact dataset failed\n");
+ TEST_ERROR;
+ }
+
+ if (!close_dset_real(ds->contig_did, ds->contig_sid)) {
+ printf("H5Dclose contiguous dataset failed\n");
+ TEST_ERROR;
+ }
+
+ if (!close_dset_real(ds->single_did, ds->single_sid)) {
+ printf("H5Dclose chunked dataset: single index failed\n");
+ TEST_ERROR;
+ }
+
+ if (!close_dset_real(ds->implicit_did, ds->implicit_sid)) {
+ printf("H5Dclose chunked dataset: implicit index failed\n");
+ TEST_ERROR;
+ }
+
+ if (!close_dset_real(ds->fa_did, ds->fa_sid)) {
+ printf("H5Dclose chunked dataset: fa index failed\n");
+ TEST_ERROR;
+ }
+
+ if (!close_dset_real(ds->ea_did, ds->ea_sid)) {
+ printf("H5Dclose chunked dataset: ea index failed\n");
+ TEST_ERROR;
+ }
+
+ if (!close_dset_real(ds->bt2_did, ds->bt2_sid)) {
+ printf("H5Dclose chunked dataset: bt2 index failed\n");
+ TEST_ERROR;
+ }
+
+ return true;
+
+error:
+ return false;
+
+} /* close_dsets() */
+
+/*
+ * Do the real work of closing the dataset.
+ */
+static bool
+close_dset_real(hid_t did, hid_t sid)
+{
+ if (did != badhid && H5Dclose(did) < 0) {
+ printf("H5Dclose dataset failed\n");
+ TEST_ERROR;
+ }
+
+ if (sid != badhid && H5Sclose(sid) < 0) {
+ printf("H5Sclose dataspace for dataset failed\n");
+ TEST_ERROR;
+ }
+
+ return true;
+
+error:
+ H5E_BEGIN_TRY
+ {
+ H5Dclose(did);
+ H5Sclose(sid);
+ }
+ H5E_END_TRY;
+
+ return false;
+} /* close_dset_real() */
+
+/*
+ * Writer
+ */
+
+/*
+ * Perform writes for contiguous and chunked datasets:
+ * --SEQ_WRITE: sequential writes
+ * --RANDOM_WRITE: random writes
+ * --HYPER_WRITE: hyperslab writes
+ * --MODIFY_DATA: raw data modifications
+ */
+static bool
+write_dset_contig_chunked(state_t *s, dsets_state_t *ds, H5F_vfd_swmr_config_t *config, np_state_t *np)
+{
+ unsigned step;
+ bool result;
+
+ HDassert(s->contig || s->chunked);
+
+ /* Perform sequential writes for contiguous and/or chunked datasets */
+ if (s->swrites) {
+
+ for (step = 0; (step < s->swrites && step < (s->rows * s->cols)); step++) {
+ dbgf(2, "Sequential writes %u to dataset\n", step);
+
+ result = dsets_action(SEQ_WRITE, s, ds, step);
+
+ if (s->use_np && !np_writer(result, step, s, np, config)) {
+ printf("np_writer() for sequential writes failed\n");
+ TEST_ERROR;
+ }
+ }
+ }
+
+ /* Perform random writes for contiguous and/or chunked datasets */
+ if (s->rwrites) {
+ unsigned newstep;
+
+ /* Set up random seed which will be the same for both writer and reader */
+ HDsrandom(RANDOM_SEED);
+
+ for (step = 0; (step < s->rwrites && step < (s->rows * s->cols)); step++) {
+ dbgf(2, "Random writes %u to dataset\n", step);
+
+ newstep = (unsigned int)HDrandom() % (s->rows * s->cols);
+ printf("Random step is %u\n", newstep);
+ result = dsets_action(RANDOM_WRITE, s, ds, newstep);
+
+ if (s->use_np && !np_writer(result, step, s, np, config)) {
+ printf("np_writer() for random writes failed\n");
+ TEST_ERROR;
+ }
+ }
+ }
+
+ /* Perform hyperslab writes for contiguous and/or chunked datasets */
+ if (s->lwrites) {
+ unsigned k;
+
+ for (step = 0, k = 0; (step < s->lwrites && k < (s->rows * s->cols)); step++, k += s->cols) {
+ dbgf(2, "Hyperslab writes %u to dataset\n", step);
+
+ result = dsets_action(HYPER_WRITE, s, ds, k);
+
+ if (s->use_np && !np_writer(result, step, s, np, config)) {
+ printf("np_writer() for hyperslab writes failed\n");
+ TEST_ERROR;
+ }
+ }
+ }
+
+ /* Perform raw data modifications for contiguous and/or chunked datasets */
+ if (s->wwrites) {
+
+ for (step = 0; (step < s->wwrites && step < (s->rows * s->cols)); step++) {
+ dbgf(2, "Modify raw data %u to dataset\n", step);
+
+ result = dsets_action(MODIFY_DATA, s, ds, step);
+
+ if (s->use_np && !np_writer(result, step, s, np, config)) {
+ printf("np_writer() for modify raw data failed\n");
+ TEST_ERROR;
+ }
+ }
+ }
+
+ return true;
+
+error:
+ return false;
+
+} /* write_dset_contig_chunked() */
+
+/*
+ * Perform the "action" for each of the datasets specified on the command line:
+ * SEQ_WRITE: perform `which` sequential write
+ * RANDOM_WRITE: perform `which` random write
+ * HYPER_WRITE: perform `which` hyperslab write
+ * MODIFY_DATA: perform `which` raw data modification
+ */
+static bool
+dsets_action(unsigned action, const state_t *s, const dsets_state_t *ds, unsigned which)
+{
+ hsize_t start[2];
+ hsize_t stride[2];
+ hsize_t count[2];
+ hsize_t block[2];
+ hid_t mem_sid;
+ unsigned int *wbuf = NULL;
+
+ /* Set up selection, dataspace and data buffer according to the specified action */
+ if (!dset_setup(action, which, s, start, stride, count, block, &mem_sid, &wbuf)) {
+ printf("dset_setup() failed\n");
+ TEST_ERROR;
+ }
+
+ /* Write to the contiguous dataset */
+ if (s->contig) {
+
+ if (!write_dset(ds->contig_did, s->filetype, mem_sid, ds->contig_sid, start, stride, count, block,
+ wbuf)) {
+ printf("H5Dwrite to contiguous dataset failed\n");
+ TEST_ERROR;
+ }
+ }
+
+ /* Write to the 5 chunked datasets */
+ if (s->chunked) {
+
+ if (!write_dset(ds->single_did, s->filetype, mem_sid, ds->single_sid, start, stride, count, block,
+ wbuf)) {
+ printf("H5Dwrite to chunked dataset: single index dataset failed\n");
+ TEST_ERROR;
+ }
+
+ if (!write_dset(ds->implicit_did, s->filetype, mem_sid, ds->implicit_sid, start, stride, count, block,
+ wbuf)) {
+ printf("H5Dwrite to chunked dataset: implicit index dataset failed\n");
+ TEST_ERROR;
+ }
+
+ if (!write_dset(ds->fa_did, s->filetype, mem_sid, ds->fa_sid, start, stride, count, block, wbuf)) {
+ printf("H5Dwrite to chunked dataset: fa index dataset failed\n");
+ TEST_ERROR;
+ }
+
+ if (!write_dset(ds->ea_did, s->filetype, mem_sid, ds->ea_sid, start, stride, count, block, wbuf)) {
+ printf("H5Dwrite to chunked dataset: ea index dataset failed\n");
+ TEST_ERROR;
+ }
+
+ if (!write_dset(ds->bt2_did, s->filetype, mem_sid, ds->bt2_sid, start, stride, count, block, wbuf)) {
+ printf("H5Dwrite to chunked dataset: bt2 index dataset failed\n");
+ TEST_ERROR;
+ }
+ }
+
+ if (wbuf)
+ HDfree(wbuf);
+ return true;
+
+error:
+ if (wbuf)
+ HDfree(wbuf);
+ return false;
+
+} /* dsets_action() */
+
+/*
+ * Set up selection info: start, stride, count, block
+ * Set up the memory dataspace
+ * Initialize the data buffer
+ */
+static bool
+dset_setup(unsigned action, unsigned which, const state_t *s, hsize_t *start, hsize_t *stride, hsize_t *count,
+ hsize_t *block, hid_t *mem_sid, unsigned int **buf)
+{
+ hsize_t mem_dims[1];
+ unsigned kk, i;
+ unsigned int *tmp_buf;
+
+ start[0] = which / s->cols;
+ start[1] = which % s->cols;
+ block[0] = block[1] = 1;
+
+ /* For SEQ_WRITE, RANDOM_WRITE, MODIFY_DATA: writing 1 element at a time */
+ /* For HYPER_WRITE: writing 1 row at a time: selecting every other element per row */
+ switch (action) {
+ case SEQ_WRITE:
+ case RANDOM_WRITE:
+ case MODIFY_DATA:
+ count[0] = count[1] = 1;
+ stride[0] = stride[1] = 1;
+ mem_dims[0] = 1;
+ *mem_sid = H5Screate_simple(1, mem_dims, NULL);
+ break;
+
+ case HYPER_WRITE:
+ count[0] = 1;
+ count[1] = MAX(1, s->cols / 2);
+ stride[0] = 1;
+ stride[1] = 2;
+
+ mem_dims[0] = count[1];
+ *mem_sid = H5Screate_simple(1, mem_dims, NULL);
+ break;
+
+ default:
+ HDassert(0 && "Unknown action?!?");
+ } /* end switch */
+
+ /* Allocating the buffer for writing */
+ if ((tmp_buf = HDmalloc(count[1] * sizeof(unsigned int))) == NULL) {
+ printf("HDmalloc failed\n");
+ TEST_ERROR;
+ }
+
+ /* Initialize the data in the buffer */
+ switch (action) {
+ case SEQ_WRITE:
+ tmp_buf[0] = which + 1;
+ break;
+
+ case RANDOM_WRITE:
+ tmp_buf[0] = 777;
+ break;
+
+ case MODIFY_DATA:
+ tmp_buf[0] = 999;
+ break;
+
+ case HYPER_WRITE:
+ kk = which + 1;
+ for (i = 0; i < count[1]; i++) {
+ tmp_buf[i] = kk;
+ kk += 2;
+ }
+
+ break;
+
+ default:
+ HDassert(0 && "Unknown action?!?");
+ } /* end switch */
+
+ *buf = tmp_buf;
+ return true;
+
+error:
+ return false;
+
+} /* dset_setup() */
+
+/*
+ * Make the selection and then write to the dataset.
+ */
+static bool
+write_dset(hid_t did, hid_t tid, hid_t mem_sid, hid_t file_sid, hsize_t *start, hsize_t *stride,
+ hsize_t *count, hsize_t *block, unsigned int *buf)
+{
+
+ if (H5Sselect_hyperslab(file_sid, H5S_SELECT_SET, start, stride, count, block) < 0) {
+ printf("H5Sselect to dataset failed\n");
+ TEST_ERROR;
+ }
+
+ if (H5Dwrite(did, tid, mem_sid, file_sid, H5P_DEFAULT, buf) < 0) {
+ printf("H5Dwrite to dataset failed\n");
+ TEST_ERROR;
+ }
+
+ return true;
+
+error:
+ return false;
+
+} /* write_dset() */
+
+/*
+ * Write to whole compact dataset.
+ */
+static bool
+write_dset_compact(const state_t *s, const dsets_state_t *ds)
+{
+ unsigned int *buf = NULL;
+ unsigned i;
+
+ if ((buf = HDmalloc(s->compact_elmts * sizeof(unsigned int))) == NULL) {
+ printf("HDmalloc buffer for compact dataset failed\n");
+ goto error;
+ }
+
+ for (i = 0; i < s->compact_elmts; i++)
+ buf[i] = i + 1;
+
+ if (H5Dwrite(ds->compact_did, s->filetype, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf) < 0) {
+ printf("H5Dwrite to compact dataset failed\n");
+ TEST_ERROR;
+ }
+
+ if (buf)
+ HDfree(buf);
+ return true;
+
+error:
+ if (buf)
+ HDfree(buf);
+ return false;
+
+} /* write_dset_compact() */
+
+/*
+ * Reader
+ */
+
+/*
+ * Verify writes for contiguous and chunked datasets:
+ * --SEQ_WRITE: sequential writes
+ * --RANDOM_WRITE: random writes
+ * --HYPER_WRITE: hyperslab writes
+ * --MODIFY_DATA: raw data modifications
+ */
+static bool
+verify_write_dset_contig_chunked(state_t *s, dsets_state_t *ds, H5F_vfd_swmr_config_t *config, np_state_t *np)
+{
+ unsigned step;
+ bool result;
+
+ HDassert(s->contig || s->chunked);
+
+ /* Start verifying sequential writes for contiguous and/or chunked datasets */
+ if (s->swrites) {
+
+ for (step = 0; (step < s->swrites && step < (s->rows * s->cols)); step++) {
+ dbgf(2, "Verify sequential writes %u to dataset\n", step);
+
+ if (s->use_np && !np_confirm_verify_notify(np->fd_writer_to_reader, step, s, np)) {
+ printf("np_confirm_verify_notify() verify/notify not in sync failed\n");
+ TEST_ERROR;
+ }
+
+ /* Wait for a few ticks for the update to happen */
+ decisleep(config->tick_len * s->update_interval);
+
+ result = verify_dsets_action(SEQ_WRITE, s, ds, step);
+
+ if (s->use_np && !np_reader(result, step, s, np)) {
+ printf("np_reader() for verifying addition failed\n");
+ TEST_ERROR;
+ }
+ }
+ }
+
+ /* Start verifying random writes for contiguous and/or chunked datasets */
+ if (s->rwrites) {
+ unsigned newstep;
+
+ /* Set up random seed which will be the same for both writer and reader */
+ HDsrandom(RANDOM_SEED);
+
+ for (step = 0; (step < s->rwrites && step < (s->rows * s->cols)); step++) {
+ dbgf(2, "Verify random writes %u to dataset\n", step);
+
+ newstep = (unsigned int)HDrandom() % (s->rows * s->cols);
+ printf("Random step is %u\n", newstep);
+
+ if (s->use_np && !np_confirm_verify_notify(np->fd_writer_to_reader, step, s, np)) {
+ printf("np_confirm_verify_notify() verify/notify not in sync failed\n");
+ TEST_ERROR;
+ }
+
+ /* Wait for a few ticks for the update to happen */
+ decisleep(config->tick_len * s->update_interval);
+
+ result = verify_dsets_action(RANDOM_WRITE, s, ds, newstep);
+
+ if (s->use_np && !np_reader(result, step, s, np)) {
+ printf("np_reader() for verifying addition failed\n");
+ TEST_ERROR;
+ }
+ }
+ }
+
+ /* Start verifying hyperslab writes for contiguous and/or chunked datasets */
+ if (s->lwrites) {
+ unsigned k;
+
+ for (step = 0, k = 0; (step < s->lwrites && k < (s->rows * s->cols)); step++, k += s->cols) {
+ dbgf(2, "Verify hyperslab writes %u to dataset\n", step);
+
+ if (s->use_np && !np_confirm_verify_notify(np->fd_writer_to_reader, step, s, np)) {
+ printf("np_confirm_verify_notify() verify/notify not in sync failed\n");
+ TEST_ERROR;
+ }
+
+ /* Wait for a few ticks for the update to happen */
+ decisleep(config->tick_len * s->update_interval);
+
+ result = verify_dsets_action(HYPER_WRITE, s, ds, k);
+
+ if (s->use_np && !np_reader(result, step, s, np)) {
+ printf("np_reader() for verifying addition failed\n");
+ TEST_ERROR;
+ }
+ }
+ }
+
+ /* Start verifying raw data modifications for contiguous and/or chunked datasets */
+ if (s->wwrites) {
+
+ for (step = 0; (step < s->wwrites && step < (s->rows * s->cols)); step++) {
+ dbgf(2, "Verify raw data modification %u to dataset\n", step);
+
+ if (s->use_np && !np_confirm_verify_notify(np->fd_writer_to_reader, step, s, np)) {
+ printf("np_confirm_verify_notify() verify/notify not in sync failed\n");
+ TEST_ERROR;
+ }
+
+ /* Wait for a few ticks for the update to happen */
+ decisleep(config->tick_len * s->update_interval);
+
+ result = verify_dsets_action(MODIFY_DATA, s, ds, step);
+
+ if (s->use_np && !np_reader(result, step, s, np)) {
+ printf("np_reader() for verifying addition failed\n");
+ TEST_ERROR;
+ }
+ }
+ }
+
+ return true;
+
+error:
+ return false;
+
+} /* verify_write_dset_contig_chunked() */
+
+/*
+ * Verify the data read from each of the datasets specified on the command line
+ * according to "action":
+ * SEQ_WRITE: `which` sequential write
+ * RANDOM_WRITE: `which` random write
+ * HYPER_WRITE: `which` hyperslab write
+ * MODIFY_DATA: `which` raw data modification
+ */
+static bool
+verify_dsets_action(unsigned action, const state_t *s, const dsets_state_t *ds, unsigned which)
+{
+ hsize_t start[2];
+ hsize_t stride[2];
+ hsize_t count[2];
+ hsize_t block[2];
+ hid_t mem_sid;
+ unsigned int *vbuf = NULL;
+
+ /* Set up selection, dataspace and data buffer according to the specified action */
+ if (!dset_setup(action, which, s, start, stride, count, block, &mem_sid, &vbuf)) {
+ printf("dset_setup() failed\n");
+ TEST_ERROR;
+ }
+
+ /* Verify the data read for the contiguous dataset */
+ if (s->contig) {
+ if (!verify_read_dset(ds->contig_did, s->filetype, mem_sid, ds->contig_sid, start, stride, count,
+ block, vbuf)) {
+ printf("H5Dwrite to contiguous dataset failed\n");
+ TEST_ERROR;
+ }
+ }
+
+ /* Verify the data read for the chunked datasets */
+ if (s->chunked) {
+
+ if (!verify_read_dset(ds->single_did, s->filetype, mem_sid, ds->single_sid, start, stride, count,
+ block, vbuf)) {
+ printf("H5Dwrite to chunked dataset: single index dataset failed\n");
+ TEST_ERROR;
+ }
+
+ if (!verify_read_dset(ds->implicit_did, s->filetype, mem_sid, ds->implicit_sid, start, stride, count,
+ block, vbuf)) {
+ printf("H5Dwrite to chunked dataset: implicit index dataset failed\n");
+ TEST_ERROR;
+ }
+
+ if (!verify_read_dset(ds->fa_did, s->filetype, mem_sid, ds->fa_sid, start, stride, count, block,
+ vbuf)) {
+ printf("H5Dwrite to chunked dataset: fa index dataset failed\n");
+ TEST_ERROR;
+ }
+
+ if (!verify_read_dset(ds->ea_did, s->filetype, mem_sid, ds->ea_sid, start, stride, count, block,
+ vbuf)) {
+ printf("H5Dwrite to chunked dataset: ea index dataset failed\n");
+ TEST_ERROR;
+ }
+
+ if (!verify_read_dset(ds->bt2_did, s->filetype, mem_sid, ds->bt2_sid, start, stride, count, block,
+ vbuf)) {
+ printf("H5Dwrite to chunked dataset: bt2 index dataset failed\n");
+ TEST_ERROR;
+ }
+ }
+
+ if (vbuf)
+ HDfree(vbuf);
+
+ return true;
+
+error:
+ if (vbuf)
+ HDfree(vbuf);
+
+ return false;
+
+} /* verify_dsets_action() */
+
+/*
+ * Verify the data read from the dataset is as expected.
+ * `vbuf` contains the data expected from the read.
+ */
+static bool
+verify_read_dset(hid_t did, hid_t tid, hid_t mem_sid, hid_t file_sid, hsize_t *start, hsize_t *stride,
+ hsize_t *count, hsize_t *block, unsigned int *vbuf)
+{
+ unsigned int *rbuf = NULL;
+ unsigned i;
+
+ /* Refresh the dataset */
+ if (H5Drefresh(did) < 0) {
+ printf("H5Drefresh dataset failed\n");
+ TEST_ERROR;
+ }
+
+ /* Allocate the buffer for reading */
+ if ((rbuf = HDmalloc(count[1] * sizeof(unsigned int))) == NULL) {
+ printf("HDmalloc failed\n");
+ TEST_ERROR;
+ }
+
+ /* Make the selection the file dataspace */
+ if (H5Sselect_hyperslab(file_sid, H5S_SELECT_SET, start, stride, count, block) < 0) {
+ printf("H5Sselect to dataset failed\n");
+ TEST_ERROR;
+ }
+
+ /* Read the data from the dataset into `rbuf` */
+ if (H5Dread(did, tid, mem_sid, file_sid, H5P_DEFAULT, rbuf) < 0) {
+ printf("H5Dread from dataset failed\n");
+ TEST_ERROR;
+ }
+
+ /* Verify the data read in `rbuf` is as `vbuf` */
+ for (i = 0; i < count[1]; i++)
+ if (rbuf[i] != vbuf[i])
+ TEST_ERROR;
+
+ if (rbuf)
+ HDfree(rbuf);
+
+ return true;
+
+error:
+ if (rbuf)
+ HDfree(rbuf);
+ return false;
+
+} /* verify_read_dset() */
+
+/*
+ * Verify that the data read from the compact dataset is as unexpected.
+ */
+static bool
+verify_read_dset_compact(const state_t *s, const dsets_state_t *ds)
+{
+ unsigned int *rbuf;
+ unsigned i;
+
+ if ((rbuf = HDmalloc(s->compact_elmts * sizeof(unsigned int))) == NULL) {
+ printf("HDmalloc buffer for compact dataset failed\n");
+ goto error;
+ }
+
+ if (H5Dread(ds->compact_did, s->filetype, H5S_ALL, H5S_ALL, H5P_DEFAULT, rbuf) < 0) {
+ printf("H5Dwrite to compact dataset failed\n");
+ TEST_ERROR;
+ }
+
+ for (i = 0; i < s->compact_elmts; i++)
+ if (rbuf[i] != (i + 1)) {
+ printf("Invalid value for compact dataset element\n");
+ TEST_ERROR;
+ }
+
+ if (rbuf)
+ HDfree(rbuf);
+
+ return true;
+
+error:
+ if (rbuf)
+ HDfree(rbuf);
+ return false;
+
+} /* verify_read_dset_compact() */
+
+/*
+ * Named pipes handling
+ */
+
+/*
+ * Initialize the named pipes for test synchronization.
+ */
+static bool
+np_init(np_state_t *np, bool writer)
+{
+ *np = NP_INITIALIZER;
+
+ /*
+ * Use two named pipes(FIFO) to coordinate the writer and reader for
+ * two-way communication so that the two sides can move forward together.
+ * One is for the writer to write to the reader.
+ * The other one is for the reader to signal the writer.
+ */
+ if (writer) {
+ /* If the named pipes are present at the start of the test, remove them */
+ if (HDaccess(np->fifo_writer_to_reader, F_OK) == 0)
+ if (HDremove(np->fifo_writer_to_reader) != 0) {
+ printf("HDremove fifo_writer_to_reader failed\n");
+ TEST_ERROR;
+ }
+
+ if (HDaccess(np->fifo_reader_to_writer, F_OK) == 0)
+ if (HDremove(np->fifo_reader_to_writer) != 0) {
+ printf("HDremove fifo_reader_to_writer failed\n");
+ TEST_ERROR;
+ }
+
+ /* Writer creates two named pipes(FIFO) */
+ if (HDmkfifo(np->fifo_writer_to_reader, 0600) < 0) {
+ printf("HDmkfifo fifo_writer_to_reader failed\n");
+ TEST_ERROR;
+ }
+
+ if (HDmkfifo(np->fifo_reader_to_writer, 0600) < 0) {
+ printf("HDmkfifo fifo_reader_to_writer failed\n");
+ TEST_ERROR;
+ }
+ }
+
+ /* Both the writer and reader open the pipes */
+ if ((np->fd_writer_to_reader = HDopen(np->fifo_writer_to_reader, O_RDWR)) < 0) {
+ printf("HDopen fifo_writer_to_reader failed\n");
+ TEST_ERROR;
+ }
+
+ if ((np->fd_reader_to_writer = HDopen(np->fifo_reader_to_writer, O_RDWR)) < 0) {
+ printf("HDopen fifo_reader_to_writer failed\n");
+ TEST_ERROR;
+ }
+
+ return true;
+
+error:
+ return false;
+
+} /* np_init() */
+
+/*
+ * Close the named pipes.
+ */
+static bool
+np_close(np_state_t *np, bool writer)
+{
+ /* Both the writer and reader close the named pipes */
+ if (HDclose(np->fd_writer_to_reader) < 0) {
+ printf("HDclose fd_writer_to_reader failed\n");
+ TEST_ERROR;
+ }
+
+ if (HDclose(np->fd_reader_to_writer) < 0) {
+ printf("HDclose fd_reader_to_writer failed\n");
+ TEST_ERROR;
+ }
+
+ /* Reader finishes last and deletes the named pipes */
+ if (!writer) {
+ if (HDremove(np->fifo_writer_to_reader) != 0) {
+ printf("HDremove fifo_writer_to_reader failed\n");
+ TEST_ERROR;
+ }
+
+ if (HDremove(np->fifo_reader_to_writer) != 0) {
+ printf("HDremove fifo_reader_to_writer failed\n");
+ TEST_ERROR;
+ }
+ }
+ return true;
+
+error:
+ return false;
+} /* np_close() */
+
+/*
+ * Writer synchronization depending on the result from the attribute action performed.
+ */
+static bool
+np_writer(bool result, unsigned step, const state_t *s, np_state_t *np, H5F_vfd_swmr_config_t *config)
+{
+ unsigned int i;
+
+ /* The action fails */
+ if (!result) {
+ printf("attribute action failed\n");
+ H5_FAILED();
+ AT();
+
+ /* At communication interval, notify the reader about the failure and quit */
+ if (step % s->csteps == 0) {
+ np->notify = -1;
+ HDwrite(np->fd_writer_to_reader, &np->notify, sizeof(int));
+ goto error;
+ }
+ /* The action succeeds */
+ }
+ else {
+ /* At communication interval, notify the reader and wait for its response */
+ if (step % s->csteps == 0) {
+ /* Bump up the value of notify to tell the reader to start reading */
+ np->notify++;
+ if (HDwrite(np->fd_writer_to_reader, &np->notify, sizeof(int)) < 0) {
+ printf("HDwrite failed\n");
+ TEST_ERROR;
+ }
+
+ /* During the wait, writer makes repeated HDF5 API calls
+ * to trigger EOT at approximately the correct time */
+ for (i = 0; i < config->max_lag + 1; i++) {
+ decisleep(config->tick_len);
+ H5E_BEGIN_TRY
+ {
+ H5Aexists(s->file, "nonexistent");
+ }
+ H5E_END_TRY;
+ }
+
+ /* Handshake between writer and reader */
+ if (!np_confirm_verify_notify(np->fd_reader_to_writer, step, s, np)) {
+ printf("np_confirm_verify_notify() verify/notify not in sync failed\n");
+ TEST_ERROR;
+ }
+ }
+ }
+ return true;
+
+error:
+ return false;
+
+} /* np_writer() */
+
+/*
+ *
+ * Reader synchronization depending on the result from the verification.
+ */
+static bool
+np_reader(bool result, unsigned step, const state_t *s, np_state_t *np)
+{
+ /* The verification fails */
+ if (!result) {
+ printf("verify action failed\n");
+ H5_FAILED();
+ AT();
+
+ /* At communication interval, tell the writer about the failure and exit */
+ if (step % s->csteps == 0) {
+ np->notify = -1;
+ HDwrite(np->fd_reader_to_writer, &np->notify, sizeof(int));
+ goto error;
+ }
+ /* The verification succeeds */
+ }
+ else {
+ if (step % s->csteps == 0) {
+ /* Send back the same notify value for acknowledgement:
+ * --inform the writer to move to the next step */
+ if (HDwrite(np->fd_reader_to_writer, &np->notify, sizeof(int)) < 0) {
+ printf("HDwrite failed\n");
+ TEST_ERROR;
+ }
+ }
+ }
+ return true;
+
+error:
+ return false;
+
+} /* np_reader() */
+
+/*
+ * Handshake between writer and reader:
+ * Confirm `verify` is same as `notify`.
+ */
+static bool
+np_confirm_verify_notify(int fd, unsigned step, const state_t *s, np_state_t *np)
+{
+ if (step % s->csteps == 0) {
+ np->verify++;
+ if (HDread(fd, &np->notify, sizeof(int)) < 0) {
+ printf("HDread failed\n");
+ TEST_ERROR;
+ }
+
+ if (np->notify == -1) {
+ printf("reader/writer failed to verify\n");
+ TEST_ERROR;
+ }
+
+ if (np->notify != np->verify) {
+ printf("received message %d, expecting %d\n", np->notify, np->verify);
+ TEST_ERROR;
+ }
+ }
+
+ return true;
+
+error:
+ return false;
+} /* np_confirm_verify_notify() */
+
+/*
+ * Main
+ */
+int
+main(int argc, char **argv)
+{
+ hid_t fapl, fcpl;
+ unsigned step;
+ bool writer;
+ state_t s;
+ const char * personality;
+ H5F_vfd_swmr_config_t config;
+ np_state_t np;
+ dsets_state_t ds;
+ bool result;
+
+ if (!state_init(&s, argc, argv)) {
+ printf("state_init() failed\n");
+ TEST_ERROR;
+ }
+
+ personality = HDstrstr(s.progname, "vfd_swmr_dsetops_");
+
+ if (personality != NULL && strcmp(personality, "vfd_swmr_dsetops_writer") == 0)
+ writer = true;
+ else if (personality != NULL && strcmp(personality, "vfd_swmr_dsetops_reader") == 0)
+ writer = false;
+ else {
+ printf("unknown personality, expected vfd_swmr_dsetops_{reader,writer}\n");
+ TEST_ERROR;
+ }
+
+ /* config, tick_len, max_lag, writer, flush_raw_data, md_pages_reserved, md_file_path */
+ init_vfd_swmr_config(&config, 4, 7, writer, FALSE, 128, "./dsetops-shadow");
+
+ /* use_latest_format, use_vfd_swmr, only_meta_page, config */
+ if ((fapl = vfd_swmr_create_fapl(true, s.use_vfd_swmr, true, &config)) < 0) {
+ printf("vfd_swmr_create_fapl() failed\n");
+ TEST_ERROR;
+ }
+
+ if ((fcpl = H5Pcreate(H5P_FILE_CREATE)) < 0) {
+ printf("H5Pcreate failed\n");
+ TEST_ERROR;
+ }
+
+ if (H5Pset_file_space_strategy(fcpl, H5F_FSPACE_STRATEGY_PAGE, false, 1) < 0) {
+ printf("H5Pset_file_space_strategy failed\n");
+ TEST_ERROR;
+ }
+
+ if (writer) {
+ if ((s.file = H5Fcreate(s.filename, H5F_ACC_TRUNC, fcpl, fapl)) < 0) {
+ printf("H5Fcreate failed\n");
+ TEST_ERROR;
+ }
+
+ if (!create_dsets(&s, &ds)) {
+ printf("create_dsets() failed\n");
+ TEST_ERROR;
+ }
+ }
+ else {
+ if ((s.file = H5Fopen(s.filename, H5F_ACC_RDONLY, fapl)) < 0) {
+ printf("H5Fopen failed\n");
+ TEST_ERROR;
+ }
+ if (!open_dsets(&s, &ds)) {
+ printf("open_dsets() failed\n");
+ TEST_ERROR;
+ }
+ }
+
+ /* Initiailze named pipes */
+ if (s.use_np && !np_init(&np, writer)) {
+ printf("np_init() failed\n");
+ TEST_ERROR;
+ }
+
+ if (writer) {
+
+ /* Perform writes to the whole compact dataset */
+ if (s.compact && s.compact_write) {
+ dbgf(2, "Writes all to compact dataset\n");
+
+ result = write_dset_compact(&s, &ds);
+
+ if (s.use_np && !np_writer(result, 0, &s, &np, &config)) {
+ printf("np_writer() for addition failed\n");
+ TEST_ERROR;
+ }
+ }
+
+ if (s.contig || s.chunked) {
+ /* Perform writes for contiguous and/or chunked datasets */
+ if (!write_dset_contig_chunked(&s, &ds, &config, &np)) {
+ printf("write_dset_contig_chunked() failed\n");
+ TEST_ERROR;
+ }
+ }
+ }
+ else {
+
+ /* Start verifying data written to the compact dataset */
+ if (s.compact && s.compact_write) {
+ dbgf(2, "Verify writes to compact dataset\n");
+
+ if (s.use_np && !np_confirm_verify_notify(np.fd_writer_to_reader, 0, &s, &np)) {
+ printf("np_confirm_verify_notify() verify/notify not in sync failed\n");
+ TEST_ERROR;
+ }
+ /* Wait for a few ticks for the update to happen */
+ decisleep(config.tick_len * s.update_interval);
+
+ result = verify_read_dset_compact(&s, &ds);
+
+ if (s.use_np && !np_reader(result, 0, &s, &np)) {
+ printf("np_reader() for verifying addition failed\n");
+ TEST_ERROR;
+ }
+ }
+
+ if (s.contig || s.chunked) {
+
+ /* Verify writes for contiguous and/or chunked datasets */
+ if (!verify_write_dset_contig_chunked(&s, &ds, &config, &np)) {
+ printf("verify_write_dset_contig_chunked() failed\n");
+ TEST_ERROR;
+ }
+ }
+ }
+
+ if (!close_dsets(&ds)) {
+ printf("close_dsets() failed\n");
+ TEST_ERROR;
+ }
+
+ if (H5Pclose(fapl) < 0) {
+ printf("H5Pclose failed\n");
+ TEST_ERROR;
+ }
+
+ if (H5Pclose(fcpl) < 0) {
+ printf("H5Pclose failed\n");
+ TEST_ERROR;
+ }
+
+ if (H5Fclose(s.file) < 0) {
+ printf("H5Fclose failed\n");
+ TEST_ERROR;
+ }
+
+ if (s.use_np && !np_close(&np, writer)) {
+ printf("np_close() failed\n");
+ TEST_ERROR;
+ }
+
+ return EXIT_SUCCESS;
+
+error:
+ H5E_BEGIN_TRY
+ {
+ H5Pclose(fapl);
+ H5Pclose(fcpl);
+ H5Fclose(s.file);
+ }
+ H5E_END_TRY;
+
+ if (s.use_np && np.fd_writer_to_reader >= 0)
+ HDclose(np.fd_writer_to_reader);
+
+ if (s.use_np && np.fd_reader_to_writer >= 0)
+ HDclose(np.fd_reader_to_writer);
+
+ if (s.use_np && !writer) {
+ HDremove(np.fifo_writer_to_reader);
+ HDremove(np.fifo_reader_to_writer);
+ }
+
+ return EXIT_FAILURE;
+} /* main */
+
+#else /* H5_HAVE_WIN32_API */
+
+int
+main(void)
+{
+ HDfprintf(stderr, "Non-POSIX platform. Skipping.\n");
+ return EXIT_SUCCESS;
+} /* end main() */
+
+#endif /* H5_HAVE_WIN32_API */
diff --git a/test/vol.c b/test/vol.c
index f18fd61..c7d007e 100644
--- a/test/vol.c
+++ b/test/vol.c
@@ -283,7 +283,6 @@ error:
}
H5E_END_TRY;
return FAIL;
-
} /* end test_vol_registration() */
/*-------------------------------------------------------------------------
@@ -387,8 +386,8 @@ test_basic_file_operation(const char *env_h5_drvr)
TEST_ERROR;
/* Can't compare VFD properties for split / multi / family VFDs */
- if ((hbool_t)(HDstrcmp(env_h5_drvr, "split") && HDstrcmp(env_h5_drvr, "multi") &&
- HDstrcmp(env_h5_drvr, "family"))) {
+ if ((hbool_t)(HDstrcmp(env_h5_drvr, "split") != 0 && HDstrcmp(env_h5_drvr, "multi") != 0 &&
+ HDstrcmp(env_h5_drvr, "family") != 0)) {
/* H5Fget_access_plist */
if ((fapl_id2 = H5Fget_access_plist(fid)) < 0)
TEST_ERROR;
@@ -409,8 +408,8 @@ test_basic_file_operation(const char *env_h5_drvr)
TEST_ERROR;
/* Can't retrieve VFD handle for split / multi / family VFDs */
- if ((hbool_t)(HDstrcmp(env_h5_drvr, "split") && HDstrcmp(env_h5_drvr, "multi") &&
- HDstrcmp(env_h5_drvr, "family"))) {
+ if ((hbool_t)(HDstrcmp(env_h5_drvr, "split") != 0 && HDstrcmp(env_h5_drvr, "multi") != 0 &&
+ HDstrcmp(env_h5_drvr, "family") != 0)) {
/* H5Fget_vfd_handle */
if (H5Fget_vfd_handle(fid, H5P_DEFAULT, &os_file_handle) < 0)
TEST_ERROR;
@@ -449,8 +448,8 @@ test_basic_file_operation(const char *env_h5_drvr)
TEST_ERROR;
/* Can't compare VFD properties for split / multi / family VFDs */
- if ((hbool_t)(HDstrcmp(env_h5_drvr, "split") && HDstrcmp(env_h5_drvr, "multi") &&
- HDstrcmp(env_h5_drvr, "family"))) {
+ if ((hbool_t)(HDstrcmp(env_h5_drvr, "split") != 0 && HDstrcmp(env_h5_drvr, "multi") != 0 &&
+ HDstrcmp(env_h5_drvr, "family") != 0)) {
/* H5Fget_access_plist */
if ((fapl_id2 = H5Fget_access_plist(fid)) < 0)
TEST_ERROR;
@@ -464,8 +463,8 @@ test_basic_file_operation(const char *env_h5_drvr)
TEST_ERROR;
/* Can't compare VFD properties for split / multi / family VFDs */
- if ((hbool_t)(HDstrcmp(env_h5_drvr, "split") && HDstrcmp(env_h5_drvr, "multi") &&
- HDstrcmp(env_h5_drvr, "family"))) {
+ if ((hbool_t)(HDstrcmp(env_h5_drvr, "split") != 0 && HDstrcmp(env_h5_drvr, "multi") != 0 &&
+ HDstrcmp(env_h5_drvr, "family") != 0)) {
/* H5Fget_access_plist */
if ((fapl_id2 = H5Fget_access_plist(fid_reopen)) < 0)
TEST_ERROR;
@@ -938,10 +937,14 @@ test_basic_object_operation(void)
if (H5Oget_info3(fid, &object_info, H5O_INFO_ALL) < 0)
TEST_ERROR;
+ //! [H5Oget_info_by_name3_snip]
+
/* H5Oget_info_by_name */
if (H5Oget_info_by_name3(fid, NATIVE_VOL_TEST_GROUP_NAME, &object_info, H5O_INFO_ALL, H5P_DEFAULT) < 0)
TEST_ERROR;
+ //! [H5Oget_info_by_name3_snip]
+
/* H5Oexists_by_name */
if (H5Oexists_by_name(fid, NATIVE_VOL_TEST_GROUP_NAME, H5P_DEFAULT) != TRUE)
TEST_ERROR;
diff --git a/testpar/t_2Gio.c b/testpar/t_2Gio.c
index 5a7936b..d5b9038 100644
--- a/testpar/t_2Gio.c
+++ b/testpar/t_2Gio.c
@@ -578,8 +578,9 @@ MpioTest2G(MPI_Comm comm)
MPI_Comm_rank(comm, &mpi_rank);
if (mpi_rank == 0) {
- HDprintf("Using %d process on dataset shape [%llu, %llu, %llu]\n", mpi_size, shape[0], shape[1],
- shape[2]);
+ HDprintf("Using %d process on dataset shape "
+ "[%" PRIuHSIZE ", %" PRIuHSIZE ", %" PRIuHSIZE "]\n",
+ mpi_size, shape[0], shape[1], shape[2]);
}
/*
@@ -606,7 +607,7 @@ MpioTest2G(MPI_Comm comm)
tot_size_bytes *= shape[i];
}
if (mpi_rank == 0) {
- HDprintf("Dataset of %llu bytes\n", tot_size_bytes);
+ HDprintf("Dataset of %zu bytes\n", tot_size_bytes);
}
filespace = H5Screate_simple(3, shape, NULL);
VRFY((filespace >= 0), "H5Screate_simple succeeded");
@@ -681,7 +682,7 @@ MpioTest2G(MPI_Comm comm)
H5Fclose(file_id);
free(data);
- HDprintf("Proc %d - MpioTest2G test succeeded\n", mpi_rank, data_size_bytes);
+ HDprintf("Proc %d - MpioTest2G test succeeded\n", mpi_rank);
if (mpi_rank == 0)
HDremove(FILENAME[1]);
@@ -3861,9 +3862,7 @@ actual_io_mode_tests(void)
* Programmer: Jonathan Kim
* Date: Aug, 2012
*/
-#define DSET_NOCOLCAUSE "nocolcause"
-#define NELM 2
-#define FILE_EXTERNAL "nocolcause_extern.data"
+#define FILE_EXTERNAL "nocolcause_extern.data"
static void
test_no_collective_cause_mode(int selection_mode)
{
@@ -4422,9 +4421,9 @@ no_collective_cause_tests(void)
test_no_collective_cause_mode(TEST_NOT_CONTIGUOUS_OR_CHUNKED_DATASET_COMPACT);
test_no_collective_cause_mode(TEST_NOT_CONTIGUOUS_OR_CHUNKED_DATASET_EXTERNAL);
#ifdef LATER /* fletcher32 */
- /* TODO: use this instead of below TEST_FILTERS_READ when H5Dcreate and
- * H5Dwrite is ready for mpio + filter feature.
- */
+ /* TODO: use this instead of below TEST_FILTERS_READ when H5Dcreate and
+ * H5Dwrite is ready for mpio + filter feature.
+ */
/* test_no_collective_cause_mode (TEST_FILTERS); */
test_no_collective_cause_mode_filter(TEST_FILTERS_READ);
#endif /* LATER */
diff --git a/testpar/t_bigio.c b/testpar/t_bigio.c
index 60faf68..ed99fc4 100644
--- a/testpar/t_bigio.c
+++ b/testpar/t_bigio.c
@@ -131,12 +131,13 @@ point_set(hsize_t start[], hsize_t count[], hsize_t stride[], hsize_t block[], s
}
if (VERBOSE_MED) {
- HDprintf("start[]=(%lu, %lu), count[]=(%lu, %lu), stride[]=(%lu, %lu), block[]=(%lu, %lu), total "
- "datapoints=%lu\n",
- (unsigned long)start[0], (unsigned long)start[1], (unsigned long)count[0],
- (unsigned long)count[1], (unsigned long)stride[0], (unsigned long)stride[1],
- (unsigned long)block[0], (unsigned long)block[1],
- (unsigned long)(block[0] * block[1] * count[0] * count[1]));
+ HDprintf("start[]=(%" PRIuHSIZE ", %" PRIuHSIZE "), "
+ "count[]=(%" PRIuHSIZE ", %" PRIuHSIZE "), "
+ "stride[]=(%" PRIuHSIZE ", %" PRIuHSIZE "), "
+ "block[]=(%" PRIuHSIZE ", %" PRIuHSIZE "), "
+ "total datapoints=%" PRIuHSIZE "\n",
+ start[0], start[1], count[0], count[1], stride[0], stride[1], block[0], block[1],
+ block[0] * block[1] * count[0] * count[1]);
k = 0;
for (i = 0; i < num_points; i++) {
HDprintf("(%d, %d)\n", (int)coords[k], (int)coords[k + 1]);
@@ -157,15 +158,15 @@ dataset_print(hsize_t start[], hsize_t block[], B_DATATYPE *dataset)
/* print the column heading */
HDprintf("%-8s", "Cols:");
for (j = 0; j < block[1]; j++) {
- HDprintf("%3lu ", (unsigned long)(start[1] + j));
+ HDprintf("%3" PRIuHSIZE " ", start[1] + j);
}
HDprintf("\n");
/* print the slab data */
for (i = 0; i < block[0]; i++) {
- HDprintf("Row %2lu: ", (unsigned long)(i + start[0]));
+ HDprintf("Row %2" PRIuHSIZE ": ", i + start[0]);
for (j = 0; j < block[1]; j++) {
- HDprintf("%llu ", *dataptr++);
+ HDprintf("%" PRIuHSIZE " ", *dataptr++);
}
HDprintf("\n");
}
@@ -184,10 +185,11 @@ verify_data(hsize_t start[], hsize_t count[], hsize_t stride[], hsize_t block[],
/* print it if VERBOSE_MED */
if (VERBOSE_MED) {
HDprintf("verify_data dumping:::\n");
- HDprintf("start(%lu, %lu), count(%lu, %lu), stride(%lu, %lu), block(%lu, %lu)\n",
- (unsigned long)start[0], (unsigned long)start[1], (unsigned long)count[0],
- (unsigned long)count[1], (unsigned long)stride[0], (unsigned long)stride[1],
- (unsigned long)block[0], (unsigned long)block[1]);
+ HDprintf("start(%" PRIuHSIZE ", %" PRIuHSIZE "), "
+ "count(%" PRIuHSIZE ", %" PRIuHSIZE "), "
+ "stride(%" PRIuHSIZE ", %" PRIuHSIZE "), "
+ "block(%" PRIuHSIZE ", %" PRIuHSIZE ")\n",
+ start[0], start[1], count[0], count[1], stride[0], stride[1], block[0], block[1]);
HDprintf("original values:\n");
dataset_print(start, block, original);
HDprintf("compared values:\n");
@@ -199,9 +201,10 @@ verify_data(hsize_t start[], hsize_t count[], hsize_t stride[], hsize_t block[],
for (j = 0; j < block[1]; j++) {
if (*dataset != *original) {
if (vrfyerrs++ < MAX_ERR_REPORT || VERBOSE_MED) {
- HDprintf("Dataset Verify failed at [%lu][%lu](row %lu, col %lu): expect %llu, got %llu\n",
- (unsigned long)i, (unsigned long)j, (unsigned long)(i + start[0]),
- (unsigned long)(j + start[1]), *(original), *(dataset));
+ HDprintf("Dataset Verify failed at [%" PRIuHSIZE "][%" PRIuHSIZE "]"
+ "(row %" PRIuHSIZE ", col %" PRIuHSIZE "): "
+ "expect %" PRIuHSIZE ", got %" PRIuHSIZE "\n",
+ i, j, i + start[0], j + start[1], *(original), *(dataset));
}
dataset++;
original++;
@@ -1101,7 +1104,7 @@ static void
single_rank_independent_io(void)
{
if (mpi_rank_g == 0)
- HDprintf("single_rank_independent_io\n");
+ HDprintf("\nSingle Rank Independent I/O\n");
if (MAIN_PROCESS) {
hsize_t dims[] = {LARGE_DIM};
@@ -1220,8 +1223,6 @@ create_faccess_plist(MPI_Comm comm, MPI_Info info, int l_facc_type)
* Programmer: Unknown
* July 12th, 2004
*
- * Modifications:
- *
*-------------------------------------------------------------------------
*/
@@ -1247,7 +1248,7 @@ coll_chunk1(void)
{
const char *filename = FILENAME[0];
if (mpi_rank_g == 0)
- HDprintf("coll_chunk1\n");
+ HDprintf("\nCollective chunk I/O Test #1\n");
coll_chunktest(filename, 1, BYROW_CONT, API_NONE, HYPER, HYPER, OUT_OF_ORDER);
coll_chunktest(filename, 1, BYROW_CONT, API_NONE, HYPER, POINT, OUT_OF_ORDER);
@@ -1300,7 +1301,7 @@ coll_chunk2(void)
{
const char *filename = FILENAME[0];
if (mpi_rank_g == 0)
- HDprintf("coll_chunk2\n");
+ HDprintf("\nCollective chunk I/O Test #2\n");
coll_chunktest(filename, 1, BYROW_DISCONT, API_NONE, HYPER, HYPER, OUT_OF_ORDER);
coll_chunktest(filename, 1, BYROW_DISCONT, API_NONE, HYPER, POINT, OUT_OF_ORDER);
@@ -1326,8 +1327,6 @@ coll_chunk2(void)
* Programmer: Unknown
* July 12th, 2004
*
- * Modifications:
- *
*-------------------------------------------------------------------------
*/
@@ -1354,7 +1353,7 @@ coll_chunk3(void)
{
const char *filename = FILENAME[0];
if (mpi_rank_g == 0)
- HDprintf("coll_chunk3\n");
+ HDprintf("\nCollective chunk I/O Test #3\n");
coll_chunktest(filename, mpi_size_g, BYROW_CONT, API_NONE, HYPER, HYPER, OUT_OF_ORDER);
coll_chunktest(filename, mpi_size_g, BYROW_CONT, API_NONE, HYPER, POINT, OUT_OF_ORDER);
@@ -1382,17 +1381,9 @@ coll_chunk3(void)
*
* Failure: -1
*
- * Modifications:
- * Remove invalid temporary property checkings for API_LINK_HARD and
- * API_LINK_TRUE cases.
- * Programmer: Jonathan Kim
- * Date: 2012-10-10
- *
* Programmer: Unknown
* July 12th, 2004
*
- * Modifications:
- *
*-------------------------------------------------------------------------
*/
@@ -1842,55 +1833,10 @@ coll_chunktest(const char *filename, int chunk_factor, int select_factor, int ap
HDfree(data_origin1);
}
-/*****************************************************************************
- *
- * Function: do_express_test()
- *
- * Purpose: Do an MPI_Allreduce to obtain the maximum value returned
- * by GetTestExpress() across all processes. Return this
- * value.
- *
- * Envirmoment variables can be different across different
- * processes. This function ensures that all processes agree
- * on whether to do an express test.
- *
- * Return: Success: Maximum of the values returned by
- * GetTestExpress() across all processes.
- *
- * Failure: -1
- *
- * Programmer: JRM -- 4/25/06
- *
- *****************************************************************************/
-static int
-do_express_test(int world_mpi_rank)
-{
- int express_test;
- int max_express_test;
- int result;
-
- express_test = GetTestExpress();
-
- result =
- MPI_Allreduce((void *)&express_test, (void *)&max_express_test, 1, MPI_INT, MPI_MAX, MPI_COMM_WORLD);
-
- if (result != MPI_SUCCESS) {
- nerrors++;
- max_express_test = -1;
- if (VERBOSE_MED && (world_mpi_rank == 0)) {
- HDfprintf(stdout, "%d:%s: MPI_Allreduce() failed.\n", world_mpi_rank, FUNC);
- }
- }
-
- return (max_express_test);
-
-} /* do_express_test() */
-
int
main(int argc, char **argv)
{
- int ExpressMode = 0;
- hsize_t newsize = 1048576;
+ hsize_t newsize = 1048576;
/* Set the bigio processing limit to be 'newsize' bytes */
hsize_t oldsize = H5_mpi_set_bigio_count(newsize);
@@ -1899,9 +1845,8 @@ main(int argc, char **argv)
* that we try to ensure that our bigio handling is actually
* envoked and tested.
*/
- if (newsize != oldsize) {
+ if (newsize != oldsize)
bigcount = newsize * 2;
- }
MPI_Init(&argc, &argv);
MPI_Comm_size(MPI_COMM_WORLD, &mpi_size_g);
@@ -1912,34 +1857,25 @@ main(int argc, char **argv)
* hang in the atexit post processing in which it may try to make MPI
* calls. By then, MPI calls may not work.
*/
- if (H5dont_atexit() < 0) {
+ if (H5dont_atexit() < 0)
HDprintf("Failed to turn off atexit processing. Continue.\n");
- };
/* set alarm. */
ALARM_ON;
- ExpressMode = do_express_test(mpi_rank_g);
-
dataset_big_write();
MPI_Barrier(MPI_COMM_WORLD);
dataset_big_read();
MPI_Barrier(MPI_COMM_WORLD);
- if (ExpressMode > 0) {
- if (mpi_rank_g == 0)
- HDprintf("***Express test mode on. Several tests are skipped\n");
- }
- else {
- coll_chunk1();
- MPI_Barrier(MPI_COMM_WORLD);
- coll_chunk2();
- MPI_Barrier(MPI_COMM_WORLD);
- coll_chunk3();
- MPI_Barrier(MPI_COMM_WORLD);
- single_rank_independent_io();
- }
+ coll_chunk1();
+ MPI_Barrier(MPI_COMM_WORLD);
+ coll_chunk2();
+ MPI_Barrier(MPI_COMM_WORLD);
+ coll_chunk3();
+ MPI_Barrier(MPI_COMM_WORLD);
+ single_rank_independent_io();
/* turn off alarm */
ALARM_OFF;
diff --git a/testpar/t_cache.c b/testpar/t_cache.c
index a8b6d47..4cf1139 100644
--- a/testpar/t_cache.c
+++ b/testpar/t_cache.c
@@ -1467,7 +1467,8 @@ serve_read_request(struct mssg_t *mssg_ptr)
nerrors++;
success = FALSE;
if (verbose) {
- HDfprintf(stdout, "%d:%s: addr lookup failed for %a.\n", world_mpi_rank, FUNC, target_addr);
+ HDfprintf(stdout, "%d:%s: addr lookup failed for %" PRIuHADDR ".\n", world_mpi_rank, FUNC,
+ target_addr);
}
}
else if (data[target_index].len != mssg_ptr->len) {
@@ -1475,7 +1476,7 @@ serve_read_request(struct mssg_t *mssg_ptr)
nerrors++;
success = FALSE;
if (verbose) {
- HDfprintf(stdout, "%d:%s: data[i].len = %Zu != mssg->len = %d.\n", world_mpi_rank, FUNC,
+ HDfprintf(stdout, "%d:%s: data[i].len = %zu != mssg->len = %d.\n", world_mpi_rank, FUNC,
data[target_index].len, mssg_ptr->len);
}
}
@@ -1484,7 +1485,9 @@ serve_read_request(struct mssg_t *mssg_ptr)
nerrors++;
success = FALSE;
if (verbose) {
- HDfprintf(stdout, "%d:%s: proc %d read invalid entry. idx/base_addr = %d/%a.\n",
+ HDfprintf(stdout,
+ "%d:%s: proc %d read invalid entry. "
+ "idx/base_addr = %d/%" PRIuHADDR ".\n",
world_mpi_rank, FUNC, mssg_ptr->src, target_index, data[target_index].base_addr);
}
}
@@ -1653,7 +1656,8 @@ serve_write_request(struct mssg_t *mssg_ptr)
nerrors++;
success = FALSE;
if (verbose) {
- HDfprintf(stdout, "%d:%s: addr lookup failed for %a.\n", world_mpi_rank, FUNC, target_addr);
+ HDfprintf(stdout, "%d:%s: addr lookup failed for %" PRIuHADDR ".\n", world_mpi_rank, FUNC,
+ target_addr);
}
}
else if (data[target_index].len != mssg_ptr->len) {
@@ -1919,7 +1923,8 @@ serve_entry_writes_request(struct mssg_t *mssg_ptr)
nerrors++;
success = FALSE;
if (verbose) {
- HDfprintf(stdout, "%d:%s: addr lookup failed for %a.\n", world_mpi_rank, FUNC, target_addr);
+ HDfprintf(stdout, "%d:%s: addr lookup failed for %" PRIuHADDR ".\n", world_mpi_rank, FUNC,
+ target_addr);
}
}
else {
@@ -2007,7 +2012,8 @@ serve_entry_reads_request(struct mssg_t *mssg_ptr)
nerrors++;
success = FALSE;
if (verbose) {
- HDfprintf(stdout, "%d:%s: addr lookup failed for %a.\n", world_mpi_rank, FUNC, target_addr);
+ HDfprintf(stdout, "%d:%s: addr lookup failed for %" PRIuHADDR ".\n", world_mpi_rank, FUNC,
+ target_addr);
}
}
else {
@@ -2488,10 +2494,10 @@ datum_notify(H5C_notify_action_t action, void *thing)
HDfprintf(stdout,
"%d:%s: mssg.base_addr != entry_ptr->base_addr.\n",
world_mpi_rank, FUNC);
- HDfprintf(stdout, "%d:%s: mssg.base_addr = %a.\n",
+ HDfprintf(stdout, "%d:%s: mssg.base_addr = %" PRIuHADDR ".\n",
world_mpi_rank, FUNC, mssg.base_addr);
HDfprintf(stdout,
- "%d:%s: entry_ptr->base_addr = %a.\n",
+ "%d:%s: entry_ptr->base_addr = %" PRIuHADDR ".\n",
world_mpi_rank, FUNC,
entry_ptr->base_addr);
}
@@ -2501,7 +2507,7 @@ datum_notify(H5C_notify_action_t action, void *thing)
HDfprintf(stdout,
"%d:%s: mssg.len != entry_ptr->len.\n",
world_mpi_rank, FUNC);
- HDfprintf(stdout, "%d:%s: mssg.len = %a.\n",
+ HDfprintf(stdout, "%d:%s: mssg.len = %" PRIuHADDR ".\n",
world_mpi_rank, FUNC, mssg.len);
}
@@ -4296,8 +4302,8 @@ verify_entry_reads(haddr_t addr, int expected_entry_reads)
nerrors++;
success = FALSE;
if (verbose) {
- HDfprintf(stdout, "%d:%s: rep/exp entry 0x%llx reads mismatch (%ld/%ld).\n", world_mpi_rank,
- FUNC, (long long)addr, reported_entry_reads, expected_entry_reads);
+ HDfprintf(stdout, "%d:%s: rep/exp entry 0x%" PRIxHADDR " reads mismatch (%d/%d).\n",
+ world_mpi_rank, FUNC, addr, reported_entry_reads, expected_entry_reads);
}
}
}
diff --git a/testpar/t_cache_image.c b/testpar/t_cache_image.c
index 1fbfbd4..cb75c48 100644
--- a/testpar/t_cache_image.c
+++ b/testpar/t_cache_image.c
@@ -53,9 +53,6 @@ static void verify_data_sets(hid_t file_id, int min_dset, int max_dset);
/* local test function declarations */
-static hbool_t parse_flags(int argc, char *argv[], hbool_t *setup_ptr, hbool_t *ici_ptr, int *file_idx_ptr,
- int *mpi_size_ptr, hbool_t display);
-static void usage(void);
static unsigned construct_test_file(int test_file_index);
static void par_create_dataset(int dset_num, hid_t file_id, int mpi_rank, int mpi_size);
static void par_delete_dataset(int dset_num, hid_t file_id, int mpi_rank);
@@ -1742,13 +1739,6 @@ par_delete_dataset(int dset_num, hid_t file_id, int mpi_rank)
} /* par_delete_dataset() */
-/* This test uses many POSIX things that are not available on
- * Windows. We're using a check for fork(2) here as a proxy for
- * all POSIX/Unix/Linux things until this test can be made
- * more platform-independent.
- */
-#ifdef H5_HAVE_FORK
-
/*-------------------------------------------------------------------------
* Function: par_insert_cache_image()
*
@@ -1780,63 +1770,14 @@ par_delete_dataset(int dset_num, hid_t file_id, int mpi_rank)
static void
par_insert_cache_image(int file_name_idx, int mpi_rank, int mpi_size)
{
- hbool_t show_progress = FALSE;
-
if (pass) {
if (mpi_rank == 0) { /* insert cache image in supplied test file */
- char file_name_idx_str[32];
- char mpi_size_str[32];
- int child_status;
- pid_t child_pid;
-
- HDsprintf(file_name_idx_str, "%d", file_name_idx);
- HDsprintf(mpi_size_str, "%d", mpi_size);
-
- child_pid = fork();
-
- if (child_pid == 0) { /* this is the child process */
-
- /* fun and games to shutup the compiler */
- char param0[32] = "t_cache_image";
- char param1[32] = "ici";
- char *child_argv[] = {param0, param1, file_name_idx_str, mpi_size_str, NULL};
-
- /* we may need to play with the path here */
- if (execv("t_cache_image", child_argv) == -1) {
-
- HDfprintf(stdout, "execl() of ici process failed. errno = %d(%s)\n", errno,
- strerror(errno));
- HDexit(1);
- }
- }
- else if (child_pid != -1) {
- /* this is the parent process -- wait until child is done */
- if (-1 == waitpid(child_pid, &child_status, WUNTRACED)) {
-
- HDfprintf(stdout, "can't wait on ici process.\n");
- pass = FALSE;
- }
- else if (!WIFEXITED(child_status)) {
-
- HDfprintf(stdout, "ici process hasn't exitied.\n");
- pass = FALSE;
- }
- else if (WEXITSTATUS(child_status) != 0) {
-
- HDfprintf(stdout, "ici process reports failure.\n");
- pass = FALSE;
- }
- else if (show_progress) {
-
- HDfprintf(stdout, "cache image insertion complete.\n");
- }
- }
- else { /* fork failed */
-
- HDfprintf(stdout, "can't create process to insert cache image.\n");
- pass = FALSE;
+ if (!serial_insert_cache_image(file_name_idx, mpi_size)) {
+ HDfprintf(stderr, "\n\nCache image insertion failed.\n");
+ HDfprintf(stderr, " failure mssg = \"%s\"\n", failure_mssg);
+ HDexit(EXIT_FAILURE);
}
}
}
@@ -1852,15 +1793,6 @@ par_insert_cache_image(int file_name_idx, int mpi_rank, int mpi_size)
return;
} /* par_insert_cache_image() */
-#else /* H5_HAVE_FORK */
-
-static void
-par_insert_cache_image(int file_name_idx, int mpi_rank, int mpi_size)
-{
- return;
-} /* par_insert_cache_image() */
-
-#endif /* H5_HAVE_FORK */
/*-------------------------------------------------------------------------
* Function: par_verify_dataset()
@@ -2461,158 +2393,6 @@ serial_verify_dataset(int dset_num, hid_t file_id, int mpi_size)
} /* serial_verify_dataset() */
/*-------------------------------------------------------------------------
- * Function: parse_flags
- *
- * Purpose: Parse the flags passed to this program, and load the
- * values into the supplied field.
- *
- * Return: Success: 1
- * Failure: 0
- *
- * Programmer: J Mainzer
- * 4/28/11
- *
- *-------------------------------------------------------------------------
- */
-static hbool_t
-parse_flags(int argc, char *argv[], hbool_t *setup_ptr, hbool_t *ici_ptr, int *file_idx_ptr,
- int *mpi_size_ptr, hbool_t display)
-{
- const char *fcn_name = "parse_flags()";
- const char *(ops[]) = {"setup", "ici"};
- int success = TRUE;
-
- HDassert(setup_ptr);
- HDassert(*setup_ptr == FALSE);
- HDassert(ici_ptr);
- HDassert(*ici_ptr == FALSE);
- HDassert(file_idx_ptr);
- HDassert(mpi_size_ptr);
-
- if (setup_ptr == NULL) {
-
- success = FALSE;
- HDfprintf(stdout, "%s: bad arg(s) on entry.\n", fcn_name);
- }
-
- if ((success) && ((argc != 1) && (argc != 2) && (argc != 4))) {
-
- success = FALSE;
- usage();
- }
-
- if ((success) && (argc >= 2)) {
-
- if (strcmp(argv[1], ops[0]) == 0) {
-
- if (argc != 2) {
-
- success = FALSE;
- usage();
- }
- else {
-
- *setup_ptr = TRUE;
- }
- }
- else if (strcmp(argv[1], ops[1]) == 0) {
-
- if (argc != 4) {
-
- success = FALSE;
- usage();
- }
- else {
-
- *ici_ptr = TRUE;
- *file_idx_ptr = atoi(argv[2]);
- *mpi_size_ptr = atoi(argv[3]);
- }
- }
- }
-
- if ((success) && (display)) {
-
- if (*setup_ptr)
-
- HDfprintf(stdout, "t_cache_image setup\n");
-
- else if (*ici_ptr)
-
- HDfprintf(stdout, "t_cache_image ici %d %d\n", *file_idx_ptr, *mpi_size_ptr);
-
- else
-
- HDfprintf(stdout, "t_cache_image\n");
- }
-
- return (success);
-
-} /* parse_flags() */
-
-/*-------------------------------------------------------------------------
- * Function: usage
- *
- * Purpose: Display a brief message describing the purpose and use
- * of the program.
- *
- * Return: void
- *
- * Programmer: John Mainzer
- * 4/28/11
- *
- * Modifications:
- *
- *-------------------------------------------------------------------------
- */
-void
-usage(void)
-{
- const char *s[] = {
- "\n",
- "t_cache_image:\n",
- "\n",
- "Run the parallel cache image tests. \n"
- "\n"
- "In general, this program is run via MPI. However, at present, files\n"
- "with cache images can only be constructed by serial processes.\n",
- "\n",
- "To square this circle, one process in the parallel computation \n"
- "forks a serial version of the test program to handle this detail.\n",
- "The \"setup\" parameter indicates that t_cache_image is being \n",
- "invokde for this purpose.\n",
- "\n",
- "Similarly, only a serial process can add a cache image to an\n",
- "existing file.\n",
- "\n",
- "Here again, one process forks a serial version of the test program\n",
- "with the \"ici\" parameter.\n"
- "\n",
- "usage: t_cache_image [setup|ici m n]\n",
- "\n",
- "where:\n",
- "\n",
- " setup parameter forces creation of test file\n",
- "\n",
- " ici parameter forces insertion of a cache image into the \n",
- " m th test file, created by a parallel computation with .\n",
- " n processes\n",
- "\n",
- "Returns 0 on success, 1 on failure.\n",
- "\n",
- NULL,
- };
- int i = 0;
-
- while (s[i] != NULL) {
- HDfprintf(stdout, "%s", s[i]);
- i++;
- }
-
- return;
-} /* usage() */
-
-/*-------------------------------------------------------------------------
* Function: verify_data_sets()
*
* Purpose: If pass is TRUE on entry, verify that the data sets in the
@@ -3116,8 +2896,9 @@ verify_cache_image_RO(int file_name_id, int md_write_strat, int mpi_rank)
H5_FAILED();
- if (show_progress)
- HDfprintf(stdout, "%s: failure_mssg = \"%s\"\n", failure_mssg);
+ if (show_progress) {
+ HDfprintf(stdout, "%s: failure_mssg = \"%s\"\n", fcn_name, failure_mssg);
+ }
}
}
@@ -3400,8 +3181,9 @@ verify_cache_image_RW(int file_name_id, int md_write_strat, int mpi_rank)
H5_FAILED();
- if (show_progress)
- HDfprintf(stdout, "%s: failure_mssg = \"%s\"\n", failure_mssg);
+ if (show_progress) {
+ HDfprintf(stdout, "%s: failure_mssg = \"%s\"\n", fcn_name, failure_mssg);
+ }
}
}
@@ -3811,13 +3593,6 @@ smoke_check_1(MPI_Comm mpi_comm, MPI_Info mpi_info, int mpi_rank, int mpi_size)
} /* smoke_check_1() */
-/* This test uses many POSIX things that are not available on
- * Windows. We're using a check for fork(2) here as a proxy for
- * all POSIX/Unix/Linux things until this test can be made
- * more platform-independent.
- */
-#ifdef H5_HAVE_FORK
-
/*-------------------------------------------------------------------------
* Function: main
*
@@ -3847,65 +3622,12 @@ smoke_check_1(MPI_Comm mpi_comm, MPI_Info mpi_info, int mpi_rank, int mpi_size)
int
main(int argc, char **argv)
{
- hbool_t setup = FALSE;
- hbool_t ici = FALSE;
unsigned nerrs = 0;
MPI_Comm comm = MPI_COMM_WORLD;
MPI_Info info = MPI_INFO_NULL;
- int file_idx;
- int i;
int mpi_size;
int mpi_rank;
- if (!parse_flags(argc, argv, &setup, &ici, &file_idx, &mpi_size, FALSE))
- exit(1); /* exit now if unable to parse flags */
-
- if (setup) { /* construct test files and exit */
-
- H5open();
- HDfprintf(stdout, "Constructing test files: \n");
- HDfflush(stdout);
-
- i = 0;
- while ((FILENAMES[i] != NULL) && (i < TEST_FILES_TO_CONSTRUCT)) {
-
- HDfprintf(stdout, " writing %s ... ", FILENAMES[i]);
- HDfflush(stdout);
- construct_test_file(i);
-
- if (pass) {
-
- HDprintf("done.\n");
- HDfflush(stdout);
- }
- else {
-
- HDprintf("failed.\n");
- HDexit(1);
- }
- i++;
- }
-
- HDfprintf(stdout, "Test file construction complete.\n");
- HDexit(0);
- }
- else if (ici) {
-
- if (serial_insert_cache_image(file_idx, mpi_size)) {
-
- HDexit(0);
- }
- else {
-
- HDfprintf(stderr, "\n\nCache image insertion failed.\n");
- HDfprintf(stderr, " failure mssg = \"%s\"\n", failure_mssg);
- HDexit(1);
- }
- }
-
- HDassert(!setup);
- HDassert(!ici);
-
MPI_Init(&argc, &argv);
MPI_Comm_size(MPI_COMM_WORLD, &mpi_size);
MPI_Comm_rank(MPI_COMM_WORLD, &mpi_rank);
@@ -3915,9 +3637,8 @@ main(int argc, char **argv)
* hang in the atexit post processing in which it may try to make MPI
* calls. By then, MPI calls may not work.
*/
- if (H5dont_atexit() < 0) {
+ if (H5dont_atexit() < 0)
HDprintf("%d:Failed to turn off atexit processing. Continue.\n", mpi_rank);
- };
H5open();
@@ -3929,71 +3650,45 @@ main(int argc, char **argv)
}
if (mpi_size < 2) {
-
- if (mpi_rank == 0) {
-
+ if (mpi_rank == 0)
HDprintf(" Need at least 2 processes. Exiting.\n");
- }
goto finish;
}
if (mpi_rank == 0) { /* create test files */
+ int i;
- int child_status;
- pid_t child_pid;
-
- child_pid = fork();
-
- if (child_pid == 0) { /* this is the child process */
-
- /* fun and games to shutup the compiler */
- char param0[32] = "t_cache_image";
- char param1[32] = "setup";
- char *child_argv[] = {param0, param1, NULL};
-
- /* we may need to play with the path here */
- if (execv("t_cache_image", child_argv) == -1) {
-
- HDfprintf(stdout, "execl() of setup process failed. errno = %d(%s)\n", errno,
- strerror(errno));
- HDexit(1);
- }
- }
- else if (child_pid != -1) {
- /* this is the parent process -- wait until child is done */
- if (-1 == waitpid(child_pid, &child_status, WUNTRACED)) {
-
- HDfprintf(stdout, "can't wait on setup process.\n");
- }
- else if (!WIFEXITED(child_status)) {
+ HDfprintf(stdout, "Constructing test files: \n");
+ HDfflush(stdout);
- HDfprintf(stdout, "setup process hasn't exitied.\n");
- }
- else if (WEXITSTATUS(child_status) != 0) {
+ i = 0;
+ while ((FILENAMES[i] != NULL) && (i < TEST_FILES_TO_CONSTRUCT)) {
+ HDfprintf(stdout, " writing %s ... ", FILENAMES[i]);
+ HDfflush(stdout);
+ construct_test_file(i);
- HDfprintf(stdout, "setup process reports failure.\n");
+ if (pass) {
+ HDprintf("done.\n");
+ HDfflush(stdout);
}
else {
-
- HDfprintf(stdout, "testfile construction complete -- proceeding with tests.\n");
+ HDprintf("failed.\n");
+ HDexit(EXIT_FAILURE);
}
+ i++;
}
- else { /* fork failed */
-
- HDfprintf(stdout, "can't create process to construct test file.\n");
- }
+ HDfprintf(stdout, "Test file construction complete.\n");
}
/* can't start test until test files exist */
MPI_Barrier(MPI_COMM_WORLD);
nerrs += verify_cache_image_RO(0, H5AC_METADATA_WRITE_STRATEGY__PROCESS_0_ONLY, mpi_rank);
-#if 1
nerrs += verify_cache_image_RO(1, H5AC_METADATA_WRITE_STRATEGY__DISTRIBUTED, mpi_rank);
nerrs += verify_cache_image_RW(0, H5AC_METADATA_WRITE_STRATEGY__PROCESS_0_ONLY, mpi_rank);
nerrs += verify_cache_image_RW(1, H5AC_METADATA_WRITE_STRATEGY__DISTRIBUTED, mpi_rank);
nerrs += smoke_check_1(comm, info, mpi_rank, mpi_size);
-#endif
+
finish:
/* make sure all processes are finished before final report, cleanup
@@ -4002,19 +3697,14 @@ finish:
MPI_Barrier(MPI_COMM_WORLD);
if (mpi_rank == 0) { /* only process 0 reports */
- HDsleep(10);
HDprintf("===================================\n");
- if (nerrs > 0) {
+ if (nerrs > 0)
HDprintf("***metadata cache image tests detected %d failures***\n", nerrs);
- }
- else {
+ else
HDprintf("metadata cache image tests finished with no failures\n");
- }
HDprintf("===================================\n");
}
- /* takedown_derived_types(); */
-
/* close HDF5 library */
H5close();
@@ -4025,13 +3715,3 @@ finish:
return (nerrs > 0);
} /* main() */
-#else /* H5_HAVE_FORK */
-
-int
-main(void)
-{
- HDfprintf(stderr, "Non-POSIX platform. Skipping.\n");
- return EXIT_SUCCESS;
-} /* end main() */
-
-#endif /* H5_HAVE_FORK */
diff --git a/testpar/t_dset.c b/testpar/t_dset.c
index d7b2f0b..bbd4b28 100644
--- a/testpar/t_dset.c
+++ b/testpar/t_dset.c
@@ -1627,9 +1627,6 @@ extend_writeInd(void)
VRFY((mem_dataspace >= 0), "");
/* Try write to dataset2 beyond its current dim sizes. Should fail. */
- /* Temporary turn off auto error reporting */
- H5Eget_auto2(H5E_DEFAULT, &old_func, &old_client_data);
- H5Eset_auto2(H5E_DEFAULT, NULL, NULL);
/* create a file dataspace independently */
file_dataspace = H5Dget_space(dataset2);
@@ -1638,11 +1635,13 @@ extend_writeInd(void)
VRFY((ret >= 0), "H5Sset_hyperslab succeeded");
/* write data independently. Should fail. */
- ret = H5Dwrite(dataset2, H5T_NATIVE_INT, mem_dataspace, file_dataspace, H5P_DEFAULT, data_array1);
+ H5E_BEGIN_TRY
+ {
+ ret = H5Dwrite(dataset2, H5T_NATIVE_INT, mem_dataspace, file_dataspace, H5P_DEFAULT, data_array1);
+ }
+ H5E_END_TRY
VRFY((ret < 0), "H5Dwrite failed as expected");
- /* restore auto error reporting */
- H5Eset_auto2(H5E_DEFAULT, old_func, old_client_data);
H5Sclose(file_dataspace);
/* Extend dataset2 and try again. Should succeed. */
@@ -1911,20 +1910,19 @@ extend_readInd(void)
VRFY((dataset2 >= 0), "");
/* Try extend dataset1 which is open RDONLY. Should fail. */
- /* first turn off auto error reporting */
- H5Eget_auto2(H5E_DEFAULT, &old_func, &old_client_data);
- H5Eset_auto2(H5E_DEFAULT, NULL, NULL);
file_dataspace = H5Dget_space(dataset1);
VRFY((file_dataspace >= 0), "H5Dget_space succeeded");
ret = H5Sget_simple_extent_dims(file_dataspace, dims, NULL);
VRFY((ret > 0), "H5Sget_simple_extent_dims succeeded");
dims[0]++;
- ret = H5Dset_extent(dataset1, dims);
+ H5E_BEGIN_TRY
+ {
+ ret = H5Dset_extent(dataset1, dims);
+ }
+ H5E_END_TRY
VRFY((ret < 0), "H5Dset_extent failed as expected");
- /* restore auto error reporting */
- H5Eset_auto2(H5E_DEFAULT, old_func, old_client_data);
H5Sclose(file_dataspace);
/* Read dataset1 using BYROW pattern */
@@ -2209,9 +2207,6 @@ extend_writeAll(void)
}
/* Try write to dataset2 beyond its current dim sizes. Should fail. */
- /* Temporary turn off auto error reporting */
- H5Eget_auto2(H5E_DEFAULT, &old_func, &old_client_data);
- H5Eset_auto2(H5E_DEFAULT, NULL, NULL);
/* create a file dataspace independently */
file_dataspace = H5Dget_space(dataset2);
@@ -2220,11 +2215,13 @@ extend_writeAll(void)
VRFY((ret >= 0), "H5Sset_hyperslab succeeded");
/* write data independently. Should fail. */
- ret = H5Dwrite(dataset2, H5T_NATIVE_INT, mem_dataspace, file_dataspace, xfer_plist, data_array1);
+ H5E_BEGIN_TRY
+ {
+ ret = H5Dwrite(dataset2, H5T_NATIVE_INT, mem_dataspace, file_dataspace, xfer_plist, data_array1);
+ }
+ H5E_END_TRY
VRFY((ret < 0), "H5Dwrite failed as expected");
- /* restore auto error reporting */
- H5Eset_auto2(H5E_DEFAULT, old_func, old_client_data);
H5Sclose(file_dataspace);
/* Extend dataset2 and try again. Should succeed. */
@@ -2331,20 +2328,19 @@ extend_readAll(void)
VRFY((dataset2 >= 0), "");
/* Try extend dataset1 which is open RDONLY. Should fail. */
- /* first turn off auto error reporting */
- H5Eget_auto2(H5E_DEFAULT, &old_func, &old_client_data);
- H5Eset_auto2(H5E_DEFAULT, NULL, NULL);
file_dataspace = H5Dget_space(dataset1);
VRFY((file_dataspace >= 0), "H5Dget_space succeeded");
ret = H5Sget_simple_extent_dims(file_dataspace, dims, NULL);
VRFY((ret > 0), "H5Sget_simple_extent_dims succeeded");
dims[0]++;
- ret = H5Dset_extent(dataset1, dims);
+ H5E_BEGIN_TRY
+ {
+ ret = H5Dset_extent(dataset1, dims);
+ }
+ H5E_END_TRY
VRFY((ret < 0), "H5Dset_extent failed as expected");
- /* restore auto error reporting */
- H5Eset_auto2(H5E_DEFAULT, old_func, old_client_data);
H5Sclose(file_dataspace);
/* Read dataset1 using BYROW pattern */
@@ -3321,14 +3317,23 @@ test_actual_io_mode(int selection_mode)
/* Release some resources */
ret = H5Sclose(sid);
+ VRFY((ret >= 0), "H5Sclose succeeded");
ret = H5Pclose(fapl);
+ VRFY((ret >= 0), "H5Pclose succeeded");
ret = H5Pclose(dcpl);
+ VRFY((ret >= 0), "H5Pclose succeeded");
ret = H5Pclose(dxpl_write);
+ VRFY((ret >= 0), "H5Pclose succeeded");
ret = H5Pclose(dxpl_read);
+ VRFY((ret >= 0), "H5Pclose succeeded");
ret = H5Dclose(dataset);
+ VRFY((ret >= 0), "H5Dclose succeeded");
ret = H5Sclose(mem_space);
+ VRFY((ret >= 0), "H5Sclose succeeded");
ret = H5Sclose(file_space);
+ VRFY((ret >= 0), "H5Sclose succeeded");
ret = H5Fclose(fid);
+ VRFY((ret >= 0), "H5Fclose succeeded");
HDfree(buffer);
return;
}
@@ -3344,9 +3349,7 @@ void
actual_io_mode_tests(void)
{
int mpi_size = -1;
- int mpi_rank = -1;
MPI_Comm_size(MPI_COMM_WORLD, &mpi_size);
- MPI_Comm_size(MPI_COMM_WORLD, &mpi_rank);
test_actual_io_mode(TEST_ACTUAL_IO_NO_COLLECTIVE);
@@ -3985,9 +3988,9 @@ no_collective_cause_tests(void)
test_no_collective_cause_mode(TEST_NOT_CONTIGUOUS_OR_CHUNKED_DATASET_COMPACT);
test_no_collective_cause_mode(TEST_NOT_CONTIGUOUS_OR_CHUNKED_DATASET_EXTERNAL);
#ifdef LATER /* fletcher32 */
- /* TODO: use this instead of below TEST_FILTERS_READ when H5Dcreate and
- * H5Dwrite is ready for mpio + filter feature.
- */
+ /* TODO: use this instead of below TEST_FILTERS_READ when H5Dcreate and
+ * H5Dwrite is ready for mpio + filter feature.
+ */
/* test_no_collective_cause_mode (TEST_FILTERS); */
test_no_collective_cause_mode_filter(TEST_FILTERS_READ);
#endif /* LATER */
@@ -4112,13 +4115,15 @@ dataset_atomicity(void)
if (MAINPROCESS) {
fid = H5Fopen(filename, H5F_ACC_RDWR, H5P_DEFAULT);
VRFY((fid >= 0), "H5Fopen succeeed");
- }
- /* should fail */
- ret = H5Fset_mpi_atomicity(fid, TRUE);
- VRFY((ret == FAIL), "H5Fset_mpi_atomicity failed");
+ /* should fail */
+ H5E_BEGIN_TRY
+ {
+ ret = H5Fset_mpi_atomicity(fid, TRUE);
+ }
+ H5E_END_TRY
+ VRFY((ret == FAIL), "H5Fset_mpi_atomicity failed");
- if (MAINPROCESS) {
ret = H5Fclose(fid);
VRFY((ret >= 0), "H5Fclose succeeded");
}
diff --git a/testpar/t_file.c b/testpar/t_file.c
index ec8726f..d749978 100644
--- a/testpar/t_file.c
+++ b/testpar/t_file.c
@@ -950,3 +950,58 @@ test_file_properties(void)
VRFY((mpi_ret >= 0), "MPI_Info_free succeeded");
} /* end test_file_properties() */
+
+void
+test_delete(void)
+{
+ hid_t fid = H5I_INVALID_HID; /* HDF5 file ID */
+ hid_t fapl_id = H5I_INVALID_HID; /* File access plist */
+ hbool_t is_coll;
+ const char *filename = NULL;
+ MPI_Comm comm = MPI_COMM_WORLD;
+ MPI_Info info = MPI_INFO_NULL;
+ htri_t is_hdf5 = FAIL; /* Whether a file is an HDF5 file */
+ herr_t ret; /* Generic return value */
+
+ filename = (const char *)GetTestParameters();
+
+ /* set up MPI parameters */
+ MPI_Comm_size(MPI_COMM_WORLD, &mpi_size);
+ MPI_Comm_rank(MPI_COMM_WORLD, &mpi_rank);
+
+ /* setup file access plist */
+ fapl_id = H5Pcreate(H5P_FILE_ACCESS);
+ VRFY((fapl_id != H5I_INVALID_HID), "H5Pcreate");
+ ret = H5Pset_fapl_mpio(fapl_id, comm, info);
+ VRFY((SUCCEED == ret), "H5Pset_fapl_mpio");
+
+ /* create the file */
+ fid = H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl_id);
+ VRFY((fid != H5I_INVALID_HID), "H5Fcreate");
+
+ /* close the file */
+ ret = H5Fclose(fid);
+ VRFY((SUCCEED == ret), "H5Fclose");
+
+ /* Verify that the file is an HDF5 file */
+ is_hdf5 = H5Fis_accessible(filename, fapl_id);
+ VRFY((TRUE == is_hdf5), "H5Fis_accessible");
+
+ /* Delete the file */
+ ret = H5Fdelete(filename, fapl_id);
+ VRFY((SUCCEED == ret), "H5Fdelete");
+
+ /* Verify that the file is NO LONGER an HDF5 file */
+ /* This should fail since there is no file */
+ H5E_BEGIN_TRY
+ {
+ is_hdf5 = H5Fis_accessible(filename, fapl_id);
+ }
+ H5E_END_TRY;
+ VRFY((is_hdf5 != SUCCEED), "H5Fis_accessible");
+
+ /* Release file-access plist */
+ ret = H5Pclose(fapl_id);
+ VRFY((SUCCEED == ret), "H5Pclose");
+
+} /* end test_delete() */
diff --git a/testpar/t_filters_parallel.c b/testpar/t_filters_parallel.c
index 37479b3..5153bce 100644
--- a/testpar/t_filters_parallel.c
+++ b/testpar/t_filters_parallel.c
@@ -255,8 +255,9 @@ test_write_one_chunk_filtered_dataset(void)
start[1] = 0;
if (VERBOSE_MED) {
- HDprintf("Process %d is writing with count[ %llu, %llu ], stride[ %llu, %llu ], start[ %llu, %llu ], "
- "block size[ %llu, %llu ]\n",
+ HDprintf("Process %d is writing with count[ %" PRIuHSIZE ", %" PRIuHSIZE " ], stride[ %" PRIuHSIZE
+ ", %" PRIuHSIZE " ], start[ %" PRIuHSIZE ", %" PRIuHSIZE " ], block size[ %" PRIuHSIZE
+ ", %" PRIuHSIZE " ]\n",
mpi_rank, count[0], count[1], stride[0], stride[1], start[0], start[1], block[0], block[1]);
HDfflush(stdout);
}
@@ -418,8 +419,9 @@ test_write_filtered_dataset_no_overlap(void)
start[1] = 0;
if (VERBOSE_MED) {
- HDprintf("Process %d is writing with count[ %llu, %llu ], stride[ %llu, %llu ], start[ %llu, %llu ], "
- "block size[ %llu, %llu ]\n",
+ HDprintf("Process %d is writing with count[ %" PRIuHSIZE ", %" PRIuHSIZE " ], stride[ %" PRIuHSIZE
+ ", %" PRIuHSIZE " ], start[ %" PRIuHSIZE ", %" PRIuHSIZE " ], block size[ %" PRIuHSIZE
+ ", %" PRIuHSIZE " ]\n",
mpi_rank, count[0], count[1], stride[0], stride[1], start[0], start[1], block[0], block[1]);
HDfflush(stdout);
}
@@ -578,8 +580,9 @@ test_write_filtered_dataset_overlap(void)
start[1] = 0;
if (VERBOSE_MED) {
- HDprintf("Process %d is writing with count[ %llu, %llu ], stride[ %llu, %llu ], start[ %llu, %llu ], "
- "block size[ %llu, %llu ]\n",
+ HDprintf("Process %d is writing with count[ %" PRIuHSIZE ", %" PRIuHSIZE " ], stride[ %" PRIuHSIZE
+ ", %" PRIuHSIZE " ], start[ %" PRIuHSIZE ", %" PRIuHSIZE " ], block size[ %" PRIuHSIZE
+ ", %" PRIuHSIZE " ]\n",
mpi_rank, count[0], count[1], stride[0], stride[1], start[0], start[1], block[0], block[1]);
HDfflush(stdout);
}
@@ -746,8 +749,9 @@ test_write_filtered_dataset_single_no_selection(void)
start[1] = 0;
if (VERBOSE_MED) {
- HDprintf("Process %d is writing with count[ %llu, %llu ], stride[ %llu, %llu ], start[ %llu, %llu ], "
- "block size[ %llu, %llu ]\n",
+ HDprintf("Process %d is writing with count[ %" PRIuHSIZE ", %" PRIuHSIZE " ], stride[ %" PRIuHSIZE
+ ", %" PRIuHSIZE " ], start[ %" PRIuHSIZE ", %" PRIuHSIZE " ], block size[ %" PRIuHSIZE
+ ", %" PRIuHSIZE " ]\n",
mpi_rank, count[0], count[1], stride[0], stride[1], start[0], start[1], block[0], block[1]);
HDfflush(stdout);
}
@@ -1202,8 +1206,9 @@ test_write_filtered_dataset_interleaved_write(void)
start[1] = 0;
if (VERBOSE_MED) {
- HDprintf("Process %d is writing with count[ %llu, %llu ], stride[ %llu, %llu ], start[ %llu, %llu ], "
- "block size[ %llu, %llu ]\n",
+ HDprintf("Process %d is writing with count[ %" PRIuHSIZE ", %" PRIuHSIZE " ], stride[ %" PRIuHSIZE
+ ", %" PRIuHSIZE " ], start[ %" PRIuHSIZE ", %" PRIuHSIZE " ], block size[ %" PRIuHSIZE
+ ", %" PRIuHSIZE " ]\n",
mpi_rank, count[0], count[1], stride[0], stride[1], start[0], start[1], block[0], block[1]);
HDfflush(stdout);
}
@@ -1379,8 +1384,10 @@ test_write_3d_filtered_dataset_no_overlap_separate_pages(void)
start[2] = (hsize_t)mpi_rank;
if (VERBOSE_MED) {
- HDprintf("Process %d is writing with count[ %llu, %llu, %llu ], stride[ %llu, %llu, %llu ], start[ "
- "%llu, %llu, %llu ], block size[ %llu, %llu, %llu ]\n",
+ HDprintf("Process %d is writing with count[ %" PRIuHSIZE ", %" PRIuHSIZE ", %" PRIuHSIZE
+ " ], stride[ %" PRIuHSIZE ", %" PRIuHSIZE ", %" PRIuHSIZE " ], start[ %" PRIuHSIZE
+ ", %" PRIuHSIZE ", %" PRIuHSIZE " ], block size[ %" PRIuHSIZE ", %" PRIuHSIZE ", %" PRIuHSIZE
+ " ]\n",
mpi_rank, count[0], count[1], count[2], stride[0], stride[1], stride[2], start[0], start[1],
start[2], block[0], block[1], block[2]);
HDfflush(stdout);
@@ -1547,8 +1554,10 @@ test_write_3d_filtered_dataset_no_overlap_same_pages(void)
start[2] = 0;
if (VERBOSE_MED) {
- HDprintf("Process %d is writing with count[ %llu, %llu, %llu ], stride[ %llu, %llu, %llu ], start[ "
- "%llu, %llu, %llu ], block size[ %llu, %llu, %llu ]\n",
+ HDprintf("Process %d is writing with count[ %" PRIuHSIZE ", %" PRIuHSIZE ", %" PRIuHSIZE
+ " ], stride[ %" PRIuHSIZE ", %" PRIuHSIZE ", %" PRIuHSIZE " ], start[ %" PRIuHSIZE
+ ", %" PRIuHSIZE ", %" PRIuHSIZE " ], block size[ %" PRIuHSIZE ", %" PRIuHSIZE ", %" PRIuHSIZE
+ " ]\n",
mpi_rank, count[0], count[1], count[2], stride[0], stride[1], stride[2], start[0], start[1],
start[2], block[0], block[1], block[2]);
HDfflush(stdout);
@@ -1714,8 +1723,10 @@ test_write_3d_filtered_dataset_overlap(void)
start[2] = 0;
if (VERBOSE_MED) {
- HDprintf("Process %d is writing with count[ %llu, %llu, %llu ], stride[ %llu, %llu, %llu ], start[ "
- "%llu, %llu, %llu ], block size[ %llu, %llu, %llu ]\n",
+ HDprintf("Process %d is writing with count[ %" PRIuHSIZE ", %" PRIuHSIZE ", %" PRIuHSIZE
+ " ], stride[ %" PRIuHSIZE ", %" PRIuHSIZE ", %" PRIuHSIZE " ], start[ %" PRIuHSIZE
+ ", %" PRIuHSIZE ", %" PRIuHSIZE " ], block size[ %" PRIuHSIZE ", %" PRIuHSIZE ", %" PRIuHSIZE
+ " ]\n",
mpi_rank, count[0], count[1], count[2], stride[0], stride[1], stride[2], start[0], start[1],
start[2], block[0], block[1], block[2]);
HDfflush(stdout);
@@ -1900,8 +1911,9 @@ test_write_cmpd_filtered_dataset_no_conversion_unshared(void)
start[1] = ((hsize_t)mpi_rank * WRITE_COMPOUND_FILTERED_CHUNKS_NO_CONVERSION_UNSHARED_CH_NCOLS);
if (VERBOSE_MED) {
- HDprintf("Process %d is writing with count[ %llu, %llu ], stride[ %llu, %llu ], start[ %llu, %llu ], "
- "block size[ %llu, %llu ]\n",
+ HDprintf("Process %d is writing with count[ %" PRIuHSIZE ", %" PRIuHSIZE " ], stride[ %" PRIuHSIZE
+ ", %" PRIuHSIZE " ], start[ %" PRIuHSIZE ", %" PRIuHSIZE " ], block size[ %" PRIuHSIZE
+ ", %" PRIuHSIZE " ]\n",
mpi_rank, count[0], count[1], stride[0], stride[1], start[0], start[1], block[0], block[1]);
HDfflush(stdout);
}
@@ -2080,8 +2092,9 @@ test_write_cmpd_filtered_dataset_no_conversion_shared(void)
start[1] = 0;
if (VERBOSE_MED) {
- HDprintf("Process %d is writing with count[ %llu, %llu ], stride[ %llu, %llu ], start[ %llu, %llu ], "
- "block size[ %llu, %llu ]\n",
+ HDprintf("Process %d is writing with count[ %" PRIuHSIZE ", %" PRIuHSIZE " ], stride[ %" PRIuHSIZE
+ ", %" PRIuHSIZE " ], start[ %" PRIuHSIZE ", %" PRIuHSIZE " ], block size[ %" PRIuHSIZE
+ ", %" PRIuHSIZE " ]\n",
mpi_rank, count[0], count[1], stride[0], stride[1], start[0], start[1], block[0], block[1]);
HDfflush(stdout);
}
@@ -2279,8 +2292,9 @@ test_write_cmpd_filtered_dataset_type_conversion_unshared(void)
start[1] = ((hsize_t)mpi_rank * WRITE_COMPOUND_FILTERED_CHUNKS_TYPE_CONVERSION_UNSHARED_CH_NCOLS);
if (VERBOSE_MED) {
- HDprintf("Process %d is writing with count[ %llu, %llu ], stride[ %llu, %llu ], start[ %llu, %llu ], "
- "block size[ %llu, %llu ]\n",
+ HDprintf("Process %d is writing with count[ %" PRIuHSIZE ", %" PRIuHSIZE " ], stride[ %" PRIuHSIZE
+ ", %" PRIuHSIZE " ], start[ %" PRIuHSIZE ", %" PRIuHSIZE " ], block size[ %" PRIuHSIZE
+ ", %" PRIuHSIZE " ]\n",
mpi_rank, count[0], count[1], stride[0], stride[1], start[0], start[1], block[0], block[1]);
HDfflush(stdout);
}
@@ -2471,8 +2485,9 @@ test_write_cmpd_filtered_dataset_type_conversion_shared(void)
start[1] = 0;
if (VERBOSE_MED) {
- HDprintf("Process %d is writing with count[ %llu, %llu ], stride[ %llu, %llu ], start[ %llu, %llu ], "
- "block size[ %llu, %llu ]\n",
+ HDprintf("Process %d is writing with count[ %" PRIuHSIZE ", %" PRIuHSIZE " ], stride[ %" PRIuHSIZE
+ ", %" PRIuHSIZE " ], start[ %" PRIuHSIZE ", %" PRIuHSIZE " ], block size[ %" PRIuHSIZE
+ ", %" PRIuHSIZE " ]\n",
mpi_rank, count[0], count[1], stride[0], stride[1], start[0], start[1], block[0], block[1]);
HDfflush(stdout);
}
@@ -2687,8 +2702,9 @@ test_read_one_chunk_filtered_dataset(void)
start[1] = 0;
if (VERBOSE_MED) {
- HDprintf("Process %d is reading with count[ %llu, %llu ], stride[ %llu, %llu ], start[ %llu, %llu ], "
- "block size[ %llu, %llu ]\n",
+ HDprintf("Process %d is reading with count[ %" PRIuHSIZE ", %" PRIuHSIZE " ], stride[ %" PRIuHSIZE
+ ", %" PRIuHSIZE " ], start[ %" PRIuHSIZE ", %" PRIuHSIZE " ], block size[ %" PRIuHSIZE
+ ", %" PRIuHSIZE " ]\n",
mpi_rank, count[0], count[1], stride[0], stride[1], start[0], start[1], block[0], block[1]);
HDfflush(stdout);
}
@@ -2890,8 +2906,9 @@ test_read_filtered_dataset_no_overlap(void)
start[1] = 0;
if (VERBOSE_MED) {
- HDprintf("Process %d is reading with count[ %llu, %llu ], stride[ %llu, %llu ], start[ %llu, %llu ], "
- "block size[ %llu, %llu ]\n",
+ HDprintf("Process %d is reading with count[ %" PRIuHSIZE ", %" PRIuHSIZE " ], stride[ %" PRIuHSIZE
+ ", %" PRIuHSIZE " ], start[ %" PRIuHSIZE ", %" PRIuHSIZE " ], block size[ %" PRIuHSIZE
+ ", %" PRIuHSIZE " ]\n",
mpi_rank, count[0], count[1], stride[0], stride[1], start[0], start[1], block[0], block[1]);
HDfflush(stdout);
}
@@ -3094,8 +3111,9 @@ test_read_filtered_dataset_overlap(void)
start[1] = 0;
if (VERBOSE_MED) {
- HDprintf("Process %d is reading with count[ %llu, %llu ], stride[ %llu, %llu ], start[ %llu, %llu ], "
- "block size[ %llu, %llu ]\n",
+ HDprintf("Process %d is reading with count[ %" PRIuHSIZE ", %" PRIuHSIZE " ], stride[ %" PRIuHSIZE
+ ", %" PRIuHSIZE " ], start[ %" PRIuHSIZE ", %" PRIuHSIZE " ], block size[ %" PRIuHSIZE
+ ", %" PRIuHSIZE " ]\n",
mpi_rank, count[0], count[1], stride[0], stride[1], start[0], start[1], block[0], block[1]);
HDfflush(stdout);
}
@@ -3324,8 +3342,9 @@ test_read_filtered_dataset_single_no_selection(void)
start[1] = 0;
if (VERBOSE_MED) {
- HDprintf("Process %d is reading with count[ %llu, %llu ], stride[ %llu, %llu ], start[ %llu, %llu ], "
- "block size[ %llu, %llu ]\n",
+ HDprintf("Process %d is reading with count[ %" PRIuHSIZE ", %" PRIuHSIZE " ], stride[ %" PRIuHSIZE
+ ", %" PRIuHSIZE " ], start[ %" PRIuHSIZE ", %" PRIuHSIZE " ], block size[ %" PRIuHSIZE
+ ", %" PRIuHSIZE " ]\n",
mpi_rank, count[0], count[1], stride[0], stride[1], start[0], start[1], block[0], block[1]);
HDfflush(stdout);
}
@@ -3906,8 +3925,9 @@ test_read_filtered_dataset_interleaved_read(void)
start[1] = 0;
if (VERBOSE_MED) {
- HDprintf("Process %d is reading with count[ %llu, %llu ], stride[ %llu, %llu ], start[ %llu, %llu ], "
- "block size[ %llu, %llu ]\n",
+ HDprintf("Process %d is reading with count[ %" PRIuHSIZE ", %" PRIuHSIZE " ], stride[ %" PRIuHSIZE
+ ", %" PRIuHSIZE " ], start[ %" PRIuHSIZE ", %" PRIuHSIZE " ], block size[ %" PRIuHSIZE
+ ", %" PRIuHSIZE " ]\n",
mpi_rank, count[0], count[1], stride[0], stride[1], start[0], start[1], block[0], block[1]);
HDfflush(stdout);
}
@@ -4135,8 +4155,9 @@ test_read_3d_filtered_dataset_no_overlap_separate_pages(void)
start[2] = (hsize_t)mpi_rank;
if (VERBOSE_MED) {
- HDprintf("Process %d is reading with count[ %llu, %llu ], stride[ %llu, %llu ], start[ %llu, %llu ], "
- "block size[ %llu, %llu ]\n",
+ HDprintf("Process %d is reading with count[ %" PRIuHSIZE ", %" PRIuHSIZE " ], stride[ %" PRIuHSIZE
+ ", %" PRIuHSIZE " ], start[ %" PRIuHSIZE ", %" PRIuHSIZE " ], block size[ %" PRIuHSIZE
+ ", %" PRIuHSIZE " ]\n",
mpi_rank, count[0], count[1], stride[0], stride[1], start[0], start[1], block[0], block[1]);
HDfflush(stdout);
}
@@ -4351,8 +4372,9 @@ test_read_3d_filtered_dataset_no_overlap_same_pages(void)
start[2] = 0;
if (VERBOSE_MED) {
- HDprintf("Process %d is reading with count[ %llu, %llu ], stride[ %llu, %llu ], start[ %llu, %llu ], "
- "block size[ %llu, %llu ]\n",
+ HDprintf("Process %d is reading with count[ %" PRIuHSIZE ", %" PRIuHSIZE " ], stride[ %" PRIuHSIZE
+ ", %" PRIuHSIZE " ], start[ %" PRIuHSIZE ", %" PRIuHSIZE " ], block size[ %" PRIuHSIZE
+ ", %" PRIuHSIZE " ]\n",
mpi_rank, count[0], count[1], stride[0], stride[1], start[0], start[1], block[0], block[1]);
HDfflush(stdout);
}
@@ -4574,8 +4596,9 @@ test_read_3d_filtered_dataset_overlap(void)
start[2] = 0;
if (VERBOSE_MED) {
- HDprintf("Process %d is reading with count[ %llu, %llu ], stride[ %llu, %llu ], start[ %llu, %llu ], "
- "block size[ %llu, %llu ]\n",
+ HDprintf("Process %d is reading with count[ %" PRIuHSIZE ", %" PRIuHSIZE " ], stride[ %" PRIuHSIZE
+ ", %" PRIuHSIZE " ], start[ %" PRIuHSIZE ", %" PRIuHSIZE " ], block size[ %" PRIuHSIZE
+ ", %" PRIuHSIZE " ]\n",
mpi_rank, count[0], count[1], stride[0], stride[1], start[0], start[1], block[0], block[1]);
HDfflush(stdout);
}
@@ -4807,8 +4830,9 @@ test_read_cmpd_filtered_dataset_no_conversion_unshared(void)
start[1] = ((hsize_t)mpi_rank * READ_COMPOUND_FILTERED_CHUNKS_NO_CONVERSION_UNSHARED_CH_NCOLS);
if (VERBOSE_MED) {
- HDprintf("Process %d is reading with count[ %llu, %llu ], stride[ %llu, %llu ], start[ %llu, %llu ], "
- "block size[ %llu, %llu ]\n",
+ HDprintf("Process %d is reading with count[ %" PRIuHSIZE ", %" PRIuHSIZE " ], stride[ %" PRIuHSIZE
+ ", %" PRIuHSIZE " ], start[ %" PRIuHSIZE ", %" PRIuHSIZE " ], block size[ %" PRIuHSIZE
+ ", %" PRIuHSIZE " ]\n",
mpi_rank, count[0], count[1], stride[0], stride[1], start[0], start[1], block[0], block[1]);
HDfflush(stdout);
}
@@ -5035,8 +5059,9 @@ test_read_cmpd_filtered_dataset_no_conversion_shared(void)
start[1] = 0;
if (VERBOSE_MED) {
- HDprintf("Process %d is reading with count[ %llu, %llu ], stride[ %llu, %llu ], start[ %llu, %llu ], "
- "block size[ %llu, %llu ]\n",
+ HDprintf("Process %d is reading with count[ %" PRIuHSIZE ", %" PRIuHSIZE " ], stride[ %" PRIuHSIZE
+ ", %" PRIuHSIZE " ], start[ %" PRIuHSIZE ", %" PRIuHSIZE " ], block size[ %" PRIuHSIZE
+ ", %" PRIuHSIZE " ]\n",
mpi_rank, count[0], count[1], stride[0], stride[1], start[0], start[1], block[0], block[1]);
HDfflush(stdout);
}
@@ -5265,8 +5290,9 @@ test_read_cmpd_filtered_dataset_type_conversion_unshared(void)
start[1] = ((hsize_t)mpi_rank * READ_COMPOUND_FILTERED_CHUNKS_TYPE_CONVERSION_UNSHARED_CH_NCOLS);
if (VERBOSE_MED) {
- HDprintf("Process %d is reading with count[ %llu, %llu ], stride[ %llu, %llu ], start[ %llu, %llu ], "
- "block size[ %llu, %llu ]\n",
+ HDprintf("Process %d is reading with count[ %" PRIuHSIZE ", %" PRIuHSIZE " ], stride[ %" PRIuHSIZE
+ ", %" PRIuHSIZE " ], start[ %" PRIuHSIZE ", %" PRIuHSIZE " ], block size[ %" PRIuHSIZE
+ ", %" PRIuHSIZE " ]\n",
mpi_rank, count[0], count[1], stride[0], stride[1], start[0], start[1], block[0], block[1]);
HDfflush(stdout);
}
@@ -5502,8 +5528,9 @@ test_read_cmpd_filtered_dataset_type_conversion_shared(void)
start[1] = 0;
if (VERBOSE_MED) {
- HDprintf("Process %d is reading with count[ %llu, %llu ], stride[ %llu, %llu ], start[ %llu, %llu ], "
- "block size[ %llu, %llu ]\n",
+ HDprintf("Process %d is reading with count[ %" PRIuHSIZE ", %" PRIuHSIZE " ], stride[ %" PRIuHSIZE
+ ", %" PRIuHSIZE " ], start[ %" PRIuHSIZE ", %" PRIuHSIZE " ], block size[ %" PRIuHSIZE
+ ", %" PRIuHSIZE " ]\n",
mpi_rank, count[0], count[1], stride[0], stride[1], start[0], start[1], block[0], block[1]);
HDfflush(stdout);
}
@@ -5803,8 +5830,10 @@ test_write_parallel_read_serial(void)
offset[2] = 0;
if (VERBOSE_MED) {
- HDprintf("Process %d is writing with count[ %llu, %llu, %llu ], stride[ %llu, %llu, %llu ], offset[ "
- "%llu, %llu, %llu ], block size[ %llu, %llu, %llu ]\n",
+ HDprintf("Process %d is writing with count[ %" PRIuHSIZE ", %" PRIuHSIZE ", %" PRIuHSIZE
+ " ], stride[ %" PRIuHSIZE ", %" PRIuHSIZE ", %" PRIuHSIZE " ], offset[ %" PRIuHSIZE
+ ", %" PRIuHSIZE ", %" PRIuHSIZE " ], block size[ %" PRIuHSIZE ", %" PRIuHSIZE ", %" PRIuHSIZE
+ " ]\n",
mpi_rank, count[0], count[1], count[2], stride[0], stride[1], stride[2], offset[0],
offset[1], offset[2], block[0], block[1], block[2]);
HDfflush(stdout);
@@ -5973,8 +6002,9 @@ test_shrinking_growing_chunks(void)
start[1] = 0;
if (VERBOSE_MED) {
- HDprintf("Process %d is writing with count[ %llu, %llu ], stride[ %llu, %llu ], start[ %llu, %llu ], "
- "block size[ %llu, %llu ]\n",
+ HDprintf("Process %d is writing with count[ %" PRIuHSIZE ", %" PRIuHSIZE " ], stride[ %" PRIuHSIZE
+ ", %" PRIuHSIZE " ], start[ %" PRIuHSIZE ", %" PRIuHSIZE " ], block size[ %" PRIuHSIZE
+ ", %" PRIuHSIZE " ]\n",
mpi_rank, count[0], count[1], stride[0], stride[1], start[0], start[1], block[0], block[1]);
HDfflush(stdout);
}
diff --git a/testpar/t_mdset.c b/testpar/t_mdset.c
index 8fe5e14..3041e77 100644
--- a/testpar/t_mdset.c
+++ b/testpar/t_mdset.c
@@ -129,12 +129,6 @@ zero_dim_dset(void)
/*
* Example of using PHDF5 to create ndatasets datasets. Each process write
* a slab of array to the file.
- *
- * Changes: Updated function to use a dynamically calculated size,
- * instead of the old SIZE #define. This should allow it
- * to function with an arbitrary number of processors.
- *
- * JRM - 8/11/04
*/
void
multiple_dset_write(void)
@@ -218,12 +212,6 @@ multiple_dset_write(void)
}
/* Example of using PHDF5 to create, write, and read compact dataset.
- *
- * Changes: Updated function to use a dynamically calculated size,
- * instead of the old SIZE #define. This should allow it
- * to function with an arbitrary number of processors.
- *
- * JRM - 8/11/04
*/
void
compact_dataset(void)
@@ -353,14 +341,6 @@ compact_dataset(void)
/*
* Example of using PHDF5 to create, write, and read dataset and attribute
* of Null dataspace.
- *
- * Changes: Removed the assert that mpi_size <= the SIZE #define.
- * As best I can tell, this assert isn't needed here,
- * and in any case, the SIZE #define is being removed
- * in an update of the functions in this file to run
- * with an arbitrary number of processes.
- *
- * JRM - 8/24/04
*/
void
null_dataset(void)
@@ -465,14 +445,6 @@ null_dataset(void)
* Actual data is _not_ written to these datasets. Dataspaces are exact
* sizes(2GB, 4GB, etc.), but the metadata for the file pushes the file over
* the boundary of interest.
- *
- * Changes: Removed the assert that mpi_size <= the SIZE #define.
- * As best I can tell, this assert isn't needed here,
- * and in any case, the SIZE #define is being removed
- * in an update of the functions in this file to run
- * with an arbitrary number of processes.
- *
- * JRM - 8/11/04
*/
void
big_dataset(void)
@@ -594,16 +566,6 @@ big_dataset(void)
/* Example of using PHDF5 to read a partial written dataset. The dataset does
* not have actual data written to the entire raw data area and relies on the
* default fill value of zeros to work correctly.
- *
- * Changes: Removed the assert that mpi_size <= the SIZE #define.
- * As best I can tell, this assert isn't needed here,
- * and in any case, the SIZE #define is being removed
- * in an update of the functions in this file to run
- * with an arbitrary number of processes.
- *
- * Also added code to free dynamically allocated buffers.
- *
- * JRM - 8/11/04
*/
void
dataset_fillvalue(void)
@@ -710,15 +672,16 @@ dataset_fillvalue(void)
for (i = 0; i < (int)dset_dims[0]; i++)
for (j = 0; j < (int)dset_dims[1]; j++)
for (k = 0; k < (int)dset_dims[2]; k++)
- for (l = 0; l < (int)dset_dims[3]; l++, twdata++, trdata++)
+ for (l = 0; l < (int)dset_dims[3]; l++, trdata++)
if (*trdata != 0)
if (err_num++ < MAX_ERR_REPORT || VERBOSE_MED)
- HDprintf("Dataset Verify failed at [%d][%d][%d][%d]: expect 0, got %d\n", i,
- j, k, l, *trdata);
+ HDprintf(
+ "Rank %d: Dataset Verify failed at [%d][%d][%d][%d]: expect 0, got %d\n",
+ mpi_rank, i, j, k, l, *trdata);
if (err_num > MAX_ERR_REPORT && !VERBOSE_MED)
- HDprintf("[more errors ...]\n");
+ HDprintf("Rank %d: [more errors ...]\n", mpi_rank);
if (err_num) {
- HDprintf("%d errors found in check_value\n", err_num);
+ HDprintf("Rank %d: %d errors found in check_value\n", mpi_rank, err_num);
nerrors++;
}
}
@@ -856,12 +819,6 @@ collective_group_write_independent_group_read(void)
/* Write multiple groups with a chunked dataset in each group collectively.
* These groups and datasets are for testing independent read later.
- *
- * Changes: Updated function to use a dynamically calculated size,
- * instead of the old SIZE #define. This should allow it
- * to function with an arbitrary number of processors.
- *
- * JRM - 8/16/04
*/
void
collective_group_write(void)
@@ -896,6 +853,7 @@ collective_group_write(void)
plist = create_faccess_plist(MPI_COMM_WORLD, MPI_INFO_NULL, facc_type);
fid = H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, plist);
+ VRFY((fid >= 0), "H5Fcreate");
H5Pclose(plist);
/* decide the hyperslab according to process number. */
@@ -909,13 +867,13 @@ collective_group_write(void)
ret2 = H5Sselect_hyperslab(filespace, H5S_SELECT_SET, chunk_origin, chunk_dims, count, chunk_dims);
VRFY((memspace >= 0), "memspace");
VRFY((filespace >= 0), "filespace");
- VRFY((ret1 >= 0), "mgroup memspace selection");
- VRFY((ret2 >= 0), "mgroup filespace selection");
+ VRFY((ret1 == 0), "mgroup memspace selection");
+ VRFY((ret2 == 0), "mgroup filespace selection");
dcpl = H5Pcreate(H5P_DATASET_CREATE);
ret1 = H5Pset_chunk(dcpl, 2, chunk_size);
VRFY((dcpl >= 0), "dataset creation property");
- VRFY((ret1 >= 0), "set chunk for dataset creation property");
+ VRFY((ret1 == 0), "set chunk for dataset creation property");
/* creates ngroups groups under the root group, writes chunked
* datasets in parallel. */
@@ -932,10 +890,14 @@ collective_group_write(void)
for (j = 0; j < size; j++)
outme[(i * size) + j] = (i + j) * 1000 + mpi_rank;
- H5Dwrite(did, H5T_NATIVE_INT, memspace, filespace, H5P_DEFAULT, outme);
+ ret1 = H5Dwrite(did, H5T_NATIVE_INT, memspace, filespace, H5P_DEFAULT, outme);
+ VRFY((ret1 == 0), "H5Dwrite");
- H5Dclose(did);
- H5Gclose(gid);
+ ret1 = H5Dclose(did);
+ VRFY((ret1 == 0), "H5Dclose");
+
+ ret1 = H5Gclose(gid);
+ VRFY((ret1 == 0), "H5Gclose");
#ifdef BARRIER_CHECKS
if (!((m + 1) % 10)) {
@@ -948,7 +910,9 @@ collective_group_write(void)
H5Pclose(dcpl);
H5Sclose(filespace);
H5Sclose(memspace);
- H5Fclose(fid);
+
+ ret1 = H5Fclose(fid);
+ VRFY((ret1 == 0), "H5Fclose");
HDfree(outme);
}
@@ -964,6 +928,7 @@ independent_group_read(void)
const H5Ptest_param_t *pt;
char * filename;
int ngroups;
+ herr_t ret;
pt = GetTestParameters();
filename = pt->name;
@@ -975,6 +940,7 @@ independent_group_read(void)
H5Pset_all_coll_metadata_ops(plist, FALSE);
fid = H5Fopen(filename, H5F_ACC_RDONLY, plist);
+ VRFY((fid > 0), "H5Fopen");
H5Pclose(plist);
/* open groups and read datasets. Odd number processes read even number
@@ -989,20 +955,11 @@ independent_group_read(void)
group_dataset_read(fid, mpi_rank, m);
}
- H5Fclose(fid);
+ ret = H5Fclose(fid);
+ VRFY((ret == 0), "H5Fclose");
}
/* Open and read datasets and compare data
- *
- * Changes: Updated function to use a dynamically calculated size,
- * instead of the old SIZE #define. This should allow it
- * to function with an arbitrary number of processors.
- *
- * Also added code to verify the results of dynamic memory
- * allocations, and to free dynamically allocated memeory
- * when we are done with it.
- *
- * JRM - 8/16/04
*/
static void
group_dataset_read(hid_t fid, int mpi_rank, int m)
@@ -1035,16 +992,17 @@ group_dataset_read(hid_t fid, int mpi_rank, int m)
/* this is the original value */
for (i = 0; i < size; i++)
- for (j = 0; j < size; j++) {
+ for (j = 0; j < size; j++)
outdata[(i * size) + j] = (i + j) * 1000 + mpi_rank;
- }
/* compare the original value(outdata) to the value in file(indata).*/
ret = check_value(indata, outdata, size);
VRFY((ret == 0), "check the data");
- H5Dclose(did);
- H5Gclose(gid);
+ ret = H5Dclose(did);
+ VRFY((ret == 0), "H5Dclose");
+ ret = H5Gclose(gid);
+ VRFY((ret == 0), "H5Gclose");
HDfree(indata);
HDfree(outdata);
@@ -1076,11 +1034,6 @@ group_dataset_read(hid_t fid, int mpi_rank, int m)
* + means the group has attribute(s).
* ' means the datasets in the groups have attribute(s).
*
- * Changes: Updated function to use a dynamically calculated size,
- * instead of the old SIZE #define. This should allow it
- * to function with an arbitrary number of processors.
- *
- * JRM - 8/16/04
*/
void
multiple_group_write(void)
@@ -1164,12 +1117,6 @@ multiple_group_write(void)
/*
* In a group, creates NDATASETS datasets. Each process writes a hyperslab
* of a data array to the file.
- *
- * Changes: Updated function to use a dynamically calculated size,
- * instead of the old SIZE #define. This should allow it
- * to function with an arbitrary number of processors.
- *
- * JRM - 8/16/04
*/
static void
write_dataset(hid_t memspace, hid_t filespace, hid_t gid)
@@ -1243,12 +1190,6 @@ create_group_recursive(hid_t memspace, hid_t filespace, hid_t gid, int counter)
/*
* This function is to verify the data from multiple group testing. It opens
* every dataset in every group and check their correctness.
- *
- * Changes: Updated function to use a dynamically calculated size,
- * instead of the old SIZE #define. This should allow it
- * to function with an arbitrary number of processors.
- *
- * JRM - 8/11/04
*/
void
multiple_group_read(void)
@@ -1323,12 +1264,6 @@ multiple_group_read(void)
/*
* This function opens all the datasets in a certain, checks the data using
* dataset_vrfy function.
- *
- * Changes: Updated function to use a dynamically calculated size,
- * instead of the old SIZE #define. This should allow it
- * to function with an arbitrary number of processors.
- *
- * JRM - 8/11/04
*/
static int
read_dataset(hid_t memspace, hid_t filespace, hid_t gid)
@@ -1456,10 +1391,8 @@ read_attribute(hid_t obj_id, int this_type, int num)
if (this_type == is_group) {
HDsprintf(attr_name, "Group Attribute %d", num);
aid = H5Aopen(obj_id, attr_name, H5P_DEFAULT);
- if (MAINPROCESS) {
- H5Aread(aid, H5T_NATIVE_INT, &in_num);
- vrfy_errors = dataset_vrfy(NULL, NULL, NULL, group_block, &in_num, &num);
- }
+ H5Aread(aid, H5T_NATIVE_INT, &in_num);
+ vrfy_errors = dataset_vrfy(NULL, NULL, NULL, group_block, &in_num, &num);
H5Aclose(aid);
}
else if (this_type == is_dset) {
@@ -1467,10 +1400,8 @@ read_attribute(hid_t obj_id, int this_type, int num)
for (i = 0; i < 8; i++)
out_data[i] = i;
aid = H5Aopen(obj_id, attr_name, H5P_DEFAULT);
- if (MAINPROCESS) {
- H5Aread(aid, H5T_NATIVE_INT, in_data);
- vrfy_errors = dataset_vrfy(NULL, NULL, NULL, dset_block, in_data, out_data);
- }
+ H5Aread(aid, H5T_NATIVE_INT, in_data);
+ vrfy_errors = dataset_vrfy(NULL, NULL, NULL, dset_block, in_data, out_data);
H5Aclose(aid);
}
@@ -1479,12 +1410,6 @@ read_attribute(hid_t obj_id, int this_type, int num)
/* This functions compares the original data with the read-in data for its
* hyperslab part only by process ID.
- *
- * Changes: Modified function to use a passed in size parameter
- * instead of the old SIZE #define. This should let us
- * run with an arbitrary number of processes.
- *
- * JRM - 8/16/04
*/
static int
check_value(DATATYPE *indata, DATATYPE *outdata, int size)
@@ -1517,12 +1442,6 @@ check_value(DATATYPE *indata, DATATYPE *outdata, int size)
}
/* Decide the portion of data chunk in dataset by process ID.
- *
- * Changes: Modified function to use a passed in size parameter
- * instead of the old SIZE #define. This should let us
- * run with an arbitrary number of processes.
- *
- * JRM - 8/11/04
*/
static void
@@ -1564,8 +1483,6 @@ get_slab(hsize_t chunk_origin[], hsize_t chunk_dims[], hsize_t count[], hsize_t
* This function reproduces this situation. At present the test hangs
* on failure.
* JRM - 9/13/04
- *
- * Changes: None.
*/
#define N 4
@@ -1809,10 +1726,6 @@ io_mode_confusion(void)
* cache clients will have to construct on disk images on demand.
*
* JRM -- 10/13/10
- *
- * Changes:
- * Break it into two parts, a writer to write the file and a reader
- * the correctness of the writer. AKC -- 2010/10/27
*/
#define NUM_DATA_SETS 4
diff --git a/testpar/t_pread.c b/testpar/t_pread.c
index cf91b31..17091cb 100644
--- a/testpar/t_pread.c
+++ b/testpar/t_pread.c
@@ -35,7 +35,7 @@ const char *FILENAMES[NFILENAME + 1] = {"reloc_t_pread_data_file", "reloc_t_prea
#define LIMIT_NPROC 6
-hbool_t pass = true;
+hbool_t pass = TRUE;
static const char *random_hdf5_text = "Now is the time for all first-time-users of HDF5 to read their \
manual or go thru the tutorials!\n\
While you\'re at it, now is also the time to read up on MPI-IO.";
@@ -112,7 +112,7 @@ generate_test_file(MPI_Comm comm, int mpi_rank, int group_id)
float nextValue;
float * data_slice = NULL;
- pass = true;
+ pass = TRUE;
HDassert(comm != MPI_COMM_NULL);
@@ -256,14 +256,14 @@ generate_test_file(MPI_Comm comm, int mpi_rank, int group_id)
if (pass) {
if ((dset_id = H5Dcreate2(file_id, "dataset0", H5T_NATIVE_FLOAT, filespace, H5P_DEFAULT, H5P_DEFAULT,
H5P_DEFAULT)) < 0) {
- pass = false;
+ pass = FALSE;
failure_mssg = "H5Dcreate2() failed.\n";
}
}
if (pass) {
if ((H5Dwrite(dset_id, H5T_NATIVE_FLOAT, memspace, filespace, dxpl_id, data_slice)) < 0) {
- pass = false;
+ pass = FALSE;
failure_mssg = "H5Dwrite() failed.\n";
}
}
@@ -273,14 +273,14 @@ generate_test_file(MPI_Comm comm, int mpi_rank, int group_id)
if (pass) {
if ((dcpl_id = H5Pcreate(H5P_DATASET_CREATE)) < 0) {
- pass = false;
+ pass = FALSE;
failure_mssg = "H5Pcreate() failed.\n";
}
}
if (pass) {
if ((H5Pset_chunk(dcpl_id, 1, chunk)) < 0) {
- pass = false;
+ pass = FALSE;
failure_mssg = "H5Pset_chunk() failed.\n";
}
}
@@ -289,27 +289,27 @@ generate_test_file(MPI_Comm comm, int mpi_rank, int group_id)
if ((dset_id_ch = H5Dcreate2(file_id, "dataset0_chunked", H5T_NATIVE_FLOAT, filespace, H5P_DEFAULT,
dcpl_id, H5P_DEFAULT)) < 0) {
- pass = false;
+ pass = FALSE;
failure_mssg = "H5Dcreate2() failed.\n";
}
}
if (pass) {
if ((H5Dwrite(dset_id_ch, H5T_NATIVE_FLOAT, memspace, filespace, dxpl_id, data_slice)) < 0) {
- pass = false;
+ pass = FALSE;
failure_mssg = "H5Dwrite() failed.\n";
}
}
if (pass || (dcpl_id != -1)) {
if (H5Pclose(dcpl_id) < 0) {
- pass = false;
+ pass = FALSE;
failure_mssg = "H5Pclose(dcpl_id) failed.\n";
}
}
if (pass || (dset_id_ch != -1)) {
if (H5Dclose(dset_id_ch) < 0) {
- pass = false;
+ pass = FALSE;
failure_mssg = "H5Dclose(dset_id_ch) failed.\n";
}
}
@@ -317,49 +317,49 @@ generate_test_file(MPI_Comm comm, int mpi_rank, int group_id)
/* close file, etc. */
if (pass || (dset_id != -1)) {
if (H5Dclose(dset_id) < 0) {
- pass = false;
+ pass = FALSE;
failure_mssg = "H5Dclose(dset_id) failed.\n";
}
}
if (pass || (memspace != -1)) {
if (H5Sclose(memspace) < 0) {
- pass = false;
+ pass = FALSE;
failure_mssg = "H5Sclose(memspace) failed.\n";
}
}
if (pass || (filespace != -1)) {
if (H5Sclose(filespace) < 0) {
- pass = false;
+ pass = FALSE;
failure_mssg = "H5Sclose(filespace) failed.\n";
}
}
if (pass || (file_id != -1)) {
if (H5Fclose(file_id) < 0) {
- pass = false;
+ pass = FALSE;
failure_mssg = "H5Fclose(file_id) failed.\n";
}
}
if (pass || (dxpl_id != -1)) {
if (H5Pclose(dxpl_id) < 0) {
- pass = false;
+ pass = FALSE;
failure_mssg = "H5Pclose(dxpl_id) failed.\n";
}
}
if (pass || (fapl_id != -1)) {
if (H5Pclose(fapl_id) < 0) {
- pass = false;
+ pass = FALSE;
failure_mssg = "H5Pclose(fapl_id) failed.\n";
}
}
if (pass || (fctmpl != -1)) {
if (H5Pclose(fctmpl) < 0) {
- pass = false;
+ pass = FALSE;
failure_mssg = "H5Pclose(fctmpl) failed.\n";
}
}
@@ -661,14 +661,14 @@ test_parallel_read(MPI_Comm comm, int mpi_rank, int mpi_size, int group_id)
if (pass || (memspace != -1)) {
if (H5Sclose(memspace) < 0) {
- pass = false;
+ pass = FALSE;
failure_mssg = "H5Sclose(memspace) failed.\n";
}
}
if (pass || (filespace != -1)) {
if (H5Sclose(filespace) < 0) {
- pass = false;
+ pass = FALSE;
failure_mssg = "H5Sclose(filespace) failed.\n";
}
}
@@ -859,7 +859,7 @@ test_parallel_read(MPI_Comm comm, int mpi_rank, int mpi_size, int group_id)
if (pass || (filespace != -1)) {
if (H5Sclose(filespace) < 0) {
- pass = false;
+ pass = FALSE;
failure_mssg = "H5Sclose(filespace) failed.\n";
}
}
@@ -956,7 +956,7 @@ test_parallel_read(MPI_Comm comm, int mpi_rank, int mpi_size, int group_id)
if (pass || (memspace != -1)) {
if (H5Sclose(memspace) < 0) {
- pass = false;
+ pass = FALSE;
failure_mssg = "H5Sclose(memspace) failed.\n";
}
}
@@ -969,7 +969,7 @@ test_parallel_read(MPI_Comm comm, int mpi_rank, int mpi_size, int group_id)
if (pass || (dxpl_id != -1)) {
if (H5Pclose(dxpl_id) < 0) {
- pass = false;
+ pass = FALSE;
failure_mssg = "H5Pclose(dxpl_id) failed.\n";
}
}
@@ -978,28 +978,28 @@ test_parallel_read(MPI_Comm comm, int mpi_rank, int mpi_size, int group_id)
/* close file, etc. */
if (pass || (dset_id != -1)) {
if (H5Dclose(dset_id) < 0) {
- pass = false;
+ pass = FALSE;
failure_mssg = "H5Dclose(dset_id) failed.\n";
}
}
if (pass || (dset_id_ch != -1)) {
if (H5Dclose(dset_id_ch) < 0) {
- pass = false;
+ pass = FALSE;
failure_mssg = "H5Dclose(dset_id_ch) failed.\n";
}
}
if (pass || (file_id != -1)) {
if (H5Fclose(file_id) < 0) {
- pass = false;
+ pass = FALSE;
failure_mssg = "H5Fclose(file_id) failed.\n";
}
}
if (pass || (fapl_id != -1)) {
if (H5Pclose(fapl_id) < 0) {
- pass = false;
+ pass = FALSE;
failure_mssg = "H5Pclose(fapl_id) failed.\n";
}
}
diff --git a/testpar/t_prop.c b/testpar/t_prop.c
index 27de777..92c8bc0 100644
--- a/testpar/t_prop.c
+++ b/testpar/t_prop.c
@@ -441,3 +441,192 @@ test_plist_ed(void)
ret = H5Pclose(acpl);
VRFY((ret >= 0), "H5Pclose succeeded");
}
+
+void
+external_links(void)
+{
+ hid_t lcpl = H5I_INVALID_HID; /* link create prop. list */
+ hid_t lapl = H5I_INVALID_HID; /* link access prop. list */
+ hid_t fapl = H5I_INVALID_HID; /* file access prop. list */
+ hid_t gapl = H5I_INVALID_HID; /* group access prop. list */
+ hid_t fid = H5I_INVALID_HID; /* file id */
+ hid_t group = H5I_INVALID_HID; /* group id */
+ int mpi_size, mpi_rank;
+
+ MPI_Comm comm;
+ int doIO;
+ int i, mrc;
+
+ herr_t ret; /* Generic return value */
+ htri_t tri_status; /* tri return value */
+
+ const char *filename = "HDF5test.h5";
+ const char *filename_ext = "HDF5test_ext.h5";
+ const char *group_path = "/Base/Block/Step";
+ const char *link_name = "link"; /* external link */
+ char link_path[50];
+
+ if (VERBOSE_MED)
+ HDprintf("Check external links\n");
+
+ /* set up MPI parameters */
+ MPI_Comm_size(MPI_COMM_WORLD, &mpi_size);
+ MPI_Comm_rank(MPI_COMM_WORLD, &mpi_rank);
+
+ /* Check MPI communicator access properties are passed to
+ linked external files */
+
+ if (mpi_rank == 0) {
+
+ lcpl = H5Pcreate(H5P_LINK_CREATE);
+ VRFY((lcpl >= 0), "H5Pcreate succeeded");
+
+ ret = H5Pset_create_intermediate_group(lcpl, 1);
+ VRFY((ret >= 0), "H5Pset_create_intermediate_group succeeded");
+
+ /* Create file to serve as target for external link.*/
+ fid = H5Fcreate(filename_ext, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT);
+ VRFY((fid >= 0), "H5Fcreate succeeded");
+
+ group = H5Gcreate2(fid, group_path, lcpl, H5P_DEFAULT, H5P_DEFAULT);
+ VRFY((group >= 0), "H5Gcreate succeeded");
+
+ ret = H5Gclose(group);
+ VRFY((ret >= 0), "H5Gclose succeeded");
+
+ ret = H5Fclose(fid);
+ VRFY((ret >= 0), "H5Fclose succeeded");
+
+ fapl = H5Pcreate(H5P_FILE_ACCESS);
+ VRFY((fapl >= 0), "H5Pcreate succeeded");
+
+ /* Create a new file using the file access property list. */
+ fid = H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl);
+ VRFY((fid >= 0), "H5Fcreate succeeded");
+
+ ret = H5Pclose(fapl);
+ VRFY((ret >= 0), "H5Pclose succeeded");
+
+ group = H5Gcreate2(fid, group_path, lcpl, H5P_DEFAULT, H5P_DEFAULT);
+ VRFY((group >= 0), "H5Gcreate succeeded");
+
+ /* Create external links to the target files. */
+ ret = H5Lcreate_external(filename_ext, group_path, group, link_name, H5P_DEFAULT, H5P_DEFAULT);
+ VRFY((ret >= 0), "H5Lcreate_external succeeded");
+
+ /* Close and release resources. */
+ ret = H5Pclose(lcpl);
+ VRFY((ret >= 0), "H5Pclose succeeded");
+ ret = H5Gclose(group);
+ VRFY((ret >= 0), "H5Gclose succeeded");
+ ret = H5Fclose(fid);
+ VRFY((ret >= 0), "H5Fclose succeeded");
+ }
+
+ MPI_Barrier(MPI_COMM_WORLD);
+
+ /*
+ * For the first case, use all the processes. For the second case
+ * use a sub-communicator to verify the correct communicator is
+ * being used for the externally linked files.
+ * There is no way to determine if MPI info is being used for the
+ * externally linked files.
+ */
+
+ for (i = 0; i < 2; i++) {
+
+ if (i == 0) {
+ doIO = 1;
+ comm = MPI_COMM_WORLD;
+ }
+ else {
+ doIO = mpi_rank % 2;
+ mrc = MPI_Comm_split(MPI_COMM_WORLD, doIO, mpi_rank, &comm);
+ VRFY((mrc == MPI_SUCCESS), "");
+ }
+
+ if (doIO) {
+ fapl = H5Pcreate(H5P_FILE_ACCESS);
+ VRFY((fapl >= 0), "H5Pcreate succeeded");
+ ret = H5Pset_fapl_mpio(fapl, comm, MPI_INFO_NULL);
+ VRFY((fapl >= 0), "H5Pset_fapl_mpio succeeded");
+
+ fid = H5Fopen(filename, H5F_ACC_RDWR, fapl);
+ VRFY((fid >= 0), "H5Fopen succeeded");
+
+ /* test opening a group that is to an external link, the external linked
+ file should inherit the source file's access properties */
+ HDsprintf(link_path, "%s%s%s", group_path, "/", link_name);
+ group = H5Gopen2(fid, link_path, H5P_DEFAULT);
+ VRFY((group >= 0), "H5Gopen succeeded");
+ ret = H5Gclose(group);
+ VRFY((ret >= 0), "H5Gclose succeeded");
+
+ /* test opening a group that is external link by setting group
+ creation property */
+ gapl = H5Pcreate(H5P_GROUP_ACCESS);
+ VRFY((gapl >= 0), "H5Pcreate succeeded");
+
+ ret = H5Pset_elink_fapl(gapl, fapl);
+ VRFY((ret >= 0), "H5Pset_elink_fapl succeeded");
+
+ group = H5Gopen2(fid, link_path, gapl);
+ VRFY((group >= 0), "H5Gopen succeeded");
+
+ ret = H5Gclose(group);
+ VRFY((ret >= 0), "H5Gclose succeeded");
+
+ ret = H5Pclose(gapl);
+ VRFY((ret >= 0), "H5Pclose succeeded");
+
+ /* test link APIs */
+ lapl = H5Pcreate(H5P_LINK_ACCESS);
+ VRFY((lapl >= 0), "H5Pcreate succeeded");
+
+ ret = H5Pset_elink_fapl(lapl, fapl);
+ VRFY((ret >= 0), "H5Pset_elink_fapl succeeded");
+
+ tri_status = H5Lexists(fid, link_path, H5P_DEFAULT);
+ VRFY((tri_status == TRUE), "H5Lexists succeeded");
+
+ tri_status = H5Lexists(fid, link_path, lapl);
+ VRFY((tri_status == TRUE), "H5Lexists succeeded");
+
+ group = H5Oopen(fid, link_path, H5P_DEFAULT);
+ VRFY((group >= 0), "H5Oopen succeeded");
+
+ ret = H5Oclose(group);
+ VRFY((ret >= 0), "H5Oclose succeeded");
+
+ group = H5Oopen(fid, link_path, lapl);
+ VRFY((group >= 0), "H5Oopen succeeded");
+
+ ret = H5Oclose(group);
+ VRFY((ret >= 0), "H5Oclose succeeded");
+
+ ret = H5Pclose(lapl);
+ VRFY((ret >= 0), "H5Pclose succeeded");
+
+ /* close the remaining resources */
+
+ ret = H5Pclose(fapl);
+ VRFY((ret >= 0), "H5Pclose succeeded");
+
+ ret = H5Fclose(fid);
+ VRFY((ret >= 0), "H5Fclose succeeded");
+
+ if (i == 1) {
+ mrc = MPI_Comm_free(&comm);
+ VRFY((mrc == MPI_SUCCESS), "MPI_Comm_free succeeded");
+ }
+ }
+ }
+
+ MPI_Barrier(MPI_COMM_WORLD);
+
+ /* delete the test files */
+ if (mpi_rank == 0) {
+ MPI_File_delete(filename, MPI_INFO_NULL);
+ MPI_File_delete(filename_ext, MPI_INFO_NULL);
+ }
+}
diff --git a/testpar/t_shapesame.c b/testpar/t_shapesame.c
index 6ad6694..2dd867a 100644
--- a/testpar/t_shapesame.c
+++ b/testpar/t_shapesame.c
@@ -441,11 +441,8 @@ hs_dr_pio_test__setup(const int test_num, const int edge_size, const int checker
VRFY((ret >= 0), "H5Dwrite() small_dataset initial write succeeded");
/* sync with the other processes before checking data */
- if (!use_collective_io) {
-
- mrc = MPI_Barrier(MPI_COMM_WORLD);
- VRFY((mrc == MPI_SUCCESS), "Sync after small dataset writes");
- }
+ mrc = MPI_Barrier(MPI_COMM_WORLD);
+ VRFY((mrc == MPI_SUCCESS), "Sync after small dataset writes");
/* read the small data set back to verify that it contains the
* expected data. Note that each process reads in the entire
@@ -515,11 +512,8 @@ hs_dr_pio_test__setup(const int test_num, const int edge_size, const int checker
VRFY((ret >= 0), "H5Dwrite() large_dataset initial write succeeded");
/* sync with the other processes before checking data */
- if (!use_collective_io) {
-
- mrc = MPI_Barrier(MPI_COMM_WORLD);
- VRFY((mrc == MPI_SUCCESS), "Sync after large dataset writes");
- }
+ mrc = MPI_Barrier(MPI_COMM_WORLD);
+ VRFY((mrc == MPI_SUCCESS), "Sync after large dataset writes");
/* read the large data set back to verify that it contains the
* expected data. Note that each process reads in the entire
@@ -547,12 +541,8 @@ hs_dr_pio_test__setup(const int test_num, const int edge_size, const int checker
VRFY((mis_match == FALSE), "large ds init data good.");
/* sync with the other processes before changing data */
-
- if (!use_collective_io) {
-
- mrc = MPI_Barrier(MPI_COMM_WORLD);
- VRFY((mrc == MPI_SUCCESS), "Sync initial values check");
- }
+ mrc = MPI_Barrier(MPI_COMM_WORLD);
+ VRFY((mrc == MPI_SUCCESS), "Sync initial values check");
return;
@@ -2000,8 +1990,8 @@ contig_hs_dr_pio_test(ShapeSameTestMethods sstest_type)
}
if ((MAINPROCESS) && (tests_skipped > 0)) {
- HDfprintf(stdout, " %lld of %lld subtests skipped to expedite testing.\n", tests_skipped,
- total_tests);
+ HDfprintf(stdout, " %" PRId64 " of %" PRId64 " subtests skipped to expedite testing.\n",
+ tests_skipped, total_tests);
}
return;
@@ -3913,16 +3903,16 @@ ckrbrd_hs_dr_pio_test(ShapeSameTestMethods sstest_type)
} /* end of switch(sstest_type) */
#if CONTIG_HS_DR_PIO_TEST__DEBUG
if ((MAINPROCESS) && (tests_skipped > 0)) {
- HDfprintf(stdout, " run/skipped/total = %lld/%lld/%lld.\n", tests_run, tests_skipped,
- total_tests);
+ HDfprintf(stdout, " run/skipped/total = %" PRId64 "/%" PRId64 "/%" PRId64 ".\n",
+ tests_run, tests_skipped, total_tests);
}
#endif /* CONTIG_HS_DR_PIO_TEST__DEBUG */
}
}
if ((MAINPROCESS) && (tests_skipped > 0)) {
- HDfprintf(stdout, " %lld of %lld subtests skipped to expedite testing.\n", tests_skipped,
- total_tests);
+ HDfprintf(stdout, " %" PRId64 " of %" PRId64 " subtests skipped to expedite testing.\n",
+ tests_skipped, total_tests);
}
return;
diff --git a/testpar/testphdf5.c b/testpar/testphdf5.c
index e693bc0..0beb6d7 100644
--- a/testpar/testphdf5.c
+++ b/testpar/testphdf5.c
@@ -33,9 +33,6 @@ int ngroups = 512; /* number of groups to create in root
int facc_type = FACC_MPIO; /*Test file access type */
int dxfer_coll_type = DXFER_COLLECTIVE_IO;
-H5E_auto2_t old_func; /* previous error handler */
-void * old_client_data; /* previous error handler arg.*/
-
/* other option flags */
/* FILENAME and filenames must have the same number of names.
@@ -353,6 +350,8 @@ main(int argc, char **argv)
AddTest("props", test_file_properties, NULL, "Coll Metadata file property settings", PARATESTFILE);
+ AddTest("delete", test_delete, NULL, "MPI-IO VFD file delete", PARATESTFILE);
+
AddTest("idsetw", dataset_writeInd, NULL, "dataset independent write", PARATESTFILE);
AddTest("idsetr", dataset_readInd, NULL, "dataset independent read", PARATESTFILE);
diff --git a/testpar/testphdf5.h b/testpar/testphdf5.h
index d1469df..e3075a3 100644
--- a/testpar/testphdf5.h
+++ b/testpar/testphdf5.h
@@ -225,18 +225,18 @@ typedef enum {
} ShapeSameTestMethods;
/* Shared global variables */
-extern int dim0, dim1; /*Dataset dimensions */
-extern int chunkdim0, chunkdim1; /*Chunk dimensions */
-extern int nerrors; /*errors count */
-extern H5E_auto2_t old_func; /* previous error handler */
-extern void * old_client_data; /*previous error handler arg.*/
-extern int facc_type; /*Test file access type */
-extern int dxfer_coll_type;
+extern int dim0, dim1; /*Dataset dimensions */
+extern int chunkdim0, chunkdim1; /*Chunk dimensions */
+extern int nerrors; /*errors count */
+extern int facc_type; /*Test file access type */
+extern int dxfer_coll_type;
/* Test program prototypes */
void test_plist_ed(void);
+void external_links(void);
void zero_dim_dset(void);
void test_file_properties(void);
+void test_delete(void);
void multiple_dset_write(void);
void multiple_group_write(void);
void multiple_group_read(void);
diff --git a/tools/lib/h5diff.c b/tools/lib/h5diff.c
index 19a19b0..57cfaf2 100644
--- a/tools/lib/h5diff.c
+++ b/tools/lib/h5diff.c
@@ -687,7 +687,7 @@ h5diff(const char *fname1, const char *fname2, const char *objname1, const char
/* if any object is specified */
if (objname1) {
/* make the given object1 fullpath, start with "/" */
- if (HDstrncmp(objname1, "/", 1)) {
+ if (HDstrncmp(objname1, "/", 1) != 0) {
#ifdef H5_HAVE_ASPRINTF
/* Use the asprintf() routine, since it does what we're trying to do below */
if (HDasprintf(&obj1fullname, "/%s", objname1) < 0)
@@ -706,7 +706,7 @@ h5diff(const char *fname1, const char *fname2, const char *objname1, const char
H5TOOLS_DEBUG("obj1fullname = %s", obj1fullname);
/* make the given object2 fullpath, start with "/" */
- if (HDstrncmp(objname2, "/", 1)) {
+ if (HDstrncmp(objname2, "/", 1) != 0) {
#ifdef H5_HAVE_ASPRINTF
/* Use the asprintf() routine, since it does what we're trying to do below */
if (HDasprintf(&obj2fullname, "/%s", objname2) < 0)
@@ -1013,7 +1013,7 @@ h5diff(const char *fname1, const char *fname2, const char *objname1, const char
parallel_print("\n");
/* if given objects is group under root */
- if (HDstrcmp(obj1fullname, "/") || HDstrcmp(obj2fullname, "/"))
+ if (HDstrcmp(obj1fullname, "/") != 0 || HDstrcmp(obj2fullname, "/") != 0)
parallel_print("group1 group2\n");
else
parallel_print("file1 file2\n");
@@ -1115,9 +1115,9 @@ diff_match(hid_t file1_id, const char *grp1, trav_info_t *info1, hid_t file2_id,
* if not root, prepare object name to be pre-appended to group path to
* make full path
*/
- if (HDstrcmp(grp1, "/"))
+ if (HDstrcmp(grp1, "/") != 0)
grp1_path = grp1;
- if (HDstrcmp(grp2, "/"))
+ if (HDstrcmp(grp2, "/") != 0)
grp2_path = grp2;
/*-------------------------------------------------------------------------
diff --git a/tools/lib/h5diff_attr.c b/tools/lib/h5diff_attr.c
index 9882ffc..5c1777a 100644
--- a/tools/lib/h5diff_attr.c
+++ b/tools/lib/h5diff_attr.c
@@ -104,7 +104,7 @@ table_attrs_free(table_attrs_t *table)
* Date: March 15, 2011
*------------------------------------------------------------------------*/
static void
-table_attr_mark_exist(unsigned *exist, char *name, table_attrs_t *table)
+table_attr_mark_exist(const unsigned *exist, char *name, table_attrs_t *table)
{
if (table->nattrs == table->size) {
match_attr_t *new_attrs;
@@ -343,7 +343,7 @@ diff_attr_data(hid_t attr1_id, hid_t attr2_id, const char *name1, const char *na
hsize_t dims1[H5S_MAX_RANK]; /* dimensions of dataset */
hsize_t dims2[H5S_MAX_RANK]; /* dimensions of dataset */
hsize_t nfound = 0;
- int j;
+ size_t sz;
diff_err_t ret_value = opts->err_stat;
H5TOOLS_START_DEBUG(" - errstat:%d", opts->err_stat);
@@ -394,19 +394,19 @@ diff_attr_data(hid_t attr1_id, hid_t attr2_id, const char *name1, const char *na
H5TOOLS_DEBUG("attr_names: %s - %s", name1, name2);
if (name1) {
- j = (int)HDstrlen(name1);
- H5TOOLS_DEBUG("attr1_name: %s - %d", name1, j);
- if (j > 0) {
- opts->obj_name[0] = (char *)HDmalloc((size_t)j + 1);
- HDstrncpy(opts->obj_name[0], name1, (size_t)j + 1);
+ sz = HDstrlen(name1);
+ H5TOOLS_DEBUG("attr1_name: %s - %d", name1, sz);
+ if (sz > 0) {
+ opts->obj_name[0] = (char *)HDmalloc(sz + 1);
+ HDstrncpy(opts->obj_name[0], name1, sz + 1);
}
}
if (name2) {
- j = (int)HDstrlen(name2);
- H5TOOLS_DEBUG("attr2_name: %s - %d", name2, j);
- if (j > 0) {
- opts->obj_name[1] = (char *)HDmalloc((size_t)j + 1);
- HDstrncpy(opts->obj_name[1], name2, (size_t)j + 1);
+ sz = HDstrlen(name2);
+ H5TOOLS_DEBUG("attr2_name: %s - %d", name2, sz);
+ if (sz > 0) {
+ opts->obj_name[1] = (char *)HDmalloc(sz + 1);
+ HDstrncpy(opts->obj_name[1], name2, sz + 1);
}
}
H5TOOLS_DEBUG("attr_names: %s - %s", opts->obj_name[0], opts->obj_name[1]);
@@ -414,6 +414,9 @@ diff_attr_data(hid_t attr1_id, hid_t attr2_id, const char *name1, const char *na
/* 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, opts, 0) == 1) {
+
+ int j;
+
/*-----------------------------------------------------------------
* "upgrade" the smaller memory size
*------------------------------------------------------------------
@@ -471,22 +474,18 @@ diff_attr_data(hid_t attr1_id, hid_t attr2_id, const char *name1, const char *na
H5TOOLS_DEBUG("attr_names: %s - %s : %s - %s", name1, name2, path1, path2);
if (name1) {
- j = (int)HDstrlen(name1) + (int)HDstrlen(path1) + 7;
- H5TOOLS_DEBUG("attr1_name: %s - %d", name1, j);
- if (j > 0) {
- opts->obj_name[0] = (char *)HDcalloc((size_t)j + 1, sizeof(char));
- HDsnprintf(opts->obj_name[0], j, "%s of <%s>", name1, path1);
- opts->obj_name[0][j] = '\0';
- }
+ sz = HDstrlen(name1) + HDstrlen(path1) + 7;
+ H5TOOLS_DEBUG("attr1_name: %s - %d", name1, sz);
+ opts->obj_name[0] = (char *)HDcalloc(sz + 1, sizeof(char));
+ HDsnprintf(opts->obj_name[0], sz, "%s of <%s>", name1, path1);
+ opts->obj_name[0][sz] = '\0';
}
if (name2) {
- j = (int)HDstrlen(name2) + (int)HDstrlen(path2) + 7;
- H5TOOLS_DEBUG("attr2_name: %s - %d", name2, j);
- if (j > 0) {
- opts->obj_name[1] = (char *)HDcalloc((size_t)j + 1, sizeof(char));
- HDsnprintf(opts->obj_name[1], j, "%s of <%s>", name2, path2);
- opts->obj_name[1][j] = '\0';
- }
+ sz = HDstrlen(name2) + HDstrlen(path2) + 7;
+ H5TOOLS_DEBUG("attr2_name: %s - %d", name2, sz);
+ opts->obj_name[1] = (char *)HDcalloc(sz + 1, sizeof(char));
+ HDsnprintf(opts->obj_name[1], sz, "%s of <%s>", name2, path2);
+ opts->obj_name[1][sz] = '\0';
}
/*---------------------------------------------------------------------
diff --git a/tools/lib/h5diff_util.c b/tools/lib/h5diff_util.c
index b32a138..3e24802 100644
--- a/tools/lib/h5diff_util.c
+++ b/tools/lib/h5diff_util.c
@@ -322,9 +322,9 @@ void
print_found(hsize_t nfound)
{
if (g_Parallel)
- parallel_print("%" H5_PRINTF_LL_WIDTH "u differences found\n", (unsigned long long)nfound);
+ parallel_print("%" PRIuHSIZE " differences found\n", nfound);
else
- HDfprintf(stdout, "%Hu differences found\n", nfound);
+ HDfprintf(stdout, "%" PRIuHSIZE " differences found\n", nfound);
}
/*-----------------------------------------------------------------
diff --git a/tools/lib/h5tools.c b/tools/lib/h5tools.c
index 6f5edbf..3f95505 100644
--- a/tools/lib/h5tools.c
+++ b/tools/lib/h5tools.c
@@ -1672,7 +1672,7 @@ h5tools_render_region_element(FILE *stream, const h5tool_format_t *info, h5tools
*-------------------------------------------------------------------------
*/
void
-init_acc_pos(unsigned ndims, hsize_t *dims, hsize_t *acc, hsize_t *pos, hsize_t *p_min_idx)
+init_acc_pos(unsigned ndims, const hsize_t *dims, hsize_t *acc, hsize_t *pos, hsize_t *p_min_idx)
{
int i;
unsigned j;
@@ -1705,7 +1705,7 @@ init_acc_pos(unsigned ndims, hsize_t *dims, hsize_t *acc, hsize_t *pos, hsize_t
*-------------------------------------------------------------------------
*/
hsize_t
-calc_acc_pos(unsigned ndims, hsize_t elmtno, hsize_t *acc, hsize_t *pos)
+calc_acc_pos(unsigned ndims, hsize_t elmtno, const hsize_t *acc, hsize_t *pos)
{
int i;
hsize_t curr_pos = elmtno;
@@ -1976,7 +1976,7 @@ render_bin_output(FILE *stream, hid_t container, hid_t tid, void *_mem, hsize_t
*/
int
render_bin_output_region_data_blocks(hid_t region_id, FILE *stream, hid_t container, unsigned ndims,
- hid_t type_id, hsize_t nblocks, hsize_t *ptdata)
+ hid_t type_id, hsize_t nblocks, const hsize_t *ptdata)
{
hsize_t *dims1 = NULL;
hsize_t *start = NULL;
@@ -2284,12 +2284,12 @@ h5tools_is_obj_same(hid_t loc_id1, const char *name1, hid_t loc_id2, const char
H5O_info2_t oinfo1, oinfo2;
hbool_t ret_val = FALSE;
- if (name1 && HDstrcmp(name1, "."))
+ if (name1 && HDstrcmp(name1, ".") != 0)
H5Oget_info_by_name3(loc_id1, name1, &oinfo1, H5O_INFO_BASIC, H5P_DEFAULT);
else
H5Oget_info3(loc_id1, &oinfo1, H5O_INFO_BASIC);
- if (name2 && HDstrcmp(name2, "."))
+ if (name2 && HDstrcmp(name2, ".") != 0)
H5Oget_info_by_name3(loc_id2, name2, &oinfo2, H5O_INFO_BASIC, H5P_DEFAULT);
else
H5Oget_info3(loc_id2, &oinfo2, H5O_INFO_BASIC);
diff --git a/tools/lib/h5tools.h b/tools/lib/h5tools.h
index f9aabbf..b4c1e49 100644
--- a/tools/lib/h5tools.h
+++ b/tools/lib/h5tools.h
@@ -676,8 +676,9 @@ 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(unsigned ndims, hsize_t *dims, hsize_t *acc, hsize_t *pos, hsize_t *p_min_idx);
-H5TOOLS_DLL hsize_t calc_acc_pos(unsigned ndims, hsize_t elemtno, hsize_t *acc, hsize_t *pos);
+H5TOOLS_DLL void init_acc_pos(unsigned ndims, const hsize_t *dims, hsize_t *acc, hsize_t *pos,
+ hsize_t *p_min_idx);
+H5TOOLS_DLL hsize_t calc_acc_pos(unsigned ndims, hsize_t elemtno, const hsize_t *acc, hsize_t *pos);
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);
@@ -691,7 +692,7 @@ H5TOOLS_DLL void h5tools_region_simple_prefix(FILE *stream, const h5tool_format_
H5TOOLS_DLL int render_bin_output(FILE *stream, hid_t container, hid_t tid, void *_mem, hsize_t nelmts);
H5TOOLS_DLL int render_bin_output_region_data_blocks(hid_t region_id, FILE *stream, hid_t container,
unsigned ndims, hid_t type_id, hsize_t nblocks,
- hsize_t *ptdata);
+ const 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 int render_bin_output_region_data_points(hid_t region_space, hid_t region_id, FILE *stream,
diff --git a/tools/lib/h5tools_dump.c b/tools/lib/h5tools_dump.c
index 9edaba6..190325f 100644
--- a/tools/lib/h5tools_dump.c
+++ b/tools/lib/h5tools_dump.c
@@ -329,7 +329,7 @@ h5tools_dump_simple_data(FILE *stream, const h5tool_format_t *info, h5tools_cont
* Purpose: Print some values from an attribute referenced by object reference.
*
* Description:
- * This is a special case subfunction to dump aa attribute references.
+ * This is a special case subfunction to dump an attribute reference.
*
* Return:
* The function returns False if the last dimension has been reached, otherwise True
@@ -448,6 +448,9 @@ done:
if (H5Tclose(atype) < 0)
H5TOOLS_ERROR(dimension_break, "H5Tclose failed");
+ if (H5Sclose(region_space) < 0)
+ H5TOOLS_ERROR(dimension_break, "H5Sclose failed");
+
ctx->indent_level--;
ctx->need_prefix = TRUE;
@@ -1254,12 +1257,12 @@ done:
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, 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 */
+ 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 */
+ const hsize_t *total_size, /* total size of dataset */
+ unsigned int row_dim) /* index of row_counter dimension */
{
size_t i; /* counters */
size_t j; /* counters */
@@ -2222,7 +2225,7 @@ h5tools_print_datatype(FILE *stream, h5tools_str_t *buffer, const h5tool_format_
h5tools_str_append(buffer, "H5T_NATIVE_LDOUBLE");
#endif
else {
-
+ /* print what the library knows */
/* byte order */
if (H5Tget_size(type) > 1) {
order = H5Tget_order(type);
diff --git a/tools/lib/h5tools_ref.c b/tools/lib/h5tools_ref.c
index 4643466..50f283d 100644
--- a/tools/lib/h5tools_ref.c
+++ b/tools/lib/h5tools_ref.c
@@ -200,7 +200,7 @@ ref_path_table_lookup(const char *thepath, H5O_token_t *token)
if ((thepath == NULL) || (HDstrlen(thepath) == 0))
return -1;
/* Allow lookups on the root group, even though it doesn't have any link info */
- if (HDstrcmp(thepath, "/")) {
+ if (HDstrcmp(thepath, "/") != 0) {
H5L_info2_t li;
/* Check for external link first, so we don't return the OID of an object in another file */
diff --git a/tools/lib/h5tools_str.c b/tools/lib/h5tools_str.c
index 0890ba3..8973b2d 100644
--- a/tools/lib/h5tools_str.c
+++ b/tools/lib/h5tools_str.c
@@ -142,7 +142,7 @@ h5tools_str_append(h5tools_str_t *str /*in,out*/, const char *fmt, ...)
/* failure, such as bad format */
return NULL;
- if ((size_t)nchars >= avail || (0 == nchars && (HDstrcmp(fmt, "%s")))) {
+ if ((size_t)nchars >= avail || (0 == nchars && (HDstrcmp(fmt, "%s") != 0))) {
/* 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
@@ -323,7 +323,7 @@ h5tools_str_prefix(h5tools_str_t *str /*in,out*/, const h5tool_format_t *info, h
*/
char *
h5tools_str_region_prefix(h5tools_str_t *str /*in,out*/, const h5tool_format_t *info, hsize_t elmtno,
- hsize_t *ptdata, h5tools_context_t *ctx)
+ const hsize_t *ptdata, h5tools_context_t *ctx)
{
size_t i = 0;
diff --git a/tools/lib/h5tools_str.h b/tools/lib/h5tools_str.h
index c207a83..eee87c9 100644
--- a/tools/lib/h5tools_str.h
+++ b/tools/lib/h5tools_str.h
@@ -36,7 +36,7 @@ H5TOOLS_DLL char * h5tools_str_prefix(h5tools_str_t *str, const h5tool_format_t
* new functions needed to display region reference data
*/
H5TOOLS_DLL char *h5tools_str_region_prefix(h5tools_str_t *str, const h5tool_format_t *info, hsize_t elmtno,
- hsize_t *ptdata, h5tools_context_t *ctx);
+ const hsize_t *ptdata, h5tools_context_t *ctx);
H5TOOLS_DLL void h5tools_str_dump_space_slabs(h5tools_str_t *, hid_t, const h5tool_format_t *,
h5tools_context_t *ctx);
H5TOOLS_DLL void h5tools_str_dump_space_blocks(h5tools_str_t *, hid_t, const h5tool_format_t *);
diff --git a/tools/lib/h5tools_utils.c b/tools/lib/h5tools_utils.c
index 83b32bd..18f5a62 100644
--- a/tools/lib/h5tools_utils.c
+++ b/tools/lib/h5tools_utils.c
@@ -378,8 +378,6 @@ get_option(int argc, const char **argv, const char *opts, const struct long_opti
* Programmer: Jacob Smith
* 2017-11-10
*
- * Changes: None.
- *
*****************************************************************************
*/
herr_t
@@ -1071,7 +1069,6 @@ h5tools_parse_ros3_fapl_tuple(const char *tuple_str, int delim, H5FD_ros3_fapl_t
{
const char *ccred[3];
unsigned nelems = 0;
- char * start = NULL;
char * s3cred_src = NULL;
char ** s3cred = NULL;
herr_t ret_value = SUCCEED;
diff --git a/tools/lib/h5trav.c b/tools/lib/h5trav.c
index 042288c..d0c299f 100644
--- a/tools/lib/h5trav.c
+++ b/tools/lib/h5trav.c
@@ -357,7 +357,7 @@ trav_fileinfo_add(trav_info_t *info, hid_t loc_id)
H5O_info2_t oinfo;
size_t idx = info->nused - 1;
- if (info->paths[idx].path && HDstrcmp(info->paths[idx].path, "."))
+ if (info->paths[idx].path && HDstrcmp(info->paths[idx].path, ".") != 0)
H5Oget_info_by_name3(loc_id, info->paths[idx].path, &oinfo, H5O_INFO_BASIC, H5P_DEFAULT);
else
H5Oget_info3(loc_id, &oinfo, H5O_INFO_BASIC);
@@ -731,7 +731,7 @@ trav_table_addlink(trav_table_t *table, const H5O_token_t *obj_token, const char
*-------------------------------------------------------------------------
*/
void
-trav_table_addflags(unsigned *flags, char *name, h5trav_type_t type, trav_table_t *table)
+trav_table_addflags(const unsigned *flags, char *name, h5trav_type_t type, trav_table_t *table)
{
size_t new_obj;
diff --git a/tools/lib/h5trav.h b/tools/lib/h5trav.h
index c7b9db7..7a8a63d 100644
--- a/tools/lib/h5trav.h
+++ b/tools/lib/h5trav.h
@@ -187,6 +187,7 @@ H5TOOLS_DLL void trav_table_init(hid_t fid, trav_table_t **table);
H5TOOLS_DLL void trav_table_free(trav_table_t *table);
-H5TOOLS_DLL void trav_table_addflags(unsigned *flags, char *objname, h5trav_type_t type, trav_table_t *table);
+H5TOOLS_DLL void trav_table_addflags(const unsigned *flags, char *objname, h5trav_type_t type,
+ trav_table_t *table);
#endif /* H5TRAV_H */
diff --git a/tools/libtest/h5tools_test_utils.c b/tools/libtest/h5tools_test_utils.c
index 05fce76..b27a399 100644
--- a/tools/libtest/h5tools_test_utils.c
+++ b/tools/libtest/h5tools_test_utils.c
@@ -69,6 +69,8 @@
*
*****************************************************************************/
+H5_GCC_DIAG_OFF("format")
+
/*----------------------------------------------------------------------------
*
* ifdef flag: JSVERIFY_EXP_ACT
@@ -1005,8 +1007,9 @@ test_set_configured_fapl(void)
* TEST-LOCAL VARIABLES *
************************/
- hid_t fapl_id = H5I_INVALID_HID;
- other_fa_t wrong_fa = {0x432, 0xf82, 0x9093};
+ hid_t fapl_id = H5I_INVALID_HID;
+ other_fa_t wrong_fa = {0x432, 0xf82, 0x9093};
+#ifdef H5_HAVE_ROS3_VFD
H5FD_ros3_fapl_t ros3_anon_fa = {1, FALSE, "", "", ""};
H5FD_ros3_fapl_t ros3_auth_fa = {
1, /* fapl version */
@@ -1015,6 +1018,8 @@ test_set_configured_fapl(void)
"12345677890abcdef", /* simulate access key ID */
"oiwnerwe9u0234nJw0-aoj+dsf", /* simulate secret key */
};
+#endif /* H5_HAVE_ROS3_VFD */
+#ifdef H5_HAVE_LIBHDFS
H5FD_hdfs_fapl_t hdfs_fa = {
1, /* fapl version */
"", /* namenode name */
@@ -1023,6 +1028,7 @@ test_set_configured_fapl(void)
"", /* user name */
2048, /* stream buffer size */
};
+#endif /* H5_HAVE_LIBHDFS */
unsigned n_cases = 7; /* number of common testcases */
testcase cases[] = {
{
@@ -1249,6 +1255,7 @@ error:
#undef UTIL_TEST_DEFAULT
#undef UTIL_TEST_CREATE
} /* test_set_configured_fapl */
+H5_GCC_DIAG_ON("format")
/*----------------------------------------------------------------------------
*
diff --git a/tools/src/h5copy/h5copy.c b/tools/src/h5copy/h5copy.c
index 16d034c..f618914 100644
--- a/tools/src/h5copy/h5copy.c
+++ b/tools/src/h5copy/h5copy.c
@@ -219,8 +219,8 @@ main(int argc, const char *argv[])
unsigned flag = 0;
unsigned verbose = 0;
unsigned parents = 0;
- hid_t ocpl_id = (-1); /* Object copy property list */
- hid_t lcpl_id = (-1); /* Link creation property list */
+ hid_t ocpl_id = H5I_INVALID_HID; /* Object copy property list */
+ hid_t lcpl_id = H5I_INVALID_HID; /* Link creation property list */
int opt;
int li_ret;
h5tool_link_info_t linkinfo;
diff --git a/tools/src/h5dump/h5dump.h b/tools/src/h5dump/h5dump.h
index 60422ad..a53d1ba 100644
--- a/tools/src/h5dump/h5dump.h
+++ b/tools/src/h5dump/h5dump.h
@@ -10,8 +10,8 @@
* If you do not have access to either file, you may request a copy from *
* help@hdfgroup.org. *
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
-#ifndef H5DUMP_H__
-#define H5DUMP_H__
+#ifndef H5DUMP_H
+#define H5DUMP_H
#include "hdf5.h"
#include "H5private.h"
@@ -112,4 +112,4 @@ const dump_functions *dump_function_table;
}
#endif
-#endif /* !H5DUMP_H__ */
+#endif /* H5DUMP_H */
diff --git a/tools/src/h5dump/h5dump_ddl.c b/tools/src/h5dump/h5dump_ddl.c
index 6690469..80e8088 100644
--- a/tools/src/h5dump/h5dump_ddl.c
+++ b/tools/src/h5dump/h5dump_ddl.c
@@ -1252,9 +1252,9 @@ dump_fcpl(hid_t fid)
indentation(dump_indent + COL);
PRINTSTREAM(rawoutstream, "%s %s\n", "FREE_SPACE_PERSIST", fs_persist ? "TRUE" : "FALSE");
indentation(dump_indent + COL);
- PRINTSTREAM(rawoutstream, "%s %Hu\n", "FREE_SPACE_SECTION_THRESHOLD", fs_threshold);
+ PRINTSTREAM(rawoutstream, "%s %" PRIuHSIZE "\n", "FREE_SPACE_SECTION_THRESHOLD", fs_threshold);
indentation(dump_indent + COL);
- PRINTSTREAM(rawoutstream, "%s %Hu\n", "FILE_SPACE_PAGE_SIZE", fsp_size);
+ PRINTSTREAM(rawoutstream, "%s %" PRIuHSIZE "\n", "FILE_SPACE_PAGE_SIZE", fsp_size);
/*-------------------------------------------------------------------------
* USER_BLOCK
@@ -1263,7 +1263,7 @@ dump_fcpl(hid_t fid)
indentation(dump_indent + COL);
PRINTSTREAM(rawoutstream, "USER_BLOCK %s\n", BEGIN);
indentation(dump_indent + COL + COL);
- PRINTSTREAM(rawoutstream, "%s %Hu\n", "USERBLOCK_SIZE", userblock);
+ PRINTSTREAM(rawoutstream, "%s %" PRIuHSIZE "\n", "USERBLOCK_SIZE", userblock);
indentation(dump_indent + COL);
PRINTSTREAM(rawoutstream, "%s\n", END);
diff --git a/tools/src/h5dump/h5dump_ddl.h b/tools/src/h5dump/h5dump_ddl.h
index 6d65796..8487270 100644
--- a/tools/src/h5dump/h5dump_ddl.h
+++ b/tools/src/h5dump/h5dump_ddl.h
@@ -11,8 +11,8 @@
* help@hdfgroup.org. *
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
-#ifndef H5DUMP_DDL_H__
-#define H5DUMP_DDL_H__
+#ifndef H5DUMP_DDL_H
+#define H5DUMP_DDL_H
#ifdef __cplusplus
extern "C" {
@@ -50,4 +50,4 @@ void handle_datatypes(hid_t fid, const char *type, void H5_ATTR_UNUSED *data, in
}
#endif
-#endif /* !H5DUMP_DDL_H__ */
+#endif /* H5DUMP_DDL_H */
diff --git a/tools/src/h5dump/h5dump_defines.h b/tools/src/h5dump/h5dump_defines.h
index 0fb8def..21a31dd 100644
--- a/tools/src/h5dump/h5dump_defines.h
+++ b/tools/src/h5dump/h5dump_defines.h
@@ -10,8 +10,8 @@
* 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__
+#ifndef H5DUMP_DEFINES_H
+#define H5DUMP_DEFINES_H
#define H5DUMP_MAX_RANK H5S_MAX_RANK
@@ -50,4 +50,4 @@
#define H5_SZIP_MSB_OPTION_MASK 16
#define H5_SZIP_RAW_OPTION_MASK 128
-#endif /* !H5DUMP_DEFINES_H__ */
+#endif /* H5DUMP_DEFINES_H */
diff --git a/tools/src/h5dump/h5dump_extern.h b/tools/src/h5dump/h5dump_extern.h
index 8fbb5af..308f602 100644
--- a/tools/src/h5dump/h5dump_extern.h
+++ b/tools/src/h5dump/h5dump_extern.h
@@ -10,8 +10,8 @@
* 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__
+#ifndef H5DUMP_EXTERN_H
+#define H5DUMP_EXTERN_H
#include "hdf5.h"
#include "H5private.h"
@@ -109,4 +109,4 @@ ssize_t table_list_visited(unsigned long file_no);
}
#endif
-#endif /* !H5DUMP_EXTERN_H__ */
+#endif /* H5DUMP_EXTERN_H */
diff --git a/tools/src/h5dump/h5dump_xml.h b/tools/src/h5dump/h5dump_xml.h
index 9ff22ed..d69f6d5 100644
--- a/tools/src/h5dump/h5dump_xml.h
+++ b/tools/src/h5dump/h5dump_xml.h
@@ -10,8 +10,8 @@
* 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__
+#ifndef H5DUMP_XML_H
+#define H5DUMP_XML_H
extern const char *xmlnsprefix;
@@ -34,4 +34,4 @@ void xml_dump_data(hid_t, int, struct subset_t *, int);
}
#endif
-#endif /* !H5DUMP_XML_H__ */
+#endif /* H5DUMP_XML_H */
diff --git a/tools/src/h5import/h5import.h b/tools/src/h5import/h5import.h
index 2192f4a..efd40e1 100644
--- a/tools/src/h5import/h5import.h
+++ b/tools/src/h5import/h5import.h
@@ -17,8 +17,8 @@
*
*/
-#ifndef H5IMPORT_H__
-#define H5IMPORT_H__
+#ifndef H5IMPORT_H
+#define H5IMPORT_H
/*
* state table tokens
@@ -189,4 +189,4 @@ void help(char *);
hid_t createOutputDataType(struct Input *in);
hid_t createInputDataType(struct Input *in);
-#endif /* H5IMPORT_H__ */
+#endif /* H5IMPORT_H */
diff --git a/tools/src/h5repack/h5repack.h b/tools/src/h5repack/h5repack.h
index 4987000..0dcc590 100644
--- a/tools/src/h5repack/h5repack.h
+++ b/tools/src/h5repack/h5repack.h
@@ -11,8 +11,8 @@
* help@hdfgroup.org. *
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
-#ifndef H5REPACK_H__
-#define H5REPACK_H__
+#ifndef H5REPACK_H
+#define H5REPACK_H
#include "H5private.h"
#include "hdf5.h"
@@ -222,4 +222,4 @@ obj_list_t *parse_filter(const char *str, unsigned *n_objs, filter_info_t *filt,
obj_list_t *parse_layout(const char *str, unsigned *n_objs, pack_info_t *pack, /* info about object */
pack_opt_t *options);
-#endif /* H5REPACK_H__ */
+#endif /* H5REPACK_H */
diff --git a/tools/src/h5stat/h5stat.c b/tools/src/h5stat/h5stat.c
index b89145c..62f0734 100644
--- a/tools/src/h5stat/h5stat.c
+++ b/tools/src/h5stat/h5stat.c
@@ -122,7 +122,7 @@ static const char *drivername = NULL;
/* Default "anonymous" S3 configuration */
static H5FD_ros3_fapl_t ros3_fa = {
1, /* Structure Version */
- false, /* Authenticate? */
+ FALSE, /* Authenticate? */
"", /* AWS Region */
"", /* Access Key ID */
"", /* Secret Access Key */
@@ -1196,7 +1196,7 @@ print_file_info(const iter_t *iter)
HDprintf("\t# of unique links: %lu\n", iter->uniq_links);
HDprintf("\t# of unique other: %lu\n", iter->uniq_others);
HDprintf("\tMax. # of links to object: %lu\n", iter->max_links);
- HDfprintf(stdout, "\tMax. # of objects in group: %Hu\n", iter->max_fanout);
+ HDfprintf(stdout, "\tMax. # of objects in group: %" PRIuHSIZE "\n", iter->max_fanout);
return 0;
} /* print_file_info() */
@@ -1219,40 +1219,40 @@ 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, "\tSuperblock: %" PRIuHSIZE "\n", iter->super_size);
+ HDfprintf(stdout, "\tSuperblock extension: %" PRIuHSIZE "\n", iter->super_ext_size);
+ HDfprintf(stdout, "\tUser block: %" PRIuHSIZE "\n", iter->ublk_size);
HDfprintf(stdout, "\tObject headers: (total/unused)\n");
- HDfprintf(stdout, "\t\tGroups: %Hu/%Hu\n", iter->group_ohdr_info.total_size,
+ HDfprintf(stdout, "\t\tGroups: %" PRIuHSIZE "/%" PRIuHSIZE "\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,
+ HDfprintf(stdout, "\t\tDatasets(exclude compact data): %" PRIuHSIZE "/%" PRIuHSIZE "\n",
+ iter->dset_ohdr_info.total_size, iter->dset_ohdr_info.free_size);
+ HDfprintf(stdout, "\t\tDatatypes: %" PRIuHSIZE "/%" PRIuHSIZE "\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, "\t\tB-tree/List: %" PRIuHSIZE "\n", iter->groups_btree_storage_size);
+ HDfprintf(stdout, "\t\tHeap: %" PRIuHSIZE "\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, "\t\tB-tree/List: %" PRIuHSIZE "\n", iter->attrs_btree_storage_size);
+ HDfprintf(stdout, "\t\tHeap: %" PRIuHSIZE "\n", iter->attrs_heap_storage_size);
HDfprintf(stdout, "\tChunked datasets:\n");
- HDfprintf(stdout, "\t\tIndex: %Hu\n", iter->datasets_index_storage_size);
+ HDfprintf(stdout, "\t\tIndex: %" PRIuHSIZE "\n", iter->datasets_index_storage_size);
HDfprintf(stdout, "\tDatasets:\n");
- HDfprintf(stdout, "\t\tHeap: %Hu\n", iter->datasets_heap_storage_size);
+ HDfprintf(stdout, "\t\tHeap: %" PRIuHSIZE "\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, "\t\tHeader: %" PRIuHSIZE "\n", iter->SM_hdr_storage_size);
+ HDfprintf(stdout, "\t\tB-tree/List: %" PRIuHSIZE "\n", iter->SM_index_storage_size);
+ HDfprintf(stdout, "\t\tHeap: %" PRIuHSIZE "\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);
+ HDfprintf(stdout, "\t\tHeader: %" PRIuHSIZE "\n", iter->free_hdr);
+ HDfprintf(stdout, "\t\tAmount of free space: %" PRIuHSIZE "\n", iter->free_space);
return 0;
} /* print_file_metadata() */
@@ -1330,11 +1330,11 @@ print_group_metadata(const iter_t *iter)
{
HDprintf("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, "\tObject headers (total/unused): %" PRIuHSIZE "/%" PRIuHSIZE "\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);
+ HDfprintf(stdout, "\tB-tree/List: %" PRIuHSIZE "\n", iter->groups_btree_storage_size);
+ HDfprintf(stdout, "\tHeap: %" PRIuHSIZE "\n", iter->groups_heap_storage_size);
return 0;
} /* print_group_metadata() */
@@ -1368,7 +1368,7 @@ print_dataset_info(const iter_t *iter)
HDprintf("\t\t# of dataset with rank %u: %lu\n", u, iter->dset_rank_count[u]);
HDprintf("1-D Dataset information:\n");
- HDfprintf(stdout, "\tMax. dimension size of 1-D datasets: %Hu\n", iter->max_dset_dims);
+ HDfprintf(stdout, "\tMax. dimension size of 1-D datasets: %" PRIuHSIZE "\n", iter->max_dset_dims);
HDprintf("\tSmall 1-D datasets (with dimension sizes 0 to %u):\n", sdsets_threshold - 1);
total = 0;
for (u = 0; u < (unsigned)sdsets_threshold; u++) {
@@ -1400,8 +1400,9 @@ print_dataset_info(const iter_t *iter)
} /* end if */
HDprintf("Dataset storage information:\n");
- HDfprintf(stdout, "\tTotal raw data size: %Hu\n", iter->dset_storage_size);
- HDfprintf(stdout, "\tTotal external raw data size: %Hu\n", iter->dset_external_storage_size);
+ HDfprintf(stdout, "\tTotal raw data size: %" PRIuHSIZE "\n", iter->dset_storage_size);
+ HDfprintf(stdout, "\tTotal external raw data size: %" PRIuHSIZE "\n",
+ iter->dset_external_storage_size);
HDprintf("Dataset layout information:\n");
for (u = 0; u < H5D_NLAYOUTS; u++)
@@ -1445,11 +1446,11 @@ print_dset_metadata(const iter_t *iter)
{
HDprintf("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, "\tObject headers (total/unused): %" PRIuHSIZE "/%" PRIuHSIZE "\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);
+ HDfprintf(stdout, "\tIndex for Chunked datasets: %" PRIuHSIZE "\n", iter->datasets_index_storage_size);
+ HDfprintf(stdout, "\tHeap: %" PRIuHSIZE "\n", iter->datasets_heap_storage_size);
return 0;
} /* print_dset_metadata() */
@@ -1563,7 +1564,7 @@ print_freespace_info(const iter_t *iter)
unsigned u; /* Local index variable */
HDfprintf(stdout, "Free-space persist: %s\n", iter->fs_persist ? "TRUE" : "FALSE");
- HDfprintf(stdout, "Free-space section threshold: %Hu bytes\n", iter->fs_threshold);
+ HDfprintf(stdout, "Free-space section threshold: %" PRIuHSIZE " bytes\n", iter->fs_threshold);
HDprintf("Small size free-space sections (< %u bytes):\n", (unsigned)SIZE_SMALL_SECTS);
total = 0;
for (u = 0; u < SIZE_SMALL_SECTS; u++) {
@@ -1611,7 +1612,7 @@ print_storage_summary(const iter_t *iter)
double percent = 0.0f;
HDfprintf(stdout, "File space management strategy: %s\n", FS_STRATEGY_NAME[iter->fs_strategy]);
- HDfprintf(stdout, "File space page size: %Hu bytes\n", iter->fsp_size);
+ HDfprintf(stdout, "File space page size: %" PRIuHSIZE " bytes\n", iter->fsp_size);
HDprintf("Summary of file space information:\n");
total_meta =
iter->super_size + iter->super_ext_size + iter->ublk_size + iter->group_ohdr_info.total_size +
@@ -1620,27 +1621,28 @@ print_storage_summary(const iter_t *iter)
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);
+ HDfprintf(stdout, " File metadata: %" PRIuHSIZE " bytes\n", total_meta);
+ HDfprintf(stdout, " Raw data: %" PRIuHSIZE " bytes\n", iter->dset_storage_size);
percent = ((double)iter->free_space / (double)iter->filesize) * (double)100.0f;
- HDfprintf(stdout, " Amount/Percent of tracked free space: %Hu bytes/%3.1f%\n", iter->free_space,
- percent);
+ HDfprintf(stdout, " Amount/Percent of tracked free space: %" PRIuHSIZE " bytes/%3.1f%%\n",
+ 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);
+ HDfprintf(stdout, " ??? File has %" PRIuHSIZE " 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);
+ HDfprintf(stdout, " Unaccounted space: %" PRIuHSIZE " bytes\n", unaccount);
}
- HDfprintf(stdout, "Total space: %Hu bytes\n",
+ HDfprintf(stdout, "Total space: %" PRIuHSIZE " 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: %" PRIuHSIZE " bytes\n", iter->dset_external_storage_size);
return 0;
} /* print_storage_summary() */
diff --git a/tools/src/misc/CMakeLists.txt b/tools/src/misc/CMakeLists.txt
index ea30c98..8811f97 100644
--- a/tools/src/misc/CMakeLists.txt
+++ b/tools/src/misc/CMakeLists.txt
@@ -38,11 +38,20 @@ if (NOT ONLY_SHARED_LIBS)
set_target_properties (h5clear PROPERTIES FOLDER tools)
set_global_variable (HDF5_UTILS_TO_EXPORT "${HDF5_UTILS_TO_EXPORT};h5clear")
+ add_executable (h5delete ${HDF5_TOOLS_SRC_MISC_SOURCE_DIR}/h5delete.c)
+ target_include_directories (h5delete PRIVATE "${HDF5_TOOLS_DIR}/lib;${HDF5_SRC_DIR};${HDF5_SRC_BINARY_DIR};$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_C_INCLUDE_DIRS}>")
+ target_compile_options(h5delete PRIVATE "${HDF5_CMAKE_C_FLAGS}")
+ TARGET_C_PROPERTIES (h5delete STATIC)
+ target_link_libraries (h5delete PRIVATE ${HDF5_TOOLS_LIB_TARGET} ${HDF5_LIB_TARGET})
+ set_target_properties (h5delete PROPERTIES FOLDER tools)
+ set_global_variable (HDF5_UTILS_TO_EXPORT "${HDF5_UTILS_TO_EXPORT};h5delete")
+
set (H5_DEP_EXECUTABLES
h5debug
h5repart
h5mkgrp
- h5clear
+ h5clear
+ h5delete
)
endif ()
if (BUILD_SHARED_LIBS)
@@ -78,11 +87,20 @@ if (BUILD_SHARED_LIBS)
set_target_properties (h5clear-shared PROPERTIES FOLDER tools)
set_global_variable (HDF5_UTILS_TO_EXPORT "${HDF5_UTILS_TO_EXPORT};h5clear-shared")
+ add_executable (h5delete-shared ${HDF5_TOOLS_SRC_MISC_SOURCE_DIR}/h5delete.c)
+ target_include_directories (h5delete-shared PRIVATE "${HDF5_TOOLS_DIR}/lib;${HDF5_SRC_DIR};${HDF5_SRC_BINARY_DIR};$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_C_INCLUDE_DIRS}>")
+ target_compile_options(h5delete-shared PRIVATE "${HDF5_CMAKE_C_FLAGS}")
+ TARGET_C_PROPERTIES (h5delete-shared SHARED)
+ target_link_libraries (h5delete-shared PRIVATE ${HDF5_TOOLS_LIBSH_TARGET} ${HDF5_LIBSH_TARGET})
+ set_target_properties (h5delete-shared PROPERTIES FOLDER tools)
+ set_global_variable (HDF5_UTILS_TO_EXPORT "${HDF5_UTILS_TO_EXPORT};h5delete-shared")
+
set (H5_DEP_EXECUTABLES ${H5_DEP_EXECUTABLES}
h5debug-shared
h5repart-shared
h5mkgrp-shared
h5clear-shared
+ h5delete-shared
)
endif ()
@@ -95,11 +113,13 @@ if (HDF5_ENABLE_FORMATTERS)
clang_format (HDF5_H5REPART_SRC_FORMAT h5repart)
clang_format (HDF5_H5MKGRP_SRC_FORMAT h5mkgrp)
clang_format (HDF5_H5CLEAR_SRC_FORMAT h5clear)
+ clang_format (HDF5_H5DELETE_SRC_FORMAT h5delete)
else ()
clang_format (HDF5_H5DEBUG_SRC_FORMAT h5debug-shared)
clang_format (HDF5_H5REPART_SRC_FORMAT h5repart-shared)
clang_format (HDF5_H5MKGRP_SRC_FORMAT h5mkgrp-shared)
clang_format (HDF5_H5CLEAR_SRC_FORMAT h5clear-shared)
+ clang_format (HDF5_H5DELETE_SRC_FORMAT h5delete-shared)
endif ()
endif ()
diff --git a/tools/src/misc/Makefile.am b/tools/src/misc/Makefile.am
index e8ee947..cad13c1 100644
--- a/tools/src/misc/Makefile.am
+++ b/tools/src/misc/Makefile.am
@@ -22,13 +22,14 @@ include $(top_srcdir)/config/commence.am
AM_CPPFLAGS+=-I$(top_srcdir)/src -I$(top_srcdir)/tools/lib
# These are our main targets, the tools
-bin_PROGRAMS=h5debug h5repart h5mkgrp h5clear
+bin_PROGRAMS=h5debug h5repart h5mkgrp h5clear h5delete
# Add h5debug, h5repart, and h5mkgrp specific linker flags here
h5debug_LDFLAGS = $(LT_STATIC_EXEC) $(AM_LDFLAGS)
h5repart_LDFLAGS = $(LT_STATIC_EXEC) $(AM_LDFLAGS)
h5mkgrp_LDFLAGS = $(LT_STATIC_EXEC) $(AM_LDFLAGS)
h5clear_LDFLAGS = $(LT_STATIC_EXEC) $(AM_LDFLAGS)
+h5delete_LDFLAGS = $(LT_STATIC_EXEC) $(AM_LDFLAGS)
# All programs rely on hdf5 library and h5tools library
LDADD=$(LIBH5TOOLS) $(LIBHDF5)
diff --git a/tools/src/misc/h5clear.c b/tools/src/misc/h5clear.c
index 6fb3dfd..ac7c0ca 100644
--- a/tools/src/misc/h5clear.c
+++ b/tools/src/misc/h5clear.c
@@ -358,7 +358,7 @@ main(int argc, const char *argv[])
h5tools_setstatus(EXIT_FAILURE);
goto done;
}
- HDfprintf(stdout, "EOA is %a; EOF is %a \n", eoa, st.st_size);
+ HDfprintf(stdout, "EOA is %" PRIuHADDR "; EOF is %" PRIuHADDR " \n", eoa, (haddr_t)st.st_size);
}
/* --increment option */
diff --git a/tools/src/misc/h5debug.c b/tools/src/misc/h5debug.c
index ae5b0e5..454981d 100644
--- a/tools/src/misc/h5debug.c
+++ b/tools/src/misc/h5debug.c
@@ -344,7 +344,7 @@ main(int argc, char *argv[])
/*
* Read the signature at the specified file position.
*/
- HDfprintf(stdout, "Reading signature at address %a (rel)\n", addr);
+ HDfprintf(stdout, "Reading signature at address %" PRIuHADDR " (rel)\n", addr);
if (H5F_block_read(f, H5FD_MEM_SUPER, addr, sizeof(sig), sig) < 0) {
HDfprintf(stderr, "cannot read signature\n");
exit_value = 3;
diff --git a/tools/src/misc/h5delete.c b/tools/src/misc/h5delete.c
new file mode 100644
index 0000000..3c4f8d5
--- /dev/null
+++ b/tools/src/misc/h5delete.c
@@ -0,0 +1,66 @@
+/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
+ * Copyright by The HDF Group. *
+ * All rights reserved. *
+ * *
+ * This file is part of HDF5. The full HDF5 copyright notice, including *
+ * terms governing use, modification, and redistribution, is contained in *
+ * the COPYING file, which can be found at the root of the source code *
+ * distribution tree, or in https://www.hdfgroup.org/licenses. *
+ * If you do not have access to either file, you may request a copy from *
+ * help@hdfgroup.org. *
+ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
+
+/* h5delete tool
+ *
+ * Deletes storage via H5Fdelete() using the VOL connector specified in the
+ * environment variable.
+ */
+
+#include "H5private.h"
+#include "H5Eprivate.h"
+#include "H5Pprivate.h"
+
+static void usage(void);
+
+static void
+usage(void)
+{
+ HDfprintf(stderr, "Usage: h5delete [-f] <filename>\n");
+}
+
+int
+main(int argc, const char *argv[])
+{
+ hbool_t quiet = FALSE;
+ const char *name = NULL;
+ int ret = 0;
+
+ switch (argc) {
+ case 3:
+ if (HDstrcmp(argv[1], "-f") != 0) {
+ usage();
+ return EXIT_FAILURE;
+ }
+ quiet = TRUE;
+ name = argv[2];
+ break;
+ case 2:
+ name = argv[1];
+ break;
+ default:
+ usage();
+ return EXIT_FAILURE;
+ }
+
+ H5E_BEGIN_TRY
+ {
+ /* Only uses the environment variable at this time */
+ ret = (int)H5Fdelete(name, H5P_DEFAULT);
+ }
+ H5E_END_TRY;
+
+ if (ret < 0 && !quiet)
+ HDfprintf(stderr, "Unable to delete storage at: %s\n", name);
+
+ return ret < 0 ? EXIT_FAILURE : EXIT_SUCCESS;
+}
diff --git a/tools/src/misc/h5repart.c b/tools/src/misc/h5repart.c
index e3f00af..f4cef6a 100644
--- a/tools/src/misc/h5repart.c
+++ b/tools/src/misc/h5repart.c
@@ -12,7 +12,7 @@
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
/*
- * Programmer: Robb Matzke <matzke@llnl.gov>
+ * Programmer: Robb Matzke
* Wednesday, May 13, 1998
*
* Purpose: Repartitions a file family. This program can be used to
@@ -64,10 +64,10 @@ usage(const char *progname)
"(windows or sec2)\n");
HDfprintf(stderr, " SRC The name of the source file\n");
HDfprintf(stderr, " DST The name of the destination files\n");
- HDfprintf(stderr, "Sizes may be suffixed with `g' for GB, `m' for MB or "
- "`k' for kB.\n");
+ HDfprintf(stderr, "Sizes may be suffixed with 'g' for GB, 'm' for MB or "
+ "'k' for kB.\n");
HDfprintf(stderr, "File family names include an integer printf "
- "format such as `%%d'\n");
+ "format such as '%%d'\n");
HDexit(EXIT_FAILURE);
}
@@ -97,7 +97,7 @@ static off_t
get_size(const char *progname, int *argno, int argc, char *argv[])
{
off_t retval = -1;
- char *suffix;
+ char *suffix = NULL;
if (isdigit((int)(argv[*argno][2]))) {
retval = HDstrtol(argv[*argno] + 2, &suffix, 10);
diff --git a/tools/test/h5dump/errfiles/tall-1.err b/tools/test/h5dump/errfiles/tall-1.err
index 84140f2..2269c97 100644
--- a/tools/test/h5dump/errfiles/tall-1.err
+++ b/tools/test/h5dump/errfiles/tall-1.err
@@ -28,7 +28,7 @@ HDF5-DIAG: Error detected in HDF5 (version (number)) thread (IDs):
minor: Link traversal failure
#009: (file name) line (number) in H5G__traverse_ud(): traversal callback returned invalid ID
major: Symbol table
- minor: Unable to find atom information (already closed?)
+ minor: Unable to find ID information (already closed?)
#010: (file name) line (number) in H5L__extern_traverse(): unable to open external file, external link file name = 'somefile'
major: Links
minor: Unable to open file
diff --git a/tools/test/h5dump/errfiles/tall-2A.err b/tools/test/h5dump/errfiles/tall-2A.err
index 84140f2..2269c97 100644
--- a/tools/test/h5dump/errfiles/tall-2A.err
+++ b/tools/test/h5dump/errfiles/tall-2A.err
@@ -28,7 +28,7 @@ HDF5-DIAG: Error detected in HDF5 (version (number)) thread (IDs):
minor: Link traversal failure
#009: (file name) line (number) in H5G__traverse_ud(): traversal callback returned invalid ID
major: Symbol table
- minor: Unable to find atom information (already closed?)
+ minor: Unable to find ID information (already closed?)
#010: (file name) line (number) in H5L__extern_traverse(): unable to open external file, external link file name = 'somefile'
major: Links
minor: Unable to open file
diff --git a/tools/test/h5dump/errfiles/tall-2A0.err b/tools/test/h5dump/errfiles/tall-2A0.err
index 84140f2..2269c97 100644
--- a/tools/test/h5dump/errfiles/tall-2A0.err
+++ b/tools/test/h5dump/errfiles/tall-2A0.err
@@ -28,7 +28,7 @@ HDF5-DIAG: Error detected in HDF5 (version (number)) thread (IDs):
minor: Link traversal failure
#009: (file name) line (number) in H5G__traverse_ud(): traversal callback returned invalid ID
major: Symbol table
- minor: Unable to find atom information (already closed?)
+ minor: Unable to find ID information (already closed?)
#010: (file name) line (number) in H5L__extern_traverse(): unable to open external file, external link file name = 'somefile'
major: Links
minor: Unable to open file
diff --git a/tools/test/h5dump/errfiles/tall-2B.err b/tools/test/h5dump/errfiles/tall-2B.err
index 84140f2..2269c97 100644
--- a/tools/test/h5dump/errfiles/tall-2B.err
+++ b/tools/test/h5dump/errfiles/tall-2B.err
@@ -28,7 +28,7 @@ HDF5-DIAG: Error detected in HDF5 (version (number)) thread (IDs):
minor: Link traversal failure
#009: (file name) line (number) in H5G__traverse_ud(): traversal callback returned invalid ID
major: Symbol table
- minor: Unable to find atom information (already closed?)
+ minor: Unable to find ID information (already closed?)
#010: (file name) line (number) in H5L__extern_traverse(): unable to open external file, external link file name = 'somefile'
major: Links
minor: Unable to open file
diff --git a/tools/test/h5dump/errfiles/textlink.err b/tools/test/h5dump/errfiles/textlink.err
index 3f77f38..5ca94a8 100644
--- a/tools/test/h5dump/errfiles/textlink.err
+++ b/tools/test/h5dump/errfiles/textlink.err
@@ -28,7 +28,7 @@ HDF5-DIAG: Error detected in HDF5 (version (number)) thread (IDs):
minor: Link traversal failure
#009: (file name) line (number) in H5G__traverse_ud(): traversal callback returned invalid ID
major: Symbol table
- minor: Unable to find atom information (already closed?)
+ minor: Unable to find ID information (already closed?)
#010: (file name) line (number) in H5L__extern_traverse(): unable to open external file, external link file name = 'filename'
major: Links
minor: Unable to open file
@@ -62,7 +62,7 @@ HDF5-DIAG: Error detected in HDF5 (version (number)) thread (IDs):
minor: Link traversal failure
#009: (file name) line (number) in H5G__traverse_ud(): traversal callback returned invalid ID
major: Symbol table
- minor: Unable to find atom information (already closed?)
+ minor: Unable to find ID information (already closed?)
#010: (file name) line (number) in H5L__extern_traverse(): unable to open external file, external link file name = 'anotherfile'
major: Links
minor: Unable to open file
diff --git a/tools/test/h5dump/errfiles/textlinkfar.err b/tools/test/h5dump/errfiles/textlinkfar.err
index 8245291..92bad14 100644
--- a/tools/test/h5dump/errfiles/textlinkfar.err
+++ b/tools/test/h5dump/errfiles/textlinkfar.err
@@ -28,7 +28,7 @@ HDF5-DIAG: Error detected in HDF5 (version (number)) thread (IDs):
minor: Link traversal failure
#009: (file name) line (number) in H5G__traverse_ud(): traversal callback returned invalid ID
major: Symbol table
- minor: Unable to find atom information (already closed?)
+ minor: Unable to find ID information (already closed?)
#010: (file name) line (number) in H5L__extern_traverse(): unable to open object
major: Links
minor: Can't open object
@@ -71,7 +71,7 @@ HDF5-DIAG: Error detected in HDF5 (version (number)) thread (IDs):
minor: Link traversal failure
#004: (file name) line (number) in H5G__traverse_ud(): traversal callback returned invalid ID
major: Symbol table
- minor: Unable to find atom information (already closed?)
+ minor: Unable to find ID information (already closed?)
#005: (file name) line (number) in H5L__extern_traverse(): unable to open object
major: Links
minor: Can't open object
@@ -92,7 +92,7 @@ HDF5-DIAG: Error detected in HDF5 (version (number)) thread (IDs):
minor: Link traversal failure
#011: (file name) line (number) in H5G__traverse_ud(): traversal callback returned invalid ID
major: Symbol table
- minor: Unable to find atom information (already closed?)
+ minor: Unable to find ID information (already closed?)
#012: (file name) line (number) in H5L__extern_traverse(): unable to open object
major: Links
minor: Can't open object
@@ -113,7 +113,7 @@ HDF5-DIAG: Error detected in HDF5 (version (number)) thread (IDs):
minor: Link traversal failure
#018: (file name) line (number) in H5G__traverse_ud(): traversal callback returned invalid ID
major: Symbol table
- minor: Unable to find atom information (already closed?)
+ minor: Unable to find ID information (already closed?)
#019: (file name) line (number) in H5L__extern_traverse(): unable to open object
major: Links
minor: Can't open object
@@ -134,7 +134,7 @@ HDF5-DIAG: Error detected in HDF5 (version (number)) thread (IDs):
minor: Link traversal failure
#025: (file name) line (number) in H5G__traverse_ud(): traversal callback returned invalid ID
major: Symbol table
- minor: Unable to find atom information (already closed?)
+ minor: Unable to find ID information (already closed?)
#026: (file name) line (number) in H5L__extern_traverse(): unable to open object
major: Links
minor: Can't open object
@@ -168,7 +168,7 @@ HDF5-DIAG: Error detected in HDF5 (version (number)) thread (IDs):
minor: Link traversal failure
#004: (file name) line (number) in H5G__traverse_ud(): traversal callback returned invalid ID
major: Symbol table
- minor: Unable to find atom information (already closed?)
+ minor: Unable to find ID information (already closed?)
#005: (file name) line (number) in H5L__extern_traverse(): unable to open object
major: Links
minor: Can't open object
@@ -189,7 +189,7 @@ HDF5-DIAG: Error detected in HDF5 (version (number)) thread (IDs):
minor: Link traversal failure
#011: (file name) line (number) in H5G__traverse_ud(): traversal callback returned invalid ID
major: Symbol table
- minor: Unable to find atom information (already closed?)
+ minor: Unable to find ID information (already closed?)
#012: (file name) line (number) in H5L__extern_traverse(): unable to open object
major: Links
minor: Can't open object
@@ -210,7 +210,7 @@ HDF5-DIAG: Error detected in HDF5 (version (number)) thread (IDs):
minor: Link traversal failure
#018: (file name) line (number) in H5G__traverse_ud(): traversal callback returned invalid ID
major: Symbol table
- minor: Unable to find atom information (already closed?)
+ minor: Unable to find ID information (already closed?)
#019: (file name) line (number) in H5L__extern_traverse(): unable to open object
major: Links
minor: Can't open object
@@ -231,7 +231,7 @@ HDF5-DIAG: Error detected in HDF5 (version (number)) thread (IDs):
minor: Link traversal failure
#025: (file name) line (number) in H5G__traverse_ud(): traversal callback returned invalid ID
major: Symbol table
- minor: Unable to find atom information (already closed?)
+ minor: Unable to find ID information (already closed?)
#026: (file name) line (number) in H5L__extern_traverse(): unable to open object
major: Links
minor: Can't open object
diff --git a/tools/test/h5dump/errfiles/textlinksrc.err b/tools/test/h5dump/errfiles/textlinksrc.err
index 8245291..92bad14 100644
--- a/tools/test/h5dump/errfiles/textlinksrc.err
+++ b/tools/test/h5dump/errfiles/textlinksrc.err
@@ -28,7 +28,7 @@ HDF5-DIAG: Error detected in HDF5 (version (number)) thread (IDs):
minor: Link traversal failure
#009: (file name) line (number) in H5G__traverse_ud(): traversal callback returned invalid ID
major: Symbol table
- minor: Unable to find atom information (already closed?)
+ minor: Unable to find ID information (already closed?)
#010: (file name) line (number) in H5L__extern_traverse(): unable to open object
major: Links
minor: Can't open object
@@ -71,7 +71,7 @@ HDF5-DIAG: Error detected in HDF5 (version (number)) thread (IDs):
minor: Link traversal failure
#004: (file name) line (number) in H5G__traverse_ud(): traversal callback returned invalid ID
major: Symbol table
- minor: Unable to find atom information (already closed?)
+ minor: Unable to find ID information (already closed?)
#005: (file name) line (number) in H5L__extern_traverse(): unable to open object
major: Links
minor: Can't open object
@@ -92,7 +92,7 @@ HDF5-DIAG: Error detected in HDF5 (version (number)) thread (IDs):
minor: Link traversal failure
#011: (file name) line (number) in H5G__traverse_ud(): traversal callback returned invalid ID
major: Symbol table
- minor: Unable to find atom information (already closed?)
+ minor: Unable to find ID information (already closed?)
#012: (file name) line (number) in H5L__extern_traverse(): unable to open object
major: Links
minor: Can't open object
@@ -113,7 +113,7 @@ HDF5-DIAG: Error detected in HDF5 (version (number)) thread (IDs):
minor: Link traversal failure
#018: (file name) line (number) in H5G__traverse_ud(): traversal callback returned invalid ID
major: Symbol table
- minor: Unable to find atom information (already closed?)
+ minor: Unable to find ID information (already closed?)
#019: (file name) line (number) in H5L__extern_traverse(): unable to open object
major: Links
minor: Can't open object
@@ -134,7 +134,7 @@ HDF5-DIAG: Error detected in HDF5 (version (number)) thread (IDs):
minor: Link traversal failure
#025: (file name) line (number) in H5G__traverse_ud(): traversal callback returned invalid ID
major: Symbol table
- minor: Unable to find atom information (already closed?)
+ minor: Unable to find ID information (already closed?)
#026: (file name) line (number) in H5L__extern_traverse(): unable to open object
major: Links
minor: Can't open object
@@ -168,7 +168,7 @@ HDF5-DIAG: Error detected in HDF5 (version (number)) thread (IDs):
minor: Link traversal failure
#004: (file name) line (number) in H5G__traverse_ud(): traversal callback returned invalid ID
major: Symbol table
- minor: Unable to find atom information (already closed?)
+ minor: Unable to find ID information (already closed?)
#005: (file name) line (number) in H5L__extern_traverse(): unable to open object
major: Links
minor: Can't open object
@@ -189,7 +189,7 @@ HDF5-DIAG: Error detected in HDF5 (version (number)) thread (IDs):
minor: Link traversal failure
#011: (file name) line (number) in H5G__traverse_ud(): traversal callback returned invalid ID
major: Symbol table
- minor: Unable to find atom information (already closed?)
+ minor: Unable to find ID information (already closed?)
#012: (file name) line (number) in H5L__extern_traverse(): unable to open object
major: Links
minor: Can't open object
@@ -210,7 +210,7 @@ HDF5-DIAG: Error detected in HDF5 (version (number)) thread (IDs):
minor: Link traversal failure
#018: (file name) line (number) in H5G__traverse_ud(): traversal callback returned invalid ID
major: Symbol table
- minor: Unable to find atom information (already closed?)
+ minor: Unable to find ID information (already closed?)
#019: (file name) line (number) in H5L__extern_traverse(): unable to open object
major: Links
minor: Can't open object
@@ -231,7 +231,7 @@ HDF5-DIAG: Error detected in HDF5 (version (number)) thread (IDs):
minor: Link traversal failure
#025: (file name) line (number) in H5G__traverse_ud(): traversal callback returned invalid ID
major: Symbol table
- minor: Unable to find atom information (already closed?)
+ minor: Unable to find ID information (already closed?)
#026: (file name) line (number) in H5L__extern_traverse(): unable to open object
major: Links
minor: Can't open object
diff --git a/tools/test/h5dump/errfiles/torderlinks1.err b/tools/test/h5dump/errfiles/torderlinks1.err
index caeef27..1fbd47e 100644
--- a/tools/test/h5dump/errfiles/torderlinks1.err
+++ b/tools/test/h5dump/errfiles/torderlinks1.err
@@ -28,7 +28,7 @@ HDF5-DIAG: Error detected in HDF5 (version (number)) thread (IDs):
minor: Link traversal failure
#009: (file name) line (number) in H5G__traverse_ud(): traversal callback returned invalid ID
major: Symbol table
- minor: Unable to find atom information (already closed?)
+ minor: Unable to find ID information (already closed?)
#010: (file name) line (number) in H5L__extern_traverse(): unable to open external file, external link file name = 'fname'
major: Links
minor: Unable to open file
diff --git a/tools/test/h5dump/errfiles/torderlinks2.err b/tools/test/h5dump/errfiles/torderlinks2.err
index caeef27..1fbd47e 100644
--- a/tools/test/h5dump/errfiles/torderlinks2.err
+++ b/tools/test/h5dump/errfiles/torderlinks2.err
@@ -28,7 +28,7 @@ HDF5-DIAG: Error detected in HDF5 (version (number)) thread (IDs):
minor: Link traversal failure
#009: (file name) line (number) in H5G__traverse_ud(): traversal callback returned invalid ID
major: Symbol table
- minor: Unable to find atom information (already closed?)
+ minor: Unable to find ID information (already closed?)
#010: (file name) line (number) in H5L__extern_traverse(): unable to open external file, external link file name = 'fname'
major: Links
minor: Unable to open file
diff --git a/tools/test/h5repack/testfiles/h5repack_layout.h5-dset2_chunk_20x10-errstk.tst b/tools/test/h5repack/testfiles/h5repack_layout.h5-dset2_chunk_20x10-errstk.tst
index 9e83ff8..6f586cc 100644
--- a/tools/test/h5repack/testfiles/h5repack_layout.h5-dset2_chunk_20x10-errstk.tst
+++ b/tools/test/h5repack/testfiles/h5repack_layout.h5-dset2_chunk_20x10-errstk.tst
@@ -1,7 +1,7 @@
HDF5-DIAG: Error detected in HDF5 (version (number)) thread (IDs):
#000: (file name) line (number) in H5Dcreate2(): unable to create dataset
major: Dataset
- minor: Unable to initialize object
+ minor: Unable to create file
#001: (file name) line (number) in H5VL_dataset_create(): dataset create failed
major: Virtual Object Layer
minor: Unable to create file
diff --git a/utils/mirror_vfd/mirror_remote.h b/utils/mirror_vfd/mirror_remote.h
index 0053615..6f37b0b 100644
--- a/utils/mirror_vfd/mirror_remote.h
+++ b/utils/mirror_vfd/mirror_remote.h
@@ -20,6 +20,8 @@
#ifdef H5_HAVE_MIRROR_VFD
+#include "H5FDmirror_priv.h" /* Private header for the mirror VFD */
+
#define V_NONE 0
#define V_ERR 1
#define V_WARN 2