summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/CMakeLists.txt76
-rw-r--r--src/H5.c4
-rw-r--r--src/H5AC.c6
-rw-r--r--src/H5ACpkg.h2
-rw-r--r--src/H5ACpublic.h6
-rw-r--r--src/H5Abtree2.c4
-rw-r--r--src/H5Adense.c4
-rw-r--r--src/H5Aint.c4
-rw-r--r--src/H5Apkg.h2
-rw-r--r--src/H5B.c2
-rw-r--r--src/H5Bprivate.h2
-rw-r--r--src/H5C.c10
-rw-r--r--src/H5Cpkg.h12
-rw-r--r--src/H5Cprivate.h8
-rw-r--r--src/H5Dchunk.c6
-rw-r--r--src/H5Edeprec.c10
-rw-r--r--src/H5F.c2
-rw-r--r--src/H5FDdirect.c6
-rw-r--r--src/H5FDfamily.c2
-rw-r--r--src/H5FDmpio.c4
-rw-r--r--src/H5FDmulti.c2
-rw-r--r--src/H5FL.c6
-rw-r--r--src/H5FS.c6
-rw-r--r--src/H5FScache.c2
-rw-r--r--src/H5Fint.c2
-rw-r--r--src/H5Gbtree2.c4
-rw-r--r--src/H5Gcache.c53
-rw-r--r--src/H5Gdense.c20
-rw-r--r--src/H5Gent.c8
-rw-r--r--src/H5Gname.c2
-rw-r--r--src/H5Gobj.c2
-rw-r--r--src/H5Gpkg.h6
-rw-r--r--src/H5HFcache.c2
-rw-r--r--src/H5HFtiny.c2
-rw-r--r--src/H5L.c743
-rw-r--r--src/H5MF.c2
-rw-r--r--src/H5Oainfo.c5
-rw-r--r--src/H5Oattr.c8
-rw-r--r--src/H5Obogus.c5
-rw-r--r--src/H5Obtreek.c5
-rw-r--r--src/H5Ocache.c4
-rw-r--r--src/H5Ocont.c5
-rw-r--r--src/H5Ocopy.c2
-rw-r--r--src/H5Odrvinfo.c5
-rw-r--r--src/H5Odtype.c4
-rw-r--r--src/H5Oefl.c5
-rw-r--r--src/H5Ofill.c10
-rw-r--r--src/H5Oginfo.c5
-rw-r--r--src/H5Olayout.c5
-rw-r--r--src/H5Olinfo.c5
-rw-r--r--src/H5Olink.c5
-rw-r--r--src/H5Omessage.c62
-rw-r--r--src/H5Omtime.c10
-rw-r--r--src/H5Oname.c5
-rw-r--r--src/H5Opkg.h4
-rw-r--r--src/H5Opline.c95
-rw-r--r--src/H5Oprivate.h2
-rw-r--r--src/H5Orefcount.c5
-rw-r--r--src/H5Osdspace.c5
-rw-r--r--src/H5Oshared.c2
-rw-r--r--src/H5Oshared.h8
-rw-r--r--src/H5Oshmesg.c5
-rw-r--r--src/H5Ostab.c5
-rw-r--r--src/H5S.c2
-rw-r--r--src/H5SM.c16
-rw-r--r--src/H5T.c24
-rw-r--r--src/H5Tpkg.h2
-rw-r--r--src/H5Tprivate.h2
-rw-r--r--src/H5Z.c378
-rw-r--r--src/H5detect.c42
-rw-r--r--src/H5public.h4
-rw-r--r--src/H5system.c4
-rw-r--r--src/Makefile.in92
73 files changed, 1003 insertions, 883 deletions
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index a825958..4d2f1bc 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -1,4 +1,4 @@
-cmake_minimum_required (VERSION 3.2.2)
+cmake_minimum_required (VERSION 3.10)
PROJECT (HDF5_SRC C CXX)
#-----------------------------------------------------------------------------
@@ -616,11 +616,13 @@ TARGET_C_PROPERTIES (H5detect STATIC " " " ")
if (MSVC OR MINGW)
target_link_libraries (H5detect "ws2_32.lib")
endif ()
+if (CMAKE_SYSTEM_NAME STREQUAL "Emscripten")
+ set_property(TARGET H5detect PROPERTY LINK_FLAGS "-O0")
+endif ()
-set (CMD $<TARGET_FILE:H5detect>)
add_custom_command (
OUTPUT ${HDF5_BINARY_DIR}/H5Tinit.c
- COMMAND ${CMD}
+ COMMAND $<TARGET_FILE:H5detect>
ARGS > ${HDF5_BINARY_DIR}/H5Tinit.c
DEPENDS H5detect
)
@@ -630,11 +632,13 @@ TARGET_C_PROPERTIES (H5make_libsettings STATIC " " " ")
if (MSVC OR MINGW)
target_link_libraries (H5make_libsettings "ws2_32.lib")
endif ()
+if (CMAKE_SYSTEM_NAME STREQUAL "Emscripten")
+ set_property(TARGET H5make_libsettings PROPERTY LINK_FLAGS "-O0")
+endif ()
-set (CMD $<TARGET_FILE:H5make_libsettings>)
add_custom_command (
OUTPUT ${HDF5_BINARY_DIR}/H5lib_settings.c
- COMMAND ${CMD}
+ COMMAND $<TARGET_FILE:H5make_libsettings>
ARGS > ${HDF5_BINARY_DIR}/H5lib_settings.c
DEPENDS H5make_libsettings
WORKING_DIRECTORY ${HDF5_BINARY_DIR}
@@ -696,13 +700,10 @@ add_library (${HDF5_LIB_TARGET} STATIC ${common_SRCS} ${H5_PUBLIC_HEADERS} ${H5_
TARGET_C_PROPERTIES (${HDF5_LIB_TARGET} STATIC " " " ")
target_link_libraries (${HDF5_LIB_TARGET} PRIVATE ${LINK_LIBS} ${LINK_COMP_LIBS})
if (NOT WIN32)
- target_link_libraries (${HDF5_LIB_TARGET} PUBLIC dl)
-endif ()
-if (H5_HAVE_PARALLEL AND MPI_C_FOUND)
- target_include_directories (${HDF5_LIB_TARGET} PUBLIC ${MPI_C_INCLUDE_DIRS})
+ target_link_libraries (${HDF5_LIB_TARGET} PUBLIC ${CMAKE_DL_LIBS})
endif ()
set_global_variable (HDF5_LIBRARIES_TO_EXPORT ${HDF5_LIB_TARGET})
-H5_SET_LIB_OPTIONS (${HDF5_LIB_TARGET} ${HDF5_LIB_NAME} STATIC)
+H5_SET_LIB_OPTIONS (${HDF5_LIB_TARGET} ${HDF5_LIB_NAME} STATIC 0)
set_target_properties (${HDF5_LIB_TARGET} PROPERTIES
FOLDER libraries
INTERFACE_INCLUDE_DIRECTORIES "$<INSTALL_INTERFACE:$<INSTALL_PREFIX>/include>"
@@ -722,13 +723,10 @@ if (BUILD_SHARED_LIBS)
TARGET_C_PROPERTIES (${HDF5_LIBSH_TARGET} SHARED " " " ")
target_link_libraries (${HDF5_LIBSH_TARGET} PRIVATE ${LINK_LIBS} ${LINK_COMP_LIBS})
if (NOT WIN32)
- target_link_libraries (${HDF5_LIBSH_TARGET} PUBLIC dl)
- endif ()
- if (H5_HAVE_PARALLEL AND MPI_C_FOUND)
- target_include_directories (${HDF5_LIBSH_TARGET} PUBLIC ${MPI_C_INCLUDE_DIRS})
+ target_link_libraries (${HDF5_LIBSH_TARGET} PUBLIC ${CMAKE_DL_LIBS})
endif ()
set_global_variable (HDF5_LIBRARIES_TO_EXPORT "${HDF5_LIBRARIES_TO_EXPORT};${HDF5_LIBSH_TARGET}")
- H5_SET_LIB_OPTIONS (${HDF5_LIBSH_TARGET} ${HDF5_LIB_NAME} SHARED ${HDF5_PACKAGE_SOVERSION})
+ H5_SET_LIB_OPTIONS (${HDF5_LIBSH_TARGET} ${HDF5_LIB_NAME} SHARED "LIB")
set_target_properties (${HDF5_LIBSH_TARGET} PROPERTIES
FOLDER libraries
COMPILE_DEFINITIONS "H5_BUILT_AS_DYNAMIC_LIB"
@@ -787,3 +785,51 @@ if (HDF5_EXPORTED_TARGETS)
INCLUDES DESTINATION include
)
endif ()
+
+#-----------------------------------------------------------------------------
+# Create pkgconfig files
+#-----------------------------------------------------------------------------
+set (_PKG_CONFIG_PREFIX ${CMAKE_INSTALL_PREFIX})
+set (_PKG_CONFIG_EXEC_PREFIX \${prefix})
+set (_PKG_CONFIG_LIBDIR \${exec_prefix}/lib)
+set (_PKG_CONFIG_INCLUDEDIR \${prefix}/include)
+set (_PKG_CONFIG_LIBNAME "${HDF5_LIB_CORENAME}")
+set (_PKG_CONFIG_VERSION "${HDF5_PACKAGE_VERSION}")
+
+foreach (libs ${LINK_LIBS} ${LINK_COMP_LIBS})
+ set (_PKG_CONFIG_LIBS_PRIVATE "${_PKG_CONFIG_LIBS_PRIVATE} -l${libs}")
+endforeach ()
+
+set (_PKG_CONFIG_LIBS "${_PKG_CONFIG_LIBS} -l${HDF5_LIB_CORENAME}")
+if (BUILD_SHARED_LIBS)
+ set (_PKG_CONFIG_SH_LIBS "${_PKG_CONFIG_SH_LIBS} -l${HDF5_LIB_CORENAME}")
+endif ()
+
+set (_PKG_CONFIG_REQUIRES)
+set (_PKG_CONFIG_REQUIRES_PRIVATE)
+
+configure_file (
+ ${HDF_RESOURCES_DIR}/libhdf5.pc.in
+ ${HDF5_BINARY_DIR}/CMakeFiles/${HDF5_LIB_CORENAME}-${HDF5_PACKAGE_VERSION}.pc
+ @ONLY
+)
+install (
+ FILES ${HDF5_BINARY_DIR}/CMakeFiles/${HDF5_LIB_CORENAME}-${HDF5_PACKAGE_VERSION}.pc
+ DESTINATION ${HDF5_INSTALL_LIB_DIR}/pkgconfig
+ COMPONENT libraries
+)
+
+if (NOT WIN32)
+ set (_PKG_CONFIG_COMPILER ${CMAKE_C_COMPILER})
+ configure_file (
+ ${HDF_RESOURCES_DIR}/libh5cc.in
+ ${HDF5_BINARY_DIR}/CMakeFiles/h5cc
+ @ONLY
+ )
+ install (
+ FILES ${HDF5_BINARY_DIR}/CMakeFiles/h5cc
+ DESTINATION ${HDF5_INSTALL_BIN_DIR}
+ PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE
+ COMPONENT libraries
+ )
+endif ()
diff --git a/src/H5.c b/src/H5.c
index e25a57e..34e4613 100644
--- a/src/H5.c
+++ b/src/H5.c
@@ -417,7 +417,7 @@ H5dont_atexit(void)
* library, which are supposed to free any unused memory they have
* allocated.
*
- * These should probably be registered dynamicly in a linked list of
+ * These should probably be registered dynamically in a linked list of
* functions to call, but there aren't that many right now, so we
* hard-wire them...
*
@@ -758,7 +758,7 @@ H5check_version(unsigned majnum, unsigned minnum, unsigned relnum)
HDfprintf (stderr, "%s", H5libhdf5_settings);
break;
default:
- /* 2 or higer: continue silently */
+ /* 2 or higher: continue silently */
break;
} /* end switch */
diff --git a/src/H5AC.c b/src/H5AC.c
index ecbea10..32bacc5 100644
--- a/src/H5AC.c
+++ b/src/H5AC.c
@@ -437,7 +437,7 @@ H5AC_create(const H5F_t *f,
HGOTO_ERROR(H5E_VFL, H5E_CANTGET, FAIL, "can't get mpi size")
if(NULL == (aux_ptr = H5FL_CALLOC(H5AC_aux_t)))
- HGOTO_ERROR(H5E_CACHE, H5E_CANTALLOC, FAIL, "Can't allocate H5AC auxilary structure.")
+ HGOTO_ERROR(H5E_CACHE, H5E_CANTALLOC, FAIL, "Can't allocate H5AC auxiliary structure.")
aux_ptr->magic = H5AC__H5AC_AUX_T_MAGIC;
aux_ptr->mpi_comm = mpi_comm;
@@ -545,7 +545,7 @@ H5AC_create(const H5F_t *f,
done:
#ifdef H5_HAVE_PARALLEL
- /* if there is a failure, try to tidy up the auxilary structure */
+ /* if there is a failure, try to tidy up the auxiliary structure */
if(ret_value < 0) {
if(aux_ptr != NULL) {
if(aux_ptr->d_slist_ptr != NULL)
@@ -1419,7 +1419,7 @@ done:
* from the cache, clear it, and free it without writing it to
* disk.
*
- * This verion of the function is a complete re-write to
+ * This version of the function is a complete re-write to
* use the new metadata cache. While there isn't all that
* much difference between the old and new Purpose sections,
* the original version is given below.
diff --git a/src/H5ACpkg.h b/src/H5ACpkg.h
index 9a6bb0f..42f0b18 100644
--- a/src/H5ACpkg.h
+++ b/src/H5ACpkg.h
@@ -155,7 +155,7 @@
* is permitted to write to file.
*
* dirty_bytes_threshold: Integer field containing the dirty bytes
- * generation threashold. Whenever dirty byte creation
+ * generation threshold. Whenever dirty byte creation
* exceeds this value, the metadata cache on process 0
* broadcasts a list of the entries it has flushed since
* the last broadcast (or since the beginning of execution)
diff --git a/src/H5ACpublic.h b/src/H5ACpublic.h
index 83938d9..ceb225d 100644
--- a/src/H5ACpublic.h
+++ b/src/H5ACpublic.h
@@ -39,7 +39,7 @@ extern "C" {
* structure H5AC_cache_config_t
*
* H5AC_cache_config_t is a public structure intended for use in public APIs.
- * At least in its initial incarnation, it is basicaly a copy of struct
+ * At least in its initial incarnation, it is basically a copy of struct
* H5C_auto_size_ctl_t, minus the report_fcn field, and plus the
* dirty_bytes_threshold field.
*
@@ -76,7 +76,7 @@ extern "C" {
* open_trace_file: Boolean field indicating whether the trace_file_name
* field should be used to open a trace file for the cache.
*
- * The trace file is a debuging feature that allow the capture of
+ * The trace file is a debugging feature that allow the capture of
* top level metadata cache requests for purposes of debugging and/or
* optimization. This field should normally be set to FALSE, as
* trace file collection imposes considerable overhead.
@@ -206,7 +206,7 @@ extern "C" {
*
* flash_incr_mode: Instance of the H5C_cache_flash_incr_mode enumerated
* type whose value indicates whether and by which algorithm we should
- * make flash increases in the size of the cache to accomodate insertion
+ * make flash increases in the size of the cache to accommodate insertion
* of large entries and large increases in the size of a single entry.
*
* The addition of the flash increment mode was occasioned by performance
diff --git a/src/H5Abtree2.c b/src/H5Abtree2.c
index 33a031e..318c60d 100644
--- a/src/H5Abtree2.c
+++ b/src/H5Abtree2.c
@@ -162,7 +162,7 @@ const H5B2_class_t H5A_BT2_CORDER[1]={{ /* B-tree class information */
*-------------------------------------------------------------------------
*/
static herr_t
-H5A_dense_fh_name_cmp(const void *obj, size_t H5_ATTR_UNUSED obj_len, void *_udata)
+H5A_dense_fh_name_cmp(const void *obj, size_t obj_len, void *_udata)
{
H5A_fh_ud_cmp_t *udata = (H5A_fh_ud_cmp_t *)_udata; /* User data for 'op' callback */
H5A_t *attr = NULL; /* Pointer to attribute created from heap object */
@@ -172,7 +172,7 @@ H5A_dense_fh_name_cmp(const void *obj, size_t H5_ATTR_UNUSED obj_len, void *_uda
FUNC_ENTER_NOAPI_NOINIT
/* Decode attribute information */
- if(NULL == (attr = (H5A_t *)H5O_msg_decode(udata->f, udata->dxpl_id, NULL, H5O_ATTR_ID, (const unsigned char *)obj)))
+ if(NULL == (attr = (H5A_t *)H5O_msg_decode(udata->f, udata->dxpl_id, NULL, H5O_ATTR_ID, obj_len, (const unsigned char *)obj)))
HGOTO_ERROR(H5E_OHDR, H5E_CANTDECODE, FAIL, "can't decode attribute")
/* Compare the string values */
diff --git a/src/H5Adense.c b/src/H5Adense.c
index 291f422..ab159ff 100644
--- a/src/H5Adense.c
+++ b/src/H5Adense.c
@@ -843,7 +843,7 @@ done:
*-------------------------------------------------------------------------
*/
static herr_t
-H5A__dense_copy_fh_cb(const void *obj, size_t H5_ATTR_UNUSED obj_len, void *_udata)
+H5A__dense_copy_fh_cb(const void *obj, size_t obj_len, void *_udata)
{
H5A_fh_ud_cp_t *udata = (H5A_fh_ud_cp_t *)_udata; /* User data for fractal heap 'op' callback */
herr_t ret_value = SUCCEED; /* Return value */
@@ -857,7 +857,7 @@ H5A__dense_copy_fh_cb(const void *obj, size_t H5_ATTR_UNUSED obj_len, void *_uda
* HDF5 routine, it could attempt to re-protect that direct block for the
* heap, causing the HDF5 routine called to fail)
*/
- if(NULL == (udata->attr = (H5A_t *)H5O_msg_decode(udata->f, udata->dxpl_id, NULL, H5O_ATTR_ID, (const unsigned char *)obj)))
+ if(NULL == (udata->attr = (H5A_t *)H5O_msg_decode(udata->f, udata->dxpl_id, NULL, H5O_ATTR_ID, obj_len, (const unsigned char *)obj)))
HGOTO_ERROR(H5E_ATTR, H5E_CANTDECODE, FAIL, "can't decode attribute")
/* Set the creation order index for the attribute */
diff --git a/src/H5Aint.c b/src/H5Aint.c
index f53dfba..894e356 100644
--- a/src/H5Aint.c
+++ b/src/H5Aint.c
@@ -997,7 +997,7 @@ H5A_free(H5A_t *attr)
HDassert(attr);
- /* Free dynamicly allocated items */
+ /* Free dynamically allocated items */
if(attr->shared->name) {
H5MM_xfree(attr->shared->name);
attr->shared->name = NULL;
@@ -1052,7 +1052,7 @@ H5A_close(H5A_t *attr)
/* Reference count can be 0. It only happens when H5A_create fails. */
if(attr->shared->nrefs <= 1) {
- /* Free dynamicly allocated items */
+ /* Free dynamically allocated items */
if(H5A_free(attr) < 0)
HGOTO_ERROR(H5E_ATTR, H5E_CANTRELEASE, FAIL, "can't release attribute info")
diff --git a/src/H5Apkg.h b/src/H5Apkg.h
index 2606387..84b82fe 100644
--- a/src/H5Apkg.h
+++ b/src/H5Apkg.h
@@ -86,7 +86,7 @@ typedef struct H5A_shared_t {
void *data; /* Attribute data (on a temporary basis) */
size_t data_size; /* Size of data on disk */
H5O_msg_crt_idx_t crt_idx; /* Attribute's creation index in the object header */
- unsigned nrefs; /* Ref count for times this object is refered */
+ unsigned nrefs; /* Ref count for times this object is referred */
} H5A_shared_t;
/* Define the main attribute structure */
diff --git a/src/H5B.c b/src/H5B.c
index f96ec98..5443155 100644
--- a/src/H5B.c
+++ b/src/H5B.c
@@ -775,7 +775,7 @@ H5B_insert_child(H5B_t *bt, unsigned *bt_flags, unsigned idx,
* the specified type.
*
* On return, if LT_KEY_CHANGED is non-zero, then LT_KEY is
- * the new native left key. Similarily for RT_KEY_CHANGED
+ * the new native left key. Similarly for RT_KEY_CHANGED
* and RT_KEY.
*
* If the node splits, then MD_KEY contains the key that
diff --git a/src/H5Bprivate.h b/src/H5Bprivate.h
index 732e478..9b565ab 100644
--- a/src/H5Bprivate.h
+++ b/src/H5Bprivate.h
@@ -121,7 +121,7 @@ typedef struct H5B_class_t {
H5B_ins_t (*insert)(H5F_t*, hid_t, haddr_t, void*, hbool_t*, void*, void*,
void*, hbool_t*, haddr_t*);
- /* min insert uses min leaf, not new(), similarily for max insert */
+ /* min insert uses min leaf, not new(), similarly for max insert */
hbool_t follow_min;
hbool_t follow_max;
diff --git a/src/H5C.c b/src/H5C.c
index e03a0c8..b3f76dc 100644
--- a/src/H5C.c
+++ b/src/H5C.c
@@ -5258,7 +5258,7 @@ H5C_unprotect(H5F_t * f,
*
* All this is a bit awkward, but until the metadata cache entries
* are contiguous, with only one dirty flag, we have to let the supplied
- * functions deal with the reseting the is_dirty flag.
+ * functions deal with the resetting the is_dirty flag.
*/
if ( entry_ptr->clear_on_unprotect ) {
@@ -6912,7 +6912,7 @@ H5C__flash_increase_cache_size(H5C_t * cache_ptr,
if ( (cache_ptr->resize_ctl).rpt_fcn != NULL ) {
/* get the hit rate for the reporting function. Should still
- * be good as we havent reset the hit rate statistics.
+ * be good as we haven't reset the hit rate statistics.
*/
if ( H5C_get_cache_hit_rate(cache_ptr, &hit_rate) != SUCCEED ) {
@@ -7032,7 +7032,7 @@ H5C_flush_invalidate_cache(H5F_t * f,
}
}
- /* The flush proceedure here is a bit strange.
+ /* The flush procedure here is a bit strange.
*
* In the outer while loop we make at least one pass through the
* cache, and then repeat until either all the pinned entries
@@ -7210,7 +7210,7 @@ H5C_flush_invalidate_cache(H5F_t * f,
*
* While this optimization used to be easy, with the possibility
* of new entries being added to the slist in the midst of the
- * flush, we must keep the slist in cannonical form at all
+ * flush, we must keep the slist in canonical form at all
* times.
*/
@@ -7783,7 +7783,7 @@ H5C_flush_single_entry(H5F_t * f,
if ( cache_ptr->aux_ptr != NULL ) {
HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, \
- "resize/move in serialize occured in parallel case.")
+ "resize/move in serialize occurred in parallel case.")
}
}
diff --git a/src/H5Cpkg.h b/src/H5Cpkg.h
index 0df5bf7..3041ce1 100644
--- a/src/H5Cpkg.h
+++ b/src/H5Cpkg.h
@@ -1005,7 +1005,7 @@ struct H5C_t
* We maintain doubly linked lists of instances of H5C_cache_entry_t for a
* variety of reasons -- protected list, LRU list, and the clean and dirty
* LRU lists at present. The following macros support linking and unlinking
- * of instances of H5C_cache_entry_t by both their regular and auxilary next
+ * of instances of H5C_cache_entry_t by both their regular and auxiliary next
* and previous pointers.
*
* The size and length fields are also maintained.
@@ -2509,7 +2509,7 @@ if ( (cache_ptr)->index_size != \
* a bit more performance out of the cache.
*
* At least for the first cut, I am leaving the comments and
- * white space in the macro. If they cause dificulties with
+ * white space in the macro. If they cause difficulties with
* the pre-processor, I'll have to remove them.
*
* JRM - 7/28/04
@@ -2620,7 +2620,7 @@ if ( (cache_ptr)->index_size != \
* a bit more performance out of the cache.
*
* At least for the first cut, I am leaving the comments and
- * white space in the macro. If they cause dificulties with
+ * white space in the macro. If they cause difficulties with
* pre-processor, I'll have to remove them.
*
* JRM - 7/28/04
@@ -2764,7 +2764,7 @@ if ( (cache_ptr)->index_size != \
* a bit more performance out of the cache.
*
* At least for the first cut, I am leaving the comments and
- * white space in the macro. If they cause dificulties with
+ * white space in the macro. If they cause difficulties with
* pre-processor, I'll have to remove them.
*
* JRM - 7/28/04
@@ -2902,7 +2902,7 @@ if ( (cache_ptr)->index_size != \
* a bit more performance out of the cache.
*
* At least for the first cut, I am leaving the comments and
- * white space in the macro. If they cause dificulties with
+ * white space in the macro. If they cause difficulties with
* pre-processor, I'll have to remove them.
*
* JRM - 7/28/04
@@ -3443,7 +3443,7 @@ if ( (cache_ptr)->index_size != \
* squeeze a bit more performance out of the cache.
*
* At least for the first cut, I am leaving the comments and
- * white space in the macro. If they cause dificulties with
+ * white space in the macro. If they cause difficulties with
* pre-processor, I'll have to remove them.
*
* JRM - 7/28/04
diff --git a/src/H5Cprivate.h b/src/H5Cprivate.h
index feed474..efddb3c 100644
--- a/src/H5Cprivate.h
+++ b/src/H5Cprivate.h
@@ -160,7 +160,7 @@ typedef struct H5C_class_t {
} H5C_class_t;
-/* Type defintions of call back functions used by the cache as a whole */
+/* Type definitions of call back functions used by the cache as a whole */
typedef herr_t (*H5C_write_permitted_func_t)(const H5F_t *f,
hid_t dxpl_id,
@@ -186,7 +186,7 @@ typedef herr_t (*H5C_log_flush_func_t)(H5C_t * cache_ptr,
/* Default max cache size and min clean size are give here to make
- * them generally accessable.
+ * them generally accessible.
*/
#define H5C__DEFAULT_MAX_CACHE_SIZE ((size_t)(4 * 1024 * 1024))
@@ -369,7 +369,7 @@ typedef herr_t (*H5C_log_flush_func_t)(H5C_t * cache_ptr,
* flush_immediately: Boolean flag used only in Phdf5 -- and then only
* for H5AC_METADATA_WRITE_STRATEGY__DISTRIBUTED.
*
- * When a destributed metadata write is triggered at a
+ * When a distributed metadata write is triggered at a
* sync point, this field is used to mark entries that
* must be flushed before leaving the sync point. At all
* other times, this field should be set to FALSE.
@@ -674,7 +674,7 @@ typedef struct H5C_cache_entry_t
*
* flash_incr_mode: Instance of the H5C_cache_flash_incr_mode enumerated
* type whose value indicates whether and by what algorithm we should
- * make flash increases in the size of the cache to accomodate insertion
+ * make flash increases in the size of the cache to accommodate insertion
* of large entries and large increases in the size of a single entry.
*
* The addition of the flash increment mode was occasioned by performance
diff --git a/src/H5Dchunk.c b/src/H5Dchunk.c
index 021335f..4cabd72 100644
--- a/src/H5Dchunk.c
+++ b/src/H5Dchunk.c
@@ -641,7 +641,7 @@ H5D__chunk_set_info_real(H5O_layout_chunk_t *layout, unsigned ndims, const hsize
/* Compute the # of chunks in dataset dimensions */
for(u = 0, layout->nchunks = 1; u < ndims; u++) {
- /* Round up to the next integer # of chunks, to accomodate partial chunks */
+ /* Round up to the next integer # of chunks, to accommodate partial chunks */
layout->chunks[u] = ((curr_dims[u] + layout->dim[u]) - 1) / layout->dim[u];
/* Accumulate the # of chunks */
@@ -2731,7 +2731,7 @@ H5D__chunk_flush_entry(const H5D_t *dset, hid_t dxpl_id, const H5D_dxpl_cache_t
} /* end if */
else {
/*
- * If we are reseting and something goes wrong after this
+ * If we are resetting and something goes wrong after this
* point then it's too late to recover because we may have
* destroyed the original data by calling H5Z_pipeline().
* The only safe option is to continue with the reset
@@ -4267,7 +4267,7 @@ H5D__chunk_prune_by_extent(H5D_t *dset, hid_t dxpl_id, const hsize_t *old_dim)
HGOTO_DONE(SUCCEED)
} /* end if */
- /* Round up to the next integer # of chunks, to accomodate partial chunks */
+ /* Round up to the next integer # of chunks, to accommodate partial chunks */
/* Use current dims because the indices have already been updated! -NAF */
/* (also compute the number of elements per chunk) */
/* (also copy the chunk dimensions into 'hsize_t' array for creating dataspace) */
diff --git a/src/H5Edeprec.c b/src/H5Edeprec.c
index 8175899..e2ef79c 100644
--- a/src/H5Edeprec.c
+++ b/src/H5Edeprec.c
@@ -275,7 +275,7 @@ done:
/*-------------------------------------------------------------------------
* Function: H5Eclear1
*
- * Purpose: This function is for backward compatbility.
+ * Purpose: This function is for backward compatibility.
* Clears the error stack for the specified error stack.
*
* Return: Non-negative on success/Negative on failure
@@ -306,7 +306,7 @@ done:
/*-------------------------------------------------------------------------
* Function: H5Eprint1
*
- * Purpose: This function is for backward compatbility.
+ * Purpose: This function is for backward compatibility.
* Prints the error stack in some default way. This is just a
* convenience function for H5Ewalk() with a function that
* prints error messages. Users are encouraged to write there
@@ -344,7 +344,7 @@ done:
/*-------------------------------------------------------------------------
* Function: H5Ewalk1
*
- * Purpose: This function is for backward compatbility.
+ * Purpose: This function is for backward compatibility.
* Walks the error stack for the current thread and calls some
* function for each error along the way.
*
@@ -383,7 +383,7 @@ done:
/*-------------------------------------------------------------------------
* Function: H5Eget_auto1
*
- * Purpose: This function is for backward compatbility.
+ * Purpose: This function is for backward compatibility.
* Returns the current settings for the automatic error stack
* traversal function and its data for specific error stack.
* Either (or both) arguments may be null in which case the
@@ -434,7 +434,7 @@ done:
/*-------------------------------------------------------------------------
* Function: H5Eset_auto1
*
- * Purpose: This function is for backward compatbility.
+ * Purpose: This function is for backward compatibility.
* Turns on or off automatic printing of errors for certain
* error stack. When turned on (non-null FUNC pointer) any
* API function which returns an error indication will first
diff --git a/src/H5F.c b/src/H5F.c
index 9c0c3ce..ca0fa57 100644
--- a/src/H5F.c
+++ b/src/H5F.c
@@ -703,7 +703,7 @@ H5Fflush(hid_t object_id, H5F_scope_t scope)
if(!f) {
if(!oloc)
- HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "object is not assocated with a file")
+ HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "object is not associated with a file")
f = oloc->file;
} /* end if */
if(!f)
diff --git a/src/H5FDdirect.c b/src/H5FDdirect.c
index a14e676..ff18c71 100644
--- a/src/H5FDdirect.c
+++ b/src/H5FDdirect.c
@@ -946,7 +946,7 @@ H5FD_direct_read(H5FD_t *_file, H5FD_mem_t H5_ATTR_UNUSED type, hid_t H5_ATTR_UN
do {
/* Read the aligned data in file first. Not able to handle interrupted
* system calls and partial results like sec2 driver does because the
- * data may no longer be aligned. It's expecially true when the data in
+ * data may no longer be aligned. It's especially true when the data in
* file is smaller than ALLOC_SIZE. */
HDmemset(copy_buf, 0, alloc_size);
@@ -1131,9 +1131,9 @@ H5FD_direct_write(H5FD_t *_file, H5FD_mem_t H5_ATTR_UNUSED type, hid_t H5_ATTR_U
/*
* Read the aligned data first if the aligned region doesn't fall
- * entirely in the range to be writen. Not able to handle interrupted
+ * entirely in the range to be written. Not able to handle interrupted
* system calls and partial results like sec2 driver does because the
- * data may no longer be aligned. It's expecially true when the data in
+ * data may no longer be aligned. It's especially true when the data in
* file is smaller than ALLOC_SIZE. Only read the entire section if
* both ends are misaligned, otherwise only read the block on the
* misaligned end.
diff --git a/src/H5FDfamily.c b/src/H5FDfamily.c
index 4b45c62..269441a 100644
--- a/src/H5FDfamily.c
+++ b/src/H5FDfamily.c
@@ -548,7 +548,7 @@ H5FD_family_sb_encode(H5FD_t *_file, char *name/*out*/, unsigned char *buf/*out*
/*-------------------------------------------------------------------------
* Function: H5FD_family_sb_decode
*
- * Purpose: This function has 2 seperate purpose. One is to decodes the
+ * Purpose: This function has 2 separate purpose. One is to decodes the
* superblock information for this driver. The NAME argument is
* the eight-character (plus null termination) name stored in i
* the file. The FILE argument is updated according to the
diff --git a/src/H5FDmpio.c b/src/H5FDmpio.c
index 61fb46d..c8edb85 100644
--- a/src/H5FDmpio.c
+++ b/src/H5FDmpio.c
@@ -1483,7 +1483,7 @@ H5FD_mpio_read(H5FD_t *_file, H5FD_mem_t H5_ATTR_UNUSED type, hid_t dxpl_id, had
/* Only look for MPI views for raw data transfers */
if(type==H5FD_MEM_DRAW) {
- H5FD_mpio_xfer_t xfer_mode; /* I/O tranfer mode */
+ H5FD_mpio_xfer_t xfer_mode; /* I/O transfer mode */
/* Obtain the data transfer properties */
if(NULL == (plist = (H5P_genplist_t *)H5I_object(dxpl_id)))
@@ -1769,7 +1769,7 @@ H5FD_mpio_write(H5FD_t *_file, H5FD_mem_t type, hid_t dxpl_id, haddr_t addr,
#endif
if(type == H5FD_MEM_DRAW) {
- H5FD_mpio_xfer_t xfer_mode; /* I/O tranfer mode */
+ H5FD_mpio_xfer_t xfer_mode; /* I/O transfer mode */
/* Obtain the data transfer properties */
if(NULL == (plist = (H5P_genplist_t *)H5I_object(dxpl_id)))
diff --git a/src/H5FDmulti.c b/src/H5FDmulti.c
index 1ec988e..c76c2c0 100644
--- a/src/H5FDmulti.c
+++ b/src/H5FDmulti.c
@@ -262,7 +262,7 @@ H5FD_multi_term(void)
/*-------------------------------------------------------------------------
* Function: H5Pset_fapl_split
*
- * Purpose: Compatability function. Makes the multi driver act like the
+ * Purpose: Compatibility function. Makes the multi driver act like the
* old split driver which stored meta data in one file and raw
* data in another file.
*
diff --git a/src/H5FL.c b/src/H5FL.c
index 0e49d69..59f0f82 100644
--- a/src/H5FL.c
+++ b/src/H5FL.c
@@ -18,7 +18,7 @@
* Purpose: Manage priority queues of free-lists (of blocks of bytes).
* These are used in various places in the library which allocate and
* free differently blocks of bytes repeatedly. Usually the same size
- * of block is allocated and freed repeatly in a loop, while writing out
+ * of block is allocated and freed repeatedly in a loop, while writing out
* chunked data for example, but the blocks may also be of different sizes
* from different datasets and an attempt is made to optimize access to
* the proper free list of blocks by using these priority queues to
@@ -455,7 +455,7 @@ H5FL_reg_calloc(H5FL_reg_head_t *head H5FL_TRACK_PARAMS)
HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "memory allocation failed")
/* Clear to zeros */
- /* (Accomodate tracking information, if present) */
+ /* (Accommodate tracking information, if present) */
HDmemset(ret_value,0,head->size - H5FL_TRACK_SIZE);
done:
@@ -2190,7 +2190,7 @@ H5FL_fac_calloc(H5FL_fac_head_t *head H5FL_TRACK_PARAMS)
HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "memory allocation failed")
/* Clear to zeros */
- /* (Accomodate tracking information, if present) */
+ /* (Accommodate tracking information, if present) */
HDmemset(ret_value,0,head->size - H5FL_TRACK_SIZE);
done:
diff --git a/src/H5FS.c b/src/H5FS.c
index e93302b..7cdbea1 100644
--- a/src/H5FS.c
+++ b/src/H5FS.c
@@ -134,7 +134,7 @@ HDfprintf(stderr, "%s: Creating free space manager, nclasses = %Zu\n", FUNC, ncl
fspace->alignment = alignment;
fspace->threshold = threshold;
- /* Check if the free space tracker is supposed to be persistant */
+ /* Check if the free space tracker is supposed to be persistent */
if(fs_addr) {
/* Allocate space for the free space header */
if(HADDR_UNDEF == (fspace->addr = H5MF_alloc(f, H5FD_MEM_FSPACE_HDR, dxpl_id, (hsize_t)fspace->hdr_size)))
@@ -373,7 +373,7 @@ HDfprintf(stderr, "%s: fspace->tot_sect_count = %Hu, fspace->serial_sect_count =
HDfprintf(stderr, "%s: fspace->alloc_sect_size = %Hu, fspace->sect_size = %Hu\n", FUNC, fspace->alloc_sect_size, fspace->sect_size);
#endif /* H5FS_DEBUG */
/* If there are sections to serialize, update them */
- /* (if the free space manager is persistant) */
+ /* (if the free space manager is persistent) */
if(fspace->serial_sect_count > 0 && H5F_addr_defined(fspace->addr)) {
#ifdef H5FS_DEBUG
HDfprintf(stderr, "%s: Real sections to store in file\n", FUNC);
@@ -729,7 +729,7 @@ HDfprintf(stderr, "%s: Marking free space header as dirty\n", FUNC);
/* Sanity check */
HDassert(fspace);
- /* Check if the free space manager is persistant */
+ /* Check if the free space manager is persistent */
if(H5F_addr_defined(fspace->addr))
/* Mark header as dirty in cache */
if(H5AC_mark_entry_dirty(fspace) < 0)
diff --git a/src/H5FScache.c b/src/H5FScache.c
index db1d3b2..fdf4e4d 100644
--- a/src/H5FScache.c
+++ b/src/H5FScache.c
@@ -750,7 +750,7 @@ H5FS_sinfo_serialize_sect_cb(void *_item, void H5_ATTR_UNUSED *key, void *_udata
/* Call 'serialize' callback for this section */
if(sect_cls->serialize) {
if((*sect_cls->serialize)(sect_cls, sect, *udata->p) < 0)
- HGOTO_ERROR(H5E_FSPACE, H5E_CANTSERIALIZE, FAIL, "can't syncronize section")
+ HGOTO_ERROR(H5E_FSPACE, H5E_CANTSERIALIZE, FAIL, "can't synchronize section")
/* Update offset in serialization buffer */
(*udata->p) += sect_cls->serial_size;
diff --git a/src/H5Fint.c b/src/H5Fint.c
index 62f249e..a92fa46 100644
--- a/src/H5Fint.c
+++ b/src/H5Fint.c
@@ -2014,7 +2014,7 @@ H5F_get_file_image(H5F_t *file, void *buf_ptr, size_t buf_len)
*
* While this problem is quire solvable, the required time and
* resources are lacking at present. Hence, for now, we don't
- * allow the get file image operation to be perfomed on files
+ * allow the get file image operation to be performed on files
* opened with the family file driver.
*
* Observe that the following test only looks at the top level
diff --git a/src/H5Gbtree2.c b/src/H5Gbtree2.c
index 888c611..d520484 100644
--- a/src/H5Gbtree2.c
+++ b/src/H5Gbtree2.c
@@ -159,7 +159,7 @@ const H5B2_class_t H5G_BT2_CORDER[1]={{ /* B-tree class information */
*-------------------------------------------------------------------------
*/
static herr_t
-H5G_dense_fh_name_cmp(const void *obj, size_t H5_ATTR_UNUSED obj_len, void *_udata)
+H5G_dense_fh_name_cmp(const void *obj, size_t obj_len, void *_udata)
{
H5G_fh_ud_cmp_t *udata = (H5G_fh_ud_cmp_t *)_udata; /* User data for 'op' callback */
H5O_link_t *lnk; /* Pointer to link created from heap object */
@@ -168,7 +168,7 @@ H5G_dense_fh_name_cmp(const void *obj, size_t H5_ATTR_UNUSED obj_len, void *_uda
FUNC_ENTER_NOAPI_NOINIT
/* Decode link information */
- if(NULL == (lnk = (H5O_link_t *)H5O_msg_decode(udata->f, udata->dxpl_id, NULL, H5O_LINK_ID, (const unsigned char *)obj)))
+ if(NULL == (lnk = (H5O_link_t *)H5O_msg_decode(udata->f, udata->dxpl_id, NULL, H5O_LINK_ID, obj_len, (const unsigned char *)obj)))
HGOTO_ERROR(H5E_SYM, H5E_CANTDECODE, FAIL, "can't decode link")
/* Compare the string values */
diff --git a/src/H5Gcache.c b/src/H5Gcache.c
index 1ca80df..994c5bf 100644
--- a/src/H5Gcache.c
+++ b/src/H5Gcache.c
@@ -103,49 +103,43 @@ H5FL_SEQ_EXTERN(H5G_entry_t);
/*-------------------------------------------------------------------------
- * Function: H5G_node_load
+ * Function: H5G_node_load
*
- * Purpose: Loads a symbol table node from the file.
+ * Purpose: Loads a symbol table node from the file.
*
- * Return: Success: Ptr to the new table.
+ * Return: Success: Ptr to the new table.
+ * Failure: NULL
*
- * Failure: NULL
- *
- * Programmer: Robb Matzke
- * matzke@llnl.gov
- * Jun 23 1997
+ * Programmer: Robb Matzke
+ * matzke@llnl.gov
+ * Jun 23 1997
*
*-------------------------------------------------------------------------
*/
static H5G_node_t *
H5G_node_load(H5F_t *f, hid_t dxpl_id, haddr_t addr, void *udata)
{
- H5G_node_t *sym = NULL;
- H5WB_t *wb = NULL; /* Wrapped buffer for node data */
- uint8_t node_buf[H5G_NODE_BUF_SIZE]; /* Buffer for node */
- uint8_t *node; /* Pointer to node buffer */
+ H5G_node_t *sym = NULL;
+ H5WB_t *wb = NULL; /* Wrapped buffer for node data */
+ uint8_t node_buf[H5G_NODE_BUF_SIZE]; /* Buffer for node */
+ uint8_t *node; /* Pointer to node buffer */
const uint8_t *p;
- H5G_node_t *ret_value; /*for error handling */
+ const uint8_t *p_end;
+ H5G_node_t *ret_value; /* Return value */
FUNC_ENTER_NOAPI_NOINIT
- /*
- * Check arguments.
- */
+ /* Sanity checks */
HDassert(f);
HDassert(H5F_addr_defined(addr));
HDassert(udata);
- /*
- * Initialize variables.
- */
-
/* Allocate symbol table data structures */
if(NULL == (sym = H5FL_CALLOC(H5G_node_t)))
- HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "memory allocation failed")
+ HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "memory allocation failed")
sym->node_size = H5G_NODE_SIZE(f);
if(NULL == (sym->entry = H5FL_SEQ_CALLOC(H5G_entry_t, (size_t)(2 * H5F_SYM_LEAF_K(f)))))
- HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "memory allocation failed")
+ HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "memory allocation failed")
/* Wrap the local buffer for serialized node info */
if(NULL == (wb = H5WB_wrap(node_buf, sizeof(node_buf))))
@@ -157,19 +151,24 @@ H5G_node_load(H5F_t *f, hid_t dxpl_id, haddr_t addr, void *udata)
/* Read the serialized symbol table node. */
if(H5F_block_read(f, H5FD_MEM_BTREE, addr, sym->node_size, dxpl_id, node) < 0)
- HGOTO_ERROR(H5E_SYM, H5E_READERROR, NULL, "unable to read symbol table node")
+ HGOTO_ERROR(H5E_SYM, H5E_READERROR, NULL, "unable to read symbol table node")
/* Get temporary pointer to serialized node */
p = node;
+ /* Get a pointer to the end of the node. This ensures we don't run off
+ * the end of the buffer if the file is corrupt.
+ */
+ p_end = p + sym->node_size - 1;
+
/* magic */
if(HDmemcmp(p, H5G_NODE_MAGIC, (size_t)H5_SIZEOF_MAGIC))
- HGOTO_ERROR(H5E_SYM, H5E_CANTLOAD, NULL, "bad symbol table node signature")
+ HGOTO_ERROR(H5E_SYM, H5E_CANTLOAD, NULL, "bad symbol table node signature")
p += 4;
/* version */
if(H5G_NODE_VERS != *p++)
- HGOTO_ERROR(H5E_SYM, H5E_CANTLOAD, NULL, "bad symbol table node version")
+ HGOTO_ERROR(H5E_SYM, H5E_CANTLOAD, NULL, "bad symbol table node version")
/* reserved */
p++;
@@ -178,8 +177,8 @@ H5G_node_load(H5F_t *f, hid_t dxpl_id, haddr_t addr, void *udata)
UINT16DECODE(p, sym->nsyms);
/* entries */
- if(H5G__ent_decode_vec(f, &p, sym->entry, sym->nsyms) < 0)
- HGOTO_ERROR(H5E_SYM, H5E_CANTLOAD, NULL, "unable to decode symbol table entries")
+ if(H5G__ent_decode_vec(f, &p, p_end, sym->entry, sym->nsyms) < 0)
+ HGOTO_ERROR(H5E_SYM, H5E_CANTLOAD, NULL, "unable to decode symbol table entries")
/* Set return value */
ret_value = sym;
diff --git a/src/H5Gdense.c b/src/H5Gdense.c
index 9ec8951..a43939e 100644
--- a/src/H5Gdense.c
+++ b/src/H5Gdense.c
@@ -597,7 +597,7 @@ done:
*-------------------------------------------------------------------------
*/
static herr_t
-H5G_dense_lookup_by_idx_fh_cb(const void *obj, size_t H5_ATTR_UNUSED obj_len, void *_udata)
+H5G_dense_lookup_by_idx_fh_cb(const void *obj, size_t obj_len, void *_udata)
{
H5G_fh_ud_lbi_t *udata = (H5G_fh_ud_lbi_t *)_udata; /* User data for fractal heap 'op' callback */
H5O_link_t *tmp_lnk = NULL; /* Temporary pointer to link */
@@ -606,7 +606,7 @@ H5G_dense_lookup_by_idx_fh_cb(const void *obj, size_t H5_ATTR_UNUSED obj_len, vo
FUNC_ENTER_NOAPI_NOINIT
/* Decode link information & keep a copy */
- if(NULL == (tmp_lnk = (H5O_link_t *)H5O_msg_decode(udata->f, udata->dxpl_id, NULL, H5O_LINK_ID, (const unsigned char *)obj)))
+ if(NULL == (tmp_lnk = (H5O_link_t *)H5O_msg_decode(udata->f, udata->dxpl_id, NULL, H5O_LINK_ID, obj_len, (const unsigned char *)obj)))
HGOTO_ERROR(H5E_SYM, H5E_CANTDECODE, FAIL, "can't decode link")
/* Copy link information */
@@ -887,7 +887,7 @@ done:
*-------------------------------------------------------------------------
*/
static herr_t
-H5G_dense_iterate_fh_cb(const void *obj, size_t H5_ATTR_UNUSED obj_len, void *_udata)
+H5G_dense_iterate_fh_cb(const void *obj, size_t obj_len, void *_udata)
{
H5G_fh_ud_it_t *udata = (H5G_fh_ud_it_t *)_udata; /* User data for fractal heap 'op' callback */
herr_t ret_value = SUCCEED; /* Return value */
@@ -901,7 +901,7 @@ H5G_dense_iterate_fh_cb(const void *obj, size_t H5_ATTR_UNUSED obj_len, void *_u
* HDF5 routine, it could attempt to re-protect that direct block for the
* heap, causing the HDF5 routine called to fail - QAK)
*/
- if(NULL == (udata->lnk = (H5O_link_t *)H5O_msg_decode(udata->f, udata->dxpl_id, NULL, H5O_LINK_ID, (const unsigned char *)obj)))
+ if(NULL == (udata->lnk = (H5O_link_t *)H5O_msg_decode(udata->f, udata->dxpl_id, NULL, H5O_LINK_ID, obj_len, (const unsigned char *)obj)))
HGOTO_ERROR(H5E_SYM, H5E_CANTDECODE, FAIL, "can't decode link")
done:
@@ -1099,7 +1099,7 @@ done:
*-------------------------------------------------------------------------
*/
static herr_t
-H5G_dense_get_name_by_idx_fh_cb(const void *obj, size_t H5_ATTR_UNUSED obj_len, void *_udata)
+H5G_dense_get_name_by_idx_fh_cb(const void *obj, size_t obj_len, void *_udata)
{
H5G_fh_ud_gnbi_t *udata = (H5G_fh_ud_gnbi_t *)_udata; /* User data for fractal heap 'op' callback */
H5O_link_t *lnk; /* Pointer to link created from heap object */
@@ -1108,7 +1108,7 @@ H5G_dense_get_name_by_idx_fh_cb(const void *obj, size_t H5_ATTR_UNUSED obj_len,
FUNC_ENTER_NOAPI_NOINIT
/* Decode link information */
- if(NULL == (lnk = (H5O_link_t *)H5O_msg_decode(udata->f, udata->dxpl_id, NULL, H5O_LINK_ID, (const unsigned char *)obj)))
+ if(NULL == (lnk = (H5O_link_t *)H5O_msg_decode(udata->f, udata->dxpl_id, NULL, H5O_LINK_ID, obj_len, (const unsigned char *)obj)))
HGOTO_ERROR(H5E_SYM, H5E_CANTDECODE, FAIL, "can't decode link")
/* Get the length of the name */
@@ -1306,7 +1306,7 @@ done:
*-------------------------------------------------------------------------
*/
static herr_t
-H5G_dense_remove_fh_cb(const void *obj, size_t H5_ATTR_UNUSED obj_len, void *_udata)
+H5G_dense_remove_fh_cb(const void *obj, size_t obj_len, void *_udata)
{
H5G_fh_ud_rm_t *udata = (H5G_fh_ud_rm_t *)_udata; /* User data for fractal heap 'op' callback */
H5O_link_t *lnk = NULL; /* Pointer to link created from heap object */
@@ -1316,7 +1316,7 @@ H5G_dense_remove_fh_cb(const void *obj, size_t H5_ATTR_UNUSED obj_len, void *_ud
FUNC_ENTER_NOAPI_NOINIT
/* Decode link information */
- if(NULL == (lnk = (H5O_link_t *)H5O_msg_decode(udata->f, udata->dxpl_id, NULL, H5O_LINK_ID, (const unsigned char *)obj)))
+ if(NULL == (lnk = (H5O_link_t *)H5O_msg_decode(udata->f, udata->dxpl_id, NULL, H5O_LINK_ID, obj_len, (const unsigned char *)obj)))
HGOTO_ERROR(H5E_SYM, H5E_CANTDECODE, FAIL, "can't decode link")
/* Check for removing the link from the creation order index */
@@ -1483,7 +1483,7 @@ done:
*-------------------------------------------------------------------------
*/
static herr_t
-H5G_dense_remove_by_idx_fh_cb(const void *obj, size_t H5_ATTR_UNUSED obj_len, void *_udata)
+H5G_dense_remove_by_idx_fh_cb(const void *obj, size_t obj_len, void *_udata)
{
H5G_fh_ud_rmbi_t *udata = (H5G_fh_ud_rmbi_t *)_udata; /* User data for fractal heap 'op' callback */
herr_t ret_value = SUCCEED; /* Return value */
@@ -1491,7 +1491,7 @@ H5G_dense_remove_by_idx_fh_cb(const void *obj, size_t H5_ATTR_UNUSED obj_len, vo
FUNC_ENTER_NOAPI_NOINIT
/* Decode link information */
- if(NULL == (udata->lnk = (H5O_link_t *)H5O_msg_decode(udata->f, udata->dxpl_id, NULL, H5O_LINK_ID, (const unsigned char *)obj)))
+ if(NULL == (udata->lnk = (H5O_link_t *)H5O_msg_decode(udata->f, udata->dxpl_id, NULL, H5O_LINK_ID, obj_len, (const unsigned char *)obj)))
HGOTO_ERROR(H5E_SYM, H5E_CANTDECODE, H5_ITER_ERROR, "can't decode link")
/* Can't operate on link here because the fractal heap block is locked */
diff --git a/src/H5Gent.c b/src/H5Gent.c
index bb6aa38..1bd8e63 100644
--- a/src/H5Gent.c
+++ b/src/H5Gent.c
@@ -91,7 +91,8 @@ H5FL_BLK_EXTERN(str_buf);
*-------------------------------------------------------------------------
*/
herr_t
-H5G__ent_decode_vec(const H5F_t *f, const uint8_t **pp, H5G_entry_t *ent, unsigned n)
+H5G__ent_decode_vec(const H5F_t *f, const uint8_t **pp, const uint8_t *p_end,
+ H5G_entry_t *ent, unsigned n)
{
unsigned u; /* Local index variable */
herr_t ret_value = SUCCEED; /* Return value */
@@ -104,9 +105,12 @@ H5G__ent_decode_vec(const H5F_t *f, const uint8_t **pp, H5G_entry_t *ent, unsign
HDassert(ent);
/* decode entries */
- for(u = 0; u < n; u++)
+ for(u = 0; u < n; u++) {
+ if(*pp > p_end)
+ HGOTO_ERROR(H5E_SYM, H5E_CANTDECODE, FAIL, "ran off the end of the buffer")
if(H5G_ent_decode(f, pp, ent + u) < 0)
HGOTO_ERROR(H5E_SYM, H5E_CANTDECODE, FAIL, "can't decode")
+ }
done:
FUNC_LEAVE_NOAPI(ret_value)
diff --git a/src/H5Gname.c b/src/H5Gname.c
index 6152417..6db4b48 100644
--- a/src/H5Gname.c
+++ b/src/H5Gname.c
@@ -1060,7 +1060,7 @@ done:
* Function: H5G_name_replace
*
* Purpose: Search the list of open IDs and replace names according to a
- * particular operation. The operation occured on the
+ * particular operation. The operation occurred on the
* SRC_FILE/SRC_FULL_PATH_R object. The new name (if there is
* one) is NEW_NAME_R. Additional entry location information
* (currently only needed for the 'move' operation) is passed in
diff --git a/src/H5Gobj.c b/src/H5Gobj.c
index 7b01871..97c9a76 100644
--- a/src/H5Gobj.c
+++ b/src/H5Gobj.c
@@ -226,7 +226,7 @@ H5G__obj_create_real(H5F_t *f, hid_t dxpl_id, const H5O_ginfo_t *ginfo,
size_t pline_size = 0; /* Size of the pipeline message */
size_t link_size; /* Size of a link message */
- /* Calculate message size infomation, for creating group's object header */
+ /* Calculate message size information, for creating group's object header */
linfo_size = H5O_msg_size_f(f, gcpl_id, H5O_LINFO_ID, linfo, (size_t)0);
HDassert(linfo_size);
diff --git a/src/H5Gpkg.h b/src/H5Gpkg.h
index 07aff02..f49ef26 100644
--- a/src/H5Gpkg.h
+++ b/src/H5Gpkg.h
@@ -1,4 +1,4 @@
-/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
+/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* Copyright by The HDF Group. *
* Copyright by the Board of Trustees of the University of Illinois. *
* All rights reserved. *
@@ -400,9 +400,9 @@ H5_DLL void H5G__ent_copy(H5G_entry_t *dst, const H5G_entry_t *src,
H5_copy_depth_t depth);
H5_DLL void H5G__ent_reset(H5G_entry_t *ent);
H5_DLL herr_t H5G__ent_decode_vec(const H5F_t *f, const uint8_t **pp,
- H5G_entry_t *ent, unsigned n);
+ const uint8_t *p_end, H5G_entry_t *ent, unsigned n);
H5_DLL herr_t H5G__ent_encode_vec(const H5F_t *f, uint8_t **pp,
- const H5G_entry_t *ent, unsigned n);
+ const H5G_entry_t *ent, unsigned n);
H5_DLL herr_t H5G__ent_convert(H5F_t *f, hid_t dxpl_id, H5HL_t *heap,
const char *name, const H5O_link_t *lnk, H5O_type_t obj_type,
const void *crt_info, H5G_entry_t *ent);
diff --git a/src/H5HFcache.c b/src/H5HFcache.c
index f0d251c..0d25dbf 100644
--- a/src/H5HFcache.c
+++ b/src/H5HFcache.c
@@ -384,7 +384,7 @@ H5HF_cache_hdr_load(H5F_t *f, hid_t dxpl_id, haddr_t addr, void *_udata)
UINT32DECODE(p, hdr->pline_root_direct_filter_mask);
/* Decode I/O filter information */
- if(NULL == (pline = (H5O_pline_t *)H5O_msg_decode(hdr->f, udata->dxpl_id, NULL, H5O_PLINE_ID, p)))
+ if(NULL == (pline = (H5O_pline_t *)H5O_msg_decode(hdr->f, udata->dxpl_id, NULL, H5O_PLINE_ID, hdr->filter_len, p)))
HGOTO_ERROR(H5E_HEAP, H5E_CANTDECODE, NULL, "can't decode I/O pipeline filters")
p += hdr->filter_len;
diff --git a/src/H5HFtiny.c b/src/H5HFtiny.c
index 6dbdaa3..ea913a2 100644
--- a/src/H5HFtiny.c
+++ b/src/H5HFtiny.c
@@ -109,7 +109,7 @@ H5HF_tiny_init(H5HF_hdr_t *hdr)
/* Check if tiny objects need an extra byte for their length */
/* (account for boundary condition when length of an object would need an
* extra byte, but using that byte means that the extra length byte is
- * unneccessary)
+ * unnecessary)
*/
if((hdr->id_len - 1) <= H5HF_TINY_LEN_SHORT) {
hdr->tiny_max_len = hdr->id_len - 1;
diff --git a/src/H5L.c b/src/H5L.c
index d302e3f..1e60398 100644
--- a/src/H5L.c
+++ b/src/H5L.c
@@ -15,10 +15,10 @@
/* Module Setup */
/****************/
-#define H5L_PACKAGE /*suppress error about including H5Lpkg */
+#define H5L_PACKAGE /*suppress error about including H5Lpkg */
/* Interface initialization */
-#define H5_INTERFACE_INIT_FUNC H5L_init_interface
+#define H5_INTERFACE_INIT_FUNC H5L_init_interface
/***********/
/* Headers */
@@ -27,7 +27,7 @@
#include "H5ACprivate.h" /* Metadata cache */
#include "H5Dprivate.h" /* Datasets */
#include "H5Eprivate.h" /* Error handling */
-#include "H5Fprivate.h" /* File access */
+#include "H5Fprivate.h" /* File access */
#include "H5Gprivate.h" /* Groups */
#include "H5Iprivate.h" /* IDs */
#include "H5Lpkg.h" /* Links */
@@ -78,7 +78,7 @@ typedef struct {
typedef struct {
const char *dst_name; /* Destination name for moving object */
H5T_cset_t cset; /* Char set for new name */
- H5G_loc_t *dst_loc; /* Destination location for moving object */
+ H5G_loc_t *dst_loc; /* Destination location for moving object */
unsigned dst_target_flags; /* Target flags for destination object */
hbool_t copy; /* TRUE if this is a copy operation */
hid_t lapl_id; /* LAPL to use in callback */
@@ -206,15 +206,15 @@ static H5L_class_t *H5L_table_g = NULL;
/*-------------------------------------------------------------------------
- * Function: H5L_init
+ * Function: H5L_init
*
- * Purpose: Initialize the interface from some other package.
+ * Purpose: Initialize the interface from some other package.
*
- * Return: Success: non-negative
+ * Return: Success: non-negative
*
- * Failure: negative
+ * Failure: negative
*
- * Programmer: James Laird
+ * Programmer: James Laird
* Thursday, July 13, 2006
*
*-------------------------------------------------------------------------
@@ -233,13 +233,13 @@ done:
/*-------------------------------------------------------------------------
- * Function: H5L_init_interface
+ * Function: H5L_init_interface
*
- * Purpose: Initialize information specific to H5L interface.
+ * Purpose: Initialize information specific to H5L interface.
*
- * Return: Non-negative on success/Negative on failure
+ * Return: Non-negative on success/Negative on failure
*
- * Programmer: James Laird
+ * Programmer: James Laird
* Tuesday, January 24, 2006
*
*-------------------------------------------------------------------------
@@ -261,13 +261,13 @@ done:
/*-------------------------------------------------------------------------
- * Function: H5L_term_interface
+ * Function: H5L_term_interface
*
- * Purpose: Terminate any resources allocated in H5L_init_interface.
+ * Purpose: Terminate any resources allocated in H5L_init_interface.
*
- * Return: Non-negative on success/Negative on failure
+ * Return: Non-negative on success/Negative on failure
*
- * Programmer: James Laird
+ * Programmer: James Laird
* Tuesday, January 24, 2006
*
*-------------------------------------------------------------------------
@@ -275,7 +275,7 @@ done:
int
H5L_term_interface(void)
{
- int n = 0;
+ int n = 0;
FUNC_ENTER_NOAPI_NOINIT_NOERR
@@ -291,18 +291,18 @@ H5L_term_interface(void)
/*-------------------------------------------------------------------------
- * Function: H5Lmove
+ * Function: H5Lmove
*
- * Purpose: Renames an object within an HDF5 file and moves it to a new
+ * Purpose: Renames an object within an HDF5 file and moves it to a new
* group. The original name SRC is unlinked from the group graph
* and then inserted with the new name DST (which can specify a
* new path for the object) as an atomic operation. The names
* are interpreted relative to SRC_LOC_ID and
* DST_LOC_ID, which are either file IDs or group ID.
*
- * Return: Non-negative on success/Negative on failure
+ * Return: Non-negative on success/Negative on failure
*
- * Programmer: James Laird
+ * Programmer: James Laird
* Wednesday, March 29, 2006
*
*-------------------------------------------------------------------------
@@ -311,8 +311,8 @@ herr_t
H5Lmove(hid_t src_loc_id, const char *src_name, hid_t dst_loc_id,
const char *dst_name, hid_t lcpl_id, hid_t lapl_id)
{
- H5G_loc_t src_loc, *src_loc_p;
- H5G_loc_t dst_loc, *dst_loc_p;
+ H5G_loc_t src_loc, *src_loc_p;
+ H5G_loc_t dst_loc, *dst_loc_p;
herr_t ret_value=SUCCEED; /* Return value */
FUNC_ENTER_API(FAIL)
@@ -344,7 +344,7 @@ H5Lmove(hid_t src_loc_id, const char *src_name, hid_t dst_loc_id,
/* Move the link */
if(H5L_move(src_loc_p, src_name, dst_loc_p, dst_name, FALSE, lcpl_id,
lapl_id, H5AC_dxpl_id) < 0)
- HGOTO_ERROR(H5E_LINK, H5E_CANTMOVE, FAIL, "unable to move link")
+ HGOTO_ERROR(H5E_LINK, H5E_CANTMOVE, FAIL, "unable to move link")
done:
FUNC_LEAVE_API(ret_value)
@@ -352,15 +352,15 @@ done:
/*-------------------------------------------------------------------------
- * Function: H5Lcopy
+ * Function: H5Lcopy
*
- * Purpose: Creates an identical copy of a link with the same creation
+ * Purpose: Creates an identical copy of a link with the same creation
* time and target. The new link can have a different name
* and be in a different location than the original.
*
- * Return: Non-negative on success/Negative on failure
+ * Return: Non-negative on success/Negative on failure
*
- * Programmer: James Laird
+ * Programmer: James Laird
* Wednesday, March 29, 2006
*
*-------------------------------------------------------------------------
@@ -369,8 +369,8 @@ herr_t
H5Lcopy(hid_t src_loc_id, const char *src_name, hid_t dst_loc_id,
const char *dst_name, hid_t lcpl_id, hid_t lapl_id)
{
- H5G_loc_t src_loc, *src_loc_p;
- H5G_loc_t dst_loc, *dst_loc_p;
+ H5G_loc_t src_loc, *src_loc_p;
+ H5G_loc_t dst_loc, *dst_loc_p;
herr_t ret_value=SUCCEED; /* Return value */
FUNC_ENTER_API(FAIL)
@@ -402,7 +402,7 @@ H5Lcopy(hid_t src_loc_id, const char *src_name, hid_t dst_loc_id,
/* Copy the link */
if(H5L_move(src_loc_p, src_name, dst_loc_p, dst_name, TRUE, lcpl_id,
lapl_id, H5AC_dxpl_id) < 0)
- HGOTO_ERROR(H5E_LINK, H5E_CANTMOVE, FAIL, "unable to move link")
+ HGOTO_ERROR(H5E_LINK, H5E_CANTMOVE, FAIL, "unable to move link")
done:
FUNC_LEAVE_API(ret_value)
@@ -410,19 +410,19 @@ done:
/*-------------------------------------------------------------------------
- * Function: H5Lcreate_soft
+ * Function: H5Lcreate_soft
*
- * Purpose: Creates a soft link from LINK_NAME to LINK_TARGET.
+ * Purpose: Creates a soft link from LINK_NAME to LINK_TARGET.
*
- * LINK_TARGET can be anything and is interpreted at lookup
+ * LINK_TARGET can be anything and is interpreted at lookup
* time relative to the group which contains the final component
* of LINK_NAME. For instance, if LINK_TARGET is `./foo' and
* LINK_NAME is `./x/y/bar' and a request is made for `./x/y/bar'
* then the actual object looked up is `./x/y/./foo'.
*
- * Return: Non-negative on success/Negative on failure
+ * Return: Non-negative on success/Negative on failure
*
- * Programmer: Robb Matzke
+ * Programmer: Robb Matzke
* Monday, April 6, 1998
*
*-------------------------------------------------------------------------
@@ -431,7 +431,7 @@ herr_t
H5Lcreate_soft(const char *link_target,
hid_t link_loc_id, const char *link_name, hid_t lcpl_id, hid_t lapl_id)
{
- H5G_loc_t link_loc; /* Group location for new link */
+ H5G_loc_t link_loc; /* Group location for new link */
herr_t ret_value = SUCCEED; /* Return value */
FUNC_ENTER_API(FAIL)
@@ -441,15 +441,15 @@ H5Lcreate_soft(const char *link_target,
if(H5G_loc(link_loc_id, &link_loc) < 0)
HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a location")
if(!link_target || !*link_target)
- HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "no target specified")
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "no target specified")
if(!link_name || !*link_name)
- HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "no new name specified")
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "no new name specified")
if(lcpl_id != H5P_DEFAULT && (TRUE != H5P_isa_class(lcpl_id, H5P_LINK_CREATE)))
HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a link creation property list")
/* Create the link */
if(H5L_create_soft(link_target, &link_loc, link_name, lcpl_id, lapl_id, H5AC_dxpl_id) < 0)
- HGOTO_ERROR(H5E_LINK, H5E_CANTINIT, FAIL, "unable to create link")
+ HGOTO_ERROR(H5E_LINK, H5E_CANTINIT, FAIL, "unable to create link")
done:
FUNC_LEAVE_API(ret_value)
@@ -457,17 +457,17 @@ done:
/*-------------------------------------------------------------------------
- * Function: H5Lcreate_hard
+ * Function: H5Lcreate_hard
*
- * Purpose: Creates a hard link from NEW_NAME to CUR_NAME.
+ * Purpose: Creates a hard link from NEW_NAME to CUR_NAME.
*
- * CUR_NAME must name an existing object. CUR_NAME and
+ * CUR_NAME must name an existing object. CUR_NAME and
* NEW_NAME are interpreted relative to CUR_LOC_ID and
* NEW_LOC_ID, which are either file IDs or group IDs.
*
- * Return: Non-negative on success/Negative on failure
+ * Return: Non-negative on success/Negative on failure
*
- * Programmer: Robb Matzke
+ * Programmer: Robb Matzke
* Monday, April 6, 1998
*
*-------------------------------------------------------------------------
@@ -476,8 +476,8 @@ herr_t
H5Lcreate_hard(hid_t cur_loc_id, const char *cur_name,
hid_t new_loc_id, const char *new_name, hid_t lcpl_id, hid_t lapl_id)
{
- H5G_loc_t cur_loc, *cur_loc_p;
- H5G_loc_t new_loc, *new_loc_p;
+ H5G_loc_t cur_loc, *cur_loc_p;
+ H5G_loc_t new_loc, *new_loc_p;
herr_t ret_value = SUCCEED; /* Return value */
FUNC_ENTER_API(FAIL)
@@ -488,13 +488,13 @@ H5Lcreate_hard(hid_t cur_loc_id, const char *cur_name,
if(cur_loc_id == H5L_SAME_LOC && new_loc_id == H5L_SAME_LOC)
HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "source and destination should not be both H5L_SAME_LOC")
if(cur_loc_id != H5L_SAME_LOC && H5G_loc(cur_loc_id, &cur_loc) < 0)
- HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a location")
+ HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a location")
if(new_loc_id != H5L_SAME_LOC && H5G_loc(new_loc_id, &new_loc) < 0)
HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a location")
if(!cur_name || !*cur_name)
- HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "no current name specified")
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "no current name specified")
if(!new_name || !*new_name)
- HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "no new name specified")
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "no new name specified")
if(lcpl_id != H5P_DEFAULT && (TRUE != H5P_isa_class(lcpl_id, H5P_LINK_CREATE)))
HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a link creation property list")
@@ -504,14 +504,14 @@ H5Lcreate_hard(hid_t cur_loc_id, const char *cur_name,
if(cur_loc_id == H5L_SAME_LOC)
cur_loc_p = new_loc_p;
else if(new_loc_id == H5L_SAME_LOC)
- new_loc_p = cur_loc_p;
+ new_loc_p = cur_loc_p;
else if(cur_loc_p->oloc->file != new_loc_p->oloc->file)
HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "source and destination should be in the same file.")
/* Create the link */
if(H5L_create_hard(cur_loc_p, cur_name, new_loc_p, new_name,
lcpl_id, lapl_id, H5AC_dxpl_id) < 0)
- HGOTO_ERROR(H5E_LINK, H5E_CANTINIT, FAIL, "unable to create link")
+ HGOTO_ERROR(H5E_LINK, H5E_CANTINIT, FAIL, "unable to create link")
done:
FUNC_LEAVE_API(ret_value)
@@ -519,25 +519,25 @@ done:
/*-------------------------------------------------------------------------
- * Function: H5Lcreate_ud
+ * Function: H5Lcreate_ud
*
- * Purpose: Creates a user-defined link of type LINK_TYPE named LINK_NAME
+ * Purpose: Creates a user-defined link of type LINK_TYPE named LINK_NAME
* with user-specified data UDATA.
*
- * The format of the information pointed to by UDATA is
+ * The format of the information pointed to by UDATA is
* defined by the user. UDATA_SIZE holds the size of this buffer.
*
- * LINK_NAME is interpreted relative to LINK_LOC_ID.
+ * LINK_NAME is interpreted relative to LINK_LOC_ID.
*
- * The property list specified by LCPL_ID holds properties used
+ * The property list specified by LCPL_ID holds properties used
* to create the link.
*
* The link class of the new link must already be registered
* with the library.
*
- * Return: Non-negative on success/Negative on failure
+ * Return: Non-negative on success/Negative on failure
*
- * Programmer: James Laird
+ * Programmer: James Laird
* Tuesday, December 13, 2005
*
*-------------------------------------------------------------------------
@@ -546,7 +546,7 @@ herr_t
H5Lcreate_ud(hid_t link_loc_id, const char *link_name, H5L_type_t link_type,
const void *udata, size_t udata_size, hid_t lcpl_id, hid_t lapl_id)
{
- H5G_loc_t link_loc;
+ H5G_loc_t link_loc;
herr_t ret_value = SUCCEED; /* Return value */
FUNC_ENTER_API(FAIL)
@@ -557,13 +557,13 @@ H5Lcreate_ud(hid_t link_loc_id, const char *link_name, H5L_type_t link_type,
if(H5G_loc(link_loc_id, &link_loc) < 0)
HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a location")
if(!link_name || !*link_name)
- HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "no link name specified")
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "no link name specified")
if(link_type < H5L_TYPE_UD_MIN || link_type > H5L_TYPE_MAX)
HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "invalid link class")
/* Create external link */
if(H5L_create_ud(&link_loc, link_name, udata, udata_size, link_type, lcpl_id, lapl_id, H5AC_dxpl_id) < 0)
- HGOTO_ERROR(H5E_LINK, H5E_CANTINIT, FAIL, "unable to create link")
+ HGOTO_ERROR(H5E_LINK, H5E_CANTINIT, FAIL, "unable to create link")
done:
FUNC_LEAVE_API(ret_value)
@@ -571,18 +571,18 @@ done:
/*-------------------------------------------------------------------------
- * Function: H5Ldelete
+ * Function: H5Ldelete
*
- * Purpose: Removes the specified NAME from the group graph and
- * decrements the link count for the object to which NAME
- * points. If the link count reaches zero then all file-space
- * associated with the object will be reclaimed (but if the
- * object is open, then the reclamation of the file space is
- * delayed until all handles to the object are closed).
+ * Purpose: Removes the specified NAME from the group graph and
+ * decrements the link count for the object to which NAME
+ * points. If the link count reaches zero then all file-space
+ * associated with the object will be reclaimed (but if the
+ * object is open, then the reclamation of the file space is
+ * delayed until all handles to the object are closed).
*
- * Return: Non-negative on success/Negative on failure
+ * Return: Non-negative on success/Negative on failure
*
- * Programmer: Robb Matzke
+ * Programmer: Robb Matzke
* Monday, April 6, 1998
*
*-------------------------------------------------------------------------
@@ -590,7 +590,7 @@ done:
herr_t
H5Ldelete(hid_t loc_id, const char *name, hid_t lapl_id)
{
- H5G_loc_t loc; /* Group's location */
+ H5G_loc_t loc; /* Group's location */
herr_t ret_value = SUCCEED; /* Return value */
FUNC_ENTER_API(FAIL)
@@ -598,13 +598,13 @@ H5Ldelete(hid_t loc_id, const char *name, hid_t lapl_id)
/* Check arguments */
if(H5G_loc(loc_id, &loc) < 0)
- HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a location")
+ HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a location")
if(!name || !*name)
- HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "no name")
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "no name")
/* Unlink */
if(H5L_delete(&loc, name, lapl_id, H5AC_dxpl_id) < 0)
- HGOTO_ERROR(H5E_LINK, H5E_CANTDELETE, FAIL, "unable to delete link")
+ HGOTO_ERROR(H5E_LINK, H5E_CANTDELETE, FAIL, "unable to delete link")
done:
FUNC_LEAVE_API(ret_value)
@@ -612,20 +612,20 @@ done:
/*-------------------------------------------------------------------------
- * Function: H5Ldelete_by_idx
+ * Function: H5Ldelete_by_idx
*
- * Purpose: Removes the specified link from the group graph and
- * decrements the link count for the object to which it
- * points, according to the order within an index.
+ * Purpose: Removes the specified link from the group graph and
+ * decrements the link count for the object to which it
+ * points, according to the order within an index.
*
- * If the link count reaches zero then all file-space
- * associated with the object will be reclaimed (but if the
- * object is open, then the reclamation of the file space is
- * delayed until all handles to the object are closed).
+ * If the link count reaches zero then all file-space
+ * associated with the object will be reclaimed (but if the
+ * object is open, then the reclamation of the file space is
+ * delayed until all handles to the object are closed).
*
- * Return: Non-negative on success/Negative on failure
+ * Return: Non-negative on success/Negative on failure
*
- * Programmer: Quincey Koziol
+ * Programmer: Quincey Koziol
* Monday, November 13, 2006
*
*-------------------------------------------------------------------------
@@ -634,7 +634,7 @@ herr_t
H5Ldelete_by_idx(hid_t loc_id, const char *group_name,
H5_index_t idx_type, H5_iter_order_t order, hsize_t n, hid_t lapl_id)
{
- H5G_loc_t loc; /* Group's location */
+ H5G_loc_t loc; /* Group's location */
H5L_trav_rmbi_t udata; /* User data for callback */
herr_t ret_value = SUCCEED; /* Return value */
@@ -643,13 +643,13 @@ H5Ldelete_by_idx(hid_t loc_id, const char *group_name,
/* Check arguments */
if(H5G_loc(loc_id, &loc) < 0)
- HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a location")
+ HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a location")
if(!group_name || !*group_name)
- HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "no name specified")
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "no name specified")
if(idx_type <= H5_INDEX_UNKNOWN || idx_type >= H5_INDEX_N)
- HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "invalid index type specified")
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "invalid index type specified")
if(order <= H5_ITER_UNKNOWN || order >= H5_ITER_N)
- HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "invalid iteration order specified")
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "invalid iteration order specified")
if(H5P_DEFAULT == lapl_id)
lapl_id = H5P_LINK_ACCESS_DEFAULT;
else
@@ -672,20 +672,20 @@ done:
/*-------------------------------------------------------------------------
- * Function: H5Lget_val
+ * Function: H5Lget_val
*
- * Purpose: Returns the link value of a link whose name is NAME. For
+ * Purpose: Returns the link value of a link whose name is NAME. For
* symbolic links, this is the path to which the link points,
* including the null terminator. For user-defined links, it
* is the link buffer.
*
* At most SIZE bytes are copied to the BUF result buffer.
*
- * Return: Success: Non-negative with the link value in BUF.
+ * Return: Success: Non-negative with the link value in BUF.
*
- * Failure: Negative
+ * Failure: Negative
*
- * Programmer: Robb Matzke
+ * Programmer: Robb Matzke
* Monday, April 13, 1998
*
*-------------------------------------------------------------------------
@@ -694,7 +694,7 @@ herr_t
H5Lget_val(hid_t loc_id, const char *name, void *buf/*out*/, size_t size,
hid_t lapl_id)
{
- H5G_loc_t loc; /* Group location for location to query */
+ H5G_loc_t loc; /* Group location for location to query */
herr_t ret_value = SUCCEED; /* Return value */
FUNC_ENTER_API(FAIL)
@@ -702,9 +702,9 @@ H5Lget_val(hid_t loc_id, const char *name, void *buf/*out*/, size_t size,
/* Check arguments */
if(H5G_loc(loc_id, &loc))
- HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a location")
+ HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a location")
if(!name || !*name)
- HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "no name specified")
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "no name specified")
if(H5P_DEFAULT == lapl_id)
lapl_id = H5P_LINK_ACCESS_DEFAULT;
else
@@ -713,7 +713,7 @@ H5Lget_val(hid_t loc_id, const char *name, void *buf/*out*/, size_t size,
/* Get the link value */
if(H5L_get_val(&loc, name, buf, size, lapl_id, H5AC_ind_dxpl_id) < 0)
- HGOTO_ERROR(H5E_SYM, H5E_NOTFOUND, FAIL, "unable to get link value for '%s'", name)
+ HGOTO_ERROR(H5E_SYM, H5E_NOTFOUND, FAIL, "unable to get link value for '%s'", name)
done:
FUNC_LEAVE_API(ret_value)
@@ -721,19 +721,19 @@ done:
/*-------------------------------------------------------------------------
- * Function: H5Lget_val_by_idx
+ * Function: H5Lget_val_by_idx
*
- * Purpose: Returns the link value of a link, according to the order of
+ * Purpose: Returns the link value of a link, according to the order of
* an index. For symbolic links, this is the path to which the
* link points, including the null terminator. For user-defined
* links, it is the link buffer.
*
* At most SIZE bytes are copied to the BUF result buffer.
*
- * Return: Success: Non-negative with the link value in BUF.
- * Failure: Negative
+ * Return: Success: Non-negative with the link value in BUF.
+ * Failure: Negative
*
- * Programmer: Quincey Koziol
+ * Programmer: Quincey Koziol
* Monday, November 13, 2006
*
*-------------------------------------------------------------------------
@@ -743,7 +743,7 @@ H5Lget_val_by_idx(hid_t loc_id, const char *group_name, H5_index_t idx_type,
H5_iter_order_t order, hsize_t n, void *buf/*out*/, size_t size,
hid_t lapl_id)
{
- H5G_loc_t loc; /* Group location for location to query */
+ H5G_loc_t loc; /* Group location for location to query */
H5L_trav_gvbi_t udata; /* User data for callback */
herr_t ret_value = SUCCEED; /* Return value */
@@ -753,13 +753,13 @@ H5Lget_val_by_idx(hid_t loc_id, const char *group_name, H5_index_t idx_type,
/* Check arguments */
if(H5G_loc(loc_id, &loc))
- HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a location")
+ HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a location")
if(!group_name || !*group_name)
- HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "no name specified")
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "no name specified")
if(idx_type <= H5_INDEX_UNKNOWN || idx_type >= H5_INDEX_N)
- HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "invalid index type specified")
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "invalid index type specified")
if(order <= H5_ITER_UNKNOWN || order >= H5_ITER_N)
- HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "invalid iteration order specified")
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "invalid iteration order specified")
if(H5P_DEFAULT == lapl_id)
lapl_id = H5P_LINK_ACCESS_DEFAULT;
else
@@ -785,14 +785,14 @@ done:
/*-------------------------------------------------------------------------
- * Function: H5Lexists
+ * Function: H5Lexists
*
- * Purpose: Checks if a link of a given name exists in a group
+ * Purpose: Checks if a link of a given name exists in a group
*
- * Return: Success: TRUE/FALSE
- * Failure: Negative
+ * Return: Success: TRUE/FALSE
+ * Failure: Negative
*
- * Programmer: Quincey Koziol
+ * Programmer: Quincey Koziol
* Friday, March 16, 2007
*
*-------------------------------------------------------------------------
@@ -800,7 +800,7 @@ done:
htri_t
H5Lexists(hid_t loc_id, const char *name, hid_t lapl_id)
{
- H5G_loc_t loc;
+ H5G_loc_t loc;
htri_t ret_value;
FUNC_ENTER_API(FAIL)
@@ -808,9 +808,9 @@ H5Lexists(hid_t loc_id, const char *name, hid_t lapl_id)
/* Check arguments */
if(H5G_loc(loc_id, &loc))
- HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a location")
+ HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a location")
if(!name || !*name)
- HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "no name specified")
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "no name specified")
if(H5P_DEFAULT == lapl_id)
lapl_id = H5P_LINK_ACCESS_DEFAULT;
else
@@ -819,7 +819,7 @@ H5Lexists(hid_t loc_id, const char *name, hid_t lapl_id)
/* Check for the existence of the link */
if((ret_value = H5L_exists(&loc, name, lapl_id, H5AC_ind_dxpl_id)) < 0)
- HGOTO_ERROR(H5E_SYM, H5E_NOTFOUND, FAIL, "unable to get link info")
+ HGOTO_ERROR(H5E_SYM, H5E_NOTFOUND, FAIL, "unable to get link info")
done:
FUNC_LEAVE_API(ret_value)
@@ -827,15 +827,15 @@ done:
/*-------------------------------------------------------------------------
- * Function: H5Lget_info
+ * Function: H5Lget_info
*
- * Purpose: Gets metadata for a link.
+ * Purpose: Gets metadata for a link.
*
- * Return: Success: Non-negative with information in LINFO
+ * Return: Success: Non-negative with information in LINFO
*
- * Failure: Negative
+ * Failure: Negative
*
- * Programmer: James Laird
+ * Programmer: James Laird
* Wednesday, June 21, 2006
*
*-------------------------------------------------------------------------
@@ -844,7 +844,7 @@ herr_t
H5Lget_info(hid_t loc_id, const char *name, H5L_info_t *linfo /*out*/,
hid_t lapl_id)
{
- H5G_loc_t loc;
+ H5G_loc_t loc;
herr_t ret_value = SUCCEED;
FUNC_ENTER_API(FAIL)
@@ -852,9 +852,9 @@ H5Lget_info(hid_t loc_id, const char *name, H5L_info_t *linfo /*out*/,
/* Check arguments */
if(H5G_loc(loc_id, &loc))
- HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a location")
+ HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a location")
if(!name || !*name)
- HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "no name specified")
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "no name specified")
if(H5P_DEFAULT == lapl_id)
lapl_id = H5P_LINK_ACCESS_DEFAULT;
else
@@ -863,7 +863,7 @@ H5Lget_info(hid_t loc_id, const char *name, H5L_info_t *linfo /*out*/,
/* Get the link information */
if(H5L_get_info(&loc, name, linfo, lapl_id, H5AC_ind_dxpl_id) < 0)
- HGOTO_ERROR(H5E_SYM, H5E_NOTFOUND, FAIL, "unable to get link info")
+ HGOTO_ERROR(H5E_SYM, H5E_NOTFOUND, FAIL, "unable to get link info")
done:
FUNC_LEAVE_API(ret_value)
@@ -871,15 +871,15 @@ done:
/*-------------------------------------------------------------------------
- * Function: H5Lget_info_by_idx
+ * Function: H5Lget_info_by_idx
*
- * Purpose: Gets metadata for a link, according to the order within an
+ * Purpose: Gets metadata for a link, according to the order within an
* index.
*
- * Return: Success: Non-negative with information in LINFO
- * Failure: Negative
+ * Return: Success: Non-negative with information in LINFO
+ * Failure: Negative
*
- * Programmer: Quincey Koziol
+ * Programmer: Quincey Koziol
* Monday, November 6, 2006
*
*-------------------------------------------------------------------------
@@ -889,7 +889,7 @@ H5Lget_info_by_idx(hid_t loc_id, const char *group_name,
H5_index_t idx_type, H5_iter_order_t order, hsize_t n,
H5L_info_t *linfo /*out*/, hid_t lapl_id)
{
- H5G_loc_t loc; /* Group location for group to query */
+ H5G_loc_t loc; /* Group location for group to query */
H5L_trav_gibi_t udata; /* User data for callback */
herr_t ret_value = SUCCEED; /* Return value */
@@ -899,13 +899,13 @@ H5Lget_info_by_idx(hid_t loc_id, const char *group_name,
/* Check arguments */
if(H5G_loc(loc_id, &loc))
- HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a location")
+ HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a location")
if(!group_name || !*group_name)
- HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "no name specified")
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "no name specified")
if(idx_type <= H5_INDEX_UNKNOWN || idx_type >= H5_INDEX_N)
- HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "invalid index type specified")
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "invalid index type specified")
if(order <= H5_ITER_UNKNOWN || order >= H5_ITER_N)
- HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "invalid iteration order specified")
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "invalid iteration order specified")
if(H5P_DEFAULT == lapl_id)
lapl_id = H5P_LINK_ACCESS_DEFAULT;
else
@@ -921,7 +921,7 @@ H5Lget_info_by_idx(hid_t loc_id, const char *group_name,
/* Traverse the group hierarchy to locate the object to get info about */
if(H5G_traverse(&loc, group_name, H5G_TARGET_SLINK|H5G_TARGET_UDLINK, H5L_get_info_by_idx_cb, &udata, lapl_id, H5AC_ind_dxpl_id) < 0)
- HGOTO_ERROR(H5E_SYM, H5E_NOTFOUND, FAIL, "unable to get link info")
+ HGOTO_ERROR(H5E_SYM, H5E_NOTFOUND, FAIL, "unable to get link info")
done:
@@ -930,9 +930,9 @@ done:
/*-------------------------------------------------------------------------
- * Function: H5Lregister
+ * Function: H5Lregister
*
- * Purpose: Registers a class of user-defined links, or changes the
+ * Purpose: Registers a class of user-defined links, or changes the
* behavior of an existing class.
*
* The link class passed in will override any existing link
@@ -941,9 +941,9 @@ done:
* H5L_LINK_CLASS_T_VERS), a link class ID, and a traversal
* function.
*
- * Return: Non-negative on success/Negative on failure
+ * Return: Non-negative on success/Negative on failure
*
- * Programmer: James Laird
+ * Programmer: James Laird
* Monday, July 10, 2006
*
*-------------------------------------------------------------------------
@@ -958,7 +958,7 @@ H5Lregister(const H5L_class_t *cls)
/* Check args */
if(cls == NULL)
- HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "invalid link class")
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "invalid link class")
/* Check H5L_class_t version number; this is where a function to convert
* from an outdated version should be called.
@@ -981,16 +981,16 @@ done:
/*-------------------------------------------------------------------------
- * Function: H5Lunregister
+ * Function: H5Lunregister
*
- * Purpose: Unregisters a class of user-defined links, preventing them
+ * Purpose: Unregisters a class of user-defined links, preventing them
* from being traversed, queried, moved, etc.
*
* A link class can be re-registered using H5Lregister().
*
- * Return: Non-negative on success/Negative on failure
+ * Return: Non-negative on success/Negative on failure
*
- * Programmer: James Laird
+ * Programmer: James Laird
* Monday, July 10, 2006
*
*-------------------------------------------------------------------------
@@ -1005,11 +1005,11 @@ H5Lunregister(H5L_type_t id)
/* Check args */
if(id < 0 || id > H5L_TYPE_MAX)
- HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "invalid link type")
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "invalid link type")
/* Do it */
if(H5L_unregister(id) < 0)
- HGOTO_ERROR(H5E_LINK, H5E_NOTREGISTERED, FAIL, "unable to unregister link type")
+ HGOTO_ERROR(H5E_LINK, H5E_NOTREGISTERED, FAIL, "unable to unregister link type")
done:
FUNC_LEAVE_API(ret_value)
@@ -1017,16 +1017,16 @@ done:
/*-------------------------------------------------------------------------
- * Function: H5Lis_registered
+ * Function: H5Lis_registered
*
- * Purpose: Tests whether a user-defined link class has been registered
+ * Purpose: Tests whether a user-defined link class has been registered
* or not.
*
- * Return: Positive if the link class has been registered
+ * Return: Positive if the link class has been registered
* Zero if it is unregistered
* Negative on error (if the class is not a valid UD class ID)
*
- * Programmer: James Laird
+ * Programmer: James Laird
* Monday, July 10, 2006
*
*-------------------------------------------------------------------------
@@ -1046,7 +1046,7 @@ H5Lis_registered(H5L_type_t id)
/* Is the link class already registered? */
for(i = 0; i < H5L_table_used_g; i++)
- if(H5L_table_g[i].id == id) {
+ if(H5L_table_g[i].id == id) {
ret_value = TRUE;
break;
} /* end if */
@@ -1057,18 +1057,18 @@ done:
/*-------------------------------------------------------------------------
- * Function: H5Lget_name_by_idx
+ * Function: H5Lget_name_by_idx
*
- * Purpose: Gets name for a link, according to the order within an
+ * Purpose: Gets name for a link, according to the order within an
* index.
*
* Same pattern of behavior as H5Iget_name.
*
- * Return: Success: Non-negative length of name, with information
- * in NAME buffer
- * Failure: Negative
+ * Return: Success: Non-negative length of name, with information
+ * in NAME buffer
+ * Failure: Negative
*
- * Programmer: Quincey Koziol
+ * Programmer: Quincey Koziol
* Saturday, November 11, 2006
*
*-------------------------------------------------------------------------
@@ -1078,7 +1078,7 @@ H5Lget_name_by_idx(hid_t loc_id, const char *group_name,
H5_index_t idx_type, H5_iter_order_t order, hsize_t n,
char *name /*out*/, size_t size, hid_t lapl_id)
{
- H5G_loc_t loc; /* Location of group */
+ H5G_loc_t loc; /* Location of group */
H5L_trav_gnbi_t udata; /* User data for callback */
ssize_t ret_value; /* Return value */
@@ -1088,13 +1088,13 @@ H5Lget_name_by_idx(hid_t loc_id, const char *group_name,
/* Check arguments */
if(H5G_loc(loc_id, &loc))
- HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a location")
+ HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a location")
if(!group_name || !*group_name)
- HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "no name specified")
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "no name specified")
if(idx_type <= H5_INDEX_UNKNOWN || idx_type >= H5_INDEX_N)
- HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "invalid index type specified")
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "invalid index type specified")
if(order <= H5_ITER_UNKNOWN || order >= H5_ITER_N)
- HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "invalid iteration order specified")
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "invalid iteration order specified")
if(H5P_DEFAULT == lapl_id)
lapl_id = H5P_LINK_ACCESS_DEFAULT;
else
@@ -1123,23 +1123,23 @@ done:
/*-------------------------------------------------------------------------
- * Function: H5Literate
+ * Function: H5Literate
*
- * Purpose: Iterates over links in a group, with user callback routine,
+ * Purpose: Iterates over links in a group, with user callback routine,
* according to the order within an index.
*
* Same pattern of behavior as H5Giterate.
*
- * Return: Success: The return value of the first operator that
- * returns non-zero, or zero if all members were
- * processed with no operator returning non-zero.
+ * Return: Success: The return value of the first operator that
+ * returns non-zero, or zero if all members were
+ * processed with no operator returning non-zero.
*
- * Failure: Negative if something goes wrong within the
- * library, or the negative value returned by one
- * of the operators.
+ * Failure: Negative if something goes wrong within the
+ * library, or the negative value returned by one
+ * of the operators.
*
*
- * Programmer: Quincey Koziol
+ * Programmer: Quincey Koziol
* Thursday, November 16, 2006
*
*-------------------------------------------------------------------------
@@ -1150,8 +1150,8 @@ H5Literate(hid_t grp_id, H5_index_t idx_type, H5_iter_order_t order,
{
H5I_type_t id_type; /* Type of ID */
H5G_link_iterate_t lnk_op; /* Link operator */
- hsize_t last_lnk; /* Index of last object looked at */
- hsize_t idx; /* Internal location to hold index */
+ hsize_t last_lnk; /* Index of last object looked at */
+ hsize_t idx; /* Internal location to hold index */
herr_t ret_value; /* Return value */
FUNC_ENTER_API(FAIL)
@@ -1162,11 +1162,11 @@ H5Literate(hid_t grp_id, H5_index_t idx_type, H5_iter_order_t order,
if(!(H5I_GROUP == id_type || H5I_FILE == id_type))
HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "invalid argument")
if(idx_type <= H5_INDEX_UNKNOWN || idx_type >= H5_INDEX_N)
- HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "invalid index type specified")
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "invalid index type specified")
if(order <= H5_ITER_UNKNOWN || order >= H5_ITER_N)
- HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "invalid iteration order specified")
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "invalid iteration order specified")
if(!op)
- HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "no operator specified")
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "no operator specified")
/* Set up iteration beginning/end info */
idx = (idx_p == NULL ? 0 : *idx_p);
@@ -1178,7 +1178,7 @@ H5Literate(hid_t grp_id, H5_index_t idx_type, H5_iter_order_t order,
/* Iterate over the links */
if((ret_value = H5G_iterate(grp_id, ".", idx_type, order, idx, &last_lnk, &lnk_op, op_data, H5P_DEFAULT, H5AC_ind_dxpl_id)) < 0)
- HGOTO_ERROR(H5E_SYM, H5E_BADITER, FAIL, "link iteration failed")
+ HGOTO_ERROR(H5E_SYM, H5E_BADITER, FAIL, "link iteration failed")
/* Set the index we stopped at */
if(idx_p)
@@ -1190,23 +1190,23 @@ done:
/*-------------------------------------------------------------------------
- * Function: H5Literate_by_name
+ * Function: H5Literate_by_name
*
- * Purpose: Iterates over links in a group, with user callback routine,
+ * Purpose: Iterates over links in a group, with user callback routine,
* according to the order within an index.
*
* Same pattern of behavior as H5Giterate.
*
- * Return: Success: The return value of the first operator that
- * returns non-zero, or zero if all members were
- * processed with no operator returning non-zero.
+ * Return: Success: The return value of the first operator that
+ * returns non-zero, or zero if all members were
+ * processed with no operator returning non-zero.
*
- * Failure: Negative if something goes wrong within the
- * library, or the negative value returned by one
- * of the operators.
+ * Failure: Negative if something goes wrong within the
+ * library, or the negative value returned by one
+ * of the operators.
*
*
- * Programmer: Quincey Koziol
+ * Programmer: Quincey Koziol
* Thursday, November 16, 2006
*
*-------------------------------------------------------------------------
@@ -1217,9 +1217,9 @@ H5Literate_by_name(hid_t loc_id, const char *group_name,
H5L_iterate_t op, void *op_data, hid_t lapl_id)
{
H5G_link_iterate_t lnk_op; /* Link operator */
- hsize_t last_lnk; /* Index of last object looked at */
- hsize_t idx; /* Internal location to hold index */
- herr_t ret_value; /* Return value */
+ hsize_t last_lnk; /* Index of last object looked at */
+ hsize_t idx; /* Internal location to hold index */
+ herr_t ret_value; /* Return value */
FUNC_ENTER_API(FAIL)
H5TRACE8("e", "i*sIiIo*hx*xi", loc_id, group_name, idx_type, order, idx_p, op,
@@ -1227,13 +1227,13 @@ H5Literate_by_name(hid_t loc_id, const char *group_name,
/* Check arguments */
if(!group_name || !*group_name)
- HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "no name specified")
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "no name specified")
if(idx_type <= H5_INDEX_UNKNOWN || idx_type >= H5_INDEX_N)
- HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "invalid index type specified")
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "invalid index type specified")
if(order <= H5_ITER_UNKNOWN || order >= H5_ITER_N)
- HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "invalid iteration order specified")
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "invalid iteration order specified")
if(!op)
- HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "no operator specified")
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "no operator specified")
if(H5P_DEFAULT == lapl_id)
lapl_id = H5P_LINK_ACCESS_DEFAULT;
else
@@ -1250,7 +1250,7 @@ H5Literate_by_name(hid_t loc_id, const char *group_name,
/* Iterate over the links */
if((ret_value = H5G_iterate(loc_id, group_name, idx_type, order, idx, &last_lnk, &lnk_op, op_data, lapl_id, H5AC_ind_dxpl_id)) < 0)
- HGOTO_ERROR(H5E_SYM, H5E_BADITER, FAIL, "link iteration failed")
+ HGOTO_ERROR(H5E_SYM, H5E_BADITER, FAIL, "link iteration failed")
/* Set the index we stopped at */
if(idx_p)
@@ -1262,9 +1262,9 @@ done:
/*-------------------------------------------------------------------------
- * Function: H5Lvisit
+ * Function: H5Lvisit
*
- * Purpose: Recursively visit all the links in a group and all
+ * Purpose: Recursively visit all the links in a group and all
* the groups that are linked to from that group. Links within
* each group are visited according to the order within the
* specified index (unless the specified index does not exist for
@@ -1276,16 +1276,16 @@ done:
* callback with more than one link that points to a particular
* _object_.
*
- * Return: Success: The return value of the first operator that
- * returns non-zero, or zero if all members were
- * processed with no operator returning non-zero.
+ * Return: Success: The return value of the first operator that
+ * returns non-zero, or zero if all members were
+ * processed with no operator returning non-zero.
*
- * Failure: Negative if something goes wrong within the
- * library, or the negative value returned by one
- * of the operators.
+ * Failure: Negative if something goes wrong within the
+ * library, or the negative value returned by one
+ * of the operators.
*
- * Programmer: Quincey Koziol
- * November 24 2007
+ * Programmer: Quincey Koziol
+ * November 24 2007
*
*-------------------------------------------------------------------------
*/
@@ -1304,15 +1304,15 @@ H5Lvisit(hid_t grp_id, H5_index_t idx_type, H5_iter_order_t order,
if(!(H5I_GROUP == id_type || H5I_FILE == id_type))
HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "invalid argument")
if(idx_type <= H5_INDEX_UNKNOWN || idx_type >= H5_INDEX_N)
- HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "invalid index type specified")
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "invalid index type specified")
if(order <= H5_ITER_UNKNOWN || order >= H5_ITER_N)
- HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "invalid iteration order specified")
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "invalid iteration order specified")
if(!op)
HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "no callback operator specified")
/* Call internal group visitation routine */
if((ret_value = H5G_visit(grp_id, ".", idx_type, order, op, op_data, H5P_DEFAULT, H5AC_ind_dxpl_id)) < 0)
- HGOTO_ERROR(H5E_SYM, H5E_BADITER, FAIL, "link visitation failed")
+ HGOTO_ERROR(H5E_SYM, H5E_BADITER, FAIL, "link visitation failed")
done:
FUNC_LEAVE_API(ret_value)
@@ -1320,9 +1320,9 @@ done:
/*-------------------------------------------------------------------------
- * Function: H5Lvisit_by_name
+ * Function: H5Lvisit_by_name
*
- * Purpose: Recursively visit all the links in a group and all
+ * Purpose: Recursively visit all the links in a group and all
* the groups that are linked to from that group. Links within
* each group are visited according to the order within the
* specified index (unless the specified index does not exist for
@@ -1334,16 +1334,16 @@ done:
* callback with more than one link that points to a particular
* _object_.
*
- * Return: Success: The return value of the first operator that
- * returns non-zero, or zero if all members were
- * processed with no operator returning non-zero.
+ * Return: Success: The return value of the first operator that
+ * returns non-zero, or zero if all members were
+ * processed with no operator returning non-zero.
*
- * Failure: Negative if something goes wrong within the
- * library, or the negative value returned by one
- * of the operators.
+ * Failure: Negative if something goes wrong within the
+ * library, or the negative value returned by one
+ * of the operators.
*
- * Programmer: Quincey Koziol
- * November 3 2007
+ * Programmer: Quincey Koziol
+ * November 3 2007
*
*-------------------------------------------------------------------------
*/
@@ -1359,11 +1359,11 @@ H5Lvisit_by_name(hid_t loc_id, const char *group_name, H5_index_t idx_type,
/* Check args */
if(!group_name || !*group_name)
- HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "no name specified")
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "no name specified")
if(idx_type <= H5_INDEX_UNKNOWN || idx_type >= H5_INDEX_N)
- HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "invalid index type specified")
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "invalid index type specified")
if(order <= H5_ITER_UNKNOWN || order >= H5_ITER_N)
- HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "invalid iteration order specified")
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "invalid iteration order specified")
if(!op)
HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "no callback operator specified")
if(H5P_DEFAULT == lapl_id)
@@ -1374,7 +1374,7 @@ H5Lvisit_by_name(hid_t loc_id, const char *group_name, H5_index_t idx_type,
/* Call internal group visitation routine */
if((ret_value = H5G_visit(loc_id, group_name, idx_type, order, op, op_data, lapl_id, H5AC_ind_dxpl_id)) < 0)
- HGOTO_ERROR(H5E_SYM, H5E_BADITER, FAIL, "link visitation failed")
+ HGOTO_ERROR(H5E_SYM, H5E_BADITER, FAIL, "link visitation failed")
done:
FUNC_LEAVE_API(ret_value)
@@ -1390,16 +1390,16 @@ done:
/*-------------------------------------------------------------------------
- * Function: H5L_find_class_idx
+ * Function: H5L_find_class_idx
*
- * Purpose: Given a link class ID, return the offset in the global array
+ * Purpose: Given a link class ID, return the offset in the global array
* that holds all the registered link classes.
*
- * Return: Success: Non-negative index of entry in global
+ * Return: Success: Non-negative index of entry in global
* link class table.
- * Failure: Negative
+ * Failure: Negative
*
- * Programmer: James Laird
+ * Programmer: James Laird
* Monday, July 10, 2006
*
*-------------------------------------------------------------------------
@@ -1413,8 +1413,8 @@ H5L_find_class_idx(H5L_type_t id)
FUNC_ENTER_NOAPI_NOINIT_NOERR
for(i = 0; i < H5L_table_used_g; i++)
- if(H5L_table_g[i].id == id)
- HGOTO_DONE((int)i)
+ if(H5L_table_g[i].id == id)
+ HGOTO_DONE((int)i)
done:
FUNC_LEAVE_NOAPI(ret_value)
@@ -1422,15 +1422,15 @@ done:
/*-------------------------------------------------------------------------
- * Function: H5L_find_class
+ * Function: H5L_find_class
*
- * Purpose: Given a link class ID return a pointer to a global struct that
- * defines the link class.
+ * Purpose: Given a link class ID return a pointer to a global struct that
+ * defines the link class.
*
- * Return: Success: Ptr to entry in global link class table.
- * Failure: NULL
+ * Return: Success: Ptr to entry in global link class table.
+ * Failure: NULL
*
- * Programmer: James Laird
+ * Programmer: James Laird
* Monday, July 10, 2006
*
*-------------------------------------------------------------------------
@@ -1438,7 +1438,7 @@ done:
const H5L_class_t *
H5L_find_class(H5L_type_t id)
{
- int idx; /* Filter index in global table */
+ int idx; /* Filter index in global table */
H5L_class_t *ret_value = NULL; /* Return value */
FUNC_ENTER_NOAPI(NULL)
@@ -1456,16 +1456,16 @@ done:
/*-------------------------------------------------------------------------
- * Function: H5L_register
+ * Function: H5L_register
*
- * Purpose: Registers a class of user-defined links, or changes the
+ * Purpose: Registers a class of user-defined links, or changes the
* behavior of an existing class.
*
* See H5Lregister for full documentation.
*
- * Return: Non-negative on success/Negative on failure
+ * Return: Non-negative on success/Negative on failure
*
- * Programmer: James Laird
+ * Programmer: James Laird
* Monday, July 10, 2006
*
*-------------------------------------------------------------------------
@@ -1483,22 +1483,22 @@ H5L_register(const H5L_class_t *cls)
/* Is the link type already registered? */
for(i = 0; i < H5L_table_used_g; i++)
- if(H5L_table_g[i].id == cls->id)
+ if(H5L_table_g[i].id == cls->id)
break;
/* Filter not already registered */
if(i >= H5L_table_used_g) {
- if(H5L_table_used_g >= H5L_table_alloc_g) {
- size_t n = MAX(H5L_MIN_TABLE_SIZE, (2 * H5L_table_alloc_g));
- H5L_class_t *table = (H5L_class_t *)H5MM_realloc(H5L_table_g, (n * sizeof(H5L_class_t)));
+ if(H5L_table_used_g >= H5L_table_alloc_g) {
+ size_t n = MAX(H5L_MIN_TABLE_SIZE, (2 * H5L_table_alloc_g));
+ H5L_class_t *table = (H5L_class_t *)H5MM_realloc(H5L_table_g, (n * sizeof(H5L_class_t)));
if(!table)
- HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "unable to extend link type table")
- H5L_table_g = table;
+ HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "unable to extend link type table")
+ H5L_table_g = table;
H5L_table_alloc_g = n;
- } /* end if */
+ } /* end if */
- /* Initialize */
- i = H5L_table_used_g++;
+ /* Initialize */
+ i = H5L_table_used_g++;
} /* end if */
/* Copy link class info into table */
@@ -1510,15 +1510,15 @@ done:
/*-------------------------------------------------------------------------
- * Function: H5L_unregister
+ * Function: H5L_unregister
*
- * Purpose: Unregisters a class of user-defined links.
+ * Purpose: Unregisters a class of user-defined links.
*
* See H5Lunregister for full documentation.
*
- * Return: Non-negative on success/Negative on failure
+ * Return: Non-negative on success/Negative on failure
*
- * Programmer: James Laird
+ * Programmer: James Laird
* Monday, July 10, 2006
*
*-------------------------------------------------------------------------
@@ -1535,7 +1535,7 @@ H5L_unregister(H5L_type_t id)
/* Is the filter already registered? */
for(i = 0; i < H5L_table_used_g; i++)
- if(H5L_table_g[i].id == id)
+ if(H5L_table_g[i].id == id)
break;
/* Fail if filter not found */
@@ -1553,14 +1553,14 @@ done:
/*-------------------------------------------------------------------------
- * Function: H5L_link
+ * Function: H5L_link
*
- * Purpose: Creates a link from OBJ_ID to CUR_NAME. See H5Olink() for
- * full documentation.
+ * Purpose: Creates a link from OBJ_ID to CUR_NAME. See H5Olink() for
+ * full documentation.
*
- * Return: Non-negative on success/Negative on failure
+ * Return: Non-negative on success/Negative on failure
*
- * Programmer: James Laird
+ * Programmer: James Laird
* Tuesday, December 13, 2005
*
*-------------------------------------------------------------------------
@@ -1598,13 +1598,13 @@ done:
/*-------------------------------------------------------------------------
- * Function: H5L_link_object
+ * Function: H5L_link_object
*
- * Purpose: Creates a new object and a link to it.
+ * Purpose: Creates a new object and a link to it.
*
- * Return: Non-negative on success/Negative on failure
+ * Return: Non-negative on success/Negative on failure
*
- * Programmer: Quincey Koziol
+ * Programmer: Quincey Koziol
* Monday, April 9, 2007
*
*-------------------------------------------------------------------------
@@ -1641,13 +1641,13 @@ done:
/*-------------------------------------------------------------------------
- * Function: H5L_link_cb
+ * Function: H5L_link_cb
*
- * Purpose: Callback for creating a link to an object.
+ * Purpose: Callback for creating a link to an object.
*
- * Return: Non-negative on success/Negative on failure
+ * Return: Non-negative on success/Negative on failure
*
- * Programmer: Quincey Koziol
+ * Programmer: Quincey Koziol
* Monday, September 19, 2005
*
*-------------------------------------------------------------------------
@@ -1889,13 +1889,13 @@ done:
/*-------------------------------------------------------------------------
- * Function: H5L_create_hard
+ * Function: H5L_create_hard
*
- * Purpose: Creates a hard link from NEW_NAME to CUR_NAME.
+ * Purpose: Creates a hard link from NEW_NAME to CUR_NAME.
*
- * Return: Non-negative on success/Negative on failure
+ * Return: Non-negative on success/Negative on failure
*
- * Programmer: Robb Matzke
+ * Programmer: Robb Matzke
* Monday, April 6, 1998
*
*-------------------------------------------------------------------------
@@ -1905,7 +1905,7 @@ H5L_create_hard(H5G_loc_t *cur_loc, const char *cur_name,
const H5G_loc_t *link_loc, const char *link_name, hid_t lcpl_id,
hid_t lapl_id, hid_t dxpl_id)
{
- char *norm_cur_name = NULL; /* Pointer to normalized current name */
+ char *norm_cur_name = NULL; /* Pointer to normalized current name */
H5F_t *link_file = NULL; /* Pointer to file to link to */
H5O_link_t lnk; /* Link to insert */
H5G_loc_t obj_loc; /* Location of object to link to */
@@ -1963,13 +1963,13 @@ done:
/*-------------------------------------------------------------------------
- * Function: H5L_create_soft
+ * Function: H5L_create_soft
*
- * Purpose: Creates a soft link from LINK_NAME to TARGET_PATH.
+ * Purpose: Creates a soft link from LINK_NAME to TARGET_PATH.
*
- * Return: Non-negative on success/Negative on failure
+ * Return: Non-negative on success/Negative on failure
*
- * Programmer: Robb Matzke
+ * Programmer: Robb Matzke
* Monday, April 6, 1998
*
*-------------------------------------------------------------------------
@@ -1978,7 +1978,7 @@ herr_t
H5L_create_soft(const char *target_path, const H5G_loc_t *link_loc,
const char *link_name, hid_t lcpl_id, hid_t lapl_id, hid_t dxpl_id)
{
- char *norm_target = NULL; /* Pointer to normalized current name */
+ char *norm_target = NULL; /* Pointer to normalized current name */
H5O_link_t lnk; /* Link to insert */
herr_t ret_value = SUCCEED; /* Return value */
@@ -2011,14 +2011,14 @@ done:
/*-------------------------------------------------------------------------
- * Function: H5L_create_ud
+ * Function: H5L_create_ud
*
- * Purpose: Creates a user-defined link. See H5Lcreate_ud for
+ * Purpose: Creates a user-defined link. See H5Lcreate_ud for
* full documentation.
*
- * Return: Non-negative on success/Negative on failure
+ * Return: Non-negative on success/Negative on failure
*
- * Programmer: James Laird
+ * Programmer: James Laird
* Friday, May 19, 2006
*
*-------------------------------------------------------------------------
@@ -2070,13 +2070,13 @@ done:
/*-------------------------------------------------------------------------
- * Function: H5L_get_val_real
+ * Function: H5L_get_val_real
*
- * Purpose: Retrieve link value from a link object
+ * Purpose: Retrieve link value from a link object
*
- * Return: Non-negative on success/Negative on failure
+ * Return: Non-negative on success/Negative on failure
*
- * Programmer: Quincey Koziol
+ * Programmer: Quincey Koziol
* Monday, November 13 2006
*
*-------------------------------------------------------------------------
@@ -2126,13 +2126,13 @@ done:
/*-------------------------------------------------------------------------
- * Function: H5L_get_val_cb
+ * Function: H5L_get_val_cb
*
- * Purpose: Callback for retrieving link value or udata.
+ * Purpose: Callback for retrieving link value or udata.
*
- * Return: Non-negative on success/Negative on failure
+ * Return: Non-negative on success/Negative on failure
*
- * Programmer: Quincey Koziol
+ * Programmer: Quincey Koziol
* Tuesday, September 20, 2005
*
*-------------------------------------------------------------------------
@@ -2164,20 +2164,20 @@ done:
/*-------------------------------------------------------------------------
- * Function: H5L_get_val
+ * Function: H5L_get_val
*
- * Purpose: Returns the value of a symbolic link or the udata for a
+ * Purpose: Returns the value of a symbolic link or the udata for a
* user-defined link.
*
- * Return: Success: Non-negative, with at most SIZE bytes of the
- * link value copied into the BUF buffer. If the
- * link value is larger than SIZE characters
- * counting the null terminator then the BUF
- * result will not be null terminated.
+ * Return: Success: Non-negative, with at most SIZE bytes of the
+ * link value copied into the BUF buffer. If the
+ * link value is larger than SIZE characters
+ * counting the null terminator then the BUF
+ * result will not be null terminated.
*
- * Failure: Negative
+ * Failure: Negative
*
- * Programmer: Robb Matzke
+ * Programmer: Robb Matzke
* Monday, April 13, 1998
*
*-------------------------------------------------------------------------
@@ -2187,7 +2187,7 @@ H5L_get_val(H5G_loc_t *loc, const char *name, void *buf/*out*/, size_t size,
hid_t lapl_id, hid_t dxpl_id)
{
H5L_trav_gv_t udata; /* User data for callback */
- herr_t ret_value = SUCCEED; /* Return value */
+ herr_t ret_value = SUCCEED; /* Return value */
FUNC_ENTER_NOAPI(FAIL)
@@ -2209,14 +2209,14 @@ done:
/*-------------------------------------------------------------------------
- * Function: H5L_get_val_by_idx_cb
+ * Function: H5L_get_val_by_idx_cb
*
- * Purpose: Callback for retrieving a link's value according to an
+ * Purpose: Callback for retrieving a link's value according to an
* index's order.
*
- * Return: Non-negative on success/Negative on failure
+ * Return: Non-negative on success/Negative on failure
*
- * Programmer: Quincey Koziol
+ * Programmer: Quincey Koziol
* Monday, November 13 2006
*
*-------------------------------------------------------------------------
@@ -2261,14 +2261,14 @@ done:
/*-------------------------------------------------------------------------
- * Function: H5L_delete_cb
+ * Function: H5L_delete_cb
*
- * Purpose: Callback for deleting a link. This routine
+ * Purpose: Callback for deleting a link. This routine
* actually deletes the link
*
- * Return: Non-negative on success/Negative on failure
+ * Return: Non-negative on success/Negative on failure
*
- * Programmer: Quincey Koziol
+ * Programmer: Quincey Koziol
* Monday, September 19, 2005
*
*-------------------------------------------------------------------------
@@ -2298,7 +2298,7 @@ H5L_delete_cb(H5G_loc_t *grp_loc/*in*/, const char *name, const H5O_link_t *lnk,
/* Remove the link from the group */
if(H5G_obj_remove(grp_loc->oloc, grp_loc->path->full_path_r, name, udata->dxpl_id) < 0)
- HGOTO_ERROR(H5E_SYM, H5E_CANTDELETE, FAIL, "unable to remove link from group")
+ HGOTO_ERROR(H5E_SYM, H5E_CANTDELETE, FAIL, "unable to remove link from group")
done:
/* Indicate that this callback didn't take ownership of the group *
@@ -2310,13 +2310,13 @@ done:
/*-------------------------------------------------------------------------
- * Function: H5L_delete
+ * Function: H5L_delete
*
- * Purpose: Delete a link from a group.
+ * Purpose: Delete a link from a group.
*
- * Return: Non-negative on success/Negative on failure
+ * Return: Non-negative on success/Negative on failure
*
- * Programmer: Robb Matzke
+ * Programmer: Robb Matzke
* Thursday, September 17, 1998
*
*-------------------------------------------------------------------------
@@ -2324,9 +2324,9 @@ done:
herr_t
H5L_delete(H5G_loc_t *loc, const char *name, hid_t lapl_id, hid_t dxpl_id)
{
- H5L_trav_rm_t udata; /* User data for callback */
- char *norm_name = NULL; /* Pointer to normalized name */
- herr_t ret_value = SUCCEED; /* Return value */
+ H5L_trav_rm_t udata; /* User data for callback */
+ char *norm_name = NULL; /* Pointer to normalized name */
+ herr_t ret_value = SUCCEED; /* Return value */
FUNC_ENTER_NOAPI(FAIL)
@@ -2353,13 +2353,13 @@ done:
/*-------------------------------------------------------------------------
- * Function: H5L_delete_by_idx_cb
+ * Function: H5L_delete_by_idx_cb
*
- * Purpose: Callback for removing a link according to an index's order.
+ * Purpose: Callback for removing a link according to an index's order.
*
- * Return: Non-negative on success/Negative on failure
+ * Return: Non-negative on success/Negative on failure
*
- * Programmer: Quincey Koziol
+ * Programmer: Quincey Koziol
* Monday, November 13 2006
*
*-------------------------------------------------------------------------
@@ -2393,15 +2393,15 @@ done:
/*-------------------------------------------------------------------------
- * Function: H5L_move_dest_cb
+ * Function: H5L_move_dest_cb
*
- * Purpose: Second callback for moving and renaming an object. This routine
+ * Purpose: Second callback for moving and renaming an object. This routine
* inserts a new link into the group returned by the traversal.
* It is called by H5L_move_cb.
*
- * Return: Non-negative on success/Negative on failure
+ * Return: Non-negative on success/Negative on failure
*
- * Programmer: James Laird
+ * Programmer: James Laird
* Monday, April 3, 2006
*
*-------------------------------------------------------------------------
@@ -2507,15 +2507,15 @@ done:
/*-------------------------------------------------------------------------
- * Function: H5L_move_cb
+ * Function: H5L_move_cb
*
- * Purpose: Callback for moving and renaming an object. This routine
+ * Purpose: Callback for moving and renaming an object. This routine
* replaces the names of open objects with the moved object
* in the path
*
- * Return: Non-negative on success/Negative on failure
+ * Return: Non-negative on success/Negative on failure
*
- * Programmer: James Laird
+ * Programmer: James Laird
* Friday, April 3, 2006
*
*-------------------------------------------------------------------------
@@ -2561,7 +2561,7 @@ H5L_move_cb(H5G_loc_t *grp_loc/*in*/, const char *name, const H5O_link_t *lnk,
/* Insert the link into its new location */
if(H5G_traverse(udata->dst_loc, udata->dst_name, udata->dst_target_flags,
H5L_move_dest_cb, &udata_out, udata->lapl_id, udata->dxpl_id) < 0)
- HGOTO_ERROR(H5E_SYM, H5E_NOTFOUND, FAIL, "unable to follow symbolic link")
+ HGOTO_ERROR(H5E_SYM, H5E_NOTFOUND, FAIL, "unable to follow symbolic link")
/* If this is a move and not a copy operation, change the object's name and remove the old link */
if(!udata->copy) {
@@ -2617,9 +2617,9 @@ done:
/*-------------------------------------------------------------------------
- * Function: H5L_move
+ * Function: H5L_move
*
- * Purpose: Atomically move or copy a link.
+ * Purpose: Atomically move or copy a link.
*
* Creates a copy of a link in a new destination with a new name.
* SRC_LOC and SRC_NAME together define the link's original
@@ -2629,9 +2629,9 @@ done:
* If copy_flag is FALSE, the original link is removed
* (effectively moving the link).
*
- * Return: Non-negative on success/Negative on failure
+ * Return: Non-negative on success/Negative on failure
*
- * Programmer: James Laird
+ * Programmer: James Laird
* Monday, May 1, 2006
*
*-------------------------------------------------------------------------
@@ -2699,9 +2699,10 @@ H5L_move(H5G_loc_t *src_loc, const char *src_name, H5G_loc_t *dst_loc,
udata.dxpl_id = dxpl_id;
/* Do the move */
- if(H5G_traverse(src_loc, src_name, H5G_TARGET_MOUNT | H5G_TARGET_SLINK | H5G_TARGET_UDLINK,
+ if(H5G_traverse(src_loc,
+ src_name, H5G_TARGET_MOUNT | H5G_TARGET_SLINK | H5G_TARGET_UDLINK,
H5L_move_cb, &udata, lapl_id, dxpl_id) < 0)
- HGOTO_ERROR(H5E_SYM, H5E_NOTFOUND, FAIL, "unable to find link")
+ HGOTO_ERROR(H5E_SYM, H5E_NOTFOUND, FAIL, "unable to find link")
done:
FUNC_LEAVE_NOAPI(ret_value)
@@ -2709,13 +2710,13 @@ done:
/*-------------------------------------------------------------------------
- * Function: H5L_exists_cb
+ * Function: H5L_exists_cb
*
- * Purpose: Callback for checking whether a link exists
+ * Purpose: Callback for checking whether a link exists
*
- * Return: Non-negative on success/Negative on failure
+ * Return: Non-negative on success/Negative on failure
*
- * Programmer: Quincey Koziol
+ * Programmer: Quincey Koziol
* Friday, March 16 2007
*
*-------------------------------------------------------------------------
@@ -2741,13 +2742,13 @@ H5L_exists_cb(H5G_loc_t H5_ATTR_UNUSED *grp_loc/*in*/, const char H5_ATTR_UNUSED
/*-------------------------------------------------------------------------
- * Function: H5L_exists
+ * Function: H5L_exists
*
- * Purpose: Returns whether a link exists in a group
+ * Purpose: Returns whether a link exists in a group
*
- * Return: Non-negative (TRUE/FALSE) on success/Negative on failure
+ * Return: Non-negative (TRUE/FALSE) on success/Negative on failure
*
- * Programmer: Quincey Koziol
+ * Programmer: Quincey Koziol
* Friday, March 16 2007
*
*-------------------------------------------------------------------------
@@ -2773,13 +2774,13 @@ done:
/*-------------------------------------------------------------------------
- * Function: H5L_get_info_cb
+ * Function: H5L_get_info_cb
*
- * Purpose: Callback for retrieving a link's metadata
+ * Purpose: Callback for retrieving a link's metadata
*
- * Return: Non-negative on success/Negative on failure
+ * Return: Non-negative on success/Negative on failure
*
- * Programmer: James Laird
+ * Programmer: James Laird
* Monday, April 17 2006
*
*-------------------------------------------------------------------------
@@ -2812,13 +2813,13 @@ done:
/*-------------------------------------------------------------------------
- * Function: H5L_get_info
+ * Function: H5L_get_info
*
- * Purpose: Returns metadata about a link.
+ * Purpose: Returns metadata about a link.
*
- * Return: Non-negative on success/Negative on failure
+ * Return: Non-negative on success/Negative on failure
*
- * Programmer: James Laird
+ * Programmer: James Laird
* Monday, April 17 2006
*
*-------------------------------------------------------------------------
@@ -2845,14 +2846,14 @@ done:
/*-------------------------------------------------------------------------
- * Function: H5L_get_info_by_idx_cb
+ * Function: H5L_get_info_by_idx_cb
*
- * Purpose: Callback for retrieving a link's metadata according to an
+ * Purpose: Callback for retrieving a link's metadata according to an
* index's order.
*
- * Return: Non-negative on success/Negative on failure
+ * Return: Non-negative on success/Negative on failure
*
- * Programmer: Quincey Koziol
+ * Programmer: Quincey Koziol
* Monday, November 6 2006
*
*-------------------------------------------------------------------------
@@ -2897,15 +2898,15 @@ done:
/*-------------------------------------------------------------------------
- * Function: H5L_get_default_lcpl
+ * Function: H5L_get_default_lcpl
*
- * Purpose: Accessor for the default Link Creation Property List
+ * Purpose: Accessor for the default Link Creation Property List
*
- * Return: Success: ID of the deafult lcpl
+ * Return: Success: ID of the default lcpl
*
- * Failure: Negative
+ * Failure: Negative
*
- * Programmer: James Laird
+ * Programmer: James Laird
* Tuesday, July 4, 2006
*
*-------------------------------------------------------------------------
@@ -2925,14 +2926,14 @@ done:
/*-------------------------------------------------------------------------
- * Function: H5L_get_name_by_idx_cb
+ * Function: H5L_get_name_by_idx_cb
*
- * Purpose: Callback for retrieving a link's name according to an
+ * Purpose: Callback for retrieving a link's name according to an
* index's order.
*
- * Return: Non-negative on success/Negative on failure
+ * Return: Non-negative on success/Negative on failure
*
- * Programmer: Quincey Koziol
+ * Programmer: Quincey Koziol
* Saturday, November 11 2006
*
*-------------------------------------------------------------------------
@@ -2966,16 +2967,16 @@ done:
/*-------------------------------------------------------------------------
- * Function: H5L_link_copy_file
+ * Function: H5L_link_copy_file
*
* Purpose: Copy a link and the object it points to from one file to
* another.
*
- * Return: Non-negative on success/Negative on failure
+ * Return: Non-negative on success/Negative on failure
*
- * Programmer: Quincey Koziol
- * koziol@hdfgroup.org
- * Sep 29 2006
+ * Programmer: Quincey Koziol
+ * koziol@hdfgroup.org
+ * Sep 29 2006
*
*-------------------------------------------------------------------------
*/
diff --git a/src/H5MF.c b/src/H5MF.c
index 569bf99..60b142f 100644
--- a/src/H5MF.c
+++ b/src/H5MF.c
@@ -1117,7 +1117,7 @@ HDfprintf(stderr, "%s: Check 2.0 - f->shared->fs_man[%u] = %p, f->shared->fs_add
#endif /* H5MF_ALLOC_DEBUG_MORE */
/* If there is free space manager info for this type, delete it */
- /* (XXX: Make this optional when free space for a file can be persistant) */
+ /* (XXX: Make this optional when free space for a file can be persistent) */
if(H5F_addr_defined(f->shared->fs_addr[type])) {
haddr_t tmp_fs_addr; /* Temporary holder for free space manager address */
diff --git a/src/H5Oainfo.c b/src/H5Oainfo.c
index e85df44..5aab4c6 100644
--- a/src/H5Oainfo.c
+++ b/src/H5Oainfo.c
@@ -34,7 +34,7 @@
/* PRIVATE PROTOTYPES */
static void *H5O_ainfo_decode(H5F_t *f, hid_t dxpl_id, H5O_t *open_oh,
- unsigned mesg_flags, unsigned *ioflags, const uint8_t *p);
+ unsigned mesg_flags, unsigned *ioflags, size_t p_size, const uint8_t *p);
static herr_t H5O_ainfo_encode(H5F_t *f, hbool_t disable_shared, uint8_t *p, const void *_mesg);
static void *H5O_ainfo_copy(const void *_mesg, void *_dest);
static size_t H5O_ainfo_size(const H5F_t *f, hbool_t disable_shared, const void *_mesg);
@@ -104,7 +104,8 @@ H5FL_DEFINE_STATIC(H5O_ainfo_t);
*/
static void *
H5O_ainfo_decode(H5F_t *f, hid_t H5_ATTR_UNUSED dxpl_id, H5O_t H5_ATTR_UNUSED *open_oh,
- unsigned H5_ATTR_UNUSED mesg_flags, unsigned H5_ATTR_UNUSED *ioflags, const uint8_t *p)
+ unsigned H5_ATTR_UNUSED mesg_flags, unsigned H5_ATTR_UNUSED *ioflags,
+ size_t H5_ATTR_UNUSED p_size, const uint8_t *p)
{
H5O_ainfo_t *ainfo = NULL; /* Attribute info */
unsigned char flags; /* Flags for encoding attribute info */
diff --git a/src/H5Oattr.c b/src/H5Oattr.c
index 149f04a..c2c0fe3 100644
--- a/src/H5Oattr.c
+++ b/src/H5Oattr.c
@@ -26,7 +26,7 @@
/* PRIVATE PROTOTYPES */
static herr_t H5O_attr_encode(H5F_t *f, uint8_t *p, const void *mesg);
static void *H5O_attr_decode(H5F_t *f, hid_t dxpl_id, H5O_t *open_oh,
- unsigned mesg_flags, unsigned *ioflags, const uint8_t *p);
+ unsigned mesg_flags, unsigned *ioflags, size_t p_size, const uint8_t *p);
static void *H5O_attr_copy(const void *_mesg, void *_dest);
static size_t H5O_attr_size(const H5F_t *f, const void *_mesg);
static herr_t H5O_attr_free(void *mesg);
@@ -121,7 +121,7 @@ H5FL_EXTERN(H5S_extent_t);
--------------------------------------------------------------------------*/
static void *
H5O_attr_decode(H5F_t *f, hid_t dxpl_id, H5O_t *open_oh, unsigned H5_ATTR_UNUSED mesg_flags,
- unsigned *ioflags, const uint8_t *p)
+ unsigned *ioflags, size_t H5_ATTR_UNUSED p_size, const uint8_t *p)
{
H5A_t *attr = NULL;
H5S_extent_t *extent; /*extent dimensionality information */
@@ -182,7 +182,7 @@ H5O_attr_decode(H5F_t *f, hid_t dxpl_id, H5O_t *open_oh, unsigned H5_ATTR_UNUSED
/* Decode the attribute's datatype */
if(NULL == (attr->shared->dt = (H5T_t *)(H5O_MSG_DTYPE->decode)(f, dxpl_id, open_oh,
- ((flags & H5O_ATTR_FLAG_TYPE_SHARED) ? H5O_MSG_FLAG_SHARED : 0), ioflags, p)))
+ ((flags & H5O_ATTR_FLAG_TYPE_SHARED) ? H5O_MSG_FLAG_SHARED : 0), ioflags, attr->shared->dt_size, p)))
HGOTO_ERROR(H5E_ATTR, H5E_CANTDECODE, NULL, "can't decode attribute datatype")
if(attr->shared->version < H5O_ATTR_VERSION_2)
p += H5O_ALIGN_OLD(attr->shared->dt_size);
@@ -197,7 +197,7 @@ H5O_attr_decode(H5F_t *f, hid_t dxpl_id, H5O_t *open_oh, unsigned H5_ATTR_UNUSED
/* Decode attribute's dataspace extent */
if((extent = (H5S_extent_t *)(H5O_MSG_SDSPACE->decode)(f, dxpl_id, open_oh,
- ((flags & H5O_ATTR_FLAG_SPACE_SHARED) ? H5O_MSG_FLAG_SHARED : 0), ioflags, p)) == NULL)
+ ((flags & H5O_ATTR_FLAG_SPACE_SHARED) ? H5O_MSG_FLAG_SHARED : 0), ioflags, attr->shared->ds_size, p)) == NULL)
HGOTO_ERROR(H5E_ATTR, H5E_CANTDECODE, NULL, "can't decode attribute dataspace")
/* Copy the extent information to the dataspace */
diff --git a/src/H5Obogus.c b/src/H5Obogus.c
index 7a058b2..ba9a8ad 100644
--- a/src/H5Obogus.c
+++ b/src/H5Obogus.c
@@ -37,7 +37,7 @@
/* PRIVATE PROTOTYPES */
static void *H5O_bogus_decode(H5F_t *f, hid_t dxpl_id, H5O_t *open_oh,
- unsigned mesg_flags, unsigned *ioflags, const uint8_t *p);
+ unsigned mesg_flags, unsigned *ioflags, size_t p_size, const uint8_t *p);
static herr_t H5O_bogus_encode(H5F_t *f, hbool_t disable_shared, uint8_t *p, const void *_mesg);
static size_t H5O_bogus_size(const H5F_t *f, hbool_t disable_shared, const void *_mesg);
static herr_t H5O_bogus_debug(H5F_t *f, hid_t dxpl_id, const void *_mesg, FILE * stream,
@@ -110,7 +110,8 @@ const H5O_msg_class_t H5O_MSG_BOGUS_INVALID[1] = {{
*/
static void *
H5O_bogus_decode(H5F_t *f, hid_t H5_ATTR_UNUSED dxpl_id, H5O_t H5_ATTR_UNUSED *open_oh,
- unsigned H5_ATTR_UNUSED mesg_flags, unsigned H5_ATTR_UNUSED *ioflags, const uint8_t *p)
+ unsigned H5_ATTR_UNUSED mesg_flags, unsigned H5_ATTR_UNUSED *ioflags,
+ size_t H5_ATTR_UNUSED p_size, const uint8_t *p)
{
H5O_bogus_t *mesg = NULL;
void *ret_value; /* Return value */
diff --git a/src/H5Obtreek.c b/src/H5Obtreek.c
index 70aacc7..6bcdcc3 100644
--- a/src/H5Obtreek.c
+++ b/src/H5Obtreek.c
@@ -27,7 +27,7 @@
#include "H5MMprivate.h" /* Memory management */
static void *H5O_btreek_decode(H5F_t *f, hid_t dxpl_id, H5O_t *open_oh,
- unsigned mesg_flags, unsigned *ioflags, const uint8_t *p);
+ unsigned mesg_flags, unsigned *ioflags, size_t p_size, const uint8_t *p);
static herr_t H5O_btreek_encode(H5F_t *f, hbool_t disable_shared, uint8_t *p, const void *_mesg);
static void *H5O_btreek_copy(const void *_mesg, void *_dest);
static size_t H5O_btreek_size(const H5F_t *f, hbool_t disable_shared, const void *_mesg);
@@ -78,7 +78,8 @@ const H5O_msg_class_t H5O_MSG_BTREEK[1] = {{
*/
static void *
H5O_btreek_decode(H5F_t H5_ATTR_UNUSED *f, hid_t H5_ATTR_UNUSED dxpl_id, H5O_t H5_ATTR_UNUSED *open_oh,
- unsigned H5_ATTR_UNUSED mesg_flags, unsigned H5_ATTR_UNUSED *ioflags, const uint8_t *p)
+ unsigned H5_ATTR_UNUSED mesg_flags, unsigned H5_ATTR_UNUSED *ioflags,
+ size_t H5_ATTR_UNUSED p_size, const uint8_t *p)
{
H5O_btreek_t *mesg; /* Native message */
void *ret_value; /* Return value */
diff --git a/src/H5Ocache.c b/src/H5Ocache.c
index ebae3f5..39f3ca3 100644
--- a/src/H5Ocache.c
+++ b/src/H5Ocache.c
@@ -1288,7 +1288,7 @@ H5O_chunk_deserialize(H5O_t *oh, haddr_t addr, size_t len, const uint8_t *image,
unsigned ioflags = 0; /* Flags for decode routine */
/* Decode continuation message */
- cont = (H5O_cont_t *)(H5O_MSG_CONT->decode)(udata->f, udata->dxpl_id, NULL, 0, &ioflags, oh->mesg[curmesg].raw);
+ cont = (H5O_cont_t *)(H5O_MSG_CONT->decode)(udata->f, udata->dxpl_id, NULL, 0, &ioflags, oh->mesg[curmesg].raw_size, oh->mesg[curmesg].raw);
cont->chunkno = udata->cont_msg_info->nmsgs + 1; /*the next continuation message/chunk */
/* Save 'native' form of continuation message */
@@ -1312,7 +1312,7 @@ H5O_chunk_deserialize(H5O_t *oh, haddr_t addr, size_t len, const uint8_t *image,
/* Decode ref. count message */
HDassert(oh->version > H5O_VERSION_1);
- refcount = (H5O_refcount_t *)(H5O_MSG_REFCOUNT->decode)(udata->f, udata->dxpl_id, NULL, 0, &ioflags, oh->mesg[curmesg].raw);
+ refcount = (H5O_refcount_t *)(H5O_MSG_REFCOUNT->decode)(udata->f, udata->dxpl_id, NULL, 0, &ioflags, oh->mesg[curmesg].raw_size, oh->mesg[curmesg].raw);
/* Save 'native' form of ref. count message */
oh->mesg[curmesg].native = refcount;
diff --git a/src/H5Ocont.c b/src/H5Ocont.c
index 681f54a..b91b181 100644
--- a/src/H5Ocont.c
+++ b/src/H5Ocont.c
@@ -36,7 +36,7 @@
/* PRIVATE PROTOTYPES */
static void *H5O_cont_decode(H5F_t *f, hid_t dxpl_id, H5O_t *open_oh,
- unsigned mesg_flags, unsigned *ioflags, const uint8_t *p);
+ unsigned mesg_flags, unsigned *ioflags, size_t p_size, const uint8_t *p);
static herr_t H5O_cont_encode(H5F_t *f, hbool_t disable_shared, uint8_t *p, const void *_mesg);
static size_t H5O_cont_size(const H5F_t *f, hbool_t disable_shared, const void *_mesg);
static herr_t H5O_cont_free(void *mesg);
@@ -89,7 +89,8 @@ H5FL_DEFINE(H5O_cont_t);
*/
static void *
H5O_cont_decode(H5F_t *f, hid_t H5_ATTR_UNUSED dxpl_id, H5O_t H5_ATTR_UNUSED *open_oh,
- unsigned H5_ATTR_UNUSED mesg_flags, unsigned H5_ATTR_UNUSED *ioflags, const uint8_t *p)
+ unsigned H5_ATTR_UNUSED mesg_flags, unsigned H5_ATTR_UNUSED *ioflags,
+ size_t H5_ATTR_UNUSED p_size, const uint8_t *p)
{
H5O_cont_t *cont = NULL;
void *ret_value;
diff --git a/src/H5Ocopy.c b/src/H5Ocopy.c
index 31beb0e..2d974f1 100644
--- a/src/H5Ocopy.c
+++ b/src/H5Ocopy.c
@@ -1044,7 +1044,7 @@ H5O_copy_header(const H5O_loc_t *oloc_src, H5O_loc_t *oloc_dst /*out */,
HDassert(H5F_addr_defined(oloc_src->addr));
HDassert(oloc_dst->file);
- /* Intialize copy info before errors can be thrown */
+ /* Initialize copy info before errors can be thrown */
HDmemset(&cpy_info, 0, sizeof(H5O_copy_t));
/* Get the copy property list */
diff --git a/src/H5Odrvinfo.c b/src/H5Odrvinfo.c
index 6f715f8..fd8ad6b 100644
--- a/src/H5Odrvinfo.c
+++ b/src/H5Odrvinfo.c
@@ -27,7 +27,7 @@
#include "H5MMprivate.h" /* Memory management */
static void *H5O_drvinfo_decode(H5F_t *f, hid_t dxpl_id, H5O_t *open_oh,
- unsigned mesg_flags, unsigned *ioflags, const uint8_t *p);
+ unsigned mesg_flags, unsigned *ioflags, size_t p_size, const uint8_t *p);
static herr_t H5O_drvinfo_encode(H5F_t *f, hbool_t disable_shared, uint8_t *p, const void *_mesg);
static void *H5O_drvinfo_copy(const void *_mesg, void *_dest);
static size_t H5O_drvinfo_size(const H5F_t *f, hbool_t disable_shared, const void *_mesg);
@@ -79,7 +79,8 @@ const H5O_msg_class_t H5O_MSG_DRVINFO[1] = {{
*/
static void *
H5O_drvinfo_decode(H5F_t H5_ATTR_UNUSED *f, hid_t H5_ATTR_UNUSED dxpl_id, H5O_t H5_ATTR_UNUSED *open_oh,
- unsigned H5_ATTR_UNUSED mesg_flags, unsigned H5_ATTR_UNUSED *ioflags, const uint8_t *p)
+ unsigned H5_ATTR_UNUSED mesg_flags, unsigned H5_ATTR_UNUSED *ioflags,
+ size_t H5_ATTR_UNUSED p_size, const uint8_t *p)
{
H5O_drvinfo_t *mesg; /* Native message */
void *ret_value; /* Return value */
diff --git a/src/H5Odtype.c b/src/H5Odtype.c
index 774b071..85fbef4 100644
--- a/src/H5Odtype.c
+++ b/src/H5Odtype.c
@@ -29,7 +29,7 @@
/* PRIVATE PROTOTYPES */
static herr_t H5O_dtype_encode(H5F_t *f, uint8_t *p, const void *mesg);
static void *H5O_dtype_decode(H5F_t *f, hid_t dxpl_id, H5O_t *open_oh,
- unsigned mesg_flags, unsigned *ioflags, const uint8_t *p);
+ unsigned mesg_flags, unsigned *ioflags, size_t p_size, const uint8_t *p);
static void *H5O_dtype_copy(const void *_mesg, void *_dest);
static size_t H5O_dtype_size(const H5F_t *f, const void *_mesg);
static herr_t H5O_dtype_reset(void *_mesg);
@@ -1093,7 +1093,7 @@ done:
--------------------------------------------------------------------------*/
static void *
H5O_dtype_decode(H5F_t *f, hid_t H5_ATTR_UNUSED dxpl_id, H5O_t H5_ATTR_UNUSED *open_oh, unsigned H5_ATTR_UNUSED mesg_flags,
- unsigned *ioflags/*in,out*/, const uint8_t *p)
+ unsigned *ioflags/*in,out*/, size_t H5_ATTR_UNUSED p_size, const uint8_t *p)
{
H5T_t *dt = NULL;
void *ret_value; /* Return value */
diff --git a/src/H5Oefl.c b/src/H5Oefl.c
index 218d250..546eb4f 100644
--- a/src/H5Oefl.c
+++ b/src/H5Oefl.c
@@ -28,7 +28,7 @@
/* PRIVATE PROTOTYPES */
static void *H5O_efl_decode(H5F_t *f, hid_t dxpl_id, H5O_t *open_oh,
- unsigned mesg_flags, unsigned *ioflags, const uint8_t *p);
+ unsigned mesg_flags, unsigned *ioflags, size_t p_size, const uint8_t *p);
static herr_t H5O_efl_encode(H5F_t *f, hbool_t disable_shared, uint8_t *p, const void *_mesg);
static void *H5O_efl_copy(const void *_mesg, void *_dest);
static size_t H5O_efl_size(const H5F_t *f, hbool_t disable_shared, const void *_mesg);
@@ -88,7 +88,8 @@ const H5O_msg_class_t H5O_MSG_EFL[1] = {{
*/
static void *
H5O_efl_decode(H5F_t *f, hid_t dxpl_id, H5O_t H5_ATTR_UNUSED *open_oh,
- unsigned H5_ATTR_UNUSED mesg_flags, unsigned H5_ATTR_UNUSED *ioflags, const uint8_t *p)
+ unsigned H5_ATTR_UNUSED mesg_flags, unsigned H5_ATTR_UNUSED *ioflags,
+ size_t H5_ATTR_UNUSED p_size, const uint8_t *p)
{
H5O_efl_t *mesg = NULL;
int version;
diff --git a/src/H5Ofill.c b/src/H5Ofill.c
index 721c648..70704c5 100644
--- a/src/H5Ofill.c
+++ b/src/H5Ofill.c
@@ -32,11 +32,11 @@
static void *H5O_fill_old_decode(H5F_t *f, hid_t dxpl_id, H5O_t *open_oh,
- unsigned mesg_flags, unsigned *ioflags, const uint8_t *p);
+ unsigned mesg_flags, unsigned *ioflags, size_t p_size, const uint8_t *p);
static herr_t H5O_fill_old_encode(H5F_t *f, uint8_t *p, const void *_mesg);
static size_t H5O_fill_old_size(const H5F_t *f, const void *_mesg);
static void *H5O_fill_new_decode(H5F_t *f, hid_t dxpl_id, H5O_t *open_oh,
- unsigned mesg_flags, unsigned *ioflags, const uint8_t *p);
+ unsigned mesg_flags, unsigned *ioflags, size_t p_size, const uint8_t *p);
static herr_t H5O_fill_new_encode(H5F_t *f, uint8_t *p, const void *_mesg);
static size_t H5O_fill_new_size(const H5F_t *f, const void *_mesg);
static void *H5O_fill_copy(const void *_mesg, void *_dest);
@@ -183,7 +183,8 @@ H5FL_BLK_EXTERN(type_conv);
*/
static void *
H5O_fill_new_decode(H5F_t H5_ATTR_UNUSED *f, hid_t H5_ATTR_UNUSED dxpl_id, H5O_t H5_ATTR_UNUSED *open_oh,
- unsigned H5_ATTR_UNUSED mesg_flags, unsigned H5_ATTR_UNUSED *ioflags, const uint8_t *p)
+ unsigned H5_ATTR_UNUSED mesg_flags, unsigned H5_ATTR_UNUSED *ioflags,
+ size_t H5_ATTR_UNUSED p_size, const uint8_t *p)
{
H5O_fill_t *fill = NULL;
void *ret_value;
@@ -297,7 +298,8 @@ done:
*/
static void *
H5O_fill_old_decode(H5F_t H5_ATTR_UNUSED *f, hid_t H5_ATTR_UNUSED dxpl_id, H5O_t H5_ATTR_UNUSED *open_oh,
- unsigned H5_ATTR_UNUSED mesg_flags, unsigned H5_ATTR_UNUSED *ioflags, const uint8_t *p)
+ unsigned H5_ATTR_UNUSED mesg_flags, unsigned H5_ATTR_UNUSED *ioflags,
+ size_t H5_ATTR_UNUSED p_size, const uint8_t *p)
{
H5O_fill_t *fill = NULL; /* Decoded fill value message */
void *ret_value; /* Return value */
diff --git a/src/H5Oginfo.c b/src/H5Oginfo.c
index d8be51f..8ba1f71 100644
--- a/src/H5Oginfo.c
+++ b/src/H5Oginfo.c
@@ -32,7 +32,7 @@
/* PRIVATE PROTOTYPES */
static void *H5O_ginfo_decode(H5F_t *f, hid_t dxpl_id, H5O_t *open_oh,
- unsigned mesg_flags, unsigned *ioflags, const uint8_t *p);
+ unsigned mesg_flags, unsigned *ioflags, size_t p_size, const uint8_t *p);
static herr_t H5O_ginfo_encode(H5F_t *f, hbool_t disable_shared, uint8_t *p, const void *_mesg);
static void *H5O_ginfo_copy(const void *_mesg, void *_dest);
static size_t H5O_ginfo_size(const H5F_t *f, hbool_t disable_shared, const void *_mesg);
@@ -94,7 +94,8 @@ H5FL_DEFINE_STATIC(H5O_ginfo_t);
*/
static void *
H5O_ginfo_decode(H5F_t H5_ATTR_UNUSED *f, hid_t H5_ATTR_UNUSED dxpl_id, H5O_t H5_ATTR_UNUSED *open_oh,
- unsigned H5_ATTR_UNUSED mesg_flags, unsigned H5_ATTR_UNUSED *ioflags, const uint8_t *p)
+ unsigned H5_ATTR_UNUSED mesg_flags, unsigned H5_ATTR_UNUSED *ioflags,
+ size_t H5_ATTR_UNUSED p_size, const uint8_t *p)
{
H5O_ginfo_t *ginfo = NULL; /* Pointer to group information message */
unsigned char flags; /* Flags for encoding group info */
diff --git a/src/H5Olayout.c b/src/H5Olayout.c
index 17385c2..3f5076c 100644
--- a/src/H5Olayout.c
+++ b/src/H5Olayout.c
@@ -35,7 +35,7 @@
/* PRIVATE PROTOTYPES */
static void *H5O_layout_decode(H5F_t *f, hid_t dxpl_id, H5O_t *open_oh,
- unsigned mesg_flags, unsigned *ioflags, const uint8_t *p);
+ unsigned mesg_flags, unsigned *ioflags, size_t p_size, const uint8_t *p);
static herr_t H5O_layout_encode(H5F_t *f, hbool_t disable_shared, uint8_t *p, const void *_mesg);
static void *H5O_layout_copy(const void *_mesg, void *_dest);
static size_t H5O_layout_size(const H5F_t *f, hbool_t disable_shared, const void *_mesg);
@@ -95,7 +95,8 @@ H5FL_DEFINE(H5O_layout_t);
*/
static void *
H5O_layout_decode(H5F_t *f, hid_t H5_ATTR_UNUSED dxpl_id, H5O_t H5_ATTR_UNUSED *open_oh,
- unsigned H5_ATTR_UNUSED mesg_flags, unsigned H5_ATTR_UNUSED *ioflags, const uint8_t *p)
+ unsigned H5_ATTR_UNUSED mesg_flags, unsigned H5_ATTR_UNUSED *ioflags,
+ size_t H5_ATTR_UNUSED p_size, const uint8_t *p)
{
H5O_layout_t *mesg = NULL;
unsigned u;
diff --git a/src/H5Olinfo.c b/src/H5Olinfo.c
index 03e545f..a612ae5 100644
--- a/src/H5Olinfo.c
+++ b/src/H5Olinfo.c
@@ -36,7 +36,7 @@
/* PRIVATE PROTOTYPES */
static void *H5O_linfo_decode(H5F_t *f, hid_t dxpl_id, H5O_t *open_oh,
- unsigned mesg_flags, unsigned *ioflags, const uint8_t *p);
+ unsigned mesg_flags, unsigned *ioflags, size_t p_size, const uint8_t *p);
static herr_t H5O_linfo_encode(H5F_t *f, hbool_t disable_shared, uint8_t *p, const void *_mesg);
static void *H5O_linfo_copy(const void *_mesg, void *_dest);
static size_t H5O_linfo_size(const H5F_t *f, hbool_t disable_shared, const void *_mesg);
@@ -113,7 +113,8 @@ H5FL_DEFINE_STATIC(H5O_linfo_t);
*/
static void *
H5O_linfo_decode(H5F_t *f, hid_t H5_ATTR_UNUSED dxpl_id, H5O_t H5_ATTR_UNUSED *open_oh,
- unsigned H5_ATTR_UNUSED mesg_flags, unsigned H5_ATTR_UNUSED *ioflags, const uint8_t *p)
+ unsigned H5_ATTR_UNUSED mesg_flags, unsigned H5_ATTR_UNUSED *ioflags,
+ size_t H5_ATTR_UNUSED p_size, const uint8_t *p)
{
H5O_linfo_t *linfo = NULL; /* Link info */
unsigned char index_flags; /* Flags for encoding link index info */
diff --git a/src/H5Olink.c b/src/H5Olink.c
index 1b57f22..c0dd1d8 100644
--- a/src/H5Olink.c
+++ b/src/H5Olink.c
@@ -38,7 +38,7 @@
/* PRIVATE PROTOTYPES */
static void *H5O_link_decode(H5F_t *f, hid_t dxpl_id, H5O_t *open_oh,
- unsigned mesg_flags, unsigned *ioflags, const uint8_t *p);
+ unsigned mesg_flags, unsigned *ioflags, size_t p_size, const uint8_t *p);
static herr_t H5O_link_encode(H5F_t *f, hbool_t disable_shared, uint8_t *p, const void *_mesg);
static void *H5O_link_copy(const void *_mesg, void *_dest);
static size_t H5O_link_size(const H5F_t *f, hbool_t disable_shared, const void *_mesg);
@@ -117,7 +117,8 @@ H5FL_DEFINE_STATIC(H5O_link_t);
*/
static void *
H5O_link_decode(H5F_t *f, hid_t H5_ATTR_UNUSED dxpl_id, H5O_t H5_ATTR_UNUSED *open_oh,
- unsigned H5_ATTR_UNUSED mesg_flags, unsigned H5_ATTR_UNUSED *ioflags, const uint8_t *p)
+ unsigned H5_ATTR_UNUSED mesg_flags, unsigned H5_ATTR_UNUSED *ioflags,
+ size_t H5_ATTR_UNUSED p_size, const uint8_t *p)
{
H5O_link_t *lnk = NULL; /* Pointer to link message */
size_t len = 0; /* Length of a string in the message */
diff --git a/src/H5Omessage.c b/src/H5Omessage.c
index bbcf5a6..a2e4e88 100644
--- a/src/H5Omessage.c
+++ b/src/H5Omessage.c
@@ -14,8 +14,8 @@
/*-------------------------------------------------------------------------
*
* Created: H5Omessage.c
- * Dec 3 2006
- * Quincey Koziol <koziol@hdfgroup.org>
+ * Dec 3 2006
+ * Quincey Koziol <koziol@hdfgroup.org>
*
* Purpose: Object header message routines.
*
@@ -31,14 +31,14 @@
/***********/
/* Headers */
/***********/
-#include "H5private.h" /* Generic Functions */
-#include "H5Aprivate.h" /* Attributes */
+#include "H5private.h" /* Generic Functions */
+#include "H5Aprivate.h" /* Attributes */
#include "H5Eprivate.h" /* Error handling */
-#include "H5Fprivate.h" /* File access */
-#include "H5Iprivate.h" /* IDs */
-#include "H5MMprivate.h" /* Memory management */
-#include "H5Opkg.h" /* Object headers */
-#include "H5SMprivate.h" /* Shared object header messages */
+#include "H5Fprivate.h" /* File access */
+#include "H5Iprivate.h" /* IDs */
+#include "H5MMprivate.h" /* Memory management */
+#include "H5Opkg.h" /* Object headers */
+#include "H5SMprivate.h" /* Shared object header messages */
/****************/
@@ -102,11 +102,11 @@ static herr_t H5O_copy_mesg(H5F_t *f, hid_t dxpl_id, H5O_t *oh, size_t idx,
*
* Return: Success: Non-negative
*
- * Failure: Negative
+ * Failure: Negative
*
* Programmer: Quincey Koziol
- * koziol@hdfgroup.org
- * Dec 1 2006
+ * koziol@hdfgroup.org
+ * Dec 1 2006
*
*-------------------------------------------------------------------------
*/
@@ -150,11 +150,11 @@ done:
*
* Return: Success: Non-negative
*
- * Failure: Negative
+ * Failure: Negative
*
* Programmer: Quincey Koziol
- * koziol@ncsa.uiuc.edu
- * Dec 31 2002
+ * koziol@ncsa.uiuc.edu
+ * Dec 31 2002
*
*-------------------------------------------------------------------------
*/
@@ -445,10 +445,10 @@ done:
* to hold the result and return its pointer instead.
*
* Return: Success: Ptr to message in native format. The message
- * should be freed by calling H5O_msg_reset(). If
- * MESG is a null pointer then the caller should
- * also call H5MM_xfree() on the return value
- * after calling H5O_msg_reset().
+ * should be freed by calling H5O_msg_reset(). If
+ * MESG is a null pointer then the caller should
+ * also call H5MM_xfree() on the return value
+ * after calling H5O_msg_reset().
*
* Failure: NULL
*
@@ -499,10 +499,10 @@ done:
* to hold the result and return its pointer instead.
*
* Return: Success: Ptr to message in native format. The message
- * should be freed by calling H5O_msg_reset(). If
- * MESG is a null pointer then the caller should
- * also call H5MM_xfree() on the return value
- * after calling H5O_msg_reset().
+ * should be freed by calling H5O_msg_reset(). If
+ * MESG is a null pointer then the caller should
+ * also call H5MM_xfree() on the return value
+ * after calling H5O_msg_reset().
*
* Failure: NULL
*
@@ -858,11 +858,11 @@ H5O_msg_count_real(const H5O_t *oh, const H5O_msg_class_t *type)
* header without trying to decode the message.
*
* Return: Success: FALSE if the message does not exist; TRUE if
- * th message exists.
+ * the message exists.
*
* Failure: FAIL if the existence of the message could
- * not be determined due to some error such as
- * not being able to read the object header.
+ * not be determined due to some error such as
+ * not being able to read the object header.
*
* Programmer: Robb Matzke
* Monday, November 2, 1998
@@ -904,11 +904,11 @@ done:
* header without trying to decode the message.
*
* Return: Success: FALSE if the message does not exist; TRUE if
- * th message exists.
+ * the message exists.
*
* Failure: FAIL if the existence of the message could
- * not be determined due to some error such as
- * not being able to read the object header.
+ * not be determined due to some error such as
+ * not being able to read the object header.
*
* Programmer: Robb Matzke
* Monday, November 2, 1998
@@ -1821,7 +1821,7 @@ done:
*/
void *
H5O_msg_decode(H5F_t *f, hid_t dxpl_id, H5O_t *open_oh, unsigned type_id,
- const unsigned char *buf)
+ size_t buf_size, const unsigned char *buf)
{
const H5O_msg_class_t *type; /* Actual H5O class type for the ID */
void *ret_value; /* Return value */
@@ -1836,7 +1836,7 @@ H5O_msg_decode(H5F_t *f, hid_t dxpl_id, H5O_t *open_oh, unsigned type_id,
HDassert(type);
/* decode */
- if((ret_value = (type->decode)(f, dxpl_id, open_oh, 0, &ioflags, buf)) == NULL)
+ if((ret_value = (type->decode)(f, dxpl_id, open_oh, 0, &ioflags, buf_size, buf)) == NULL)
HGOTO_ERROR(H5E_OHDR, H5E_CANTDECODE, NULL, "unable to decode message")
done:
diff --git a/src/H5Omtime.c b/src/H5Omtime.c
index 46dd499..e4db09b 100644
--- a/src/H5Omtime.c
+++ b/src/H5Omtime.c
@@ -27,12 +27,12 @@
static void *H5O_mtime_new_decode(H5F_t *f, hid_t dxpl_id, H5O_t *open_oh,
- unsigned mesg_flags, unsigned *ioflags, const uint8_t *p);
+ unsigned mesg_flags, unsigned *ioflags, size_t p_size, const uint8_t *p);
static herr_t H5O_mtime_new_encode(H5F_t *f, hbool_t disable_shared, uint8_t *p, const void *_mesg);
static size_t H5O_mtime_new_size(const H5F_t *f, hbool_t disable_shared, const void *_mesg);
static void *H5O_mtime_decode(H5F_t *f, hid_t dxpl_id, H5O_t *open_oh,
- unsigned mesg_flags, unsigned *ioflags, const uint8_t *p);
+ unsigned mesg_flags, unsigned *ioflags, size_t p_size, const uint8_t *p);
static herr_t H5O_mtime_encode(H5F_t *f, hbool_t disable_shared, uint8_t *p, const void *_mesg);
static void *H5O_mtime_copy(const void *_mesg, void *_dest);
static size_t H5O_mtime_size(const H5F_t *f, hbool_t disable_shared, const void *_mesg);
@@ -118,7 +118,8 @@ H5FL_DEFINE(time_t);
*/
static void *
H5O_mtime_new_decode(H5F_t H5_ATTR_UNUSED *f, hid_t H5_ATTR_UNUSED dxpl_id, H5O_t H5_ATTR_UNUSED *open_oh,
- unsigned H5_ATTR_UNUSED mesg_flags, unsigned H5_ATTR_UNUSED *ioflags, const uint8_t *p)
+ unsigned H5_ATTR_UNUSED mesg_flags, unsigned H5_ATTR_UNUSED *ioflags,
+ size_t H5_ATTR_UNUSED p_size, const uint8_t *p)
{
time_t *mesg;
uint32_t tmp_time; /* Temporary copy of the time */
@@ -171,7 +172,8 @@ done:
*/
static void *
H5O_mtime_decode(H5F_t H5_ATTR_UNUSED *f, hid_t H5_ATTR_UNUSED dxpl_id, H5O_t H5_ATTR_UNUSED *open_oh,
- unsigned H5_ATTR_UNUSED mesg_flags, unsigned H5_ATTR_UNUSED *ioflags, const uint8_t *p)
+ unsigned H5_ATTR_UNUSED mesg_flags, unsigned H5_ATTR_UNUSED *ioflags,
+ size_t H5_ATTR_UNUSED p_size, const uint8_t *p)
{
time_t *mesg, the_time;
int i;
diff --git a/src/H5Oname.c b/src/H5Oname.c
index 007e20f..5248168 100644
--- a/src/H5Oname.c
+++ b/src/H5Oname.c
@@ -32,7 +32,7 @@
/* PRIVATE PROTOTYPES */
static void *H5O_name_decode(H5F_t *f, hid_t dxpl_id, H5O_t *open_oh,
- unsigned mesg_flags, unsigned *ioflags, const uint8_t *p);
+ unsigned mesg_flags, unsigned *ioflags, size_t p_size, const uint8_t *p);
static herr_t H5O_name_encode(H5F_t *f, hbool_t disable_shared, uint8_t *p, const void *_mesg);
static void *H5O_name_copy(const void *_mesg, void *_dest);
static size_t H5O_name_size(const H5F_t *f, hbool_t disable_shared, const void *_mesg);
@@ -83,7 +83,8 @@ const H5O_msg_class_t H5O_MSG_NAME[1] = {{
*/
static void *
H5O_name_decode(H5F_t H5_ATTR_UNUSED *f, hid_t H5_ATTR_UNUSED dxpl_id, H5O_t H5_ATTR_UNUSED *open_oh,
- unsigned H5_ATTR_UNUSED mesg_flags, unsigned H5_ATTR_UNUSED *ioflags, const uint8_t *p)
+ unsigned H5_ATTR_UNUSED mesg_flags, unsigned H5_ATTR_UNUSED *ioflags,
+ size_t H5_ATTR_UNUSED p_size, const uint8_t *p)
{
H5O_name_t *mesg;
void *ret_value; /* Return value */
diff --git a/src/H5Opkg.h b/src/H5Opkg.h
index cd585be..f4b8014 100644
--- a/src/H5Opkg.h
+++ b/src/H5Opkg.h
@@ -186,7 +186,7 @@
\
/* Decode the message */ \
HDassert(msg_type->decode); \
- if(NULL == ((MSG)->native = (msg_type->decode)((F), (DXPL), (OH), (MSG)->flags, &ioflags, (MSG)->raw))) \
+ if(NULL == ((MSG)->native = (msg_type->decode)((F), (DXPL), (OH), (MSG)->flags, &ioflags, (MSG)->raw_size, (MSG)->raw))) \
HGOTO_ERROR(H5E_OHDR, H5E_CANTDECODE, ERR, "unable to decode message") \
\
/* Mark the message dirty if it was changed by decoding */ \
@@ -222,7 +222,7 @@ struct H5O_msg_class_t {
const char *name; /*for debugging */
size_t native_size; /*size of native message */
unsigned share_flags; /* Message sharing settings */
- void *(*decode)(H5F_t *, hid_t, H5O_t *, unsigned, unsigned *, const uint8_t *);
+ void *(*decode)(H5F_t *, hid_t, H5O_t *, unsigned, unsigned *, size_t, const uint8_t *);
herr_t (*encode)(H5F_t *, hbool_t, uint8_t *, const void *);
void *(*copy)(const void *, void *); /*copy native value */
size_t (*raw_size)(const H5F_t *, hbool_t, const void *);/*sizeof encoded message */
diff --git a/src/H5Opline.c b/src/H5Opline.c
index 42fb72c..adaee33 100644
--- a/src/H5Opline.c
+++ b/src/H5Opline.c
@@ -33,7 +33,7 @@
/* PRIVATE PROTOTYPES */
static herr_t H5O_pline_encode(H5F_t *f, uint8_t *p, const void *mesg);
static void *H5O_pline_decode(H5F_t *f, hid_t dxpl_id, H5O_t *open_oh,
- unsigned mesg_flags, unsigned *ioflags, const uint8_t *p);
+ unsigned mesg_flags, unsigned *ioflags, size_t p_size, const uint8_t *p);
static void *H5O_pline_copy(const void *_mesg, void *_dest);
static size_t H5O_pline_size(const H5F_t *f, const void *_mesg);
static herr_t H5O_pline_reset(void *_mesg);
@@ -108,13 +108,15 @@ H5FL_DEFINE(H5O_pline_t);
*/
static void *
H5O_pline_decode(H5F_t H5_ATTR_UNUSED *f, hid_t H5_ATTR_UNUSED dxpl_id, H5O_t H5_ATTR_UNUSED *open_oh,
- unsigned H5_ATTR_UNUSED mesg_flags, unsigned H5_ATTR_UNUSED *ioflags, const uint8_t *p)
+ unsigned H5_ATTR_UNUSED mesg_flags, unsigned H5_ATTR_UNUSED *ioflags,
+ size_t p_size, const uint8_t *p)
{
H5O_pline_t *pline = NULL; /* Pipeline message */
H5Z_filter_info_t *filter; /* Filter to decode */
size_t name_length; /* Length of filter name */
size_t i; /* Local index variable */
- void *ret_value; /* Return value */
+ const uint8_t *p_end = p + p_size - 1; /* End of the p buffer */
+ void *ret_value = NULL; /* Return value */
FUNC_ENTER_NOAPI_NOINIT
@@ -123,17 +125,24 @@ H5O_pline_decode(H5F_t H5_ATTR_UNUSED *f, hid_t H5_ATTR_UNUSED dxpl_id, H5O_t H5
/* Allocate space for I/O pipeline message */
if(NULL == (pline = H5FL_CALLOC(H5O_pline_t)))
- HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "memory allocation failed")
+ HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "memory allocation failed")
/* Version */
pline->version = *p++;
if(pline->version < H5O_PLINE_VERSION_1 || pline->version > H5O_PLINE_VERSION_LATEST)
- HGOTO_ERROR(H5E_PLINE, H5E_CANTLOAD, NULL, "bad version number for filter pipeline message")
+ HGOTO_ERROR(H5E_PLINE, H5E_CANTLOAD, NULL, "bad version number for filter pipeline message")
/* Number of filters */
pline->nused = *p++;
- if(pline->nused > H5Z_MAX_NFILTERS)
- HGOTO_ERROR(H5E_PLINE, H5E_CANTLOAD, NULL, "filter pipeline message has too many filters")
+ if(pline->nused > H5Z_MAX_NFILTERS) {
+
+ /* Reset the number of filters used to avoid array traversal in error
+ * handling code.
+ */
+ pline->nused = 0;
+
+ HGOTO_ERROR(H5E_PLINE, H5E_CANTLOAD, NULL, "filter pipeline message has too many filters")
+ }
/* Reserved */
if(pline->version == H5O_PLINE_VERSION_1)
@@ -142,12 +151,12 @@ H5O_pline_decode(H5F_t H5_ATTR_UNUSED *f, hid_t H5_ATTR_UNUSED dxpl_id, H5O_t H5
/* Allocate array for filters */
pline->nalloc = pline->nused;
if(NULL == (pline->filter = (H5Z_filter_info_t *)H5MM_calloc(pline->nalloc * sizeof(pline->filter[0]))))
- HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "memory allocation failed")
+ HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "memory allocation failed")
/* Decode filters */
for(i = 0, filter = &pline->filter[0]; i < pline->nused; i++, filter++) {
/* Filter ID */
- UINT16DECODE(p, filter->id);
+ UINT16DECODE(p, filter->id);
/* Length of filter name */
if(pline->version > H5O_PLINE_VERSION_1 && filter->id < H5Z_FILTER_RESERVED)
@@ -159,18 +168,18 @@ H5O_pline_decode(H5F_t H5_ATTR_UNUSED *f, hid_t H5_ATTR_UNUSED dxpl_id, H5O_t H5
} /* end if */
/* Filter flags */
- UINT16DECODE(p, filter->flags);
+ UINT16DECODE(p, filter->flags);
/* Number of filter parameters ("client data elements") */
- UINT16DECODE(p, filter->cd_nelmts);
+ UINT16DECODE(p, filter->cd_nelmts);
/* Filter name, if there is one */
- if(name_length) {
+ if(name_length) {
size_t actual_name_length; /* Actual length of name */
/* Determine actual name length (without padding, but with null terminator) */
- actual_name_length = HDstrlen((const char *)p) + 1;
- HDassert(actual_name_length <= name_length);
+ actual_name_length = HDstrlen((const char *)p) + 1;
+ HDassert(actual_name_length <= name_length);
/* Allocate space for the filter name, or use the internal buffer */
if(actual_name_length > H5Z_COMMON_NAME_LEN) {
@@ -181,12 +190,12 @@ H5O_pline_decode(H5F_t H5_ATTR_UNUSED *f, hid_t H5_ATTR_UNUSED dxpl_id, H5O_t H5
else
filter->name = filter->_name;
- HDstrncpy(filter->name, (const char *)p, actual_name_length);
- p += name_length;
- } /* end if */
+ HDstrncpy(filter->name, (const char *)p, actual_name_length);
+ p += name_length;
+ } /* end if */
/* Filter parameters */
- if(filter->cd_nelmts) {
+ if(filter->cd_nelmts) {
size_t j; /* Local index variable */
/* Allocate space for the client data elements, or use the internal buffer */
@@ -198,15 +207,20 @@ H5O_pline_decode(H5F_t H5_ATTR_UNUSED *f, hid_t H5_ATTR_UNUSED dxpl_id, H5O_t H5
else
filter->cd_values = filter->_cd_values;
- /*
- * Read the client data values and the padding
- */
- for(j = 0; j < filter->cd_nelmts; j++)
- UINT32DECODE(p, filter->cd_values[j]);
+ /*
+ * Read the client data values and the padding
+ */
+ for (j = 0; j < filter->cd_nelmts; j++) {
+ if (p + 4 - 1 <= p_end)
+ UINT32DECODE(p, filter->cd_values[j])
+ else
+ HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "ran off the end of the buffer: current p = %p, p_size = %zu, p_end = %p", p, p_size, p_end)
+ }
+
if(pline->version == H5O_PLINE_VERSION_1)
if(filter->cd_nelmts % 2)
p += 4; /*padding*/
- } /* end if */
+ } /* end if */
} /* end for */
/* Set return value */
@@ -495,23 +509,30 @@ H5O_pline_reset(void *mesg)
FUNC_ENTER_NOAPI_NOINIT_NOERR
+ /* NOTE: This function can be called during error processing from
+ * other API calls so DO NOT ASSUME THAT ANY VALUES ARE SANE.
+ */
+
HDassert(pline);
- /* Free information for each filter */
- for(i = 0; i < pline->nused; i++) {
- if(pline->filter[i].name && pline->filter[i].name != pline->filter[i]._name)
- HDassert((HDstrlen(pline->filter[i].name) + 1) > H5Z_COMMON_NAME_LEN);
- if(pline->filter[i].name != pline->filter[i]._name)
- pline->filter[i].name = (char *)H5MM_xfree(pline->filter[i].name);
- if(pline->filter[i].cd_values && pline->filter[i].cd_values != pline->filter[i]._cd_values)
- HDassert(pline->filter[i].cd_nelmts > H5Z_COMMON_CD_VALUES);
- if(pline->filter[i].cd_values != pline->filter[i]._cd_values)
- pline->filter[i].cd_values = (unsigned *)H5MM_xfree(pline->filter[i].cd_values);
- } /* end for */
+ /* Free the filter information and array */
+ if (pline->filter) {
+
+ /* Free information for each filter */
+ for(i = 0; i < pline->nused; i++) {
+ if(pline->filter[i].name && pline->filter[i].name != pline->filter[i]._name)
+ HDassert((HDstrlen(pline->filter[i].name) + 1) > H5Z_COMMON_NAME_LEN);
+ if(pline->filter[i].name != pline->filter[i]._name)
+ pline->filter[i].name = (char *)H5MM_xfree(pline->filter[i].name);
+ if(pline->filter[i].cd_values && pline->filter[i].cd_values != pline->filter[i]._cd_values)
+ HDassert(pline->filter[i].cd_nelmts > H5Z_COMMON_CD_VALUES);
+ if(pline->filter[i].cd_values != pline->filter[i]._cd_values)
+ pline->filter[i].cd_values = (unsigned *)H5MM_xfree(pline->filter[i].cd_values);
+ } /* end for */
- /* Free filter array */
- if(pline->filter)
+ /* Free filter array */
pline->filter = (H5Z_filter_info_t *)H5MM_xfree(pline->filter);
+ }
/* Reset # of filters */
pline->nused = pline->nalloc = 0;
diff --git a/src/H5Oprivate.h b/src/H5Oprivate.h
index ca0fc8e..1f51705 100644
--- a/src/H5Oprivate.h
+++ b/src/H5Oprivate.h
@@ -710,7 +710,7 @@ H5_DLL herr_t H5O_msg_get_crt_index(unsigned type_id, const void *mesg,
H5_DLL herr_t H5O_msg_encode(H5F_t *f, unsigned type_id, hbool_t disable_shared,
unsigned char *buf, const void *obj);
H5_DLL void* H5O_msg_decode(H5F_t *f, hid_t dxpl_id, H5O_t *open_oh,
- unsigned type_id, const unsigned char *buf);
+ unsigned type_id, size_t buf_size, const unsigned char *buf);
H5_DLL herr_t H5O_msg_delete(H5F_t *f, hid_t dxpl_id, H5O_t *open_oh,
unsigned type_id, void *mesg);
H5_DLL int H5O_msg_get_chunkno(const H5O_loc_t *loc, unsigned type_id, hid_t dxpl_id);
diff --git a/src/H5Orefcount.c b/src/H5Orefcount.c
index 22b1a02..78ff791 100644
--- a/src/H5Orefcount.c
+++ b/src/H5Orefcount.c
@@ -32,7 +32,7 @@
/* PRIVATE PROTOTYPES */
static void *H5O_refcount_decode(H5F_t *f, hid_t dxpl_id, H5O_t *open_oh,
- unsigned mesg_flags, unsigned *ioflags, const uint8_t *p);
+ unsigned mesg_flags, unsigned *ioflags, size_t p_size, const uint8_t *p);
static herr_t H5O_refcount_encode(H5F_t *f, hbool_t disable_shared, uint8_t *p, const void *_mesg);
static void *H5O_refcount_copy(const void *_mesg, void *_dest);
static size_t H5O_refcount_size(const H5F_t *f, hbool_t disable_shared, const void *_mesg);
@@ -89,7 +89,8 @@ H5FL_DEFINE_STATIC(H5O_refcount_t);
*/
static void *
H5O_refcount_decode(H5F_t H5_ATTR_UNUSED *f, hid_t H5_ATTR_UNUSED dxpl_id, H5O_t H5_ATTR_UNUSED *open_oh,
- unsigned H5_ATTR_UNUSED mesg_flags, unsigned H5_ATTR_UNUSED *ioflags, const uint8_t *p)
+ unsigned H5_ATTR_UNUSED mesg_flags, unsigned H5_ATTR_UNUSED *ioflags,
+ size_t H5_ATTR_UNUSED p_size, const uint8_t *p)
{
H5O_refcount_t *refcount = NULL; /* Reference count */
void *ret_value; /* Return value */
diff --git a/src/H5Osdspace.c b/src/H5Osdspace.c
index 557a44b..627ea19 100644
--- a/src/H5Osdspace.c
+++ b/src/H5Osdspace.c
@@ -26,7 +26,7 @@
/* PRIVATE PROTOTYPES */
static void *H5O_sdspace_decode(H5F_t *f, hid_t dxpl_id, H5O_t *open_oh,
- unsigned mesg_flags, unsigned *ioflags, const uint8_t *p);
+ unsigned mesg_flags, unsigned *ioflags, size_t p_size, const uint8_t *p);
static herr_t H5O_sdspace_encode(H5F_t *f, uint8_t *p, const void *_mesg);
static void *H5O_sdspace_copy(const void *_mesg, void *_dest);
static size_t H5O_sdspace_size(const H5F_t *f, const void *_mesg);
@@ -110,7 +110,8 @@ H5FL_ARR_EXTERN(hsize_t);
--------------------------------------------------------------------------*/
static void *
H5O_sdspace_decode(H5F_t *f, hid_t H5_ATTR_UNUSED dxpl_id, H5O_t H5_ATTR_UNUSED *open_oh,
- unsigned H5_ATTR_UNUSED mesg_flags, unsigned H5_ATTR_UNUSED *ioflags, const uint8_t *p)
+ unsigned H5_ATTR_UNUSED mesg_flags, unsigned H5_ATTR_UNUSED *ioflags,
+ size_t H5_ATTR_UNUSED p_size, const uint8_t *p)
{
H5S_extent_t *sdim = NULL;/* New extent dimensionality structure */
void *ret_value;
diff --git a/src/H5Oshared.c b/src/H5Oshared.c
index 0d692f9..2475dd5 100644
--- a/src/H5Oshared.c
+++ b/src/H5Oshared.c
@@ -156,7 +156,7 @@ H5O_shared_read(H5F_t *f, hid_t dxpl_id, H5O_t *open_oh, unsigned *ioflags,
HGOTO_ERROR(H5E_OHDR, H5E_CANTLOAD, NULL, "can't read message from fractal heap.")
/* Decode the message */
- if(NULL == (ret_value = (type->decode)(f, dxpl_id, open_oh, 0, ioflags, mesg_ptr)))
+ if(NULL == (ret_value = (type->decode)(f, dxpl_id, open_oh, 0, ioflags, mesg_size, mesg_ptr)))
HGOTO_ERROR(H5E_OHDR, H5E_CANTDECODE, NULL, "can't decode shared message.")
} /* end if */
else {
diff --git a/src/H5Oshared.h b/src/H5Oshared.h
index f71f5f6..e60d7ba 100644
--- a/src/H5Oshared.h
+++ b/src/H5Oshared.h
@@ -47,7 +47,7 @@
*/
static H5_INLINE void *
H5O_SHARED_DECODE(H5F_t *f, hid_t dxpl_id, H5O_t *open_oh, unsigned mesg_flags,
- unsigned *ioflags, const uint8_t *p)
+ unsigned *ioflags, size_t p_size, const uint8_t *p)
{
void *ret_value; /* Return value */
@@ -67,7 +67,7 @@ H5O_SHARED_DECODE(H5F_t *f, hid_t dxpl_id, H5O_t *open_oh, unsigned mesg_flags,
if(mesg_flags & H5O_MSG_FLAG_SHARED) {
/* Retrieve native message info indirectly through shared message */
if(NULL == (ret_value = H5O_shared_decode(f, dxpl_id, open_oh, ioflags, p, H5O_SHARED_TYPE)))
- HGOTO_ERROR(H5E_OHDR, H5E_CANTDECODE, NULL, "unable to decode shared message")
+ HGOTO_ERROR(H5E_OHDR, H5E_CANTDECODE, NULL, "unable to decode shared message")
/* We currently do not support automatically fixing shared messages */
#ifdef H5_STRICT_FORMAT_CHECKS
@@ -79,8 +79,8 @@ H5O_SHARED_DECODE(H5F_t *f, hid_t dxpl_id, H5O_t *open_oh, unsigned mesg_flags,
} /* end if */
else {
/* Decode native message directly */
- if(NULL == (ret_value = H5O_SHARED_DECODE_REAL(f, dxpl_id, open_oh, mesg_flags, ioflags, p)))
- HGOTO_ERROR(H5E_OHDR, H5E_CANTDECODE, NULL, "unable to decode native message")
+ if(NULL == (ret_value = H5O_SHARED_DECODE_REAL(f, dxpl_id, open_oh, mesg_flags, ioflags, p_size, p)))
+ HGOTO_ERROR(H5E_OHDR, H5E_CANTDECODE, NULL, "unable to decode native message")
} /* end else */
done:
diff --git a/src/H5Oshmesg.c b/src/H5Oshmesg.c
index 536f67e..489114a 100644
--- a/src/H5Oshmesg.c
+++ b/src/H5Oshmesg.c
@@ -27,7 +27,7 @@
#include "H5MMprivate.h" /* Memory management */
static void *H5O_shmesg_decode(H5F_t *f, hid_t dxpl_id, H5O_t *open_oh,
- unsigned mesg_flags, unsigned *ioflags, const uint8_t *p);
+ unsigned mesg_flags, unsigned *ioflags, size_t p_size, const uint8_t *p);
static herr_t H5O_shmesg_encode(H5F_t *f, hbool_t disable_shared, uint8_t *p, const void *_mesg);
static void *H5O_shmesg_copy(const void *_mesg, void *_dest);
static size_t H5O_shmesg_size(const H5F_t *f, hbool_t disable_shared, const void *_mesg);
@@ -75,7 +75,8 @@ const H5O_msg_class_t H5O_MSG_SHMESG[1] = {{
*/
static void *
H5O_shmesg_decode(H5F_t *f, hid_t H5_ATTR_UNUSED dxpl_id, H5O_t H5_ATTR_UNUSED *open_oh,
- unsigned H5_ATTR_UNUSED mesg_flags, unsigned H5_ATTR_UNUSED *ioflags, const uint8_t *p)
+ unsigned H5_ATTR_UNUSED mesg_flags, unsigned H5_ATTR_UNUSED *ioflags,
+ size_t H5_ATTR_UNUSED p_size, const uint8_t *p)
{
H5O_shmesg_table_t *mesg; /* Native message */
void *ret_value; /* Return value */
diff --git a/src/H5Ostab.c b/src/H5Ostab.c
index 928307e..cf8c96a 100644
--- a/src/H5Ostab.c
+++ b/src/H5Ostab.c
@@ -35,7 +35,7 @@
/* PRIVATE PROTOTYPES */
static void *H5O_stab_decode(H5F_t *f, hid_t dxpl_id, H5O_t *open_oh,
- unsigned mesg_flags, unsigned *ioflags, const uint8_t *p);
+ unsigned mesg_flags, unsigned *ioflags, size_t p_size, const uint8_t *p);
static herr_t H5O_stab_encode(H5F_t *f, hbool_t disable_shared, uint8_t *p, const void *_mesg);
static void *H5O_stab_copy(const void *_mesg, void *_dest);
static size_t H5O_stab_size(const H5F_t *f, hbool_t disable_shared, const void *_mesg);
@@ -96,7 +96,8 @@ H5FL_DEFINE_STATIC(H5O_stab_t);
*/
static void *
H5O_stab_decode(H5F_t *f, hid_t H5_ATTR_UNUSED dxpl_id, H5O_t H5_ATTR_UNUSED *open_oh,
- unsigned H5_ATTR_UNUSED mesg_flags, unsigned H5_ATTR_UNUSED *ioflags, const uint8_t *p)
+ unsigned H5_ATTR_UNUSED mesg_flags, unsigned H5_ATTR_UNUSED *ioflags,
+ size_t H5_ATTR_UNUSED p_size, const uint8_t *p)
{
H5O_stab_t *stab = NULL;
void *ret_value; /* Return value */
diff --git a/src/H5S.c b/src/H5S.c
index d03d523..50bee52 100644
--- a/src/H5S.c
+++ b/src/H5S.c
@@ -1644,7 +1644,7 @@ H5S_decode(const unsigned char *buf)
/* Decode the extent part of dataspace */
/* (pass mostly bogus file pointer and bogus DXPL) */
- if((extent = (H5S_extent_t *)H5O_msg_decode(f, H5P_DEFAULT, NULL, H5O_SDSPACE_ID, buf))==NULL)
+ if((extent = (H5S_extent_t *)H5O_msg_decode(f, H5P_DEFAULT, NULL, H5O_SDSPACE_ID, extent_size, buf))==NULL)
HGOTO_ERROR(H5E_DATASPACE, H5E_CANTDECODE, NULL, "can't decode object")
buf += extent_size;
diff --git a/src/H5SM.c b/src/H5SM.c
index 080eb7c..b549b59 100644
--- a/src/H5SM.c
+++ b/src/H5SM.c
@@ -69,7 +69,7 @@ static herr_t H5SM_write_mesg(H5F_t *f, hid_t dxpl_id, H5O_t *open_oh,
static herr_t H5SM_decr_ref(void *record, void *op_data, hbool_t *changed);
static herr_t H5SM_delete_from_index(H5F_t *f, hid_t dxpl_id, H5O_t *open_oh,
H5SM_index_header_t *header, const H5O_shared_t * mesg,
- unsigned *cache_flags, void ** /*out*/ encoded_mesg);
+ unsigned *cache_flags, size_t * /*out*/ mesg_size, void ** /*out*/ encoded_mesg);
static herr_t H5SM_type_to_flag(unsigned type_id, unsigned *type_flag);
static herr_t H5SM_read_iter_op(H5O_t *oh, H5O_mesg_t *mesg, unsigned sequence,
unsigned *oh_modified, void *_udata);
@@ -1518,6 +1518,7 @@ H5SM_delete(H5F_t *f, hid_t dxpl_id, H5O_t *open_oh, H5O_shared_t *sh_mesg)
unsigned cache_flags = H5AC__NO_FLAGS_SET;
H5SM_table_cache_ud_t cache_udata; /* User-data for callback */
ssize_t index_num;
+ size_t mesg_size = 0;
void *mesg_buf = NULL;
void *native_mesg = NULL;
unsigned type_id; /* Message type ID to operate on */
@@ -1547,8 +1548,8 @@ H5SM_delete(H5F_t *f, hid_t dxpl_id, H5O_t *open_oh, H5O_shared_t *sh_mesg)
* zero and any file space it uses needs to be freed. mesg_buf holds the
* serialized form of the message.
*/
- if(H5SM_delete_from_index(f, dxpl_id, open_oh, &(table->indexes[index_num]), sh_mesg, &cache_flags, &mesg_buf) < 0)
- HGOTO_ERROR(H5E_SOHM, H5E_CANTDELETE, FAIL, "unable to delete mesage from SOHM index")
+ if(H5SM_delete_from_index(f, dxpl_id, open_oh, &(table->indexes[index_num]), sh_mesg, &cache_flags, &mesg_size, &mesg_buf) < 0)
+ HGOTO_ERROR(H5E_SOHM, H5E_CANTDELETE, FAIL, "unable to delete mesage from SOHM index")
/* Release the master SOHM table */
if(H5AC_unprotect(f, dxpl_id, H5AC_SOHM_TABLE, H5F_SOHM_ADDR(f), table, cache_flags) < 0)
@@ -1560,7 +1561,7 @@ H5SM_delete(H5F_t *f, hid_t dxpl_id, H5O_t *open_oh, H5O_shared_t *sh_mesg)
* master table needs to be unprotected when we do this.
*/
if(mesg_buf) {
- if(NULL == (native_mesg = H5O_msg_decode(f, dxpl_id, open_oh, type_id, (const unsigned char *)mesg_buf)))
+ if(NULL == (native_mesg = H5O_msg_decode(f, dxpl_id, open_oh, type_id, mesg_size, (const unsigned char *)mesg_buf)))
HGOTO_ERROR(H5E_SOHM, H5E_CANTDECODE, FAIL, "can't decode shared message.")
if(H5O_msg_delete(f, dxpl_id, open_oh, type_id, native_mesg) < 0)
@@ -1747,7 +1748,7 @@ H5SM_decr_ref(void *record, void *op_data, hbool_t *changed)
static herr_t
H5SM_delete_from_index(H5F_t *f, hid_t dxpl_id, H5O_t *open_oh,
H5SM_index_header_t *header, const H5O_shared_t *mesg,
- unsigned *cache_flags, void ** /*out*/ encoded_mesg)
+ unsigned *cache_flags, size_t * /*out*/ mesg_size, void ** /*out*/ encoded_mesg)
{
H5SM_list_t *list = NULL;
H5SM_mesg_key_t key;
@@ -1879,6 +1880,7 @@ H5SM_delete_from_index(H5F_t *f, hid_t dxpl_id, H5O_t *open_oh,
/* Return the message's encoding so anything it references can be freed */
*encoded_mesg = encoding_buf;
+ *mesg_size = buf_size;
/* If there are no messages left in the index, delete it */
if(header->num_messages == 0) {
@@ -1920,8 +1922,10 @@ done:
/* Free the message encoding, if we're not returning it in encoded_mesg
* or if there's been an error.
*/
- if(encoding_buf && (NULL == *encoded_mesg || ret_value < 0))
+ if(encoding_buf && (NULL == *encoded_mesg || ret_value < 0)) {
encoding_buf = H5MM_xfree(encoding_buf);
+ *mesg_size = 0;
+ }
FUNC_LEAVE_NOAPI(ret_value)
} /* end H5SM_delete_from_index() */
diff --git a/src/H5T.c b/src/H5T.c
index d705b99..f4c10a5 100644
--- a/src/H5T.c
+++ b/src/H5T.c
@@ -298,8 +298,6 @@ static herr_t H5T_unregister(H5T_pers_t pers, const char *name, H5T_t *src,
static herr_t H5T_register(H5T_pers_t pers, const char *name, H5T_t *src,
H5T_t *dst, H5T_conv_t func, hid_t dxpl_id, hbool_t api_call);
static htri_t H5T_compiler_conv(H5T_t *src, H5T_t *dst);
-static herr_t H5T_encode(H5T_t *obj, unsigned char *buf, size_t *nalloc);
-static H5T_t *H5T_decode(const unsigned char *buf);
static herr_t H5T_set_size(H5T_t *dt, size_t size);
@@ -2801,8 +2799,13 @@ H5Tdecode(const void *buf)
if(buf == NULL)
HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "empty buffer")
- /* Create datatype by decoding buffer */
- if(NULL == (dt = H5T_decode((const unsigned char *)buf)))
+ /* Create datatype by decoding buffer
+ * There is no way to get the size of the buffer, so we pass in
+ * SIZE_MAX and assume the caller knows what they are doing.
+ * Really fixing this will require an H5Tdecode2() call that
+ * takes a size parameter.
+ */
+ if(NULL == (dt = H5T_decode(SIZE_MAX, (const unsigned char *)buf)))
HGOTO_ERROR(H5E_DATATYPE, H5E_CANTDECODE, FAIL, "can't decode object")
/* Register the type and return the ID */
@@ -2834,7 +2837,7 @@ done:
*
*-------------------------------------------------------------------------
*/
-static herr_t
+herr_t
H5T_encode(H5T_t *obj, unsigned char *buf, size_t *nalloc)
{
size_t buf_size; /* Encoded size of datatype */
@@ -2890,8 +2893,8 @@ done:
*
*-------------------------------------------------------------------------
*/
-static H5T_t *
-H5T_decode(const unsigned char *buf)
+H5T_t *
+H5T_decode(size_t buf_size, const unsigned char *buf)
{
H5F_t *f = NULL; /* Fake file structure*/
H5T_t *ret_value = NULL; /* Return value */
@@ -2911,7 +2914,7 @@ H5T_decode(const unsigned char *buf)
HGOTO_ERROR(H5E_DATATYPE, H5E_VERSION, NULL, "unknown version of encoded datatype")
/* Decode the serialized datatype message */
- if(NULL == (ret_value = (H5T_t *)H5O_msg_decode(f, H5AC_ind_dxpl_id, NULL, H5O_DTYPE_ID, buf)))
+ if(NULL == (ret_value = (H5T_t *)H5O_msg_decode(f, H5AC_ind_dxpl_id, NULL, H5O_DTYPE_ID, buf_size, buf)))
HGOTO_ERROR(H5E_DATATYPE, H5E_CANTDECODE, NULL, "can't decode object")
/* Mark datatype as being in memory now */
@@ -5171,6 +5174,11 @@ H5T_set_loc(H5T_t *dt, H5F_t *f, H5T_loc_t loc)
/* Check if the field changed size */
if(old_size != memb_type->shared->size) {
+
+ /* Fail if the old_size is zero */
+ if (0 == old_size)
+ HGOTO_ERROR(H5E_DATATYPE, H5E_BADVALUE, FAIL, "old_size of zero would cause division by zero");
+
/* Adjust the size of the member */
dt->shared->u.compnd.memb[i].size = (dt->shared->u.compnd.memb[i].size*memb_type->shared->size)/old_size;
diff --git a/src/H5Tpkg.h b/src/H5Tpkg.h
index 200fa09..d63b30d 100644
--- a/src/H5Tpkg.h
+++ b/src/H5Tpkg.h
@@ -282,7 +282,7 @@ typedef enum H5T_state_t {
H5T_STATE_OPEN /*named constant, open object header */
} H5T_state_t;
- /* This struct is shared between all occurances of an open named type */
+ /* This struct is shared between all occurrences of an open named type */
typedef struct H5T_shared_t {
hsize_t fo_count; /* number of references to this file object */
H5T_state_t state; /*current state of the type */
diff --git a/src/H5Tprivate.h b/src/H5Tprivate.h
index 81af056..f519141 100644
--- a/src/H5Tprivate.h
+++ b/src/H5Tprivate.h
@@ -112,6 +112,8 @@ H5_DLL H5T_class_t H5T_get_class(const H5T_t *dt, htri_t internal);
H5_DLL htri_t H5T_detect_class(const H5T_t *dt, H5T_class_t cls, hbool_t from_api);
H5_DLL size_t H5T_get_size(const H5T_t *dt);
H5_DLL int H5T_cmp(const H5T_t *dt1, const H5T_t *dt2, hbool_t superset);
+H5_DLL herr_t H5T_encode(H5T_t *obj, unsigned char *buf, size_t *nalloc);
+H5_DLL H5T_t *H5T_decode(size_t buf_size, const unsigned char *buf);
H5_DLL herr_t H5T_debug(const H5T_t *dt, FILE * stream);
H5_DLL struct H5O_loc_t *H5T_oloc(H5T_t *dt);
H5_DLL H5G_name_t *H5T_nameof(H5T_t *dt);
diff --git a/src/H5Z.c b/src/H5Z.c
index 0579c62..a5cf1be 100644
--- a/src/H5Z.c
+++ b/src/H5Z.c
@@ -11,23 +11,23 @@
* help@hdfgroup.org. *
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
-#define H5Z_PACKAGE /*suppress error about including H5Zpkg */
+#define H5Z_PACKAGE /* suppress error about including H5Zpkg */
/* Interface initialization */
-#define H5_INTERFACE_INIT_FUNC H5Z_init_interface
+#define H5_INTERFACE_INIT_FUNC H5Z_init_interface
-#include "H5private.h" /* Generic Functions */
-#include "H5Dprivate.h" /* Dataset functions */
-#include "H5Eprivate.h" /* Error handling */
-#include "H5Fprivate.h" /* File */
-#include "H5Iprivate.h" /* IDs */
-#include "H5MMprivate.h" /* Memory management */
-#include "H5Oprivate.h" /* Object headers */
-#include "H5Pprivate.h" /* Property lists */
-#include "H5PLprivate.h" /* Plugins */
-#include "H5Sprivate.h" /* Dataspace functions */
-#include "H5Zpkg.h" /* Data filters */
+#include "H5private.h" /* Generic Functions */
+#include "H5Dprivate.h" /* Dataset functions */
+#include "H5Eprivate.h" /* Error handling */
+#include "H5Fprivate.h" /* File */
+#include "H5Iprivate.h" /* IDs */
+#include "H5MMprivate.h" /* Memory management */
+#include "H5Oprivate.h" /* Object headers */
+#include "H5Pprivate.h" /* Property lists */
+#include "H5PLprivate.h" /* Plugins */
+#include "H5Sprivate.h" /* Dataspace functions */
+#include "H5Zpkg.h" /* Data filters */
#ifdef H5_HAVE_SZLIB_H
# include "szlib.h"
@@ -37,15 +37,15 @@
#ifdef H5Z_DEBUG
typedef struct H5Z_stats_t {
struct {
- hsize_t total; /*total number of bytes processed */
- hsize_t errors; /*bytes of total attributable to errors */
- H5_timer_t timer; /*execution time including errors */
- } stats[2]; /*0=output, 1=input */
+ hsize_t total; /* total number of bytes processed */
+ hsize_t errors; /* bytes of total attributable to errors */
+ H5_timer_t timer; /* execution time including errors */
+ } stats[2]; /* 0=output, 1=input */
} H5Z_stats_t;
#endif /* H5Z_DEBUG */
typedef struct H5Z_object_t {
- H5Z_filter_t filter_id; /* ID of the filter we're looking for */
+ H5Z_filter_t filter_id; /* ID of the filter we're looking for */
htri_t found; /* Whether we find an object using the filter */
} H5Z_object_t;
@@ -56,11 +56,11 @@ typedef enum {
} H5Z_prelude_type_t;
/* Local variables */
-static size_t H5Z_table_alloc_g = 0;
-static size_t H5Z_table_used_g = 0;
-static H5Z_class2_t *H5Z_table_g = NULL;
+static size_t H5Z_table_alloc_g = 0;
+static size_t H5Z_table_used_g = 0;
+static H5Z_class2_t *H5Z_table_g = NULL;
#ifdef H5Z_DEBUG
-static H5Z_stats_t *H5Z_stat_table_g = NULL;
+static H5Z_stats_t *H5Z_stat_table_g = NULL;
#endif /* H5Z_DEBUG */
/* Local functions */
@@ -71,44 +71,38 @@ static int H5Z__flush_file_cb(void *obj_ptr, hid_t obj_id, void *key);
/*-------------------------------------------------------------------------
- * Function: H5Z_init_interface
+ * Function: H5Z_init_interface
*
- * Purpose: Initializes the data filter layer.
- *
- * Return: Non-negative on success/Negative on failure
- *
- * Programmer: Robb Matzke
- * Thursday, April 16, 1998
- *
- * Modifications:
+ * Purpose: Initializes the data filter layer.
*
+ * Return: Non-negative on success/Negative on failure
*-------------------------------------------------------------------------
*/
static herr_t
H5Z_init_interface (void)
{
- herr_t ret_value=SUCCEED; /* Return value */
+ herr_t ret_value = SUCCEED; /* Return value */
FUNC_ENTER_NOAPI_NOINIT
/* Internal filters */
- if (H5Z_register (H5Z_SHUFFLE)<0)
+ if (H5Z_register (H5Z_SHUFFLE) < 0)
HGOTO_ERROR (H5E_PLINE, H5E_CANTINIT, FAIL, "unable to register shuffle filter")
- if (H5Z_register (H5Z_FLETCHER32)<0)
+ if (H5Z_register (H5Z_FLETCHER32) < 0)
HGOTO_ERROR (H5E_PLINE, H5E_CANTINIT, FAIL, "unable to register fletcher32 filter")
- if (H5Z_register (H5Z_NBIT)<0)
+ if (H5Z_register (H5Z_NBIT) < 0)
HGOTO_ERROR (H5E_PLINE, H5E_CANTINIT, FAIL, "unable to register nbit filter")
- if (H5Z_register (H5Z_SCALEOFFSET)<0)
+ if (H5Z_register (H5Z_SCALEOFFSET) < 0)
HGOTO_ERROR (H5E_PLINE, H5E_CANTINIT, FAIL, "unable to register scaleoffset filter")
/* External filters */
#ifdef H5_HAVE_FILTER_DEFLATE
- if (H5Z_register (H5Z_DEFLATE)<0)
+ if (H5Z_register (H5Z_DEFLATE) < 0)
HGOTO_ERROR (H5E_PLINE, H5E_CANTINIT, FAIL, "unable to register deflate filter")
#endif /* H5_HAVE_FILTER_DEFLATE */
#ifdef H5_HAVE_FILTER_SZIP
H5Z_SZIP->encoder_present = SZ_encoder_enabled();
- if (H5Z_register (H5Z_SZIP)<0)
+ if (H5Z_register (H5Z_SZIP) < 0)
HGOTO_ERROR (H5E_PLINE, H5E_CANTINIT, FAIL, "unable to register szip filter")
#endif /* H5_HAVE_FILTER_SZIP */
@@ -118,84 +112,79 @@ done:
/*-------------------------------------------------------------------------
- * Function: H5Z_term_interface
+ * Function: H5Z_term_interface
*
- * Purpose: Terminate the H5Z layer.
- *
- * Return: void
- *
- * Programmer: Robb Matzke
- * Thursday, April 16, 1998
- *
- * Modifications:
+ * Purpose: Terminate the H5Z layer.
*
+ * Return: void
*-------------------------------------------------------------------------
*/
int
H5Z_term_interface(void)
{
#ifdef H5Z_DEBUG
- size_t i;
- int dir, nprint=0;
- char comment[16], bandwidth[32];
+ size_t i;
+ int dir;
+ int nprint = 0;
+ char comment[16];
+ char bandwidth[32];
#endif
- if(H5_interface_initialize_g) {
+ if (H5_interface_initialize_g) {
#ifdef H5Z_DEBUG
- if (H5DEBUG(Z)) {
- for (i=0; i<H5Z_table_used_g; i++) {
- for (dir=0; dir<2; dir++) {
- if (0==H5Z_stat_table_g[i].stats[dir].total) continue;
-
- if (0==nprint++) {
- /* Print column headers */
- HDfprintf (H5DEBUG(Z), "H5Z: filter statistics "
- "accumulated over life of library:\n");
- HDfprintf (H5DEBUG(Z),
- " %-16s %10s %10s %8s %8s %8s %10s\n",
- "Filter", "Total", "Errors", "User",
- "System", "Elapsed", "Bandwidth");
- HDfprintf (H5DEBUG(Z),
- " %-16s %10s %10s %8s %8s %8s %10s\n",
- "------", "-----", "------", "----",
- "------", "-------", "---------");
- }
-
- /* Truncate the comment to fit in the field */
- HDstrncpy(comment, H5Z_table_g[i].name,
- sizeof comment);
- comment[sizeof(comment)-1] = '\0';
-
- /*
- * Format bandwidth to have four significant digits and
- * units of `B/s', `kB/s', `MB/s', `GB/s', or `TB/s' or
- * the word `Inf' if the elapsed time is zero.
- */
- H5_bandwidth(bandwidth,
- (double)(H5Z_stat_table_g[i].stats[dir].total),
- H5Z_stat_table_g[i].stats[dir].timer.etime);
-
- /* Print the statistics */
- HDfprintf (H5DEBUG(Z),
- " %s%-15s %10Hd %10Hd %8.2f %8.2f %8.2f "
- "%10s\n", dir?"<":">", comment,
- H5Z_stat_table_g[i].stats[dir].total,
- H5Z_stat_table_g[i].stats[dir].errors,
- H5Z_stat_table_g[i].stats[dir].timer.utime,
- H5Z_stat_table_g[i].stats[dir].timer.stime,
- H5Z_stat_table_g[i].stats[dir].timer.etime,
- bandwidth);
- }
- }
- }
+ if (H5DEBUG(Z)) {
+ for (i = 0; i < H5Z_table_used_g; i++) {
+ for (dir = 0; dir < 2; dir++) {
+ if (0 == H5Z_stat_table_g[i].stats[dir].total) continue;
+
+ if (0 == nprint++) {
+ /* Print column headers */
+ HDfprintf (H5DEBUG(Z), "H5Z: filter statistics "
+ "accumulated over life of library:\n");
+ HDfprintf (H5DEBUG(Z),
+ " %-16s %10s %10s %8s %8s %8s %10s\n",
+ "Filter", "Total", "Errors", "User",
+ "System", "Elapsed", "Bandwidth");
+ HDfprintf (H5DEBUG(Z),
+ " %-16s %10s %10s %8s %8s %8s %10s\n",
+ "------", "-----", "------", "----",
+ "------", "-------", "---------");
+ }
+
+ /* Truncate the comment to fit in the field */
+ HDstrncpy (comment, H5Z_table_g[i].name, sizeof comment);
+ comment[sizeof(comment)-1] = '\0';
+
+ /*
+ * Format bandwidth to have four significant digits and
+ * units of `B/s', `kB/s', `MB/s', `GB/s', or `TB/s' or
+ * the word `Inf' if the elapsed time is zero.
+ */
+ H5_bandwidth (bandwidth,
+ (double)(H5Z_stat_table_g[i].stats[dir].total),
+ H5Z_stat_table_g[i].stats[dir].timer.etime);
+
+ /* Print the statistics */
+ HDfprintf (H5DEBUG(Z),
+ " %s%-15s %10Hd %10Hd %8.2f %8.2f %8.2f "
+ "%10s\n", dir?"<":">", comment,
+ H5Z_stat_table_g[i].stats[dir].total,
+ H5Z_stat_table_g[i].stats[dir].errors,
+ H5Z_stat_table_g[i].stats[dir].timer.utime,
+ H5Z_stat_table_g[i].stats[dir].timer.stime,
+ H5Z_stat_table_g[i].stats[dir].timer.etime,
+ bandwidth);
+ }
+ }
+ }
#endif /* H5Z_DEBUG */
- /* Free the table of filters */
- H5Z_table_g = (H5Z_class2_t *)H5MM_xfree(H5Z_table_g);
+ /* Free the table of filters */
+ H5Z_table_g = (H5Z_class2_t *)H5MM_xfree(H5Z_table_g);
#ifdef H5Z_DEBUG
- H5Z_stat_table_g = (H5Z_stats_t *)H5MM_xfree(H5Z_stat_table_g);
+ H5Z_stat_table_g = (H5Z_stats_t *)H5MM_xfree(H5Z_stat_table_g);
#endif /* H5Z_DEBUG */
- H5Z_table_used_g = H5Z_table_alloc_g = 0;
- H5_interface_initialize_g = 0;
+ H5Z_table_used_g = H5Z_table_alloc_g = 0;
+ H5_interface_initialize_g = 0;
} /* end if */
return(0);
@@ -203,34 +192,26 @@ H5Z_term_interface(void)
/*-------------------------------------------------------------------------
- * Function: H5Zregister
- *
- * Purpose: This function registers new filter.
+ * Function: H5Zregister
*
- * Return: Non-negative on success/Negative on failure
- *
- * Programmer: Robb Matzke
- * Thursday, April 16, 1998
- *
- * Modifications:
- * Changed to pass in H5Z_class_t struct
- * Quincey Koziol, April 5, 2003
+ * Purpose: This function registers new filter.
*
+ * Return: Non-negative on success/Negative on failure
*-------------------------------------------------------------------------
*/
herr_t
H5Zregister(const void *cls)
{
const H5Z_class2_t *cls_real = (const H5Z_class2_t *) cls; /* "Real" class pointer */
- H5Z_class2_t cls_new; /* Translated class struct */
- herr_t ret_value=SUCCEED; /* Return value */
+ H5Z_class2_t cls_new; /* Translated class struct */
+ herr_t ret_value = SUCCEED; /* Return value */
FUNC_ENTER_API(FAIL)
H5TRACE1("e", "*x", cls);
/* Check args */
if (cls_real==NULL)
- HGOTO_ERROR (H5E_ARGS, H5E_BADVALUE, FAIL, "invalid filter class")
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "invalid filter class")
/* Check H5Z_class_t version number; this is where a function to convert
* from an outdated version should be called.
@@ -242,7 +223,7 @@ H5Zregister(const void *cls)
* at least 256, there should be no overlap and the version of the struct
* can be determined by the value of the first field.
*/
- if(cls_real->version != H5Z_CLASS_T_VERS) {
+ if (cls_real->version != H5Z_CLASS_T_VERS) {
#ifndef H5_NO_DEPRECATED_SYMBOLS
/* Assume it is an old "H5Z_class1_t" instead */
const H5Z_class1_t *cls_old = (const H5Z_class1_t *) cls;
@@ -266,16 +247,16 @@ H5Zregister(const void *cls)
#endif /* H5_NO_DEPRECATED_SYMBOLS */
} /* end if */
- if (cls_real->id<0 || cls_real->id>H5Z_FILTER_MAX)
- HGOTO_ERROR (H5E_ARGS, H5E_BADVALUE, FAIL, "invalid filter identification number")
- if (cls_real->id<H5Z_FILTER_RESERVED)
- HGOTO_ERROR (H5E_ARGS, H5E_BADVALUE, FAIL, "unable to modify predefined filters")
- if (cls_real->filter==NULL)
- HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "no filter function specified")
+ if (cls_real->id < 0 || cls_real->id > H5Z_FILTER_MAX)
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "invalid filter identification number")
+ if (cls_real->id < H5Z_FILTER_RESERVED)
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "unable to modify predefined filters")
+ if (cls_real->filter == NULL)
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "no filter function specified")
/* Do it */
- if (H5Z_register (cls_real)<0)
- HGOTO_ERROR (H5E_PLINE, H5E_CANTINIT, FAIL, "unable to register filter")
+ if (H5Z_register (cls_real) < 0)
+ HGOTO_ERROR(H5E_PLINE, H5E_CANTINIT, FAIL, "unable to register filter")
done:
FUNC_LEAVE_API(ret_value)
@@ -283,66 +264,61 @@ done:
/*-------------------------------------------------------------------------
- * Function: H5Z_register
+ * Function: H5Z_register
*
- * Purpose: Same as the public version except this one allows filters
- * to be set for predefined method numbers <H5Z_FILTER_RESERVED
- *
- * Return: Non-negative on success/Negative on failure
- *
- * Programmer: Robb Matzke
- * Thursday, April 16, 1998
- *
- * Modifications:
+ * Purpose: Same as the public version except this one allows filters
+ * to be set for predefined method numbers <H5Z_FILTER_RESERVED
*
+ * Return: Non-negative on success
+ * Negative on failure
*-------------------------------------------------------------------------
*/
herr_t
H5Z_register (const H5Z_class2_t *cls)
{
- size_t i;
- herr_t ret_value = SUCCEED; /* Return value */
+ size_t i;
+ herr_t ret_value = SUCCEED; /* Return value */
FUNC_ENTER_NOAPI(FAIL)
- HDassert(cls);
- HDassert(cls->id >= 0 && cls->id <= H5Z_FILTER_MAX);
+ HDassert (cls);
+ HDassert (cls->id >= 0 && cls->id <= H5Z_FILTER_MAX);
/* Is the filter already registered? */
- for(i = 0; i < H5Z_table_used_g; i++)
- if(H5Z_table_g[i].id == cls->id)
+ for (i = 0; i < H5Z_table_used_g; i++)
+ if (H5Z_table_g[i].id == cls->id)
break;
/* Filter not already registered */
- if(i >= H5Z_table_used_g) {
- if(H5Z_table_used_g >= H5Z_table_alloc_g) {
- size_t n = MAX(H5Z_MAX_NFILTERS, 2*H5Z_table_alloc_g);
- H5Z_class2_t *table = (H5Z_class2_t *)H5MM_realloc(H5Z_table_g, n * sizeof(H5Z_class2_t));
+ if (i >= H5Z_table_used_g) {
+ if (H5Z_table_used_g >= H5Z_table_alloc_g) {
+ size_t n = MAX(H5Z_MAX_NFILTERS, 2 * H5Z_table_alloc_g);
+ H5Z_class2_t *table = (H5Z_class2_t *)H5MM_realloc(H5Z_table_g, n * sizeof(H5Z_class2_t));
#ifdef H5Z_DEBUG
- H5Z_stats_t *stat_table = (H5Z_stats_t *)H5MM_realloc(H5Z_stat_table_g, n * sizeof(H5Z_stats_t));
+ H5Z_stats_t *stat_table = (H5Z_stats_t *)H5MM_realloc(H5Z_stat_table_g, n * sizeof(H5Z_stats_t));
#endif /* H5Z_DEBUG */
- if(!table)
- HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "unable to extend filter table")
- H5Z_table_g = table;
+ if (!table)
+ HGOTO_ERROR (H5E_RESOURCE, H5E_NOSPACE, FAIL, "unable to extend filter table")
+ H5Z_table_g = table;
#ifdef H5Z_DEBUG
- if(!stat_table)
- HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "unable to extend filter statistics table")
- H5Z_stat_table_g = stat_table;
+ if (!stat_table)
+ HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "unable to extend filter statistics table")
+ H5Z_stat_table_g = stat_table;
#endif /* H5Z_DEBUG */
- H5Z_table_alloc_g = n;
- } /* end if */
+ H5Z_table_alloc_g = n;
+ } /* end if */
- /* Initialize */
- i = H5Z_table_used_g++;
- HDmemcpy(H5Z_table_g+i, cls, sizeof(H5Z_class2_t));
+ /* Initialize */
+ i = H5Z_table_used_g++;
+ HDmemcpy (H5Z_table_g+i, cls, sizeof(H5Z_class2_t));
#ifdef H5Z_DEBUG
- HDmemset(H5Z_stat_table_g+i, 0, sizeof(H5Z_stats_t));
+ HDmemset (H5Z_stat_table_g+i, 0, sizeof(H5Z_stats_t));
#endif /* H5Z_DEBUG */
} /* end if */
/* Filter already registered */
else {
- /* Replace old contents */
- HDmemcpy(H5Z_table_g+i, cls, sizeof(H5Z_class2_t));
+ /* Replace old contents */
+ HDmemcpy (H5Z_table_g+i, cls, sizeof(H5Z_class2_t));
} /* end else */
done:
@@ -351,34 +327,31 @@ done:
/*-------------------------------------------------------------------------
- * Function: H5Zunregister
- *
- * Purpose: This function unregisters a filter.
- *
- * Return: Non-negative on success/Negative on failure
+ * Function: H5Zunregister
*
- * Programmer: Quincey Koziol
- * Thursday, November 14, 2002
+ * Purpose: This function unregisters a filter.
*
+ * Return: Non-negative on success
+ * Negative on failure
*-------------------------------------------------------------------------
*/
herr_t
H5Zunregister(H5Z_filter_t id)
{
- herr_t ret_value=SUCCEED; /* Return value */
+ herr_t ret_value = SUCCEED; /* Return value */
FUNC_ENTER_API(FAIL)
H5TRACE1("e", "Zf", id);
/* Check args */
- if(id < 0 || id > H5Z_FILTER_MAX)
- HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "invalid filter identification number")
- if(id < H5Z_FILTER_RESERVED)
- HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "unable to modify predefined filters")
+ if (id < 0 || id > H5Z_FILTER_MAX)
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "invalid filter identification number")
+ if (id < H5Z_FILTER_RESERVED)
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "unable to modify predefined filters")
/* Do it */
- if(H5Z_unregister(id) < 0)
- HGOTO_ERROR(H5E_PLINE, H5E_CANTINIT, FAIL, "unable to unregister filter")
+ if (H5Z_unregister(id) < 0)
+ HGOTO_ERROR(H5E_PLINE, H5E_CANTINIT, FAIL, "unable to unregister filter")
done:
FUNC_LEAVE_API(ret_value)
@@ -386,36 +359,33 @@ done:
/*-------------------------------------------------------------------------
- * Function: H5Z_unregister
- *
- * Purpose: Same as the public version except this one allows filters
- * to be unset for predefined method numbers <H5Z_FILTER_RESERVED
- *
- * Return: Non-negative on success/Negative on failure
+ * Function: H5Z_unregister
*
- * Programmer: Quincey Koziol
- * Thursday, November 14, 2002
+ * Purpose: Same as the public version except this one allows filters
+ * to be unset for predefined method numbers <H5Z_FILTER_RESERVED
*
+ * Return: Non-negative on success
+ * Negative on failure
*-------------------------------------------------------------------------
*/
herr_t
H5Z_unregister(H5Z_filter_t filter_id)
{
- size_t filter_index; /* Local index variable for filter */
+ size_t filter_index; /* Local index variable for filter */
H5Z_object_t object;
- herr_t ret_value=SUCCEED; /* Return value */
+ herr_t ret_value = SUCCEED; /* Return value */
FUNC_ENTER_NOAPI(FAIL)
HDassert(filter_id>=0 && filter_id<=H5Z_FILTER_MAX);
/* Is the filter already registered? */
- for (filter_index=0; filter_index<H5Z_table_used_g; filter_index++)
- if (H5Z_table_g[filter_index].id==filter_id)
+ for (filter_index = 0; filter_index < H5Z_table_used_g; filter_index++)
+ if (H5Z_table_g[filter_index].id == filter_id)
break;
/* Fail if filter not found */
- if (filter_index>=H5Z_table_used_g)
+ if (filter_index >= H5Z_table_used_g)
HGOTO_ERROR(H5E_PLINE, H5E_NOTFOUND, FAIL, "filter is not registered")
/* Initialize the structure object for iteration */
@@ -423,28 +393,28 @@ H5Z_unregister(H5Z_filter_t filter_id)
object.found = FALSE;
/* Iterate through all opened datasets, returns a failure if any of them uses the filter */
- if(H5I_iterate(H5I_DATASET, H5Z__check_unregister_dset_cb, &object, FALSE) < 0)
+ if (H5I_iterate(H5I_DATASET, H5Z__check_unregister_dset_cb, &object, FALSE) < 0)
HGOTO_ERROR(H5E_FILE, H5E_BADITER, FAIL, "iteration failed")
- if(object.found)
+ if (object.found)
HGOTO_ERROR(H5E_PLINE, H5E_CANTRELEASE, FAIL, "can't unregister filter because a dataset is still using it")
/* Iterate through all opened groups, returns a failure if any of them uses the filter */
- if(H5I_iterate(H5I_GROUP, H5Z__check_unregister_group_cb, &object, FALSE) < 0)
+ if (H5I_iterate(H5I_GROUP, H5Z__check_unregister_group_cb, &object, FALSE) < 0)
HGOTO_ERROR(H5E_FILE, H5E_BADITER, FAIL, "iteration failed")
- if(object.found)
+ if (object.found)
HGOTO_ERROR(H5E_PLINE, H5E_CANTRELEASE, FAIL, "can't unregister filter because a group is still using it")
/* Iterate through all opened files and flush them */
- if(H5I_iterate(H5I_FILE, H5Z__flush_file_cb, NULL, FALSE) < 0)
+ if (H5I_iterate(H5I_FILE, H5Z__flush_file_cb, NULL, FALSE) < 0)
HGOTO_ERROR(H5E_FILE, H5E_BADITER, FAIL, "iteration failed")
/* Remove filter from table */
/* Don't worry about shrinking table size (for now) */
- HDmemmove(&H5Z_table_g[filter_index],&H5Z_table_g[filter_index+1],sizeof(H5Z_class2_t)*((H5Z_table_used_g-1)-filter_index));
+ HDmemmove (&H5Z_table_g[filter_index], &H5Z_table_g[filter_index+1], sizeof(H5Z_class2_t)*((H5Z_table_used_g-1)-filter_index));
#ifdef H5Z_DEBUG
- HDmemmove(&H5Z_stat_table_g[filter_index],&H5Z_stat_table_g[filter_index+1],sizeof(H5Z_stats_t)*((H5Z_table_used_g-1)-filter_index));
+ HDmemmove (&H5Z_stat_table_g[filter_index], &H5Z_stat_table_g[filter_index+1], sizeof(H5Z_stats_t)*((H5Z_table_used_g-1)-filter_index));
#endif /* H5Z_DEBUG */
H5Z_table_used_g--;
@@ -454,16 +424,12 @@ done:
/*-------------------------------------------------------------------------
- * Function: H5Z__check_unregister
- *
- * Purpose: Check if an object uses the filter to be unregistered.
- *
- * Return: TRUE if the object uses the filter.
- * FALSE if not, NEGATIVE on error.
+ * Function: H5Z__check_unregister
*
- * Programmer: Quincey Koziol
- * 11 May 2013
+ * Purpose: Check if an object uses the filter to be unregistered.
*
+ * Return: TRUE if the object uses the filter.
+ * FALSE if not, NEGATIVE on error.
*-------------------------------------------------------------------------
*/
static htri_t
@@ -475,11 +441,11 @@ H5Z__check_unregister(hid_t ocpl_id, H5Z_filter_t filter_id)
FUNC_ENTER_STATIC
/* Get the plist structure of object creation */
- if(NULL == (plist = H5P_object_verify(ocpl_id, H5P_OBJECT_CREATE)))
+ if (NULL == (plist = H5P_object_verify(ocpl_id, H5P_OBJECT_CREATE)))
HGOTO_ERROR(H5E_PLINE, H5E_BADATOM, FAIL, "can't find object for ID")
/* Check if the object creation property list uses the filter */
- if((ret_value = H5P_filter_in_pline(plist, filter_id)) < 0)
+ if ((ret_value = H5P_filter_in_pline(plist, filter_id)) < 0)
HGOTO_ERROR(H5E_PLINE, H5E_CANTGET, FAIL, "can't check filter in pipeline")
done:
@@ -688,8 +654,8 @@ H5Z_filter_avail(H5Z_filter_t id)
if(H5Z_table_g[i].id == id)
HGOTO_DONE(TRUE)
- if(NULL != (filter_info = (const H5Z_class2_t *)H5PL_load(H5PL_TYPE_FILTER, (int)id))) {
- if(H5Z_register(filter_info) < 0)
+ if (NULL != (filter_info = (const H5Z_class2_t *)H5PL_load(H5PL_TYPE_FILTER, (int)id))) {
+ if (H5Z_register(filter_info) < 0)
HGOTO_ERROR(H5E_PLINE, H5E_CANTINIT, FAIL, "unable to register loaded filter")
HGOTO_DONE(TRUE)
}
diff --git a/src/H5detect.c b/src/H5detect.c
index 2dae228..1780932 100644
--- a/src/H5detect.c
+++ b/src/H5detect.c
@@ -36,8 +36,8 @@ static const char *FileHeader = "\n\
* Livermore National Laboratory.
*
* Detects machine byte order and floating point
- * format and generates a C source file (native.c)
- * to describe those paramters.
+ * format and generates a C source file (H5Tinit.c)
+ * to describe those parameters.
*
* Assumptions: We have an ANSI compiler. We're on a Unix like
* system or configure has detected those Unix
@@ -54,6 +54,16 @@ static const char *FileHeader = "\n\
#include "H5Tpublic.h"
#include "H5Rpublic.h"
+#if defined(__has_attribute)
+#if __has_attribute(no_sanitize)
+#define HDF_NO_UBSAN __attribute__((no_sanitize("undefined")))
+#else
+#define HDF_NO_UBSAN
+#endif
+#else
+#define HDF_NO_UBSAN
+#endif
+
#define MAXDETECT 64
/* The ALIGNMENT test code may generate the SIGBUS, SIGSEGV, or SIGILL signals.
@@ -65,7 +75,7 @@ static const char *FileHeader = "\n\
/* Define H5SETJMP/H5LONGJMP depending on if sigsetjmp/siglongjmp are */
/* supported. */
#if defined(H5_HAVE_SIGSETJMP) && defined(H5_HAVE_SIGLONGJMP)
-/* Always save blocked signals to be restore by siglongjmp. */
+/* Always save blocked signals to be restored by siglongjmp. */
#define H5JMP_BUF sigjmp_buf
#define H5SETJMP(buf) HDsigsetjmp(buf, 1)
#define H5LONGJMP(buf, val) HDsiglongjmp(buf, val)
@@ -1347,7 +1357,7 @@ bit.\n";
*
*-------------------------------------------------------------------------
*/
-static void
+static void HDF_NO_UBSAN
detect_C89_integers(void)
{
DETECT_BYTE(signed char, SCHAR, d_g[nd_g]); nd_g++;
@@ -1375,7 +1385,7 @@ detect_C89_integers(void)
*
*-------------------------------------------------------------------------
*/
-static void
+static void HDF_NO_UBSAN
detect_C89_floats(void)
{
DETECT_F(float, FLOAT, d_g[nd_g]); nd_g++;
@@ -1397,7 +1407,7 @@ detect_C89_floats(void)
*
*-------------------------------------------------------------------------
*/
-static void
+static void HDF_NO_UBSAN
detect_C99_integers8(void)
{
#if H5_SIZEOF_INT8_T>0
@@ -1459,7 +1469,7 @@ detect_C99_integers8(void)
*
*-------------------------------------------------------------------------
*/
-static void
+static void HDF_NO_UBSAN
detect_C99_integers16(void)
{
#if H5_SIZEOF_INT16_T>0
@@ -1497,7 +1507,7 @@ detect_C99_integers16(void)
*
*-------------------------------------------------------------------------
*/
-static void
+static void HDF_NO_UBSAN
detect_C99_integers32(void)
{
#if H5_SIZEOF_INT32_T>0
@@ -1535,7 +1545,7 @@ detect_C99_integers32(void)
*
*-------------------------------------------------------------------------
*/
-static void
+static void HDF_NO_UBSAN
detect_C99_integers64(void)
{
#if H5_SIZEOF_INT64_T>0
@@ -1586,7 +1596,7 @@ detect_C99_integers64(void)
*
*-------------------------------------------------------------------------
*/
-static void
+static void HDF_NO_UBSAN
detect_C99_integers(void)
{
/* break it down to more subroutines so that each module subroutine */
@@ -1612,7 +1622,7 @@ detect_C99_integers(void)
*
*-------------------------------------------------------------------------
*/
-static void
+static void HDF_NO_UBSAN
detect_C99_floats(void)
{
#if H5_SIZEOF_DOUBLE == H5_SIZEOF_LONG_DOUBLE
@@ -1643,7 +1653,7 @@ detect_C99_floats(void)
*
*-------------------------------------------------------------------------
*/
-static void
+static void HDF_NO_UBSAN
detect_alignments(void)
{
/* Detect structure alignment for pointers, hvl_t, hobj_ref_t, hdset_reg_ref_t */
@@ -1662,6 +1672,12 @@ detect_alignments(void)
*/
static int verify_signal_handlers(int signum, void (*handler)(int))
{
+#if defined(__has_feature)
+#if __has_feature(address_sanitizer) || __has_feature(thread_sanitizer)
+ /* Under the address and thread sanitizers, don't raise any signals. */
+ return 0;
+#endif
+#endif
void (*save_handler)(int) = HDsignal(signum, handler);
int i, val;
int ntries=5;
@@ -1725,7 +1741,7 @@ static int verify_signal_handlers(int signum, void (*handler)(int))
*
*-------------------------------------------------------------------------
*/
-int
+int HDF_NO_UBSAN
main(void)
{
diff --git a/src/H5public.h b/src/H5public.h
index ba98cf2..997e871 100644
--- a/src/H5public.h
+++ b/src/H5public.h
@@ -92,10 +92,10 @@ extern "C" {
/* Version numbers */
#define H5_VERS_MAJOR 1 /* For major interface/format changes */
#define H5_VERS_MINOR 8 /* For minor interface/format changes */
-#define H5_VERS_RELEASE 20 /* For tweaks, bug-fixes, or development */
+#define H5_VERS_RELEASE 21 /* For tweaks, bug-fixes, or development */
#define H5_VERS_SUBRELEASE "" /* For pre-releases like snap0 */
/* Empty string for real releases. */
-#define H5_VERS_INFO "HDF5 library version: 1.8.20" /* Full version string */
+#define H5_VERS_INFO "HDF5 library version: 1.8.21" /* Full version string */
#define H5check() H5check_version(H5_VERS_MAJOR,H5_VERS_MINOR, \
H5_VERS_RELEASE)
diff --git a/src/H5system.c b/src/H5system.c
index be21d83..398ffee 100644
--- a/src/H5system.c
+++ b/src/H5system.c
@@ -782,7 +782,7 @@ H5_build_extpath(const char *name, char **extpath /*out*/)
* Unix: does not apply
*/
if(H5_CHECK_ABS_DRIVE(name)) {
- drive = name[0] - 'A' + 1;
+ drive = HDtoupper(name[0]) - 'A' + 1;
retcwd = HDgetdcwd(drive, cwdpath, MAX_PATH_LEN);
HDstrncpy(new_name, &name[2], name_len);
} /* end if */
@@ -876,7 +876,7 @@ H5_combine_path(const char* path1, const char* path2, char **full_name /*out*/)
if(NULL == (*full_name = (char *)H5MM_strdup(path2)))
HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "memory allocation failed")
- } /* end if */
+ } /* end if */
else if(H5_CHECK_ABS_PATH(path2)) {
/* On windows path2 is a path absolute name */
diff --git a/src/Makefile.in b/src/Makefile.in
index f6a7526..b733fb7 100644
--- a/src/Makefile.in
+++ b/src/Makefile.in
@@ -731,25 +731,25 @@ CHECK_CLEANFILES = *.chkexe *.chklog *.clog *.clog2
# After making changes, run bin/reconfigure to update other configure related
# files like Makefile.in.
LT_VERS_INTERFACE = 13
-LT_VERS_REVISION = 1
+LT_VERS_REVISION = 2
LT_VERS_AGE = 3
-LT_CXX_VERS_INTERFACE = 15
+LT_CXX_VERS_INTERFACE = 16
LT_CXX_VERS_REVISION = 0
LT_CXX_VERS_AGE = 0
LT_F_VERS_INTERFACE = 10
-LT_F_VERS_REVISION = 5
+LT_F_VERS_REVISION = 6
LT_F_VERS_AGE = 0
LT_HL_VERS_INTERFACE = 12
-LT_HL_VERS_REVISION = 1
+LT_HL_VERS_REVISION = 2
LT_HL_VERS_AGE = 2
LT_HL_CXX_VERS_INTERFACE = 12
-LT_HL_CXX_VERS_REVISION = 1
+LT_HL_CXX_VERS_REVISION = 2
LT_HL_CXX_VERS_AGE = 1
LT_HL_F_VERS_INTERFACE = 10
-LT_HL_F_VERS_REVISION = 4
+LT_HL_F_VERS_REVISION = 5
LT_HL_F_VERS_AGE = 0
LT_TOOLS_VERS_INTERFACE = 10
-LT_TOOLS_VERS_REVISION = 6
+LT_TOOLS_VERS_REVISION = 7
LT_TOOLS_VERS_AGE = 0
# Our main target, the HDF5 library
@@ -862,6 +862,7 @@ chk_TESTS = $(check_PROGRAMS) $(check_SCRIPTS) $(EXTRA_TEST)
TEST_EXTENSIONS = .sh
SH_LOG_COMPILER = $(SHELL)
AM_SH_LOG_FLAGS =
+REALTIMEOUTPUT = $(realtimeOutput)
TEST_PROG_CHKEXE = $(TEST_PROG:=.chkexe_)
TEST_PROG_PARA_CHKEXE = $(TEST_PROG_PARA:=.chkexe_)
TEST_SCRIPT_CHKSH = $(TEST_SCRIPT:=.chkexe_)
@@ -1726,7 +1727,6 @@ trace: $(libhdf5_la_SOURCES)
esac; \
fi; \
done
-
# lib/progs/tests targets recurse into subdirectories. build-* targets
# build files in this directory.
build-lib: $(LIB)
@@ -1814,28 +1814,62 @@ $(TEST_PROG_CHKEXE) $(TEST_PROG_PARA_CHKEXE) dummy.chkexe_:
if $(top_srcdir)/bin/newer $(@:.chkexe_=.chkexe) $${tname}; then \
echo "No need to test $${tname} again."; \
else \
- echo "============================" > $${log}; \
- if test "X$(FORTRAN_API)" = "Xyes"; then \
- echo "Fortran API: Testing $(HDF5_DRIVER) $${tname} $(TEST_FLAGS)"; \
- echo "Fortran API: $(HDF5_DRIVER) $${tname} $(TEST_FLAGS) Test Log" >> $${log}; \
- elif test "X$(CXX_API)" = "Xyes"; then \
- echo "C++ API: Testing $(HDF5_DRIVER) $${tname} $(TEST_FLAGS)"; \
- echo "C++ API: $(HDF5_DRIVER) $${tname} $(TEST_FLAGS) Test Log" >> $${log};\
- else \
- echo "Testing $(HDF5_DRIVER) $${tname} $(TEST_FLAGS)"; \
- echo "$(HDF5_DRIVER) $${tname} $(TEST_FLAGS) Test Log" >> $${log}; \
- fi; \
- echo "============================" >> $${log}; \
- srcdir="$(srcdir)" \
- $(TIME) $(RUNEXEC) ./$${tname} $(TEST_FLAGS) >> $${log} 2>&1 \
- && touch $(@:.chkexe_=.chkexe) || \
- (test $$HDF5_Make_Ignore && echo "*** Error ignored") || \
- (cat $${log} && false) || exit 1; \
+ if test -n "$(REALTIMEOUTPUT)"; then \
+ echo "============================" | tee $${log}; \
+ else \
+ echo "============================" > $${log}; \
+ fi; \
+ if test "X$(FORTRAN_API)" = "Xyes"; then \
+ echo "Fortran API: Testing $(HDF5_DRIVER) $${tname} $(TEST_FLAGS)"; \
+ if test -n "$(REALTIMEOUTPUT)"; then \
+ echo "Fortran API: $(HDF5_DRIVER) $${tname} $(TEST_FLAGS) Test Log" | tee -a $${log}; \
+ else \
+ echo "Fortran API: $(HDF5_DRIVER) $${tname} $(TEST_FLAGS) Test Log" >> $${log}; \
+ fi; \
+ elif test "X$(CXX_API)" = "Xyes"; then \
+ echo "C++ API: Testing $(HDF5_DRIVER) $${tname} $(TEST_FLAGS)"; \
+ if test -n "$(REALTIMEOUTPUT)"; then \
+ echo "C++ API: $(HDF5_DRIVER) $${tname} $(TEST_FLAGS) Test Log" | tee -a $${log};\
+ else \
+ echo "C++ API: $(HDF5_DRIVER) $${tname} $(TEST_FLAGS) Test Log" >> $${log};\
+ fi; \
+ else \
+ echo "Testing $(HDF5_DRIVER) $${tname} $(TEST_FLAGS)"; \
+ if test -n "$(REALTIMEOUTPUT)"; then \
+ echo "$(HDF5_DRIVER) $${tname} $(TEST_FLAGS) Test Log" | tee -a $${log}; \
+ else \
+ echo "$(HDF5_DRIVER) $${tname} $(TEST_FLAGS) Test Log" >> $${log}; \
+ fi; \
+ fi; \
+ if test -n "$(REALTIMEOUTPUT)"; then \
+ echo "============================" | tee -a $${log}; \
+ else \
+ echo "============================" >> $${log}; \
+ fi; \
+ if test -n "$(REALTIMEOUTPUT)"; then \
+ srcdir="$(srcdir)" \
+ $(TIME) $(RUNEXEC) ./$${tname} $(TEST_FLAGS) | tee -a $${log} 2>&1 \
+ && touch $(@:.chkexe_=.chkexe) || \
+ (test $$HDF5_Make_Ignore && echo "*** Error ignored") || \
+ (cat $${log} && false) || exit 1; \
+ else \
+ srcdir="$(srcdir)" \
+ $(TIME) $(RUNEXEC) ./$${tname} $(TEST_FLAGS) >> $${log} 2>&1 \
+ && touch $(@:.chkexe_=.chkexe) || \
+ (test $$HDF5_Make_Ignore && echo "*** Error ignored") || \
+ (cat $${log} && false) || exit 1; \
+ fi; \
echo "" >> $${log}; \
- echo "Finished testing $${tname} $(TEST_FLAGS)" >> $${log}; \
- echo "============================" >> $${log}; \
- echo "Finished testing $${tname} $(TEST_FLAGS)"; \
- cat $${log}; \
+ if test -n "$(REALTIMEOUTPUT)"; then \
+ echo "Finished testing $${tname} $(TEST_FLAGS)" | tee -a $${log}; \
+ echo "============================" | tee -a $${log}; \
+ else \
+ echo "Finished testing $${tname} $(TEST_FLAGS)" >> $${log}; \
+ echo "============================" >> $${log}; \
+ fi; \
+ if test -z "$(REALTIMEOUTPUT)"; then \
+ cat $${log}; \
+ fi; \
fi; \
fi