mirror of
https://github.com/HDFGroup/hdf5.git
synced 2026-09-25 04:09:44 +03:00
merge and fix conflict
This commit is contained in:
+4
-2
@@ -216,10 +216,10 @@ java/src/hdf/hdf5lib/callbacks/H5D_iterate_cb.java -text
|
||||
java/src/hdf/hdf5lib/callbacks/H5D_iterate_t.java -text
|
||||
java/src/hdf/hdf5lib/callbacks/H5E_walk_cb.java -text
|
||||
java/src/hdf/hdf5lib/callbacks/H5E_walk_t.java -text
|
||||
java/src/hdf/hdf5lib/callbacks/H5L_iterate_cb.java -text
|
||||
java/src/hdf/hdf5lib/callbacks/H5L_iterate_t.java -text
|
||||
java/src/hdf/hdf5lib/callbacks/H5O_iterate_cb.java -text
|
||||
java/src/hdf/hdf5lib/callbacks/H5L_iterate_opdata_t.java -text
|
||||
java/src/hdf/hdf5lib/callbacks/H5O_iterate_t.java -text
|
||||
java/src/hdf/hdf5lib/callbacks/H5O_iterate_opdata_t.java -text
|
||||
java/src/hdf/hdf5lib/callbacks/H5P_cls_close_func_cb.java -text
|
||||
java/src/hdf/hdf5lib/callbacks/H5P_cls_close_func_t.java -text
|
||||
java/src/hdf/hdf5lib/callbacks/H5P_cls_copy_func_cb.java -text
|
||||
@@ -267,6 +267,8 @@ java/src/hdf/hdf5lib/structs/H5G_info_t.java -text
|
||||
java/src/hdf/hdf5lib/structs/H5L_info_t.java -text
|
||||
java/src/hdf/hdf5lib/structs/H5O_hdr_info_t.java -text
|
||||
java/src/hdf/hdf5lib/structs/H5O_info_t.java -text
|
||||
java/src/hdf/hdf5lib/structs/H5O_native_info_t.java -text
|
||||
java/src/hdf/hdf5lib/structs/H5O_token_t.java -text
|
||||
java/src/hdf/hdf5lib/structs/H5_ih_info_t.java -text
|
||||
java/src/hdf/overview.html -text
|
||||
java/src/jni/CMakeLists.txt -text
|
||||
|
||||
+63
-12
@@ -394,6 +394,9 @@ HDF_DIR_PATHS(${HDF5_PACKAGE_NAME})
|
||||
|
||||
include (${HDF_RESOURCES_EXT_DIR}/HDFLibMacros.cmake)
|
||||
include (${HDF_RESOURCES_DIR}/HDF5Macros.cmake)
|
||||
if (HDF5_ENABLE_SANITIZERS)
|
||||
include (${HDF5_SOURCE_DIR}/config/sanitizer/sanitizers.cmake)
|
||||
endif ()
|
||||
|
||||
#-----------------------------------------------------------------------------
|
||||
# Targets built within this project are exported at Install time for use
|
||||
@@ -432,17 +435,29 @@ endif ()
|
||||
#-----------------------------------------------------------------------------
|
||||
# Option to Build Shared and Static libs, default is both
|
||||
#-----------------------------------------------------------------------------
|
||||
option (BUILD_STATIC_LIBS "Build Static Libraries" ON)
|
||||
set (H5_ENABLE_STATIC_LIB NO)
|
||||
option (BUILD_SHARED_LIBS "Build Shared Libraries" ON)
|
||||
set (H5_ENABLE_SHARED_LIB NO)
|
||||
option (ONLY_SHARED_LIBS "Only Build Shared Libraries" OFF)
|
||||
set (H5_ENABLE_STATIC_LIB YES)
|
||||
|
||||
if (BUILD_STATIC_LIBS)
|
||||
set (H5_ENABLE_STATIC_LIB YES)
|
||||
endif ()
|
||||
if (BUILD_SHARED_LIBS)
|
||||
set (H5_ENABLE_SHARED_LIB YES)
|
||||
endif ()
|
||||
|
||||
# Force only shared libraries if all OFF
|
||||
if (NOT BUILD_STATIC_LIBS AND NOT BUILD_SHARED_LIBS)
|
||||
set (ONLY_SHARED_LIBS ON CACHE BOOL "Only Build Shared Libraries" FORCE)
|
||||
endif ()
|
||||
|
||||
if (ONLY_SHARED_LIBS)
|
||||
set (H5_ENABLE_STATIC_LIB NO)
|
||||
set (BUILD_SHARED_LIBS ON CACHE BOOL "Build Shared Libraries")
|
||||
endif ()
|
||||
option (BUILD_SHARED_LIBS "Build Shared Libraries" ON)
|
||||
set (H5_ENABLE_SHARED_LIB NO)
|
||||
if (BUILD_SHARED_LIBS)
|
||||
set (H5_ENABLE_SHARED_LIB YES)
|
||||
endif ()
|
||||
|
||||
set (CMAKE_POSITION_INDEPENDENT_CODE ON)
|
||||
|
||||
#-----------------------------------------------------------------------------
|
||||
@@ -456,18 +471,30 @@ if (BUILD_STATIC_EXECS)
|
||||
endif ()
|
||||
endif ()
|
||||
|
||||
if (HDF5_ENABLE_ANALYZER_TOOLS)
|
||||
include (${HDF5_SOURCE_DIR}/config/sanitizer/tools.cmake)
|
||||
endif ()
|
||||
if (HDF5_ENABLE_SANITIZERS)
|
||||
include (${HDF5_SOURCE_DIR}/config/sanitizer/sanitizers.cmake)
|
||||
endif ()
|
||||
|
||||
#-----------------------------------------------------------------------------
|
||||
# Option to use code coverage
|
||||
#-----------------------------------------------------------------------------
|
||||
option (HDF5_ENABLE_COVERAGE "Enable code coverage for Libraries and Programs" OFF)
|
||||
if (HDF5_ENABLE_COVERAGE)
|
||||
set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -g -O0 --coverage -fprofile-arcs -ftest-coverage")
|
||||
set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -g --coverage -O0 -fprofile-arcs -ftest-coverage")
|
||||
if (CMAKE_C_COMPILER_ID STREQUAL "GNU")
|
||||
set (LDFLAGS "${LDFLAGS} -fprofile-arcs -ftest-coverage")
|
||||
link_libraries (gcov)
|
||||
include (${HDF5_SOURCE_DIR}/config/sanitizer/code-coverage.cmake)
|
||||
if(CODE_COVERAGE AND CODE_COVERAGE_ADDED)
|
||||
add_code_coverage() # Adds instrumentation to all targets
|
||||
else ()
|
||||
set (CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} --coverage")
|
||||
set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -g -O0 --coverage -fprofile-arcs -ftest-coverage")
|
||||
set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -g --coverage -O0 -fprofile-arcs -ftest-coverage")
|
||||
if (CMAKE_C_COMPILER_ID STREQUAL "GNU")
|
||||
set (LDFLAGS "${LDFLAGS} -fprofile-arcs -ftest-coverage")
|
||||
link_libraries (gcov)
|
||||
else ()
|
||||
set (CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} --coverage")
|
||||
endif ()
|
||||
endif ()
|
||||
endif ()
|
||||
|
||||
@@ -845,6 +872,30 @@ if (BUILD_TESTING)
|
||||
include (${HDF5_SOURCE_DIR}/CTestConfig.cmake)
|
||||
configure_file (${HDF_RESOURCES_DIR}/CTestCustom.cmake ${HDF5_BINARY_DIR}/CTestCustom.ctest @ONLY)
|
||||
|
||||
option (HDF5_TEST_SERIAL "Execute non-parallel tests" ON)
|
||||
mark_as_advanced (HDF5_TEST_SERIAL)
|
||||
|
||||
option (HDF5_TEST_TOOLS "Execute tools tests" ON)
|
||||
mark_as_advanced (HDF5_TEST_TOOLS)
|
||||
|
||||
option (HDF5_TEST_EXAMPLES "Execute tests on examples" ON)
|
||||
mark_as_advanced (HDF5_TEST_EXAMPLES)
|
||||
|
||||
option (HDF5_TEST_SWMR "Execute SWMR tests" ON)
|
||||
mark_as_advanced (HDF5_TEST_SWMR)
|
||||
|
||||
option (HDF5_TEST_PARALLEL "Execute parallel tests" ON)
|
||||
mark_as_advanced (HDF5_TEST_PARALLEL)
|
||||
|
||||
option (HDF5_TEST_FORTRAN "Execute fortran tests" ON)
|
||||
mark_as_advanced (HDF5_TEST_FORTRAN)
|
||||
|
||||
option (HDF5_TEST_CPP "Execute cpp tests" ON)
|
||||
mark_as_advanced (HDF5_TEST_CPP)
|
||||
|
||||
option (HDF5_TEST_JAVA "Execute java tests" ON)
|
||||
mark_as_advanced (HDF5_TEST_JAVA)
|
||||
|
||||
if (NOT HDF5_EXTERNALLY_CONFIGURED)
|
||||
if (EXISTS "${HDF5_SOURCE_DIR}/test" AND IS_DIRECTORY "${HDF5_SOURCE_DIR}/test")
|
||||
add_subdirectory (test)
|
||||
|
||||
@@ -132,6 +132,7 @@
|
||||
./config/intel-flags
|
||||
./config/linux-gnu
|
||||
./config/linux-gnuaout
|
||||
./config/linux-gnueabihf
|
||||
./config/linux-gnulibc1
|
||||
./config/linux-gnulibc2
|
||||
./config/lt_vers.am
|
||||
@@ -748,6 +749,7 @@
|
||||
./src/H5Ipublic.h
|
||||
./src/H5Itest.c
|
||||
./src/H5L.c
|
||||
./src/H5Ldeprec.c
|
||||
./src/H5Lexternal.c
|
||||
./src/H5Lmodule.h
|
||||
./src/H5Lpkg.h
|
||||
@@ -936,7 +938,9 @@
|
||||
./src/H5VLnative_file.c
|
||||
./src/H5VLnative_group.c
|
||||
./src/H5VLnative_link.c
|
||||
./src/H5VLnative_introspect.c
|
||||
./src/H5VLnative_object.c
|
||||
./src/H5VLnative_token.c
|
||||
./src/H5VLnative_private.h
|
||||
./src/H5VLpassthru.c
|
||||
./src/H5VLpassthru.h
|
||||
@@ -1183,6 +1187,7 @@
|
||||
./test/ttime.c
|
||||
./test/trefer.c
|
||||
./test/trefer_deprec.c
|
||||
./test/trefer_shutdown.c
|
||||
./test/trefstr.c
|
||||
./test/tselect.c
|
||||
./test/tsizeslheap.h5
|
||||
@@ -2173,6 +2178,28 @@
|
||||
./tools/testfiles/zerodim.ddl
|
||||
./tools/testfiles/zerodim.h5
|
||||
|
||||
# h5dump new reference validation
|
||||
./tools/testfiles/trefer_attrR.ddl
|
||||
./tools/testfiles/trefer_compatR.ddl
|
||||
./tools/testfiles/trefer_extR.ddl
|
||||
./tools/testfiles/trefer_grpR.ddl
|
||||
./tools/testfiles/trefer_obj_delR.ddl
|
||||
./tools/testfiles/trefer_objR.ddl
|
||||
./tools/testfiles/trefer_paramR.ddl
|
||||
./tools/testfiles/trefer_reg_1dR.ddl
|
||||
./tools/testfiles/trefer_regR.ddl
|
||||
# h5dump and h5diff new reference files
|
||||
./tools/testfiles/trefer_attr.h5
|
||||
./tools/testfiles/trefer_compat.h5
|
||||
./tools/testfiles/trefer_ext1.h5
|
||||
./tools/testfiles/trefer_ext2.h5
|
||||
./tools/testfiles/trefer_grp.h5
|
||||
./tools/testfiles/trefer_obj_del.h5
|
||||
./tools/testfiles/trefer_obj.h5
|
||||
./tools/testfiles/trefer_param.h5
|
||||
./tools/testfiles/trefer_reg_1d.h5
|
||||
./tools/testfiles/trefer_reg.h5
|
||||
|
||||
# Expected output from h5ls tests
|
||||
./tools/testfiles/nosuchfile.ls
|
||||
./tools/testfiles/help-1.ls
|
||||
@@ -2353,6 +2380,7 @@
|
||||
./tools/test/h5diff/testfiles/h5diff_56.txt
|
||||
./tools/test/h5diff/testfiles/h5diff_57.txt
|
||||
./tools/test/h5diff/testfiles/h5diff_58.txt
|
||||
./tools/test/h5diff/testfiles/h5diff_58_ref.txt
|
||||
./tools/test/h5diff/testfiles/h5diff_59.txt
|
||||
./tools/test/h5diff/testfiles/h5diff_60.txt
|
||||
./tools/test/h5diff/testfiles/h5diff_61.txt
|
||||
@@ -2571,6 +2599,8 @@
|
||||
./tools/test/h5diff/testfiles/h5diff_v1.txt
|
||||
./tools/test/h5diff/testfiles/h5diff_v2.txt
|
||||
./tools/test/h5diff/testfiles/h5diff_v3.txt
|
||||
#reg_ref
|
||||
./tools/test/h5diff/testfiles/h5diff_reg.txt
|
||||
|
||||
#test files for h5repack
|
||||
./tools/test/h5repack/testfiles/README
|
||||
@@ -3017,10 +3047,10 @@
|
||||
./java/src/hdf/hdf5lib/callbacks/H5D_append_t.java
|
||||
./java/src/hdf/hdf5lib/callbacks/H5E_walk_cb.java
|
||||
./java/src/hdf/hdf5lib/callbacks/H5E_walk_t.java
|
||||
./java/src/hdf/hdf5lib/callbacks/H5L_iterate_cb.java
|
||||
./java/src/hdf/hdf5lib/callbacks/H5L_iterate_t.java
|
||||
./java/src/hdf/hdf5lib/callbacks/H5O_iterate_cb.java
|
||||
./java/src/hdf/hdf5lib/callbacks/H5L_iterate_opdata_t.java
|
||||
./java/src/hdf/hdf5lib/callbacks/H5O_iterate_t.java
|
||||
./java/src/hdf/hdf5lib/callbacks/H5O_iterate_opdata_t.java
|
||||
./java/src/hdf/hdf5lib/callbacks/H5P_cls_close_func_cb.java
|
||||
./java/src/hdf/hdf5lib/callbacks/H5P_cls_close_func_t.java
|
||||
./java/src/hdf/hdf5lib/callbacks/H5P_cls_copy_func_cb.java
|
||||
@@ -3073,6 +3103,8 @@
|
||||
./java/src/hdf/hdf5lib/structs/H5L_info_t.java
|
||||
./java/src/hdf/hdf5lib/structs/H5O_hdr_info_t.java
|
||||
./java/src/hdf/hdf5lib/structs/H5O_info_t.java
|
||||
./java/src/hdf/hdf5lib/structs/H5O_native_info_t.java
|
||||
./java/src/hdf/hdf5lib/structs/H5O_token_t.java
|
||||
|
||||
./java/src/hdf/hdf5lib/H5.java
|
||||
./java/src/hdf/hdf5lib/HDF5Constants.java
|
||||
@@ -3472,6 +3504,13 @@
|
||||
./config/cmake/scripts/HDF5config.cmake
|
||||
./config/cmake/scripts/HDF5options.cmake
|
||||
|
||||
# CMake-specific Sanitizer Scripts
|
||||
./config/sanitizer/code-coverage.cmake
|
||||
./config/sanitizer/sanitizers.cmake
|
||||
./config/sanitizer/tools.cmake
|
||||
./config/sanitizer/LICENSE
|
||||
./config/sanitizer/README.md
|
||||
|
||||
# CMake-specific HPC Scripts
|
||||
./config/cmake/scripts/HPC/sbatch-HDF5options.cmake
|
||||
./config/cmake/scripts/HPC/bsub-HDF5options.cmake
|
||||
|
||||
@@ -114,13 +114,6 @@ fi
|
||||
|
||||
|
||||
usage() {
|
||||
# A wonderfully informative "usage" message.
|
||||
echo "usage: $prog_name [OPTIONS] <compile line>"
|
||||
echo " OPTIONS:"
|
||||
echo " -help This help message."
|
||||
echo " -echo Show all the shell commands executed"
|
||||
echo " -prefix=DIR Prefix directory to find HDF5 lib/ and include/"
|
||||
echo " subdirectories [default: $prefix]"
|
||||
# A wonderfully informative "usage" message.
|
||||
echo "usage: $prog_name [OPTIONS] <compile line>"
|
||||
echo " OPTIONS:"
|
||||
|
||||
+44
-14
@@ -9,7 +9,7 @@ use warnings;
|
||||
# need to be decremented. - QAK)
|
||||
|
||||
# Max. library "index" (0 = v1.0, 1 = 1.2, 2 = 1.4, 3 = 1.6, 4 = 1.8, 5 = 1.10, 6 = 1.12, 7 = 1.14, etc)
|
||||
$max_idx = 7;
|
||||
$max_idx = 8;
|
||||
|
||||
# Min. supported previous library version "index" (0 = v1.0, 1 = 1.2, etc)
|
||||
$min_sup_idx = 3;
|
||||
@@ -90,7 +90,8 @@ sub print_checkoptions ($) {
|
||||
my $curr_idx; # Current API version index
|
||||
|
||||
# Print the option checking
|
||||
print $fh "\n/* Issue error if contradicting macros have been defined. */\n";
|
||||
print $fh "\n\n/* Issue error if contradicting macros have been defined. */\n";
|
||||
print $fh "/* (Can't use an older (deprecated) API version if deprecated symbols have been disabled) */\n";
|
||||
|
||||
# Print the #ifdef
|
||||
print $fh "#if (";
|
||||
@@ -119,7 +120,30 @@ sub print_checkoptions ($) {
|
||||
##############################################################################
|
||||
# Print "global" API version macro settings
|
||||
#
|
||||
sub print_globalapivers ($) {
|
||||
sub print_globalapidefvers ($) {
|
||||
my $fh = shift; # File handle for output file
|
||||
my $curr_idx; # Current API version index
|
||||
|
||||
# Print the descriptive comment
|
||||
print $fh "\n\n/* If a particular default \"global\" version of the library's interfaces is\n";
|
||||
print $fh " * chosen, set the corresponding version macro for API symbols.\n";
|
||||
print $fh " *\n";
|
||||
print $fh " */\n";
|
||||
|
||||
for $curr_idx ($min_sup_idx .. ($max_idx - 1)) {
|
||||
# Print API version ifdef
|
||||
print $fh "\n#if defined(H5_USE_1", ($curr_idx * 2), "_API_DEFAULT) && !defined(H5_USE_1", ($curr_idx * 2), "_API)\n";
|
||||
# Print API version definition
|
||||
print $fh " " x $indent, "#define H5_USE_1", ($curr_idx * 2), "_API 1\n";
|
||||
# Print API version endif
|
||||
print $fh "#endif /* H5_USE_1", ($curr_idx * 2), "_API_DEFAULT && !H5_USE_1", ($curr_idx * 2), "_API */\n";
|
||||
}
|
||||
}
|
||||
|
||||
##############################################################################
|
||||
# Print "global" API symbol version macro settings
|
||||
#
|
||||
sub print_globalapisymbolvers ($) {
|
||||
my $fh = shift; # File handle for output file
|
||||
my $curr_idx; # Current API version index
|
||||
|
||||
@@ -131,15 +155,6 @@ sub print_globalapivers ($) {
|
||||
print $fh " * API symbol, the individual API version macro takes priority.\n";
|
||||
print $fh " */\n";
|
||||
|
||||
for $curr_idx ($min_sup_idx .. ($max_idx - 1)) {
|
||||
# Print API version ifdef
|
||||
print $fh "#if defined(H5_USE_1", ($curr_idx * 2), "_API_DEFAULT) && !defined(H5_USE_1", ($curr_idx * 2), "_API)\n";
|
||||
# Print API version definition
|
||||
print $fh " " x $indent, "#define H5_USE_1", ($curr_idx * 2), "_API 1\n";
|
||||
# Print API version endif
|
||||
print $fh "#endif /* H5_USE_1", ($curr_idx * 2), "_API_DEFAULT && !H5_USE_1", ($curr_idx * 2), "_API */\n\n";
|
||||
}
|
||||
|
||||
# Loop over supported older library APIs and define the appropriate macros
|
||||
for $curr_idx ($min_sup_idx .. ($max_idx - 1)) {
|
||||
# Print API version ifdef
|
||||
@@ -339,7 +354,18 @@ sub parse_line ($) {
|
||||
my $vers_idx; # Index of version in array
|
||||
|
||||
# Do some validation on the input
|
||||
if(!( $_ =~ /v1[02468]/ || $_ =~ /v11[02468]/ )) {
|
||||
# Note: v111 is allowed because H5O functions were prematurely versioned
|
||||
# in HDF5 1.10. Because users were affected by this, the versioning
|
||||
# was rescinded but the H5O version 2 functions were kept to be
|
||||
# called directly. Now that the version macros are added in 1.12,
|
||||
# along with a 3rd version of the H5O functions, the H5O function
|
||||
# version for default api=v110 should be version 1 to work correctly
|
||||
# with 1.10 applications that were using unversioned H5O functions,
|
||||
# and the H5O function version should be version 3 for default api=v112
|
||||
# (the default api version for 1.12). Allowing a v111 entry and
|
||||
# incrementing its index 13 lines below allows a version 2 that is
|
||||
# never accessed via the H5O function macros.
|
||||
if(!( $_ =~ /v1[02468]/ || $_ =~ /v11[02468]/ || $_ =~ /v111/ )) {
|
||||
die "bad version information: $name";
|
||||
}
|
||||
if(exists($sym_versions{$_})) {
|
||||
@@ -352,6 +378,9 @@ sub parse_line ($) {
|
||||
#print "parse_line: _=$_\n";
|
||||
# Get the index of the version
|
||||
($vers_idx) = ($_ =~ /v1(\d+)/);
|
||||
if($vers_idx == 11) {
|
||||
$vers_idx++;
|
||||
}
|
||||
$vers_idx /= 2;
|
||||
#print "parse_line: vers_idx='$vers_idx'\n";
|
||||
push(@vers_nums, $vers_idx);
|
||||
@@ -444,8 +473,9 @@ sub create_public ($) {
|
||||
print_copyright(*HEADER);
|
||||
print_warning(*HEADER);
|
||||
print_startprotect(*HEADER, $file);
|
||||
print_globalapidefvers(*HEADER);
|
||||
print_checkoptions(*HEADER);
|
||||
print_globalapivers(*HEADER);
|
||||
print_globalapisymbolvers(*HEADER);
|
||||
print_defaultapivers(*HEADER);
|
||||
print_endprotect(*HEADER, $file);
|
||||
|
||||
|
||||
@@ -71,6 +71,7 @@ $Source = "";
|
||||
"uint32_t" => "Iu",
|
||||
"uint64_t" => "UL",
|
||||
"H5I_type_t" => "It",
|
||||
"H5O_token_t" => "k",
|
||||
"H5G_link_t" => "Ll", #Same as H5L_type_t now
|
||||
"H5L_type_t" => "Ll",
|
||||
"MPI_Comm" => "Mc",
|
||||
@@ -100,24 +101,35 @@ $Source = "";
|
||||
"H5T_str_t" => "Tz",
|
||||
"unsigned long" => "Ul",
|
||||
"unsigned long long" => "UL",
|
||||
"H5VL_subclass_t" => "VS",
|
||||
"H5VL_get_conn_lvl_t" => "VL",
|
||||
"H5VL_attr_get_t" => "Va",
|
||||
"H5VL_attr_optional_t" => "Vs",
|
||||
"H5VL_attr_specific_t" => "Vb",
|
||||
"H5VL_blob_specific_t" => "VB",
|
||||
"H5VL_class_value_t" => "VC",
|
||||
"H5VL_dataset_get_t" => "Vc",
|
||||
"H5VL_dataset_specific_t" => "Vd",
|
||||
"H5VL_dataset_optional_t" => "Vt",
|
||||
"H5VL_datatype_get_t" => "Ve",
|
||||
"H5VL_datatype_specific_t" => "Vf",
|
||||
"H5VL_datatype_optional_t" => "Vu",
|
||||
"H5VL_file_get_t" => "Vg",
|
||||
"H5VL_file_specific_t" => "Vh",
|
||||
"H5VL_file_optional_t" => "Vv",
|
||||
"H5VL_group_get_t" => "Vi",
|
||||
"H5VL_group_specific_t" => "Vj",
|
||||
"H5VL_group_optional_t" => "Vw",
|
||||
"H5VL_link_create_type_t" => "Vk",
|
||||
"H5VL_link_get_t" => "Vl",
|
||||
"H5VL_link_specific_t" => "Vm",
|
||||
"H5VL_link_optional_t" => "Vx",
|
||||
"H5VL_object_get_t" => "Vn",
|
||||
"H5VL_object_specific_t" => "Vo",
|
||||
"H5VL_object_optional_t" => "Vy",
|
||||
"H5VL_request_specific_t" => "Vr",
|
||||
"H5VL_request_optional_t" => "Vz",
|
||||
"H5VL_blob_optional_t" => "VA",
|
||||
"void" => "x",
|
||||
"FILE" => "x",
|
||||
"H5A_operator_t" => "x",
|
||||
@@ -153,12 +165,18 @@ $Source = "";
|
||||
"H5I_search_func_t" => "x",
|
||||
"H5L_class_t" => "x",
|
||||
"H5L_elink_traverse_t" => "x",
|
||||
"H5L_iterate_t" => "x",
|
||||
"H5L_info1_t" => "x",
|
||||
"H5L_info2_t" => "x",
|
||||
"H5L_iterate1_t" => "x",
|
||||
"H5L_iterate2_t" => "x",
|
||||
"H5M_iterate_t" => 'x',
|
||||
"H5MM_allocate_t" => "x",
|
||||
"H5MM_free_t" => "x",
|
||||
"H5O_info_t" => "x",
|
||||
"H5O_iterate_t" => "x",
|
||||
"H5O_info1_t" => "x",
|
||||
"H5O_info2_t" => "x",
|
||||
"H5O_native_info_t" => "x",
|
||||
"H5O_iterate1_t" => "x",
|
||||
"H5O_iterate2_t" => "x",
|
||||
"H5O_mcdt_search_cb_t" => "x",
|
||||
"H5P_cls_create_func_t" => "x",
|
||||
"H5P_cls_copy_func_t" => "x",
|
||||
@@ -221,6 +239,7 @@ sub argstring ($$$) {
|
||||
# certain type qualifiers, and indirection.
|
||||
$atype =~ s/^\bconst\b//;
|
||||
$atype =~ s/\bH5_ATTR_UNUSED\b//g;
|
||||
$atype =~ s/\bH5_ATTR_NDEBUG_UNUSED\b//g;
|
||||
$atype =~ s/\s+/ /g;
|
||||
$ptr = length $1 if $atype =~ s/(\*+)//;
|
||||
$atype =~ s/^\s+//;
|
||||
|
||||
+17
-5
@@ -1,5 +1,6 @@
|
||||
#!/usr/bin/perl -w
|
||||
#!/usr/bin/env perl
|
||||
require 5.003;
|
||||
use warnings;
|
||||
|
||||
#
|
||||
# Copyright by The HDF Group.
|
||||
@@ -205,8 +206,13 @@ while (<>) {
|
||||
($last_c_name, $toss) = split /\:/, $_;
|
||||
}
|
||||
|
||||
# Retain C/C++ compile line, which comes with the line of warning
|
||||
if($_ =~ /.*[A-Za-z0-9_]\.[chC]\(.*[0-9]\):.*#.*/) {
|
||||
$last_c_name = $_;
|
||||
}
|
||||
|
||||
# Skip lines that don't have the word "warning"
|
||||
next if $_ !~ /[Ww]arning:/;
|
||||
next if $_ !~ /[Ww]arning/;
|
||||
|
||||
# Skip warnings from linker
|
||||
next if $_ =~ /ld: warning:/;
|
||||
@@ -256,11 +262,16 @@ while (<>) {
|
||||
} elsif($_ =~ /^\".*, line [0-9]+: *[Ww]arning:.*/) {
|
||||
($name, $toss, $warning, $extra, $extra2) = split /\:/, $_;
|
||||
($name, $line) = split /\,/, $name;
|
||||
$name =~ s/^\"//g;
|
||||
$name =~ s/\"$//g;
|
||||
$line =~ s/^\s*line\s*//g;
|
||||
$name =~ s/^\"//g;
|
||||
$name =~ s/\"$//g;
|
||||
$line =~ s/^\s*line\s*//g;
|
||||
# print "name:'", $name, "'-'", $line, "'\n";
|
||||
# print "warning:'", $warning, "'\n";
|
||||
# Check for Intel icc warning
|
||||
} elsif($_ =~ /.*[A-Za-z0-9_]\.[chC]\(.*[0-9]\):.*#.*/) {
|
||||
($last_c_name, $toss, $warning) = split /\:/, $last_c_name;
|
||||
($name, $line) = split /\(/, $last_c_name;
|
||||
$line =~ s/\)//g;
|
||||
} else {
|
||||
# Check for 'character offset' field appended to file & line #
|
||||
# (This is probably specific to GCC)
|
||||
@@ -330,6 +341,7 @@ while (<>) {
|
||||
# Convert all quotes to '
|
||||
$warning =~ s/‘/'/g;
|
||||
$warning =~ s/’/'/g;
|
||||
$warning =~ s/"/'/g;
|
||||
|
||||
#
|
||||
# These skipped messages & "genericizations" may be specific to GCC
|
||||
|
||||
@@ -68,6 +68,6 @@ foreach (example ${tutr_examples})
|
||||
set_target_properties (cpp_ex_${example} PROPERTIES FOLDER examples/cpp)
|
||||
endforeach ()
|
||||
|
||||
if (BUILD_TESTING)
|
||||
if (BUILD_TESTING AND HDF5_TEST_CPP AND HDF5_TEST_EXAMPLES AND HDF5_TEST_SERIAL)
|
||||
include (CMakeTests.cmake)
|
||||
endif ()
|
||||
|
||||
@@ -36,7 +36,7 @@ const H5std_string FILE_NAME( "Group.h5" );
|
||||
const int RANK = 2;
|
||||
|
||||
// Operator function
|
||||
extern "C" herr_t file_info(hid_t loc_id, const char *name, const H5L_info_t *linfo,
|
||||
extern "C" herr_t file_info(hid_t loc_id, const char *name, const H5L_info2_t *linfo,
|
||||
void *opdata);
|
||||
|
||||
int main(void)
|
||||
@@ -157,7 +157,7 @@ int main(void)
|
||||
* root directory.
|
||||
*/
|
||||
cout << endl << "Iterating over elements in the file" << endl;
|
||||
herr_t idx = H5Literate(file->getId(), H5_INDEX_NAME, H5_ITER_INC, NULL, file_info, NULL);
|
||||
herr_t idx = H5Literate2(file->getId(), H5_INDEX_NAME, H5_ITER_INC, NULL, file_info, NULL);
|
||||
cout << endl;
|
||||
|
||||
/*
|
||||
@@ -175,7 +175,7 @@ int main(void)
|
||||
cout << "\"Data\" is unlinked" << endl;
|
||||
|
||||
cout << endl << "Iterating over elements in the file again" << endl;
|
||||
idx = H5Literate(file->getId(), H5_INDEX_NAME, H5_ITER_INC, NULL, file_info, NULL);
|
||||
idx = H5Literate2(file->getId(), H5_INDEX_NAME, H5_ITER_INC, NULL, file_info, NULL);
|
||||
cout << endl;
|
||||
|
||||
/*
|
||||
@@ -219,7 +219,7 @@ int main(void)
|
||||
* Operator function.
|
||||
*/
|
||||
herr_t
|
||||
file_info(hid_t loc_id, const char *name, const H5L_info_t *linfo, void *opdata)
|
||||
file_info(hid_t loc_id, const char *name, const H5L_info2_t *linfo, void *opdata)
|
||||
{
|
||||
hid_t group;
|
||||
|
||||
|
||||
@@ -11493,7 +11493,7 @@ normal'><span style='font-size:14.0pt;mso-bidi-font-size:11.0pt;line-height:
|
||||
mso-border-top-alt:solid windowtext .5pt;mso-border-left-alt:solid windowtext .5pt;
|
||||
mso-border-alt:solid windowtext .5pt;padding:0in 5.4pt 0in 5.4pt'>
|
||||
<p class=MsoNormal style='margin-bottom:0in;margin-bottom:.0001pt;line-height:
|
||||
normal'>H5L_info_t getLinkInfo(const char* link_name,</p>
|
||||
normal'>H5L_info2_t getLinkInfo(const char* link_name,</p>
|
||||
<p class=MsoNormal style='margin-bottom:0in;margin-bottom:.0001pt;line-height:
|
||||
normal'><span style='mso-tab-count:1'> </span>const
|
||||
LinkAccPropList& lapl = LinkAccPropList::DEFAULT)</p>
|
||||
@@ -11526,7 +11526,7 @@ normal'><span style='font-size:14.0pt;mso-bidi-font-size:11.0pt;line-height:
|
||||
mso-border-top-alt:solid windowtext .5pt;mso-border-left-alt:solid windowtext .5pt;
|
||||
mso-border-alt:solid windowtext .5pt;padding:0in 5.4pt 0in 5.4pt'>
|
||||
<p class=MsoNormal style='margin-bottom:0in;margin-bottom:.0001pt;line-height:
|
||||
normal'>H5L_info_t getLinkInfo(const H5std_string& link_name,</p>
|
||||
normal'>H5L_info2_t getLinkInfo(const H5std_string& link_name,</p>
|
||||
<p class=MsoNormal style='margin-bottom:0in;margin-bottom:.0001pt;line-height:
|
||||
normal'><span style='mso-tab-count:1'> </span>const
|
||||
LinkAccPropList& lapl = LinkAccPropList::DEFAULT)</p>
|
||||
|
||||
+136
-21
@@ -1403,6 +1403,121 @@ void H5Location::unlink(const H5std_string& name, const LinkAccPropList& lapl) c
|
||||
unlink(name.c_str(), lapl);
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
// Function: H5Location::getNativeObjinfo
|
||||
///\brief Retrieves native information about an HDF5 object.
|
||||
///\param objinfo - OUT: Struct containing the native object info
|
||||
///\param fields - IN: Indicates the group of information to be retrieved
|
||||
///\par Description
|
||||
/// Valid values of \a fields are as follows:
|
||||
/// \li \c H5O_INFO_HDR (default)
|
||||
/// \li \c H5O_INFO_META_SIZE
|
||||
/// \li \c H5O_INFO_ALL
|
||||
// July, 2018
|
||||
//--------------------------------------------------------------------------
|
||||
void H5Location::getNativeObjinfo(H5O_native_info_t& objinfo, unsigned fields) const
|
||||
{
|
||||
|
||||
// Use C API to get information of the object
|
||||
herr_t ret_value = H5Oget_native_info(getId(), &objinfo, fields);
|
||||
|
||||
// Throw exception if C API returns failure
|
||||
if (ret_value < 0)
|
||||
throwException(inMemFunc("getNativeObjinfo"), "H5Oget_native_info failed");
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
// Function: H5Location::getNativeObjinfo
|
||||
///\brief Retrieves native information about an HDF5 object given its name.
|
||||
///\param name - IN: Name of the object to be queried - \c char *
|
||||
///\param objinfo - OUT: Struct containing the native object info
|
||||
///\param fields - IN: Indicates the group of information to be retrieved
|
||||
/// - default to H5O_INFO_HDR
|
||||
///\param lapl - IN: Link access property list
|
||||
///\par Description
|
||||
/// Valid values of \a fields are as follows:
|
||||
/// \li \c H5O_INFO_HDR (default)
|
||||
/// \li \c H5O_INFO_META_SIZE
|
||||
/// \li \c H5O_INFO_ALL
|
||||
// July, 2018
|
||||
//--------------------------------------------------------------------------
|
||||
void H5Location::getNativeObjinfo(const char* name, H5O_native_info_t& objinfo, unsigned fields, const LinkAccPropList& lapl) const
|
||||
{
|
||||
// Use C API to get information of the object
|
||||
herr_t ret_value = H5Oget_native_info_by_name(getId(), name, &objinfo, fields, lapl.getId());
|
||||
|
||||
// Throw exception if C API returns failure
|
||||
if (ret_value < 0)
|
||||
throwException(inMemFunc("getNativeObjinfo"), "H5Oget_native_info_by_name failed");
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
// Function: H5Location::getNativeObjinfo
|
||||
///\brief This is an overloaded member function, provided for convenience.
|
||||
/// It differs from the above function in that it takes
|
||||
/// a reference to an \c H5std_string for \a name.
|
||||
///\param name - IN: Name of the object to be queried - \c H5std_string
|
||||
///\param objinfo - OUT: Struct containing the native object info
|
||||
///\param fields - IN: Indicates the group of information to be retrieved
|
||||
/// - default to H5O_INFO_HDR
|
||||
///\param lapl - IN: Link access property list
|
||||
// July, 2018
|
||||
//--------------------------------------------------------------------------
|
||||
void H5Location::getNativeObjinfo(const H5std_string& name, H5O_native_info_t& objinfo, unsigned fields, const LinkAccPropList& lapl) const
|
||||
{
|
||||
getNativeObjinfo(name.c_str(), objinfo, fields, lapl);
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
// Function: H5Location::getNativeObjinfo
|
||||
///\brief Retrieves native information about an HDF5 object given its index.
|
||||
///\param grp_name - IN: Group name where the object belongs - \c char *
|
||||
///\param idx_type - IN: Type of index
|
||||
///\param order - IN: Order to traverse
|
||||
///\param idx - IN: Object position
|
||||
///\param objinfo - OUT: Struct containing the native object info
|
||||
///\param fields - IN: Indicates the group of information to be retrieved
|
||||
/// - default to H5O_INFO_HDR
|
||||
///\param lapl - IN: Link access property list
|
||||
///\par Description
|
||||
/// Valid values of \a fields are as follows:
|
||||
/// \li \c H5O_INFO_HDR (default)
|
||||
/// \li \c H5O_INFO_META_SIZE
|
||||
/// \li \c H5O_INFO_ALL
|
||||
// July, 2018
|
||||
//--------------------------------------------------------------------------
|
||||
void H5Location::getNativeObjinfo(const char* grp_name, H5_index_t idx_type,
|
||||
H5_iter_order_t order, hsize_t idx, H5O_native_info_t& objinfo, unsigned fields,
|
||||
const LinkAccPropList& lapl) const
|
||||
{
|
||||
// Use C API to get information of the object
|
||||
herr_t ret_value = H5Oget_native_info_by_idx(getId(), grp_name, idx_type, order,
|
||||
idx, &objinfo, fields, lapl.getId());
|
||||
|
||||
// Throw exception if C API returns failure
|
||||
if (ret_value < 0)
|
||||
throwException(inMemFunc("getNativeObjinfo"), "H5Oget_native_info_by_idx failed");
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
// Function: H5Location::getObjinfo
|
||||
///\brief This is an overloaded member function, provided for convenience.
|
||||
/// It differs from the above function in that it takes
|
||||
/// a reference to an \c H5std_string for \a name.
|
||||
///\param name - IN: Name of the object to be queried - \c H5std_string
|
||||
///\param objinfo - OUT: Struct containing the native object info
|
||||
///\param fields - IN: Indicates a group of information to be retrieved
|
||||
/// - default to H5O_INFO_HDR
|
||||
///\param lapl - IN: Link access property list
|
||||
// July, 2018
|
||||
//--------------------------------------------------------------------------
|
||||
void H5Location::getNativeObjinfo(const H5std_string& grp_name, H5_index_t idx_type,
|
||||
H5_iter_order_t order, hsize_t idx, H5O_native_info_t& objinfo, unsigned fields,
|
||||
const LinkAccPropList& lapl) const
|
||||
{
|
||||
getNativeObjinfo(grp_name.c_str(), idx_type, order, idx, objinfo, fields, lapl);
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
// Function: H5Location::getObjinfo
|
||||
///\brief Retrieves information about an HDF5 object.
|
||||
@@ -1418,15 +1533,15 @@ void H5Location::unlink(const H5std_string& name, const LinkAccPropList& lapl) c
|
||||
/// \li \c H5O_INFO_ALL
|
||||
// July, 2018
|
||||
//--------------------------------------------------------------------------
|
||||
void H5Location::getObjinfo(H5O_info_t& objinfo, unsigned fields) const
|
||||
void H5Location::getObjinfo(H5O_info2_t& objinfo, unsigned fields) const
|
||||
{
|
||||
|
||||
// Use C API to get information of the object
|
||||
herr_t ret_value = H5Oget_info2(getId(), &objinfo, fields);
|
||||
herr_t ret_value = H5Oget_info3(getId(), &objinfo, fields);
|
||||
|
||||
// Throw exception if C API returns failure
|
||||
if (ret_value < 0)
|
||||
throwException(inMemFunc("getObjinfo"), "H5Oget_info2 failed");
|
||||
throwException(inMemFunc("getObjinfo"), "H5Oget_info3 failed");
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
@@ -1447,10 +1562,10 @@ void H5Location::getObjinfo(H5O_info_t& objinfo, unsigned fields) const
|
||||
/// \li \c H5O_INFO_ALL
|
||||
// July, 2018
|
||||
//--------------------------------------------------------------------------
|
||||
void H5Location::getObjinfo(const char* name, H5O_info_t& objinfo, unsigned fields, const LinkAccPropList& lapl) const
|
||||
void H5Location::getObjinfo(const char* name, H5O_info2_t& objinfo, unsigned fields, const LinkAccPropList& lapl) const
|
||||
{
|
||||
// Use C API to get information of the object
|
||||
herr_t ret_value = H5Oget_info_by_name2(getId(), name, &objinfo, fields, lapl.getId());
|
||||
herr_t ret_value = H5Oget_info_by_name3(getId(), name, &objinfo, fields, lapl.getId());
|
||||
|
||||
// Throw exception if C API returns failure
|
||||
if (ret_value < 0)
|
||||
@@ -1469,7 +1584,7 @@ void H5Location::getObjinfo(const char* name, H5O_info_t& objinfo, unsigned fiel
|
||||
///\param lapl - IN: Link access property list
|
||||
// July, 2018
|
||||
//--------------------------------------------------------------------------
|
||||
void H5Location::getObjinfo(const H5std_string& name, H5O_info_t& objinfo, unsigned fields, const LinkAccPropList& lapl) const
|
||||
void H5Location::getObjinfo(const H5std_string& name, H5O_info2_t& objinfo, unsigned fields, const LinkAccPropList& lapl) const
|
||||
{
|
||||
getObjinfo(name.c_str(), objinfo, fields, lapl);
|
||||
}
|
||||
@@ -1496,11 +1611,11 @@ void H5Location::getObjinfo(const H5std_string& name, H5O_info_t& objinfo, unsig
|
||||
// July, 2018
|
||||
//--------------------------------------------------------------------------
|
||||
void H5Location::getObjinfo(const char* grp_name, H5_index_t idx_type,
|
||||
H5_iter_order_t order, hsize_t idx, H5O_info_t& objinfo, unsigned fields,
|
||||
H5_iter_order_t order, hsize_t idx, H5O_info2_t& objinfo, unsigned fields,
|
||||
const LinkAccPropList& lapl) const
|
||||
{
|
||||
// Use C API to get information of the object
|
||||
herr_t ret_value = H5Oget_info_by_idx2(getId(), grp_name, idx_type, order,
|
||||
herr_t ret_value = H5Oget_info_by_idx3(getId(), grp_name, idx_type, order,
|
||||
idx, &objinfo, fields, lapl.getId());
|
||||
|
||||
// Throw exception if C API returns failure
|
||||
@@ -1521,7 +1636,7 @@ void H5Location::getObjinfo(const char* grp_name, H5_index_t idx_type,
|
||||
// July, 2018
|
||||
//--------------------------------------------------------------------------
|
||||
void H5Location::getObjinfo(const H5std_string& grp_name, H5_index_t idx_type,
|
||||
H5_iter_order_t order, hsize_t idx, H5O_info_t& objinfo, unsigned fields,
|
||||
H5_iter_order_t order, hsize_t idx, H5O_info2_t& objinfo, unsigned fields,
|
||||
const LinkAccPropList& lapl) const
|
||||
{
|
||||
getObjinfo(grp_name.c_str(), idx_type, order, idx, objinfo, fields, lapl);
|
||||
@@ -1596,11 +1711,11 @@ void H5Location::getObjinfo(const H5std_string& name, H5G_stat_t& statbuf) const
|
||||
///\exception H5::FileIException/H5::GroupIException/H5::LocationException
|
||||
// 2000
|
||||
//--------------------------------------------------------------------------
|
||||
H5L_info_t H5Location::getLinkInfo(const char* link_name, const LinkAccPropList& lapl) const
|
||||
H5L_info2_t H5Location::getLinkInfo(const char* link_name, const LinkAccPropList& lapl) const
|
||||
{
|
||||
H5L_info_t linkinfo; // link info structure
|
||||
H5L_info2_t linkinfo; // link info structure
|
||||
|
||||
herr_t ret_value = H5Lget_info(getId(), link_name, &linkinfo, lapl.getId());
|
||||
herr_t ret_value = H5Lget_info2(getId(), link_name, &linkinfo, lapl.getId());
|
||||
if (ret_value < 0)
|
||||
throwException("getLinkInfo", "H5Lget_info to find buffer size failed");
|
||||
|
||||
@@ -1613,7 +1728,7 @@ H5L_info_t H5Location::getLinkInfo(const char* link_name, const LinkAccPropList&
|
||||
/// It differs from the above function in that it takes an
|
||||
/// \c H5std_string for \a link_name.
|
||||
//--------------------------------------------------------------------------
|
||||
H5L_info_t H5Location::getLinkInfo(const H5std_string& link_name, const LinkAccPropList& lapl) const
|
||||
H5L_info2_t H5Location::getLinkInfo(const H5std_string& link_name, const LinkAccPropList& lapl) const
|
||||
{
|
||||
return(getLinkInfo(link_name.c_str(), lapl));
|
||||
}
|
||||
@@ -1629,7 +1744,7 @@ H5L_info_t H5Location::getLinkInfo(const H5std_string& link_name, const LinkAccP
|
||||
//--------------------------------------------------------------------------
|
||||
H5std_string H5Location::getLinkval(const char* name, size_t size) const
|
||||
{
|
||||
H5L_info_t linkinfo;
|
||||
H5L_info2_t linkinfo;
|
||||
char *value_C; // value in C string
|
||||
size_t val_size = size;
|
||||
H5std_string value = "";
|
||||
@@ -1638,7 +1753,7 @@ H5std_string H5Location::getLinkval(const char* name, size_t size) const
|
||||
// if user doesn't provide buffer size, determine it
|
||||
if (size == 0)
|
||||
{
|
||||
ret_value = H5Lget_info(getId(), name, &linkinfo, H5P_DEFAULT);
|
||||
ret_value = H5Lget_info2(getId(), name, &linkinfo, H5P_DEFAULT);
|
||||
if (ret_value < 0)
|
||||
throwException("getLinkval", "H5Lget_info to find buffer size failed");
|
||||
|
||||
@@ -1941,11 +2056,11 @@ ssize_t H5Location::getObjnameByIdx(hsize_t idx, H5std_string& name, size_t size
|
||||
//--------------------------------------------------------------------------
|
||||
H5O_type_t H5Location::childObjType(const char* objname) const
|
||||
{
|
||||
H5O_info_t objinfo;
|
||||
H5O_info2_t objinfo;
|
||||
H5O_type_t objtype = H5O_TYPE_UNKNOWN;
|
||||
|
||||
// Use C API to get information of the object
|
||||
herr_t ret_value = H5Oget_info_by_name2(getId(), objname, &objinfo, H5O_INFO_BASIC, H5P_DEFAULT);
|
||||
herr_t ret_value = H5Oget_info_by_name3(getId(), objname, &objinfo, H5O_INFO_BASIC, H5P_DEFAULT);
|
||||
|
||||
// Throw exception if C API returns failure
|
||||
if (ret_value < 0)
|
||||
@@ -2016,11 +2131,11 @@ H5O_type_t H5Location::childObjType(const H5std_string& objname) const
|
||||
H5O_type_t H5Location::childObjType(hsize_t index, H5_index_t index_type, H5_iter_order_t order, const char* objname) const
|
||||
{
|
||||
herr_t ret_value;
|
||||
H5O_info_t objinfo;
|
||||
H5O_info2_t objinfo;
|
||||
H5O_type_t objtype = H5O_TYPE_UNKNOWN;
|
||||
|
||||
// Use C API to get information of the object
|
||||
ret_value = H5Oget_info_by_idx2(getId(), objname, index_type, order, index, &objinfo, H5O_INFO_BASIC, H5P_DEFAULT);
|
||||
ret_value = H5Oget_info_by_idx3(getId(), objname, index_type, order, index, &objinfo, H5O_INFO_BASIC, H5P_DEFAULT);
|
||||
|
||||
// Throw exception if C API returns failure
|
||||
if (ret_value < 0)
|
||||
@@ -2058,11 +2173,11 @@ H5O_type_t H5Location::childObjType(hsize_t index, H5_index_t index_type, H5_ite
|
||||
//--------------------------------------------------------------------------
|
||||
unsigned H5Location::childObjVersion(const char* objname) const
|
||||
{
|
||||
H5O_info_t objinfo;
|
||||
H5O_native_info_t objinfo;
|
||||
unsigned version = 0;
|
||||
|
||||
// Use C API to get information of the object
|
||||
herr_t ret_value = H5Oget_info_by_name2(getId(), objname, &objinfo, H5O_INFO_HDR, H5P_DEFAULT);
|
||||
herr_t ret_value = H5Oget_native_info_by_name(getId(), objname, &objinfo, H5O_NATIVE_INFO_HDR, H5P_DEFAULT);
|
||||
|
||||
// Throw exception if C API returns failure
|
||||
if (ret_value < 0)
|
||||
|
||||
+28
-7
@@ -118,8 +118,8 @@ class H5_DLLCPP H5Location : public IdComponent {
|
||||
DataSet openDataSet(const char* name, const DSetAccPropList& dapl = DSetAccPropList::DEFAULT) const;
|
||||
DataSet openDataSet(const H5std_string& name, const DSetAccPropList& dapl = DSetAccPropList::DEFAULT) const;
|
||||
|
||||
H5L_info_t getLinkInfo(const char* link_name, const LinkAccPropList& lapl = LinkAccPropList::DEFAULT) const;
|
||||
H5L_info_t getLinkInfo(const H5std_string& link_name, const LinkAccPropList& lapl = LinkAccPropList::DEFAULT) const;
|
||||
H5L_info2_t getLinkInfo(const char* link_name, const LinkAccPropList& lapl = LinkAccPropList::DEFAULT) const;
|
||||
H5L_info2_t getLinkInfo(const H5std_string& link_name, const LinkAccPropList& lapl = LinkAccPropList::DEFAULT) const;
|
||||
|
||||
// Returns the value of a symbolic link.
|
||||
H5std_string getLinkval(const char* link_name, size_t size=0) const;
|
||||
@@ -147,26 +147,47 @@ class H5_DLLCPP H5Location : public IdComponent {
|
||||
unsigned childObjVersion(const H5std_string& objname) const;
|
||||
|
||||
// Retrieves information about an HDF5 object.
|
||||
void getObjinfo(H5O_info_t& objinfo, unsigned fields = H5O_INFO_BASIC) const;
|
||||
void getObjinfo(H5O_info2_t& objinfo, unsigned fields = H5O_INFO_BASIC) const;
|
||||
|
||||
// Retrieves information about an HDF5 object, given its name.
|
||||
void getObjinfo(const char* name, H5O_info_t& objinfo,
|
||||
void getObjinfo(const char* name, H5O_info2_t& objinfo,
|
||||
unsigned fields = H5O_INFO_BASIC,
|
||||
const LinkAccPropList& lapl = LinkAccPropList::DEFAULT) const;
|
||||
void getObjinfo(const H5std_string& name, H5O_info_t& objinfo,
|
||||
void getObjinfo(const H5std_string& name, H5O_info2_t& objinfo,
|
||||
unsigned fields = H5O_INFO_BASIC,
|
||||
const LinkAccPropList& lapl = LinkAccPropList::DEFAULT) const;
|
||||
|
||||
// Retrieves information about an HDF5 object, given its index.
|
||||
void getObjinfo(const char* grp_name, H5_index_t idx_type,
|
||||
H5_iter_order_t order, hsize_t idx, H5O_info_t& objinfo,
|
||||
H5_iter_order_t order, hsize_t idx, H5O_info2_t& objinfo,
|
||||
unsigned fields = H5O_INFO_BASIC,
|
||||
const LinkAccPropList& lapl = LinkAccPropList::DEFAULT) const;
|
||||
void getObjinfo(const H5std_string& grp_name, H5_index_t idx_type,
|
||||
H5_iter_order_t order, hsize_t idx, H5O_info_t& objinfo,
|
||||
H5_iter_order_t order, hsize_t idx, H5O_info2_t& objinfo,
|
||||
unsigned fields = H5O_INFO_BASIC,
|
||||
const LinkAccPropList& lapl = LinkAccPropList::DEFAULT) const;
|
||||
|
||||
// Retrieves native native information about an HDF5 object.
|
||||
void getNativeObjinfo(H5O_native_info_t& objinfo, unsigned fields = H5O_NATIVE_INFO_HDR) const;
|
||||
|
||||
// Retrieves native information about an HDF5 object, given its name.
|
||||
void getNativeObjinfo(const char* name, H5O_native_info_t& objinfo,
|
||||
unsigned fields = H5O_NATIVE_INFO_HDR,
|
||||
const LinkAccPropList& lapl = LinkAccPropList::DEFAULT) const;
|
||||
void getNativeObjinfo(const H5std_string& name, H5O_native_info_t& objinfo,
|
||||
unsigned fields = H5O_NATIVE_INFO_HDR,
|
||||
const LinkAccPropList& lapl = LinkAccPropList::DEFAULT) const;
|
||||
|
||||
// Retrieves native information about an HDF5 object, given its index.
|
||||
void getNativeObjinfo(const char* grp_name, H5_index_t idx_type,
|
||||
H5_iter_order_t order, hsize_t idx, H5O_native_info_t& objinfo,
|
||||
unsigned fields = H5O_NATIVE_INFO_HDR,
|
||||
const LinkAccPropList& lapl = LinkAccPropList::DEFAULT) const;
|
||||
void getNativeObjinfo(const H5std_string& grp_name, H5_index_t idx_type,
|
||||
H5_iter_order_t order, hsize_t idx, H5O_native_info_t& objinfo,
|
||||
unsigned fields = H5O_NATIVE_INFO_HDR,
|
||||
const LinkAccPropList& lapl = LinkAccPropList::DEFAULT) const;
|
||||
|
||||
#ifndef H5_NO_DEPRECATED_SYMBOLS
|
||||
// Returns the type of an object in this group, given the
|
||||
// object's index.
|
||||
|
||||
+13
-15
@@ -52,9 +52,9 @@ extern "C" herr_t userAttrOpWrpr(hid_t loc_id, const char *attr_name,
|
||||
}
|
||||
|
||||
// userVisitOpWrpr interfaces between the user's function and the
|
||||
// C library function H5Ovisit2
|
||||
// C library function H5Ovisit3
|
||||
extern "C" herr_t userVisitOpWrpr(hid_t obj_id, const char *attr_name,
|
||||
const H5O_info_t *obj_info, void *op_data)
|
||||
const H5O_info2_t *obj_info, void *op_data)
|
||||
{
|
||||
H5std_string s_attr_name = H5std_string(attr_name);
|
||||
UserData4Visit* myData = reinterpret_cast<UserData4Visit *> (op_data);
|
||||
@@ -250,13 +250,11 @@ int H5Object::iterateAttrs(attr_operator_t user_op, unsigned *_idx, void *op_dat
|
||||
///\param *op_data - IN: User-defined pointer to data required by the
|
||||
/// application for its processing of the object
|
||||
///\param fields - IN: Flags specifying the fields to be retrieved
|
||||
/// to the callback op via the H5O_info_t argument.
|
||||
/// to the callback op via the H5O_info2_t argument.
|
||||
/// \li \c H5O_INFO_BASIC fileno, addr, type, and rc fields
|
||||
/// \li \c H5O_INFO_TIME atime, mtime, ctime, and btime fields
|
||||
/// \li \c H5O_INFO_NUM_ATTRS num_attrs field
|
||||
/// \li \c H5O_INFO_HDR hdr field
|
||||
/// \li \c H5O_INFO_META_SIZE meta_size field
|
||||
/// \li \c H5O_INFO_ALL H5O_INFO_BASIC | H5O_INFO_TIME | H5O_INFO_NUM_ATTRS | H5O_INFO_HDR | H5O_INFO_META_SIZE
|
||||
/// \li \c H5O_INFO_ALL H5O_INFO_BASIC | H5O_INFO_TIME | H5O_INFO_NUM_ATTRS
|
||||
///\return
|
||||
/// \li On success:
|
||||
/// \li the return value of the first operator that returns a positive value
|
||||
@@ -266,7 +264,7 @@ int H5Object::iterateAttrs(attr_operator_t user_op, unsigned *_idx, void *op_dat
|
||||
/// wrong within the library or the operator failed
|
||||
///\exception H5::Exception
|
||||
///\par Description
|
||||
/// For information, please refer to the H5Ovisit2 API in the HDF5
|
||||
/// For information, please refer to the H5Ovisit3 API in the HDF5
|
||||
/// C Reference Manual.
|
||||
// Programmer Binh-Minh Ribler - Feb, 2019
|
||||
//--------------------------------------------------------------------------
|
||||
@@ -279,15 +277,15 @@ void H5Object::visit(H5_index_t idx_type, H5_iter_order_t order, visit_operator_
|
||||
userData->obj = this;
|
||||
|
||||
// Call the C API passing in op wrapper and info
|
||||
herr_t ret_value = H5Ovisit2(getId(), idx_type, order, userVisitOpWrpr, static_cast<void *>(userData), fields);
|
||||
herr_t ret_value = H5Ovisit3(getId(), idx_type, order, userVisitOpWrpr, static_cast<void *>(userData), fields);
|
||||
|
||||
// Release memory
|
||||
delete userData;
|
||||
|
||||
// Throw exception if H5Ovisit2 failed, which could be a failure in
|
||||
// Throw exception if H5Ovisit3 failed, which could be a failure in
|
||||
// the library or in the call back operator
|
||||
if (ret_value < 0)
|
||||
throw Exception(inMemFunc("visit"), "H5Ovisit2 failed");
|
||||
throw Exception(inMemFunc("visit"), "H5Ovisit3 failed");
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
@@ -304,15 +302,15 @@ void H5Object::visit(H5_index_t idx_type, H5_iter_order_t order, visit_operator_
|
||||
//--------------------------------------------------------------------------
|
||||
unsigned H5Object::objVersion() const
|
||||
{
|
||||
H5O_info_t objinfo;
|
||||
H5O_native_info_t objinfo;
|
||||
unsigned version = 0;
|
||||
|
||||
// Use C API to get information of the object
|
||||
herr_t ret_value = H5Oget_info2(getId(), &objinfo, H5O_INFO_HDR);
|
||||
herr_t ret_value = H5Oget_native_info(getId(), &objinfo, H5O_NATIVE_INFO_HDR);
|
||||
|
||||
// Throw exception if C API returns failure
|
||||
if (ret_value < 0)
|
||||
throw Exception(inMemFunc("objVersion"), "H5Oget_info failed");
|
||||
throw Exception(inMemFunc("objVersion"), "H5Oget_native_info failed");
|
||||
// Return a valid version or throw an exception for invalid value
|
||||
else
|
||||
{
|
||||
@@ -332,9 +330,9 @@ unsigned H5Object::objVersion() const
|
||||
//--------------------------------------------------------------------------
|
||||
int H5Object::getNumAttrs() const
|
||||
{
|
||||
H5O_info_t oinfo; /* Object info */
|
||||
H5O_info2_t oinfo; /* Object info */
|
||||
|
||||
if(H5Oget_info2(getId(), &oinfo, H5O_INFO_NUM_ATTRS) < 0)
|
||||
if(H5Oget_info3(getId(), &oinfo, H5O_INFO_NUM_ATTRS) < 0)
|
||||
throw AttributeIException(inMemFunc("getNumAttrs"), "H5Oget_info failed");
|
||||
else
|
||||
return(static_cast<int>(oinfo.num_attrs));
|
||||
|
||||
+2
-2
@@ -44,10 +44,10 @@ typedef void (*attr_operator_t)(H5Object& loc,
|
||||
const H5std_string attr_name,
|
||||
void *operator_data);
|
||||
|
||||
// Define the operator function pointer for H5Ovisit2().
|
||||
// Define the operator function pointer for H5Ovisit3().
|
||||
typedef int (*visit_operator_t)(H5Object& obj,
|
||||
const H5std_string attr_name,
|
||||
const H5O_info_t *oinfo,
|
||||
const H5O_info2_t *oinfo,
|
||||
void *operator_data);
|
||||
|
||||
// User data for attribute iteration
|
||||
|
||||
@@ -56,4 +56,6 @@ else ()
|
||||
endif ()
|
||||
set_target_properties (cpp_testhdf5 PROPERTIES FOLDER test/cpp)
|
||||
|
||||
include (CMakeTests.cmake)
|
||||
if (HDF5_TEST_CPP AND HDF5_TEST_SERIAL)
|
||||
include (CMakeTests.cmake)
|
||||
endif ()
|
||||
|
||||
+13
-13
@@ -1116,9 +1116,9 @@ static herr_t test_types(H5File& file)
|
||||
|
||||
|
||||
/*-------------------------------------------------------------------------
|
||||
* Function: test_getObjinfo
|
||||
* Function: test_getNativeObjinfo
|
||||
*
|
||||
* Purpose Tests getObjinfo()
|
||||
* Purpose Tests getNativeObjinfo()
|
||||
*
|
||||
* Return Success: 0
|
||||
* Failure: -1
|
||||
@@ -1126,7 +1126,7 @@ static herr_t test_types(H5File& file)
|
||||
* July, 2018
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
static herr_t test_getinfo(H5File& file)
|
||||
static herr_t test_getnativeinfo(H5File& file)
|
||||
{
|
||||
SUBTEST("Getting object information");
|
||||
|
||||
@@ -1142,18 +1142,18 @@ static herr_t test_getinfo(H5File& file)
|
||||
DataSet dataset(file.openDataSet(DSET_CHUNKED_NAME));
|
||||
|
||||
// Get dataset header info
|
||||
H5O_info_t oinfo;
|
||||
HDmemset(&oinfo, 0, sizeof(oinfo));
|
||||
dataset.getObjinfo(oinfo, H5O_INFO_HDR);
|
||||
verify_val(oinfo.hdr.nchunks, 1, "DataSet::getObjinfo", __LINE__, __FILE__);
|
||||
H5O_native_info_t ninfo;
|
||||
HDmemset(&ninfo, 0, sizeof(ninfo));
|
||||
dataset.getNativeObjinfo(ninfo, H5O_NATIVE_INFO_HDR);
|
||||
verify_val(ninfo.hdr.nchunks, 1, "DataSet::getNativeObjinfo", __LINE__, __FILE__);
|
||||
dataset.close();
|
||||
|
||||
// Open the dataset we created above and then close it. This is one
|
||||
// way to open an existing dataset for accessing.
|
||||
dataset = file.openDataSet(DSET_DEFAULT_NAME);
|
||||
HDmemset(&oinfo, 0, sizeof(oinfo));
|
||||
dataset.getObjinfo(oinfo, H5O_INFO_ALL);
|
||||
verify_val(oinfo.hdr.nchunks, 1, "DataSet::getObjinfo", __LINE__, __FILE__);
|
||||
HDmemset(&ninfo, 0, sizeof(ninfo));
|
||||
dataset.getNativeObjinfo(ninfo, H5O_NATIVE_INFO_ALL);
|
||||
verify_val(ninfo.hdr.nchunks, 1, "DataSet::getNativeObjinfo", __LINE__, __FILE__);
|
||||
dataset.close();
|
||||
|
||||
PASSED();
|
||||
@@ -1169,10 +1169,10 @@ static herr_t test_getinfo(H5File& file)
|
||||
// catch all other exceptions
|
||||
catch (Exception& E)
|
||||
{
|
||||
issue_fail_msg("test_getinfo", __LINE__, __FILE__);
|
||||
issue_fail_msg("test_getnativeinfo", __LINE__, __FILE__);
|
||||
return -1;
|
||||
}
|
||||
} // test_getinfo
|
||||
} // test_getnativeinfo
|
||||
|
||||
|
||||
/*-------------------------------------------------------------------------
|
||||
@@ -1408,7 +1408,7 @@ void test_dset()
|
||||
|
||||
nerrors += test_create(file) < 0 ? 1:0;
|
||||
nerrors += test_simple_io(file) < 0 ? 1:0;
|
||||
nerrors += test_getinfo(file) < 0 ? 1:0;
|
||||
nerrors += test_getnativeinfo(file) < 0 ? 1:0;
|
||||
nerrors += test_tconv(file) < 0 ? 1:0;
|
||||
nerrors += test_compression(file) < 0 ? 1:0;
|
||||
nerrors += test_nbit_compression(file) < 0 ? 1:0;
|
||||
|
||||
+2
-2
@@ -519,7 +519,7 @@ static void test_attr_basic_read()
|
||||
verify_val(num_attrs, 3, "DataSet::getNumAttrs", __LINE__, __FILE__);
|
||||
|
||||
// Verify the correct number of attributes another way
|
||||
H5O_info_t oinfo;
|
||||
H5O_info2_t oinfo;
|
||||
HDmemset(&oinfo, 0, sizeof(oinfo));
|
||||
dataset.getObjinfo(oinfo, H5O_INFO_NUM_ATTRS);
|
||||
verify_val(oinfo.num_attrs, 3, "DataSet::getObjinfo", __LINE__, __FILE__);
|
||||
@@ -670,7 +670,7 @@ static void test_attr_compound_read()
|
||||
verify_val(num_attrs, 1, "DataSet::getNumAttrs", __LINE__, __FILE__);
|
||||
|
||||
// Verify the correct number of attributes another way
|
||||
H5O_info_t oinfo;
|
||||
H5O_info2_t oinfo;
|
||||
HDmemset(&oinfo, 0, sizeof(oinfo));
|
||||
dataset.getObjinfo(oinfo, H5O_INFO_NUM_ATTRS);
|
||||
verify_val(oinfo.num_attrs, 1, "DataSet::getObjinfo", __LINE__, __FILE__);
|
||||
|
||||
+7
-7
@@ -716,10 +716,10 @@ static void test_libver_bounds_real(
|
||||
verify_val(obj_version, oh_vers_create, "H5File::childObjVersion", __LINE__, __FILE__);
|
||||
|
||||
// Verify object header version another way
|
||||
H5O_info_t oinfo;
|
||||
HDmemset(&oinfo, 0, sizeof(oinfo));
|
||||
file.getObjinfo(oinfo, H5O_INFO_HDR);
|
||||
verify_val(oinfo.hdr.version, oh_vers_create, "H5File::getObjinfo", __LINE__, __FILE__);
|
||||
H5O_native_info_t ninfo;
|
||||
HDmemset(&ninfo, 0, sizeof(ninfo));
|
||||
file.getNativeObjinfo(ninfo, H5O_NATIVE_INFO_HDR);
|
||||
verify_val(ninfo.hdr.version, oh_vers_create, "H5File::getNativeObjinfo", __LINE__, __FILE__);
|
||||
|
||||
/*
|
||||
* Reopen the file and make sure the root group still has the correct
|
||||
@@ -744,9 +744,9 @@ static void test_libver_bounds_real(
|
||||
verify_val(obj_version, oh_vers_mod, "Group::objVersion", __LINE__, __FILE__);
|
||||
|
||||
// Verify object header version another way
|
||||
HDmemset(&oinfo, 0, sizeof(oinfo));
|
||||
group.getObjinfo(oinfo, H5O_INFO_HDR);
|
||||
verify_val(oinfo.hdr.version, oh_vers_mod, "Group::getObjinfo", __LINE__, __FILE__);
|
||||
HDmemset(&ninfo, 0, sizeof(ninfo));
|
||||
group.getNativeObjinfo(ninfo, H5O_NATIVE_INFO_HDR);
|
||||
verify_val(ninfo.hdr.version, oh_vers_mod, "Group::getNativeObjinfo", __LINE__, __FILE__);
|
||||
|
||||
group.close(); // close "/G1"
|
||||
|
||||
|
||||
@@ -96,7 +96,7 @@ int iter_strcmp(const void *s1, const void *s2)
|
||||
* Purpose Custom link iteration callback routine
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
static herr_t liter_cb(hid_t H5_ATTR_UNUSED group, const char *name, const H5L_info_t H5_ATTR_UNUSED *link_info, void *op_data)
|
||||
static herr_t liter_cb(hid_t H5_ATTR_UNUSED group, const char *name, const H5L_info2_t H5_ATTR_UNUSED *link_info, void *op_data)
|
||||
{
|
||||
iter_info *info = (iter_info *)op_data;
|
||||
static int count = 0;
|
||||
@@ -158,7 +158,7 @@ static void test_iter_group(FileAccPropList& fapl)
|
||||
/* Test iterating over empty group */
|
||||
info.command = RET_ZERO;
|
||||
idx = 0;
|
||||
ret = H5Literate(file.getId(), H5_INDEX_NAME, H5_ITER_INC, &idx, liter_cb, &info);
|
||||
ret = H5Literate2(file.getId(), H5_INDEX_NAME, H5_ITER_INC, &idx, liter_cb, &info);
|
||||
verify_val(ret, SUCCEED, "H5Literate", __LINE__, __FILE__);
|
||||
|
||||
DataType datatype(PredType::NATIVE_INT);
|
||||
@@ -207,7 +207,7 @@ static void test_iter_group(FileAccPropList& fapl)
|
||||
H5std_string obj_name;
|
||||
for (i = 0; i < nobjs; i++)
|
||||
{
|
||||
//H5O_info_t oinfo; /* Object info */
|
||||
//H5O_info2_t oinfo; /* Object info */
|
||||
|
||||
obj_name = root_group.getObjnameByIdx(i);
|
||||
//ret = (herr_t)H5Lget_name_by_idx(root_group, ".", H5_INDEX_NAME, H5_ITER_INC, (hsize_t)i, dataset_name, (size_t)NAMELEN, H5P_DEFAULT);
|
||||
@@ -287,7 +287,7 @@ static void test_iter_group(FileAccPropList& fapl)
|
||||
/* Test all objects in group, when callback always returns 0 */
|
||||
info.command = RET_ZERO;
|
||||
idx = 0;
|
||||
if((ret = H5Literate(file, H5_INDEX_NAME, H5_ITER_INC, &idx, liter_cb, &info)) > 0)
|
||||
if((ret = H5Literate2(file, H5_INDEX_NAME, H5_ITER_INC, &idx, liter_cb, &info)) > 0)
|
||||
TestErrPrintf("Group iteration function didn't return zero correctly!\n");
|
||||
|
||||
/* Test all objects in group, when callback always returns 1 */
|
||||
@@ -295,7 +295,7 @@ static void test_iter_group(FileAccPropList& fapl)
|
||||
info.command = RET_TWO;
|
||||
i = 0;
|
||||
idx = 0;
|
||||
while((ret = H5Literate(file, H5_INDEX_NAME, H5_ITER_INC, &idx, liter_cb, &info)) > 0) {
|
||||
while((ret = H5Literate2(file, H5_INDEX_NAME, H5_ITER_INC, &idx, liter_cb, &info)) > 0) {
|
||||
/* Verify return value from iterator gets propagated correctly */
|
||||
verify_val(ret, 2, "H5Literate", __LINE__, __FILE__);
|
||||
|
||||
@@ -321,7 +321,7 @@ static void test_iter_group(FileAccPropList& fapl)
|
||||
info.command = new_format ? RET_CHANGE2 : RET_CHANGE;
|
||||
i = 0;
|
||||
idx = 0;
|
||||
while((ret = H5Literate(file, H5_INDEX_NAME, H5_ITER_INC, &idx, liter_cb, &info)) >= 0) {
|
||||
while((ret = H5Literate2(file, H5_INDEX_NAME, H5_ITER_INC, &idx, liter_cb, &info)) >= 0) {
|
||||
/* Verify return value from iterator gets propagated correctly */
|
||||
verify_val(ret, 1, "H5Literate", __LINE__, __FILE__);
|
||||
|
||||
|
||||
+2
-2
@@ -190,7 +190,7 @@ const H5std_string GROUP2NAME("Second_group");
|
||||
static void
|
||||
test_lcpl(hid_t fapl_id, hbool_t new_format)
|
||||
{
|
||||
H5L_info_t linfo;
|
||||
H5L_info2_t linfo;
|
||||
char filename[1024];
|
||||
hsize_t dims[2];
|
||||
|
||||
@@ -604,7 +604,7 @@ const int RANK = 2;
|
||||
const int DIM1 = 2;
|
||||
|
||||
// Operator function
|
||||
static int visit_obj_cb(H5Object& obj, const H5std_string name, const H5O_info_t *oinfo, void *_op_data)
|
||||
static int visit_obj_cb(H5Object& obj, const H5std_string name, const H5O_info2_t *oinfo, void *_op_data)
|
||||
{
|
||||
ovisit_ud_t *op_data = static_cast <ovisit_ud_t *>(_op_data);
|
||||
|
||||
|
||||
@@ -542,7 +542,7 @@ const H5std_string GROUP1NAME("group1");
|
||||
const H5std_string GROUP2NAME("group2");
|
||||
static void test_getobjectinfo_same_file()
|
||||
{
|
||||
H5O_info_t oinfo1, oinfo2; /* Object info structs */
|
||||
H5O_info2_t oinfo1, oinfo2; /* Object info structs */
|
||||
|
||||
// Output message about test being performed
|
||||
SUBTEST("Group::getObjinfo");
|
||||
|
||||
+1
-1
@@ -482,7 +482,7 @@ static void test_reference_group()
|
||||
verify_val(fname, FILE1, "H5Group::getFileName",__LINE__,__FILE__);
|
||||
|
||||
// Check object type using Group::getObjinfo()
|
||||
H5O_info_t oinfo;
|
||||
H5O_info2_t oinfo;
|
||||
HDmemset(&oinfo, 0, sizeof(oinfo));
|
||||
group.getObjinfo(".", H5_INDEX_NAME, H5_ITER_INC, (hsize_t)0, oinfo);
|
||||
verify_val(oinfo.type, H5O_TYPE_DATASET, "Group::getObjinfo",__LINE__,__FILE__);
|
||||
|
||||
@@ -200,7 +200,7 @@ if (NOT MSVC AND CMAKE_COMPILER_IS_GNUCC)
|
||||
|
||||
# Append more extra warning flags that only gcc 7.x+ know about
|
||||
if (CMAKE_C_COMPILER_ID STREQUAL "GNU" AND NOT CMAKE_C_COMPILER_VERSION VERSION_LESS 7.0)
|
||||
set (H5_CFLAGS4 "${H5_CFLAGS4} -Walloc-zero -Walloca -Wduplicated-branches -Wformat-overflow=2 -Wformat-truncation=2 -Wimplicit-fallthrough=5 -Wrestrict")
|
||||
set (H5_CFLAGS4 "${H5_CFLAGS4} -Walloc-zero -Walloca -Wduplicated-branches -Wformat-overflow=2 -Wformat-truncation=1 -Wimplicit-fallthrough=5 -Wrestrict")
|
||||
endif ()
|
||||
|
||||
# Append more extra warning flags that only gcc 8.x+ know about
|
||||
|
||||
+136
-107
@@ -75,16 +75,19 @@ message (STATUS "COMMAND Result: ${TEST_RESULT}")
|
||||
# if the .err file exists and ERRROR_APPEND is enabled
|
||||
if (EXISTS "${TEST_FOLDER}/${TEST_OUTPUT}.err")
|
||||
file (READ ${TEST_FOLDER}/${TEST_OUTPUT}.err TEST_STREAM)
|
||||
if (TEST_MASK_FILE)
|
||||
STRING(REGEX REPLACE "CurrentDir is [^\n]+\n" "CurrentDir is (dir name)\n" TEST_STREAM "${TEST_STREAM}")
|
||||
endif ()
|
||||
list(LENGTH TEST_STREAM test_len)
|
||||
if (test_len GREATER 0)
|
||||
if (TEST_MASK_FILE)
|
||||
STRING(REGEX REPLACE "CurrentDir is [^\n]+\n" "CurrentDir is (dir name)\n" TEST_STREAM "${TEST_STREAM}")
|
||||
endif ()
|
||||
|
||||
if (NOT ERROR_APPEND)
|
||||
# write back to original .err file
|
||||
file (WRITE ${TEST_FOLDER}/${TEST_OUTPUT}.err "${TEST_STREAM}")
|
||||
else ()
|
||||
# append error output to the stdout output file
|
||||
file (APPEND ${TEST_FOLDER}/${TEST_OUTPUT} "${TEST_STREAM}")
|
||||
if (NOT ERROR_APPEND)
|
||||
# write back to original .err file
|
||||
file (WRITE ${TEST_FOLDER}/${TEST_OUTPUT}.err "${TEST_STREAM}")
|
||||
else ()
|
||||
# append error output to the stdout output file
|
||||
file (APPEND ${TEST_FOLDER}/${TEST_OUTPUT} "${TEST_STREAM}")
|
||||
endif ()
|
||||
endif ()
|
||||
endif ()
|
||||
|
||||
@@ -122,146 +125,172 @@ endif ()
|
||||
message (STATUS "COMMAND Error: ${TEST_ERROR}")
|
||||
|
||||
# compare output files to references unless this must be skipped
|
||||
set (TEST_COMPARE_RESULT 0)
|
||||
if (NOT TEST_SKIP_COMPARE)
|
||||
if (EXISTS "${TEST_FOLDER}/${TEST_REFERENCE}")
|
||||
if (WIN32 OR MINGW)
|
||||
configure_file(${TEST_FOLDER}/${TEST_REFERENCE} ${TEST_FOLDER}/${TEST_REFERENCE}.tmp NEWLINE_STYLE CRLF)
|
||||
file(RENAME ${TEST_FOLDER}/${TEST_REFERENCE}.tmp ${TEST_FOLDER}/${TEST_REFERENCE})
|
||||
#file (READ ${TEST_FOLDER}/${TEST_REFERENCE} TEST_STREAM)
|
||||
#file (WRITE ${TEST_FOLDER}/${TEST_REFERENCE} "${TEST_STREAM}")
|
||||
endif ()
|
||||
|
||||
if (NOT TEST_SORT_COMPARE)
|
||||
# now compare the output with the reference
|
||||
execute_process (
|
||||
COMMAND ${CMAKE_COMMAND} -E compare_files ${TEST_FOLDER}/${TEST_OUTPUT} ${TEST_FOLDER}/${TEST_REFERENCE}
|
||||
RESULT_VARIABLE TEST_RESULT
|
||||
)
|
||||
else ()
|
||||
file (STRINGS ${TEST_FOLDER}/${TEST_OUTPUT} v1)
|
||||
file (STRINGS ${TEST_FOLDER}/${TEST_REFERENCE} v2)
|
||||
list (SORT v1)
|
||||
list (SORT v2)
|
||||
if (NOT v1 STREQUAL v2)
|
||||
set(TEST_RESULT 1)
|
||||
file (READ ${TEST_FOLDER}/${TEST_REFERENCE} TEST_STREAM)
|
||||
list(LENGTH TEST_STREAM test_len)
|
||||
if (test_len GREATER 0)
|
||||
if (WIN32 OR MINGW)
|
||||
configure_file(${TEST_FOLDER}/${TEST_REFERENCE} ${TEST_FOLDER}/${TEST_REFERENCE}.tmp NEWLINE_STYLE CRLF)
|
||||
if (EXISTS "${TEST_FOLDER}/${TEST_REFERENCE}.tmp")
|
||||
file(RENAME ${TEST_FOLDER}/${TEST_REFERENCE}.tmp ${TEST_FOLDER}/${TEST_REFERENCE})
|
||||
endif ()
|
||||
#file (READ ${TEST_FOLDER}/${TEST_REFERENCE} TEST_STREAM)
|
||||
#file (WRITE ${TEST_FOLDER}/${TEST_REFERENCE} "${TEST_STREAM}")
|
||||
endif ()
|
||||
endif ()
|
||||
|
||||
if (TEST_RESULT)
|
||||
set (TEST_RESULT 0)
|
||||
file (STRINGS ${TEST_FOLDER}/${TEST_OUTPUT} test_act)
|
||||
list (LENGTH test_act len_act)
|
||||
file (STRINGS ${TEST_FOLDER}/${TEST_REFERENCE} test_ref)
|
||||
list (LENGTH test_ref len_ref)
|
||||
if (len_act GREATER 0 AND len_ref GREATER 0)
|
||||
math (EXPR _FP_LEN "${len_ref} - 1")
|
||||
foreach (line RANGE 0 ${_FP_LEN})
|
||||
list (GET test_act ${line} str_act)
|
||||
list (GET test_ref ${line} str_ref)
|
||||
if (NOT str_act STREQUAL str_ref)
|
||||
if (str_act)
|
||||
set (TEST_RESULT 1)
|
||||
message (STATUS "line = ${line}\n***ACTUAL: ${str_act}\n****REFER: ${str_ref}\n")
|
||||
endif ()
|
||||
endif ()
|
||||
endforeach ()
|
||||
if (NOT TEST_SORT_COMPARE)
|
||||
# now compare the output with the reference
|
||||
execute_process (
|
||||
COMMAND ${CMAKE_COMMAND} -E compare_files ${TEST_FOLDER}/${TEST_OUTPUT} ${TEST_FOLDER}/${TEST_REFERENCE}
|
||||
RESULT_VARIABLE TEST_COMPARE_RESULT
|
||||
)
|
||||
else ()
|
||||
if (len_act EQUAL 0)
|
||||
message (STATUS "COMPARE Failed: ${TEST_FOLDER}/${TEST_OUTPUT} is empty")
|
||||
endif ()
|
||||
if (len_ref EQUAL 0)
|
||||
message (STATUS "COMPARE Failed: ${TEST_FOLDER}/${TEST_REFERENCE} is empty")
|
||||
file (STRINGS ${TEST_FOLDER}/${TEST_OUTPUT} v1)
|
||||
file (STRINGS ${TEST_FOLDER}/${TEST_REFERENCE} v2)
|
||||
list (SORT v1)
|
||||
list (SORT v2)
|
||||
if (NOT v1 STREQUAL v2)
|
||||
set(TEST_COMPARE_RESULT 1)
|
||||
endif ()
|
||||
endif ()
|
||||
if (NOT len_act EQUAL len_ref)
|
||||
set (TEST_RESULT 1)
|
||||
|
||||
if (TEST_COMPARE_RESULT)
|
||||
set (TEST_COMPARE_RESULT 0)
|
||||
file (STRINGS ${TEST_FOLDER}/${TEST_OUTPUT} test_act)
|
||||
list (LENGTH test_act len_act)
|
||||
file (STRINGS ${TEST_FOLDER}/${TEST_REFERENCE} test_ref)
|
||||
list (LENGTH test_ref len_ref)
|
||||
if (len_act GREATER 0 AND len_ref GREATER 0)
|
||||
math (EXPR _FP_LEN "${len_ref} - 1")
|
||||
foreach (line RANGE 0 ${_FP_LEN})
|
||||
list (GET test_act ${line} str_act)
|
||||
list (GET test_ref ${line} str_ref)
|
||||
if (NOT str_act STREQUAL str_ref)
|
||||
if (str_act)
|
||||
set (TEST_COMPARE_RESULT 1)
|
||||
message (STATUS "line = ${line}\n***ACTUAL: ${str_act}\n****REFER: ${str_ref}\n")
|
||||
endif ()
|
||||
endif ()
|
||||
endforeach ()
|
||||
else ()
|
||||
if (len_act EQUAL 0)
|
||||
message (STATUS "COMPARE Failed: ${TEST_FOLDER}/${TEST_OUTPUT} is empty")
|
||||
endif ()
|
||||
if (len_ref EQUAL 0)
|
||||
message (STATUS "COMPARE Failed: ${TEST_FOLDER}/${TEST_REFERENCE} is empty")
|
||||
endif ()
|
||||
endif ()
|
||||
if (NOT len_act EQUAL len_ref)
|
||||
set (TEST_COMPARE_RESULT 1)
|
||||
endif ()
|
||||
endif ()
|
||||
endif ()
|
||||
|
||||
message (STATUS "COMPARE Result: ${TEST_RESULT}")
|
||||
message (STATUS "COMPARE Result: ${TEST_COMPARE_RESULT}")
|
||||
|
||||
# again, if return value is !=0 scream and shout
|
||||
if (TEST_RESULT)
|
||||
if (TEST_COMPARE_RESULT)
|
||||
message (FATAL_ERROR "Failed: The output of ${TEST_OUTPUT} did not match ${TEST_REFERENCE}")
|
||||
endif ()
|
||||
endif ()
|
||||
|
||||
# now compare the .err file with the error reference, if supplied
|
||||
set (TEST_ERRREF_RESULT 0)
|
||||
if (TEST_ERRREF)
|
||||
if (WIN32 OR MINGW)
|
||||
configure_file(${TEST_FOLDER}/${TEST_ERRREF} ${TEST_FOLDER}/${TEST_ERRREF}.tmp NEWLINE_STYLE CRLF)
|
||||
file(RENAME ${TEST_FOLDER}/${TEST_ERRREF}.tmp ${TEST_FOLDER}/${TEST_ERRREF})
|
||||
#file (READ ${TEST_FOLDER}/${TEST_ERRREF} TEST_STREAM)
|
||||
#file (WRITE ${TEST_FOLDER}/${TEST_ERRREF} "${TEST_STREAM}")
|
||||
endif ()
|
||||
file (READ ${TEST_FOLDER}/${TEST_ERRREF} TEST_STREAM)
|
||||
list(LENGTH TEST_STREAM test_len)
|
||||
if (test_len GREATER 0)
|
||||
if (WIN32 OR MINGW)
|
||||
configure_file(${TEST_FOLDER}/${TEST_ERRREF} ${TEST_FOLDER}/${TEST_ERRREF}.tmp NEWLINE_STYLE CRLF)
|
||||
if (EXISTS "${TEST_FOLDER}/${TEST_ERRREF}.tmp")
|
||||
file(RENAME ${TEST_FOLDER}/${TEST_ERRREF}.tmp ${TEST_FOLDER}/${TEST_ERRREF})
|
||||
endif ()
|
||||
#file (READ ${TEST_FOLDER}/${TEST_ERRREF} TEST_STREAM)
|
||||
#file (WRITE ${TEST_FOLDER}/${TEST_ERRREF} "${TEST_STREAM}")
|
||||
endif ()
|
||||
|
||||
# now compare the error output with the error reference
|
||||
execute_process (
|
||||
COMMAND ${CMAKE_COMMAND} -E compare_files ${TEST_FOLDER}/${TEST_OUTPUT}.err ${TEST_FOLDER}/${TEST_ERRREF}
|
||||
RESULT_VARIABLE TEST_RESULT
|
||||
)
|
||||
if (TEST_RESULT)
|
||||
set (TEST_RESULT 0)
|
||||
file (STRINGS ${TEST_FOLDER}/${TEST_OUTPUT}.err test_act)
|
||||
list (LENGTH test_act len_act)
|
||||
file (STRINGS ${TEST_FOLDER}/${TEST_ERRREF} test_ref)
|
||||
list (LENGTH test_ref len_ref)
|
||||
math (EXPR _FP_LEN "${len_ref} - 1")
|
||||
if (len_act GREATER 0 AND len_ref GREATER 0)
|
||||
# now compare the error output with the error reference
|
||||
execute_process (
|
||||
COMMAND ${CMAKE_COMMAND} -E compare_files ${TEST_FOLDER}/${TEST_OUTPUT}.err ${TEST_FOLDER}/${TEST_ERRREF}
|
||||
RESULT_VARIABLE TEST_ERRREF_RESULT
|
||||
)
|
||||
if (TEST_ERRREF_RESULT)
|
||||
set (TEST_ERRREF_RESULT 0)
|
||||
file (STRINGS ${TEST_FOLDER}/${TEST_OUTPUT}.err test_act)
|
||||
list (LENGTH test_act len_act)
|
||||
file (STRINGS ${TEST_FOLDER}/${TEST_ERRREF} test_ref)
|
||||
list (LENGTH test_ref len_ref)
|
||||
math (EXPR _FP_LEN "${len_ref} - 1")
|
||||
foreach (line RANGE 0 ${_FP_LEN})
|
||||
list (GET test_act ${line} str_act)
|
||||
list (GET test_ref ${line} str_ref)
|
||||
if (NOT str_act STREQUAL str_ref)
|
||||
if (str_act)
|
||||
set (TEST_RESULT 1)
|
||||
message (STATUS "line = ${line}\n***ACTUAL: ${str_act}\n****REFER: ${str_ref}\n")
|
||||
if (len_act GREATER 0 AND len_ref GREATER 0)
|
||||
math (EXPR _FP_LEN "${len_ref} - 1")
|
||||
foreach (line RANGE 0 ${_FP_LEN})
|
||||
list (GET test_act ${line} str_act)
|
||||
list (GET test_ref ${line} str_ref)
|
||||
if (NOT str_act STREQUAL str_ref)
|
||||
if (str_act)
|
||||
set (TEST_ERRREF_RESULT 1)
|
||||
message (STATUS "line = ${line}\n***ACTUAL: ${str_act}\n****REFER: ${str_ref}\n")
|
||||
endif ()
|
||||
endif ()
|
||||
endforeach ()
|
||||
else ()
|
||||
if (len_act EQUAL 0)
|
||||
message (STATUS "COMPARE Failed: ${TEST_FOLDER}/${TEST_OUTPUT}.err is empty")
|
||||
endif ()
|
||||
if (len_ref EQUAL 0)
|
||||
message (STATUS "COMPARE Failed: ${TEST_FOLDER}/${TEST_ERRREF} is empty")
|
||||
endif ()
|
||||
endforeach ()
|
||||
else ()
|
||||
if (len_act EQUAL 0)
|
||||
message (STATUS "COMPARE Failed: ${TEST_FOLDER}/${TEST_OUTPUT}.err is empty")
|
||||
endif ()
|
||||
if (len_ref EQUAL 0)
|
||||
message (STATUS "COMPARE Failed: ${TEST_FOLDER}/${TEST_ERRREF} is empty")
|
||||
if (NOT len_act EQUAL len_ref)
|
||||
set (TEST_ERRREF_RESULT 1)
|
||||
endif ()
|
||||
endif ()
|
||||
if (NOT len_act EQUAL len_ref)
|
||||
set (TEST_RESULT 1)
|
||||
endif ()
|
||||
endif ()
|
||||
|
||||
message (STATUS "COMPARE Result: ${TEST_RESULT}")
|
||||
message (STATUS "COMPARE Result: ${TEST_ERRREF_RESULT}")
|
||||
|
||||
# again, if return value is !=0 scream and shout
|
||||
if (TEST_RESULT)
|
||||
if (TEST_ERRREF_RESULT)
|
||||
message (FATAL_ERROR "Failed: The error output of ${TEST_OUTPUT}.err did not match ${TEST_ERRREF}")
|
||||
endif ()
|
||||
endif ()
|
||||
endif ()
|
||||
|
||||
set (TEST_GREP_RESULT 0)
|
||||
if (TEST_GREP_COMPARE)
|
||||
# now grep the output with the reference
|
||||
file (READ ${TEST_FOLDER}/${TEST_OUTPUT} TEST_STREAM)
|
||||
list(LENGTH TEST_STREAM test_len)
|
||||
if (test_len GREATER 0)
|
||||
# TEST_REFERENCE should always be matched
|
||||
string (REGEX MATCH "${TEST_REFERENCE}" TEST_MATCH ${TEST_STREAM})
|
||||
string (COMPARE EQUAL "${TEST_REFERENCE}" "${TEST_MATCH}" TEST_GREP_RESULT)
|
||||
if (NOT TEST_GREP_RESULT)
|
||||
message (FATAL_ERROR "Failed: The output of ${TEST_PROGRAM} did not contain ${TEST_REFERENCE}")
|
||||
endif ()
|
||||
|
||||
# TEST_REFERENCE should always be matched
|
||||
string (REGEX MATCH "${TEST_REFERENCE}" TEST_MATCH ${TEST_STREAM})
|
||||
string (COMPARE EQUAL "${TEST_REFERENCE}" "${TEST_MATCH}" TEST_RESULT)
|
||||
if (NOT TEST_RESULT)
|
||||
message (FATAL_ERROR "Failed: The output of ${TEST_PROGRAM} did not contain ${TEST_REFERENCE}")
|
||||
endif ()
|
||||
|
||||
string (REGEX MATCH "${TEST_FILTER}" TEST_MATCH ${TEST_STREAM})
|
||||
if (TEST_EXPECT)
|
||||
# TEST_EXPECT (1) interprets TEST_FILTER as; NOT to match
|
||||
string (LENGTH "${TEST_MATCH}" TEST_RESULT)
|
||||
if (TEST_RESULT)
|
||||
message (FATAL_ERROR "Failed: The output of ${TEST_PROGRAM} did contain ${TEST_FILTER}")
|
||||
string (REGEX MATCH "${TEST_FILTER}" TEST_MATCH ${TEST_STREAM})
|
||||
if (TEST_EXPECT)
|
||||
# TEST_EXPECT (1) interprets TEST_FILTER as; NOT to match
|
||||
string (LENGTH "${TEST_MATCH}" TEST_GREP_RESULT)
|
||||
if (TEST_GREP_RESULT)
|
||||
message (FATAL_ERROR "Failed: The output of ${TEST_PROGRAM} did contain ${TEST_FILTER}")
|
||||
endif ()
|
||||
endif ()
|
||||
endif ()
|
||||
endif ()
|
||||
|
||||
# dump the output unless nodisplay option is set
|
||||
if (TEST_SKIP_COMPARE AND NOT TEST_NO_DISPLAY)
|
||||
file (READ ${TEST_FOLDER}/${TEST_OUTPUT} TEST_STREAM)
|
||||
execute_process (
|
||||
COMMAND ${CMAKE_COMMAND} -E echo ${TEST_STREAM}
|
||||
RESULT_VARIABLE TEST_RESULT
|
||||
)
|
||||
endif ()
|
||||
|
||||
# everything went fine...
|
||||
message (STATUS "${TEST_PROGRAM} Passed")
|
||||
|
||||
|
||||
@@ -50,6 +50,17 @@ if (SITE_BUILDNAME_SUFFIX)
|
||||
endif ()
|
||||
set (BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DSITE:STRING=${CTEST_SITE} -DBUILDNAME:STRING=${CTEST_BUILD_NAME}")
|
||||
|
||||
# Launchers work only with Makefile and Ninja generators.
|
||||
if(NOT "${CTEST_CMAKE_GENERATOR}" MATCHES "Make|Ninja")
|
||||
set(CTEST_USE_LAUNCHERS 0)
|
||||
set(ENV{CTEST_USE_LAUNCHERS_DEFAULT} 0)
|
||||
set(BUILD_OPTIONS "${BUILD_OPTIONS} -DCTEST_USE_LAUNCHERS:BOOL=OFF")
|
||||
else()
|
||||
set(CTEST_USE_LAUNCHERS 1)
|
||||
set(ENV{CTEST_USE_LAUNCHERS_DEFAULT} 1)
|
||||
set(BUILD_OPTIONS "${BUILD_OPTIONS} -DCTEST_USE_LAUNCHERS:BOOL=ON")
|
||||
endif()
|
||||
|
||||
#-----------------------------------------------------------------------------
|
||||
# MAC machines need special option
|
||||
#-----------------------------------------------------------------------------
|
||||
@@ -219,9 +230,6 @@ else ()
|
||||
)
|
||||
endif ()
|
||||
|
||||
set(CTEST_USE_LAUNCHERS 1)
|
||||
set(ENV{CTEST_USE_LAUNCHERS_DEFAULT} 1)
|
||||
|
||||
#-----------------------------------------------------------------------------
|
||||
## -- set output to english
|
||||
set ($ENV{LC_MESSAGES} "en_EN")
|
||||
|
||||
@@ -64,7 +64,7 @@ if (NOT TEST_RESULT EQUAL TEST_EXPECT)
|
||||
if (NOT TEST_NOERRDISPLAY)
|
||||
if (EXISTS "${TEST_FOLDER}/${TEST_OUTPUT}_${TEST_VFD}.out")
|
||||
file (READ ${TEST_FOLDER}/${TEST_OUTPUT}_${TEST_VFD}.out TEST_STREAM)
|
||||
message (STATUS "Output USING ${TEST_VFD}:\n${TEST_STREAM}")
|
||||
message (STATUS "Output USING ${TEST_VFD}:\n${TEST_STREAM}")
|
||||
endif ()
|
||||
endif ()
|
||||
message (FATAL_ERROR "Failed: Test program ${TEST_PROGRAM} exited != ${TEST_EXPECT}.\n${TEST_ERROR}")
|
||||
|
||||
@@ -64,7 +64,7 @@ if (NOT TEST_RESULT EQUAL TEST_EXPECT)
|
||||
if (NOT TEST_NOERRDISPLAY)
|
||||
if (EXISTS "${TEST_FOLDER}/${TEST_OUTPUT}.out")
|
||||
file (READ ${TEST_FOLDER}/${TEST_OUTPUT}.out TEST_STREAM)
|
||||
message (STATUS "Output USING ${TEST_VOL}:\n${TEST_STREAM}")
|
||||
message (STATUS "Output USING ${TEST_VOL}:\n${TEST_STREAM}")
|
||||
endif ()
|
||||
endif ()
|
||||
message (FATAL_ERROR "Failed: Test program ${TEST_PROGRAM} exited != ${TEST_EXPECT}.\n${TEST_ERROR}")
|
||||
|
||||
@@ -1,16 +1,17 @@
|
||||
set (CTEST_CUSTOM_MAXIMUM_NUMBER_OF_WARNINGS 3000)
|
||||
|
||||
|
||||
set (CTEST_CUSTOM_WARNING_EXCEPTION
|
||||
${CTEST_CUSTOM_WARNING_EXCEPTION}
|
||||
"note.*expected.*void.*but argument is of type.*volatile"
|
||||
"SZIP.src.*:[ \t]*warning"
|
||||
"jpeg.src.*:[ \t]*warning"
|
||||
"POSIX name for this item is deprecated"
|
||||
"disabling jobserver mode"
|
||||
"warning.*implicit declaration of function"
|
||||
"note: expanded from macro"
|
||||
".*note.*expected.*void.*but argument is of type.*volatile.*"
|
||||
".*src.SZIP.*:[ \t]*warning.*"
|
||||
".*src.ZLIB.*:[ \t]*warning.*"
|
||||
".*jpeg.src.*:[ \t]*warning.*"
|
||||
".*POSIX name for this item is deprecated.*"
|
||||
".*disabling jobserver mode.*"
|
||||
".*warning.*implicit declaration of function.*"
|
||||
".*note: expanded from macro.*"
|
||||
)
|
||||
|
||||
|
||||
set (CTEST_CUSTOM_MEMCHECK_IGNORE
|
||||
${CTEST_CUSTOM_MEMCHECK_IGNORE}
|
||||
)
|
||||
|
||||
@@ -82,91 +82,102 @@ if (TEST_FIND_RESULT GREATER 0)
|
||||
endif ()
|
||||
|
||||
# if the TEST_ERRREF exists grep the error output with the error reference
|
||||
set (TEST_ERRREF_RESULT 0)
|
||||
if (TEST_ERRREF)
|
||||
# if the .err file exists grep the error output with the error reference before comparing stdout
|
||||
if (EXISTS "${TEST_FOLDER}/${TEST_OUTPUT}.err")
|
||||
file (READ ${TEST_FOLDER}/${TEST_OUTPUT}.err TEST_ERR_STREAM)
|
||||
|
||||
# TEST_ERRREF should always be matched
|
||||
string (REGEX MATCH "${TEST_ERRREF}" TEST_MATCH ${TEST_ERR_STREAM})
|
||||
string (COMPARE EQUAL "${TEST_ERRREF}" "${TEST_MATCH}" TEST_RESULT)
|
||||
if (NOT TEST_RESULT)
|
||||
message (FATAL_ERROR "Failed: The error output of ${TEST_PROGRAM} did not contain ${TEST_ERRREF}")
|
||||
list(LENGTH TEST_ERR_STREAM test_len)
|
||||
if (test_len GREATER 0)
|
||||
# TEST_ERRREF should always be matched
|
||||
string (REGEX MATCH "${TEST_ERRREF}" TEST_MATCH ${TEST_ERR_STREAM})
|
||||
string (COMPARE EQUAL "${TEST_ERRREF}" "${TEST_MATCH}" TEST_ERRREF_RESULT)
|
||||
if (NOT TEST_ERRREF_RESULT)
|
||||
message (FATAL_ERROR "Failed: The error output of ${TEST_PROGRAM} did not contain ${TEST_ERRREF}")
|
||||
endif ()
|
||||
endif ()
|
||||
endif ()
|
||||
|
||||
#always compare output file to reference unless this must be skipped
|
||||
set (TEST_COMPARE_RESULT 0)
|
||||
if (NOT TEST_SKIP_COMPARE)
|
||||
if (EXISTS "${TEST_FOLDER}/${TEST_REFERENCE}")
|
||||
if (WIN32 OR MINGW)
|
||||
configure_file(${TEST_FOLDER}/${TEST_REFERENCE} ${TEST_FOLDER}/${TEST_REFERENCE}.tmp NEWLINE_STYLE CRLF)
|
||||
file(RENAME ${TEST_FOLDER}/${TEST_REFERENCE}.tmp ${TEST_FOLDER}/${TEST_REFERENCE})
|
||||
#file (READ ${TEST_FOLDER}/${TEST_REFERENCE} TEST_STREAM)
|
||||
#file (WRITE ${TEST_FOLDER}/${TEST_REFERENCE} "${TEST_STREAM}")
|
||||
endif ()
|
||||
if (NOT TEST_SORT_COMPARE)
|
||||
# now compare the output with the reference
|
||||
execute_process (
|
||||
COMMAND ${CMAKE_COMMAND} -E compare_files ${TEST_FOLDER}/${TEST_OUTPUT} ${TEST_FOLDER}/${TEST_REFERENCE}
|
||||
RESULT_VARIABLE TEST_RESULT
|
||||
)
|
||||
else ()
|
||||
file (STRINGS ${TEST_FOLDER}/${TEST_OUTPUT} v1)
|
||||
file (STRINGS ${TEST_FOLDER}/${TEST_REFERENCE} v2)
|
||||
list (SORT v1)
|
||||
list (SORT v2)
|
||||
if (NOT v1 STREQUAL v2)
|
||||
set(TEST_RESULT 1)
|
||||
file (READ ${TEST_FOLDER}/${TEST_REFERENCE} TEST_STREAM)
|
||||
list(LENGTH TEST_STREAM test_len)
|
||||
if (test_len GREATER 0)
|
||||
if (WIN32 OR MINGW)
|
||||
configure_file(${TEST_FOLDER}/${TEST_REFERENCE} ${TEST_FOLDER}/${TEST_REFERENCE}.tmp NEWLINE_STYLE CRLF)
|
||||
if (EXISTS "${TEST_FOLDER}/${TEST_REFERENCE}.tmp")
|
||||
file(RENAME ${TEST_FOLDER}/${TEST_REFERENCE}.tmp ${TEST_FOLDER}/${TEST_REFERENCE})
|
||||
endif ()
|
||||
#file (READ ${TEST_FOLDER}/${TEST_REFERENCE} TEST_STREAM)
|
||||
#file (WRITE ${TEST_FOLDER}/${TEST_REFERENCE} "${TEST_STREAM}")
|
||||
endif ()
|
||||
endif ()
|
||||
|
||||
if (TEST_RESULT)
|
||||
set (TEST_RESULT 0)
|
||||
file (STRINGS ${TEST_FOLDER}/${TEST_OUTPUT} test_act)
|
||||
list (LENGTH test_act len_act)
|
||||
file (STRINGS ${TEST_FOLDER}/${TEST_REFERENCE} test_ref)
|
||||
list (LENGTH test_ref len_ref)
|
||||
if (len_act GREATER 0 AND len_ref GREATER 0)
|
||||
math (EXPR _FP_LEN "${len_ref} - 1")
|
||||
foreach (line RANGE 0 ${_FP_LEN})
|
||||
list (GET test_act ${line} str_act)
|
||||
list (GET test_ref ${line} str_ref)
|
||||
if (NOT str_act STREQUAL str_ref)
|
||||
if (str_act)
|
||||
set (TEST_RESULT 1)
|
||||
message (STATUS "line = ${line}\n***ACTUAL: ${str_act}\n****REFER: ${str_ref}\n")
|
||||
endif ()
|
||||
endif ()
|
||||
endforeach ()
|
||||
if (NOT TEST_SORT_COMPARE)
|
||||
# now compare the output with the reference
|
||||
execute_process (
|
||||
COMMAND ${CMAKE_COMMAND} -E compare_files ${TEST_FOLDER}/${TEST_OUTPUT} ${TEST_FOLDER}/${TEST_REFERENCE}
|
||||
RESULT_VARIABLE TEST_COMPARE_RESULT
|
||||
)
|
||||
else ()
|
||||
if (len_act EQUAL 0)
|
||||
message (STATUS "COMPARE Failed: ${TEST_FOLDER}/${TEST_OUTPUT} is empty")
|
||||
endif ()
|
||||
if (len_ref EQUAL 0)
|
||||
message (STATUS "COMPARE Failed: ${TEST_FOLDER}/${TEST_REFERENCE} is empty")
|
||||
file (STRINGS ${TEST_FOLDER}/${TEST_OUTPUT} v1)
|
||||
file (STRINGS ${TEST_FOLDER}/${TEST_REFERENCE} v2)
|
||||
list (SORT v1)
|
||||
list (SORT v2)
|
||||
if (NOT v1 STREQUAL v2)
|
||||
set(TEST_COMPARE_RESULT 1)
|
||||
endif ()
|
||||
endif ()
|
||||
if (NOT len_act EQUAL len_ref)
|
||||
set (TEST_RESULT 1)
|
||||
|
||||
if (TEST_COMPARE_RESULT)
|
||||
set (TEST_COMPARE_RESULT 0)
|
||||
file (STRINGS ${TEST_FOLDER}/${TEST_OUTPUT} test_act)
|
||||
list (LENGTH test_act len_act)
|
||||
file (STRINGS ${TEST_FOLDER}/${TEST_REFERENCE} test_ref)
|
||||
list (LENGTH test_ref len_ref)
|
||||
if (len_act GREATER 0 AND len_ref GREATER 0)
|
||||
math (EXPR _FP_LEN "${len_ref} - 1")
|
||||
foreach (line RANGE 0 ${_FP_LEN})
|
||||
list (GET test_act ${line} str_act)
|
||||
list (GET test_ref ${line} str_ref)
|
||||
if (NOT str_act STREQUAL str_ref)
|
||||
if (str_act)
|
||||
set (TEST_COMPARE_RESULT 1)
|
||||
message (STATUS "line = ${line}\n***ACTUAL: ${str_act}\n****REFER: ${str_ref}\n")
|
||||
endif ()
|
||||
endif ()
|
||||
endforeach ()
|
||||
else ()
|
||||
if (len_act EQUAL 0)
|
||||
message (STATUS "COMPARE Failed: ${TEST_FOLDER}/${TEST_OUTPUT} is empty")
|
||||
endif ()
|
||||
if (len_ref EQUAL 0)
|
||||
message (STATUS "COMPARE Failed: ${TEST_FOLDER}/${TEST_REFERENCE} is empty")
|
||||
endif ()
|
||||
endif ()
|
||||
if (NOT len_act EQUAL len_ref)
|
||||
set (TEST_COMPARE_RESULT 1)
|
||||
endif ()
|
||||
endif ()
|
||||
endif ()
|
||||
|
||||
message (STATUS "COMPARE Result: ${TEST_RESULT}")
|
||||
message (STATUS "COMPARE Result: ${TEST_COMPARE_RESULT}")
|
||||
|
||||
# again, if return value is !=0 scream and shout
|
||||
if (TEST_RESULT)
|
||||
if (TEST_COMPARE_RESULT)
|
||||
message (FATAL_ERROR "Failed: The output of ${TEST_OUTPUT} did not match ${TEST_REFERENCE}")
|
||||
endif ()
|
||||
endif ()
|
||||
endif ()
|
||||
else ()
|
||||
# else grep the output with the reference
|
||||
set (TEST_GREP_RESULT 0)
|
||||
file (READ ${TEST_FOLDER}/${TEST_OUTPUT} TEST_STREAM)
|
||||
|
||||
# TEST_REFERENCE should always be matched
|
||||
string (REGEX MATCH "${TEST_REFERENCE}" TEST_MATCH ${TEST_STREAM})
|
||||
string (COMPARE EQUAL "${TEST_REFERENCE}" "${TEST_MATCH}" TEST_RESULT)
|
||||
if (NOT TEST_RESULT)
|
||||
string (COMPARE EQUAL "${TEST_REFERENCE}" "${TEST_MATCH}" TEST_GREP_RESULT)
|
||||
if (NOT TEST_GREP_RESULT)
|
||||
message (FATAL_ERROR "Failed: The output of ${TEST_PROGRAM} did not contain ${TEST_REFERENCE}")
|
||||
endif ()
|
||||
endif ()
|
||||
@@ -176,8 +187,8 @@ if (TEST_FILTER)
|
||||
string (REGEX MATCH "${TEST_FILTER}" TEST_MATCH ${TEST_STREAM})
|
||||
if (TEST_EXPECT)
|
||||
# TEST_EXPECT (1) interprets TEST_FILTER as; NOT to match
|
||||
string (LENGTH "${TEST_MATCH}" TEST_RESULT)
|
||||
if (TEST_RESULT)
|
||||
string (LENGTH "${TEST_MATCH}" TEST_GREP_RESULT)
|
||||
if (TEST_GREP_RESULT)
|
||||
message (FATAL_ERROR "Failed: The output of ${TEST_PROGRAM} did contain ${TEST_FILTER}")
|
||||
endif ()
|
||||
endif ()
|
||||
|
||||
+130
-110
@@ -90,18 +90,21 @@ message (STATUS "COMMAND Result: ${TEST_RESULT}")
|
||||
# if the .err file exists and ERRROR_APPEND is enabled
|
||||
if (EXISTS "${TEST_FOLDER}/${TEST_OUTPUT}.err")
|
||||
file (READ ${TEST_FOLDER}/${TEST_OUTPUT}.err TEST_STREAM)
|
||||
if (TEST_MASK_FILE)
|
||||
STRING(REGEX REPLACE "CurrentDir is [^\n]+\n" "CurrentDir is (dir name)\n" TEST_STREAM "${TEST_STREAM}")
|
||||
endif ()
|
||||
# remove special output
|
||||
string (REGEX REPLACE "^.*_pmi_alps[^\n]+\n" "" TEST_STREAM "${TEST_STREAM}")
|
||||
list(LENGTH TEST_STREAM test_len)
|
||||
if (test_len GREATER 0)
|
||||
if (TEST_MASK_FILE)
|
||||
STRING(REGEX REPLACE "CurrentDir is [^\n]+\n" "CurrentDir is (dir name)\n" TEST_STREAM "${TEST_STREAM}")
|
||||
endif ()
|
||||
# remove special output
|
||||
string (REGEX REPLACE "^.*_pmi_alps[^\n]+\n" "" TEST_STREAM "${TEST_STREAM}")
|
||||
|
||||
if (NOT ERROR_APPEND)
|
||||
# write back to original .err file
|
||||
file (WRITE ${TEST_FOLDER}/${TEST_OUTPUT}.err "${TEST_STREAM}")
|
||||
else ()
|
||||
# append error output to the stdout output file
|
||||
file (APPEND ${TEST_FOLDER}/${TEST_OUTPUT} "${TEST_STREAM}")
|
||||
if (NOT ERROR_APPEND)
|
||||
# write back to original .err file
|
||||
file (WRITE ${TEST_FOLDER}/${TEST_OUTPUT}.err "${TEST_STREAM}")
|
||||
else ()
|
||||
# append error output to the stdout output file
|
||||
file (APPEND ${TEST_FOLDER}/${TEST_OUTPUT} "${TEST_STREAM}")
|
||||
endif ()
|
||||
endif ()
|
||||
endif ()
|
||||
|
||||
@@ -198,147 +201,164 @@ endif ()
|
||||
if (TEST_REF_FILTER)
|
||||
#message (STATUS "TEST_REF_FILTER: ${TEST_APPEND}${TEST_REF_FILTER}")
|
||||
file (READ ${TEST_FOLDER}/${TEST_REFERENCE} TEST_STREAM)
|
||||
STRING(REGEX REPLACE "${TEST_REF_APPEND}" "${TEST_REF_FILTER}" TEST_STREAM "${TEST_STREAM}")
|
||||
string (REGEX REPLACE "${TEST_REF_APPEND}" "${TEST_REF_FILTER}" TEST_STREAM "${TEST_STREAM}")
|
||||
file (WRITE ${TEST_FOLDER}/${TEST_REFERENCE} "${TEST_STREAM}")
|
||||
endif ()
|
||||
|
||||
# compare output files to references unless this must be skipped
|
||||
set (TEST_COMPARE_RESULT 0)
|
||||
if (NOT TEST_SKIP_COMPARE)
|
||||
if (EXISTS "${TEST_FOLDER}/${TEST_REFERENCE}")
|
||||
if (WIN32 OR MINGW)
|
||||
configure_file(${TEST_FOLDER}/${TEST_REFERENCE} ${TEST_FOLDER}/${TEST_REFERENCE}.tmp NEWLINE_STYLE CRLF)
|
||||
file(RENAME ${TEST_FOLDER}/${TEST_REFERENCE}.tmp ${TEST_FOLDER}/${TEST_REFERENCE})
|
||||
#file (READ ${TEST_FOLDER}/${TEST_REFERENCE} TEST_STREAM)
|
||||
#file (WRITE ${TEST_FOLDER}/${TEST_REFERENCE} "${TEST_STREAM}")
|
||||
endif ()
|
||||
|
||||
if (NOT TEST_SORT_COMPARE)
|
||||
# now compare the output with the reference
|
||||
execute_process (
|
||||
COMMAND ${CMAKE_COMMAND} -E compare_files ${TEST_FOLDER}/${TEST_OUTPUT} ${TEST_FOLDER}/${TEST_REFERENCE}
|
||||
RESULT_VARIABLE TEST_RESULT
|
||||
)
|
||||
else ()
|
||||
file (STRINGS ${TEST_FOLDER}/${TEST_OUTPUT} v1)
|
||||
file (STRINGS ${TEST_FOLDER}/${TEST_REFERENCE} v2)
|
||||
list (SORT v1)
|
||||
list (SORT v2)
|
||||
if (NOT v1 STREQUAL v2)
|
||||
set(TEST_RESULT 1)
|
||||
file (READ ${TEST_FOLDER}/${TEST_REFERENCE} TEST_STREAM)
|
||||
list(LENGTH TEST_STREAM test_len)
|
||||
if (test_len GREATER 0)
|
||||
if (WIN32 OR MINGW)
|
||||
configure_file(${TEST_FOLDER}/${TEST_REFERENCE} ${TEST_FOLDER}/${TEST_REFERENCE}.tmp NEWLINE_STYLE CRLF)
|
||||
if (EXISTS "${TEST_FOLDER}/${TEST_REFERENCE}.tmp")
|
||||
file(RENAME ${TEST_FOLDER}/${TEST_REFERENCE}.tmp ${TEST_FOLDER}/${TEST_REFERENCE})
|
||||
endif ()
|
||||
#file (READ ${TEST_FOLDER}/${TEST_REFERENCE} TEST_STREAM)
|
||||
#file (WRITE ${TEST_FOLDER}/${TEST_REFERENCE} "${TEST_STREAM}")
|
||||
endif ()
|
||||
endif ()
|
||||
|
||||
if (TEST_RESULT)
|
||||
set (TEST_RESULT 0)
|
||||
file (STRINGS ${TEST_FOLDER}/${TEST_OUTPUT} test_act)
|
||||
list (LENGTH test_act len_act)
|
||||
file (STRINGS ${TEST_FOLDER}/${TEST_REFERENCE} test_ref)
|
||||
list (LENGTH test_ref len_ref)
|
||||
if (len_act GREATER 0 AND len_ref GREATER 0)
|
||||
math (EXPR _FP_LEN "${len_ref} - 1")
|
||||
foreach (line RANGE 0 ${_FP_LEN})
|
||||
list (GET test_act ${line} str_act)
|
||||
list (GET test_ref ${line} str_ref)
|
||||
if (NOT str_act STREQUAL str_ref)
|
||||
if (str_act)
|
||||
set (TEST_RESULT 1)
|
||||
message (STATUS "line = ${line}\n***ACTUAL: ${str_act}\n****REFER: ${str_ref}\n")
|
||||
endif ()
|
||||
endif ()
|
||||
endforeach ()
|
||||
if (NOT TEST_SORT_COMPARE)
|
||||
# now compare the output with the reference
|
||||
execute_process (
|
||||
COMMAND ${CMAKE_COMMAND} -E compare_files ${TEST_FOLDER}/${TEST_OUTPUT} ${TEST_FOLDER}/${TEST_REFERENCE}
|
||||
RESULT_VARIABLE TEST_COMPARE_RESULT
|
||||
)
|
||||
else ()
|
||||
if (len_act EQUAL 0)
|
||||
message (STATUS "COMPARE Failed: ${TEST_FOLDER}/${TEST_OUTPUT} is empty")
|
||||
endif ()
|
||||
if (len_ref EQUAL 0)
|
||||
message (STATUS "COMPARE Failed: ${TEST_FOLDER}/${TEST_REFERENCE} is empty")
|
||||
file (STRINGS ${TEST_FOLDER}/${TEST_OUTPUT} v1)
|
||||
file (STRINGS ${TEST_FOLDER}/${TEST_REFERENCE} v2)
|
||||
list (SORT v1)
|
||||
list (SORT v2)
|
||||
if (NOT v1 STREQUAL v2)
|
||||
set(TEST_COMPARE_RESULT 1)
|
||||
endif ()
|
||||
endif ()
|
||||
if (NOT len_act EQUAL len_ref)
|
||||
set (TEST_RESULT 1)
|
||||
|
||||
if (TEST_COMPARE_RESULT)
|
||||
set (TEST_COMPARE_RESULT 0)
|
||||
file (STRINGS ${TEST_FOLDER}/${TEST_OUTPUT} test_act)
|
||||
list (LENGTH test_act len_act)
|
||||
file (STRINGS ${TEST_FOLDER}/${TEST_REFERENCE} test_ref)
|
||||
list (LENGTH test_ref len_ref)
|
||||
if (len_act GREATER 0 AND len_ref GREATER 0)
|
||||
math (EXPR _FP_LEN "${len_ref} - 1")
|
||||
foreach (line RANGE 0 ${_FP_LEN})
|
||||
list (GET test_act ${line} str_act)
|
||||
list (GET test_ref ${line} str_ref)
|
||||
if (NOT str_act STREQUAL str_ref)
|
||||
if (str_act)
|
||||
set (TEST_COMPARE_RESULT 1)
|
||||
message (STATUS "line = ${line}\n***ACTUAL: ${str_act}\n****REFER: ${str_ref}\n")
|
||||
endif ()
|
||||
endif ()
|
||||
endforeach ()
|
||||
else ()
|
||||
if (len_act EQUAL 0)
|
||||
message (STATUS "COMPARE Failed: ${TEST_FOLDER}/${TEST_OUTPUT} is empty")
|
||||
endif ()
|
||||
if (len_ref EQUAL 0)
|
||||
message (STATUS "COMPARE Failed: ${TEST_FOLDER}/${TEST_REFERENCE} is empty")
|
||||
endif ()
|
||||
endif ()
|
||||
if (NOT len_act EQUAL len_ref)
|
||||
set (TEST_COMPARE_RESULT 1)
|
||||
endif ()
|
||||
endif ()
|
||||
endif ()
|
||||
|
||||
message (STATUS "COMPARE Result: ${TEST_RESULT}")
|
||||
message (STATUS "COMPARE Result: ${TEST_COMPARE_RESULT}")
|
||||
|
||||
# again, if return value is !=0 scream and shout
|
||||
if (TEST_RESULT)
|
||||
if (TEST_COMPARE_RESULT)
|
||||
message (FATAL_ERROR "Failed: The output of ${TEST_OUTPUT} did not match ${TEST_REFERENCE}")
|
||||
endif ()
|
||||
endif ()
|
||||
|
||||
# now compare the .err file with the error reference, if supplied
|
||||
set (TEST_ERRREF_RESULT 0)
|
||||
if (TEST_ERRREF)
|
||||
if (WIN32 OR MINGW)
|
||||
configure_file(${TEST_FOLDER}/${TEST_ERRREF} ${TEST_FOLDER}/${TEST_ERRREF}.tmp NEWLINE_STYLE CRLF)
|
||||
file(RENAME ${TEST_FOLDER}/${TEST_ERRREF}.tmp ${TEST_FOLDER}/${TEST_ERRREF})
|
||||
#file (READ ${TEST_FOLDER}/${TEST_ERRREF} TEST_STREAM)
|
||||
#file (WRITE ${TEST_FOLDER}/${TEST_ERRREF} "${TEST_STREAM}")
|
||||
endif ()
|
||||
file (READ ${TEST_FOLDER}/${TEST_ERRREF} TEST_STREAM)
|
||||
list(LENGTH TEST_STREAM test_len)
|
||||
if (test_len GREATER 0)
|
||||
if (WIN32 OR MINGW)
|
||||
configure_file(${TEST_FOLDER}/${TEST_ERRREF} ${TEST_FOLDER}/${TEST_ERRREF}.tmp NEWLINE_STYLE CRLF)
|
||||
if (EXISTS "${TEST_FOLDER}/${TEST_ERRREF}.tmp")
|
||||
file(RENAME ${TEST_FOLDER}/${TEST_ERRREF}.tmp ${TEST_FOLDER}/${TEST_ERRREF})
|
||||
endif ()
|
||||
#file (READ ${TEST_FOLDER}/${TEST_ERRREF} TEST_STREAM)
|
||||
#file (WRITE ${TEST_FOLDER}/${TEST_ERRREF} "${TEST_STREAM}")
|
||||
endif ()
|
||||
|
||||
# now compare the error output with the error reference
|
||||
execute_process (
|
||||
COMMAND ${CMAKE_COMMAND} -E compare_files ${TEST_FOLDER}/${TEST_OUTPUT}.err ${TEST_FOLDER}/${TEST_ERRREF}
|
||||
RESULT_VARIABLE TEST_RESULT
|
||||
)
|
||||
if (TEST_RESULT)
|
||||
set (TEST_RESULT 0)
|
||||
file (STRINGS ${TEST_FOLDER}/${TEST_OUTPUT}.err test_act)
|
||||
list (LENGTH test_act len_act)
|
||||
file (STRINGS ${TEST_FOLDER}/${TEST_ERRREF} test_ref)
|
||||
list (LENGTH test_ref len_ref)
|
||||
math (EXPR _FP_LEN "${len_ref} - 1")
|
||||
if (len_act GREATER 0 AND len_ref GREATER 0)
|
||||
# now compare the error output with the error reference
|
||||
execute_process (
|
||||
COMMAND ${CMAKE_COMMAND} -E compare_files ${TEST_FOLDER}/${TEST_OUTPUT}.err ${TEST_FOLDER}/${TEST_ERRREF}
|
||||
RESULT_VARIABLE TEST_ERRREF_RESULT
|
||||
)
|
||||
if (TEST_ERRREF_RESULT)
|
||||
set (TEST_ERRREF_RESULT 0)
|
||||
file (STRINGS ${TEST_FOLDER}/${TEST_OUTPUT}.err test_act)
|
||||
list (LENGTH test_act len_act)
|
||||
file (STRINGS ${TEST_FOLDER}/${TEST_ERRREF} test_ref)
|
||||
list (LENGTH test_ref len_ref)
|
||||
math (EXPR _FP_LEN "${len_ref} - 1")
|
||||
foreach (line RANGE 0 ${_FP_LEN})
|
||||
list (GET test_act ${line} str_act)
|
||||
list (GET test_ref ${line} str_ref)
|
||||
if (NOT str_act STREQUAL str_ref)
|
||||
if (str_act)
|
||||
set (TEST_RESULT 1)
|
||||
message (STATUS "line = ${line}\n***ACTUAL: ${str_act}\n****REFER: ${str_ref}\n")
|
||||
if (len_act GREATER 0 AND len_ref GREATER 0)
|
||||
math (EXPR _FP_LEN "${len_ref} - 1")
|
||||
foreach (line RANGE 0 ${_FP_LEN})
|
||||
list (GET test_act ${line} str_act)
|
||||
list (GET test_ref ${line} str_ref)
|
||||
if (NOT str_act STREQUAL str_ref)
|
||||
if (str_act)
|
||||
set (TEST_ERRREF_RESULT 1)
|
||||
message (STATUS "line = ${line}\n***ACTUAL: ${str_act}\n****REFER: ${str_ref}\n")
|
||||
endif ()
|
||||
endif ()
|
||||
endforeach ()
|
||||
else ()
|
||||
if (len_act EQUAL 0)
|
||||
message (STATUS "COMPARE Failed: ${TEST_FOLDER}/${TEST_OUTPUT}.err is empty")
|
||||
endif ()
|
||||
if (len_ref EQUAL 0)
|
||||
message (STATUS "COMPARE Failed: ${TEST_FOLDER}/${TEST_ERRREF} is empty")
|
||||
endif ()
|
||||
endforeach ()
|
||||
else ()
|
||||
if (len_act EQUAL 0)
|
||||
message (STATUS "COMPARE Failed: ${TEST_FOLDER}/${TEST_OUTPUT}.err is empty")
|
||||
endif ()
|
||||
if (len_ref EQUAL 0)
|
||||
message (STATUS "COMPARE Failed: ${TEST_FOLDER}/${TEST_ERRREF} is empty")
|
||||
if (NOT len_act EQUAL len_ref)
|
||||
set (TEST_ERRREF_RESULT 1)
|
||||
endif ()
|
||||
endif ()
|
||||
if (NOT len_act EQUAL len_ref)
|
||||
set (TEST_RESULT 1)
|
||||
endif ()
|
||||
endif ()
|
||||
|
||||
message (STATUS "COMPARE Result: ${TEST_RESULT}")
|
||||
message (STATUS "COMPARE Result: ${TEST_ERRREF_RESULT}")
|
||||
|
||||
# again, if return value is !=0 scream and shout
|
||||
if (TEST_RESULT)
|
||||
if (TEST_ERRREF_RESULT)
|
||||
message (FATAL_ERROR "Failed: The error output of ${TEST_OUTPUT}.err did not match ${TEST_ERRREF}")
|
||||
endif ()
|
||||
endif ()
|
||||
endif ()
|
||||
|
||||
set (TEST_GREP_RESULT 0)
|
||||
if (TEST_GREP_COMPARE)
|
||||
# now grep the output with the reference
|
||||
file (READ ${TEST_FOLDER}/${TEST_OUTPUT} TEST_STREAM)
|
||||
list(LENGTH TEST_STREAM test_len)
|
||||
if (test_len GREATER 0)
|
||||
# TEST_REFERENCE should always be matched
|
||||
string (REGEX MATCH "${TEST_REFERENCE}" TEST_MATCH ${TEST_STREAM})
|
||||
string (COMPARE EQUAL "${TEST_REFERENCE}" "${TEST_MATCH}" TEST_GREP_RESULT)
|
||||
if (NOT TEST_GREP_RESULT)
|
||||
message (FATAL_ERROR "Failed: The output of ${TEST_PROGRAM} did not contain ${TEST_REFERENCE}")
|
||||
endif ()
|
||||
|
||||
# TEST_REFERENCE should always be matched
|
||||
string (REGEX MATCH "${TEST_REFERENCE}" TEST_MATCH ${TEST_STREAM})
|
||||
string (COMPARE EQUAL "${TEST_REFERENCE}" "${TEST_MATCH}" TEST_RESULT)
|
||||
if (NOT TEST_RESULT)
|
||||
message (FATAL_ERROR "Failed: The output of ${TEST_PROGRAM} did not contain ${TEST_REFERENCE}")
|
||||
endif ()
|
||||
|
||||
string (REGEX MATCH "${TEST_FILTER}" TEST_MATCH ${TEST_STREAM})
|
||||
if (TEST_EXPECT)
|
||||
# TEST_EXPECT (1) interprets TEST_FILTER as; NOT to match
|
||||
string (LENGTH "${TEST_MATCH}" TEST_RESULT)
|
||||
if (TEST_RESULT)
|
||||
message (FATAL_ERROR "Failed: The output of ${TEST_PROGRAM} did contain ${TEST_FILTER}")
|
||||
string (REGEX MATCH "${TEST_FILTER}" TEST_MATCH ${TEST_STREAM})
|
||||
if (TEST_EXPECT)
|
||||
# TEST_EXPECT (1) interprets TEST_FILTER as; NOT to match
|
||||
string (LENGTH "${TEST_MATCH}" TEST_GREP_RESULT)
|
||||
if (TEST_GREP_RESULT)
|
||||
message (FATAL_ERROR "Failed: The output of ${TEST_PROGRAM} did contain ${TEST_FILTER}")
|
||||
endif ()
|
||||
endif ()
|
||||
endif ()
|
||||
endif ()
|
||||
|
||||
+1
-1
@@ -276,7 +276,7 @@ if test "X-gcc" = "X-$cc_vendor"; then
|
||||
# gcc 7
|
||||
if test $cc_vers_major -ge 7; then
|
||||
DEVELOPER_WARNING_CFLAGS="$DEVELOPER_WARNING_CFLAGS -Wstringop-overflow=2"
|
||||
H5_CFLAGS="$H5_CFLAGS -Walloc-zero -Walloca -Wduplicated-branches -Wformat-overflow=2 -Wformat-truncation=2 -Wimplicit-fallthrough=5 -Wrestrict"
|
||||
H5_CFLAGS="$H5_CFLAGS -Walloc-zero -Walloca -Wduplicated-branches -Wformat-overflow=2 -Wformat-truncation=1 -Wimplicit-fallthrough=5 -Wrestrict"
|
||||
fi
|
||||
|
||||
# gcc 8
|
||||
|
||||
@@ -0,0 +1,16 @@
|
||||
# -*- shell-script -*-
|
||||
#
|
||||
# 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://support.hdfgroup.org/ftp/HDF5/releases.
|
||||
# If you do not have access to either file, you may request a copy from
|
||||
# help@hdfgroup.org.
|
||||
|
||||
# ARM for Raspberry Pi, etc.
|
||||
# This is the same as linux-gnulibc1
|
||||
|
||||
. $srcdir/config/linux-gnulibc1
|
||||
@@ -0,0 +1,174 @@
|
||||
Apache License
|
||||
Version 2.0, January 2004
|
||||
http://www.apache.org/licenses/
|
||||
|
||||
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
||||
|
||||
1. Definitions.
|
||||
|
||||
"License" shall mean the terms and conditions for use, reproduction,
|
||||
and distribution as defined by Sections 1 through 9 of this document.
|
||||
|
||||
"Licensor" shall mean the copyright owner or entity authorized by
|
||||
the copyright owner that is granting the License.
|
||||
|
||||
"Legal Entity" shall mean the union of the acting entity and all
|
||||
other entities that control, are controlled by, or are under common
|
||||
control with that entity. For the purposes of this definition,
|
||||
"control" means (i) the power, direct or indirect, to cause the
|
||||
direction or management of such entity, whether by contract or
|
||||
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
||||
outstanding shares, or (iii) beneficial ownership of such entity.
|
||||
|
||||
"You" (or "Your") shall mean an individual or Legal Entity
|
||||
exercising permissions granted by this License.
|
||||
|
||||
"Source" form shall mean the preferred form for making modifications,
|
||||
including but not limited to software source code, documentation
|
||||
source, and configuration files.
|
||||
|
||||
"Object" form shall mean any form resulting from mechanical
|
||||
transformation or translation of a Source form, including but
|
||||
not limited to compiled object code, generated documentation,
|
||||
and conversions to other media types.
|
||||
|
||||
"Work" shall mean the work of authorship, whether in Source or
|
||||
Object form, made available under the License, as indicated by a
|
||||
copyright notice that is included in or attached to the work
|
||||
(an example is provided in the Appendix below).
|
||||
|
||||
"Derivative Works" shall mean any work, whether in Source or Object
|
||||
form, that is based on (or derived from) the Work and for which the
|
||||
editorial revisions, annotations, elaborations, or other modifications
|
||||
represent, as a whole, an original work of authorship. For the purposes
|
||||
of this License, Derivative Works shall not include works that remain
|
||||
separable from, or merely link (or bind by name) to the interfaces of,
|
||||
the Work and Derivative Works thereof.
|
||||
|
||||
"Contribution" shall mean any work of authorship, including
|
||||
the original version of the Work and any modifications or additions
|
||||
to that Work or Derivative Works thereof, that is intentionally
|
||||
submitted to Licensor for inclusion in the Work by the copyright owner
|
||||
or by an individual or Legal Entity authorized to submit on behalf of
|
||||
the copyright owner. For the purposes of this definition, "submitted"
|
||||
means any form of electronic, verbal, or written communication sent
|
||||
to the Licensor or its representatives, including but not limited to
|
||||
communication on electronic mailing lists, source code control systems,
|
||||
and issue tracking systems that are managed by, or on behalf of, the
|
||||
Licensor for the purpose of discussing and improving the Work, but
|
||||
excluding communication that is conspicuously marked or otherwise
|
||||
designated in writing by the copyright owner as "Not a Contribution."
|
||||
|
||||
"Contributor" shall mean Licensor and any individual or Legal Entity
|
||||
on behalf of whom a Contribution has been received by Licensor and
|
||||
subsequently incorporated within the Work.
|
||||
|
||||
2. Grant of Copyright License. Subject to the terms and conditions of
|
||||
this License, each Contributor hereby grants to You a perpetual,
|
||||
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
||||
copyright license to reproduce, prepare Derivative Works of,
|
||||
publicly display, publicly perform, sublicense, and distribute the
|
||||
Work and such Derivative Works in Source or Object form.
|
||||
|
||||
3. Grant of Patent License. Subject to the terms and conditions of
|
||||
this License, each Contributor hereby grants to You a perpetual,
|
||||
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
||||
(except as stated in this section) patent license to make, have made,
|
||||
use, offer to sell, sell, import, and otherwise transfer the Work,
|
||||
where such license applies only to those patent claims licensable
|
||||
by such Contributor that are necessarily infringed by their
|
||||
Contribution(s) alone or by combination of their Contribution(s)
|
||||
with the Work to which such Contribution(s) was submitted. If You
|
||||
institute patent litigation against any entity (including a
|
||||
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
||||
or a Contribution incorporated within the Work constitutes direct
|
||||
or contributory patent infringement, then any patent licenses
|
||||
granted to You under this License for that Work shall terminate
|
||||
as of the date such litigation is filed.
|
||||
|
||||
4. Redistribution. You may reproduce and distribute copies of the
|
||||
Work or Derivative Works thereof in any medium, with or without
|
||||
modifications, and in Source or Object form, provided that You
|
||||
meet the following conditions:
|
||||
|
||||
(a) You must give any other recipients of the Work or
|
||||
Derivative Works a copy of this License; and
|
||||
|
||||
(b) You must cause any modified files to carry prominent notices
|
||||
stating that You changed the files; and
|
||||
|
||||
(c) You must retain, in the Source form of any Derivative Works
|
||||
that You distribute, all copyright, patent, trademark, and
|
||||
attribution notices from the Source form of the Work,
|
||||
excluding those notices that do not pertain to any part of
|
||||
the Derivative Works; and
|
||||
|
||||
(d) If the Work includes a "NOTICE" text file as part of its
|
||||
distribution, then any Derivative Works that You distribute must
|
||||
include a readable copy of the attribution notices contained
|
||||
within such NOTICE file, excluding those notices that do not
|
||||
pertain to any part of the Derivative Works, in at least one
|
||||
of the following places: within a NOTICE text file distributed
|
||||
as part of the Derivative Works; within the Source form or
|
||||
documentation, if provided along with the Derivative Works; or,
|
||||
within a display generated by the Derivative Works, if and
|
||||
wherever such third-party notices normally appear. The contents
|
||||
of the NOTICE file are for informational purposes only and
|
||||
do not modify the License. You may add Your own attribution
|
||||
notices within Derivative Works that You distribute, alongside
|
||||
or as an addendum to the NOTICE text from the Work, provided
|
||||
that such additional attribution notices cannot be construed
|
||||
as modifying the License.
|
||||
|
||||
You may add Your own copyright statement to Your modifications and
|
||||
may provide additional or different license terms and conditions
|
||||
for use, reproduction, or distribution of Your modifications, or
|
||||
for any such Derivative Works as a whole, provided Your use,
|
||||
reproduction, and distribution of the Work otherwise complies with
|
||||
the conditions stated in this License.
|
||||
|
||||
5. Submission of Contributions. Unless You explicitly state otherwise,
|
||||
any Contribution intentionally submitted for inclusion in the Work
|
||||
by You to the Licensor shall be under the terms and conditions of
|
||||
this License, without any additional terms or conditions.
|
||||
Notwithstanding the above, nothing herein shall supersede or modify
|
||||
the terms of any separate license agreement you may have executed
|
||||
with Licensor regarding such Contributions.
|
||||
|
||||
6. Trademarks. This License does not grant permission to use the trade
|
||||
names, trademarks, service marks, or product names of the Licensor,
|
||||
except as required for reasonable and customary use in describing the
|
||||
origin of the Work and reproducing the content of the NOTICE file.
|
||||
|
||||
7. Disclaimer of Warranty. Unless required by applicable law or
|
||||
agreed to in writing, Licensor provides the Work (and each
|
||||
Contributor provides its Contributions) on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
||||
implied, including, without limitation, any warranties or conditions
|
||||
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
||||
PARTICULAR PURPOSE. You are solely responsible for determining the
|
||||
appropriateness of using or redistributing the Work and assume any
|
||||
risks associated with Your exercise of permissions under this License.
|
||||
|
||||
8. Limitation of Liability. In no event and under no legal theory,
|
||||
whether in tort (including negligence), contract, or otherwise,
|
||||
unless required by applicable law (such as deliberate and grossly
|
||||
negligent acts) or agreed to in writing, shall any Contributor be
|
||||
liable to You for damages, including any direct, indirect, special,
|
||||
incidental, or consequential damages of any character arising as a
|
||||
result of this License or out of the use or inability to use the
|
||||
Work (including but not limited to damages for loss of goodwill,
|
||||
work stoppage, computer failure or malfunction, or any and all
|
||||
other commercial damages or losses), even if such Contributor
|
||||
has been advised of the possibility of such damages.
|
||||
|
||||
9. Accepting Warranty or Additional Liability. While redistributing
|
||||
the Work or Derivative Works thereof, You may choose to offer,
|
||||
and charge a fee for, acceptance of support, warranty, indemnity,
|
||||
or other liability obligations and/or rights consistent with this
|
||||
License. However, in accepting such obligations, You may act only
|
||||
on Your own behalf and on Your sole responsibility, not on behalf
|
||||
of any other Contributor, and only if You agree to indemnify,
|
||||
defend, and hold each Contributor harmless for any liability
|
||||
incurred by, or claims asserted against, such Contributor by reason
|
||||
of your accepting any such warranty or additional liability.
|
||||
@@ -0,0 +1,307 @@
|
||||
# CMake Scripts <!-- omit in toc -->
|
||||
|
||||
[](https://git.stabletec.com/other/cmake-scripts/commits/master)
|
||||
[](https://git.stabletec.com/other/cmake-scripts/blob/master/LICENSE)
|
||||
|
||||
This is a collection of quite useful scripts that expand the possibilities for building software with CMake, by making some things easier and otherwise adding new build types
|
||||
|
||||
- [C++ Standards `c++-standards.cmake`](#c-standards-c-standardscmake)
|
||||
- [Sanitizer Builds `sanitizers.cmake`](#sanitizer-builds-sanitizerscmake)
|
||||
- [Code Coverage `code-coverage.cmake`](#code-coverage-code-coveragecmake)
|
||||
- [Added Targets](#added-targets)
|
||||
- [Usage](#usage)
|
||||
- [Example 1 - All targets instrumented](#example-1---all-targets-instrumented)
|
||||
- [1a - Via global command](#1a---via-global-command)
|
||||
- [1b - Via target commands](#1b---via-target-commands)
|
||||
- [Example 2: Target instrumented, but with regex pattern of files to be excluded from report](#example-2-target-instrumented-but-with-regex-pattern-of-files-to-be-excluded-from-report)
|
||||
- [Example 3: Target added to the 'ccov' and 'ccov-all' targets](#example-3-target-added-to-the-ccov-and-ccov-all-targets)
|
||||
- [Compiler Options `compiler-options.cmake`](#compiler-options-compiler-optionscmake)
|
||||
- [Dependency Graph `dependency-graph.cmake`](#dependency-graph-dependency-graphcmake)
|
||||
- [Required Arguments](#required-arguments)
|
||||
- [OUTPUT_TYPE *STR*](#output_type-str)
|
||||
- [Optional Arguments](#optional-arguments)
|
||||
- [ADD_TO_DEP_GRAPH](#add_to_dep_graph)
|
||||
- [TARGET_NAME *STR*](#target_name-str)
|
||||
- [OUTPUT_DIR *STR*](#output_dir-str)
|
||||
- [Doxygen `doxygen.cmake`](#doxygen-doxygencmake)
|
||||
- [Optional Arguments](#optional-arguments-1)
|
||||
- [ADD_TO_DOC](#add_to_doc)
|
||||
- [INSTALLABLE](#installable)
|
||||
- [PROCESS_DOXYFILE](#process_doxyfile)
|
||||
- [TARGET_NAME *STR*](#target_name-str-1)
|
||||
- [OUTPUT_DIR *STR*](#output_dir-str-1)
|
||||
- [INSTALL_PATH *STR*](#install_path-str)
|
||||
- [DOXYFILE_PATH *STR*](#doxyfile_path-str)
|
||||
- [Prepare the Catch Test Framework `prepare_catch.cmake`](#prepare-the-catch-test-framework-prepare_catchcmake)
|
||||
- [Optional Arguments](#optional-arguments-2)
|
||||
- [COMPILED_CATCH](#compiled_catch)
|
||||
- [CATCH1](#catch1)
|
||||
- [CLONE](#clone)
|
||||
- [Tools `tools.cmake`](#tools-toolscmake)
|
||||
- [clang-tidy](#clang-tidy)
|
||||
- [include-what-you-use](#include-what-you-use)
|
||||
- [cppcheck](#cppcheck)
|
||||
- [Formatting `formatting.cmake`](#formatting-formattingcmake)
|
||||
- [clang-format](#clang-format)
|
||||
- [cmake-format](#cmake-format)
|
||||
|
||||
## C++ Standards [`c++-standards.cmake`](c++-standards.cmake)
|
||||
|
||||
Using the functions `cxx_11()`, `cxx_14()`, `cxx_17()` or `cxx_20()` this adds the appropriate flags for both unix and MSVC compilers, even for those before 3.11 with improper support.
|
||||
|
||||
These obviously force the standard to be required, and also disables compiler-specific extensions, ie `--std=gnu++11`. This helps to prevent fragmenting the code base with items not available elsewhere, adhering to the agreed C++ standards only.
|
||||
|
||||
## Sanitizer Builds [`sanitizers.cmake`](sanitizers.cmake)
|
||||
|
||||
Sanitizers are tools that perform checks during a program’s runtime and returns issues, and as such, along with unit testing, code coverage and static analysis, is another tool to add to the programmers toolbox. And of course, like the previous tools, are tragically simple to add into any project using CMake, allowing any project and developer to quickly and easily use.
|
||||
|
||||
A quick rundown of the tools available, and what they do:
|
||||
- [LeakSanitizer](https://clang.llvm.org/docs/LeakSanitizer.html) detects memory leaks, or issues where memory is allocated and never deallocated, causing programs to slowly consume more and more memory, eventually leading to a crash.
|
||||
- [AddressSanitizer](https://clang.llvm.org/docs/AddressSanitizer.html) is a fast memory error detector. It is useful for detecting most issues dealing with memory, such as:
|
||||
- Out of bounds accesses to heap, stack, global
|
||||
- Use after free
|
||||
- Use after return
|
||||
- Use after scope
|
||||
- Double-free, invalid free
|
||||
- Memory leaks (using LeakSanitizer)
|
||||
- [ThreadSanitizer](https://clang.llvm.org/docs/ThreadSanitizer.html) detects data races for multi-threaded code.
|
||||
- [UndefinedBehaviourSanitizer](https://clang.llvm.org/docs/UndefinedBehaviorSanitizer.html) detects the use of various features of C/C++ that are explicitly listed as resulting in undefined behaviour. Most notably:
|
||||
- Using misaligned or null pointer.
|
||||
- Signed integer overflow
|
||||
- Conversion to, from, or between floating-point types which would overflow the destination
|
||||
- Division by zero
|
||||
- Unreachable code
|
||||
- [MemorySanitizer](https://clang.llvm.org/docs/MemorySanitizer.html) detects uninitialized reads.
|
||||
|
||||
These are used by declaring the `USE_SANITIZER` CMake variable as one of:
|
||||
- Address
|
||||
- Memory
|
||||
- MemoryWithOrigins
|
||||
- Undefined
|
||||
- Thread
|
||||
- Address;Undefined
|
||||
- Undefined;Address
|
||||
- Leak
|
||||
|
||||
## Code Coverage [`code-coverage.cmake`](code-coverage.cmake)
|
||||
|
||||

|
||||
|
||||
> In computer science, test coverage is a measure used to describe the degree to which the source code of a program is executed when a particular test suite runs. A program with high test coverage, measured as a percentage, has had more of its source code executed during testing, which suggests it has a lower chance of containing undetected software bugs compared to a program with low test coverage. Many different metrics can be used to calculate test coverage; some of the most basic are the percentage of program subroutines and the percentage of program statements called during execution of the test suite.
|
||||
>
|
||||
> [Wikipedia, Code Coverage](https://en.wikipedia.org/wiki/Code_coverage)
|
||||
|
||||
Code coverage is the detailing of, during the execution of a binary, which regions, functions, or lines of code are *actually* executed. This can be used in a number of ways, from figuring out areas that automated testing is lacking or not touching, to giving a user an instrumented binary to determine which areas of code are used most/least to determine which areas to focus on. Although this does come with the caveat that coverage is no guarantee of good testing, just of what code has been.
|
||||
|
||||
Coverage here is supported on both GCC and Clang. GCC requires the `lcov` program, and Clang requires `llvm-cov` and `llvm-profdata`, often provided with the llvm toolchain.
|
||||
|
||||
To enable, turn on the `CODE_COVERAGE` variable.
|
||||
|
||||
### Added Targets
|
||||
|
||||
- GCOV/LCOV:
|
||||
- ccov : Generates HTML code coverage report for every target added with 'AUTO' parameter.
|
||||
- ccov-${TARNGET_NAME} : Generates HTML code coverage report for the associated named target.
|
||||
- ccov-all : Generates HTML code coverage report, merging every target added with 'ALL' parameter into a single detailed report.
|
||||
- ccov-all-capture : Generates an all-merged.info file, for use with coverage dashboards (e.g. codecov.io, coveralls).
|
||||
- LLVM-COV:
|
||||
- ccov : Generates HTML code coverage report for every target added with 'AUTO' parameter.
|
||||
- ccov-report : Generates HTML code coverage report for every target added with 'AUTO' parameter.
|
||||
- ccov-${TARGET_NAME} : Generates HTML code coverage report.
|
||||
- ccov-rpt-${TARGET_NAME} : Prints to command line summary per-file coverage information.
|
||||
- ccov-show-${TARGET_NAME} : Prints to command line detailed per-line coverage information.
|
||||
- ccov-all : Generates HTML code coverage report, merging every target added with 'ALL' parameter into a single detailed report.
|
||||
- ccov-all-report : Prints summary per-file coverage information for every target added with ALL' parameter to the command line.
|
||||
|
||||
### Usage
|
||||
|
||||
To enable any code coverage instrumentation/targets, the single CMake option of `CODE_COVERAGE` needs to be set to 'ON', either by GUI, ccmake, or on the command line ie `-DCODE_COVERAGE=ON`.
|
||||
|
||||
From this point, there are two primary methods for adding instrumentation to targets:
|
||||
1. A blanket instrumentation by calling `add_code_coverage()`, where all targets in that directory and all subdirectories are automatically instrumented.
|
||||
2. Per-target instrumentation by calling `target_code_coverage(<TARGET_NAME>)`, where the target is given and thus only that target is instrumented. This applies to both libraries and executables.
|
||||
|
||||
To add coverage targets, such as calling `make ccov` to generate the actual coverage information for perusal or consumption, call `target_code_coverage(<TARGET_NAME>)` on an *executable* target.
|
||||
|
||||
**NOTE:** For more options, please check the actual [`code-coverage.cmake`](code-coverage.cmake) file.
|
||||
|
||||
#### Example 1 - All targets instrumented
|
||||
|
||||
In this case, the coverage information reported will will be that of the `theLib` library target and `theExe` executable.
|
||||
|
||||
##### 1a - Via global command
|
||||
|
||||
```
|
||||
add_code_coverage() # Adds instrumentation to all targets
|
||||
|
||||
add_library(theLib lib.cpp)
|
||||
|
||||
add_executable(theExe main.cpp)
|
||||
target_link_libraries(theExe PRIVATE theLib)
|
||||
target_code_coverage(theExe) # As an executable target, adds the 'ccov-theExe' target (instrumentation already added via global anyways) for generating code coverage reports.
|
||||
```
|
||||
|
||||
##### 1b - Via target commands
|
||||
|
||||
```
|
||||
add_library(theLib lib.cpp)
|
||||
target_code_coverage(theLib) # As a library target, adds coverage instrumentation but no targets.
|
||||
|
||||
add_executable(theExe main.cpp)
|
||||
target_link_libraries(theExe PRIVATE theLib)
|
||||
target_code_coverage(theExe) # As an executable target, adds the 'ccov-theExe' target and instrumentation for generating code coverage reports.
|
||||
```
|
||||
|
||||
#### Example 2: Target instrumented, but with regex pattern of files to be excluded from report
|
||||
|
||||
```
|
||||
add_executable(theExe main.cpp non_covered.cpp)
|
||||
target_code_coverage(theExe EXCLUDE non_covered.cpp) # As an executable target, the reports will exclude the non-covered.cpp file.
|
||||
```
|
||||
|
||||
#### Example 3: Target added to the 'ccov' and 'ccov-all' targets
|
||||
|
||||
```
|
||||
add_code_coverage_all_targets(EXCLUDE test/*) # Adds the 'ccov-all' target set and sets it to exclude all files in test/ folders.
|
||||
|
||||
add_executable(theExe main.cpp non_covered.cpp)
|
||||
target_code_coverage(theExe AUTO ALL EXCLUDE non_covered.cpp test/*) # As an executable target, adds to the 'ccov' and ccov-all' targets, and the reports will exclude the non-covered.cpp file, and any files in a test/ folder.
|
||||
```
|
||||
|
||||
## Compiler Options [`compiler-options.cmake`](compiler-options.cmake)
|
||||
|
||||
Allows for easy use of some pre-made compiler options for the major compilers.
|
||||
|
||||
Using `-DENABLE_ALL_WARNINGS=ON` will enable almost all of the warnings available for a compiler:
|
||||
|
||||
| Compiler | Options |
|
||||
| :------- | :------------ |
|
||||
| MSVC | /W4 |
|
||||
| GCC | -Wall -Wextra |
|
||||
| Clang | -Wall -Wextra |
|
||||
|
||||
Using `-DENABLE_EFFECTIVE_CXX=ON` adds the `-Weffc++` for both GCC and clang.
|
||||
|
||||
Using `-DGENERATE_DEPENDENCY_DATA=ON` generates `.d` files along with regular object files on a per-source file basis on GCC/Clang compilers. These files contains the list of all header files used during compilation of that compilation unit.
|
||||
|
||||
## Dependency Graph [`dependency-graph.cmake`](dependency-graph.cmake)
|
||||
|
||||
CMake, with the dot application available, will build a visual representation of the library/executable dependencies, like so:
|
||||

|
||||
|
||||
### Required Arguments
|
||||
|
||||
#### OUTPUT_TYPE *STR*
|
||||
The type of output of `dot` to produce. Can be whatever `dot` itself supports (eg. png, ps, pdf).
|
||||
|
||||
### Optional Arguments
|
||||
|
||||
#### ADD_TO_DEP_GRAPH
|
||||
If specified, add this generated target to be a dependency of the more general `dep-graph` target.
|
||||
|
||||
#### TARGET_NAME *STR*
|
||||
The name to give the doc target. (Default: doc-${PROJECT_NAME})
|
||||
|
||||
#### OUTPUT_DIR *STR*
|
||||
The directory to place the generated output
|
||||
|
||||
## Doxygen [`doxygen.cmake`](doxygen.cmake)
|
||||
|
||||
Builds doxygen documentation with a default 'Doxyfile.in' or with a specified one, and can make the results installable (under the `doc` install target)
|
||||
|
||||
This can only be used once per project, as each target generated is as `doc-${PROJECT_NAME}` unless TARGET_NAME is specified.
|
||||
|
||||
### Optional Arguments
|
||||
|
||||
#### ADD_TO_DOC
|
||||
If specified, adds this generated target to be a dependency of the more general `doc` target.
|
||||
|
||||
#### INSTALLABLE
|
||||
Adds the generated documentation to the generic `install` target, under the `documentation` installation group.
|
||||
|
||||
#### PROCESS_DOXYFILE
|
||||
If set, then will process the found Doxyfile through the CMAKE `configure_file` function for macro replacements before using it. (@ONLY)
|
||||
|
||||
#### TARGET_NAME *STR*
|
||||
The name to give the doc target. (Default: doc-${PROJECT_NAME})
|
||||
|
||||
#### OUTPUT_DIR *STR*
|
||||
The directory to place the generated output. (Default: ${CMAKE_CURRENT_BINARY_DIR}/doc)
|
||||
|
||||
#### INSTALL_PATH *STR*
|
||||
The path to install the documenttation under. (if not specified, defaults to 'share/${PROJECT_NAME})
|
||||
|
||||
#### DOXYFILE_PATH *STR*
|
||||
The given doxygen file to use/process. (Defaults to'${CMAKE_CURRENT_SOURCE_DIR}/Doxyfile')
|
||||
|
||||
## Prepare the Catch Test Framework [`prepare_catch.cmake`](prepare_catch.cmake)
|
||||
|
||||
The included `prepare_catch` function contained within attempts to add the infrastructure necessary for automatically adding C/C++ tests using the Catch2 library, including either an interface or pre-compiled 'catch' target library.
|
||||
|
||||
It first attempts to find the header on the local machine, and failing that, clones the single header variant for use. It does make the determination between pre-C++11 and will use Catch1.X rather than Catch2 (when cloned), automatically or forced.. Adds a subdirectory of tests/ if it exists from the macro's calling location.
|
||||
|
||||
### Optional Arguments
|
||||
|
||||
#### COMPILED_CATCH
|
||||
If this option is specified, then generates the 'catch' target as a library with catch already pre-compiled as part of the library. Otherwise acts just an interface library for the header location.
|
||||
|
||||
#### CATCH1
|
||||
Force the use of Catch1.X, rather than auto-detecting the C++ version in use.
|
||||
|
||||
#### CLONE
|
||||
Force cloning of Catch, rather than attempting to use a locally-found variant.
|
||||
|
||||
## Tools [`tools.cmake`](tools.cmake)
|
||||
|
||||
### clang-tidy
|
||||
|
||||
> clang-tidy is a clang-based C++ “linter” tool. Its purpose is to provide an extensible framework for diagnosing and fixing typical programming errors, like style violations, interface misuse, or bugs that can be deduced via static analysis. clang-tidy is modular and provides a convenient interface for writing new checks.
|
||||
>
|
||||
> [clang-tidy page](https://clang.llvm.org/extra/clang-tidy/)
|
||||
|
||||
When detected, [clang-tidy](https://clang.llvm.org/extra/clang-tidy/) can be enabled by using the option of `-DCLANG_TIDY=ON`, as it is disabled by default.
|
||||
|
||||
To use, add the `clang_tidy()` function, with the arguments being the options to pass to the clang tidy program, such as '-checks=*'.
|
||||
|
||||
### include-what-you-use
|
||||
|
||||
This tool helps to organize headers for all files encompass all items being used in that file, without accidentally relying upon headers deep down a chain of other headers. This is disabled by default, and can be enabled via have the program installed and adding `-DIWYU=ON`.
|
||||
|
||||
To use, add the `include_what_you_use()` function, with the arguments being the options to pass to the program.
|
||||
|
||||
### cppcheck
|
||||
|
||||
This tool is another static analyzer in the vein of clang-tidy, which focuses on having no false positives. This is by default disabled, and can be enabled via have the program installed and adding `-DCPPCHECK=ON`.
|
||||
|
||||
To use, add the `cppcheck()` function, with the arguments being the options to pass to the program.
|
||||
|
||||
## Formatting [`formatting.cmake`](formatting.cmake)
|
||||
|
||||
### clang-format
|
||||
|
||||
Allows to automatically perform code formatting using the clang-format program, by calling an easy-to-use target ala `make format`. It requires a target name, and the list of files to format. As well, if the target name is the name of another target, then all files associated with that target will be added, and the target name changed to be `format_<TARGET>`. As well, any targets otherwise listed with the files will also have their files imported for formatting.
|
||||
|
||||
```
|
||||
file(GLOB_RECURSE ALL_CODE_FILES
|
||||
${PROJECT_SOURCE_DIR}/src/*.[ch]pp
|
||||
${PROJECT_SOURCE_DIR}/src/*.[ch]
|
||||
${PROJECT_SOURCE_DIR}/include/*.[h]pp
|
||||
${PROJECT_SOURCE_DIR}/include/*.[h]
|
||||
${PROJECT_SOURCE_DIR}/example/*.[ch]pp
|
||||
${PROJECT_SOURCE_DIR}/example/*.[ch]
|
||||
)
|
||||
|
||||
clang_format(TARGET_NAME ${ALL_CODE_FILES})
|
||||
```
|
||||
|
||||
### cmake-format
|
||||
|
||||
Similar to the clang-format above, creates a target `cmake-format` when the `cmake_format(<FILES>)` function is defined in CMake scripts, and any <FILES> passed in will be formatted by the cmake-format program, if it is found.
|
||||
|
||||
```
|
||||
file(GLOB_RECURSE CMAKE_FILES
|
||||
CMakeLists.txt
|
||||
)
|
||||
|
||||
cmake_format(TARGET_NAME ${CMAKE_FILES})
|
||||
```
|
||||
@@ -0,0 +1,536 @@
|
||||
#
|
||||
# Copyright (C) 2018 by George Cave - gcave@stablecoder.ca
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License"); you may not
|
||||
# use this file except in compliance with the License. You may obtain a copy of
|
||||
# the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
||||
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
||||
# License for the specific language governing permissions and limitations under
|
||||
# the License.
|
||||
|
||||
# USAGE: To enable any code coverage instrumentation/targets, the single CMake
|
||||
# option of `CODE_COVERAGE` needs to be set to 'ON', either by GUI, ccmake, or
|
||||
# on the command line.
|
||||
#
|
||||
# From this point, there are two primary methods for adding instrumentation to
|
||||
# targets: 1 - A blanket instrumentation by calling `add_code_coverage()`, where
|
||||
# all targets in that directory and all subdirectories are automatically
|
||||
# instrumented. 2 - Per-target instrumentation by calling
|
||||
# `target_code_coverage(<TARGET_NAME>)`, where the target is given and thus only
|
||||
# that target is instrumented. This applies to both libraries and executables.
|
||||
#
|
||||
# To add coverage targets, such as calling `make ccov` to generate the actual
|
||||
# coverage information for perusal or consumption, call
|
||||
# `target_code_coverage(<TARGET_NAME>)` on an *executable* target.
|
||||
#
|
||||
# Example 1: All targets instrumented
|
||||
#
|
||||
# In this case, the coverage information reported will will be that of the
|
||||
# `theLib` library target and `theExe` executable.
|
||||
#
|
||||
# 1a: Via global command
|
||||
#
|
||||
# ~~~
|
||||
# add_code_coverage() # Adds instrumentation to all targets
|
||||
#
|
||||
# add_library(theLib lib.cpp)
|
||||
#
|
||||
# add_executable(theExe main.cpp)
|
||||
# target_link_libraries(theExe PRIVATE theLib)
|
||||
# target_code_coverage(theExe) # As an executable target, adds the 'ccov-theExe' target (instrumentation already added via global anyways) for generating code coverage reports.
|
||||
# ~~~
|
||||
#
|
||||
# 1b: Via target commands
|
||||
#
|
||||
# ~~~
|
||||
# add_library(theLib lib.cpp)
|
||||
# target_code_coverage(theLib) # As a library target, adds coverage instrumentation but no targets.
|
||||
#
|
||||
# add_executable(theExe main.cpp)
|
||||
# target_link_libraries(theExe PRIVATE theLib)
|
||||
# target_code_coverage(theExe) # As an executable target, adds the 'ccov-theExe' target and instrumentation for generating code coverage reports.
|
||||
# ~~~
|
||||
#
|
||||
# Example 2: Target instrumented, but with regex pattern of files to be excluded
|
||||
# from report
|
||||
#
|
||||
# ~~~
|
||||
# add_executable(theExe main.cpp non_covered.cpp)
|
||||
# target_code_coverage(theExe EXCLUDE non_covered.cpp test/*) # As an executable target, the reports will exclude the non-covered.cpp file, and any files in a test/ folder.
|
||||
# ~~~
|
||||
#
|
||||
# Example 3: Target added to the 'ccov' and 'ccov-all' targets
|
||||
#
|
||||
# ~~~
|
||||
# add_code_coverage_all_targets(EXCLUDE test/*) # Adds the 'ccov-all' target set and sets it to exclude all files in test/ folders.
|
||||
#
|
||||
# add_executable(theExe main.cpp non_covered.cpp)
|
||||
# target_code_coverage(theExe AUTO ALL EXCLUDE non_covered.cpp test/*) # As an executable target, adds to the 'ccov' and ccov-all' targets, and the reports will exclude the non-covered.cpp file, and any files in a test/ folder.
|
||||
# ~~~
|
||||
|
||||
# Options
|
||||
option(
|
||||
CODE_COVERAGE
|
||||
"Builds targets with code coverage instrumentation. (Requires GCC or Clang)"
|
||||
OFF)
|
||||
|
||||
# Programs
|
||||
find_program(LLVM_COV_PATH llvm-cov)
|
||||
find_program(LLVM_PROFDATA_PATH llvm-profdata)
|
||||
find_program(LCOV_PATH lcov)
|
||||
find_program(GENHTML_PATH genhtml)
|
||||
|
||||
# Variables
|
||||
set(CMAKE_COVERAGE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/ccov)
|
||||
|
||||
# Common initialization/checks
|
||||
if(CODE_COVERAGE AND NOT CODE_COVERAGE_ADDED)
|
||||
set(CODE_COVERAGE_ADDED ON)
|
||||
|
||||
# Common Targets
|
||||
add_custom_target(
|
||||
ccov-preprocessing
|
||||
COMMAND ${CMAKE_COMMAND} -E make_directory
|
||||
${CMAKE_COVERAGE_OUTPUT_DIRECTORY}
|
||||
DEPENDS ccov-clean)
|
||||
|
||||
if(CMAKE_C_COMPILER_ID MATCHES "[Cc]lang"
|
||||
OR CMAKE_CXX_COMPILER_ID MATCHES "[Cc]lang")
|
||||
# Messages
|
||||
message(STATUS "Building with llvm Code Coverage Tools")
|
||||
|
||||
if(NOT LLVM_COV_PATH)
|
||||
message(FATAL_ERROR "llvm-cov not found! Aborting.")
|
||||
else()
|
||||
# Version number checking for 'EXCLUDE' compatibility
|
||||
execute_process(COMMAND ${LLVM_COV_PATH} --version
|
||||
OUTPUT_VARIABLE LLVM_COV_VERSION_CALL_OUTPUT)
|
||||
string(REGEX MATCH "[0-9]+\\.[0-9]+\\.[0-9]+" LLVM_COV_VERSION
|
||||
${LLVM_COV_VERSION_CALL_OUTPUT})
|
||||
|
||||
if(LLVM_COV_VERSION VERSION_LESS "7.0.0")
|
||||
message(
|
||||
WARNING
|
||||
"target_code_coverage()/add_code_coverage_all_targets() 'EXCLUDE' option only available on llvm-cov >= 7.0.0"
|
||||
)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
# Targets
|
||||
add_custom_target(
|
||||
ccov-clean
|
||||
COMMAND rm -f ${CMAKE_COVERAGE_OUTPUT_DIRECTORY}/binaries.list
|
||||
COMMAND rm -f ${CMAKE_COVERAGE_OUTPUT_DIRECTORY}/profraw.list)
|
||||
|
||||
# Used to get the shared object file list before doing the main all-
|
||||
# processing
|
||||
add_custom_target(
|
||||
ccov-libs
|
||||
COMMAND ;
|
||||
COMMENT "libs ready for coverage report.")
|
||||
|
||||
elseif(CMAKE_C_COMPILER_ID MATCHES "GNU" OR CMAKE_CXX_COMPILER_ID MATCHES "GNU")
|
||||
# Messages
|
||||
message(STATUS "Building with lcov Code Coverage Tools")
|
||||
|
||||
if(CMAKE_BUILD_TYPE)
|
||||
string(TOUPPER ${CMAKE_BUILD_TYPE} upper_build_type)
|
||||
if(NOT ${upper_build_type} STREQUAL "DEBUG")
|
||||
message(
|
||||
WARNING
|
||||
"Code coverage results with an optimized (non-Debug) build may be misleading"
|
||||
)
|
||||
endif()
|
||||
else()
|
||||
message(
|
||||
WARNING
|
||||
"Code coverage results with an optimized (non-Debug) build may be misleading"
|
||||
)
|
||||
endif()
|
||||
if(NOT LCOV_PATH)
|
||||
message(FATAL_ERROR "lcov not found! Aborting...")
|
||||
endif()
|
||||
if(NOT GENHTML_PATH)
|
||||
message(FATAL_ERROR "genhtml not found! Aborting...")
|
||||
endif()
|
||||
|
||||
# Targets
|
||||
add_custom_target(ccov-clean COMMAND ${LCOV_PATH} --directory
|
||||
${CMAKE_BINARY_DIR} --zerocounters)
|
||||
|
||||
else()
|
||||
set(CODE_COVERAGE_ADDED OFF)
|
||||
message(STATUS "Code coverage requires Clang or GCC.(${CMAKE_C_COMPILER_ID})")
|
||||
endif()
|
||||
endif()
|
||||
|
||||
# Adds code coverage instrumentation to a library, or instrumentation/targets
|
||||
# for an executable target.
|
||||
# ~~~
|
||||
# EXECUTABLE ADDED TARGETS:
|
||||
# GCOV/LCOV:
|
||||
# ccov : Generates HTML code coverage report for every target added with 'AUTO' parameter.
|
||||
# ccov-${TARGET_NAME} : Generates HTML code coverage report for the associated named target.
|
||||
# ccov-all : Generates HTML code coverage report, merging every target added with 'ALL' parameter into a single detailed report.
|
||||
#
|
||||
# LLVM-COV:
|
||||
# ccov : Generates HTML code coverage report for every target added with 'AUTO' parameter.
|
||||
# ccov-report : Generates HTML code coverage report for every target added with 'AUTO' parameter.
|
||||
# ccov-${TARGET_NAME} : Generates HTML code coverage report.
|
||||
# ccov-report-${TARGET_NAME} : Prints to command line summary per-file coverage information.
|
||||
# ccov-show-${TARGET_NAME} : Prints to command line detailed per-line coverage information.
|
||||
# ccov-all : Generates HTML code coverage report, merging every target added with 'ALL' parameter into a single detailed report.
|
||||
# ccov-all-report : Prints summary per-file coverage information for every target added with ALL' parameter to the command line.
|
||||
#
|
||||
# Required:
|
||||
# TARGET_NAME - Name of the target to generate code coverage for.
|
||||
# Optional:
|
||||
# AUTO - Adds the target to the 'ccov' target so that it can be run in a batch with others easily. Effective on executable targets.
|
||||
# ALL - Adds the target to the 'ccov-all' and 'ccov-all-report' targets, which merge several executable targets coverage data to a single report. Effective on executable targets.
|
||||
# EXTERNAL - For GCC's lcov, allows the profiling of 'external' files from the processing directory
|
||||
# EXCLUDE <REGEX_PATTERNS> - Excludes files of the patterns provided from coverage. **These do not copy to the 'all' targets.**
|
||||
# OBJECTS <TARGETS> - For executables ONLY, if the provided targets are shared libraries, adds coverage information to the output
|
||||
# ~~~
|
||||
function(target_code_coverage TARGET_NAME)
|
||||
# Argument parsing
|
||||
set(options AUTO ALL EXTERNAL)
|
||||
set(multi_value_keywords EXCLUDE OBJECTS)
|
||||
cmake_parse_arguments(target_code_coverage "${options}" ""
|
||||
"${multi_value_keywords}" ${ARGN})
|
||||
|
||||
if(CODE_COVERAGE)
|
||||
|
||||
# Add code coverage instrumentation to the target's linker command
|
||||
if(CMAKE_C_COMPILER_ID MATCHES "[Cc]lang"
|
||||
OR CMAKE_CXX_COMPILER_ID MATCHES "[Cc]lang")
|
||||
target_compile_options(${TARGET_NAME} PRIVATE -fprofile-instr-generate
|
||||
-fcoverage-mapping)
|
||||
set_property(
|
||||
TARGET ${TARGET_NAME}
|
||||
APPEND_STRING
|
||||
PROPERTY LINK_FLAGS "-fprofile-instr-generate ")
|
||||
set_property(
|
||||
TARGET ${TARGET_NAME}
|
||||
APPEND_STRING
|
||||
PROPERTY LINK_FLAGS "-fcoverage-mapping ")
|
||||
elseif(CMAKE_C_COMPILER_ID MATCHES "GNU" OR CMAKE_CXX_COMPILER_ID MATCHES "GNU")
|
||||
target_compile_options(${TARGET_NAME} PRIVATE -fprofile-arcs
|
||||
-ftest-coverage)
|
||||
target_link_libraries(${TARGET_NAME} PRIVATE gcov)
|
||||
endif()
|
||||
|
||||
# Targets
|
||||
get_target_property(target_type ${TARGET_NAME} TYPE)
|
||||
|
||||
# Add shared library to processing for 'all' targets
|
||||
if(target_type STREQUAL "SHARED_LIBRARY" AND target_code_coverage_ALL)
|
||||
if(CMAKE_C_COMPILER_ID MATCHES "[Cc]lang"
|
||||
OR CMAKE_CXX_COMPILER_ID MATCHES "[Cc]lang")
|
||||
add_custom_target(
|
||||
ccov-run-${TARGET_NAME}
|
||||
COMMAND echo "-object=$<TARGET_FILE:${TARGET_NAME}>" >>
|
||||
${CMAKE_COVERAGE_OUTPUT_DIRECTORY}/binaries.list
|
||||
DEPENDS ccov-preprocessing ${TARGET_NAME})
|
||||
|
||||
if(NOT TARGET ccov-libs)
|
||||
message(
|
||||
FATAL_ERROR
|
||||
"Calling target_code_coverage with 'ALL' must be after a call to 'add_code_coverage_all_targets'."
|
||||
)
|
||||
endif()
|
||||
|
||||
add_dependencies(ccov-libs ccov-run-${TARGET_NAME})
|
||||
endif()
|
||||
endif()
|
||||
|
||||
# For executables add targets to run and produce output
|
||||
if(target_type STREQUAL "EXECUTABLE")
|
||||
if(CMAKE_C_COMPILER_ID MATCHES "[Cc]lang"
|
||||
OR CMAKE_CXX_COMPILER_ID MATCHES "(Apple)?Cc]lang")
|
||||
|
||||
# If there are shared objects to also work with, generate the string to
|
||||
# add them here
|
||||
foreach(SO_TARGET ${target_code_coverage_OBJECTS})
|
||||
# Check to see if the target is a shared object
|
||||
if(TARGET ${SO_TARGET})
|
||||
get_target_property(SO_TARGET_TYPE ${SO_TARGET} TYPE)
|
||||
if(${SO_TARGET_TYPE} STREQUAL "SHARED_LIBRARY")
|
||||
set(SO_OBJECTS ${SO_OBJECTS} -object=$<TARGET_FILE:${SO_TARGET}>)
|
||||
endif()
|
||||
endif()
|
||||
endforeach()
|
||||
|
||||
# Run the executable, generating raw profile data
|
||||
add_custom_target(
|
||||
ccov-run-${TARGET_NAME}
|
||||
COMMAND LLVM_PROFILE_FILE=${TARGET_NAME}.profraw
|
||||
$<TARGET_FILE:${TARGET_NAME}>
|
||||
COMMAND echo "-object=$<TARGET_FILE:${TARGET_NAME}>" >>
|
||||
${CMAKE_COVERAGE_OUTPUT_DIRECTORY}/binaries.list
|
||||
COMMAND echo "${CMAKE_CURRENT_BINARY_DIR}/${TARGET_NAME}.profraw " >>
|
||||
${CMAKE_COVERAGE_OUTPUT_DIRECTORY}/profraw.list
|
||||
DEPENDS ccov-preprocessing ccov-libs ${TARGET_NAME})
|
||||
|
||||
# Merge the generated profile data so llvm-cov can process it
|
||||
add_custom_target(
|
||||
ccov-processing-${TARGET_NAME}
|
||||
COMMAND ${LLVM_PROFDATA_PATH} merge -sparse ${TARGET_NAME}.profraw -o
|
||||
${TARGET_NAME}.profdata
|
||||
DEPENDS ccov-run-${TARGET_NAME})
|
||||
|
||||
# Ignore regex only works on LLVM >= 7
|
||||
if(LLVM_COV_VERSION VERSION_GREATER_EQUAL "7.0.0")
|
||||
foreach(EXCLUDE_ITEM ${target_code_coverage_EXCLUDE})
|
||||
set(EXCLUDE_REGEX ${EXCLUDE_REGEX}
|
||||
-ignore-filename-regex='${EXCLUDE_ITEM}')
|
||||
endforeach()
|
||||
endif()
|
||||
|
||||
# Print out details of the coverage information to the command line
|
||||
add_custom_target(
|
||||
ccov-show-${TARGET_NAME}
|
||||
COMMAND
|
||||
${LLVM_COV_PATH} show $<TARGET_FILE:${TARGET_NAME}> ${SO_OBJECTS}
|
||||
-instr-profile=${TARGET_NAME}.profdata -show-line-counts-or-regions
|
||||
${EXCLUDE_REGEX}
|
||||
DEPENDS ccov-processing-${TARGET_NAME})
|
||||
|
||||
# Print out a summary of the coverage information to the command line
|
||||
add_custom_target(
|
||||
ccov-report-${TARGET_NAME}
|
||||
COMMAND ${LLVM_COV_PATH} report $<TARGET_FILE:${TARGET_NAME}>
|
||||
${SO_OBJECTS} -instr-profile=${TARGET_NAME}.profdata
|
||||
${EXCLUDE_REGEX}
|
||||
DEPENDS ccov-processing-${TARGET_NAME})
|
||||
|
||||
# Generates HTML output of the coverage information for perusal
|
||||
add_custom_target(
|
||||
ccov-${TARGET_NAME}
|
||||
COMMAND
|
||||
${LLVM_COV_PATH} show $<TARGET_FILE:${TARGET_NAME}> ${SO_OBJECTS}
|
||||
-instr-profile=${TARGET_NAME}.profdata -show-line-counts-or-regions
|
||||
-output-dir=${CMAKE_COVERAGE_OUTPUT_DIRECTORY}/${TARGET_NAME}
|
||||
-format="html" ${EXCLUDE_REGEX}
|
||||
DEPENDS ccov-processing-${TARGET_NAME})
|
||||
|
||||
elseif(CMAKE_C_COMPILER_ID MATCHES "GNU" OR CMAKE_CXX_COMPILER_ID MATCHES "GNU")
|
||||
set(COVERAGE_INFO
|
||||
"${CMAKE_COVERAGE_OUTPUT_DIRECTORY}/${TARGET_NAME}.info")
|
||||
|
||||
# Run the executable, generating coverage information
|
||||
add_custom_target(
|
||||
ccov-run-${TARGET_NAME}
|
||||
COMMAND $<TARGET_FILE:${TARGET_NAME}>
|
||||
DEPENDS ccov-preprocessing ${TARGET_NAME})
|
||||
|
||||
# Generate exclusion string for use
|
||||
foreach(EXCLUDE_ITEM ${target_code_coverage_EXCLUDE})
|
||||
set(EXCLUDE_REGEX ${EXCLUDE_REGEX} --remove ${COVERAGE_INFO}
|
||||
'${EXCLUDE_ITEM}')
|
||||
endforeach()
|
||||
|
||||
if(EXCLUDE_REGEX)
|
||||
set(EXCLUDE_COMMAND ${LCOV_PATH} ${EXCLUDE_REGEX} --output-file
|
||||
${COVERAGE_INFO})
|
||||
else()
|
||||
set(EXCLUDE_COMMAND ;)
|
||||
endif()
|
||||
|
||||
if(NOT ${target_code_coverage_EXTERNAL})
|
||||
set(EXTERNAL_OPTION --no-external)
|
||||
endif()
|
||||
|
||||
# Capture coverage data
|
||||
add_custom_target(
|
||||
ccov-capture-${TARGET_NAME}
|
||||
COMMAND ${CMAKE_COMMAND} -E remove ${COVERAGE_INFO}
|
||||
COMMAND ${LCOV_PATH} --directory ${CMAKE_BINARY_DIR} --zerocounters
|
||||
COMMAND $<TARGET_FILE:${TARGET_NAME}>
|
||||
COMMAND
|
||||
${LCOV_PATH} --directory ${CMAKE_BINARY_DIR} --base-directory
|
||||
${CMAKE_SOURCE_DIR} --capture ${EXTERNAL_OPTION} --output-file
|
||||
${COVERAGE_INFO}
|
||||
COMMAND ${EXCLUDE_COMMAND}
|
||||
DEPENDS ccov-preprocessing ${TARGET_NAME})
|
||||
|
||||
# Generates HTML output of the coverage information for perusal
|
||||
add_custom_target(
|
||||
ccov-${TARGET_NAME}
|
||||
COMMAND ${GENHTML_PATH} -o
|
||||
${CMAKE_COVERAGE_OUTPUT_DIRECTORY}/${TARGET_NAME}
|
||||
${COVERAGE_INFO}
|
||||
DEPENDS ccov-capture-${TARGET_NAME})
|
||||
endif()
|
||||
|
||||
add_custom_command(
|
||||
TARGET ccov-${TARGET_NAME}
|
||||
POST_BUILD
|
||||
COMMAND ;
|
||||
COMMENT
|
||||
"Open ${CMAKE_COVERAGE_OUTPUT_DIRECTORY}/${TARGET_NAME}/index.html in your browser to view the coverage report."
|
||||
)
|
||||
|
||||
# AUTO
|
||||
if(target_code_coverage_AUTO)
|
||||
if(NOT TARGET ccov)
|
||||
add_custom_target(ccov)
|
||||
endif()
|
||||
add_dependencies(ccov ccov-${TARGET_NAME})
|
||||
|
||||
if(NOT CMAKE_COMPILER_IS_GNUCXX)
|
||||
if(NOT TARGET ccov-report)
|
||||
add_custom_target(ccov-report)
|
||||
endif()
|
||||
add_dependencies(ccov-report ccov-report-${TARGET_NAME})
|
||||
endif()
|
||||
endif()
|
||||
|
||||
# ALL
|
||||
if(target_code_coverage_ALL)
|
||||
if(NOT TARGET ccov-all-processing)
|
||||
message(
|
||||
FATAL_ERROR
|
||||
"Calling target_code_coverage with 'ALL' must be after a call to 'add_code_coverage_all_targets'."
|
||||
)
|
||||
endif()
|
||||
|
||||
add_dependencies(ccov-all-processing ccov-run-${TARGET_NAME})
|
||||
endif()
|
||||
endif()
|
||||
endif()
|
||||
endfunction()
|
||||
|
||||
# Adds code coverage instrumentation to all targets in the current directory and
|
||||
# any subdirectories. To add coverage instrumentation to only specific targets,
|
||||
# use `target_code_coverage`.
|
||||
function(add_code_coverage)
|
||||
if(CMAKE_C_COMPILER_ID MATCHES "[Cc]lang"
|
||||
OR CMAKE_CXX_COMPILER_ID MATCHES "[Cc]lang")
|
||||
add_compile_options(-fprofile-instr-generate -fcoverage-mapping)
|
||||
add_link_options(-fprofile-instr-generate -fcoverage-mapping)
|
||||
elseif(CMAKE_C_COMPILER_ID MATCHES "GNU" OR CMAKE_CXX_COMPILER_ID MATCHES "GNU")
|
||||
add_compile_options(-fprofile-arcs -ftest-coverage)
|
||||
link_libraries(gcov)
|
||||
endif()
|
||||
endfunction()
|
||||
|
||||
# Adds the 'ccov-all' type targets that calls all targets added via
|
||||
# `target_code_coverage` with the `ALL` parameter, but merges all the coverage
|
||||
# data from them into a single large report instead of the numerous smaller
|
||||
# reports. Also adds the ccov-all-capture Generates an all-merged.info file, for
|
||||
# use with coverage dashboards (e.g. codecov.io, coveralls).
|
||||
# ~~~
|
||||
# Optional:
|
||||
# EXCLUDE <REGEX_PATTERNS> - Excludes files of the regex patterns provided from coverage.
|
||||
# ~~~
|
||||
function(add_code_coverage_all_targets)
|
||||
# Argument parsing
|
||||
set(multi_value_keywords EXCLUDE)
|
||||
cmake_parse_arguments(add_code_coverage_all_targets "" ""
|
||||
"${multi_value_keywords}" ${ARGN})
|
||||
|
||||
if(CODE_COVERAGE)
|
||||
if(CMAKE_C_COMPILER_ID MATCHES "[Cc]lang"
|
||||
OR CMAKE_CXX_COMPILER_ID MATCHES "[Cc]lang")
|
||||
|
||||
# Merge the profile data for all of the run executables
|
||||
add_custom_target(
|
||||
ccov-all-processing
|
||||
COMMAND
|
||||
${LLVM_PROFDATA_PATH} merge -o
|
||||
${CMAKE_COVERAGE_OUTPUT_DIRECTORY}/all-merged.profdata -sparse `cat
|
||||
${CMAKE_COVERAGE_OUTPUT_DIRECTORY}/profraw.list`)
|
||||
|
||||
# Regex exclude only available for LLVM >= 7
|
||||
if(LLVM_COV_VERSION VERSION_GREATER_EQUAL "7.0.0")
|
||||
foreach(EXCLUDE_ITEM ${add_code_coverage_all_targets_EXCLUDE})
|
||||
set(EXCLUDE_REGEX ${EXCLUDE_REGEX}
|
||||
-ignore-filename-regex='${EXCLUDE_ITEM}')
|
||||
endforeach()
|
||||
endif()
|
||||
|
||||
# Print summary of the code coverage information to the command line
|
||||
add_custom_target(
|
||||
ccov-all-report
|
||||
COMMAND
|
||||
${LLVM_COV_PATH} report `cat
|
||||
${CMAKE_COVERAGE_OUTPUT_DIRECTORY}/binaries.list`
|
||||
-instr-profile=${CMAKE_COVERAGE_OUTPUT_DIRECTORY}/all-merged.profdata
|
||||
${EXCLUDE_REGEX}
|
||||
DEPENDS ccov-all-processing)
|
||||
|
||||
# Export coverage information so continuous integration tools (e.g.
|
||||
# Jenkins) can consume it
|
||||
add_custom_target(
|
||||
ccov-all-export
|
||||
COMMAND
|
||||
${LLVM_COV_PATH} export `cat
|
||||
${CMAKE_COVERAGE_OUTPUT_DIRECTORY}/binaries.list`
|
||||
-instr-profile=${CMAKE_COVERAGE_OUTPUT_DIRECTORY}/all-merged.profdata
|
||||
-format="text" ${EXCLUDE_REGEX} >
|
||||
${CMAKE_COVERAGE_OUTPUT_DIRECTORY}/coverage.json
|
||||
DEPENDS ccov-all-processing)
|
||||
|
||||
# Generate HTML output of all added targets for perusal
|
||||
add_custom_target(
|
||||
ccov-all
|
||||
COMMAND
|
||||
${LLVM_COV_PATH} show `cat
|
||||
${CMAKE_COVERAGE_OUTPUT_DIRECTORY}/binaries.list`
|
||||
-instr-profile=${CMAKE_COVERAGE_OUTPUT_DIRECTORY}/all-merged.profdata
|
||||
-show-line-counts-or-regions
|
||||
-output-dir=${CMAKE_COVERAGE_OUTPUT_DIRECTORY}/all-merged
|
||||
-format="html" ${EXCLUDE_REGEX}
|
||||
DEPENDS ccov-all-processing)
|
||||
|
||||
elseif(CMAKE_C_COMPILER_ID MATCHES "GNU" OR CMAKE_CXX_COMPILER_ID MATCHES "GNU")
|
||||
set(COVERAGE_INFO "${CMAKE_COVERAGE_OUTPUT_DIRECTORY}/all-merged.info")
|
||||
|
||||
# Nothing required for gcov
|
||||
add_custom_target(ccov-all-processing COMMAND ;)
|
||||
|
||||
# Exclusion regex string creation
|
||||
foreach(EXCLUDE_ITEM ${add_code_coverage_all_targets_EXCLUDE})
|
||||
set(EXCLUDE_REGEX ${EXCLUDE_REGEX} --remove ${COVERAGE_INFO}
|
||||
'${EXCLUDE_ITEM}')
|
||||
endforeach()
|
||||
|
||||
if(EXCLUDE_REGEX)
|
||||
set(EXCLUDE_COMMAND ${LCOV_PATH} ${EXCLUDE_REGEX} --output-file
|
||||
${COVERAGE_INFO})
|
||||
else()
|
||||
set(EXCLUDE_COMMAND ;)
|
||||
endif()
|
||||
|
||||
# Capture coverage data
|
||||
add_custom_target(
|
||||
ccov-all-capture
|
||||
COMMAND ${CMAKE_COMMAND} -E remove ${COVERAGE_INFO}
|
||||
COMMAND ${LCOV_PATH} --directory ${CMAKE_BINARY_DIR} --capture
|
||||
--output-file ${COVERAGE_INFO}
|
||||
COMMAND ${EXCLUDE_COMMAND}
|
||||
DEPENDS ccov-all-processing)
|
||||
|
||||
# Generates HTML output of all targets for perusal
|
||||
add_custom_target(
|
||||
ccov-all
|
||||
COMMAND ${GENHTML_PATH} -o ${CMAKE_COVERAGE_OUTPUT_DIRECTORY}/all-merged
|
||||
${COVERAGE_INFO}
|
||||
DEPENDS ccov-all-capture)
|
||||
|
||||
endif()
|
||||
|
||||
add_custom_command(
|
||||
TARGET ccov-all
|
||||
POST_BUILD
|
||||
COMMAND ;
|
||||
COMMENT
|
||||
"Open ${CMAKE_COVERAGE_OUTPUT_DIRECTORY}/all-merged/index.html in your browser to view the coverage report."
|
||||
)
|
||||
endif()
|
||||
endfunction()
|
||||
@@ -0,0 +1,96 @@
|
||||
#
|
||||
# Copyright (C) 2018 by George Cave - gcave@stablecoder.ca
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License"); you may not
|
||||
# use this file except in compliance with the License. You may obtain a copy of
|
||||
# the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
||||
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
||||
# License for the specific language governing permissions and limitations under
|
||||
# the License.
|
||||
|
||||
set(USE_SANITIZER
|
||||
""
|
||||
CACHE
|
||||
STRING
|
||||
"Compile with a sanitizer. Options are: Address, Memory, MemoryWithOrigins, Undefined, Thread, Leak, 'Address;Undefined'"
|
||||
)
|
||||
|
||||
function(append value)
|
||||
foreach(variable ${ARGN})
|
||||
set(${variable}
|
||||
"${${variable}} ${value}"
|
||||
PARENT_SCOPE)
|
||||
endforeach(variable)
|
||||
endfunction()
|
||||
|
||||
if(USE_SANITIZER)
|
||||
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
|
||||
|
||||
append("-fno-omit-frame-pointer" CMAKE_C_FLAGS CMAKE_CXX_FLAGS)
|
||||
|
||||
if(UNIX)
|
||||
|
||||
if(uppercase_CMAKE_BUILD_TYPE STREQUAL "DEBUG")
|
||||
append("-O1" CMAKE_C_FLAGS CMAKE_CXX_FLAGS)
|
||||
endif()
|
||||
|
||||
if(USE_SANITIZER MATCHES "([Aa]ddress);([Uu]ndefined)"
|
||||
OR USE_SANITIZER MATCHES "([Uu]ndefined);([Aa]ddress)")
|
||||
message(STATUS "Building with Address, Undefined sanitizers")
|
||||
append("-fsanitize=address,undefined" CMAKE_C_FLAGS CMAKE_CXX_FLAGS)
|
||||
set(MEMCHECK_TYPE AddressSanitizer)
|
||||
elseif(USE_SANITIZER MATCHES "([Aa]ddress)")
|
||||
# Optional: -fno-optimize-sibling-calls -fsanitize-address-use-after-scope
|
||||
message(STATUS "Building with Address sanitizer")
|
||||
append("-fsanitize=address" CMAKE_C_FLAGS CMAKE_CXX_FLAGS)
|
||||
set(MEMCHECK_TYPE AddressSanitizer)
|
||||
elseif(USE_SANITIZER MATCHES "([Mm]emory([Ww]ith[Oo]rigins)?)")
|
||||
# Optional: -fno-optimize-sibling-calls -fsanitize-memory-track-origins=2
|
||||
append("-fsanitize=memory" CMAKE_C_FLAGS CMAKE_CXX_FLAGS)
|
||||
if(USE_SANITIZER MATCHES "([Mm]emory[Ww]ith[Oo]rigins)")
|
||||
message(STATUS "Building with MemoryWithOrigins sanitizer")
|
||||
append("-fsanitize-memory-track-origins" CMAKE_C_FLAGS CMAKE_CXX_FLAGS)
|
||||
else()
|
||||
message(STATUS "Building with Memory sanitizer")
|
||||
endif()
|
||||
set(MEMCHECK_TYPE MemorySanitizer)
|
||||
elseif(USE_SANITIZER MATCHES "([Uu]ndefined)")
|
||||
message(STATUS "Building with Undefined sanitizer")
|
||||
append("-fsanitize=undefined" CMAKE_C_FLAGS CMAKE_CXX_FLAGS)
|
||||
if(EXISTS "${BLACKLIST_FILE}")
|
||||
append("-fsanitize-blacklist=${BLACKLIST_FILE}" CMAKE_C_FLAGS
|
||||
CMAKE_CXX_FLAGS)
|
||||
endif()
|
||||
set(MEMCHECK_TYPE UndefinedBehaviorSanitizer)
|
||||
elseif(USE_SANITIZER MATCHES "([Tt]hread)")
|
||||
message(STATUS "Building with Thread sanitizer")
|
||||
append("-fsanitize=thread" CMAKE_C_FLAGS CMAKE_CXX_FLAGS)
|
||||
set(MEMCHECK_TYPE ThreadSanitizer)
|
||||
elseif(USE_SANITIZER MATCHES "([Ll]eak)")
|
||||
message(STATUS "Building with Leak sanitizer")
|
||||
append("-fsanitize=leak" CMAKE_C_FLAGS CMAKE_CXX_FLAGS)
|
||||
set(MEMCHECK_TYPE LeakSanitizer)
|
||||
else()
|
||||
message(
|
||||
FATAL_ERROR "Unsupported value of USE_SANITIZER: ${USE_SANITIZER}")
|
||||
endif()
|
||||
elseif(MSVC)
|
||||
if(USE_SANITIZER MATCHES "([Aa]ddress)")
|
||||
message(STATUS "Building with Address sanitizer")
|
||||
append("-fsanitize=address" CMAKE_C_FLAGS CMAKE_CXX_FLAGS)
|
||||
else()
|
||||
message(
|
||||
FATAL_ERROR
|
||||
"This sanitizer not yet supported in the MSVC environment: ${USE_SANITIZER}"
|
||||
)
|
||||
endif()
|
||||
else()
|
||||
message(FATAL_ERROR "USE_SANITIZER is not supported on this platform.")
|
||||
endif()
|
||||
|
||||
endif()
|
||||
@@ -0,0 +1,111 @@
|
||||
#
|
||||
# Copyright (C) 2018 by George Cave - gcave@stablecoder.ca
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License"); you may not
|
||||
# use this file except in compliance with the License. You may obtain a copy of
|
||||
# the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
||||
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
||||
# License for the specific language governing permissions and limitations under
|
||||
# the License.
|
||||
|
||||
option(CLANG_TIDY "Turns on clang-tidy processing if it is found." OFF)
|
||||
option(IWYU "Turns on include-what-you-use processing if it is found." OFF)
|
||||
option(CPPCHECK "Turns on cppcheck processing if it is found." OFF)
|
||||
|
||||
# Adds clang-tidy checks to the compilation, with the given arguments being used
|
||||
# as the options set.
|
||||
macro(clang_tidy)
|
||||
if(CLANG_TIDY AND CLANG_TIDY_EXE)
|
||||
set(CMAKE_CXX_CLANG_TIDY ${CLANG_TIDY_EXE} ${ARGN})
|
||||
endif()
|
||||
endmacro()
|
||||
|
||||
# Adds include_what_you_use to the compilation, with the given arguments being
|
||||
# used as the options set.
|
||||
macro(include_what_you_use)
|
||||
if(IWYU AND IWYU_EXE)
|
||||
set(CMAKE_CXX_INCLUDE_WHAT_YOU_USE "${IWYU_EXE};${IWYU_STRING}")
|
||||
endif()
|
||||
endmacro()
|
||||
|
||||
# Adds cppcheck to the compilation, with the given arguments being used as the
|
||||
# options set.
|
||||
macro(cppcheck)
|
||||
if(CPPCHECK AND CPPCHECK_EXE)
|
||||
set(CMAKE_CXX_CPPCHECK "${CPPCHECK_EXE};${CPPCHECK_STRING}")
|
||||
endif()
|
||||
endmacro()
|
||||
|
||||
find_program(CLANG_TIDY_EXE NAMES "clang-tidy")
|
||||
if(CLANG_TIDY_EXE)
|
||||
message(STATUS "clang-tidy found: ${CLANG_TIDY_EXE}")
|
||||
if(NOT CLANG_TIDY)
|
||||
message(STATUS "clang-tidy NOT ENABLED via 'CLANG_TIDY' variable!")
|
||||
set(CMAKE_CXX_CLANG_TIDY
|
||||
""
|
||||
CACHE STRING "" FORCE) # delete it
|
||||
endif()
|
||||
elseif(CLANG_TIDY)
|
||||
message(SEND_ERROR "Cannot enable clang-tidy, as executable not found!")
|
||||
set(CMAKE_CXX_CLANG_TIDY
|
||||
""
|
||||
CACHE STRING "" FORCE) # delete it
|
||||
else()
|
||||
message(STATUS "clang-tidy not found!")
|
||||
set(CMAKE_CXX_CLANG_TIDY
|
||||
""
|
||||
CACHE STRING "" FORCE) # delete it
|
||||
endif()
|
||||
|
||||
find_program(IWYU_EXE NAMES "include-what-you-use")
|
||||
if(IWYU_EXE)
|
||||
message(STATUS "include-what-you-use found: ${IWYU_EXE}")
|
||||
if(NOT IWYU)
|
||||
message(STATUS "include-what-you-use NOT ENABLED via 'IWYU' variable!")
|
||||
set(CMAKE_CXX_INCLUDE_WHAT_YOU_USE
|
||||
""
|
||||
CACHE STRING "" FORCE) # delete it
|
||||
endif()
|
||||
elseif(IWYU)
|
||||
message(
|
||||
SEND_ERROR "Cannot enable include-what-you-use, as executable not found!")
|
||||
set(CMAKE_CXX_INCLUDE_WHAT_YOU_USE
|
||||
""
|
||||
CACHE STRING "" FORCE) # delete it
|
||||
else()
|
||||
message(STATUS "include-what-you-use not found!")
|
||||
set(CMAKE_CXX_INCLUDE_WHAT_YOU_USE
|
||||
""
|
||||
CACHE STRING "" FORCE) # delete it
|
||||
endif()
|
||||
|
||||
find_program(CPPCHECK_EXE NAMES "cppcheck")
|
||||
if(CPPCHECK_EXE)
|
||||
message(STATUS "cppcheck found: ${CPPCHECK_EXE}")
|
||||
if(CPPECHECK)
|
||||
set(CMAKE_CXX_CPPCHECK
|
||||
"${CPPCHECK_EXE};--enable=warning,performance,portability,missingInclude;--template=\"[{severity}][{id}] {message} {callstack} \(On {file}:{line}\)\";--suppress=missingIncludeSystem;--quiet;--verbose;--force"
|
||||
)
|
||||
endif()
|
||||
if(NOT CPPCHECK)
|
||||
message(STATUS "cppcheck NOT ENABLED via 'CPPCHECK' variable!")
|
||||
set(CMAKE_CXX_CPPCHECK
|
||||
""
|
||||
CACHE STRING "" FORCE) # delete it
|
||||
endif()
|
||||
elseif(CPPCHECK)
|
||||
message(SEND_ERROR "Cannot enable cppcheck, as executable not found!")
|
||||
set(CMAKE_CXX_CPPCHECK
|
||||
""
|
||||
CACHE STRING "" FORCE) # delete it
|
||||
else()
|
||||
message(STATUS "cppcheck not found!")
|
||||
set(CMAKE_CXX_CPPCHECK
|
||||
""
|
||||
CACHE STRING "" FORCE) # delete it
|
||||
endif()
|
||||
@@ -67,6 +67,6 @@ if (H5_HAVE_PARALLEL)
|
||||
set_target_properties (ph5example PROPERTIES FOLDER examples)
|
||||
endif ()
|
||||
|
||||
if (BUILD_TESTING)
|
||||
if (BUILD_TESTING AND HDF5_TEST_EXAMPLES)
|
||||
include (CMakeTests.cmake)
|
||||
endif ()
|
||||
|
||||
+31
-29
@@ -64,38 +64,40 @@ set (test_ex_CLEANFILES
|
||||
vds-eiger.h5
|
||||
)
|
||||
|
||||
# Remove any output file left over from previous test run
|
||||
add_test (
|
||||
NAME EXAMPLES-clear-objects
|
||||
COMMAND ${CMAKE_COMMAND} -E remove ${test_ex_CLEANFILES}
|
||||
)
|
||||
set_tests_properties (EXAMPLES-clear-objects PROPERTIES FIXTURES_SETUP clear_EXAMPLES)
|
||||
if (HDF5_TEST_SERIAL)
|
||||
# Remove any output file left over from previous test run
|
||||
add_test (
|
||||
NAME EXAMPLES-clear-objects
|
||||
COMMAND ${CMAKE_COMMAND} -E remove ${test_ex_CLEANFILES}
|
||||
)
|
||||
set_tests_properties (EXAMPLES-clear-objects PROPERTIES FIXTURES_SETUP clear_EXAMPLES)
|
||||
|
||||
foreach (example ${examples})
|
||||
if (HDF5_ENABLE_USING_MEMCHECKER)
|
||||
add_test (NAME EXAMPLES-${example} COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:${example}>)
|
||||
else ()
|
||||
add_test (NAME EXAMPLES-${example} COMMAND "${CMAKE_COMMAND}"
|
||||
-D "TEST_EMULATOR=${CMAKE_CROSSCOMPILING_EMULATOR}"
|
||||
-D "TEST_PROGRAM=$<TARGET_FILE:${example}>"
|
||||
-D "TEST_ARGS:STRING="
|
||||
-D "TEST_EXPECT=0"
|
||||
-D "TEST_SKIP_COMPARE=TRUE"
|
||||
-D "TEST_OUTPUT=${example}.txt"
|
||||
#-D "TEST_REFERENCE=${example}.out"
|
||||
-D "TEST_FOLDER=${PROJECT_BINARY_DIR}"
|
||||
-P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake"
|
||||
)
|
||||
endif ()
|
||||
set_tests_properties (EXAMPLES-${example} PROPERTIES FIXTURES_REQUIRED clear_EXAMPLES)
|
||||
if (last_test)
|
||||
set_tests_properties (EXAMPLES-${example} PROPERTIES DEPENDS ${last_test})
|
||||
endif ()
|
||||
set (last_test "EXAMPLES-${example}")
|
||||
endforeach ()
|
||||
foreach (example ${examples})
|
||||
if (HDF5_ENABLE_USING_MEMCHECKER)
|
||||
add_test (NAME EXAMPLES-${example} COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:${example}>)
|
||||
else ()
|
||||
add_test (NAME EXAMPLES-${example} COMMAND "${CMAKE_COMMAND}"
|
||||
-D "TEST_EMULATOR=${CMAKE_CROSSCOMPILING_EMULATOR}"
|
||||
-D "TEST_PROGRAM=$<TARGET_FILE:${example}>"
|
||||
-D "TEST_ARGS:STRING="
|
||||
-D "TEST_EXPECT=0"
|
||||
-D "TEST_SKIP_COMPARE=TRUE"
|
||||
-D "TEST_OUTPUT=${example}.txt"
|
||||
#-D "TEST_REFERENCE=${example}.out"
|
||||
-D "TEST_FOLDER=${PROJECT_BINARY_DIR}"
|
||||
-P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake"
|
||||
)
|
||||
endif ()
|
||||
set_tests_properties (EXAMPLES-${example} PROPERTIES FIXTURES_REQUIRED clear_EXAMPLES)
|
||||
if (last_test)
|
||||
set_tests_properties (EXAMPLES-${example} PROPERTIES DEPENDS ${last_test})
|
||||
endif ()
|
||||
set (last_test "EXAMPLES-${example}")
|
||||
endforeach ()
|
||||
endif ()
|
||||
|
||||
### Windows pops up a modal permission dialog on this test
|
||||
if (H5_HAVE_PARALLEL AND NOT WIN32)
|
||||
if (H5_HAVE_PARALLEL AND HDF5_TEST_PARALLEL AND NOT WIN32)
|
||||
if (HDF5_ENABLE_USING_MEMCHECKER)
|
||||
add_test (NAME MPI_TEST_EXAMPLES-ph5example COMMAND ${MPIEXEC_EXECUTABLE} ${MPIEXEC_NUMPROC_FLAG} ${MPIEXEC_MAX_NUMPROCS} ${MPIEXEC_PREFLAGS} $<TARGET_FILE:ph5example> ${MPIEXEC_POSTFLAGS})
|
||||
else ()
|
||||
|
||||
@@ -60,7 +60,7 @@ main (void)
|
||||
float matrix[ADIM1][ADIM2]; /* Attribute data */
|
||||
|
||||
herr_t ret; /* Return value */
|
||||
H5O_info_t oinfo; /* Object info */
|
||||
H5O_info2_t oinfo; /* Object info */
|
||||
unsigned i, j; /* Counters */
|
||||
char string_out[80]; /* Buffer to read string attribute back */
|
||||
int point_out; /* Buffer to read scalar attribute back */
|
||||
@@ -189,7 +189,7 @@ main (void)
|
||||
/*
|
||||
* Find string attribute by iterating through all attributes
|
||||
*/
|
||||
ret = H5Oget_info2(dataset, &oinfo, H5O_INFO_ALL);
|
||||
ret = H5Oget_info3(dataset, &oinfo, H5O_INFO_NUM_ATTRS);
|
||||
for(i = 0; i < (unsigned)oinfo.num_attrs; i++) {
|
||||
attr = H5Aopen_by_idx(dataset, ".", H5_INDEX_CRT_ORDER, H5_ITER_INC, (hsize_t)i, H5P_DEFAULT, H5P_DEFAULT);
|
||||
atype = H5Aget_type(attr);
|
||||
|
||||
+24
-24
@@ -316,7 +316,7 @@ static void hard_link_example(void)
|
||||
{
|
||||
hid_t file_id;
|
||||
hid_t group_id;
|
||||
H5L_info_t li;
|
||||
H5L_info2_t li;
|
||||
/* Define the link class that we'll use to register "user-defined hard
|
||||
* links" using the callbacks we defined above.
|
||||
* A link class can have NULL for any callback except its traverse
|
||||
@@ -361,13 +361,13 @@ static void hard_link_example(void)
|
||||
* the target group's address. We do this by calling H5Lget_info
|
||||
* on a hard link to the object.
|
||||
*/
|
||||
H5Lget_info(file_id, TARGET_GROUP, &li, H5P_DEFAULT);
|
||||
H5Lget_info2(file_id, TARGET_GROUP, &li, H5P_DEFAULT);
|
||||
|
||||
/* Now create a user-defined link. We give it the group's address
|
||||
* as its udata.
|
||||
*/
|
||||
H5Lcreate_ud(file_id, UD_HARD_LINK_NAME, (H5L_type_t)UD_HARD_CLASS, &(li.u.address),
|
||||
sizeof(li.u.address), H5P_DEFAULT, H5P_DEFAULT);
|
||||
H5Lcreate_ud(file_id, UD_HARD_LINK_NAME, (H5L_type_t)UD_HARD_CLASS, &(li.u.token),
|
||||
sizeof(H5O_token_t), H5P_DEFAULT, H5P_DEFAULT);
|
||||
|
||||
/* The UD hard link has now incremented the group's reference count
|
||||
* like a normal hard link would. This means that we can unlink the
|
||||
@@ -404,23 +404,23 @@ static void hard_link_example(void)
|
||||
static herr_t UD_hard_create(const char *link_name, hid_t loc_group,
|
||||
const void *udata, size_t udata_size, hid_t lcpl_id)
|
||||
{
|
||||
haddr_t addr;
|
||||
hid_t target_obj = -1;
|
||||
H5O_token_t token;
|
||||
hid_t target_obj = H5I_INVALID_HID;
|
||||
herr_t ret_value = 0;
|
||||
|
||||
/* Make sure that the address passed in looks valid */
|
||||
if(udata_size != sizeof(haddr_t))
|
||||
if(udata_size != sizeof(H5O_token_t))
|
||||
{
|
||||
ret_value = -1;
|
||||
goto done;
|
||||
}
|
||||
|
||||
addr = *((const haddr_t *) udata);
|
||||
token = *((H5O_token_t *) udata);
|
||||
|
||||
/* Open the object this link points to so that we can increment
|
||||
* its reference count. This also ensures that the address passed
|
||||
* its reference count. This also ensures that the token passed
|
||||
* in points to a real object (although this check is not perfect!) */
|
||||
target_obj= H5Oopen_by_addr(loc_group, addr);
|
||||
target_obj = H5Oopen_by_token(loc_group, token);
|
||||
if(target_obj < 0)
|
||||
{
|
||||
ret_value = -1;
|
||||
@@ -448,23 +448,23 @@ done:
|
||||
static herr_t UD_hard_delete(const char *link_name, hid_t loc_group,
|
||||
const void *udata, size_t udata_size)
|
||||
{
|
||||
haddr_t addr;
|
||||
hid_t target_obj = -1;
|
||||
H5O_token_t token;
|
||||
hid_t target_obj = H5I_INVALID_HID;
|
||||
herr_t ret_value = 0;
|
||||
|
||||
/* Sanity check; we have already verified the udata's size in the creation
|
||||
* callback.
|
||||
*/
|
||||
if(udata_size != sizeof(haddr_t))
|
||||
if(udata_size != sizeof(H5O_token_t))
|
||||
{
|
||||
ret_value = -1;
|
||||
goto done;
|
||||
}
|
||||
|
||||
addr = *((const haddr_t *) udata);
|
||||
token = *((H5O_token_t *) udata);
|
||||
|
||||
/* Open the object this link points to */
|
||||
target_obj= H5Oopen_by_addr(loc_group, addr);
|
||||
target_obj = H5Oopen_by_token(loc_group, token);
|
||||
if(target_obj < 0)
|
||||
{
|
||||
ret_value = -1;
|
||||
@@ -492,21 +492,21 @@ done:
|
||||
static hid_t UD_hard_traverse(const char *link_name, hid_t cur_group,
|
||||
const void *udata, size_t udata_size, hid_t lapl_id, hid_t dxpl_id)
|
||||
{
|
||||
haddr_t addr;
|
||||
hid_t ret_value = -1;
|
||||
H5O_token_t token;
|
||||
hid_t ret_value = H5I_INVALID_HID;
|
||||
|
||||
/* Sanity check; we have already verified the udata's size in the creation
|
||||
* callback.
|
||||
*/
|
||||
if(udata_size != sizeof(haddr_t))
|
||||
return -1;
|
||||
if(udata_size != sizeof(H5O_token_t))
|
||||
return H5I_INVALID_HID;
|
||||
|
||||
addr = *((const haddr_t *) udata);
|
||||
token = *((H5O_token_t *) udata);
|
||||
|
||||
/* Open the object by address. If H5Oopen_by_addr fails, ret_value will
|
||||
/* Open the object by token. If H5Oopen_by_token fails, ret_value will
|
||||
* be negative to indicate that the traversal function failed.
|
||||
*/
|
||||
ret_value = H5Oopen_by_addr(cur_group, addr);
|
||||
ret_value = H5Oopen_by_token(cur_group, token);
|
||||
|
||||
return ret_value;
|
||||
}
|
||||
@@ -621,7 +621,7 @@ static hid_t UD_plist_traverse(const char *link_name, hid_t cur_group,
|
||||
const void *udata, size_t udata_size, hid_t lapl_id, hid_t dxpl_id)
|
||||
{
|
||||
char * path;
|
||||
hid_t ret_value = -1;
|
||||
hid_t ret_value = H5I_INVALID_HID;
|
||||
|
||||
/* If the link property isn't set or can't be found, traversal fails. */
|
||||
if(H5Pexist(lapl_id, PLIST_LINK_PROP) < 0)
|
||||
@@ -638,7 +638,7 @@ static hid_t UD_plist_traverse(const char *link_name, hid_t cur_group,
|
||||
return ret_value;
|
||||
|
||||
error:
|
||||
return -1;
|
||||
return H5I_INVALID_HID;
|
||||
}
|
||||
|
||||
|
||||
|
||||
+7
-7
@@ -26,9 +26,9 @@
|
||||
#define H5FILE_NAME "group.h5"
|
||||
#define RANK 2
|
||||
|
||||
static herr_t file_info(hid_t loc_id, const char *name, const H5L_info_t *linfo,
|
||||
static herr_t file_info(hid_t loc_id, const char *name, const H5L_info2_t *linfo,
|
||||
void *opdata); /* Link iteration operator function */
|
||||
static herr_t group_info(hid_t loc_id, const char *name, const H5L_info_t *linfo,
|
||||
static herr_t group_info(hid_t loc_id, const char *name, const H5L_info2_t *linfo,
|
||||
void *opdata); /* Link iteration operator function */
|
||||
int
|
||||
main(void)
|
||||
@@ -135,7 +135,7 @@ main(void)
|
||||
/*
|
||||
* Use iterator to see the names of the objects in the root group.
|
||||
*/
|
||||
idx_f = H5Literate(file, H5_INDEX_NAME, H5_ITER_INC, NULL, file_info, NULL);
|
||||
idx_f = H5Literate2(file, H5_INDEX_NAME, H5_ITER_INC, NULL, file_info, NULL);
|
||||
|
||||
/*
|
||||
* Unlink name "Data" and use iterator to see the names
|
||||
@@ -146,13 +146,13 @@ main(void)
|
||||
else
|
||||
printf("\"Data\" is unlinked \n");
|
||||
|
||||
idx_f = H5Literate(file, H5_INDEX_NAME, H5_ITER_INC, NULL, file_info, NULL);
|
||||
idx_f = H5Literate2(file, H5_INDEX_NAME, H5_ITER_INC, NULL, file_info, NULL);
|
||||
|
||||
/*
|
||||
* Use iterator to see the names of the objects in the group
|
||||
* /Data_new.
|
||||
*/
|
||||
idx_g = H5Literate_by_name(grp, "/Data_new", H5_INDEX_NAME, H5_ITER_INC, NULL, group_info, NULL, H5P_DEFAULT);
|
||||
idx_g = H5Literate_by_name2(grp, "/Data_new", H5_INDEX_NAME, H5_ITER_INC, NULL, group_info, NULL, H5P_DEFAULT);
|
||||
|
||||
/*
|
||||
* Close the file.
|
||||
@@ -168,7 +168,7 @@ main(void)
|
||||
* Operator function.
|
||||
*/
|
||||
static herr_t
|
||||
file_info(hid_t loc_id, const char *name, const H5L_info_t *linfo, void *opdata)
|
||||
file_info(hid_t loc_id, const char *name, const H5L_info2_t *linfo, void *opdata)
|
||||
{
|
||||
/* avoid compiler warnings */
|
||||
loc_id = loc_id;
|
||||
@@ -189,7 +189,7 @@ file_info(hid_t loc_id, const char *name, const H5L_info_t *linfo, void *opdata)
|
||||
* Operator function.
|
||||
*/
|
||||
static herr_t
|
||||
group_info(hid_t loc_id, const char *name, const H5L_info_t *linfo, void *opdata)
|
||||
group_info(hid_t loc_id, const char *name, const H5L_info2_t *linfo, void *opdata)
|
||||
{
|
||||
hid_t did; /* dataset identifier */
|
||||
hid_t tid; /* datatype identifier */
|
||||
|
||||
@@ -308,8 +308,8 @@ echo "***"Version compatibility tests.
|
||||
# If H5_NO_DEPRECATED_SYMBOLS;
|
||||
# then only v18main works.
|
||||
# else if H5_USE_16_API_DEFAULT;
|
||||
# then v16main works and -DH5_NO_DEPRECATED_SYMBOLS v18main also works.
|
||||
# else v18main works and -DH5_USE_16_API_DEFAULT v16main also works.
|
||||
# then v16main works.
|
||||
# else v18main works and -DH5_USE_16_API_DEFAULT v16main also works.
|
||||
#
|
||||
if [ -n "$H5_USE_16_API_DEFAULT" ]; then
|
||||
echo "H5_USE_16_API_DEFAULT is defined."
|
||||
@@ -326,7 +326,6 @@ if [ -n "$H5_NO_DEPRECATED_SYMBOLS" ]; then
|
||||
TOOLTEST $v18main
|
||||
elif [ -n "$H5_USE_16_API_DEFAULT" ]; then
|
||||
TOOLTEST $v16main
|
||||
TOOLTEST -DH5_NO_DEPRECATED_SYMBOLS $v18main
|
||||
else
|
||||
TOOLTEST -DH5_USE_16_API_DEFAULT $v16main
|
||||
TOOLTEST $v18main
|
||||
|
||||
@@ -173,6 +173,6 @@ if (H5_HAVE_PARALLEL AND MPI_Fortran_FOUND)
|
||||
endif ()
|
||||
endif ()
|
||||
|
||||
if (BUILD_TESTING)
|
||||
if (BUILD_TESTING AND HDF5_TEST_FORTRAN AND HDF5_TEST_EXAMPLES)
|
||||
include (CMakeTests.cmake)
|
||||
endif ()
|
||||
|
||||
@@ -16,77 +16,79 @@
|
||||
##############################################################################
|
||||
##############################################################################
|
||||
|
||||
set (test_ex_fortran_CLEANFILES
|
||||
compound.h5
|
||||
copy1.h5
|
||||
copy2.h5
|
||||
dsetf.h5
|
||||
extend.h5
|
||||
FORTRAN.h5
|
||||
groupf.h5
|
||||
groupsf.h5
|
||||
h5_cmprss.h5
|
||||
mount1.h5
|
||||
mount2.h5
|
||||
sdsf.h5
|
||||
subset.h5
|
||||
SDScompound.h5
|
||||
test.h5
|
||||
)
|
||||
if (HDF5_TEST_SERIAL)
|
||||
set (test_ex_fortran_CLEANFILES
|
||||
compound.h5
|
||||
copy1.h5
|
||||
copy2.h5
|
||||
dsetf.h5
|
||||
extend.h5
|
||||
FORTRAN.h5
|
||||
groupf.h5
|
||||
groupsf.h5
|
||||
h5_cmprss.h5
|
||||
mount1.h5
|
||||
mount2.h5
|
||||
sdsf.h5
|
||||
subset.h5
|
||||
SDScompound.h5
|
||||
test.h5
|
||||
)
|
||||
|
||||
# Remove any output file left over from previous test run
|
||||
add_test (
|
||||
NAME f90_ex-clear-objects
|
||||
COMMAND ${CMAKE_COMMAND} -E remove ${test_ex_fortran_CLEANFILES}
|
||||
)
|
||||
set_tests_properties (f90_ex-clear-objects PROPERTIES FIXTURES_SETUP clear_f90_ex)
|
||||
# Remove any output file left over from previous test run
|
||||
add_test (
|
||||
NAME f90_ex-clear-objects
|
||||
COMMAND ${CMAKE_COMMAND} -E remove ${test_ex_fortran_CLEANFILES}
|
||||
)
|
||||
set_tests_properties (f90_ex-clear-objects PROPERTIES FIXTURES_SETUP clear_f90_ex)
|
||||
|
||||
foreach (example ${examples})
|
||||
if (HDF5_ENABLE_USING_MEMCHECKER)
|
||||
add_test (NAME f90_ex_${example} COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:f90_ex_${example}>)
|
||||
else ()
|
||||
add_test (NAME f90_ex_${example} COMMAND "${CMAKE_COMMAND}"
|
||||
-D "TEST_EMULATOR=${CMAKE_CROSSCOMPILING_EMULATOR}"
|
||||
-D "TEST_PROGRAM=$<TARGET_FILE:f90_ex_${example}>"
|
||||
-D "TEST_ARGS:STRING="
|
||||
-D "TEST_EXPECT=0"
|
||||
-D "TEST_SKIP_COMPARE=TRUE"
|
||||
-D "TEST_OUTPUT=f90_ex_${example}.txt"
|
||||
#-D "TEST_REFERENCE=f90_ex_${example}.out"
|
||||
-D "TEST_FOLDER=${PROJECT_BINARY_DIR}"
|
||||
-P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake"
|
||||
)
|
||||
endif ()
|
||||
set_tests_properties (f90_ex_${example} PROPERTIES FIXTURES_REQUIRED clear_f90_ex)
|
||||
if (last_test)
|
||||
set_tests_properties (f90_ex_${example} PROPERTIES DEPENDS ${last_test})
|
||||
endif ()
|
||||
set (last_test "f90_ex_${example}")
|
||||
endforeach ()
|
||||
foreach (example ${examples})
|
||||
if (HDF5_ENABLE_USING_MEMCHECKER)
|
||||
add_test (NAME f90_ex_${example} COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:f90_ex_${example}>)
|
||||
else ()
|
||||
add_test (NAME f90_ex_${example} COMMAND "${CMAKE_COMMAND}"
|
||||
-D "TEST_EMULATOR=${CMAKE_CROSSCOMPILING_EMULATOR}"
|
||||
-D "TEST_PROGRAM=$<TARGET_FILE:f90_ex_${example}>"
|
||||
-D "TEST_ARGS:STRING="
|
||||
-D "TEST_EXPECT=0"
|
||||
-D "TEST_SKIP_COMPARE=TRUE"
|
||||
-D "TEST_OUTPUT=f90_ex_${example}.txt"
|
||||
#-D "TEST_REFERENCE=f90_ex_${example}.out"
|
||||
-D "TEST_FOLDER=${PROJECT_BINARY_DIR}"
|
||||
-P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake"
|
||||
)
|
||||
endif ()
|
||||
set_tests_properties (f90_ex_${example} PROPERTIES FIXTURES_REQUIRED clear_f90_ex)
|
||||
if (last_test)
|
||||
set_tests_properties (f90_ex_${example} PROPERTIES DEPENDS ${last_test})
|
||||
endif ()
|
||||
set (last_test "f90_ex_${example}")
|
||||
endforeach ()
|
||||
|
||||
foreach (example ${F2003_examples})
|
||||
if (HDF5_ENABLE_USING_MEMCHECKER)
|
||||
add_test (NAME f03_ex_${example} COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:f03_ex_${example}>)
|
||||
else ()
|
||||
add_test (NAME f03_ex_${example} COMMAND "${CMAKE_COMMAND}"
|
||||
-D "TEST_EMULATOR=${CMAKE_CROSSCOMPILING_EMULATOR}"
|
||||
-D "TEST_PROGRAM=$<TARGET_FILE:f03_ex_${example}>"
|
||||
-D "TEST_ARGS:STRING="
|
||||
-D "TEST_EXPECT=0"
|
||||
-D "TEST_SKIP_COMPARE=TRUE"
|
||||
-D "TEST_OUTPUT=f03_ex_${example}.txt"
|
||||
#-D "TEST_REFERENCE=f03_ex_${example}.out"
|
||||
-D "TEST_FOLDER=${PROJECT_BINARY_DIR}"
|
||||
-P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake"
|
||||
)
|
||||
endif ()
|
||||
set_tests_properties (f03_ex_${example} PROPERTIES FIXTURES_REQUIRED clear_f90_ex)
|
||||
if (last_test)
|
||||
set_tests_properties (f03_ex_${example} PROPERTIES DEPENDS ${last_test})
|
||||
endif ()
|
||||
set (last_test "f03_ex_${example}")
|
||||
endforeach ()
|
||||
foreach (example ${F2003_examples})
|
||||
if (HDF5_ENABLE_USING_MEMCHECKER)
|
||||
add_test (NAME f03_ex_${example} COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:f03_ex_${example}>)
|
||||
else ()
|
||||
add_test (NAME f03_ex_${example} COMMAND "${CMAKE_COMMAND}"
|
||||
-D "TEST_EMULATOR=${CMAKE_CROSSCOMPILING_EMULATOR}"
|
||||
-D "TEST_PROGRAM=$<TARGET_FILE:f03_ex_${example}>"
|
||||
-D "TEST_ARGS:STRING="
|
||||
-D "TEST_EXPECT=0"
|
||||
-D "TEST_SKIP_COMPARE=TRUE"
|
||||
-D "TEST_OUTPUT=f03_ex_${example}.txt"
|
||||
#-D "TEST_REFERENCE=f03_ex_${example}.out"
|
||||
-D "TEST_FOLDER=${PROJECT_BINARY_DIR}"
|
||||
-P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake"
|
||||
)
|
||||
endif ()
|
||||
set_tests_properties (f03_ex_${example} PROPERTIES FIXTURES_REQUIRED clear_f90_ex)
|
||||
if (last_test)
|
||||
set_tests_properties (f03_ex_${example} PROPERTIES DEPENDS ${last_test})
|
||||
endif ()
|
||||
set (last_test "f03_ex_${example}")
|
||||
endforeach ()
|
||||
endif ()
|
||||
|
||||
if (H5_HAVE_PARALLEL AND MPI_Fortran_FOUND)
|
||||
if (H5_HAVE_PARALLEL AND HDF5_TEST_PARALLEL AND MPI_Fortran_FOUND)
|
||||
add_test (NAME MPI_TEST_f90_ex_ph5example COMMAND ${MPIEXEC_EXECUTABLE} ${MPIEXEC_NUMPROC_FLAG} ${MPIEXEC_MAX_NUMPROCS} ${MPIEXEC_PREFLAGS} $<TARGET_FILE:f90_ex_ph5example> ${MPIEXEC_POSTFLAGS})
|
||||
endif ()
|
||||
|
||||
+2
-2
@@ -137,13 +137,13 @@ int_f
|
||||
h5aget_num_attrs_c (hid_t_f *obj_id, int_f *attr_num)
|
||||
/******/
|
||||
{
|
||||
H5O_info_t oinfo; /* Object info */
|
||||
H5O_info2_t oinfo; /* Object info */
|
||||
int_f ret_value = 0; /* Return value */
|
||||
|
||||
/*
|
||||
* Call H5Oget_info function.
|
||||
*/
|
||||
if(H5Oget_info2((hid_t)*obj_id, &oinfo, H5O_INFO_NUM_ATTRS) < 0)
|
||||
if(H5Oget_info3((hid_t)*obj_id, &oinfo, H5O_INFO_NUM_ATTRS) < 0)
|
||||
HGOTO_DONE(FAIL);
|
||||
|
||||
/* Set number of attributes */
|
||||
|
||||
+2
-2
@@ -170,7 +170,7 @@ h5gget_obj_info_idx_c(hid_t_f *loc_id, _fcd name, int_f *namelen, int_f *idx,
|
||||
_fcd obj_name, int_f *obj_namelen, int_f *obj_type)
|
||||
/******/
|
||||
{
|
||||
H5O_info_t oinfo;
|
||||
H5O_info2_t oinfo;
|
||||
hid_t c_loc_id = (hid_t)*loc_id;
|
||||
char *c_name = NULL;
|
||||
size_t c_obj_namelen;
|
||||
@@ -200,7 +200,7 @@ h5gget_obj_info_idx_c(hid_t_f *loc_id, _fcd name, int_f *namelen, int_f *idx,
|
||||
/* Query the object's information */
|
||||
if(H5Lget_name_by_idx(gid, ".", H5_INDEX_NAME, H5_ITER_INC, c_idx, c_obj_name, c_obj_namelen, H5P_DEFAULT) < 0)
|
||||
goto DONE;
|
||||
if(H5Oget_info_by_idx2(gid, ".", H5_INDEX_NAME, H5_ITER_INC, c_idx, &oinfo, H5O_INFO_BASIC, H5P_DEFAULT) < 0)
|
||||
if(H5Oget_info_by_idx3(gid, ".", H5_INDEX_NAME, H5_ITER_INC, c_idx, &oinfo, H5O_INFO_BASIC, H5P_DEFAULT) < 0)
|
||||
goto DONE;
|
||||
|
||||
/* XXX: Switch from using H5Gget_objtype_by_idx() means that this routine won't
|
||||
|
||||
+14
-14
@@ -441,7 +441,7 @@ done:
|
||||
* H5L_LINK_SOFT_F - Soft link
|
||||
* H5L_LINK_EXTERNAL_F - External link
|
||||
* H5L_LINK_ERROR_F - Error
|
||||
* address - If the link is a hard link, address specifies the file address that the link points to
|
||||
* token - If the link is a hard link, token specifies the token for the object that the link points to
|
||||
* val_size - If the link is a symbolic link, val_size will be the length of the link value
|
||||
*
|
||||
* RETURNS
|
||||
@@ -456,13 +456,12 @@ done:
|
||||
int_f
|
||||
h5lget_info_c(hid_t_f *link_loc_id, _fcd link_name, size_t_f *link_namelen,
|
||||
int_f *cset, int_f *corder, int_f *corder_valid, int_f *link_type,
|
||||
haddr_t_f *address, size_t_f *val_size,
|
||||
hid_t_f *lapl_id)
|
||||
H5O_token_t *token, size_t_f *val_size, hid_t_f *lapl_id)
|
||||
/******/
|
||||
{
|
||||
char *c_link_name = NULL; /* Buffer to hold C string */
|
||||
int_f ret_value = 0; /* Return value */
|
||||
H5L_info_t link_buff;
|
||||
H5L_info2_t link_buff;
|
||||
|
||||
/*
|
||||
* Convert FORTRAN name to C name
|
||||
@@ -473,7 +472,7 @@ h5lget_info_c(hid_t_f *link_loc_id, _fcd link_name, size_t_f *link_namelen,
|
||||
/*
|
||||
* Call H5Linfo function.
|
||||
*/
|
||||
if(H5Lget_info((hid_t)*link_loc_id, c_link_name, &link_buff, (hid_t)*lapl_id) < 0)
|
||||
if(H5Lget_info2((hid_t)*link_loc_id, c_link_name, &link_buff, (hid_t)*lapl_id) < 0)
|
||||
HGOTO_DONE(FAIL);
|
||||
|
||||
/* Unpack the structure */
|
||||
@@ -482,7 +481,7 @@ h5lget_info_c(hid_t_f *link_loc_id, _fcd link_name, size_t_f *link_namelen,
|
||||
*corder_valid = 0;
|
||||
if(link_buff.corder_valid > 0) *corder_valid = 1;
|
||||
*link_type = (int_f)link_buff.type;
|
||||
*address = (haddr_t_f)link_buff.u.address;
|
||||
*token = link_buff.u.token;
|
||||
*val_size = (size_t_f)link_buff.u.val_size;
|
||||
|
||||
done:
|
||||
@@ -525,14 +524,15 @@ done:
|
||||
int_f
|
||||
h5lget_info_by_idx_c(hid_t_f *loc_id, _fcd group_name, size_t_f *group_namelen,
|
||||
int_f *index_field, int_f *order, hsize_t_f *n,
|
||||
int_f *link_type, int_f *corder_valid, int_f *corder, int_f *cset, haddr_t_f *address, size_t_f *val_size, hid_t_f *lapl_id)
|
||||
int_f *link_type, int_f *corder_valid, int_f *corder,
|
||||
int_f *cset, H5O_token_t *token, size_t_f *val_size, hid_t_f *lapl_id)
|
||||
/******/
|
||||
{
|
||||
char *c_group_name = NULL; /* Buffer to hold C string */
|
||||
H5_index_t c_index_field;
|
||||
H5_iter_order_t c_order;
|
||||
int_f ret_value = 0; /* Return value */
|
||||
H5L_info_t link_buff;
|
||||
H5L_info2_t link_buff;
|
||||
|
||||
/*
|
||||
* Convert FORTRAN name to C name
|
||||
@@ -545,7 +545,7 @@ h5lget_info_by_idx_c(hid_t_f *loc_id, _fcd group_name, size_t_f *group_namelen,
|
||||
/*
|
||||
* Call H5Linfo_by_idx function.
|
||||
*/
|
||||
if(H5Lget_info_by_idx((hid_t)*loc_id, c_group_name, c_index_field, c_order, (hsize_t)*n,
|
||||
if(H5Lget_info_by_idx2((hid_t)*loc_id, c_group_name, c_index_field, c_order, (hsize_t)*n,
|
||||
&link_buff, (hid_t)*lapl_id) < 0)
|
||||
HGOTO_DONE(FAIL);
|
||||
|
||||
@@ -557,7 +557,7 @@ h5lget_info_by_idx_c(hid_t_f *loc_id, _fcd group_name, size_t_f *group_namelen,
|
||||
*corder = (int_f)link_buff.corder;
|
||||
*cset = (int_f)link_buff.cset;
|
||||
*link_type = (int_f)link_buff.type;
|
||||
*address = (haddr_t_f)link_buff.u.address;
|
||||
*token = link_buff.u.token;
|
||||
*val_size = (size_t_f)link_buff.u.val_size;
|
||||
|
||||
done:
|
||||
@@ -988,7 +988,7 @@ done:
|
||||
* SOURCE
|
||||
*/
|
||||
int_f
|
||||
h5literate_c(hid_t_f *group_id, int_f *index_type, int_f *order, hsize_t_f *idx, H5L_iterate_t op, void *op_data )
|
||||
h5literate_c(hid_t_f *group_id, int_f *index_type, int_f *order, hsize_t_f *idx, H5L_iterate2_t op, void *op_data )
|
||||
/******/
|
||||
{
|
||||
int_f ret_value = -1; /* Return value */
|
||||
@@ -1001,7 +1001,7 @@ h5literate_c(hid_t_f *group_id, int_f *index_type, int_f *order, hsize_t_f *idx,
|
||||
* Call H5Linterate
|
||||
*/
|
||||
|
||||
func_ret_value = H5Literate( (hid_t)*group_id, (H5_index_t)*index_type, (H5_iter_order_t)*order, &idx_c, op, op_data);
|
||||
func_ret_value = H5Literate2( (hid_t)*group_id, (H5_index_t)*index_type, (H5_iter_order_t)*order, &idx_c, op, op_data);
|
||||
|
||||
ret_value = (int_f)func_ret_value;
|
||||
*idx = (hsize_t_f)idx_c;
|
||||
@@ -1038,7 +1038,7 @@ h5literate_c(hid_t_f *group_id, int_f *index_type, int_f *order, hsize_t_f *idx,
|
||||
* SOURCE
|
||||
*/
|
||||
int_f
|
||||
h5literate_by_name_c(hid_t_f *loc_id, _fcd name, size_t_f *namelen, int_f *index_type, int_f *order, hsize_t_f *idx, H5L_iterate_t op, void *op_data, hid_t_f *lapl_id)
|
||||
h5literate_by_name_c(hid_t_f *loc_id, _fcd name, size_t_f *namelen, int_f *index_type, int_f *order, hsize_t_f *idx, H5L_iterate2_t op, void *op_data, hid_t_f *lapl_id)
|
||||
/******/
|
||||
{
|
||||
int_f ret_value = -1; /* Return value */
|
||||
@@ -1058,7 +1058,7 @@ h5literate_by_name_c(hid_t_f *loc_id, _fcd name, size_t_f *namelen, int_f *index
|
||||
* Call H5Linterate
|
||||
*/
|
||||
|
||||
func_ret_value = H5Literate_by_name((hid_t)*loc_id, c_name,(H5_index_t)*index_type,(H5_iter_order_t)*order,&idx_c,op,op_data,(hid_t)*lapl_id);
|
||||
func_ret_value = H5Literate_by_name2((hid_t)*loc_id, c_name,(H5_index_t)*index_type,(H5_iter_order_t)*order,&idx_c,op,op_data,(hid_t)*lapl_id);
|
||||
|
||||
ret_value = (int_f)func_ret_value;
|
||||
*idx = (hsize_t_f)idx_c;
|
||||
|
||||
+18
-20
@@ -46,7 +46,7 @@ MODULE H5L
|
||||
! Fortran2003 Derived Type:
|
||||
!
|
||||
TYPE, bind(c) :: union_t
|
||||
INTEGER(haddr_t) :: address
|
||||
TYPE(H5O_TOKEN_T_F) :: token
|
||||
INTEGER(size_t) :: val_size
|
||||
END TYPE union_t
|
||||
|
||||
@@ -604,7 +604,7 @@ CONTAINS
|
||||
! H5L_TYPE_SOFT_F - Soft link
|
||||
! H5L_TYPE_EXTERNAL_F - External link
|
||||
! H5L_TYPE_ERROR_ F - Error
|
||||
! address - If the link is a hard link, address specifies the file address that the link points to
|
||||
! token - If the link is a hard link, token specifies the object token that the link points to
|
||||
! val_size - If the link is a symbolic link, val_size will be the length of the link value, e.g.,
|
||||
! the length of the name of the pointed-to object with a null terminator.
|
||||
! hdferr - Returns 0 if successful and -1 if fails
|
||||
@@ -625,7 +625,7 @@ CONTAINS
|
||||
!
|
||||
! SOURCE
|
||||
SUBROUTINE h5lget_info_f(link_loc_id, link_name, &
|
||||
cset, corder, f_corder_valid, link_type, address, val_size, &
|
||||
cset, corder, f_corder_valid, link_type, token, val_size, &
|
||||
hdferr, lapl_id)
|
||||
IMPLICIT NONE
|
||||
|
||||
@@ -641,7 +641,7 @@ CONTAINS
|
||||
! H5L_TYPE_SOFT_F - Soft link
|
||||
! H5L_TYPE_EXTERNAL_F - External link
|
||||
! H5L_TYPE_ERROR _F - Error
|
||||
INTEGER(HADDR_T), INTENT(OUT) :: address ! If the link is a hard link, address specifies the file address that the link points to
|
||||
TYPE(H5O_TOKEN_T_F), INTENT(OUT), TARGET :: token ! If the link is a hard link, token specifies the object token that the link points to
|
||||
INTEGER(SIZE_T), INTENT(OUT) :: val_size ! If the link is a symbolic link, val_size will be the length of the link value, e.g.,
|
||||
! the length of the name of the pointed-to object with a null terminator.
|
||||
INTEGER, INTENT(OUT) :: hdferr ! Error code:
|
||||
@@ -654,17 +654,17 @@ CONTAINS
|
||||
|
||||
INTERFACE
|
||||
INTEGER FUNCTION h5lget_info_c(link_loc_id, link_name, link_namelen, &
|
||||
cset, corder, corder_valid, link_type, address, val_size, &
|
||||
cset, corder, corder_valid, link_type, token, val_size, &
|
||||
lapl_id_default) BIND(C,NAME='h5lget_info_c')
|
||||
IMPORT :: c_char
|
||||
IMPORT :: HID_T, SIZE_T, HADDR_T
|
||||
IMPORT :: HID_T, SIZE_T, H5O_TOKEN_T_F
|
||||
IMPLICIT NONE
|
||||
INTEGER(HID_T), INTENT(IN) :: link_loc_id
|
||||
CHARACTER(KIND=C_CHAR), DIMENSION(*), INTENT(IN) :: link_name
|
||||
INTEGER, INTENT(OUT) :: cset
|
||||
INTEGER, INTENT(OUT) :: corder
|
||||
INTEGER, INTENT(OUT) :: link_type
|
||||
INTEGER(HADDR_T), INTENT(OUT) :: address
|
||||
TYPE(H5O_TOKEN_T_F), INTENT(OUT) :: token
|
||||
INTEGER(SIZE_T), INTENT(OUT) :: val_size
|
||||
INTEGER(HID_T) :: lapl_id_default
|
||||
INTEGER(SIZE_T) :: link_namelen
|
||||
@@ -677,10 +677,8 @@ CONTAINS
|
||||
lapl_id_default = H5P_DEFAULT_F
|
||||
IF(PRESENT(lapl_id)) lapl_id_default = lapl_id
|
||||
|
||||
hdferr = h5lget_info_c(link_loc_id, link_name, link_namelen, &
|
||||
cset, corder, corder_valid, link_type, &
|
||||
address, val_size, &
|
||||
lapl_id_default)
|
||||
hdferr = h5lget_info_c(link_loc_id, link_name, link_namelen, cset, &
|
||||
corder, corder_valid, link_type, token, val_size, lapl_id_default)
|
||||
|
||||
f_corder_valid =.FALSE.
|
||||
IF(corder_valid .EQ. 1) f_corder_valid =.TRUE.
|
||||
@@ -708,8 +706,8 @@ CONTAINS
|
||||
! corder_valid - Indicates whether the creation order data is valid for this attribute
|
||||
! corder - Is a positive integer containing the creation order of the attribute
|
||||
! cset - Indicates the character set used for the attribute’s name
|
||||
! address - If the link is a hard link, address specifies the file address that the link points to
|
||||
! val_size - If the link is a symbolic link, val_size will be the length of the link value, e.g.,
|
||||
! token - If the link is a hard link, token specifies the object token that the link points to
|
||||
! val_size - If the link is a symbolic link, val_size will be the length of the link value, e.g.,
|
||||
! the length of the name of the pointed-to object with a null terminator.
|
||||
! hdferr - Returns 0 if successful and -1 if fails
|
||||
!
|
||||
@@ -729,7 +727,7 @@ CONTAINS
|
||||
!
|
||||
! SOURCE
|
||||
SUBROUTINE h5lget_info_by_idx_f(loc_id, group_name, index_field, order, n, &
|
||||
link_type, f_corder_valid, corder, cset, address, val_size, hdferr, lapl_id)
|
||||
link_type, f_corder_valid, corder, cset, token, val_size, hdferr, lapl_id)
|
||||
IMPLICIT NONE
|
||||
INTEGER(HID_T), INTENT(IN) :: loc_id ! File or group identifier specifying location of subject group
|
||||
CHARACTER(LEN=*), INTENT(IN) :: group_name ! Name of subject group
|
||||
@@ -752,7 +750,7 @@ CONTAINS
|
||||
LOGICAL, INTENT(OUT) :: f_corder_valid ! Indicates whether the creation order data is valid for this attribute
|
||||
INTEGER, INTENT(OUT) :: corder ! Is a positive integer containing the creation order of the attribute
|
||||
INTEGER, INTENT(OUT) :: cset ! Indicates the character set used for the attribute’s name
|
||||
INTEGER(HADDR_T), INTENT(OUT) :: address ! If the link is a hard link, address specifies the file address that the link points to
|
||||
TYPE(H5O_TOKEN_T_F), INTENT(OUT), TARGET :: token ! If the link is a hard link, token specifies the object token that the link points to
|
||||
INTEGER(SIZE_T), INTENT(OUT) :: val_size ! If the link is a symbolic link, val_size will be the length of the link value, e.g.,
|
||||
! the length of the name of the pointed-to object with a null terminator.
|
||||
INTEGER, INTENT(OUT) :: hdferr ! Error code:
|
||||
@@ -767,10 +765,10 @@ CONTAINS
|
||||
!
|
||||
INTERFACE
|
||||
INTEGER FUNCTION h5lget_info_by_idx_c(loc_id, group_name, group_namelen, index_field, order, n, &
|
||||
link_type, corder_valid, corder, cset, address, val_size, lapl_id_default) &
|
||||
link_type, corder_valid, corder, cset, token, val_size, lapl_id_default) &
|
||||
BIND(C,NAME='h5lget_info_by_idx_c')
|
||||
IMPORT :: c_char
|
||||
IMPORT :: HID_T, SIZE_T, HSIZE_T, HADDR_T
|
||||
IMPORT :: HID_T, SIZE_T, HSIZE_T, H5O_TOKEN_T_F
|
||||
IMPLICIT NONE
|
||||
INTEGER(HID_T), INTENT(IN) :: loc_id
|
||||
CHARACTER(KIND=C_CHAR), DIMENSION(*), INTENT(IN) :: group_name
|
||||
@@ -779,10 +777,10 @@ CONTAINS
|
||||
INTEGER, INTENT(IN) :: order
|
||||
INTEGER(HSIZE_T), INTENT(IN) :: n
|
||||
INTEGER, INTENT(OUT) :: link_type
|
||||
INTEGER :: corder_valid
|
||||
INTEGER :: corder_valid
|
||||
INTEGER, INTENT(OUT) :: corder
|
||||
INTEGER, INTENT(OUT) :: cset
|
||||
INTEGER(HADDR_T), INTENT(OUT) :: address
|
||||
TYPE(H5O_TOKEN_T_F), INTENT(OUT) :: token
|
||||
INTEGER(SIZE_T), INTENT(OUT) :: val_size
|
||||
INTEGER(HID_T) :: lapl_id_default
|
||||
END FUNCTION h5lget_info_by_idx_c
|
||||
@@ -794,7 +792,7 @@ CONTAINS
|
||||
IF(PRESENT(lapl_id)) lapl_id_default = lapl_id
|
||||
|
||||
hdferr = h5lget_info_by_idx_c(loc_id, group_name, group_namelen, index_field, order, n, &
|
||||
link_type, corder_valid, corder, cset, address, val_size, lapl_id_default)
|
||||
link_type, corder_valid, corder, cset, token, val_size, lapl_id_default)
|
||||
|
||||
f_corder_valid =.FALSE.
|
||||
IF (corder_valid .EQ. 1) f_corder_valid =.TRUE.
|
||||
|
||||
+65
-44
@@ -22,10 +22,10 @@
|
||||
#include "H5f90.h"
|
||||
#include "H5Eprivate.h"
|
||||
int_f
|
||||
fill_h5o_info_t_f(H5O_info_t Oinfo, H5O_info_t_f *object_info);
|
||||
fill_h5o_info_t_f(H5O_info2_t Oinfo, H5O_info_t_f *object_info);
|
||||
|
||||
int_f
|
||||
fill_h5o_info_t_f(H5O_info_t Oinfo, H5O_info_t_f *object_info) {
|
||||
fill_h5o_info_t_f(H5O_info2_t Oinfo, H5O_info_t_f *object_info) {
|
||||
|
||||
/* This function does not used the field parameter because we want
|
||||
* this function to fill the unfilled fields with C's default values.
|
||||
@@ -34,7 +34,7 @@ fill_h5o_info_t_f(H5O_info_t Oinfo, H5O_info_t_f *object_info) {
|
||||
struct tm *ts;
|
||||
|
||||
object_info->fileno = Oinfo.fileno;
|
||||
object_info->addr = (haddr_t_f)Oinfo.addr;
|
||||
object_info->token = Oinfo.token;
|
||||
|
||||
object_info->type = (int_f)Oinfo.type;
|
||||
object_info->rc = (int_f)Oinfo.rc;
|
||||
@@ -85,24 +85,6 @@ fill_h5o_info_t_f(H5O_info_t Oinfo, H5O_info_t_f *object_info) {
|
||||
|
||||
object_info->num_attrs = (hsize_t_f)Oinfo.num_attrs;
|
||||
|
||||
object_info->hdr.version = (int_f)Oinfo.hdr.version;
|
||||
object_info->hdr.nmesgs = (int_f)Oinfo.hdr.nmesgs;
|
||||
object_info->hdr.nchunks = (int_f)Oinfo.hdr.nchunks;
|
||||
object_info->hdr.flags = (int_f)Oinfo.hdr.flags;
|
||||
|
||||
object_info->hdr.space.total = (hsize_t_f)Oinfo.hdr.space.total;
|
||||
object_info->hdr.space.meta = (hsize_t_f)Oinfo.hdr.space.meta;
|
||||
object_info->hdr.space.mesg = (hsize_t_f)Oinfo.hdr.space.mesg;
|
||||
object_info->hdr.space.free = (hsize_t_f)Oinfo.hdr.space.free;
|
||||
|
||||
object_info->hdr.mesg.present = Oinfo.hdr.mesg.present;
|
||||
object_info->hdr.mesg.shared = Oinfo.hdr.mesg.shared;
|
||||
|
||||
object_info->meta_size.obj.index_size = (hsize_t_f)Oinfo.meta_size.obj.index_size;
|
||||
object_info->meta_size.obj.heap_size = (hsize_t_f)Oinfo.meta_size.obj.heap_size;
|
||||
object_info->meta_size.attr.index_size = (hsize_t_f)Oinfo.meta_size.attr.index_size;
|
||||
object_info->meta_size.attr.heap_size = (hsize_t_f)Oinfo.meta_size.attr.heap_size;
|
||||
|
||||
return 0;
|
||||
|
||||
}
|
||||
@@ -248,34 +230,35 @@ h5oclose_c ( hid_t_f *object_id )
|
||||
* SOURCE
|
||||
*/
|
||||
int_f
|
||||
h5ovisit_c(hid_t_f *group_id, int_f *index_type, int_f *order, H5O_iterate_t op, void *op_data, int_f *fields )
|
||||
h5ovisit_c(hid_t_f *group_id, int_f *index_type, int_f *order, H5O_iterate2_t op,
|
||||
void *op_data, int_f *fields )
|
||||
/******/
|
||||
{
|
||||
int_f ret_value = -1; /* Return value */
|
||||
herr_t func_ret_value; /* H5Linterate return value */
|
||||
|
||||
/*
|
||||
* Call H5Ovisit2
|
||||
* Call H5Ovisit
|
||||
*/
|
||||
|
||||
func_ret_value = H5Ovisit2( (hid_t)*group_id, (H5_index_t)*index_type, (H5_iter_order_t)*order, op, op_data, (unsigned)*fields);
|
||||
func_ret_value = H5Ovisit3( (hid_t)*group_id, (H5_index_t)*index_type, (H5_iter_order_t)*order, op, op_data, (unsigned)*fields);
|
||||
|
||||
ret_value = (int_f)func_ret_value;
|
||||
|
||||
return ret_value;
|
||||
}
|
||||
|
||||
/****if* H5Of/h5oopen_by_addr_c
|
||||
/****if* H5Of/h5oopen_by_token_c
|
||||
* NAME
|
||||
* h5oopen_by_addr_c
|
||||
* h5oopen_by_token_c
|
||||
* PURPOSE
|
||||
* Calls H5open_by_addr
|
||||
* Calls H5open_by_token
|
||||
* INPUTS
|
||||
* loc_id - File or group identifier
|
||||
* addr - Object’s address in the file
|
||||
* loc_id - File or group identifier
|
||||
* token - Object’s token in the file
|
||||
*
|
||||
* OUTPUTS
|
||||
* obj_id - Dataset identifier
|
||||
* obj_id - Object identifier
|
||||
*
|
||||
* RETURNS
|
||||
* 0 on success, -1 on failure
|
||||
@@ -285,15 +268,15 @@ h5ovisit_c(hid_t_f *group_id, int_f *index_type, int_f *order, H5O_iterate_t op,
|
||||
* SOURCE
|
||||
*/
|
||||
int_f
|
||||
h5oopen_by_addr_c (hid_t_f *loc_id, haddr_t_f *addr, hid_t_f *obj_id)
|
||||
h5oopen_by_token_c(hid_t_f *loc_id, H5O_token_t *token, hid_t_f *obj_id)
|
||||
/******/
|
||||
{
|
||||
int_f ret_value = 0; /* Return value */
|
||||
|
||||
/*
|
||||
* Call H5Oopen_by_address function.
|
||||
* Call H5Oopen_by_token function.
|
||||
*/
|
||||
if((*obj_id = (hid_t_f)H5Oopen_by_addr((hid_t)*loc_id, (haddr_t)*addr)) < 0)
|
||||
if((*obj_id = (hid_t_f)H5Oopen_by_token((hid_t)*loc_id, *token)) < 0)
|
||||
HGOTO_DONE(FAIL);
|
||||
|
||||
done:
|
||||
@@ -328,7 +311,7 @@ h5oget_info_by_name_c (hid_t_f *loc_id, _fcd name, size_t_f *namelen, hid_t_f *l
|
||||
{
|
||||
char *c_name = NULL; /* Buffer to hold C string */
|
||||
int_f ret_value = 0; /* Return value */
|
||||
H5O_info_t Oinfo;
|
||||
H5O_info2_t Oinfo;
|
||||
|
||||
/*
|
||||
* Convert FORTRAN name to C name
|
||||
@@ -339,7 +322,7 @@ h5oget_info_by_name_c (hid_t_f *loc_id, _fcd name, size_t_f *namelen, hid_t_f *l
|
||||
/*
|
||||
* Call H5Oinfo_by_name function.
|
||||
*/
|
||||
if(H5Oget_info_by_name2((hid_t)*loc_id, c_name,
|
||||
if(H5Oget_info_by_name3((hid_t)*loc_id, c_name,
|
||||
&Oinfo, (unsigned)*fields, (hid_t)*lapl_id) < 0)
|
||||
HGOTO_DONE(FAIL);
|
||||
|
||||
@@ -379,10 +362,10 @@ h5oget_info_by_idx_c (hid_t_f *loc_id, _fcd group_name, size_t_f *namelen,
|
||||
{
|
||||
char *c_group_name = NULL; /* Buffer to hold C string */
|
||||
int_f ret_value = 0; /* Return value */
|
||||
H5O_info_t Oinfo;
|
||||
H5O_info2_t Oinfo;
|
||||
H5_index_t c_index_field;
|
||||
H5_iter_order_t c_order;
|
||||
|
||||
|
||||
/*
|
||||
* Convert FORTRAN name to C name
|
||||
*/
|
||||
@@ -395,7 +378,7 @@ h5oget_info_by_idx_c (hid_t_f *loc_id, _fcd group_name, size_t_f *namelen,
|
||||
/*
|
||||
* Call H5Oinfo_by_idx function.
|
||||
*/
|
||||
if(H5Oget_info_by_idx2((hid_t)*loc_id, c_group_name, c_index_field, c_order, (hsize_t)*n,
|
||||
if(H5Oget_info_by_idx3((hid_t)*loc_id, c_group_name, c_index_field, c_order, (hsize_t)*n,
|
||||
&Oinfo, (unsigned)*fields, (hid_t)*lapl_id) < 0)
|
||||
HGOTO_DONE(FAIL);
|
||||
|
||||
@@ -430,12 +413,12 @@ h5oget_info_c (hid_t_f *object_id, H5O_info_t_f *object_info, int_f *fields)
|
||||
/******/
|
||||
{
|
||||
int_f ret_value = 0; /* Return value */
|
||||
H5O_info_t Oinfo;
|
||||
|
||||
H5O_info2_t Oinfo;
|
||||
|
||||
/*
|
||||
* Call H5Oinfo_by_name function.
|
||||
*/
|
||||
if(H5Oget_info2((hid_t)*object_id, &Oinfo, (unsigned)*fields) < 0)
|
||||
if(H5Oget_info3((hid_t)*object_id, &Oinfo, (unsigned)*fields) < 0)
|
||||
HGOTO_DONE(FAIL);
|
||||
|
||||
ret_value = fill_h5o_info_t_f(Oinfo,object_info);
|
||||
@@ -528,7 +511,7 @@ h5ocopy_c (hid_t_f *src_loc_id, _fcd src_name, size_t_f *src_name_len,
|
||||
*/
|
||||
int_f
|
||||
h5ovisit_by_name_c(hid_t_f *loc_id, _fcd object_name, size_t_f *namelen, int_f *index_type, int_f *order,
|
||||
H5O_iterate_t op, void *op_data, hid_t_f *lapl_id, int_f *fields )
|
||||
H5O_iterate2_t op, void *op_data, hid_t_f *lapl_id, int_f *fields )
|
||||
/******/
|
||||
{
|
||||
int_f ret_value = -1; /* Return value */
|
||||
@@ -542,9 +525,9 @@ h5ovisit_by_name_c(hid_t_f *loc_id, _fcd object_name, size_t_f *namelen, int_f
|
||||
HGOTO_DONE(FAIL);
|
||||
|
||||
/*
|
||||
* Call H5Ovisit
|
||||
* Call H5Ovisit_by_name
|
||||
*/
|
||||
func_ret_value = H5Ovisit_by_name2( (hid_t)*loc_id, c_object_name, (H5_index_t)*index_type, (H5_iter_order_t)*order,
|
||||
func_ret_value = H5Ovisit_by_name3( (hid_t)*loc_id, c_object_name, (H5_index_t)*index_type, (H5_iter_order_t)*order,
|
||||
op, op_data, (unsigned)*fields, (hid_t)*lapl_id);
|
||||
ret_value = (int_f)func_ret_value;
|
||||
|
||||
@@ -934,3 +917,41 @@ h5oget_comment_by_name_c (hid_t_f *loc_id, _fcd name, size_t_f *name_size,
|
||||
|
||||
return ret_value;
|
||||
}
|
||||
|
||||
/****if* H5Of/h5otoken_cmp_c
|
||||
* NAME
|
||||
* h5otoken_cmp_c
|
||||
* PURPOSE
|
||||
* Calls H5Otoken_cmp
|
||||
* INPUTS
|
||||
* loc_id - Identifier of an object in the file / container.
|
||||
* token1 - The first token to compare.
|
||||
* token2 - The second token to compare.
|
||||
* cmp_value - Whether the tokens are equal.
|
||||
* RETURNS
|
||||
* 0 on success, -1 on failure
|
||||
* AUTHOR
|
||||
* Quincey Koziol
|
||||
* January 10, 2019
|
||||
* SOURCE
|
||||
*/
|
||||
int_f
|
||||
h5otoken_cmp_c(hid_t_f *loc_id, H5O_token_t *token1, H5O_token_t *token2,
|
||||
int_f *cmp_value_f)
|
||||
/******/
|
||||
{
|
||||
int cmp_value; /* Token comparison result */
|
||||
int_f ret_value = 0; /* Return value */
|
||||
|
||||
/* Call H5Otoken_cmp function */
|
||||
cmp_value = 0;
|
||||
if(H5Otoken_cmp((hid_t)*loc_id, token1, token2, &cmp_value) < 0)
|
||||
HGOTO_DONE(FAIL);
|
||||
|
||||
/* Set the comparison value to return */
|
||||
*cmp_value_f = cmp_value;
|
||||
|
||||
done:
|
||||
return ret_value;
|
||||
}
|
||||
|
||||
|
||||
+110
-58
@@ -44,7 +44,43 @@ MODULE H5O
|
||||
USE H5GLOBAL
|
||||
IMPLICIT NONE
|
||||
|
||||
!****t* H5T (F03)/h5o_info_t
|
||||
!****t* H5O (F03)/h5o_info_t
|
||||
!
|
||||
! Fortran2003 Derived Type:
|
||||
!
|
||||
TYPE, BIND(C) :: h5o_info_t
|
||||
INTEGER(C_LONG) :: fileno ! File number that object is located in
|
||||
TYPE(H5O_TOKEN_T_F) :: token ! Token for object in file
|
||||
INTEGER(C_INT) :: type ! Basic object type (group, dataset, etc.)
|
||||
INTEGER :: rc ! Reference count of object
|
||||
|
||||
INTEGER, DIMENSION(8) :: atime ! Access time ! -- NOTE --
|
||||
INTEGER, DIMENSION(8) :: mtime ! Modification time ! Returns an integer array
|
||||
INTEGER, DIMENSION(8) :: ctime ! Change time ! as specified in the Fortran
|
||||
INTEGER, DIMENSION(8) :: btime ! Birth time ! intrinsic DATE_AND_TIME(VALUES)
|
||||
|
||||
INTEGER(hsize_t) :: num_attrs ! # of attributes attached to object
|
||||
END TYPE h5o_info_t
|
||||
|
||||
! C interoperable structure for h5o_info_t. The Fortran derived type returns the time
|
||||
! values as an integer array as specified in the Fortran intrinsic DATE_AND_TIME(VALUES).
|
||||
! Whereas, this derived type does not.
|
||||
|
||||
TYPE, BIND(C) :: c_h5o_info_t
|
||||
INTEGER(C_LONG) :: fileno ! File number that object is located in
|
||||
TYPE(H5O_TOKEN_T_F) :: token ! Token for object in file
|
||||
INTEGER(C_INT) :: type ! Basic object type (group, dataset, etc.)
|
||||
INTEGER(C_INT) :: rc ! Reference count of object
|
||||
|
||||
INTEGER(KIND=TIME_T) :: atime ! Access time
|
||||
INTEGER(KIND=TIME_T) :: mtime ! Modify time
|
||||
INTEGER(KIND=TIME_T) :: ctime ! Create time
|
||||
INTEGER(KIND=TIME_T) :: btime ! Birth time
|
||||
|
||||
INTEGER(hsize_t) :: num_attrs ! # of attributes attached to object
|
||||
END TYPE c_h5o_info_t
|
||||
|
||||
!****t* H5O (F03)/h5o_native_info_t
|
||||
!
|
||||
! Fortran2003 Derived Type:
|
||||
!
|
||||
@@ -59,13 +95,13 @@ MODULE H5O
|
||||
INTEGER(c_int64_t) :: present ! Flags to indicate presence of message type in header
|
||||
INTEGER(c_int64_t) :: shared ! Flags to indicate message type is shared in header
|
||||
END TYPE mesg_t
|
||||
|
||||
|
||||
TYPE, BIND(C) :: hdr_t
|
||||
INTEGER :: version ! Version number of header format in file
|
||||
INTEGER :: nmesgs ! Number of object header messages
|
||||
INTEGER :: nchunks ! Number of object header chunks
|
||||
INTEGER :: flags ! Object header status flags
|
||||
TYPE(space_t) :: space
|
||||
TYPE(space_t) :: space
|
||||
TYPE(mesg_t) :: mesg
|
||||
END TYPE hdr_t
|
||||
|
||||
@@ -74,7 +110,7 @@ MODULE H5O
|
||||
INTEGER(C_INT) :: nmesgs ! Number of object header messages
|
||||
INTEGER(C_INT) :: nchunks ! Number of object header chunks
|
||||
INTEGER(C_INT) :: flags ! Object header status flags
|
||||
TYPE(space_t) :: space
|
||||
TYPE(space_t) :: space
|
||||
TYPE(mesg_t) :: mesg
|
||||
END TYPE c_hdr_t
|
||||
|
||||
@@ -88,46 +124,17 @@ MODULE H5O
|
||||
TYPE(H5_ih_info_t) :: obj ! v1/v2 B-tree & local/fractal heap for groups, B-tree for chunked datasets
|
||||
TYPE(H5_ih_info_t) :: attr ! v2 B-tree & heap for attributes
|
||||
ENDTYPE meta_size_t
|
||||
|
||||
TYPE, BIND(C) :: h5o_info_t
|
||||
INTEGER(C_LONG) :: fileno ! File number that object is located in
|
||||
INTEGER(haddr_t) :: addr ! Object address in file
|
||||
INTEGER(C_INT) :: type ! Basic object type (group, dataset, etc.)
|
||||
INTEGER :: rc ! Reference count of object
|
||||
|
||||
INTEGER, DIMENSION(8) :: atime ! Access time ! -- NOTE --
|
||||
INTEGER, DIMENSION(8) :: mtime ! Modification time ! Returns an integer array
|
||||
INTEGER, DIMENSION(8) :: ctime ! Change time ! as specified in the Fortran
|
||||
INTEGER, DIMENSION(8) :: btime ! Birth time ! intrinsic DATE_AND_TIME(VALUES)
|
||||
|
||||
INTEGER(hsize_t) :: num_attrs ! # of attributes attached to object
|
||||
|
||||
TYPE, BIND(C) :: h5o_native_info_t
|
||||
TYPE(hdr_t) :: hdr
|
||||
|
||||
TYPE(meta_size_t) :: meta_size
|
||||
END TYPE h5o_info_t
|
||||
|
||||
! C interoperable structure for h5o_info_t. The Fortran derived type returns the time
|
||||
! values as an integer array as specified in the Fortran intrinsic DATE_AND_TIME(VALUES).
|
||||
! Whereas, this derived type does not.
|
||||
|
||||
TYPE, BIND(C) :: c_h5o_info_t
|
||||
INTEGER(C_LONG) :: fileno ! File number that object is located in
|
||||
INTEGER(haddr_t) :: addr ! Object address in file
|
||||
INTEGER(C_INT) :: type ! Basic object type (group, dataset, etc.)
|
||||
INTEGER(C_INT) :: rc ! Reference count of object
|
||||
|
||||
INTEGER(KIND=TIME_T) :: atime ! Access time
|
||||
INTEGER(KIND=TIME_T) :: mtime ! modify time
|
||||
INTEGER(KIND=TIME_T) :: ctime ! create time
|
||||
INTEGER(KIND=TIME_T) :: btime ! Access time
|
||||
|
||||
INTEGER(hsize_t) :: num_attrs ! # of attributes attached to object
|
||||
END TYPE h5o_native_info_t
|
||||
|
||||
! C interoperable structure for h5o_native_info_t.
|
||||
TYPE, BIND(C) :: c_h5o_native_info_t
|
||||
TYPE(c_hdr_t) :: hdr
|
||||
|
||||
TYPE(meta_size_t) :: meta_size
|
||||
END TYPE c_h5o_info_t
|
||||
END TYPE c_h5o_native_info_t
|
||||
|
||||
!*****
|
||||
|
||||
@@ -292,46 +299,46 @@ CONTAINS
|
||||
END SUBROUTINE h5oclose_f
|
||||
|
||||
!
|
||||
!****s* H5O/h5open_by_addr_f
|
||||
! NAME
|
||||
! h5oopen_by_addr_f
|
||||
!****s* H5O/h5oopen_by_token_f
|
||||
! NAME
|
||||
! h5oopen_by_token_f
|
||||
!
|
||||
! PURPOSE
|
||||
! Opens an object using its address within an HDF5 file.
|
||||
! Opens an object using its token within an HDF5 file.
|
||||
!
|
||||
! Inputs:
|
||||
! Inputs:
|
||||
! loc_id - File or group identifier.
|
||||
! addr - Object’s address in the file.
|
||||
! token - Object’s token in the file.
|
||||
!
|
||||
! Outputs:
|
||||
! obj_id - Object identifier for the opened object.
|
||||
! hdferr - Returns 0 if successful and -1 if fails.
|
||||
!
|
||||
! AUTHOR
|
||||
! AUTHOR
|
||||
! M. Scot Breitenfeld
|
||||
! September 14, 2009
|
||||
!
|
||||
!
|
||||
! Fortran90 Interface:
|
||||
SUBROUTINE h5oopen_by_addr_f(loc_id, addr, obj_id, hdferr)
|
||||
SUBROUTINE h5oopen_by_token_f(loc_id, token, obj_id, hdferr)
|
||||
IMPLICIT NONE
|
||||
INTEGER(HID_T) , INTENT(IN) :: loc_id
|
||||
INTEGER(HADDR_T), INTENT(IN) :: addr
|
||||
INTEGER(HID_T) , INTENT(OUT) :: obj_id
|
||||
INTEGER , INTENT(OUT) :: hdferr
|
||||
INTEGER(HID_T) , INTENT(IN) :: loc_id
|
||||
TYPE(H5O_TOKEN_T_F), INTENT(IN) :: token
|
||||
INTEGER(HID_T) , INTENT(OUT) :: obj_id
|
||||
INTEGER , INTENT(OUT) :: hdferr
|
||||
!*****
|
||||
INTERFACE
|
||||
INTEGER FUNCTION h5oopen_by_addr_c(loc_id, addr, obj_id) BIND(C,NAME='h5oopen_by_addr_c')
|
||||
IMPORT :: HID_T, HADDR_T
|
||||
INTEGER FUNCTION h5oopen_by_token_c(loc_id, token, obj_id) BIND(C,NAME='h5oopen_by_token_c')
|
||||
IMPORT :: HID_T, H5O_TOKEN_T_F
|
||||
IMPLICIT NONE
|
||||
INTEGER(HID_T), INTENT(IN) :: loc_id
|
||||
INTEGER(HADDR_T), INTENT(IN) :: addr
|
||||
TYPE(H5O_TOKEN_T_F), INTENT(IN) :: token
|
||||
INTEGER(HID_T), INTENT(OUT) :: obj_id
|
||||
END FUNCTION h5oopen_by_addr_c
|
||||
END FUNCTION h5oopen_by_token_c
|
||||
END INTERFACE
|
||||
|
||||
hdferr = h5oopen_by_addr_c(loc_id, addr, obj_id)
|
||||
hdferr = h5oopen_by_token_c(loc_id, token, obj_id)
|
||||
|
||||
END SUBROUTINE h5oopen_by_addr_f
|
||||
END SUBROUTINE h5oopen_by_token_f
|
||||
!
|
||||
!****s* H5O/h5ocopy_f
|
||||
! NAME
|
||||
@@ -966,7 +973,7 @@ CONTAINS
|
||||
CHARACTER(KIND=C_CHAR), DIMENSION(*), INTENT(IN) :: name
|
||||
INTEGER(SIZE_T) , INTENT(IN) :: namelen
|
||||
INTEGER(HID_T) , INTENT(IN) :: lapl_id_default
|
||||
TYPE(C_PTR),VALUE :: object_info
|
||||
TYPE(C_PTR), VALUE :: object_info
|
||||
INTEGER , INTENT(IN) :: fields
|
||||
END FUNCTION h5oget_info_by_name_c
|
||||
END INTERFACE
|
||||
@@ -1212,5 +1219,50 @@ CONTAINS
|
||||
|
||||
END SUBROUTINE h5ovisit_by_name_f
|
||||
|
||||
!****s* H5O/h5otoken_cmp_f
|
||||
! NAME
|
||||
! h5otoken_cmp_f
|
||||
!
|
||||
! PURPOSE
|
||||
! Compare two tokens, which must be from the same file / containers.
|
||||
!
|
||||
! Inputs:
|
||||
! loc_id - Identifier of an object in the file / container.
|
||||
! token1 - The first token to compare.
|
||||
! token2 - The second token to compare.
|
||||
!
|
||||
! Outputs:
|
||||
! cmp_value - Returns 0 if tokens are equal, non-zero for unequal tokens.
|
||||
! hdferr - Returns 0 if successful and -1 if fails.
|
||||
!
|
||||
! AUTHOR
|
||||
! Quincey Koziol
|
||||
! January 10, 2019
|
||||
!
|
||||
! Fortran90 Interface:
|
||||
SUBROUTINE h5otoken_cmp_f(loc_id, token1, token2, cmp_value, hdferr)
|
||||
IMPLICIT NONE
|
||||
INTEGER(HID_T) , INTENT(IN) :: loc_id
|
||||
TYPE(H5O_TOKEN_T_F), INTENT(IN) :: token1 ! First token
|
||||
TYPE(H5O_TOKEN_T_F), INTENT(IN) :: token2 ! First token
|
||||
INTEGER , INTENT(OUT) :: cmp_value
|
||||
INTEGER , INTENT(OUT) :: hdferr
|
||||
!*****
|
||||
INTERFACE
|
||||
INTEGER FUNCTION h5otoken_cmp_c(loc_id, token1, token2, cmp_value) BIND(C,NAME='h5otoken_cmp_c')
|
||||
IMPORT :: HID_T, C_PTR, H5O_TOKEN_T_F
|
||||
IMPLICIT NONE
|
||||
INTEGER(HID_T), INTENT(IN) :: loc_id
|
||||
TYPE(H5O_TOKEN_T_F), INTENT(IN) :: token1 ! First token
|
||||
TYPE(H5O_TOKEN_T_F), INTENT(IN) :: token2 ! First token
|
||||
INTEGER, INTENT(OUT) :: cmp_value
|
||||
|
||||
END FUNCTION h5otoken_cmp_c
|
||||
END INTERFACE
|
||||
|
||||
hdferr = h5otoken_cmp_c(loc_id, token1, token2, cmp_value)
|
||||
|
||||
END SUBROUTINE h5otoken_cmp_f
|
||||
|
||||
END MODULE H5O
|
||||
|
||||
|
||||
+48
-8
@@ -167,10 +167,49 @@ CONTAINS
|
||||
END SUBROUTINE H5VLis_connector_registered_f
|
||||
|
||||
!
|
||||
!****s* H5VL/H5VLis_connector_registered_f
|
||||
!****s* H5VL/H5VLget_connector_id_f
|
||||
!
|
||||
! NAME
|
||||
! H5VLis_connector_registered_f
|
||||
! H5VLget_connector_id_f
|
||||
!
|
||||
! PURPOSE
|
||||
! Retrieves the ID for a registered VOL connector.
|
||||
!
|
||||
! INPUTS
|
||||
! obj_id - Object id
|
||||
! OUTPUTS
|
||||
! vol_id - Connector id
|
||||
! hdferr - Returns 0 if successful and -1 if fails
|
||||
! SOURCE
|
||||
|
||||
SUBROUTINE H5VLget_connector_id_f(obj_id, vol_id, hdferr)
|
||||
IMPLICIT NONE
|
||||
INTEGER(HID_T), INTENT(IN) :: obj_id
|
||||
INTEGER(HID_T), INTENT(OUT) :: vol_id
|
||||
INTEGER, INTENT(OUT) :: hdferr
|
||||
!*****
|
||||
|
||||
INTERFACE
|
||||
INTEGER(HID_T) FUNCTION H5VLget_connector_id(obj_id) BIND(C,NAME='H5VLget_connector_id')
|
||||
IMPORT :: HID_T
|
||||
INTEGER(HID_T), INTENT(IN) :: obj_id
|
||||
END FUNCTION H5VLget_connector_id
|
||||
END INTERFACE
|
||||
|
||||
vol_id = H5VLget_connector_id(obj_id)
|
||||
|
||||
IF(vol_id.LT.0)THEN
|
||||
hdferr = -1
|
||||
vol_id = H5I_INVALID_HID_F
|
||||
ENDIF
|
||||
|
||||
END SUBROUTINE H5VLget_connector_id_f
|
||||
|
||||
!
|
||||
!****s* H5VL/H5VLget_connector_id_by_name_f
|
||||
!
|
||||
! NAME
|
||||
! H5VLget_connector_id_by_name_f
|
||||
!
|
||||
! PURPOSE
|
||||
! Retrieves the ID for a registered VOL connector.
|
||||
@@ -182,7 +221,7 @@ CONTAINS
|
||||
! hdferr - Returns 0 if successful and -1 if fails
|
||||
! SOURCE
|
||||
|
||||
SUBROUTINE H5VLget_connector_id_f(name, vol_id, hdferr)
|
||||
SUBROUTINE H5VLget_connector_id_by_name_f(name, vol_id, hdferr)
|
||||
IMPLICIT NONE
|
||||
CHARACTER(LEN=*), INTENT(IN) :: name
|
||||
INTEGER(HID_T), INTENT(OUT) :: vol_id
|
||||
@@ -191,22 +230,23 @@ CONTAINS
|
||||
CHARACTER(LEN=LEN_TRIM(name)+1,KIND=C_CHAR) :: c_name
|
||||
|
||||
INTERFACE
|
||||
INTEGER(HID_T) FUNCTION H5VLget_connector_id(name) BIND(C,NAME='H5VLget_connector_id')
|
||||
INTEGER(HID_T) FUNCTION H5VLget_connector_id_by_name(name) BIND(C,NAME='H5VLget_connector_id_by_name')
|
||||
IMPORT :: C_CHAR
|
||||
IMPORT :: HID_T
|
||||
CHARACTER(KIND=C_CHAR), DIMENSION(*), INTENT(IN) :: name
|
||||
END FUNCTION H5VLget_connector_id
|
||||
END FUNCTION H5VLget_connector_id_by_name
|
||||
END INTERFACE
|
||||
|
||||
c_name = TRIM(name)//C_NULL_CHAR
|
||||
vol_id = H5VLget_connector_id(c_name)
|
||||
|
||||
vol_id = H5VLget_connector_id_by_name(c_name)
|
||||
|
||||
hdferr = 0
|
||||
IF(vol_id.LT.0)THEN
|
||||
hdferr = -1
|
||||
vol_id = H5I_INVALID_HID_F
|
||||
ENDIF
|
||||
|
||||
END SUBROUTINE H5VLget_connector_id_f
|
||||
END SUBROUTINE H5VLget_connector_id_by_name_f
|
||||
|
||||
SUBROUTINE H5VLget_connector_name_f(obj_id, name, hdferr, name_len)
|
||||
IMPLICIT NONE
|
||||
|
||||
+147
-144
@@ -56,7 +56,6 @@ h5init_types_c( hid_t_f * types, hid_t_f * floatingtypes, hid_t_f * integertypes
|
||||
{
|
||||
int ret_value = -1;
|
||||
hid_t c_type_id;
|
||||
size_t tmp_val;
|
||||
int i;
|
||||
|
||||
/* Fortran INTEGER may not be the same as C; do all checking to find
|
||||
@@ -133,8 +132,7 @@ h5init_types_c( hid_t_f * types, hid_t_f * floatingtypes, hid_t_f * integertypes
|
||||
#endif
|
||||
|
||||
if ((c_type_id = H5Tcopy(H5T_FORTRAN_S1)) < 0) return ret_value;
|
||||
tmp_val = 1;
|
||||
if(H5Tset_size(c_type_id, tmp_val) < 0) return ret_value;
|
||||
if(H5Tset_size(c_type_id, 1) < 0) return ret_value;
|
||||
if(H5Tset_strpad(c_type_id, H5T_STR_SPACEPAD) < 0) return ret_value;
|
||||
types[8] = (hid_t_f)c_type_id;
|
||||
|
||||
@@ -313,6 +311,7 @@ h5close_types_c( hid_t_f * types, int_f *lentypes,
|
||||
ret_value = 0;
|
||||
return ret_value;
|
||||
}
|
||||
|
||||
/****if* H5_f/h5init_flags_c
|
||||
* NAME
|
||||
* h5init_flags_c
|
||||
@@ -370,7 +369,6 @@ h5init_flags_c( int_f *h5d_flags, size_t_f *h5d_size_flags,
|
||||
haddr_t_f *h5_haddr_generic_flags)
|
||||
/******/
|
||||
{
|
||||
int ret_value = -1;
|
||||
/*
|
||||
* H5D flags
|
||||
*/
|
||||
@@ -538,196 +536,201 @@ h5init_flags_c( int_f *h5d_flags, size_t_f *h5d_size_flags,
|
||||
* but we need to assign each kind of message to a different bit so that
|
||||
* one index can hold multiple types.)
|
||||
*/
|
||||
h5o_flags[7] = (int_f)H5O_SHMESG_NONE_FLAG; /* No shared messages */
|
||||
h5o_flags[8] = (int_f)H5O_SHMESG_SDSPACE_FLAG; /* Simple Dataspace Message. */
|
||||
h5o_flags[9] = (int_f)H5O_SHMESG_DTYPE_FLAG; /* Datatype Message. */
|
||||
h5o_flags[10] = (int_f)H5O_SHMESG_FILL_FLAG; /* Fill Value Message. */
|
||||
h5o_flags[11] = (int_f)H5O_SHMESG_PLINE_FLAG; /* Filter pipeline message. */
|
||||
h5o_flags[12] = (int_f)H5O_SHMESG_ATTR_FLAG; /* Attribute Message. */
|
||||
h5o_flags[13] = (int_f)H5O_SHMESG_ALL_FLAG;
|
||||
h5o_flags[7] = (int_f)H5O_SHMESG_NONE_FLAG; /* No shared messages */
|
||||
h5o_flags[8] = (int_f)H5O_SHMESG_SDSPACE_FLAG; /* Simple Dataspace Message. */
|
||||
h5o_flags[9] = (int_f)H5O_SHMESG_DTYPE_FLAG; /* Datatype Message. */
|
||||
h5o_flags[10] = (int_f)H5O_SHMESG_FILL_FLAG; /* Fill Value Message. */
|
||||
h5o_flags[11] = (int_f)H5O_SHMESG_PLINE_FLAG; /* Filter pipeline message. */
|
||||
h5o_flags[12] = (int_f)H5O_SHMESG_ATTR_FLAG; /* Attribute Message. */
|
||||
h5o_flags[13] = (int_f)H5O_SHMESG_ALL_FLAG;
|
||||
|
||||
/* Object header status flag definitions */
|
||||
h5o_flags[14] = (int_f)H5O_HDR_CHUNK0_SIZE; /* 2-bit field indicating # of bytes to store the size of chunk 0's data */
|
||||
h5o_flags[15] = (int_f)H5O_HDR_ATTR_CRT_ORDER_TRACKED; /* Attribute creation order is tracked */
|
||||
h5o_flags[16] = (int_f)H5O_HDR_ATTR_CRT_ORDER_INDEXED; /* Attribute creation order has index */
|
||||
h5o_flags[17] = (int_f)H5O_HDR_ATTR_STORE_PHASE_CHANGE; /* Non-default attribute storage phase change values stored */
|
||||
h5o_flags[18] = (int_f)H5O_HDR_STORE_TIMES; /* Store access, modification, change & birth times for object */
|
||||
h5o_flags[19] = (int_f)H5O_HDR_ALL_FLAGS;
|
||||
h5o_flags[14] = (int_f)H5O_HDR_CHUNK0_SIZE; /* 2-bit field indicating # of bytes to store the size of chunk 0's data */
|
||||
h5o_flags[15] = (int_f)H5O_HDR_ATTR_CRT_ORDER_TRACKED; /* Attribute creation order is tracked */
|
||||
h5o_flags[16] = (int_f)H5O_HDR_ATTR_CRT_ORDER_INDEXED; /* Attribute creation order has index */
|
||||
h5o_flags[17] = (int_f)H5O_HDR_ATTR_STORE_PHASE_CHANGE; /* Non-default attribute storage phase change values stored */
|
||||
h5o_flags[18] = (int_f)H5O_HDR_STORE_TIMES; /* Store access, modification, change & birth times for object */
|
||||
h5o_flags[19] = (int_f)H5O_HDR_ALL_FLAGS;
|
||||
|
||||
/* Maximum shared message values. Number of indexes is 8 to allow room to add
|
||||
* new types of messages.
|
||||
*/
|
||||
h5o_flags[20] = (int_f)H5O_SHMESG_MAX_NINDEXES;
|
||||
h5o_flags[21] = (int_f)H5O_SHMESG_MAX_LIST_SIZE;
|
||||
h5o_flags[20] = (int_f)H5O_SHMESG_MAX_NINDEXES;
|
||||
h5o_flags[21] = (int_f)H5O_SHMESG_MAX_LIST_SIZE;
|
||||
|
||||
/* Types of objects in file */
|
||||
h5o_flags[22] = (int_f)H5O_TYPE_UNKNOWN; /* Unknown object type */
|
||||
h5o_flags[23] = (int_f)H5O_TYPE_GROUP; /* Object is a group */
|
||||
h5o_flags[24] = (int_f)H5O_TYPE_DATASET; /* Object is a dataset */
|
||||
h5o_flags[25] = (int_f)H5O_TYPE_NAMED_DATATYPE; /* Object is a named data type */
|
||||
h5o_flags[26] = (int_f)H5O_TYPE_NTYPES; /* Number of different object types */
|
||||
h5o_flags[22] = (int_f)H5O_TYPE_UNKNOWN; /* Unknown object type */
|
||||
h5o_flags[23] = (int_f)H5O_TYPE_GROUP; /* Object is a group */
|
||||
h5o_flags[24] = (int_f)H5O_TYPE_DATASET; /* Object is a dataset */
|
||||
h5o_flags[25] = (int_f)H5O_TYPE_NAMED_DATATYPE; /* Object is a named data type */
|
||||
h5o_flags[26] = (int_f)H5O_TYPE_NTYPES; /* Number of different object types */
|
||||
|
||||
/* Flags for H5Oget_info.
|
||||
* These flags determine which fields will be filled in in the H5O_info_t
|
||||
* struct.
|
||||
* struct.
|
||||
*/
|
||||
h5o_flags[27] = (int_f)H5O_INFO_ALL; /* (H5O_INFO_BASIC|H5O_INFO_TIME|H5O_INFO_NUM_ATTRS|H5O_INFO_HDR|H5O_INFO_META_SIZE) */
|
||||
h5o_flags[28] = (int_f)H5O_INFO_BASIC; /* Fill in the fileno, addr, type, and rc fields */
|
||||
h5o_flags[29] = (int_f)H5O_INFO_TIME; /* Fill in the atime, mtime, ctime, and btime fields */
|
||||
h5o_flags[30] = (int_f)H5O_INFO_NUM_ATTRS; /* Fill in the num_attrs field */
|
||||
h5o_flags[31] = (int_f)H5O_INFO_HDR; /* Fill in the hdr field */
|
||||
h5o_flags[32] = (int_f)H5O_INFO_META_SIZE; /* Fill in the meta_size field */
|
||||
h5o_flags[27] = (int_f)H5O_INFO_ALL; /* (H5O_INFO_BASIC|H5O_INFO_TIME|H5O_INFO_NUM_ATTRS) */
|
||||
h5o_flags[28] = (int_f)H5O_INFO_BASIC; /* Fill in the fileno, addr, type, and rc fields */
|
||||
h5o_flags[29] = (int_f)H5O_INFO_TIME; /* Fill in the atime, mtime, ctime, and btime fields */
|
||||
h5o_flags[30] = (int_f)H5O_INFO_NUM_ATTRS; /* Fill in the num_attrs field */
|
||||
|
||||
/* Flags for H5Oget_native_info.
|
||||
* These flags determine which fields will be filled in in the H5O_native_info_t
|
||||
* struct.
|
||||
*/
|
||||
h5o_flags[31] = (int_f)H5O_NATIVE_INFO_ALL; /* (H5O_NATIVE_INFO_HDR|H5O_NATIVE_INFO_META_SIZE) */
|
||||
h5o_flags[32] = (int_f)H5O_NATIVE_INFO_HDR; /* Fill in the hdr field */
|
||||
h5o_flags[33] = (int_f)H5O_NATIVE_INFO_META_SIZE; /* Fill in the meta_size field */
|
||||
/*
|
||||
* H5P flags
|
||||
*/
|
||||
h5p_flags[0] = (hid_t_f)H5P_FILE_CREATE;
|
||||
h5p_flags[1] = (hid_t_f)H5P_FILE_ACCESS;
|
||||
h5p_flags[2] = (hid_t_f)H5P_DATASET_CREATE;
|
||||
h5p_flags[3] = (hid_t_f)H5P_DATASET_XFER;
|
||||
h5p_flags[4] = (hid_t_f)H5P_FILE_MOUNT;
|
||||
h5p_flags[5] = (hid_t_f)H5P_DEFAULT;
|
||||
h5p_flags[6] = (hid_t_f)H5P_ROOT;
|
||||
h5p_flags[7] = (hid_t_f)H5P_OBJECT_CREATE;
|
||||
h5p_flags[8] = (hid_t_f)H5P_DATASET_ACCESS;
|
||||
h5p_flags[9] = (hid_t_f)H5P_GROUP_CREATE;
|
||||
h5p_flags[10] = (hid_t_f)H5P_GROUP_ACCESS;
|
||||
h5p_flags[11] = (hid_t_f)H5P_DATATYPE_CREATE;
|
||||
h5p_flags[12] = (hid_t_f)H5P_DATATYPE_ACCESS;
|
||||
h5p_flags[13] = (hid_t_f)H5P_STRING_CREATE;
|
||||
h5p_flags[14] = (hid_t_f)H5P_ATTRIBUTE_CREATE;
|
||||
h5p_flags[15] = (hid_t_f)H5P_OBJECT_COPY;
|
||||
h5p_flags[16] = (hid_t_f)H5P_LINK_CREATE;
|
||||
h5p_flags[17] = (hid_t_f)H5P_LINK_ACCESS;
|
||||
h5p_flags[0] = (hid_t_f)H5P_FILE_CREATE;
|
||||
h5p_flags[1] = (hid_t_f)H5P_FILE_ACCESS;
|
||||
h5p_flags[2] = (hid_t_f)H5P_DATASET_CREATE;
|
||||
h5p_flags[3] = (hid_t_f)H5P_DATASET_XFER;
|
||||
h5p_flags[4] = (hid_t_f)H5P_FILE_MOUNT;
|
||||
h5p_flags[5] = (hid_t_f)H5P_DEFAULT;
|
||||
h5p_flags[6] = (hid_t_f)H5P_ROOT;
|
||||
h5p_flags[7] = (hid_t_f)H5P_OBJECT_CREATE;
|
||||
h5p_flags[8] = (hid_t_f)H5P_DATASET_ACCESS;
|
||||
h5p_flags[9] = (hid_t_f)H5P_GROUP_CREATE;
|
||||
h5p_flags[10] = (hid_t_f)H5P_GROUP_ACCESS;
|
||||
h5p_flags[11] = (hid_t_f)H5P_DATATYPE_CREATE;
|
||||
h5p_flags[12] = (hid_t_f)H5P_DATATYPE_ACCESS;
|
||||
h5p_flags[13] = (hid_t_f)H5P_STRING_CREATE;
|
||||
h5p_flags[14] = (hid_t_f)H5P_ATTRIBUTE_CREATE;
|
||||
h5p_flags[15] = (hid_t_f)H5P_OBJECT_COPY;
|
||||
h5p_flags[16] = (hid_t_f)H5P_LINK_CREATE;
|
||||
h5p_flags[17] = (hid_t_f)H5P_LINK_ACCESS;
|
||||
|
||||
|
||||
/*
|
||||
* H5P integer flags
|
||||
*/
|
||||
h5p_flags_int[0] = (int_f)H5P_CRT_ORDER_INDEXED;
|
||||
h5p_flags_int[1] = (int_f)H5P_CRT_ORDER_TRACKED;
|
||||
h5p_flags_int[0] = (int_f)H5P_CRT_ORDER_INDEXED;
|
||||
h5p_flags_int[1] = (int_f)H5P_CRT_ORDER_TRACKED;
|
||||
|
||||
/*
|
||||
* H5R flags
|
||||
*/
|
||||
|
||||
h5r_flags[0] = (int_f)H5R_OBJECT;
|
||||
h5r_flags[1] = (int_f)H5R_DATASET_REGION;
|
||||
h5r_flags[0] = (int_f)H5R_OBJECT;
|
||||
h5r_flags[1] = (int_f)H5R_DATASET_REGION;
|
||||
|
||||
/*
|
||||
* H5S flags
|
||||
*/
|
||||
|
||||
h5s_hid_flags[0] = (hid_t_f)H5S_ALL;
|
||||
h5s_hid_flags[0] = (hid_t_f)H5S_ALL;
|
||||
|
||||
h5s_hsize_flags[0] = (hsize_t_f)H5S_UNLIMITED;
|
||||
h5s_hsize_flags[0] = (hsize_t_f)H5S_UNLIMITED;
|
||||
|
||||
h5s_flags[0] = (int_f)H5S_SCALAR;
|
||||
h5s_flags[1] = (int_f)H5S_SIMPLE;
|
||||
h5s_flags[2] = (int_f)H5S_NULL;
|
||||
h5s_flags[3] = (int_f)H5S_SELECT_SET;
|
||||
h5s_flags[4] = (int_f)H5S_SELECT_OR;
|
||||
h5s_flags[0] = (int_f)H5S_SCALAR;
|
||||
h5s_flags[1] = (int_f)H5S_SIMPLE;
|
||||
h5s_flags[2] = (int_f)H5S_NULL;
|
||||
h5s_flags[3] = (int_f)H5S_SELECT_SET;
|
||||
h5s_flags[4] = (int_f)H5S_SELECT_OR;
|
||||
|
||||
h5s_flags[5] = (int_f)H5S_SELECT_NOOP;
|
||||
h5s_flags[6] = (int_f)H5S_SELECT_AND;
|
||||
h5s_flags[7] = (int_f)H5S_SELECT_XOR;
|
||||
h5s_flags[8] = (int_f)H5S_SELECT_NOTB;
|
||||
h5s_flags[9] = (int_f)H5S_SELECT_NOTA;
|
||||
h5s_flags[5] = (int_f)H5S_SELECT_NOOP;
|
||||
h5s_flags[6] = (int_f)H5S_SELECT_AND;
|
||||
h5s_flags[7] = (int_f)H5S_SELECT_XOR;
|
||||
h5s_flags[8] = (int_f)H5S_SELECT_NOTB;
|
||||
h5s_flags[9] = (int_f)H5S_SELECT_NOTA;
|
||||
|
||||
h5s_flags[10] = (int_f)H5S_SELECT_APPEND;
|
||||
h5s_flags[11] = (int_f)H5S_SELECT_PREPEND;
|
||||
h5s_flags[12] = (int_f)H5S_SELECT_INVALID;
|
||||
h5s_flags[13] = (int_f)H5S_SEL_ERROR;
|
||||
h5s_flags[14] = (int_f)H5S_SEL_NONE;
|
||||
h5s_flags[10] = (int_f)H5S_SELECT_APPEND;
|
||||
h5s_flags[11] = (int_f)H5S_SELECT_PREPEND;
|
||||
h5s_flags[12] = (int_f)H5S_SELECT_INVALID;
|
||||
h5s_flags[13] = (int_f)H5S_SEL_ERROR;
|
||||
h5s_flags[14] = (int_f)H5S_SEL_NONE;
|
||||
|
||||
h5s_flags[15] = (int_f)H5S_SEL_POINTS;
|
||||
h5s_flags[16] = (int_f)H5S_SEL_HYPERSLABS;
|
||||
h5s_flags[17] = (int_f)H5S_SEL_ALL;
|
||||
|
||||
h5s_flags[15] = (int_f)H5S_SEL_POINTS;
|
||||
h5s_flags[16] = (int_f)H5S_SEL_HYPERSLABS;
|
||||
h5s_flags[17] = (int_f)H5S_SEL_ALL;
|
||||
/*
|
||||
* H5T flags
|
||||
*/
|
||||
h5t_flags[0] = (int_f)H5T_NO_CLASS;
|
||||
h5t_flags[1] = (int_f)H5T_INTEGER;
|
||||
h5t_flags[2] = (int_f)H5T_FLOAT;
|
||||
h5t_flags[3] = (int_f)H5T_TIME;
|
||||
h5t_flags[4] = (int_f)H5T_STRING;
|
||||
h5t_flags[5] = (int_f)H5T_BITFIELD;
|
||||
h5t_flags[6] = (int_f)H5T_OPAQUE;
|
||||
h5t_flags[7] = (int_f)H5T_COMPOUND;
|
||||
h5t_flags[8] = (int_f)H5T_REFERENCE;
|
||||
h5t_flags[9] = (int_f)H5T_ENUM;
|
||||
h5t_flags[10] = (int_f)H5T_ORDER_LE;
|
||||
h5t_flags[11] = (int_f)H5T_ORDER_BE;
|
||||
h5t_flags[12] = (int_f)H5T_ORDER_MIXED;
|
||||
h5t_flags[13] = (int_f)H5T_ORDER_VAX;
|
||||
h5t_flags[14] = (int_f)H5T_ORDER_NONE;
|
||||
h5t_flags[15] = (int_f)H5T_PAD_ZERO;
|
||||
h5t_flags[16] = (int_f)H5T_PAD_ONE;
|
||||
h5t_flags[17] = (int_f)H5T_PAD_BACKGROUND;
|
||||
h5t_flags[18] = (int_f)H5T_PAD_ERROR;
|
||||
h5t_flags[19] = (int_f)H5T_SGN_NONE;
|
||||
h5t_flags[20] = (int_f)H5T_SGN_2;
|
||||
h5t_flags[21] = (int_f)H5T_SGN_ERROR;
|
||||
h5t_flags[22] = (int_f)H5T_NORM_IMPLIED;
|
||||
h5t_flags[23] = (int_f)H5T_NORM_MSBSET;
|
||||
h5t_flags[24] = (int_f)H5T_NORM_NONE;
|
||||
h5t_flags[25] = (int_f)H5T_CSET_ASCII;
|
||||
h5t_flags[26] = (int_f)H5T_CSET_UTF8;
|
||||
h5t_flags[27] = (int_f)H5T_STR_NULLTERM;
|
||||
h5t_flags[28] = (int_f)H5T_STR_NULLPAD;
|
||||
h5t_flags[29] = (int_f)H5T_STR_SPACEPAD;
|
||||
h5t_flags[30] = (int_f)H5T_STR_ERROR;
|
||||
h5t_flags[31] = (int_f)H5T_VLEN;
|
||||
h5t_flags[32] = (int_f)H5T_ARRAY;
|
||||
h5t_flags[33] = (int_f)H5T_DIR_ASCEND;
|
||||
h5t_flags[34] = (int_f)H5T_DIR_DESCEND;
|
||||
h5t_flags[0] = (int_f)H5T_NO_CLASS;
|
||||
h5t_flags[1] = (int_f)H5T_INTEGER;
|
||||
h5t_flags[2] = (int_f)H5T_FLOAT;
|
||||
h5t_flags[3] = (int_f)H5T_TIME;
|
||||
h5t_flags[4] = (int_f)H5T_STRING;
|
||||
h5t_flags[5] = (int_f)H5T_BITFIELD;
|
||||
h5t_flags[6] = (int_f)H5T_OPAQUE;
|
||||
h5t_flags[7] = (int_f)H5T_COMPOUND;
|
||||
h5t_flags[8] = (int_f)H5T_REFERENCE;
|
||||
h5t_flags[9] = (int_f)H5T_ENUM;
|
||||
h5t_flags[10] = (int_f)H5T_ORDER_LE;
|
||||
h5t_flags[11] = (int_f)H5T_ORDER_BE;
|
||||
h5t_flags[12] = (int_f)H5T_ORDER_MIXED;
|
||||
h5t_flags[13] = (int_f)H5T_ORDER_VAX;
|
||||
h5t_flags[14] = (int_f)H5T_ORDER_NONE;
|
||||
h5t_flags[15] = (int_f)H5T_PAD_ZERO;
|
||||
h5t_flags[16] = (int_f)H5T_PAD_ONE;
|
||||
h5t_flags[17] = (int_f)H5T_PAD_BACKGROUND;
|
||||
h5t_flags[18] = (int_f)H5T_PAD_ERROR;
|
||||
h5t_flags[19] = (int_f)H5T_SGN_NONE;
|
||||
h5t_flags[20] = (int_f)H5T_SGN_2;
|
||||
h5t_flags[21] = (int_f)H5T_SGN_ERROR;
|
||||
h5t_flags[22] = (int_f)H5T_NORM_IMPLIED;
|
||||
h5t_flags[23] = (int_f)H5T_NORM_MSBSET;
|
||||
h5t_flags[24] = (int_f)H5T_NORM_NONE;
|
||||
h5t_flags[25] = (int_f)H5T_CSET_ASCII;
|
||||
h5t_flags[26] = (int_f)H5T_CSET_UTF8;
|
||||
h5t_flags[27] = (int_f)H5T_STR_NULLTERM;
|
||||
h5t_flags[28] = (int_f)H5T_STR_NULLPAD;
|
||||
h5t_flags[29] = (int_f)H5T_STR_SPACEPAD;
|
||||
h5t_flags[30] = (int_f)H5T_STR_ERROR;
|
||||
h5t_flags[31] = (int_f)H5T_VLEN;
|
||||
h5t_flags[32] = (int_f)H5T_ARRAY;
|
||||
h5t_flags[33] = (int_f)H5T_DIR_ASCEND;
|
||||
h5t_flags[34] = (int_f)H5T_DIR_DESCEND;
|
||||
|
||||
/*
|
||||
* H5Z flags
|
||||
*/
|
||||
h5z_flags[0] = (int_f)H5Z_FILTER_ERROR;
|
||||
h5z_flags[1] = (int_f)H5Z_FILTER_NONE;
|
||||
h5z_flags[2] = (int_f)H5Z_FILTER_DEFLATE;
|
||||
h5z_flags[3] = (int_f)H5Z_FILTER_SHUFFLE;
|
||||
h5z_flags[4] = (int_f)H5Z_FILTER_FLETCHER32;
|
||||
h5z_flags[5] = (int_f)H5Z_ERROR_EDC;
|
||||
h5z_flags[6] = (int_f)H5Z_DISABLE_EDC;
|
||||
h5z_flags[7] = (int_f)H5Z_ENABLE_EDC;
|
||||
h5z_flags[8] = (int_f)H5Z_NO_EDC;
|
||||
h5z_flags[9] = (int_f)H5Z_FILTER_SZIP;
|
||||
h5z_flags[10] = (int_f)H5Z_FLAG_OPTIONAL;
|
||||
h5z_flags[11] = (int_f)H5Z_FILTER_CONFIG_ENCODE_ENABLED;
|
||||
h5z_flags[12] = (int_f)H5Z_FILTER_CONFIG_DECODE_ENABLED;
|
||||
h5z_flags[13] = (int_f)H5Z_FILTER_ALL;
|
||||
h5z_flags[14] = (int_f)H5Z_FILTER_NBIT;
|
||||
h5z_flags[15] = (int_f)H5Z_FILTER_SCALEOFFSET;
|
||||
h5z_flags[16] = (int_f)H5Z_SO_FLOAT_DSCALE;
|
||||
h5z_flags[17] = (int_f)H5Z_SO_FLOAT_ESCALE;
|
||||
h5z_flags[18] = (int_f)H5Z_SO_INT;
|
||||
h5z_flags[19] = (int_f)H5Z_SO_INT_MINBITS_DEFAULT;
|
||||
h5z_flags[0] = (int_f)H5Z_FILTER_ERROR;
|
||||
h5z_flags[1] = (int_f)H5Z_FILTER_NONE;
|
||||
h5z_flags[2] = (int_f)H5Z_FILTER_DEFLATE;
|
||||
h5z_flags[3] = (int_f)H5Z_FILTER_SHUFFLE;
|
||||
h5z_flags[4] = (int_f)H5Z_FILTER_FLETCHER32;
|
||||
h5z_flags[5] = (int_f)H5Z_ERROR_EDC;
|
||||
h5z_flags[6] = (int_f)H5Z_DISABLE_EDC;
|
||||
h5z_flags[7] = (int_f)H5Z_ENABLE_EDC;
|
||||
h5z_flags[8] = (int_f)H5Z_NO_EDC;
|
||||
h5z_flags[9] = (int_f)H5Z_FILTER_SZIP;
|
||||
h5z_flags[10] = (int_f)H5Z_FLAG_OPTIONAL;
|
||||
h5z_flags[11] = (int_f)H5Z_FILTER_CONFIG_ENCODE_ENABLED;
|
||||
h5z_flags[12] = (int_f)H5Z_FILTER_CONFIG_DECODE_ENABLED;
|
||||
h5z_flags[13] = (int_f)H5Z_FILTER_ALL;
|
||||
h5z_flags[14] = (int_f)H5Z_FILTER_NBIT;
|
||||
h5z_flags[15] = (int_f)H5Z_FILTER_SCALEOFFSET;
|
||||
h5z_flags[16] = (int_f)H5Z_SO_FLOAT_DSCALE;
|
||||
h5z_flags[17] = (int_f)H5Z_SO_FLOAT_ESCALE;
|
||||
h5z_flags[18] = (int_f)H5Z_SO_INT;
|
||||
h5z_flags[19] = (int_f)H5Z_SO_INT_MINBITS_DEFAULT;
|
||||
|
||||
/*
|
||||
* H5 Generic flags introduced in version 1.8
|
||||
*/
|
||||
|
||||
/* H5_index_t enum struct */
|
||||
/* H5_index_t enum struct */
|
||||
|
||||
h5_generic_flags[0] = (int_f)H5_INDEX_UNKNOWN; /* Unknown index type */
|
||||
h5_generic_flags[1] = (int_f)H5_INDEX_NAME; /* Index on names */
|
||||
h5_generic_flags[2] = (int_f)H5_INDEX_CRT_ORDER; /* Index on creation order */
|
||||
h5_generic_flags[3] = (int_f)H5_INDEX_N; /* Index on creation order */
|
||||
h5_generic_flags[0] = (int_f)H5_INDEX_UNKNOWN; /* Unknown index type */
|
||||
h5_generic_flags[1] = (int_f)H5_INDEX_NAME; /* Index on names */
|
||||
h5_generic_flags[2] = (int_f)H5_INDEX_CRT_ORDER; /* Index on creation order */
|
||||
h5_generic_flags[3] = (int_f)H5_INDEX_N; /* Index on creation order */
|
||||
|
||||
|
||||
/* H5_iter_order_t enum struct */
|
||||
/* H5_iter_order_t enum struct */
|
||||
|
||||
h5_generic_flags[4] = (int_f)H5_ITER_UNKNOWN; /* Unknown order */
|
||||
h5_generic_flags[5] = (int_f)H5_ITER_INC; /* Increasing order */
|
||||
h5_generic_flags[6] = (int_f)H5_ITER_DEC; /* Decreasing order */
|
||||
h5_generic_flags[7] = (int_f)H5_ITER_NATIVE; /* No particular order, whatever is fastest */
|
||||
h5_generic_flags[8] = (int_f)H5_ITER_N; /* Number of iteration orders */
|
||||
h5_generic_flags[4] = (int_f)H5_ITER_UNKNOWN; /* Unknown order */
|
||||
h5_generic_flags[5] = (int_f)H5_ITER_INC; /* Increasing order */
|
||||
h5_generic_flags[6] = (int_f)H5_ITER_DEC; /* Decreasing order */
|
||||
h5_generic_flags[7] = (int_f)H5_ITER_NATIVE; /* No particular order, whatever is fastest */
|
||||
h5_generic_flags[8] = (int_f)H5_ITER_N; /* Number of iteration orders */
|
||||
|
||||
h5_haddr_generic_flags[0] = (haddr_t_f)HADDR_UNDEF; /* undefined address */
|
||||
h5_haddr_generic_flags[0] = (haddr_t_f)HADDR_UNDEF; /* undefined address */
|
||||
|
||||
ret_value = 0;
|
||||
return ret_value;
|
||||
return 0;
|
||||
}
|
||||
|
||||
int_f
|
||||
|
||||
@@ -25,5 +25,8 @@
|
||||
|
||||
/* Constants used in H5Gf.c files */
|
||||
#define OBJECT_NAMELEN_DEFAULT_F -1
|
||||
|
||||
#define H5_MAX(a,b) (((a)>(b)) ? (a) : (b))
|
||||
|
||||
#endif /* _H5f90_H */
|
||||
|
||||
|
||||
@@ -54,6 +54,7 @@ MODULE H5GLOBAL
|
||||
! If you change the value of these parameters, do not forget to change corresponding
|
||||
! values in the H5f90.h file.
|
||||
INTEGER, PARAMETER :: REF_REG_BUF_LEN = 3
|
||||
INTEGER, PARAMETER :: H5O_TOKEN_BUF_LEN = 16 ! Matches C defined value in H5public.h
|
||||
|
||||
! Parameters used in the function 'h5kind_to_type' located in H5_ff.F90.
|
||||
! The flag is used to tell the function whether the kind input variable
|
||||
@@ -70,13 +71,17 @@ MODULE H5GLOBAL
|
||||
INTEGER, DIMENSION(1:REF_REG_BUF_LEN) :: ref
|
||||
END TYPE hdset_reg_ref_t_f
|
||||
|
||||
TYPE, BIND(C) :: h5o_token_t_f
|
||||
INTEGER(C_INT8_T), DIMENSION(1:H5O_TOKEN_BUF_LEN) :: token
|
||||
END TYPE h5o_token_t_f
|
||||
|
||||
! Do not forget to change these values when new predefined
|
||||
! datatypes are added
|
||||
INTEGER, PARAMETER :: PREDEF_TYPES_LEN = 19
|
||||
INTEGER, PARAMETER :: FLOATING_TYPES_LEN = 4
|
||||
INTEGER, PARAMETER :: INTEGER_TYPES_LEN = 27
|
||||
|
||||
! These arrays need to be global because they are used in
|
||||
! These arrays need to be global because they are used in
|
||||
! both h5open_f and in h5close_f; initialize to fix linking issues
|
||||
! on OSX and Intel compilers.
|
||||
INTEGER(HID_T), DIMENSION(1:PREDEF_TYPES_LEN) :: predef_types = -1
|
||||
|
||||
@@ -21,8 +21,7 @@
|
||||
*/
|
||||
#include "H5f90i_gen.h"
|
||||
|
||||
/* Define _fcd. These are the same on every system
|
||||
* but UNICOS.
|
||||
/* Define _fcd. These are the same on every system but UNICOS.
|
||||
*/
|
||||
#define _fcdtocp(desc) (desc)
|
||||
|
||||
|
||||
+20
-14
@@ -23,7 +23,7 @@ H5_FCDLL void HD5packFstring(char *src, char *dest, size_t len);
|
||||
|
||||
|
||||
/*
|
||||
* Storage info struct used by H5O_info_t and H5F_info_t
|
||||
* Storage info struct used by H5O_info_t and H5F_info_t
|
||||
* interoperable with Fortran.
|
||||
*/
|
||||
typedef struct H5_ih_info_t_f {
|
||||
@@ -31,7 +31,7 @@ typedef struct H5_ih_info_t_f {
|
||||
hsize_t heap_size;
|
||||
} H5_ih_info_t_f;
|
||||
|
||||
/* 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)
|
||||
* interoperable with Fortran.
|
||||
*/
|
||||
typedef struct H5O_hdr_info_t_f {
|
||||
@@ -51,12 +51,11 @@ typedef struct H5O_hdr_info_t_f {
|
||||
} mesg;
|
||||
} H5O_hdr_info_t_f;
|
||||
|
||||
/* Information struct for object (for H5Oget_info/H5Oget_info_by_name/H5Oget_info_by_idx)
|
||||
* interoperable with Fortran.
|
||||
/* Information struct for object (for H5Oget_info/H5Oget_info_by_name/H5Oget_info_by_idx)
|
||||
*/
|
||||
typedef struct H5O_info_t_f {
|
||||
unsigned long fileno; /* File number that object is located in */
|
||||
haddr_t_f addr; /* Object address in file */
|
||||
H5O_token_t token; /* Token of object in file */
|
||||
int type; /* Basic object type (group, dataset, etc.) */
|
||||
int_f rc; /* Reference count of object */
|
||||
int_f atime[8]; /* Access time */
|
||||
@@ -64,13 +63,18 @@ typedef struct H5O_info_t_f {
|
||||
int_f ctime[8]; /* Change time */
|
||||
int_f btime[8]; /* Birth time */
|
||||
hsize_t num_attrs; /* # of attributes attached to object */
|
||||
} H5O_info_t_f;
|
||||
|
||||
/* Information struct for native object (for H5Oget_native_info/H5Oget_native_info_by_name/H5Oget_native_info_by_idx)
|
||||
*/
|
||||
typedef struct H5O_native_info_t_f {
|
||||
H5O_hdr_info_t_f hdr; /* Object header information */
|
||||
/* Extra metadata storage for obj & attributes */
|
||||
struct {
|
||||
H5_ih_info_t_f obj; /* v1/v2 B-tree & local/fractal heap for groups, B-tree for chunked datasets */
|
||||
H5_ih_info_t_f attr; /* v2 B-tree & heap for attributes */
|
||||
} meta_size;
|
||||
} H5O_info_t_f;
|
||||
} H5O_native_info_t_f;
|
||||
|
||||
|
||||
/*
|
||||
@@ -312,12 +316,12 @@ H5_FCDLL int_f h5tconvert_c(hid_t_f *src_id, hid_t_f *dst_id, size_t_f *nelmts,
|
||||
|
||||
H5_FCDLL int_f h5oopen_c(hid_t_f *loc_id, _fcd name, size_t_f *namelen, hid_t_f *lapl_id, hid_t_f *obj_id);
|
||||
H5_FCDLL int_f h5oclose_c(hid_t_f *object_id );
|
||||
H5_FCDLL int_f h5oopen_by_addr_c(hid_t_f *loc_id, haddr_t_f *addr, hid_t_f *obj_id);
|
||||
H5_FCDLL int_f h5oopen_by_token_c(hid_t_f *loc_id, H5O_token_t *token, hid_t_f *obj_id);
|
||||
H5_FCDLL int_f h5olink_c(hid_t_f *object_id, hid_t_f *new_loc_id, _fcd name, size_t_f *namelen,
|
||||
hid_t_f *lcpl_id, hid_t_f *lapl_id);
|
||||
H5_FCDLL int_f h5ovisit_c(hid_t_f *group_id, int_f *index_type, int_f *order, H5O_iterate_t op, void *op_data, int_f *fields);
|
||||
H5_FCDLL int_f h5ovisit_c(hid_t_f *group_id, int_f *index_type, int_f *order, H5O_iterate2_t op, void *op_data, int_f *fields);
|
||||
H5_FCDLL int_f h5ovisit_by_name_c(hid_t_f *loc_id, _fcd object_name, size_t_f *namelen, int_f *index_type, int_f *order,
|
||||
H5O_iterate_t op, void *op_data, hid_t_f *lapl_id, int_f *fields );
|
||||
H5O_iterate2_t op, void *op_data, hid_t_f *lapl_id, int_f *fields );
|
||||
H5_FCDLL int_f h5oget_info_c(hid_t_f *object_id, H5O_info_t_f *object_info, int_f *fields);
|
||||
H5_FCDLL int_f h5oget_info_by_idx_c(hid_t_f *loc_id, _fcd group_name, size_t_f *namelen,
|
||||
int_f *index_field, int_f *order, hsize_t_f *n, hid_t_f *lapl_id, H5O_info_t_f *object_info, int_f *fields);
|
||||
@@ -336,6 +340,8 @@ H5_FCDLL int_f h5oopen_by_idx_c(hid_t_f *loc_id, _fcd group_name, size_t_f *gro
|
||||
H5_FCDLL int_f h5oget_comment_c(hid_t_f *object_id, _fcd comment, size_t_f *commentsize, hssize_t_f *bufsize);
|
||||
H5_FCDLL int_f h5oget_comment_by_name_c(hid_t_f *loc_id, _fcd name, size_t_f *name_size,
|
||||
_fcd comment, size_t_f *commentsize, size_t_f *bufsize, hid_t_f *lapl_id);
|
||||
H5_FCDLL int_f h5otoken_cmp_c(hid_t_f *loc_id, H5O_token_t *token1,
|
||||
H5O_token_t *token2, int_f *cmp_value);
|
||||
/*
|
||||
* Functions from H5Pf.c
|
||||
*/
|
||||
@@ -568,11 +574,11 @@ H5_FCDLL int_f h5ldelete_by_idx_c(hid_t_f *loc_id, _fcd group_name, size_t_f *gr
|
||||
H5_FCDLL int_f h5lexists_c(hid_t_f *loc_id, _fcd name, size_t_f *namelen, hid_t_f *lapl_id, int_f *link_exists);
|
||||
H5_FCDLL int_f h5lget_info_c(hid_t_f *link_loc_id, _fcd link_name, size_t_f *link_namelen,
|
||||
int_f *cset, int_f *corder, int_f *corder_valid, int_f *link_type,
|
||||
haddr_t_f *address, size_t_f *val_size,
|
||||
hid_t_f *lapl_id);
|
||||
H5O_token_t *token, size_t_f *val_size, hid_t_f *lapl_id);
|
||||
H5_FCDLL int_f h5lget_info_by_idx_c(hid_t_f *loc_id, _fcd group_name, size_t_f *group_namelen,
|
||||
int_f *index_field, int_f *order, hsize_t_f *n,
|
||||
int_f *link_type, int_f *corder_valid, int_f *corder, int_f *cset, haddr_t_f *address, size_t_f *val_size, hid_t_f *lapl_id);
|
||||
int_f *link_type, int_f *corder_valid, int_f *corder,
|
||||
int_f *cset, H5O_token_t *token, size_t_f *val_size, hid_t_f *lapl_id);
|
||||
H5_FCDLL int_f h5lis_registered_c(int_f *link_cls_id);
|
||||
H5_FCDLL int_f h5lmove_c(hid_t_f *src_loc_id, _fcd src_name, size_t_f *src_namelen, hid_t_f *dest_loc_id,
|
||||
_fcd dest_name, size_t_f *dest_namelen, hid_t_f *lcpl_id, hid_t_f *lapl_id);
|
||||
@@ -582,8 +588,8 @@ H5_FCDLL int_f h5lget_name_by_idx_c(hid_t_f *loc_id, _fcd group_name, size_t_f *
|
||||
H5_FCDLL int_f h5lget_val_c(hid_t_f *link_loc_id, _fcd link_name, size_t_f *link_namelen, size_t_f *size,
|
||||
void *linkval_buff, hid_t_f *lapl_id) ;
|
||||
|
||||
H5_FCDLL int_f h5literate_c(hid_t_f *group_id, int_f *index_type, int_f *order, hsize_t_f *idx, H5L_iterate_t op, void *op_data );
|
||||
H5_FCDLL int_f h5literate_by_name_c(hid_t_f *loc_id, _fcd name, size_t_f *namelen, int_f *index_type, int_f *order, hsize_t_f *idx, H5L_iterate_t op, void *op_data, hid_t_f *lapl_id);
|
||||
H5_FCDLL int_f h5literate_c(hid_t_f *group_id, int_f *index_type, int_f *order, hsize_t_f *idx, H5L_iterate2_t op, void *op_data );
|
||||
H5_FCDLL int_f h5literate_by_name_c(hid_t_f *loc_id, _fcd name, size_t_f *namelen, int_f *index_type, int_f *order, hsize_t_f *idx, H5L_iterate2_t op, void *op_data, hid_t_f *lapl_id);
|
||||
|
||||
|
||||
#endif /* _H5f90proto_H */
|
||||
|
||||
@@ -414,13 +414,19 @@ int main(void)
|
||||
return -1;
|
||||
}
|
||||
|
||||
/* Need the buffer size for the fortran derive type 'hdset_reg_ref_t_f03'
|
||||
/* Need the buffer size for the fortran derived type 'hdset_reg_ref_t_f03'
|
||||
* in order to be interoperable with C's structure, the C buffer size
|
||||
* H5R_DSET_REG_REF_BUF_SIZE is (sizeof(haddr_t)+4)
|
||||
*/
|
||||
|
||||
|
||||
fprintf(fort_header, " INTEGER, PARAMETER :: H5R_DSET_REG_REF_BUF_SIZE_F = %u\n", H5_SIZEOF_HADDR_T + 4 );
|
||||
|
||||
/* Need the buffer size for the fortran derived type 'h5o_token_t'
|
||||
* in order to be interoperable with C's structure.
|
||||
*/
|
||||
|
||||
fprintf(fort_header, " INTEGER, PARAMETER :: H5O_MAX_TOKEN_SIZE_F = %u\n", H5O_MAX_TOKEN_SIZE);
|
||||
|
||||
/* Close files */
|
||||
endCfile();
|
||||
endFfile();
|
||||
|
||||
+10
-10
@@ -87,7 +87,7 @@ Quick overview of the Fortran APIs
|
||||
to the file, a C program will read it as a 6x4 two-dimensional dataset into
|
||||
memory. The HDF5 C utilities h5dump and h5ls display transposed data, if
|
||||
data is written from a Fortran program.
|
||||
|
||||
|
||||
* Fortran indices are 1 based.
|
||||
|
||||
============================
|
||||
@@ -105,29 +105,29 @@ Procedure to add a new function
|
||||
Procedure for passing C variables to Fortran
|
||||
---------------------------------------------
|
||||
|
||||
(1) Find the C struct name you are interested in:
|
||||
(1) Find the C struct name you are interested in:
|
||||
(a) src/H5public.h if it is a generic type, i.e. H5_*
|
||||
or
|
||||
(b) src/H5*public.h if is a specific type, i.e. H5*_
|
||||
|
||||
(b) src/H5*public.h if is a specific type, i.e. H5*_
|
||||
|
||||
(2) Put that structure into an array that will be passed to fortran in:
|
||||
(a) fortran/src/H5_f.c (add to nh5init_flags_c subroutine)
|
||||
(b) edit fortran/src/H5f90proto.h and edit nh5init_flags_c interface call
|
||||
|
||||
|
||||
(3) Edit the function call in fortran/src/H5_ff.F90
|
||||
(a) edit the call: FUNCTION h5init_flags_c
|
||||
(a) edit the call: FUNCTION h5init_flags_c
|
||||
(b) edit h5init_flags_c call in h5open_f to match the number of arguments passing
|
||||
|
||||
(4) add the size of the array and array to fortran/src/H5f90global.F90
|
||||
|
||||
(4) add the size of the array and array to fortran/src/H5f90global.F90
|
||||
- must match the size found it H5_f.c
|
||||
|
||||
NOTE: To just add a default C value argument, do steps (2a) and (4)
|
||||
NOTE: To just add a default C value argument, do steps (2a) and (4)
|
||||
|
||||
|
||||
Procedure for adding a new file to the repository
|
||||
--------------------------------------------------
|
||||
|
||||
Add the name of the file to the:
|
||||
Add the name of the file to the:
|
||||
(1) Makefile.am located in the same directory as the newfile
|
||||
(2) CMakeLists.txt located in the same directory as the newfile
|
||||
(3) MANIFEST located in the top level directory
|
||||
|
||||
@@ -175,7 +175,7 @@ H5O_mp_H5OGET_COMMENT_F
|
||||
H5O_mp_H5OGET_COMMENT_BY_NAME_F
|
||||
H5O_mp_H5OINCR_REFCOUNT_F
|
||||
H5O_mp_H5OLINK_F
|
||||
H5O_mp_H5OOPEN_BY_ADDR_F
|
||||
H5O_mp_H5OOPEN_BY_TOKEN_F
|
||||
H5O_mp_H5OOPEN_BY_IDX_F
|
||||
H5O_mp_H5OOPEN_F
|
||||
H5O_mp_H5OSET_COMMENT_F
|
||||
@@ -185,6 +185,7 @@ H5O_mp_H5OGET_INFO_BY_NAME_F
|
||||
H5O_mp_H5OGET_INFO_F
|
||||
H5O_mp_H5OVISIT_BY_NAME_F
|
||||
H5O_mp_H5OVISIT_F
|
||||
H5O_mp_H5OTOKEN_CMP_F
|
||||
; H5P
|
||||
H5P_mp_H5PCREATE_F
|
||||
H5P_mp_H5PSET_PRESERVE_F
|
||||
@@ -459,6 +460,7 @@ H5VL_mp_H5VLREGISTER_CONNECTOR_BY_NAME_F
|
||||
H5VL_mp_H5VLREGISTER_CONNECTOR_BY_VALUE_F
|
||||
H5VL_mp_H5VLIS_CONNECTOR_REGISTERED_F
|
||||
H5VL_mp_H5VLGET_CONNECTOR_ID_F
|
||||
H5VL_mp_H5VLGET_CONNECTOR_ID_BY_NAME_F
|
||||
H5VL_mp_H5VLGET_CONNECTOR_NAME_F
|
||||
H5VL_mp_H5VLCLOSE_F
|
||||
H5VL_mp_H5VLUNREGISTER_CONNECTOR_F
|
||||
|
||||
@@ -517,4 +517,6 @@ else ()
|
||||
add_dependencies (vol_connector ${HDF5_F90_TEST_LIBSH_TARGET})
|
||||
endif ()
|
||||
|
||||
include (CMakeTests.cmake)
|
||||
if (HDF5_TEST_FORTRAN AND HDF5_TEST_SERIAL)
|
||||
include (CMakeTests.cmake)
|
||||
endif ()
|
||||
|
||||
@@ -153,7 +153,7 @@ PROGRAM fortranlibtest_F03
|
||||
|
||||
! write(*,*)
|
||||
! write(*,*) '========================================='
|
||||
! write(*,*) 'Testing GROUP interface '
|
||||
! write(*,*) 'Testing OBJECT interface '
|
||||
! write(*,*) '========================================='
|
||||
|
||||
ret_total_error = 0
|
||||
@@ -161,11 +161,11 @@ PROGRAM fortranlibtest_F03
|
||||
CALL write_test_status(ret_total_error, ' Testing object functions ', total_error)
|
||||
|
||||
ret_total_error = 0
|
||||
CALL obj_visit(ret_total_error)
|
||||
CALL test_obj_visit(ret_total_error)
|
||||
CALL write_test_status(ret_total_error, ' Testing object visiting functions ', total_error)
|
||||
|
||||
ret_total_error = 0
|
||||
CALL obj_info(ret_total_error)
|
||||
CALL test_obj_info(ret_total_error)
|
||||
CALL write_test_status(ret_total_error, ' Testing object info functions ', total_error)
|
||||
|
||||
ret_total_error = 0
|
||||
|
||||
+27
-27
@@ -665,11 +665,11 @@ SUBROUTINE group_info(cleanup, fapl, total_error)
|
||||
! H5L_TYPE_SOFT_F - Soft link
|
||||
! H5L_TYPE_EXTERNAL_F - External link
|
||||
! H5L_TYPE_ERROR _F - Error
|
||||
INTEGER(HADDR_T) :: address ! If the link is a hard link, address specifies the file address that the link points to
|
||||
TYPE(H5O_TOKEN_T_F) :: token ! If the link is a hard link, token specifies the object token that the link points to
|
||||
INTEGER(SIZE_T) :: val_size ! If the link is a symbolic link, val_size will be the length of the link value
|
||||
|
||||
|
||||
! WRITE(*,*) "link creation (w/new group format)"
|
||||
WRITE(*,*) "link creation (w/new group format)"
|
||||
|
||||
! Create a file
|
||||
CALL h5fcreate_f(FileName, H5F_ACC_TRUNC_F, file, error, H5P_DEFAULT_F, fapl)
|
||||
@@ -698,7 +698,7 @@ SUBROUTINE group_info(cleanup, fapl, total_error)
|
||||
CALL check("H5Lcreate_soft_f", error, total_error)
|
||||
|
||||
CALL H5Lget_info_f(file, "grp1/soft", &
|
||||
cset, corder, f_corder_valid, link_type, address, val_size, &
|
||||
cset, corder, f_corder_valid, link_type, token, val_size, &
|
||||
error, H5P_DEFAULT_F)
|
||||
CALL check("H5Lget_info_f",error,total_error)
|
||||
|
||||
@@ -770,7 +770,7 @@ SUBROUTINE group_info(cleanup, fapl, total_error)
|
||||
! H5L_TYPE_SOFT_F - Soft link
|
||||
! H5L_TYPE_EXTERNAL_F - External link
|
||||
! H5L_TYPE_ERROR _F - Error
|
||||
INTEGER(HADDR_T) :: address ! If the link is a hard link, address specifies the file address that the link points to
|
||||
TYPE(H5O_TOKEN_T_F) :: token ! If the link is a hard link, token specifies the object token that the link points to
|
||||
INTEGER(SIZE_T) :: val_size ! If the link is a symbolic link, val_size will be the length of the link value
|
||||
|
||||
INTEGER :: error
|
||||
@@ -816,7 +816,7 @@ SUBROUTINE group_info(cleanup, fapl, total_error)
|
||||
|
||||
! Get the group's link's information
|
||||
CALL H5Lget_info_f(file_id, "group", &
|
||||
cset, corder, f_corder_valid, link_type, address, val_size, &
|
||||
cset, corder, f_corder_valid, link_type, token, val_size, &
|
||||
error, H5P_DEFAULT_F)
|
||||
CALL check("H5Lget_info_f",error,total_error)
|
||||
|
||||
@@ -1179,7 +1179,7 @@ SUBROUTINE delete_by_idx(cleanup, fapl, total_error)
|
||||
INTEGER :: cset ! Indicates the character set used for the attribute’s name
|
||||
INTEGER(SIZE_T) :: val_size
|
||||
INTEGER :: link_type
|
||||
INTEGER(HADDR_T) :: address
|
||||
TYPE(H5O_TOKEN_T_F) :: token
|
||||
|
||||
INTEGER :: u ! Local index variable
|
||||
INTEGER :: Input1, i
|
||||
@@ -1309,10 +1309,10 @@ SUBROUTINE delete_by_idx(cleanup, fapl, total_error)
|
||||
! HDmemset(&linfo, 0, sizeof(linfo));
|
||||
|
||||
CALL H5Lget_info_by_idx_f(group_id, ".", idx_type, iorder, INT(0,HSIZE_T), &
|
||||
link_type, f_corder_valid, corder, cset, address, val_size, error)
|
||||
link_type, f_corder_valid, corder, cset, token, val_size, error)
|
||||
|
||||
CALL H5Oopen_by_addr_f(group_id, address, grp, error)
|
||||
CALL check("H5Oopen_by_addr_f", error, total_error)
|
||||
CALL H5Oopen_by_token_f(group_id, token, grp, error)
|
||||
CALL check("H5Oopen_by_token_f", error, total_error)
|
||||
|
||||
CALL H5Iget_type_f(grp, id_type, error)
|
||||
CALL check("H5Iget_type_f", error, total_error)
|
||||
@@ -1357,11 +1357,11 @@ SUBROUTINE delete_by_idx(cleanup, fapl, total_error)
|
||||
|
||||
! Close the group creation property list
|
||||
CALL H5Pclose_f(gcpl_id, error)
|
||||
CALL check("delete_by_idx.H5Gclose_f", error, total_error)
|
||||
CALL check("delete_by_idx.H5Pclose_f", error, total_error)
|
||||
|
||||
! Close the file
|
||||
CALL H5Fclose_f(file_id, error)
|
||||
CALL check("delete_by_idx.H5Gclose_f", error, total_error)
|
||||
CALL check("delete_by_idx.H5Fclose_f", error, total_error)
|
||||
|
||||
IF(cleanup) CALL h5_cleanup_f("file0", H5P_DEFAULT_F, error)
|
||||
CALL check("h5_cleanup_f", error, total_error)
|
||||
@@ -1407,7 +1407,7 @@ SUBROUTINE link_info_by_idx_check(group_id, linkname, n, &
|
||||
INTEGER :: corder ! Is a positive integer containing the creation order of the attribute
|
||||
INTEGER :: cset ! Indicates the character set used for the attribute’s name
|
||||
INTEGER :: link_type
|
||||
INTEGER(HADDR_T) :: address
|
||||
TYPE(H5O_TOKEN_T_F) :: token
|
||||
INTEGER(SIZE_T) :: val_size ! Indicates the size, in the number of characters, of the attribute
|
||||
|
||||
CHARACTER(LEN=7) :: tmpname ! Temporary link name
|
||||
@@ -1427,14 +1427,14 @@ SUBROUTINE link_info_by_idx_check(group_id, linkname, n, &
|
||||
! Verify the link information for first link, in increasing creation order
|
||||
! HDmemset(&linfo, 0, sizeof(linfo));
|
||||
CALL H5Lget_info_by_idx_f(group_id, ".", H5_INDEX_CRT_ORDER_F, H5_ITER_INC_F, INT(0,HSIZE_T), &
|
||||
link_type, f_corder_valid, corder, cset, address, val_size, error)
|
||||
link_type, f_corder_valid, corder, cset, token, val_size, error)
|
||||
CALL check("H5Lget_info_by_idx_f", error, total_error)
|
||||
CALL verify("H5Lget_info_by_idx_f", corder, 0, total_error)
|
||||
|
||||
! Verify the link information for new link, in increasing creation order
|
||||
! HDmemset(&linfo, 0, sizeof(linfo));
|
||||
CALL H5Lget_info_by_idx_f(group_id, ".", H5_INDEX_CRT_ORDER_F, H5_ITER_INC_F, INT(n,HSIZE_T), &
|
||||
link_type, f_corder_valid, corder, cset, address, val_size, error)
|
||||
link_type, f_corder_valid, corder, cset, token, val_size, error)
|
||||
CALL check("H5Lget_info_by_idx_f", error, total_error)
|
||||
CALL verify("H5Lget_info_by_idx_f", corder, n, total_error)
|
||||
|
||||
@@ -1516,7 +1516,7 @@ SUBROUTINE link_info_by_idx_check(group_id, linkname, n, &
|
||||
! H5L_TYPE_SOFT_F - Soft link
|
||||
! H5L_TYPE_EXTERNAL_F - External link
|
||||
! H5L_TYPE_ERROR _F - Error
|
||||
INTEGER(HADDR_T) :: address ! If the link is a hard link, address specifies the file address that the link points to
|
||||
TYPE(H5O_TOKEN_T_F) :: token ! If the link is a hard link, token specifies the object token that the link points to
|
||||
INTEGER(SIZE_T) :: val_size ! If the link is a symbolic link, val_size will be the length of the link value
|
||||
|
||||
CHARACTER(LEN=1024) :: filename = 'tempfile.h5'
|
||||
@@ -1555,7 +1555,7 @@ SUBROUTINE link_info_by_idx_check(group_id, linkname, n, &
|
||||
! Check that its character encoding is the default
|
||||
|
||||
CALL H5Lget_info_f(file_id, "group", &
|
||||
cset, corder, f_corder_valid, link_type, address, val_size, &
|
||||
cset, corder, f_corder_valid, link_type, token, val_size, &
|
||||
error, H5P_DEFAULT_F)
|
||||
|
||||
! File-wide default character encoding can not yet be set via the file
|
||||
@@ -1575,7 +1575,7 @@ SUBROUTINE link_info_by_idx_check(group_id, linkname, n, &
|
||||
|
||||
! Check that its character encoding is the default
|
||||
CALL H5Lget_info_f(file_id, "type", &
|
||||
cset, corder, f_corder_valid, link_type, address, val_size, &
|
||||
cset, corder, f_corder_valid, link_type, token, val_size, &
|
||||
error)
|
||||
CALL check("h5tclose_f", error, total_error)
|
||||
|
||||
@@ -1636,7 +1636,7 @@ SUBROUTINE link_info_by_idx_check(group_id, linkname, n, &
|
||||
|
||||
! Check that its character encoding is the default
|
||||
CALL H5Lget_info_f(file_id, "dataset", &
|
||||
cset, corder, f_corder_valid, link_type, address, val_size, &
|
||||
cset, corder, f_corder_valid, link_type, token, val_size, &
|
||||
error)
|
||||
CALL check("H5Lget_info_f", error, total_error)
|
||||
|
||||
@@ -1661,7 +1661,7 @@ SUBROUTINE link_info_by_idx_check(group_id, linkname, n, &
|
||||
|
||||
! Check that its character encoding is UTF-8
|
||||
CALL H5Lget_info_f(file_id, "group2", &
|
||||
cset, corder, f_corder_valid, link_type, address, val_size, &
|
||||
cset, corder, f_corder_valid, link_type, token, val_size, &
|
||||
error)
|
||||
CALL check("H5Lget_info_f", error, total_error)
|
||||
CALL verify("H5Lget_info_f",cset, H5T_CSET_UTF8_F,total_error)
|
||||
@@ -1679,7 +1679,7 @@ SUBROUTINE link_info_by_idx_check(group_id, linkname, n, &
|
||||
|
||||
! Check that its character encoding is UTF-8
|
||||
CALL H5Lget_info_f(file_id, "type2", &
|
||||
cset, corder, f_corder_valid, link_type, address, val_size, &
|
||||
cset, corder, f_corder_valid, link_type, token, val_size, &
|
||||
error)
|
||||
CALL check("H5Lget_info_f", error, total_error)
|
||||
CALL verify("H5Lget_info_f",cset, H5T_CSET_UTF8_F,total_error)
|
||||
@@ -1697,7 +1697,7 @@ SUBROUTINE link_info_by_idx_check(group_id, linkname, n, &
|
||||
|
||||
! Check that its character encoding is UTF-8
|
||||
CALL H5Lget_info_f(file_id, "dataset2", &
|
||||
cset, corder, f_corder_valid, link_type, address, val_size, &
|
||||
cset, corder, f_corder_valid, link_type, token, val_size, &
|
||||
error)
|
||||
CALL check("H5Lget_info_f", error, total_error)
|
||||
CALL verify("H5Lget_info_f2",cset, H5T_CSET_UTF8_F,total_error)
|
||||
@@ -1719,7 +1719,7 @@ SUBROUTINE link_info_by_idx_check(group_id, linkname, n, &
|
||||
|
||||
! Check that its character encoding is ASCII
|
||||
CALL H5Lget_info_f(file_id, "/dataset2_link", &
|
||||
cset, corder, f_corder_valid, link_type, address, val_size, &
|
||||
cset, corder, f_corder_valid, link_type, token, val_size, &
|
||||
error)
|
||||
CALL check("H5Lget_info_f", error, total_error)
|
||||
CALL verify("H5Lget_info_f",cset, H5T_CSET_ASCII_F,total_error)
|
||||
@@ -1727,7 +1727,7 @@ SUBROUTINE link_info_by_idx_check(group_id, linkname, n, &
|
||||
! Check that the first link's encoding hasn't changed
|
||||
|
||||
CALL H5Lget_info_f(file_id, "/dataset2", &
|
||||
cset, corder, f_corder_valid, link_type, address, val_size, &
|
||||
cset, corder, f_corder_valid, link_type, token, val_size, &
|
||||
error)
|
||||
CALL check("H5Lget_info_f", error, total_error)
|
||||
CALL verify("H5Lget_info_f3",cset, H5T_CSET_UTF8_F,total_error)
|
||||
@@ -1742,7 +1742,7 @@ SUBROUTINE link_info_by_idx_check(group_id, linkname, n, &
|
||||
CALL check("H5Lcreate_soft_f", error, total_error)
|
||||
|
||||
CALL H5Lget_info_f(file_id, "slink_to_dset2", &
|
||||
cset, corder, f_corder_valid, link_type, address, val_size, &
|
||||
cset, corder, f_corder_valid, link_type, token, val_size, &
|
||||
error)
|
||||
CALL check("H5Lget_info_f", error, total_error)
|
||||
CALL verify("H5Lget_info_f",cset, H5T_CSET_UTF8_F,total_error)
|
||||
@@ -1756,7 +1756,7 @@ SUBROUTINE link_info_by_idx_check(group_id, linkname, n, &
|
||||
CALL check("H5Lmove_f",error, total_error)
|
||||
|
||||
CALL H5Lget_info_f(file_id, "moved_slink", &
|
||||
cset, corder, f_corder_valid, link_type, address, val_size, &
|
||||
cset, corder, f_corder_valid, link_type, token, val_size, &
|
||||
error)
|
||||
CALL check("H5Lget_info_f", error, total_error)
|
||||
CALL verify("H5Lget_info_f",cset, H5T_CSET_ASCII_F,total_error)
|
||||
@@ -1770,7 +1770,7 @@ SUBROUTINE link_info_by_idx_check(group_id, linkname, n, &
|
||||
CALL H5Lcopy_f(file_id, "moved_slink", file_id, "copied_slink", error, lcpl_id)
|
||||
|
||||
CALL H5Lget_info_f(file_id, "copied_slink", &
|
||||
cset, corder, f_corder_valid, link_type, address, val_size, &
|
||||
cset, corder, f_corder_valid, link_type, token, val_size, &
|
||||
error)
|
||||
CALL check("H5Lget_info_f", error, total_error)
|
||||
CALL verify("H5Lget_info_f",cset, H5T_CSET_UTF8_F,total_error)
|
||||
@@ -1782,7 +1782,7 @@ SUBROUTINE link_info_by_idx_check(group_id, linkname, n, &
|
||||
CALL check("H5Lcreate_external_f", error, total_error)
|
||||
|
||||
CALL H5Lget_info_f(file_id, "extlink", &
|
||||
cset, corder, f_corder_valid, link_type, address, val_size, &
|
||||
cset, corder, f_corder_valid, link_type, token, val_size, &
|
||||
error)
|
||||
CALL check("H5Lget_info_f", error, total_error)
|
||||
CALL verify("H5Lget_info_f",cset, H5T_CSET_UTF8_F,total_error)
|
||||
|
||||
+35
-133
@@ -63,27 +63,33 @@ MODULE visit_cb
|
||||
|
||||
CONTAINS
|
||||
|
||||
! Compares the field values of a C h5O_info_t and a Fortran H5O_info_t.
|
||||
! Compares the field values of a C H5O_info_t and a Fortran H5O_info_t.
|
||||
|
||||
INTEGER FUNCTION compare_h5o_info_t( loc_id, oinfo_f, oinfo_c, field, full_f_field ) RESULT(status)
|
||||
|
||||
INTEGER FUNCTION compare_h5o_info_t( oinfo_f, oinfo_c, field, full_f_field ) RESULT(status)
|
||||
|
||||
IMPLICIT NONE
|
||||
INTEGER(HID_T) :: loc_id
|
||||
TYPE(h5o_info_t) :: oinfo_f
|
||||
TYPE(c_h5o_info_t) :: oinfo_c
|
||||
TYPE(H5O_TOKEN_T_F) :: token_c
|
||||
INTEGER :: field
|
||||
LOGICAL :: full_f_field ! All the fields of Fortran H5O_info_t where filled
|
||||
LOGICAL :: full_f_field ! All the fields of Fortran H5O_info_t where filled
|
||||
! local
|
||||
INTEGER(C_INT), DIMENSION(1:8) :: atime, btime, ctime, mtime
|
||||
INTEGER :: cmp_value
|
||||
INTEGER :: i
|
||||
INTEGER :: ierr
|
||||
|
||||
status = 0
|
||||
|
||||
|
||||
IF( (field .EQ. H5O_INFO_BASIC_F).OR.(field .EQ. H5O_INFO_ALL_F) )THEN
|
||||
IF( (oinfo_f%fileno.LE.0) .OR. (oinfo_c%fileno .NE. oinfo_f%fileno) )THEN
|
||||
status = -1
|
||||
RETURN
|
||||
ENDIF
|
||||
IF( (oinfo_f%addr.LE.0) .OR. (oinfo_c%addr .NE. oinfo_f%addr) )THEN
|
||||
token_c%token = oinfo_c%token%token
|
||||
CALL H5Otoken_cmp_f(loc_id, oinfo_f%token, token_c, cmp_value, ierr);
|
||||
IF( (ierr .EQ. -1) .OR. (cmp_value .NE. 0) ) THEN
|
||||
status = -1
|
||||
RETURN
|
||||
ENDIF
|
||||
@@ -131,7 +137,12 @@ CONTAINS
|
||||
! check other field values are not filled (using only a small subset to check)
|
||||
status = 0
|
||||
IF( oinfo_c%fileno .NE. oinfo_f%fileno) status = status + 1
|
||||
IF( oinfo_c%addr .NE. oinfo_f%addr) status = status + 1
|
||||
token_c%token = oinfo_c%token%token
|
||||
CALL H5Otoken_cmp_f(loc_id, oinfo_f%token, token_c, cmp_value, ierr);
|
||||
IF( (ierr .EQ. -1) .OR. (cmp_value .NE. 0) ) THEN
|
||||
status = -1
|
||||
RETURN
|
||||
ENDIF
|
||||
IF( oinfo_c%type .NE. oinfo_f%type) status = status + 1
|
||||
IF( oinfo_c%rc .NE. oinfo_f%rc) status = status + 1
|
||||
IF(status.EQ.0) THEN ! There was no difference found, which is only possible if the field was filled.
|
||||
@@ -150,93 +161,12 @@ CONTAINS
|
||||
! check other field values are not filled (using only a small subset to check)
|
||||
status = 0
|
||||
IF( oinfo_c%fileno .NE. oinfo_f%fileno) status = status + 1
|
||||
IF( oinfo_c%addr .NE. oinfo_f%addr) status = status + 1
|
||||
IF( oinfo_c%type .NE. oinfo_f%type) status = status + 1
|
||||
IF( oinfo_c%rc .NE. oinfo_f%rc) status = status + 1
|
||||
IF(status.EQ.0) THEN ! There was no difference found, which is only possible if the field was filled.
|
||||
token_c%token = oinfo_c%token%token
|
||||
CALL H5Otoken_cmp_f(loc_id, oinfo_f%token, token_c, cmp_value, ierr);
|
||||
IF( (ierr .EQ. -1) .OR. (cmp_value .NE. 0) ) THEN
|
||||
status = -1
|
||||
RETURN
|
||||
ENDIF
|
||||
status = 0 ! reset
|
||||
|
||||
ENDIF
|
||||
|
||||
IF((field).EQ.H5O_INFO_HDR_F.OR.(field .EQ. H5O_INFO_ALL_F))THEN
|
||||
IF( (oinfo_f%hdr%version.LT.0) .OR. (oinfo_c%hdr%version .NE. oinfo_f%hdr%version) )THEN
|
||||
status = -1
|
||||
RETURN
|
||||
ENDIF
|
||||
IF( (oinfo_f%hdr%nmesgs.LT.0) .OR. (oinfo_c%hdr%nmesgs .NE. oinfo_f%hdr%nmesgs) )THEN
|
||||
status = -1
|
||||
RETURN
|
||||
ENDIF
|
||||
IF( (oinfo_f%hdr%nchunks.LT.0) .OR. (oinfo_c%hdr%nchunks .NE. oinfo_f%hdr%nchunks) )THEN
|
||||
status = -1
|
||||
RETURN
|
||||
ENDIF
|
||||
IF( (oinfo_f%hdr%flags.LT.0) .OR. (oinfo_c%hdr%flags .NE. oinfo_f%hdr%flags) )THEN
|
||||
status = -1
|
||||
RETURN
|
||||
ENDIF
|
||||
IF( (oinfo_f%hdr%space%total.LT.0) .OR. (oinfo_c%hdr%space%total .NE. oinfo_f%hdr%space%total) )THEN
|
||||
status = -1
|
||||
RETURN
|
||||
ENDIF
|
||||
IF( (oinfo_f%hdr%space%meta.LT.0) .OR. (oinfo_c%hdr%space%meta .NE. oinfo_f%hdr%space%meta) )THEN
|
||||
status = -1
|
||||
RETURN
|
||||
ENDIF
|
||||
IF( (oinfo_f%hdr%space%mesg.LT.0) .OR. (oinfo_c%hdr%space%mesg .NE. oinfo_f%hdr%space%mesg) )THEN
|
||||
status = -1
|
||||
RETURN
|
||||
ENDIF
|
||||
IF( (oinfo_f%hdr%space%free.LT.0) .OR. (oinfo_c%hdr%space%free .NE. oinfo_f%hdr%space%free) )THEN
|
||||
status = -1
|
||||
RETURN
|
||||
ENDIF
|
||||
IF( (oinfo_f%hdr%mesg%present.LT.0) .OR. (oinfo_c%hdr%mesg%present .NE. oinfo_f%hdr%mesg%present) )THEN
|
||||
status = -1
|
||||
RETURN
|
||||
ENDIF
|
||||
IF( (oinfo_f%hdr%mesg%shared.LT.0) .OR. (oinfo_c%hdr%mesg%shared .NE. oinfo_f%hdr%mesg%shared) )THEN
|
||||
status = -1
|
||||
RETURN
|
||||
ENDIF
|
||||
ELSE IF( field .EQ. H5O_INFO_HDR_F.AND.full_f_field)THEN
|
||||
! check other field values are not filled (using only a small subset to check)
|
||||
status = 0
|
||||
IF( oinfo_c%fileno .NE. oinfo_f%fileno) status = status + 1
|
||||
IF( oinfo_c%addr .NE. oinfo_f%addr) status = status + 1
|
||||
IF( oinfo_c%type .NE. oinfo_f%type) status = status + 1
|
||||
IF( oinfo_c%rc .NE. oinfo_f%rc) status = status + 1
|
||||
IF(status.EQ.0) THEN ! There was no difference found, which is only possible if the field was filled.
|
||||
status = -1
|
||||
RETURN
|
||||
ENDIF
|
||||
status = 0 ! reset
|
||||
ENDIF
|
||||
IF((field).EQ.H5O_INFO_META_SIZE_F.OR.(field .EQ. H5O_INFO_ALL_F))THEN
|
||||
IF((oinfo_f%meta_size%obj%index_size.LT.0).OR.(oinfo_c%meta_size%obj%index_size.NE.oinfo_f%meta_size%obj%index_size))THEN
|
||||
status = -1
|
||||
RETURN
|
||||
ENDIF
|
||||
IF((oinfo_f%meta_size%obj%heap_size.LT.0).OR.(oinfo_c%meta_size%obj%heap_size.NE.oinfo_f%meta_size%obj%heap_size))THEN
|
||||
status = -1
|
||||
RETURN
|
||||
ENDIF
|
||||
IF((oinfo_f%meta_size%attr%index_size.LT.0).OR.(oinfo_c%meta_size%attr%index_size.NE.oinfo_f%meta_size%attr%index_size))THEN
|
||||
status = -1
|
||||
RETURN
|
||||
ENDIF
|
||||
IF((oinfo_f%meta_size%attr%heap_size.LT.0).OR.(oinfo_c%meta_size%attr%heap_size.NE.oinfo_f%meta_size%attr%heap_size))THEN
|
||||
status = -1
|
||||
RETURN
|
||||
ENDIF
|
||||
ELSE IF( field .EQ. H5O_INFO_META_SIZE_F.AND.full_f_field)THEN
|
||||
! check other field values are not filled (using only a small subset to check)
|
||||
status = 0
|
||||
IF( oinfo_c%fileno .NE. oinfo_f%fileno) status = status + 1
|
||||
IF( oinfo_c%addr .NE. oinfo_f%addr) status = status + 1
|
||||
IF( oinfo_c%type .NE. oinfo_f%type) status = status + 1
|
||||
IF( oinfo_c%rc .NE. oinfo_f%rc) status = status + 1
|
||||
IF(status.EQ.0) THEN ! There was no difference found, which is only possible if the field was filled.
|
||||
@@ -295,13 +225,13 @@ CONTAINS
|
||||
IF(op_data%field .EQ. H5O_INFO_ALL_F)THEN
|
||||
|
||||
idx = op_data%idx
|
||||
|
||||
|
||||
DO i = 1, len
|
||||
IF(op_data%info(idx)%path(i)(1:1) .NE. name(i)(1:1))THEN
|
||||
visit_obj_cb = -1
|
||||
RETURN
|
||||
ENDIF
|
||||
|
||||
|
||||
IF(op_data%info(idx)%type_obj .NE. oinfo_c%type)THEN
|
||||
visit_obj_cb = -1
|
||||
RETURN
|
||||
@@ -310,14 +240,14 @@ CONTAINS
|
||||
|
||||
ENDIF
|
||||
|
||||
! Check H5Oget_info_by_name_f; if partial field values where filled correctly
|
||||
! Check H5Oget_info_by_name_f; if partial field values were filled correctly
|
||||
CALL H5Oget_info_by_name_f(group_id, name2, oinfo_f, ierr);
|
||||
visit_obj_cb = compare_h5o_info_t( oinfo_f, oinfo_c, op_data%field, .TRUE. )
|
||||
visit_obj_cb = compare_h5o_info_t( group_id, oinfo_f, oinfo_c, op_data%field, .TRUE. )
|
||||
IF(visit_obj_cb.EQ.-1) RETURN
|
||||
|
||||
! Check H5Oget_info_by_name_f, only check field values
|
||||
CALL H5Oget_info_by_name_f(group_id, name2, oinfo_f, ierr, fields = op_data%field);
|
||||
visit_obj_cb = compare_h5o_info_t( oinfo_f, oinfo_c, op_data%field, .FALSE. )
|
||||
visit_obj_cb = compare_h5o_info_t(group_id, oinfo_f, oinfo_c, op_data%field, .FALSE. )
|
||||
IF(visit_obj_cb.EQ.-1) RETURN
|
||||
|
||||
|
||||
@@ -325,12 +255,12 @@ CONTAINS
|
||||
|
||||
! Check H5Oget_info_f, only check field values
|
||||
CALL H5Oget_info_f(group_id, oinfo_f, ierr, fields = op_data%field);
|
||||
visit_obj_cb = compare_h5o_info_t( oinfo_f, oinfo_c, op_data%field, .FALSE. )
|
||||
visit_obj_cb = compare_h5o_info_t(group_id, oinfo_f, oinfo_c, op_data%field, .FALSE. )
|
||||
IF(visit_obj_cb.EQ.-1) RETURN
|
||||
|
||||
! Check H5Oget_info_f; if partial field values where filled correctly
|
||||
CALL H5Oget_info_f(group_id, oinfo_f, ierr);
|
||||
visit_obj_cb = compare_h5o_info_t( oinfo_f, oinfo_c, op_data%field, .TRUE. )
|
||||
visit_obj_cb = compare_h5o_info_t(group_id, oinfo_f, oinfo_c, op_data%field, .TRUE. )
|
||||
IF(visit_obj_cb.EQ.-1) RETURN
|
||||
|
||||
ENDIF
|
||||
@@ -486,11 +416,11 @@ END SUBROUTINE test_h5o_refcount
|
||||
|
||||
!****************************************************************
|
||||
!**
|
||||
!** test_h5o_refcount(): Test H5O visit functions.
|
||||
!** test_obj_visit(): Test H5O visit functions.
|
||||
!**
|
||||
!****************************************************************
|
||||
|
||||
SUBROUTINE obj_visit(total_error)
|
||||
SUBROUTINE test_obj_visit(total_error)
|
||||
|
||||
USE HDF5
|
||||
USE TH5_MISC
|
||||
@@ -583,20 +513,6 @@ SUBROUTINE obj_visit(total_error)
|
||||
IF(ret_val.LT.0)THEN
|
||||
CALL check("h5ovisit_f", -1, total_error)
|
||||
ENDIF
|
||||
udata%field = H5O_INFO_HDR_F
|
||||
udata%idx = 1
|
||||
CALL h5ovisit_f(fid, H5_INDEX_NAME_F, H5_ITER_INC_F, fun_ptr, f_ptr, ret_val, error, fields=udata%field)
|
||||
CALL check("h5ovisit_f", error, total_error)
|
||||
IF(ret_val.LT.0)THEN
|
||||
CALL check("h5ovisit_f", -1, total_error)
|
||||
ENDIF
|
||||
udata%field = H5O_INFO_META_SIZE_F
|
||||
udata%idx = 1
|
||||
CALL h5ovisit_f(fid, H5_INDEX_NAME_F, H5_ITER_INC_F, fun_ptr, f_ptr, ret_val, error, fields=udata%field)
|
||||
CALL check("h5ovisit_f", error, total_error)
|
||||
IF(ret_val.LT.0)THEN
|
||||
CALL check("h5ovisit_f", -1, total_error)
|
||||
ENDIF
|
||||
|
||||
! Test h5ovisit_by_name_f
|
||||
object_name = "/"
|
||||
@@ -630,33 +546,19 @@ SUBROUTINE obj_visit(total_error)
|
||||
IF(ret_val.LT.0)THEN
|
||||
CALL check("h5ovisit_by_name_f", -1, total_error)
|
||||
ENDIF
|
||||
udata%idx = 1
|
||||
udata%field = H5O_INFO_HDR_F
|
||||
CALL h5ovisit_by_name_f(fid, object_name, H5_INDEX_NAME_F, H5_ITER_INC_F, fun_ptr, f_ptr, ret_val, error, fields=udata%field)
|
||||
CALL check("h5ovisit_by_name_f", error, total_error)
|
||||
IF(ret_val.LT.0)THEN
|
||||
CALL check("h5ovisit_by_name_f", -1, total_error)
|
||||
ENDIF
|
||||
udata%idx = 1
|
||||
udata%field = H5O_INFO_META_SIZE_F
|
||||
CALL h5ovisit_by_name_f(fid, object_name, H5_INDEX_NAME_F, H5_ITER_INC_F, fun_ptr, f_ptr, ret_val, error, fields=udata%field)
|
||||
CALL check("h5ovisit_by_name_f", error, total_error)
|
||||
IF(ret_val.LT.0)THEN
|
||||
CALL check("h5ovisit_by_name_f", -1, total_error)
|
||||
ENDIF
|
||||
|
||||
|
||||
CALL h5fclose_f(fid, error)
|
||||
CALL check("h5fclose_f",error, total_error)
|
||||
|
||||
END SUBROUTINE obj_visit
|
||||
END SUBROUTINE test_obj_visit
|
||||
|
||||
!****************************************************************
|
||||
!**
|
||||
!** test_h5o_refcount(): Test H5O info functions.
|
||||
!** test_obj_info(): Test H5O info functions.
|
||||
!**
|
||||
!****************************************************************
|
||||
|
||||
SUBROUTINE obj_info(total_error)
|
||||
SUBROUTINE test_obj_info(total_error)
|
||||
|
||||
USE HDF5
|
||||
USE TH5_MISC
|
||||
@@ -796,7 +698,7 @@ SUBROUTINE obj_info(total_error)
|
||||
CALL h5fclose_f(fid, error)
|
||||
CALL check("h5fclose_f", error, total_error)
|
||||
|
||||
END SUBROUTINE obj_info
|
||||
END SUBROUTINE test_obj_info
|
||||
|
||||
!-------------------------------------------------------------------------
|
||||
! Function: build_visit_file
|
||||
|
||||
@@ -74,8 +74,8 @@ CONTAINS
|
||||
CALL check("H5VLis_connector_registered_f",error,total_error)
|
||||
CALL VERIFY("H5VLis_connector_registered_f", is_registered, .TRUE., total_error)
|
||||
|
||||
CALL H5VLget_connector_id_f(NATIVE_VOL_CONNECTOR_NAME, vol_id_out, error)
|
||||
CALL check("H5VLget_connector_id_f",error,total_error)
|
||||
CALL H5VLget_connector_id_by_name_f(NATIVE_VOL_CONNECTOR_NAME, vol_id_out, error)
|
||||
CALL check("H5VLget_connector_id_by_name_f",error,total_error)
|
||||
|
||||
CALL H5Fcreate_f("voltest.h5",H5F_ACC_TRUNC_F, file_id, error)
|
||||
CALL check("H5F_create_f",error,total_error)
|
||||
@@ -201,9 +201,9 @@ CONTAINS
|
||||
CALL VERIFY("H5Pget_vol_id_f", vol_id_out, vol_id, total_error)
|
||||
ENDIF
|
||||
|
||||
CALL H5VLget_connector_id_f(NATIVE_VOL_CONNECTOR_NAME, vol_id_out, error)
|
||||
CALL check("H5VLget_connector_id_f",error,total_error)
|
||||
CALL VERIFY("H5VLget_connector_id_f", vol_id_out, vol_id, total_error)
|
||||
CALL H5VLget_connector_id_by_name_f(NATIVE_VOL_CONNECTOR_NAME, vol_id_out, error)
|
||||
CALL check("H5VLget_connector_id_by_name_f",error,total_error)
|
||||
CALL VERIFY("H5VLget_connector_id_by_name_f", vol_id_out, vol_id, total_error)
|
||||
CALL H5Fcreate_f("voltest.h5",H5F_ACC_TRUNC_F, file_id, error, H5P_DEFAULT_F, fapl_id)
|
||||
|
||||
CALL check("H5F_create_f",error,total_error)
|
||||
|
||||
@@ -45,4 +45,6 @@ set_target_properties (parallel_test PROPERTIES
|
||||
)
|
||||
endif ()
|
||||
|
||||
include (CMakeTests.cmake)
|
||||
if (HDF5_TEST_FORTRAN AND HDF5_TEST_PARALLEL)
|
||||
include (CMakeTests.cmake)
|
||||
endif ()
|
||||
|
||||
+1
-1
@@ -19,7 +19,7 @@ endif ()
|
||||
|
||||
#-- Build the Unit testing if requested
|
||||
if (NOT HDF5_EXTERNALLY_CONFIGURED)
|
||||
if (BUILD_TESTING)
|
||||
if (BUILD_TESTING AND HDF5_TEST_SERIAL)
|
||||
add_subdirectory (test)
|
||||
endif ()
|
||||
endif ()
|
||||
|
||||
@@ -23,6 +23,6 @@ else ()
|
||||
endif ()
|
||||
set_target_properties (ptExampleFL PROPERTIES FOLDER examples/hl/cpp)
|
||||
|
||||
if (BUILD_TESTING)
|
||||
if (BUILD_TESTING AND HDF5_TEST_CPP AND HDF5_TEST_EXAMPLES AND HDF5_TEST_SERIAL)
|
||||
include (CMakeTests.cmake)
|
||||
endif ()
|
||||
|
||||
@@ -24,4 +24,6 @@ else ()
|
||||
endif ()
|
||||
set_target_properties (hl_ptableTest PROPERTIES FOLDER test/hl/cpp)
|
||||
|
||||
include (CMakeTests.cmake)
|
||||
if (HDF5_TEST_CPP AND HDF5_TEST_SERIAL)
|
||||
include (CMakeTests.cmake)
|
||||
endif ()
|
||||
|
||||
@@ -39,8 +39,6 @@ foreach (example ${examples})
|
||||
set_target_properties (hl_ex_${example} PROPERTIES FOLDER examples/hl)
|
||||
endforeach ()
|
||||
|
||||
if (BUILD_TESTING)
|
||||
|
||||
if (BUILD_TESTING AND HDF5_TEST_EXAMPLES AND HDF5_TEST_SERIAL)
|
||||
include (CMakeTests.cmake)
|
||||
|
||||
endif ()
|
||||
|
||||
@@ -52,6 +52,6 @@ foreach (example ${examples})
|
||||
endif ()
|
||||
endforeach ()
|
||||
|
||||
if (BUILD_TESTING)
|
||||
if (BUILD_TESTING AND HDF5_TEST_FORTRAN AND HDF5_TEST_EXAMPLES AND HDF5_TEST_SERIAL)
|
||||
include (CMakeTests.cmake)
|
||||
endif ()
|
||||
|
||||
@@ -61,4 +61,6 @@ foreach (h5_test ${H5_TESTS})
|
||||
ADD_H5_FORTRAN_EXE(${h5_test})
|
||||
endforeach ()
|
||||
|
||||
include (CMakeTests.cmake)
|
||||
if (HDF5_TEST_FORTRAN AND HDF5_TEST_SERIAL)
|
||||
include (CMakeTests.cmake)
|
||||
endif ()
|
||||
|
||||
+125
-78
@@ -140,10 +140,10 @@ herr_t H5DSattach_scale(hid_t did,
|
||||
hobj_ref_t ref_j; /* iterator reference */
|
||||
hvl_t *buf = NULL; /* VL buffer to store in the attribute */
|
||||
hid_t dsid_j; /* DS dataset ID in DIMENSION_LIST */
|
||||
H5O_info_t oi1, oi2;
|
||||
H5O_info2_t oi1, oi2;
|
||||
H5I_type_t it1, it2;
|
||||
int i;
|
||||
size_t len;
|
||||
size_t len;
|
||||
int found_ds=0;
|
||||
htri_t is_scale;
|
||||
|
||||
@@ -156,20 +156,26 @@ herr_t H5DSattach_scale(hid_t did,
|
||||
return FAIL;
|
||||
|
||||
/* the dataset cannot be a DS dataset */
|
||||
if ( is_scale == 1)
|
||||
if (is_scale == 1)
|
||||
return FAIL;
|
||||
|
||||
/* get info for the dataset in the parameter list */
|
||||
if(H5Oget_info2(did, &oi1, H5O_INFO_BASIC) < 0)
|
||||
if(H5Oget_info3(did, &oi1, H5O_INFO_BASIC) < 0)
|
||||
return FAIL;
|
||||
|
||||
/* get info for the scale in the parameter list */
|
||||
if(H5Oget_info2(dsid, &oi2, H5O_INFO_BASIC) < 0)
|
||||
if(H5Oget_info3(dsid, &oi2, H5O_INFO_BASIC) < 0)
|
||||
return FAIL;
|
||||
|
||||
/* same object, not valid */
|
||||
if(oi1.fileno == oi2.fileno && oi1.addr == oi2.addr)
|
||||
return FAIL;
|
||||
if(oi1.fileno == oi2.fileno) {
|
||||
int token_cmp;
|
||||
|
||||
if(H5Otoken_cmp(did, &oi1.token, &oi2.token, &token_cmp) < 0)
|
||||
return FAIL;
|
||||
if(!token_cmp)
|
||||
return FAIL;
|
||||
} /* end if */
|
||||
|
||||
/* get ID type */
|
||||
if ((it1 = H5Iget_type(did)) < 0)
|
||||
@@ -177,7 +183,7 @@ herr_t H5DSattach_scale(hid_t did,
|
||||
if ((it2 = H5Iget_type(dsid)) < 0)
|
||||
return FAIL;
|
||||
|
||||
if (H5I_DATASET!=it1 || H5I_DATASET!=it2)
|
||||
if (H5I_DATASET != it1 || H5I_DATASET != it2)
|
||||
return FAIL;
|
||||
|
||||
/* the DS dataset cannot have dimension scales */
|
||||
@@ -202,19 +208,19 @@ herr_t H5DSattach_scale(hid_t did,
|
||||
return FAIL;
|
||||
|
||||
/* get rank */
|
||||
if ((rank=H5Sget_simple_extent_ndims(sid)) < 0)
|
||||
if ((rank = H5Sget_simple_extent_ndims(sid)) < 0)
|
||||
goto out;
|
||||
|
||||
/* scalar rank */
|
||||
if (rank==0)
|
||||
rank=1;
|
||||
if (rank == 0)
|
||||
rank = 1;
|
||||
|
||||
/* close dataset space */
|
||||
if (H5Sclose(sid) < 0)
|
||||
return FAIL;
|
||||
|
||||
/* parameter range checking */
|
||||
if (idx>(unsigned)rank-1)
|
||||
if (idx > (unsigned)rank-1)
|
||||
return FAIL;
|
||||
|
||||
/*-------------------------------------------------------------------------
|
||||
@@ -324,16 +330,22 @@ herr_t H5DSattach_scale(hid_t did,
|
||||
goto out;
|
||||
|
||||
/* get info for DS in the parameter list */
|
||||
if(H5Oget_info2(dsid, &oi1, H5O_INFO_BASIC) < 0)
|
||||
if(H5Oget_info3(dsid, &oi1, H5O_INFO_BASIC) < 0)
|
||||
goto out;
|
||||
|
||||
/* get info for this DS */
|
||||
if(H5Oget_info2(dsid_j, &oi2, H5O_INFO_BASIC) < 0)
|
||||
if(H5Oget_info3(dsid_j, &oi2, H5O_INFO_BASIC) < 0)
|
||||
goto out;
|
||||
|
||||
/* same object, so this DS scale is already in this DIM IDX */
|
||||
if(oi1.fileno == oi2.fileno && oi1.addr == oi2.addr)
|
||||
found_ds = 1;
|
||||
if(oi1.fileno == oi2.fileno) {
|
||||
int token_cmp;
|
||||
|
||||
if(H5Otoken_cmp(did, &oi1.token, &oi2.token, &token_cmp) < 0)
|
||||
goto out;
|
||||
if(!token_cmp)
|
||||
found_ds = 1;
|
||||
} /* end if */
|
||||
|
||||
/* close the dereferenced dataset */
|
||||
if(H5Dclose(dsid_j) < 0)
|
||||
@@ -508,7 +520,7 @@ herr_t H5DSattach_scale(hid_t did,
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
if((is_ds=H5DSis_scale(dsid)) < 0)
|
||||
if((is_ds = H5DSis_scale(dsid)) < 0)
|
||||
return FAIL;
|
||||
|
||||
if(is_ds == 0) {
|
||||
@@ -586,7 +598,7 @@ herr_t H5DSdetach_scale(hid_t did,
|
||||
int i;
|
||||
size_t j;
|
||||
hssize_t ii;
|
||||
H5O_info_t did_oi, dsid_oi, tmp_oi;
|
||||
H5O_info2_t did_oi, dsid_oi, tmp_oi;
|
||||
int found_dset = 0, found_ds = 0;
|
||||
int have_ds = 0;
|
||||
htri_t is_scale;
|
||||
@@ -598,7 +610,7 @@ herr_t H5DSdetach_scale(hid_t did,
|
||||
|
||||
/* check for valid types of identifiers */
|
||||
|
||||
if(H5I_DATASET!=H5Iget_type(did) || H5I_DATASET!=H5Iget_type(dsid))
|
||||
if(H5I_DATASET != H5Iget_type(did) || H5I_DATASET != H5Iget_type(dsid))
|
||||
return FAIL;
|
||||
|
||||
if((is_scale = H5DSis_scale(did)) < 0)
|
||||
@@ -609,16 +621,22 @@ herr_t H5DSdetach_scale(hid_t did,
|
||||
return FAIL;
|
||||
|
||||
/* get info for the dataset in the parameter list */
|
||||
if(H5Oget_info2(did, &did_oi, H5O_INFO_BASIC) < 0)
|
||||
if(H5Oget_info3(did, &did_oi, H5O_INFO_BASIC) < 0)
|
||||
return FAIL;
|
||||
|
||||
/* get info for the scale in the parameter list */
|
||||
if(H5Oget_info2(dsid, &dsid_oi, H5O_INFO_BASIC) < 0)
|
||||
if(H5Oget_info3(dsid, &dsid_oi, H5O_INFO_BASIC) < 0)
|
||||
return FAIL;
|
||||
|
||||
/* same object, not valid */
|
||||
if(did_oi.fileno == dsid_oi.fileno && did_oi.addr == dsid_oi.addr)
|
||||
return FAIL;
|
||||
if(did_oi.fileno == dsid_oi.fileno) {
|
||||
int token_cmp;
|
||||
|
||||
if(H5Otoken_cmp(did, &did_oi.token, &dsid_oi.token, &token_cmp) < 0)
|
||||
return FAIL;
|
||||
if(!token_cmp)
|
||||
return FAIL;
|
||||
} /* end if */
|
||||
|
||||
|
||||
/*-------------------------------------------------------------------------
|
||||
@@ -626,7 +644,7 @@ herr_t H5DSdetach_scale(hid_t did,
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
/* try to find the attribute "DIMENSION_LIST" on the >>data<< dataset */
|
||||
if ((has_dimlist = H5LT_find_attribute(did,DIMENSION_LIST)) < 0)
|
||||
if ((has_dimlist = H5LT_find_attribute(did, DIMENSION_LIST)) < 0)
|
||||
return FAIL;
|
||||
|
||||
if (has_dimlist == 0)
|
||||
@@ -637,7 +655,7 @@ herr_t H5DSdetach_scale(hid_t did,
|
||||
return FAIL;
|
||||
|
||||
/* get rank */
|
||||
if ((rank=H5Sget_simple_extent_ndims(sid)) < 0)
|
||||
if ((rank = H5Sget_simple_extent_ndims(sid)) < 0)
|
||||
goto out;
|
||||
|
||||
/* close dataset space */
|
||||
@@ -645,7 +663,7 @@ herr_t H5DSdetach_scale(hid_t did,
|
||||
return FAIL;
|
||||
|
||||
/* parameter range checking */
|
||||
if (idx>(unsigned)rank-1)
|
||||
if (idx > (unsigned)rank-1)
|
||||
return FAIL;
|
||||
|
||||
/*-------------------------------------------------------------------------
|
||||
@@ -696,7 +714,7 @@ herr_t H5DSdetach_scale(hid_t did,
|
||||
goto out;
|
||||
|
||||
/* get info for this DS */
|
||||
if(H5Oget_info2(dsid_j, &tmp_oi, H5O_INFO_BASIC) < 0)
|
||||
if(H5Oget_info3(dsid_j, &tmp_oi, H5O_INFO_BASIC) < 0)
|
||||
goto out;
|
||||
|
||||
/* Close the dereferenced dataset */
|
||||
@@ -704,30 +722,35 @@ herr_t H5DSdetach_scale(hid_t did,
|
||||
goto out;
|
||||
|
||||
/* same object, reset */
|
||||
if(dsid_oi.fileno == tmp_oi.fileno && dsid_oi.addr == tmp_oi.addr)
|
||||
{
|
||||
/* If there are more than one reference in the VL element
|
||||
and the reference we found is not the last one,
|
||||
copy the last one to replace the found one since the order
|
||||
of the references doesn't matter according to the spec;
|
||||
reduce the size of the VL element by 1;
|
||||
if the length of the element becomes 0, free the pointer
|
||||
and reset to NULL */
|
||||
if(dsid_oi.fileno == tmp_oi.fileno) {
|
||||
int token_cmp;
|
||||
|
||||
size_t len = buf[idx].len;
|
||||
if(H5Otoken_cmp(did, &dsid_oi.token, &tmp_oi.token, &token_cmp) < 0)
|
||||
goto out;
|
||||
if(!token_cmp) {
|
||||
/* If there are more than one reference in the VL element
|
||||
and the reference we found is not the last one,
|
||||
copy the last one to replace the found one since the order
|
||||
of the references doesn't matter according to the spec;
|
||||
reduce the size of the VL element by 1;
|
||||
if the length of the element becomes 0, free the pointer
|
||||
and reset to NULL */
|
||||
|
||||
if(j < len - 1)
|
||||
((hobj_ref_t *)buf[idx].p)[j] = ((hobj_ref_t *)buf[idx].p)[len-1];
|
||||
len = --buf[idx].len;
|
||||
if(len == 0) {
|
||||
HDfree(buf[idx].p);
|
||||
buf[idx].p = NULL;
|
||||
}
|
||||
/* Since a reference to a dim. scale can be inserted only once,
|
||||
we do not need to continue the search if it is found */
|
||||
found_ds = 1;
|
||||
break;
|
||||
}
|
||||
size_t len = buf[idx].len;
|
||||
|
||||
if(j < len - 1)
|
||||
((hobj_ref_t *)buf[idx].p)[j] = ((hobj_ref_t *)buf[idx].p)[len-1];
|
||||
len = --buf[idx].len;
|
||||
if(len == 0) {
|
||||
HDfree(buf[idx].p);
|
||||
buf[idx].p = NULL;
|
||||
}
|
||||
/* Since a reference to a dim. scale can be inserted only once,
|
||||
we do not need to continue the search if it is found */
|
||||
found_ds = 1;
|
||||
break;
|
||||
} /* end if */
|
||||
} /* end if */
|
||||
} /* j */
|
||||
} /* if */
|
||||
|
||||
@@ -795,7 +818,7 @@ herr_t H5DSdetach_scale(hid_t did,
|
||||
if(H5Aread(aid, ntid, dsbuf) < 0)
|
||||
goto out;
|
||||
|
||||
for(ii=0; ii<nelmts; ii++) {
|
||||
for(ii = 0; ii < nelmts; ii++) {
|
||||
/* First check if we have the same dimension index */
|
||||
if(idx == dsbuf[ii].dim_idx) {
|
||||
/* get the reference to the dataset */
|
||||
@@ -806,7 +829,7 @@ herr_t H5DSdetach_scale(hid_t did,
|
||||
goto out;
|
||||
|
||||
/* get info for this dataset */
|
||||
if(H5Oget_info2(did_i, &tmp_oi, H5O_INFO_BASIC) < 0)
|
||||
if(H5Oget_info3(did_i, &tmp_oi, H5O_INFO_BASIC) < 0)
|
||||
goto out;
|
||||
|
||||
/* close the dereferenced dataset */
|
||||
@@ -814,13 +837,19 @@ herr_t H5DSdetach_scale(hid_t did,
|
||||
goto out;
|
||||
|
||||
/* same object, reset. we want to detach only for this DIM */
|
||||
if(did_oi.fileno == tmp_oi.fileno && did_oi.addr == tmp_oi.addr) {
|
||||
/* copy the last one to replace the one which is found */
|
||||
dsbuf[ii] = dsbuf[nelmts-1];
|
||||
nelmts--;
|
||||
found_dset=1;
|
||||
break;
|
||||
} /* if */
|
||||
if(did_oi.fileno == tmp_oi.fileno) {
|
||||
int token_cmp;
|
||||
|
||||
if(H5Otoken_cmp(did, &did_oi.token, &tmp_oi.token, &token_cmp) < 0)
|
||||
goto out;
|
||||
if(!token_cmp) {
|
||||
/* copy the last one to replace the one which is found */
|
||||
dsbuf[ii] = dsbuf[nelmts-1];
|
||||
nelmts--;
|
||||
found_dset=1;
|
||||
break;
|
||||
} /* end if */
|
||||
} /* end if */
|
||||
} /* if we have the same dimension index */
|
||||
} /* ii */
|
||||
|
||||
@@ -954,7 +983,7 @@ htri_t H5DSis_attached(hid_t did,
|
||||
hvl_t *buf = NULL; /* VL buffer to store in the attribute */
|
||||
hid_t dsid_j; /* DS dataset ID in DIMENSION_LIST */
|
||||
hid_t did_i; /* dataset ID in REFERENCE_LIST */
|
||||
H5O_info_t oi1, oi2, oi3, oi4;
|
||||
H5O_info2_t oi1, oi2, oi3, oi4;
|
||||
H5I_type_t it1, it2;
|
||||
int i;
|
||||
int found_dset=0, found_ds=0;
|
||||
@@ -973,16 +1002,22 @@ htri_t H5DSis_attached(hid_t did,
|
||||
return FAIL;
|
||||
|
||||
/* get info for the dataset in the parameter list */
|
||||
if(H5Oget_info2(did, &oi1, H5O_INFO_BASIC) < 0)
|
||||
if(H5Oget_info3(did, &oi1, H5O_INFO_BASIC) < 0)
|
||||
return FAIL;
|
||||
|
||||
/* get info for the scale in the parameter list */
|
||||
if(H5Oget_info2(dsid, &oi2, H5O_INFO_BASIC) < 0)
|
||||
if(H5Oget_info3(dsid, &oi2, H5O_INFO_BASIC) < 0)
|
||||
return FAIL;
|
||||
|
||||
/* same object, not valid */
|
||||
if(oi1.fileno == oi2.fileno && oi1.addr == oi2.addr)
|
||||
return FAIL;
|
||||
if(oi1.fileno == oi2.fileno) {
|
||||
int token_cmp;
|
||||
|
||||
if(H5Otoken_cmp(did, &oi1.token, &oi2.token, &token_cmp) < 0)
|
||||
return FAIL;
|
||||
if(!token_cmp)
|
||||
return FAIL;
|
||||
} /* end if */
|
||||
|
||||
/* get ID type */
|
||||
if ((it1 = H5Iget_type(did)) < 0)
|
||||
@@ -990,7 +1025,7 @@ htri_t H5DSis_attached(hid_t did,
|
||||
if ((it2 = H5Iget_type(dsid)) < 0)
|
||||
return FAIL;
|
||||
|
||||
if (H5I_DATASET!=it1 || H5I_DATASET!=it2)
|
||||
if (H5I_DATASET != it1 || H5I_DATASET != it2)
|
||||
return FAIL;
|
||||
|
||||
/*-------------------------------------------------------------------------
|
||||
@@ -1040,7 +1075,7 @@ htri_t H5DSis_attached(hid_t did,
|
||||
goto out;
|
||||
|
||||
/* read */
|
||||
if (H5Aread(aid,tid,buf) < 0)
|
||||
if (H5Aread(aid, tid, buf) < 0)
|
||||
goto out;
|
||||
|
||||
/* iterate all the REFs in this dimension IDX */
|
||||
@@ -1050,20 +1085,26 @@ htri_t H5DSis_attached(hid_t did,
|
||||
ref = ((hobj_ref_t *)buf[idx].p)[i];
|
||||
|
||||
/* get the scale id for this REF */
|
||||
if ((dsid_j = H5Rdereference2(did,H5P_DEFAULT,H5R_OBJECT,&ref)) < 0)
|
||||
if ((dsid_j = H5Rdereference2(did, H5P_DEFAULT, H5R_OBJECT, &ref)) < 0)
|
||||
goto out;
|
||||
|
||||
/* get info for DS in the parameter list */
|
||||
if(H5Oget_info2(dsid, &oi1, H5O_INFO_BASIC) < 0)
|
||||
if(H5Oget_info3(dsid, &oi1, H5O_INFO_BASIC) < 0)
|
||||
goto out;
|
||||
|
||||
/* get info for this DS */
|
||||
if(H5Oget_info2(dsid_j, &oi2, H5O_INFO_BASIC) < 0)
|
||||
if(H5Oget_info3(dsid_j, &oi2, H5O_INFO_BASIC) < 0)
|
||||
goto out;
|
||||
|
||||
/* same object */
|
||||
if(oi1.fileno == oi2.fileno && oi1.addr == oi2.addr)
|
||||
found_ds = 1;
|
||||
if(oi1.fileno == oi2.fileno) {
|
||||
int token_cmp;
|
||||
|
||||
if(H5Otoken_cmp(did, &oi1.token, &oi2.token, &token_cmp) < 0)
|
||||
goto out;
|
||||
if(!token_cmp)
|
||||
found_ds = 1;
|
||||
} /* end if */
|
||||
|
||||
/* close the dereferenced dataset */
|
||||
if (H5Dclose(dsid_j) < 0)
|
||||
@@ -1073,7 +1114,7 @@ htri_t H5DSis_attached(hid_t did,
|
||||
|
||||
|
||||
/* close */
|
||||
if (H5Treclaim(tid,sid,H5P_DEFAULT,buf) < 0)
|
||||
if (H5Treclaim(tid, sid, H5P_DEFAULT, buf) < 0)
|
||||
goto out;
|
||||
if (H5Sclose(sid) < 0)
|
||||
goto out;
|
||||
@@ -1123,7 +1164,7 @@ htri_t H5DSis_attached(hid_t did,
|
||||
if (dsbuf == NULL)
|
||||
goto out;
|
||||
|
||||
if (H5Aread(aid,ntid,dsbuf) < 0)
|
||||
if (H5Aread(aid, ntid, dsbuf) < 0)
|
||||
goto out;
|
||||
|
||||
/*-------------------------------------------------------------------------
|
||||
@@ -1131,7 +1172,7 @@ htri_t H5DSis_attached(hid_t did,
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
for(i=0; i<nelmts; i++)
|
||||
for(i = 0; i < nelmts; i++)
|
||||
{
|
||||
/* get the reference */
|
||||
ref = dsbuf[i].ref;
|
||||
@@ -1140,20 +1181,26 @@ htri_t H5DSis_attached(hid_t did,
|
||||
if (ref)
|
||||
{
|
||||
/* get the dataset id */
|
||||
if ((did_i = H5Rdereference2(did,H5P_DEFAULT,H5R_OBJECT,&ref)) < 0)
|
||||
if ((did_i = H5Rdereference2(did, H5P_DEFAULT, H5R_OBJECT, &ref)) < 0)
|
||||
goto out;
|
||||
|
||||
/* get info for dataset in the parameter list */
|
||||
if(H5Oget_info2(did, &oi3, H5O_INFO_BASIC) < 0)
|
||||
if(H5Oget_info3(did, &oi3, H5O_INFO_BASIC) < 0)
|
||||
goto out;
|
||||
|
||||
/* get info for this dataset */
|
||||
if(H5Oget_info2(did_i, &oi4, H5O_INFO_BASIC) < 0)
|
||||
if(H5Oget_info3(did_i, &oi4, H5O_INFO_BASIC) < 0)
|
||||
goto out;
|
||||
|
||||
/* same object */
|
||||
if(oi3.fileno == oi4.fileno && oi3.addr == oi4.addr && idx==dsbuf[i].dim_idx)
|
||||
found_dset=1;
|
||||
if(oi3.fileno == oi4.fileno) {
|
||||
int token_cmp;
|
||||
|
||||
if(H5Otoken_cmp(did, &oi3.token, &oi4.token, &token_cmp) < 0)
|
||||
goto out;
|
||||
if(!token_cmp && (idx == dsbuf[i].dim_idx))
|
||||
found_dset=1;
|
||||
} /* end if */
|
||||
|
||||
/* close the dereferenced dataset */
|
||||
if (H5Dclose(did_i) < 0)
|
||||
|
||||
+2
-2
@@ -1360,7 +1360,7 @@ out:
|
||||
*/
|
||||
|
||||
static herr_t
|
||||
find_dataset(hid_t loc_id, const char *name, const H5L_info_t *linfo, void *op_data)
|
||||
find_dataset(hid_t loc_id, const char *name, const H5L_info2_t *linfo, void *op_data)
|
||||
{
|
||||
/* Define a default zero value for return. This will cause the iterator to continue if
|
||||
* the dataset is not found yet.
|
||||
@@ -1411,7 +1411,7 @@ find_dataset(hid_t loc_id, const char *name, const H5L_info_t *linfo, void *op_d
|
||||
herr_t
|
||||
H5LTfind_dataset( hid_t loc_id, const char *dset_name )
|
||||
{
|
||||
return H5Literate(loc_id, H5_INDEX_NAME, H5_ITER_INC, 0, find_dataset, (void *)dset_name);
|
||||
return H5Literate2(loc_id, H5_INDEX_NAME, H5_ITER_INC, 0, find_dataset, (void *)dset_name);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -93,4 +93,6 @@ if (HDF5_BUILD_GENERATORS AND NOT ONLY_SHARED_LIBS)
|
||||
set_target_properties (hl_gen_test_ld PROPERTIES FOLDER test/hl/gen)
|
||||
endif ()
|
||||
|
||||
include (CMakeTests.cmake)
|
||||
if (HDF5_TEST_SERIAL)
|
||||
include (CMakeTests.cmake)
|
||||
endif ()
|
||||
|
||||
@@ -67,7 +67,7 @@ if (BUILD_SHARED_LIBS)
|
||||
)
|
||||
endif ()
|
||||
|
||||
if (BUILD_TESTING)
|
||||
if (BUILD_TESTING AND HDF5_TEST_SERIAL)
|
||||
# --------------------------------------------------------------------
|
||||
# This executable can generate the actual test files - Currently not
|
||||
# used in the CMake Build system as we rely on the test files that are
|
||||
@@ -83,7 +83,9 @@ if (BUILD_TESTING)
|
||||
# add_test (NAME hl_h52gifgentest COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:hl_h52gifgentest>)
|
||||
endif ()
|
||||
|
||||
include (CMakeTests.cmake)
|
||||
if (HDF5_TEST_TOOLS)
|
||||
include (CMakeTests.cmake)
|
||||
endif ()
|
||||
endif ()
|
||||
|
||||
#-----------------------------------------------------------------------------
|
||||
|
||||
@@ -173,7 +173,7 @@ Decompress(GIFIMAGEDESC *GifImageDesc, GIFHEAD *GifHead)
|
||||
/* Now read in values from the image descriptor */
|
||||
IWidth = GifImageDesc->ImageWidth;
|
||||
IHeight = GifImageDesc->ImageHeight;
|
||||
Interlace = GifImageDesc->PackedField & 0x40;
|
||||
Interlace = (uint8_t)(GifImageDesc->PackedField & 0x40);
|
||||
|
||||
/*
|
||||
* Note that I ignore the possible existence of a local color map. I'm
|
||||
|
||||
@@ -26,7 +26,7 @@ if (BUILD_SHARED_LIBS)
|
||||
set (H5_DEP_EXECUTABLES ${H5_DEP_EXECUTABLES} h5watch-shared)
|
||||
endif ()
|
||||
|
||||
if (BUILD_TESTING)
|
||||
if (BUILD_TESTING AND HDF5_TEST_SWMR AND HDF5_TEST_SERIAL)
|
||||
#-- Add swmr_check_compat_vfd program
|
||||
set (hl_swmr_check_compat_vfd_SOURCES
|
||||
${HDF5_HL_TOOLS_H5WATCH_SOURCE_DIR}/swmr_check_compat_vfd.c
|
||||
@@ -68,7 +68,9 @@ if (BUILD_TESTING)
|
||||
endif ()
|
||||
set_target_properties (h5watchgentest PROPERTIES FOLDER generator/tools/hl)
|
||||
|
||||
include (CMakeTests.cmake)
|
||||
if (HDF5_TEST_TOOLS)
|
||||
include (CMakeTests.cmake)
|
||||
endif ()
|
||||
endif ()
|
||||
|
||||
#-----------------------------------------------------------------------------
|
||||
|
||||
@@ -18,7 +18,7 @@
|
||||
# supports SWMR.
|
||||
./swmr_check_compat_vfd
|
||||
rc=$?
|
||||
if [[ $rc != 0 ]] ; then
|
||||
if [ $rc != 0 ] ; then
|
||||
echo
|
||||
echo "The VFD specified by the HDF5_DRIVER environment variable"
|
||||
echo "does not support SWMR."
|
||||
|
||||
@@ -71,7 +71,7 @@ foreach (HDFJAVA_JAR ${CMAKE_JAVA_INCLUDE_PATH})
|
||||
set (CMAKE_JAVA_CLASSPATH "${CMAKE_JAVA_CLASSPATH}${CMAKE_JAVA_INCLUDE_FLAG_SEP}${HDFJAVA_JAR}")
|
||||
endforeach ()
|
||||
|
||||
if (BUILD_TESTING)
|
||||
if (BUILD_TESTING AND HDF5_TEST_EXAMPLES AND HDF5_TEST_SERIAL)
|
||||
get_property (target_name TARGET ${HDF5_JAVA_JNI_LIB_TARGET} PROPERTY OUTPUT_NAME)
|
||||
set (CMD_ARGS "-Dhdf.hdf5lib.H5.loadLibraryName=${target_name}$<$<CONFIG:Debug>:${CMAKE_DEBUG_POSTFIX}>;")
|
||||
|
||||
|
||||
@@ -56,7 +56,7 @@ foreach (HDFJAVA_JAR ${CMAKE_JAVA_INCLUDE_PATH})
|
||||
set (CMAKE_JAVA_CLASSPATH "${CMAKE_JAVA_CLASSPATH}${CMAKE_JAVA_INCLUDE_FLAG_SEP}${HDFJAVA_JAR}")
|
||||
endforeach ()
|
||||
|
||||
if (BUILD_TESTING)
|
||||
if (BUILD_TESTING AND HDF5_TEST_EXAMPLES AND HDF5_TEST_SERIAL)
|
||||
get_property (target_name TARGET ${HDF5_JAVA_JNI_LIB_TARGET} PROPERTY OUTPUT_NAME)
|
||||
set (CMD_ARGS "-Dhdf.hdf5lib.H5.loadLibraryName=${target_name}$<$<CONFIG:Debug>:${CMAKE_DEBUG_POSTFIX}>;")
|
||||
|
||||
|
||||
@@ -22,6 +22,8 @@
|
||||
package examples.datatypes;
|
||||
|
||||
import java.text.DecimalFormat;
|
||||
import java.text.DecimalFormatSymbols;
|
||||
import java.util.Locale;
|
||||
|
||||
import hdf.hdf5lib.H5;
|
||||
import hdf.hdf5lib.HDF5Constants;
|
||||
@@ -173,7 +175,7 @@ public class H5Ex_T_Float {
|
||||
}
|
||||
|
||||
// Output the data to the screen.
|
||||
DecimalFormat df = new DecimalFormat("#,##0.0000");
|
||||
DecimalFormat df = new DecimalFormat("#,##0.0000", new DecimalFormatSymbols(Locale.US));
|
||||
System.out.println(DATASETNAME + ":");
|
||||
for (int indx = 0; indx < dims[0]; indx++) {
|
||||
System.out.print(" [");
|
||||
|
||||
@@ -22,6 +22,8 @@
|
||||
package examples.datatypes;
|
||||
|
||||
import java.text.DecimalFormat;
|
||||
import java.text.DecimalFormatSymbols;
|
||||
import java.util.Locale;
|
||||
|
||||
import hdf.hdf5lib.H5;
|
||||
import hdf.hdf5lib.HDF5Constants;
|
||||
@@ -201,7 +203,7 @@ public class H5Ex_T_FloatAttribute {
|
||||
}
|
||||
|
||||
// Output the data to the screen.
|
||||
DecimalFormat df = new DecimalFormat("#,##0.0000");
|
||||
DecimalFormat df = new DecimalFormat("#,##0.0000", new DecimalFormatSymbols(Locale.US));
|
||||
System.out.println(ATTRIBUTENAME + ":");
|
||||
for (int indx = 0; indx < dims[0]; indx++) {
|
||||
System.out.print(" [");
|
||||
|
||||
@@ -55,7 +55,7 @@ foreach (h5_file ${HDF_JAVA_TEST_FILES})
|
||||
endforeach ()
|
||||
add_custom_target(H5Ex_G_Visit_files ALL COMMENT "Copying files needed by H5Ex_G_Visit tests" DEPENDS ${H5Ex_G_Visit_files_list})
|
||||
|
||||
if (BUILD_TESTING)
|
||||
if (BUILD_TESTING AND HDF5_TEST_EXAMPLES AND HDF5_TEST_SERIAL)
|
||||
get_property (target_name TARGET ${HDF5_JAVA_JNI_LIB_TARGET} PROPERTY OUTPUT_NAME)
|
||||
set (CMD_ARGS "-Dhdf.hdf5lib.H5.loadLibraryName=${target_name}$<$<CONFIG:Debug>:${CMAKE_DEBUG_POSTFIX}>;")
|
||||
|
||||
|
||||
@@ -19,8 +19,8 @@ package examples.groups;
|
||||
|
||||
import hdf.hdf5lib.H5;
|
||||
import hdf.hdf5lib.HDF5Constants;
|
||||
import hdf.hdf5lib.callbacks.H5O_iterate_cb;
|
||||
import hdf.hdf5lib.callbacks.H5O_iterate_t;
|
||||
import hdf.hdf5lib.callbacks.H5O_iterate_opdata_t;
|
||||
import hdf.hdf5lib.structs.H5O_info_t;
|
||||
|
||||
import java.util.ArrayList;
|
||||
@@ -53,9 +53,9 @@ public class H5Ex_G_Intermediate {
|
||||
// Print all the objects in the file_ids to show that intermediate group_ids have been created.
|
||||
System.out.println("Objects in the file_id:");
|
||||
|
||||
// H5O_iterate_t iter_data = null;
|
||||
H5O_iterate_t iter_data = new H5O_iter_data();
|
||||
H5O_iterate_cb iter_cb = new H5O_iter_callback();
|
||||
// H5O_iterate_opdata_t iter_data = null;
|
||||
H5O_iterate_opdata_t iter_data = new H5O_iter_data();
|
||||
H5O_iterate_t iter_cb = new H5O_iter_callback();
|
||||
|
||||
H5.H5Ovisit(file_id, HDF5Constants.H5_INDEX_NAME, HDF5Constants.H5_ITER_NATIVE, iter_cb, iter_data);
|
||||
}
|
||||
@@ -92,12 +92,12 @@ public class H5Ex_G_Intermediate {
|
||||
}
|
||||
}
|
||||
|
||||
private class H5O_iter_data implements H5O_iterate_t {
|
||||
private class H5O_iter_data implements H5O_iterate_opdata_t {
|
||||
public ArrayList<idata> iterdata = new ArrayList<idata>();
|
||||
}
|
||||
|
||||
private class H5O_iter_callback implements H5O_iterate_cb {
|
||||
public int callback(long group, String name, H5O_info_t info, H5O_iterate_t op_data) {
|
||||
private class H5O_iter_callback implements H5O_iterate_t {
|
||||
public int callback(long group, String name, H5O_info_t info, H5O_iterate_opdata_t op_data) {
|
||||
idata id = new idata(name, info.type);
|
||||
((H5O_iter_data) op_data).iterdata.add(id);
|
||||
|
||||
|
||||
@@ -19,6 +19,7 @@ package examples.groups;
|
||||
|
||||
import hdf.hdf5lib.H5;
|
||||
import hdf.hdf5lib.HDF5Constants;
|
||||
import hdf.hdf5lib.structs.H5O_token_t;
|
||||
|
||||
import java.util.EnumSet;
|
||||
import java.util.HashMap;
|
||||
@@ -75,8 +76,8 @@ public class H5Ex_G_Iterate {
|
||||
String[] oname = new String[count];
|
||||
int[] otype = new int[count];
|
||||
int[] ltype = new int[count];
|
||||
long[] orefs = new long[count];
|
||||
H5.H5Gget_obj_info_all(file_id, DATASETNAME, oname, otype, ltype, orefs, HDF5Constants.H5_INDEX_NAME);
|
||||
H5O_token_t[] otokens = new H5O_token_t[count];
|
||||
H5.H5Gget_obj_info_all(file_id, DATASETNAME, oname, otype, ltype, otokens, HDF5Constants.H5_INDEX_NAME);
|
||||
|
||||
// Get type of the object and display its name and type.
|
||||
for (int indx = 0; indx < otype.length; indx++) {
|
||||
|
||||
@@ -25,22 +25,22 @@ package examples.groups;
|
||||
|
||||
import hdf.hdf5lib.H5;
|
||||
import hdf.hdf5lib.HDF5Constants;
|
||||
import hdf.hdf5lib.callbacks.H5L_iterate_cb;
|
||||
import hdf.hdf5lib.callbacks.H5L_iterate_t;
|
||||
import hdf.hdf5lib.callbacks.H5L_iterate_opdata_t;
|
||||
import hdf.hdf5lib.structs.H5L_info_t;
|
||||
import hdf.hdf5lib.structs.H5O_info_t;
|
||||
import examples.groups.H5Ex_G_Iterate.H5O_type;
|
||||
|
||||
class opdata implements H5L_iterate_t {
|
||||
class opdata implements H5L_iterate_opdata_t {
|
||||
int recurs;
|
||||
opdata prev;
|
||||
long addr;
|
||||
H5O_token_t obj_token;
|
||||
}
|
||||
|
||||
public class H5Ex_G_Traverse {
|
||||
|
||||
private static String FILE = "h5ex_g_traverse.h5";
|
||||
public static H5L_iterate_cb iter_cb = new H5L_iter_callbackT();
|
||||
public static H5L_iterate_t iter_cb = new H5L_iter_callbackT();
|
||||
|
||||
private static void OpenGroup() {
|
||||
long file_id = -1;
|
||||
@@ -54,7 +54,7 @@ public class H5Ex_G_Traverse {
|
||||
infobuf = H5.H5Oget_info(file_id);
|
||||
od.recurs = 0;
|
||||
od.prev = null;
|
||||
od.addr = infobuf.addr;
|
||||
od.obj_token = infobuf.token;
|
||||
}
|
||||
}
|
||||
catch (Exception e) {
|
||||
@@ -64,7 +64,7 @@ public class H5Ex_G_Traverse {
|
||||
// Print the root group and formatting, begin iteration.
|
||||
try {
|
||||
System.out.println("/ {");
|
||||
// H5L_iterate_cb iter_cb = new H5L_iter_callbackT();
|
||||
// H5L_iterate_t iter_cb = new H5L_iter_callbackT();
|
||||
H5.H5Literate(file_id, HDF5Constants.H5_INDEX_NAME, HDF5Constants.H5_ITER_NATIVE, 0L, iter_cb, od);
|
||||
System.out.println("}");
|
||||
}
|
||||
@@ -87,8 +87,8 @@ public class H5Ex_G_Traverse {
|
||||
}
|
||||
}
|
||||
|
||||
class H5L_iter_callbackT implements H5L_iterate_cb {
|
||||
public int callback(long group, String name, H5L_info_t info, H5L_iterate_t op_data) {
|
||||
class H5L_iter_callbackT implements H5L_iterate_t {
|
||||
public int callback(long group, String name, H5L_info_t info, H5L_iterate_opdata_t op_data) {
|
||||
|
||||
H5O_info_t infobuf;
|
||||
int return_val = 0;
|
||||
@@ -105,7 +105,7 @@ class H5L_iter_callbackT implements H5L_iterate_cb {
|
||||
switch (H5O_type.get(infobuf.type)) {
|
||||
case H5O_TYPE_GROUP:
|
||||
System.out.println("Group: " + name + " { ");
|
||||
// Check group address against linked list of operator
|
||||
// Check group object token against linked list of operator
|
||||
// data structures. We will always run the check, as the
|
||||
// reference count cannot be relied upon if there are
|
||||
// symbolic links, and H5Oget_info_by_name always follows
|
||||
@@ -114,7 +114,7 @@ class H5L_iter_callbackT implements H5L_iterate_cb {
|
||||
// links, however it could still fail if an object's
|
||||
// reference count was manually manipulated with
|
||||
// H5Odecr_refcount.
|
||||
if (group_check(od, infobuf.addr)) {
|
||||
if (group_check(od, infobuf.token)) {
|
||||
for (int i = 0; i < spaces; i++)
|
||||
System.out.print(" ");
|
||||
System.out.println(" Warning: Loop detected!");
|
||||
@@ -127,8 +127,8 @@ class H5L_iter_callbackT implements H5L_iterate_cb {
|
||||
opdata nextod = new opdata();
|
||||
nextod.recurs = od.recurs + 1;
|
||||
nextod.prev = od;
|
||||
nextod.addr = infobuf.addr;
|
||||
H5L_iterate_cb iter_cb2 = new H5L_iter_callbackT();
|
||||
nextod.obj_token = infobuf.token;
|
||||
H5L_iterate_t iter_cb2 = new H5L_iter_callbackT();
|
||||
return_val = H5.H5Literate_by_name(group, name, HDF5Constants.H5_INDEX_NAME,
|
||||
HDF5Constants.H5_ITER_NATIVE, 0L, iter_cb2, nextod, HDF5Constants.H5P_DEFAULT);
|
||||
}
|
||||
@@ -153,13 +153,13 @@ class H5L_iter_callbackT implements H5L_iterate_cb {
|
||||
return return_val;
|
||||
}
|
||||
|
||||
public boolean group_check(opdata od, long target_addr) {
|
||||
if (od.addr == target_addr)
|
||||
return true; // Addresses match
|
||||
public boolean group_check(opdata od, H5O_token_t target_token) {
|
||||
if (od.obj_token.equals(target_token))
|
||||
return true; // Object tokens match
|
||||
else if (od.recurs == 0)
|
||||
return false; // Root group reached with no matches
|
||||
else
|
||||
return group_check(od.prev, target_addr); // Recursively examine the next node
|
||||
return group_check(od.prev, target_token); // Recursively examine the next node
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -23,10 +23,10 @@ package examples.groups;
|
||||
|
||||
import hdf.hdf5lib.H5;
|
||||
import hdf.hdf5lib.HDF5Constants;
|
||||
import hdf.hdf5lib.callbacks.H5L_iterate_cb;
|
||||
import hdf.hdf5lib.callbacks.H5L_iterate_t;
|
||||
import hdf.hdf5lib.callbacks.H5O_iterate_cb;
|
||||
import hdf.hdf5lib.callbacks.H5L_iterate_opdata_t;
|
||||
import hdf.hdf5lib.callbacks.H5O_iterate_t;
|
||||
import hdf.hdf5lib.callbacks.H5O_iterate_opdata_t;
|
||||
import hdf.hdf5lib.structs.H5L_info_t;
|
||||
import hdf.hdf5lib.structs.H5O_info_t;
|
||||
|
||||
@@ -55,13 +55,13 @@ public class H5Ex_G_Visit {
|
||||
|
||||
// Begin iteration using H5Ovisit
|
||||
System.out.println("Objects in the file:");
|
||||
H5O_iterate_t iter_data = new H5O_iter_data();
|
||||
H5O_iterate_cb iter_cb = new H5O_iter_callback();
|
||||
H5O_iterate_opdata_t iter_data = new H5O_iter_data();
|
||||
H5O_iterate_t iter_cb = new H5O_iter_callback();
|
||||
H5.H5Ovisit(file_id, HDF5Constants.H5_INDEX_NAME, HDF5Constants.H5_ITER_NATIVE, iter_cb, iter_data);
|
||||
System.out.println();
|
||||
// Repeat the same process using H5Lvisit
|
||||
H5L_iterate_t iter_data2 = new H5L_iter_data();
|
||||
H5L_iterate_cb iter_cb2 = new H5L_iter_callback();
|
||||
H5L_iterate_opdata_t iter_data2 = new H5L_iter_data();
|
||||
H5L_iterate_t iter_cb2 = new H5L_iter_callback();
|
||||
System.out.println("Links in the file:");
|
||||
H5.H5Lvisit(file_id, HDF5Constants.H5_INDEX_NAME, HDF5Constants.H5_ITER_NATIVE, iter_cb2, iter_data2);
|
||||
|
||||
@@ -91,12 +91,12 @@ public class H5Ex_G_Visit {
|
||||
}
|
||||
}
|
||||
|
||||
private class H5L_iter_data implements H5L_iterate_t {
|
||||
private class H5L_iter_data implements H5L_iterate_opdata_t {
|
||||
public ArrayList<idata> iterdata = new ArrayList<idata>();
|
||||
}
|
||||
|
||||
private class H5L_iter_callback implements H5L_iterate_cb {
|
||||
public int callback(long group, String name, H5L_info_t info, H5L_iterate_t op_data) {
|
||||
private class H5L_iter_callback implements H5L_iterate_t {
|
||||
public int callback(long group, String name, H5L_info_t info, H5L_iterate_opdata_t op_data) {
|
||||
|
||||
idata id = new idata(name, info.type);
|
||||
((H5L_iter_data) op_data).iterdata.add(id);
|
||||
@@ -107,8 +107,8 @@ public class H5Ex_G_Visit {
|
||||
// Get type of the object and display its name and type. The name of the object is passed to this
|
||||
// function by the Library.
|
||||
infobuf = H5.H5Oget_info_by_name(group, name, HDF5Constants.H5P_DEFAULT);
|
||||
H5O_iterate_cb iter_cbO = new H5O_iter_callback();
|
||||
H5O_iterate_t iter_dataO = new H5O_iter_data();
|
||||
H5O_iterate_t iter_cbO = new H5O_iter_callback();
|
||||
H5O_iterate_opdata_t iter_dataO = new H5O_iter_data();
|
||||
ret = iter_cbO.callback(group, name, infobuf, iter_dataO);
|
||||
}
|
||||
catch (Exception e) {
|
||||
@@ -119,12 +119,12 @@ public class H5Ex_G_Visit {
|
||||
}
|
||||
}
|
||||
|
||||
private class H5O_iter_data implements H5O_iterate_t {
|
||||
private class H5O_iter_data implements H5O_iterate_opdata_t {
|
||||
public ArrayList<idata> iterdata = new ArrayList<idata>();
|
||||
}
|
||||
|
||||
private class H5O_iter_callback implements H5O_iterate_cb {
|
||||
public int callback(long group, String name, H5O_info_t info, H5O_iterate_t op_data) {
|
||||
private class H5O_iter_callback implements H5O_iterate_t {
|
||||
public int callback(long group, String name, H5O_info_t info, H5O_iterate_opdata_t op_data) {
|
||||
idata id = new idata(name, info.type);
|
||||
((H5O_iter_data) op_data).iterdata.add(id);
|
||||
|
||||
|
||||
@@ -45,7 +45,7 @@ foreach (HDFJAVA_JAR ${CMAKE_JAVA_INCLUDE_PATH})
|
||||
set (CMAKE_JAVA_CLASSPATH "${CMAKE_JAVA_CLASSPATH}${CMAKE_JAVA_INCLUDE_FLAG_SEP}${HDFJAVA_JAR}")
|
||||
endforeach ()
|
||||
|
||||
if (BUILD_TESTING)
|
||||
if (BUILD_TESTING AND HDF5_TEST_EXAMPLES AND HDF5_TEST_SERIAL)
|
||||
get_property (target_name TARGET ${HDF5_JAVA_JNI_LIB_TARGET} PROPERTY OUTPUT_NAME)
|
||||
set (CMD_ARGS "-Dhdf.hdf5lib.H5.loadLibraryName=${target_name}$<$<CONFIG:Debug>:${CMAKE_DEBUG_POSTFIX}>;")
|
||||
|
||||
|
||||
@@ -51,10 +51,10 @@ hdf5_java_JAVA = \
|
||||
${pkgpath}/callbacks/H5D_iterate_t.java \
|
||||
${pkgpath}/callbacks/H5E_walk_cb.java \
|
||||
${pkgpath}/callbacks/H5E_walk_t.java \
|
||||
${pkgpath}/callbacks/H5L_iterate_cb.java \
|
||||
${pkgpath}/callbacks/H5L_iterate_t.java \
|
||||
${pkgpath}/callbacks/H5O_iterate_cb.java \
|
||||
${pkgpath}/callbacks/H5L_iterate_opdata_t.java \
|
||||
${pkgpath}/callbacks/H5O_iterate_t.java \
|
||||
${pkgpath}/callbacks/H5O_iterate_opdata_t.java \
|
||||
${pkgpath}/callbacks/H5P_cls_close_func_cb.java \
|
||||
${pkgpath}/callbacks/H5P_cls_close_func_t.java \
|
||||
${pkgpath}/callbacks/H5P_cls_copy_func_cb.java \
|
||||
@@ -103,6 +103,8 @@ hdf5_java_JAVA = \
|
||||
${pkgpath}/structs/H5G_info_t.java \
|
||||
${pkgpath}/structs/H5L_info_t.java \
|
||||
${pkgpath}/structs/H5O_info_t.java \
|
||||
${pkgpath}/structs/H5O_native_info_t.java \
|
||||
${pkgpath}/structs/H5O_token_t.java \
|
||||
${pkgpath}/structs/H5O_hdr_info_t.java \
|
||||
${pkgpath}/structs/H5AC_cache_config_t.java \
|
||||
${pkgpath}/H5.java \
|
||||
|
||||
@@ -18,10 +18,10 @@ set (HDF5_JAVA_HDF_HDF5_CALLBACKS_SOURCES
|
||||
callbacks/H5D_iterate_t.java
|
||||
callbacks/H5E_walk_cb.java
|
||||
callbacks/H5E_walk_t.java
|
||||
callbacks/H5L_iterate_cb.java
|
||||
callbacks/H5L_iterate_t.java
|
||||
callbacks/H5O_iterate_cb.java
|
||||
callbacks/H5L_iterate_opdata_t.java
|
||||
callbacks/H5O_iterate_t.java
|
||||
callbacks/H5O_iterate_opdata_t.java
|
||||
callbacks/H5P_cls_close_func_cb.java
|
||||
callbacks/H5P_cls_close_func_t.java
|
||||
callbacks/H5P_cls_copy_func_cb.java
|
||||
@@ -79,6 +79,8 @@ set (HDF5_JAVA_HDF_HDF5_STRUCTS_SOURCES
|
||||
structs/H5L_info_t.java
|
||||
structs/H5O_hdr_info_t.java
|
||||
structs/H5O_info_t.java
|
||||
structs/H5O_native_info_t.java
|
||||
structs/H5O_token_t.java
|
||||
)
|
||||
|
||||
set (HDF5_JAVA_HDF_HDF5_SOURCES
|
||||
|
||||
+203
-42
@@ -24,10 +24,10 @@ import hdf.hdf5lib.callbacks.H5D_iterate_cb;
|
||||
import hdf.hdf5lib.callbacks.H5D_iterate_t;
|
||||
import hdf.hdf5lib.callbacks.H5E_walk_cb;
|
||||
import hdf.hdf5lib.callbacks.H5E_walk_t;
|
||||
import hdf.hdf5lib.callbacks.H5L_iterate_cb;
|
||||
import hdf.hdf5lib.callbacks.H5L_iterate_t;
|
||||
import hdf.hdf5lib.callbacks.H5O_iterate_cb;
|
||||
import hdf.hdf5lib.callbacks.H5L_iterate_opdata_t;
|
||||
import hdf.hdf5lib.callbacks.H5O_iterate_t;
|
||||
import hdf.hdf5lib.callbacks.H5O_iterate_opdata_t;
|
||||
import hdf.hdf5lib.callbacks.H5P_cls_close_func_cb;
|
||||
import hdf.hdf5lib.callbacks.H5P_cls_close_func_t;
|
||||
import hdf.hdf5lib.callbacks.H5P_cls_copy_func_cb;
|
||||
@@ -55,6 +55,8 @@ import hdf.hdf5lib.structs.H5FD_ros3_fapl_t;
|
||||
import hdf.hdf5lib.structs.H5G_info_t;
|
||||
import hdf.hdf5lib.structs.H5L_info_t;
|
||||
import hdf.hdf5lib.structs.H5O_info_t;
|
||||
import hdf.hdf5lib.structs.H5O_native_info_t;
|
||||
import hdf.hdf5lib.structs.H5O_token_t;
|
||||
|
||||
/**
|
||||
* This class is the Java interface for the HDF5 library.
|
||||
@@ -3577,8 +3579,8 @@ public class H5 implements java.io.Serializable {
|
||||
* OUT: Names of all objects under the group, name.
|
||||
* @param objTypes
|
||||
* OUT: Types of all objects under the group, name.
|
||||
* @param objRef
|
||||
* OUT: Reference number of all objects under the group, name.
|
||||
* @param tokens
|
||||
* OUT: Object token of all objects under the group, name.
|
||||
*
|
||||
* @return the number of items found
|
||||
*
|
||||
@@ -3588,26 +3590,26 @@ public class H5 implements java.io.Serializable {
|
||||
* - name is null.
|
||||
*/
|
||||
public synchronized static int H5Gget_obj_info_all(long loc_id, String name, String[] objNames, int[] objTypes,
|
||||
long[] objRef) throws HDF5LibraryException, NullPointerException {
|
||||
H5O_token_t[] tokens) throws HDF5LibraryException, NullPointerException {
|
||||
if (objNames == null) {
|
||||
throw new NullPointerException("H5Gget_obj_info_all(): name array is null");
|
||||
}
|
||||
|
||||
return H5Gget_obj_info_all(loc_id, name, objNames, objTypes, null, null, objRef, HDF5Constants.H5_INDEX_NAME);
|
||||
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,
|
||||
int[] ltype, long[] ref, int indx_type) throws HDF5LibraryException, NullPointerException {
|
||||
return H5Gget_obj_info_full(loc_id, name, oname, otype, ltype, null, ref, indx_type, -1);
|
||||
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);
|
||||
}
|
||||
|
||||
public synchronized static int H5Gget_obj_info_all(long loc_id, String name, String[] oname, int[] otype,
|
||||
int[] ltype, long[] fno, long[] ref, int indx_type) throws HDF5LibraryException, NullPointerException {
|
||||
return H5Gget_obj_info_full(loc_id, name, oname, otype, ltype, fno, ref, oname.length, indx_type, -1);
|
||||
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, oname.length, indx_type, -1);
|
||||
}
|
||||
|
||||
public synchronized static int H5Gget_obj_info_full(long loc_id, String name, String[] oname, int[] otype,
|
||||
int[] ltype, long[] fno, long[] ref, int indx_type, int indx_order) throws HDF5LibraryException,
|
||||
int[] ltype, long[] fno, H5O_token_t[] tokens, int indx_type, int indx_order) throws HDF5LibraryException,
|
||||
NullPointerException {
|
||||
if (oname == null) {
|
||||
throw new NullPointerException("H5Gget_obj_info_full(): name array is null");
|
||||
@@ -3629,7 +3631,7 @@ public class H5 implements java.io.Serializable {
|
||||
ltype = new int[otype.length];
|
||||
|
||||
if (fno == null)
|
||||
fno = new long[ref.length];
|
||||
fno = new long[tokens.length];
|
||||
|
||||
if (indx_type < 0)
|
||||
indx_type = HDF5Constants.H5_INDEX_NAME;
|
||||
@@ -3638,7 +3640,7 @@ public class H5 implements java.io.Serializable {
|
||||
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, ref, oname.length, indx_type,
|
||||
int status = H5Gget_obj_info_full(loc_id, name, oname, otype, ltype, fno, tokens, oname.length, indx_type,
|
||||
indx_order);
|
||||
for (int indx = 0; indx < oname.length; indx++)
|
||||
log.trace("H5Gget_obj_info_full: oname={}", oname[indx]);
|
||||
@@ -3646,7 +3648,7 @@ public class H5 implements java.io.Serializable {
|
||||
}
|
||||
|
||||
private synchronized static native int H5Gget_obj_info_full(long loc_id, String name, String[] oname, int[] otype,
|
||||
int[] ltype, long[] fno, long[] ref, int n, int indx_type, int indx_order) throws HDF5LibraryException,
|
||||
int[] ltype, long[] fno, H5O_token_t[] tokens, int n, int indx_type, int indx_order) throws HDF5LibraryException,
|
||||
NullPointerException;
|
||||
|
||||
/**
|
||||
@@ -3701,8 +3703,8 @@ public class H5 implements java.io.Serializable {
|
||||
* OUT: Types of all objects under the group, name.
|
||||
* @param lnkTypes
|
||||
* OUT: Types of all links under the group, name.
|
||||
* @param objRef
|
||||
* OUT: Reference number of all objects under the group, name.
|
||||
* @param objToken
|
||||
* OUT: Object token of all objects under the group, name.
|
||||
* @param objMax
|
||||
* IN: Maximum number of all objects under the group, name.
|
||||
*
|
||||
@@ -3714,7 +3716,7 @@ public class H5 implements java.io.Serializable {
|
||||
* - name is null.
|
||||
*/
|
||||
public synchronized static int H5Gget_obj_info_max(long loc_id, String[] objNames, int[] objTypes, int[] lnkTypes,
|
||||
long[] objRef, long objMax) throws HDF5LibraryException, NullPointerException {
|
||||
H5O_token_t[] objToken, long objMax) throws HDF5LibraryException, NullPointerException {
|
||||
if (objNames == null) {
|
||||
throw new NullPointerException("H5Gget_obj_info_max(): name array is null");
|
||||
}
|
||||
@@ -3739,11 +3741,11 @@ public class H5 implements java.io.Serializable {
|
||||
throw new HDF5LibraryException("H5Gget_obj_info_max(): name and type array sizes are different");
|
||||
}
|
||||
|
||||
return H5Gget_obj_info_max(loc_id, objNames, objTypes, lnkTypes, objRef, objMax, objNames.length);
|
||||
return H5Gget_obj_info_max(loc_id, objNames, objTypes, lnkTypes, objToken, objMax, objNames.length);
|
||||
}
|
||||
|
||||
private synchronized static native int H5Gget_obj_info_max(long loc_id, String[] oname, int[] otype, int[] ltype,
|
||||
long[] ref, long amax, int n) throws HDF5LibraryException, NullPointerException;
|
||||
H5O_token_t[] tokens, long amax, int n) throws HDF5LibraryException, NullPointerException;
|
||||
|
||||
/**
|
||||
* H5Gn_members report the number of objects in a Group. The 'objects' include everything that will be visited by
|
||||
@@ -4340,8 +4342,8 @@ public class H5 implements java.io.Serializable {
|
||||
* @exception HDF5LibraryException
|
||||
* - Error from the HDF-5 Library.
|
||||
**/
|
||||
public synchronized static native int H5Literate(long grp_id, int idx_type, int order, long idx, H5L_iterate_cb op,
|
||||
H5L_iterate_t op_data) throws HDF5LibraryException;
|
||||
public synchronized static native int H5Literate(long grp_id, int idx_type, int order, long idx, H5L_iterate_t op,
|
||||
H5L_iterate_opdata_t op_data) throws HDF5LibraryException;
|
||||
|
||||
/**
|
||||
* H5Literate_by_name iterates through links in a group.
|
||||
@@ -4372,7 +4374,7 @@ public class H5 implements java.io.Serializable {
|
||||
* - group_name is null.
|
||||
**/
|
||||
public synchronized static native int H5Literate_by_name(long grp_id, String group_name, int idx_type, int order,
|
||||
long idx, H5L_iterate_cb op, H5L_iterate_t op_data, long lapl_id) throws HDF5LibraryException,
|
||||
long idx, H5L_iterate_t op, H5L_iterate_opdata_t op_data, long lapl_id) throws HDF5LibraryException,
|
||||
NullPointerException;
|
||||
|
||||
/**
|
||||
@@ -4419,8 +4421,8 @@ public class H5 implements java.io.Serializable {
|
||||
* @exception HDF5LibraryException
|
||||
* - Error from the HDF-5 Library.
|
||||
**/
|
||||
public synchronized static native int H5Lvisit(long grp_id, int idx_type, int order, H5L_iterate_cb op,
|
||||
H5L_iterate_t op_data) throws HDF5LibraryException;
|
||||
public synchronized static native int H5Lvisit(long grp_id, int idx_type, int order, H5L_iterate_t op,
|
||||
H5L_iterate_opdata_t op_data) throws HDF5LibraryException;
|
||||
|
||||
/**
|
||||
* H5Lvisit_by_name recursively visits all links starting from a specified group.
|
||||
@@ -4449,7 +4451,7 @@ public class H5 implements java.io.Serializable {
|
||||
* - group_name is null.
|
||||
**/
|
||||
public synchronized static native int H5Lvisit_by_name(long loc_id, String group_name, int idx_type, int order,
|
||||
H5L_iterate_cb op, H5L_iterate_t op_data, long lapl_id) throws HDF5LibraryException, NullPointerException;
|
||||
H5L_iterate_t op, H5L_iterate_opdata_t op_data, long lapl_id) throws HDF5LibraryException, NullPointerException;
|
||||
|
||||
|
||||
/**
|
||||
@@ -4665,6 +4667,52 @@ public class H5 implements java.io.Serializable {
|
||||
public synchronized static native H5O_info_t H5Oget_info(long loc_id, int fields) throws HDF5LibraryException,
|
||||
NullPointerException;
|
||||
|
||||
/**
|
||||
* H5Oget_info_by_name retrieves the metadata for an object, identifying the object by location and relative name.
|
||||
*
|
||||
* @param loc_id
|
||||
* IN: File or group identifier specifying location of group in which object is located
|
||||
* @param name
|
||||
* IN: Relative name of group
|
||||
* @param lapl_id
|
||||
* IN: Access property list identifier for the link pointing to the object (Not currently used; pass as
|
||||
* H5P_DEFAULT.)
|
||||
*
|
||||
* @return object information
|
||||
*
|
||||
* @exception HDF5LibraryException
|
||||
* - Error from the HDF-5 Library.
|
||||
* @exception NullPointerException
|
||||
* - name is null.
|
||||
**/
|
||||
public static H5O_info_t H5Oget_info_by_name(long loc_id, String name, long lapl_id)
|
||||
throws HDF5LibraryException, NullPointerException {
|
||||
return H5Oget_info_by_name(loc_id, name, HDF5Constants.H5O_INFO_ALL, lapl_id);
|
||||
}
|
||||
|
||||
/**
|
||||
* H5Oget_info_by_name retrieves the metadata for an object, identifying the object by location and relative name.
|
||||
*
|
||||
* @param loc_id
|
||||
* IN: File or group identifier specifying location of group in which object is located
|
||||
* @param name
|
||||
* IN: Relative name of group
|
||||
* @param fields
|
||||
* IN: Object fields to select
|
||||
* @param lapl_id
|
||||
* IN: Access property list identifier for the link pointing to the object (Not currently used; pass as
|
||||
* H5P_DEFAULT.)
|
||||
*
|
||||
* @return object information
|
||||
*
|
||||
* @exception HDF5LibraryException
|
||||
* - Error from the HDF-5 Library.
|
||||
* @exception NullPointerException
|
||||
* - name is null.
|
||||
**/
|
||||
public synchronized static native H5O_info_t H5Oget_info_by_name(long loc_id, String name, int fields, long lapl_id)
|
||||
throws HDF5LibraryException, NullPointerException;
|
||||
|
||||
/**
|
||||
* H5Oget_info_by_idx retrieves the metadata for an object, identifying the object by an index position.
|
||||
*
|
||||
@@ -4724,7 +4772,47 @@ public class H5 implements java.io.Serializable {
|
||||
int order, long n, int fields, long lapl_id) throws HDF5LibraryException, NullPointerException;
|
||||
|
||||
/**
|
||||
* H5Oget_info_by_name retrieves the metadata for an object, identifying the object by location and relative name.
|
||||
* H5Oget_native_info retrieves the native HDF5-specific metadata for an HDF5 object specified by an identifier.
|
||||
* Native HDF5-specific metadata includes things like object header information and object storage layout information.
|
||||
*
|
||||
* @param loc_id
|
||||
* IN: Identifier for target object
|
||||
*
|
||||
* @return object information
|
||||
*
|
||||
* @exception HDF5LibraryException
|
||||
* - Error from the HDF-5 Library.
|
||||
* @exception NullPointerException
|
||||
* - name is null.
|
||||
**/
|
||||
public static H5O_native_info_t H5Oget_native_info(long loc_id) throws HDF5LibraryException,
|
||||
NullPointerException {
|
||||
return H5Oget_native_info(loc_id, HDF5Constants.H5O_NATIVE_INFO_ALL);
|
||||
}
|
||||
|
||||
/**
|
||||
* H5Oget_native_info retrieves the native HDF5-specific metadata for an HDF5 object specified by an identifier.
|
||||
* Native HDF5-specific metadata includes things like object header information and object storage layout information.
|
||||
*
|
||||
* @param loc_id
|
||||
* IN: Identifier for target object
|
||||
* @param fields
|
||||
* IN: Object fields to select
|
||||
*
|
||||
* @return object information
|
||||
*
|
||||
* @exception HDF5LibraryException
|
||||
* - Error from the HDF-5 Library.
|
||||
* @exception NullPointerException
|
||||
* - name is null.
|
||||
**/
|
||||
public synchronized static native H5O_native_info_t H5Oget_native_info(long loc_id, int fields) throws HDF5LibraryException,
|
||||
NullPointerException;
|
||||
|
||||
/**
|
||||
* H5Oget_native_info_by_name retrieves the native HDF5-specific metadata for an HDF5 object, identifying the object
|
||||
* by location and relative name. Native HDF5-specific metadata includes things like object header information and
|
||||
* object storage layout information.
|
||||
*
|
||||
* @param loc_id
|
||||
* IN: File or group identifier specifying location of group in which object is located
|
||||
@@ -4741,13 +4829,15 @@ public class H5 implements java.io.Serializable {
|
||||
* @exception NullPointerException
|
||||
* - name is null.
|
||||
**/
|
||||
public static H5O_info_t H5Oget_info_by_name(long loc_id, String name, long lapl_id)
|
||||
public static H5O_native_info_t H5Oget_native_info_by_name(long loc_id, String name, long lapl_id)
|
||||
throws HDF5LibraryException, NullPointerException {
|
||||
return H5Oget_info_by_name(loc_id, name, HDF5Constants.H5O_INFO_ALL, lapl_id);
|
||||
return H5Oget_native_info_by_name(loc_id, name, HDF5Constants.H5O_NATIVE_INFO_ALL, lapl_id);
|
||||
}
|
||||
|
||||
/**
|
||||
* H5Oget_info_by_name retrieves the metadata for an object, identifying the object by location and relative name.
|
||||
* H5Oget_native_info_by_name retrieves the native HDF5-specific metadata for an HDF5 object, identifying the object
|
||||
* by location and relative name. Native HDF5-specific metadata includes things like object header information and
|
||||
* object storage layout information.
|
||||
*
|
||||
* @param loc_id
|
||||
* IN: File or group identifier specifying location of group in which object is located
|
||||
@@ -4766,9 +4856,71 @@ public class H5 implements java.io.Serializable {
|
||||
* @exception NullPointerException
|
||||
* - name is null.
|
||||
**/
|
||||
public synchronized static native H5O_info_t H5Oget_info_by_name(long loc_id, String name, int fields, long lapl_id)
|
||||
public synchronized static native H5O_native_info_t H5Oget_native_info_by_name(long loc_id, String name, int fields, long lapl_id)
|
||||
throws HDF5LibraryException, NullPointerException;
|
||||
|
||||
/**
|
||||
* H5Oget_native_info_by_idx retrieves the native HDF5-specific metadata for an HDF5 object, identifying the object
|
||||
* by an index position. Native HDF5-specific metadata includes things like object header information and
|
||||
* object storage layout information.
|
||||
*
|
||||
* @param loc_id
|
||||
* IN: File or group identifier
|
||||
* @param group_name
|
||||
* IN: Name of group, relative to loc_id, in which object is located
|
||||
* @param idx_type
|
||||
* IN: Type of index by which objects are ordered
|
||||
* @param order
|
||||
* IN: Order of iteration within index
|
||||
* @param n
|
||||
* IN: Object to open
|
||||
* @param lapl_id
|
||||
* IN: Access property list identifier for the link pointing to the object (Not currently used; pass as
|
||||
* H5P_DEFAULT.)
|
||||
*
|
||||
* @return object information
|
||||
*
|
||||
* @exception HDF5LibraryException
|
||||
* - Error from the HDF-5 Library.
|
||||
* @exception NullPointerException
|
||||
* - name is null.
|
||||
**/
|
||||
public static H5O_native_info_t H5Oget_native_info_by_idx(long loc_id, String group_name, int idx_type,
|
||||
int order, long n, long lapl_id) throws HDF5LibraryException, NullPointerException {
|
||||
return H5Oget_native_info_by_idx(loc_id, group_name, idx_type, order, n, HDF5Constants.H5O_NATIVE_INFO_ALL, lapl_id);
|
||||
}
|
||||
|
||||
/**
|
||||
* H5Oget_native_info_by_idx retrieves the native HDF5-specific metadata for an HDF5 object, identifying the object
|
||||
* by an index position. Native HDF5-specific metadata includes things like object header information and
|
||||
* object storage layout information.
|
||||
*
|
||||
* @param loc_id
|
||||
* IN: File or group identifier
|
||||
* @param group_name
|
||||
* IN: Name of group, relative to loc_id, in which object is located
|
||||
* @param idx_type
|
||||
* IN: Type of index by which objects are ordered
|
||||
* @param order
|
||||
* IN: Order of iteration within index
|
||||
* @param n
|
||||
* IN: Object to open
|
||||
* @param fields
|
||||
* IN: Object fields to select
|
||||
* @param lapl_id
|
||||
* IN: Access property list identifier for the link pointing to the object (Not currently used; pass as
|
||||
* H5P_DEFAULT.)
|
||||
*
|
||||
* @return object information
|
||||
*
|
||||
* @exception HDF5LibraryException
|
||||
* - Error from the HDF-5 Library.
|
||||
* @exception NullPointerException
|
||||
* - name is null.
|
||||
**/
|
||||
public synchronized static native H5O_native_info_t H5Oget_native_info_by_idx(long loc_id, String group_name, int idx_type,
|
||||
int order, long n, int fields, long lapl_id) throws HDF5LibraryException, NullPointerException;
|
||||
|
||||
/**
|
||||
* H5Olink creates a new hard link to an object in an HDF5 file.
|
||||
*
|
||||
@@ -4843,7 +4995,7 @@ public class H5 implements java.io.Serializable {
|
||||
* @exception NullPointerException
|
||||
* - name is null.
|
||||
**/
|
||||
public static int H5Ovisit(long obj_id, int idx_type, int order, H5O_iterate_cb op, H5O_iterate_t op_data)
|
||||
public static int H5Ovisit(long obj_id, int idx_type, int order, H5O_iterate_t op, H5O_iterate_opdata_t op_data)
|
||||
throws HDF5LibraryException, NullPointerException {
|
||||
return H5Ovisit(obj_id, idx_type, order, op, op_data, HDF5Constants.H5O_INFO_ALL);
|
||||
}
|
||||
@@ -4872,8 +5024,8 @@ public class H5 implements java.io.Serializable {
|
||||
* @exception NullPointerException
|
||||
* - name is null.
|
||||
**/
|
||||
public synchronized static native int H5Ovisit(long obj_id, int idx_type, int order, H5O_iterate_cb op,
|
||||
H5O_iterate_t op_data, int fields) throws HDF5LibraryException, NullPointerException;
|
||||
public synchronized static native int H5Ovisit(long obj_id, int idx_type, int order, H5O_iterate_t op,
|
||||
H5O_iterate_opdata_t op_data, int fields) throws HDF5LibraryException, NullPointerException;
|
||||
|
||||
/**
|
||||
* H5Ovisit_by_name recursively visits all objects starting from a specified object.
|
||||
@@ -4902,7 +5054,7 @@ public class H5 implements java.io.Serializable {
|
||||
* - name is null.
|
||||
**/
|
||||
public static int H5Ovisit_by_name(long loc_id, String obj_name, int idx_type, int order,
|
||||
H5O_iterate_cb op, H5O_iterate_t op_data, long lapl_id) throws HDF5LibraryException, NullPointerException {
|
||||
H5O_iterate_t op, H5O_iterate_opdata_t op_data, long lapl_id) throws HDF5LibraryException, NullPointerException {
|
||||
return H5Ovisit_by_name(loc_id, obj_name, idx_type, order, op, op_data, HDF5Constants.H5O_INFO_ALL, lapl_id);
|
||||
}
|
||||
|
||||
@@ -4935,7 +5087,7 @@ public class H5 implements java.io.Serializable {
|
||||
* - name is null.
|
||||
**/
|
||||
public synchronized static native int H5Ovisit_by_name(long loc_id, String obj_name, int idx_type, int order,
|
||||
H5O_iterate_cb op, H5O_iterate_t op_data, int fields, long lapl_id) throws HDF5LibraryException, NullPointerException;
|
||||
H5O_iterate_t op, H5O_iterate_opdata_t op_data, int fields, long lapl_id) throws HDF5LibraryException, NullPointerException;
|
||||
|
||||
|
||||
/**
|
||||
@@ -4977,26 +5129,28 @@ public class H5 implements java.io.Serializable {
|
||||
public synchronized static native void H5Oincr_refcount(long object_id) throws HDF5LibraryException;
|
||||
|
||||
/**
|
||||
* H5Oopen_by_addr opens a group, dataset, or named datatype using its address within an HDF5 file.
|
||||
* H5Oopen_by_token opens a group, dataset, or named datatype using its object token within an HDF5 file.
|
||||
*
|
||||
* @param loc_id IN: File or group identifier
|
||||
* @param addr IN: Object's address in the file
|
||||
* @param token IN: Object's token in the file
|
||||
*
|
||||
* @return an object identifier for the opened object
|
||||
*
|
||||
* @exception HDF5LibraryException - Error from the HDF-5 Library.
|
||||
**/
|
||||
public static long H5Oopen_by_addr(long loc_id, long addr) throws HDF5LibraryException {
|
||||
long id = _H5Oopen_by_addr(loc_id, addr);
|
||||
public static long H5Oopen_by_token(long loc_id, H5O_token_t token) throws HDF5LibraryException {
|
||||
long id = _H5Oopen_by_token(loc_id, token);
|
||||
|
||||
if (id > 0) {
|
||||
log.trace("OPEN_IDS: H5Oopen_by_addr add {}", id);
|
||||
log.trace("OPEN_IDS: H5Oopen_by_token add {}", id);
|
||||
OPEN_IDS.add(id);
|
||||
log.trace("OPEN_IDS: {}", OPEN_IDS.size());
|
||||
}
|
||||
|
||||
return id;
|
||||
}
|
||||
|
||||
private synchronized static native long _H5Oopen_by_addr(long loc_id, long addr)
|
||||
private synchronized static native long _H5Oopen_by_token(long loc_id, H5O_token_t token)
|
||||
throws HDF5LibraryException, NullPointerException;
|
||||
|
||||
/**
|
||||
@@ -5060,6 +5214,12 @@ public class H5 implements java.io.Serializable {
|
||||
public synchronized static native void H5Oenable_mdc_flushes(long object_id);
|
||||
public synchronized static native boolean H5Oare_mdc_flushes_disabled(long object_id);
|
||||
|
||||
// /////// unimplemented ////////
|
||||
// herr_t H5Otoken_cmp(hid_t loc_id, const H5O_token_t *token1, const H5O_token_t *token2,
|
||||
// int *cmp_value);
|
||||
// herr_t H5Otoken_to_str(hid_t loc_id, const H5O_token_t *token, char **token_str);
|
||||
// herr_t H5Otoken_from_str(hid_t loc_id, const char *token_str, H5O_token_t *token);
|
||||
|
||||
// ////////////////////////////////////////////////////////////
|
||||
// //
|
||||
// H5P: Property List Interface Functions //
|
||||
@@ -10736,7 +10896,8 @@ public class H5 implements java.io.Serializable {
|
||||
public synchronized static native long H5VLregister_connector_by_name(String connector_name, long vipl_id);
|
||||
public synchronized static native long H5VLregister_connector_by_value(int connector_value, long vipl_id);
|
||||
public synchronized static native boolean H5VLis_connector_registered(String name);
|
||||
public synchronized static native long H5VLget_connector_id(String name);
|
||||
public synchronized static native long H5VLget_connector_id(long object_id);
|
||||
public synchronized static native long H5VLget_connector_id_by_name(String name);
|
||||
public synchronized static native String H5VLget_connector_name(long object_id);
|
||||
public synchronized static native void H5VLclose(long connector_id);
|
||||
public synchronized static native void H5VLunregister_connector(long connector_id);
|
||||
|
||||
@@ -14,6 +14,8 @@
|
||||
|
||||
package hdf.hdf5lib;
|
||||
|
||||
import hdf.hdf5lib.structs.H5O_token_t;
|
||||
|
||||
/**
|
||||
* /** This class contains C constants and enumerated types of HDF5 library. The
|
||||
* values of these constants are obtained from the library by calling J2C(int
|
||||
@@ -344,9 +346,10 @@ public class HDF5Constants {
|
||||
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_HDR = H5O_INFO_HDR();
|
||||
public static final int H5O_INFO_META_SIZE = H5O_INFO_META_SIZE();
|
||||
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();
|
||||
@@ -359,6 +362,8 @@ public class HDF5Constants {
|
||||
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();
|
||||
@@ -1308,12 +1313,14 @@ public class HDF5Constants {
|
||||
|
||||
private static native final int H5O_INFO_NUM_ATTRS();
|
||||
|
||||
private static native final int H5O_INFO_HDR();
|
||||
|
||||
private static native final int H5O_INFO_META_SIZE();
|
||||
|
||||
private static native final int H5O_INFO_ALL();
|
||||
|
||||
private static native final int H5O_NATIVE_INFO_HDR();
|
||||
|
||||
private static native final int H5O_NATIVE_INFO_META_SIZE();
|
||||
|
||||
private static native final int H5O_NATIVE_INFO_ALL();
|
||||
|
||||
private static native final int H5O_SHMESG_NONE_FLAG();
|
||||
|
||||
private static native final int H5O_SHMESG_SDSPACE_FLAG();
|
||||
@@ -1338,6 +1345,10 @@ public class HDF5Constants {
|
||||
|
||||
private static native final int H5O_TYPE_NTYPES();
|
||||
|
||||
private static native final int H5O_MAX_TOKEN_SIZE();
|
||||
|
||||
private static native final H5O_token_t H5O_TOKEN_UNDEF();
|
||||
|
||||
private static native final long H5P_ROOT();
|
||||
|
||||
private static native final long H5P_OBJECT_CREATE();
|
||||
|
||||
+1
-4
@@ -13,9 +13,6 @@
|
||||
|
||||
package hdf.hdf5lib.callbacks;
|
||||
|
||||
import hdf.hdf5lib.structs.H5L_info_t;
|
||||
public interface H5L_iterate_opdata_t {
|
||||
|
||||
//Information class for link callback(for H5Lvisit/H5Lvisit_by_name)
|
||||
public interface H5L_iterate_cb extends Callbacks {
|
||||
int callback(long group, String name, H5L_info_t info, H5L_iterate_t op_data);
|
||||
}
|
||||
@@ -13,8 +13,9 @@
|
||||
|
||||
package hdf.hdf5lib.callbacks;
|
||||
|
||||
public interface H5L_iterate_t {
|
||||
/** public ArrayList iterdata = new ArrayList();
|
||||
* Any derived interfaces must define the single public variable as above.
|
||||
*/
|
||||
import hdf.hdf5lib.structs.H5L_info_t;
|
||||
|
||||
// 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);
|
||||
}
|
||||
|
||||
+1
-4
@@ -13,9 +13,6 @@
|
||||
|
||||
package hdf.hdf5lib.callbacks;
|
||||
|
||||
import hdf.hdf5lib.structs.H5O_info_t;
|
||||
public interface H5O_iterate_opdata_t {
|
||||
|
||||
//Information class for link callback(for H5Ovisit/H5Ovisit_by_name)
|
||||
public interface H5O_iterate_cb extends Callbacks {
|
||||
int callback(long group, String name, H5O_info_t info, H5O_iterate_t op_data);
|
||||
}
|
||||
@@ -13,8 +13,9 @@
|
||||
|
||||
package hdf.hdf5lib.callbacks;
|
||||
|
||||
public interface H5O_iterate_t {
|
||||
/** public ArrayList iterdata = new ArrayList();
|
||||
* Any derived interfaces must define the single public variable as above.
|
||||
*/
|
||||
import hdf.hdf5lib.structs.H5O_info_t;
|
||||
|
||||
// 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);
|
||||
}
|
||||
|
||||
@@ -15,22 +15,39 @@ package hdf.hdf5lib.structs;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
//Information struct for link (for H5Lget_info/H5Lget_info_by_idx)
|
||||
public class H5L_info_t implements Serializable{
|
||||
private static final long serialVersionUID = -4754320605310155033L;
|
||||
public int type;
|
||||
public boolean corder_valid;
|
||||
public long corder;
|
||||
public int cset;
|
||||
public long address_val_size;
|
||||
import hdf.hdf5lib.HDF5Constants;
|
||||
|
||||
// Information struct for link (for H5Lget_info/H5Lget_info_by_idx)
|
||||
public class H5L_info_t implements Serializable {
|
||||
private static final long serialVersionUID = -4754320605310155033L;
|
||||
public int type;
|
||||
public boolean corder_valid;
|
||||
public long corder;
|
||||
public int cset;
|
||||
public H5O_token_t token;
|
||||
public long val_size;
|
||||
|
||||
// Constructor for using object token portion of C union
|
||||
H5L_info_t (int type, boolean corder_valid, long corder,
|
||||
int cset, long address_val_size)
|
||||
int cset, H5O_token_t token)
|
||||
{
|
||||
this.type = type;
|
||||
this.corder_valid = corder_valid;
|
||||
this.corder = corder;
|
||||
this.cset = cset;
|
||||
this.address_val_size = address_val_size;
|
||||
this.token = token;
|
||||
this.val_size = -1;
|
||||
}
|
||||
|
||||
// Constructor for using val_size portion of C union
|
||||
H5L_info_t (int type, boolean corder_valid, long corder,
|
||||
int cset, long val_size)
|
||||
{
|
||||
this.type = type;
|
||||
this.corder_valid = corder_valid;
|
||||
this.corder = corder;
|
||||
this.cset = cset;
|
||||
this.token = HDF5Constants.H5O_TOKEN_UNDEF;
|
||||
this.val_size = val_size;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -16,7 +16,7 @@ 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)
|
||||
public class H5O_hdr_info_t implements Serializable{
|
||||
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 */
|
||||
@@ -44,4 +44,38 @@ public class H5O_hdr_info_t implements Serializable{
|
||||
this.mesg_present = mesg_present;
|
||||
this.mesg_shared = mesg_shared;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals(Object o) {
|
||||
if (this == o)
|
||||
return true;
|
||||
|
||||
if (!(o instanceof H5O_hdr_info_t))
|
||||
return false;
|
||||
|
||||
H5O_hdr_info_t info = (H5O_hdr_info_t) o;
|
||||
|
||||
if (this.version != info.version)
|
||||
return false;
|
||||
if (this.nmesgs != info.nmesgs)
|
||||
return false;
|
||||
if (this.nchunks != info.nchunks)
|
||||
return false;
|
||||
if (this.flags != info.flags)
|
||||
return false;
|
||||
if (this.space_total != info.space_total)
|
||||
return false;
|
||||
if (this.space_meta != info.space_meta)
|
||||
return false;
|
||||
if (this.space_mesg != info.space_mesg)
|
||||
return false;
|
||||
if (this.space_free != info.space_free)
|
||||
return false;
|
||||
if (this.mesg_present != info.mesg_present)
|
||||
return false;
|
||||
if (this.mesg_shared != info.mesg_shared)
|
||||
return false;
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -15,38 +15,30 @@ package hdf.hdf5lib.structs;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
//Information struct for object (for H5Oget_info/H5Oget_info_by_name/H5Oget_info_by_idx)
|
||||
public class H5O_info_t implements Serializable{
|
||||
// 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 long addr; /* Object address 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 */
|
||||
public H5O_hdr_info_t hdr; /* Object header information */
|
||||
/* Extra metadata storage for obj & attributes */
|
||||
public H5_ih_info_t meta_size_obj; /* v1/v2 B-tree & local/fractal heap for groups, B-tree for chunked datasets */
|
||||
public H5_ih_info_t meta_size_attr; /* v2 B-tree & heap for attributes */
|
||||
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 */
|
||||
|
||||
public H5O_info_t (long fileno, long addr, int type,
|
||||
int rc, long num_attrs, long atime, long mtime, long ctime, long btime,
|
||||
H5O_hdr_info_t hdr, H5_ih_info_t meta_size_obj, H5_ih_info_t meta_size_attr)
|
||||
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)
|
||||
{
|
||||
this.fileno = fileno;
|
||||
this.addr = addr;
|
||||
this.token = token;
|
||||
this.type = type;
|
||||
this.rc = rc;
|
||||
this.num_attrs = num_attrs;
|
||||
this.atime = atime;
|
||||
this.mtime = mtime;
|
||||
this.ctime = ctime;
|
||||
this.btime = btime;
|
||||
this.hdr = hdr;
|
||||
this.meta_size_obj = meta_size_obj;
|
||||
this.meta_size_attr = meta_size_attr;
|
||||
this.num_attrs = num_attrs;
|
||||
}
|
||||
}
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user