From bcaf21187db589d99a413950d9013a41f8b9d38f Mon Sep 17 00:00:00 2001 From: Larry Knox Date: Sun, 22 Nov 2020 22:42:07 -0600 Subject: [PATCH 01/21] Snapshot version 1.12 release 1-3. Update version to 1.12.1-4. --- README.txt | 2 +- c++/src/cpp_doc_config | 2 +- config/cmake/scripts/HDF5config.cmake | 2 +- configure.ac | 2 +- release_docs/RELEASE.txt | 2 +- src/H5public.h | 4 ++-- 6 files changed, 7 insertions(+), 7 deletions(-) diff --git a/README.txt b/README.txt index 6611db81988..a331088705c 100644 --- a/README.txt +++ b/README.txt @@ -1,4 +1,4 @@ -HDF5 version 1.12.1-3 currently under development +HDF5 version 1.12.1-4 currently under development ------------------------------------------------------------------------------ Please refer to the release_docs/INSTALL file for installation instructions. diff --git a/c++/src/cpp_doc_config b/c++/src/cpp_doc_config index 3db683dd71e..089b432989c 100644 --- a/c++/src/cpp_doc_config +++ b/c++/src/cpp_doc_config @@ -38,7 +38,7 @@ PROJECT_NAME = # could be handy for archiving the generated documentation or if some version # control system is used. -PROJECT_NUMBER = "1.12.1-3, currently under development" +PROJECT_NUMBER = "1.12.1-4, currently under development" # Using the PROJECT_BRIEF tag one can provide an optional one line description # for a project that appears at the top of each page and should give viewer a diff --git a/config/cmake/scripts/HDF5config.cmake b/config/cmake/scripts/HDF5config.cmake index 13c3f6ee4ac..3bbb4cd5676 100644 --- a/config/cmake/scripts/HDF5config.cmake +++ b/config/cmake/scripts/HDF5config.cmake @@ -38,7 +38,7 @@ cmake_minimum_required (VERSION 3.12) ############################################################################## set (CTEST_SOURCE_VERSION "1.12.1") -set (CTEST_SOURCE_VERSEXT "-3") +set (CTEST_SOURCE_VERSEXT "-4") ############################################################################## # handle input parameters to script. diff --git a/configure.ac b/configure.ac index 98802237676..abeb48c3e76 100644 --- a/configure.ac +++ b/configure.ac @@ -24,7 +24,7 @@ AC_PREREQ([2.69]) ## NOTE: Do not forget to change the version number here when we do a ## release!!! ## -AC_INIT([HDF5], [1.12.1-3], [help@hdfgroup.org]) +AC_INIT([HDF5], [1.12.1-4], [help@hdfgroup.org]) AC_CONFIG_SRCDIR([src/H5.c]) AC_CONFIG_HEADERS([src/H5config.h]) diff --git a/release_docs/RELEASE.txt b/release_docs/RELEASE.txt index de4d378fabf..3617de61df1 100644 --- a/release_docs/RELEASE.txt +++ b/release_docs/RELEASE.txt @@ -1,4 +1,4 @@ -HDF5 version 1.12.1-3 currently under development +HDF5 version 1.12.1-4 currently under development ================================================================================ diff --git a/src/H5public.h b/src/H5public.h index 29a78c68f08..9202be404cf 100644 --- a/src/H5public.h +++ b/src/H5public.h @@ -95,9 +95,9 @@ extern "C" { #define H5_VERS_MAJOR 1 /* For major interface/format changes */ #define H5_VERS_MINOR 12 /* For minor interface/format changes */ #define H5_VERS_RELEASE 1 /* For tweaks, bug-fixes, or development */ -#define H5_VERS_SUBRELEASE "3" /* For pre-releases like snap0 */ +#define H5_VERS_SUBRELEASE "4" /* For pre-releases like snap0 */ /* Empty string for real releases. */ -#define H5_VERS_INFO "HDF5 library version: 1.12.1-3" /* Full version string */ +#define H5_VERS_INFO "HDF5 library version: 1.12.1-4" /* Full version string */ #define H5check() H5check_version(H5_VERS_MAJOR, H5_VERS_MINOR, H5_VERS_RELEASE) From 7a78fd16d42bcfe843c21173c5f2a4b0c41392ac Mon Sep 17 00:00:00 2001 From: Gerd Heber Date: Wed, 18 Nov 2020 09:06:01 -0600 Subject: [PATCH 02/21] First cut of the H5 public API documentation. (#80) * First cut of the H5 public API documentation. * Added H5Z "bonus track." * Applied Quincey's patch. * Added the missing patches from Quincey's original patch. * H5PL (complete) and basic H5VL API documentation. * Added H5I API docs. * Added H5L API docs. * First installment from Elena's H5T batch. * Second installment of Elena's H5T batch. * Final installment of Elena's H5T batch. --- doxygen/aliases | 16 +- src/H5.c | 36 + src/H5Imodule.h | 5 + src/H5Ipublic.h | 615 ++++++++- src/H5Lmodule.h | 8 + src/H5Lpublic.h | 2035 ++++++++++++++++++++++++++++-- src/H5PLmodule.h | 5 + src/H5PLpublic.h | 176 ++- src/H5Tmodule.h | 76 ++ src/H5Tpublic.h | 2896 +++++++++++++++++++++++++++++++++++++++---- src/H5VLconnector.h | 91 +- src/H5VLmodule.h | 15 + src/H5VLnative.h | 6 + src/H5VLpublic.h | 287 ++++- src/H5Zmodule.h | 67 + src/H5Zpublic.h | 661 ++++++++-- src/H5checksum.c | 3 +- src/H5dbg.c | 1 + src/H5err.txt | 1 + src/H5module.h | 34 + src/H5private.h | 2 - src/H5public.h | 459 ++++++- src/H5system.c | 3 +- src/H5timer.c | 1 + src/H5trace.c | 1 + 25 files changed, 6933 insertions(+), 567 deletions(-) create mode 100644 src/H5module.h diff --git a/doxygen/aliases b/doxygen/aliases index aa22bd461fc..c10c3e8c42a 100644 --- a/doxygen/aliases +++ b/doxygen/aliases @@ -60,8 +60,8 @@ ALIASES += space_id{1}="\param[in] \1 Dataspace identifier" # Dataypes ################################################################################ -ALIASES += dtype_id="\param[in] dtype_id Datatype identifier" -ALIASES += dtype_id{1}="\param[in] \1 Datatype identifier" +ALIASES += type_id="\param[in] type_id Datatype identifier" +ALIASES += type_id{1}="\param[in] \1 Datatype identifier" ALIASES += file_type_id{1}="\param[in] \1 Datatype (in-file) identifier" ALIASES += mem_type_id{1}="\param[in] \1 Datatype (in-memory) identifier" @@ -133,15 +133,21 @@ ALIASES += lapl_id{1}="\param[in] \1 Link access property list identifier" ALIASES += lcpl_id="\param[in] lcpl_id Link creation property list identifier" ALIASES += lcpl_id{1}="\param[in] \1 Link creation property list identifier" -ALIASES += vipl_id="\param[in] vipl_id VOL initialization property list identifier" -ALIASES += vipl_id{1}="\param[in] \1 vipl_id VOL initialization property list identifier" - ALIASES += plist_id="\param[in] plist_id Property list identifier" ALIASES += plist_id{1}="\param[in] \1 Property list identifier" ALIASES += plistcls_id="\param[in] plistcls_id Property list class identifier" ALIASES += plistcls_id{1}="\param[in] \1 Property list class identifier" +ALIASES += tapl_id="\param[in] tapl_id Datatype access property list identifier" +ALIASES += tapl_id{1}="\param[in] \1 Datatype access property list identifier" + +ALIASES += tcpl_id="\param[in] tcpl_id Datatype creation property list identifier" +ALIASES += tcpl_id{1}="\param[in] \1 Datatype creation property list identifier" + +ALIASES += vipl_id="\param[in] vipl_id VOL initialization property list identifier" +ALIASES += vipl_id{1}="\param[in] \1 vipl_id VOL initialization property list identifier" + ################################################################################ # Objects ################################################################################ diff --git a/src/H5.c b/src/H5.c index e7514b408ec..7efd4f0678a 100644 --- a/src/H5.c +++ b/src/H5.c @@ -14,6 +14,7 @@ /****************/ /* Module Setup */ /****************/ +#include "H5module.h" /* This source code file is part of the H5 module */ /***********/ /* Headers */ @@ -55,6 +56,9 @@ static int H5__mpi_delete_cb(MPI_Comm comm, int keyval, void *attr_val, int *fla /* Package Variables */ /*********************/ +/* Package initialization variable */ +hbool_t H5_PKG_INIT_VAR = FALSE; + /*****************************/ /* Library Private Variables */ /*****************************/ @@ -84,6 +88,33 @@ H5_debug_t H5_debug_g; /* debugging info */ /* Local Variables */ /*******************/ +/*-------------------------------------------------------------------------- +NAME + H5__init_package -- Initialize interface-specific information +USAGE + herr_t H5__init_package() +RETURNS + Non-negative on success/Negative on failure +DESCRIPTION + Initializes any interface-specific data or routines. +--------------------------------------------------------------------------*/ +herr_t +H5__init_package(void) +{ + herr_t ret_value = SUCCEED; /* Return value */ + + FUNC_ENTER_NOAPI_NOINIT + + /* Run the library initialization routine, if it hasn't already ran */ + if (!H5_INIT_GLOBAL && !H5_TERM_GLOBAL) { \ + if (H5_init_library() < 0) + HGOTO_ERROR(H5E_LIB, H5E_CANTINIT, FAIL, "unable to initialize library") + } /* end if */ + +done: + FUNC_LEAVE_NOAPI(ret_value) +} /* end H5__init_package() */ + /*-------------------------------------------------------------------------- * NAME * H5_init_library -- Initialize library-global information @@ -103,6 +134,11 @@ H5_init_library(void) { herr_t ret_value = SUCCEED; + /* Set the 'library initialized' flag as early as possible, to avoid + * possible re-entrancy. + */ + H5_INIT_GLOBAL = TRUE; \ + FUNC_ENTER_NOAPI(FAIL) #ifdef H5_HAVE_PARALLEL diff --git a/src/H5Imodule.h b/src/H5Imodule.h index 768fa81f963..7fc6af0f253 100644 --- a/src/H5Imodule.h +++ b/src/H5Imodule.h @@ -29,4 +29,9 @@ #define H5_MY_PKG_ERR H5E_ATOM #define H5_MY_PKG_INIT NO +/**\defgroup H5I H5I + * \brief Identifier Interface + * \todo Describe concisely what the functions in this module are about. + */ + #endif /* _H5Imodule_H */ diff --git a/src/H5Ipublic.h b/src/H5Ipublic.h index 2b8a97860b9..f981d2e2f23 100644 --- a/src/H5Ipublic.h +++ b/src/H5Ipublic.h @@ -21,34 +21,36 @@ /* Public headers needed by this file */ #include "H5public.h" -/* - * Library type values. Start with `1' instead of `0' because it makes the - * tracing output look better when hid_t values are large numbers. Change the - * TYPE_BITS in H5I.c if the MAXID gets larger than 32 (an assertion will - * fail otherwise). +/** + * Library type values. + * \internal Library type values. Start with `1' instead of `0' because it + * makes the tracing output look better when hid_t values are large + * numbers. Change the TYPE_BITS in H5I.c if the MAXID gets larger + * than 32 (an assertion will fail otherwise). * - * When adding types here, add a section to the 'misc19' test in test/tmisc.c - * to verify that the H5I{inc|dec|get}_ref() routines work correctly with it. + * When adding types here, add a section to the 'misc19' test in + * test/tmisc.c to verify that the H5I{inc|dec|get}_ref() routines + * work correctly with it. \endinternal */ typedef enum H5I_type_t { - H5I_UNINIT = (-2), /* uninitialized type */ - H5I_BADID = (-1), /* invalid Type */ - H5I_FILE = 1, /* type ID for File objects */ - H5I_GROUP, /* type ID for Group objects */ - H5I_DATATYPE, /* type ID for Datatype objects */ - H5I_DATASPACE, /* type ID for Dataspace objects */ - H5I_DATASET, /* type ID for Dataset objects */ - H5I_MAP, /* type ID for Map objects */ - H5I_ATTR, /* type ID for Attribute objects */ - H5I_VFL, /* type ID for virtual file layer */ - H5I_VOL, /* type ID for virtual object layer */ - H5I_GENPROP_CLS, /* type ID for generic property list classes */ - H5I_GENPROP_LST, /* type ID for generic property lists */ - H5I_ERROR_CLASS, /* type ID for error classes */ - H5I_ERROR_MSG, /* type ID for error messages */ - H5I_ERROR_STACK, /* type ID for error stacks */ - H5I_SPACE_SEL_ITER, /* type ID for dataspace selection iterator */ - H5I_NTYPES /* number of library types, MUST BE LAST! */ + H5I_UNINIT = (-2), /**< uninitialized type */ + H5I_BADID = (-1), /**< invalid Type */ + H5I_FILE = 1, /**< type ID for File objects */ + H5I_GROUP, /**< type ID for Group objects */ + H5I_DATATYPE, /**< type ID for Datatype objects */ + H5I_DATASPACE, /**< type ID for Dataspace objects */ + H5I_DATASET, /**< type ID for Dataset objects */ + H5I_MAP, /**< type ID for Map objects */ + H5I_ATTR, /**< type ID for Attribute objects */ + H5I_VFL, /**< type ID for virtual file layer */ + H5I_VOL, /**< type ID for virtual object layer */ + H5I_GENPROP_CLS, /**< type ID for generic property list classes */ + H5I_GENPROP_LST, /**< type ID for generic property lists */ + H5I_ERROR_CLASS, /**< type ID for error classes */ + H5I_ERROR_MSG, /**< type ID for error messages */ + H5I_ERROR_STACK, /**< type ID for error stacks */ + H5I_SPACE_SEL_ITER, /**< type ID for dataspace selection iterator */ + H5I_NTYPES /**< number of library types, MUST BE LAST! */ } H5I_type_t; /* Type of IDs to return to users */ @@ -59,13 +61,18 @@ typedef int64_t hid_t; #define PRIXHID PRIX64 #define PRIoHID PRIo64 -#define H5_SIZEOF_HID_T H5_SIZEOF_INT64_T +/** + * The size of identifiers + */ +#define H5_SIZEOF_HID_T H5_SIZEOF_INT64_T -/* An invalid object ID. This is also negative for error return. */ -#define H5I_INVALID_HID (-1) +/** + * An invalid object ID. This is also negative for error return. + */ +#define H5I_INVALID_HID (-1) -/* - * Function for freeing objects. This function will be called with an object +/** + * A function for freeing objects. This function will be called with an object * ID type number and a pointer to the object. The function should free the * object and return non-negative to indicate that the object * can be removed from the ID type. If the function returns negative @@ -73,11 +80,19 @@ typedef int64_t hid_t; */ typedef herr_t (*H5I_free_t)(void *); -/* Type of the function to compare objects & keys */ +/** + * The type of a function to compare objects & keys + */ +//! [H5I_search_func_t_snip] typedef int (*H5I_search_func_t)(void *obj, hid_t id, void *key); +//! [H5I_search_func_t_snip] -/* Type of the H5Iiterate callback function */ +/** + * The type of H5Iiterate() callback functions + */ +//! [H5I_iterate_func_t_snip] typedef herr_t (*H5I_iterate_func_t)(hid_t id, void *udata); +//! [H5I_iterate_func_t_snip] #ifdef __cplusplus extern "C" { @@ -85,25 +100,561 @@ extern "C" { /* Public API functions */ +/** + * \ingroup H5I + * + * \brief Registers an object under a type and returns an ID for it + * + * \param[in] type The identifier of the type of the new ID + * \param[in] object Pointer to object for which a new ID is created + * + * \return \hid_t{object} + * + * \details H5Iregister() allocates and returns a new ID for an object. + * + * \details The \p type parameter is the identifier for the ID type to which + * this new ID will belong. This identifier must have been created by + * a call to H5Iregister_type(). + * + * \details The \p object parameter is a pointer to the memory which the new ID + * will be a reference to. This pointer will be stored by the library + * and returned via a call to H5Iobject_verify(). + * + */ H5_DLL hid_t H5Iregister(H5I_type_t type, const void *object); +/** + * \ingroup H5I + * + * \brief Returns the object referenced by an ID + * + * \param[in] id ID to be dereferenced + * \param[in] id_type The identifier type + + * + * \return Pointer to the object referenced by \p id on success, NULL on failure. + * + * \details H5Iobject_verify() returns a pointer to the memory referenced by id + * after verifying that \p id is of type \p id_type. This function is + * analogous to dereferencing a pointer in C with type checking. + * + * \note H5Iobject_verify() does not change the ID it is called on in any way + * (as opposed to H5Iremove_verify(), which removes the ID from its + * type’s hash table). + * + * \see H5Iregister() + * + */ H5_DLL void * H5Iobject_verify(hid_t id, H5I_type_t id_type); +/** + * \ingroup H5I + * + * \brief Removes an ID from its type + * + * \param[in] id The ID to be removed from its type + * \param[in] id_type The identifier type + + * + * \return Returns a pointer to the memory referred to by \p id on success, + * NULL on failure. + * + * \details H5Iremove_verify() first ensures that \p id belongs to \p id_type. + * If so, it removes \p id from its type and returns the pointer + * to the memory it referred to. This pointer is the same pointer that + * was placed in storage by H5Iregister(). If id does not belong to + * \p id_type, then NULL is returned. + * + * The \p id parameter is the ID which is to be removed from its type. + * + * The \p type parameter is the identifier for the ID type which \p id + * is supposed to belong to. This identifier must have been created by + * a call to H5Iregister_type(). + * + * \note This function does NOT deallocate the memory that \p id refers to. + * The pointer returned by H5Iregister() must be deallocated by the user + * to avoid memory leaks. + * + */ H5_DLL void * H5Iremove_verify(hid_t id, H5I_type_t id_type); +/** + * \ingroup H5I + * + * \brief Retrieves the type of an object + * + * \obj_id{id} + * + * \return Returns the object type if successful; otherwise #H5I_BADID. + * + * \details H5Iget_type() retrieves the type of the object identified by + * \p id. + * + * Valid types returned by the function are: + * \id_types + * + * If no valid type can be determined or the identifier submitted is + * invalid, the function returns #H5I_BADID. + * + * This function is of particular use in determining the type of + * object closing function (H5Dclose(), H5Gclose(), etc.) to call + * after a call to H5Rdereference(). + * + * \note Note that this function returns only the type of object that \p id + * would identify if it were valid; it does not determine whether \p id + * is valid identifier. Validity can be determined with a call to + * H5Iis_valid(). + * + */ H5_DLL H5I_type_t H5Iget_type(hid_t id); +/** + * \ingroup H5I + * + * \brief Retrieves an identifier for the file containing the specified object + * + * \obj_id{id} + * + * \return \hid_t{file} + * + * \details H5Iget_file_id() returns the identifier of the file associated with + * the object referenced by \p id. + * + * \note Note that the HDF5 library permits an application to close a file + * while objects within the file remain open. If the file containing the + * object \p id is still open, H5Iget_file_id() will retrieve the + * existing file identifier. If there is no existing file identifier for + * the file, i.e., the file has been closed, H5Iget_file_id() will reopen + * the file and return a new file identifier. In either case, the file + * identifier must eventually be released using H5Fclose(). + * + * \since 1.6.3 + * + */ H5_DLL hid_t H5Iget_file_id(hid_t id); +/** + * \ingroup H5I + * + * \brief Retrieves a name of an object based on the object identifier + * + * \obj_id{id} + * \param[out] name A buffer for thename associated with the identifier + * \param[in] size The size of the \p name buffer; usually the size of + * the name in bytes plus 1 for a NULL terminator + * + * \return ssize_t + * + * \details H5Iget_name() retrieves a name for the object identified by \p id. + * + * \details Up to size characters of the name are returned in \p name; + * additional characters, if any, are not returned to the user + * application. + * + * If the length of the name, which determines the required value of + * \p size, is unknown, a preliminary H5Iget_name() call can be made. + * The return value of this call will be the size in bytes of the + * object name. That value, plus 1 for a NULL terminator, is then + * assigned to size for a second H5Iget_name() call, which will + * retrieve the actual name. + * + * If the object identified by \p id is an attribute, as determined + * via H5Iget_type(), H5Iget_name() retrieves the name of the object + * to which that attribute is attached. To retrieve the name of the + * attribute itself, use H5Aget_name(). + * + * If there is no name associated with the object identifier or if the + * name is NULL, H5Iget_name() returns 0 (zero). + * + * \note Note that an object in an HDF5 file may have multiple paths if there + * are multiple links pointing to it. This function may return any one of + * these paths. When possible, H5Iget_name() returns the path with which + * the object was opened. + * + * \since 1.6.0 + * + */ H5_DLL ssize_t H5Iget_name(hid_t id, char *name /*out*/, size_t size); +/** + * \ingroup H5I + * + * \brief Increments the reference count for an object + * + * \obj_id{id} + * + * \return Returns a non-negative reference count of the object ID after + * incrementing it if successful; otherwise a negative value is + * returned. + * + * \details H5Iinc_ref() increments the reference count of the object + * identified by \p id. + * + * The reference count for an object ID is attached to the information + * about an object in memory and has no relation to the number of + * links to an object on disk. + * + * The reference count for a newly created object will be 1. Reference + * counts for objects may be explicitly modified with this function or + * with H5Idec_ref(). When an object ID's reference count reaches + * zero, the object will be closed. Calling an object ID's \c close + * function decrements the reference count for the ID which normally + * closes the object, but if the reference count for the ID has been + * incremented with this function, the object will only be closed when + * the reference count reaches zero with further calls to H5Idec_ref() + * or the object ID's \c close function. + * + * If the object ID was created by a collective parallel call (such as + * H5Dcreate(), H5Gopen(), etc.), the reference count should be + * modified by all the processes which have copies of the ID. + * Generally this means that group, dataset, attribute, file and named + * datatype IDs should be modified by all the processes and that all + * other types of IDs are safe to modify by individual processes. + * + * This function is of particular value when an application is + * maintaining multiple copies of an object ID. The object ID can be + * incremented when a copy is made. Each copy of the ID can then be + * safely closed or decremented and the HDF5 object will be closed + * when the reference count for that that object drops to zero. + * + * \since 1.6.2 + * + */ H5_DLL int H5Iinc_ref(hid_t id); +/** + * \ingroup H5I + * + * \brief Decrements the reference count for an object + * + * \obj_id{id} + * + * \return Returns a non-negative reference count of the object ID after + * decrementing it, if successful; otherwise a negative value is + * returned. + * + * \details H5Idec_ref() decrements the reference count of the object + * identified by \p id. + * + * The reference count for an object ID is attached to the information + * about an object in memory and has no relation to the number of + * links to an object on disk. + * + * The reference count for a newly created object will be 1. Reference + * counts for objects may be explicitly modified with this function or + * with H5Iinc_ref(). When an object identifier’s reference count + * reaches zero, the object will be closed. Calling an object + * identifier’s \c close function decrements the reference count for + * the identifier which normally closes the object, but if the + * reference count for the identifier has been incremented with + * H5Iinc_ref(), the object will only be closed when the reference + * count reaches zero with further calls to this function or the + * object identifier’s \c close function. + * + * If the object ID was created by a collective parallel call (such as + * H5Dcreate(), H5Gopen(), etc.), the reference count should be + * modified by all the processes which have copies of the ID. + * Generally this means that group, dataset, attribute, file and named + * datatype IDs should be modified by all the processes and that all + * other types of IDs are safe to modify by individual processes. + * + * This function is of particular value when an application is + * maintaining multiple copies of an object ID. The object ID can be + * incremented when a copy is made. Each copy of the ID can then be + * safely closed or decremented and the HDF5 object will be closed + * when the reference count for that that object drops to zero. + * + * \since 1.6.2 + * + */ H5_DLL int H5Idec_ref(hid_t id); +/** + * \ingroup H5I + * + * \brief Retrieves the reference count for an object + * + * \obj_id{id} + * + * \return Returns a non-negative current reference count of the object + * identifier if successful; otherwise a negative value is returned. + * + * \details H5Iget_ref() retrieves the reference count of the object identified + * by \p id. + * + * The reference count for an object identifier is attached to the + * information about an object in memory and has no relation to the + * number of links to an object on disk. + * + * The function H5Iis_valid() is used to determine whether a specific + * object identifier is valid. + * + * \since 1.6.2 + * + */ H5_DLL int H5Iget_ref(hid_t id); +/** + * \ingroup H5I + * + * \brief Creates and returns a new ID type + * + * \param[in] hash_size Minimum hash table size (in entries) used to store IDs + * for the new type + * \param[in] reserved Number of reserved IDs for the new type + * \param[in] free_func Function used to deallocate space for a single ID + * + * \return Returns the type identifier on success, negative on failure. + * + * \details H5Iregister_type() allocates space for a new ID type and returns an + * identifier for it. + * + * The \p hash_size parameter indicates the minimum size of the hash + * table used to store IDs in the new type. + * + * The \p reserved parameter indicates the number of IDs in this new + * type to be reserved. Reserved IDs are valid IDs which are not + * associated with any storage within the library. + * + * The \p free_func parameter is a function pointer to a function + * which returns an herr_t and accepts a \c void*. The purpose of this + * function is to deallocate memory for a single ID. It will be called + * by H5Iclear_type() and H5Idestroy_type() on each ID. This function + * is NOT called by H5Iremove_verify(). The \c void* will be the same + * pointer which was passed in to the H5Iregister() function. The \p + * free_func function should return 0 on success and -1 on failure. + * + */ H5_DLL H5I_type_t H5Iregister_type(size_t hash_size, unsigned reserved, H5I_free_t free_func); +/** + * \ingroup H5I + * + * \brief Deletes all identifiers of the given type + * + * \param[in] type Identifier of identifier type which is to be cleared of identifiers + * \param[in] force Whether or not to force deletion of all identifiers + * + * \return \herr_t + * + * \details H5Iclear_type() deletes all identifiers of the type identified by + * the argument \p type. + * + * The identifier type's free function is first called on all of these + * identifiers to free their memory, then they are removed from the + * type. + * + * If the \p force flag is set to false, only those identifiers whose + * reference counts are equal to 1 will be deleted, and all other + * identifiers will be entirely unchanged. If the force flag is true, + * all identifiers of this type will be deleted. + * + */ H5_DLL herr_t H5Iclear_type(H5I_type_t type, hbool_t force); +/** + * \ingroup H5I + * + * \brief Removes an identifier type and all identifiers within that type + * + * \param[in] type Identifier of identifier type which is to be destroyed + * + * \return \herr_t + * + * \details H5Idestroy_type deletes an entire identifier type \p type. All + * identifiers of this type are destroyed and no new identifiers of + * this type can be registered. + * + * The type’s free function is called on all of the identifiers which + * are deleted by this function, freeing their memory. In addition, + * all memory used by this type’s hash table is freed. + * + * Since the H5I_type_t values of destroyed identifier types are + * reused when new types are registered, it is a good idea to set the + * variable holding the value of the destroyed type to #H5I_UNINIT. + * + */ H5_DLL herr_t H5Idestroy_type(H5I_type_t type); +/** + * \ingroup H5I + * + * \brief Increments the reference count on an ID type + * + * \param[in] type The identifier of the type whose reference count is to be incremented + * + * \return Returns the current reference count on success, negative on failure. + * + * \details H5Iinc_type_ref() increments the reference count on an ID type. The + * reference count is used by the library to indicate when an ID type + * can be destroyed. + * + * The type parameter is the identifier for the ID type whose + * reference count is to be incremented. This identifier must have + * been created by a call to H5Iregister_type(). + * + */ H5_DLL int H5Iinc_type_ref(H5I_type_t type); +/** + * \ingroup H5I + * + * \brief Decrements the reference count on an identifier type + * + * \param[in] type The identifier of the type whose reference count is to be decremented + * + * \return Returns the current reference count on success, negative on failure. + * + * \details H5Idec_type_ref() decrements the reference count on an identifier + * type. The reference count is used by the library to indicate when + * an identifier type can be destroyed. If the reference count reaches + * zero, this function will destroy it. + * + * The type parameter is the identifier for the identifier type whose + * reference count is to be decremented. This identifier must have + * been created by a call to H5Iregister_type(). + * + */ H5_DLL int H5Idec_type_ref(H5I_type_t type); +/** + * \ingroup H5I + * + * \brief Retrieves the reference count on an ID type + * + * \param[in] type The identifier of the type whose reference count is to be retieved + * + * \return Returns the current reference count on success, negative on failure. + * + * \details H5Iget_type_ref() retrieves the reference count on an ID type. The + * reference count is used by the library to indicate when an ID type + * can be destroyed. + * + * The type parameter is the identifier for the ID type whose + * reference count is to be retrieved. This identifier must have been + * created by a call to H5Iregister_type(). + * + */ H5_DLL int H5Iget_type_ref(H5I_type_t type); +/** + * \ingroup H5I + * + * \brief Finds the memory referred to by an ID within the given ID type such + * that some criterion is satisfied + * + * \param[in] type The identifier of the type to be searched + * \param[in] func The function defining the search criteria + * \param[in] key A key for the search function + * + * \return Returns a pointer to the object which satisfies the search function + * on success, NULL on failure. + * + * \details H5Isearch() searches through a given ID type to find an object that + * satisfies the criteria defined by \p func. If such an object is + * found, the pointer to the memory containing this object is + * returned. Otherwise, NULL is returned. To do this, \p func is + * called on every member of type \p type. The first member to satisfy + * \p func is returned. + * + * The \p type parameter is the identifier for the ID type which is to + * be searched. This identifier must have been created by a call to + * H5Iregister_type(). + * + * The parameter \p func is a function pointer to a function which + * takes three parameters. The first parameter is a \c void* and will + * be a pointer to the object to be tested. This is the same object + * that was placed in storage using H5Iregister(). The second + * parameter is a hid_t and is the ID of the object to be tested. The + * last parameter is a \c void*. This is the \p key parameter and can + * be used however the user finds helpful, or it can be ignored if it + * is not needed. \p func returns 0 if the object it is testing does + * not pass its criteria. A non-zero value should be returned if the + * object does pass its criteria. H5I_search_func_t is defined in + * H5Ipublic.h and is shown below. + * \snippet this H5I_search_func_t_snip + * The \p key parameter will be passed to the search function as a + * parameter. It can be used to further define the search at run-time. + * + */ H5_DLL void * H5Isearch(H5I_type_t type, H5I_search_func_t func, void *key); +/** + * \ingroup H5I + * + * \brief Calls a callback for each member of the identifier type specified + * + * \param[in] type The identifier type + * \param[in] op The callback function + * \param[in,out] op_data The data for the callback function + * + * \return The last value returned by \p op + * + * \details H5Iiterate() calls the callback function \p op for each member of + * the identifier type \p type. The callback function type for \p op, + * H5I_iterate_func_t, is defined in H5Ipublic.h as: + * \snippet this H5I_iterate_func_t_snip + * \p op takes as parameters the identifier and a pass through of + * \p op_data, and returns an herr_t. + * + * A positive return from op will cause the iteration to stop and + * H5Iiterate() will return the value returned by \p op. A negative + * return from \p op will cause the iteration to stop and H5Iiterate() + * will return failure. A zero return from \p op will allow iteration + * to continue, as long as there are other identifiers remaining in + * type. + * + * \since 1.12.0 + * + */ H5_DLL herr_t H5Iiterate(H5I_type_t type, H5I_iterate_func_t op, void *op_data); +/** + * \ingroup H5I + * + * \brief Returns the number of identifiers in a given identifier type + * + * \param[in] type The identifier type + * \param[out] num_members Number of identifiers of the specified identifier type + * + * \return \herr_t + * + * \details H5Inmembers() returns the number of identifiers of the identifier + * type specified in \p type. + * + * The number of identifiers is returned in \p num_members. If no + * identifiers of this type have been registered, the type does not + * exist, or it has been destroyed, \p num_members is returned with + * the value 0. + * + */ H5_DLL herr_t H5Inmembers(H5I_type_t type, hsize_t *num_members); +/** + * \ingroup H5I + * + * \brief Determines whether an identifier type is registered + * + * \param[in] type Identifier type + * + * \return \htri_t + * + * \details H5Itype_exists() determines whether the given identifier type, + * \p type, is registered with the library. + * + * \since 1.8.0 + * + */ H5_DLL htri_t H5Itype_exists(H5I_type_t type); +/** + * \ingroup H5I + * + * \brief Determines whether an identifier is valid + * + * \obj_id{id} + * + * \return \htri_t + * + * \details H5Iis_valid() determines whether the identifier \p id is valid. + * + * \details Valid identifiers are those that have been obtained by an + * application and can still be used to access the original target. + * Examples of invalid identifiers include: + * \li Out of range values: negative, for example + * \li Previously-valid identifiers that have been released: + * for example, a dataset identifier for which the dataset has + * been closed + * + * H5Iis_valid() can be used with any type of identifier: object + * identifier, property list identifier, attribute identifier, error + * message identifier, etc. When necessary, a call to H5Iget_type() + * can determine the type of the object that \p id identifies. + * + * \since 1.8.3 + * + */ H5_DLL htri_t H5Iis_valid(hid_t id); #ifdef __cplusplus diff --git a/src/H5Lmodule.h b/src/H5Lmodule.h index 043a8651305..ad737d6b26b 100644 --- a/src/H5Lmodule.h +++ b/src/H5Lmodule.h @@ -29,4 +29,12 @@ #define H5_MY_PKG_ERR H5E_LINK #define H5_MY_PKG_INIT YES +/**\defgroup H5L H5L + * \brief Link Interface + * \todo Describe concisely what the functions in this module are about. + * + * \defgroup TRAV Link Traversal + * \ingroup H5L + */ + #endif /* _H5Lmodule_H */ diff --git a/src/H5Lpublic.h b/src/H5Lpublic.h index be920c224fe..14975bc81b2 100644 --- a/src/H5Lpublic.h +++ b/src/H5Lpublic.h @@ -34,14 +34,21 @@ /* Public Macros */ /*****************/ -/* Maximum length of a link's name */ -/* (encoded in a 32-bit unsigned integer) */ +/** + * \brief Maximum length of a link's name + * + * The maximum length of a link's name is encoded in a 32-bit unsigned integer. + */ #define H5L_MAX_LINK_NAME_LEN ((uint32_t)(-1)) /* (4GB - 1) */ -/* Macro to indicate operation occurs on same location */ +/** + * \brief Macro to indicate operation occurs on same location + */ #define H5L_SAME_LOC (hid_t)0 -/* Current version of the H5L_class_t struct */ +/** + * \brief Current version of the H5L_class_t struct + */ #define H5L_LINK_CLASS_T_VERS 1 #ifdef __cplusplus @@ -52,91 +59,128 @@ extern "C" { /* Public Typedefs */ /*******************/ -/* Link class types. - * Values less than 64 are reserved for the HDF5 library's internal use. - * Values 64 to 255 are for "user-defined" link class types; these types are - * defined by HDF5 but their behavior can be overridden by users. - * Users who want to create new classes of links should contact the HDF5 - * development team at help@hdfgroup.org. - * These values can never change because they appear in HDF5 files. +/** + * \brief Link class types. + * + * Values less than 64 are reserved for the HDF5 library's internal use. Values + * 64 to 255 are for "user-defined" link class types; these types are defined + * by HDF5 but their behavior can be overridden by users. Users who want to + * create new classes of links should contact the HDF5 development team at + * mailto:help@hdfgroup.org. These values can never change because they appear + * in HDF5 files. */ typedef enum { - H5L_TYPE_ERROR = (-1), /* Invalid link type id */ - H5L_TYPE_HARD = 0, /* Hard link id */ - H5L_TYPE_SOFT = 1, /* Soft link id */ - H5L_TYPE_EXTERNAL = 64, /* External link id */ - H5L_TYPE_MAX = 255 /* Maximum link type id */ + H5L_TYPE_ERROR = (-1), /**< Invalid link type id */ + H5L_TYPE_HARD = 0, /**< Hard link id */ + H5L_TYPE_SOFT = 1, /**< Soft link id */ + H5L_TYPE_EXTERNAL = 64, /**< External link id */ + H5L_TYPE_MAX = 255 /**< Maximum link type id */ } H5L_type_t; -/* Maximum value link value for "built-in" link types */ +/** + * \brief Maximum value link value for "built-in" link types + */ #define H5L_TYPE_BUILTIN_MAX H5L_TYPE_SOFT -/* Link ids at or above this value are "user-defined" link types. */ -#define H5L_TYPE_UD_MIN H5L_TYPE_EXTERNAL +/** + * \brief Link ids at or above this value are "user-defined" link types. + */ +#define H5L_TYPE_UD_MIN H5L_TYPE_EXTERNAL +/** + * \brief Maximum link id value for "user-defined" link types. + */ +#define H5L_TYPE_UD_MAX H5L_TYPE_MAX -/* Information struct for link (for H5Lget_info2/H5Lget_info_by_idx2) - * H5O_token_t version used in VOL layer and future public API calls +/** + * \brief Information struct for links */ +//! [H5L_info2_t_snip] typedef struct { - H5L_type_t type; /* Type of link */ - hbool_t corder_valid; /* Indicate if creation order is valid */ - int64_t corder; /* Creation order */ - H5T_cset_t cset; /* Character set of link name */ + H5L_type_t type; /**< Type of link */ + hbool_t corder_valid; /**< Indicate if creation order is valid */ + int64_t corder; /**< Creation order */ + H5T_cset_t cset; /**< Character set of link name */ union { - H5O_token_t token; /* Token of location that hard link points to */ - size_t val_size; /* Size of a soft link or UD link value */ + H5O_token_t token; /**< Token of location that hard link points to */ + size_t val_size; /**< Size of a soft link or user-defined link value */ } u; } H5L_info2_t; +//! [H5L_info2_t_snip] /* The H5L_class_t struct can be used to override the behavior of a * "user-defined" link class. Users should populate the struct with callback * functions defined below. */ /* Callback prototypes for user-defined links */ -/* Link creation callback */ -typedef herr_t (*H5L_create_func_t)(const char *link_name, hid_t loc_group, const void *lnkdata, - size_t lnkdata_size, hid_t lcpl_id); - -/* Callback for when the link is moved */ -typedef herr_t (*H5L_move_func_t)(const char *new_name, hid_t new_loc, const void *lnkdata, - size_t lnkdata_size); - -/* Callback for when the link is copied */ -typedef herr_t (*H5L_copy_func_t)(const char *new_name, hid_t new_loc, const void *lnkdata, - size_t lnkdata_size); - -/* Callback during link traversal */ -typedef hid_t (*H5L_traverse_func_t)(const char *link_name, hid_t cur_group, const void *lnkdata, - size_t lnkdata_size, hid_t lapl_id, hid_t dxpl_id); - -/* Callback for when the link is deleted */ -typedef herr_t (*H5L_delete_func_t)(const char *link_name, hid_t file, const void *lnkdata, - size_t lnkdata_size); - -/* Callback for querying the link */ -/* Returns the size of the buffer needed */ -typedef ssize_t (*H5L_query_func_t)(const char *link_name, const void *lnkdata, size_t lnkdata_size, - void *buf /*out*/, size_t buf_size); +/** + * \brief Link creation callback + */ +typedef herr_t (*H5L_create_func_t)(const char *link_name, hid_t loc_group, + const void *lnkdata, size_t lnkdata_size, hid_t lcpl_id); +/** + * \brief Callback for link move + */ +typedef herr_t (*H5L_move_func_t)(const char *new_name, hid_t new_loc, + const void *lnkdata, size_t lnkdata_size); +/** + * \brief Callback for link copy + */ +typedef herr_t (*H5L_copy_func_t)(const char *new_name, hid_t new_loc, + const void *lnkdata, size_t lnkdata_size); +/** + * \brief Callback during link traversal + */ +typedef hid_t (*H5L_traverse_func_t)(const char *link_name, hid_t cur_group, + const void *lnkdata, size_t lnkdata_size, hid_t lapl_id, hid_t dxpl_id); +/** + * \brief Callback for link deletion + */ +typedef herr_t (*H5L_delete_func_t)(const char *link_name, hid_t file, + const void *lnkdata, size_t lnkdata_size); +/** + * \brief Callback for querying the link. + * + * Returns the size of the buffer needed. + */ +typedef ssize_t (*H5L_query_func_t)(const char *link_name, const void *lnkdata, + size_t lnkdata_size, void *buf /*out*/, size_t buf_size); +/** + * \brief Link prototype + * + * The H5L_class_t struct can be used to override the behavior of a + * "user-defined" link class. Users should populate the struct with callback + * functions defined elsewhere. + */ +//! [H5L_class_t_snip] typedef struct { - int version; /* Version number of this struct */ - H5L_type_t id; /* Link type ID */ - const char * comment; /* Comment for debugging */ - H5L_create_func_t create_func; /* Callback during link creation */ - H5L_move_func_t move_func; /* Callback after moving link */ - H5L_copy_func_t copy_func; /* Callback after copying link */ - H5L_traverse_func_t trav_func; /* Callback during link traversal */ - H5L_delete_func_t del_func; /* Callback for link deletion */ - H5L_query_func_t query_func; /* Callback for queries */ + int version; /**< Version number of this struct */ + H5L_type_t id; /**< Link type ID */ + const char *comment; /**< Comment for debugging */ + H5L_create_func_t create_func; /**< Callback during link creation */ + H5L_move_func_t move_func; /**< Callback after moving link */ + H5L_copy_func_t copy_func; /**< Callback after copying link */ + H5L_traverse_func_t trav_func; /**< Callback during link traversal */ + H5L_delete_func_t del_func; /**< Callback for link deletion */ + H5L_query_func_t query_func; /**< Callback for queries */ } H5L_class_t; +//! [H5L_class_t_snip] -/* Prototype for H5Literate2/H5Literate_by_name2() operator - * H5O_token_t version used in VOL layer and future public API calls +/** + * \brief Prototype for H5Literate2(), H5Literate_by_name2() operator + * + * The H5O_token_t version is used in the VOL layer and future public API calls. */ -typedef herr_t (*H5L_iterate2_t)(hid_t group, const char *name, const H5L_info2_t *info, void *op_data); +//! [H5L_iterate2_t_snip] +typedef herr_t (*H5L_iterate2_t)(hid_t group, const char *name, const H5L_info2_t *info, + void *op_data); +//! [H5L_iterate2_t_snip] -/* Callback for external link traversal */ -typedef herr_t (*H5L_elink_traverse_t)(const char *parent_file_name, const char *parent_group_name, - const char *child_file_name, const char *child_object_name, - unsigned *acc_flags, hid_t fapl_id, void *op_data); +/** + * \brief Callback for external link traversal + */ +typedef herr_t (*H5L_elink_traverse_t)(const char *parent_file_name, + const char *parent_group_name, const char *child_file_name, + const char *child_object_name, unsigned *acc_flags, hid_t fapl_id, + void *op_data); /********************/ /* Public Variables */ @@ -145,49 +189,1409 @@ typedef herr_t (*H5L_elink_traverse_t)(const char *parent_file_name, const char /*********************/ /* Public Prototypes */ /*********************/ +/** + * \ingroup H5L + * + * \brief Moves a link within an HDF5 file + * + * \fgdta_loc_id{src_loc} + * \param[in] src_name Original link name + * \fgdta_loc_id{dst_loc} + * \param[in] dst_name New link name + * \lcpl_id + * \lapl_id + * + * \return \herr_t + * + * \todo We need to get the location ID story straight! + * + * \details H5Lmove() moves a link within an HDF5 file. The original link, + * \p src_name, is removed from \p src_loc and the new link, + * \p dst_name, is inserted at dst_loc. This change is + * accomplished as an atomic operation. + * + * \p src_loc and \p src_name identify the original link. + * \p src_loc is the original location identifier; \p src_name is + * the path to the link and is interpreted relative to \p src_loc. + * + * \p dst_loc and \p dst_name identify the new link. \p dst_loc is + * either a file or group identifier; \p dst_name is the path to + * the link and is interpreted relative to \p dst_loc. + * + * \p lcpl_id and \p lapl_id are the link creation and link access + * property lists, respectively, associated with the new link, + * \p dst_name. + * + * Through these property lists, several properties are available to + * govern the behavior of H5Lmove(). The property controlling creation + * of missing intermediate groups is set in the link creation property + * list with H5Pset_create_intermediate_group(); H5Lmove() ignores any + * other properties in the link creation property list. Properties + * controlling character encoding, link traversals, and external link + * prefixes are set in the link access property list with + * H5Pset_char_encoding(), H5Pset_nlinks(), and H5Pset_elink_prefix(), + * respectively. + * + * \note Note that H5Lmove() does not modify the value of the link; the new + * link points to the same object as the original link pointed to. + * Furthermore, if the object pointed to by the original link was already + * open with a valid object identifier, that identifier will remain valid + * after the call to H5Lmove(). + * + * \attention Exercise care in moving links as it is possible to render data in + * a file inaccessible with H5Lmove(). If the link being moved is on + * the only path leading to an HDF5 object, that object may become + * permanently inaccessible in the file. + * + * \since 1.8.0 + * + *------------------------------------------------------------------------- + */ H5_DLL herr_t H5Lmove(hid_t src_loc, const char *src_name, hid_t dst_loc, const char *dst_name, hid_t lcpl_id, hid_t lapl_id); +/** + * \ingroup H5L + * + * \brief 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. + * + * \fgdt_loc_id{src_loc} + * \param[in] src_name Name of the link to be copied + * \fgdt_loc_id{dst_loc} + * \param[in] dst_name Name to be assigned to the new copy + * \lcpl_id + * \lapl_id + * \return \herr_t + * + * \details H5Lcopy() copies the link specified by \p src_name from the location + * specified by \p src_loc_id to the location specified by + * \p dst_loc_id. The new copy of the link is created with the name + * \p dst_name. + * + * If \p dst_loc_id is a file identifier, \p dst_name will be + * interpreted relative to that file’s root group. + * + * The new link is created with the creation and access property lists + * specified by \p lcpl_id and \p lapl_id. The interpretation of + * \p lcpl_id is limited in the manner described in the next paragraph. + * + * H5Lcopy() retains the creation time and the target of the original + * link. However, since the link may be renamed, the character + * encoding is that specified in \p lcpl_id rather than that of the + * original link. Other link creation properties are ignored. + * + * If the link is a soft link, also known as a symbolic link, its + * target is interpreted relative to the location of the copy. + * + * Several properties are available to govern the behavior of + * H5Lcopy(). These properties are set in the link creation and access + * property lists, \p lcpl_id and \p lapl_id, respectively. The + * property controlling creation of missing intermediate groups is set + * in the link creation property list with + * H5Pset_create_intermediate_group(); this function ignores any + * other properties in the link creation property list. Properties + * controlling character encoding, link traversals, and external link + * prefixes are set in the link access property list with + * H5Pset_char_encoding(), H5Pset_nlinks(), and + * H5Pset_elink_prefix(). + * + * \note H5Lcopy() does not affect the object that the link points to. + * + * \attention H5Lcopy() cannot copy hard links across files as a hard link is + * not valid without a target object; to copy objects from one file + * to another, see H5Ocopy(). + * + * \see H5Ocopy() + * + * \since 1.8.0 + * + */ H5_DLL herr_t H5Lcopy(hid_t src_loc, const char *src_name, hid_t dst_loc, const char *dst_name, hid_t lcpl_id, hid_t lapl_id); +/** + * \ingroup H5L + * + * \brief Creates a hard link to an object + * + * \fgdta_loc_id{cur_loc} + * \param[in] cur_name Name of the target object, which must already exist + * \fgdta_loc_id{dst_loc} + * \param[in] dst_name The name of the new link + * \lcpl_id + * \lapl_id + * + * \return \herr_t + * + * \todo We need to get the location ID story straight! + * + * \details H5Lcreate_hard() creates a new hard link to a pre-existing object + * in an HDF5 file. + * + * \p cur_loc and \p cur_name specify the location + * and name, respectively, of the target object, i.e., the object that + * the new hard link points to. \p dst_loc and \p dst_name specify the + * location and name, respectively, of the new hard link. + * + * \p cur_name and \p dst_name are interpreted relative to \p cur_loc + * and \p dst_loc, respectively. If \p cur_loc and \p dst_loc are the + * same location, the HDF5 macro #H5L_SAME_LOC can be used for either + * parameter (but not both). + * + * \p lcpl_id and \p lapl_id are the link creation and access property + * lists associated with the new link. + * + * \note Hard and soft links are for use only if the target object is in the + * current file. If the desired target object is in a different file from + * the new link, an external link may be created with + * H5Lcreate_external(). + * + * \note The HDF5 library keeps a count of all hard links pointing to an + * object; if the hard link count reaches zero (0), the object will be + * deleted from the file. Creating new hard links to an object will + * prevent it from being deleted if other links are removed. The + * library maintains no similar count for soft links and they can dangle. + * + * \note The new link may be one of many that point to that object. + * + * \since 1.8.0 + * + */ H5_DLL herr_t H5Lcreate_hard(hid_t cur_loc, const char *cur_name, hid_t dst_loc, const char *dst_name, hid_t lcpl_id, hid_t lapl_id); +/** + * \ingroup H5L + * + * \brief Creates a soft link + * + * \param[in] link_target An HDF5 path name + * \fgdta_loc_id{link_loc_id} + * \param[in] link_name The name of the new link + * \lcpl_id + * \lapl_id + * + * \return \herr_t + * + * \todo We need to get the location ID story straight! + * + * \details H5Lcreate_soft() creates a new soft link to an object in an HDF5 + * file. + * + * \p link_target specifies the HDF5 path name the soft link contains. + * \p link_target can be an arbitrary HDF5 path name and is + * interpreted only at lookup time. This path may be absolute in the + * file or relative to \p link_loc_id. + * + * \p link_loc_id and \p link_name specify the location and name, + * respectively, of the new soft link. \p link_name is interpreted + * relative to \p link_loc_id and must contain only the name of the soft + * link; \p link_name may not contain any additional path elements. + * + * If \p link_loc_id is a group identifier, the object pointed to by + * \p link_name will be accessed as a member of that group. If + * \p link_loc_id is a file identifier, the object will be accessed as a + * member of the file's root group. + * + * \p lcpl_id and \p lapl_id are the link creation and access property + * lists associated with the new link. + * + * For instance, if target_path is \c ./foo, \p link_loc_id specifies + * \c ./x/y/bar, and the name of the new link is \c new_link, then a + * subsequent request for \c ./x/y/bar/new_link will return same the + * object as would be found at \c ./foo. + * + * \note H5Lcreate_soft() is for use only if the target object is in the + * current file. If the desired target object is in a different file from + * the new link, use H5Lcreate_external() to create an external link. + * + * \note Soft links and external links are also known as symbolic links as they + * use a name to point to an object; hard links employ an object’s + * address in the file. + * + * \note Unlike hard links, a soft link in an HDF5 file is allowed to dangle, + * meaning that the target object need not exist at the time that the + * link is created. + * + * \note The HDF5 library does not keep a count of soft links as it does of + * hard links. + * + * \note The new link may be one of many that point to that object. + * + * \see H5Lcreate_hard(), H5Lcreate_external() + * + * \since 1.8.0 + * + + */ H5_DLL 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); +/** + * \ingroup H5L + * + * \brief Removes a link from a group + * + * \fgdta_loc_id + * \param[in] name Name of the link to delete + * \lapl_id + * + * \return \herr_t + * + * \todo We need to get the location ID story straight! + * + * \details H5Ldelete() removes the link specified by \p name from the location + * \p loc_id. + * + * If the link being removed is a hard link, H5Ldelete() also + * decrements the link count for the object to which name points. + * Unless there is a duplicate hard link in that group, this action + * removes the object to which name points from the group that + * previously contained it. + * + * Object headers keep track of how many hard links refer to an + * object; when the hard link count, also referred to as the reference + * count, reaches zero, the object can be removed from the file. The + * file space associated will then be released, i.e., identified in + * memory as freespace. Objects which are open are not removed until + * all identifiers to the object are closed. + * + * \attention Exercise caution in the use of H5Ldelete(); if the link being + * removed is on the only path leading to an HDF5 object, that + * object may become permanently inaccessible in the file. + * + * \see H5Lcreate_hard(), H5Lcreate_soft(), H5Lcreate_external() + * + * \since 1.8.0 + * + */ H5_DLL herr_t H5Ldelete(hid_t loc_id, const char *name, hid_t lapl_id); +/** + * \ingroup H5L + * + * \brief Removes the \Emph{n}-th link in a group + * + * \fgdta_loc_id + * \param[in] group_name Name of subject group + * \param[in] idx_type Index or field which determines the order + * \param[in] order Order within field or index + * \param[in] n Link for which to retrieve information + * \lapl_id + * + * \return \herr_t + * + * \todo We need to get the location ID story straight! + * + * \details H5Ldelete_by_idx() removes the \Emph{n}-th link in a group + * according to the specified order, \p order, in the specified index, + * \p index. + * + * If \p loc_id specifies the group in which the link resides, + * \p group_name can be a dot (\c .). + * + * \see H5Ldelete() + * + * \since 1.8.0 + * + */ H5_DLL 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); +/** + * \ingroup H5L + * + * \brief Returns the value of a link + * + * \fgdta_loc_id + * \param[in] name Link name + * \param[out] buf The buffer to hold the link value + * \param[in] size Maximum number of bytes of link value to be returned + * \lapl_id + * + * \return \herr_t + * + * \todo We need to get the location ID story straight! + * + * \details H5Lget_val() returns tha value of link \p name. For smbolic links, + * this is the path to which the link points, including the null + * terminator. For external and user-defined links, it is the link + * buffer. + * + * \p size is the size of \p buf and should be the size of the link + * value being returned. This size value can be determined through a + * call to H5Lget_info(); it is returned in the \c val_size field of + * the \ref H5L_info_t \c struct. + * + * If \p size is smaller than the size of the returned value, then the + * string stored in \p buf will be truncated to \p size bytes. For + * soft links, this means that the value will not be null terminated. + * + * In the case of external links, the target file and object names are + * extracted from \p buf by calling H5Lunpack_elink_val(). + * + * The link class of link \p name can be determined with a call to + * H5Lget_info(). + * + * \p lapl_id specifies the link access property list associated with + * the link \p name. In the general case, when default link access + * properties are acceptable, this can be passed in as #H5P_DEFAULT. An + * example of a situation that requires a non-default link access + * property list is when the link is an external link; an external + * link may require that a link prefix be set in a link access + * property list (see H5Pset_elink_prefix()). + * + * This function should be used only after H5Lget_info() has been + * called to verify that \p name is a symbolic link. This can be + * deteremined from the \c link_type field of the \ref H5L_info_t + * \c struct. + * + * \note This function will fail if called on a hard link. + * + * \see H5Lget_val_by_idx() + * + * \since 1.8.0 + * + */ H5_DLL herr_t H5Lget_val(hid_t loc_id, const char *name, void *buf /*out*/, size_t size, hid_t lapl_id); +/** + * \ingroup H5L + * + * \brief Retrieves value of the \Emph{n}-th link in a group, according to the order within an index + * + * \fgdta_loc_id + * \param[in] group_name Group name + * \param[in] idx_type Type of index + * \param[in] order Order within field or index + * \param[in] n Link position for which to retrieve information + * \param[out] buf The buffer to hold the link value + * \param[in] size Maximum number of bytes of link value to be returned + * \lapl_id + * + * \return \herr_t + * + * \todo We need to get the location ID story straight! + * + * \details H5Lget_val_by_idx() retrieves the value of the \Emph{n}-th link in + * a group, according to the specified order, \p order, within an + * index, \p index. + * + * For soft links, the value is an HDF5 path name. + * + * For external links, this is a compound value containing file and + * path name information; to use this external link information, it + * must first be decoded with H5Lunpack_elink_val() + * + * For user-defined links, this value will be described in the + * definition of the user-defined link type. + * + * \p loc_id specifies the location identifier of the group specified + * by \p group_name. + * + * \p group_name specifies the group in which the link exists. If + * \p loc_id already specifies the group in which the link exists, + * \p group_name must be a dot (\c .). + * + * The size in bytes of link_val is specified in \p size. The size + * value can be determined through a call to H5Lget_info_by_idx(); it + * is returned in the \c val_size field of the \ref H5L_info_t + * \c struct. If + * size is smaller than the size of the returned value, then the + * string stored in link_val will be truncated to size bytes. For soft + * links, this means that the value will not be null terminated. + * + * If the type of the link is unknown or uncertain, H5Lget_val_by_idx() + * should be called only after the type has been determined via a call + * to H5Lget_info_by_idx(). + * + * \note This function will fail if called on a hard link. + * + * \see H5Lget_val() + * + * \since 1.8.0 + * + */ H5_DLL herr_t 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); +/** + * \ingroup H5L + * + * \brief Determines whether a link with the specified name exists in a group + * + * \fgdta_loc_id + * \param[in] name Link name + * \lapl_id + * + * \return \herr_t + * + * \todo We need to get the location ID story straight! + * + * \details H5Lexists() allows an application to determine whether the link \p + * name exists in the location specified by \p loc_id. The link may be + * of any type; only the presence of a link with that name is checked. + * + * Note that H5Lexists() verifies only that the target link exists. If + * name includes either a relative path or an absolute path to the + * target link, intermediate steps along the path must be verified + * before the existence of the target link can be safely checked. If + * the path is not verified and an intermediate element of the path + * does not exist, H5Lexists() will fail. The example in the next + * paragraph illustrates one step-by-step method for verifying the + * existence of a link with a relative or absolute path. + * + * \Bold{Example:} Use the following steps to verify the existence of + * the link \c datasetD in the \c group group1/group2/softlink_to_group3/, + * where \c group1 is a member of the group specified by \c loc_id: + * + * 1. First use H5Lexists() to verify that \c group1 exists. + * 2. If \c group1 exists, use H5Lexists() again, this time with name + * set to \c group1/group2, to verify that \c group2 exists. + * 3. If \c group2 exists, use H5Lexists() with name set to + * \c group1/group2/softlink_to_group3 to verify that + * \c softlink_to_group3 exists. + * 4. If \c softlink_to_group3 exists, you can now safely use + * H5Lexists() with \c name set to + * \c group1/group2/softlink_to_group3/datasetD to verify that the + * target link, \c datasetD, exists. + * + * If the link to be verified is specified with an absolute path, the + * same approach should be used, but starting with the first link in + * the file’s root group. For instance, if \c datasetD were in + * \c /group1/group2/softlink_to_group3, the first call to H5Lexists() + * would have name set to \c /group1. + * + * Note that this is an outline and does not include all necessary + * details. Depending on circumstances, for example, you may need to + * verify that an intermediate link points to a group and that a soft + * link points to an existing target. + * + * \note The behavior of H5Lexists() was changed in the 1.10 release in the + * case where the root group, \c "/", is the name of the link. This + * change is described below: + *
    + *
  1. Let \c file denote a valid HDF5 file identifier, and let \c lapl + * denote a valid link access property list identifier. A call to + * H5Lexists() with arguments \c file, \c "/", and \c lapl + * returns a positive value; in other words, + * \Code{H5Lexists(file, "/", lapl)} returns a positive value. + * In HDF5 version 1.8.16, this function returns 0.
  2. + *
  3. Let \c root denote a valid HDF5 group identifier that refers to the + * root group of an HDF5 file, and let \c lapl denote a valid link + * access property list identifier. A call to H5Lexists() with + * arguments c root, \c "/", and \c lapl returns a positive value; + * in other words, \Code{H5Lexists(root, "/", lapl)} returns a postive + * value. In HDF5 version 1.8.16, this function returns 0.
  4. + *
+ * Note that the function accepts link names and path names. This is + * potentially misleading to callers, and we plan to separate the + * functionality for link names and path names in a future release. + * + * \attention H5Lexists() checks the existence of only the final element in a + * relative or absolute path; it does not check any other path + * elements. The function will therefore fail when both of the + * following conditions exist: + * - \c name is not local to the group specified by \c loc_id or, + * if \c loc_id is something other than a group identifier, \c name + * is not local to the root group. + * - Any element of the relative path or absolute path in name, + * except the target link, does not exist. + * + * \version 1.10.0 Function behavior changed in this release. (See the note.) + * \since 1.8.0 + * + */ H5_DLL htri_t H5Lexists(hid_t loc_id, const char *name, hid_t lapl_id); +/** + * \ingroup H5L + * + * \brief Returns information about a link + * + * \fgdta_loc_id + * \param[in] name Link name + * \param[out] linfo Buffer in which link information is returned + * \lapl_id + * + * \return \herr_t + * + * \todo We need to get the location ID story straight! + * + * \details H5Lget_info2() returns information about the specified link through + * the \p linfo argument. + * + * The location identifier, \p loc_id, specifies the location of the + * link. A link name, \p name, interpreted relative to \p loc_id, + * specifies the link being queried. + * + * \p lapl_id is the link access property list associated with the + * link name. In the general case, when default link access properties + * are acceptable, this can be passed in as #H5P_DEFAULT. An example + * of a situation that requires a non-default link access property + * list is when the link is an external link; an external link may + * require that a link prefix be set in a link access property list + * (see H5Pset_elink_prefix()). + * + * H5Lget_info2() returns information about name in the data structure + * H5L_info2_t, which is described below and defined in H5Lpublic.h. + * This structure is returned in the buffer \p linfo. + * \snippet this H5L_info2_t_snip + * In the above struct, \c type specifies the link class. Valid values + * include the following: + * \link_types + * There will be additional valid values if user-defined links have + * been registered. + * + * \p corder specifies the link’s creation order position while + * \p corder_valid indicates whether the value in corder is valid. + * + * If \p corder_valid is \c TRUE, the value in \p corder is known to + * be valid; if \p corder_valid is \c FALSE, the value in \p corder is + * presumed to be invalid; \p corder starts at zero (0) and is + * incremented by one (1) as new links are created. But + * higher-numbered entries are not adjusted when a lower-numbered link + * is deleted; the deleted link's creation order position is simply + * left vacant. In such situations, the value of \p corder for the + * last link created will be larger than the number of links remaining + * in the group. + * + * \p cset specifies the character set in which the link name is + * encoded. Valid values include the following: + * \csets + * This value is set with H5Pset_char_encoding(). + * + * \c token is the location that a hard link points to, and + * \c val_size is the size of a soft link or user defined link value. + * H5O_token_t is used in the VOL layer. It is defined in H5public.h + * as: + * \snippet H5public.h H5O_token_t_snip + * + * If the link is a symbolic link, \c val_size will be the length of + * the link value, e.g., the length of the HDF5 path name with a null + * terminator. + * + * \since 1.12.0 + * + */ H5_DLL herr_t H5Lget_info2(hid_t loc_id, const char *name, H5L_info2_t *linfo /*out*/, hid_t lapl_id); +/** + * \ingroup H5L + * + * \brief Retrieves metadata for a link in a group, according to the order + * within a field or index + * + * \loc_id + * \param[in] group_name Group name + * \idx_type + * \order + * \param[in] n Link position for which to retrieve information + * \param[out] linfo Buffer in which link information is returned + * \lapl_id + * + * \return \herr_t + * + * \details H5get_info_by_idx2() returns the metadata for a link in a group + * according to a specified field or index and a specified order. The + * link for which information is to be returned is specified by \p + * idx_type, \p order, and \p n as follows: + * + * - \p idx_type specifies the field by which the links in \p + * group_name are ordered. The links may be indexed on this field, + * in which case operations seeking specific links are likely to + * complete more quickly. + * - \p order specifies the order in which + * the links are to be referenced for the purposes of this function. + * - \p n specifies the position of the subject link. Note that this + * count is zero-based; 0 (zero) indicates that the function will + * return the value of the first link; if \p n is 5, the function + * will return the value of the sixth link; etc. + * + * For example, assume that \p idx_type, \p order, and \p n are + * #H5_INDEX_NAME, #H5_ITER_DEC, and 5, respectively. #H5_INDEX_NAME + * indicates that the links are accessed in lexicographic order by + * their names. #H5_ITER_DEC specifies that the list be traversed in + * reverse order, or in decremented order. And 5 specifies that this + * call to the function will return the metadata for the 6th link + * (\c n + 1) from the end. + * + * See H5Literate2() for a list of valid values and further discussion + * regarding \p idx_type and \p order. + * + * If \p loc_id specifies the group in which the link resides, + * \p group_name can be a dot (\c .). + * + * \since 1.12.0 + * + * \see H5Lget_info2() + * + * \todo Document H5Lget_info_by_idx() + * + */ H5_DLL herr_t H5Lget_info_by_idx2(hid_t loc_id, const char *group_name, H5_index_t idx_type, H5_iter_order_t order, hsize_t n, H5L_info2_t *linfo /*out*/, hid_t lapl_id); +/** + * \ingroup H5L + * + * \brief Retrieves name of the \Emph{n}-th link in a group, according to the + * order within a specified field or index + * + * \loc_id + * \param[in] group_name Group name + * \idx_type + * \order + * \param[in] n Link position for which to retrieve information + * \param[out] name Buffer in which link name is returned + * \param[in] size Size in bytes of \p name + * \lapl_id + * + * \return Returns the size of the link name if successful; otherwise returns a + * negative value. + * + * \details H5get_name_by_idx() retrieves the name of the \Emph{n}-th link in a + * group, according to the specified order, \p order, within a specified + * field or index, \p idx_type. + * + * \p idx_type specifies the index that is used. Valid values include + * the following: + * \indexes + * + * \p order specifies the order in which objects are inspected along + * the index specified in \p idx_type. Valid values include the + * following: + * \orders + * + * If \p loc_id specifies the group in which the link resides, + * \p group_name can be a dot (\c .). + * + * The size in bytes of name is specified in \p size. If \p size is + * unknown, it can be determined via an initial H5Lget_name_by_idx() + * call with name set to NULL; the function's return value will be the + * size of the name. + * + * \note Please note that in order for the specified index to correspond to the + * creation order index, \p order must be set to #H5_ITER_INC or + * #H5_ITER_DEC when calling H5Lget_name_by_idx(). \note The index \p n + * passed to H5Lget_name_by_idx() is the index of the link within the + * link table, sorted according to \p order and \p idx_type. If order is + * #H5_ITER_NATIVE, then the link table is not sorted, and it does not + * matter what \p idx_type is. Specifying #H5_ITER_NATIVE does not + * guarantee any particular order, only that it remains consistent. + * + * \since 1.8.0 + * + */ H5_DLL ssize_t 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); +/** + * \ingroup TRAV + * + * \brief Iterates over links in a group, with user callback routine, + * according to the order within an index. + * + * \group_id{grp_id} + * \idx_type + * \order + * \param[in,out] idx Pointer to an iteration index to allow + * continuing a previous iteration + * \op + * \op_data + * \return \success{The return value of the first operator that returns + * non-zero, or zero if all members were processed with no + * operator returning non-zero.} + * \return \failure{Negative if an error occurs in the library, or the negative + * value returned by one of the operators.} + * + * \details H5Literate2() iterates through the links in a file or + * group, \p group_id, in the order of the specified + * index, \p idx_type, using a user-defined callback routine + * \p op. H5Literate2() does not recursively follow links into + * subgroups of the specified group. + * + * Three parameters are used to manage progress of the iteration: + * \p idx_type, \p order, and \p idx_p. + * + * \p idx_type specifies the index to be used. If the links have + * not been indexed by the index type, they will first be sorted by + * that index then the iteration will begin; if the links have been + * so indexed, the sorting step will be unnecessary, so the iteration + * may begin more quickly. + * + * \p order specifies the order in which objects are to be inspected + * along the index \p idx_type. + * + * \p idx_p tracks the iteration and allows an iteration to be + * resumed if it was stopped before all members were processed. It is + * passed in by the application with a starting point and returned by + * the library with the point at which the iteration stopped. + * + * \p op_data is a user-defined pointer to the data required to + * process links in the course of the iteration. This pointer is + * passed back to each step of the iteration in the \p op callback + * function's \p op_data parameter. \p op is invoked for each link + * encounter. + * + * \p op_data is passed to and from each iteration and can be used to + * supply or aggregate information across iterations. + * + * \remark Same pattern of behavior as H5Giterate(). + * + * \note This function is also available through the H5Literate() macro. + * + * \warning The behavior of H5Literate2() is undefined if the link + * membership of \p group_id changes during the iteration. + * This does not limit the ability to change link destinations + * while iterating, but caution is advised. + * + * + * \since 1.12.0 + * + * \see H5Literate_by_name2(), H5Lvisit2(), H5Lvisit_by_name2() + * + */ H5_DLL herr_t H5Literate2(hid_t grp_id, H5_index_t idx_type, H5_iter_order_t order, hsize_t *idx, H5L_iterate2_t op, void *op_data); +/** + * \ingroup TRAV + * + * \brief Iterates through links in a group + * + * \loc_id + * \param[in] group_name Group name + * \idx_type + * \order + * \param[in,out] idx iteration position at which to start (\Emph{IN}) or + * position at which an interrupted iteration may be restarted + * (\Emph{OUT}) + * \op + * \op_data + * \lapl_id + * \return \success{The return value of the first operator that returns + * non-zero, or zero if all members were processed with no + * operator returning non-zero.} + * \return \failure{Negative if an error occurs in the library, or the negative + * value returned by one of the operators.} + * + * \details H5Literate_by_name2() iterates through the links in a group + * specified by \p loc_id and \p group_name, in the order of the + * specified index, \p idx_type, using a user-defined callback routine + * \p op. H5Literate_by_name2() does not recursively follow links into + * subgroups of the specified group. + * + * \p idx_type specifies the index to be used. If the links have not + * been indexed by the index type, they will first be sorted by that + * index then the iteration will begin; if the links have been so + * indexed, the sorting step will be unnecessary, so the iteration may + * begin more quickly. Valid values include the following: + * \indexes + * + * \p order specifies the order in which objects are to be inspected + * along the index specified in \p idx_type. Valid values include the + * following: + * \orders + * + * \p idx_p allows an interrupted iteration to be resumed; it is + * passed in by the application with a starting point and returned by + * the library with the point at which the iteration stopped. + * + * \note H5Literate_by_name2() is not recursive. In particular, if a member of + * \p group_name is found to be a group, call it \c subgroup_a, + * H5Literate_by_name2() does not examine the members of \c subgroup_a. + * When recursive iteration is required, the application must handle the + * recursion, explicitly calling H5Literate_by_name2() on discovered + * subgroups. + * + * \note H5Literate_by_name2() assumes that the membership of the group being + * iterated over remains unchanged through the iteration; if any of the + * links in the group change during the iteration, the function’s + * behavior is undefined. Note, however, that objects pointed to by the + * links can be modified. + * + * \note H5Literate_by_name2() is the same as H5Literate2(), except that + * H5Literate2() always proceeds in alphanumeric order. + * + * \since 1.12.0 + * + * \see H5Literate(), H5Lvisit() + * + */ H5_DLL herr_t H5Literate_by_name2(hid_t loc_id, const char *group_name, H5_index_t idx_type, H5_iter_order_t order, hsize_t *idx, H5L_iterate2_t op, void *op_data, hid_t lapl_id); +/** + * \ingroup TRAV + * + * \brief Recursively visits all links starting from a specified group + * + * \group_id{grp_id} + * \idx_type + * \order + * \op + * \op_data + * \return \success{The return value of the first operator that returns + * non-zero, or zero if all members were processed with no + * operator returning non-zero.} + * \return \failure{Negative if an error occurs in the library, or the negative + * value returned by one of the operators.} + * + * \details H5Lvisit2() is a recursive iteration function to visit all links in + * and below a group in an HDF5 file, thus providing a mechanism for + * an application to perform a common set of operations across all of + * those links or a dynamically selected subset. For non-recursive + * iteration across the members of a group, see H5Literate2(). + * + * The group serving as the root of the iteration is specified by its + * group or file identifier, \p group_id. + * + * Two parameters are used to establish the iteration: \p idx_type and + * \p order. + * + * \p idx_type specifies the index to be used. If the links have not + * been indexed by the index type, they will first be sorted by that + * index then the iteration will begin; if the links have been so + * indexed, the sorting step will be unnecessary, so the iteration may + * begin more quickly. Valid values include the following: + * \indexes + * + * Note that the index type passed in \p idx_type is a best effort + * setting. If the application passes in a value indicating iteration + * in creation order and a group is encountered that was not tracked + * in creation order, that group will be iterated over in + * lexicographic order by name, or name order. (Name order is the + * native order used by the HDF5 library and is always available.) + * + * \p order specifies the order in which objects are to be inspected + * along the index specified in \p idx_type. Valid values include the + * following: + * \orders + * + * \p op is a callback function of type \ref H5L_iterate2_t that is invoked + * for each link encountered. + * \snippet this H5L_iterate2_t_snip + * + * The \ref H5L_info2_t struct is defined (in H5Lpublic.h) as follows: + * \snippet this H5L_info2_t_snip + * + * The possible return values from the callback function, and the + * effect of each, are as follows: + * \li Zero causes the visit iterator to continue, returning zero when + * all group members have been processed. + * \li A positive value causes the visit iterator to immediately + * return that positive value, indicating short-circuit success. + * \li A negative value causes the visit iterator to immediately + * return that value, indicating failure. + * + * The H5Lvisit2() \p op_data parameter is a user-defined pointer to + * the data required to process links in the course of the iteration. + * This pointer is passed back to each step of the iteration in the + * \p op callback function's \p op_data parameter. + * + * H5Lvisit2() and H5Ovisit2() are companion functions: one for + * examining and operating on links; the other for examining and + * operating on the objects that those links point to. Both functions + * ensure that by the time the function completes successfully, every + * link or object below the specified point in the file has been + * presented to the application for whatever processing the + * application requires. + * + * \since 1.12.0 + * + * \see H5Literate() + * + */ H5_DLL herr_t H5Lvisit2(hid_t grp_id, H5_index_t idx_type, H5_iter_order_t order, H5L_iterate2_t op, void *op_data); +/** + * \ingroup TRAV + * + * \brief Recursively visits all links starting from a specified group + * + * \loc_id + * \param[in] group_name Group name + * \idx_type + * \order + * \op + * \op_data + * \lapl_id + * + * \return \herr_t + * + * \details H5Lvisit_by_name2() is a recursive iteration function to visit all + * links in and below a group in an HDF5 file, thus providing a + * mechanism for an application to perform a common set of operations + * across all of those links or a dynamically selected subset. For + * non-recursive iteration across the members of a group, see + * H5Literate2(). + * + * The group serving as the root of the iteration is specified by the + * \p loc_id / \p group_name parameter pair. \p loc_id specifies a + * file or group; group_name specifies either a group in the file + * (with an absolute name based in the file’s root group) or a group + * relative to \p loc_id. If \p loc_id fully specifies the group that + * is to serve as the root of the iteration, group_name should be '.' + * (a dot). (Note that when \p loc_id fully specifies the the group + * that is to serve as the root of the iteration, the user may wish to + * consider using H5Lvisit2() instead of H5Lvisit_by_name2().) + * + * Two parameters are used to establish the iteration: \p idx_type and + * \p order. + * + * \p idx_type specifies the index to be used. If the links have not + * been indexed by the index type, they will first be sorted by that + * index then the iteration will begin; if the links have been so + * indexed, the sorting step will be unnecesary, so the iteration may + * begin more quickly. Valid values include the following: + * \indexes + * + * Note that the index type passed in \p idx_type is a best effort + * setting. If the application passes in a value indicating iteration + * in creation order and a group is encountered that was not tracked + * in creation order, that group will be iterated over in + * lexicographic order by name, or name order. (Name order is the + * native order used by the HDF5 library and is always available.) + * + * \p order specifies the order in which objects are to be inspected + * along the index specified in \p idx_type. Valid values include the + * following: + * \orders + * + * The \p op callback function, the related \ref H5L_info2_t + * \c struct, and the effect that the callback function's return value + * has on the application are described in H5Lvisit2(). + * + * The H5Lvisit_by_name2() \p op_data parameter is a user-defined + * pointer to the data required to process links in the course of the + * iteration. This pointer is passed back to each step of the + * iteration in the callback function's \p op_data parameter. + * + * \p lapl_id is a link access property list. In the general case, + * when default link access properties are acceptable, this can be + * passed in as #H5P_DEFAULT. An example of a situation that requires + * a non-default link access property list is when the link is an + * external link; an external link may require that a link prefix be + * set in a link access property list (see H5Pset_elink_prefix()). + * + * H5Lvisit_by_name2() and H5Ovisit_by_name2() are companion + * functions: one for examining and operating on links; the other for + * examining and operating on the objects that those links point to. + * Both functions ensure that by the time the function completes + * successfully, every link or object below the specified point in the + * file has been presented to the application for whatever processing + * the application requires. + * + * \since 1.12.0 + * + */ H5_DLL herr_t H5Lvisit_by_name2(hid_t loc_id, const char *group_name, H5_index_t idx_type, H5_iter_order_t order, H5L_iterate2_t op, void *op_data, hid_t lapl_id); /* UD link functions */ +/** + * \ingroup H5L + * + * \brief Creates a link of a user-defined type + * + * \loc_id{link_loc_id} + * \param[in] link_name Link name + * \param[in] link_type User-defined link class + * \param[in] udata User-supplied link information + * \param[in] udata_size Size of udata buffer + * \lcpl_id + * \lapl_id + * + * \return \herr_t + * + * \details H5Lcreate_ud() creates a link of user-defined type \p link_type + * named \p link_name at the location specified in \p link_loc_id with + * user-specified data \p udata. + * + * \p link_name is interpreted relative to \p link_loc_id. + * + * Valid values for the link class of the new link, \p link_type, + * include #H5L_TYPE_EXTERNAL and any user-defined link classes that + * have been registered with the library. See H5Lregister() for + * further information. + * + * The format of the information pointed to by \p udata is defined by + * the user. \p udata_size specifies the size of the \p udata buffer. + * \p udata may be NULL if \p udata_size is zero (0). + * + * The property lists specified by \p lcpl_id and \p lapl_id specify + * properties used to create and access the link. + * + * \note The external link type, #H5L_TYPE_EXTERNAL, included in the HDF5 + * library distribution, is implemented as a user-defined link type. This + * was done, in part, to provide a model for the implementation of other + * user-defined links. + * + * \since 1.8.0 + * + */ H5_DLL 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); +/** + * \ingroup H5LA + * + * \brief Registers a user-defined link class or changes behavior of an + * existing class + * + * \param[in] cls Pointer to a buffer containing the struct describing the + * user-defined link class + * + * \return \herr_t + * + * \details H5Lregister() registers a class of user-defined links, or changes + * the behavior of an existing class. + * + * \p cls is a pointer to a buffer containing a copy of the + * H5L_class_t struct. This struct is defined in H5Lpublic.h as + * follows: + * \snippet this H5L_class_t_snip + * + * The class definition passed with \p cls must include at least the + * following: + * \li An H5L_class_t version (which should be #H5L_LINK_CLASS_T_VERS) + * \li A link class identifier, \c class_id + * \li A traversal function, \c trav_func + * + * Remaining \c struct members are optional and may be passed as NULL. + * + * The link class passed in \c class_id must be in the user-definable + * range between #H5L_TYPE_UD_MIN and #H5L_TYPE_UD_MAX + * (see the table below) and will override + * any existing link class with that identifier. + * + * As distributed, valid values of \c class_id used in HDF5 include + * the following (defined in H5Lpublic.h): + * \link_types + * + * The hard and soft link class identifiers cannot be modified or + * reassigned, but the external link class is implemented as an + * example in the user-definable link class identifier range. + * H5Lregister() is used to register additional link classes. It could + * also be used to modify the behavior of the external link class, + * though that is not recommended. + * + * The following table summarizes existing link types and values and + * the reserved and user-definable link class identifier value ranges. + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + *
Link class identifier or Value rangeDescriptionLink class or label
0 to 63Reserved range
64 to 255User-definable range
64Minimum user-defined value#H5L_TYPE_UD_MIN
64External link#H5L_TYPE_EXTERNAL
255Maximum user-defined value#H5L_TYPE_UD_MAX
255Maximum value#H5L_TYPE_MAX
-1Error#H5L_TYPE_ERROR
+ * + * Note that HDF5 internally registers user-defined link classes only + * by the numeric value of the link class identifier. An application, + * on the other hand, will generally use a name for a user-defined + * class, if for no other purpose than as a variable name. Assume, + * for example, that a complex link type is registered with the link + * class identifier 73 and that the code includes the following + * assignment: + * \code + * H5L_TYPE_COMPLEX_A = 73 + * \endcode + * The application can refer to the link class with a term, + * \c H5L_TYPE_COMPLEX_A, that conveys meaning to a human reviewing + * the code, while HDF5 recognizes it by the more cryptic numeric + * identifier, 73. + * + * \attention Important details and considerations include the following: + * \li If you plan to distribute files or software with a + * user-defined link class, please contact the Help Desk at + * The HDF Group to help prevent collisions between \c class_id + * values. See below. + * \li As distributed with HDF5, the external link class is + * implemented as an example of a user-defined link class with + * #H5L_TYPE_EXTERNAL equal to #H5L_TYPE_UD_MIN. \c class_id in + * the H5L_class_t \c struct must not equal #H5L_TYPE_UD_MIN + * unless you intend to overwrite or modify the behavior of + * external links. + * \li H5Lregister() can be used only with link class identifiers + * in the user-definable range (see table above). + * \li The hard and soft links defined by the HDF5 library, + * #H5L_TYPE_HARD and #H5L_TYPE_SOFT, reside in the reserved + * range below #H5L_TYPE_UD_MIN and cannot be redefined or + * modified. + * \li H5Lis_registered() can be used to determine whether a desired + * link class identifier is available. \Emph{Note that this + * function will tell you only whether the link class identifier + * has been registered with the installed copy of HDF5; it + * cannot tell you whether the link class has been registered + * with The HDF Group.} + * \li #H5L_TYPE_MAX is the maximum allowed value for a link type + * identifier. + * \li #H5L_TYPE_UD_MIN equals #H5L_TYPE_EXTERNAL. + * \li #H5L_TYPE_UD_MAX equals #H5L_TYPE_MAX. + * \li #H5L_TYPE_ERROR indicates that an error has occurred. + * + * \note \Bold{Registration with The HDF Group:}\n + * There are sometimes reasons to take a broader approach to registering + * a user-defined link class than just invoking H5Lregister(). For + * example: + * \li A user-defined link class is intended for use across an + * organization, among collaborators, or across a community of users. + * \li An application or library overlying HDF5 invokes a user-defined + * link class that must be shipped with the software. + * \li Files are distributed that make use of a user-defined link class. + * \li Or simply, a specific user-defined link class is thought to be + * widely useful. + * + * In such cases, you are encouraged to register that link class with + * The HDF Group's Helpdesk. The HDF Group maintains a registry of known + * user-defined link classes and tracks the selected link class + * identifiers. This registry is intended to reduce the risk of + * collisions between \c class_id values and to help coordinate the use + * of specialized link classes. + * + * \since 1.8.0 + * + */ H5_DLL herr_t H5Lregister(const H5L_class_t *cls); +/** + * \ingroup H5LA + * + * \brief Unregisters a class of user-defined links + * + * \param[in] id User-defined link class identifier + * + * \return \herr_t + * + * \details H5Lunregister() unregisters a class of user-defined links, + * preventing them from being traversed, queried, moved, etc. + * + * \note A link class can be re-registered using H5Lregister(). + * + * \since 1.8.0 + * + */ H5_DLL herr_t H5Lunregister(H5L_type_t id); +/** + * \ingroup H5LA + * + * \brief Determines whether a class of user-defined links is registered + * + * \param[in] id User-defined link class identifier + * + * \return \htri_t + * + * \details H5Lis_registered() tests whether a user-defined link class is + * currently registered, either by the HDF5 library or by the user + * through the use of H5Lregister(). + * + * \note A link class must be registered to create new links of that type or to + * traverse existing links of that type. + * + * \since 1.8.0 + * + */ H5_DLL htri_t H5Lis_registered(H5L_type_t id); /* External link functions */ +/** + * \ingroup H5L + * + * \brief Decodes external link information + * + * \param[in] ext_linkval Buffer containing external link information + * \param[in] link_size Size, in bytes, of the \p ext_linkval buffer + * \param[out] flags External link flags, packed as a bitmap (\Emph{Reserved as + * a bitmap for flags; no flags are currently defined, so the + * only valid value * is 0.}) + * \param[out] filename Returned filename \param[out] obj_path Returned + * object path, relative to \p filename + * + * \return \herr_t + * + * \details H5Lunpack_elink_val() decodes the external link information + * returned by H5Lget_val() in the \p ext_linkval buffer. + * + * \p ext_linkval should be the buffer set by H5Lget_val() and will + * consist of two NULL-terminated strings, the filename and object + * path, one after the other. + * + * Given this buffer, H5Lunpack_elink_val() creates pointers to the + * filename and object path within the buffer and returns them in + * \p filename and \p obj_path, unless they are passed in as NULL. + * + * H5Lunpack_elink_val() requires that \p ext_linkval contain a + * concatenated pair of null-terminated strings, so use of this + * function on a string that is not an external link \p udata buffer + * may result in a segmentation fault. This failure can be avoided by + * adhering to the following procedure: + *
    + *
  1. Call H5Lget_info() to get the link type and the size of the + * link value.
  2. + *
  3. Verify that the link is an external link, i.e., that its link + * type is #H5L_TYPE_EXTERNAL.
  4. + *
  5. Call H5Lget_val() to get the link value.
  6. + *
  7. Call H5Lunpack_elink_val() to unpack that value.
  8. + *
+ * + * \since 1.8.0 + * + */ H5_DLL herr_t H5Lunpack_elink_val(const void *ext_linkval /*in*/, size_t link_size, unsigned *flags, const char **filename /*out*/, const char **obj_path /*out*/); +/** + * \ingroup H5L + * + * \brief Creates an external link, a soft link to an object in a different file. + * + * \param[in] file_name Name of the target file containing the target object. + * \param[in] obj_name Path within the target file to the target object + * \fgdt_loc_id{link_loc_id} + * \param[in] link_name Name of the new link, relative to \p link_loc_id + * \lcpl_id + * \lapl_id + * \return \herr_t + * + * \details H5Lcreate_external() creates a new external link. An external link + * is a soft link to an object in a different HDF5 file from the + * location of the link, i.e., to an external object. + * + * \p file_name identifies the target file containing the target + * object; \p obj_name specifies the path of the target object within + * that file. \p obj_name must be an absolute pathname in + * \p file_name, i.e., it must start at the target file’s root group, + * but it is not interpreted until an application attempts to traverse + * it. + * + * \p link_loc_id and \p link_name specify the location and name, + * respectively, of the new link. \p link_name is interpreted relative + * to \p link_loc_id. + * + * \p lcpl_id is the link creation property list used in creating the + * new link. + * + * \p lapl_id is the link access property list used in traversing the + * new link. Note that an external file opened by the traversal of an + * external link is always opened with the weak file close degree + * property setting, #H5F_CLOSE_WEAK (see H5Pset_fclose_degree()); + * any file close degree property setting in \p lapl_id is ignored. + * + * An external link behaves similarly to a soft link, and like a soft + * link in an HDF5 file, it may dangle: the target file and object + * need not exist at the time that the external link is created. + * + * When the external link \p link_name is accessed, the library will + * search for the target file \p file_name as described below: + * + * - If \p file_name is a relative pathname, the following steps are + * performed: + * - The library will get the prefix(es) set in the environment + * variable \c HDF5_EXT_PREFIX and will try to prepend each prefix + * to \p file_name to form a new \p file_name. + * - If the new \p file_name does not exist or if \c HDF5_EXT_PREFIX + * is not set, the library will get the prefix set via + * H5Pset_elink_prefix() and prepend it to \p file_name to form a + * new \p file_name. + * - If the new \p file_name does not exist or no prefix is being + * set by H5Pset_elink_prefix(), then the path of the file + * associated with \p link_loc_id is obtained. This path can be + * the absolute path or the current working directory plus the + * relative path of that file when it is created/opened. The + * library will prepend this path to \p file_name to form a new + * \p file_name. + * - If the new \p file_name does not exist, then the library will + * look for \p file_name and will return failure/success + * accordingly. + * - If \p file_name is an absolute pathname, the library will first + * try to find \p file_name. If \p file_name does not exist, + * \p file_name is stripped of directory paths to form a new + * \p file_name. The search for the new \p file_name then follows + * the same steps as described above for a relative pathname. See + * examples below illustrating how target_file_name is stripped to + * form a new \p file_name. + * + * Note that \p file_name is considered to be an absolute pathname + * when the following condition is true: + * + * - For Unix, the first character of \p file_name is a slash (\c /). + * For example, consider a \p file_name of \c /tmp/A.h5. + * If that target file does not exist, the new \p file_name after + * stripping will be \c A.h5. + * - For Windows, there are 6 cases: + * -# \p file_name is an absolute drive with absolute pathname. + * For example, consider a \p file_name of \c /tmp/A.h5. If that + * target file does not exist, the new \p file_name after + * stripping will be \c A.h5. + * -# \p file_name is an absolute pathname without specifying drive + * name. For example, consider a \p file_name of \c /tmp/A.h5. + * If that target file does not exist, the new \p file_name after + * stripping will be \c A.h5. + * -# \p file_name is an absolute drive with relative pathname. + * For example, consider a \p file_name of \c /tmp/A.h5. If that + * target file does not exist, the new \p file_name after + * stripping will be \c tmp\A.h5. + * -# \p file_name is in UNC (Uniform Naming Convention) format with + * server name, share name, and pathname. For example, consider + * a \p file_name of \c /tmp/A.h5. If that target file does not + * exist, the new \p file_name after stripping will be \c A.h5. + * -# \p file_name is in Long UNC (Uniform Naming Convention) format + * with server name, share name, and pathname. For example, + * consider a \p file_name of \c /tmp/A.h5. If that target file + * does not exist, the new \p file_name after stripping will be + * \c A.h5. + * -# \p file_name is in Long UNC (Uniform Naming Convention) format + * with an absolute drive and an absolute pathname. For example, + * consider a \p file_name of \c /tmp/A.h5. If that target file + * does not exist, the new \p file_name after stripping will be + * \c A.h5. + * + * The library opens target file \p file_name with the file access + * property list that is set via H5Pset_elink_fapl() when the external + * link link_name is accessed. If no such property list is set, the + * library uses the file access property list associated with the file + * of \p link_loc_id to open the target file. + * + * If an application requires additional control over file access + * flags or the file access property list, see H5Pset_elink_cb(); this + * function enables the use of an external link callback function as + * described in H5L_elink_traverse_t(). + * + * \attention A file close degree property setting (H5Pset_fclose_degree()) in + * the external link file access property list or in the external + * link callback function will be ignored. A file opened by means of + * traversing an external link is always opened with the weak file + * close degree property setting, #H5F_CLOSE_WEAK . + * + * \see H5Lcreate_hard(), H5Lcreate_soft(), H5Lcreate_ud() + * + * \since 1.8.0 + */ H5_DLL herr_t H5Lcreate_external(const char *file_name, const char *obj_name, hid_t link_loc_id, const char *link_name, hid_t lcpl_id, hid_t lapl_id); @@ -205,49 +1609,508 @@ H5_DLL herr_t H5Lcreate_external(const char *file_name, const char *obj_name, hi /* Typedefs */ /* Information struct for link (for H5Lget_info1/H5Lget_info_by_idx1) */ +//! [H5L_info1_t_snip] typedef struct { - H5L_type_t type; /* Type of link */ - hbool_t corder_valid; /* Indicate if creation order is valid */ - int64_t corder; /* Creation order */ - H5T_cset_t cset; /* Character set of link name */ + H5L_type_t type; /**< Type of link */ + hbool_t corder_valid; /**< Indicate if creation order is valid */ + int64_t corder; /**< Creation order */ + H5T_cset_t cset; /**< Character set of link name */ union { - haddr_t address; /* Address hard link points to */ - size_t val_size; /* Size of a soft link or UD link value */ + haddr_t address; /**< Address hard link points to */ + size_t val_size; /**< Size of a soft link or UD link value */ } u; } H5L_info1_t; +//! [H5L_info1_t_snip] -/* Callback during link traversal */ +/** Callback during link traversal */ typedef hid_t (*H5L_traverse_0_func_t)(const char *link_name, hid_t cur_group, const void *lnkdata, size_t lnkdata_size, hid_t lapl_id); -/* User-defined link types */ +/** User-defined link types */ typedef struct { - int version; /* Version number of this struct */ - H5L_type_t id; /* Link type ID */ - const char * comment; /* Comment for debugging */ - H5L_create_func_t create_func; /* Callback during link creation */ - H5L_move_func_t move_func; /* Callback after moving link */ - H5L_copy_func_t copy_func; /* Callback after copying link */ - H5L_traverse_0_func_t trav_func; /* Callback during link traversal */ - H5L_delete_func_t del_func; /* Callback for link deletion */ - H5L_query_func_t query_func; /* Callback for queries */ + int version; /**< Version number of this struct */ + H5L_type_t id; /**< Link type ID */ + const char *comment; /**< Comment for debugging */ + H5L_create_func_t create_func; /**< Callback during link creation */ + H5L_move_func_t move_func; /**< Callback after moving link */ + H5L_copy_func_t copy_func; /**< Callback after copying link */ + H5L_traverse_0_func_t trav_func; /**< Callback during link traversal */ + H5L_delete_func_t del_func; /**< Callback for link deletion */ + H5L_query_func_t query_func; /**< Callback for queries */ } H5L_class_0_t; -/* Prototype for H5Literate1/H5Literate_by_name1() operator */ -typedef herr_t (*H5L_iterate1_t)(hid_t group, const char *name, const H5L_info1_t *info, void *op_data); +/** Prototype for H5Literate1() / H5Literate_by_name1() operator */ +//! [H5L_iterate1_t_snip] +typedef herr_t (*H5L_iterate1_t)(hid_t group, const char *name, const H5L_info1_t *info, + void *op_data); +//! [H5L_iterate1_t_snip] /* Function prototypes */ +/** + * \ingroup H5L + * + * \brief Returns information about a link + * + * \fgdta_loc_id + * \param[in] name Link name + * \param[out] linfo Buffer in which link information is returned + * \lapl_id + * + * \return \herr_t + * + * \deprecated As of HDF5-1.12 this function has been deprecated in favor of + * the function H5Lget_info2() or the macro H5Lget_info(). + * + * \todo We need to get the location ID story straight! + * + * \details H5Lget_info1() returns information about the specified link through + * the \p linfo argument. + * + * The location identifier, \p loc_id, specifies the location of the + * link. A link name, \p name, interpreted relative to \p loc_id, + * specifies the link being queried. + * + * \p lapl_id is the link access property list associated with the + * link \p name. In the general case, when default link access + * properties are acceptable, this can be passed in as #H5P_DEFAULT. + * An example of a situation that requires a non-default link access + * property list is when the link is an external link; an external + * link may require that a link prefix be set in a link access + * property list (see H5Pset_elink_prefix()). + * + * H5Lget_info1() returns information about name in the data structure + * \ref H5L_info1_t, which is described below and defined in + * H5Lpublic.h. This structure is returned in the buffer \p linfo. + * \snippet this H5L_info1_t_snip + * In the above struct, type specifies the link class. Valid values + * include the following: + * \link_types + * There will be additional valid values if user-defined links have + * been registered. + * + * \c corder specifies the link’s creation order position while + * \c corder_valid indicates whether the value in \c corder is valid. + * + * If \c corder_valid is \c TRUE, the value in \c corder is known to + * be valid; if \c corder_valid is \c FALSE, the value in \c corder is + * presumed to be invalid; + * + * \c corder starts at zero (0) and is incremented by one (1) as new + * links are created. But higher-numbered entries are not adjusted + * when a lower-numbered link is deleted; the deleted link’s creation + * order position is simply left vacant. In such situations, the value + * of \c corder for the last link created will be larger than the + * number of links remaining in the group. + * + * \c cset specifies the character set in which the link name is + * encoded. Valid values include the following: + * \csets + * This value is set with H5Pset_char_encoding(). + * + * \c address and \c val_size are returned for hard and symbolic + * links, respectively. Symbolic links include soft and external links + * and some user-defined links. + * + * If the link is a hard link, \c address specifies the file address + * that the link points to. + * + * If the link is a symbolic link, \c val_size will be the length of + * the link value, e.g., the length of the HDF5 path name with a null + * terminator. + * + * \version 1.12.0 Function was deprecated. + * \version 1.8.2 Fortran subroutine added in this release. + * \version 1.8.4 Fortran subroutine syntax changed in this release. + * + * \since 1.8.0 + * + */ H5_DLL herr_t H5Lget_info1(hid_t loc_id, const char *name, H5L_info1_t *linfo /*out*/, hid_t lapl_id); +/** + * \ingroup H5L + * + * \brief Retrieves metadata for a link in a group, according to the order + * within a field or index + * + * \loc_id + * \param[in] group_name Group name + * \idx_type + * \order + * \param[in] n Link position for which to retrieve information + * \param[out] linfo Buffer in which link information is returned + * \lapl_id + * + * \return \herr_t + * + * \deprecated As of HDF5-1.12 this function has been deprecated in favor of + * the function H5Lget_info_by_idx2() and the macro + * H5Lget_info_by_idx(). + * + * \details H5get_info_by_idx1() returns the metadata for a link in a group + * according to a specified field or index and a specified order. + * + * The link for which information is to be returned is specified by \p + * idx_type, \p order, and \p n as follows: + * + * - \p idx_type specifies the field by which the links in \p + * group_name are ordered. The links may be indexed on this field, + * in which case operations seeking specific links are likely to + * complete more quickly. + * - \p order specifies the order in which + * the links are to be referenced for the purposes of this function. + * - \p n specifies the position of the subject link. Note that this + * count is zero-based; 0 (zero) indicates that the function will + * return the value of the first link; if \p n is 5, the function + * will return the value of the sixth link; etc. + * + * For example, assume that \p idx_type, \p order, and \p n are + * #H5_INDEX_NAME, #H5_ITER_DEC, and 5, respectively. #H5_INDEX_NAME + * indicates that the links are accessed in lexicographic order by + * their names. #H5_ITER_DEC specifies that the list be traversed in + * reverse order, or in decremented order. And 5 specifies that this + * call to the function will return the metadata for the 6th link + * (\c n + 1) from the end. + * + * See H5Literate1() for a list of valid values and further discussion + * regarding \p idx_type and \p order. + * + * If \p loc_id specifies the group in which the link resides, + * \p group_name can be a dot (\c .). + * + * \version 1.12.0 Function was renamed to H5Lget_index_by_idx1() and deprecated. + * \version 1.8.4 Fortran subroutine syntax changed in this release. + * \version 1.8.2 Fortran subroutine added in this release. + * + * \since 1.8.0 + * + */ H5_DLL herr_t H5Lget_info_by_idx1(hid_t loc_id, const char *group_name, H5_index_t idx_type, H5_iter_order_t order, hsize_t n, H5L_info1_t *linfo /*out*/, hid_t lapl_id); +/** + * \ingroup TRAV + * + * \brief Iterates over links in a group, with user callback routine, + * according to the order within an index. + * + * \group_id{grp_id} + * \idx_type + * \order + * \param[in,out] idx Pointer to an iteration index to allow + * continuing a previous iteration + * \op + * \op_data + * \return \success{The return value of the first operator that returns + * non-zero, or zero if all members were processed with no + * operator returning non-zero.} + * \return \failure{Negative if an error occurs in the library, or the negative + * value returned by one of the operators.} + * + * \deprecated Deprecated in favor of H5Literate2(). + * + * \details H5Literate1() iterates through the links in a file or + * group, \p group_id, in the order of the specified + * index, \p idx_type, using a user-defined callback routine + * \p op. H5Literate1() does not recursively follow links into + * subgroups of the specified group. + * + * Three parameters are used to manage progress of the iteration: + * \p idx_type, \p order, and \p idx_p. + * + * \p idx_type specifies the index to be used. If the links have + * not been indexed by the index type, they will first be sorted by + * that index then the iteration will begin; if the links have been + * so indexed, the sorting step will be unnecessary, so the iteration + * may begin more quickly. + * + * \p order specifies the order in which objects are to be inspected + * along the index \p idx_type. + * + * \p idx_p tracks the iteration and allows an iteration to be + * resumed if it was stopped before all members were processed. It is + * passed in by the application with a starting point and returned by + * the library with the point at which the iteration stopped. + * + * \p op_data is a user-defined pointer to the data required to + * process links in the course of the iteration. This pointer is + * passed back to each step of the iteration in the \p op callback + * function's \p op_data parameter. \p op is invoked for each link + * encounter. + * + * \p op_data is passed to and from each iteration and can be used to + * supply or aggregate information across iterations. + * + * \remark Same pattern of behavior as H5Giterate(). + * + * \note This function is also available through the H5Literate() macro. + * + * \warning The behavior of H5Literate1() is undefined if the link + * membership of \p group_id changes during the iteration. + * This does not limit the ability to change link destinations + * while iterating, but caution is advised. + * + * + * \version 1.12.0 Function was deprecated in this release. + * \since 1.8.0 + * + * \see H5Literate_by_name2(), H5Lvisit2(), H5Lvisit_by_name2() + * + */ H5_DLL herr_t H5Literate1(hid_t grp_id, H5_index_t idx_type, H5_iter_order_t order, hsize_t *idx, H5L_iterate1_t op, void *op_data); +/** + * \ingroup TRAV + * + * \brief Iterates through links in a group by its name + * + * \loc_id + * \param[in] group_name Group name + * \idx_type + * \order + * \param[in,out] idx iteration position at which to start (\Emph{IN}) or + * position at which an interrupted iteration may be restarted + * (\Emph{OUT}) + * \op + * \op_data + * \lapl_id + * + * \return \success{The return value of the first operator that returns + * non-zero, or zero if all members were processed with no + * operator returning non-zero.} + * \return \failure{Negative if an error occurs in the library, or the negative + * value returned by one of the operators.} + * + * \deprecated As of HDF5-1.12 this function has been deprecated in favor of + * the function H5Literate_by_name2() or the macro + * H5Literate_by_name(). + * + * \details H5Literate_by_name1() iterates through the links in a group + * specified by \p loc_id and \p group_name, in the order of the + * specified index, \p idx_type, using a user-defined callback routine + * \p op. H5Literate_by_name1() does not recursively follow links into + * subgroups of the specified group. + * + * \p idx_type specifies the index to be used. If the links have not + * been indexed by the index type, they will first be sorted by that + * index then the iteration will begin; if the links have been so + * indexed, the sorting step will be unnecessary, so the iteration may + * begin more quickly. Valid values include the following: + * \indexes + * + * \p order specifies the order in which objects are to be inspected + * along the index specified in \p idx_type. Valid values include the + * following: + * \orders + * + * \p idx allows an interrupted iteration to be resumed; it is + * passed in by the application with a starting point and returned by + * the library with the point at which the iteration stopped. + * + * \note H5Literate_by_name1() is not recursive. In particular, if a member of + * \p group_name is found to be a group, call it \c subgroup_a, + * H5Literate_by_name1() does not examine the members of \c subgroup_a. + * When recursive iteration is required, the application must handle the + * recursion, explicitly calling H5Literate_by_name1() on discovered + * subgroups. + * + * \note H5Literate_by_name1() assumes that the membership of the group being + * iterated over remains unchanged through the iteration; if any of the + * links in the group change during the iteration, the function’s + * behavior is undefined. Note, however, that objects pointed to by the + * links can be modified. + * + * \note H5Literate_by_name1() is the same as H5Giterate(), except that + * H5Giterate() always proceeds in lexicographic order. + * + * \version 1.12.0 Function H5Literate_by_name() was renamed to + * H5Literate_by_name1() and deprecated. + * \version 1.8.8 Fortran subroutine added. + * + * \since 1.8.0 + * + */ H5_DLL herr_t H5Literate_by_name1(hid_t loc_id, const char *group_name, H5_index_t idx_type, H5_iter_order_t order, hsize_t *idx, H5L_iterate1_t op, void *op_data, hid_t lapl_id); +/** + * \ingroup TRAV + * + * \brief Recursively visits all links starting from a specified group + * + * \group_id{grp_id} + * \idx_type + * \order + * \op + * \op_data + * + * \return \success{The return value of the first operator that returns + * non-zero, or zero if all members were processed with no + * operator returning non-zero.} + * \return \failure{Negative if an error occurs in the library, or the negative + * value returned by one of the operators.} + * + * \deprecated As of HDF5-1.12 this function has been deprecated in favor of + * the function H5Lvisit2() or the macro H5Lvisit(). + * + * \details H5Lvisit1() is a recursive iteration function to visit all links in + * and below a group in an HDF5 file, thus providing a mechanism for + * an application to perform a common set of operations across all of + * those links or a dynamically selected subset. For non-recursive + * iteration across the members of a group, see H5Literate1(). + * + * The group serving as the root of the iteration is specified by its + * group or file identifier, \p group_id. + * + * Two parameters are used to establish the iteration: \p idx_type and + * \p order. + * + * \p idx_type specifies the index to be used. If the links have not + * been indexed by the index type, they will first be sorted by that + * index then the iteration will begin; if the links have been so + * indexed, the sorting step will be unnecessary, so the iteration may + * begin more quickly. Valid values include the following: + * \indexes + * + * Note that the index type passed in \p idx_type is a best effort + * setting. If the application passes in a value indicating iteration + * in creation order and a group is encountered that was not tracked + * in creation order, that group will be iterated over in + * lexicographic order by name, or name order. (Name order is the + * native order used by the HDF5 library and is always available.) + * + * \p order specifies the order in which objects are to be inspected + * along the index specified in \p idx_type. Valid values include the + * following: + * \orders + * + * \p op is a callback function of type \ref H5L_iterate1_t that is invoked + * for each link encountered. + * \snippet this H5L_iterate1_t_snip + * + * The \ref H5L_info1_t struct is defined (in H5Lpublic.h) as follows: + * \snippet this H5L_info1_t_snip + * + * The possible return values from the callback function, and the + * effect of each, are as follows: + * \li Zero causes the visit iterator to continue, returning zero when + * all group members have been processed. + * \li A positive value causes the visit iterator to immediately + * return that positive value, indicating short-circuit success. + * \li A negative value causes the visit iterator to immediately + * return that value, indicating failure. + * + * The H5Lvisit1() \p op_data parameter is a user-defined pointer to + * the data required to process links in the course of the iteration. + * This pointer is passed back to each step of the iteration in the + * \p op callback function's \p op_data parameter. + * + * H5Lvisit1() and H5Ovisit1() are companion functions: one for + * examining and operating on links; the other for examining and + * operating on the objects that those links point to. Both functions + * ensure that by the time the function completes successfully, every + * link or object below the specified point in the file has been + * presented to the application for whatever processing the + * application requires. + * + * \version 1.12.0 Function was renamed from H5Lvisit() to H5Lvisit1() and + * deprecated. + * + * \since 1.8.0 + * + */ H5_DLL herr_t H5Lvisit1(hid_t grp_id, H5_index_t idx_type, H5_iter_order_t order, H5L_iterate1_t op, void *op_data); +/** + * \ingroup TRAV + * + * \brief Recursively visits all links starting from a specified group + * + * \loc_id + * \param[in] group_name Group name + * \idx_type + * \order + * \op + * \op_data + * \lapl_id + * + * \return \success{The return value of the first operator that returns + * non-zero, or zero if all members were processed with no + * operator returning non-zero.} + * \return \failure{Negative if an error occurs in the library, or the negative + * value returned by one of the operators.} + * + * \deprecated As of HDF5-1.12 this function has been deprecated in favor of + * the function H5Lvisit_by_name2() or the macro H5Lvisit_by_name(). + * + * \details H5Lvisit_by_name1() is a recursive iteration function to visit all + * links in and below a group in an HDF5 file, thus providing a + * mechanism for an application to perform a common set of operations + * across all of those links or a dynamically selected subset. For + * non-recursive iteration across the members of a group, see + * H5Literate1(). + * + * The group serving as the root of the iteration is specified by the + * \p loc_id / \p group_name parameter pair. \p loc_id specifies a + * file or group; group_name specifies either a group in the file + * (with an absolute name based in the file’s root group) or a group + * relative to \p loc_id. If \p loc_id fully specifies the group that + * is to serve as the root of the iteration, group_name should be '.' + * (a dot). (Note that when \p loc_id fully specifies the the group + * that is to serve as the root of the iteration, the user may wish to + * consider using H5Lvisit1() instead of H5Lvisit_by_name1().) + * + * Two parameters are used to establish the iteration: \p idx_type and + * \p order. + * + * \p idx_type specifies the index to be used. If the links have not + * been indexed by the index type, they will first be sorted by that + * index then the iteration will begin; if the links have been so + * indexed, the sorting step will be unnecesary, so the iteration may + * begin more quickly. Valid values include the following: + * \indexes + * + * Note that the index type passed in \p idx_type is a best effort + * setting. If the application passes in a value indicating iteration + * in creation order and a group is encountered that was not tracked + * in creation order, that group will be iterated over in + * lexicographic order by name, or name order. (Name order is the + * native order used by the HDF5 library and is always available.) + * + * \p order specifies the order in which objects are to be inspected + * along the index specified in \p idx_type. Valid values include the + * following: + * \orders + * + * The \p op callback function, the related \ref H5L_info1_t + * \c struct, and the effect that the callback function's return value + * has on the application are described in H5Lvisit1(). + * + * The H5Lvisit_by_name1() \p op_data parameter is a user-defined + * pointer to the data required to process links in the course of the + * iteration. This pointer is passed back to each step of the + * iteration in the callback function's \p op_data parameter. + * + * \p lapl_id is a link access property list. In the general case, + * when default link access properties are acceptable, this can be + * passed in as #H5P_DEFAULT. An example of a situation that requires + * a non-default link access property list is when the link is an + * external link; an external link may require that a link prefix be + * set in a link access property list (see H5Pset_elink_prefix()). + * + * H5Lvisit_by_name1() and H5Ovisit_by_name1() are companion + * functions: one for examining and operating on links; the other for + * examining and operating on the objects that those links point to. + * Both functions ensure that by the time the function completes + * successfully, every link or object below the specified point in the + * file has been presented to the application for whatever processing + * the application requires. + * + * \version 1.12.0 Function renamed from H5Lvisit_by_name() to + * H5Lvisit_by_name1() and deprecated. + * + * \since 1.8.0 + * + */ H5_DLL herr_t H5Lvisit_by_name1(hid_t loc_id, const char *group_name, H5_index_t idx_type, H5_iter_order_t order, H5L_iterate1_t op, void *op_data, hid_t lapl_id); diff --git a/src/H5PLmodule.h b/src/H5PLmodule.h index 8bf11ce26c7..6e6a08802cb 100644 --- a/src/H5PLmodule.h +++ b/src/H5PLmodule.h @@ -27,4 +27,9 @@ #define H5_MY_PKG_ERR H5E_PLUGIN #define H5_MY_PKG_INIT YES +/**\defgroup H5PL H5PL + * \brief Plugins + * \todo Describe what programmatically controlling dynamically loaded plugins (H5PL) is all about + */ + #endif /* _H5PLmodule_H */ diff --git a/src/H5PLpublic.h b/src/H5PLpublic.h index a54cce063a3..b345188cb55 100644 --- a/src/H5PLpublic.h +++ b/src/H5PLpublic.h @@ -28,14 +28,20 @@ */ #define H5PL_NO_PLUGIN "::" -/* Plugin type used by the plugin library */ +//! [H5PL_type_t_snip] + +/** + * Plugin type (bit-position) used by the plugin library + */ typedef enum H5PL_type_t { - H5PL_TYPE_ERROR = -1, /* Error */ - H5PL_TYPE_FILTER = 0, /* Filter */ - H5PL_TYPE_VOL = 1, /* VOL driver */ - H5PL_TYPE_NONE = 2 /* This must be last! */ + H5PL_TYPE_ERROR = -1, /**< Error */ + H5PL_TYPE_FILTER = 0, /**< Filter */ + H5PL_TYPE_VOL = 1, /**< VOL driver */ + H5PL_TYPE_NONE = 2 /**< Sentinel: This must be last! */ } H5PL_type_t; +//! [H5PL_type_t_snip] + /* Common dynamic plugin type flags used by the set/get_loading_state functions */ #define H5PL_FILTER_PLUGIN 0x0001 #define H5PL_VOL_PLUGIN 0x0002 @@ -46,14 +52,174 @@ extern "C" { #endif /* plugin state */ +/** + * \ingroup H5PL + * \brief Controls the loadability of dynamic plugin types + * + * \param[in] plugin_control_mask The list of dynamic plugin types to enable or disable.\n + * A plugin bit set to 0 (zero) prevents use of that dynamic plugin.\n + * A plugin bit set to 1 (one) enables use of that dynamic plugin.\n + * Setting \p plugin_control_mask to a negative value enables all dynamic + * plugin types.\n + * Setting \p plugin_control_mask to 0 (zero) disables all dynamic plugin\n + * types. + * \return \herr_t + * + * \details H5PLset_loading_state() uses one argument to enable or disable individual plugin types. + * + * \details The \p plugin_control_mask parameter is an encoded integer in which each bit controls a specific + * plugin type. Bit positions allocated to date are specified in \ref H5PL_type_t as follows: + * \snippet this H5PL_type_t_snip + * + * A plugin bit set to 0 (zero) prevents the use of the dynamic plugin type corresponding to that bit + * position. A plugin bit set to 1 (one) allows the use of that dynamic plugin type. + * + * All dynamic plugin types can be enabled by setting \p plugin_control_mask to a negative value. A + * value of 0 (zero) will disable all dynamic plugin types. + * + * The loading of external dynamic plugins can be controlled during runtime with an environment + * variable, \c HDF5_PLUGIN_PRELOAD. H5PLset_loading_state() inspects the \c HDF5_PLUGIN_PRELOAD + * environment variable every time it is called. If the environment variable is set to the special + * \c :: string, all dynamic plugins are disabled. + * + * \warning The environment variable \c HDF5_PLUGIN_PRELOAD controls the loading of dynamic plugin types at + * runtime. If it is set to disable all plugin types, then it will disable them for \Emph{all} + * running programs that access the same variable instance. + * + * \since 1.8.15 + * + */ H5_DLL herr_t H5PLset_loading_state(unsigned int plugin_control_mask); +/** + * \ingroup H5PL + * \brief Queries the loadability of dynamic plugin types + * + * \param[out] plugin_control_mask List of dynamic plugin types that are enabled or disabled.\n + * A plugin bit set to 0 (zero) indicates that that the dynamic plugin type is + * disabled.\n + * A plugin bit set to 1 (one) indicates that that the dynamic plugin type is + * enabled.\n + * If the value of \p plugin_control_mask is negative, all dynamic plugin types + * are enabled.\n + * If the value of \p plugin_control_mask is 0 (zero), all dynamic plugins + * are disabled. + * \return \herr_t + * + * \details H5PLget_loading_state() retrieves the bitmask that controls whether a certain type of plugins + * (e.g.: filters, VOL drivers) will be loaded by the HDF5 library. + * + * Bit positions allocated to date are specified in \ref H5PL_type_t as follows: + * \snippet this H5PL_type_t_snip + * + * \since 1.8.15 + * + */ H5_DLL herr_t H5PLget_loading_state(unsigned int *plugin_control_mask /*out*/); +/** + * \ingroup H5PL + * \brief Inserts a plugin path at the end of the plugin search path list + * + * \param[in] search_path A plugin path + * \return \herr_t + * + * \details H5PLappend() inserts a plugin path at the end of the plugin search path list. + * + * \since 1.10.1 + * + */ H5_DLL herr_t H5PLappend(const char *search_path); +/** + * \ingroup H5PL + * \brief Inserts a plugin path at the beginning of the plugin search path list + * + * \param[in] search_path A plugin path + * \return \herr_t + * + * \details H5PLprepend() inserts a plugin path at the end of the plugin search path list. + * + * \since 1.10.1 + * + */ H5_DLL herr_t H5PLprepend(const char *search_path); +/** + * \ingroup H5PL + * \brief Replaces the path at the specified index in the plugin search path list + * + * \param[in] search_path A plugin path + * \param[in] index Index + * \return \herr_t + * + * \details H5PLreplace() replaces a plugin path at the specified index in the plugin search path list. + * + * \since 1.10.1 + * + */ H5_DLL herr_t H5PLreplace(const char *search_path, unsigned int index); +/** + * \ingroup H5PL + * \brief Inserts a path at the specified index in the plugin search path list + * + * \param[in] search_path A plugin path + * \param[in] index Index + * \return \herr_t + * + * \details H5PLinsert() inserts a plugin path at the specified index in the plugin search path list, + * moving other paths after \p index. + * + * \since 1.10.1 + * + */ H5_DLL herr_t H5PLinsert(const char *search_path, unsigned int index); +/** + * \ingroup H5PL + * \brief Removes a plugin path at a specified index from the plugin search path list + * + * \param[in] index Index + * \return \herr_t + * + * \details H5PLremove() removes a plugin path at the specified \p index and compacts the plugin search path + * list. + * + * \since 1.10.1 + * + */ H5_DLL herr_t H5PLremove(unsigned int index); +/** + * \ingroup H5PL + * \brief Queries the plugin search path list at the specified index + * + * \param[in] index Index + * \param[out] path_buf Pathname + * \param[in] buf_size Size of \p path_buf + * \return Returns the length of the path, a non-negative value, if successful; otherwise returns a negative + * value. + * + * \details H5PLget() queries the plugin path at a specified index. If \p path_buf is non-NULL then it writes + * up to \p buf_size bytes into that buffer and always returns the length of the path name. + * + * If \p path_buf is NULL, this function will simply return the number of characters required to + * store the path name, ignoring \p path_buf and \p buf_size. + * + * If an error occurs then the buffer pointed to by \p path_buf (NULL or non-NULL) is unchanged and + * the function returns a negative value. If a zero is returned for the name's length, then there is + * no path name associated with the index. and the \p path_buf buffer will be unchanged. + * + * \since 1.10.1 + * + */ H5_DLL ssize_t H5PLget(unsigned int index, char *path_buf /*out*/, size_t buf_size); +/** + * \ingroup H5PL + * \brief Retrieves the number of stored plugin paths + * + * \param[out] num_paths Current length of the plugin search path list + * \return \herr_t + * + * \details H5PLsize() retrieves the number of paths stored in the plugin search path list. + * + * \since 1.10.1 + * + */ H5_DLL herr_t H5PLsize(unsigned int *num_paths /*out*/); #ifdef __cplusplus diff --git a/src/H5Tmodule.h b/src/H5Tmodule.h index b508dfdcaf3..fd545c20a39 100644 --- a/src/H5Tmodule.h +++ b/src/H5Tmodule.h @@ -29,4 +29,80 @@ #define H5_MY_PKG_ERR H5E_DATATYPE #define H5_MY_PKG_INIT YES +/** + * \defgroup H5T H5T + * \brief Datatype Interface + * \todo Describe concisely what the functions in this module are about. + * + * \defgroup ARRAY Array Datatypes + * \ingroup H5T + * \defgroup ATOM Atomic Datatypes + * \ingroup H5T + * \defgroup COMPOUND Compound Datatypes + * \ingroup H5T + * \defgroup CONV Conversion Function + * \ingroup H5T + * \defgroup ENUM Enumeration Datatypes + * \ingroup H5T + * \defgroup GTO General Datatype Operations + * \ingroup H5T + * \defgroup OPAQUE Opaque Datatypes + * \ingroup H5T + * \defgroup STRING String Datatypes + * \ingroup H5T + * \defgroup VLEN Variable-length Sequence Datatypes + * \ingroup H5T + * + * \defgroup PDT Predefined Datatypes + * \ingroup H5T + * \details What is a predefined HDF5 datatype? + * \todo Fill in the blanks! + * + * \defgroup PDTCPU By CPU + * \ingroup PDT + * \details CPU-specific datatypes + * \defgroup PDTALPHA DEC Alpha + * \ingroup PDTCPU + * \defgroup PDTX86 AMD & INTEL + * \ingroup PDTCPU + * \defgroup PDTMIPS SGI MIPS + * \ingroup PDTCPU + * + * \defgroup PDTIEEE IEEE + * \ingroup PDT + * \details The IEEE floating point types in big- and little-endian byte orders. + * + * \defgroup PDTSTD Standard Datatypes + * \ingroup PDT + * \details These are "standard" types. For instance, signed (2's complement) + * and unsigned integers of various sizes in big- and little-endian + * byte orders. + * + * \defgroup PDTUNIX UNIX-specific Datatypes + * \ingroup PDT + * \details Types which are particular to Unix. + * \todo Fill in the blanks! + * + * \defgroup PDTNAT Native Datatypes + * \ingroup PDT + * \details These are the datatypes detected during library \Emph{compilation} + * by \c H5detect(). Their names differ from other HDF5 datatype names + * as follows: + * \li Instead of a class name, precision and byte order as the last + * component, they have a C-like type name. + * \li If the type begins with \c U then it is the unsigned version of + * the integer type; other integer types are signed. + * \li The datatype \c LLONG corresponds C's \Code{long long} and + * \c LDOUBLE is \Code{long double}. These types might be the same + * as \c LONG and \c DOUBLE, respectively. + * \defgroup PDTC9x C9x Integer Datatypes + * \ingroup PDTNAT + * \details C9x integer types + * \todo Fill in the blanks! + * + * \defgroup PDTS Strings + * \ingroup PDT + * + */ + #endif /* _H5Tmodule_H */ diff --git a/src/H5Tpublic.h b/src/H5Tpublic.h index 73a00b68b7f..8bebb988b4c 100644 --- a/src/H5Tpublic.h +++ b/src/H5Tpublic.h @@ -23,197 +23,249 @@ #define HOFFSET(S, M) (offsetof(S, M)) -/* These are the various classes of datatypes */ -/* If this goes over 16 types (0-15), the file format will need to change) */ +/** + * These are the various classes of datatypes + * internal If this goes over 16 types (0-15), the file format will need to + * change. + */ +//! [H5T_class_t_snip] typedef enum H5T_class_t { - H5T_NO_CLASS = -1, /*error */ - H5T_INTEGER = 0, /*integer types */ - H5T_FLOAT = 1, /*floating-point types */ - H5T_TIME = 2, /*date and time types */ - H5T_STRING = 3, /*character string types */ - H5T_BITFIELD = 4, /*bit field types */ - H5T_OPAQUE = 5, /*opaque types */ - H5T_COMPOUND = 6, /*compound types */ - H5T_REFERENCE = 7, /*reference types */ - H5T_ENUM = 8, /*enumeration types */ - H5T_VLEN = 9, /*Variable-Length types */ - H5T_ARRAY = 10, /*Array types */ - - H5T_NCLASSES /*this must be last */ + H5T_NO_CLASS = -1, /**< error */ + H5T_INTEGER = 0, /**< integer types */ + H5T_FLOAT = 1, /**< floating-point types */ + H5T_TIME = 2, /**< date and time types */ + H5T_STRING = 3, /**< character string types */ + H5T_BITFIELD = 4, /**< bit field types */ + H5T_OPAQUE = 5, /**< opaque types */ + H5T_COMPOUND = 6, /**< compound types */ + H5T_REFERENCE = 7, /**< reference types */ + H5T_ENUM = 8, /**< enumeration types */ + H5T_VLEN = 9, /**< variable-Length types */ + H5T_ARRAY = 10, /**< array types */ + + H5T_NCLASSES /**< sentinel: this must be last */ } H5T_class_t; +//! [H5T_class_t_snip] -/* Byte orders */ +/** + * Byte orders + */ +//! [H5T_order_t_snip] typedef enum H5T_order_t { - H5T_ORDER_ERROR = -1, /*error */ - H5T_ORDER_LE = 0, /*little endian */ - H5T_ORDER_BE = 1, /*bit endian */ - H5T_ORDER_VAX = 2, /*VAX mixed endian */ - H5T_ORDER_MIXED = 3, /*Compound type with mixed member orders */ - H5T_ORDER_NONE = 4 /*no particular order (strings, bits,..) */ + H5T_ORDER_ERROR = -1, /**< error */ + H5T_ORDER_LE = 0, /**< little endian */ + H5T_ORDER_BE = 1, /**< bit endian */ + H5T_ORDER_VAX = 2, /**< VAX mixed endian */ + H5T_ORDER_MIXED = 3, /**< Compound type with mixed member orders */ + H5T_ORDER_NONE = 4 /**< no particular order (strings, bits,..) */ /*H5T_ORDER_NONE must be last */ } H5T_order_t; +//! [H5T_order_t_snip] -/* Types of integer sign schemes */ +/** + * Types of integer sign schemes + */ +//! [H5T_sign_t_snip] typedef enum H5T_sign_t { - H5T_SGN_ERROR = -1, /*error */ - H5T_SGN_NONE = 0, /*this is an unsigned type */ - H5T_SGN_2 = 1, /*two's complement */ + H5T_SGN_ERROR = -1, /**< error */ + H5T_SGN_NONE = 0, /**< this is an unsigned type */ + H5T_SGN_2 = 1, /**< two's complement */ - H5T_NSGN = 2 /*this must be last! */ + H5T_NSGN = 2 /** sentinel: this must be last! */ } H5T_sign_t; +//! [H5T_sign_t_snip] -/* Floating-point normalization schemes */ +/** + * Floating-point normalization schemes + */ +//! [H5T_norm_t_snip] typedef enum H5T_norm_t { - H5T_NORM_ERROR = -1, /*error */ - H5T_NORM_IMPLIED = 0, /*msb of mantissa isn't stored, always 1 */ - H5T_NORM_MSBSET = 1, /*msb of mantissa is always 1 */ - H5T_NORM_NONE = 2 /*not normalized */ + H5T_NORM_ERROR = -1, /**< error */ + H5T_NORM_IMPLIED = 0, /**< msb of mantissa isn't stored, always 1 */ + H5T_NORM_MSBSET = 1, /**< msb of mantissa is always 1 */ + H5T_NORM_NONE = 2 /**< not normalized */ /*H5T_NORM_NONE must be last */ } H5T_norm_t; +//! [H5T_norm_t_snip] -/* - * Character set to use for text strings. Do not change these values since - * they appear in HDF5 files! +/** + * Character set to use for text strings. + * \internal Do not change these values since they appear in HDF5 files! */ typedef enum H5T_cset_t { - H5T_CSET_ERROR = -1, /*error */ - H5T_CSET_ASCII = 0, /*US ASCII */ - H5T_CSET_UTF8 = 1, /*UTF-8 Unicode encoding */ - H5T_CSET_RESERVED_2 = 2, /*reserved for later use */ - H5T_CSET_RESERVED_3 = 3, /*reserved for later use */ - H5T_CSET_RESERVED_4 = 4, /*reserved for later use */ - H5T_CSET_RESERVED_5 = 5, /*reserved for later use */ - H5T_CSET_RESERVED_6 = 6, /*reserved for later use */ - H5T_CSET_RESERVED_7 = 7, /*reserved for later use */ - H5T_CSET_RESERVED_8 = 8, /*reserved for later use */ - H5T_CSET_RESERVED_9 = 9, /*reserved for later use */ - H5T_CSET_RESERVED_10 = 10, /*reserved for later use */ - H5T_CSET_RESERVED_11 = 11, /*reserved for later use */ - H5T_CSET_RESERVED_12 = 12, /*reserved for later use */ - H5T_CSET_RESERVED_13 = 13, /*reserved for later use */ - H5T_CSET_RESERVED_14 = 14, /*reserved for later use */ - H5T_CSET_RESERVED_15 = 15 /*reserved for later use */ + H5T_CSET_ERROR = -1, /**< error */ + H5T_CSET_ASCII = 0, /**< US ASCII */ + H5T_CSET_UTF8 = 1, /**< UTF-8 Unicode encoding */ + H5T_CSET_RESERVED_2 = 2, /**< reserved for later use */ + H5T_CSET_RESERVED_3 = 3, /**< reserved for later use */ + H5T_CSET_RESERVED_4 = 4, /**< reserved for later use */ + H5T_CSET_RESERVED_5 = 5, /**< reserved for later use */ + H5T_CSET_RESERVED_6 = 6, /**< reserved for later use */ + H5T_CSET_RESERVED_7 = 7, /**< reserved for later use */ + H5T_CSET_RESERVED_8 = 8, /**< reserved for later use */ + H5T_CSET_RESERVED_9 = 9, /**< reserved for later use */ + H5T_CSET_RESERVED_10 = 10, /**< reserved for later use */ + H5T_CSET_RESERVED_11 = 11, /**< reserved for later use */ + H5T_CSET_RESERVED_12 = 12, /**< reserved for later use */ + H5T_CSET_RESERVED_13 = 13, /**< reserved for later use */ + H5T_CSET_RESERVED_14 = 14, /**< reserved for later use */ + H5T_CSET_RESERVED_15 = 15 /**< reserved for later use */ } H5T_cset_t; -#define H5T_NCSET H5T_CSET_RESERVED_2 /*Number of character sets actually defined */ +#define H5T_NCSET H5T_CSET_RESERVED_2 /*Number of character sets actually defined */ -/* - * Type of padding to use in character strings. Do not change these values - * since they appear in HDF5 files! +/** + * Type of padding to use in character strings. + * \internal Do not change these values since they appear in HDF5 files! */ typedef enum H5T_str_t { - H5T_STR_ERROR = -1, /*error */ - H5T_STR_NULLTERM = 0, /*null terminate like in C */ - H5T_STR_NULLPAD = 1, /*pad with nulls */ - H5T_STR_SPACEPAD = 2, /*pad with spaces like in Fortran */ - H5T_STR_RESERVED_3 = 3, /*reserved for later use */ - H5T_STR_RESERVED_4 = 4, /*reserved for later use */ - H5T_STR_RESERVED_5 = 5, /*reserved for later use */ - H5T_STR_RESERVED_6 = 6, /*reserved for later use */ - H5T_STR_RESERVED_7 = 7, /*reserved for later use */ - H5T_STR_RESERVED_8 = 8, /*reserved for later use */ - H5T_STR_RESERVED_9 = 9, /*reserved for later use */ - H5T_STR_RESERVED_10 = 10, /*reserved for later use */ - H5T_STR_RESERVED_11 = 11, /*reserved for later use */ - H5T_STR_RESERVED_12 = 12, /*reserved for later use */ - H5T_STR_RESERVED_13 = 13, /*reserved for later use */ - H5T_STR_RESERVED_14 = 14, /*reserved for later use */ - H5T_STR_RESERVED_15 = 15 /*reserved for later use */ + H5T_STR_ERROR = -1, /**< error */ + H5T_STR_NULLTERM = 0, /**< null terminate like in C */ + H5T_STR_NULLPAD = 1, /**< pad with nulls */ + H5T_STR_SPACEPAD = 2, /**< pad with spaces like in Fortran */ + H5T_STR_RESERVED_3 = 3, /**< reserved for later use */ + H5T_STR_RESERVED_4 = 4, /**< reserved for later use */ + H5T_STR_RESERVED_5 = 5, /**< reserved for later use */ + H5T_STR_RESERVED_6 = 6, /**< reserved for later use */ + H5T_STR_RESERVED_7 = 7, /**< reserved for later use */ + H5T_STR_RESERVED_8 = 8, /**< reserved for later use */ + H5T_STR_RESERVED_9 = 9, /**< reserved for later use */ + H5T_STR_RESERVED_10 = 10, /**< reserved for later use */ + H5T_STR_RESERVED_11 = 11, /**< reserved for later use */ + H5T_STR_RESERVED_12 = 12, /**< reserved for later use */ + H5T_STR_RESERVED_13 = 13, /**< reserved for later use */ + H5T_STR_RESERVED_14 = 14, /**< reserved for later use */ + H5T_STR_RESERVED_15 = 15 /**< reserved for later use */ } H5T_str_t; -#define H5T_NSTR H5T_STR_RESERVED_3 /*num H5T_str_t types actually defined */ +#define H5T_NSTR H5T_STR_RESERVED_3 /*num H5T_str_t types actually defined */ -/* Type of padding to use in other atomic types */ +/** + * Type of padding to use in other atomic types + */ +//! [H5T_pad_t_snip] typedef enum H5T_pad_t { - H5T_PAD_ERROR = -1, /*error */ - H5T_PAD_ZERO = 0, /*always set to zero */ - H5T_PAD_ONE = 1, /*always set to one */ - H5T_PAD_BACKGROUND = 2, /*set to background value */ + H5T_PAD_ERROR = -1, /**< error */ + H5T_PAD_ZERO = 0, /**< always set to zero */ + H5T_PAD_ONE = 1, /**< always set to one */ + H5T_PAD_BACKGROUND = 2, /**< set to background value */ - H5T_NPAD = 3 /*THIS MUST BE LAST */ + H5T_NPAD = 3 /**< sentinal: THIS MUST BE LAST */ } H5T_pad_t; +//! [H5T_pad_t_snip] -/* Commands sent to conversion functions */ +/** + * Commands sent to conversion functions + */ typedef enum H5T_cmd_t { - H5T_CONV_INIT = 0, /*query and/or initialize private data */ - H5T_CONV_CONV = 1, /*convert data from source to dest datatype */ - H5T_CONV_FREE = 2 /*function is being removed from path */ + H5T_CONV_INIT = 0, /**< query and/or initialize private data */ + H5T_CONV_CONV = 1, /**< convert data from source to dest datatype */ + H5T_CONV_FREE = 2 /**< function is being removed from path */ } H5T_cmd_t; -/* How is the `bkg' buffer used by the conversion function? */ +/** + * How is the `bkg' buffer used by the conversion function? + */ typedef enum H5T_bkg_t { - H5T_BKG_NO = 0, /*background buffer is not needed, send NULL */ - H5T_BKG_TEMP = 1, /*bkg buffer used as temp storage only */ - H5T_BKG_YES = 2 /*init bkg buf with data before conversion */ + H5T_BKG_NO = 0, /**< background buffer is not needed, send NULL */ + H5T_BKG_TEMP = 1, /**< bkg buffer used as temp storage only */ + H5T_BKG_YES = 2 /**< init bkg buf with data before conversion */ } H5T_bkg_t; -/* Type conversion client data */ +/** + * Type conversion client data + */ +//! [H5T_cdata_t_snip] typedef struct H5T_cdata_t { - H5T_cmd_t command; /*what should the conversion function do? */ - H5T_bkg_t need_bkg; /*is the background buffer needed? */ - hbool_t recalc; /*recalculate private data */ - void * priv; /*private data */ + H5T_cmd_t command;/**< what should the conversion function do? */ + H5T_bkg_t need_bkg;/**< is the background buffer needed? */ + hbool_t recalc; /**< recalculate private data */ + void *priv; /**< private data */ } H5T_cdata_t; +//! [H5T_cdata_t_snip] -/* Conversion function persistence */ +/** + * Conversion function persistence + */ typedef enum H5T_pers_t { - H5T_PERS_DONTCARE = -1, /*wild card */ - H5T_PERS_HARD = 0, /*hard conversion function */ - H5T_PERS_SOFT = 1 /*soft conversion function */ + H5T_PERS_DONTCARE = -1, /**< wild card */ + H5T_PERS_HARD = 0, /**< hard conversion function */ + H5T_PERS_SOFT = 1 /**< soft conversion function */ } H5T_pers_t; -/* The order to retrieve atomic native datatype */ +/** + * The order to retrieve atomic native datatype + */ +//! [H5T_direction_t_snip] typedef enum H5T_direction_t { - H5T_DIR_DEFAULT = 0, /*default direction is inscendent */ - H5T_DIR_ASCEND = 1, /*in inscendent order */ - H5T_DIR_DESCEND = 2 /*in descendent order */ + H5T_DIR_DEFAULT = 0, /**< default direction is inscendent */ + H5T_DIR_ASCEND = 1, /**< in inscendent order */ + H5T_DIR_DESCEND = 2 /**< in descendent order */ } H5T_direction_t; +//! [H5T_direction_t_snip] -/* The exception type passed into the conversion callback function */ +/** + * The exception type passed into the conversion callback function + */ typedef enum H5T_conv_except_t { - H5T_CONV_EXCEPT_RANGE_HI = 0, /*source value is greater than destination's range */ - H5T_CONV_EXCEPT_RANGE_LOW = 1, /*source value is less than destination's range */ - H5T_CONV_EXCEPT_PRECISION = 2, /*source value loses precision in destination */ - H5T_CONV_EXCEPT_TRUNCATE = 3, /*source value is truncated in destination */ - H5T_CONV_EXCEPT_PINF = 4, /*source value is positive infinity(floating number) */ - H5T_CONV_EXCEPT_NINF = 5, /*source value is negative infinity(floating number) */ - H5T_CONV_EXCEPT_NAN = 6 /*source value is NaN(floating number) */ + H5T_CONV_EXCEPT_RANGE_HI = 0, /**< source value is greater than destination's range */ + H5T_CONV_EXCEPT_RANGE_LOW = 1, /**< source value is less than destination's range */ + H5T_CONV_EXCEPT_PRECISION = 2, /**< source value loses precision in destination */ + H5T_CONV_EXCEPT_TRUNCATE = 3, /**< source value is truncated in destination */ + H5T_CONV_EXCEPT_PINF = 4, /**< source value is positive infinity(floating number) */ + H5T_CONV_EXCEPT_NINF = 5, /**< source value is negative infinity(floating number) */ + H5T_CONV_EXCEPT_NAN = 6 /**< source value is NaN(floating number) */ } H5T_conv_except_t; -/* The return value from conversion callback function H5T_conv_except_func_t */ +/** + * The return value from conversion callback function H5T_conv_except_func_t() + */ typedef enum H5T_conv_ret_t { - H5T_CONV_ABORT = -1, /*abort conversion */ - H5T_CONV_UNHANDLED = 0, /*callback function failed to handle the exception */ - H5T_CONV_HANDLED = 1 /*callback function handled the exception successfully */ + H5T_CONV_ABORT = -1, /**< abort conversion */ + H5T_CONV_UNHANDLED = 0, /**< callback function failed to handle the exception */ + H5T_CONV_HANDLED = 1 /**< callback function handled the exception successfully */ } H5T_conv_ret_t; -/* Variable Length Datatype struct in memory */ -/* (This is only used for VL sequences, not VL strings, which are stored in char *'s) */ +/** + * Variable Length Datatype struct in memory (This is only used for VL + * sequences, not VL strings, which are stored in char *'s) + */ typedef struct { - size_t len; /* Length of VL data (in base type units) */ - void * p; /* Pointer to VL data */ + size_t len; /**< Length of VL data (in base type units) */ + void *p; /**< Pointer to VL data */ } hvl_t; /* Variable Length String information */ -#define H5T_VARIABLE \ - ((size_t)( \ - -1)) /* Indicate that a string is variable length (null-terminated in C, instead of fixed length) */ +/** + * Indicate that a string is variable length (null-terminated in C, instead of + * fixed length) + */ +#define H5T_VARIABLE ((size_t)(-1)) /* Opaque information */ -#define H5T_OPAQUE_TAG_MAX 256 /* Maximum length of an opaque tag */ - /* This could be raised without too much difficulty */ +/** + * Maximum length of an opaque tag + * \internal This could be raised without too much difficulty + */ +#define H5T_OPAQUE_TAG_MAX 256 #ifdef __cplusplus extern "C" { #endif -/* All datatype conversion functions are... */ -typedef herr_t (*H5T_conv_t)(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, - size_t bkg_stride, void *buf, void *bkg, hid_t dset_xfer_plist); +/** + * All datatype conversion functions are... + */ +//! [H5T_conv_t_snip] +typedef herr_t (*H5T_conv_t) (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, + size_t nelmts, size_t buf_stride, size_t bkg_stride, void *buf, + void *bkg, hid_t dset_xfer_plist); +//! [H5T_conv_t_snip] -/* Exception handler. If an exception like overflow happenes during conversion, - * this function is called if it's registered through H5Pset_type_conv_cb. +/** + * Exception handler. If an exception like overflow happenes during conversion, + * this function is called if it's registered through H5Pset_type_conv_cb(). */ -typedef H5T_conv_ret_t (*H5T_conv_except_func_t)(H5T_conv_except_t except_type, hid_t src_id, hid_t dst_id, - void *src_buf, void *dst_buf, void *user_data); +typedef H5T_conv_ret_t (*H5T_conv_except_func_t)(H5T_conv_except_t except_type, + hid_t src_id, hid_t dst_id, void *src_buf, void *dst_buf, void *user_data); /* When this header is included from a private header, don't make calls to H5open() */ #undef H5OPEN @@ -226,10 +278,26 @@ typedef H5T_conv_ret_t (*H5T_conv_except_func_t)(H5T_conv_except_t except_type, /* * The IEEE floating point types in various byte orders. */ -#define H5T_IEEE_F32BE (H5OPEN H5T_IEEE_F32BE_g) -#define H5T_IEEE_F32LE (H5OPEN H5T_IEEE_F32LE_g) -#define H5T_IEEE_F64BE (H5OPEN H5T_IEEE_F64BE_g) -#define H5T_IEEE_F64LE (H5OPEN H5T_IEEE_F64LE_g) +/** + * \ingroup PDTIEEE + * 32-bit big-endian IEEE floating-point numbers + */ +#define H5T_IEEE_F32BE (H5OPEN H5T_IEEE_F32BE_g) +/** + * \ingroup PDTIEEE + * 32-bit little-endian IEEE floating-point numbers + */ +#define H5T_IEEE_F32LE (H5OPEN H5T_IEEE_F32LE_g) +/** + * \ingroup PDTIEEE + * 64-bit big-endian IEEE floating-point numbers + */ +#define H5T_IEEE_F64BE (H5OPEN H5T_IEEE_F64BE_g) +/** + * \ingroup PDTIEEE + * 64-bit little-endian IEEE floating-point numbers + */ +#define H5T_IEEE_F64LE (H5OPEN H5T_IEEE_F64LE_g) H5_DLLVAR hid_t H5T_IEEE_F32BE_g; H5_DLLVAR hid_t H5T_IEEE_F32LE_g; H5_DLLVAR hid_t H5T_IEEE_F64BE_g; @@ -239,33 +307,141 @@ H5_DLLVAR hid_t H5T_IEEE_F64LE_g; * These are "standard" types. For instance, signed (2's complement) and * unsigned integers of various sizes and byte orders. */ -#define H5T_STD_I8BE (H5OPEN H5T_STD_I8BE_g) -#define H5T_STD_I8LE (H5OPEN H5T_STD_I8LE_g) -#define H5T_STD_I16BE (H5OPEN H5T_STD_I16BE_g) -#define H5T_STD_I16LE (H5OPEN H5T_STD_I16LE_g) -#define H5T_STD_I32BE (H5OPEN H5T_STD_I32BE_g) -#define H5T_STD_I32LE (H5OPEN H5T_STD_I32LE_g) -#define H5T_STD_I64BE (H5OPEN H5T_STD_I64BE_g) -#define H5T_STD_I64LE (H5OPEN H5T_STD_I64LE_g) -#define H5T_STD_U8BE (H5OPEN H5T_STD_U8BE_g) -#define H5T_STD_U8LE (H5OPEN H5T_STD_U8LE_g) -#define H5T_STD_U16BE (H5OPEN H5T_STD_U16BE_g) -#define H5T_STD_U16LE (H5OPEN H5T_STD_U16LE_g) -#define H5T_STD_U32BE (H5OPEN H5T_STD_U32BE_g) -#define H5T_STD_U32LE (H5OPEN H5T_STD_U32LE_g) -#define H5T_STD_U64BE (H5OPEN H5T_STD_U64BE_g) -#define H5T_STD_U64LE (H5OPEN H5T_STD_U64LE_g) -#define H5T_STD_B8BE (H5OPEN H5T_STD_B8BE_g) -#define H5T_STD_B8LE (H5OPEN H5T_STD_B8LE_g) -#define H5T_STD_B16BE (H5OPEN H5T_STD_B16BE_g) -#define H5T_STD_B16LE (H5OPEN H5T_STD_B16LE_g) -#define H5T_STD_B32BE (H5OPEN H5T_STD_B32BE_g) -#define H5T_STD_B32LE (H5OPEN H5T_STD_B32LE_g) -#define H5T_STD_B64BE (H5OPEN H5T_STD_B64BE_g) -#define H5T_STD_B64LE (H5OPEN H5T_STD_B64LE_g) -#define H5T_STD_REF_OBJ (H5OPEN H5T_STD_REF_OBJ_g) -#define H5T_STD_REF_DSETREG (H5OPEN H5T_STD_REF_DSETREG_g) -#define H5T_STD_REF (H5OPEN H5T_STD_REF_g) +/** + * \ingroup PDTSTD + * 8-bit big-endian signed integers + */ +#define H5T_STD_I8BE (H5OPEN H5T_STD_I8BE_g) +/** + * \ingroup PDTSTD + * 8-bit little-endian signed integers + */ +#define H5T_STD_I8LE (H5OPEN H5T_STD_I8LE_g) +/** + * \ingroup PDTSTD + * 16-bit big-endian signed integers + */ +#define H5T_STD_I16BE (H5OPEN H5T_STD_I16BE_g) +/** + * \ingroup PDTSTD + * 16-bit little-endian signed integers + */ +#define H5T_STD_I16LE (H5OPEN H5T_STD_I16LE_g) +/** + * \ingroup PDTSTD + * 32-bit big-endian signed integers + */ +#define H5T_STD_I32BE (H5OPEN H5T_STD_I32BE_g) +/** + * \ingroup PDTSTD + * 32-bit little-endian signed integers + */ +#define H5T_STD_I32LE (H5OPEN H5T_STD_I32LE_g) +/** + * \ingroup PDTSTD + * 64-bit big-endian signed integers + */ +#define H5T_STD_I64BE (H5OPEN H5T_STD_I64BE_g) +/** + * \ingroup PDTSTD + * 64-bit little-endian signed integers + */ +#define H5T_STD_I64LE (H5OPEN H5T_STD_I64LE_g) +/** + * \ingroup PDTSTD + * 8-bit big-endian unsigned integers + */ +#define H5T_STD_U8BE (H5OPEN H5T_STD_U8BE_g) +/** + * \ingroup PDTSTD + * 8-bit little-endian unsigned integers + */ +#define H5T_STD_U8LE (H5OPEN H5T_STD_U8LE_g) +/** + * \ingroup PDTSTD + * 16-bit big-endian unsigned integers + */ +#define H5T_STD_U16BE (H5OPEN H5T_STD_U16BE_g) +/** + * \ingroup PDTSTD + * 16-bit little-endian unsigned integers + */ +#define H5T_STD_U16LE (H5OPEN H5T_STD_U16LE_g) +/** + * \ingroup PDTSTD + * 32-bit big-endian unsigned integers + */ +#define H5T_STD_U32BE (H5OPEN H5T_STD_U32BE_g) +/** + * \ingroup PDTSTD + * 32-bit little-endian unsigned integers + */ +#define H5T_STD_U32LE (H5OPEN H5T_STD_U32LE_g) +/** + * \ingroup PDTSTD + * 64-bit big-endian unsigned integers + */ +#define H5T_STD_U64BE (H5OPEN H5T_STD_U64BE_g) +/** + * \ingroup PDTSTD + * 64-bit little-endian unsigned integers + */ +#define H5T_STD_U64LE (H5OPEN H5T_STD_U64LE_g) +/** + * \ingroup PDTSTD + * 8-bit big-endian bitfield + */ +#define H5T_STD_B8BE (H5OPEN H5T_STD_B8BE_g) +/** + * \ingroup PDTSTD + * 8-bit little-endian bitfield + */ +#define H5T_STD_B8LE (H5OPEN H5T_STD_B8LE_g) +/** + * \ingroup PDTSTD + * 16-bit big-endian bitfield + */ +#define H5T_STD_B16BE (H5OPEN H5T_STD_B16BE_g) +/** + * \ingroup PDTSTD + * 16-bit little-endian bitfield + */ +#define H5T_STD_B16LE (H5OPEN H5T_STD_B16LE_g) +/** + * \ingroup PDTSTD + * 32-bit big-endian bitfield + */ +#define H5T_STD_B32BE (H5OPEN H5T_STD_B32BE_g) +/** + * \ingroup PDTSTD + * 32-bit little-endian bitfield + */ +#define H5T_STD_B32LE (H5OPEN H5T_STD_B32LE_g) +/** + * \ingroup PDTSTD + * 64-bit big-endian bitfield + */ +#define H5T_STD_B64BE (H5OPEN H5T_STD_B64BE_g) +/** + * \ingroup PDTSTD + * 64-bit little-endian bitfield + */ +#define H5T_STD_B64LE (H5OPEN H5T_STD_B64LE_g) +/** + * \ingroup PDTSTD + * Object reference + */ +#define H5T_STD_REF_OBJ (H5OPEN H5T_STD_REF_OBJ_g) +/** + * \ingroup PDTSTD + * Dataset region reference + */ +#define H5T_STD_REF_DSETREG (H5OPEN H5T_STD_REF_DSETREG_g) +/** + * \ingroup PDTSTD + * Generic reference + */ +#define H5T_STD_REF (H5OPEN H5T_STD_REF_g) H5_DLLVAR hid_t H5T_STD_I8BE_g; H5_DLLVAR hid_t H5T_STD_I8LE_g; H5_DLLVAR hid_t H5T_STD_I16BE_g; @@ -297,10 +473,22 @@ H5_DLLVAR hid_t H5T_STD_REF_g; /* * Types which are particular to Unix. */ -#define H5T_UNIX_D32BE (H5OPEN H5T_UNIX_D32BE_g) -#define H5T_UNIX_D32LE (H5OPEN H5T_UNIX_D32LE_g) -#define H5T_UNIX_D64BE (H5OPEN H5T_UNIX_D64BE_g) -#define H5T_UNIX_D64LE (H5OPEN H5T_UNIX_D64LE_g) +/** + * \ingroup PDTUNIX + */ +#define H5T_UNIX_D32BE (H5OPEN H5T_UNIX_D32BE_g) +/** + * \ingroup PDTUNIX + */ +#define H5T_UNIX_D32LE (H5OPEN H5T_UNIX_D32LE_g) +/** + * \ingroup PDTUNIX + */ +#define H5T_UNIX_D64BE (H5OPEN H5T_UNIX_D64BE_g) +/** + * \ingroup PDTUNIX + */ +#define H5T_UNIX_D64LE (H5OPEN H5T_UNIX_D64LE_g) H5_DLLVAR hid_t H5T_UNIX_D32BE_g; H5_DLLVAR hid_t H5T_UNIX_D32LE_g; H5_DLLVAR hid_t H5T_UNIX_D64BE_g; @@ -310,12 +498,20 @@ H5_DLLVAR hid_t H5T_UNIX_D64LE_g; * Types particular to the C language. String types use `bytes' instead * of `bits' as their size. */ +/** + * \ingroup PDTS + * String datatype in C (size defined in bytes rather than in bits) + */ #define H5T_C_S1 (H5OPEN H5T_C_S1_g) H5_DLLVAR hid_t H5T_C_S1_g; /* * Types particular to Fortran. */ +/** + * \ingroup PDTS + * String datatype in Fortran (as defined for the HDF5 C library) + */ #define H5T_FORTRAN_S1 (H5OPEN H5T_FORTRAN_S1_g) H5_DLLVAR hid_t H5T_FORTRAN_S1_g; @@ -323,63 +519,239 @@ H5_DLLVAR hid_t H5T_FORTRAN_S1_g; * These types are for Intel CPU's. They are little endian with IEEE * floating point. */ -#define H5T_INTEL_I8 H5T_STD_I8LE -#define H5T_INTEL_I16 H5T_STD_I16LE -#define H5T_INTEL_I32 H5T_STD_I32LE -#define H5T_INTEL_I64 H5T_STD_I64LE -#define H5T_INTEL_U8 H5T_STD_U8LE -#define H5T_INTEL_U16 H5T_STD_U16LE -#define H5T_INTEL_U32 H5T_STD_U32LE -#define H5T_INTEL_U64 H5T_STD_U64LE -#define H5T_INTEL_B8 H5T_STD_B8LE -#define H5T_INTEL_B16 H5T_STD_B16LE -#define H5T_INTEL_B32 H5T_STD_B32LE -#define H5T_INTEL_B64 H5T_STD_B64LE -#define H5T_INTEL_F32 H5T_IEEE_F32LE -#define H5T_INTEL_F64 H5T_IEEE_F64LE +/** + * \ingroup PDTX86 + * 8-bit little-endian signed (2's complement) integers for Intel CPUs + */ +#define H5T_INTEL_I8 H5T_STD_I8LE +/** + * \ingroup PDTX86 + * 16-bit little-endian signed (2's complement) integers for Intel CPUs + */ +#define H5T_INTEL_I16 H5T_STD_I16LE +/** + * \ingroup PDTX86 + * 32-bit little-endian signed (2's complement) integers for Intel CPUs + */ +#define H5T_INTEL_I32 H5T_STD_I32LE +/** + * \ingroup PDTX86 + * 64-bit little-endian signed (2's complement) integers for Intel CPUs + */ +#define H5T_INTEL_I64 H5T_STD_I64LE +/** + * \ingroup PDTX86 + * 8-bit little-endian unsigned integers for Intel CPUs + */ +#define H5T_INTEL_U8 H5T_STD_U8LE +/** + * \ingroup PDTX86 + * 16-bit little-endian unsigned integers for Intel CPUs + */ +#define H5T_INTEL_U16 H5T_STD_U16LE +/** + * \ingroup PDTX86 + * 32-bit little-endian unsigned integers for Intel CPUs + */ +#define H5T_INTEL_U32 H5T_STD_U32LE +/** + * \ingroup PDTX86 + * 64-bit little-endian unsigned integers for Intel CPUs + */ +#define H5T_INTEL_U64 H5T_STD_U64LE +/** + * \ingroup PDTX86 + * 8-bit little-endian bitfield for Intel CPUs + */ +#define H5T_INTEL_B8 H5T_STD_B8LE +/** + * \ingroup PDTX86 + * 16-bit little-endian bitfield for Intel CPUs + */ +#define H5T_INTEL_B16 H5T_STD_B16LE +/** + * \ingroup PDTX86 + * 32-bit little-endian bitfield for Intel CPUs + */ +#define H5T_INTEL_B32 H5T_STD_B32LE +/** + * \ingroup PDTX86 + * 64-bit little-endian bitfield for Intel CPUs + */ +#define H5T_INTEL_B64 H5T_STD_B64LE +/** + * \ingroup PDTX86 + * 32-bit little-endian IEEE floating-point numbers for Intel CPUs + */ +#define H5T_INTEL_F32 H5T_IEEE_F32LE +/** + * \ingroup PDTX86 + * 64-bit little-endian IEEE floating-point numbers for Intel CPUs + */ +#define H5T_INTEL_F64 H5T_IEEE_F64LE /* * These types are for DEC Alpha CPU's. They are little endian with IEEE * floating point. */ -#define H5T_ALPHA_I8 H5T_STD_I8LE -#define H5T_ALPHA_I16 H5T_STD_I16LE -#define H5T_ALPHA_I32 H5T_STD_I32LE -#define H5T_ALPHA_I64 H5T_STD_I64LE -#define H5T_ALPHA_U8 H5T_STD_U8LE -#define H5T_ALPHA_U16 H5T_STD_U16LE -#define H5T_ALPHA_U32 H5T_STD_U32LE -#define H5T_ALPHA_U64 H5T_STD_U64LE -#define H5T_ALPHA_B8 H5T_STD_B8LE -#define H5T_ALPHA_B16 H5T_STD_B16LE -#define H5T_ALPHA_B32 H5T_STD_B32LE -#define H5T_ALPHA_B64 H5T_STD_B64LE -#define H5T_ALPHA_F32 H5T_IEEE_F32LE -#define H5T_ALPHA_F64 H5T_IEEE_F64LE +/** + * \ingroup PDTALPHA + * 8-bit little-endian signed (2's complement) integers for DEC Alpha CPUs + */ +#define H5T_ALPHA_I8 H5T_STD_I8LE +/** + * \ingroup PDTALPHA + * 16-bit little-endian signed (2's complement) integers for DEC Alpha CPUs + */ +#define H5T_ALPHA_I16 H5T_STD_I16LE +/** + * \ingroup PDTALPHA + * 32-bit little-endian signed (2's complement) integers for DEC Alpha CPUs + */ +#define H5T_ALPHA_I32 H5T_STD_I32LE +/** + * \ingroup PDTALPHA + * 64-bit little-endian signed (2's complement) integers for DEC Alpha CPUs + */ +#define H5T_ALPHA_I64 H5T_STD_I64LE +/** + * \ingroup PDTALPHA + * 8-bit little-endian unsigned integers for DEC Alpha CPUs + */ +#define H5T_ALPHA_U8 H5T_STD_U8LE +/** + * \ingroup PDTALPHA + * 16-bit little-endian unsigned integers for DEC Alpha CPUs + */ +#define H5T_ALPHA_U16 H5T_STD_U16LE +/** + * \ingroup PDTALPHA + * 32-bit little-endian unsigned integers for DEC Alpha CPUs + */ +#define H5T_ALPHA_U32 H5T_STD_U32LE +/** + * \ingroup PDTALPHA + * 64-bit little-endian unsigned integers for DEC Alpha CPUs + */ +#define H5T_ALPHA_U64 H5T_STD_U64LE +/** + * \ingroup PDTALPHA + * 8-bit little-endian bitfield for DEC Alpha CPUs + */ +#define H5T_ALPHA_B8 H5T_STD_B8LE +/** + * \ingroup PDTALPHA + * 16-bit little-endian bitfield for DEC Alpha CPUs + */ +#define H5T_ALPHA_B16 H5T_STD_B16LE +/** + * \ingroup PDTALPHA + * 32-bit little-endian bitfield for DEC Alpha CPUs + */ +#define H5T_ALPHA_B32 H5T_STD_B32LE +/** + * \ingroup PDTALPHA + * 64-bit little-endian bitfield for DEC Alpha CPUs + */ +#define H5T_ALPHA_B64 H5T_STD_B64LE +/** + * \ingroup PDTALPHA + * 32-bit little-endian IEEE floating-point numbers for DEC Alpha CPUs + */ +#define H5T_ALPHA_F32 H5T_IEEE_F32LE +/** + * \ingroup PDTALPHA + * 64-bit little-endian IEEE floating-point numbers for DEC Alpha CPUs + */ +#define H5T_ALPHA_F64 H5T_IEEE_F64LE /* * These types are for MIPS cpu's commonly used in SGI systems. They are big * endian with IEEE floating point. */ -#define H5T_MIPS_I8 H5T_STD_I8BE -#define H5T_MIPS_I16 H5T_STD_I16BE -#define H5T_MIPS_I32 H5T_STD_I32BE -#define H5T_MIPS_I64 H5T_STD_I64BE -#define H5T_MIPS_U8 H5T_STD_U8BE -#define H5T_MIPS_U16 H5T_STD_U16BE -#define H5T_MIPS_U32 H5T_STD_U32BE -#define H5T_MIPS_U64 H5T_STD_U64BE -#define H5T_MIPS_B8 H5T_STD_B8BE -#define H5T_MIPS_B16 H5T_STD_B16BE -#define H5T_MIPS_B32 H5T_STD_B32BE -#define H5T_MIPS_B64 H5T_STD_B64BE -#define H5T_MIPS_F32 H5T_IEEE_F32BE -#define H5T_MIPS_F64 H5T_IEEE_F64BE +/** + * \ingroup PDTMIPS + * 8-bit big-endian signed (2's complement) integers for SGI MIPS CPUs + */ +#define H5T_MIPS_I8 H5T_STD_I8BE +/** + * \ingroup PDTMIPS + * 16-bit big-endian signed (2's complement) integers for SGI MIPS CPUs + */ +#define H5T_MIPS_I16 H5T_STD_I16BE +/** + * \ingroup PDTMIPS + * 32-bit big-endian signed (2's complement) integers for SGI MIPS CPUs + */ +#define H5T_MIPS_I32 H5T_STD_I32BE +/** + * \ingroup PDTMIPS + * 64-bit big-endian signed (2's complement) integers for SGI MIPS CPUs + */ +#define H5T_MIPS_I64 H5T_STD_I64BE +/** + * \ingroup PDTMIPS + * 8-bit big-endian unsigned integers for SGI MIPS CPUs + */ +#define H5T_MIPS_U8 H5T_STD_U8BE +/** + * \ingroup PDTMIPS + * 16-bit big-endian unsigned integers for SGI MIPS CPUs + */ +#define H5T_MIPS_U16 H5T_STD_U16BE +/** + * \ingroup PDTMIPS + * 32-bit big-endian unsigned integers for SGI MIPS CPUs + */ +#define H5T_MIPS_U32 H5T_STD_U32BE +/** + * \ingroup PDTMIPS + * 64-bit big-endian unsigned integers for SGI MIPS CPUs + */ +#define H5T_MIPS_U64 H5T_STD_U64BE +/** + * \ingroup PDTMIPS + * 8-bit big-endian bitfield for SGI MIPS CPUs + */ +#define H5T_MIPS_B8 H5T_STD_B8BE +/** + * \ingroup PDTMIPS + * 16-bit big-endian bitfield for SGI MIPS CPUs + */ +#define H5T_MIPS_B16 H5T_STD_B16BE +/** + * \ingroup PDTMIPS + * 32-bit big-endian bitfield for SGI MIPS CPUs + */ +#define H5T_MIPS_B32 H5T_STD_B32BE +/** + * \ingroup PDTMIPS + * 64-bit big-endian bitfield for SGI MIPS CPUs + */ +#define H5T_MIPS_B64 H5T_STD_B64BE +/** + * \ingroup PDTMIPS + * 32-bit big-endian IEEE floating-point numbers for MIPS CPUs + */ +#define H5T_MIPS_F32 H5T_IEEE_F32BE +/** + * \ingroup PDTMIPS + * 64-bit big-endian IEEE floating-point numbers for MIPS CPUs + */ +#define H5T_MIPS_F64 H5T_IEEE_F64BE /* * The VAX floating point types (i.e. in VAX byte order) */ +/** + * \ingroup PDTALPHA + * 32-bit VAX byte order floating-point numbers for OpenVMS on DEC Alpha CPUs + */ #define H5T_VAX_F32 (H5OPEN H5T_VAX_F32_g) +/** + * \ingroup PDTALPHA + * 64-bit VAX byte order floating-point numbers for OpenVMS on DEC Alpha CPUs + */ #define H5T_VAX_F64 (H5OPEN H5T_VAX_F64_g) H5_DLLVAR hid_t H5T_VAX_F32_g; H5_DLLVAR hid_t H5T_VAX_F64_g; @@ -393,32 +765,128 @@ H5_DLLVAR hid_t H5T_VAX_F64_g; * to C's `long long' and LDOUBLE is `long double' (these types might be the * same as `LONG' and `DOUBLE' respectively). */ -#define H5T_NATIVE_CHAR (CHAR_MIN ? H5T_NATIVE_SCHAR : H5T_NATIVE_UCHAR) +/** + * \ingroup PDTNAT + * C-style \c char + */ +#define H5T_NATIVE_CHAR (CHAR_MIN?H5T_NATIVE_SCHAR:H5T_NATIVE_UCHAR) +/** + * \ingroup PDTNAT + * C-style \Code{signed char} + */ #define H5T_NATIVE_SCHAR (H5OPEN H5T_NATIVE_SCHAR_g) +/** + * \ingroup PDTNAT + * C-style \Code{unsigned char} + */ #define H5T_NATIVE_UCHAR (H5OPEN H5T_NATIVE_UCHAR_g) +/** + * \ingroup PDTNAT + * C-style \Code{short} + */ #define H5T_NATIVE_SHORT (H5OPEN H5T_NATIVE_SHORT_g) +/** + * \ingroup PDTNAT + * C-style \Code{unsigned short} + */ #define H5T_NATIVE_USHORT (H5OPEN H5T_NATIVE_USHORT_g) +/** + * \ingroup PDTNAT + * C-style \Code{int} + */ #define H5T_NATIVE_INT (H5OPEN H5T_NATIVE_INT_g) +/** + * \ingroup PDTNAT + * C-style \Code{unsigned int} + */ #define H5T_NATIVE_UINT (H5OPEN H5T_NATIVE_UINT_g) +/** + * \ingroup PDTNAT + * C-style \Code{long} + */ #define H5T_NATIVE_LONG (H5OPEN H5T_NATIVE_LONG_g) +/** + * \ingroup PDTNAT + * C-style \Code{unsigned long} + */ #define H5T_NATIVE_ULONG (H5OPEN H5T_NATIVE_ULONG_g) +/** + * \ingroup PDTNAT + * C-style \Code{long long} + */ #define H5T_NATIVE_LLONG (H5OPEN H5T_NATIVE_LLONG_g) +/** + * \ingroup PDTNAT + * C-style \Code{unsigned long long} + */ #define H5T_NATIVE_ULLONG (H5OPEN H5T_NATIVE_ULLONG_g) +/** + * \ingroup PDTNAT + * C-style \Code{float} + */ #define H5T_NATIVE_FLOAT (H5OPEN H5T_NATIVE_FLOAT_g) +/** + * \ingroup PDTNAT + * C-style \Code{double} + */ #define H5T_NATIVE_DOUBLE (H5OPEN H5T_NATIVE_DOUBLE_g) -#if H5_SIZEOF_LONG_DOUBLE != 0 +#if H5_SIZEOF_LONG_DOUBLE !=0 +/** + * \ingroup PDTNAT + * C-style \Code{long double} + */ #define H5T_NATIVE_LDOUBLE (H5OPEN H5T_NATIVE_LDOUBLE_g) #endif +/** + * \ingroup PDTNAT + * HDF5 8-bit bitfield based on native types + */ #define H5T_NATIVE_B8 (H5OPEN H5T_NATIVE_B8_g) +/** + * \ingroup PDTNAT + * HDF5 16-bit bitfield based on native types + */ #define H5T_NATIVE_B16 (H5OPEN H5T_NATIVE_B16_g) +/** + * \ingroup PDTNAT + * HDF5 32-bit bitfield based on native types + */ #define H5T_NATIVE_B32 (H5OPEN H5T_NATIVE_B32_g) -#define H5T_NATIVE_B64 (H5OPEN H5T_NATIVE_B64_g) +/** + * \ingroup PDTNAT + * HDF5 64-bit bitfield based on native types + */ +#define H5T_NATIVE_B64 (H5OPEN H5T_NATIVE_B64_g) +/** + * \ingroup PDTNAT + * HDF5 opaque unit based on native types + */ #define H5T_NATIVE_OPAQUE (H5OPEN H5T_NATIVE_OPAQUE_g) +/** + * \ingroup PDTNAT + * HDF5 address type based on native types + */ #define H5T_NATIVE_HADDR (H5OPEN H5T_NATIVE_HADDR_g) +/** + * \ingroup PDTNAT + * HDF5 size type based on native types + */ #define H5T_NATIVE_HSIZE (H5OPEN H5T_NATIVE_HSIZE_g) +/** + * \ingroup PDTNAT + * HDF5 signed size type based on native types + */ #define H5T_NATIVE_HSSIZE (H5OPEN H5T_NATIVE_HSSIZE_g) -#define H5T_NATIVE_HERR (H5OPEN H5T_NATIVE_HERR_g) -#define H5T_NATIVE_HBOOL (H5OPEN H5T_NATIVE_HBOOL_g) +/** + * \ingroup PDTNAT + * HDF5 error code type based on native types + */ +#define H5T_NATIVE_HERR (H5OPEN H5T_NATIVE_HERR_g) +/** + * \ingroup PDTNAT + * HDF5 Boolean type based on native types + */ +#define H5T_NATIVE_HBOOL (H5OPEN H5T_NATIVE_HBOOL_g) H5_DLLVAR hid_t H5T_NATIVE_SCHAR_g; H5_DLLVAR hid_t H5T_NATIVE_UCHAR_g; H5_DLLVAR hid_t H5T_NATIVE_SHORT_g; @@ -446,12 +914,30 @@ H5_DLLVAR hid_t H5T_NATIVE_HERR_g; H5_DLLVAR hid_t H5T_NATIVE_HBOOL_g; /* C9x integer types */ -#define H5T_NATIVE_INT8 (H5OPEN H5T_NATIVE_INT8_g) -#define H5T_NATIVE_UINT8 (H5OPEN H5T_NATIVE_UINT8_g) +/** + * \ingroup PDTC9x + */ +#define H5T_NATIVE_INT8 (H5OPEN H5T_NATIVE_INT8_g) +/** + * \ingroup PDTC9x + */ +#define H5T_NATIVE_UINT8 (H5OPEN H5T_NATIVE_UINT8_g) +/** + * \ingroup PDTC9x + */ #define H5T_NATIVE_INT_LEAST8 (H5OPEN H5T_NATIVE_INT_LEAST8_g) -#define H5T_NATIVE_UINT_LEAST8 (H5OPEN H5T_NATIVE_UINT_LEAST8_g) -#define H5T_NATIVE_INT_FAST8 (H5OPEN H5T_NATIVE_INT_FAST8_g) -#define H5T_NATIVE_UINT_FAST8 (H5OPEN H5T_NATIVE_UINT_FAST8_g) +/** + * \ingroup PDTC9x + */ +#define H5T_NATIVE_UINT_LEAST8 (H5OPEN H5T_NATIVE_UINT_LEAST8_g) +/** + * \ingroup PDTC9x + */ +#define H5T_NATIVE_INT_FAST8 (H5OPEN H5T_NATIVE_INT_FAST8_g) +/** + * \ingroup PDTC9x + */ +#define H5T_NATIVE_UINT_FAST8 (H5OPEN H5T_NATIVE_UINT_FAST8_g) H5_DLLVAR hid_t H5T_NATIVE_INT8_g; H5_DLLVAR hid_t H5T_NATIVE_UINT8_g; H5_DLLVAR hid_t H5T_NATIVE_INT_LEAST8_g; @@ -459,12 +945,30 @@ H5_DLLVAR hid_t H5T_NATIVE_UINT_LEAST8_g; H5_DLLVAR hid_t H5T_NATIVE_INT_FAST8_g; H5_DLLVAR hid_t H5T_NATIVE_UINT_FAST8_g; -#define H5T_NATIVE_INT16 (H5OPEN H5T_NATIVE_INT16_g) -#define H5T_NATIVE_UINT16 (H5OPEN H5T_NATIVE_UINT16_g) -#define H5T_NATIVE_INT_LEAST16 (H5OPEN H5T_NATIVE_INT_LEAST16_g) -#define H5T_NATIVE_UINT_LEAST16 (H5OPEN H5T_NATIVE_UINT_LEAST16_g) -#define H5T_NATIVE_INT_FAST16 (H5OPEN H5T_NATIVE_INT_FAST16_g) -#define H5T_NATIVE_UINT_FAST16 (H5OPEN H5T_NATIVE_UINT_FAST16_g) +/** + * \ingroup PDTC9x + */ +#define H5T_NATIVE_INT16 (H5OPEN H5T_NATIVE_INT16_g) +/** + * \ingroup PDTC9x + */ +#define H5T_NATIVE_UINT16 (H5OPEN H5T_NATIVE_UINT16_g) +/** + * \ingroup PDTC9x + */ +#define H5T_NATIVE_INT_LEAST16 (H5OPEN H5T_NATIVE_INT_LEAST16_g) +/** + * \ingroup PDTC9x + */ +#define H5T_NATIVE_UINT_LEAST16 (H5OPEN H5T_NATIVE_UINT_LEAST16_g) +/** + * \ingroup PDTC9x + */ +#define H5T_NATIVE_INT_FAST16 (H5OPEN H5T_NATIVE_INT_FAST16_g) +/** + * \ingroup PDTC9x + */ +#define H5T_NATIVE_UINT_FAST16 (H5OPEN H5T_NATIVE_UINT_FAST16_g) H5_DLLVAR hid_t H5T_NATIVE_INT16_g; H5_DLLVAR hid_t H5T_NATIVE_UINT16_g; H5_DLLVAR hid_t H5T_NATIVE_INT_LEAST16_g; @@ -472,12 +976,30 @@ H5_DLLVAR hid_t H5T_NATIVE_UINT_LEAST16_g; H5_DLLVAR hid_t H5T_NATIVE_INT_FAST16_g; H5_DLLVAR hid_t H5T_NATIVE_UINT_FAST16_g; -#define H5T_NATIVE_INT32 (H5OPEN H5T_NATIVE_INT32_g) -#define H5T_NATIVE_UINT32 (H5OPEN H5T_NATIVE_UINT32_g) -#define H5T_NATIVE_INT_LEAST32 (H5OPEN H5T_NATIVE_INT_LEAST32_g) -#define H5T_NATIVE_UINT_LEAST32 (H5OPEN H5T_NATIVE_UINT_LEAST32_g) -#define H5T_NATIVE_INT_FAST32 (H5OPEN H5T_NATIVE_INT_FAST32_g) -#define H5T_NATIVE_UINT_FAST32 (H5OPEN H5T_NATIVE_UINT_FAST32_g) +/** + * \ingroup PDTC9x + */ +#define H5T_NATIVE_INT32 (H5OPEN H5T_NATIVE_INT32_g) +/** + * \ingroup PDTC9x + */ +#define H5T_NATIVE_UINT32 (H5OPEN H5T_NATIVE_UINT32_g) +/** + * \ingroup PDTC9x + */ +#define H5T_NATIVE_INT_LEAST32 (H5OPEN H5T_NATIVE_INT_LEAST32_g) +/** + * \ingroup PDTC9x + */ +#define H5T_NATIVE_UINT_LEAST32 (H5OPEN H5T_NATIVE_UINT_LEAST32_g) +/** + * \ingroup PDTC9x + */ +#define H5T_NATIVE_INT_FAST32 (H5OPEN H5T_NATIVE_INT_FAST32_g) +/** + * \ingroup PDTC9x + */ +#define H5T_NATIVE_UINT_FAST32 (H5OPEN H5T_NATIVE_UINT_FAST32_g) H5_DLLVAR hid_t H5T_NATIVE_INT32_g; H5_DLLVAR hid_t H5T_NATIVE_UINT32_g; H5_DLLVAR hid_t H5T_NATIVE_INT_LEAST32_g; @@ -485,12 +1007,30 @@ H5_DLLVAR hid_t H5T_NATIVE_UINT_LEAST32_g; H5_DLLVAR hid_t H5T_NATIVE_INT_FAST32_g; H5_DLLVAR hid_t H5T_NATIVE_UINT_FAST32_g; -#define H5T_NATIVE_INT64 (H5OPEN H5T_NATIVE_INT64_g) -#define H5T_NATIVE_UINT64 (H5OPEN H5T_NATIVE_UINT64_g) -#define H5T_NATIVE_INT_LEAST64 (H5OPEN H5T_NATIVE_INT_LEAST64_g) +/** + * \ingroup PDTC9x + */ +#define H5T_NATIVE_INT64 (H5OPEN H5T_NATIVE_INT64_g) +/** + * \ingroup PDTC9x + */ +#define H5T_NATIVE_UINT64 (H5OPEN H5T_NATIVE_UINT64_g) +/** + * \ingroup PDTC9x + */ +#define H5T_NATIVE_INT_LEAST64 (H5OPEN H5T_NATIVE_INT_LEAST64_g) +/** + * \ingroup PDTC9x + */ #define H5T_NATIVE_UINT_LEAST64 (H5OPEN H5T_NATIVE_UINT_LEAST64_g) -#define H5T_NATIVE_INT_FAST64 (H5OPEN H5T_NATIVE_INT_FAST64_g) -#define H5T_NATIVE_UINT_FAST64 (H5OPEN H5T_NATIVE_UINT_FAST64_g) +/** + * \ingroup PDTC9x + */ +#define H5T_NATIVE_INT_FAST64 (H5OPEN H5T_NATIVE_INT_FAST64_g) +/** + * \ingroup PDTC9x + */ +#define H5T_NATIVE_UINT_FAST64 (H5OPEN H5T_NATIVE_UINT_FAST64_g) H5_DLLVAR hid_t H5T_NATIVE_INT64_g; H5_DLLVAR hid_t H5T_NATIVE_UINT64_g; H5_DLLVAR hid_t H5T_NATIVE_INT_LEAST64_g; @@ -499,92 +1039,1837 @@ H5_DLLVAR hid_t H5T_NATIVE_INT_FAST64_g; H5_DLLVAR hid_t H5T_NATIVE_UINT_FAST64_g; /* Operations defined on all datatypes */ +/** + * \ingroup H5T + * + * \brief Creates a new datatype. + * + * \param[in] type Class of datatype to create + * \param[in] size Size, in bytes, of the datatype being created + * + * \return \hid_t{datatype} + * + * \details H5Tcreate() creates a new datatype of the specified class with the + * specified number of bytes. This function is used only with the + * following datatype classes: + * - #H5T_COMPOUND + * - #H5T_OPAQUE + * - #H5T_ENUM + * - #H5T_STRING + * + * Other datatypes, including integer and floating-point datatypes, + * are typically created by using H5Tcopy() to copy and modify a + * predefined datatype. + * + * When creating a variable-length string datatype, \p size must + * be #H5T_VARIABLE. + * + * When creating a fixed-length string datatype, \p size will + * be the length of the string in bytes. The length of the + * string in characters will depend on i the encoding used; see + * H5Pset_char_encoding(). + * + * ENUMs created with this function have a signed native integer + * base datatype. Use H5Tenum_create() if a different integer base + * datatype is required. + * + * The datatype identifier returned from this function should be + * released with H5Tclose or resource leaks will result. + * + * \since 1.2.0 + * + * \see H5Tclose() + * + * \todo Original has a reference to “Creating variable-length string + * datatypes”. + * \todo Create an example for H5Tcreate. + * + */ H5_DLL hid_t H5Tcreate(H5T_class_t type, size_t size); +/** + * \ingroup H5T + * + * \brief Copies an existing datatype. + * + * \type_id + * + * \return \hid_t{datatype} + * + * \details H5Tcopy() makes a copy of an existing datatype. The returned type + * is always transient and unlocked. + * + * The \p type_id argument can be either a datatype identifier, + * a predefined datatype (defined in H5Tpublic.h), or a dataset + * identifier. If \p type_id is a dataset identifier, this function + * returns a transient, modifiable datatype which is a copy of the + * dataset's datatype. + * + * The returned datatype identifier should be released with H5Tclose() + * to prevent resource leak. + * + * \todo Create an example for H5Tcopy(). + * + */ H5_DLL hid_t H5Tcopy(hid_t type_id); +/** + * \ingroup H5T + * + * \brief Releases a datatype + * + * \type_id + * + * \return \herr_t + * + * \details H5Tclose() releases the datatype \p dtype_id. Further access + * through this datatype identifier is illegal. Failure to release + * a datatype with this call will result in resource leaks. + * + */ H5_DLL herr_t H5Tclose(hid_t type_id); +/** + * \ingroup H5T + * + * \brief Determines whether two datatype identifiers refer to the same datatype + * + * \type_id{type1_id} + * \type_id{type2_id} + * + * \return \htri_t + * + * \details H5Tequal() determines whether two datatype identifiers refer to + * the same datatype. + * + * \since 1.6 or earlier + * + */ H5_DLL htri_t H5Tequal(hid_t type1_id, hid_t type2_id); +/** + * \ingroup H5T + * + * \brief Locks a datatype + * + * \type_id + * + * \return \herr_t + * + * \details H5Tlock() locks the datatype specified by the dtype_id identifier, + * making it read-only and non-destructible. This is normally done by + * the library for predefined datatypes so the application does not + * inadvertently change or delete a predefined type. Once a datatype + * is locked it can never be unlocked. + * + */ H5_DLL herr_t H5Tlock(hid_t type_id); +/** + * \ingroup H5T + * + * \brief Commits a transient datatype, linking it into the file and creating + * a new committed datatype + * + * \fg_loc_id + * \param[in] name Name given to committed datatype + * \type_id Identifier of datatype to be committed and, upon function’s + * return, identifier for the committed datatype + * \lcpl_id + * \tcpl_id + * \tapl_id + * + * \return \herr_t + * + * \details H5Tcommit2() saves a transient datatype as an immutable committed + * datatype in a file. The datatype specified by \p dtype_id is + * committed to the file with the name name at the location specified + * by \p loc_id and with the datatype creation and access property + * lists \p tcpl_id and \p tapl_id, respectively. + * + * \p loc_id may be a file identifier, or a group identifier within + * that file. \p name may be either an absolute path in the file or + * a relative path from \p loc_id naming the newly-commited datatype. + * + * The link creation property list, \p lcpl_id, governs creation of + * the link(s) by which the new committed datatype is accessed and + * the creation of any intermediate groups that may be missing. + * + * Once commited, this datatype may be used to define the datatype + * of any other dataset or attribute in the file. + * + * This function will not accept a datatype that cannot actually hold + * information. This currently includes compound datatypes with no + * fields and enumerated datatypes with no members. + * + * Committed datatypes are sometimes referred to as named datatypes. + * + * \version 1.8.7 Function modified in this release to reject datatypes that + * will not accomodate actual data, such as a compound datatype + * with no fields or an enumerated datatype with no members. + * + * \since 1.8.0 + * + */ H5_DLL herr_t H5Tcommit2(hid_t loc_id, const char *name, hid_t type_id, hid_t lcpl_id, hid_t tcpl_id, hid_t tapl_id); +/** + * -------------------------------------------------------------------------- + * \ingroup H5T + * + * \brief Opens a committed (named) datatype + * + * \fgdta_loc_id + * \param[in] name Name of the datatype to open + * \tapl_id + * + * \return \hid_t{datatype} + * + * \details H5Topen2() opens a committed datatype at the location specified + * by \p loc_id and returns an identifier for the datatype. \p + * loc_id is either a file or group identifier. The identifier should + * eventually be closed by calling H5Tclose() to release resources. + * + * The committed datatype is opened with the datatype access property + * list tapl_id. + * + * \since 1.8.0 + * + */ H5_DLL hid_t H5Topen2(hid_t loc_id, const char *name, hid_t tapl_id); +/** + * \ingroup H5T + * + * \brief Commits a transient datatype to a file, creating a new named + * datatype, but does not link it into the file structure + * + * \fg_loc_id + * \type_id + * \tcpl_id + * \tapl_id + * + * \return \herr_t + * + * \details H5Tcommit_anon() commits a transient datatype (not immutable) + * to a file, turning it into a named datatype with the specified + * creation and property lists. With default property lists, + * #H5P_DEFAULT, H5Tcommit_anon() provides similar functionality to + * that of H5Tcommit(), with the differences described below. + * + * #H5P_DEFAULT can be passed in for the datatype creation property + * list identifier, \p tcpl_id. The datatype access property list + * identifier, \p tapl_id, is provided for future functionality and + * is not used at this time. This parameter should always be passed + * as the value #H5P_DEFAULT. + * + * Note that H5Tcommit_anon() does not link this newly-committed + * datatype into the file. After the H5Tcommit_anon() call, the + * datatype identifier \p type_id must be linked into the HDF5 file + * structure with H5Olink() or it will be deleted from the file when + * the file is closed. + * + * The differences between this function and H5Tcommit() are as follows: + * \li H5Tcommit_anon() explicitly includes property lists, + * which provides for greater control of the creation process + * and of the properties of the new named datatype. H5Tcommit() + * always uses default properties. + * \li H5Tcommit_anon() neither provides the new named datatype’s + * name nor links it into the HDF5 file structure; those actions + * must be performed separately through a call to H5Olink(), + * which offers greater control over linking. + * + * This function will not accept a datatype that cannot actually + * hold data. This currently includes compound datatypes with no + * fields and enumerated datatypes with no members. + * + * \version 1.8.7 Function modified in this release to reject datatypes that + * will not accomodate actual data, such as a compound datatype + * with no fields or an enumerated datatype with no members. + * + * \since 1.2.0 + * + */ H5_DLL herr_t H5Tcommit_anon(hid_t loc_id, hid_t type_id, hid_t tcpl_id, hid_t tapl_id); +/** + * \ingroup H5T + * + * \brief Returns a copy of a datatype's creation property list + * + * \type_id + * + * \return \hid_t{datatype creation property list} + * + * \details H5Tget_create_plist() returns a property list identifier + * for the datatype creation property list associated with the datatype + * specified by \p type_id. + * + * The creation property list identifier should be released with + * H5Pclose() to prevent memory leaks. + * + * \since 1.8.0 + * + */ H5_DLL hid_t H5Tget_create_plist(hid_t type_id); +/** + * \ingroup H5T + * + * \brief Determines whether a datatype is a committed type or a transient type + * + * \type_id + * + * \return \htri_t + * + * \details H5Tcommitted() queries a type to determine whether the type + * specified by the \p dtype_id identifier is a committed (formerly + * known as a \Emph{named}) type or a transient type. If this function returns + * a positive value, then the type is committed (that is, it has been + * committed, perhaps by some other application). Datasets which + * return committed datatypes with H5Dget_type() are able to share + * the datatype with other datasets in the same file. + * + * \version 1.8.0 Fortran API was added + * + * \since 1.6 or earlier + * + */ H5_DLL htri_t H5Tcommitted(hid_t type_id); +/** + * \ingroup H5T + * + * \brief Encodes a datatype object description into a binary buffer + * + * \param[in] obj_id Identifier of the object to be encoded + * \param[in,out] buf Buffer for the object to be encoded into. + * \param[in,out] nalloc IN: The size of the allocated buffer + * OUT: The size of the buffer needed + * + * \return \herr_t + * + * \details H5Tencode() Given datatype identifier, H5Tencode() converts a + * datatype description into binary form in a buffer. Using this + * binary form in the buffer, a datatype object can be reconstructed + * using H5Tdecode() to return a new object handle (\ref hid_t) for + * this datatype. + * + * If the provided buffer is NULL, only the size of buffer needed is + * returned through \p nalloc. + * + * A preliminary H5Tencode() call can be made to find out the size + * of the buffer needed. This value is returned as \p nalloc. That + * value can then be assigned to \p nalloc for a second H5Tencode() + * call, which will retrieve the actual encoded object. + * + * If the library finds that \p nalloc is not big enough for the + * object, it simply returns the size of the buffer needed through + * \p nalloc without encoding the provided buffer. + * + * \since 1.2.0 + * + */ H5_DLL herr_t H5Tencode(hid_t obj_id, void *buf, size_t *nalloc); -H5_DLL hid_t H5Tdecode(const void *buf); -H5_DLL herr_t H5Tflush(hid_t type_id); -H5_DLL herr_t H5Trefresh(hid_t type_id); - -/* Operations defined on compound datatypes */ -H5_DLL herr_t H5Tinsert(hid_t parent_id, const char *name, size_t offset, hid_t member_id); +/** + * \ingroup H5T + * + * \brief Decodes a binary object description of datatype and return a new + * object handle + * + * \param[in] buf Buffer for the datatype object to be decoded + * + * \return \hid_t{datatype} + * + * \details H5Tdecode() Given an object description of datatype in binary in a + * buffer, H5Tdecode() reconstructs the HDF5 datatype object and + * returns a new object handle for it. The binary description of + * the object is encoded by H5Tencode(). User is responsible for + * passing in the right buffer. + * + * The datatype identifier returned by this function can be released + * with H5Tclose() when the identifier is no longer needed so that + * resource leaks will not develop. + * + */ +H5_DLL hid_t H5Tdecode(const void *buf); +/** + * \ingroup H5T + * + * \brief Flushes all buffers associated with a committed datatype to disk + * + * \type_id + * + * \return \herr_t + * + * \details H5Tflush() causes all buffers associated with a committed datatype + * \p type_id to be immediately flushed to disk without removing the + * data from the cache. + * + * HDF5 does not possess full control over buffering. H5Tflush() + * flushes the internal HDF5 buffers and then asks the operating + * system (the OS) to flush the system buffers for the open + * files. After that, the OS is responsible for ensuring that the + * data is actually flushed to disk. + * + * \return \herr_t + * + * \since 1.10.0 C function introduced with this release. + * + * \see H5Dflush() + * H5Drefresh() + * H5Tflush() + * H5Grefresh() + * H5Oflush() + * H5Orefresh() + * H5Tflush() + * H5Trefresh() + * H5Fstart_swmr_write() + * H5Pget_append_flush() + * H5Pget_object_flush_cb() + * H5Pset_append_flush() + * H5Pset_object_flush_cb() + * + */ +H5_DLL herr_t H5Tflush(hid_t type_id); +/** + * \ingroup H5T + * + * \brief Refreshes all buffers associated with a committed datatype + * + * \type_id + * + * \return \herr_t + * + * \details H5Trefresh() causes all buffers associated with a committed + * datatype to be cleared and immediately re-loaded with updated + * contents from disk. + * + * This function essentially closes the datatype, evicts all + * metadata associated with it from the cache, and then re-opens the + * datatype. The reopened datatype is automatically re-registered + * with the same identifier. + * + * \since 1.2.0 + * + */ +H5_DLL herr_t H5Trefresh(hid_t type_id); + +/* Operations defined on compound datatypes */ +/** + * \ingroup COMPOUND + * + * \brief Adds a new member to a compound datatype. + * + * \type_id{parent_id} + * \param[in] name Name of the field to insert + * \param[in] offset Offset in memory structure of the field to insert + * \param[in] member_id Datatype identifier of the field to insert + * + * \return \herr_t + * + * \details H5Tinsert() adds another member to the compound datatype, specified + * \p type_id. + * + * The new member has a \p name which must be unique within the + * compound datatype. The \p offset argument defines the start of the + * member in an instance of the compound datatype, and \p member_id + * is the datatype identifier of the new member. + * + * \note Members of a compound datatype do not have to be atomic + * datatypes; a compound datatype can have a member which is a + * compound datatype. + * + * \since 1.2.0 + * + * \todo Create example for H5Tinsert + * + */ +H5_DLL herr_t H5Tinsert(hid_t parent_id, const char *name, size_t offset, hid_t member_id); +/** + * \ingroup COMPOUND + * + * \brief Recursively removes padding from within a compound datatype + * + * \type_id + * + * \return \herr_t + * + * \details H5Tpack() recursively removes padding from within a compound + * datatype to make it more efficient (space-wise) to store that data. + * + * \since 1.2.0 + * + */ H5_DLL herr_t H5Tpack(hid_t type_id); /* Operations defined on enumeration datatypes */ +/** + * \ingroup ENUM + * + * \brief Creates a new enumeration datatype + * + * \param[in] base_id Datatype identifier for the base datatype. Must be an + * integer datatype + * + * \return \hid_t{enumeration datatype} + * + * \details H5Tenum_create() creates a new enumeration datatype based on the + * specified base datatype, dtype_id, which must be an integer datatype. + * + * If a particular architecture datatype is required, a little endian + * or big endian datatype for example, use a native datatype as the + * base datatype and use H5Tconvert() on values as they are read + * from or written to a dataset. + * + * \since 1.2.0 + * + */ H5_DLL hid_t H5Tenum_create(hid_t base_id); +/** + * \ingroup ENUM + * + * \brief Inserts a new enumeration datatype member + * + * \type_id{type} + * \param[in] name Name of the new member + * \param[in] value Pointer to the value of the new member + * + * \return \herr_t + * + * \details H5Tenum_insert() inserts a new enumeration datatype member into an + * enumeration datatype. + * + * \p type_id is the datatype identifier for the enumeration datatype, + * \p name is the name of the new member, and \p value points to the + * value of the new member. + * + * \p name and \p value must both be unique within \p dtype_id. + * + * \p value points to data which must be of the integer base datatype + * used when the enumeration datatype was created. If a particular + * architecture datatype is required, a little endian or big endian + * datatype for example, use a native datatype as the base datatype + * and use H5Tconvert() on values as they are read from or written + * to a dataset. + * + * \since 1.2.0 + * + */ H5_DLL herr_t H5Tenum_insert(hid_t type, const char *name, const void *value); +/** + * \ingroup ENUM + * + * \brief Returns the symbol name corresponding to a specified member of an + * enumeration datatype + * + * \type_id{type} + * \param[in] value Value of the enumeration datatype + * \param[out] name Buffer for output of the symbol name + * \param[in] size Anticipated size of the symbol name, in bytes + * + * \return Returns a non-negative value if successful. Otherwise returns a + * negative value + * + * \details H5Tenum_nameof() finds the symbol name that corresponds to the + * specified \p value of the enumeration datatype \p type. + * + * At most \p size characters of the symbol \p name are copied into + * the \p name buffer. If the entire symbol name and null terminator + * do not fit in the name buffer, then as many characters as possible + * are copied (not null terminated) and the function fails. + * + * \since 1.2.0 + * + */ H5_DLL herr_t H5Tenum_nameof(hid_t type, const void *value, char *name /*out*/, size_t size); +/** + * \ingroup ENUM + * + * \brief Returns the value corresponding to a specified member of an + * enumeration datatype + * + * \type_id{type} + * \param[in] name Symbol name of the enumeration datatype + * \param[out] value Buffer for the value of the enumeration datatype + * + * \return \herr_t + * + * \details H5Tenum_valueof() finds the value that corresponds to the + * specified name of the enumeration datatype \p dtype_id. + * + * Values returned in \p value will be of the enumerated type’s + * base type, that is, the datatype used by H5Tenum_create() when + * the enumerated type was created. + * + * The \p value buffer must be at least large enough to hold a value + * of that base type. If the size is unknown, you can determine it + * with H5Tget_size(). + * + * \since 1.2.0 + * + */ H5_DLL herr_t H5Tenum_valueof(hid_t type, const char *name, void *value /*out*/); /* Operations defined on variable-length datatypes */ +/** + * \ingroup VLEN + * + * \brief Creates a new variable-length array datatype + * + * \type_id{base_id}, the element type of the datatype to create + * + * \return \hid_t{variable-length datatype} + * + * \details H5Tvlen_create() creates a new one-dimensional array datatype of + * variable-length (VL) with the base datatype \p base_id. + * + * This one-dimensional array often represents a data sequence of the + * base datatype, such as characters for character sequences or vertex + * coordinates for polygon lists. The base type specified for the VL + * datatype can be any HDF5 datatype, including another VL datatype, a + * compound datatype, or an atomic datatype. + * + * When necessary, use H5Tget_super() to determine the base type of + * the VL datatype. + * + * The datatype identifier returned from this function should be + * released with H5Tclose() or resource leaks will result. Under + * certain circumstances, H5Dvlen_reclaim() must also be used. + * + * \attention H5Tvlen_create() cannot be used to create a variable-length + * string datatype. H5Tvlen_create() called with a string or + * character base type creates a variable-length sequence of strings + * (a variable-length, 1-dimensional array), with each element of + * the array being of the string or character base type.\n + * To create a variable-length string datatype, see "Creating + * variable-length string datatypes." + * + * \todo Fix the reference. + * + */ H5_DLL hid_t H5Tvlen_create(hid_t base_id); /* Operations defined on array datatypes */ +/** + * \ingroup ARRAY + * + * \brief Creates an array datatype object + * + * \param[in] base_id Datatype identifier for the array base datatype + * \param[in] ndims Rank of the array + * \param[in] dim Size of each array dimension + * + * \return \hid_t{array datatype} + * + * \details H5Tarray_create2() creates a new array datatype object.\n\n + * \p base_id is the datatype of every element of the array, i.e., + * of the number at each position in the array. + * + * \p ndims is the number of dimensions and the size of each dimension + * is specified in the array \p dim. The value of \p rank is + * currently limited to #H5S_MAX_RANK and must be greater than 0 + * (zero). All dimension sizes specified in \p dim must be greater + * than 0 (zero). + * + * \since 1.8.0 + * + */ H5_DLL hid_t H5Tarray_create2(hid_t base_id, unsigned ndims, const hsize_t dim[/* ndims */]); +/** + * \ingroup ARRAY + * + * \brief Returns the rank of an array datatype + * + * \type_id + * + * \return Returns the rank of the array if successful; otherwise returns a + * negative value. + * + * \details H5Tget_array_ndims() returns the rank, i.e., the number of + * dimensions, of an array datatype object. + * + * \since 1.2.0 + * + */ H5_DLL int H5Tget_array_ndims(hid_t type_id); +/** + * \ingroup ARRAY + * + * \brief Retrieves sizes of array dimensions + * + * \type_id + * \param[out] dims Sizes of array dimensions + * + * \return Returns the non-negative number of dimensions of the array type + * if successful; otherwise returns a negative value. + * + * \details H5Tget_array_dims2() returns the sizes of the dimensions of the + * specified array datatype object in the array \p dims. + * + * \since 1.2.0 + * + */ H5_DLL int H5Tget_array_dims2(hid_t type_id, hsize_t dims[]); /* Operations defined on opaque datatypes */ +/** + * \ingroup OPAQUE + * + * \brief Tags an opaque datatype + * + * \type_id{type} of an opaque datatype + * \param[in] tag Descriptive ASCII string with which the opaque datatype is + * to be tagged + * + * \return \herr_t + * + * \details H5Tset_tag() tags an opaque datatype \p type with a descriptive + * ASCII identifier, \p tag. + * + * \p tag is intended to provide a concise description; the maximum + * size is hard-coded in the HDF5 library as 256 bytes + * (#H5T_OPAQUE_TAG_MAX). + * + * \version 1.6.5 The #H5T_OPAQUE_TAG_MAX macro constant, specifying the + * maximum size of an opaque datatype tag, was added in + * H5Tpublic.h. + * + */ H5_DLL herr_t H5Tset_tag(hid_t type, const char *tag); +/** + * \ingroup OPAQUE + * + * \brief Gets the tag associated with an opaque datatype + * + * \type_id{type} of an opaque datatype + * + * \return Returns a pointer to an allocated string if successful; otherwise + * returns NULL. + * + * \details H5Tget_tag() returns the tag associated with the opaque datatype + * \p type. + * + * \attention The tag is returned via a pointer to an allocated string, which + * the caller must free. + * + */ H5_DLL char * H5Tget_tag(hid_t type); /* Querying property values */ +/** + * \ingroup H5T + * + * \brief Returns the base datatype from which a datatype is derived + * + * \type_id{type} + * + * \return \hid_t{datatype} + * + * \details H5Tget_super() returns the base datatype from which the datatype + * \p type_id is derived. In the case of an enumeration type, the + * return value is an integer type. + * + * The datatype identifier returned by this function must be released + * with H5Tclose() when the identifier is no longer needed so that + * resource leaks will not develop. + * + */ H5_DLL hid_t H5Tget_super(hid_t type); +/** + * \ingroup H5T + * + * \brief Returns a datatype class + * + * \type_id + * + * \return Returns the datatype class if successful; otherwise #H5T_NO_CLASS. + * + * \details H5Tget_class() returns the class of the datatype \p type_id. + * Valid class identifiers, as defined in H5Tpublic.h, are: + * \snippet this H5T_class_t_snip + * + * \note The library returns #H5T_STRING for both fixed-length and + * variable-length strings. + * + * \note Unsupported datatype: The time datatype class, #H5T_TIME, + * is not supported. If #H5T_TIME is used, the resulting data will + * be readable and modifiable only on the originating computing + * platform; it will not be portable to other platforms. + * + */ H5_DLL H5T_class_t H5Tget_class(hid_t type_id); +/** + * \ingroup H5T + * + * \brief Determines whether a datatype contains any datatypes of the given + * datatype class + * + * \type_id + * \param[in] cls Datatype class + * + * \return \htri_t + * + * \details H5Tdetect_class() determines whether the datatype specified in + * \p type_id contains any datatypes of the datatype class specified + * in \p dtype_class. + * + * This function is useful primarily in recursively examining all the + * fields and/or base types of compound, array, and variable-length + * datatypes. + * + * Valid class identifiers, as defined in H5Tpublic.h, are: + * \snippet this H5T_class_t_snip + * + * \since 1.6.0 + * + */ H5_DLL htri_t H5Tdetect_class(hid_t type_id, H5T_class_t cls); +/** + * \ingroup H5T + * + * \brief Returns the size of a datatype + * + * \type_id + * + * \return Returns the size of the datatype in bytes if successful; otherwise, + * returns 0. + * + * \details H5Tget_size() returns the size of a datatype in bytes. + * \li For atomic datatypes, array datatypes, compound datatypes, and + * other datatypes of a constant size, the returned value is the + * size of the actual datatype in bytes. + * \li For variable-length string datatypes the returned value is + * the size of the pointer to the actual string, or \c sizeof(\c + * char \c *). This function does not return the size of actual + * variable-length string data. + * \li For variable-length sequence datatypes (see H5Tvlen_create()), + * the returned value is the size of the \p hvl_t struct, or \c + * sizeof(\p hvl_t). The \p hvl_t struct contains a pointer to the + * actual data and a size value. This function does not return the + * size of actual variable-length sequence data. + * + * \since 1.2.0 + * + * \see H5Tset_size() + * + * \todo Original has a reference to “Creating variable-length string datatypes”. + * \todo Create an example for H5Tget_size(). + * + */ H5_DLL size_t H5Tget_size(hid_t type_id); +/** + * \ingroup ATOM + * + * \brief Returns the byte order of an atomic datatype + * + * \type_id + * + * \return Returns a byte order constant if successful; otherwise returns + * #H5T_ORDER_ERROR (-1) + * + * \details H5Tget_order() returns the byte order of an atomic datatype. + * Possible return values are: + * \snippet this H5T_order_t_snip + * Members of a compound datatype need not have the same byte + * order. If members of a compound datatype have more than one of + * little endian, big endian, or VAX byte order, H5Tget_order() will + * return #H5T_ORDER_MIXED for the compound datatype. A byte order of + * #H5T_ORDER_NONE will, however, be ignored; for example, if one or + * more members of a compound datatype have byte order #H5T_ORDER_NONE + * but all other members have byte order #H5T_ORDER_LE, H5Tget_order() + * will return #H5T_ORDER_LE for the compound datatype. + * + * \since 1.2.0 + * + */ H5_DLL H5T_order_t H5Tget_order(hid_t type_id); +/** + * \ingroup ATOM + * + * \brief Returns the precision of an atomic datatype + * + * \type_id + * + * \return Returns the number of significant bits if successful; otherwise 0 + * + * \details H5Tget_precision() returns the precision of an atomic datatype + * (for example, integer or float) or a datatype whose base (parent) + * type is an atomic type (for example, array, enum and variable + * length). The precision is the number of significant bits which, + * unless padding is present, is 8 times larger than the value + * returned by H5Tget_size(). + * + * \since 1.2.0 + * + */ H5_DLL size_t H5Tget_precision(hid_t type_id); +/** + * \ingroup ATOM + * + * \brief Retrieves the bit offset of the first significant bit + * + * \type_id + * + * \return Returns an offset value if successful; otherwise returns a + * negative value. + * + * \details H5Tget_offset() retrieves the bit offset of the first significant + * bit. The significant bits of an atomic datum can be offset from the + * beginning of the memory for that datum by an amount of padding. The + * 'offset' property specifies the number of bits of padding that + * appear to the "right of" the value. That is, if we have a 32-bit + * datum with 16-bits of precision having the value 0x1122 then it + * will be laid out in memory as (from small byte address toward + * larger byte addresses): + * \code{.unparsed} + * 0: [ pad] [0x11] [0x22] [ pad] + * 1: [ pad] [0x22] [0x11] [ pad] + * 2: [0x11] [ pad] [ pad] [0x22] + * 3: [0x22] [ pad] [ pad] [0x11] + * \endcode + * + * \since 1.2.0 + * + */ H5_DLL int H5Tget_offset(hid_t type_id); +/** + * \ingroup ATOM + * + * \brief Retrieves the padding type of the least and most-significant bit padding + * + * \type_id + * \param[out] lsb Buffer for the least-significant bit padding type + * \param[out] msb Buffer for the most-significant bit padding type + * + * \return \herr_t + * + * \details H5Tget_pad() retrieves the padding type of the least and + * most-significant bit padding. Valid padding types are: + * \snippet this H5T_pad_t_snip + * + * \since 1.2.0 + * + */ H5_DLL herr_t H5Tget_pad(hid_t type_id, H5T_pad_t *lsb /*out*/, H5T_pad_t *msb /*out*/); -H5_DLL H5T_sign_t H5Tget_sign(hid_t type_id); +/** + * \ingroup ATOM + * + * \brief Retrieves the sign type for an integer type + * + * \type_id + * + * \return Returns a valid sign type if successful; otherwise #H5T_SGN_ERROR (-1) + * + * \details H5Tget_sign() retrieves the sign type for an integer type. + * Valid types are: + * \snippet this H5T_sign_t_snip + * + * \since 1.2.0 + * + */ +H5_DLL H5T_sign_t H5Tget_sign(hid_t type_id); +/** + * \ingroup ATOM + * + * \brief Retrieves floating point datatype bit field information + * + * \type_id + * \param[out] spos Pointer to location to return floating-point sign bit + * \param[out] epos Pointer to location to return exponent bit-position + * \param[out] esize Pointer to location to return size of exponent in bits + * \param[out] mpos Pointer to location to return mantissa bit-position + * \param[out] msize Pointer to location to return size of mantissa in bits + * + * \return \herr_t + * + * \details H5Tget_fields() retrieves information about the locations of + * the various bit fields of a floating point datatype. The field + * positions are bit positions in the significant region of the + * datatype. Bits are numbered with the least significant bit number + * zero. Any (or even all) of the arguments can be null pointers. + * + * \since 1.2.0 + * + */ H5_DLL herr_t H5Tget_fields(hid_t type_id, size_t *spos /*out*/, size_t *epos /*out*/, size_t *esize /*out*/, size_t *mpos /*out*/, size_t *msize /*out*/); +/** + * \ingroup ATOM + * + * \brief Retrieves the exponent bias of a floating-point type + * + * \type_id + * + * \return Returns the bias if successful and 0, otherwise. + * + * \details H5Tget_ebias() retrieves the exponent bias of a floating-point type. + * + * \since 1.2.0 + * + */ H5_DLL size_t H5Tget_ebias(hid_t type_id); +/** + * -------------------------------------------------------------------------- + * \ingroup ATOM + * + * \brief Retrieves mantissa normalization of a floating-point datatype + * + * \type_id + * + * \return Returns a valid normalization type if successful; otherwise + * returns #H5T_NORM_ERROR (-1) + * + * \details H5Tget_norm() retrieves the mantissa normalization of a + * floating-point datatype. Valid normalization types are: + * \snippet this H5T_norm_t_snip + * + * \since 1.2.0 + * + */ H5_DLL H5T_norm_t H5Tget_norm(hid_t type_id); +/** + * \ingroup ATOM + * + * \brief Retrieves the internal padding type for unused bits in floating-point + * datatypes + * + * \type_id + * + * \return Returns a valid padding type if successful; otherwise returns + * #H5T_PAD_ERROR (-1). + * + * \details H5Tget_inpad() retrieves the internal padding type for unused + * bits in floating-point datatypes. Valid padding types are: + * \snippet this H5T_pad_t_snip + * + * \since 1.2.0 + * + */ H5_DLL H5T_pad_t H5Tget_inpad(hid_t type_id); +/** + * \ingroup ATOM + * + * \brief Retrieves the type of padding used for a string datatype + * + * \type_id + * + * \return Returns a valid string of the padding if successful; otherwise + * returns #H5T_STR_ERROR (-1) + * + * \details H5Tget_strpad() retrieves the type of padding used for a string + * datatype. + * + * The string padding type is set with H5Tset_strpad(). Possible + * values returned are: + * \str_pad_type + * + * \since 1.2.0 + * + */ H5_DLL H5T_str_t H5Tget_strpad(hid_t type_id); +/** + * \ingroup COMPOUND + * + * \brief Retrieves the number of elements in a compound or enumeration datatype + * + * \type_id + * + * \return Returns the number of elements if successful; otherwise returns a + * negative value. + * + * \details H5Tget_nmembers() retrieves the number of fields in a compound + * datatype or the number of members of an enumeration datatype. + * + * \since 1.2.0 + * + */ H5_DLL int H5Tget_nmembers(hid_t type_id); +/** + * \ingroup COMPOUND + * + * \brief Retrieves the name of a compound or enumeration datatype member + * + * \type_id + * \param[in] membno Zero-based index of the field or element + * + * \return Returns a valid pointer to a string allocated with malloc() if + * successful; otherwise returns NULL. + * + * \details H5Tget_member_name() retrieves the name of a field of a compound + * datatype or an element of an enumeration datatype. + * + * The index of the target field or element is specified in \p + * member_no. Compound datatype fields and enumeration datatype + * elements are stored in no particular order with index values of + * 0 through N-1, where N is the value returned by H5Tget_nmembers(). + * + * The HDF5 library allocates a buffer to receive the name of + * the field. The caller must subsequently free the buffer with + * H5free_memory(). + * + * \since 1.2.0 + * + */ H5_DLL char * H5Tget_member_name(hid_t type_id, unsigned membno); +/** + * \ingroup COMPOUND + * + * \brief Retrieves the index of a compound or enumeration datatype member + * + * \type_id + * \param[in] name Name of the field or member + * + * \return \herr_t + * + * \details H5Tget_member_index() retrieves the index of a field of a compound + * datatype or an element of an enumeration datatype. + * + * The name of the target field or element is specified by \p name. + * + * Fields are stored in no particular order with index values of 0 + * through N-1, where N is the value returned by H5Tget_nmembers() . + * + * \since 1.2.0 + * + */ H5_DLL int H5Tget_member_index(hid_t type_id, const char *name); +/** + * \ingroup COMPOUND + * + * \brief Retrieves the offset of a field of a compound datatype + * + * \type_id + * \param[in] membno Zero-based index of the field or element + * + * \return Returns the byte offset of the field if successful; otherwise + * returns 0 (zero). + * + * \details H5Tget_member_offset() retrieves the byte offset of the beginning + * of a field within a compound datatype with respect to the beginning + * of the compound datatype datum. + * + * Note that zero is a valid offset and that this function will fail + * only if a call to H5Tget_member_class() fails with the same arguments. + * + * \version 1.6.4 \p member_no parameter type changed to unsigned. + * + * \since 1.2.0 + * + */ H5_DLL size_t H5Tget_member_offset(hid_t type_id, unsigned membno); +/** + * \ingroup COMPOUND + * + * \brief Returns datatype class of compound datatype member + * + * \type_id + * \param[in] membno Zero-based index of the field or element + * + * \return Returns the datatype class, a non-negative value, if successful; + * otherwise returns a negative value. + * + * \details Given a compound datatype, \p dtype_id, H5Tget_member_class() + * returns the datatype class of the member specified by \p member_no. + * + * Valid class identifiers, as defined in H5Tpublic.h, are: + * \snippet this H5T_class_t_snip + * + * \since 1.2.0 + * + */ H5_DLL H5T_class_t H5Tget_member_class(hid_t type_id, unsigned membno); +/** + * \ingroup COMPOUND + * + * \brief Returns the datatype of the specified member + * + * \type_id + * \param[in] membno Zero-based index of the field or element + * + * \return Returns the identifier of a copy of the datatype of the field if + * successful; otherwise returns a negative value. + * + * \details H5Tget_member_type() returns the datatype of the specified member. + * The caller should invoke H5Tclose() to release resources associated + * with the type. + * + * \version 1.6.4 \p membno parameter type changed to unsigned. + * + * \since 1.2.0 + * + */ H5_DLL hid_t H5Tget_member_type(hid_t type_id, unsigned membno); +/** + * \ingroup ENUM + * + * \brief Returns the value of an enumeration datatype member + * + * \type_id + * \param[in] membno Number of the enumeration datatype member + * \param[out] value Buffer for the value of the enumeration datatype member + * + * \return \herr_t + * + * \details H5Tget_member_value() returns the value of the enumeration datatype + * member \p member_no. + * + * The member value is returned in a user-supplied buffer pointed to + * by \p value. Values returned in \p value will be of the enumerated + * type’s base type, that is, the datatype used by H5Tenum_create() + * when the enumerated type was created. + * + * The value buffer must be at least large enough to hold a value + * of that base type. If the size is unknown, you can determine it + * with H5Tget_size(). + * + * \since 1.2.0 + * + */ H5_DLL herr_t H5Tget_member_value(hid_t type_id, unsigned membno, void *value /*out*/); +/** + * \ingroup ATOM + * + * \brief Retrieves the character set type of a string datatype + * + * \type_id + * + * \return Returns a valid character set type if successful; otherwise + * #H5T_CSET_ERROR (-1). + * + * \details H5Tget_cset() retrieves the character set type of a string datatype. + * Valid character set types are: + * \csets + * + * \since 1.2.0 + * + */ H5_DLL H5T_cset_t H5Tget_cset(hid_t type_id); +/** + * \ingroup ATOM + * + * \brief Determines whether datatype is a variable-length string + * + * \type_id + * + * \return Returns: + * \li a positive value if the specified datatype is a variable-length + * string + * \li 0 if the specified datatype is not a variable-length string + * \li a negative value when the function fails + * + * \details H5Tis_variable_str() determines whether the datatype identified + * by \p dtype_id is a variable-length string. + * + * This function can be used to distinguish between fixed and + * variable-length string datatypes. + * + * \since 1.6.0 + * + */ H5_DLL htri_t H5Tis_variable_str(hid_t type_id); +/** + * \ingroup H5T + * + * \brief Returns the native datatype identifier of a specified datatype + * + * \type_id + * \param[in] direction Direction of search + * + * \return \hid_t{native datatype} + * + * \details H5Tget_native_type() returns the equivalent native datatype + * identifier for the datatype specified by \p type_id. + * + * H5Tget_native_type() is designed primarily to facilitate use of + * the H5Dread() function, for which users otherwise must undertake a + * multi-step process to determine the native datatype of a dataset + * prior to reading it into memory. This function can be used for + * the following purposes: + * + * \li To determine the native datatype of an atomic datatype + * \li To determine the base datatype of an array, enumerated, or + * variable-length datatype + * \li To determine the native atomic datatypes of the individual + * components of a compound datatype + * + * For example, if \p type_id is a compound datatype, the returned + * datatype identifier will be for a similar compound datatype with + * each element converted to the corresponding native datatype; + * nested compound datatypes will be unwound. If \p type_id is an + * array, the returned datatype identifier will be for the native + * datatype of a single array element. + * + * H5Tget_native_type() selects the first matching native datatype + * from the following list: + * + * \li #H5T_NATIVE_CHAR + * \li #H5T_NATIVE_SHORT + * \li #H5T_NATIVE_INT + * \li #H5T_NATIVE_LONG + * \li #H5T_NATIVE_LLONG + * + * \li #H5T_NATIVE_UCHAR + * \li #H5T_NATIVE_USHORT + * \li #H5T_NATIVE_UINT + * \li #H5T_NATIVE_ULONG + * \li #H5T_NATIVE_ULLONG + * + * \li #H5T_NATIVE_FLOAT + * \li #H5T_NATIVE_DOUBLE + * \li #H5T_NATIVE_LDOUBLE + * + * \li #H5T_NATIVE_B8 + * \li #H5T_NATIVE_B16 + * \li #H5T_NATIVE_B32 + * \li #H5T_NATIVE_B64 + * + * The direction parameter indicates the order in which the library + * searches for a native datatype match. Valid values for direction + * are as follows: + * \snippet this H5T_direction_t_snip + * + * H5Tget_native_type() is designed primarily for use with integer, + * floating point, and bitfield datatypes. String, time, opaque, and + * reference datatypes are returned as a copy of dtype_id. See above + * for compound, array, enumerated, and variable-length datatypes. + * + * The identifier returned by H5Tget_native_type() should eventually + * be closed by calling H5Tclose() to release resources. + * + * \note Please note that a datatype is actually an object + * identifier or handle returned from opening the datatype. It + * is not persistent and its value can be different from one HDF5 + * session to the next. + * + * \note H5Tequal() can be used to compare datatypes. + * + * \note HDF5 High Level APIs that may also be of interest are: H5LTdtype_to_text() + * creates a text description of a datatype. H5LTtext_to_dtype() creates an + * HDF5 datatype given a text description. + * + * \since 1.6.0 + * + */ H5_DLL hid_t H5Tget_native_type(hid_t type_id, H5T_direction_t direction); /* Setting property values */ +/** + * \ingroup H5T + * + * \brief Sets size for a datatype. + * + * \type_id + * \param[in] size New datatype size is bytes or #H5T_VARIABLE + * + * \return \herr_t + * + * \details H5Tset_size() sets the total size, \p size, in bytes, for a + * datatype. + * + * \p size must have a positive value, unless it is passed in as + * #H5T_VARIABLE and the datatype is a string datatype. + * + * \li Numeric datatypes: If the datatype is atomic and the size + * is decreased so that significant bits of the datatype extend + * beyond the edge of the new size, then the offset property of the + * datatype is decreased toward zero. If the offset becomes zero + * and the significant bits of the datatype still hang over the edge + * of the new size, then the number of significant bits is decreased. + * + * \li String or character datatypes: The size set for a string + * datatype should include space for the null-terminator character, + * otherwise it will not be stored on (or retrieved from) + * disk. Adjusting the size of a string automatically sets the + * precision to \p 8*size. + * + * \li Variable-length string datatypes: If \p dtype_id is a + * variable-length string, size must normally be set to #H5T_VARIABLE. + * + * \li Compound datatypes: This function may be used to increase or + * decrease the size of a compound datatype, but the function will + * fail if the new size is too small to accommodate all member fields. + * + * \li Ineligible datatypes: This function cannot be used with + * enumerated datatypes (#H5T_ENUM), array datatypes (#H5T_ARRAY), + * variable-length array datatypes (#H5T_VLEN), or reference datatypes + * (#H5T_REFERENCE). + * + * \since 1.2.0 + * + * \see H5Tget_size() + * + *\todo Create an example for H5Tset_size(). + *\todo Original has a reference to “Creating variable-length string datatypes”. + * + */ H5_DLL herr_t H5Tset_size(hid_t type_id, size_t size); +/** + * \ingroup ATOM + * + * \brief Sets the byte order of a datatype + * + * \type_id + * \param[in] order Byte order constant + * + * \return \herr_t + * + * \details H5Tset_order() sets the byte order of a datatype.\n + * Byte order can currently be set to any of the following: + * \snippet this H5T_order_t_snip + * #H5T_ORDER_MIXED (3) is a valid value for order only when + * returned by the function H5Tget_order(); it cannot be set with + * H5Tset_order(). + * + * #H5T_ORDER_NONE (4) is a valid value for order, but it has no + * effect. It is valid only for fixed-length strings and object and + * region references and specifies “no particular order.” + * + * The byte order of a derived datatype is initially the same as + * that of the parent type, but can be changed with H5Tset_order(). + * + * This function cannot be used with a datatype after it has been + * committed. + * + * \note Special considerations: + * \li ENUM datatypes: Byte order must be set before any member on + * an ENUM is defined. + * \li Compound datatypes: Byte order is set individually on each member + * of a compound datatype; members of a compound datatype need not + * have the same byte order. + * \li Opaque datatypes: Byte order can be set but has no effect. + * + * \since 1.2.0 + * + */ H5_DLL herr_t H5Tset_order(hid_t type_id, H5T_order_t order); +/** + * \ingroup ATOM + * + * \brief Sets the precision of an atomic datatype + * + * \type_id + * \param[in] prec Number of bits of precision for datatype + * + * \return \herr_t + * + * \details H5Tset_precision() sets the precision of an atomic datatype. The + * precision is the number of significant bits which, unless + * padding is present, is 8 times larger than the value returned + * by H5Tget_size(). + * + * If the precision is increased then the offset is decreased and + * then the size is increased to insure that significant bits do not + * "hang over" the edge of the datatype. + * + * Changing the precision of an #H5T_STRING automatically changes + * the size as well. The precision must be a multiple of 8. + * + * When decreasing the precision of a floating point type, set the + * locations and sizes of the sign, mantissa, and exponent fields + * first. + * + * \since 1.2.0 + * + */ H5_DLL herr_t H5Tset_precision(hid_t type_id, size_t prec); +/** + * \ingroup ATOM + * + * \brief Sets the bit offset of the first significant bit + * + * \type_id + * \param[in] offset Offset of first significant bit + * + * \return \herr_t + * + * \details H5Tset_offset() sets the bit offset of the first significant + * bit. The significant bits of an atomic datum can be offset from + * the beginning of the memory for that datum by an amount of + * padding. The offset property specifies the number of bits of + * padding that appear “to the right of” the value. That is, + * if we have a 32-bit datum with 16-bits of precision having the + * value 0x1122, then it will be laid out in memory as (from small + * byte address toward larger byte addresses): + * \code{.unparsed} + * 0: [ pad] [0x11] [0x22] [ pad] + * 1: [ pad] [0x22] [0x11] [ pad] + * 2: [0x11] [ pad] [ pad] [0x22] + * 3: [0x22] [ pad] [ pad] [0x11] + * \endcode + * If the offset is incremented then the total size is incremented + * also if necessary to prevent significant bits of the value from + * hanging over the edge of the datatype. + * + * The offset of an #H5T_STRING cannot be set to anything but zero. + * + * \since 1.2.0 + * + */ H5_DLL herr_t H5Tset_offset(hid_t type_id, size_t offset); +/** + * \ingroup ATOM + * + * \brief Sets the least and most-significant bits padding types + * + * \type_id + * \param[in] lsb Padding type for least-significant bits + * \param[in] msb Padding type for most-significant bits + * + * \return \herr_t + * + * \details H5Tset_pad() sets the least and most-significant bits padding types. + * Available values are: + * \padding_type + * + * \since 1.2.0 + * + */ H5_DLL herr_t H5Tset_pad(hid_t type_id, H5T_pad_t lsb, H5T_pad_t msb); +/** + * \ingroup ATOM + * + * \brief Sets the sign property for an integer type + * + * \type_id + * \param[in] sign Sign type + * + * \return \herr_t + * + * \details H5Tset_sign() sets the sign property for an integer type: + * \sign_prop + * + * \since 1.2.0 + * + */ H5_DLL herr_t H5Tset_sign(hid_t type_id, H5T_sign_t sign); +/** + * \ingroup ATOM + * + * \brief Sets locations and sizes of floating point bit fields + * + * \type_id + * \param[in] spos Sign position, i.e., the bit offset of the floating-point + * sign bit + * \param[in] epos Exponent bit position + * \param[in] esize Size of exponent in bits + * \param[in] mpos Mantissa bit position + * \param[in] msize Size of mantissa in bits + * + * \return \herr_t + * + * \details H5Tset_fields() sets the locations and sizes of the various + * floating-point bit fields. The field positions are bit positions + * in the significant region of the datatype. Bits are numbered with + * the least significant bit number zero. + * + * Fields are not allowed to extend beyond the number of bits of + * precision, nor are they allowed to overlap with one another. + * + * \since 1.2.0 + * + */ H5_DLL herr_t H5Tset_fields(hid_t type_id, size_t spos, size_t epos, size_t esize, size_t mpos, size_t msize); +/** + * \ingroup ATOM + * + * \brief Sets the exponent bias of a floating-point type + * + * \type_id + * \param[in] ebias Exponent bias value + * + * \return \herr_t + * + * \details H5Tset_ebias() sets the exponent bias of a floating-point type. + * + * \since 1.2.0 + * + */ H5_DLL herr_t H5Tset_ebias(hid_t type_id, size_t ebias); +/** + * \ingroup ATOM + * + * \brief Sets the mantissa normalization of a floating-point datatype + * + * \type_id + * \param[in] norm Mantissa normalization type + * + * \return \herr_t + * + * \details H5Tset_norm() sets the mantissa normalization of a floating-point + * datatype. Valid normalization types are: + * \snippet this H5T_norm_t_snip + * + * \since 1.2.0 + * + */ H5_DLL herr_t H5Tset_norm(hid_t type_id, H5T_norm_t norm); +/** + * \ingroup ATOM + * + * \brief Fills unused internal floating-point bits + * + * \type_id + * \param[in] pad Padding type + * + * \return \herr_t + * + * \details H5Tset_inpad() If any internal bits of a floating point-type are + * unused (that is, those significant bits which are not part of the + * sign, exponent, or mantissa), then H5Tset_inpad() will be filled + * according to the value of the padding value property inpad. Valid + * padding types are: + * \snippet this H5T_pad_t_snip + * + * \since 1.2.0 + * + */ H5_DLL herr_t H5Tset_inpad(hid_t type_id, H5T_pad_t pad); +/** + * \ingroup ATOM + * + * \brief Sets character set to be used in a string or character datatype + * + * \type_id + * \param[in] cset Character set type + * + * \return \herr_t + * + * \details H5Tset_cset() sets the character set to be used in a dataset with + * a string or character datatype. + * + * Valid values for cset include the following: + * \csets + * For example, if the character set for the datatype \p type_id is set + * to #H5T_CSET_UTF8, string or character data of datatype dtype_id + * will be encoded using the UTF-8 Unicode character set. + * + * ASCII and UTF-8 Unicode are the only currently supported character + * encodings. Extended ASCII encodings (for example, ISO 8859) are + * not supported. This encoding policy is not enforced by the HDF5 + * library. Using encodings other than ASCII and UTF-8 can lead to + * compatibility and usability problems. + * + * Note that H5Tset_cset() sets the character set for a character or + * string datatype while H5Pset_char_encoding() sets the character + * set used for an HDF5 link or attribute name. + * + * \since 1.2.0 + * + */ H5_DLL herr_t H5Tset_cset(hid_t type_id, H5T_cset_t cset); +/** + * \ingroup ATOM + * + * \brief Defines the type of padding used for character strings + * + * \type_id + * \param[in] strpad String padding type + * + * \return \herr_t + * + * \details H5Tset_strpad() defines the type of padding used for a string + * datatype. + * + * The method used to store character strings differs with the + * programming language. C usually null terminates strings while + * Fortran left-justifies and space-pads strings. + * + * Valid values of \p strpad are as follows: + * \str_pad_type + * When converting from a longer string to a shorter string, the + * behavior is as follows. If the shorter string is #H5T_STR_NULLPAD + * or #H5T_STR_SPACEPAD, then the string is simply truncated. If + * the short string is #H5T_STR_NULLTERM, it is truncated and a null + * terminator is appended. + * + * When converting from a shorter string to a longer string, the + * longer string is padded on the end by appending nulls or spaces. + * + * \since 1.2.0 + * + */ H5_DLL herr_t H5Tset_strpad(hid_t type_id, H5T_str_t strpad); /* Type conversion database */ +/** + * \ingroup CONV + * + * \brief Registers a datatype conversion function + * + * \param[in] pers Conversion function type + * \param[in] name Name displayed in diagnostic output + * \type_id{src_id} of source datatype + * \type_id{dst_id} of destination datatype + * \param[in] func Function to convert between source and destination datatypes + * + * \return \herr_t + * + * \details H5Tregister() registers a hard or soft conversion function for a + * datatype conversion path. The parameter \p pers indicates whether a + * conversion function is hard (#H5T_PERS_HARD) or soft + * (#H5T_PERS_SOFT). User-defined functions employing compiler casting + * are designated as \Emph{hard}; other user-defined conversion + * functions registered with the HDF5 library (with H5Tregister() ) + * are designated as \Emph{soft}. The HDF5 library also has its own + * hard and soft conversion functions. + * + * A conversion path can have only one hard function. When type is + * #H5T_PERS_HARD, \p func replaces any previous hard function. + * + * When type is #H5T_PERS_SOFT, H5Tregister() adds the function to the + * end of the master soft list and replaces the soft function in all + * applicable existing conversion paths. Soft functions are used when + * determining which conversion function is appropriate for this path. + * + * The \p name is used only for debugging and should be a short + * identifier for the function. + * + * The path is specified by the source and destination datatypes \p + * src_id and \p dst_id. For soft conversion functions, only the class + * of these types is important. + * + * The type of the conversion function pointer is declared as: + * \snippet this H5T_conv_t_snip + * + * The \ref H5T_cdata_t \c struct is declared as: + * \snippet this H5T_cdata_t_snip + * + * \since 1.6.3 The following change occurred in the \ref H5T_conv_t function: + * the \c nelmts parameter type changed to size_t. + * + */ H5_DLL herr_t H5Tregister(H5T_pers_t pers, const char *name, hid_t src_id, hid_t dst_id, H5T_conv_t func); +/** + * \ingroup CONV + * + * \brief Removes a conversion function + * + * \param[in] pers Conversion function type + * \param[in] name Name displayed in diagnostic output + * \type_id{src_id} of source datatype + * \type_id{dst_id} of destination datatype + * \param[in] func Function to convert between source and destination datatypes + * + * \return \herr_t + * + * \details H5Tunregister() removes a conversion function matching criteria + * such as soft or hard conversion, source and destination types, and + * the conversion function. + * + * If a user is trying to remove a conversion function he registered, + * all parameters can be used. If he is trying to remove a library’s + * default conversion function, there is no guarantee the \p name and + * \p func parameters will match the user’s chosen values. Passing in + * some values may cause this function to fail. A good practice is to + * pass in NULL as their values. + * + * All parameters are optional. The missing parameters will be used to + * generalize the search criteria. + * + * The conversion function pointer type declaration is described in + * H5Tregister(). + * + * \version 1.6.3 The following change occurred in the \ref H5T_conv_t function: + * the \c nelmts parameter type changed to size_t. + * + */ H5_DLL herr_t H5Tunregister(H5T_pers_t pers, const char *name, hid_t src_id, hid_t dst_id, H5T_conv_t func); +/** + * \ingroup CONV + * + * \brief Finds a conversion function + * + * \type_id{src_id} of source datatype + * \type_id{dst_id} of destination datatype + * \param[out] pcdata Pointer to type conversion data + * + * \return Returns a pointer to a suitable conversion function if successful. + * Otherwise returns NULL. + * + * \details H5Tfind() finds a conversion function that can handle a conversion + * from type \p src_id to type \p dst_id. The \p pcdata argument is a + * pointer to a pointer to type conversion data which was created and + * initialized by the soft type conversion function of this path when + * the conversion function was installed on the path. + * + */ H5_DLL H5T_conv_t H5Tfind(hid_t src_id, hid_t dst_id, H5T_cdata_t **pcdata); +/** + * \ingroup CONV + * + * \brief Check whether the library’s default conversion is hard conversion + * + * \type_id{src_id} of source datatype + * \type_id{dst_id} of destination datatype + * + * \return \htri_t + * + * \details H5Tcompiler_conv() determines whether the library’s conversion + * function from type \p src_id to type \p dst_id is a compiler (hard) + * conversion or not. A compiler conversion uses compiler’s casting; a + * library (soft) conversion uses the library’s own conversion + * function. + * + * \since 1.8.0 + * + */ H5_DLL htri_t H5Tcompiler_conv(hid_t src_id, hid_t dst_id); +/** + * -------------------------------------------------------------------------- + * \ingroup CONV + * + * \brief Converts data from one specified datatype to another + * + * \type_id{src_id} of source datatype + * \type_id{dst_id} of destination datatype + * \param[in] nelmts Size of array \p buf + * \param[in,out] buf Array containing pre- and post-conversion values + * \param[in] background Optional background buffer + * \dxpl_id{plist_id} + * + * \return \herr_t + * + * \details H5Tconvert() converts \p nelmts elements from a source datatype, + * specified by \p src_id, to a destination datatype, \p dst_id. The + * source elements are packed in \p buf and on return the destination + * elements will be packed in \p buf. That is, the conversion is + * performed in place. + * + * The optional background buffer is for use with compound datatypes. + * It is an array of \p nelmts values for the destination datatype + * which can then be merged with the converted values to recreate the + * compound datatype. For instance, background might be an array of + * structs with the \c a and \c b fields already initialized and the + * conversion of buf supplies the \c c and \c d field values. + * + * The parameter \p plist_id contains the dataset transfer property list + * identifier which is passed to the conversion functions. As of + * Release 1.2, this parameter is only used to pass along the + * variable-length datatype custom allocation information. + * + * \note H5Tconvert() will not resize the buffer \p buf; it must be large + * enough to hold the larger of the input and output data. + * + * \version 1.6.3 \p nelmts parameter type changed to size_t. + * \version 1.4.0 \p nelmts parameter type changed to \ref hsize_t. + * + */ H5_DLL herr_t H5Tconvert(hid_t src_id, hid_t dst_id, size_t nelmts, void *buf, void *background, hid_t plist_id); +/** + * \ingroup VLEN + * + * \brief Reclaims the variable length (VL) datatype memory buffers + * + * \type_id + * \space_id + * \dxpl_id{plist_id} used to create the buffer + * \param[in] buf Pointer to the buffer to be reclaimed + * + * \return \herr_t + * + * \details H5Treclaim() reclaims memory buffers created to store VL datatypes. + * It only frees the variable length data in the selection defined in + * the dataspace specified by \p space_id. The dataset transfer + * property list \p plist_id is required to find the correct + * allocation and/or free methods for the variable-length data in the + * buffer. + * + * \since 1.12.0 + * + */ H5_DLL herr_t H5Treclaim(hid_t type_id, hid_t space_id, hid_t plist_id, void *buf); /* Symbols defined for compatibility with previous versions of the HDF5 API. @@ -598,10 +2883,139 @@ H5_DLL herr_t H5Treclaim(hid_t type_id, hid_t space_id, hid_t plist_id, void /* Typedefs */ /* Function prototypes */ +/** + * \ingroup H5T + * + * \brief Commits a transient datatype to a file, creating a new named datatype + * + * \fg_loc_id + * \param[in] name Name given to committed datatype + * \param[in] type_id Identifier of datatype to be committed + * + * \return \herr_t + * + * \deprecated This function has been renamed from H5Tcommit() and is + * deprecated in favor of the macro #H5Tcommit or the function + * H5Tcommit2(). + * + * \details H5Tcommit1() commits the transient datatype (not immutable) to + * a file, turning it into a named datatype. + * + * The datatype \p dtype_id is committed as a named datatype at the + * location \p loc_id, which is either a file or group identifier, + * with the name \p name. + * + * \p name can be a relative path based at \p loc_id or an absolute + * path from the root of the file. Use of this function requires + * that any intermediate groups specified in the path already exist. + * + * As is the case for any object in a group, the length of the name + * of a named datatype is not limited. + * + * See H5Tcommit_anon() for a discussion of the differences between + * H5Tcommit() and H5Tcommit_anon(). + * + * This function will not accept a datatype that cannot actually + * hold data. This currently includes compound datatypes with no + * fields and enumerated datatypes with no members. + * + * \version 1.8.7 Function modified in this release to reject datatypes that + * will not accommodate actual data, such as a compound datatype with + * no fields or an enumerated datatype with no members. + * \version 1.8.0 C function H5Tcommit() renamed to H5Tcommit1() and deprecated + * in this release. + * \since 1.2.0 + * + */ H5_DLL herr_t H5Tcommit1(hid_t loc_id, const char *name, hid_t type_id); +/** + * \ingroup H5T + * + * \brief Opens a named datatype + * + * \fg_loc_id + * \param[in] name A datatype name, defined within the specified file or group + * + * \return \herr_t + * + * \deprecated This function has been renamed from H5Topen() and is + * deprecated in favor of the macro #H5Topen or the function + * H5Topen2(). + * + * \details H5Topen1() opens a named datatype at the location specified by + * \p loc_id and returns an identifier for the datatype. \p loc_id + * can be either a file or group identifier. The identifier should + * eventually be closed by calling H5Tclose() to release resources. + * + * \version 1.8.0 Function H5Topen() renamed to H5Topen1() and deprecated in + * this release. + * + * \since 1.2.0 + * + */ H5_DLL hid_t H5Topen1(hid_t loc_id, const char *name); +/** + * \ingroup ARRAY + * + * \brief Creates an array datatype object + * + * \param[in] base_id Datatype identifier for the array base datatype + * \param[in] ndims Rank of the array + * \param[in] dim Size of each array dimension + * \param[in] perm Dimension permutation (Currently not implemented.) + * + * \return \hid_t{array datatype} + * + * \deprecated This function has been renamed from H5Tarray_create() and is + * deprecated in favor of the macro #H5Tarray_create or the function + * H5Tarray_create2(). + * + * \details H5Tarray_create1() creates a new array datatype object.\n\n + * \p base_id is the datatype of every element of the array, i.e., + * of the number at each position in the array. + * + * \p rank is the number of dimensions and the size of each dimension + * is specified in the array dims. The value of rank is currently + * limited to #H5S_MAX_RANK and must be greater than 0 (zero). All + * dimension sizes specified in dims must be greater than 0 (zero). + * + * The array \p perm is designed to contain the dimension permutation, + * i.e. C versus FORTRAN array order. (The parameter perm is + * currently unused and is not yet implemented.) + * + * \version 1.8.0 Function H5Tarray_create() renamed to H5Tarray_create1() + * and deprecated in this release. + * \since 1.4.0 + * + */ H5_DLL hid_t H5Tarray_create1(hid_t base_id, int ndims, const hsize_t dim[/* ndims */], const int perm[/* ndims */]); +/** + * \ingroup ARRAY + * + * \brief Retrieves sizes of array dimensions + * + * \type_id + * \param[out] dims Sizes of array dimensions + * \param[out] perm Dimension permutations (This parameter is not used.) + * + * \return Returns the non-negative number of dimensions of the array type + * if successful; otherwise, returns a negative value. + * + * \deprecated This function has been renamed from H5Tget_array_dims() and is + * deprecated in favor of the macro #H5Tget_array_dims or the + * function H5Tget_array_dims2(). + * + * \details H5Tget_array_dims1() returns the sizes of the dimensions and + * the dimension permutations of the specified array datatype object. + * + * The sizes of the dimensions are returned in the array \p dims. + * + * \version 1.8.0 Function H5Tarray_create() renamed to H5Tarray_create1() + * and deprecated in this release. + * \since 1.2.0 + * + */ H5_DLL int H5Tget_array_dims1(hid_t type_id, hsize_t dims[], int perm[]); #endif /* H5_NO_DEPRECATED_SYMBOLS */ diff --git a/src/H5VLconnector.h b/src/H5VLconnector.h index 63ac9108669..2abdca3011d 100644 --- a/src/H5VLconnector.h +++ b/src/H5VLconnector.h @@ -438,39 +438,44 @@ typedef struct H5VL_token_class_t { herr_t (*from_str)(void *obj, H5I_type_t obj_type, const char *token_str, H5O_token_t *token); } H5VL_token_class_t; -/* Class information for each VOL connector */ +/** + * \ingroup H5VLDEV + * Class information for each VOL connector + */ +//! [H5VL_class_t_snip] typedef struct H5VL_class_t { /* Overall connector fields & callbacks */ - unsigned int version; /* VOL connector class struct version # */ - H5VL_class_value_t value; /* Value to identify connector */ - const char * name; /* Connector name (MUST be unique!) */ - unsigned cap_flags; /* Capability flags for connector */ - herr_t (*initialize)(hid_t vipl_id); /* Connector initialization callback */ - herr_t (*terminate)(void); /* Connector termination callback */ + unsigned int version; /**< VOL connector class struct version # */ + H5VL_class_value_t value; /**< Value to identify connector */ + const char * name; /**< Connector name (MUST be unique!) */ + unsigned cap_flags; /**< Capability flags for connector */ + herr_t (*initialize)(hid_t vipl_id); /**< Connector initialization callback */ + herr_t (*terminate)(void); /**< Connector termination callback */ /* VOL framework */ - H5VL_info_class_t info_cls; /* VOL info fields & callbacks */ - H5VL_wrap_class_t wrap_cls; /* VOL object wrap / retrieval callbacks */ + H5VL_info_class_t info_cls; /**< VOL info fields & callbacks */ + H5VL_wrap_class_t wrap_cls; /**< VOL object wrap / retrieval callbacks */ /* Data Model */ - H5VL_attr_class_t attr_cls; /* Attribute (H5A*) class callbacks */ - H5VL_dataset_class_t dataset_cls; /* Dataset (H5D*) class callbacks */ - H5VL_datatype_class_t datatype_cls; /* Datatype (H5T*) class callbacks */ - H5VL_file_class_t file_cls; /* File (H5F*) class callbacks */ - H5VL_group_class_t group_cls; /* Group (H5G*) class callbacks */ - H5VL_link_class_t link_cls; /* Link (H5L*) class callbacks */ - H5VL_object_class_t object_cls; /* Object (H5O*) class callbacks */ + H5VL_attr_class_t attr_cls; /**< Attribute (H5A*) class callbacks */ + H5VL_dataset_class_t dataset_cls; /**< Dataset (H5D*) class callbacks */ + H5VL_datatype_class_t datatype_cls; /**< Datatype (H5T*) class callbacks */ + H5VL_file_class_t file_cls; /**< File (H5F*) class callbacks */ + H5VL_group_class_t group_cls; /**< Group (H5G*) class callbacks */ + H5VL_link_class_t link_cls; /**< Link (H5L*) class callbacks */ + H5VL_object_class_t object_cls; /**< Object (H5O*) class callbacks */ /* Infrastructure / Services */ - H5VL_introspect_class_t introspect_cls; /* Container/connector introspection class callbacks */ - H5VL_request_class_t request_cls; /* Asynchronous request class callbacks */ - H5VL_blob_class_t blob_cls; /* 'Blob' class callbacks */ - H5VL_token_class_t token_cls; /* VOL connector object token class callbacks */ + H5VL_introspect_class_t introspect_cls; /**< Container/connector introspection class callbacks */ + H5VL_request_class_t request_cls; /**< Asynchronous request class callbacks */ + H5VL_blob_class_t blob_cls; /**< 'Blob' class callbacks */ + H5VL_token_class_t token_cls; /**< VOL connector object token class callbacks */ /* Catch-all */ herr_t (*optional)(void *obj, int op_type, hid_t dxpl_id, void **req, - va_list arguments); /* Optional callback */ + va_list arguments); /**< Optional callback */ } H5VL_class_t; +//! [H5VL_class_t_snip] /********************/ /* Public Variables */ @@ -485,10 +490,54 @@ extern "C" { #endif /* Helper routines for VOL connector authors */ +/** + * \ingroup H5VLDEV + * \brief Registers a new VOL connector + * + * \param[in] cls A pointer to the plugin structure to register + * \vipl_id + * \return \hid_t{VOL connector} + * + * \details H5VLregister_connector() registers a new VOL connector as a member + * of the virtual object layer class. This VOL connector identifier is + * good until the library is closed or the connector is unregistered. + * + * \p vipl_id is either #H5P_DEFAULT or the identifier of a VOL + * initialization property list of class #H5P_VOL_INITIALIZE created + * with H5Pcreate(). When created, this property list contains no + * library properties. If a VOL connector author decides that + * initialization-specific data are needed, they can be added to the + * empty list and retrieved by the connector in the VOL connector's + * initialize callback. Use of the VOL initialization property list is + * uncommon, as most VOL-specific properties are added to the file + * access property list via the connector's API calls which set the + * VOL connector for the file open/create. For more information, see + * the VOL documentation. + * + * H5VL_class_t is defined in H5VLconnector.h in the source code. It + * contains class information for each VOL connector: + * \snippet this H5VL_class_t_snip + * + * \todo Fix the reference to VOL documentation. + * + * \since 1.12.0 + */ H5_DLL hid_t H5VLregister_connector(const H5VL_class_t *cls, hid_t vipl_id); +/** + * \ingroup H5VLDEV + */ H5_DLL void *H5VLobject(hid_t obj_id); +/** + * \ingroup H5VLDEV + */ H5_DLL hid_t H5VLget_file_type(void *file_obj, hid_t connector_id, hid_t dtype_id); +/** + * \ingroup H5VLDEV + */ H5_DLL hid_t H5VLpeek_connector_id_by_name(const char *name); +/** + * \ingroup H5VLDEV + */ H5_DLL hid_t H5VLpeek_connector_id_by_value(H5VL_class_value_t value); #ifdef __cplusplus diff --git a/src/H5VLmodule.h b/src/H5VLmodule.h index 1ff9137e7be..91d61c94f8a 100644 --- a/src/H5VLmodule.h +++ b/src/H5VLmodule.h @@ -27,4 +27,19 @@ #define H5_MY_PKG_ERR H5E_VOL #define H5_MY_PKG_INIT YES +/** + * \defgroup H5VL H5VL + * \brief Virtual Object Layer Interface + * \todo Describe concisely what the functions in this module are about. + * + * \defgroup H5VLDEF Definitions + * \ingroup H5VL + * \defgroup H5VLDEV VOL Developer + * \ingroup H5VL + * \defgroup H5VLNAT Native VOL + * \ingroup H5VL + * \defgroup H5VLPT Pass-through VOL + * \ingroup H5VL + */ + #endif /* _H5VLmodule_H */ diff --git a/src/H5VLnative.h b/src/H5VLnative.h index b703c4fa3a6..b81f9c1fc4e 100644 --- a/src/H5VLnative.h +++ b/src/H5VLnative.h @@ -123,7 +123,13 @@ extern "C" { #endif /* Token <--> address converters */ +/** + * \ingroup H5VLNAT + */ H5_DLL herr_t H5VLnative_addr_to_token(hid_t loc_id, haddr_t addr, H5O_token_t *token); +/** + * \ingroup H5VLNAT + */ H5_DLL herr_t H5VLnative_token_to_addr(hid_t loc_id, H5O_token_t token, haddr_t *addr); /* Not really public but must be included here */ diff --git a/src/H5VLpublic.h b/src/H5VLpublic.h index 919a4b8c3fe..19cd2b9a478 100644 --- a/src/H5VLpublic.h +++ b/src/H5VLpublic.h @@ -28,39 +28,64 @@ /* VOL connector identifier values * These are H5VL_class_value_t values, NOT hid_t values! */ -#define H5_VOL_INVALID (-1) /* Invalid ID for VOL connector ID */ -#define H5_VOL_NATIVE 0 /* Native HDF5 file format VOL connector */ -#define H5_VOL_RESERVED 256 /* VOL connector IDs below this value are reserved for library use */ -#define H5_VOL_MAX 65535 /* Maximum VOL connector ID */ +/** + * \ingroup H5VLDEF + * Invalid ID for VOL connector ID + */ +#define H5_VOL_INVALID (-1) +/** + * \ingroup H5VLDEF + * Native HDF5 file format VOL connector + */ +#define H5_VOL_NATIVE 0 +/** + * \ingroup H5VLDEF + * VOL connector IDs below this value are reserved for library use + */ +#define H5_VOL_RESERVED 256 +/** + * \ingroup H5VLDEF + * Maximum VOL connector ID + */ +#define H5_VOL_MAX 65535 /*******************/ /* Public Typedefs */ /*******************/ -/* - * VOL connector identifiers. Values 0 through 255 are for connectors defined - * by the HDF5 library. Values 256 through 511 are available for testing new - * connectors. Subsequent values should be obtained from the HDF5 development - * team at help@hdfgroup.org. +/** + * \ingroup H5VLDEF + * + * \brief VOL connector identifiers. + * + * \details Values 0 through 255 are for connectors defined by the HDF5 + * library. Values 256 through 511 are available for testing new + * connectors. Subsequent values should be obtained from the HDF5 + * development team at mailto:help@hdfgroup.org. */ +//! [H5VL_class_value_t_snip] typedef int H5VL_class_value_t; +//! [H5VL_class_value_t_snip] -/* Enum type for each VOL subclass */ -/* (Used for various queries, etc) */ +/** + * \ingroup H5VLDEF + * \details Enum type for each VOL subclass + * (Used for various queries, etc) + */ typedef enum H5VL_subclass_t { - H5VL_SUBCLS_NONE, /* Operations outside of a subclass */ - H5VL_SUBCLS_INFO, /* 'Info' subclass */ - H5VL_SUBCLS_WRAP, /* 'Wrap' subclass */ - H5VL_SUBCLS_ATTR, /* 'Attribute' subclass */ - H5VL_SUBCLS_DATASET, /* 'Dataset' subclass */ - H5VL_SUBCLS_DATATYPE, /* 'Named datatype' subclass */ - H5VL_SUBCLS_FILE, /* 'File' subclass */ - H5VL_SUBCLS_GROUP, /* 'Group' subclass */ - H5VL_SUBCLS_LINK, /* 'Link' subclass */ - H5VL_SUBCLS_OBJECT, /* 'Object' subclass */ - H5VL_SUBCLS_REQUEST, /* 'Request' subclass */ - H5VL_SUBCLS_BLOB, /* 'Blob' subclass */ - H5VL_SUBCLS_TOKEN /* 'Token' subclass */ + H5VL_SUBCLS_NONE, /**< Operations outside of a subclass */ + H5VL_SUBCLS_INFO, /**< 'Info' subclass */ + H5VL_SUBCLS_WRAP, /**< 'Wrap' subclass */ + H5VL_SUBCLS_ATTR, /**< 'Attribute' subclass */ + H5VL_SUBCLS_DATASET, /**< 'Dataset' subclass */ + H5VL_SUBCLS_DATATYPE, /**< 'Named datatype' subclass */ + H5VL_SUBCLS_FILE, /**< 'File' subclass */ + H5VL_SUBCLS_GROUP, /**< 'Group' subclass */ + H5VL_SUBCLS_LINK, /**< 'Link' subclass */ + H5VL_SUBCLS_OBJECT, /**< 'Object' subclass */ + H5VL_SUBCLS_REQUEST, /**< 'Request' subclass */ + H5VL_SUBCLS_BLOB, /**< 'Blob' subclass */ + H5VL_SUBCLS_TOKEN /**< 'Token' subclass */ } H5VL_subclass_t; /********************/ @@ -75,16 +100,230 @@ typedef enum H5VL_subclass_t { extern "C" { #endif +/** + * \ingroup H5VL + * \brief Registers a new VOL connector by name + * + * \param[in] connector_name Connector name + * \vipl_id + * \return \hid_t{VOL connector} + * + * \details H5VLregister_connector_by_name() registers a new VOL connector with + * the name \p connector_name as a member of the virtual object layer + * class. This VOL connector identifier is good until the library is + * closed or the connector is unregistered. + * + * \p vipl_id is either #H5P_DEFAULT or the identifier of a VOL + * initialization property list of class #H5P_VOL_INITIALIZE created + * with H5Pcreate(). When created, this property list contains no + * library properties. If a VOL connector author decides that + * initialization-specific data are needed, they can be added to the + * empty list and retrieved by the connector in the VOL connector's + * initialize callback. Use of the VOL initialization property list is + * uncommon, as most VOL-specific properties are added to the file + * access property list via the connector's API calls which set the + * VOL connector for the file open/create. For more information, see + * the VOL documentation. + * + * \todo Fix the reference to VOL documentation. + * + * \since 1.12.0 + */ H5_DLL hid_t H5VLregister_connector_by_name(const char *connector_name, hid_t vipl_id); +/** + * \ingroup H5VL + * \brief Registers a new VOL connector by value + * + * \param[in] connector_value Connector value + * \vipl_id + * \return \hid_t{VOL connector} + * + * \details H5VLregister_connector_by_value() registers a new VOL connector + * with value connector_value as a member of the virtual object layer + * class. This VOL connector identifier is good until the library is + * closed or the connector is unregistered. + * + * \p connector_value has a type of H5VL_class_value_t, which is + * defined in H5VLpublic.h as follows: + * \snippet this H5VL_class_value_t_snip + * + * Valid VOL connector identifiers can have values from 0 through 255 + * for connectors defined by the HDF5 library. Values 256 through 511 + * are available for testing new connectors. Subsequent values should + * be obtained by contacting the The HDF Help Desk. + * + * \p vipl_id is either #H5P_DEFAULT or the identifier of a VOL + * initialization property list of class #H5P_VOL_INITIALIZE created + * with H5Pcreate(). When created, this property list contains no + * library properties. If a VOL connector author decides that + * initialization-specific data are needed, they can be added to the + * empty list and retrieved by the connector in the VOL connector's + * initialize callback. Use of the VOL initialization property list is + * uncommon, as most VOL-specific properties are added to the file + * access property list via the connector's API calls which set the + * VOL connector for the file open/create. For more information, see + * the VOL documentation. + * + * \todo Fix the reference to VOL documentation. + * + * \since 1.12.0 + */ H5_DLL hid_t H5VLregister_connector_by_value(H5VL_class_value_t connector_value, hid_t vipl_id); +/** + * \ingroup H5VL + * \brief Tests whether a VOL class has been registered under a certain name + * + * \param[in] name Alleged name of connector + * \return \htri_t + * + * \details H5VLis_connector_registered_by_name() tests whether a VOL class has + * been registered or not, according to the supplied connector name + * \p name. + * + * \since 1.12.0 + */ H5_DLL htri_t H5VLis_connector_registered_by_name(const char *name); +/** + * \ingroup H5VL + * \brief Tests whether a VOL class has been registered for a given value + * + * \param[in] connector_value Connector value + * \return \htri_t + * + * \details H5VLis_connector_registered_by_value() tests whether a VOL class + * has been registered, according to the supplied connector value \p + * connector_value. + * + * \p connector_value has a type of H5VL_class_value_t, which is + * defined in H5VLpublic.h as follows: + * \snippet this H5VL_class_value_t_snip + * + * Valid VOL connector identifiers can have values from 0 through 255 + * for connectors defined by the HDF5 library. Values 256 through 511 + * are available for testing new connectors. Subsequent values should + * be obtained by contacting the The HDF Help Desk. + * + * \since 1.12.0 + */ H5_DLL htri_t H5VLis_connector_registered_by_value(H5VL_class_value_t connector_value); +/** + * \ingroup H5VL + * \brief Retrieves the VOL connector identifier for a given object identifier + * + * \obj_id + * \return \hid_t{VOL connector} + * + * \details H5VLget_connector_id() retrieves the registered VOL connector + * identifier for the specified object identifier \p obj_id. The VOL + * connector identifier must be closed with H5VLclose() when no longer + * in use. + * + * \since 1.12.0 + */ H5_DLL hid_t H5VLget_connector_id(hid_t obj_id); +/** + * \ingroup H5VL + * \brief Retrieves the identifier for a registered VOL connector name + * + * \param[in] name Connector name + * \return \hid_t{VOL connector} + * + * \details H5VLget_connector_id_by_name() retrieves the identifier for a + * registered VOL connector with the name \p name. The identifier must + * be closed with H5VLclose() when no longer in use. + * + * \since 1.12.0 + */ H5_DLL hid_t H5VLget_connector_id_by_name(const char *name); +/** + * \ingroup H5VL + * \brief Retrieves the identifier for a registered VOL connector value + * + * \param[in] connector_value Connector value + * \return \hid_t{VOL connector} + * + * \details H5VLget_connector_id_by_value() retrieves the identifier for a + * registered VOL connector with the value \p connector_value. The + * identifier will need to be closed by H5VLclose(). + * + * \p connector_value has a type of H5VL_class_value_t, which is + * defined in H5VLpublic.h as follows: + * \snippet this H5VL_class_value_t_snip + * + * Valid VOL connector identifiers can have values from 0 through 255 + * for connectors defined by the HDF5 library. Values 256 through 511 + * are available for testing new connectors. Subsequent values should + * be obtained by contacting the The HDF Help Desk. + * + * \since 1.12.0 + */ H5_DLL hid_t H5VLget_connector_id_by_value(H5VL_class_value_t connector_value); +/** + * \ingroup H5VL + * \brief Retrieves a connector name for a VOL + * + * \obj_id{id} or file identifier + * \param[out] name Connector name + * \param[in] size Maximum length of the name to retrieve + * \return Returns the length of the connector name on success, and a negative value on failure. + * + * \details H5VLget_connector_name() retrieves up to \p size elements of the + * VOL name \p name associated with the object or file identifier \p + * id. + * + * Passing in a NULL pointer for size will return the size of the + * connector name. This can be used to determine the size of the + * buffer to allocate for the name. + * + * \since 1.12.0 + */ H5_DLL ssize_t H5VLget_connector_name(hid_t id, char *name /*out*/, size_t size); +/** + * \ingroup H5VL + * \brief Closes a VOL connector identifier + * + * \param[in] connector_id Connector identifier + * \return \herr_t + * + * \details H5VLclose() closes a VOL connector identifier. This does not affect + * the file access property lists which have been defined to use this + * VOL connector or files which are already opened under this + * connector. + * + * \since 1.12.0 + */ H5_DLL herr_t H5VLclose(hid_t connector_id); +/** + * \ingroup H5VL + * \brief Removes a VOL connector identifier from the library + * + * \param[in] connector_id Connector identifier + * \return \herr_t + * + * \details H5VLunregister_connector() removes a VOL connector identifier from + * the library. This does not affect the file access property lists + * which have been defined to use the VOL connector or any files which + * are already opened with this connector. + * + * \attention H5VLunregister_connector() will fail if attempting to unregister + * the native VOL connector. + * + * \since 1.12.0 + */ H5_DLL herr_t H5VLunregister_connector(hid_t connector_id); +/** + * \ingroup H5VL + * \brief Determine if a VOL connector supports a particular + * optional callback operation. + * + * \obj_id + * \param[in] subcls VOL subclass + * \param[in] opt_type Option type + * \param[out] supported Flag + * \return \herr_t + * + * \since 1.12.0 + */ H5_DLL herr_t H5VLquery_optional(hid_t obj_id, H5VL_subclass_t subcls, int opt_type, hbool_t *supported); #ifdef __cplusplus diff --git a/src/H5Zmodule.h b/src/H5Zmodule.h index d83f338f06e..3be26292fcd 100644 --- a/src/H5Zmodule.h +++ b/src/H5Zmodule.h @@ -29,4 +29,71 @@ #define H5_MY_PKG_ERR H5E_PLINE #define H5_MY_PKG_INIT YES +/** + * \defgroup H5Z H5Z + * + * + * \brief Filter and Compression Interface + * + * \details The functions in this module let you configure filters that process + * data during I/O operation. + * + * HDF5 supports a filter pipeline that provides the capability for + * standard and customized raw data processing during I/O operations. + * HDF5 is distributed with a small set of standard filters such as + * compression (gzip, SZIP, and a shuffling algorithm) and error + * checking (Fletcher32 checksum). For further flexibility, the + * library allows a user application to extend the pipeline through + * the creation and registration of customized filters. + * + * The flexibility of the filter pipeline implementation enables the + * definition of additional filters by a user application. A filter + * \li is associated with a dataset when the dataset is created, + * \li can be used only with chunked data (i.e., datasets stored in + * the #H5D_CHUNKED storage layout), and + * \li is applied independently to each chunk of the dataset. + * + * The HDF5 library does not support filters for contiguous datasets + * because of the difficulty of implementing random access for partial + * I/O. Compact dataset filters are not supported because it would not + * produce significant results. + * + * Filter identifiers for the filters distributed with the HDF5 + * Library are as follows: + * + * + * + * + * + * + * + *
#H5Z_FILTER_DEFLATEThe gzip compression, or + * deflation, filter
#H5Z_FILTER_SZIPThe SZIP compression + * filter
#H5Z_FILTER_NBITThe N-bit compression + * filter
#H5Z_FILTER_SCALEOFFSETThe scale-offset + * compression filter
#H5Z_FILTER_SHUFFLEThe shuffle algorithm + * filter
#H5Z_FILTER_FLETCHER32The Fletcher32 checksum, + * or error checking, filter
+ * Custom filters that have been registered with the library will have + * additional unique identifiers. + * + * See \Emph{HDF5 Dynamically Loaded Filters} for more information on + * how an HDF5 application can apply a filter that is not registered + * with the HDF5 library. + * + * \todo Fix the reference. + * + * \defgroup H5ZPRE Predefined Filters + * \ingroup H5Z + * \defgroup FLETCHER32 Checksum Filter + * \ingroup H5ZPRE + * \defgroup SCALEOFFSET Scale-Offset Filter + * \ingroup H5ZPRE + * \defgroup SHUFFLE Shuffle Filter + * \ingroup H5ZPRE + * \defgroup SZIP Szip Filter + * \ingroup H5ZPRE + * + */ + #endif /* _H5Zmodule_H */ diff --git a/src/H5Zpublic.h b/src/H5Zpublic.h index 97da13ccbe9..709e5fdf113 100644 --- a/src/H5Zpublic.h +++ b/src/H5Zpublic.h @@ -21,201 +21,610 @@ /* Public headers needed by this file */ #include "H5public.h" -/* - * Filter identifiers. Values 0 through 255 are for filters defined by the - * HDF5 library. Values 256 through 511 are available for testing new - * filters. Subsequent values should be obtained from the HDF5 development - * team at help@hdfgroup.org. These values will never change because they - * appear in the HDF5 files. +/** + * \brief Filter identifiers + * + * \details Values 0 through 255 are for filters defined by the HDF5 library. + * Values 256 through 511 are available for testing new filters. + * Subsequent values should be obtained from the HDF5 development team + * at mailto:help@hdfgroup.org. These values will never change because + * they appear in the HDF5 files. */ typedef int H5Z_filter_t; /* Filter IDs */ -#define H5Z_FILTER_ERROR (-1) /*no filter */ -#define H5Z_FILTER_NONE 0 /*reserved indefinitely */ -#define H5Z_FILTER_DEFLATE 1 /*deflation like gzip */ -#define H5Z_FILTER_SHUFFLE 2 /*shuffle the data */ -#define H5Z_FILTER_FLETCHER32 3 /*fletcher32 checksum of EDC */ -#define H5Z_FILTER_SZIP 4 /*szip compression */ -#define H5Z_FILTER_NBIT 5 /*nbit compression */ -#define H5Z_FILTER_SCALEOFFSET 6 /*scale+offset compression */ -#define H5Z_FILTER_RESERVED 256 /*filter ids below this value are reserved for library use */ - -#define H5Z_FILTER_MAX 65535 /*maximum filter id */ +/** + * no filter + */ +#define H5Z_FILTER_ERROR (-1) +/** + * reserved indefinitely +*/ +#define H5Z_FILTER_NONE 0 +/** + * deflation like gzip + */ +#define H5Z_FILTER_DEFLATE 1 +/** + * shuffle the data + */ +#define H5Z_FILTER_SHUFFLE 2 +/** + * fletcher32 checksum of EDC +*/ +#define H5Z_FILTER_FLETCHER32 3 +/** + * szip compression + */ +#define H5Z_FILTER_SZIP 4 +/** + * nbit compression + */ +#define H5Z_FILTER_NBIT 5 +/** + * scale+offset compression + */ +#define H5Z_FILTER_SCALEOFFSET 6 +/** + * filter ids below this value are reserved for library use + */ +#define H5Z_FILTER_RESERVED 256 +/** + * maximum filter id + */ +#define H5Z_FILTER_MAX 65535 /* General macros */ -#define H5Z_FILTER_ALL 0 /* Symbol to remove all filters in H5Premove_filter */ -#define H5Z_MAX_NFILTERS 32 /* Maximum number of filters allowed in a pipeline */ - /* (should probably be allowed to be an - * unlimited amount, but currently each - * filter uses a bit in a 32-bit field, - * so the format would have to be - * changed to accommodate that) - */ +/** + * Symbol to remove all filters in H5Premove_filter() + */ +#define H5Z_FILTER_ALL 0 +/** + * Maximum number of filters allowed in a pipeline + * + * \internal (should probably be allowed to be an unlimited amount, but + * currently each filter uses a bit in a 32-bit field, so the format + * would have to be changed to accommodate that) + */ +#define H5Z_MAX_NFILTERS 32 /* Flags for filter definition (stored) */ -#define H5Z_FLAG_DEFMASK 0x00ff /*definition flag mask */ -#define H5Z_FLAG_MANDATORY 0x0000 /*filter is mandatory */ -#define H5Z_FLAG_OPTIONAL 0x0001 /*filter is optional */ +/** + * definition flag mask + */ +#define H5Z_FLAG_DEFMASK 0x00ff +/** + * filter is mandatory + */ +#define H5Z_FLAG_MANDATORY 0x0000 +/** + * filter is optional + */ +#define H5Z_FLAG_OPTIONAL 0x0001 /* Additional flags for filter invocation (not stored) */ -#define H5Z_FLAG_INVMASK 0xff00 /*invocation flag mask */ -#define H5Z_FLAG_REVERSE 0x0100 /*reverse direction; read */ -#define H5Z_FLAG_SKIP_EDC 0x0200 /*skip EDC filters for read */ +/** + * invocation flag mask + */ +#define H5Z_FLAG_INVMASK 0xff00 +/** + * reverse direction; read + */ +#define H5Z_FLAG_REVERSE 0x0100 +/** + * skip EDC filters for read + */ +#define H5Z_FLAG_SKIP_EDC 0x0200 /* Special parameters for szip compression */ /* [These are aliases for the similar definitions in szlib.h, which we can't * include directly due to the duplication of various symbols with the zlib.h * header file] */ -#define H5_SZIP_ALLOW_K13_OPTION_MASK 1 -#define H5_SZIP_CHIP_OPTION_MASK 2 -#define H5_SZIP_EC_OPTION_MASK 4 -#define H5_SZIP_NN_OPTION_MASK 32 -#define H5_SZIP_MAX_PIXELS_PER_BLOCK 32 +/** + * \ingroup SZIP */ +#define H5_SZIP_ALLOW_K13_OPTION_MASK 1 +/** + * \ingroup SZIP */ +#define H5_SZIP_CHIP_OPTION_MASK 2 +/** + * \ingroup SZIP */ +#define H5_SZIP_EC_OPTION_MASK 4 +/** + * \ingroup SZIP */ +#define H5_SZIP_NN_OPTION_MASK 32 +/** + * \ingroup SZIP */ +#define H5_SZIP_MAX_PIXELS_PER_BLOCK 32 /* Macros for the shuffle filter */ -#define H5Z_SHUFFLE_USER_NPARMS 0 /* Number of parameters that users can set */ -#define H5Z_SHUFFLE_TOTAL_NPARMS 1 /* Total number of parameters for filter */ +/** + * \ingroup SHUFFLE + * Number of parameters that users can set for the shuffle filter +*/ +#define H5Z_SHUFFLE_USER_NPARMS 0 +/** + * \ingroup SHUFFLE + * Total number of parameters for the shuffle filter + */ +#define H5Z_SHUFFLE_TOTAL_NPARMS 1 /* Macros for the szip filter */ -#define H5Z_SZIP_USER_NPARMS 2 /* Number of parameters that users can set */ -#define H5Z_SZIP_TOTAL_NPARMS 4 /* Total number of parameters for filter */ -#define H5Z_SZIP_PARM_MASK 0 /* "User" parameter for option mask */ -#define H5Z_SZIP_PARM_PPB 1 /* "User" parameter for pixels-per-block */ -#define H5Z_SZIP_PARM_BPP 2 /* "Local" parameter for bits-per-pixel */ -#define H5Z_SZIP_PARM_PPS 3 /* "Local" parameter for pixels-per-scanline */ +/** + * \ingroup SZIP + * Number of parameters that users can set for SZIP + */ +#define H5Z_SZIP_USER_NPARMS 2 +/** + * \ingroup SZIP + * Total number of parameters for SZIP filter + */ +#define H5Z_SZIP_TOTAL_NPARMS 4 +/** + * \ingroup SZIP + * "User" parameter for option mask + */ +#define H5Z_SZIP_PARM_MASK 0 +/** + * \ingroup SZIP + * "User" parameter for pixels-per-block + */ +#define H5Z_SZIP_PARM_PPB 1 +/** + * \ingroup SZIP + * "Local" parameter for bits-per-pixel + */ +#define H5Z_SZIP_PARM_BPP 2 +/** + * \ingroup SZIP + * "Local" parameter for pixels-per-scanline + */ +#define H5Z_SZIP_PARM_PPS 3 /* Macros for the nbit filter */ -#define H5Z_NBIT_USER_NPARMS 0 /* Number of parameters that users can set */ +/** + * \ingroup NBIT + * Number of parameters that users can set for the N-bit filter + */ +#define H5Z_NBIT_USER_NPARMS 0 /* Number of parameters that users can set */ /* Macros for the scale offset filter */ -#define H5Z_SCALEOFFSET_USER_NPARMS 2 /* Number of parameters that users can set */ +/** + * \ingroup SCALEOFFSET + * Number of parameters that users can set for the scale-offset filter + */ +#define H5Z_SCALEOFFSET_USER_NPARMS 2 + /* Special parameters for ScaleOffset filter*/ +/** + * \ingroup SCALEOFFSET */ #define H5Z_SO_INT_MINBITS_DEFAULT 0 +/** + * \ingroup SCALEOFFSET */ typedef enum H5Z_SO_scale_type_t { H5Z_SO_FLOAT_DSCALE = 0, H5Z_SO_FLOAT_ESCALE = 1, H5Z_SO_INT = 2 } H5Z_SO_scale_type_t; -/* Current version of the H5Z_class_t struct */ +/** + * Current version of the H5Z_class_t struct + */ #define H5Z_CLASS_T_VERS (1) -/* Values to decide if EDC is enabled for reading data */ +/** + * \ingroup FLETCHER32 + * Values to decide if EDC is enabled for reading data + */ typedef enum H5Z_EDC_t { - H5Z_ERROR_EDC = -1, /* error value */ - H5Z_DISABLE_EDC = 0, - H5Z_ENABLE_EDC = 1, - H5Z_NO_EDC = 2 /* must be the last */ + H5Z_ERROR_EDC = -1, /**< error value */ + H5Z_DISABLE_EDC = 0, + H5Z_ENABLE_EDC = 1, + H5Z_NO_EDC = 2 /**< sentinel */ } H5Z_EDC_t; /* Bit flags for H5Zget_filter_info */ #define H5Z_FILTER_CONFIG_ENCODE_ENABLED (0x0001) #define H5Z_FILTER_CONFIG_DECODE_ENABLED (0x0002) -/* Return values for filter callback function */ +/** + * Return values for filter callback function + */ typedef enum H5Z_cb_return_t { - H5Z_CB_ERROR = -1, - H5Z_CB_FAIL = 0, /* I/O should fail if filter fails. */ - H5Z_CB_CONT = 1, /* I/O continues if filter fails. */ - H5Z_CB_NO = 2 + H5Z_CB_ERROR = -1, + H5Z_CB_FAIL = 0, /**< I/O should fail if filter fails. */ + H5Z_CB_CONT = 1, /**< I/O continues if filter fails. */ + H5Z_CB_NO = 2 } H5Z_cb_return_t; -/* Filter callback function definition */ -typedef H5Z_cb_return_t (*H5Z_filter_func_t)(H5Z_filter_t filter, void *buf, size_t buf_size, void *op_data); +/** + * Filter callback function definition + */ +typedef H5Z_cb_return_t (*H5Z_filter_func_t)(H5Z_filter_t filter, void* buf, + size_t buf_size, void* op_data); -/* Structure for filter callback property */ +/** + * Structure for filter callback property + */ typedef struct H5Z_cb_t { - H5Z_filter_func_t func; - void * op_data; + H5Z_filter_func_t func; + void *op_data; } H5Z_cb_t; #ifdef __cplusplus extern "C" { #endif -/* - * Before a dataset gets created, the "can_apply" callbacks for any filters used - * in the dataset creation property list are called - * with the dataset's dataset creation property list, the dataset's datatype and - * a dataspace describing a chunk (for chunked dataset storage). +/** + * \details Before a dataset gets created, the \c can_apply callbacks for any + * filters used in the dataset creation property list are called with + * the dataset's dataset creation property list, the dataset's + * datatype and a dataspace describing a chunk (for chunked dataset + * storage). * - * The "can_apply" callback must determine if the combination of the dataset - * creation property list setting, the datatype and the dataspace represent a - * valid combination to apply this filter to. For example, some cases of - * invalid combinations may involve the filter not operating correctly on - * certain datatypes (or certain datatype sizes), or certain sizes of the chunk - * dataspace. + * The \c can_apply callback must determine if the combination of the + * dataset creation property list setting, the datatype and the + * dataspace represent a valid combination to apply this filter to. + * For example, some cases of invalid combinations may involve the + * filter not operating correctly on certain datatypes (or certain + * datatype sizes), or certain sizes of the chunk dataspace. * - * The "can_apply" callback can be the NULL pointer, in which case, the library - * will assume that it can apply to any combination of dataset creation - * property list values, datatypes and dataspaces. + * The \c can_apply callback can be the NULL pointer, in which case, + * the library will assume that it can apply to any combination of + * dataset creation property list values, datatypes and dataspaces. * - * The "can_apply" callback returns positive a valid combination, zero for an - * invalid combination and negative for an error. + * The \c can_apply callback returns positive a valid combination, + * zero for an invalid combination and negative for an error. */ +//! [H5Z_can_apply_func_t_snip] typedef htri_t (*H5Z_can_apply_func_t)(hid_t dcpl_id, hid_t type_id, hid_t space_id); - -/* - * After the "can_apply" callbacks are checked for new datasets, the "set_local" - * callbacks for any filters used in the dataset creation property list are - * called. These callbacks receive the dataset's private copy of the dataset - * creation property list passed in to H5Dcreate (i.e. not the actual property - * list passed in to H5Dcreate) and the datatype ID passed in to H5Dcreate - * (which is not copied and should not be modified) and a dataspace describing - * the chunk (for chunked dataset storage) (which should also not be modified). +//! [H5Z_can_apply_func_t_snip] +/** + * \details After the "can_apply" callbacks are checked for new datasets, the + * \c set_local callbacks for any filters used in the dataset creation + * property list are called. These callbacks receive the dataset's + * private copy of the dataset creation property list passed in to + * H5Dcreate() (i.e. not the actual property list passed in to + * H5Dcreate()) and the datatype ID passed in to H5Dcreate() (which is + * not copied and should not be modified) and a dataspace describing + * the chunk (for chunked dataset storage) (which should also not be + * modified). * - * The "set_local" callback must set any parameters that are specific to this - * dataset, based on the combination of the dataset creation property list - * values, the datatype and the dataspace. For example, some filters perform - * different actions based on different datatypes (or datatype sizes) or - * different number of dimensions or dataspace sizes. + * The \c set_local callback must set any parameters that are specific + * to this dataset, based on the combination of the dataset creation + * property list values, the datatype and the dataspace. For example, + * some filters perform different actions based on different datatypes + * (or datatype sizes) or different number of dimensions or dataspace + * sizes. * - * The "set_local" callback can be the NULL pointer, in which case, the library - * will assume that there are no dataset-specific settings for this filter. + * The \c set_local callback can be the NULL pointer, in which case, + * the library will assume that there are no dataset-specific settings + * for this filter. * - * The "set_local" callback must return non-negative on success and negative - * for an error. + * The \c set_local callback must return non-negative on success and + * negative for an error. */ +//! [H5Z_set_local_func_t_snip] typedef herr_t (*H5Z_set_local_func_t)(hid_t dcpl_id, hid_t type_id, hid_t space_id); - -/* - * A filter gets definition flags and invocation flags (defined above), the - * client data array and size defined when the filter was added to the - * pipeline, the size in bytes of the data on which to operate, and pointers - * to a buffer and its allocated size. +//! [H5Z_set_local_func_t_snip] +/** + * \details A filter gets definition flags and invocation flags (defined + * above), the client data array and size defined when the filter was + * added to the pipeline, the size in bytes of the data on which to + * operate, and pointers to a buffer and its allocated size. * - * The filter should store the result in the supplied buffer if possible, - * otherwise it can allocate a new buffer, freeing the original. The - * allocated size of the new buffer should be returned through the BUF_SIZE - * pointer and the new buffer through the BUF pointer. + * The filter should store the result in the supplied buffer if + * possible, otherwise it can allocate a new buffer, freeing the + * original. The allocated size of the new buffer should be returned + * through the \p buf_size pointer and the new buffer through the \p + * buf pointer. * - * The return value from the filter is the number of bytes in the output - * buffer. If an error occurs then the function should return zero and leave - * all pointer arguments unchanged. + * The return value from the filter is the number of bytes in the + * output buffer. If an error occurs then the function should return + * zero and leave all pointer arguments unchanged. */ +//! [H5Z_func_t_snip] typedef size_t (*H5Z_func_t)(unsigned int flags, size_t cd_nelmts, const unsigned int cd_values[], size_t nbytes, size_t *buf_size, void **buf); - -/* +//! [H5Z_func_t_snip] +/** * The filter table maps filter identification numbers to structs that * contain a pointers to the filter function and timing statistics. */ +//! [H5Z_class2_t_snip] typedef struct H5Z_class2_t { - int version; /* Version number of the H5Z_class_t struct */ - H5Z_filter_t id; /* Filter ID number */ - unsigned encoder_present; /* Does this filter have an encoder? */ - unsigned decoder_present; /* Does this filter have a decoder? */ - const char * name; /* Comment for debugging */ - H5Z_can_apply_func_t can_apply; /* The "can apply" callback for a filter */ - H5Z_set_local_func_t set_local; /* The "set local" callback for a filter */ - H5Z_func_t filter; /* The actual filter function */ + int version; /**< Version number of the H5Z_class_t struct */ + H5Z_filter_t id; /**< Filter ID number */ + unsigned encoder_present; /**< Does this filter have an encoder? */ + unsigned decoder_present; /**< Does this filter have a decoder? */ + const char *name; /**< Comment for debugging */ + H5Z_can_apply_func_t can_apply; /**< The "can apply" callback for a filter */ + H5Z_set_local_func_t set_local; /**< The "set local" callback for a filter */ + H5Z_func_t filter; /**< The actual filter function */ } H5Z_class2_t; +//! [H5Z_class2_t_snip] +/** + * \ingroup H5Z + * + * \brief Registers a new filter with the HDF5 library + * + * \param[in] cls A pointer to a buffer for the struct containing the + * filter-definition + * + * \return \herr_t + * + * \details H5Zregister() registers a new filter with the HDF5 library. + * + * \details Making a new filter available to an application is a two-step + * process. The first step is to write the three filter callback + * functions described below: \c can_apply, \c set_local, and \c + * filter. This call to H5Zregister(), registering the filter with the + * library, is the second step. The can_apply and set_local fields can + * be set to NULL if they are not required for the filter being + * registered. + * + * H5Zregister() accepts a single parameter, a pointer to a buffer for + * the \p cls data structure. That data structure must conform to one + * of the following definitions: + * \snippet this H5Z_class1_t_snip + * or + * \snippet this H5Z_class2_t_snip + * + * \c version is a library-defined value reporting the version number + * of the #H5Z_class_t struct. This currently must be set to + * #H5Z_CLASS_T_VERS. + * + * \c id is the identifier for the new filter. This is a user-defined + * value between #H5Z_FILTER_RESERVED and #H5Z_FILTER_MAX. These + * values are defined in the HDF5 source file H5Zpublic.h, but the + * symbols #H5Z_FILTER_RESERVED and #H5Z_FILTER_MAX should always be + * used instead of the literal values. + * + * \c encoder_present is a library-defined value indicating whether + * the filter’s encoding capability is available to the application. + * + * \c decoder_present is a library-defined value indicating whether + * the filter’s encoding capability is available to the application. + * + * \c name is a descriptive comment used for debugging, may contain a + * descriptive name for the filter, and may be the null pointer. + * + * \c can_apply, described in detail below, is a user-defined callback + * function which determines whether the combination of the dataset + * creation property list values, the datatype, and the dataspace + * represent a valid combination to apply this filter to. + * + * \c set_local, described in detail below, is a user-defined callback + * function which sets any parameters that are specific to this + * dataset, based on the combination of the dataset creation property + * list values, the datatype, and the dataspace. + * + * \c filter, described in detail below, is a user-defined callback + * function which performs the action of the filter. + * + * The statistics associated with a filter are not reset by this + * function; they accumulate over the life of the library. + * + * #H5Z_class_t is a macro which maps to either H5Z_class1_t or + * H5Z_class2_t, depending on the needs of the application. To affect + * only this macro, H5Z_class_t_vers may be defined to either 1 or 2. + * Otherwise, it will behave in the same manner as other API + * compatibility macros. See API Compatibility Macros in HDF5 for more + * information. H5Z_class1_t matches the #H5Z_class_t structure that is + * used in the 1.6.x versions of the HDF5 library. + * + * H5Zregister() will automatically detect which structure type has + * been passed in, regardless of the mapping of the #H5Z_class_t macro. + * However, the application must make sure that the fields are filled + * in according to the correct structure definition if the macro is + * used to declare the structure. + * + * \Bold{The callback functions:}\n Before H5Zregister() can link a + * filter into an application, three callback functions must be + * defined as described in the HDF5 library header file H5Zpublic.h. + * + * When a filter is applied to the fractal heap for a group (e.g., + * when compressing group metadata) and if the can apply and set local + * callback functions have been defined for that filter, HDF5 passes + * the value -1 for all parameters for those callback functions. This + * is done to ensure that the filter will not be applied to groups if + * it relies on these parameters, as they are not applicable to group + * fractal heaps; to operate on group fractal heaps, a filter must be + * capable of operating on an opaque block of binary data. + * + * The \Emph{can apply} callback function must return a positive value + * for a valid combination, zero for an invalid combination, and a + * negative value for an error. + * \snippet this H5Z_can_apply_func_t_snip + * + * Before a dataset is created, the \Emph{can apply} callbacks for any + * filters used in the dataset creation property list are called with + * the dataset's dataset creation property list, \c dcpl_id, the + * dataset's datatype, \p type_id, and a dataspace describing a chunk, + * \p space_id, (for chunked dataset storage). + * + * This callback must determine whether the combination of the dataset + * creation property list settings, the datatype, and the dataspace + * represent a valid combination to which to apply this filter. For + * example, an invalid combination may involve the filter not + * operating correctly on certain datatypes, on certain datatype + * sizes, or on certain sizes of the chunk dataspace. If this filter + * is enabled through H5Pset_filter() as optional and the can apply + * function returns 0, the library will skip the filter in the filter + * pipeline. + * + * This callback can be the NULL pointer, in which case the library + * will assume that the filter can be applied to a dataset with any + * combination of dataset creation property list values, datatypes, + * and dataspaces. + * + * The \Emph{set local} callback function is defined as follows: + * \snippet this H5Z_set_local_func_t_snip + * + * After the can apply callbacks are checked for a new dataset, the + * \Emph{set local} callback functions for any filters used in the + * dataset creation property list are called. These callbacks receive + * \c dcpl_id, the dataset's private copy of the dataset creation + * property list passed in to H5Dcreate() (i.e. not the actual + * property list passed in to H5Dcreate()); \c type_id, the datatype + * identifier passed in to H5Dcreate(), which is not copied and should + * not be modified; and \c space_id, a dataspace describing the chunk + * (for chunked dataset storage), which should also not be modified. + * + * The set local callback must set any filter parameters that are + * specific to this dataset, based on the combination of the dataset + * creation property list values, the datatype, and the dataspace. For + * example, some filters perform different actions based on different + * datatypes, datatype sizes, numbers of dimensions, or dataspace + * sizes. + * + * The \Emph{set local} callback may be the NULL pointer, in which + * case, the library will assume that there are no dataset-specific + * settings for this filter. + * + * The \Emph{set local} callback function must return a non-negative + * value on success and a negative value for an error. + * + * The \Emph{filter operation} callback function, defining the + * filter's operation on the data, is defined as follows: + * \snippet this H5Z_func_t_snip + * + * The parameters \c flags, \c cd_nelmts, and \c cd_values are the + * same as for the function H5Pset_filter(). The one exception is that + * an additional flag, #H5Z_FLAG_REVERSE, is set when the filter is + * called as part of the input pipeline. + * + * The parameter \c buf points to the input buffer which has a size of + * \c buf_size bytes, \c nbytes of which are valid data. + * + * The filter should perform the transformation in place if possible. + * If the transformation cannot be done in place, then the filter + * should allocate a new buffer with malloc() and assign it to \c buf, + * assigning the allocated size of that buffer to \c buf_size. The old + * buffer should be freed by calling free(). + * + * If successful, the \Emph{filter operation} callback function + * returns the number of valid bytes of data contained in \c buf. In + * the case of failure, the return value is 0 (zero) and all pointer + * arguments are left unchanged. + * + * \version 1.8.6 Return type for the \Emph{can apply} callback function, + * \ref H5Z_can_apply_func_t, changed to \ref htri_t. + * \version 1.8.5 Semantics of the \Emph{can apply} and \Emph{set local} + * callback functions changed to accommodate the use of filters + * with group fractal heaps. + * \version 1.8.3 #H5Z_class_t renamed to H5Z_class2_t, H5Z_class1_t structure + * introduced for backwards compatibility with release 1.6.x, + * and #H5Z_class_t macro introduced in this release. Function + * modified to accept either structure type. + * \version 1.8.0 The fields \c version, \c encoder_present, and + * \c decoder_present were added to the #H5Z_class_t \c struct + * in this release. + * \version 1.6.0 This function was substantially revised in Release 1.6.0 with + * a new #H5Z_class_t struct and new set local and can apply + * callback functions. + * + */ H5_DLL herr_t H5Zregister(const void *cls); +/** + * \ingroup H5Z + * + * \brief Unregisters a filter. + * + * \param[in] id Identifier of the filter to be unregistered. + * \return \herr_t + * + * \details H5Zunregister() unregisters the filter specified in \p id. + * + * \details This function first iterates through all opened datasets and + * groups. If an open object that uses this filter is found, the + * function will fail with a message indicating that an object using + * the filter is still open. All open files are then flushed to make + * sure that all cached data that may use this filter are written out. + * + * If the application is a parallel program, all processes that + * participate in collective data write should call this function to + * ensure that all data is flushed. + * + * After a call to H5Zunregister(), the filter specified in filter + * will no longer be available to the application. + * + * \version 1.8.12 Function modified to check for open objects using the + * filter. + * \since 1.6.0 + */ H5_DLL herr_t H5Zunregister(H5Z_filter_t id); +/** + * \ingroup H5Z + * + * \brief Determines whether a filter is available + * + * \param[in] id Filter identifier + * \return \htri_t + * + * \details H5Zfilter_avail() determines whether the filter specified in \p id + * is available to the application. + * + * \since 1.6.0 + */ H5_DLL htri_t H5Zfilter_avail(H5Z_filter_t id); +/** + * \ingroup H5Z + * + * \brief Retrieves information about a filter + * + * \param[in] filter Filter identifier + * \param[out] filter_config_flags A bit field encoding the returned filter + * information + * \return \herr_t + * + * \details H5Zget_filter_info() retrieves information about a filter. At + * present, this means that the function retrieves a filter's + * configuration flags, indicating whether the filter is configured to + * decode data, to encode data, neither, or both. + * + * If \p filter_config_flags is not set to NULL prior to the function + * call, the returned parameter contains a bit field specifying the + * available filter configuration. The configuration flag values can + * then be determined through a series of bitwise AND operations, as + * described below. + * + * Valid filter configuration flags include the following: + * + * + * + * + * + *
#H5Z_FILTER_CONFIG_ENCODE_ENABLEDEncoding is enabled for this filter
#H5Z_FILTER_CONFIG_DECODE_ENABLEDDecoding is enabled for this filter
+ * + * A bitwise AND of the returned \p filter_config_flags and a valid + * filter configuration flag will reveal whether the related + * configuration option is available. For example, if the value of + * \code + * H5Z_FILTER_CONFIG_ENCODE_ENABLED & filter_config_flags + * \endcode + * is true, i.e., greater than 0 (zero), the queried filter + * is configured to encode data; if the value is \c FALSE, i.e., equal to + * 0 (zero), the filter is not so configured. + * + * If a filter is not encode-enabled, the corresponding \c H5Pset_* + * function will return an error if the filter is added to a dataset + * creation property list (which is required if the filter is to be + * used to encode that dataset). For example, if the + * #H5Z_FILTER_CONFIG_ENCODE_ENABLED flag is not returned for the SZIP + * filter, #H5Z_FILTER_SZIP, a call to H5Pset_szip() will fail. + * + * If a filter is not decode-enabled, the application will not be able + * to read an existing file encoded with that filter. + * + * This function should be called, and the returned \p + * filter_config_flags analyzed, before calling any other function, + * such as H5Pset_szip() , that might require a particular filter + * configuration. + * + * \since 1.6.3 + */ H5_DLL herr_t H5Zget_filter_info(H5Z_filter_t filter, unsigned int *filter_config_flags); /* Symbols defined for compatibility with previous versions of the HDF5 API. @@ -224,17 +633,19 @@ H5_DLL herr_t H5Zget_filter_info(H5Z_filter_t filter, unsigned int *filter_confi */ #ifndef H5_NO_DEPRECATED_SYMBOLS -/* +/** * The filter table maps filter identification numbers to structs that * contain a pointers to the filter function and timing statistics. */ +//! [H5Z_class1_t_snip] typedef struct H5Z_class1_t { - H5Z_filter_t id; /* Filter ID number */ - const char * name; /* Comment for debugging */ - H5Z_can_apply_func_t can_apply; /* The "can apply" callback for a filter */ - H5Z_set_local_func_t set_local; /* The "set local" callback for a filter */ - H5Z_func_t filter; /* The actual filter function */ + H5Z_filter_t id; /**< Filter ID number */ + const char *name; /**< Comment for debugging */ + H5Z_can_apply_func_t can_apply; /**< The "can apply" callback for a filter */ + H5Z_set_local_func_t set_local; /**< The "set local" callback for a filter */ + H5Z_func_t filter; /**< The actual filter function */ } H5Z_class1_t; +//! [H5Z_class1_t_snip] #endif /* H5_NO_DEPRECATED_SYMBOLS */ diff --git a/src/H5checksum.c b/src/H5checksum.c index bc36bb9fbe5..82964d9909e 100644 --- a/src/H5checksum.c +++ b/src/H5checksum.c @@ -25,6 +25,7 @@ /****************/ /* Module Setup */ /****************/ +#include "H5module.h" /* This source code file is part of the H5 module */ /***********/ /* Headers */ @@ -379,7 +380,7 @@ uint32_t H5_checksum_lookup3(const void *key, size_t length, uint32_t initval) { const uint8_t *k = (const uint8_t *)key; - uint32_t a, b, c; /* internal state */ + uint32_t a, b, c = 0; /* internal state */ FUNC_ENTER_NOAPI_NOINIT_NOERR diff --git a/src/H5dbg.c b/src/H5dbg.c index 1b64d2c60dc..5d38efcc2ce 100644 --- a/src/H5dbg.c +++ b/src/H5dbg.c @@ -25,6 +25,7 @@ /****************/ /* Module Setup */ /****************/ +#include "H5module.h" /* This source code file is part of the H5 module */ /***********/ /* Headers */ diff --git a/src/H5err.txt b/src/H5err.txt index 24ac2acbfb2..05476e5f7e0 100644 --- a/src/H5err.txt +++ b/src/H5err.txt @@ -46,6 +46,7 @@ MAJOR, H5E_ARGS, Invalid arguments to routine MAJOR, H5E_RESOURCE, Resource unavailable MAJOR, H5E_INTERNAL, Internal error (too specific to document in detail) +MAJOR, H5E_LIB, General library infrastructure MAJOR, H5E_FILE, File accessibility MAJOR, H5E_IO, Low-level I/O MAJOR, H5E_FUNC, Function entry/exit diff --git a/src/H5module.h b/src/H5module.h new file mode 100644 index 00000000000..f6884b1e771 --- /dev/null +++ b/src/H5module.h @@ -0,0 +1,34 @@ +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * + * Copyright by The HDF Group. * + * All rights reserved. * + * * + * This file is part of HDF5. The full HDF5 copyright notice, including * + * terms governing use, modification, and redistribution, is contained in * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * + * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ + +/* + * Purpose: This file contains declarations which define macros for the + * H5 package. Including this header means that the source file + * is part of the H5 package. + */ +#ifndef _H5module_H +#define _H5module_H + +/* Define the proper control macros for the generic FUNC_ENTER/LEAVE and error + * reporting macros. + */ +#define H5_MODULE +#define H5_MY_PKG H5 +#define H5_MY_PKG_ERR H5E_LIB +#define H5_MY_PKG_INIT YES + +/**\defgroup H5 H5 + * \brief General Library Functions + * \todo Describe concisely what the functions in this module are about. + */ + +#endif /* _H5module_H */ diff --git a/src/H5private.h b/src/H5private.h index 1390b3f5b84..600089da3fe 100644 --- a/src/H5private.h +++ b/src/H5private.h @@ -2160,7 +2160,6 @@ H5_DLL herr_t H5CX_pop(void); #define FUNC_ENTER_API_INIT(err) \ /* Initialize the library */ \ if (!H5_INIT_GLOBAL && !H5_TERM_GLOBAL) { \ - H5_INIT_GLOBAL = TRUE; \ if (H5_init_library() < 0) \ HGOTO_ERROR(H5E_FUNC, H5E_CANTINIT, err, "library initialization failed") \ } /* end if */ \ @@ -2603,7 +2602,6 @@ extern hbool_t H5_api_entered_g; /* Has library already been entered through API \ /* Initialize the library or bust */ \ if (!H5_INIT_GLOBAL && !H5_TERM_GLOBAL) { \ - H5_INIT_GLOBAL = TRUE; \ if (H5_init_library() < 0) { \ /* (Can't use H5E_THROW here) */ \ H5E_PRINTF(H5E_CANTINIT, "interface initialization failed"); \ diff --git a/src/H5public.h b/src/H5public.h index 9202be404cf..44e0d946feb 100644 --- a/src/H5public.h +++ b/src/H5public.h @@ -304,15 +304,21 @@ typedef unsigned long uint32_t; #error "nothing appropriate for uint32_t" #endif -/* Common iteration orders */ +//! [H5_iter_order_t_snip] + +/** + * Common iteration orders + */ typedef enum { - H5_ITER_UNKNOWN = -1, /* Unknown order */ - H5_ITER_INC, /* Increasing order */ - H5_ITER_DEC, /* Decreasing order */ - H5_ITER_NATIVE, /* No particular order, whatever is fastest */ - H5_ITER_N /* Number of iteration orders */ + H5_ITER_UNKNOWN = -1, /**< Unknown order */ + H5_ITER_INC, /**< Increasing order */ + H5_ITER_DEC, /**< Decreasing order */ + H5_ITER_NATIVE, /**< No particular order, whatever is fastest */ + H5_ITER_N /**< Number of iteration orders */ } H5_iter_order_t; +//! [H5_iter_order_t_snip] + /* Iteration callback values */ /* (Actually, any positive value will cause the iterator to stop and pass back * that positive value to the function that called the iterator) @@ -321,18 +327,22 @@ typedef enum { #define H5_ITER_CONT (0) #define H5_ITER_STOP (1) -/* +//! [H5_index_t_snip] + +/** * The types of indices on links in groups/attributes on objects. * Primarily used for " by index" routines and for iterating over * links in groups/attributes on objects. */ typedef enum H5_index_t { - H5_INDEX_UNKNOWN = -1, /* Unknown index type */ - H5_INDEX_NAME, /* Index on names */ - H5_INDEX_CRT_ORDER, /* Index on creation order */ - H5_INDEX_N /* Number of indices defined */ + H5_INDEX_UNKNOWN = -1, /**< Unknown index type */ + H5_INDEX_NAME, /**< Index on names */ + H5_INDEX_CRT_ORDER, /**< Index on creation order */ + H5_INDEX_N /**< Number of indices defined */ } H5_index_t; +//! [H5_index_t_snip] + /** * Storage info struct used by H5O_info_t and H5F_info_t */ @@ -343,45 +353,446 @@ typedef struct H5_ih_info_t { } H5_ih_info_t; //! [H5_ih_info_t_snip] -/* Tokens are unique and permanent identifiers that are - * used to reference HDF5 objects in a container. */ +/** + * The maximum size allowed for tokens + * \details Tokens are unique and permanent identifiers that are + * used to reference HDF5 objects in a container. This allows + * for 128-bit tokens + */ +#define H5O_MAX_TOKEN_SIZE (16) -/* The maximum size allowed for tokens */ -#define H5O_MAX_TOKEN_SIZE (16) /* Allows for 128-bit tokens */ +//! [H5O_token_t_snip] +/** + * \internal (Hoisted here, since it's used by both the + * H5Lpublic.h and H5Opublic.h headers) */ /* Type for object tokens */ -/* (Hoisted here, since it's used by both the H5Lpublic.h and H5Opublic.h headers) */ typedef struct H5O_token_t { uint8_t __data[H5O_MAX_TOKEN_SIZE]; } H5O_token_t; -/* +//! [H5O_token_t_snip] + +/** * Allocation statistics info struct */ typedef struct H5_alloc_stats_t { - unsigned long long total_alloc_bytes; /* Running count of total # of bytes allocated */ - size_t curr_alloc_bytes; /* Current # of bytes allocated */ - size_t peak_alloc_bytes; /* Peak # of bytes allocated */ - size_t max_block_size; /* Largest block allocated */ - size_t total_alloc_blocks_count; /* Running count of total # of blocks allocated */ - size_t curr_alloc_blocks_count; /* Current # of blocks allocated */ - size_t peak_alloc_blocks_count; /* Peak # of blocks allocated */ + unsigned long long total_alloc_bytes; /**< Running count of total # of bytes allocated */ + size_t curr_alloc_bytes; /**< Current # of bytes allocated */ + size_t peak_alloc_bytes; /**< Peak # of bytes allocated */ + size_t max_block_size; /**< Largest block allocated */ + size_t total_alloc_blocks_count; /**< Running count of total # of blocks allocated */ + size_t curr_alloc_blocks_count; /**< Current # of blocks allocated */ + size_t peak_alloc_blocks_count; /**< Peak # of blocks allocated */ } H5_alloc_stats_t; /* Functions in H5.c */ +/** + * \ingroup H5 + * \brief Initializes the HDF5 library + * \return \herr_t + * + * \details H5open() initializes the HDF5 library. + * + * \details When the HDF5 library is used in a C application, the library is + * automatically initialized when the first HDf5 function call is + * issued. If one finds that an HDF5 library function is failing + * inexplicably, H5open() can be called first. It is safe to call + * H5open() before an application issues any other function calls to + * the HDF5 library as there are no damaging side effects in calling + * it more than once. + */ H5_DLL herr_t H5open(void); +/** + * \ingroup H5 + * \brief Flushes all data to disk, closes all open objects, and releases memory + * \return \herr_t + * + * \details H5close() flushes all data to disk, closes all open HDF5 objects, + * and cleans up all memory used by the HDF5 library. This function is + * generally called when the application calls exit(), but may be + * called earlier in the event of an emergency shutdown or out of a + * desire to free all resources used by the HDF5 library. + */ H5_DLL herr_t H5close(void); +/** + * \ingroup H5 + * \brief Instructs library not to install atexit() cleanup routine + * \return \herr_t + * + * \details H5dont_atexit() indicates to the library that an atexit() cleanup + * routine should not be installed. The major purpose for using this + * function is in situations where the library is dynamically linked + * into an application and is un-linked from the application before + * exit() gets called. In those situations, a routine installed with + * atexit() would jump to a routine which was no longer in memory, + * causing errors. + * + * \attention In order to be effective, this routine \Emph{must} be called + * before any other HDF5 function calls, and must be called each + * time the library is loaded/linked into the application (the first + * time and after it's been un-loaded). + */ H5_DLL herr_t H5dont_atexit(void); +/** + * \ingroup H5 + * \brief Garbage collects on all free-lists of all types + * \return \herr_t + * + * \details H5garbage_collect() walks through all garbage collection routines + * of the library, freeing any unused memory. + * + * It is not required that H5garbage_collect() be called at any + * particular time; it is only necessary in certain situations where + * the application has performed actions that cause the library to + * allocate many objects. The application should call + * H5garbage_collect() if it eventually releases those objects and + * wants to reduce the memory used by the library from the peak usage + * required. + * + * \note The library automatically garbage collects all the free lists when the + * application ends. + */ H5_DLL herr_t H5garbage_collect(void); +/** + * \ingroup H5 + * \brief Sets free-list size limits + * + * \param[in] reg_global_lim The cumulative limit, in bytes, on memory used for + * all regular free lists (Default: 1MB) + * \param[in] reg_list_lim The limit, in bytes, on memory used for each regular + * free list (Default: 64KB) + * \param[in] arr_global_lim The cumulative limit, in bytes, on memory used for + * all array free lists (Default: 4MB) + * \param[in] arr_list_lim The limit, in bytes, on memory used for each array + * free list (Default: 256KB) + * \param[in] blk_global_lim The cumulative limit, in bytes, on memory used for + * all block free lists and, separately, for all + * factory free lists (Default: 16MB) + * \param[in] blk_list_lim The limit, in bytes, on memory used for each block + * or factory free list (Default: 1MB) + * \return \herr_t + * + * \details H5set_free_list_limits() sets size limits on all types of free + * lists. The HDF5 library uses free lists internally to manage + * memory. The types of free lists used are as follows: + * \li Regular free lists manage memory for single internal data + * structures. + * \li Array free lists manage memory for arrays of internal + * data structures. + * \li Block free lists manage memory for arbitrarily-sized blocks + * of bytes. + * \li Factory free lists manage memory for fixed-size blocks of + * bytes. + * + * The parameters specify global and per-list limits; for example, \p + * reg_global_limit and \p reg_list_limit limit the accumulated size + * of all regular free lists and the size of each individual regular + * free list, respectively. Therefore, if an application sets a 1Mb + * limit on each of the global lists, up to 4Mb of total storage might + * be allocated, 1Mb for each of the regular, array, block, and + * factory type lists. + * + * The settings specified for block free lists are duplicated for + * factory free lists. Therefore, increasing the global limit on block + * free lists by x bytes will increase the potential free list memory + * usage by 2x bytes. + * + * Using a value of -1 for a limit means that no limit is set for the + * specified type of free list. + * + * \version 1.8.3 Function changed in this release to set factory free list + * memory limits. + * + * \since 1.6.0 + */ H5_DLL herr_t H5set_free_list_limits(int reg_global_lim, int reg_list_lim, int arr_global_lim, int arr_list_lim, int blk_global_lim, int blk_list_lim); +/** + * \ingroup H5 + * \brief Gets the current size of the free lists used to manage memory + * + * \param[out] reg_size The current size of all "regular" free list memory used + * \param[out] arr_size The current size of all "array" free list memory used + * \param[out] blk_size The current size of all "block" free list memory used + * \param[out] fac_size The current size of all "factory" free list memory used + * \return \herr_t + * + * \details H5get_free_list_sizes() obtains the current size of the different + * kinds of free lists that the library uses to manage memory. The + * free list sizes can be set with H5set_free_list_limits() and + * garbage collected with H5garbage_collect(). These lists are global + * for the entire library. + * + * \since 1.12.1 + */ H5_DLL herr_t H5get_free_list_sizes(size_t *reg_size, size_t *arr_size, size_t *blk_size, size_t *fac_size); +/** + * \ingroup H5 + * \brief Gets the memory allocation statistics for the library + * + * \param[out] stats Memory allocation statistics + * \return \herr_t + * + * \details H5get_alloc_stats() gets the memory allocation statistics for the + * library, if the \c --enable-memory-alloc-sanity-check option was + * given when building the library. Applications can check whether + * this option was enabled detecting if the + * \c H5_MEMORY_ALLOC_SANITY_CHECK macro is defined. This option is + * enabled by default for debug builds of the library and disabled by + * default for non-debug builds. If the option is not enabled, all the + * values returned with be 0. These statistics are global for the + * entire library, but do not include allocations from chunked dataset + * I/O filters or non-native VOL connectors. + * + * \since 1.12.1 + */ H5_DLL herr_t H5get_alloc_stats(H5_alloc_stats_t *stats); +/** + * \ingroup H5 + * \brief Returns the HDF library release number + * + * \param[out] majnum The major version number of the library + * \param[out] minnum The minor version number of the library + * \param[out] relnum The release version number of the library + * \return \herr_t + * + * \details H5get_libversion() retrieves the major, minor, and release numbers + * of the version of the HDF5 library which is linked to the + * application. + * + */ H5_DLL herr_t H5get_libversion(unsigned *majnum, unsigned *minnum, unsigned *relnum); +/** + * \ingroup H5 + * \brief Verifies that HDF5 library versions are consistent + * + * \param[in] majnum HDF5 library major version number + * \param[in] minnum HDF5 library minor version number + * \param[in] relnum HDF5 library release number + * \return \herr_t + * + * \details H5check_version() verifies that the version of the HDF5 library + * with which an application was compiled, as indicated by the passed + * parameters, matches the version of the HDF5 library against which + * the application is currently linked. + * + * \p majnum is the major version number of the HDF library with which + * the application was compiled, \p minnum is the minor version + * number, and \p relnum is the release number. Consider the following + * example: + * + * An official HDF5 release is labelled as follows: + * HDF5 Release \Code{\.\.\}\n + * For example, in HDF5 Release 1.8.5: + * \li 1 is the major version number, \p majnum. + * \li 8 is the minor version number, \p minnum. + * \li 5 is the release number, \p relnum. + * + * As stated above, H5check_version() first verifies that the version + * of the HDF5 library with which an application was compiled matches + * the version of the HDF5 library against which the application is + * currently linked. If this check fails, H5check_version() causes the + * application to abort (by means of a standard C abort() call) and + * prints information that is usually useful for debugging. This + * precaution is is taken to avoid the risks of data corruption or + * segmentation faults. + * + * The most common cause of this failure is that an application was + * compiled with one version of HDF5 and is dynamically linked with a + * different version different version. + * + * If the above test passes, H5check_version() proceeds to verify the + * consistency of additional library version information. This is + * designed to catch source code inconsistencies that do not normally + * cause failures; if this check reveals an inconsistency, an + * informational warning is printed but the application is allowed to + * run. + * + */ H5_DLL herr_t H5check_version(unsigned majnum, unsigned minnum, unsigned relnum); +/** + * \ingroup H5 + * \brief Determines whether the HDF5 library was built with the thread-safety + * feature enabled + * + * \param[out] is_ts Boolean value indicating whether the library was built + * with thread-safety enabled + * \return \herr_t + * + * \details The HDF5 library, although not internally multi-threaded, can be + * built with a thread-safety feature enabled that protects internal + * data structures with a mutex. In certain circumstances, it may be + * useful to determine, at run-time, whether the linked HDF5 library + * was built with the thread-safety feature enabled. + */ H5_DLL herr_t H5is_library_threadsafe(hbool_t *is_ts); +/** + * \ingroup H5 + * \brief Frees memory allocated by the HDF5 library + * + * \param[in] mem Buffer to be freed. Can be NULL + * \return \herr_t + * + * \details H5free_memory() frees memory that has been allocated by the caller + * with H5allocate_memory() or by the HDF5 library on behalf of the + * caller. + * + * H5Tget_member_name() provides an example of memory allocation on + * behalf of the caller: The function returns a buffer containing the + * name of a compound datatype member. It is the caller’s + * responsibility to eventually free that buffer with H5free_memory(). + * + * \attention It is especially important to use this function to free memory + * allocated by the library on Windows. The C standard library is + * implemented in dynamic link libraries (DLLs) known as the C + * run-time (CRT). Each version of Visual Studio comes with two CRT + * DLLs (debug and release) and allocating and freeing across DLL + * boundaries can cause resource leaks and subtle bugs due to heap + * corruption.\n + * Only use this function to free memory allocated by the HDF5 + * Library. It will generally not be safe to use this function to + * free memory allocated by any other means.\n + * Even when using this function, it is still best to ensure that + * all components of a C application are built with the same version + * of Visual Studio and build (debug or release) and thus linked + * against the same CRT. + * + * \see H5allocate_memory(), H5resize_memory() + * + * \since 1.8.13 + * + */ H5_DLL herr_t H5free_memory(void *mem); +/** + * \ingroup H5 + * \brief Frees memory allocated by the HDF5 library + * + * \param[in] size The size in bytes of the buffer to be allocated + * \param[in] clear Flag whether the new buffer is to be initialized with 0 + * + * \return On success, returns pointer to newly allocated buffer or returns + * NULL if size is 0 (zero).\n + * Returns NULL on failure. + * + * \details H5allocate_memory() allocates a memory buffer of size bytes that + * will later be freed internally by the HDF5 library. + * + * The boolean \p clear parameter specifies whether the buffer should + * be initialized. If clear is \c TRUE, all bits in the buffer are to be + * set to 0 (zero); if clear is \c FALSE, the buffer will not be + * initialized. + * + * This function is intended to have the semantics of malloc() and + * calloc(). However, unlike malloc() and calloc() which allow for a + * "special" pointer to be returned instead of NULL, this function + * always returns NULL on failure or when size is set to 0 (zero). + * + * \note At this time, the only intended use for this function is to allocate + * memory that will be returned to the library as a data buffer from a + * third-party filter. + * + * \attention To avoid heap corruption, allocated memory should be freed using + * the same library that initially allocated it. In most cases, the + * HDF5 API uses resources that are allocated and freed either + * entirely by the user or entirely by the library, so this is not a + * problem. In rare cases, however, HDF5 API calls will free memory + * that the user allocated. This function allows the user to safely + * allocate this memory.\n + * It is particularly important to use this function to allocate + * memory in Microsoft Windows environments. In Windows, the C + * standard library is implemented in dynamic link libraries (DLLs) + * known as the C run-time (CRT). Each version of Visual Studio + * comes with multiple versions of the CRT DLLs (debug, release, et + * cetera) and allocating and freeing memory across DLL boundaries + * can cause resource leaks and subtle bugs due to heap corruption.\n + * Even when using this function, it is best where possible to + * ensure that all components of a C application are built with the + * same version of Visual Studio and configuration (Debug or + * Release), and thus linked against the same CRT.\n + * Use this function only to allocate memory inside third-party HDF5 + * filters. It will generally not be safe to use this function to + * allocate memory for any other purpose. + * + * \see H5free_memory(), H5resize_memory() + * + * \since 1.8.15 + * + */ H5_DLL void * H5allocate_memory(size_t size, hbool_t clear); +/** + * \ingroup H5 + * \brief Resizes and, if required, re-allocates memory that will later be + * freed internally by the HDF5 library + * + * \param[in] mem Pointer to a buffer to be resized. May be NULL + * \param[in] size New size of the buffer, in bytes + + * + * \return On success, returns pointer to resized or reallocated buffer + * or returns NULL if size is 0 (zero).\n + * Returns NULL on failure. + * + * \details H5resize_memory() takes a pointer to an existing buffer and resizes + * the buffer to match the value in \p size. If necessary, the buffer + * is reallocated. If \p size is 0, the buffer is released. + * + * The input buffer must either be NULL or have been allocated by + * H5allocate_memory() since the input buffer may be freed by the + * library. + * + * For certain behaviors, the pointer \p mem may be passed in as NULL. + * + * This function is intended to have the semantics of realloc(): + * + * + * + * + * + * + * + * + * + * + *
\Code{H5resize_memory(buffer, size)}Resizes buffer. Returns pointer to resized buffer.
\Code{H5resize_memory(NULL, size)}Allocates memory using HDF5 Library allocator. + * Returns pointer to new buffer
\Code{H5resize_memory(buffer, 0)}Frees memory using HDF5 Library allocator. + * Returns NULL.
\Code{H5resize_memory(NULL, 0)}Returns NULL (undefined in C standard).
+ * + * Unlike realloc(), which allows for a "special pointer to be + * returned instead of NULL, this function always returns NULL on + * failure or when size is 0 (zero). + * + * \note At this time, the only intended use for this function is to resize or + * reallocate memory that will be returned to the library (and eventually + * to the user) as a data buffer from a third-party HDF5 filter. + * + * \attention To avoid heap corruption, allocated memory should be freed using + * the same library that initially allocated it. In most cases, the + * HDF5 API uses resources that are allocated and freed either + * entirely by the user or entirely by the library, so this is not a + * problem. In rare cases, however, HDF5 API calls will free memory + * that the user allocated. This function allows the user to safely + * allocate this memory.\n + * It is particularly important to use this function to resize + * memory on Microsoft Windows systems. In Windows, the C standard + * library is implemented in dynamic link libraries (DLLs) known as + * the C run-time (CRT). Each version of Visual Studio comes with + * multiple versions of the CRT DLLs (debug, release, et cetera) and + * allocating and freeing memory across DLL boundaries can cause + * resource leaks and subtle bugs due to heap corruption.\n + * Even when using this function, it is still best to ensure that + * all components of a C application are built with the same version + * of Visual Studio and the same configuration (Debug or Release), + * and thus linked against the same CRT.\n + * Only use this function to resize memory inside third-party HDF5 + * filters. It will generally not be safe to use this function to + * resize memory for any other purpose. + * + * \see H5allocate_memory(), H5free_memory() + * + * \since 1.8.15 + * + */ H5_DLL void * H5resize_memory(void *mem, size_t size); #ifdef __cplusplus diff --git a/src/H5system.c b/src/H5system.c index b2a2668d209..a817b7cd78b 100644 --- a/src/H5system.c +++ b/src/H5system.c @@ -25,6 +25,7 @@ /****************/ /* Module Setup */ /****************/ +#include "H5module.h" /* This source code file is part of the H5 module */ /***********/ /* Headers */ @@ -347,7 +348,7 @@ H5_make_time(struct tm *tm) */ long timezone = 0; #endif /* defined(H5_HAVE_VISUAL_STUDIO) && (_MSC_VER >= 1900) */ - time_t ret_value; /* Return value */ + time_t ret_value = 0; /* Return value */ FUNC_ENTER_NOAPI_NOINIT diff --git a/src/H5timer.c b/src/H5timer.c index 1df2d8de330..b53c3025304 100644 --- a/src/H5timer.c +++ b/src/H5timer.c @@ -24,6 +24,7 @@ /****************/ /* Module Setup */ /****************/ +#include "H5module.h" /* This source code file is part of the H5 module */ /***********/ /* Headers */ diff --git a/src/H5trace.c b/src/H5trace.c index 18c7f7e9d6f..0ffa0aa25c3 100644 --- a/src/H5trace.c +++ b/src/H5trace.c @@ -25,6 +25,7 @@ /****************/ /* Module Setup */ /****************/ +#include "H5module.h" /* This source code file is part of the H5 module */ #define H5I_FRIEND /*suppress error about including H5Ipkg */ /***********/ From ba77da0b5a482f19ea22c191ecea7ca449673edc Mon Sep 17 00:00:00 2001 From: Gerd Heber Date: Fri, 20 Nov 2020 23:18:14 -0600 Subject: [PATCH 03/21] Full set of current H5F documentation. (#105) * First cut of the H5 public API documentation. * Added H5Z "bonus track." * Applied Quincey's patch. * Added the missing patches from Quincey's original patch. * H5PL (complete) and basic H5VL API documentation. * Added H5I API docs. * Added H5L API docs. * First installment from Elena's H5T batch. * Second installment of Elena's H5T batch. * Final installment of Elena's H5T batch. * Migrated documentation for SWMR functions. * Catching up on MDC functions. * Integrated the H5F MDC function documentation. * Added MDC and parallel H5F functions. * Slightly updated main page. * Added doxygen/dox/H5AC_cache_config_t.dox to MANIFEST. --- MANIFEST | 1 + doxygen/Doxyfile.in | 1 + doxygen/dox/H5AC_cache_config_t.dox | 415 +++++++++++++ doxygen/dox/mainpage.dox | 70 ++- src/H5Fpublic.h | 868 +++++++++++++++++++++++++++- 5 files changed, 1311 insertions(+), 44 deletions(-) create mode 100644 doxygen/dox/H5AC_cache_config_t.dox diff --git a/MANIFEST b/MANIFEST index c925f6fdcf6..4c2c2c2398d 100644 --- a/MANIFEST +++ b/MANIFEST @@ -197,6 +197,7 @@ ./doxygen/aliases ./doxygen/Doxyfile.in ./doxygen/dox/api-compat-macros.dox +./doxygen/dox/H5AC_cache_config_t.dox ./doxygen/dox/H5Acreate.dox ./doxygen/dox/H5Aiterate.dox ./doxygen/dox/H5Fget_info.dox diff --git a/doxygen/Doxyfile.in b/doxygen/Doxyfile.in index 711fa7a2196..24fc4ba12e0 100644 --- a/doxygen/Doxyfile.in +++ b/doxygen/Doxyfile.in @@ -854,6 +854,7 @@ INPUT_ENCODING = UTF-8 FILE_PATTERNS = H5*public.h \ H5*module.h \ + H5FDmpio.h \ H5VLconnector.h \ H5VLconnector_passthru.h \ H5VLnative.h \ diff --git a/doxygen/dox/H5AC_cache_config_t.dox b/doxygen/dox/H5AC_cache_config_t.dox new file mode 100644 index 00000000000..9b9862b6c1e --- /dev/null +++ b/doxygen/dox/H5AC_cache_config_t.dox @@ -0,0 +1,415 @@ +/** + * \page H5AC-cache-config-t Metadata Cache Configuration + * \tableofcontents + * + * \section gcf General configuration fields + * + * \par version + * Integer field containing the version number of this version + * of the H5AC_cache_config_t structure. Any instance of + * H5AC_cache_config_t passed to the cache must have a known + * version number, or an error will be flagged. + * + * \par rpt_fcn_enabled + * \parblock + * Boolean field used to enable and disable the default + * reporting function. This function is invoked every time the + * automatic cache resize code is run, and reports on its activities. + * + * This is a debugging function, and should normally be turned off. + * \endparblock + * + * \par open_trace_file + * \parblock + * Boolean field indicating whether the trace_file_name + * field should be used to open a trace file for the cache. + * + * \Emph{*** DEPRECATED ***} Use \Code{H5Fstart/stop} logging functions instead + * + * The trace file is a debuging 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 \c FALSE, as + * trace file collection imposes considerable overhead. + * + * This field should only be set to \c TRUE when the trace_file_name + * contains the full path of the desired trace file, and either + * there is no open trace file on the cache, or the \c close_trace_file + * field is also \c TRUE. + * \endparblock + * + * \par close_trace_file + * \parblock + * Boolean field indicating whether the current trace + * file (if any) should be closed. + * + * \Emph{*** DEPRECATED ***} Use \Code{H5Fstart/stop} logging functions instead + * + * See the above comments on the open_trace_file field. This field + * should be set to \c FALSE unless there is an open trace file on the + * cache that you wish to close. + * \endparblock + * + * \par trace_file_name + * \parblock + * Full path of the trace file to be opened if the + * open_trace_file field is \c TRUE. + * + * \Emph{*** DEPRECATED ***} Use \Code{H5Fstart/stop} logging functions instead + * + * In the parallel case, an ascii representation of the mpi rank of + * the process will be appended to the file name to yield a unique + * trace file name for each process. + * + * The length of the path must not exceed #H5AC__MAX_TRACE_FILE_NAME_LEN + * characters. + * \endparblock + * + * \par evictions_enabled + * \parblock + * Boolean field used to either report the current + * evictions enabled status of the cache, or to set the cache's + * evictions enabled status. + * + * In general, the metadata cache should always be allowed to + * evict entries. However, in some cases it is advantageous to + * disable evictions briefly, and thereby postpone metadata + * writes. However, this must be done with care, as the cache + * can grow quickly. If you do this, re-enable evictions as + * soon as possible and monitor cache size. + * + * At present, evictions can only be disabled if automatic + * cache resizing is also disabled (that is, \Code{(incr_mode == + * H5C_incr__off ) && ( decr_mode == H5C_decr__off )}). There + * is no logical reason why this should be so, but it simplifies + * implementation and testing, and I can't think of any reason + * why it would be desireable. If you can think of one, I'll + * revisit the issue. (JM) + * \endparblock + * + * \par set_initial_size + * Boolean flag indicating whether the size of the + * initial size of the cache is to be set to the value given in + * the initial_size field. If set_initial_size is \c FALSE, the + * initial_size field is ignored. + * + * \par initial_size + * If enabled, this field contain the size the cache is + * to be set to upon receipt of this structure. Needless to say, + * initial_size must lie in the closed interval \Code{[min_size, max_size]}. + * + * \par min_clean_fraction + * \c double in the range 0 to 1 indicating the fraction + * of the cache that is to be kept clean. This field is only used + * in parallel mode. Typical values are 0.1 to 0.5. + * + * \par max_size + * Maximum size to which the cache can be adjusted. The + * supplied value must fall in the closed interval + * \Code{[MIN_MAX_CACHE_SIZE, MAX_MAX_CACHE_SIZE]}. Also, \c max_size must + * be greater than or equal to \c min_size. + * + * \par min_size + * Minimum size to which the cache can be adjusted. The + * supplied value must fall in the closed interval + * \Code{[H5C__MIN_MAX_CACHE_SIZE, H5C__MAX_MAX_CACHE_SIZE]}. Also, \c min_size + * must be less than or equal to \c max_size. + * + * \par epoch_length + * \parblock + * Number of accesses on the cache over which to collect + * hit rate stats before running the automatic cache resize code, + * if it is enabled. + * + * At the end of an epoch, we discard prior hit rate data and start + * collecting afresh. The epoch_length must lie in the closed + * interval \Code{[H5C__MIN_AR_EPOCH_LENGTH, H5C__MAX_AR_EPOCH_LENGTH]}. + * \endparblock + * + * + * \section csicf Cache size increase control fields + * + * \par incr_mode + * Instance of the \c H5C_cache_incr_mode enumerated type whose + * value indicates how we determine whether the cache size should be + * increased. At present there are two possible values: + * \li \c H5C_incr__off: Don't attempt to increase the size of the cache + * automatically.\n + * When this increment mode is selected, the remaining fields + * in the cache size increase section ar ignored. + * \li \c H5C_incr__threshold: Attempt to increase the size of the cache + * whenever the average hit rate over the last epoch drops + * below the value supplied in the \c lower_hr_threshold + * field.\n + * Note that this attempt will fail if the cache is already + * at its maximum size, or if the cache is not already using + * all available space. + * + * Note that you must set \c decr_mode to \c H5C_incr__off if you + * disable metadata cache entry evictions. + * + * \par lower_hr_threshold + * \parblock + * Lower hit rate threshold. If the increment mode + * (\c incr_mode) is \c H5C_incr__threshold and the hit rate drops below the + * value supplied in this field in an epoch, increment the cache size by + * \c size_increment. Note that cache size may not be incremented above + * \c max_size, and that the increment may be further restricted by the + * \c max_increment field if it is enabled. + * + * When enabled, this field must contain a value in the range [0.0, 1.0]. + * Depending on the \c incr_mode selected, it may also have to be less than + * \c upper_hr_threshold. + * \endparblock + * + * \par increment + * \parblock + * Double containing the multiplier used to derive the new + * cache size from the old if a cache size increment is triggered. + * The increment must be greater than 1.0, and should not exceed 2.0. + * + * The new cache size is obtained my multiplying the current max cache + * size by the increment, and then clamping to \c max_size and to stay + * within the \c max_increment as necessary. + * \endparblock + * + * \par apply_max_increment + * Boolean flag indicating whether the \c max_increment + * field should be used to limit the maximum cache size increment. + * + * \par max_increment + * If enabled by the \c apply_max_increment field described + * above, this field contains the maximum number of bytes by which the + * cache size can be increased in a single re-size. + * + * \par flash_incr_mode + * \parblock + * Instance of the \c H5C_cache_flash_incr_mode enumerated + * type whose value indicates whether and by which algorithm we should + * make flash increases in the size of the cache to accommodate insertion + * of large entries and large increases in the size of a single entry. + * + * The addition of the flash increment mode was occasioned by performance + * problems that appear when a local heap is increased to a size in excess + * of the current cache size. While the existing re-size code dealt with + * this eventually, performance was very bad for the remainder of the + * epoch. + * + * At present, there are two possible values for the \c flash_incr_mode: + * + * \li \c H5C_flash_incr__off: Don't perform flash increases in the size of the cache. + * + * \li \c H5C_flash_incr__add_space: Let \c x be either the size of a newly + * newly inserted entry, or the number of bytes by which the + * size of an existing entry has been increased.\n + * If \Code{x > flash_threshold * current max cache size}, + * increase the current maximum cache size by \Code{x * flash_multiple} + * less any free space in the cache, and star a new epoch. For + * now at least, pay no attention to the maximum increment. + * + * In both of the above cases, the flash increment pays no attention to + * the maximum increment (at least in this first incarnation), but DOES + * stay within max_size. + * + * With a little thought, it should be obvious that the above flash + * cache size increase algorithm is not sufficient for all circumstances + * -- for example, suppose the user round robins through + * \Code{(1/flash_threshold) +1} groups, adding one data set to each on each + * pass. Then all will increase in size at about the same time, requiring + * the max cache size to at least double to maintain acceptable + * performance, however the above flash increment algorithm will not be + * triggered. + * + * Hopefully, the add space algorithms detailed above will be sufficient + * for the performance problems encountered to date. However, we should + * expect to revisit the issue. + * \endparblock + * + * \par flash_multiple + * Double containing the multiple described above in the + * \c H5C_flash_incr__add_space section of the discussion of the + * \c flash_incr_mode section. This field is ignored unless \c flash_incr_mode + * is \c H5C_flash_incr__add_space. + * + * \par flash_threshold + * Double containing the factor by which current max cache + * size is multiplied to obtain the size threshold for the add_space flash + * increment algorithm. The field is ignored unless \c flash_incr_mode is + * \c H5C_flash_incr__add_space. + * + * + * \section csdcf Cache size decrease control fields + * + * \par decr_mode + * \parblock + * Instance of the \c H5C_cache_decr_mode enumerated type whose + * value indicates how we determine whether the cache size should be + * decreased. At present there are four possibilities. + * + * \li \c H5C_decr__off: Don't attempt to decrease the size of the cache + * automatically.\n + * When this increment mode is selected, the remaining fields + * in the cache size decrease section are ignored. + * \li \c H5C_decr__threshold: Attempt to decrease the size of the cache + * whenever the average hit rate over the last epoch rises + * above the value supplied in the \c upper_hr_threshold + * field. + * \li \c H5C_decr__age_out: At the end of each epoch, search the cache for + * entries that have not been accessed for at least the number + * of epochs specified in the epochs_before_eviction field, and + * evict these entries. Conceptually, the maximum cache size + * is then decreased to match the new actual cache size. However, + * this reduction may be modified by the \c min_size, the + * \c max_decrement, and/or the \c empty_reserve. + * \li \c H5C_decr__age_out_with_threshold: Same as age_out, but we only + * attempt to reduce the cache size when the hit rate observed + * over the last epoch exceeds the value provided in the + * \c upper_hr_threshold field. + * + * Note that you must set \c decr_mode to \c H5C_decr__off if you + * disable metadata cache entry evictions. + * \endparblock + * + * \par upper_hr_threshold + * \parblock + * Upper hit rate threshold. The use of this field + * varies according to the current \c decr_mode : + * + * \c H5C_decr__off or \c H5C_decr__age_out: The value of this field is + * ignored. + * + * \li \c H5C_decr__threshold: If the hit rate exceeds this threshold in any + * epoch, attempt to decrement the cache size by size_decrement.\n + * Note that cache size may not be decremented below \c min_size.\n + * Note also that if the \c upper_threshold is 1.0, the cache size\n + * will never be reduced. + * + * \li \c H5C_decr__age_out_with_threshold: If the hit rate exceeds this + * threshold in any epoch, attempt to reduce the cache size + * by evicting entries that have not been accessed for more + * than the specified number of epochs. + * \endparblock + * + * \par decrement + * \parblock + * This field is only used when the decr_mode is + * \c H5C_decr__threshold. + * + * The field is a double containing the multiplier used to derive the + * new cache size from the old if a cache size decrement is triggered. + * The decrement must be in the range 0.0 (in which case the cache will + * try to contract to its minimum size) to 1.0 (in which case the + * cache will never shrink). + * \endparblock + * + * \par apply_max_decrement + * Boolean flag used to determine whether decrements + * in cache size are to be limited by the \c max_decrement field. + * + * \par max_decrement + * Maximum number of bytes by which the cache size can be + * decreased in a single re-size. Note that decrements may also be + * restricted by the \c min_size of the cache, and (in age out modes) by + * the \c empty_reserve field. + * + * \par epochs_before_eviction + * \parblock + * Integer field used in \c H5C_decr__age_out and + * \c H5C_decr__age_out_with_threshold decrement modes. + * + * This field contains the number of epochs an entry must remain + * unaccessed before it is evicted in an attempt to reduce the + * cache size. If applicable, this field must lie in the range + * \Code{[1, H5C__MAX_EPOCH_MARKERS]}. + * \endparblock + * + * \par apply_empty_reserve + * Boolean field controlling whether the empty_reserve + * field is to be used in computing the new cache size when the + * decr_mode is H5C_decr__age_out or H5C_decr__age_out_with_threshold. + * + * \par empty_reserve + * \parblock + * To avoid a constant racheting down of cache size by small + * amounts in the \c H5C_decr__age_out and \c H5C_decr__age_out_with_threshold + * modes, this field allows one to require that any cache size + * reductions leave the specified fraction of unused space in the cache. + * + * The value of this field must be in the range [0.0, 1.0]. I would + * expect typical values to be in the range of 0.01 to 0.1. + * \endparblock + * + * + * \section pcf Parallel Configuration Fields + * + * In PHDF5, all operations that modify metadata must be executed collectively. + * + * We used to think that this was enough to ensure consistency across the + * metadata caches, but since we allow processes to read metadata individually, + * the order of dirty entries in the LRU list can vary across processes, + * which can result in inconsistencies between the caches. + * + * PHDF5 uses several strategies to prevent such inconsistencies in metadata, + * all of which use the fact that the same stream of dirty metadata is seen + * by all processes for purposes of synchronization. This is done by + * having each process count the number of bytes of dirty metadata generated, + * and then running a "sync point" whenever this count exceeds a user + * specified threshold (see \c dirty_bytes_threshold below). + * + * The current metadata write strategy is indicated by the + * \c metadata_write_strategy field. The possible values of this field, along + * with the associated metadata write strategies are discussed below. + * + * \par dirty_bytes_threshold + * \parblock + * Threshold of dirty byte creation used to + * synchronize updates between caches. (See above for outline and + * motivation.) + * + * This value MUST be consistent across all processes accessing the + * file. This field is ignored unless HDF5 has been compiled for + * parallel. + * \endparblock + * + * \par metadata_write_strategy + * Integer field containing a code indicating the + * desired metadata write strategy. The valid values of this field + * are enumerated and discussed below: + * + * \li #H5AC_METADATA_WRITE_STRATEGY__PROCESS_0_ONLY\n + * When metadata_write_strategy is set to this value, only process + * zero is allowed to write dirty metadata to disk. All other + * processes must retain dirty metadata until they are informed at + * a sync point that the dirty metadata in question has been written + * to disk.\n + * When the sync point is reached (or when there is a user generated + * flush), process zero flushes sufficient entries to bring it into + * complience with its min clean size (or flushes all dirty entries in + * the case of a user generated flush), broad casts the list of + * entries just cleaned to all the other processes, and then exits + * the sync point.\n + * Upon receipt of the broadcast, the other processes mark the indicated + * entries as clean, and leave the sync point as well. + * + * \li #H5AC_METADATA_WRITE_STRATEGY__DISTRIBUTED\n + * In the distributed metadata write strategy, process zero still makes + * the decisions as to what entries should be flushed, but the actual + * flushes are distributed across the processes in the computation to + * the extent possible.\n + * In this strategy, when a sync point is triggered (either by dirty + * metadata creation or manual flush), all processes enter a barrier.\n + * On the other side of the barrier, process 0 constructs an ordered + * list of the entries to be flushed, and then broadcasts this list + * to the caches in all the processes.\n + * All processes then scan the list of entries to be flushed, flushing + * some, and marking the rest as clean. The algorithm for this purpose + * ensures that each entry in the list is flushed exactly once, and + * all are marked clean in each cache.\n + * Note that in the case of a flush of the cache, no message passing + * is necessary, as all processes have the same list of dirty entries, + * and all of these entries must be flushed. Thus in this case it is + * sufficient for each process to sort its list of dirty entries after + * leaving the initial barrier, and use this list as if it had been + * received from process zero.\n + * To avoid possible messages from the past/future, all caches must + * wait until all caches are done before leaving the sync point. + */ \ No newline at end of file diff --git a/doxygen/dox/mainpage.dox b/doxygen/dox/mainpage.dox index 83fc323de0c..eda967b421b 100644 --- a/doxygen/dox/mainpage.dox +++ b/doxygen/dox/mainpage.dox @@ -1,36 +1,44 @@ -/*! \mainpage API Documentation for HDF5 Version 1.13 (Draft) +/*! \mainpage HDF5 C-API Reference + * + * The HDF5 C-API provides applications with fine-grained control over all + * aspects HDF5 functionality. This functionality is grouped into the following + * \Emph{modules}: + * \li \ref H5A "Attributes" — Management of HDF5 attributes (\ref H5A) + * \li \ref H5D "Datasets" — Management of HDF5 datasets (\ref H5D) + * \li \ref H5S "Dataspaces" — Management of HDF5 dataspaces which describe the shape of datasets and attributes (\ref H5S) + * \li \ref H5T "Datatypes" — Management of datatypes which describe elements of datasets and attributes (\ref H5T) + * \li \ref H5E "Error Handling" — Functions for handling errors that occur within HDF5 (\ref H5E) + * \li \ref H5F "Files" — Management of HDF5 files (\ref H5F) + * \li \ref H5Z "Filters" — Configuration of filters that process data during I/O operation (\ref H5Z) + * \li \ref H5G "Groups" — Management of groups in HDF5 files (\ref H5G) + * \li \ref H5I "Identifiers" — Management of object identifiers and object names (\ref H5I) + * \li \ref H5 "Library" — General purpose library functions (\ref H5) + * \li \ref H5L "Links" — Management of links in HDF5 groups (\ref H5L) + * \li \ref H5O "Objects" — Management of objects in HDF5 files (\ref H5O) + * \li \ref H5PL "Plugins" — Programmatic control over dynamically loaded plugins (\ref H5PL) + * \li \ref H5P "Property Lists" — Management of property lists to control HDF5 library behavior (\ref H5P) + * \li \ref H5R "References" — Management of references to specific objects and data regions in an HDF5 file (\ref H5R) + * \li \ref H5VL "Virtual Object Layer" — Management of the Virtual Object Layer (\ref H5VL) + * + * Here are a few simple rules to follow: + * + * \li \Bold{Handle discipline:} If you acquire a handle (by creation or coopy), \Emph{you own it!} (..., i.e., you have to close it.) + * \li \Bold{Dynamic memory allocation:} ... + * \li \Bold{Use of locations:} Identifier + name combo + * + * \attention \Bold{C++ Developers using HDF5 C-API functions beware:}\n + * If a C routine that takes a function pointer as an argument is called from + * within C++ code, the C routine should be returned from normally. + * Examples of this kind of routine include callbacks such as H5Pset_elink_cb() + * and H5Pset_type_conv_cb() and functions such as H5Tconvert() and H5Ewalk2().\n + * Exiting the routine in its normal fashion allows the HDF5 C library to clean + * up its work properly. In other words, if the C++ application jumps out of + * the routine back to the C++ \c catch statement, the library is not given the + * opportunity to close any temporary data structures that were set up when the + * routine was called. The C++ application should save some state as the + * routine is started so that any problem that occurs might be diagnosed. * * \todo Fix the search form for server deployments. * \todo Make it mobile-friendly * - * \section intro_sec Introduction - * - * \todo Write an introduction. - * - * \section quick_links Quick Links - * - *
    - *
  • \ref PDT "Predefined Datatypes"
  • - *
  • \ref api-compat-macros "API Compatibility Macros"
  • - *
  • HDF5 Wiki
  • - *
- * - * \section using_locations The Use of Locations (Identifier + Name) in the HDF5 API - * - * \todo Make this crystal clear! - * - * \section cpp_note Programming Note for C++ Developers Using C Functions - * - * If a C routine that takes a function pointer as an argument is called from - * within C++ code, the C routine should be returned from normally. - * - * Examples of this kind of routine include callbacks such as H5Pset_elink_cb() - * and H5Pset_type_conv_cb() and functions such as H5Tconvert() and H5Ewalk2(). - * - * Exiting the routine in its normal fashion allows the HDF5 C library to clean - * up its work properly. In other words, if the C++ application jumps out of - * the routine back to the C++ \c catch statement, the library is not given the - * opportunity to close any temporary data structures that were set up when the - * routine was called. The C++ application should save some state as the - * routine is started so that any problem that occurs might be diagnosed. */ \ No newline at end of file diff --git a/src/H5Fpublic.h b/src/H5Fpublic.h index fbee9c5f895..10cfbbe6f3a 100644 --- a/src/H5Fpublic.h +++ b/src/H5Fpublic.h @@ -225,6 +225,7 @@ typedef enum H5F_file_space_type_t { H5F_FILE_SPACE_NTYPES /**< Sentinel */ } H5F_file_space_type_t; +//! [H5F_retry_info_t_snip] #define H5F_NUM_METADATA_READ_RETRY_TYPES 21 /** @@ -235,6 +236,7 @@ typedef struct H5F_retry_info_t { unsigned nbins; uint32_t *retries[H5F_NUM_METADATA_READ_RETRY_TYPES]; } H5F_retry_info_t; +//! [H5F_retry_info_t_snip] /** * Callback for H5Pset_object_flush_cb() in a file access property list @@ -952,32 +954,542 @@ H5_DLL ssize_t H5Fget_file_image(hid_t file_id, void *buf_ptr, size_t buf_len); /** * \ingroup MDC * - * \todo Finish this! + * \brief Obtains current metadata cache configuration for target file + * + * \file_id + * \param[in,out] config_ptr Pointer to the H5AC_cache_config_t instance in which + * the current metadata cache configuration is to be + * reported. The fields of this structure are discussed + * \ref H5AC-cache-config-t "here". + * \return \herr_t + * + * \details H5Fget_mdc_config() loads the current metadata cache configuration + * into the instance of H5AC_cache_config_t pointed to by the \p config_ptr + * parameter. + * + * Note that the \c version field of \p config_ptr must be initialized + * --this allows the library to support old versions of the H5AC_cache_config_t + * structure. + * + * \par General configuration section + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + *
int version IN: Integer field indicating the the version of the H5AC_cache_config_t in use. This field should + * be set to #H5AC__CURR_CACHE_CONFIG_VERSION (defined in H5ACpublic.h).
hbool_t rpt_fcn_enabled

OUT: Boolean flag indicating whether the adaptive cache resize report function is enabled. This + * field should almost always be set to disabled (0). Since resize algorithm activity is + * reported via stdout, it MUST be set to disabled (0) on Windows machines.

The + * report function is not supported code, and can be expected to change between versions of the + * library. Use it at your own risk.

hbool_t open_trace_file OUT: Boolean field indicating whether the trace_file_name field should be used to open + * a trace file for the cache. This field will always be set to 0 in this context.
hbool_t close_trace_file OUT: Boolean field indicating whether the current trace file (if any) should be closed. This field + * will always be set to 0 in this context.
char*trace_file_name OUT: Full path name of the trace file to be opened if the open_trace_file field is set + * to 1. This field will always be set to the empty string in this context.
hbool_t evictions_enabled OUT: Boolean flag indicating whether metadata cache entry evictions are + * enabled.
hbool_t set_initial_size OUT: Boolean flag indicating whether the cache should be created with a user specified initial + * maximum size.

If the configuration is loaded from the cache, this flag will always be set + * to 0.

size_t initial_size OUT: Initial maximum size of the cache in bytes, if applicable.

If the configuration is loaded + * from the cache, this field will contain the cache maximum size as of the time of the + * call.

double min_clean_fraction OUT: Float value specifying the minimum fraction of the cache that must be kept either clean or + * empty when possible.
size_t max_size OUT: Upper bound (in bytes) on the range of values that the adaptive cache resize code can select + * as the maximum cache size.
size_t min_size OUT: Lower bound (in bytes) on the range of values that the adaptive cache resize code can select + * as the maximum cache size.
long int epoch_length OUT: Number of cache accesses between runs of the adaptive cache resize + * code.
+ * + * \par Increment configuration section + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + *
enum H5C_cache_incr_mode incr_mode OUT: Enumerated value indicating the operational mode of the automatic cache size increase code. At + * present, only the following values are legal:

\c H5C_incr__off: Automatic cache size increase is + * disabled.

\c H5C_incr__threshold: Automatic cache size increase is enabled using the hit rate + * threshold algorithm.

double lower_hr_threshold OUT: Hit rate threshold used in the hit rate threshold cache size increase algorithm.
double increment OUT: The factor by which the current maximum cache size is multiplied to obtain an initial new + * maximum cache size if a size increase is triggered in the hit rate threshold cache size increase + * algorithm.
hbool_t apply_max_increment OUT: Boolean flag indicating whether an upper limit will be applied to the size of cache size + * increases.
size_t max_increment OUT: The maximum number of bytes by which the maximum cache size can be increased in a single step + * -- if applicable.
enum H5C_cache_flash_incr_mode flash_incr_mode OUT: Enumerated value indicating the operational mode of the flash cache size increase code. At + * present, only the following values are legal:

\c H5C_flash_incr__off: Flash cache size increase is + * disabled.

\c H5C_flash_incr__add_space: Flash cache size increase is enabled using the add space + * algorithm.

double flash_threshold OUT: The factor by which the current maximum cache size is multiplied to obtain the minimum size + * entry / entry size increase which may trigger a flash cache size + * increase.
double flash_multiple OUT: The factor by which the size of the triggering entry / entry size increase is multiplied to + * obtain the initial cache size increment. This increment may be reduced to reflect existing free space + * in the cache and the max_size field above.
+ * + * \par Decrement configuration section + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + *
Decrement configuration + * section:
enum H5C_cache_decr_mode decr_mode OUT: Enumerated value indicating the operational mode of the automatic cache size decrease code. At + * present, the following values are legal:

H5C_decr__off: Automatic cache size decrease is disabled, + * and the remaining decrement fields are ignored.

H5C_decr__threshold: Automatic cache size + * decrease is enabled using the hit rate threshold algorithm.

H5C_decr__age_out: Automatic cache + * size decrease is enabled using the ageout algorithm.

H5C_decr__age_out_with_threshold: + * Automatic cache size decrease is enabled using the ageout with hit rate threshold + * algorithm

double upper_hr_threshold OUT: Upper hit rate threshold. This value is only used if the decr_mode is either + * H5C_decr__threshold or H5C_decr__age_out_with_threshold.
double decrement OUT: Factor by which the current max cache size is multiplied to obtain an initial value for the + * new cache size when cache size reduction is triggered in the hit rate threshold cache size reduction + * algorithm.
hbool_t apply_max_decrement OUT: Boolean flag indicating whether an upper limit should be applied to the size of cache size + * decreases.
size_t max_decrement OUT: The maximum number of bytes by which cache size can be decreased if any single step, if + * applicable.
int epochs_before_eviction OUT: The minimum number of epochs that an entry must reside unaccessed in cache before being + * evicted under either of the ageout cache size reduction algorithms.
hbool_t apply_empty_reserve OUT: Boolean flag indicating whether an empty reserve should be maintained under either of the + * ageout cache size reduction algorithms.
double empty_reserve OUT: Empty reserve for use with the ageout cache size reduction algorithms, if applicable.
+ * + * \par Parallel configuration section + * + * + * + * + *
int dirty_bytes_threshold OUT: Threshold number of bytes of dirty metadata generation for triggering synchronizations of the + * metadata caches serving the target file in the parallel case.

Synchronization occurs whenever the + * number of bytes of dirty metadata created since the last synchronization exceeds this limit.

+ * + * \since 1.8.0 + * + * \todo Fix the reference! + * */ H5_DLL herr_t H5Fget_mdc_config(hid_t file_id, H5AC_cache_config_t *config_ptr); /** * \ingroup MDC * - * \todo Finish this! + * \brief Attempts to configure metadata cache of target file + * + * \file_id + * \param[in,out] config_ptr Pointer to the H5AC_cache_config_t instance + * containing the desired configuration. + * The fields of this structure are discussed + * \ref H5AC-cache-config-t "here". + * \return \herr_t + * + * \details H5Fset_mdc_config() attempts to configure the file's metadata cache + * according configuration supplied in \p config_ptr. + * + * \par General configuration fields + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + *
int versionIN: Integer field indicating the the version of the H5AC_cache_config_t in use. This + * field should be set to #H5AC__CURR_CACHE_CONFIG_VERSION (defined + * in H5ACpublic.h).
hbool_t rpt_fcn_enabledIN: Boolean flag indicating whether the adaptive cache resize report function is enabled. This + * field should almost always be set to disabled (0). Since resize algorithm activity is reported + * via stdout, it MUST be set to disabled (0) on Windows machines.

The report function is not + * supported code, and can be expected to change between versions of the library. Use it at your own + * risk.

hbool_t open_trace_FileIN: 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 allows the capture of top level + * metadata cache requests for purposes of debugging and/or optimization. This field should normally be set + * to 0, as trace file collection imposes considerable overhead.

This field should only be + * set to 1 when the trace_file_name contains the full path of the desired trace + * file, and either there is no open trace file on the cache, or the close_trace_file field is + * also 1.

The trace file feature is unsupported unless used at the direction of The HDF + * Group. It is intended to allow The HDF Group to collect a trace of cache activity in cases of occult + * failures and/or poor performance seen in the field, so as to aid in reproduction in the lab. If you use it + * absent the direction of The HDF Group, you are on your + * own.

hbool_t close_trace_fileIN: Boolean field indicating whether the current trace file (if any) should be closed.

See the + * above comments on the open_trace_file field. This field should be set to 0 unless + * there is an open trace file on the cache that you wish to close.

The trace file feature is + * unsupported unless used at the direction of The HDF Group. It is intended to allow The HDF Group to collect + * a trace of cache activity in cases of occult failures and/or poor performance seen in the field, so as to + * aid in reproduction in the lab. If you use it absent the direction of The HDF Group, you are on your + * own.

char trace_file_name[]IN: Full path of the trace file to be opened if the open_trace_file field is set + * to 1.

In the parallel case, an ascii representation of the mpi rank of the process will be + * appended to the file name to yield a unique trace file name for each process.

The length of the path + * must not exceed #H5AC__MAX_TRACE_FILE_NAME_LEN characters.

The trace file feature is + * unsupported unless used at the direction of The HDF Group. It is intended to allow The HDF Group to collect + * a trace of cache activity in cases of occult failures and/or poor performance seen in the field, so as to + * aid in reproduction in the lab. If you use it absent the direction of The HDF Group, you are on your + * own.

hbool_t evictions_enabledIN: A boolean flag indicating whether evictions from the metadata cache are enabled. This flag is + * initially set to enabled (1).

In rare circumstances, the raw data throughput requirements + * may be so high that the user wishes to postpone metadata writes so as to reserve I/O throughput for raw + * data. The evictions_enabled field exists to allow this. However, this is an extreme step, and + * you have no business doing it unless you have read the User Guide section on metadata caching, and have + * considered all other options carefully.

The evictions_enabled field may not be set to + * disabled (0) unless all adaptive cache resizing code is disabled via + * the incr_mode, flash_incr_mode, and decr_mode fields.

When + * this flag is set to disabled (0), the metadata cache will not attempt to evict entries to make + * space for new entries, and thus will grow without bound.

Evictions will be re-enabled when this field + * is set back to 1. This should be done as soon as + * possible.

hbool_t set_initial_sizeIN: Boolean flag indicating whether the cache should be forced to the user specified initial + * size.
size_t initial_sizeIN: If set_initial_size is set to 1, then initial_size must + * contain the desired initial size in bytes. This value must lie in the closed interval [min_size, + * max_size]. (see below)
double min_clean_fractionIN: This field specifies the minimum fraction of the cache that must be kept either clean or + * empty.

The value must lie in the interval [0.0, 1.0]. 0.01 is a good place to start in the serial case. + * In the parallel case, a larger value is needed -- + * see Metadata Caching in HDF5 in the collection + * "Advanced Topics in HDF5."

size_t max_sizeIN: Upper bound (in bytes) on the range of values that the adaptive cache resize code can select as + * the maximum cache size.
size_t min_sizeIN: Lower bound (in bytes) on the range of values that the adaptive cache resize code can select as + * the maximum cache size.
long int epoch_lengthIN: Number of cache accesses between runs of the adaptive cache resize code. 50,000 is a good + * starting number.
+ * + * \par Increment configuration fields + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + *
enum H5C_cache_incr_mode incr_modeIN: Enumerated value indicating the operational mode of the automatic cache size increase code. At + * present, only two values are legal:

\c H5C_incr__off: Automatic cache size increase is disabled, and the + * remaining increment fields are ignored.

\c H5C_incr__threshold: Automatic cache size increase is enabled + * using the hit rate threshold + * algorithm.

double lower_hr_thresholdIN: Hit rate threshold used by the hit rate threshold cache size increment algorithm.

When the + * hit rate over an epoch is below this threshold and the cache is full, the maximum size of the cache is + * multiplied by increment (below), and then clipped as necessary to stay within max_size, and possibly + * max_increment.

This field must lie in the interval [0.0, 1.0]. 0.8 or 0.9 is a good starting + * point.

double incrementIN: Factor by which the hit rate threshold cache size increment algorithm multiplies the current + * maximum cache size to obtain a tentative new cache size.

The actual cache size increase will be clipped + * to satisfy the max_size specified in the general configuration, and possibly max_increment below.

The + * parameter must be greater than or equal to 1.0 -- 2.0 is a reasonable value.

If you set it to 1.0, + * you will effectively disable cache size + * increases.

hbool_t apply_max_incrementIN: Boolean flag indicating whether an upper limit should be applied to the size of cache size + * increases.
size_t max_incrementIN: Maximum number of bytes by which cache size can be increased in a single step -- if + * applicable.
enum H5C_cache_flash_incr_mode flash_incr_modeIN: Enumerated value indicating the operational mode of the flash cache size increase code. At + * present, only the following values are legal:

\c H5C_flash_incr__off: Flash cache size increase is + * disabled.

\c H5C_flash_incr__add_space: Flash cache size increase is enabled using the add space + * algorithm.

double flash_thresholdIN: The factor by which the current maximum cache size is multiplied to obtain the minimum size + * entry / entry size increase which may trigger a flash cache size increase.

At present, this value must + * lie in the range [0.1, 1.0].

double flash_multipleIN: The factor by which the size of the triggering entry / entry size increase is multiplied to + * obtain the initial cache size increment. This increment may be reduced to reflect existing free space in + * the cache and the max_size field above.

At present, this field must lie in the range [0.1, + * 10.0].

+ * + * \par Decrement configuration fields + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + *
enum H5C_cache_decr_mode decr_modeIN: Enumerated value indicating the operational mode of the automatic cache size decrease code. At + * present, the following values are legal:

\c H5C_decr__off: Automatic cache size decrease is + * disabled.

\c H5C_decr__threshold: Automatic cache size decrease is enabled using the hit rate threshold + * algorithm.

\c H5C_decr__age_out: Automatic cache size decrease is enabled using the ageout + * algorithm.

\c H5C_decr__age_out_with_threshold: Automatic cache size decrease is enabled using the + * ageout with hit rate threshold + * algorithm

double upper_hr_thresholdIN: Hit rate threshold for the hit rate threshold and ageout with hit rate threshold cache size + * decrement algorithms.

When \c decr_mode is \c H5C_decr__threshold, and the hit rate over a given epoch exceeds + * the supplied threshold, the current maximum cache size is multiplied by decrement to obtain a tentative new + * (and smaller) maximum cache size.

When \c decr_mode is \c H5C_decr__age_out_with_threshold, there is no + * attempt to find and evict aged out entries unless the hit rate in the previous epoch exceeded the supplied + * threshold.

This field must lie in the interval [0.0, 1.0].

For \c H5C_incr__threshold, .9995 or + * .99995 is a good place to start.

For \c H5C_decr__age_out_with_threshold, .999 might be more + * useful.

double decrementIN: In the hit rate threshold cache size decrease algorithm, this parameter contains the factor by + * which the current max cache size is multiplied to produce a tentative new cache size.

The actual cache + * size decrease will be clipped to satisfy the min_size specified in the general configuration, and possibly + * max_decrement below.

The parameter must be be in the interval [0.0, 1.0].

If you set it to 1.0, + * you will effectively disable cache size decreases. 0.9 is a reasonable starting + * point.

hbool_t apply_max_decrementIN: Boolean flag indicating whether an upper limit should be applied to the size of cache size + * decreases.
size_t max_decrementIN: Maximum number of bytes by which the maximum cache size can be decreased in any single step -- + * if applicable.
int epochs_before_evictionIN: In the ageout based cache size reduction algorithms, this field contains the minimum number of + * epochs an entry must remain unaccessed in cache before the cache size reduction algorithm tries to evict + * it. 3 is a reasonable value.
hbool_t apply_empty_reserveIN: Boolean flag indicating whether the ageout based decrement algorithms will maintain a empty + * reserve when decreasing cache size.
double empty_reserveIN: Empty reserve as a fraction of maximum cache size if applicable.

When so directed, the ageout + * based algorithms will not decrease the maximum cache size unless the empty reserve can be met.

The + * parameter must lie in the interval [0.0, 1.0]. 0.1 or 0.05 is a good place to + * start.

+ * + * \par Parallel configuration fields + * + * + * + * + * + *
int dirty_bytes_thresholdIN: Threshold number of bytes of dirty metadata generation for triggering synchronizations of the + * metadata caches serving the target file in the parallel case.

Synchronization occurs whenever the number + * of bytes of dirty metadata created since the last synchronization exceeds this limit.

This field only + * applies to the parallel case. While it is ignored elsewhere, it can still draw a value out of bounds + * error.

It must be consistant across all caches on any given file.

By default, this field is set + * to 256 KB. It shouldn't be more than half the current maximum cache size times the minimum clean + * fraction.

+ * + * \since 1.8.0 + * + * \todo Fix the MDC document reference! */ H5_DLL herr_t H5Fset_mdc_config(hid_t file_id, H5AC_cache_config_t *config_ptr); /** * \ingroup MDC * - * \todo Finish this! + * \brief Obtains target file's metadata cache hit rate + * + * \file_id + * \param[out] hit_rate_ptr Pointer to the double in which the hit rate is returned. Note that + * \p hit_rate_ptr is undefined if the API call fails + * \return \herr_t + * + * \details H5Fget_mdc_hit_rate() queries the metadata cache of the target file to obtain its hit rate + * \Code{(cache hits / (cache hits + cache misses))} since the last time hit rate statistics + * were reset. If the cache has not been accessed since the last time the hit rate stats were + * reset, the hit rate is defined to be 0.0. + * + * The hit rate stats can be reset either manually (via H5Freset_mdc_hit_rate_stats()), or + * automatically. If the cache's adaptive resize code is enabled, the hit rate stats will be + * reset once per epoch. If they are reset manually as well, the cache may behave oddly. + * + * See the overview of the metadata cache in the special topics section of the user manual for + * details on the metadata cache and its adaptive resize algorithms. + * */ H5_DLL herr_t H5Fget_mdc_hit_rate(hid_t file_id, double *hit_rate_ptr); /** * \ingroup MDC * - * \todo Finish this! + * \brief Obtains current metadata cache size data for specified file + * + * \file_id + * \param[out] max_size_ptr Pointer to the location in which the current cache maximum size is to be + * returned, or NULL if this datum is not desired + * \param[out] min_clean_size_ptr Pointer to the location in which the current cache minimum clean + * size is to be returned, or NULL if that datum is not desired + * \param[out] cur_size_ptr Pointer to the location in which the current cache size is to be returned, + * or NULL if that datum is not desired + * \param[out] cur_num_entries_ptr Pointer to the location in which the current number of entries in + * the cache is to be returned, or NULL if that datum is not desired + * \returns \herr_t + * + * \details H5Fget_mdc_size() queries the metadata cache of the target file for the desired size + * information, and returns this information in the locations indicated by the pointer + * parameters. If any pointer parameter is NULL, the associated data is not returned. + * + * If the API call fails, the values returned via the pointer parameters are undefined. + * + * If adaptive cache resizing is enabled, the cache maximum size and minimum clean size + * may change at the end of each epoch. Current size and current number of entries can + * change on each cache access. + * + * Current size can exceed maximum size under certain conditions. See the overview of the + * metadata cache in the special topics section of the user manual for a discussion of this. + * */ H5_DLL herr_t H5Fget_mdc_size(hid_t file_id, size_t *max_size_ptr, size_t *min_clean_size_ptr, size_t *cur_size_ptr, int *cur_num_entries_ptr); /** * \ingroup MDC * - * \todo Finish this! + * \brief Resets hit rate statistics counters for the target file + * + * \file_id + * \returns \herr_t + * + * \details + * \parblock + * H5Freset_mdc_hit_rate_stats() resets the hit rate statistics counters in the metadata cache + * associated with the specified file. + * + * If the adaptive cache resizing code is enabled, the hit rate statistics are reset at the beginning + * of each epoch. This API call allows you to do the same thing from your program. + * + * The adaptive cache resizing code may behave oddly if you use this call when adaptive cache resizing + * is enabled. However, the call should be useful if you choose to control metadata cache size from your + * program. + * + * See "Metadata Caching in HDF5" for details about the metadata cache and the adaptive cache resizing + * algorithms. If you have not read, understood, and thought about the material covered in that + * documentation, + * you should not be using this API call. + * \endparblock + * + * \todo Fix the MDC document reference! */ H5_DLL herr_t H5Freset_mdc_hit_rate_stats(hid_t file_id); /** @@ -1067,13 +1579,118 @@ H5_DLL herr_t H5Fget_info2(hid_t obj_id, H5F_info2_t *file_info); /** * \ingroup SWMR * - * \todo Finish this! + * \brief Retrieves the collection of read retries for metadata entries with checksum + * + * \file_id + * \param[out] info Struct containing the collection of read retries for metadata + * entries with checksum + * \return \herr_t\n + * + * \details \Bold{Failure Modes:} + * \li When the input identifier is not a file identifier. + * \li When the pointer to the output structure is NULL. + * \li When the memory allocation for \p retries failed. + * + * \details H5Fget_metadata_read_retry_info() retrieves information regarding the number + * of read retries for metadata entries with checksum for the file \p file_id. + * This information is reported in the H5F_retry_info_t struct defined in + * H5Fpublic.h as follows: + * \snippet this H5F_retry_info_t_snip + * \c nbins is the number of bins for each \c retries[i] of metadata entry \c i. + * It is calculated based on the current number of read attempts used in the + * library and logarithmic base 10. + * + * If read retries are incurred for a metadata entry \c i, the library will + * allocate memory for \Code{retries[i] (nbins * sizeof(uint32_t)} and store + * the collection of retries there. If there are no retries for a metadata entry + * \c i, \Code{retries[i]} will be NULL. After a call to this routine, users should + * free each \Code{retries[i]} that is non-NULL, otherwise resource leak will occur. + * + * For the library default read attempts of 100 for SWMR access, nbins will be 2 + * as depicted below: + * \li \Code{retries[i][0]} is the number of 1 to 9 read retries. + * \li \Code{retries[i][1]} is the number of 10 to 99 read retries. + * For the library default read attempts of 1 for non-SWMR access, \c nbins will + * be 0 and each \Code{retries[i]} will be NULL. + * + * The following table lists the 21 metadata entries of \Code{retries[]}: + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + *
Index for \Code{retries[]}Metadata entries*
0Object header (version 2)
1Object header chunk (version 2)
2B-tree header (version 2)
3B-tree internal node (version 2)
4B-tree leaf node (version 2)
5Fractal heap header
6Fractal heap direct block (optional checksum)
7Fractal heap indirect block
8Free-space header
9Free-space sections
10Shared object header message table
11Shared message record list
12Extensive array header
13Extensive array index block
14Extensive array super block
15Extensive array data block
16Extensive array data block page
17Fixed array super block
18Fixed array data block
19Fixed array data block page
20File's superblock (version 2)
* All entries are of version 0 (zero) unless indicated otherwise.
+ * + * \note On a system that is not atomic, the library might possibly read inconsistent + * metadata with checksum when performing single-writer/multiple-reader (SWMR) + * operations for an HDF5 file. Upon encountering such situations, the library + * will try reading the metadata again for a set number of times to attempt to + * obtain consistent data. The maximum number of read attempts used by the library + * will be either the value set via H5Pset_metadata_read_attempts() or the library + * default value when a value is not set.\n + * When the current number of metadata read attempts used in the library is unable + * to remedy the reading of inconsistent metadata on a system, the user can assess + * the information obtained via this routine to derive a different maximum value. + * The information can also be helpful for debugging purposes to identify potential + * issues with metadata flush dependencies and SWMR implementation in general. + * + * \since 1.10.0 + * */ H5_DLL herr_t H5Fget_metadata_read_retry_info(hid_t file_id, H5F_retry_info_t *info); /** * \ingroup SWMR * - * \todo Finish this! + * \brief Retrieves free-space section information for a file + * + * \file_id + * + * \return \herr_t + * + * \details H5Fstart_swmr_write() will activate SWMR writing mode for a file + * associated with \p file_id. This routine will prepare and ensure + * the file is safe for SWMR writing as follows: + * \li Check that the file is opened with write access (#H5F_ACC_RDWR). + * \li Check that the file is opened with the latest library format to + * ensure data structures with check-summed metadata are used. + * \li Check that the file is not already marked in SWMR writing mode. + * \li Enable reading retries for check-summed metadata to remedy + * possible checksum failures from reading inconsistent metadata + * on a system that is not atomic. + * \li Turn off usage of the library's accumulator to avoid possible + * ordering problem on a system that is not atomic. + * \li Perform a flush of the file’s data buffers and metadata to set + * a consistent state for starting SWMR write operations. + * + * Library objects are groups, datasets, and committed datatypes. For + * the current implementation, groups and datasets can remain open when + * activating SWMR writing mode, but not committed datatypes. Attributes + * attached to objects cannot remain open either. + * + * \since 1.10.0 + * */ H5_DLL herr_t H5Fstart_swmr_write(hid_t file_id); /** @@ -1174,19 +1791,141 @@ H5_DLL herr_t H5Fset_libver_bounds(hid_t file_id, H5F_libver_t low, H5F_libver /** * \ingroup MDC * - * \todo Finish this! + * \brief Starts logging metadata cache events if logging was previously enabled + * + * \file_id + * + * \return \herr_t + * + * \details The metadata cache is a central part of the HDF5 library through + * which all \Emph{file metadata} reads and writes take place. File + * metadata is normally invisible to the user and is used by the + * library for purposes such as locating and indexing data. File + * metadata should not be confused with user metadata, which consists + * of attributes created by users and attached to HDF5 objects such + * as datasets via H5A API calls. + * + * Due to the complexity of the cache, a trace/logging feature has been + * created that can be used by HDF5 developers for debugging and performance + * analysis. The functions that control this functionality will normally be + * of use to a very limited number of developers outside of The HDF Group. + * The functions have been documented to help users create logs that can + * be sent with bug reports. + * + * Control of the log functionality is straightforward. Logging is enabled + * via the H5Pset_mdc_log_options() function, which will modify the file + * access property list used to open or create a file. This function has + * a flag that determines whether logging begins at file open or starts + * in a paused state. Log messages can then be controlled via the + * H5Fstart_mdc_logging() and H5Fstop_mdc_logging() functions. + * H5Pget_mdc_log_options() can be used to examine a file access property + * list, and H5Fget_mdc_logging_status() will return the current state of + * the logging flags. + * + * The log format is described in the \Emph{Metadata Cache Logging} document. + * + * \note Logging can only be started or stopped if metadata cache logging was enabled + * via H5Pset_mdc_log_options().\n + * When enabled and currently logging, the overhead of the logging feature will + * almost certainly be significant.\n + * The log file is opened when the HDF5 file is opened or created and not when + * this function is called for the first time.\n + * This function opens the log file and starts logging metadata cache operations + * for a particular file. Calling this function when logging has already been + * enabled will be considered an error. + * + * \since 1.10.0 + * + * \todo Fix the document reference! + * */ H5_DLL herr_t H5Fstart_mdc_logging(hid_t file_id); /** * \ingroup MDC * - * \todo Finish this! + * \brief Stops logging metadata cache events if logging was previously enabled and is currently ongoing + * + * \file_id + * + * \return \herr_t + * + * \details The metadata cache is a central part of the HDF5 library through + * which all \Emph{file metadata} reads and writes take place. File + * metadata is normally invisible to the user and is used by the + * library for purposes such as locating and indexing data. File + * metadata should not be confused with user metadata, which consists + * of attributes created by users and attached to HDF5 objects such + * as datasets via H5A API calls. + * + * Due to the complexity of the cache, a trace/logging feature has been + * created that can be used by HDF5 developers for debugging and performance + * analysis. The functions that control this functionality will normally be + * of use to a very limited number of developers outside of The HDF Group. + * The functions have been documented to help users create logs that can + * be sent with bug reports. + * + * Control of the log functionality is straightforward. Logging is enabled + * via the H5Pset_mdc_log_options() function, which will modify the file + * access property list used to open or create a file. This function has + * a flag that determines whether logging begins at file open or starts + * in a paused state. Log messages can then be controlled via the + * H5Fstart_mdc_logging() and H5Fstop_mdc_logging() functions. + * H5Pget_mdc_log_options() can be used to examine a file access property + * list, and H5Fget_mdc_logging_status() will return the current state of + * the logging flags. + * + * The log format is described in the \Emph{Metadata Cache Logging} document. + * + * \note Logging can only be started or stopped if metadata cache logging was enabled + * via H5Pset_mdc_log_options().\n + * This function only suspends the logging operations. The log file will remain + * open and will not be closed until the HDF5 file is closed. + * + * \since 1.10.0 + * */ H5_DLL herr_t H5Fstop_mdc_logging(hid_t file_id); /** * \ingroup MDC * - * \todo Finish this! + * \brief Gets the current metadata cache logging status + * + * \file_id + * \param[out] is_enabled Whether logging is enabled + * \param[out] is_currently_logging Whether events are currently being logged + * \return \herr_t + * + * \details The metadata cache is a central part of the HDF5 library through + * which all \Emph{file metadata} reads and writes take place. File + * metadata is normally invisible to the user and is used by the + * library for purposes such as locating and indexing data. File + * metadata should not be confused with user metadata, which consists + * of attributes created by users and attached to HDF5 objects such + * as datasets via H5A API calls. + * + * Due to the complexity of the cache, a trace/logging feature has been + * created that can be used by HDF5 developers for debugging and performance + * analysis. The functions that control this functionality will normally be + * of use to a very limited number of developers outside of The HDF Group. + * The functions have been documented to help users create logs that can + * be sent with bug reports. + * + * Control of the log functionality is straightforward. Logging is enabled + * via the H5Pset_mdc_log_options() function, which will modify the file + * access property list used to open or create a file. This function has + * a flag that determines whether logging begins at file open or starts + * in a paused state. Log messages can then be controlled via the + * H5Fstart_mdc_logging() and H5Fstop_mdc_logging() functions. + * H5Pget_mdc_log_options() can be used to examine a file access property + * list, and H5Fget_mdc_logging_status() will return the current state of + * the logging flags. + * + * The log format is described in the \Emph{Metadata Cache Logging} document. + * + * \note Unlike H5Fstart_mdc_logging() and H5Fstop_mdc_logging(), this function can + * be called on any open file identifier. + * + * \since 1.10.0 */ H5_DLL herr_t H5Fget_mdc_logging_status(hid_t file_id, /*OUT*/ hbool_t *is_enabled, @@ -1245,7 +1984,32 @@ H5_DLL herr_t H5Fget_page_buffering_stats(hid_t file_id, unsigned accesses[2], /** * \ingroup MDC * - * \todo Finish this! + * \brief Obtains information about a cache image if it exists + * + * \file_id + * \param[out] image_addr Offset of the cache image if it exists, or #HADDR_UNDEF if it does not + * \param[out] image_size Length of the cache image if it exists, or 0 if it does not + * \returns \herr_t + * + * \details + * \parblock + * H5Fget_mdc_image_info() returns information about a cache image if it exists. + * + * When an HDF5 file is opened in Read/Write mode, any metadata cache image will + * be read and deleted from the file on the first metadata cache access (or, if + * persistent free space managers are enabled, on the first file space + * allocation / deallocation, or read of free space manager status, whichever + * comes first). + * + * Thus, if the file is opened Read/Write, H5Fget_mdc_image_info() should be called + * immediately after file open and before any other operation. If H5Fget_mdc_image_info() + * is called after the cache image is loaded, it will correctly report that no cache image + * exists, as the image will have already been read and deleted from the file. In the Read Only + * case, the function may be called at any time, as any cache image will not be deleted + * from the file. + * \endparblock + * + * \since 1.10.1 */ H5_DLL herr_t H5Fget_mdc_image_info(hid_t file_id, haddr_t *image_addr, hsize_t *image_size); /** @@ -1307,13 +2071,91 @@ H5_DLL herr_t H5Fset_dset_no_attrs_hint(hid_t file_id, hbool_t minimize); /** * \ingroup PH5F * - * \todo Finish this! + * \brief Sets the MPI atomicity mode + * + * \file_id + * \param[in] flag Logical flag for atomicity setting. Valid values are: + * \li \c 1 -- Sets MPI file access to atomic mode. + * \li \c 0 -- Sets MPI file access to nonatomic mode. + * \returns \herr_t + * + * \par Motivation + * H5Fset_mpi_atomicity() is applicable only in parallel environments using MPI I/O. + * The function is one of the tools used to ensure sequential consistency. This means + * that a set of operations will behave as though they were performed in a serial + * order consistent with the program order. + * + * \details + * \parblock + * H5Fset_mpi_atomicity() sets MPI consistency semantics for data access to the file, + * \p file_id. + * + * If \p flag is set to \c 1, all file access operations will appear atomic, guaranteeing + * sequential consistency. If \p flag is set to \c 0, enforcement of atomic file access + * will be turned off. + * + * H5Fset_mpi_atomicity() is a collective function and all participating processes must + * pass the same values for \p file_id and \p flag. + * + * This function is available only when the HDF5 library is configured with parallel support + * (\Code{--enable-parallel}). It is useful only when used with the #H5FD_MPIO driver + * (see H5Pset_fapl_mpio()). + * \endparblock + * + * \attention + * \parblock + * H5Fset_mpi_atomicity() calls \Code{MPI_File_set_atomicity} underneath and is not supported + * if the execution platform does not support \Code{MPI_File_set_atomicity}. When it is + * supported and used, the performance of data access operations may drop significantly. + * + * In certain scenarios, even when \Code{MPI_File_set_atomicity} is supported, setting + * atomicity with H5Fset_mpi_atomicity() and \p flag set to 1 does not always yield + * strictly atomic updates. For example, some H5Dwrite() calls translate to multiple + * \Code{MPI_File_write_at} calls. This happens in all cases where the high-level file + * access routine translates to multiple lower level file access routines. + * The following scenarios will raise this issue: + * \li Non-contiguous file access using independent I/O + * \li Partial collective I/O using chunked access + * \li Collective I/O using filters or when data conversion is required + * + * This issue arises because MPI atomicity is a matter of MPI file access operations rather + * than HDF5 access operations. But the user is normally seeking atomicity at the HDF5 level. + * To accomplish this, the application must set a barrier after a write, H5Dwrite(), but before + * the next read, H5Dread(), in addition to calling H5Fset_mpi_atomicity().The barrier will + * guarantee that all underlying write operations execute atomically before the read + * operations starts. This ensures additional ordering semantics and will normally produce + * the desired behavior. + * \endparblock + * + * \see Enabling a Strict Consistency Semantics Model in Parallel HDF5 + * + * \since 1.8.9 + * + * \todo Fix the reference! */ H5_DLL herr_t H5Fset_mpi_atomicity(hid_t file_id, hbool_t flag); /** * \ingroup PH5F * - * \todo Finish this! + * \brief Retrieves the atomicity mode in use + * + * \file_id + * \param[out] flag Logical flag for atomicity setting. Valid values are: + * \li 1 -- MPI file access is set to atomic mode. + * \li 0 -- MPI file access is set to nonatomic mode. + * \returns \herr_t + * + * \details H5Fget_mpi_atomicity() retrieves the current consistency semantics mode for + * data access for the file \p file_id. + * + * Upon successful return, \p flag will be set to \c 1 if file access is set + * to atomic mode and \c 0 if file access is set to nonatomic mode. + * + * \see Enabling a Strict Consistency Semantics Model in Parallel HDF5 + * + * \since 1.8.9 + * + * \todo Fix the reference! */ H5_DLL herr_t H5Fget_mpi_atomicity(hid_t file_id, hbool_t *flag); #endif /* H5_HAVE_PARALLEL */ From 3c0394b1e06d974eb649361cd029302b33101ee4 Mon Sep 17 00:00:00 2001 From: bljhdf <58825073+bljhdf@users.noreply.github.com> Date: Mon, 23 Nov 2020 16:17:44 -0600 Subject: [PATCH 04/21] Doxygen - added (mostly) beginner functions (#112) * Doxygen - added (mostly) beginner functions * Removed duplicate H5Pset_szip function --- src/H5Amodule.h | 17 + src/H5Apublic.h | 341 ++++++++++++++++++- src/H5Pmodule.h | 43 +++ src/H5Ppublic.h | 868 +++++++++++++++++++++++++++++++++++++++++++++++- src/H5Smodule.h | 27 ++ src/H5Spublic.h | 282 +++++++++++++++- 6 files changed, 1551 insertions(+), 27 deletions(-) diff --git a/src/H5Amodule.h b/src/H5Amodule.h index 707fc54cf7c..09e6c4aec60 100644 --- a/src/H5Amodule.h +++ b/src/H5Amodule.h @@ -29,4 +29,21 @@ #define H5_MY_PKG_ERR H5E_ATTR #define H5_MY_PKG_INIT YES +/**\defgroup H5A H5A + * \brief Attribute Interface + * + * \details The Attribute Interface, H5A, provides a mechanism for attaching + * additional information to a dataset, group, or named datatype. + * + * Attributes are accessed by opening the object that they are + * attached to and are not independent objects. Typically an + * attribute is small in size and contains user metadata about the + * object that it is attached to. + * + * Attributes look similar to HDF5 datasets in that they have a + * datatype and dataspace. However, they do not support partial + * I/O operations and cannot be compressed or extended. + * + */ + #endif /* _H5Amodule_H */ diff --git a/src/H5Apublic.h b/src/H5Apublic.h index 89a3b04a538..3b836e7dbd4 100644 --- a/src/H5Apublic.h +++ b/src/H5Apublic.h @@ -45,18 +45,306 @@ typedef herr_t (*H5A_operator2_t)(hid_t location_id /*in*/, const char *attr_nam extern "C" { #endif +/*-------------------------------------------------------------------------*/ +/** + * \ingroup H5A + * + * \brief Closes the specified attribute + * + * \attr_id + * + * \return \herr_t + * + * \details H5Aclose() terminates access to the attribute specified by + * \p attr_id by releasing the identifier. + * + * \attention Further use of a released attribute identifier is illegal; a + * function using such an identifier will generate an error. + * + * \since 1.0.0 + * + * \see H5Acreate(), H5Aopen() + */ +H5_DLL herr_t H5Aclose(hid_t attr_id); +/* --------------------------------------------------------------------------*/ +/** + * \ingroup H5A + * + * \brief Creates an attribute attached to a specified object + * + * \fgdt_loc_id + * \param[in] attr_name Name of attribute + * \param[in] type_id Attribute datatype identifier + * \space_id + * \acpl_id + * \aapl_id + * + * \return \hid_tv{attribute} + * + * \details H5Acreate2() creates an attribute, \p attr_name, which is attached + * to the object specified by the identifier \p loc_id. + * + * The attribute name, \p attr_name, must be unique for the object. + * + * The attribute is created with the specified datatype and dataspace, + * \p type_id and \p space_id, which are created with the H5T and + * H5S interfaces, respectively. + * + * If \p type_id is either a fixed-length or variable-length string, + * it is important to set the string length when defining the + * datatype. String datatypes are derived from #H5T_C_S1 (or + * #H5T_FORTRAN_S1 for Fortran), which defaults to 1 character in + * size. See H5Tset_size() and Creating variable-length string + * datatypes. + * + * The access property list is currently unused, but will be used in + * the future. This property list should currently be #H5P_DEFAULT. + * + * The attribute identifier returned by this function must be released + * with H5Aclose() resource leaks will develop. + * + * \note The \p acpl and \p aapl parameters are currently not used; specify + * #H5P_DEFAULT. + * \note If \p loc_id is a file identifier, the attribute will be attached + * that file’s root group. + * + * \since 1.8.0 + * + * \see H5Aclose() + * + */ H5_DLL hid_t H5Acreate2(hid_t loc_id, const char *attr_name, hid_t type_id, hid_t space_id, hid_t acpl_id, hid_t aapl_id); +/*--------------------------------------------------------------------------*/ +/** + * \ingroup H5A + * + * \brief Creates an attribute attached to a specified object + * + * \fgdt_loc_id + * \param[in] obj_name Name, relative to \p loc_id, of object that + * attribute is to be attached to + * \param[in] attr_name Attribute name + * \param[in] type_id Attribute datatype identifier + * \space_id + * \acpl_id + * \aapl_id + * \lapl_id + * + * \return \hid_tv{attribute} + * + * \details H5Acreate_by_name() creates an attribute, \p attr_name, which is + * attached to the object specified by \p loc_id and \p obj_name. + * + * \p loc_id is a location identifier; \p obj_name is the object + * name relative to \p loc_id. If \p loc_id fully specifies the + * object to which the attribute is to be attached, \p obj_name + * should be '.' (a dot). + * + * The attribute name, \p attr_name, must be unique for the object. + * + * The attribute is created with the specified datatype and + * dataspace, \p type_id and \p space_id, which are created with + * the H5T and H5S interfaces respectively. + * + * The attribute creation and access property lists are currently + * unused, but will be used in the future for optional attribute + * creation and access properties. These property lists should + * currently be #H5P_DEFAULT. + * + * The link access property list, \p lapl_id, may provide + * information regarding the properties of links required to access + * the object, \p obj_name. + * + * The attribute identifier returned by this function must be + * released with H5close() or resource leaks will develop. + * + * \since 1.8.0 + * + */ H5_DLL hid_t H5Acreate_by_name(hid_t loc_id, const char *obj_name, const char *attr_name, hid_t type_id, hid_t space_id, hid_t acpl_id, hid_t aapl_id, hid_t lapl_id); +/*--------------------------------------------------------------------------*/ +/** + * \ingroup H5A + * + * \brief Opens an attribute for an object specified by object identifier and + * attribute name + * + * \fgdt_loc_id{obj_id} + * \param[in] attr_name Name of attribute to open + * \aapl_id + * + * \return \hid_tv{attribute} + * + * \details H5Aopen() opens an existing attribute, \p attr_name, that is + * attached to object specified by an object identifier, \p obj_id. + * + * The attribute access property list, \p aapl_id, is currently unused + * and should be #H5P_DEFAULT. + * + * This function, H5Aopen_by_idx() or H5Aopen_by_name() must be called + * before the attribute can be accessed for any further purpose, + * including reading, writing, or any modification. + * + * The attribute identifier returned by this function must be released + * with H5Aclose() or resource leaks will develop. + * + * \since 1.8.0 + * + * \see H5Aclose(), H5Acreate() + */ H5_DLL hid_t H5Aopen(hid_t obj_id, const char *attr_name, hid_t aapl_id); -H5_DLL hid_t H5Aopen_by_name(hid_t loc_id, const char *obj_name, const char *attr_name, hid_t aapl_id, - hid_t lapl_id); +/*--------------------------------------------------------------------------*/ +/** + * \ingroup H5A + * + * \brief Opens the nth attribute attached to an object + * + * \loc_id + * \param[in] obj_name Name of object to which attribute is attached, + * relative to location + * \param[in] idx_type Type of index + * \param[in] order Index traversal order + * \param[in] n Attribute’s position in index + * \aapl_id + * \lapl_id + * + * \return \hid_tv{attribute} + * + * \details H5Aopen_by_idx() opens an existing attribute that is attached + * to an object specified by location and name, \p loc_id and + * \p obj_name, respectively. If \p loc_id fully specifies the + * object to which the attribute is attached, \p obj_name, should + * be '.' (a dot). + * + * The attribute is identified by an index type, an index traversal + * order, and a position in the index, \p idx_type, \p order and + * \p n, respectively. These parameters and their valid values are + * discussed in the description of H5Aiterate2(). + * + * The attribute access property list, \p aapl_id, is currently + * unused and should currently be #H5P_DEFAULT. + * + * The link access property list, \p lapl_id, may provide + * information regarding the properties of links required to access + * the object, \p obj_name. + * + * This function, H5Aopen(), or H5Aopen_by_name() must be called + * before an attribute can be accessed for any further purpose, + * including reading, writing, or any modification. + * + * The attribute identifier returned by this function must be + * released with H5Aclose() or resource leaks will develop. + * + * \since 1.8.0 + * + */ H5_DLL hid_t H5Aopen_by_idx(hid_t loc_id, const char *obj_name, H5_index_t idx_type, H5_iter_order_t order, hsize_t n, hid_t aapl_id, hid_t lapl_id); -H5_DLL herr_t H5Awrite(hid_t attr_id, hid_t type_id, const void *buf); +/*--------------------------------------------------------------------------*/ +/** + * \ingroup H5A + * + * \brief Opens an attribute for an object by object name and attribute name + * + * \fgdt_loc_id + * \param[in] obj_name Name of object to which attribute is attached, + * relative to \p loc_id + * \param[in] attr_name Name of attribute to open + * \aapl_id + * \lapl_id + * + * \return \hid_tv{attribute} + * + * \details H5Aopen_by_name() opens an existing attribute, \p attr_name, + * that is attached to an object specified by location and name, + * \p loc_id and \p obj_name, respectively. + * + * \p loc_id specifies a location from which the target object can + * be located and \p obj_name is an object name relative to + * \p loc_id. If \p loc_id fully specifies the object to which the + * attribute is attached, \p obj_name should be '.' (a dot). + * + * The attribute access property list, \p aapl_id, is currently + * unused and should currently be #H5P_DEFAULT. + * + * The link access property list, \p lapl_id, may provide + * information regarding the properties of links required to access + * the object, \p obj_name. + * + * This function, H5Aopen(), or H5Aopen_by_idx() must be called + * before an attribute can be accessed for any further purpose, + * including reading, writing, or any modification. + * + * The attribute identifier returned by this function must be + * released with H5Aclose() or resource leaks will develop. + * + * \since 1.8.0 + * + */ +H5_DLL hid_t H5Aopen_by_name(hid_t loc_id, const char *obj_name, const char *attr_name, hid_t aapl_id, + hid_t lapl_id); +/*-------------------------------------------------------------------------- */ +/** + * \ingroup H5A + * + * \brief Reads the value of an attribute + * + * \attr_id + * \mem_type_id{type_id} + * \param[out] buf Buffer for data to be read + * + * \return \herr_t + * + * \details H5Aread() reads an attribute, specified with \p attr_id. The + * attribute's in-memory datatype is specified with \p type_id. The + * entire attribute is read into \p buf from the file. + * + * Datatype conversion takes place at the time of a read or write and + * is automatic. + * + * \version 1.8.8 Fortran updated to Fortran2003. + * \version 1.4.2 The \p dims parameter was added to the Fortran API in this + * release. + * \since 1.0.0 + * + * \see H5Awrite() + * +*/ H5_DLL herr_t H5Aread(hid_t attr_id, hid_t type_id, void *buf); -H5_DLL herr_t H5Aclose(hid_t attr_id); +/*--------------------------------------------------------------------------*/ +/** + * \ingroup H5A + * + * \brief Writes data to an attribute + * + * \attr_id + * \mem_type_id{type_id} + * \param[out] buf Data to be written + * + * \return \herr_t + * + * \details H5Awrite() writes an attribute, specified with \p attr_id. The + * attribute's in-memory datatype is specified with \p type_id. + * The entire attribute is written from \p buf to the file. + * + * If \p type_id is either a fixed-length or variable-length string, + * it is important to set the string length when defining the datatype. + * String datatypes are derived from #H5T_C_S1 (or #H5T_FORTRAN_S1 for + * Fortran codes), which defaults to 1 character in size. + * See H5Tset_size() and Creating variable-length string datatypes. + * + * Datatype conversion takes place at the time of a read or write and + * is automatic. + * + * \version 1.8.8 Fortran updated to Fortran2003. + * \version 1.4.2 Fortran \p dims parameter added in this release + * \since 1.0.0 + * \see H5Aread() + * + */ +H5_DLL herr_t H5Awrite(hid_t attr_id, hid_t type_id, const void *buf); H5_DLL hid_t H5Aget_space(hid_t attr_id); H5_DLL hid_t H5Aget_type(hid_t attr_id); H5_DLL hid_t H5Aget_create_plist(hid_t attr_id); @@ -100,6 +388,51 @@ typedef herr_t (*H5A_operator1_t)(hid_t location_id /*in*/, const char *attr_nam void *operator_data /*in,out*/); /* Function prototypes */ +/* --------------------------------------------------------------------------*/ +/** + * \ingroup H5A + * + * \brief Creates an attribute attached to a specified object + * + * \fgdt_loc_id + * \param[in] name Name of attribute to locate and open + * \param[in] type_id Identifier of attribute datatype + * \space_id + * \acpl_id + * + * \return \hid_tv{attribute} + * + * \note The \p acpl parameters is currently not used; specify #H5P_DEFAULT. + * + * \deprecated Deprecated in favor of H5Acreate2() + * + * \details H5Acreate1() creates an attribute, \p name, which is attached + * to the object specified by the identifier \p loc_id. + * + * The attribute name, \p name, must be unique for the object. + * + * The attribute is created with the specified datatype and dataspace, + * \p type_id and \p space_id, which are created with the H5T and + * H5S interfaces, respectively. + * + * If \p type_id is either a fixed-length or variable-length string, + * it is important to set the string length when defining the + * datatype. String datatypes are derived from #H5T_C_S1 (or + * #H5T_FORTRAN_S1 for Fortran), which defaults to 1 character in + * size. See H5Tset_size() and Creating variable-length string + * datatypes. + * + * The attribute identifier returned by this function must be released + * with H5Aclose() resource leaks will develop. + * + * \since 1.8.0 + * + * \version 1.8.0 The function H5Acreate() was renamed to H5Acreate1() and + * deprecated in this release. + * + * \see H5Aclose() + * + */ H5_DLL hid_t H5Acreate1(hid_t loc_id, const char *name, hid_t type_id, hid_t space_id, hid_t acpl_id); H5_DLL hid_t H5Aopen_name(hid_t loc_id, const char *name); H5_DLL hid_t H5Aopen_idx(hid_t loc_id, unsigned idx); diff --git a/src/H5Pmodule.h b/src/H5Pmodule.h index d8cc43051e7..b9e11802e7d 100644 --- a/src/H5Pmodule.h +++ b/src/H5Pmodule.h @@ -29,4 +29,47 @@ #define H5_MY_PKG_ERR H5E_PLIST #define H5_MY_PKG_INIT YES +/**\defgroup H5P H5P + * \brief Property List Interface + * + * \details The HDF5 Property List Interface provides a mechanism to take + * advantage of more powerful or unusual features in HDF5. + * + * HDF5 objects have properties or characteristics associated with + * them, and there are default properties that handle the most + * common needs. These default properties can be modified using the + * HDF5 Property List Interface. For example, the data storage + * layout property of a dataset is contiguous by default. For better + * performance, the layout can be modified to be chunked or chunked + * and compressed. + * + * \todo Describe concisely what the functions in this module are about. + * \todo Clicking on "more" after "Property List Interface" at the top does not work + * + * \defgroup GPLO General Property List Operations + * \ingroup H5P + * \defgroup GPLOA General Property List Operations (Advanced) + * \ingroup H5P + * \defgroup FCPL File Creation Properties + * \ingroup H5P + * \defgroup FAPL File Access Properties + * \ingroup H5P + * \defgroup GCPL Group Creation Properties + * \ingroup H5P + * \defgroup ALCAPL Attribute and Link Creation Properties + * \ingroup H5P + * \defgroup LAPL Link Access Properties + * \ingroup H5P + * \defgroup DCPL Dataset Creation Properties + * \ingroup H5P + * \defgroup DAPL Dataset Access Properties + * \ingroup H5P + * \defgroup DXPL Dataset Transfer Properties + * \ingroup H5P + * \defgroup OCPL Object Creation Properties + * \ingroup H5P + * \defgroup OCPPL Object Copy Properties + * \ingroup H5P + */ + #endif /* _H5Pmodule_H */ diff --git a/src/H5Ppublic.h b/src/H5Ppublic.h index ffcdd99b061..a978895b839 100644 --- a/src/H5Ppublic.h +++ b/src/H5Ppublic.h @@ -232,11 +232,153 @@ H5_DLLVAR hid_t H5P_LST_REFERENCE_ACCESS_ID_g; /*********************/ /* Generic property list routines */ + +/** + * \ingroup GPLO + * + * \brief Terminates access to a property list + * + * \plist_id + * + * \return \herr_t + * + * \details H5Pclose() terminates access to a property list. All property + * lists should be closed when the application is finished + * accessing them. This frees resources used by the property + * list. + * + * \since 1.0.0 + * + */ +H5_DLL herr_t H5Pclose(hid_t plist_id); +/** + * \ingroup GPLO + * + * \brief Creates a new property list as an instance of a property list class + * + * \plistcls_id{cls_id} + * + * \return \hid_t{property list} + * + * \details H5Pcreate() creates a new property list as an instance of + * some property list class. The new property list is initialized + * with default values for the specified class. The classes are as + * follows: + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + *
Class IdentifierClass NameComments
#H5P_ATTRIBUTE_CREATEattribute createProperties for attribute creation
#H5P_DATASET_ACCESSdataset accessProperties for dataset access
#H5P_DATASET_CREATEdataset createProperties for dataset creation
#H5P_DATASET_XFERdata transferProperties for raw data transfer
#H5P_DATATYPE_ACCESSdatatype accessProperties for datatype access
#H5P_DATATYPE_CREATEdatatype createProperties for datatype creation
#H5P_FILE_ACCESSfile accessProperties for file access
#H5P_FILE_CREATEfile createProperties for file creation
#H5P_FILE_MOUNTfile mountProperties for file mounting
#H5P_GROUP_ACCESSgroup accessProperties for group access
#H5P_GROUP_CREATEgroup createProperties for group creation
#H5P_LINK_ACCESSlink accessProperties governing link traversal when accessing objects
#H5P_LINK_CREATElink createProperties governing link creation
#H5P_OBJECT_COPYobject copyProperties governing the object copying process
#H5P_OBJECT_CREATEobject createProperties for object creation
#H5P_STRING_CREATEstring createProperties for character encoding when encoding strings or + * object names
#H5P_VOL_INITIALIZEvol initializeProperties for VOL initialization
+ * + * This property list must eventually be closed with H5Pclose(); + * otherwise, errors are likely to occur. + * + * \version 1.12.0 The #H5P_VOL_INITIALIZE property list class was added + * \version 1.8.15 For each class, the class name returned by + * H5Pget_class_name() was added. + * The list of possible Fortran values was updated. + * \version 1.8.0 The following property list classes were added at this + * release: #H5P_DATASET_ACCESS, #H5P_GROUP_CREATE, + * #H5P_GROUP_ACCESS, #H5P_DATATYPE_CREATE, + * #H5P_DATATYPE_ACCESS, #H5P_ATTRIBUTE_CREATE + * + * \since 1.0.0 + * + */ +H5_DLL hid_t H5Pcreate(hid_t cls_id); H5_DLL hid_t H5Pcreate_class(hid_t parent, const char *name, H5P_cls_create_func_t cls_create, void *create_data, H5P_cls_copy_func_t cls_copy, void *copy_data, H5P_cls_close_func_t cls_close, void *close_data); H5_DLL char * H5Pget_class_name(hid_t pclass_id); -H5_DLL hid_t H5Pcreate(hid_t cls_id); H5_DLL herr_t H5Pregister2(hid_t cls_id, const char *name, size_t size, void *def_value, H5P_prp_create_func_t prp_create, H5P_prp_set_func_t prp_set, H5P_prp_get_func_t prp_get, H5P_prp_delete_func_t prp_del, @@ -262,10 +404,80 @@ H5_DLL herr_t H5Pcopy_prop(hid_t dst_id, hid_t src_id, const char *name); H5_DLL herr_t H5Premove(hid_t plist_id, const char *name); H5_DLL herr_t H5Punregister(hid_t pclass_id, const char *name); H5_DLL herr_t H5Pclose_class(hid_t plist_id); -H5_DLL herr_t H5Pclose(hid_t plist_id); H5_DLL hid_t H5Pcopy(hid_t plist_id); /* Object creation property list (OCPL) routines */ + +/** + * \ingroup OCPL + * + * \brief Returns information about a filter in a pipeline + * + * \todo Signature for H5Pget_filter2 is different in H5Pocpl.c than in + * H5Ppublic.h + * + * \plist_id{plist_id} + * \param[in] idx Sequence number within the filter pipeline of the filter + * for which information is sought + * \param[out] flags Bit vector specifying certain general properties of the + * filter + * \param[in,out] cd_nelmts Number of elements in \p cd_values + * \param[out] cd_values Auxiliary data for the filter + * \param[in] namelen Anticipated number of characters in \p name + * \param[out] name Name of the filter + * \param[out] filter_config Bit field, as described in H5Zget_filter_info() + * + * \return Returns a negative value on failure, and the filter identifier + * if successful (see #H5Z_filter_t): + * - #H5Z_FILTER_DEFLATE Data compression filter, + * employing the gzip algorithm + * - #H5Z_FILTER_SHUFFLE Data shuffling filter + * - #H5Z_FILTER_FLETCHER32 Error detection filter, employing the + * Fletcher32 checksum algorithm + * - #H5Z_FILTER_SZIP Data compression filter, employing the + * SZIP algorithm + * - #H5Z_FILTER_NBIT Data compression filter, employing the + * N-bit algorithm + * - #H5Z_FILTER_SCALEOFFSET Data compression filter, employing the + * scale-offset algorithm + * + * \details H5Pget_filter2() returns information about a filter specified by + * its filter number, in a filter pipeline specified by the property + * list with which it is associated. + * + * \p plist_id must be a dataset or group creation property list. + * + * \p idx is a value between zero and N-1, as described in + * H5Pget_nfilters(). The function will return a negative value if + * the filter number is out of range. + * + * The structure of the \p flags argument is discussed in + * H5Pset_filter(). + * + * On input, \p cd_nelmts indicates the number of entries in the + * \p cd_values array, as allocated by the caller; on return, + * \p cd_nelmts contains the number of values defined by the filter. + * + * If \p name is a pointer to an array of at least \p namelen bytes, + * the filter name will be copied into that array. The name will be + * null terminated if \p namelen is large enough. The filter name + * returned will be the name appearing in the file, the name + * registered for the filter, or an empty string. + * + * \p filter_config is the bit field described in + * H5Zget_filter_info(). + * + * \version 1.8.5 Function extended to work with group creation property + * lists. + * \since 1.8.0 + * + */ +H5_DLL H5Z_filter_t H5Pget_filter2(hid_t plist_id, unsigned idx, + unsigned int *flags/*out*/, + size_t *cd_nelmts/*out*/, + unsigned cd_values[]/*out*/, + size_t namelen, char name[], + unsigned *filter_config /*out*/); H5_DLL herr_t H5Pset_attr_phase_change(hid_t plist_id, unsigned max_compact, unsigned min_dense); H5_DLL herr_t H5Pget_attr_phase_change(hid_t plist_id, unsigned *max_compact, unsigned *min_dense); H5_DLL herr_t H5Pset_attr_creation_order(hid_t plist_id, unsigned crt_order_flags); @@ -277,9 +489,6 @@ H5_DLL herr_t H5Pmodify_filter(hid_t plist_id, H5Z_filter_t filter, unsigned int H5_DLL herr_t H5Pset_filter(hid_t plist_id, H5Z_filter_t filter, unsigned int flags, size_t cd_nelmts, const unsigned int c_values[]); H5_DLL int H5Pget_nfilters(hid_t plist_id); -H5_DLL H5Z_filter_t H5Pget_filter2(hid_t plist_id, unsigned filter, unsigned int *flags /*out*/, - size_t *cd_nelmts /*out*/, unsigned cd_values[] /*out*/, size_t namelen, - char name[], unsigned *filter_config /*out*/); H5_DLL herr_t H5Pget_filter_by_id2(hid_t plist_id, H5Z_filter_t id, unsigned int *flags /*out*/, size_t *cd_nelmts /*out*/, unsigned cd_values[] /*out*/, size_t namelen, char name[] /*out*/, unsigned *filter_config /*out*/); @@ -379,10 +588,592 @@ H5_DLL herr_t H5Pget_page_buffer_size(hid_t plist_id, size_t *buf_size, unsigned unsigned *min_raw_per); /* Dataset creation property list (DCPL) routines */ -H5_DLL herr_t H5Pset_layout(hid_t plist_id, H5D_layout_t layout); + +/** + * \ingroup DCPL + * + * \brief Retrieves the size of chunks for the raw data of a chunked + * layout dataset + * + * \dcpl_id{plist_id} + * \param[in] max_ndims Size of the \p dims array + * \param[out] dim Array to store the chunk dimensions + * + * \return Returns chunk dimensionality if successful; + * otherwise returns a negative value. + * + * \details H5Pget_chunk() retrieves the size of chunks for the raw data + * of a chunked layout dataset. This function is only valid for + * dataset creation property lists. At most, \p max_ndims elements + * of \p dim will be initialized. + * + * \since 1.0.0 + * + */ +H5_DLL int H5Pget_chunk(hid_t plist_id, int max_ndims, hsize_t dim[]/*out*/); +/** + *------------------------------------------------------------------------- + * + * \ingroup DCPL + * + * \brief Retrieves the edge chunk option setting from a dataset creation + * property list + * + * \dcpl_id{plist_id} + * \param[out] opts Edge chunk option flag. Valid values are described in + * H5Pset_chunk_opts(). The option status can be + * retrieved using the bitwise AND operator ( & ). For + * example, the expression + * (opts&#H5D_CHUNK_DONT_FILTER_PARTIAL_CHUNKS) will + * evaluate to #H5D_CHUNK_DONT_FILTER_PARTIAL_CHUNKS if + * that option has been enabled. Otherwise, it will + * evaluate to 0 (zero). + * + * \return \herr_t + * + * \details H5Pget_chunk_opts() retrieves the edge chunk option setting + * stored in the dataset creation property list \p plist_id. + * + * \since 1.10.0 + * + */ +H5_DLL herr_t H5Pget_chunk_opts(hid_t plist_id, unsigned *opts); +/** + *------------------------------------------------------------------------- + * + * \ingroup DCPL + * + * \brief Retrieves the time when fill values are written to a dataset + * + * \dcpl_id{plist_id} + * \param[out] fill_time Setting for the timing of writing fill values to + * the dataset + * + * \return \herr_t + * + * \details H5Pget_fill_time() examines the dataset creation property list + * \p plist_id to determine when fill values are to be written to + * a dataset. Valid values returned in \p fill_time are as + * follows: + * + * + * + * + * + * + * + * + * + * + * + * + * + * + *
#H5D_FILL_TIME_IFSETFill values are written to the dataset when storage + * space is allocated only if there is a user-defined fill + * value, i.e., one set with H5Pset_fill_value(). (Default) + *
#H5D_FILL_TIME_ALLOCFill values are written to the dataset when storage + * space is allocated.
#H5D_FILL_TIME_NEVERFill values are never written to the dataset.
+ * + * \note H5Pget_fill_time() is designed to work in coordination with the + * dataset fill value and dataset storage allocation time properties, + * retrieved with the functions H5Pget_fill_value() and + * H5Pget_alloc_time(). + * + * \since 1.6.0 + * + */ +H5_DLL herr_t H5Pget_fill_time(hid_t plist_id, H5D_fill_time_t + *fill_time/*out*/); +/** + *------------------------------------------------------------------------- + * + * \ingroup DCPL + * + * \brief Retrieves a dataset fill value + * + * \dcpl_id{plist_id} + * \param[in] type_id Datatype identifier for the value passed via + * \p value + * \param[out] value Pointer to buffer to contain the returned + * fill value + * + * \return \herr_t + * + * \details H5Pget_fill_value() returns the dataset fill value defined in + * the dataset creation property list \p plist_id. The fill value + * is returned through the \p value pointer and will be converted + * to the datatype specified by \p type_id. This datatype may + * differ from the fill value datatype in the property list, but + * the HDF5 library must be able to convert between the two + * datatypes. + * + * If the fill value is undefined, i.e., set to NULL in the + * property list, H5Pget_fill_value() will return an error. + * H5Pfill_value_defined() should be used to check for this + * condition before H5Pget_fill_value() is called. + * + * Memory must be allocated by the calling application. + * + * \note H5Pget_fill_value() is designed to coordinate with the dataset + * storage allocation time and fill value write time properties, + * which can be retrieved with the functions H5Pget_alloc_time() + * and H5Pget_fill_time(), respectively. + * + * \since 1.0.0 + * + */ +H5_DLL herr_t H5Pget_fill_value(hid_t plist_id, hid_t type_id, + void *value/*out*/); +/** + *------------------------------------------------------------------------- + * \ingroup DCPL + * + * \brief Returns the layout of the raw data for a dataset + * + * \dcpl_id{plist_id} + * + * \return Returns the layout type (a non-negative value) of a dataset + * creation property list if successful. Valid return values are: + * - #H5D_COMPACT: Raw data is stored in the object header in the + * file. + * - #H5D_CONTIGUOUS: Raw data is stored separately from the object + * header in one contiguous chunk in the file. + * - #H5D_CHUNKED: Raw data is stored separately from the object + * header in chunks in separate locations in the + * file. + * - #H5D_VIRTUAL: Raw data is drawn from multiple datasets in + * different files. + * \return + * Otherwise, returns a negative value indicating failure. + * + * \details H5Pget_layout() returns the layout of the raw data for a + * dataset. This function is only valid for dataset creation + * property lists. + * + * Note that a compact storage layout may affect writing data to + * the dataset with parallel applications. See the H5Dwrite() + * documentation for details. + * + * \version 1.10.0 #H5D_VIRTUAL added in this release. + * + * \since 1.0.0 + * + */ H5_DLL H5D_layout_t H5Pget_layout(hid_t plist_id); -H5_DLL herr_t H5Pset_chunk(hid_t plist_id, int ndims, const hsize_t dim[/*ndims*/]); -H5_DLL int H5Pget_chunk(hid_t plist_id, int max_ndims, hsize_t dim[] /*out*/); +/** + *------------------------------------------------------------------------- + * \ingroup DCPL + * + * \brief Sets the size of the chunks used to store a chunked layout + * dataset + * + * \dcpl_id{plist_id} + * \param[in] ndims The number of dimensions of each chunk + * \param[in] dim An array defining the size, in dataset elements, of + * each chunk + * + * \return \herr_t + * \details H5Pset_chunk() sets the size of the chunks used to store a + * chunked layout dataset. This function is only valid for dataset + * creation property lists. + * + * The \p ndims parameter currently must be the same size as the + * rank of the dataset. + * + * The values of the \p dim array define the size of the chunks + * to store the dataset's raw data. The unit of measure for \p dim + * values is dataset elements. + * + * As a side-effect of this function, the layout of the dataset is + * changed to #H5D_CHUNKED, if it is not already so set. + * + * \note Chunk size cannot exceed the size of a fixed-size dataset. For + * example, a dataset consisting of a 5x4 fixed-size array cannot be + * defined with 10x10 chunks. Chunk maximums: + * - The maximum number of elements in a chunk is 232-1 which + * is equal to 4,294,967,295. If the number of elements in a chunk is + * set via H5Pset_chunk() to a value greater than 232-1, + * then H5Pset_chunk() will fail. + * - The maximum size for any chunk is 4GB. If a chunk that is larger + * than 4GB attempts to be written with H5Dwrite(), then H5Dwrite() + * will fail. + * + * \see H5Pset_layout(), H5Dwrite() + * + * \since 1.0.0 + * + */ +H5_DLL herr_t H5Pset_chunk(hid_t plist_id, int ndims, const hsize_t dim[/*ndims*/]); +/** + *------------------------------------------------------------------------- + * + * \ingroup DCPL + * + * \brief Sets the edge chunk option in a dataset creation property list + * + * \dcpl_id{plist_id} + * \param[in] opts Edge chunk option flag. Valid values are: + * \li #H5D_CHUNK_DONT_FILTER_PARTIAL_CHUNKS + * When enabled, filters are not applied to partial + * edge chunks. When disabled, partial edge chunks are + * filtered. Enabling this option will improve + * performance when appending to the dataset and, when + * compression filters are used, prevent reallocation + * of these chunks. Datasets created with this option + * enabled will be inaccessible with HDF5 library + * versions before Release 1.10. Default: \e Disabled + * \li 0 (zero) Disables option; partial edge chunks + * will be compressed. + * + * \return \herr_t + * + * \details H5Pset_chunk_opts() sets the edge chunk option in the + * dataset creation property list \p dcpl_id. + * + * The available option is detailed in the parameters section. + * Only chunks that are not completely filled by the dataset’s + * dataspace are affected by this option. Such chunks are + * referred to as partial edge chunks. + * + * \note \b Motivation: H5Pset_chunk_opts() is used to specify storage + * options for chunks on the edge of a dataset’s dataspace. This + * capability allows the user to tune performance in cases where + * the dataset size may not be a multiple of the chunk size and + * the handling of partial edge chunks can impact performance. + * + * \since 1.10.0 + * + */ +H5_DLL herr_t H5Pset_chunk_opts(hid_t plist_id, unsigned opts); +/** + *------------------------------------------------------------------------- + * + * \ingroup DCPL + * + * \brief Sets the time when fill values are written to a dataset + * + * \dcpl_id{plist_id} + * \param[in] fill_time When to write fill values to a dataset + * + * \return \herr_t + * + * \details H5Pset_fill_time() sets up the timing for writing fill values + * to a dataset. This property is set in the dataset creation + * property list \p plist_id. Timing is specified in \p fill_time + * with one of the following values: + * + * + * + * + * + * + * + * + * + * + * + * + * + * + *
#H5D_FILL_TIME_IFSETWrite fill values to the dataset when storage space is + * allocated only if there is a user-defined fill value, + * i.e.,one set with H5Pset_fill_value(). (Default)
#H5D_FILL_TIME_ALLOCWrite fill values to the dataset when storage space is + * allocated.
#H5D_FILL_TIME_NEVERNever write fill values to the dataset.
+ * + * \note H5Pset_fill_time() is designed for coordination with the dataset + * fill value and dataset storage allocation time properties, set + * with the functions H5Pset_fill_value() and H5Pset_alloc_time(). + * See H5Dcreate() for further cross-references. + * + * \since 1.6.0 + * + */ +H5_DLL herr_t H5Pset_fill_time(hid_t plist_id, H5D_fill_time_t fill_time); +/** + *------------------------------------------------------------------------- + * + * \ingroup DCPL + * + * \brief Sets the fill value for a dataset + * + * \dcpl_id{plist_id} + * \param[in] type_id Datatype of \p value + * \param[in] value Pointer to buffer containing value to use as + * fill value + * + * \return \herr_t + * + * \details H5Pset_fill_value() sets the fill value for a dataset in the + * dataset creation property list. \p value is interpreted as + * being of datatype \p type_id. This datatype may differ from + * that of the dataset, but the HDF5 library must be able to + * convert \p value to the dataset datatype when the dataset is + * created. + * + * The default fill value is 0 (zero), which is interpreted + * according to the actual dataset datatype. + * + * Setting \p value to NULL indicates that the fill value is to + * be undefined. + * + * \note Applications sometimes write data only to portions of an allocated + * dataset. It is often useful in such cases to fill the unused space + * with a known fill value. This function allows the user application + * to set that fill value; the functions H5Dfill() and + * H5Pset_fill_time(), respectively, provide the ability to apply the + * fill value on demand or to set up its automatic application. + * + * \note A fill value should be defined so that it is appropriate for the + * application. While the HDF5 default fill value is 0 (zero), it is + * often appropriate to use another value. It might be useful, for + * example, to use a value that is known to be impossible for the + * application to legitimately generate. + * + * \note H5Pset_fill_value() is designed to work in concert with + * H5Pset_alloc_time() and H5Pset_fill_time(). H5Pset_alloc_time() + * and H5Pset_fill_time() govern the timing of dataset storage + * allocation and fill value write operations and can be important in + * tuning application performance. + * + * \note See H5Dcreate() for further cross-references. + * + * \since 1.0.0 + * + */ +H5_DLL herr_t H5Pset_fill_value(hid_t plist_id, hid_t type_id, + const void *value); +/** + *------------------------------------------------------------------------- + * + * \ingroup DCPL + * + * \brief Sets up use of the shuffle filter + * + * \dcpl_id{plist_id} + * + * \return \herr_t + * + * \details H5Pset_shuffle() sets the shuffle filter, #H5Z_FILTER_SHUFFLE, + * in the dataset creation property list \p plist_id. The shuffle + * filter de-interlaces a block of data by reordering the bytes. + * All the bytes from one consistent byte position of each data + * element are placed together in one block; all bytes from a + * second consistent byte position of each data element are placed + * together a second block; etc. For example, given three data + * elements of a 4-byte datatype stored as 012301230123, shuffling + * will re-order data as 000111222333. This can be a valuable step + * in an effective compression algorithm because the bytes in each + * byte position are often closely related to each other and + * putting them together can increase the compression ratio. + * + * As implied above, the primary value of the shuffle filter lies + * in its coordinated use with a compression filter; it does not + * provide data compression when used alone. When the shuffle + * filter is applied to a dataset immediately prior to the use of + * a compression filter, the compression ratio achieved is often + * superior to that achieved by the use of a compression filter + * without the shuffle filter. + * + * \since 1.6.0 + * + */ +H5_DLL herr_t H5Pset_shuffle(hid_t plist_id); +/** + *------------------------------------------------------------------------- + * \ingroup DCPL + * + * \brief Sets the type of storage used to store the raw data for a dataset + * + * \dcpl_id{plist_id} + * \param[in] layout Type of storage layout for raw data + * + * \return \herr_t + * \details H5Pset_layout() sets the type of storage used to store the raw + * data for a dataset. This function is only valid for dataset + * creation property lists. + * + * Valid values for \p layout are: + * - #H5D_COMPACT: Store raw data in the dataset object header + * in file. This should only be used for datasets + * with small amounts of raw data. The raw data + * size limit is 64K (65520 bytes). Attempting + * to create a dataset with raw data larger than + * this limit will cause the H5Dcreate() call to + * fail. + * - #H5D_CONTIGUOUS: Store raw data separately from the object + * header in one large chunk in the file. + * - #H5D_CHUNKED: Store raw data separately from the object header + * as chunks of data in separate locations in + * the file. + * - #H5D_VIRTUAL: Draw raw data from multiple datasets in + * different files. + * + * Note that a compact storage layout may affect writing data to + * the dataset with parallel applications. See the note in + * H5Dwrite() documentation for details. + * \version 1.10.0 #H5D_VIRTUAL added in this release. + * \since 1.0.0 + * + */ +H5_DLL herr_t H5Pset_layout(hid_t plist_id, H5D_layout_t layout); +/** + *------------------------------------------------------------------------- + * \ingroup DCPL + * + * \brief Sets up use of the SZIP compression filter + * + * \dcpl_id{plist_id} + * \param[in] options_mask A bit-mask conveying the desired SZIP options; + * Valid values are #H5_SZIP_EC_OPTION_MASK and + * #H5_SZIP_NN_OPTION_MASK. + * \param[in] pixels_per_block The number of pixels or data elements in each + * data block + * + * \return \herr_t + * + * \details H5Pset_szip() sets an SZIP compression filter, #H5Z_FILTER_SZIP, + * for a dataset. SZIP is a compression method designed for use with + * scientific data. + * + * Before proceeding, all users should review the “Limitations” + * section below. + * + * Users familiar with SZIP outside the HDF5 context may benefit + * from reviewing the Note “For Users Familiar with SZIP in Other + * Contexts” below. + * + * In the text below, the term pixel refers to an HDF5 data element. + * This terminology derives from SZIP compression's use with image + * data, where pixel referred to an image pixel. + * + * The SZIP \p bits_per_pixel value (see Note, below) is automatically + * set, based on the HDF5 datatype. SZIP can be used with atomic + * datatypes that may have size of 8, 16, 32, or 64 bits. + * Specifically, a dataset with a datatype that is 8-, 16-, 32-, or + * 64-bit signed or unsigned integer; char; or 32- or 64-bit float + * can be compressed with SZIP. See Note, below, for further + * discussion of the the SZIP \p bits_per_pixel setting. + * + * SZIP options are passed in an options mask, \p options_mask, + * as follows. + * + * + * + * + * + * + * + * + * + * + * + * + * + * + *
OptionDescription (Mutually exclusive; select one.)
#H5_SZIP_EC_OPTION_MASKSelects entropy coding method
#H5_SZIP_NN_OPTION_MASKSelects nearest neighbor coding method
+ * + * The following guidelines can be used in determining which + * option to select: + * + * - The entropy coding method, the EC option specified by + * #H5_SZIP_EC_OPTION_MASK, is best suited for data that has been + * processed. The EC method works best for small numbers. + * - The nearest neighbor coding method, the NN option specified + * by #H5_SZIP_NN_OPTION_MASK, preprocesses the data then the + * applies EC method as above. + * + * Other factors may affect results, but the above criteria + * provides a good starting point for optimizing data compression. + * + * SZIP compresses data block by block, with a user-tunable block + * size. This block size is passed in the parameter + * \p pixels_per_block and must be even and not greater than 32, + * with typical values being 8, 10, 16, or 32. This parameter + * affects compression ratio; the more pixel values vary, the + * smaller this number should be to achieve better performance. + * + * In HDF5, compression can be applied only to chunked datasets. + * If \p pixels_per_block is bigger than the total number of + * elements in a dataset chunk, H5Pset_szip() will succeed but + * the subsequent call to H5Dcreate() will fail; the conflict + * can be detected only when the property list is used. + * + * To achieve optimal performance for SZIP compression, it is + * recommended that a chunk's fastest-changing dimension be equal + * to N times \p pixels_per_block where N is the maximum number of + * blocks per scan line allowed by the SZIP library. In the + * current version of SZIP, N is set to 128. + * + * SZIP compression is an optional HDF5 filter. + * + * \b Limitations: + * + * - SZIP compression cannot be applied to compound, array, + * variable-length, enumeration, or any other user-defined + * datatypes. If an SZIP filter is set in a dataset creation + * property list used to create a dataset containing a + * non-allowed datatype, the call to H5Dcreate() will fail; the + * conflict can be detected only when the property list is used. + * - Users should be aware that there are factors that affect one’s + * rights and ability to use SZIP compression by reviewing the + * SZIP copyright notice. + * + * \note \b For \b Users \b Familiar \b with \b SZIP \b in \b Other \b Contexts: + * + * \note The following notes are of interest primarily to those who have + * used SZIP compression outside of the HDF5 context. + * In non-HDF5 applications, SZIP typically requires that the user + * application supply additional parameters: + * - \p pixels_in_object, the number of pixels in the object to + * be compressed + * - \p bits_per_pixel, the number of bits per pixel + * - \p pixels_per_scanline, the number of pixels per scan line + * + * \note These values need not be independently supplied in the HDF5 + * environment as they are derived from the datatype and dataspace, + * which are already known. In particular, HDF5 sets + * \p pixels_in_object to the number of elements in a chunk and + * \p bits_per_pixel to the size of the element or pixel datatype. + * + * \note The following algorithm is used to set \p pixels_per_scanline: + * - If the size of a chunk's fastest-changing dimension, size, + * is greater than 4K, set \p pixels_per_scanline to 128 times + * \p pixels_per_block. + * - If size is less than 4K but greater than \p pixels_per_block, + * set \p pixels_per_scanline to the minimum of size and 128 + * times \p pixels_per_block. + * - If size is less than \p pixels_per_block but greater than the + * number elements in the chunk, set \p pixels_per_scanline to + * the minimum of the number elements in the chunk and 128 times + * \p pixels_per_block. + * + * \note The HDF5 datatype may have precision that is less than the full + * size of the data element, e.g., an 11-bit integer can be defined + * using H5Tset_precision(). To a certain extent, SZIP can take + * advantage of the precision of the datatype to improve compression: + * - If the HDF5 datatype size is 24-bit or less and the offset of + * the bits in the HDF5 datatype is zero (see H5Tset_offset() or + * H5Tget_offset()), the data is the in lowest N bits of the data + * element. In this case, the SZIP \p bits_per_pixel is set to the + * precision of the HDF5 datatype. + * - If the offset is not zero, the SZIP \p bits_per_pixel will be + * set to the number of bits in the full size of the data element. + * - If the HDF5 datatype precision is 25-bit to 32-bit, the SZIP + * \p bits_per_pixel will be set to 32. + * - If the HDF5 datatype precision is 33-bit to 64-bit, the SZIP + * \p bits_per_pixel will be set to 64. + * + * \note HDF5 always modifies the options mask provided by the user to set up + * usage of RAW_OPTION_MASK, ALLOW_K13_OPTION_MASK, and one of + * LSB_OPTION_MASK or MSB_OPTION_MASK, depending on endianness of the + * datatype. + * + * \since 1.6.0 + * + *-------------------------------------------------------------------------- + */ +H5_DLL herr_t H5Pset_szip(hid_t plist_id, unsigned options_mask, unsigned pixels_per_block); H5_DLL herr_t H5Pset_virtual(hid_t dcpl_id, hid_t vspace_id, const char *src_file_name, const char *src_dset_name, hid_t src_space_id); H5_DLL herr_t H5Pget_virtual_count(hid_t dcpl_id, size_t *count /*out*/); @@ -391,22 +1182,14 @@ H5_DLL hid_t H5Pget_virtual_srcspace(hid_t dcpl_id, size_t index); H5_DLL ssize_t H5Pget_virtual_filename(hid_t dcpl_id, size_t index, char *name /*out*/, size_t size); H5_DLL ssize_t H5Pget_virtual_dsetname(hid_t dcpl_id, size_t index, char *name /*out*/, size_t size); H5_DLL herr_t H5Pset_external(hid_t plist_id, const char *name, off_t offset, hsize_t size); -H5_DLL herr_t H5Pset_chunk_opts(hid_t plist_id, unsigned opts); -H5_DLL herr_t H5Pget_chunk_opts(hid_t plist_id, unsigned *opts); H5_DLL int H5Pget_external_count(hid_t plist_id); H5_DLL herr_t H5Pget_external(hid_t plist_id, unsigned idx, size_t name_size, char *name /*out*/, off_t *offset /*out*/, hsize_t *size /*out*/); -H5_DLL herr_t H5Pset_szip(hid_t plist_id, unsigned options_mask, unsigned pixels_per_block); -H5_DLL herr_t H5Pset_shuffle(hid_t plist_id); H5_DLL herr_t H5Pset_nbit(hid_t plist_id); H5_DLL herr_t H5Pset_scaleoffset(hid_t plist_id, H5Z_SO_scale_type_t scale_type, int scale_factor); -H5_DLL herr_t H5Pset_fill_value(hid_t plist_id, hid_t type_id, const void *value); -H5_DLL herr_t H5Pget_fill_value(hid_t plist_id, hid_t type_id, void *value /*out*/); H5_DLL herr_t H5Pfill_value_defined(hid_t plist, H5D_fill_value_t *status); H5_DLL herr_t H5Pset_alloc_time(hid_t plist_id, H5D_alloc_time_t alloc_time); H5_DLL herr_t H5Pget_alloc_time(hid_t plist_id, H5D_alloc_time_t *alloc_time /*out*/); -H5_DLL herr_t H5Pset_fill_time(hid_t plist_id, H5D_fill_time_t fill_time); -H5_DLL herr_t H5Pget_fill_time(hid_t plist_id, H5D_fill_time_t *fill_time /*out*/); H5_DLL herr_t H5Pget_dset_no_attrs_hint(hid_t dcpl_id, hbool_t *minimize); H5_DLL herr_t H5Pset_dset_no_attrs_hint(hid_t dcpl_id, hbool_t minimize); @@ -526,6 +1309,59 @@ H5_DLL herr_t H5Pinsert1(hid_t plist_id, const char *name, size_t size, vo H5P_prp_delete_func_t prp_delete, H5P_prp_copy_func_t prp_copy, H5P_prp_close_func_t prp_close); H5_DLL herr_t H5Pencode1(hid_t plist_id, void *buf, size_t *nalloc); +/** + *------------------------------------------------------------------------- + * \ingroup OCPL + * + * \brief Returns information about a filter in a pipeline (DEPRECATED) + * + * \todo H5Pget_filter1() prototype does not match source in H5Pocpl.c. + * Also, it is not in a deprecated file. Is that okay? + * + * \plist_id{plist_id} + * \param[in] filter Sequence number within the filter pipeline of the filter + * for which information is sought + * \param[out] flags Bit vector specifying certain general properties of + * the filter + * \param[in,out] cd_nelmts Number of elements in \p cd_values + * \param[out] cd_values Auxiliary data for the filter + * \param[in] namelen Anticipated number of characters in \p name + * \param[out] name Name of the filter + * + * \return Returns the filter identifier if successful; Otherwise returns + * a negative value. See: #H5Z_filter_t + * + * \details H5Pget_filter1() returns information about a filter, specified + * by its filter number, in a filter pipeline, specified by the + * property list with which it is associated. + * + * \p plist_id must be a dataset or group creation property list. + * + * \p filter is a value between zero and N-1, as described in + * H5Pget_nfilters(). The function will return a negative value + * if the filter number is out of range. + * + * The structure of the \p flags argument is discussed in + * H5Pset_filter(). + * + * On input, \p cd_nelmts indicates the number of entries in the + * \p cd_values array, as allocated by the caller; on return, + * \p cd_nelmts contains the number of values defined by the filter. + * + * If \p name is a pointer to an array of at least \p namelen + * bytes, the filter name will be copied into that array. The name + * will be null terminated if \p namelen is large enough. The + * filter name returned will be the name appearing in the file, the + * name registered for the filter, or an empty string. + * + * \version 1.8.5 Function extended to work with group creation property + * lists. + * \version 1.8.0 N-bit and scale-offset filters added. + * \version 1.8.0 Function H5Pget_filter() renamed to H5Pget_filter1() and + * deprecated in this release. + * \version 1.6.4 \p filter parameter type changed to unsigned. + * + */ H5_DLL H5Z_filter_t H5Pget_filter1(hid_t plist_id, unsigned filter, unsigned int *flags /*out*/, size_t *cd_nelmts /*out*/, unsigned cd_values[] /*out*/, size_t namelen, char name[]); diff --git a/src/H5Smodule.h b/src/H5Smodule.h index 11494ee2b91..6e8208bc1c9 100644 --- a/src/H5Smodule.h +++ b/src/H5Smodule.h @@ -29,4 +29,31 @@ #define H5_MY_PKG_ERR H5E_DATASPACE #define H5_MY_PKG_INIT YES +/**\defgroup H5S H5S + * \brief Dataspace Interface + * + * \details The Dataspace Interface provides functions for creating and + * working with dataspaces. + * + * A dataspace has two roles: + * + * \li It contains the spatial information (logical layout) of a + * dataset stored in a file. + * \li It describes an application’s data buffers and data elements + * participating in I/O. In other words, it can be used to + * select a portion or subset of a dataset. + * + * The spatial information of a dataset in a file includes the + * rank and dimensions of the dataset, which are a permanent part + * of the dataset definition. It can have dimensions that are fixed + * (unchanging) or unlimited, which means they can grow in size + * (or are extendible). + * + * A dataspace can consist of: + * \li no elements (NULL) + * \li a single element (scalar), or + * \li a simple array. + * + */ + #endif /* _H5Smodule_H */ diff --git a/src/H5Spublic.h b/src/H5Spublic.h index f0aa6dc11f5..c16af9332d4 100644 --- a/src/H5Spublic.h +++ b/src/H5Spublic.h @@ -120,17 +120,288 @@ typedef enum { extern "C" { #endif -/* Operations on dataspaces */ +/* Operations on dataspaces and dataspace selections */ + +/** + * \ingroup H5S + * + * \brief Releases and terminates access to a dataspace + * + * \space_id + * + * \return \herr_t + * + * \details H5Sclose() releases a dataspace. Further access through the + * dataspace identifier is illegal. Failure to release a dataspace with this + * call will result in resource leaks. + * + * \version 1.4.0 Fortran subroutine introduced in this release. + * \since 1.0.0 + * + */ +H5_DLL herr_t H5Sclose(hid_t space_id); +/** + * \ingroup H5S + * + * \brief Creates a new dataspace of a specified type + * + * \param[in] type Type of dataspace to be created + * + * \return \hid_t{dataspace} + * + * \details H5Screate() creates a new dataspace of a particular type. Currently + * supported types are #H5S_SCALAR, #H5S_SIMPLE, and #H5S_NULL. + * + * Further dataspace types may be added later. + * + * A scalar dataspace, #H5S_SCALAR, has a single element, though that + * element may be of a complex datatype, such as a compound or array + * datatype. By convention, the rank of a scalar dataspace is always \p 0 + * (zero); think of it geometrically as a single, dimensionless point, + * though that point can be complex. + * + * A simple dataspace, #H5S_SIMPLE, consists of a regular array of elements. + * + * A null dataspace, #H5S_NULL, has no data elements. + * + * The dataspace identifier returned by this function can be released with + * H5Sclose() so that resource leaks will not occur. + * + * \version 1.4.0 Fortran subroutine introduced. + * \since 1.0.0 + * + */ H5_DLL hid_t H5Screate(H5S_class_t type); +/** + * \ingroup H5S + * \brief Creates a new simple dataspace and opens it for access + * + * \param[in] rank Number of dimensions of dataspace + * \param[in] dims Array specifying the size of each dimension + * \param[in] maxdims Array specifying the maximum size of each dimension + * + * \return \hid_t{dataspace} + * + * \details H5Screate_simple() creates a new simple dataspace and opens it + * for access, returning a dataspace identifier. + * + * \p rank is the number of dimensions used in the dataspace. + * + * \p dims is a one-dimensional array of size rank specifying the + * size of each dimension of the dataset. \p maxdims is an array of the + * same size specifying the upper limit on the size of each dimension. + * + * Any element of \p dims can be \p 0 (zero). Note that no data can + * be written to a dataset if the size of any dimension of its current + * dataspace is \p 0. This is sometimes a useful initial state for a dataset. + * + * \p maxdims may be the null pointer, in which case the upper limit is + * the same as \p dims. Otherwise, no element of \p maxdims + * should be smaller than the corresponding element of \p dims. + * + * If an element of \p maxdims is #H5S_UNLIMITED, the maximum size of the + * corresponding dimension is unlimited. + * + * Any dataset with an unlimited dimension must also be chunked; see + * H5Pset_chunk(). Similarly, a dataset must be chunked if \p dims does + * not equal \p maxdims. + * + * The dataspace identifier returned from this function must be released with + * H5Sclose() or resource leaks will occur. + * + * \note Once a dataspace has been created, specific regions or elements in + * the dataspace can be selected and selections can be removed, as well. + * For example, H5Sselect_hyperslab() selects a region in a dataspace and + * H5Sselect_elements() selects array elements in a dataspace. These + * functions are used for subsetting. H5Sselect_none() removes all + * selections from a dataspace and is used in Parallel HDF5 when a process + * does not have or need to write data. + * + * \version 1.4.0 Fortran subroutine introduced. + * + * \since 1.0.0 + * + */ H5_DLL hid_t H5Screate_simple(int rank, const hsize_t dims[], const hsize_t maxdims[]); +/*--------------------------------------------------------------------------*/ +/**\ingroup H5S + * + * \brief Determines the number of elements in a dataspace selection + * + * \space_id{spaceid} + * + * \return Returns the number of elements in the selection if successful; + * otherwise returns a negative value. + * + * \details H5Sget_select_npoints() determines the number of elements in + * the current selection of a dataspace. It works with any + * selection type, and is the correct way to retrieve the number + * of elements in a selection. + * + * \version 1.4.0 Fortran subroutine introduced in this release. + * \since 1.0.0 + * + */ +H5_DLL hssize_t H5Sget_select_npoints(hid_t spaceid); +/*-------------------------------------------------------------------------*/ +/**\ingroup H5S + * + * \brief Retrieves dataspace dimension size and maximum size + * + * \space_id + * \param[out] dims Pointer to array to store the size of each dimension + * \param[out] maxdims Pointer to array to store the maximum size of each + * dimension + * + * \return Returns the number of dimensions in the dataspace if successful; + * otherwise returns a negative value. + * + * \details H5Sget_simple_extent_dims() returns the size and maximum sizes + * of each dimension of a dataspace \p space_id through the \p dims + * and \p maxdims parameters. + * + * Either or both of \p dims and \p maxdims may be NULL. + * + * If a value in the returned array \p maxdims is #H5S_UNLIMITED (-1), + * the maximum size of that dimension is unlimited. + * + * \version 1.4.0 Fortran subroutine introduced. + * \since 1.0.0 + * + */ +H5_DLL int H5Sget_simple_extent_dims(hid_t space_id, hsize_t dims[], + hsize_t maxdims[]); +/*-------------------------------------------------------------------------*/ +/**\ingroup H5S + * + * \brief Determines the dimensionality of a dataspace + * + * \space_id + * + * \return Returns the number of dimensions in the dataspace if successful; + * otherwise returns a negative value. + * + * \details H5Sget_simple_extent_ndims() determines the dimensionality (or + * rank) of a dataspace. + * + * \version 1.4.0 Fortran subroutine introduced. + * \since 1.0.0 + * + */ +H5_DLL int H5Sget_simple_extent_ndims(hid_t space_id); +/*--------------------------------------------------------------------------*/ +/**\ingroup H5S + * + * \brief Selects a hyperslab region to add to the current selected region + * + * \space_id + * \param[in] op Operation to perform on current selection + * \param[in] start Offset of start of hyperslab + * \param[in] stride Hyperslab stride + * \param[in] count Number of blocks included in hyperslab + * \param[in] block Size of block in hyperslab + * + * \return \herr_t + * + * \details H5Sselect_hyperslab() selects a hyperslab region to add to the + * current selected region for the dataspace specified by + * \p space_id. + * + * The \p start, \p stride, \p count, and \p block arrays must be the + * same size as the rank of the dataspace. For example, if the + * dataspace is 4-dimensional, each of these parameters must be a + * 1-dimensional array of size 4. + * + * The selection operator \p op determines how the new selection + * is to be combined with the already existing selection for the + * dataspace. The following operators are supported: + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + *
#H5S_SELECT_SETReplaces the existing selection with the + * parameters from this call. Overlapping blocks + * are not supported with this operator.
#H5S_SELECT_ORAdds the new selection to the existing selection. + * (Binary OR)
#H5S_SELECT_ANDRetains only the overlapping portions of the + * new selection and the existing selection. + * (Binary AND)
#H5S_SELECT_XORRetains only the elements that are members of + * the new selection or the existing selection, + * excluding elements that are members of both + * selections. (Binary exclusive-OR, XOR) + *
#H5S_SELECT_NOTBRetains only elements of the existing selection + * that are not in the new selection.
#H5S_SELECT_NOTARetains only elements of the new selection that + * are not in the existing selection.
+ * + * The \p start array specifies the offset of the starting element + * of the specified hyperslab. + * + * The \p stride array chooses array locations from the dataspace with + * each value in the \p stride array determining how many elements to + * move in each dimension. Setting a value in the \p stride array to + * \p 1 moves to each element in that dimension of the dataspace; + * setting a value of \p 2 in allocation in the \p stride array moves + * to every other element in that dimension of the dataspace. In + * other words, the \p stride determines the number of elements to + * move from the \p start location in each dimension. Stride values + * of \p 0 are not allowed. If the \p stride parameter is NULL, a + * contiguous hyperslab is selected (as if each value in the \p stride + * array were set to \p 1). + * + * The \p count array determines how many blocks to select from the + * dataspace, in each dimension. + * + * The \p block array determines the size of the element block + * selected from the dataspace. If the \p block parameter is set to + * NULL, the block size defaults to a single element in each dimension + * (as if each value in the \p block array were set to \p 1). + * + * For example, consider a 2-dimensional dataspace with hyperslab + * selection settings as follows: the \p start offset is specified as + * [1,1], \p stride is [4,4], \p count is [3,7], and \p block is [2,2]. + * In C, these settings will specify a hyperslab consisting of 21 + * 2x2 blocks of array elements starting with location (1,1) with the + * selected blocks at locations (1,1), (5,1), (9,1), (1,5), (5,5), etc.; + * in Fortran, they will specify a hyperslab consisting of 21 2x2 + * blocks of array elements starting with location (2,2) with the + * selected blocks at locations (2,2), (6,2), (10,2), (2,6), (6,6), etc. + * + * Regions selected with this function call default to C order + * iteration when I/O is performed. + * + * \version 1.4.0 Fortran subroutine introduced in this release. + * \since 1.0.0 + * + */ +H5_DLL herr_t H5Sselect_hyperslab(hid_t space_id, H5S_seloper_t op, + const hsize_t start[], const hsize_t stride[], const hsize_t count[], + const hsize_t block[]); H5_DLL herr_t H5Sset_extent_simple(hid_t space_id, int rank, const hsize_t dims[], const hsize_t max[]); H5_DLL hid_t H5Scopy(hid_t space_id); -H5_DLL herr_t H5Sclose(hid_t space_id); H5_DLL herr_t H5Sencode2(hid_t obj_id, void *buf, size_t *nalloc, hid_t fapl); H5_DLL hid_t H5Sdecode(const void *buf); H5_DLL hssize_t H5Sget_simple_extent_npoints(hid_t space_id); -H5_DLL int H5Sget_simple_extent_ndims(hid_t space_id); -H5_DLL int H5Sget_simple_extent_dims(hid_t space_id, hsize_t dims[], hsize_t maxdims[]); H5_DLL htri_t H5Sis_simple(hid_t space_id); H5_DLL H5S_class_t H5Sget_simple_extent_type(hid_t space_id); H5_DLL herr_t H5Sset_extent_none(hid_t space_id); @@ -139,7 +410,6 @@ H5_DLL htri_t H5Sextent_equal(hid_t sid1, hid_t sid2); /* Operations on dataspace selections */ H5_DLL H5S_sel_type H5Sget_select_type(hid_t spaceid); -H5_DLL hssize_t H5Sget_select_npoints(hid_t spaceid); H5_DLL herr_t H5Sselect_copy(hid_t dst_id, hid_t src_id); H5_DLL htri_t H5Sselect_valid(hid_t spaceid); H5_DLL herr_t H5Sselect_adjust(hid_t spaceid, const hssize_t *offset); @@ -153,8 +423,6 @@ H5_DLL herr_t H5Sselect_elements(hid_t space_id, H5S_seloper_t op, size_t num_ H5_DLL hssize_t H5Sget_select_elem_npoints(hid_t spaceid); H5_DLL herr_t H5Sget_select_elem_pointlist(hid_t spaceid, hsize_t startpoint, hsize_t numpoints, hsize_t buf[/*numpoints*/]); -H5_DLL herr_t H5Sselect_hyperslab(hid_t space_id, H5S_seloper_t op, const hsize_t start[], - const hsize_t _stride[], const hsize_t count[], const hsize_t _block[]); H5_DLL hid_t H5Scombine_hyperslab(hid_t space_id, H5S_seloper_t op, const hsize_t start[], const hsize_t _stride[], const hsize_t count[], const hsize_t _block[]); H5_DLL herr_t H5Smodify_select(hid_t space1_id, H5S_seloper_t op, hid_t space2_id); From 3360ebd93d1f6b796ecfeaa8a7cbd04c0122930c Mon Sep 17 00:00:00 2001 From: Larry Knox Date: Wed, 25 Nov 2020 21:02:02 -0600 Subject: [PATCH 05/21] Add src/H5module.h to MANIFEST. --- MANIFEST | 1 + 1 file changed, 1 insertion(+) diff --git a/MANIFEST b/MANIFEST index 4c2c2c2398d..c78280d51c4 100644 --- a/MANIFEST +++ b/MANIFEST @@ -564,6 +564,7 @@ ./src/H5err.txt ./src/H5detect.c ./src/H5make_libsettings.c +./src/H5module.h ./src/H5mpi.c ./src/H5overflow.txt ./src/H5private.h From 93f4ce1a9eaa362a84a8ff3d30ea587363fc9eee Mon Sep 17 00:00:00 2001 From: "H. Joe Lee" Date: Thu, 17 Dec 2020 15:22:44 -0600 Subject: [PATCH 06/21] close #195. (#196) * Update HDF5PluginMacros.cmake * Update HDF5PluginMacros.cmake --- config/cmake/HDF5PluginMacros.cmake | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/config/cmake/HDF5PluginMacros.cmake b/config/cmake/HDF5PluginMacros.cmake index 3c0e12c1f39..a858353f37f 100644 --- a/config/cmake/HDF5PluginMacros.cmake +++ b/config/cmake/HDF5PluginMacros.cmake @@ -57,8 +57,8 @@ macro (EXTERNAL_PLUGIN_LIBRARY compress_type) endif () if (ENABLE_SZF) add_dependencies (h5szf ${HDF5_LIBSH_TARGET}) - add_dependencies (h5ex_d_szf ${HDF5_LIBSH_TARGET}) - target_include_directories (h5ex_d_szf PRIVATE "${HDF5_SRC_DIR};${HDF5_SRC_BINARY_DIR}") + add_dependencies (h5ex_d_sz ${HDF5_LIBSH_TARGET}) + target_include_directories (h5ex_d_sz PRIVATE "${HDF5_SRC_DIR};${HDF5_SRC_BINARY_DIR}") endif () if (ENABLE_ZFP) add_dependencies (h5zfp ${HDF5_LIBSH_TARGET}) From 16ca6d17469209da9564b85aba94e58b0f073440 Mon Sep 17 00:00:00 2001 From: Quincey Koziol Date: Sat, 19 Dec 2020 12:37:45 -0600 Subject: [PATCH 07/21] Avoid aligned access for references by decoding into temporary buffer and then copying the result into the actual buffer. Update test to be more thorough with using compound datatype fields everywhere. (#206) --- src/H5Rint.c | 4 ++- src/H5Tref.c | 17 ++++++++----- test/trefer.c | 67 ++++++++++++++++++++++++--------------------------- 3 files changed, 46 insertions(+), 42 deletions(-) diff --git a/src/H5Rint.c b/src/H5Rint.c index 60f8131886d..93645a13b97 100644 --- a/src/H5Rint.c +++ b/src/H5Rint.c @@ -1041,12 +1041,13 @@ H5R__decode(const unsigned char *buf, size_t *nbytes, H5R_ref_priv_t *ref) FUNC_ENTER_PACKAGE + /* Sanity checks */ HDassert(buf); HDassert(nbytes); HDassert(ref); - buf_size = *nbytes; /* Don't decode if buffer size isn't big enough */ + buf_size = *nbytes; if (buf_size < H5R_ENCODE_HEADER_SIZE) HGOTO_ERROR(H5E_REFERENCE, H5E_CANTDECODE, FAIL, "Buffer size is too small") @@ -1107,6 +1108,7 @@ H5R__decode(const unsigned char *buf, size_t *nbytes, H5R_ref_priv_t *ref) H5R_LOG_DEBUG("Decoded reference, filename=%s, obj_addr=%s, encode size=%u", ref->info.obj.filename, H5R__print_token(ref->info.obj.token), ref->encode_size); + /* Set output info */ *nbytes = decode_size; done: diff --git a/src/H5Tref.c b/src/H5Tref.c index c71724fdec4..0c17d49acac 100644 --- a/src/H5Tref.c +++ b/src/H5Tref.c @@ -589,6 +589,7 @@ H5T__ref_mem_write(H5VL_object_t *src_file, const void *src_buf, size_t src_size H5F_t * src_f = NULL; hid_t file_id = H5I_INVALID_HID; H5R_ref_priv_t *dst_ref = (H5R_ref_priv_t *)dst_buf; + H5R_ref_priv_t tmp_ref; /* Temporary reference to decode into */ herr_t ret_value = SUCCEED; FUNC_ENTER_STATIC @@ -599,6 +600,7 @@ H5T__ref_mem_write(H5VL_object_t *src_file, const void *src_buf, size_t src_size HDassert(src_size); HDassert(dst_buf); HDassert(dst_size == H5T_REF_MEM_SIZE); + HDcompile_assert(sizeof(*dst_ref) == sizeof(tmp_ref)); /* Memory-to-memory conversion to support vlen conversion */ if (NULL == src_file) { @@ -624,13 +626,13 @@ H5T__ref_mem_write(H5VL_object_t *src_file, const void *src_buf, size_t src_size HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "invalid VOL object") /* Make sure reference buffer is correctly initialized */ - HDmemset(dst_buf, 0, dst_size); + HDmemset(&tmp_ref, 0, sizeof(tmp_ref)); switch (src_type) { case H5R_OBJECT1: { size_t token_size = H5F_SIZEOF_ADDR(src_f); - if (H5R__create_object((const H5O_token_t *)src_buf, token_size, dst_ref) < 0) + if (H5R__create_object((const H5O_token_t *)src_buf, token_size, &tmp_ref) < 0) HGOTO_ERROR(H5E_REFERENCE, H5E_CANTCREATE, FAIL, "unable to create object reference") } break; @@ -638,7 +640,7 @@ H5T__ref_mem_write(H5VL_object_t *src_file, const void *src_buf, size_t src_size const struct H5Tref_dsetreg *src_reg = (const struct H5Tref_dsetreg *)src_buf; size_t token_size = H5F_SIZEOF_ADDR(src_f); - if (H5R__create_region(&src_reg->token, token_size, src_reg->space, dst_ref) < 0) + if (H5R__create_region(&src_reg->token, token_size, src_reg->space, &tmp_ref) < 0) HGOTO_ERROR(H5E_REFERENCE, H5E_CANTCREATE, FAIL, "unable to create region reference") /* create_region creates its internal copy of the space */ @@ -655,7 +657,7 @@ H5T__ref_mem_write(H5VL_object_t *src_file, const void *src_buf, size_t src_size case H5R_OBJECT2: case H5R_ATTR: /* Decode reference */ - if (H5R__decode((const unsigned char *)src_buf, &src_size, dst_ref) < 0) + if (H5R__decode((const unsigned char *)src_buf, &src_size, &tmp_ref) < 0) HGOTO_ERROR(H5E_REFERENCE, H5E_CANTDECODE, FAIL, "Cannot decode reference") break; @@ -667,17 +669,20 @@ H5T__ref_mem_write(H5VL_object_t *src_file, const void *src_buf, size_t src_size } /* end switch */ /* If no filename set, this is not an external reference */ - if (NULL == H5R_REF_FILENAME(dst_ref)) { + if (NULL == H5R_REF_FILENAME(&tmp_ref)) { /* TODO temporary hack to retrieve file object */ if ((file_id = H5F_get_file_id(src_file, H5I_FILE, FALSE)) < 0) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a file or file object") /* Attach loc ID to reference and hold reference to it, this is a * user exposed reference so set app_ref to TRUE. */ - if (H5R__set_loc_id(dst_ref, file_id, TRUE, TRUE) < 0) + if (H5R__set_loc_id(&tmp_ref, file_id, TRUE, TRUE) < 0) HGOTO_ERROR(H5E_REFERENCE, H5E_CANTSET, FAIL, "unable to attach location id to reference") } /* end if */ + /* Set output info */ + HDmemcpy(dst_ref, &tmp_ref, sizeof(tmp_ref)); + done: if ((file_id != H5I_INVALID_HID) && (H5I_dec_ref(file_id) < 0)) HDONE_ERROR(H5E_REFERENCE, H5E_CANTDEC, FAIL, "unable to decrement refcount on location id") diff --git a/test/trefer.c b/test/trefer.c index 530a4091005..496a8f421ea 100644 --- a/test/trefer.c +++ b/test/trefer.c @@ -566,7 +566,7 @@ test_reference_vlen_obj(void) hsize_t vl_dims[] = {1}; hid_t dapl_id; /* Dataset access property list */ H5R_ref_t *wbuf, /* buffer to write to disk */ - *rbuf; /* buffer read from disk */ + *rbuf = NULL; /* buffer read from disk */ unsigned * ibuf, *obuf; unsigned i, j; /* Counters */ H5O_type_t obj_type; /* Object type */ @@ -578,7 +578,6 @@ test_reference_vlen_obj(void) /* Allocate write & read buffers */ wbuf = HDcalloc(sizeof(H5R_ref_t), SPACE1_DIM1); - rbuf = HDcalloc(sizeof(H5R_ref_t), SPACE1_DIM1); ibuf = HDcalloc(sizeof(unsigned), SPACE1_DIM1); obuf = HDcalloc(sizeof(unsigned), SPACE1_DIM1); @@ -832,8 +831,6 @@ test_reference_cmpnd_obj(void) hsize_t dims1[] = {SPACE1_DIM1}; hsize_t cmpnd_dims[] = {1}; hid_t dapl_id; /* Dataset access property list */ - H5R_ref_t *wbuf, /* buffer to write to disk */ - *rbuf; /* buffer read from disk */ unsigned * ibuf, *obuf; unsigned i, j; /* Counters */ H5O_type_t obj_type; /* Object type */ @@ -844,8 +841,6 @@ test_reference_cmpnd_obj(void) MESSAGE(5, ("Testing Object Reference Functions within compound type\n")); /* Allocate write & read buffers */ - wbuf = HDcalloc(sizeof(H5R_ref_t), SPACE1_DIM1); - rbuf = HDcalloc(sizeof(H5R_ref_t), SPACE1_DIM1); ibuf = HDcalloc(sizeof(unsigned), SPACE1_DIM1); obuf = HDcalloc(sizeof(unsigned), SPACE1_DIM1); @@ -946,39 +941,38 @@ test_reference_cmpnd_obj(void) dataset = H5Dcreate2(fid1, "Dataset3", tid1, sid1, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); CHECK(dataset, H5I_INVALID_HID, "H5Dcreate2"); + /* Reset buffer for writing */ + HDmemset(&cmpnd_wbuf, 0, sizeof(cmpnd_wbuf)); + /* Create reference to dataset */ - ret = H5Rcreate_object(fid1, "/Group1/Dataset1", H5P_DEFAULT, &wbuf[0]); + ret = H5Rcreate_object(fid1, "/Group1/Dataset1", H5P_DEFAULT, &cmpnd_wbuf.ref0); CHECK(ret, FAIL, "H5Rcreate_object"); - ret = H5Rget_obj_type3(&wbuf[0], H5P_DEFAULT, &obj_type); + ret = H5Rget_obj_type3(&cmpnd_wbuf.ref0, H5P_DEFAULT, &obj_type); CHECK(ret, FAIL, "H5Rget_obj_type3"); VERIFY(obj_type, H5O_TYPE_DATASET, "H5Rget_obj_type3"); /* Create reference to dataset */ - ret = H5Rcreate_object(fid1, "/Group1/Dataset2", H5P_DEFAULT, &wbuf[1]); + ret = H5Rcreate_object(fid1, "/Group1/Dataset2", H5P_DEFAULT, &cmpnd_wbuf.ref1); CHECK(ret, FAIL, "H5Rcreate_object"); - ret = H5Rget_obj_type3(&wbuf[1], H5P_DEFAULT, &obj_type); + ret = H5Rget_obj_type3(&cmpnd_wbuf.ref1, H5P_DEFAULT, &obj_type); CHECK(ret, FAIL, "H5Rget_obj_type3"); VERIFY(obj_type, H5O_TYPE_DATASET, "H5Rget_obj_type3"); /* Create reference to group */ - ret = H5Rcreate_object(fid1, "/Group1", H5P_DEFAULT, &wbuf[2]); + ret = H5Rcreate_object(fid1, "/Group1", H5P_DEFAULT, &cmpnd_wbuf.ref2); CHECK(ret, FAIL, "H5Rcreate_object"); - ret = H5Rget_obj_type3(&wbuf[2], H5P_DEFAULT, &obj_type); + ret = H5Rget_obj_type3(&cmpnd_wbuf.ref2, H5P_DEFAULT, &obj_type); CHECK(ret, FAIL, "H5Rget_obj_type3"); VERIFY(obj_type, H5O_TYPE_GROUP, "H5Rget_obj_type3"); /* Create reference to named datatype */ - ret = H5Rcreate_object(fid1, "/Group1/Datatype1", H5P_DEFAULT, &wbuf[3]); + ret = H5Rcreate_object(fid1, "/Group1/Datatype1", H5P_DEFAULT, &cmpnd_wbuf.ref3); CHECK(ret, FAIL, "H5Rcreate_object"); - ret = H5Rget_obj_type3(&wbuf[3], H5P_DEFAULT, &obj_type); + ret = H5Rget_obj_type3(&cmpnd_wbuf.ref3, H5P_DEFAULT, &obj_type); CHECK(ret, FAIL, "H5Rget_obj_type3"); VERIFY(obj_type, H5O_TYPE_NAMED_DATATYPE, "H5Rget_obj_type3"); /* Store dimensions */ - cmpnd_wbuf.ref0 = wbuf[0]; - cmpnd_wbuf.ref1 = wbuf[1]; - cmpnd_wbuf.ref2 = wbuf[2]; - cmpnd_wbuf.ref3 = wbuf[3]; cmpnd_wbuf.dim_idx = SPACE1_DIM1; /* Write selection to disk */ @@ -1017,17 +1011,13 @@ test_reference_cmpnd_obj(void) CHECK(ret, FAIL, "H5Dread"); VERIFY(cmpnd_rbuf.dim_idx, SPACE1_DIM1, "H5Dread"); - rbuf[0] = cmpnd_rbuf.ref0; - rbuf[1] = cmpnd_rbuf.ref1; - rbuf[2] = cmpnd_rbuf.ref2; - rbuf[3] = cmpnd_rbuf.ref3; /* Close datatype */ ret = H5Tclose(tid1); CHECK(ret, FAIL, "H5Tclose"); /* Open dataset object */ - dset2 = H5Ropen_object(&rbuf[0], H5P_DEFAULT, dapl_id); + dset2 = H5Ropen_object(&cmpnd_rbuf.ref0, H5P_DEFAULT, dapl_id); CHECK(dset2, H5I_INVALID_HID, "H5Ropen_object"); /* Check information in referenced dataset */ @@ -1049,7 +1039,7 @@ test_reference_cmpnd_obj(void) CHECK(ret, FAIL, "H5Dclose"); /* Open group object. GAPL isn't supported yet. But it's harmless to pass in */ - group = H5Ropen_object(&rbuf[2], H5P_DEFAULT, H5P_DEFAULT); + group = H5Ropen_object(&cmpnd_rbuf.ref2, H5P_DEFAULT, H5P_DEFAULT); CHECK(group, H5I_INVALID_HID, "H5Ropen_object"); /* Close group */ @@ -1057,7 +1047,7 @@ test_reference_cmpnd_obj(void) CHECK(ret, FAIL, "H5Gclose"); /* Open datatype object. TAPL isn't supported yet. But it's harmless to pass in */ - tid1 = H5Ropen_object(&rbuf[3], H5P_DEFAULT, H5P_DEFAULT); + tid1 = H5Ropen_object(&cmpnd_rbuf.ref3, H5P_DEFAULT, H5P_DEFAULT); CHECK(tid1, H5I_INVALID_HID, "H5Ropen_object"); /* Verify correct datatype */ @@ -1088,18 +1078,25 @@ test_reference_cmpnd_obj(void) CHECK(ret, FAIL, "H5Fclose"); /* Destroy references */ - for (j = 0; j < SPACE1_DIM1; j++) { - ret = H5Rdestroy(&wbuf[j]); - CHECK(ret, FAIL, "H5Rdestroy"); - } - for (j = 0; j < SPACE1_DIM1; j++) { - ret = H5Rdestroy(&rbuf[j]); - CHECK(ret, FAIL, "H5Rdestroy"); - } + ret = H5Rdestroy(&cmpnd_wbuf.ref0); + CHECK(ret, FAIL, "H5Rdestroy"); + ret = H5Rdestroy(&cmpnd_wbuf.ref1); + CHECK(ret, FAIL, "H5Rdestroy"); + ret = H5Rdestroy(&cmpnd_wbuf.ref2); + CHECK(ret, FAIL, "H5Rdestroy"); + ret = H5Rdestroy(&cmpnd_wbuf.ref3); + CHECK(ret, FAIL, "H5Rdestroy"); + + ret = H5Rdestroy(&cmpnd_rbuf.ref0); + CHECK(ret, FAIL, "H5Rdestroy"); + ret = H5Rdestroy(&cmpnd_rbuf.ref1); + CHECK(ret, FAIL, "H5Rdestroy"); + ret = H5Rdestroy(&cmpnd_rbuf.ref2); + CHECK(ret, FAIL, "H5Rdestroy"); + ret = H5Rdestroy(&cmpnd_rbuf.ref3); + CHECK(ret, FAIL, "H5Rdestroy"); /* Free memory buffers */ - HDfree(wbuf); - HDfree(rbuf); HDfree(ibuf); HDfree(obuf); } /* test_reference_cmpnd_obj() */ From edf801c40c9988edd48a394ce9a54208fd2c9f50 Mon Sep 17 00:00:00 2001 From: Larry Knox Date: Tue, 29 Dec 2020 15:43:49 -0600 Subject: [PATCH 08/21] Modify temporary rpath for testing in java example scripts. (#230) --- java/examples/datasets/JavaDatasetExample.sh.in | 10 +++++++++- java/examples/datatypes/JavaDatatypeExample.sh.in | 10 +++++++++- java/examples/groups/JavaGroupExample.sh.in | 12 ++++++++++-- java/examples/intro/JavaIntroExample.sh.in | 10 +++++++++- 4 files changed, 37 insertions(+), 5 deletions(-) diff --git a/java/examples/datasets/JavaDatasetExample.sh.in b/java/examples/datasets/JavaDatasetExample.sh.in index ae794166fa8..7c47002e838 100644 --- a/java/examples/datasets/JavaDatasetExample.sh.in +++ b/java/examples/datasets/JavaDatasetExample.sh.in @@ -15,6 +15,7 @@ top_builddir=@top_builddir@ top_srcdir=@top_srcdir@ srcdir=@srcdir@ +IS_DARWIN="@H5_IS_DARWIN@" USE_FILTER_SZIP="@USE_FILTER_SZIP@" USE_FILTER_DEFLATE="@USE_FILTER_DEFLATE@" @@ -36,8 +37,8 @@ nerrors=0 # where the libs exist HDFLIB_HOME="$top_srcdir/java/lib" -BLDLIBDIR="$top_builddir/hdf5/lib" BLDDIR="." +BLDLIBDIR="$BLDDIR/testlibs" HDFTEST_HOME="$top_srcdir/java/examples/datasets" JARFILE=jar@PACKAGE_TARNAME@-@PACKAGE_VERSION@.jar TESTJARFILE=jar@PACKAGE_TARNAME@datasets.jar @@ -113,6 +114,13 @@ COPY_LIBFILES_TO_BLDLIBDIR() fi fi done + if [ "$IS_DARWIN" = "yes" ]; then + (cd $BLDLIBDIR; \ + install_name_tool -add_rpath @loader_path libhdf5_java.dylib; \ + exist_path=` otool -l libhdf5_java.dylib | grep libhdf5 | grep -v java | awk '{print $2}'`; \ + echo $exist_path; \ + install_name_tool -change $exist_path @rpath/libhdf5.dylib libhdf5_java.dylib) + fi # copy jar files. Used -f to make sure get a new copy for tstfile in $COPY_JARTESTFILES do diff --git a/java/examples/datatypes/JavaDatatypeExample.sh.in b/java/examples/datatypes/JavaDatatypeExample.sh.in index 447512a42f8..6a4581a8edb 100644 --- a/java/examples/datatypes/JavaDatatypeExample.sh.in +++ b/java/examples/datatypes/JavaDatatypeExample.sh.in @@ -15,6 +15,7 @@ top_builddir=@top_builddir@ top_srcdir=@top_srcdir@ srcdir=@srcdir@ +IS_DARWIN="@H5_IS_DARWIN@" TESTNAME=EX_Datatypes EXIT_SUCCESS=0 @@ -33,8 +34,8 @@ nerrors=0 # where the libs exist HDFLIB_HOME="$top_srcdir/java/lib" -BLDLIBDIR="$top_builddir/hdf5/lib" BLDDIR="." +BLDLIBDIR="$BLDDIR/testlibs" HDFTEST_HOME="$top_srcdir/java/examples/datatypes" JARFILE=jar@PACKAGE_TARNAME@-@PACKAGE_VERSION@.jar TESTJARFILE=jar@PACKAGE_TARNAME@datatypes.jar @@ -110,6 +111,13 @@ COPY_LIBFILES_TO_BLDLIBDIR() fi fi done + if [ "$IS_DARWIN" = "yes" ]; then + (cd $BLDLIBDIR; \ + install_name_tool -add_rpath @loader_path libhdf5_java.dylib; \ + exist_path=` otool -l libhdf5_java.dylib | grep libhdf5 | grep -v java | awk '{print $2}'`; \ + echo $exist_path; \ + install_name_tool -change $exist_path @rpath/libhdf5.dylib libhdf5_java.dylib) + fi # copy jar files. Used -f to make sure get a new copy for tstfile in $COPY_JARTESTFILES do diff --git a/java/examples/groups/JavaGroupExample.sh.in b/java/examples/groups/JavaGroupExample.sh.in index acc606f64a4..f32947a9253 100644 --- a/java/examples/groups/JavaGroupExample.sh.in +++ b/java/examples/groups/JavaGroupExample.sh.in @@ -15,6 +15,7 @@ top_builddir=@top_builddir@ top_srcdir=@top_srcdir@ srcdir=@srcdir@ +IS_DARWIN="@H5_IS_DARWIN@" TESTNAME=EX_Groups EXIT_SUCCESS=0 @@ -33,9 +34,9 @@ nerrors=0 # where the libs exist HDFLIB_HOME="$top_srcdir/java/lib" -BLDLIBDIR="$top_builddir/hdf5/lib" -BLDITERDIR="./groups" BLDDIR="." +BLDLIBDIR="$BLDDIR/testlibs" +BLDITERDIR="./groups" HDFTEST_HOME="$top_srcdir/java/examples/groups" JARFILE=jar@PACKAGE_TARNAME@-@PACKAGE_VERSION@.jar TESTJARFILE=jar@PACKAGE_TARNAME@groups.jar @@ -105,6 +106,13 @@ COPY_LIBFILES_TO_BLDLIBDIR() fi fi done + if [ "$IS_DARWIN" = "yes" ]; then + (cd $BLDLIBDIR; \ + install_name_tool -add_rpath @loader_path libhdf5_java.dylib; \ + exist_path=` otool -l libhdf5_java.dylib | grep libhdf5 | grep -v java | awk '{print $2}'`; \ + echo $exist_path; \ + install_name_tool -change $exist_path @rpath/libhdf5.dylib libhdf5_java.dylib) + fi # copy jar files. Used -f to make sure get a new copy for tstfile in $COPY_JARTESTFILES do diff --git a/java/examples/intro/JavaIntroExample.sh.in b/java/examples/intro/JavaIntroExample.sh.in index 1886485ad86..7f7dabf6e08 100644 --- a/java/examples/intro/JavaIntroExample.sh.in +++ b/java/examples/intro/JavaIntroExample.sh.in @@ -15,6 +15,7 @@ top_builddir=@top_builddir@ top_srcdir=@top_srcdir@ srcdir=@srcdir@ +IS_DARWIN="@H5_IS_DARWIN@" TESTNAME=EX_Intro EXIT_SUCCESS=0 @@ -33,8 +34,8 @@ nerrors=0 # where the libs exist HDFLIB_HOME="$top_srcdir/java/lib" -BLDLIBDIR="$top_builddir/hdf5/lib" BLDDIR="." +BLDLIBDIR="$BLDDIR/testlibs" HDFTEST_HOME="$top_srcdir/java/examples/intro" JARFILE=jar@PACKAGE_TARNAME@-@PACKAGE_VERSION@.jar TESTJARFILE=jar@PACKAGE_TARNAME@intro.jar @@ -99,6 +100,13 @@ COPY_LIBFILES_TO_BLDLIBDIR() fi fi done + if [ "$IS_DARWIN" = "yes" ]; then + (cd $BLDLIBDIR; \ + install_name_tool -add_rpath @loader_path libhdf5_java.dylib; \ + exist_path=` otool -l libhdf5_java.dylib | grep libhdf5 | grep -v java | awk '{print $2}'`; \ + echo $exist_path; \ + install_name_tool -change $exist_path @rpath/libhdf5.dylib libhdf5_java.dylib) + fi # copy jar files. Used -f to make sure get a new copy for tstfile in $COPY_JARTESTFILES do From 3af66ddb827de648bc3fd62c1d23dd3657be0286 Mon Sep 17 00:00:00 2001 From: Sean McBride Date: Fri, 19 Feb 2021 13:48:04 -0500 Subject: [PATCH 09/21] Fix undefined left shifting of negative numbers (#338) Undefined Bahavior Sanitizer errored here about left shifting negative numbers. --- test/dsets.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test/dsets.c b/test/dsets.c index 0be6d187505..9b586ed20f6 100644 --- a/test/dsets.c +++ b/test/dsets.c @@ -4041,7 +4041,7 @@ test_nbit_compound_2(hid_t file) power = HDpow(2.0F, (double)(precision[1] - 1)); orig_data[i][j].a.c = (char)(((long long)HDrandom() % (long long)power) << offset[1]); power = HDpow(2.0F, (double)(precision[2] - 1)); - orig_data[i][j].a.s = (short)(-((long long)HDrandom() % (long long)power) << offset[2]); + orig_data[i][j].a.s = (short)(-(((long long)HDrandom() % (long long)power) << offset[2])); orig_data[i][j].a.f = float_val[i][j]; power = HDpow(2.0F, (double)precision[3]); @@ -4057,7 +4057,7 @@ test_nbit_compound_2(hid_t file) for (n = 0; n < (size_t)array_dims[1]; n++) { power = HDpow(2.0F, (double)(precision[0] - 1)); orig_data[i][j].d[m][n].i = - (int)(-((long long)HDrandom() % (long long)power) << offset[0]); + (int)(-(((long long)HDrandom() % (long long)power) << offset[0])); power = HDpow(2.0F, (double)(precision[1] - 1)); orig_data[i][j].d[m][n].c = (char)(((long long)HDrandom() % (long long)power) << offset[1]); From febde7c9a24409c9563962f81a8dc19f60cb1637 Mon Sep 17 00:00:00 2001 From: Dana Robinson <43805+derobins@users.noreply.github.com> Date: Thu, 4 Mar 2021 20:30:09 -0800 Subject: [PATCH 10/21] Fixes various warnings noticed on Windows (#425) * Fixes various warnings noticed on Windows - Adds a prototype for our implementation of vasprintf - Return type of H5_get_utf16_str() is now non-const - Fixes possible uninitialized return type in Wremove_utf8 - Better isolation of fork() code in accum.c:test_swmr_write_big() - Better isolation of non-zlib code in dsets.c:test_filter_delete() - Removed unused variable in trefer.c:test_reference_cmpnd_obj() * Fixes clang-format issues --- src/H5private.h | 12 +++++++----- src/H5system.c | 8 ++++---- src/H5win32defs.h | 7 ++++--- test/accum.c | 25 ++++++++++--------------- test/dsets.c | 10 +++++++--- test/trefer.c | 2 +- 6 files changed, 33 insertions(+), 31 deletions(-) diff --git a/src/H5private.h b/src/H5private.h index 7863ae2071a..c640b4280e7 100644 --- a/src/H5private.h +++ b/src/H5private.h @@ -675,11 +675,6 @@ typedef struct { #ifndef HDacos #define HDacos(X) acos(X) #endif /* HDacos */ -#ifndef HDvasprintf -#ifdef H5_HAVE_VASPRINTF -#define HDvasprintf(RET, FMT, A) vasprintf(RET, FMT, A) -#endif /* H5_HAVE_VASPRINTF */ -#endif /* HDvasprintf */ #ifndef HDalarm #ifdef H5_HAVE_ALARM #define HDalarm(N) alarm(N) @@ -1596,6 +1591,13 @@ H5_DLL int64_t HDstrtoll(const char *s, const char **rest, int base); #ifndef HDutime #define HDutime(S, T) utime(S, T) #endif /* HDutime */ +#ifndef HDvasprintf +#ifdef H5_HAVE_VASPRINTF +#define HDvasprintf(RET, FMT, A) vasprintf(RET, FMT, A) +#else +H5_DLL int HDvasprintf(char **bufp, const char *fmt, va_list _ap); +#endif /* H5_HAVE_VASPRINTF */ +#endif /* HDvasprintf */ #ifndef HDva_arg #define HDva_arg(A, T) va_arg(A, T) #endif /* HDva_arg */ diff --git a/src/H5system.c b/src/H5system.c index 2ac3f9340a4..53307a8c1de 100644 --- a/src/H5system.c +++ b/src/H5system.c @@ -66,7 +66,7 @@ /* Track whether tzset routine was called */ static hbool_t H5_ntzset = FALSE; -#ifndef HDvasprintf +#ifndef H5_HAVE_VASPRINTF /* HDvasprintf provides vasprintf-like function on targets where it is * unavailable. */ @@ -94,7 +94,7 @@ HDvasprintf(char **bufp, const char *fmt, va_list _ap) } return -1; } -#endif +#endif /* H5_HAVE_VASPRINTF */ /*------------------------------------------------------------------------- * Function: HDstrtoll @@ -737,7 +737,7 @@ Wroundf(float arg) * *------------------------------------------------------------------------- */ -const wchar_t * +wchar_t * H5_get_utf16_str(const char *s) { int nwchars = -1; /* Length of the UTF-16 buffer */ @@ -833,7 +833,7 @@ int Wremove_utf8(const char *path) { wchar_t *wpath = NULL; /* UTF-16 version of the path */ - int ret; + int ret = -1; /* Convert the input UTF-8 path to UTF-16 */ if (NULL == (wpath = H5_get_utf16_str(path))) diff --git a/src/H5win32defs.h b/src/H5win32defs.h index b4b253f0729..8f3947afd34 100644 --- a/src/H5win32defs.h +++ b/src/H5win32defs.h @@ -176,9 +176,10 @@ H5_DLL int c99_snprintf(char *str, size_t size, const char *format, ...); H5_DLL int c99_vsnprintf(char *str, size_t size, const char *format, va_list ap); H5_DLL int Wnanosleep(const struct timespec *req, struct timespec *rem); H5_DLL herr_t H5_expand_windows_env_vars(char **env_var); -H5_DLL const wchar_t *H5_get_utf16_str(const char *s); -H5_DLL int Wopen_utf8(const char *path, int oflag, ...); -H5_DLL int Wremove_utf8(const char *path); +H5_DLL wchar_t *H5_get_utf16_str(const char *s); +H5_DLL int Wopen_utf8(const char *path, int oflag, ...); +H5_DLL int Wremove_utf8(const char *path); +H5_DLL int H5_get_win32_times(H5_timevals_t *tvs); /* Round functions only needed for VS2012 and earlier. * They are always built to ensure they don't go stale and diff --git a/test/accum.c b/test/accum.c index 1f09fe04851..fd97576e865 100644 --- a/test/accum.c +++ b/test/accum.c @@ -2092,6 +2092,7 @@ HDfprintf(stderr, "Random # seed was: %u\n", seed); unsigned test_swmr_write_big(hbool_t newest_format) { +#if defined(H5_HAVE_FORK) && defined(H5_HAVE_WAITPID) && defined(H5_HAVE_UNISTD_H) hid_t fid = -1; /* File ID */ hid_t fapl = -1; /* File access property list */ H5F_t * rf = NULL; /* File pointer */ @@ -2099,26 +2100,16 @@ test_swmr_write_big(hbool_t newest_format) uint8_t *wbuf2 = NULL, *rbuf = NULL; /* Buffers for reading & writing */ uint8_t wbuf[1024]; /* Buffer for reading & writing */ unsigned u; /* Local index variable */ -#ifdef H5_HAVE_UNISTD_H - pid_t pid; /* Process ID */ -#endif /* H5_HAVE_UNISTD_H */ - int status; /* Status returned from child process */ - char * driver = NULL; /* VFD string (from env variable) */ - hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ + pid_t pid; /* Process ID */ + int status; /* Status returned from child process */ + char * driver = NULL; /* VFD string (from env variable) */ + hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ if (newest_format) TESTING("SWMR write of large metadata: with latest format") else TESTING("SWMR write of large metadata: with non-latest-format") -#if !(defined(H5_HAVE_FORK) && defined(H5_HAVE_WAITPID)) - - SKIPPED(); - HDputs(" Test skipped due to fork or waitpid not defined."); - return 0; - -#else /* defined(H5_HAVE_FORK && defined(H5_HAVE_WAITPID) */ - /* Skip this test if SWMR I/O is not supported for the VFD specified * by the environment variable. */ @@ -2296,7 +2287,11 @@ test_swmr_write_big(hbool_t newest_format) return 1; -#endif +#else + SKIPPED(); + HDputs(" Test skipped due to fork, waitpid, or pid_t not defined."); + return 0; +#endif /* defined(H5_HAVE_FORK) && defined(H5_HAVE_WAITPID) && defined(H5_HAVE_UNISTD_H) */ } /* end test_swmr_write_big() */ diff --git a/test/dsets.c b/test/dsets.c index 9b586ed20f6..98df82083a2 100644 --- a/test/dsets.c +++ b/test/dsets.c @@ -6976,6 +6976,7 @@ test_copy_dcpl(hid_t file, hid_t fapl) static herr_t test_filter_delete(hid_t file) { +#ifdef H5_HAVE_FILTER_DEFLATE H5Z_filter_t filtn; /* filter identification number */ hid_t dsid = -1; /* dataset ID */ hid_t sid = -1; /* dataspace ID */ @@ -6987,6 +6988,7 @@ test_filter_delete(hid_t file) unsigned flags; /* flags for filter */ herr_t ret; /* generic return value */ int i; +#endif TESTING("filter deletion"); @@ -7088,9 +7090,7 @@ test_filter_delete(hid_t file) goto error; PASSED(); -#else - SKIPPED(); -#endif + return SUCCEED; error: @@ -7103,6 +7103,10 @@ test_filter_delete(hid_t file) } H5E_END_TRY; return FAIL; +#else + SKIPPED(); + return SUCCEED; +#endif } /* end test_filter_delete() */ /*------------------------------------------------------------------------- diff --git a/test/trefer.c b/test/trefer.c index 0d6ae751559..6422a1bdc96 100644 --- a/test/trefer.c +++ b/test/trefer.c @@ -832,7 +832,7 @@ test_reference_cmpnd_obj(void) hsize_t cmpnd_dims[] = {1}; hid_t dapl_id; /* Dataset access property list */ unsigned * ibuf, *obuf; - unsigned i, j; /* Counters */ + unsigned i; /* Counter */ H5O_type_t obj_type; /* Object type */ herr_t ret; /* Generic return value */ s2_t cmpnd_wbuf, cmpnd_rbuf; From 9840892b82867c22b4f52a45dc9eacd53038e5c2 Mon Sep 17 00:00:00 2001 From: Sean McBride Date: Tue, 9 Mar 2021 11:59:44 -0500 Subject: [PATCH 11/21] =?UTF-8?q?Applied=20clang-tidy=20readability-non-co?= =?UTF-8?q?nst-parameter=20warning=20fixes=20auto=E2=80=A6=20(#429)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Automatically applied clang-tidy readability-avoid-const-params-in-decls fixes Removes useless const declarations. * Fixed most readability-non-const-parameter warnings These changes were made automatically by clang-tidy, but I manually reverted the changes related to the H5Z_func_t signature. * Reformat source with clang v10.0.1. Co-authored-by: Larry Knox --- hl/test/test_file_image.c | 2 +- hl/test/test_ld.c | 5 ++-- hl/tools/gif2h5/gif.h | 6 ++--- hl/tools/gif2h5/gifread.c | 2 +- hl/tools/gif2h5/hdfgifwr.c | 4 +-- hl/tools/h5watch/h5watch.c | 4 +-- src/H5Dchunk.c | 2 +- src/H5Dpkg.h | 3 ++- src/H5Tbit.c | 2 +- src/H5Tpkg.h | 3 ++- src/H5Znbit.c | 36 ++++++++++++++------------- src/H5Zscaleoffset.c | 14 +++++------ src/H5Ztrans.c | 3 +-- test/chunk_info.c | 10 ++++---- test/dt_arith.c | 7 +++--- test/dtransform.c | 8 +++--- test/fillval.c | 2 +- test/tselect.c | 2 +- test/vfd.c | 4 +-- tools/lib/h5diff_attr.c | 2 +- tools/lib/h5tools.c | 6 ++--- tools/lib/h5tools.h | 7 +++--- tools/lib/h5tools_dump.c | 12 ++++----- tools/lib/h5tools_str.c | 2 +- tools/lib/h5tools_str.h | 2 +- tools/lib/h5trav.c | 2 +- tools/lib/h5trav.h | 3 ++- tools/src/h5repack/h5repack.h | 14 +++++------ tools/src/h5repack/h5repack_copy.c | 6 ++--- tools/src/h5repack/h5repack_filters.c | 14 +++++------ 30 files changed, 98 insertions(+), 91 deletions(-) diff --git a/hl/test/test_file_image.c b/hl/test/test_file_image.c index c20112feda1..f82056876af 100644 --- a/hl/test/test_file_image.c +++ b/hl/test/test_file_image.c @@ -51,7 +51,7 @@ *------------------------------------------------------------------------- */ static int -test_file_image(size_t open_images, size_t nflags, unsigned *flags) +test_file_image(size_t open_images, size_t nflags, const unsigned *flags) { hid_t * file_id, *dset_id, file_space, plist; /* HDF5 ids */ hsize_t dims1[RANK] = {2, 3}; /* original dimension of datasets */ diff --git a/hl/test/test_ld.c b/hl/test/test_ld.c index 06cb600d0c2..02a56f4e537 100644 --- a/hl/test/test_ld.c +++ b/hl/test/test_ld.c @@ -157,7 +157,8 @@ static herr_t test_LD_elmts_invalid(const char *file); static herr_t test_LD_elmts_one(const char *file, const char *dname, const char *fields); static herr_t test_LD_elmts_two(const char *file, const char *dname, const char *fields); -static herr_t verify_elmts_two(int type, hsize_t *ext_dims, hsize_t *prev_dims, void *_ldbuf, void *_buf); +static herr_t verify_elmts_two(int type, const hsize_t *ext_dims, const hsize_t *prev_dims, void *_ldbuf, + void *_buf); /* data structures for compound data type */ typedef struct sub22_t { @@ -1135,7 +1136,7 @@ test_LD_elmts_one(const char *file, const char *dname, const char *fields) ************************************************************************************** */ static herr_t -verify_elmts_two(int type, hsize_t *ext_dims, hsize_t *prev_dims, void *_ldbuf, void *_buf) +verify_elmts_two(int type, const hsize_t *ext_dims, const hsize_t *prev_dims, void *_ldbuf, void *_buf) { int k, m; /* Local index variable */ diff --git a/hl/tools/gif2h5/gif.h b/hl/tools/gif2h5/gif.h index 2b4a3442996..1a8cfe428d1 100644 --- a/hl/tools/gif2h5/gif.h +++ b/hl/tools/gif2h5/gif.h @@ -157,8 +157,8 @@ int ReadGifApplication(GIFAPPLICATION *, GIFBYTE **); int ReadGifComment(GIFCOMMENT *, GIFBYTE **); /* HDFGIFWR.C */ -int hdfWriteGIF(FILE *fp, GIFBYTE *pic, int ptype, int w, int h, GIFBYTE *rmap, GIFBYTE *gmap, GIFBYTE *bmap, - GIFBYTE *pc2ncmap, int numcols, int colorstyle, int BitsPerPixel); +int hdfWriteGIF(FILE *fp, GIFBYTE *pic, int ptype, int w, int h, const GIFBYTE *rmap, const GIFBYTE *gmap, + const GIFBYTE *bmap, const GIFBYTE *pc2ncmap, int numcols, int colorstyle, int BitsPerPixel); /* WRITEHDF.C */ int WriteHDF(GIFTOMEM, GIFCHAR *); @@ -176,7 +176,7 @@ int ReadHDF(GIFBYTE **data, GIFBYTE palette[256][3], hsize_t *image_size, GIFCHA GIFCHAR *dset_name, GIFCHAR *pal_name); GIFBYTE *Decompress(GIFIMAGEDESC *, GIFHEAD *); -GIFBYTE GetByte(GIFBYTE *); +GIFBYTE GetByte(const GIFBYTE *); GIFWORD GetWord(GIFBYTE *); void cleanup(GIFBYTE *); diff --git a/hl/tools/gif2h5/gifread.c b/hl/tools/gif2h5/gifread.c index b88264bb81d..ef2bdd40fda 100644 --- a/hl/tools/gif2h5/gifread.c +++ b/hl/tools/gif2h5/gifread.c @@ -38,7 +38,7 @@ GetWord(GIFBYTE *MemGif) } GIFBYTE -GetByte(GIFBYTE *MemGif) { return *MemGif; } +GetByte(const GIFBYTE *MemGif) { return *MemGif; } /* * Read a GIF image GIFBYTE Header. diff --git a/hl/tools/gif2h5/hdfgifwr.c b/hl/tools/gif2h5/hdfgifwr.c index 8068829fed7..21b14d14df1 100644 --- a/hl/tools/gif2h5/hdfgifwr.c +++ b/hl/tools/gif2h5/hdfgifwr.c @@ -135,8 +135,8 @@ static int EOFCode; /*************************************************************/ int -hdfWriteGIF(FILE *fp, byte *pic, int ptype, int w, int h, byte *rmap, byte *gmap, byte *bmap, byte *pc2ncmap, - int numcols, int colorstyle, int BitsPerPixel) +hdfWriteGIF(FILE *fp, byte *pic, int ptype, int w, int h, const byte *rmap, const byte *gmap, + const byte *bmap, const byte *pc2ncmap, int numcols, int colorstyle, int BitsPerPixel) { int InitCodeSize; int i; diff --git a/hl/tools/h5watch/h5watch.c b/hl/tools/h5watch/h5watch.c index 8d7f4ec648e..a5e82ca6cb4 100644 --- a/hl/tools/h5watch/h5watch.c +++ b/hl/tools/h5watch/h5watch.c @@ -43,7 +43,7 @@ static unsigned g_retry = DEFAULT_RETRY; /* # of times to try opening the file static hbool_t g_display_hex = FALSE; /* display data in hexadecimal format : LATER */ static hbool_t g_user_interrupt = FALSE; /* Flag to indicate that user interrupted execution */ -static herr_t doprint(hid_t did, hsize_t *start, hsize_t *block, int rank); +static herr_t doprint(hid_t did, const hsize_t *start, const hsize_t *block, int rank); static herr_t slicendump(hid_t did, hsize_t *prev_dims, hsize_t *cur_dims, hsize_t *start, hsize_t *block, int rank, int subrank); static herr_t monitor_dataset(hid_t fid, char *dsetname); @@ -95,7 +95,7 @@ static struct long_options l_opts[] = {{"help", no_arg, 'h'}, {"hel", no *------------------------------------------------------------------------- */ static herr_t -doprint(hid_t did, hsize_t *start, hsize_t *block, int rank) +doprint(hid_t did, const hsize_t *start, const hsize_t *block, int rank) { h5tools_context_t ctx; /* print context */ h5tool_format_t info; /* Format info for the tools library */ diff --git a/src/H5Dchunk.c b/src/H5Dchunk.c index b5009d1312a..67c92ca0618 100644 --- a/src/H5Dchunk.c +++ b/src/H5Dchunk.c @@ -4258,7 +4258,7 @@ H5D__chunk_allocated(const H5D_t *dset, hsize_t *nbytes) *------------------------------------------------------------------------- */ herr_t -H5D__chunk_allocate(const H5D_io_info_t *io_info, hbool_t full_overwrite, hsize_t old_dim[]) +H5D__chunk_allocate(const H5D_io_info_t *io_info, hbool_t full_overwrite, const hsize_t old_dim[]) { const H5D_t * dset = io_info->dset; /* the dataset pointer */ H5D_chk_idx_info_t idx_info; /* Chunked index info */ diff --git a/src/H5Dpkg.h b/src/H5Dpkg.h index 61b1a872aa2..64f2c7a263f 100644 --- a/src/H5Dpkg.h +++ b/src/H5Dpkg.h @@ -631,7 +631,8 @@ H5_DLL hbool_t H5D__chunk_is_space_alloc(const H5O_storage_t *storage); H5_DLL hbool_t H5D__chunk_is_data_cached(const H5D_shared_t *shared_dset); H5_DLL herr_t H5D__chunk_lookup(const H5D_t *dset, const hsize_t *scaled, H5D_chunk_ud_t *udata); H5_DLL herr_t H5D__chunk_allocated(const H5D_t *dset, hsize_t *nbytes); -H5_DLL herr_t H5D__chunk_allocate(const H5D_io_info_t *io_info, hbool_t full_overwrite, hsize_t old_dim[]); +H5_DLL herr_t H5D__chunk_allocate(const H5D_io_info_t *io_info, hbool_t full_overwrite, + const hsize_t old_dim[]); H5_DLL herr_t H5D__chunk_file_alloc(const H5D_chk_idx_info_t *idx_info, const H5F_block_t *old_chunk, H5F_block_t *new_chunk, hbool_t *need_insert, const hsize_t *scaled); H5_DLL herr_t H5D__chunk_update_old_edge_chunks(H5D_t *dset, hsize_t old_dim[]); diff --git a/src/H5Tbit.c b/src/H5Tbit.c index c35a530dc03..e2ca4b9db85 100644 --- a/src/H5Tbit.c +++ b/src/H5Tbit.c @@ -388,7 +388,7 @@ H5T__bit_set(uint8_t *buf, size_t offset, size_t size, hbool_t value) *------------------------------------------------------------------------- */ ssize_t -H5T__bit_find(uint8_t *buf, size_t offset, size_t size, H5T_sdir_t direction, hbool_t value) +H5T__bit_find(const uint8_t *buf, size_t offset, size_t size, H5T_sdir_t direction, hbool_t value) { ssize_t base = (ssize_t)offset; ssize_t idx, i; diff --git a/src/H5Tpkg.h b/src/H5Tpkg.h index 0fe4f502175..51ecacae481 100644 --- a/src/H5Tpkg.h +++ b/src/H5Tpkg.h @@ -852,7 +852,8 @@ H5_DLL herr_t H5T__bit_shift(uint8_t *buf, ssize_t shift_dist, size_t offset, H5_DLL void H5T__bit_set(uint8_t *buf, size_t offset, size_t size, hbool_t value); H5_DLL uint64_t H5T__bit_get_d(uint8_t *buf, size_t offset, size_t size); H5_DLL void H5T__bit_set_d(uint8_t *buf, size_t offset, size_t size, uint64_t val); -H5_DLL ssize_t H5T__bit_find(uint8_t *buf, size_t offset, size_t size, H5T_sdir_t direction, hbool_t value); +H5_DLL ssize_t H5T__bit_find(const uint8_t *buf, size_t offset, size_t size, H5T_sdir_t direction, + hbool_t value); H5_DLL hbool_t H5T__bit_inc(uint8_t *buf, size_t start, size_t size); H5_DLL hbool_t H5T__bit_dec(uint8_t *buf, size_t start, size_t size); H5_DLL void H5T__bit_neg(uint8_t *buf, size_t start, size_t size); diff --git a/src/H5Znbit.c b/src/H5Znbit.c index b19e157b655..795fdce307f 100644 --- a/src/H5Znbit.c +++ b/src/H5Znbit.c @@ -52,17 +52,19 @@ static herr_t H5Z__set_parms_array(const H5T_t *type, unsigned *cd_values_index, static herr_t H5Z__set_parms_compound(const H5T_t *type, unsigned *cd_values_index, unsigned cd_values[], hbool_t *need_not_compress); -static void H5Z__nbit_next_byte(size_t *j, size_t *buf_len); -static void H5Z__nbit_decompress_one_byte(unsigned char *data, size_t data_offset, unsigned k, +static void H5Z__nbit_next_byte(size_t *j, size_t *buf_len); +static void H5Z__nbit_decompress_one_byte(unsigned char *data, size_t data_offset, unsigned k, + unsigned begin_i, unsigned end_i, const unsigned char *buffer, + size_t *j, size_t *buf_len, const parms_atomic *p, + size_t datatype_len); +static void H5Z__nbit_compress_one_byte(const unsigned char *data, size_t data_offset, unsigned k, unsigned begin_i, unsigned end_i, unsigned char *buffer, size_t *j, size_t *buf_len, const parms_atomic *p, size_t datatype_len); -static void H5Z__nbit_compress_one_byte(unsigned char *data, size_t data_offset, unsigned k, unsigned begin_i, - unsigned end_i, unsigned char *buffer, size_t *j, size_t *buf_len, - const parms_atomic *p, size_t datatype_len); -static void H5Z__nbit_decompress_one_nooptype(unsigned char *data, size_t data_offset, unsigned char *buffer, - size_t *j, size_t *buf_len, unsigned size); -static void H5Z__nbit_decompress_one_atomic(unsigned char *data, size_t data_offset, unsigned char *buffer, - size_t *j, size_t *buf_len, const parms_atomic *p); +static void H5Z__nbit_decompress_one_nooptype(unsigned char *data, size_t data_offset, + const unsigned char *buffer, size_t *j, size_t *buf_len, + unsigned size); +static void H5Z__nbit_decompress_one_atomic(unsigned char *data, size_t data_offset, unsigned char *buffer, + size_t *j, size_t *buf_len, const parms_atomic *p); static herr_t H5Z__nbit_decompress_one_array(unsigned char *data, size_t data_offset, unsigned char *buffer, size_t *j, size_t *buf_len, const unsigned parms[], unsigned *parms_index); @@ -71,8 +73,8 @@ static herr_t H5Z__nbit_decompress_one_compound(unsigned char *data, size_t data const unsigned parms[], unsigned *parms_index); static herr_t H5Z__nbit_decompress(unsigned char *data, unsigned d_nelmts, unsigned char *buffer, const unsigned parms[]); -static void H5Z__nbit_compress_one_nooptype(unsigned char *data, size_t data_offset, unsigned char *buffer, - size_t *j, size_t *buf_len, unsigned size); +static void H5Z__nbit_compress_one_nooptype(const unsigned char *data, size_t data_offset, + unsigned char *buffer, size_t *j, size_t *buf_len, unsigned size); static void H5Z__nbit_compress_one_array(unsigned char *data, size_t data_offset, unsigned char *buffer, size_t *j, size_t *buf_len, const unsigned parms[], unsigned *parms_index); @@ -1026,7 +1028,7 @@ H5Z__nbit_next_byte(size_t *j, size_t *buf_len) static void H5Z__nbit_decompress_one_byte(unsigned char *data, size_t data_offset, unsigned k, unsigned begin_i, - unsigned end_i, unsigned char *buffer, size_t *j, size_t *buf_len, + unsigned end_i, const unsigned char *buffer, size_t *j, size_t *buf_len, const parms_atomic *p, size_t datatype_len) { size_t dat_len; /* dat_len is the number of bits to be copied in each data byte */ @@ -1075,8 +1077,8 @@ H5Z__nbit_decompress_one_byte(unsigned char *data, size_t data_offset, unsigned } static void -H5Z__nbit_decompress_one_nooptype(unsigned char *data, size_t data_offset, unsigned char *buffer, size_t *j, - size_t *buf_len, unsigned size) +H5Z__nbit_decompress_one_nooptype(unsigned char *data, size_t data_offset, const unsigned char *buffer, + size_t *j, size_t *buf_len, unsigned size) { unsigned i; /* index */ size_t dat_len; /* dat_len is the number of bits to be copied in each data byte */ @@ -1341,7 +1343,7 @@ H5Z__nbit_decompress(unsigned char *data, unsigned d_nelmts, unsigned char *buff } static void -H5Z__nbit_compress_one_byte(unsigned char *data, size_t data_offset, unsigned k, unsigned begin_i, +H5Z__nbit_compress_one_byte(const unsigned char *data, size_t data_offset, unsigned k, unsigned begin_i, unsigned end_i, unsigned char *buffer, size_t *j, size_t *buf_len, const parms_atomic *p, size_t datatype_len) { @@ -1383,8 +1385,8 @@ H5Z__nbit_compress_one_byte(unsigned char *data, size_t data_offset, unsigned k, } static void -H5Z__nbit_compress_one_nooptype(unsigned char *data, size_t data_offset, unsigned char *buffer, size_t *j, - size_t *buf_len, unsigned size) +H5Z__nbit_compress_one_nooptype(const unsigned char *data, size_t data_offset, unsigned char *buffer, + size_t *j, size_t *buf_len, unsigned size) { unsigned i; /* index */ size_t dat_len; /* dat_len is the number of bits to be copied in each data byte */ diff --git a/src/H5Zscaleoffset.c b/src/H5Zscaleoffset.c index 9890c139735..9a222ea5d19 100644 --- a/src/H5Zscaleoffset.c +++ b/src/H5Zscaleoffset.c @@ -73,9 +73,9 @@ static herr_t H5Z__scaleoffset_postdecompress_fd(void *data, unsigned d_nelmts, uint32_t minbits, unsigned long long minval, double D_val); static void H5Z__scaleoffset_next_byte(size_t *j, unsigned *buf_len); static void H5Z__scaleoffset_decompress_one_byte(unsigned char *data, size_t data_offset, unsigned k, - unsigned begin_i, unsigned char *buffer, size_t *j, + unsigned begin_i, const unsigned char *buffer, size_t *j, unsigned *buf_len, parms_atomic p, unsigned dtype_len); -static void H5Z__scaleoffset_compress_one_byte(unsigned char *data, size_t data_offset, unsigned k, +static void H5Z__scaleoffset_compress_one_byte(const unsigned char *data, size_t data_offset, unsigned k, unsigned begin_i, unsigned char *buffer, size_t *j, unsigned *buf_len, parms_atomic p, unsigned dtype_len); static void H5Z__scaleoffset_decompress_one_atomic(unsigned char *data, size_t data_offset, @@ -1608,8 +1608,8 @@ H5Z__scaleoffset_next_byte(size_t *j, unsigned *buf_len) static void H5Z__scaleoffset_decompress_one_byte(unsigned char *data, size_t data_offset, unsigned k, unsigned begin_i, - unsigned char *buffer, size_t *j, unsigned *buf_len, parms_atomic p, - unsigned dtype_len) + const unsigned char *buffer, size_t *j, unsigned *buf_len, + parms_atomic p, unsigned dtype_len) { unsigned dat_len; /* dat_len is the number of bits to be copied in each data byte */ unsigned char val; /* value to be copied in each data byte */ @@ -1694,9 +1694,9 @@ H5Z__scaleoffset_decompress(unsigned char *data, unsigned d_nelmts, unsigned cha } static void -H5Z__scaleoffset_compress_one_byte(unsigned char *data, size_t data_offset, unsigned k, unsigned begin_i, - unsigned char *buffer, size_t *j, unsigned *buf_len, parms_atomic p, - unsigned dtype_len) +H5Z__scaleoffset_compress_one_byte(const unsigned char *data, size_t data_offset, unsigned k, + unsigned begin_i, unsigned char *buffer, size_t *j, unsigned *buf_len, + parms_atomic p, unsigned dtype_len) { unsigned dat_len; /* dat_len is the number of bits to be copied in each data byte */ unsigned char val; /* value to be copied in each data byte */ diff --git a/src/H5Ztrans.c b/src/H5Ztrans.c index cea68fb3029..0224c779c37 100644 --- a/src/H5Ztrans.c +++ b/src/H5Ztrans.c @@ -90,8 +90,7 @@ static void H5Z__do_op(H5Z_node *tree); static hbool_t H5Z__op_is_numbs(H5Z_node *_tree); static hbool_t H5Z__op_is_numbs2(H5Z_node *_tree); static hid_t H5Z__xform_find_type(const H5T_t *type); -static herr_t H5Z__xform_eval_full(H5Z_node *tree, const size_t array_size, const hid_t array_type, - H5Z_result *res); +static herr_t H5Z__xform_eval_full(H5Z_node *tree, size_t array_size, hid_t array_type, H5Z_result *res); static void H5Z__xform_destroy_parse_tree(H5Z_node *tree); static void * H5Z__xform_parse(const char *expression, H5Z_datval_ptrs *dat_val_pointers); static void * H5Z__xform_copy_tree(H5Z_node *tree, H5Z_datval_ptrs *dat_val_pointers, diff --git a/test/chunk_info.c b/test/chunk_info.c index 35ffd8ac377..598fb2c7feb 100644 --- a/test/chunk_info.c +++ b/test/chunk_info.c @@ -127,7 +127,7 @@ void reinit_vars(unsigned *read_flt_msk, haddr_t *addr, hsize_t *size); static int verify_idx_nchunks(hid_t dset, hid_t dspace, H5D_chunk_index_t exp_idx_type, hsize_t exp_num_chunks); static int verify_get_chunk_info(hid_t dset, hid_t dspace, hsize_t chk_index, hsize_t exp_chk_size, - hsize_t *exp_offset, unsigned exp_flt_msk); + const hsize_t *exp_offset, unsigned exp_flt_msk); static int verify_get_chunk_info_by_coord(hid_t dset, hsize_t *offset, hsize_t exp_chk_size, unsigned exp_flt_msk); static int verify_empty_chunk_info(hid_t dset, hsize_t *offset); @@ -169,8 +169,8 @@ reinit_vars(unsigned *read_flt_msk, haddr_t *addr, hsize_t *size) *------------------------------------------------------------------------- */ static int -verify_get_chunk_info(hid_t dset, hid_t dspace, hsize_t chk_index, hsize_t exp_chk_size, hsize_t *exp_offset, - unsigned exp_flt_msk) +verify_get_chunk_info(hid_t dset, hid_t dspace, hsize_t chk_index, hsize_t exp_chk_size, + const hsize_t *exp_offset, unsigned exp_flt_msk) { unsigned read_flt_msk = 0; /* Read filter mask */ hsize_t out_offset[2] = {0, 0}; /* Buffer to get offset coordinates */ @@ -302,7 +302,7 @@ index_type_str(H5D_chunk_index_t idx_type) *------------------------------------------------------------------------- */ static int -verify_selected_chunks(hid_t dset, hid_t plist, hsize_t *start, hsize_t *end) +verify_selected_chunks(hid_t dset, hid_t plist, const hsize_t *start, const hsize_t *end) { int read_buf[CHUNK_NX][CHUNK_NY]; int expected_buf[NUM_CHUNKS][CHUNK_NX][CHUNK_NY]; /* Expected data */ @@ -364,7 +364,7 @@ verify_selected_chunks(hid_t dset, hid_t plist, hsize_t *start, hsize_t *end) *------------------------------------------------------------------------- */ static int -write_selected_chunks(hid_t dset, hid_t plist, hsize_t *start, hsize_t *end, unsigned flt_msk) +write_selected_chunks(hid_t dset, hid_t plist, const hsize_t *start, const hsize_t *end, unsigned flt_msk) { int direct_buf[NUM_CHUNKS][CHUNK_NX][CHUNK_NY]; /* Data in chunks */ hsize_t offset[2]; /* Offset coordinates of a chunk */ diff --git a/test/dt_arith.c b/test/dt_arith.c index de2e4c3ac91..81b4b4641f6 100644 --- a/test/dt_arith.c +++ b/test/dt_arith.c @@ -397,8 +397,8 @@ static int without_hardware_g = 0; void some_dummy_func(float x); static hbool_t overflows(unsigned char *origin_bits, hid_t src_id, size_t dst_num_bits); static int my_isnan(dtype_t type, void *val); -static int my_isinf(int endian, unsigned char *val, size_t size, size_t mpos, size_t msize, size_t epos, - size_t esize); +static int my_isinf(int endian, const unsigned char *val, size_t size, size_t mpos, size_t msize, size_t epos, + size_t esize); /*------------------------------------------------------------------------- * Function: fpe_handler @@ -2853,7 +2853,8 @@ my_isnan(dtype_t type, void *val) *------------------------------------------------------------------------- */ static int -my_isinf(int endian, unsigned char *val, size_t size, size_t mpos, size_t msize, size_t epos, size_t esize) +my_isinf(int endian, const unsigned char *val, size_t size, size_t mpos, size_t msize, size_t epos, + size_t esize) { unsigned char *bits; int retval = 0; diff --git a/test/dtransform.c b/test/dtransform.c index 3bbbcefd599..33cce3f4cbd 100644 --- a/test/dtransform.c +++ b/test/dtransform.c @@ -18,12 +18,12 @@ #define FLOAT_TOL 0.0001F static int init_test(hid_t file_id); -static int test_copy(const hid_t dxpl_id_c_to_f_copy, const hid_t dxpl_id_polynomial_copy); -static int test_trivial(const hid_t dxpl_id_simple); -static int test_poly(const hid_t dxpl_id_polynomial); +static int test_copy(hid_t dxpl_id_c_to_f_copy, hid_t dxpl_id_polynomial_copy); +static int test_trivial(hid_t dxpl_id_simple); +static int test_poly(hid_t dxpl_id_polynomial); static int test_specials(hid_t file); static int test_set(void); -static int test_getset(const hid_t dxpl_id_simple); +static int test_getset(hid_t dxpl_id_simple); /* These are needed for multiple tests, so are declared here globally and are init'ed in init_test */ hid_t dset_id_int = -1; diff --git a/test/fillval.c b/test/fillval.c index 80d8f9a5ddc..8a9b41f9c19 100644 --- a/test/fillval.c +++ b/test/fillval.c @@ -1586,7 +1586,7 @@ test_extend_release_cmpd_vl(void *_elmt) *------------------------------------------------------------------------- */ static int -test_extend_cases(hid_t file, hid_t _dcpl, const char *dset_name, hsize_t *ch_size, hsize_t *start_size, +test_extend_cases(hid_t file, hid_t _dcpl, const char *dset_name, const hsize_t *ch_size, hsize_t *start_size, hsize_t *max_size, hid_t dtype, void *fillval) { hid_t fspace = -1, mspace = -1; /* File & memory dataspaces */ diff --git a/test/tselect.c b/test/tselect.c index 8ecbf48ba02..c5d779f80f3 100644 --- a/test/tselect.c +++ b/test/tselect.c @@ -2561,7 +2561,7 @@ test_select_hyper_contig_dr(hid_t dset_type, hid_t xfer_plist) static void test_select_hyper_checker_board_dr__select_checker_board(hid_t tgt_n_cube_sid, unsigned tgt_n_cube_rank, unsigned edge_size, unsigned checker_edge_size, - unsigned sel_rank, hsize_t sel_start[]) + unsigned sel_rank, const hsize_t sel_start[]) { hbool_t first_selection = TRUE; unsigned n_cube_offset; diff --git a/test/vfd.c b/test/vfd.c index 6e1cb31657f..19b119ebf00 100644 --- a/test/vfd.c +++ b/test/vfd.c @@ -99,7 +99,7 @@ static int splitter_create_single_file_at(const char *filename, hid_t fapl_id, const struct splitter_dataset_def *data); static int splitter_compare_expected_data(hid_t file_id, const struct splitter_dataset_def *data); static int run_splitter_test(const struct splitter_dataset_def *data, hbool_t ignore_wo_errors, - hbool_t provide_logfile_path, hid_t sub_fapl_ids[2]); + hbool_t provide_logfile_path, const hid_t sub_fapl_ids[2]); static int splitter_RO_test(const struct splitter_dataset_def *data, hid_t child_fapl_id); static int splitter_tentative_open_test(hid_t child_fapl_id); static int file_exists(const char *filename, hid_t fapl_id); @@ -2336,7 +2336,7 @@ compare_splitter_config_info(hid_t fapl_id, H5FD_splitter_vfd_config_t *info) */ static int run_splitter_test(const struct splitter_dataset_def *data, hbool_t ignore_wo_errors, - hbool_t provide_logfile_path, hid_t sub_fapl_ids[2]) + hbool_t provide_logfile_path, const hid_t sub_fapl_ids[2]) { hid_t file_id = H5I_INVALID_HID; hid_t fapl_id = H5I_INVALID_HID; diff --git a/tools/lib/h5diff_attr.c b/tools/lib/h5diff_attr.c index c5966da1a7b..5c1777a83ed 100644 --- a/tools/lib/h5diff_attr.c +++ b/tools/lib/h5diff_attr.c @@ -104,7 +104,7 @@ table_attrs_free(table_attrs_t *table) * Date: March 15, 2011 *------------------------------------------------------------------------*/ static void -table_attr_mark_exist(unsigned *exist, char *name, table_attrs_t *table) +table_attr_mark_exist(const unsigned *exist, char *name, table_attrs_t *table) { if (table->nattrs == table->size) { match_attr_t *new_attrs; diff --git a/tools/lib/h5tools.c b/tools/lib/h5tools.c index 3b7849164ad..4d19f1f4b20 100644 --- a/tools/lib/h5tools.c +++ b/tools/lib/h5tools.c @@ -1609,7 +1609,7 @@ h5tools_render_region_element(FILE *stream, const h5tool_format_t *info, h5tools *------------------------------------------------------------------------- */ void -init_acc_pos(unsigned ndims, hsize_t *dims, hsize_t *acc, hsize_t *pos, hsize_t *p_min_idx) +init_acc_pos(unsigned ndims, const hsize_t *dims, hsize_t *acc, hsize_t *pos, hsize_t *p_min_idx) { int i; unsigned j; @@ -1642,7 +1642,7 @@ init_acc_pos(unsigned ndims, hsize_t *dims, hsize_t *acc, hsize_t *pos, hsize_t *------------------------------------------------------------------------- */ hsize_t -calc_acc_pos(unsigned ndims, hsize_t elmtno, hsize_t *acc, hsize_t *pos) +calc_acc_pos(unsigned ndims, hsize_t elmtno, const hsize_t *acc, hsize_t *pos) { int i; hsize_t curr_pos = elmtno; @@ -1913,7 +1913,7 @@ render_bin_output(FILE *stream, hid_t container, hid_t tid, void *_mem, hsize_t */ int render_bin_output_region_data_blocks(hid_t region_id, FILE *stream, hid_t container, unsigned ndims, - hid_t type_id, hsize_t nblocks, hsize_t *ptdata) + hid_t type_id, hsize_t nblocks, const hsize_t *ptdata) { hsize_t *dims1 = NULL; hsize_t *start = NULL; diff --git a/tools/lib/h5tools.h b/tools/lib/h5tools.h index a972fd9074a..9d065f31e6e 100644 --- a/tools/lib/h5tools.h +++ b/tools/lib/h5tools.h @@ -672,8 +672,9 @@ H5TOOLS_DLL hid_t h5tools_get_big_endian_type(hid_t type); H5TOOLS_DLL htri_t h5tools_detect_vlen(hid_t tid); H5TOOLS_DLL htri_t h5tools_detect_vlen_str(hid_t tid); H5TOOLS_DLL hbool_t h5tools_is_obj_same(hid_t loc_id1, const char *name1, hid_t loc_id2, const char *name2); -H5TOOLS_DLL void init_acc_pos(unsigned ndims, hsize_t *dims, hsize_t *acc, hsize_t *pos, hsize_t *p_min_idx); -H5TOOLS_DLL hsize_t calc_acc_pos(unsigned ndims, hsize_t elemtno, hsize_t *acc, hsize_t *pos); +H5TOOLS_DLL void init_acc_pos(unsigned ndims, const hsize_t *dims, hsize_t *acc, hsize_t *pos, + hsize_t *p_min_idx); +H5TOOLS_DLL hsize_t calc_acc_pos(unsigned ndims, hsize_t elemtno, const hsize_t *acc, hsize_t *pos); H5TOOLS_DLL hbool_t h5tools_is_zero(const void *_mem, size_t size); H5TOOLS_DLL int h5tools_canreadf(const char *name, hid_t dcpl_id); H5TOOLS_DLL int h5tools_can_encode(H5Z_filter_t filtn); @@ -687,7 +688,7 @@ H5TOOLS_DLL void h5tools_region_simple_prefix(FILE *stream, const h5tool_format_ H5TOOLS_DLL int render_bin_output(FILE *stream, hid_t container, hid_t tid, void *_mem, hsize_t nelmts); H5TOOLS_DLL int render_bin_output_region_data_blocks(hid_t region_id, FILE *stream, hid_t container, unsigned ndims, hid_t type_id, hsize_t nblocks, - hsize_t *ptdata); + const hsize_t *ptdata); H5TOOLS_DLL hbool_t render_bin_output_region_blocks(hid_t region_space, hid_t region_id, FILE *stream, hid_t container); H5TOOLS_DLL int render_bin_output_region_data_points(hid_t region_space, hid_t region_id, FILE *stream, diff --git a/tools/lib/h5tools_dump.c b/tools/lib/h5tools_dump.c index 45461789877..b195f928757 100644 --- a/tools/lib/h5tools_dump.c +++ b/tools/lib/h5tools_dump.c @@ -1257,12 +1257,12 @@ h5tools_dump_region_data_points(hid_t region_space, hid_t region_id, FILE *strea static herr_t h5tools_print_simple_subset(FILE *stream, const h5tool_format_t *info, h5tools_context_t *ctx, hid_t dset, hid_t p_type, hid_t f_space, hsize_t hyperslab_count, - hsize_t * temp_start, /* start inside offset count loop */ - hsize_t * temp_count, /* count inside offset count loop */ - hsize_t * temp_block, /* block size used in loop */ - hsize_t * temp_stride, /* stride size used in loop */ - hsize_t * total_size, /* total size of dataset */ - unsigned int row_dim) /* index of row_counter dimension */ + hsize_t * temp_start, /* start inside offset count loop */ + hsize_t * temp_count, /* count inside offset count loop */ + hsize_t * temp_block, /* block size used in loop */ + hsize_t * temp_stride, /* stride size used in loop */ + const hsize_t *total_size, /* total size of dataset */ + unsigned int row_dim) /* index of row_counter dimension */ { size_t i; /* counters */ size_t j; /* counters */ diff --git a/tools/lib/h5tools_str.c b/tools/lib/h5tools_str.c index 212b13e4dc9..762e8708077 100644 --- a/tools/lib/h5tools_str.c +++ b/tools/lib/h5tools_str.c @@ -323,7 +323,7 @@ h5tools_str_prefix(h5tools_str_t *str /*in,out*/, const h5tool_format_t *info, h */ char * h5tools_str_region_prefix(h5tools_str_t *str /*in,out*/, const h5tool_format_t *info, hsize_t elmtno, - hsize_t *ptdata, h5tools_context_t *ctx) + const hsize_t *ptdata, h5tools_context_t *ctx) { size_t i = 0; diff --git a/tools/lib/h5tools_str.h b/tools/lib/h5tools_str.h index c207a835965..eee87c9a631 100644 --- a/tools/lib/h5tools_str.h +++ b/tools/lib/h5tools_str.h @@ -36,7 +36,7 @@ H5TOOLS_DLL char * h5tools_str_prefix(h5tools_str_t *str, const h5tool_format_t * new functions needed to display region reference data */ H5TOOLS_DLL char *h5tools_str_region_prefix(h5tools_str_t *str, const h5tool_format_t *info, hsize_t elmtno, - hsize_t *ptdata, h5tools_context_t *ctx); + const hsize_t *ptdata, h5tools_context_t *ctx); H5TOOLS_DLL void h5tools_str_dump_space_slabs(h5tools_str_t *, hid_t, const h5tool_format_t *, h5tools_context_t *ctx); H5TOOLS_DLL void h5tools_str_dump_space_blocks(h5tools_str_t *, hid_t, const h5tool_format_t *); diff --git a/tools/lib/h5trav.c b/tools/lib/h5trav.c index 042288cf4fe..41dcd6b4d74 100644 --- a/tools/lib/h5trav.c +++ b/tools/lib/h5trav.c @@ -731,7 +731,7 @@ trav_table_addlink(trav_table_t *table, const H5O_token_t *obj_token, const char *------------------------------------------------------------------------- */ void -trav_table_addflags(unsigned *flags, char *name, h5trav_type_t type, trav_table_t *table) +trav_table_addflags(const unsigned *flags, char *name, h5trav_type_t type, trav_table_t *table) { size_t new_obj; diff --git a/tools/lib/h5trav.h b/tools/lib/h5trav.h index c7b9db70df0..7a8a63db487 100644 --- a/tools/lib/h5trav.h +++ b/tools/lib/h5trav.h @@ -187,6 +187,7 @@ H5TOOLS_DLL void trav_table_init(hid_t fid, trav_table_t **table); H5TOOLS_DLL void trav_table_free(trav_table_t *table); -H5TOOLS_DLL void trav_table_addflags(unsigned *flags, char *objname, h5trav_type_t type, trav_table_t *table); +H5TOOLS_DLL void trav_table_addflags(const unsigned *flags, char *objname, h5trav_type_t type, + trav_table_t *table); #endif /* H5TRAV_H */ diff --git a/tools/src/h5repack/h5repack.h b/tools/src/h5repack/h5repack.h index 0838c214aea..74525f4ef36 100644 --- a/tools/src/h5repack/h5repack.h +++ b/tools/src/h5repack/h5repack.h @@ -195,13 +195,13 @@ void init_packobject(pack_info_t *obj); *------------------------------------------------------------------------- */ -int apply_filters(const char *name, /* object name from traverse list */ - int rank, /* rank of dataset */ - hsize_t * dims, /* dimensions of dataset */ - size_t msize, /* size of type */ - hid_t dcpl_id, /* dataset creation property list */ - pack_opt_t *options, /* repack options */ - int * has_filter); /* (OUT) object NAME has a filter */ +int apply_filters(const char * name, /* object name from traverse list */ + int rank, /* rank of dataset */ + const hsize_t *dims, /* dimensions of dataset */ + size_t msize, /* size of type */ + hid_t dcpl_id, /* dataset creation property list */ + pack_opt_t * options, /* repack options */ + int * has_filter); /* (OUT) object NAME has a filter */ /*------------------------------------------------------------------------- * options table diff --git a/tools/src/h5repack/h5repack_copy.c b/tools/src/h5repack/h5repack_copy.c index 0aef7105f97..72e2147398d 100644 --- a/tools/src/h5repack/h5repack_copy.c +++ b/tools/src/h5repack/h5repack_copy.c @@ -37,7 +37,7 @@ * local functions *------------------------------------------------------------------------- */ -static int get_hyperslab(hid_t dcpl_id, int rank_dset, hsize_t dims_dset[], size_t size_datum, +static int get_hyperslab(hid_t dcpl_id, int rank_dset, const hsize_t dims_dset[], size_t size_datum, hsize_t dims_hslab[], hsize_t *hslab_nbytes_p); static void print_dataset_info(hid_t dcpl_id, char *objname, double per, int pr); static int do_copy_objects(hid_t fidin, hid_t fidout, trav_table_t *travt, pack_opt_t *options); @@ -406,8 +406,8 @@ copy_objects(const char *fnamein, const char *fnameout, pack_opt_t *options) *-----------------------------------------*/ int -get_hyperslab(hid_t dcpl_id, int rank_dset, hsize_t dims_dset[], size_t size_datum, hsize_t dims_hslab[], - hsize_t *hslab_nbytes_p) +get_hyperslab(hid_t dcpl_id, int rank_dset, const hsize_t dims_dset[], size_t size_datum, + hsize_t dims_hslab[], hsize_t *hslab_nbytes_p) { int k; H5D_layout_t dset_layout; diff --git a/tools/src/h5repack/h5repack_filters.c b/tools/src/h5repack/h5repack_filters.c index 66fdf451287..32476ceb3bc 100644 --- a/tools/src/h5repack/h5repack_filters.c +++ b/tools/src/h5repack/h5repack_filters.c @@ -236,13 +236,13 @@ aux_assign_obj(const char * name, /* object name from traverse list */ */ int -apply_filters(const char *name, /* object name from traverse list */ - int rank, /* rank of dataset */ - hsize_t * dims, /* dimensions of dataset */ - size_t msize, /* size of type */ - hid_t dcpl_id, /* dataset creation property list */ - pack_opt_t *options, /* repack options */ - int * has_filter) /* (OUT) object NAME has a filter */ +apply_filters(const char * name, /* object name from traverse list */ + int rank, /* rank of dataset */ + const hsize_t *dims, /* dimensions of dataset */ + size_t msize, /* size of type */ + hid_t dcpl_id, /* dataset creation property list */ + pack_opt_t * options, /* repack options */ + int * has_filter) /* (OUT) object NAME has a filter */ { int nfilters; /* number of filters in DCPL */ hsize_t chsize[64]; /* chunk size in elements */ From e391ca0750151c80f6b3f91684b570b899cee165 Mon Sep 17 00:00:00 2001 From: Sean McBride Date: Wed, 10 Mar 2021 12:52:48 -0500 Subject: [PATCH 12/21] Added C++11 override keyword where appropriate (#433) Added H5_OVERRIDE macro for compatibility with both C++11 and older. --- c++/src/H5DataSpace.h | 8 ++++---- c++/src/H5Exception.h | 24 ++++++++++++------------ c++/src/H5File.h | 12 ++++++------ c++/src/H5Group.h | 14 +++++++------- c++/src/H5Include.h | 7 +++++++ c++/src/H5Object.h | 6 +++--- 6 files changed, 39 insertions(+), 32 deletions(-) diff --git a/c++/src/H5DataSpace.h b/c++/src/H5DataSpace.h index f16acfcf4f0..470de74cc7c 100644 --- a/c++/src/H5DataSpace.h +++ b/c++/src/H5DataSpace.h @@ -43,7 +43,7 @@ class H5_DLLCPP DataSpace : public IdComponent { DataSpace &operator=(const DataSpace &rhs); // Closes this dataspace. - virtual void close(); + virtual void close() H5_OVERRIDE; // Makes copy of an existing dataspace. void copy(const DataSpace &like_space); @@ -115,13 +115,13 @@ class H5_DLLCPP DataSpace : public IdComponent { ///\brief Returns this class name. virtual H5std_string - fromClass() const + fromClass() const H5_OVERRIDE { return ("DataSpace"); } // Gets the dataspace id. - virtual hid_t getId() const; + virtual hid_t getId() const H5_OVERRIDE; // Deletes the global constant static void deleteConstants(); @@ -133,7 +133,7 @@ class H5_DLLCPP DataSpace : public IdComponent { protected: // Sets the dataspace id. - virtual void p_setId(const hid_t new_id); + virtual void p_setId(const hid_t new_id) H5_OVERRIDE; #endif // DOXYGEN_SHOULD_SKIP_THIS diff --git a/c++/src/H5Exception.h b/c++/src/H5Exception.h index 566c818eaba..ddc45f7c781 100644 --- a/c++/src/H5Exception.h +++ b/c++/src/H5Exception.h @@ -94,84 +94,84 @@ class H5_DLLCPP FileIException : public Exception { public: FileIException(const H5std_string &func_name, const H5std_string &message = DEFAULT_MSG); FileIException(); - virtual ~FileIException() throw(); + virtual ~FileIException() throw() H5_OVERRIDE; }; class H5_DLLCPP GroupIException : public Exception { public: GroupIException(const H5std_string &func_name, const H5std_string &message = DEFAULT_MSG); GroupIException(); - virtual ~GroupIException() throw(); + virtual ~GroupIException() throw() H5_OVERRIDE; }; class H5_DLLCPP DataSpaceIException : public Exception { public: DataSpaceIException(const H5std_string &func_name, const H5std_string &message = DEFAULT_MSG); DataSpaceIException(); - virtual ~DataSpaceIException() throw(); + virtual ~DataSpaceIException() throw() H5_OVERRIDE; }; class H5_DLLCPP DataTypeIException : public Exception { public: DataTypeIException(const H5std_string &func_name, const H5std_string &message = DEFAULT_MSG); DataTypeIException(); - virtual ~DataTypeIException() throw(); + virtual ~DataTypeIException() throw() H5_OVERRIDE; }; class H5_DLLCPP ObjHeaderIException : public Exception { public: ObjHeaderIException(const H5std_string &func_name, const H5std_string &message = DEFAULT_MSG); ObjHeaderIException(); - virtual ~ObjHeaderIException() throw(); + virtual ~ObjHeaderIException() throw() H5_OVERRIDE; }; class H5_DLLCPP PropListIException : public Exception { public: PropListIException(const H5std_string &func_name, const H5std_string &message = DEFAULT_MSG); PropListIException(); - virtual ~PropListIException() throw(); + virtual ~PropListIException() throw() H5_OVERRIDE; }; class H5_DLLCPP DataSetIException : public Exception { public: DataSetIException(const H5std_string &func_name, const H5std_string &message = DEFAULT_MSG); DataSetIException(); - virtual ~DataSetIException() throw(); + virtual ~DataSetIException() throw() H5_OVERRIDE; }; class H5_DLLCPP AttributeIException : public Exception { public: AttributeIException(const H5std_string &func_name, const H5std_string &message = DEFAULT_MSG); AttributeIException(); - virtual ~AttributeIException() throw(); + virtual ~AttributeIException() throw() H5_OVERRIDE; }; class H5_DLLCPP ReferenceException : public Exception { public: ReferenceException(const H5std_string &func_name, const H5std_string &message = DEFAULT_MSG); ReferenceException(); - virtual ~ReferenceException() throw(); + virtual ~ReferenceException() throw() H5_OVERRIDE; }; class H5_DLLCPP LibraryIException : public Exception { public: LibraryIException(const H5std_string &func_name, const H5std_string &message = DEFAULT_MSG); LibraryIException(); - virtual ~LibraryIException() throw(); + virtual ~LibraryIException() throw() H5_OVERRIDE; }; class H5_DLLCPP LocationException : public Exception { public: LocationException(const H5std_string &func_name, const H5std_string &message = DEFAULT_MSG); LocationException(); - virtual ~LocationException() throw(); + virtual ~LocationException() throw() H5_OVERRIDE; }; class H5_DLLCPP IdComponentException : public Exception { public: IdComponentException(const H5std_string &func_name, const H5std_string &message = DEFAULT_MSG); IdComponentException(); - virtual ~IdComponentException() throw(); + virtual ~IdComponentException() throw() H5_OVERRIDE; }; // end of IdComponentException } // namespace H5 diff --git a/c++/src/H5File.h b/c++/src/H5File.h index d287031c7bc..6126eec455c 100644 --- a/c++/src/H5File.h +++ b/c++/src/H5File.h @@ -39,7 +39,7 @@ class H5_DLLCPP H5File : public Group { const FileAccPropList &access_plist = FileAccPropList::DEFAULT); // Close this file. - virtual void close(); + virtual void close() H5_OVERRIDE; // Gets a copy of the access property list of this file. FileAccPropList getAccessPlist() const; @@ -96,16 +96,16 @@ class H5_DLLCPP H5File : public Group { ///\brief Returns this class name. virtual H5std_string - fromClass() const + fromClass() const H5_OVERRIDE { return ("H5File"); } // Throw file exception. - virtual void throwException(const H5std_string &func_name, const H5std_string &msg) const; + virtual void throwException(const H5std_string &func_name, const H5std_string &msg) const H5_OVERRIDE; // For CommonFG to get the file id. - virtual hid_t getLocId() const; + virtual hid_t getLocId() const H5_OVERRIDE; // Default constructor H5File(); @@ -114,7 +114,7 @@ class H5_DLLCPP H5File : public Group { H5File(const H5File &original); // Gets the HDF5 file id. - virtual hid_t getId() const; + virtual hid_t getId() const H5_OVERRIDE; // H5File destructor. virtual ~H5File(); @@ -122,7 +122,7 @@ class H5_DLLCPP H5File : public Group { protected: #ifndef DOXYGEN_SHOULD_SKIP_THIS // Sets the HDF5 file id. - virtual void p_setId(const hid_t new_id); + virtual void p_setId(const hid_t new_id) H5_OVERRIDE; #endif // DOXYGEN_SHOULD_SKIP_THIS private: diff --git a/c++/src/H5Group.h b/c++/src/H5Group.h index 2a0f18e98a4..fb9fbe71b7f 100644 --- a/c++/src/H5Group.h +++ b/c++/src/H5Group.h @@ -24,20 +24,20 @@ namespace H5 { class H5_DLLCPP Group : public H5Object, public CommonFG { public: // Close this group. - virtual void close(); + virtual void close() H5_OVERRIDE; ///\brief Returns this class name. virtual H5std_string - fromClass() const + fromClass() const H5_OVERRIDE { return ("Group"); } // Throw group exception. - virtual void throwException(const H5std_string &func_name, const H5std_string &msg) const; + virtual void throwException(const H5std_string &func_name, const H5std_string &msg) const H5_OVERRIDE; // for CommonFG to get the file id. - virtual hid_t getLocId() const; + virtual hid_t getLocId() const H5_OVERRIDE; // Creates a group by way of dereference. Group(const H5Location &loc, const void *ref, H5R_type_t ref_type = H5R_OBJECT, @@ -63,10 +63,10 @@ class H5_DLLCPP Group : public H5Object, public CommonFG { Group(const Group &original); // Gets the group id. - virtual hid_t getId() const; + virtual hid_t getId() const H5_OVERRIDE; // Destructor - virtual ~Group(); + virtual ~Group() H5_OVERRIDE; // Creates a copy of an existing group using its id. Group(const hid_t group_id); @@ -74,7 +74,7 @@ class H5_DLLCPP Group : public H5Object, public CommonFG { protected: #ifndef DOXYGEN_SHOULD_SKIP_THIS // Sets the group id. - virtual void p_setId(const hid_t new_id); + virtual void p_setId(const hid_t new_id) H5_OVERRIDE; #endif // DOXYGEN_SHOULD_SKIP_THIS private: diff --git a/c++/src/H5Include.h b/c++/src/H5Include.h index 1f031508f19..ac38340e648 100644 --- a/c++/src/H5Include.h +++ b/c++/src/H5Include.h @@ -37,3 +37,10 @@ const bool true = 1; * magic number as prefix and checksum as suffix for all chunks. */ #define H5O_VERSION_2 2 + +// Define H5_OVERRIDE to override for C++11. +#if defined(__cplusplus) && (201103L <= __cplusplus) +#define H5_OVERRIDE override +#else +#define H5_OVERRIDE +#endif diff --git a/c++/src/H5Object.h b/c++/src/H5Object.h index 868f63f1d61..bc2f14a1860 100644 --- a/c++/src/H5Object.h +++ b/c++/src/H5Object.h @@ -106,7 +106,7 @@ class H5_DLLCPP H5Object : public H5Location { void removeAttr(const H5std_string &name) const; // Returns an identifier. - virtual hid_t getId() const = 0; + virtual hid_t getId() const H5_OVERRIDE = 0; // Gets the name of this HDF5 object, i.e., Group, DataSet, or // DataType. @@ -122,10 +122,10 @@ class H5_DLLCPP H5Object : public H5Location { // Sets the identifier of this object to a new value. - this one // doesn't increment reference count - virtual void p_setId(const hid_t new_id) = 0; + virtual void p_setId(const hid_t new_id) H5_OVERRIDE = 0; // Noop destructor. - virtual ~H5Object(); + virtual ~H5Object() H5_OVERRIDE; #endif // DOXYGEN_SHOULD_SKIP_THIS From aaa4929673e1e30107cbf8fe2826a63f36d3acfa Mon Sep 17 00:00:00 2001 From: Sean McBride Date: Wed, 10 Mar 2021 13:41:34 -0500 Subject: [PATCH 13/21] Various clang tidy warning fixes (#448) * Fixed clang-tidy bugprone-reserved-identifier warnings * Fixed clang-tidy bugprone-assert-side-effect warnings * Fixed clang-tidy bugprone-copy-constructor-init warning * Fixed clang-tidy readability-redundant-preprocessor warning For error_test.c the removed code was already dead, because it was in the else of an `#if H5_USE_16_API` block. Based on H5Location.h, I think p_get_ref_obj_type was meant to be in `#ifndef DOXYGEN_SHOULD_SKIP_THIS` and an `#endif` was missing. Similarly, in the header, getObjTypeByIdx is only in H5_NO_DEPRECATED_SYMBOLS, not DOXYGEN_SHOULD_SKIP_THIS. * Fixed clang-tidy readability-redundant-string-init warnings * Fixed some clang-tidy performance-type-promotion-in-math-fn warnings * Fixed clang-tidy performance-unnecessary-value-param warnings * Reformat source with clang v10.0.1. Co-authored-by: Larry Knox --- c++/src/H5Attribute.cpp | 2 +- c++/src/H5DcreatProp.cpp | 4 +-- c++/src/H5DcreatProp.h | 2 +- c++/src/H5DxferProp.cpp | 2 +- c++/src/H5Exception.cpp | 2 +- c++/src/H5File.cpp | 2 +- c++/src/H5Location.cpp | 11 +++--- c++/src/H5Object.cpp | 2 +- c++/test/dsets.cpp | 2 +- c++/test/h5cpputil.cpp | 4 +-- c++/test/h5cpputil.h | 4 +-- src/H5Tconv.c | 4 +-- src/H5Zscaleoffset.c | 4 +-- test/cache_common.c | 4 +-- test/dsets.c | 38 ++++++++++---------- test/earray.c | 50 +++++++++++++------------- test/error_test.c | 5 --- test/external.c | 6 ++-- test/ohdr.c | 6 ++-- tools/test/h5diff/h5diffgentest.c | 52 +++++++++++++-------------- tools/test/h5repack/h5repackgentest.c | 34 +++++++++--------- tools/test/perform/sio_engine.c | 2 +- tools/test/perform/sio_perf.c | 2 +- 23 files changed, 119 insertions(+), 125 deletions(-) diff --git a/c++/src/H5Attribute.cpp b/c++/src/H5Attribute.cpp index 81e656f74b5..fd69c131527 100644 --- a/c++/src/H5Attribute.cpp +++ b/c++/src/H5Attribute.cpp @@ -312,7 +312,7 @@ Attribute::getName(char *attr_name, size_t buf_size) const H5std_string Attribute::getName() const { - H5std_string attr_name(""); // attribute name to return + H5std_string attr_name; // attribute name to return // Preliminary call to get the size of the attribute name ssize_t name_size = H5Aget_name(id, static_cast(0), NULL); diff --git a/c++/src/H5DcreatProp.cpp b/c++/src/H5DcreatProp.cpp index d670b74263d..0ffcbf754b1 100644 --- a/c++/src/H5DcreatProp.cpp +++ b/c++/src/H5DcreatProp.cpp @@ -769,8 +769,8 @@ DSetCreatPropList::setVirtual(const DataSpace &vspace, const char *src_fname, co // Programmer Binh-Minh Ribler - Mar, 2017 //-------------------------------------------------------------------------- void -DSetCreatPropList::setVirtual(const DataSpace &vspace, const H5std_string src_fname, - const H5std_string src_dsname, const DataSpace &sspace) const +DSetCreatPropList::setVirtual(const DataSpace &vspace, const H5std_string &src_fname, + const H5std_string &src_dsname, const DataSpace &sspace) const { setVirtual(vspace, src_fname.c_str(), src_dsname.c_str(), sspace); } diff --git a/c++/src/H5DcreatProp.h b/c++/src/H5DcreatProp.h index 3c032ee5c6d..820c0d1df19 100644 --- a/c++/src/H5DcreatProp.h +++ b/c++/src/H5DcreatProp.h @@ -123,7 +123,7 @@ class H5_DLLCPP DSetCreatPropList : public ObjCreatPropList { // Maps elements of a virtual dataset to elements of the source dataset. void setVirtual(const DataSpace &vspace, const char *src_fname, const char *src_dsname, const DataSpace &sspace) const; - void setVirtual(const DataSpace &vspace, const H5std_string src_fname, const H5std_string src_dsname, + void setVirtual(const DataSpace &vspace, const H5std_string &src_fname, const H5std_string &src_dsname, const DataSpace &sspace) const; ///\brief Returns this class name. diff --git a/c++/src/H5DxferProp.cpp b/c++/src/H5DxferProp.cpp index d9d78846e53..98e62147a9e 100644 --- a/c++/src/H5DxferProp.cpp +++ b/c++/src/H5DxferProp.cpp @@ -306,7 +306,7 @@ DSetMemXferPropList::getDataTransform() const { // Initialize string to "", so that if there is no expression, the returned // string will be empty - H5std_string expression(""); + H5std_string expression; // Preliminary call to get the expression's length ssize_t exp_len = H5Pget_data_transform(id, NULL, (size_t)0); diff --git a/c++/src/H5Exception.cpp b/c++/src/H5Exception.cpp index 1aa8ecc7471..8ea20ff7924 100644 --- a/c++/src/H5Exception.cpp +++ b/c++/src/H5Exception.cpp @@ -25,7 +25,7 @@ const char Exception::DEFAULT_MSG[] = "No detailed information provided"; ///\brief Default constructor. // Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- -Exception::Exception() : detail_message(""), func_name("") {} +Exception::Exception() {} //-------------------------------------------------------------------------- // Function: Exception overloaded constructor diff --git a/c++/src/H5File.cpp b/c++/src/H5File.cpp index cdc9b45cca2..19c12bb543e 100644 --- a/c++/src/H5File.cpp +++ b/c++/src/H5File.cpp @@ -182,7 +182,7 @@ H5File::H5File(hid_t existing_id) : Group() ///\param original - IN: H5File instance to copy // December 2000 //-------------------------------------------------------------------------- -H5File::H5File(const H5File &original) : Group() +H5File::H5File(const H5File &original) : Group(original) { id = original.getId(); incRefCount(); // increment number of references to this id diff --git a/c++/src/H5Location.cpp b/c++/src/H5Location.cpp index 2d14bfcd1bb..b136faa16e5 100644 --- a/c++/src/H5Location.cpp +++ b/c++/src/H5Location.cpp @@ -346,7 +346,7 @@ H5Location::getComment(const char *name, size_t buf_size) const { // Initialize string to "", so that if there is no comment, the returned // string will be empty - H5std_string comment(""); + H5std_string comment; // Preliminary call to get the comment's length ssize_t comment_len = H5Oget_comment_by_name(getId(), name, NULL, (size_t)0, H5P_DEFAULT); @@ -398,6 +398,7 @@ H5Location::getComment(const H5std_string &name, size_t buf_size) const { return (getComment(name.c_str(), buf_size)); } + #ifndef DOXYGEN_SHOULD_SKIP_THIS //-------------------------------------------------------------------------- @@ -646,6 +647,7 @@ H5Location::p_get_obj_type(void *ref, H5R_type_t ref_type) const return (obj_type); } #endif // DOXYGEN_SHOULD_SKIP_THIS + #endif /* H5_NO_DEPRECATED_SYMBOLS */ //-------------------------------------------------------------------------- @@ -704,6 +706,7 @@ H5Location::p_get_ref_obj_type(void *ref, H5R_type_t ref_type) const } return (obj_type); } +#endif // DOXYGEN_SHOULD_SKIP_THIS //-------------------------------------------------------------------------- // Function: H5Location::getRegion @@ -1816,7 +1819,7 @@ H5Location::getLinkval(const char *name, size_t size) const H5L_info2_t linkinfo; char * value_C; // value in C string size_t val_size = size; - H5std_string value = ""; + H5std_string value; herr_t ret_value; // if user doesn't provide buffer size, determine it @@ -2294,7 +2297,6 @@ H5Location::childObjVersion(const H5std_string &objname) const } #ifndef H5_NO_DEPRECATED_SYMBOLS -#ifndef DOXYGEN_SHOULD_SKIP_THIS //-------------------------------------------------------------------------- // Function: H5Location::getObjTypeByIdx ///\brief Returns the type of an object in this group, given the @@ -2372,7 +2374,6 @@ H5Location::getObjTypeByIdx(hsize_t idx, H5std_string &type_name) const return (obj_type); } -#endif // DOXYGEN_SHOULD_SKIP_THIS #endif /* H5_NO_DEPRECATED_SYMBOLS */ //-------------------------------------------------------------------------- @@ -2433,6 +2434,4 @@ f_DataSpace_setId(DataSpace *dspace, hid_t new_id) //-------------------------------------------------------------------------- H5Location::~H5Location() {} -#endif // DOXYGEN_SHOULD_SKIP_THIS - } // namespace H5 diff --git a/c++/src/H5Object.cpp b/c++/src/H5Object.cpp index 725d1dabd0b..c2eba8d7f08 100644 --- a/c++/src/H5Object.cpp +++ b/c++/src/H5Object.cpp @@ -477,7 +477,7 @@ H5Object::getObjName(char *obj_name, size_t buf_size) const H5std_string H5Object::getObjName() const { - H5std_string obj_name(""); // object name to return + H5std_string obj_name; // object name to return // Preliminary call to get the size of the object name ssize_t name_size = H5Iget_name(getId(), NULL, static_cast(0)); diff --git a/c++/test/dsets.cpp b/c++/test/dsets.cpp index 03e49277613..da4d391fd21 100644 --- a/c++/test/dsets.cpp +++ b/c++/test/dsets.cpp @@ -1161,7 +1161,7 @@ const int RANK1 = 1; const H5std_string FILE_ACCPLIST("test_accplist.h5"); static herr_t -test_chunk_cache(FileAccPropList fapl) +test_chunk_cache(const FileAccPropList &fapl) { SUBTEST("DSetAccPropList::set/getChunkCache"); diff --git a/c++/test/h5cpputil.cpp b/c++/test/h5cpputil.cpp index e38b34ad936..84bb2b391aa 100644 --- a/c++/test/h5cpputil.cpp +++ b/c++/test/h5cpputil.cpp @@ -216,7 +216,7 @@ InvalidActionException::InvalidActionException() : Exception() {} // func - IN: Name of the function where failure should occur // message - IN: Message //-------------------------------------------------------------------------- -InvalidActionException::InvalidActionException(const H5std_string func, const H5std_string message) +InvalidActionException::InvalidActionException(const H5std_string &func, const H5std_string &message) : Exception(func, message) { } @@ -241,7 +241,7 @@ TestFailedException::TestFailedException() : Exception() {} // func - IN: Name of the function where failure should occur // message - IN: Message //-------------------------------------------------------------------------- -TestFailedException::TestFailedException(const H5std_string func, const H5std_string message) +TestFailedException::TestFailedException(const H5std_string &func, const H5std_string &message) : Exception(func, message) { } diff --git a/c++/test/h5cpputil.h b/c++/test/h5cpputil.h index 4439ae3f661..444bc680d8b 100644 --- a/c++/test/h5cpputil.h +++ b/c++/test/h5cpputil.h @@ -48,14 +48,14 @@ void issue_fail_msg(const char *where, int line, const char *file_name, const ch class InvalidActionException : public Exception { public: - InvalidActionException(const H5std_string func_name, const H5std_string message = DEFAULT_MSG); + InvalidActionException(const H5std_string &func_name, const H5std_string &message = DEFAULT_MSG); InvalidActionException(); virtual ~InvalidActionException() throw(); }; class TestFailedException : public Exception { public: - TestFailedException(const H5std_string func_name, const H5std_string message = DEFAULT_MSG); + TestFailedException(const H5std_string &func_name, const H5std_string &message = DEFAULT_MSG); TestFailedException(); virtual ~TestFailedException() throw(); }; diff --git a/src/H5Tconv.c b/src/H5Tconv.c index 60ad627ec56..8cc6ede26bb 100644 --- a/src/H5Tconv.c +++ b/src/H5Tconv.c @@ -8477,7 +8477,7 @@ H5T__conv_f_i(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, siz /* Allocate enough space for the buffer holding temporary * converted value */ - buf_size = (size_t)(HDpow((double)2.0f, (double)src.u.f.esize) / 8 + 1); + buf_size = (size_t)(HDpow(2.0, (double)src.u.f.esize) / 8 + 1); int_buf = (uint8_t *)H5MM_calloc(buf_size); /* Get conversion exception callback property */ @@ -9315,7 +9315,7 @@ H5T__conv_i_f(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, siz } /* Check if the exponent is too big */ - expo_max = (hsize_t)(HDpow((double)2.0f, (double)dst.u.f.esize) - 1); + expo_max = (hsize_t)(HDpow(2.0, (double)dst.u.f.esize) - 1); if (expo > expo_max) { /*overflows*/ if (cb_struct.func) { /*user's exception handler. Reverse back source order*/ diff --git a/src/H5Zscaleoffset.c b/src/H5Zscaleoffset.c index 9a222ea5d19..25acc05a58c 100644 --- a/src/H5Zscaleoffset.c +++ b/src/H5Zscaleoffset.c @@ -364,12 +364,12 @@ H5Z_class2_t H5Z_SCALEOFFSET[1] = {{ #define H5Z_scaleoffset_max_min_3(i, d_nelmts, buf, filval, max, min, D_val) \ { \ i = 0; \ - while (i < d_nelmts && HDfabs(buf[i] - filval) < HDpow(10.0f, -D_val)) \ + while (i < d_nelmts && HDfabs(buf[i] - filval) < HDpow(10.0, -D_val)) \ i++; \ if (i < d_nelmts) \ min = max = buf[i]; \ for (; i < d_nelmts; i++) { \ - if (HDfabs(buf[i] - filval) < HDpow(10.0f, -D_val)) \ + if (HDfabs(buf[i] - filval) < HDpow(10.0, -D_val)) \ continue; /* ignore fill value */ \ if (buf[i] > max) \ max = buf[i]; \ diff --git a/test/cache_common.c b/test/cache_common.c index 54b1cc5079d..676b8d105a3 100644 --- a/test/cache_common.c +++ b/test/cache_common.c @@ -1683,7 +1683,7 @@ execute_flush_op(H5F_t *file_ptr, struct test_entry_t *entry_ptr, struct flush_o HDassert(cache_ptr != NULL); HDassert(cache_ptr->magic == H5C__H5C_T_MAGIC); HDassert(entry_ptr != NULL); - HDassert(entry_ptr = entry_ptr->self); + HDassert(entry_ptr == entry_ptr->self); HDassert(entry_ptr->header.addr == entry_ptr->addr); HDassert((entry_ptr->flush_op_self_resize_in_progress) || (entry_ptr->header.size == entry_ptr->size)); HDassert(op_ptr != NULL); @@ -2243,7 +2243,7 @@ resize_entry(H5F_t *file_ptr, int32_t type, int32_t idx, size_t new_size, hbool_ } else { - HDassert(entry_ptr->size = (entry_ptr->header).size); + HDassert(entry_ptr->size == (entry_ptr->header).size); } } } diff --git a/test/dsets.c b/test/dsets.c index 98df82083a2..a7b9358294b 100644 --- a/test/dsets.c +++ b/test/dsets.c @@ -3181,7 +3181,7 @@ test_nbit_int(hid_t file) /* Initialize data, assuming size of long long >= size of int */ for (i = 0; i < (size_t)size[0]; i++) for (j = 0; j < (size_t)size[1]; j++) { - power = HDpow(2.0f, (double)(precision - 1)); + power = HDpow(2.0, (double)(precision - 1)); orig_data[i][j] = (int)(((long long)HDrandom() % (long long)power) << offset); /* even-numbered values are negtive */ @@ -3558,7 +3558,7 @@ test_nbit_array(hid_t file) for (j = 0; j < (size_t)size[1]; j++) for (m = 0; m < (size_t)adims[0]; m++) for (n = 0; n < (size_t)adims[1]; n++) { - power = HDpow(2.0F, (double)precision); + power = HDpow(2.0, (double)precision); orig_data[i][j][m][n] = (unsigned int)(((long long)HDrandom() % (long long)power) << offset); } /* end for */ @@ -3754,11 +3754,11 @@ test_nbit_compound(hid_t file) /* Initialize data, assuming size of long long >= size of member datatypes */ for (i = 0; i < (size_t)size[0]; i++) for (j = 0; j < (size_t)size[1]; j++) { - power = HDpow(2.0F, (double)(precision[0] - 1)); + power = HDpow(2.0, (double)(precision[0] - 1)); orig_data[i][j].i = (int)(((long long)HDrandom() % (long long)power) << offset[0]); - power = HDpow(2.0F, (double)(precision[1] - 1)); + power = HDpow(2.0, (double)(precision[1] - 1)); orig_data[i][j].c = (char)(((long long)HDrandom() % (long long)power) << offset[1]); - power = HDpow(2.0F, (double)(precision[2] - 1)); + power = HDpow(2.0, (double)(precision[2] - 1)); orig_data[i][j].s = (short)(((long long)HDrandom() % (long long)power) << offset[2]); orig_data[i][j].f = float_val[i][j]; @@ -4036,32 +4036,32 @@ test_nbit_compound_2(hid_t file) /* Initialize data, assuming size of long long >= size of member datatypes */ for (i = 0; i < (size_t)size[0]; i++) for (j = 0; j < (size_t)size[1]; j++) { - power = HDpow(2.0F, (double)(precision[0] - 1)); + power = HDpow(2.0, (double)(precision[0] - 1)); orig_data[i][j].a.i = (int)(((long long)HDrandom() % (long long)power) << offset[0]); - power = HDpow(2.0F, (double)(precision[1] - 1)); + power = HDpow(2.0, (double)(precision[1] - 1)); orig_data[i][j].a.c = (char)(((long long)HDrandom() % (long long)power) << offset[1]); - power = HDpow(2.0F, (double)(precision[2] - 1)); + power = HDpow(2.0, (double)(precision[2] - 1)); orig_data[i][j].a.s = (short)(-(((long long)HDrandom() % (long long)power) << offset[2])); orig_data[i][j].a.f = float_val[i][j]; - power = HDpow(2.0F, (double)precision[3]); + power = HDpow(2.0, (double)precision[3]); orig_data[i][j].v = (unsigned int)(((long long)HDrandom() % (long long)power) << offset[3]); for (m = 0; m < (size_t)array_dims[0]; m++) for (n = 0; n < (size_t)array_dims[1]; n++) { - power = HDpow(2.0F, (double)(precision[4] - 1)); + power = HDpow(2.0, (double)(precision[4] - 1)); orig_data[i][j].b[m][n] = (char)(((long long)HDrandom() % (long long)power) << offset[4]); } /* end for */ for (m = 0; m < (size_t)array_dims[0]; m++) for (n = 0; n < (size_t)array_dims[1]; n++) { - power = HDpow(2.0F, (double)(precision[0] - 1)); + power = HDpow(2.0, (double)(precision[0] - 1)); orig_data[i][j].d[m][n].i = (int)(-(((long long)HDrandom() % (long long)power) << offset[0])); - power = HDpow(2.0F, (double)(precision[1] - 1)); + power = HDpow(2.0, (double)(precision[1] - 1)); orig_data[i][j].d[m][n].c = (char)(((long long)HDrandom() % (long long)power) << offset[1]); - power = HDpow(2.0F, (double)(precision[2] - 1)); + power = HDpow(2.0, (double)(precision[2] - 1)); orig_data[i][j].d[m][n].s = (short)(((long long)HDrandom() % (long long)power) << offset[2]); orig_data[i][j].d[m][n].f = float_val[i][j]; @@ -4292,7 +4292,7 @@ test_nbit_compound_3(hid_t file) /* Initialize data */ for (i = 0; i < (size_t)size[0]; i++) { - power = HDpow(2.0F, 17.0F - 1.0F); + power = HDpow(2.0, 17.0 - 1.0); HDmemset(&orig_data[i], 0, sizeof(orig_data[i])); orig_data[i].i = (int)(HDrandom() % (long)power); HDstrcpy(orig_data[i].str, "fixed-length C string"); @@ -4481,7 +4481,7 @@ test_nbit_int_size(hid_t file) */ for (i = 0; i < DSET_DIM1; i++) for (j = 0; j < DSET_DIM2; j++) { - power = HDpow(2.0F, (double)(precision - 1)); + power = HDpow(2.0, (double)(precision - 1)); orig[i][j] = HDrandom() % (int)power << offset; } @@ -5145,7 +5145,7 @@ test_scaleoffset_float(hid_t file) /* Check that the values read are the same as the values written */ for (i = 0; i < (size_t)size[0]; i++) { for (j = 0; j < (size_t)size[1]; j++) { - if (HDfabs(new_data[i][j] - orig_data[i][j]) > HDpow(10.0F, -3.0F)) { + if (HDfabs(new_data[i][j] - orig_data[i][j]) > HDpow(10.0, -3.0)) { H5_FAILED(); HDprintf(" Read different values than written.\n"); HDprintf(" At index %lu,%lu\n", (unsigned long)i, (unsigned long)j); @@ -5291,7 +5291,7 @@ test_scaleoffset_float_2(hid_t file) /* Check that the values read are the same as the values written */ for (j = 0; j < (size_t)size[1]; j++) { - if (HDfabs(new_data[0][j] - orig_data[0][j]) > HDpow(10.0F, -3.0F)) { + if (HDfabs(new_data[0][j] - orig_data[0][j]) > HDpow(10.0, -3.0)) { H5_FAILED(); HDprintf(" Read different values than written.\n"); HDprintf(" At index %lu,%lu\n", (unsigned long)0, (unsigned long)j); @@ -5412,7 +5412,7 @@ test_scaleoffset_double(hid_t file) /* Check that the values read are the same as the values written */ for (i = 0; i < (size_t)size[0]; i++) { for (j = 0; j < (size_t)size[1]; j++) { - if (HDfabs(new_data[i][j] - orig_data[i][j]) > HDpow(10.0F, -7.0F)) { + if (HDfabs(new_data[i][j] - orig_data[i][j]) > HDpow(10.0, -7.0)) { H5_FAILED(); HDprintf(" Read different values than written.\n"); HDprintf(" At index %lu,%lu\n", (unsigned long)i, (unsigned long)j); @@ -5558,7 +5558,7 @@ test_scaleoffset_double_2(hid_t file) /* Check that the values read are the same as the values written */ for (j = 0; j < (size_t)size[1]; j++) { - if (HDfabs(new_data[0][j] - orig_data[0][j]) > HDpow(10.0F, -7.0F)) { + if (HDfabs(new_data[0][j] - orig_data[0][j]) > HDpow(10.0, -7.0)) { H5_FAILED(); HDprintf(" Read different values than written.\n"); HDprintf(" At index %lu,%lu\n", (unsigned long)0, (unsigned long)j); diff --git a/test/earray.c b/test/earray.c index deb9acccc01..9b4a72e5739 100644 --- a/test/earray.c +++ b/test/earray.c @@ -122,7 +122,7 @@ typedef struct earray_iter_t { hsize_t cnt); /* Initialize/allocate iterator private info */ hssize_t (*next)(void *info); /* Get the next element to test */ hssize_t (*max_elem)(const void *info); /* Get the max. element set */ - int (*state)(void *_eiter, const H5EA_create_t *cparam, const earray_test_param_t *tparam, + int (*state)(void *in_eiter, const H5EA_create_t *cparam, const earray_test_param_t *tparam, earray_state_t *state, hsize_t idx); /* Get the state of the extensible array */ herr_t (*term)(void *info); /* Shutdown/free iterator private info */ } earray_iter_t; @@ -1290,9 +1290,9 @@ eiter_fw_init(const H5EA_create_t H5_ATTR_UNUSED *cparam, const earray_test_para *------------------------------------------------------------------------- */ static hssize_t -eiter_fw_next(void *_eiter) +eiter_fw_next(void *in_eiter) { - eiter_fw_t *eiter = (eiter_fw_t *)_eiter; + eiter_fw_t *eiter = (eiter_fw_t *)in_eiter; hssize_t ret_val; /* Sanity check */ @@ -1318,9 +1318,9 @@ eiter_fw_next(void *_eiter) *------------------------------------------------------------------------- */ static H5_ATTR_PURE hssize_t -eiter_fw_max(const void *_eiter) +eiter_fw_max(const void *in_eiter) { - const eiter_fw_t *eiter = (const eiter_fw_t *)_eiter; + const eiter_fw_t *eiter = (const eiter_fw_t *)in_eiter; /* Sanity check */ HDassert(eiter); @@ -1343,10 +1343,10 @@ eiter_fw_max(const void *_eiter) *------------------------------------------------------------------------- */ static int -eiter_fw_state(void *_eiter, const H5EA_create_t *cparam, const earray_test_param_t *tparam, +eiter_fw_state(void *in_eiter, const H5EA_create_t *cparam, const earray_test_param_t *tparam, earray_state_t *state, hsize_t idx) { - eiter_fw_t *eiter = (eiter_fw_t *)_eiter; + eiter_fw_t *eiter = (eiter_fw_t *)in_eiter; /* Sanity check */ HDassert(eiter); @@ -1490,9 +1490,9 @@ eiter_rv_init(const H5EA_create_t *cparam, const earray_test_param_t *tparam, hs *------------------------------------------------------------------------- */ static hssize_t -eiter_rv_next(void *_eiter) +eiter_rv_next(void *in_eiter) { - eiter_rv_t *eiter = (eiter_rv_t *)_eiter; + eiter_rv_t *eiter = (eiter_rv_t *)in_eiter; hssize_t ret_val; /* Sanity check */ @@ -1518,9 +1518,9 @@ eiter_rv_next(void *_eiter) *------------------------------------------------------------------------- */ static H5_ATTR_PURE hssize_t -eiter_rv_max(const void *_eiter) +eiter_rv_max(const void *in_eiter) { - const eiter_rv_t *eiter = (const eiter_rv_t *)_eiter; + const eiter_rv_t *eiter = (const eiter_rv_t *)in_eiter; /* Sanity check */ HDassert(eiter); @@ -1543,10 +1543,10 @@ eiter_rv_max(const void *_eiter) *------------------------------------------------------------------------- */ static int -eiter_rv_state(void *_eiter, const H5EA_create_t *cparam, const earray_test_param_t *tparam, +eiter_rv_state(void *in_eiter, const H5EA_create_t *cparam, const earray_test_param_t *tparam, earray_state_t *state, hsize_t idx) { - eiter_rv_t *eiter = (eiter_rv_t *)_eiter; + eiter_rv_t *eiter = (eiter_rv_t *)in_eiter; /* Sanity check */ HDassert(eiter); @@ -1720,9 +1720,9 @@ eiter_rnd_init(const H5EA_create_t H5_ATTR_UNUSED *cparam, const earray_test_par *------------------------------------------------------------------------- */ static hssize_t -eiter_rnd_next(void *_eiter) +eiter_rnd_next(void *in_eiter) { - eiter_rnd_t *eiter = (eiter_rnd_t *)_eiter; + eiter_rnd_t *eiter = (eiter_rnd_t *)in_eiter; hssize_t ret_val; /* Sanity check */ @@ -1753,9 +1753,9 @@ eiter_rnd_next(void *_eiter) *------------------------------------------------------------------------- */ static H5_ATTR_PURE hssize_t -eiter_rnd_max(const void *_eiter) +eiter_rnd_max(const void *in_eiter) { - const eiter_rnd_t *eiter = (const eiter_rnd_t *)_eiter; + const eiter_rnd_t *eiter = (const eiter_rnd_t *)in_eiter; /* Sanity check */ HDassert(eiter); @@ -1778,9 +1778,9 @@ eiter_rnd_max(const void *_eiter) *------------------------------------------------------------------------- */ static int -eiter_rnd_term(void *_eiter) +eiter_rnd_term(void *in_eiter) { - eiter_rnd_t *eiter = (eiter_rnd_t *)_eiter; + eiter_rnd_t *eiter = (eiter_rnd_t *)in_eiter; /* Sanity check */ HDassert(eiter); @@ -1934,9 +1934,9 @@ eiter_cyc_init(const H5EA_create_t H5_ATTR_UNUSED *cparam, const earray_test_par *------------------------------------------------------------------------- */ static hssize_t -eiter_cyc_next(void *_eiter) +eiter_cyc_next(void *in_eiter) { - eiter_cyc_t *eiter = (eiter_cyc_t *)_eiter; + eiter_cyc_t *eiter = (eiter_cyc_t *)in_eiter; hssize_t ret_val; /* Sanity check */ @@ -1969,9 +1969,9 @@ eiter_cyc_next(void *_eiter) *------------------------------------------------------------------------- */ static H5_ATTR_PURE hssize_t -eiter_cyc_max(const void *_eiter) +eiter_cyc_max(const void *in_eiter) { - const eiter_cyc_t *eiter = (const eiter_cyc_t *)_eiter; + const eiter_cyc_t *eiter = (const eiter_cyc_t *)in_eiter; /* Sanity check */ HDassert(eiter); @@ -1994,9 +1994,9 @@ eiter_cyc_max(const void *_eiter) *------------------------------------------------------------------------- */ static int -eiter_cyc_term(void *_eiter) +eiter_cyc_term(void *in_eiter) { - eiter_cyc_t *eiter = (eiter_cyc_t *)_eiter; + eiter_cyc_t *eiter = (eiter_cyc_t *)in_eiter; /* Sanity check */ HDassert(eiter); diff --git a/test/error_test.c b/test/error_test.c index 7f41ddca55e..99b2117a67d 100644 --- a/test/error_test.c +++ b/test/error_test.c @@ -129,13 +129,8 @@ test_error(hid_t file) TEST_ERROR; if (old_data != NULL) TEST_ERROR; -#ifdef H5_USE_16_API - if (old_func != (H5E_auto_t)H5Eprint) - TEST_ERROR; -#else /* H5_USE_16_API */ if (old_func != (H5E_auto2_t)H5Eprint2) TEST_ERROR; -#endif /* H5_USE_16_API */ if (H5Eset_auto2(H5E_DEFAULT, NULL, NULL) < 0) TEST_ERROR; diff --git a/test/external.c b/test/external.c index 9109e7508aa..0957a03f1d1 100644 --- a/test/external.c +++ b/test/external.c @@ -465,7 +465,7 @@ test_unlimited(hid_t file) *------------------------------------------------------------------------- */ static int -__add_external_files(hid_t dcpl_id, unsigned int n_external_files, off_t offset, hsize_t max_ext_size) +add_external_files(hid_t dcpl_id, unsigned int n_external_files, off_t offset, hsize_t max_ext_size) { char exname[AEF_EXNAME_MAX_LEN + 1]; unsigned int i = 0; @@ -519,7 +519,7 @@ test_multiple_files(hid_t file) max_ext_size = (hsize_t)(sizeof(int) * max_size[0] / n_external_files); - if (__add_external_files(dcpl, n_external_files, 0, max_ext_size) < 0) { + if (add_external_files(dcpl, n_external_files, 0, max_ext_size) < 0) { FAIL_STACK_ERROR; } @@ -543,7 +543,7 @@ test_multiple_files(hid_t file) max_ext_size -= 1; - if (__add_external_files(dcpl, n_external_files, 0, max_ext_size) < 0) { + if (add_external_files(dcpl, n_external_files, 0, max_ext_size) < 0) { FAIL_STACK_ERROR; } diff --git a/test/ohdr.c b/test/ohdr.c index d3683ff2b56..2fb298897e6 100644 --- a/test/ohdr.c +++ b/test/ohdr.c @@ -780,7 +780,7 @@ count_attributes(hid_t dset_id) * On success, stores size in `size_out` pointer. */ static herr_t -_oh_getsize(hid_t did, hsize_t *size_out) +oh_getsize(hid_t did, hsize_t *size_out) { H5O_native_info_t ninfo; @@ -803,9 +803,9 @@ oh_compare(hid_t did1, hid_t did2) hsize_t space1 = 0; hsize_t space2 = 0; - if (FAIL == _oh_getsize(did1, &space1)) + if (FAIL == oh_getsize(did1, &space1)) return -1; - if (FAIL == _oh_getsize(did2, &space2)) + if (FAIL == oh_getsize(did2, &space2)) return -2; if (space1 < space2) diff --git a/tools/test/h5diff/h5diffgentest.c b/tools/test/h5diff/h5diffgentest.c index cf60a6a51aa..f03254e8b90 100644 --- a/tools/test/h5diff/h5diffgentest.c +++ b/tools/test/h5diff/h5diffgentest.c @@ -465,15 +465,15 @@ test_basic(const char *fname1, const char *fname2, const char *fname3) float data15[6]; float data16[6]; - data15[0] = (float)HDsqrt(-1.0F); + data15[0] = (float)HDsqrt(-1.0); data15[1] = 1.0F; - data15[2] = (float)HDsqrt(-1.0F); + data15[2] = (float)HDsqrt(-1.0); data15[3] = 1.0F; data15[4] = 1.0F; data15[5] = 1.0F; - data16[0] = (float)HDsqrt(-1.0F); - data16[1] = (float)HDsqrt(-1.0F); + data16[0] = (float)HDsqrt(-1.0); + data16[1] = (float)HDsqrt(-1.0); data16[2] = 1.0F; data16[3] = 1.0F; data16[4] = 1.0F; @@ -492,19 +492,19 @@ test_basic(const char *fname1, const char *fname2, const char *fname3) double data17[6]; double data18[6]; - data17[0] = HDsqrt(-1.0F); - data17[1] = 1.0F; - data17[2] = HDsqrt(-1.0F); - data17[3] = 1.0F; - data17[4] = 1.0F; - data17[5] = 1.0F; + data17[0] = HDsqrt(-1.0); + data17[1] = 1.0; + data17[2] = HDsqrt(-1.0); + data17[3] = 1.0; + data17[4] = 1.0; + data17[5] = 1.0; - data18[0] = HDsqrt(-1.0F); - data18[1] = HDsqrt(-10000.0F); - data18[2] = 1.0F; - data18[3] = 1.0F; - data18[4] = 1.0F; - data18[5] = 1.0F; + data18[0] = HDsqrt(-1.0); + data18[1] = HDsqrt(-10000.0); + data18[2] = 1.0; + data18[3] = 1.0; + data18[4] = 1.0; + data18[5] = 1.0; write_dset(gid1, 1, dims1, "fp17", H5T_NATIVE_DOUBLE, data17); write_dset(gid1, 1, dims1, "fp18", H5T_NATIVE_DOUBLE, data18); @@ -519,11 +519,11 @@ test_basic(const char *fname1, const char *fname2, const char *fname3) float data19[6]; double data20[6]; - data19[0] = data19[1] = data19[2] = (float)HDlog(0.0F); - data19[3] = data19[4] = data19[5] = (float)-HDlog(0.0F); + data19[0] = data19[1] = data19[2] = (float)HDlog(0.0); + data19[3] = data19[4] = data19[5] = (float)-HDlog(0.0); - data20[0] = data20[1] = data20[2] = HDlog(0.0F); - data20[3] = data20[4] = data20[5] = -HDlog(0.0F); + data20[0] = data20[1] = data20[2] = HDlog(0.0); + data20[3] = data20[4] = data20[5] = -HDlog(0.0); write_dset(gid1, 1, dims1, "fp19", H5T_NATIVE_FLOAT, data19); write_dset(gid1, 1, dims1, "fp19_COPY", H5T_NATIVE_FLOAT, data19); @@ -547,13 +547,13 @@ test_basic(const char *fname1, const char *fname2, const char *fname3) size_t type_size; hid_t tid; - buf1[0].d = HDsqrt(-1.0F); - buf1[0].f = (float)HDsqrt(-1.0F); - buf2[0].d = HDsqrt(-1.0F); - buf2[0].f = (float)HDsqrt(-1.0F); + buf1[0].d = HDsqrt(-1.0); + buf1[0].f = (float)HDsqrt(-1.0); + buf2[0].d = HDsqrt(-1.0); + buf2[0].f = (float)HDsqrt(-1.0); - buf1[1].d = HDsqrt(-1.0F); - buf1[1].f = (float)HDsqrt(-1.0F); + buf1[1].d = HDsqrt(-1.0); + buf1[1].f = (float)HDsqrt(-1.0); buf2[1].d = 0.0F; buf2[1].f = 0.0F; diff --git a/tools/test/h5repack/h5repackgentest.c b/tools/test/h5repack/h5repackgentest.c index 2b94422291c..576b1c7f57c 100644 --- a/tools/test/h5repack/h5repackgentest.c +++ b/tools/test/h5repack/h5repackgentest.c @@ -72,8 +72,8 @@ struct external_def { * Returns 0 on success, -1 on failure. */ static int -__make_dataset(hid_t file_id, const char *dset_name, hid_t mem_type_id, hid_t space_id, hid_t dcpl_id, - void *wdata) +make_dataset(hid_t file_id, const char *dset_name, hid_t mem_type_id, hid_t space_id, hid_t dcpl_id, + void *wdata) { hid_t dset_id = H5I_INVALID_HID; int ret_value = 0; @@ -90,7 +90,7 @@ __make_dataset(hid_t file_id, const char *dset_name, hid_t mem_type_id, hid_t sp (void)H5Dclose(dset_id); return ret_value; -} /* end __make_dataset() */ +} /* end make_dataset() */ /* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - * Helper function to populate the DCPL external storage list. @@ -101,8 +101,8 @@ __make_dataset(hid_t file_id, const char *dset_name, hid_t mem_type_id, hid_t sp * Returns 0 on success, -1 on failure. */ static int -__set_dcpl_external_list(hid_t dcpl, const char *filename, unsigned n_elts_per_file, unsigned n_elts_total, - hsize_t elt_size) +set_dcpl_external_list(hid_t dcpl, const char *filename, unsigned n_elts_per_file, unsigned n_elts_total, + hsize_t elt_size) { char name[MAX_NAME_SIZE]; unsigned n_external_files = 0; @@ -123,7 +123,7 @@ __set_dcpl_external_list(hid_t dcpl, const char *filename, unsigned n_elts_per_f return -1; } return 0; -} /* end __set_dcpl_external_list() */ +} /* end set_dcpl_external_list() */ /* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - * Generalized utility function to write a file with the specified data and @@ -132,8 +132,8 @@ __set_dcpl_external_list(hid_t dcpl, const char *filename, unsigned n_elts_per_f * Returns 0 on success, -1 on failure. */ static int -__make_file(const char *basename, struct external_def *ext, hid_t type_id, hsize_t rank, hsize_t *dims, - void *wdata) +make_file(const char *basename, struct external_def *ext, hid_t type_id, hsize_t rank, hsize_t *dims, + void *wdata) { char filename[MAX_NAME_SIZE]; hid_t file_id = H5I_INVALID_HID; @@ -149,8 +149,8 @@ __make_file(const char *basename, struct external_def *ext, hid_t type_id, hsize if (dcpl_id == H5I_INVALID_HID) H5REPACKGENTEST_OOPS; - if (__set_dcpl_external_list(dcpl_id, basename, ext->n_elts_per_file, ext->n_elts_total, - ext->type_size) < 0) + if (set_dcpl_external_list(dcpl_id, basename, ext->n_elts_per_file, ext->n_elts_total, + ext->type_size) < 0) H5REPACKGENTEST_OOPS; } @@ -162,13 +162,13 @@ __make_file(const char *basename, struct external_def *ext, hid_t type_id, hsize if (file_id == H5I_INVALID_HID) H5REPACKGENTEST_OOPS; - if (__make_dataset(file_id, "dset", type_id, space_id, dcpl_id, wdata) < 0) + if (make_dataset(file_id, "dset", type_id, space_id, dcpl_id, wdata) < 0) H5REPACKGENTEST_OOPS; done: H5REPACKGENTEST_COMMON_CLEANUP(dcpl_id, file_id, space_id); return ret_value; -} /* end __make_file() */ +} /* end make_file() */ /* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - * Returns 0 on success, -1 on failure. @@ -190,7 +190,7 @@ generate_int32le_1d(hbool_t external) } def_ptr = (TRUE == external) ? (&def) : NULL; - if (__make_file(FILE_INT32LE_1, def_ptr, H5T_STD_I32LE, 1, dims, wdata) < 0) + if (make_file(FILE_INT32LE_1, def_ptr, H5T_STD_I32LE, 1, dims, wdata) < 0) ret_value = -1; return ret_value; @@ -216,7 +216,7 @@ generate_int32le_2d(hbool_t external) } def_ptr = (TRUE == external) ? (&def) : NULL; - if (__make_file(FILE_INT32LE_2, def_ptr, H5T_STD_I32LE, 2, dims, wdata) < 0) + if (make_file(FILE_INT32LE_2, def_ptr, H5T_STD_I32LE, 2, dims, wdata) < 0) ret_value = -1; return ret_value; @@ -249,7 +249,7 @@ generate_int32le_3d(hbool_t external) } def_ptr = (TRUE == external) ? (&def) : NULL; - if (__make_file(FILE_INT32LE_3, def_ptr, H5T_STD_I32LE, 3, dims, wdata) < 0) + if (make_file(FILE_INT32LE_3, def_ptr, H5T_STD_I32LE, 3, dims, wdata) < 0) ret_value = -1; return ret_value; @@ -282,7 +282,7 @@ generate_uint8be(hbool_t external) } def_ptr = (TRUE == external) ? (&def) : NULL; - if (__make_file(FILE_UINT8BE, def_ptr, H5T_STD_U8BE, 3, dims, wdata) < 0) + if (make_file(FILE_UINT8BE, def_ptr, H5T_STD_U8BE, 3, dims, wdata) < 0) ret_value = -1; return ret_value; @@ -312,7 +312,7 @@ generate_f32le(hbool_t external) } def_ptr = (TRUE == external) ? (&def) : NULL; - if (__make_file(FILE_F32LE, def_ptr, H5T_IEEE_F32LE, 2, dims, wdata) < 0) + if (make_file(FILE_F32LE, def_ptr, H5T_IEEE_F32LE, 2, dims, wdata) < 0) ret_value = -1; return ret_value; diff --git a/tools/test/perform/sio_engine.c b/tools/test/perform/sio_engine.c index f8061d42682..e5a0ec82be6 100644 --- a/tools/test/perform/sio_engine.c +++ b/tools/test/perform/sio_engine.c @@ -80,7 +80,7 @@ static int clean_file_g = -1; /*whether to cleanup temporary test */ /*0 is no cleanup; 1 is do cleanup */ /* the different types of file descriptors we can expect */ -typedef union _file_descr { +typedef union { int posixfd; /* POSIX file handle*/ hid_t h5fd; /* HDF5 file */ } file_descr; diff --git a/tools/test/perform/sio_perf.c b/tools/test/perform/sio_perf.c index 8463ffa8287..5b3a9e8e8dd 100644 --- a/tools/test/perform/sio_perf.c +++ b/tools/test/perform/sio_perf.c @@ -292,7 +292,7 @@ struct options { size_t page_size; }; -typedef struct _minmax { +typedef struct { double min; double max; double sum; From c7ae947297a2931b1dc61a09991009295910cd80 Mon Sep 17 00:00:00 2001 From: Sean McBride Date: Wed, 10 Mar 2021 12:51:45 -0500 Subject: [PATCH 14/21] Removed checks/workarounds for pre-C++89 compatibility (#449) After 30+ years, just assume that the following exist: - extension-less includes - namespaces - std:: - static_cast - bool --- CMakeLists.txt | 3 -- c++/examples/chunks.cpp | 4 -- c++/examples/compound.cpp | 4 -- c++/examples/create.cpp | 4 -- c++/examples/extend_ds.cpp | 4 -- c++/examples/h5group.cpp | 4 -- c++/examples/readdata.cpp | 4 -- c++/examples/testh5c++.sh.in | 36 +++--------------- c++/examples/writedata.cpp | 4 -- c++/src/H5Attribute.cpp | 4 -- c++/src/H5DataSet.cpp | 4 -- c++/src/H5DataSpace.cpp | 4 -- c++/src/H5DataType.cpp | 4 -- c++/src/H5Exception.h | 4 -- c++/src/H5FaccProp.cpp | 4 -- c++/src/H5File.cpp | 4 -- c++/src/H5Group.cpp | 4 -- c++/src/H5Include.h | 13 ------- c++/src/H5PropList.cpp | 4 -- c++/test/dsets.cpp | 4 -- c++/test/h5cpputil.cpp | 4 -- c++/test/tarray.cpp | 4 -- c++/test/tattr.cpp | 4 -- c++/test/tcompound.cpp | 4 -- c++/test/tdspl.cpp | 4 -- c++/test/testhdf5.cpp | 4 -- c++/test/tfile.cpp | 4 -- c++/test/tfilter.cpp | 4 -- c++/test/th5s.cpp | 4 -- c++/test/titerate.cpp | 4 -- c++/test/tlinks.cpp | 4 -- c++/test/tobject.cpp | 4 -- c++/test/trefer.cpp | 4 -- c++/test/ttypes.cpp | 4 -- c++/test/tvlstr.cpp | 4 -- config/cmake_ext_mod/HDFCXXTests.cpp | 56 ---------------------------- config/cmake_ext_mod/HDFUseCXX.cmake | 5 --- 37 files changed, 6 insertions(+), 235 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 1ce8dbc1a1f..c41908b19e3 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1096,9 +1096,6 @@ if (EXISTS "${HDF5_SOURCE_DIR}/c++" AND IS_DIRECTORY "${HDF5_SOURCE_DIR}/c++") include (${HDF_RESOURCES_EXT_DIR}/HDFUseCXX.cmake) include (${HDF_RESOURCES_DIR}/HDFCXXCompilerFlags.cmake) - if (CMAKE_NO_STD_NAMESPACE) - set (H5_NO_STD 1) - endif () add_subdirectory (c++) if (HDF5_BUILD_HL_LIB) if (EXISTS "${HDF5_SOURCE_DIR}/hl/c++" AND IS_DIRECTORY "${HDF5_SOURCE_DIR}/hl/c++") diff --git a/c++/examples/chunks.cpp b/c++/examples/chunks.cpp index 365a7da507a..3717fcba62c 100644 --- a/c++/examples/chunks.cpp +++ b/c++/examples/chunks.cpp @@ -16,11 +16,7 @@ * We will read from the file created by extend.cpp */ -#ifdef OLD_HEADER_FILENAME -#include -#else #include -#endif using std::cout; using std::endl; diff --git a/c++/examples/compound.cpp b/c++/examples/compound.cpp index 31a572af74f..89758454d87 100644 --- a/c++/examples/compound.cpp +++ b/c++/examples/compound.cpp @@ -17,11 +17,7 @@ * and read back fields' subsets. */ -#ifdef OLD_HEADER_FILENAME -#include -#else #include -#endif using std::cout; using std::endl; diff --git a/c++/examples/create.cpp b/c++/examples/create.cpp index ef2de36919e..e55230f205f 100644 --- a/c++/examples/create.cpp +++ b/c++/examples/create.cpp @@ -15,11 +15,7 @@ * This example writes a dataset to a new HDF5 file. */ -#ifdef OLD_HEADER_FILENAME -#include -#else #include -#endif #include #include "H5Cpp.h" diff --git a/c++/examples/extend_ds.cpp b/c++/examples/extend_ds.cpp index e69c1c0b473..24f5f3eac32 100644 --- a/c++/examples/extend_ds.cpp +++ b/c++/examples/extend_ds.cpp @@ -18,11 +18,7 @@ * */ -#ifdef OLD_HEADER_FILENAME -#include -#else #include -#endif #include using std::cout; diff --git a/c++/examples/h5group.cpp b/c++/examples/h5group.cpp index 793ff8f2423..f9ec176f24c 100644 --- a/c++/examples/h5group.cpp +++ b/c++/examples/h5group.cpp @@ -20,11 +20,7 @@ * the C version is used in this example. */ -#ifdef OLD_HEADER_FILENAME -#include -#else #include -#endif using std::cout; using std::endl; diff --git a/c++/examples/readdata.cpp b/c++/examples/readdata.cpp index 7441420b1b7..e247a8eaab8 100644 --- a/c++/examples/readdata.cpp +++ b/c++/examples/readdata.cpp @@ -17,11 +17,7 @@ // information about the dataset in the SDS.h5 file is obtained. // -#ifdef OLD_HEADER_FILENAME -#include -#else #include -#endif using std::cout; using std::endl; diff --git a/c++/examples/testh5c++.sh.in b/c++/examples/testh5c++.sh.in index 46fe5ebaf0d..44dc9e7d77f 100644 --- a/c++/examples/testh5c++.sh.in +++ b/c++/examples/testh5c++.sh.in @@ -67,11 +67,7 @@ temp_FILES="a.out $applib" cat > $appmain < -#ifdef OLD_HEADER_FILENAME -#include -#else #include -#endif #include "H5Cpp.h" @@ -95,19 +91,11 @@ EOF # generate prog1 cat > $prog1 < -#else - #include -#endif +#include #include -#ifndef H5_NO_NAMESPACE -#ifndef H5_NO_STD - using std::cout; - using std::endl; -#endif // H5_NO_STD -#endif +using std::cout; +using std::endl; int sub1(void) { cout << "in sub1" << endl; @@ -117,19 +105,11 @@ EOF # generate prog2 cat > $prog2 < -#else - #include -#endif +#include #include -#ifndef H5_NO_NAMESPACE -#ifndef H5_NO_STD - using std::cout; - using std::endl; -#endif // H5_NO_STD -#endif +using std::cout; +using std::endl; int sub2(void) { cout << "in sub2" << endl; @@ -142,11 +122,7 @@ EOF cat > $hdf5main < -#ifdef OLD_HEADER_FILENAME -#include -#else #include -#endif #include "H5Cpp.h" diff --git a/c++/examples/writedata.cpp b/c++/examples/writedata.cpp index ddd3460ff71..f2b715ac20e 100644 --- a/c++/examples/writedata.cpp +++ b/c++/examples/writedata.cpp @@ -20,11 +20,7 @@ * file is closed. Program reopens the file and reads and displays the result. */ -#ifdef OLD_HEADER_FILENAME -#include -#else #include -#endif using std::cout; using std::endl; diff --git a/c++/src/H5Attribute.cpp b/c++/src/H5Attribute.cpp index fd69c131527..b74349cd356 100644 --- a/c++/src/H5Attribute.cpp +++ b/c++/src/H5Attribute.cpp @@ -11,11 +11,7 @@ * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ -#ifdef OLD_HEADER_FILENAME -#include -#else #include -#endif #include #include "H5private.h" // for HDfree diff --git a/c++/src/H5DataSet.cpp b/c++/src/H5DataSet.cpp index 9027d79ca1f..5dc44b869d2 100644 --- a/c++/src/H5DataSet.cpp +++ b/c++/src/H5DataSet.cpp @@ -11,11 +11,7 @@ * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ -#ifdef OLD_HEADER_FILENAME -#include -#else #include -#endif #include #include "H5private.h" // for HDfree diff --git a/c++/src/H5DataSpace.cpp b/c++/src/H5DataSpace.cpp index 9c997d1ea5f..0485530d785 100644 --- a/c++/src/H5DataSpace.cpp +++ b/c++/src/H5DataSpace.cpp @@ -11,11 +11,7 @@ * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ -#ifdef OLD_HEADER_FILENAME -#include -#else #include -#endif #include #include "H5Include.h" diff --git a/c++/src/H5DataType.cpp b/c++/src/H5DataType.cpp index a943a552309..1689912ee05 100644 --- a/c++/src/H5DataType.cpp +++ b/c++/src/H5DataType.cpp @@ -11,11 +11,7 @@ * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ -#ifdef OLD_HEADER_FILENAME -#include -#else #include -#endif #include #include "H5Include.h" diff --git a/c++/src/H5Exception.h b/c++/src/H5Exception.h index ddc45f7c781..9970d2229b0 100644 --- a/c++/src/H5Exception.h +++ b/c++/src/H5Exception.h @@ -18,11 +18,7 @@ #include namespace H5 { -#ifdef H5_NO_STD -#define H5std_string ::string -#else #define H5std_string std::string -#endif /*! \class Exception \brief Exception provides wrappers of HDF5 error handling functions. diff --git a/c++/src/H5FaccProp.cpp b/c++/src/H5FaccProp.cpp index f42b2db79b7..af757ffa3ee 100644 --- a/c++/src/H5FaccProp.cpp +++ b/c++/src/H5FaccProp.cpp @@ -11,11 +11,7 @@ * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ -#ifdef OLD_HEADER_FILENAME -#include -#else #include -#endif #include using std::cerr; diff --git a/c++/src/H5File.cpp b/c++/src/H5File.cpp index 19c12bb543e..e40cafe1e50 100644 --- a/c++/src/H5File.cpp +++ b/c++/src/H5File.cpp @@ -11,11 +11,7 @@ * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ -#ifdef OLD_HEADER_FILENAME -#include -#else #include -#endif #include #include "H5Include.h" diff --git a/c++/src/H5Group.cpp b/c++/src/H5Group.cpp index 392f31add17..2fc6899adad 100644 --- a/c++/src/H5Group.cpp +++ b/c++/src/H5Group.cpp @@ -11,11 +11,7 @@ * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ -#ifdef OLD_HEADER_FILENAME -#include -#else #include -#endif #include #include "H5Include.h" diff --git a/c++/src/H5Include.h b/c++/src/H5Include.h index ac38340e648..0dc930dbef5 100644 --- a/c++/src/H5Include.h +++ b/c++/src/H5Include.h @@ -14,19 +14,6 @@ #include -// Define bool type for platforms that don't support bool yet -#ifdef BOOL_NOTDEFINED -#ifdef false -#undef false -#endif -#ifdef true -#undef true -#endif -typedef int bool; -const bool false = 0; -const bool true = 1; -#endif - // These are defined in H5Opkg.h, which should not be included in the C++ API, // so re-define them here for now. diff --git a/c++/src/H5PropList.cpp b/c++/src/H5PropList.cpp index c5d3bea0ba9..fe4b6f4924b 100644 --- a/c++/src/H5PropList.cpp +++ b/c++/src/H5PropList.cpp @@ -11,11 +11,7 @@ * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ -#ifdef OLD_HEADER_FILENAME -#include -#else #include -#endif #include diff --git a/c++/test/dsets.cpp b/c++/test/dsets.cpp index da4d391fd21..0faf4576465 100644 --- a/c++/test/dsets.cpp +++ b/c++/test/dsets.cpp @@ -23,11 +23,7 @@ ***************************************************************************/ -#ifdef OLD_HEADER_FILENAME -#include -#else #include -#endif using std::cerr; using std::endl; diff --git a/c++/test/h5cpputil.cpp b/c++/test/h5cpputil.cpp index 84bb2b391aa..38f9300eefb 100644 --- a/c++/test/h5cpputil.cpp +++ b/c++/test/h5cpputil.cpp @@ -19,11 +19,7 @@ ***************************************************************************/ -#ifdef OLD_HEADER_FILENAME -#include -#else #include -#endif using std::cerr; using std::endl; diff --git a/c++/test/tarray.cpp b/c++/test/tarray.cpp index ba71da83919..ce1eae9bfe5 100644 --- a/c++/test/tarray.cpp +++ b/c++/test/tarray.cpp @@ -16,11 +16,7 @@ tarray.cpp - HDF5 C++ testing the array datatype functionality ***************************************************************************/ -#ifdef OLD_HEADER_FILENAME -#include -#else #include -#endif using std::cerr; using std::endl; diff --git a/c++/test/tattr.cpp b/c++/test/tattr.cpp index e308a3a696f..3b02eb67c3d 100644 --- a/c++/test/tattr.cpp +++ b/c++/test/tattr.cpp @@ -17,11 +17,7 @@ C attribute interface (H5A) ***************************************************************************/ -#ifdef OLD_HEADER_FILENAME -#include -#else #include -#endif using std::cerr; using std::endl; diff --git a/c++/test/tcompound.cpp b/c++/test/tcompound.cpp index 641002e5c0c..4c5e3e0735a 100644 --- a/c++/test/tcompound.cpp +++ b/c++/test/tcompound.cpp @@ -16,11 +16,7 @@ tcompound.cpp - HDF5 C++ testing the compound data type functionality ***************************************************************************/ -#ifdef OLD_HEADER_FILENAME -#include -#else #include -#endif using std::cerr; using std::endl; diff --git a/c++/test/tdspl.cpp b/c++/test/tdspl.cpp index fc73a6aa197..257233e93e9 100644 --- a/c++/test/tdspl.cpp +++ b/c++/test/tdspl.cpp @@ -17,11 +17,7 @@ list functionality ***************************************************************************/ -#ifdef OLD_HEADER_FILENAME -#include -#else #include -#endif using std::cerr; using std::endl; diff --git a/c++/test/testhdf5.cpp b/c++/test/testhdf5.cpp index da5e2a4f391..71428ced87c 100644 --- a/c++/test/testhdf5.cpp +++ b/c++/test/testhdf5.cpp @@ -38,11 +38,7 @@ GetTestNumErrs() -- Retrieve the number of testing errors ***************************************************************************/ -#ifdef OLD_HEADER_FILENAME -#include -#else #include -#endif using std::cerr; using std::endl; diff --git a/c++/test/tfile.cpp b/c++/test/tfile.cpp index b082f0a560e..5e4e91b557f 100644 --- a/c++/test/tfile.cpp +++ b/c++/test/tfile.cpp @@ -20,11 +20,7 @@ h5_fileaccess() -- in h5test.c, returns a file access template ***************************************************************************/ -#ifdef OLD_HEADER_FILENAME -#include -#else #include -#endif using std::cerr; using std::endl; diff --git a/c++/test/tfilter.cpp b/c++/test/tfilter.cpp index 2df88b2714b..e89838c2f01 100644 --- a/c++/test/tfilter.cpp +++ b/c++/test/tfilter.cpp @@ -16,11 +16,7 @@ tfilter.cpp - HDF5 C++ testing various filters and their combination. ***************************************************************************/ -#ifdef OLD_HEADER_FILENAME -#include -#else #include -#endif using std::cerr; using std::endl; diff --git a/c++/test/th5s.cpp b/c++/test/th5s.cpp index e57ac04d33d..a0051702289 100644 --- a/c++/test/th5s.cpp +++ b/c++/test/th5s.cpp @@ -19,11 +19,7 @@ EXTERNAL ROUTINES/VARIABLES: ***************************************************************************/ -#ifdef OLD_HEADER_FILENAME -#include -#else #include -#endif using std::cerr; using std::endl; diff --git a/c++/test/titerate.cpp b/c++/test/titerate.cpp index 1fb2f571411..17620ca2181 100644 --- a/c++/test/titerate.cpp +++ b/c++/test/titerate.cpp @@ -16,11 +16,7 @@ titerate.cpp - HDF5 C++ testing iterate related functionality ***************************************************************************/ -#ifdef OLD_HEADER_FILENAME -#include -#else #include -#endif using std::cerr; using std::endl; diff --git a/c++/test/tlinks.cpp b/c++/test/tlinks.cpp index 231bff2e8ce..22e69da3bd7 100644 --- a/c++/test/tlinks.cpp +++ b/c++/test/tlinks.cpp @@ -16,11 +16,7 @@ C link interface (H5L) ***************************************************************************/ -#ifdef OLD_HEADER_FILENAME -#include -#else #include -#endif using std::cerr; using std::endl; diff --git a/c++/test/tobject.cpp b/c++/test/tobject.cpp index 87abd4354a5..5892f39e447 100644 --- a/c++/test/tobject.cpp +++ b/c++/test/tobject.cpp @@ -16,11 +16,7 @@ tobject.cpp - HDF5 C++ testing object related functionality ***************************************************************************/ -#ifdef OLD_HEADER_FILENAME -#include -#else #include -#endif #include #include "H5Cpp.h" // C++ API header file diff --git a/c++/test/trefer.cpp b/c++/test/trefer.cpp index 5ec04cd7632..939b0eef466 100644 --- a/c++/test/trefer.cpp +++ b/c++/test/trefer.cpp @@ -17,11 +17,7 @@ Reference interface (H5R) ***************************************************************************/ -#ifdef OLD_HEADER_FILENAME -#include -#else #include -#endif using std::cerr; using std::endl; diff --git a/c++/test/ttypes.cpp b/c++/test/ttypes.cpp index cf32b2b0d5b..5fc82a50994 100644 --- a/c++/test/ttypes.cpp +++ b/c++/test/ttypes.cpp @@ -16,11 +16,7 @@ ttypes.cpp - HDF5 C++ testing the general datatype functionality ***************************************************************************/ -#ifdef OLD_HEADER_FILENAME -#include -#else #include -#endif using std::cerr; using std::endl; diff --git a/c++/test/tvlstr.cpp b/c++/test/tvlstr.cpp index 5d671d1620c..780d1b9eeae 100644 --- a/c++/test/tvlstr.cpp +++ b/c++/test/tvlstr.cpp @@ -18,11 +18,7 @@ EXTERNAL ROUTINES/VARIABLES: ***************************************************************************/ -#ifdef OLD_HEADER_FILENAME -#include -#else #include -#endif using std::cerr; using std::endl; diff --git a/config/cmake_ext_mod/HDFCXXTests.cpp b/config/cmake_ext_mod/HDFCXXTests.cpp index f05151ba1f9..08ccb34f672 100644 --- a/config/cmake_ext_mod/HDFCXXTests.cpp +++ b/config/cmake_ext_mod/HDFCXXTests.cpp @@ -10,62 +10,6 @@ * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ -#ifdef OLD_HEADER_FILENAME - -#include - -int main(void) { return 0; } - -#endif - - -#ifdef HDF_NO_NAMESPACE - -namespace HDF { -int fnord; -} - -int main(void) { - using namespace HDF; - fnord = 37; - return 0; -} - -#endif - -#ifdef HDF_NO_STD - -#include - -using namespace std; - -int main(void) { - string myString("testing namespace std"); - return 0; -} - -#endif - -#ifdef BOOL_NOTDEFINED -int main(void) { - bool flag; - return 0; -} - -#endif - -#ifdef NO_STATIC_CAST - -int main(void) { - float test_float; - int test_int; - test_float = 37.0; - test_int = static_cast (test_float); - return 0; -} - -#endif - #ifdef CXX_HAVE_OFFSETOF #include diff --git a/config/cmake_ext_mod/HDFUseCXX.cmake b/config/cmake_ext_mod/HDFUseCXX.cmake index 28e7f8afb00..580c4092bc8 100644 --- a/config/cmake_ext_mod/HDFUseCXX.cmake +++ b/config/cmake_ext_mod/HDFUseCXX.cmake @@ -103,11 +103,6 @@ endmacro () #----------------------------------------------------------------------------- if (CMAKE_CXX_COMPILER_LOADED) foreach (cxx_test - OLD_HEADER_FILENAME - HDF_NO_NAMESPACE - HDF_NO_STD - BOOL_NOTDEFINED - NO_STATIC_CAST CXX_HAVE_OFFSETOF ) HDF_CXX_FUNCTION_TEST (${cxx_test}) From eb95b115a41e7e577e5c13a9434f138de36cf38f Mon Sep 17 00:00:00 2001 From: Sean McBride Date: Wed, 10 Mar 2021 13:42:35 -0500 Subject: [PATCH 15/21] Fixed all clang-tidy bugprone-suspicious-string-compare warnings (#451) * Fixed all clang-tidy bugprone-suspicious-string-compare warnings This change was generated entirely by clang-tidy itself. * Reformat code with clang v10.0.1. Co-authored-by: Larry Knox --- c++/test/tattr.cpp | 20 +- c++/test/tcompound.cpp | 2 +- c++/test/th5s.cpp | 2 +- c++/test/tlinks.cpp | 2 +- c++/test/tvlstr.cpp | 2 +- hl/c++/test/ptableTest.cpp | 2 +- hl/test/test_lite.c | 34 ++-- hl/tools/gif2h5/gifread.c | 2 +- src/H5.c | 2 +- src/H5A.c | 78 ++++++++ src/H5Aint.c | 2 +- src/H5B2cache.c | 6 +- src/H5Bcache.c | 2 +- src/H5Cimage.c | 2 +- src/H5Dvirtual.c | 2 +- src/H5EAcache.c | 8 +- src/H5Eint.c | 4 +- src/H5FAcache.c | 4 +- src/H5FD.c | 4 +- src/H5FDmulti.c | 2 +- src/H5FScache.c | 4 +- src/H5Gcache.c | 2 +- src/H5HFcache.c | 6 +- src/H5HGcache.c | 2 +- src/H5HLcache.c | 2 +- src/H5Ocache.c | 2 +- src/H5SMcache.c | 4 +- src/H5T.c | 4 +- src/H5Tconv.c | 2 +- test/btree2.c | 4 +- test/cache_image.c | 4 +- test/cache_logging.c | 2 +- test/cmpd_dset.c | 2 +- test/dsets.c | 8 +- test/dtypes.c | 72 +++---- test/error_test.c | 4 +- test/external.c | 2 +- test/fheap.c | 74 +++---- test/filenotclosed.c | 2 +- test/fillval.c | 8 +- test/getname.c | 10 +- test/gheap.c | 4 +- test/istore.c | 2 +- test/lheap.c | 2 +- test/links.c | 262 ++++++++++++------------- test/links_env.c | 2 +- test/mf.c | 79 ++++---- test/mount.c | 52 ++--- test/objcopy.c | 26 +-- test/objcopy_ref.c | 8 +- test/ohdr.c | 8 +- test/set_extent.c | 2 +- test/stab.c | 4 +- test/swmr_generator.c | 2 +- test/swmr_start_write.c | 2 +- test/tattr.c | 46 ++--- test/tfile.c | 2 +- test/th5s.c | 2 +- test/titerate.c | 2 +- test/tmisc.c | 4 +- test/tselect.c | 18 +- test/ttst.c | 10 +- test/tvlstr.c | 2 +- test/tvltypes.c | 122 ++++++------ test/unlink.c | 2 +- test/vfd.c | 2 +- test/vol.c | 16 +- tools/lib/h5diff.c | 10 +- tools/lib/h5tools.c | 4 +- tools/lib/h5tools_ref.c | 2 +- tools/lib/h5tools_str.c | 2 +- tools/lib/h5trav.c | 2 +- tools/src/h5dump/h5dump.c | 2 +- tools/src/h5import/h5import.c | 4 +- tools/src/h5ls/h5ls.c | 2 +- tools/src/h5repack/h5repack_main.c | 2 +- tools/src/h5repack/h5repack_opttable.c | 2 +- 77 files changed, 603 insertions(+), 514 deletions(-) diff --git a/c++/test/tattr.cpp b/c++/test/tattr.cpp index 3b02eb67c3d..f8afb8fecf5 100644 --- a/c++/test/tattr.cpp +++ b/c++/test/tattr.cpp @@ -771,16 +771,16 @@ test_attr_compound_read() hsize_t ii, jj; for (ii = 0; ii < ATTR4_DIM1; ii++) for (jj = 0; jj < ATTR4_DIM2; jj++) - if (HDmemcmp(&attr_data4[ii][jj], &read_data4[ii][jj], sizeof(struct attr4_struct))) { - TestErrPrintf( - "%d:attribute data different: attr_data4[%d][%d].i=%d, read_data4[%d][%d].i=%d\n", - __LINE__, ii, jj, attr_data4[ii][jj].i, ii, jj, read_data4[ii][jj].i); - TestErrPrintf( - "%d:attribute data different: attr_data4[%d][%d].d=%f, read_data4[%d][%d].d=%f\n", - __LINE__, ii, jj, attr_data4[ii][jj].d, ii, jj, read_data4[ii][jj].d); - TestErrPrintf( - "%d:attribute data different: attr_data4[%d][%d].c=%c, read_data4[%d][%d].c=%c\n", - __LINE__, ii, jj, attr_data4[ii][jj].c, ii, jj, read_data4[ii][jj].c); + if (HDmemcmp(&attr_data4[ii][jj], &read_data4[ii][jj], sizeof(struct attr4_struct)) != 0) { + TestErrPrintf("%d:attribute data different: attr_data4[%llu][%llu].i=%d, " + "read_data4[%llu][%llu].i=%d\n", + __LINE__, ii, jj, attr_data4[ii][jj].i, ii, jj, read_data4[ii][jj].i); + TestErrPrintf("%d:attribute data different: attr_data4[%llu][%llu].d=%f, " + "read_data4[%llu][%llu].d=%f\n", + __LINE__, ii, jj, attr_data4[ii][jj].d, ii, jj, read_data4[ii][jj].d); + TestErrPrintf("%d:attribute data different: attr_data4[%llu][%llu].c=%c, " + "read_data4[%llu][%llu].c=%c\n", + __LINE__, ii, jj, attr_data4[ii][jj].c, ii, jj, read_data4[ii][jj].c); } /* end if */ // Verify name diff --git a/c++/test/tcompound.cpp b/c++/test/tcompound.cpp index 4c5e3e0735a..82c21e8ec54 100644 --- a/c++/test/tcompound.cpp +++ b/c++/test/tcompound.cpp @@ -487,7 +487,7 @@ test_compound_5() int_array.close(); /* Check results */ - if (memcmp(src[1].name, dst[1].name, sizeof(src[1].name)) || src[1].tdim != dst[1].tdim || + if (memcmp(src[1].name, dst[1].name, sizeof(src[1].name)) != 0 || src[1].tdim != dst[1].tdim || src[1].coll_ids[0] != dst[1].coll_ids[0] || src[1].coll_ids[1] != dst[1].coll_ids[1] || src[1].coll_ids[2] != dst[1].coll_ids[2] || src[1].coll_ids[3] != dst[1].coll_ids[3]) { H5_FAILED(); diff --git a/c++/test/th5s.cpp b/c++/test/th5s.cpp index a0051702289..9952e6892a0 100644 --- a/c++/test/th5s.cpp +++ b/c++/test/th5s.cpp @@ -512,7 +512,7 @@ test_h5s_compound_scalar_read() dataset.read(&rdata, type); // Verify read data - if (HDmemcmp(&space4_data, &rdata, sizeof(struct space4_struct))) { + if (HDmemcmp(&space4_data, &rdata, sizeof(struct space4_struct)) != 0) { cerr << "scalar data different: space4_data.c1=" << space4_data.c1 << ", read_data4.c1=" << rdata.c1 << endl; cerr << "scalar data different: space4_data.u=" << space4_data.u << ", read_data4.u=" << rdata.u diff --git a/c++/test/tlinks.cpp b/c++/test/tlinks.cpp index 22e69da3bd7..e8dad5ba7dd 100644 --- a/c++/test/tlinks.cpp +++ b/c++/test/tlinks.cpp @@ -589,7 +589,7 @@ visit_obj_cb(H5Object &obj, const H5std_string name, const H5O_info2_t *oinfo, v ovisit_ud_t *op_data = static_cast(_op_data); // Check for correct object information - if (strcmp(op_data->info[op_data->idx].path, name.c_str())) + if (strcmp(op_data->info[op_data->idx].path, name.c_str()) != 0) return (H5_ITER_ERROR); if (op_data->info[op_data->idx].type != oinfo->type) return (H5_ITER_ERROR); diff --git a/c++/test/tvlstr.cpp b/c++/test/tvlstr.cpp index 780d1b9eeae..b371518c454 100644 --- a/c++/test/tvlstr.cpp +++ b/c++/test/tvlstr.cpp @@ -861,7 +861,7 @@ read_scalar_dset(H5File &file, DataType &type, DataSpace &space, char *name, cha dset.read(&data_read, type, space, space); dset.close(); - if (HDstrcmp(data, data_read)) + if (HDstrcmp(data, data_read) != 0) TestErrPrintf("Expected %s for dataset %s but read %s\n", data, name, data_read); HDfree(data_read); diff --git a/hl/c++/test/ptableTest.cpp b/hl/c++/test/ptableTest.cpp index bf6040288b8..8e71557e04c 100644 --- a/hl/c++/test/ptableTest.cpp +++ b/hl/c++/test/ptableTest.cpp @@ -690,7 +690,7 @@ TestHDFFV_9758() if (s2.a != s1[i].a || s2.e != s1[i].e) goto error; - else if (HDstrcmp(s2.d, s1[i].d)) + else if (HDstrcmp(s2.d, s1[i].d) != 0) goto error; } } // end of ptable block diff --git a/hl/test/test_lite.c b/hl/test/test_lite.c index 52cda541b79..cae91ffaae4 100644 --- a/hl/test/test_lite.c +++ b/hl/test/test_lite.c @@ -1054,7 +1054,7 @@ test_integers(void) HDfree(dt_str); goto out; } - if (HDstrcmp(dt_str, "H5T_STD_I8BE")) { + if (HDstrcmp(dt_str, "H5T_STD_I8BE") != 0) { HDfree(dt_str); goto out; } @@ -1112,7 +1112,7 @@ test_fps(void) HDfree(dt_str); goto out; } - if (HDstrcmp(dt_str, "H5T_IEEE_F32BE")) { + if (HDstrcmp(dt_str, "H5T_IEEE_F32BE") != 0) { HDfree(dt_str); goto out; } @@ -1184,7 +1184,7 @@ test_strings(void) goto out; } if (HDstrcmp(dt_str, "H5T_STRING {\n STRSIZE 13;\n STRPAD H5T_STR_NULLTERM;\n CSET " - "H5T_CSET_ASCII;\n CTYPE H5T_C_S1;\n }")) { + "H5T_CSET_ASCII;\n CTYPE H5T_C_S1;\n }") != 0) { HDprintf("dt=\n%s\n", dt_str); HDfree(dt_str); goto out; @@ -1219,7 +1219,7 @@ test_strings(void) goto out; } if (HDstrcmp(dt_str, "H5T_STRING {\n STRSIZE H5T_VARIABLE;\n STRPAD H5T_STR_NULLPAD;\n " - "CSET H5T_CSET_ASCII;\n CTYPE H5T_C_S1;\n }")) { + "CSET H5T_CSET_ASCII;\n CTYPE H5T_C_S1;\n }") != 0) { HDprintf("dt=\n%s\n", dt_str); HDfree(dt_str); goto out; @@ -1238,7 +1238,7 @@ test_strings(void) if (HDstrncmp(dt_str, "H5T_STRING {\n STRSIZE H5T_VARIABLE;\n STRPAD H5T_STR_NULLPAD;\n CSET " "H5T_CSET_ASCII;\n CTYPE H5T_C_S1;\n }", - str_len - 1)) { + str_len - 1) != 0) { HDprintf("dt=\n%s\n", dt_str); HDfree(dt_str); goto out; @@ -1261,7 +1261,7 @@ test_strings(void) if (HDstrncmp(dt_str, "H5T_STRING {\n STRSIZE H5T_VARIABLE;\n STRPAD H5T_STR_NULLPAD;\n CSET " "H5T_CSET_ASCII;\n CTYPE H5T_C_S1;\n }", - str_len)) { + str_len) != 0) { HDprintf("dt=\n%s\n", dt_str); HDfree(dt_str); goto out; @@ -1322,7 +1322,8 @@ test_opaques(void) } if (HDstrcmp( dt_str, - "H5T_OPAQUE {\n OPQ_SIZE 19;\n OPQ_TAG \"This is a tag for opaque type\";\n }")) { + "H5T_OPAQUE {\n OPQ_SIZE 19;\n OPQ_TAG \"This is a tag for opaque type\";\n }") != + 0) { HDprintf("dt=\n%s\n", dt_str); HDfree(dt_str); goto out; @@ -1376,7 +1377,7 @@ test_enums(void) if (H5Tenum_nameof(dtype, &value1, name1, size) < 0) goto out; - if (HDstrcmp(name1, "BLUE")) + if (HDstrcmp(name1, "BLUE") != 0) goto out; if (H5Tenum_valueof(dtype, name2, &value2) < 0) @@ -1399,8 +1400,9 @@ test_enums(void) HDfree(dt_str); goto out; } - if (HDstrcmp(dt_str, "H5T_ENUM {\n H5T_STD_I32LE;\n \"RED\" 5;\n \"GREEN\" " - " 6;\n \"BLUE\" 7;\n \"WHITE\" 8;\n }")) { + if (HDstrcmp(dt_str, + "H5T_ENUM {\n H5T_STD_I32LE;\n \"RED\" 5;\n \"GREEN\" " + " 6;\n \"BLUE\" 7;\n \"WHITE\" 8;\n }") != 0) { HDprintf("dt=\n%s\n", dt_str); HDfree(dt_str); @@ -1462,7 +1464,7 @@ test_variables(void) HDfree(dt_str); goto out; } - if (HDstrcmp(dt_str, "H5T_VLEN {\n H5T_VLEN {\n H5T_STD_I32BE\n }\n }")) { + if (HDstrcmp(dt_str, "H5T_VLEN {\n H5T_VLEN {\n H5T_STD_I32BE\n }\n }") != 0) { HDprintf("dt=\n%s\n", dt_str); HDfree(dt_str); goto out; @@ -1526,7 +1528,7 @@ test_arrays(void) } if (HDstrcmp(dt_str, "H5T_ARRAY {\n [5][7][13] H5T_ARRAY {\n [17][19] H5T_COMPOUND {\n " " H5T_STD_I8BE \"arr_compound_1\" : 0;\n H5T_STD_I32BE " - "\"arr_compound_2\" : 1;\n }\n }\n }")) { + "\"arr_compound_2\" : 1;\n }\n }\n }") != 0) { HDprintf("dt=\n%s\n", dt_str); HDfree(dt_str); goto out; @@ -1586,7 +1588,7 @@ test_compounds(void) goto out; } if (HDstrcmp(dt_str, "H5T_COMPOUND {\n H5T_STD_I16BE \"one_field\" : 2;\n H5T_STD_U8LE " - "\"two_field\" : 6;\n }")) { + "\"two_field\" : 6;\n }") != 0) { HDprintf("dt=\n%s\n", dt_str); HDfree(dt_str); goto out; @@ -1605,7 +1607,7 @@ test_compounds(void) if ((memb_name = H5Tget_member_name(dtype, 1)) == NULL) goto out; - if (HDstrcmp(memb_name, "i16_field")) { + if (HDstrcmp(memb_name, "i16_field") != 0) { H5free_memory(memb_name); goto out; } @@ -1683,7 +1685,7 @@ test_compound_bug(void) if ((memb_name = H5Tget_member_name(dtype, 2)) == NULL) goto out; - if (HDstrcmp(memb_name, "sub")) { + if (HDstrcmp(memb_name, "sub") != 0) { H5free_memory(memb_name); goto out; } @@ -1720,7 +1722,7 @@ test_compound_bug(void) if ((memb_name = H5Tget_member_name(dtype, 1)) == NULL) goto out; if (HDstrcmp(memb_name, "desc____________________________________________________________________________" - "_____________")) { + "_____________") != 0) { H5free_memory(memb_name); goto out; } diff --git a/hl/tools/gif2h5/gifread.c b/hl/tools/gif2h5/gifread.c index ef2bdd40fda..d2afbc48c2c 100644 --- a/hl/tools/gif2h5/gifread.c +++ b/hl/tools/gif2h5/gifread.c @@ -62,7 +62,7 @@ ReadGifHeader(GIFHEAD * GifHead, /* Pointer to GIF header structure */ GifHead->HeaderDump[i] = *(*MemGif2)++; } - if (strncmp((const char *)GifHead->HeaderDump, "GIF", (size_t)3)) { + if (strncmp((const char *)GifHead->HeaderDump, "GIF", (size_t)3) != 0) { printf("The file does not appear to be a valid GIF file.\n"); exit(EXIT_FAILURE); } diff --git a/src/H5.c b/src/H5.c index 35bfdafc540..572e5e58f37 100644 --- a/src/H5.c +++ b/src/H5.c @@ -920,7 +920,7 @@ H5check_version(unsigned majnum, unsigned minnum, unsigned relnum) HDstrncat(lib_str, "-", (size_t)1); HDstrncat(lib_str, substr, (sizeof(lib_str) - HDstrlen(lib_str)) - 1); } /* end if */ - if (HDstrcmp(lib_str, H5_lib_vers_info_g)) { + if (HDstrcmp(lib_str, H5_lib_vers_info_g) != 0) { HDfputs("Warning! Library version information error.\n" "The HDF5 library version information are not " "consistent in its source code.\nThis is NOT a fatal error " diff --git a/src/H5A.c b/src/H5A.c index 3d20f83701b..ef7dbc86208 100644 --- a/src/H5A.c +++ b/src/H5A.c @@ -1140,6 +1140,84 @@ H5Aget_info_by_idx(hid_t loc_id, const char *obj_name, H5_index_t idx_type, H5_i FUNC_LEAVE_API(ret_value) } /* end H5Aget_info_by_idx() */ +/*-------------------------------------------------------------------------- + NAME + H5A__rename_common + PURPOSE + Common helper routine for sync/async attribute rename operations + RETURNS + Non-negative on success/Negative on failure +--------------------------------------------------------------------------*/ +static herr_t +H5A__rename_common(H5VL_object_t *vol_obj, H5VL_loc_params_t *loc_params, const char *old_name, + const char *new_name, void **token_ptr) +{ + herr_t ret_value = SUCCEED; /* Return value */ + + FUNC_ENTER_STATIC + + /* Sanity checks */ + HDassert(vol_obj); + HDassert(loc_params); + HDassert(old_name); + HDassert(new_name); + + /* Avoid thrashing things if the names are the same */ + if (HDstrcmp(old_name, new_name) != 0) + /* Rename the attribute */ + if (H5VL_attr_specific(vol_obj, loc_params, H5VL_ATTR_RENAME, H5P_DATASET_XFER_DEFAULT, token_ptr, + old_name, new_name) < 0) + HGOTO_ERROR(H5E_ATTR, H5E_CANTRENAME, FAIL, "can't rename attribute from '%s' to '%s'", old_name, + new_name) + +done: + FUNC_LEAVE_NOAPI(ret_value) +} /* H5A__rename_common() */ + +/*-------------------------------------------------------------------------- + NAME + H5A__rename_api_common + PURPOSE + Common helper routine for sync/async attribute rename operations + RETURNS + Non-negative on success/Negative on failure +--------------------------------------------------------------------------*/ +static herr_t +H5A__rename_api_common(hid_t loc_id, const char *old_name, const char *new_name, void **token_ptr, + H5VL_object_t **_vol_obj_ptr) +{ + H5VL_object_t * tmp_vol_obj = NULL; /* Object for loc_id */ + H5VL_object_t **vol_obj_ptr = + (_vol_obj_ptr ? _vol_obj_ptr : &tmp_vol_obj); /* Ptr to object ptr for loc_id */ + H5VL_loc_params_t loc_params; /* Location parameters for object access */ + herr_t ret_value = SUCCEED; /* Return value */ + + FUNC_ENTER_STATIC + + /* Check arguments */ + if (H5I_ATTR == H5I_get_type(loc_id)) + HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "location is not valid for an attribute") + if (!old_name) + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "old attribute name cannot be NULL") + if (!*old_name) + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "old attribute name cannot be an empty string") + if (!new_name) + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "new attribute name cannot be NULL") + if (!*new_name) + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "new attribute name cannot be an empty string") + + /* Set up object access arguments */ + if (H5VL_setup_loc_args(loc_id, vol_obj_ptr, &loc_params) < 0) + HGOTO_ERROR(H5E_ATTR, H5E_CANTSET, FAIL, "can't set object access arguments") + + /* Rename the attribute */ + if (H5A__rename_common(*vol_obj_ptr, &loc_params, old_name, new_name, token_ptr) < 0) + HGOTO_ERROR(H5E_ATTR, H5E_CANTRENAME, FAIL, "can't rename attribute") + +done: + FUNC_LEAVE_NOAPI(ret_value) +} /* H5A__rename_api_common() */ + /*------------------------------------------------------------------------- * Function: H5Arename * diff --git a/src/H5Aint.c b/src/H5Aint.c index 0da88e118ce..0609f24b5c7 100644 --- a/src/H5Aint.c +++ b/src/H5Aint.c @@ -2496,7 +2496,7 @@ H5A__rename_by_name(H5G_loc_t loc, const char *obj_name, const char *old_attr_na FUNC_ENTER_PACKAGE /* Avoid thrashing things if the names are the same */ - if (HDstrcmp(old_attr_name, new_attr_name)) { + if (HDstrcmp(old_attr_name, new_attr_name) != 0) { /* Set up opened group location to fill in */ obj_loc.oloc = &obj_oloc; obj_loc.path = &obj_path; diff --git a/src/H5B2cache.c b/src/H5B2cache.c index d70816d9c32..e333d61f6fb 100644 --- a/src/H5B2cache.c +++ b/src/H5B2cache.c @@ -250,7 +250,7 @@ H5B2__cache_hdr_deserialize(const void *_image, size_t H5_ATTR_UNUSED len, void HGOTO_ERROR(H5E_BTREE, H5E_CANTALLOC, NULL, "allocation failed for B-tree header") /* Magic number */ - if (HDmemcmp(image, H5B2_HDR_MAGIC, (size_t)H5_SIZEOF_MAGIC)) + if (HDmemcmp(image, H5B2_HDR_MAGIC, (size_t)H5_SIZEOF_MAGIC) != 0) HGOTO_ERROR(H5E_BTREE, H5E_BADVALUE, NULL, "wrong B-tree header signature") image += H5_SIZEOF_MAGIC; @@ -648,7 +648,7 @@ H5B2__cache_int_deserialize(const void *_image, size_t H5_ATTR_UNUSED len, void internal->shadow_epoch = udata->hdr->shadow_epoch; /* Magic number */ - if (HDmemcmp(image, H5B2_INT_MAGIC, (size_t)H5_SIZEOF_MAGIC)) + if (HDmemcmp(image, H5B2_INT_MAGIC, (size_t)H5_SIZEOF_MAGIC) != 0) HGOTO_ERROR(H5E_BTREE, H5E_BADVALUE, NULL, "wrong B-tree internal node signature") image += H5_SIZEOF_MAGIC; @@ -1064,7 +1064,7 @@ H5B2__cache_leaf_deserialize(const void *_image, size_t H5_ATTR_UNUSED len, void leaf->shadow_epoch = udata->hdr->shadow_epoch; /* Magic number */ - if (HDmemcmp(image, H5B2_LEAF_MAGIC, (size_t)H5_SIZEOF_MAGIC)) + if (HDmemcmp(image, H5B2_LEAF_MAGIC, (size_t)H5_SIZEOF_MAGIC) != 0) HGOTO_ERROR(H5E_BTREE, H5E_BADVALUE, NULL, "wrong B-tree leaf node signature") image += H5_SIZEOF_MAGIC; diff --git a/src/H5Bcache.c b/src/H5Bcache.c index 6ccdc11d641..ec7457f9c2a 100644 --- a/src/H5Bcache.c +++ b/src/H5Bcache.c @@ -166,7 +166,7 @@ H5B__cache_deserialize(const void *_image, size_t H5_ATTR_UNUSED len, void *_uda HGOTO_ERROR(H5E_BTREE, H5E_CANTALLOC, NULL, "can't allocate buffer for child addresses") /* magic number */ - if (HDmemcmp(image, H5B_MAGIC, (size_t)H5_SIZEOF_MAGIC)) + if (HDmemcmp(image, H5B_MAGIC, (size_t)H5_SIZEOF_MAGIC) != 0) HGOTO_ERROR(H5E_BTREE, H5E_BADVALUE, NULL, "wrong B-tree signature") image += H5_SIZEOF_MAGIC; diff --git a/src/H5Cimage.c b/src/H5Cimage.c index b366a943466..20d3b4de461 100644 --- a/src/H5Cimage.c +++ b/src/H5Cimage.c @@ -1773,7 +1773,7 @@ H5C__decode_cache_image_header(const H5F_t *f, H5C_t *cache_ptr, const uint8_t * p = *buf; /* Check signature */ - if (HDmemcmp(p, H5C__MDCI_BLOCK_SIGNATURE, (size_t)H5C__MDCI_BLOCK_SIGNATURE_LEN)) + if (HDmemcmp(p, H5C__MDCI_BLOCK_SIGNATURE, (size_t)H5C__MDCI_BLOCK_SIGNATURE_LEN) != 0) HGOTO_ERROR(H5E_CACHE, H5E_BADVALUE, FAIL, "Bad metadata cache image header signature") p += H5C__MDCI_BLOCK_SIGNATURE_LEN; diff --git a/src/H5Dvirtual.c b/src/H5Dvirtual.c index f2489acfd42..beee8c691ab 100644 --- a/src/H5Dvirtual.c +++ b/src/H5Dvirtual.c @@ -895,7 +895,7 @@ H5D__virtual_open_source_dset(const H5D_t *vdset, H5O_storage_virtual_ent_t *vir HDassert(source_dset->dset_name); /* Check if we need to open the source file */ - if (HDstrcmp(source_dset->file_name, ".")) { + if (HDstrcmp(source_dset->file_name, ".") != 0) { unsigned intent; /* File access permissions */ /* Get the virtual dataset's file open flags ("intent") */ diff --git a/src/H5EAcache.c b/src/H5EAcache.c index 550627ee8d1..2a3153c6bc9 100644 --- a/src/H5EAcache.c +++ b/src/H5EAcache.c @@ -307,7 +307,7 @@ BEGIN_FUNC(STATIC, ERR, void *, NULL, NULL, hdr->addr = udata->addr; /* Magic number */ - if (HDmemcmp(image, H5EA_HDR_MAGIC, (size_t)H5_SIZEOF_MAGIC)) + if (HDmemcmp(image, H5EA_HDR_MAGIC, (size_t)H5_SIZEOF_MAGIC) != 0) H5E_THROW(H5E_BADVALUE, "wrong extensible array header signature") image += H5_SIZEOF_MAGIC; @@ -697,7 +697,7 @@ BEGIN_FUNC(STATIC, ERR, void *, NULL, NULL, iblock->addr = hdr->idx_blk_addr; /* Magic number */ - if (HDmemcmp(image, H5EA_IBLOCK_MAGIC, (size_t)H5_SIZEOF_MAGIC)) + if (HDmemcmp(image, H5EA_IBLOCK_MAGIC, (size_t)H5_SIZEOF_MAGIC) != 0) H5E_THROW(H5E_BADVALUE, "wrong extensible array index block signature") image += H5_SIZEOF_MAGIC; @@ -1100,7 +1100,7 @@ BEGIN_FUNC(STATIC, ERR, void *, NULL, NULL, sblock->addr = udata->sblk_addr; /* Magic number */ - if (HDmemcmp(image, H5EA_SBLOCK_MAGIC, (size_t)H5_SIZEOF_MAGIC)) + if (HDmemcmp(image, H5EA_SBLOCK_MAGIC, (size_t)H5_SIZEOF_MAGIC) != 0) H5E_THROW(H5E_BADVALUE, "wrong extensible array super block signature") image += H5_SIZEOF_MAGIC; @@ -1510,7 +1510,7 @@ BEGIN_FUNC(STATIC, ERR, void *, NULL, NULL, dblock->addr = udata->dblk_addr; /* Magic number */ - if (HDmemcmp(image, H5EA_DBLOCK_MAGIC, (size_t)H5_SIZEOF_MAGIC)) + if (HDmemcmp(image, H5EA_DBLOCK_MAGIC, (size_t)H5_SIZEOF_MAGIC) != 0) H5E_THROW(H5E_BADVALUE, "wrong extensible array data block signature") image += H5_SIZEOF_MAGIC; diff --git a/src/H5Eint.c b/src/H5Eint.c index 7e46beb5319..3fd4099ec60 100644 --- a/src/H5Eint.c +++ b/src/H5Eint.c @@ -218,7 +218,7 @@ H5E__walk1_cb(int n, H5E_error1_t *err_desc, void *client_data) cls_ptr = maj_ptr->cls; /* Print error class header if new class */ - if (eprint->cls.lib_name == NULL || HDstrcmp(cls_ptr->lib_name, eprint->cls.lib_name)) { + if (eprint->cls.lib_name == NULL || HDstrcmp(cls_ptr->lib_name, eprint->cls.lib_name) != 0) { /* update to the new class information */ if (cls_ptr->cls_name) eprint->cls.cls_name = cls_ptr->cls_name; @@ -346,7 +346,7 @@ H5E__walk2_cb(unsigned n, const H5E_error2_t *err_desc, void *client_data) HGOTO_DONE(FAIL) /* Print error class header if new class */ - if (eprint->cls.lib_name == NULL || HDstrcmp(cls_ptr->lib_name, eprint->cls.lib_name)) { + if (eprint->cls.lib_name == NULL || HDstrcmp(cls_ptr->lib_name, eprint->cls.lib_name) != 0) { /* update to the new class information */ if (cls_ptr->cls_name) eprint->cls.cls_name = cls_ptr->cls_name; diff --git a/src/H5FAcache.c b/src/H5FAcache.c index 4e6c57d9258..1b127c73a07 100644 --- a/src/H5FAcache.c +++ b/src/H5FAcache.c @@ -252,7 +252,7 @@ BEGIN_FUNC(STATIC, ERR, void *, NULL, NULL, hdr->addr = udata->addr; /* Magic number */ - if (HDmemcmp(image, H5FA_HDR_MAGIC, (size_t)H5_SIZEOF_MAGIC)) + if (HDmemcmp(image, H5FA_HDR_MAGIC, (size_t)H5_SIZEOF_MAGIC) != 0) H5E_THROW(H5E_BADVALUE, "wrong fixed array header signature") image += H5_SIZEOF_MAGIC; @@ -637,7 +637,7 @@ BEGIN_FUNC(STATIC, ERR, void *, NULL, NULL, dblock->addr = udata->dblk_addr; /* Magic number */ - if (HDmemcmp(image, H5FA_DBLOCK_MAGIC, (size_t)H5_SIZEOF_MAGIC)) + if (HDmemcmp(image, H5FA_DBLOCK_MAGIC, (size_t)H5_SIZEOF_MAGIC) != 0) H5E_THROW(H5E_BADVALUE, "wrong fixed array data block signature") image += H5_SIZEOF_MAGIC; diff --git a/src/H5FD.c b/src/H5FD.c index 877334e6157..8757ce874c0 100644 --- a/src/H5FD.c +++ b/src/H5FD.c @@ -496,9 +496,9 @@ H5FD_sb_load(H5FD_t *file, const char *name, const uint8_t *buf) /* Check if driver matches driver information saved. Unfortunately, we can't push this * function to each specific driver because we're checking if the driver is correct. */ - if (!HDstrncmp(name, "NCSAfami", (size_t)8) && HDstrcmp(file->cls->name, "family")) + if (!HDstrncmp(name, "NCSAfami", (size_t)8) && HDstrcmp(file->cls->name, "family") != 0) HGOTO_ERROR(H5E_VFL, H5E_BADVALUE, FAIL, "family driver should be used") - if (!HDstrncmp(name, "NCSAmult", (size_t)8) && HDstrcmp(file->cls->name, "multi")) + if (!HDstrncmp(name, "NCSAmult", (size_t)8) && HDstrcmp(file->cls->name, "multi") != 0) HGOTO_ERROR(H5E_VFL, H5E_BADVALUE, FAIL, "multi driver should be used") /* Decode driver information */ diff --git a/src/H5FDmulti.c b/src/H5FDmulti.c index a024ace646e..7f65f11d677 100644 --- a/src/H5FDmulti.c +++ b/src/H5FDmulti.c @@ -731,7 +731,7 @@ H5FD_multi_sb_decode(H5FD_t *_file, const char *name, const unsigned char *buf) H5Eclear2(H5E_DEFAULT); /* Make sure the name/version number is correct */ - if (strcmp(name, "NCSAmult")) + if (strcmp(name, "NCSAmult") != 0) H5Epush_ret(func, H5E_ERR_CLS, H5E_FILE, H5E_BADVALUE, "invalid multi superblock", -1); /* Set default values */ diff --git a/src/H5FScache.c b/src/H5FScache.c index 4212794067f..39f0333757d 100644 --- a/src/H5FScache.c +++ b/src/H5FScache.c @@ -248,7 +248,7 @@ H5FS__cache_hdr_deserialize(const void *_image, size_t H5_ATTR_NDEBUG_UNUSED len fspace->addr = udata->addr; /* Magic number */ - if (HDmemcmp(image, H5FS_HDR_MAGIC, (size_t)H5_SIZEOF_MAGIC)) + if (HDmemcmp(image, H5FS_HDR_MAGIC, (size_t)H5_SIZEOF_MAGIC) != 0) HGOTO_ERROR(H5E_FSPACE, H5E_CANTLOAD, NULL, "wrong free space header signature") image += H5_SIZEOF_MAGIC; @@ -988,7 +988,7 @@ H5FS__cache_sinfo_deserialize(const void *_image, size_t H5_ATTR_NDEBUG_UNUSED l H5_CHECKED_ASSIGN(old_sect_size, size_t, fspace->sect_size, hsize_t); /* Magic number */ - if (HDmemcmp(image, H5FS_SINFO_MAGIC, (size_t)H5_SIZEOF_MAGIC)) + if (HDmemcmp(image, H5FS_SINFO_MAGIC, (size_t)H5_SIZEOF_MAGIC) != 0) HGOTO_ERROR(H5E_FSPACE, H5E_CANTLOAD, NULL, "wrong free space sections signature") image += H5_SIZEOF_MAGIC; diff --git a/src/H5Gcache.c b/src/H5Gcache.c index eac75453bc6..471319360e0 100644 --- a/src/H5Gcache.c +++ b/src/H5Gcache.c @@ -176,7 +176,7 @@ H5G__cache_node_deserialize(const void *_image, size_t len, void *_udata, hbool_ HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "memory allocation failed") /* magic */ - if (HDmemcmp(image, H5G_NODE_MAGIC, (size_t)H5_SIZEOF_MAGIC)) + if (HDmemcmp(image, H5G_NODE_MAGIC, (size_t)H5_SIZEOF_MAGIC) != 0) HGOTO_ERROR(H5E_SYM, H5E_BADVALUE, NULL, "bad symbol table node signature") image += H5_SIZEOF_MAGIC; diff --git a/src/H5HFcache.c b/src/H5HFcache.c index 7d29ede32b6..fde5a4f27ba 100644 --- a/src/H5HFcache.c +++ b/src/H5HFcache.c @@ -209,7 +209,7 @@ H5HF__hdr_prefix_decode(H5HF_hdr_t *hdr, const uint8_t **image_ref) HDassert(image); /* Magic number */ - if (HDmemcmp(image, H5HF_HDR_MAGIC, (size_t)H5_SIZEOF_MAGIC)) + if (HDmemcmp(image, H5HF_HDR_MAGIC, (size_t)H5_SIZEOF_MAGIC) != 0) HGOTO_ERROR(H5E_HEAP, H5E_BADVALUE, FAIL, "wrong fractal heap header signature") image += H5_SIZEOF_MAGIC; @@ -992,7 +992,7 @@ H5HF__cache_iblock_deserialize(const void *_image, size_t H5_ATTR_NDEBUG_UNUSED HDassert(iblock->size == len); /* Magic number */ - if (HDmemcmp(image, H5HF_IBLOCK_MAGIC, (size_t)H5_SIZEOF_MAGIC)) + if (HDmemcmp(image, H5HF_IBLOCK_MAGIC, (size_t)H5_SIZEOF_MAGIC) != 0) HGOTO_ERROR(H5E_HEAP, H5E_BADVALUE, NULL, "wrong fractal heap indirect block signature") image += H5_SIZEOF_MAGIC; @@ -1831,7 +1831,7 @@ H5HF__cache_dblock_deserialize(const void *_image, size_t len, void *_udata, hbo image = dblock->blk; /* Magic number */ - if (HDmemcmp(image, H5HF_DBLOCK_MAGIC, (size_t)H5_SIZEOF_MAGIC)) + if (HDmemcmp(image, H5HF_DBLOCK_MAGIC, (size_t)H5_SIZEOF_MAGIC) != 0) HGOTO_ERROR(H5E_HEAP, H5E_BADVALUE, NULL, "wrong fractal heap direct block signature") image += H5_SIZEOF_MAGIC; diff --git a/src/H5HGcache.c b/src/H5HGcache.c index e0e1f2e9fa1..379e6f66c16 100644 --- a/src/H5HGcache.c +++ b/src/H5HGcache.c @@ -122,7 +122,7 @@ H5HG__hdr_deserialize(H5HG_heap_t *heap, const uint8_t *image, const H5F_t *f) HDassert(f); /* Magic number */ - if (HDmemcmp(image, H5HG_MAGIC, (size_t)H5_SIZEOF_MAGIC)) + if (HDmemcmp(image, H5HG_MAGIC, (size_t)H5_SIZEOF_MAGIC) != 0) HGOTO_ERROR(H5E_HEAP, H5E_BADVALUE, FAIL, "bad global heap collection signature") image += H5_SIZEOF_MAGIC; diff --git a/src/H5HLcache.c b/src/H5HLcache.c index 05a45f1b239..b46280ef79b 100644 --- a/src/H5HLcache.c +++ b/src/H5HLcache.c @@ -161,7 +161,7 @@ H5HL__hdr_deserialize(H5HL_t *heap, const uint8_t *image, H5HL_cache_prfx_ud_t * HDassert(udata); /* Check magic number */ - if (HDmemcmp(image, H5HL_MAGIC, (size_t)H5_SIZEOF_MAGIC)) + if (HDmemcmp(image, H5HL_MAGIC, (size_t)H5_SIZEOF_MAGIC) != 0) HGOTO_ERROR(H5E_HEAP, H5E_BADVALUE, FAIL, "bad local heap signature") image += H5_SIZEOF_MAGIC; diff --git a/src/H5Ocache.c b/src/H5Ocache.c index a903cc186b9..62dc2f24803 100644 --- a/src/H5Ocache.c +++ b/src/H5Ocache.c @@ -1335,7 +1335,7 @@ H5O__chunk_deserialize(H5O_t *oh, haddr_t addr, size_t len, const uint8_t *image /* Check for magic # on chunks > 0 in later versions of the format */ else if (chunkno > 0 && oh->version > H5O_VERSION_1) { /* Magic number */ - if (HDmemcmp(chunk_image, H5O_CHK_MAGIC, (size_t)H5_SIZEOF_MAGIC)) + if (HDmemcmp(chunk_image, H5O_CHK_MAGIC, (size_t)H5_SIZEOF_MAGIC) != 0) HGOTO_ERROR(H5E_OHDR, H5E_CANTLOAD, FAIL, "wrong object header chunk signature") chunk_image += H5_SIZEOF_MAGIC; } /* end if */ diff --git a/src/H5SMcache.c b/src/H5SMcache.c index 8a4c155c2b0..2ad467f1721 100644 --- a/src/H5SMcache.c +++ b/src/H5SMcache.c @@ -238,7 +238,7 @@ H5SM__cache_table_deserialize(const void *_image, size_t H5_ATTR_NDEBUG_UNUSED l HDassert(table->table_size == len); /* Check magic number */ - if (HDmemcmp(image, H5SM_TABLE_MAGIC, (size_t)H5_SIZEOF_MAGIC)) + if (HDmemcmp(image, H5SM_TABLE_MAGIC, (size_t)H5_SIZEOF_MAGIC) != 0) HGOTO_ERROR(H5E_SOHM, H5E_CANTLOAD, NULL, "bad SOHM table signature") image += H5_SIZEOF_MAGIC; @@ -580,7 +580,7 @@ H5SM__cache_list_deserialize(const void *_image, size_t H5_ATTR_NDEBUG_UNUSED le list->header = udata->header; /* Check magic number */ - if (HDmemcmp(image, H5SM_LIST_MAGIC, (size_t)H5_SIZEOF_MAGIC)) + if (HDmemcmp(image, H5SM_LIST_MAGIC, (size_t)H5_SIZEOF_MAGIC) != 0) HGOTO_ERROR(H5E_SOHM, H5E_CANTLOAD, NULL, "bad SOHM list signature") image += H5_SIZEOF_MAGIC; diff --git a/src/H5T.c b/src/H5T.c index b48011a2b49..de2a1002501 100644 --- a/src/H5T.c +++ b/src/H5T.c @@ -2771,7 +2771,7 @@ H5T__unregister(H5T_pers_t pers, const char *name, H5T_t *src, H5T_t *dst, H5T_c for (i = H5T_g.nsoft - 1; i >= 0; --i) { soft = H5T_g.soft + i; HDassert(soft); - if (name && *name && HDstrcmp(name, soft->name)) + if (name && *name && HDstrcmp(name, soft->name) != 0) continue; if (src && src->shared->type != soft->src) continue; @@ -2793,7 +2793,7 @@ H5T__unregister(H5T_pers_t pers, const char *name, H5T_t *src, H5T_t *dst, H5T_c /* Not a match */ if (((H5T_PERS_SOFT == pers && path->is_hard) || (H5T_PERS_HARD == pers && !path->is_hard)) || - (name && *name && HDstrcmp(name, path->name)) || (src && H5T_cmp(src, path->src, FALSE)) || + (name && *name && HDstrcmp(name, path->name) != 0) || (src && H5T_cmp(src, path->src, FALSE)) || (dst && H5T_cmp(dst, path->dst, FALSE)) || (func && func != path->conv.u.app_func)) { /* * Notify all other functions to recalculate private data since some diff --git a/src/H5Tconv.c b/src/H5Tconv.c index 8cc6ede26bb..7b5fce16c75 100644 --- a/src/H5Tconv.c +++ b/src/H5Tconv.c @@ -2699,7 +2699,7 @@ H5T__conv_enum_init(H5T_t *src, H5T_t *dst, H5T_cdata_t *cdata) HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "memory allocation failed") for (i = 0, j = 0; i < src->shared->u.enumer.nmembs && j < dst->shared->u.enumer.nmembs; i++, j++) { while (j < dst->shared->u.enumer.nmembs && - HDstrcmp(src->shared->u.enumer.name[i], dst->shared->u.enumer.name[j])) + HDstrcmp(src->shared->u.enumer.name[i], dst->shared->u.enumer.name[j]) != 0) j++; if (j >= dst->shared->u.enumer.nmembs) HGOTO_ERROR(H5E_DATATYPE, H5E_UNSUPPORTED, FAIL, diff --git a/test/btree2.c b/test/btree2.c index 08234ade41e..ed0bcd62280 100644 --- a/test/btree2.c +++ b/test/btree2.c @@ -8658,8 +8658,8 @@ HDfprintf(stderr, "curr_time = %lu\n", (unsigned long)curr_time); TEST_ERROR /* Check for VFD which stores data in multiple files */ - single_file_vfd = (hbool_t)(HDstrcmp(env_h5_drvr, "split") && HDstrcmp(env_h5_drvr, "multi") && - HDstrcmp(env_h5_drvr, "family")); + single_file_vfd = (hbool_t)(HDstrcmp(env_h5_drvr, "split") != 0 && HDstrcmp(env_h5_drvr, "multi") != 0 && + HDstrcmp(env_h5_drvr, "family") != 0); if (single_file_vfd) { /* Make a copy of the file in memory, in order to speed up deletion testing */ diff --git a/test/cache_image.c b/test/cache_image.c index 9c8f8558139..5eee99da9f3 100644 --- a/test/cache_image.c +++ b/test/cache_image.c @@ -7850,8 +7850,8 @@ main(void) HDprintf("=========================================\n"); /* Check for VFD which stores data in multiple files */ - single_file_vfd = (hbool_t)(HDstrcmp(env_h5_drvr, "split") && HDstrcmp(env_h5_drvr, "multi") && - HDstrcmp(env_h5_drvr, "family")); + single_file_vfd = (hbool_t)(HDstrcmp(env_h5_drvr, "split") != 0 && HDstrcmp(env_h5_drvr, "multi") != 0 && + HDstrcmp(env_h5_drvr, "family") != 0); nerrs += check_cache_image_ctl_flow_1(single_file_vfd); nerrs += check_cache_image_ctl_flow_2(single_file_vfd); diff --git a/test/cache_logging.c b/test/cache_logging.c index 1ae908bd784..448e12b1fcc 100644 --- a/test/cache_logging.c +++ b/test/cache_logging.c @@ -76,7 +76,7 @@ test_logging_api(void) if (H5Pget_mdc_log_options(fapl, &is_enabled_out, location, &size, &start_on_access_out) < 0) TEST_ERROR; if ((is_enabled != is_enabled_out) || (start_on_access != start_on_access_out) || - HDstrcmp(LOG_LOCATION, location)) + HDstrcmp(LOG_LOCATION, location) != 0) TEST_ERROR; /* Create a file */ diff --git a/test/cmpd_dset.c b/test/cmpd_dset.c index 1008b60725d..e74b4381938 100644 --- a/test/cmpd_dset.c +++ b/test/cmpd_dset.c @@ -2233,7 +2233,7 @@ main(int argc, char *argv[]) /* Turn off optimized compound converter? */ if (argc > 1) { - if (argc > 2 || HDstrcmp("--noopt", argv[1])) { + if (argc > 2 || HDstrcmp("--noopt", argv[1]) != 0) { HDfprintf(stderr, "usage: %s [--noopt]\n", argv[0]); HDexit(EXIT_FAILURE); } diff --git a/test/dsets.c b/test/dsets.c index a7b9358294b..2ad93b19c89 100644 --- a/test/dsets.c +++ b/test/dsets.c @@ -539,7 +539,8 @@ test_simple_io(const char *env_h5_drvr, hid_t fapl) TESTING("simple I/O"); /* Can't run this test with multi-file VFDs because of HDopen/read/seek the file directly */ - if (HDstrcmp(env_h5_drvr, "split") && HDstrcmp(env_h5_drvr, "multi") && HDstrcmp(env_h5_drvr, "family")) { + if (HDstrcmp(env_h5_drvr, "split") != 0 && HDstrcmp(env_h5_drvr, "multi") != 0 && + HDstrcmp(env_h5_drvr, "family") != 0) { h5_fixname(FILENAME[4], fapl, filename, sizeof filename); /* Set up data array */ @@ -699,7 +700,8 @@ test_userblock_offset(const char *env_h5_drvr, hid_t fapl, hbool_t new_format) TESTING("dataset offset with user block"); /* Can't run this test with multi-file VFDs because of HDopen/read/seek the file directly */ - if (HDstrcmp(env_h5_drvr, "split") && HDstrcmp(env_h5_drvr, "multi") && HDstrcmp(env_h5_drvr, "family")) { + if (HDstrcmp(env_h5_drvr, "split") != 0 && HDstrcmp(env_h5_drvr, "multi") != 0 && + HDstrcmp(env_h5_drvr, "family") != 0) { h5_fixname(FILENAME[2], fapl, filename, sizeof filename); /* Set up data array */ @@ -15081,7 +15083,7 @@ main(void) envval = "nomatch"; /* Current VFD that does not support contigous address space */ - contig_addr_vfd = (hbool_t)(HDstrcmp(envval, "split") && HDstrcmp(envval, "multi")); + contig_addr_vfd = (hbool_t)(HDstrcmp(envval, "split") != 0 && HDstrcmp(envval, "multi") != 0); /* Set the random # seed */ HDsrandom((unsigned)HDtime(NULL)); diff --git a/test/dtypes.c b/test/dtypes.c index 0fbb3b526c2..3cd0cf3a063 100644 --- a/test/dtypes.c +++ b/test/dtypes.c @@ -1141,7 +1141,7 @@ test_compound_5(void) H5Tclose(int_array); /* Check results */ - if (HDmemcmp(src[1].name, dst[1].name, sizeof(src[1].name)) || src[1].tdim != dst[1].tdim || + if (HDmemcmp(src[1].name, dst[1].name, sizeof(src[1].name)) != 0 || src[1].tdim != dst[1].tdim || src[1].coll_ids[0] != dst[1].coll_ids[0] || src[1].coll_ids[1] != dst[1].coll_ids[1] || src[1].coll_ids[2] != dst[1].coll_ids[2] || src[1].coll_ids[3] != dst[1].coll_ids[3]) { H5_FAILED(); @@ -1817,7 +1817,7 @@ test_compound_9(void) goto error; } /* end if */ - if (rdata.i1 != wdata.i1 || rdata.i2 != wdata.i2 || HDstrcmp(rdata.str, wdata.str)) { + if (rdata.i1 != wdata.i1 || rdata.i2 != wdata.i2 || HDstrcmp(rdata.str, wdata.str) != 0) { H5_FAILED(); AT(); HDprintf("incorrect read data\n"); @@ -1891,7 +1891,7 @@ test_compound_9(void) goto error; } /* end if */ - if (rdata.i1 != wdata.i1 || rdata.i2 != wdata.i2 || HDstrcmp(rdata.str, wdata.str)) { + if (rdata.i1 != wdata.i1 || rdata.i2 != wdata.i2 || HDstrcmp(rdata.str, wdata.str) != 0) { H5_FAILED(); AT(); HDprintf("incorrect read data\n"); @@ -2081,7 +2081,7 @@ test_compound_10(void) for (i = 0; i < ARRAY_DIM; i++) { if (rdata[i].i1 != wdata[i].i1 || rdata[i].i2 != wdata[i].i2 || - HDstrcmp(rdata[i].str, wdata[i].str)) { + HDstrcmp(rdata[i].str, wdata[i].str) != 0) { H5_FAILED(); AT(); HDprintf("incorrect read data\n"); @@ -2097,7 +2097,7 @@ test_compound_10(void) t1 = rdata[i].text.p; t2 = wdata[i].text.p; - if (HDstrcmp((char *)t1, (char *)t2)) { + if (HDstrcmp((char *)t1, (char *)t2) != 0) { H5_FAILED(); AT(); HDprintf("incorrect VL read data\n"); @@ -2282,7 +2282,7 @@ test_compound_11(void) ((big_t *)buf_orig)[u].s1, (unsigned)u, ((little_t *)buf)[u].s1); TEST_ERROR } /* end if */ - else if (HDstrcmp(((big_t *)buf_orig)[u].s1, ((little_t *)buf)[u].s1)) { + else if (HDstrcmp(((big_t *)buf_orig)[u].s1, ((little_t *)buf)[u].s1) != 0) { HDprintf("Error, line #%d: buf_orig[%u].s1=%s, buf[%u].s1=%s\n", __LINE__, (unsigned)u, ((big_t *)buf_orig)[u].s1, (unsigned)u, ((little_t *)buf)[u].s1); TEST_ERROR @@ -2333,7 +2333,7 @@ test_compound_11(void) ((big_t *)buf_orig)[u].s1, (unsigned)u, ((little_t *)buf)[u].s1); TEST_ERROR } /* end if */ - else if (HDstrcmp(((big_t *)buf_orig)[u].s1, ((little_t *)buf)[u].s1)) { + else if (HDstrcmp(((big_t *)buf_orig)[u].s1, ((little_t *)buf)[u].s1) != 0) { HDprintf("Error, line #%d: buf_orig[%u].s1=%s, buf[%u].s1=%s\n", __LINE__, (unsigned)u, ((big_t *)buf_orig)[u].s1, (unsigned)u, ((little_t *)buf)[u].s1); TEST_ERROR @@ -2374,7 +2374,7 @@ test_compound_11(void) ((big_t *)buf_orig)[u].s1, (unsigned)u, ((little_t *)buf)[u].s1); TEST_ERROR } /* end if */ - else if (HDstrcmp(((big_t *)buf_orig)[u].s1, ((little_t *)buf)[u].s1)) { + else if (HDstrcmp(((big_t *)buf_orig)[u].s1, ((little_t *)buf)[u].s1) != 0) { HDprintf("Error, line #%d: buf_orig[%u].s1=%s, buf[%u].s1=%s\n", __LINE__, (unsigned)u, ((big_t *)buf_orig)[u].s1, (unsigned)u, ((little_t *)buf)[u].s1); TEST_ERROR @@ -2956,14 +2956,14 @@ test_compound_14(void) goto error; } /* end if */ - if (rdata1.c1 != wdata1.c1 || rdata1.c2 != wdata1.c2 || HDstrcmp(rdata1.str, wdata1.str)) { + if (rdata1.c1 != wdata1.c1 || rdata1.c2 != wdata1.c2 || HDstrcmp(rdata1.str, wdata1.str) != 0) { H5_FAILED(); AT(); HDprintf("incorrect read data\n"); goto error; } /* end if */ - if (rdata2.c1 != wdata2.c1 || rdata2.c2 != wdata2.c2 || HDstrcmp(rdata2.str, wdata2.str) || + if (rdata2.c1 != wdata2.c1 || rdata2.c2 != wdata2.c2 || HDstrcmp(rdata2.str, wdata2.str) != 0 || rdata2.l1 != wdata2.l1 || rdata2.l2 != wdata2.l2 || rdata2.l3 != wdata2.l3 || rdata2.l4 != wdata2.l4) { H5_FAILED(); @@ -3054,14 +3054,14 @@ test_compound_14(void) goto error; } /* end if */ - if (rdata1.c1 != wdata1.c1 || rdata1.c2 != wdata1.c2 || HDstrcmp(rdata1.str, wdata1.str)) { + if (rdata1.c1 != wdata1.c1 || rdata1.c2 != wdata1.c2 || HDstrcmp(rdata1.str, wdata1.str) != 0) { H5_FAILED(); AT(); HDprintf("incorrect read data\n"); goto error; } /* end if */ - if (rdata2.c1 != wdata2.c1 || rdata2.c2 != wdata2.c2 || HDstrcmp(rdata2.str, wdata2.str) || + if (rdata2.c1 != wdata2.c1 || rdata2.c2 != wdata2.c2 || HDstrcmp(rdata2.str, wdata2.str) != 0 || rdata2.l1 != wdata2.l1 || rdata2.l2 != wdata2.l2 || rdata2.l3 != wdata2.l3 || rdata2.l4 != wdata2.l4) { H5_FAILED(); @@ -3885,7 +3885,7 @@ test_query(void) HDprintf("Can't get name for enum member\n"); goto error; } /* end if */ - if (HDstrcmp("YELLOW", enum_name)) { + if (HDstrcmp("YELLOW", enum_name) != 0) { H5_FAILED(); HDprintf("Incorrect name for enum member\n"); goto error; @@ -4504,14 +4504,14 @@ test_conv_str_1(void) HDmemcpy(buf, "abcdefghi\0abcdefghi\0", (size_t)20); if (H5Tconvert(src_type, dst_type, (size_t)2, buf, NULL, H5P_DEFAULT) < 0) goto error; - if (HDmemcmp(buf, "abcd\0abcd\0abcdefghi\0", (size_t)20)) { + if (HDmemcmp(buf, "abcd\0abcd\0abcdefghi\0", (size_t)20) != 0) { H5_FAILED(); HDputs(" Truncated C-string test failed"); goto error; } if (H5Tconvert(dst_type, src_type, (size_t)2, buf, NULL, H5P_DEFAULT) < 0) goto error; - if (HDmemcmp(buf, "abcd\0\0\0\0\0\0abcd\0\0\0\0\0\0", (size_t)20)) { + if (HDmemcmp(buf, "abcd\0\0\0\0\0\0abcd\0\0\0\0\0\0", (size_t)20) != 0) { H5_FAILED(); HDputs(" Extended C-string test failed"); goto error; @@ -4535,14 +4535,14 @@ test_conv_str_1(void) HDmemcpy(buf, "abcdefghijabcdefghij", (size_t)20); if (H5Tconvert(src_type, dst_type, (size_t)2, buf, NULL, H5P_DEFAULT) < 0) goto error; - if (HDmemcmp(buf, "abcdeabcdeabcdefghij", (size_t)20)) { + if (HDmemcmp(buf, "abcdeabcdeabcdefghij", (size_t)20) != 0) { H5_FAILED(); HDputs(" Truncated C buffer test failed"); goto error; } if (H5Tconvert(dst_type, src_type, (size_t)2, buf, NULL, H5P_DEFAULT) < 0) goto error; - if (HDmemcmp(buf, "abcde\0\0\0\0\0abcde\0\0\0\0\0", (size_t)20)) { + if (HDmemcmp(buf, "abcde\0\0\0\0\0abcde\0\0\0\0\0", (size_t)20) != 0) { H5_FAILED(); HDputs(" Extended C buffer test failed"); goto error; @@ -4566,14 +4566,14 @@ test_conv_str_1(void) HDmemcpy(buf, "abcdefghijabcdefghij", (size_t)20); if (H5Tconvert(src_type, dst_type, (size_t)2, buf, NULL, H5P_DEFAULT) < 0) goto error; - if (HDmemcmp(buf, "abcdeabcdeabcdefghij", (size_t)20)) { + if (HDmemcmp(buf, "abcdeabcdeabcdefghij", (size_t)20) != 0) { H5_FAILED(); HDputs(" Truncated Fortran-string test failed"); goto error; } if (H5Tconvert(dst_type, src_type, (size_t)2, buf, NULL, H5P_DEFAULT) < 0) goto error; - if (HDmemcmp(buf, "abcde abcde ", (size_t)20)) { + if (HDmemcmp(buf, "abcde abcde ", (size_t)20) != 0) { H5_FAILED(); HDputs(" Extended Fortran-string test failed"); goto error; @@ -4600,7 +4600,7 @@ test_conv_str_1(void) HDmemcpy(buf, "abcdefghijabcdefghij", (size_t)20); if (H5Tconvert(src_type, dst_type, (size_t)2, buf, NULL, H5P_DEFAULT) < 0) goto error; - if (HDmemcmp(buf, "abcdefghijabcdefghij", (size_t)20)) { + if (HDmemcmp(buf, "abcdefghijabcdefghij", (size_t)20) != 0) { H5_FAILED(); HDputs(" Non-terminated string test 1"); goto error; @@ -4611,7 +4611,7 @@ test_conv_str_1(void) HDmemcpy(buf, "abcdefghijabcdefghij", (size_t)20); if (H5Tconvert(src_type, dst_type, (size_t)2, buf, NULL, H5P_DEFAULT) < 0) goto error; - if (HDmemcmp(buf, "abcd\0abcd\0abcdefghij", (size_t)20)) { + if (HDmemcmp(buf, "abcd\0abcd\0abcdefghij", (size_t)20) != 0) { H5_FAILED(); HDputs(" Non-terminated string test 2"); goto error; @@ -4619,7 +4619,7 @@ test_conv_str_1(void) HDmemcpy(buf, "abcdeabcdexxxxxxxxxx", (size_t)20); if (H5Tconvert(dst_type, src_type, (size_t)2, buf, NULL, H5P_DEFAULT) < 0) goto error; - if (HDmemcmp(buf, "abcde\0\0\0\0\0abcde\0\0\0\0\0", (size_t)20)) { + if (HDmemcmp(buf, "abcde\0\0\0\0\0abcde\0\0\0\0\0", (size_t)20) != 0) { H5_FAILED(); HDputs(" Non-terminated string test 2"); goto error; @@ -4643,14 +4643,14 @@ test_conv_str_1(void) HDmemcpy(buf, "abcdefghi\0abcdefghi\0", (size_t)20); if (H5Tconvert(src_type, dst_type, (size_t)2, buf, NULL, H5P_DEFAULT) < 0) goto error; - if (HDmemcmp(buf, "abcdefghi abcdefghi ", (size_t)20)) { + if (HDmemcmp(buf, "abcdefghi abcdefghi ", (size_t)20) != 0) { H5_FAILED(); HDputs(" C string to Fortran test 1"); goto error; } if (H5Tconvert(dst_type, src_type, (size_t)2, buf, NULL, H5P_DEFAULT) < 0) goto error; - if (HDmemcmp(buf, "abcdefghi\0abcdefghi\0", (size_t)20)) { + if (HDmemcmp(buf, "abcdefghi\0abcdefghi\0", (size_t)20) != 0) { H5_FAILED(); HDputs(" Fortran to C string test 1"); goto error; @@ -4662,14 +4662,14 @@ test_conv_str_1(void) HDmemcpy(buf, "abcdefgh\0\0abcdefgh\0\0", (size_t)20); if (H5Tconvert(src_type, dst_type, (size_t)2, buf, NULL, H5P_DEFAULT) < 0) goto error; - if (HDmemcmp(buf, "abcdeabcdeabcdefgh\0\0", (size_t)20)) { + if (HDmemcmp(buf, "abcdeabcdeabcdefgh\0\0", (size_t)20) != 0) { H5_FAILED(); HDputs(" C string to Fortran test 2"); goto error; } if (H5Tconvert(dst_type, src_type, (size_t)2, buf, NULL, H5P_DEFAULT) < 0) goto error; - if (HDmemcmp(buf, "abcde\0\0\0\0\0abcde\0\0\0\0\0", (size_t)20)) { + if (HDmemcmp(buf, "abcde\0\0\0\0\0abcde\0\0\0\0\0", (size_t)20) != 0) { H5_FAILED(); HDputs(" Fortran to C string test 2"); goto error; @@ -4685,14 +4685,14 @@ test_conv_str_1(void) HDmemcpy(buf, "abcd\0abcd\0xxxxxxxxxx", (size_t)20); if (H5Tconvert(src_type, dst_type, (size_t)2, buf, NULL, H5P_DEFAULT) < 0) goto error; - if (HDmemcmp(buf, "abcd abcd ", (size_t)20)) { + if (HDmemcmp(buf, "abcd abcd ", (size_t)20) != 0) { H5_FAILED(); HDputs(" C string to Fortran test 3"); goto error; } if (H5Tconvert(dst_type, src_type, (size_t)2, buf, NULL, H5P_DEFAULT) < 0) goto error; - if (HDmemcmp(buf, "abcd\0abcd\0abcd ", (size_t)20)) { + if (HDmemcmp(buf, "abcd\0abcd\0abcd ", (size_t)20) != 0) { H5_FAILED(); HDputs(" Fortran to C string test 3"); goto error; @@ -4716,14 +4716,14 @@ test_conv_str_1(void) HDmemcpy(buf, "abcdefghijabcdefghij", (size_t)20); if (H5Tconvert(src_type, dst_type, (size_t)2, buf, NULL, H5P_DEFAULT) < 0) goto error; - if (HDmemcmp(buf, "abcdefghijabcdefghij", (size_t)20)) { + if (HDmemcmp(buf, "abcdefghijabcdefghij", (size_t)20) != 0) { H5_FAILED(); HDputs(" C buffer to Fortran test 1"); goto error; } if (H5Tconvert(dst_type, src_type, (size_t)2, buf, NULL, H5P_DEFAULT) < 0) goto error; - if (HDmemcmp(buf, "abcdefghijabcdefghij", (size_t)20)) { + if (HDmemcmp(buf, "abcdefghijabcdefghij", (size_t)20) != 0) { H5_FAILED(); HDputs(" Fortran to C buffer test 1"); goto error; @@ -4735,14 +4735,14 @@ test_conv_str_1(void) HDmemcpy(buf, "abcdefgh\0\0abcdefgh\0\0", (size_t)20); if (H5Tconvert(src_type, dst_type, (size_t)2, buf, NULL, H5P_DEFAULT) < 0) goto error; - if (HDmemcmp(buf, "abcdeabcdeabcdefgh\0\0", (size_t)20)) { + if (HDmemcmp(buf, "abcdeabcdeabcdefgh\0\0", (size_t)20) != 0) { H5_FAILED(); HDputs(" C buffer to Fortran test 2"); goto error; } if (H5Tconvert(dst_type, src_type, (size_t)2, buf, NULL, H5P_DEFAULT) < 0) goto error; - if (HDmemcmp(buf, "abcde\0\0\0\0\0abcde\0\0\0\0\0", (size_t)20)) { + if (HDmemcmp(buf, "abcde\0\0\0\0\0abcde\0\0\0\0\0", (size_t)20) != 0) { H5_FAILED(); HDputs(" Fortran to C buffer test 2"); goto error; @@ -4758,14 +4758,14 @@ test_conv_str_1(void) HDmemcpy(buf, "abcd\0abcd\0xxxxxxxxxx", (size_t)20); if (H5Tconvert(src_type, dst_type, (size_t)2, buf, NULL, H5P_DEFAULT) < 0) goto error; - if (HDmemcmp(buf, "abcd abcd ", (size_t)20)) { + if (HDmemcmp(buf, "abcd abcd ", (size_t)20) != 0) { H5_FAILED(); HDputs(" C buffer to Fortran test 3"); goto error; } if (H5Tconvert(dst_type, src_type, (size_t)2, buf, NULL, H5P_DEFAULT) < 0) goto error; - if (HDmemcmp(buf, "abcd\0abcd\0abcd ", (size_t)20)) { + if (HDmemcmp(buf, "abcd\0abcd\0abcd ", (size_t)20) != 0) { H5_FAILED(); HDputs(" Fortran to C buffer test 3"); goto error; @@ -7193,7 +7193,7 @@ test_named_indirect_reopen(hid_t fapl) TEST_ERROR if (NULL == (tag_ret = H5Tget_tag(type))) TEST_ERROR - if (HDstrcmp(tag, tag_ret)) + if (HDstrcmp(tag, tag_ret) != 0) TEST_ERROR H5free_memory(tag_ret); tag_ret = NULL; @@ -7209,7 +7209,7 @@ test_named_indirect_reopen(hid_t fapl) TEST_ERROR if (NULL == (tag_ret = H5Tget_tag(type))) TEST_ERROR - if (HDstrcmp(tag, tag_ret)) + if (HDstrcmp(tag, tag_ret) != 0) TEST_ERROR H5free_memory(tag_ret); tag_ret = NULL; diff --git a/test/error_test.c b/test/error_test.c index 99b2117a67d..21898f13c9c 100644 --- a/test/error_test.c +++ b/test/error_test.c @@ -195,7 +195,7 @@ init_error(void) if (cls_size != H5Eget_class_name(ERR_CLS, cls_name, (size_t)cls_size) + 1) TEST_ERROR; - if (HDstrcmp(ERR_CLS_NAME, cls_name)) + if (HDstrcmp(ERR_CLS_NAME, cls_name) != 0) TEST_ERROR; if ((ERR_MAJ_TEST = H5Ecreate_msg(ERR_CLS, H5E_MAJOR, ERR_MAJ_TEST_MSG)) < 0) @@ -220,7 +220,7 @@ init_error(void) TEST_ERROR; if (msg_type != H5E_MINOR) TEST_ERROR; - if (HDstrcmp(msg, ERR_MIN_SUBROUTINE_MSG)) + if (HDstrcmp(msg, ERR_MIN_SUBROUTINE_MSG) != 0) TEST_ERROR; /* Register another class for later testing. */ diff --git a/test/external.c b/test/external.c index 0957a03f1d1..c2476b31c2e 100644 --- a/test/external.c +++ b/test/external.c @@ -72,7 +72,7 @@ files_have_same_contents(const char *name1, const char *name2) break; } - if (HDmemcmp(buf1, buf2, (size_t)n1)) + if (HDmemcmp(buf1, buf2, (size_t)n1) != 0) break; } /* end while */ diff --git a/test/fheap.c b/test/fheap.c index 2ccaa100fc9..5066d8eb066 100644 --- a/test/fheap.c +++ b/test/fheap.c @@ -424,7 +424,7 @@ add_obj(H5HF_t *fh, size_t obj_off, size_t obj_size, fheap_heap_state_t *state, TEST_ERROR if (H5HF_read(fh, heap_id, shared_robj_g) < 0) FAIL_STACK_ERROR - if (HDmemcmp(obj, shared_robj_g, obj_size)) + if (HDmemcmp(obj, shared_robj_g, obj_size) != 0) TEST_ERROR /* If the heap IDs are to be retained, append them to the list */ @@ -1192,7 +1192,7 @@ fill_heap(H5HF_t *fh, unsigned block_row, size_t obj_size, fheap_heap_state_t *s /* Check that object is correct */ wobj = &shared_wobj_g[*curr_off_ptr]; - if (HDmemcmp(wobj, shared_robj_g, *curr_len_ptr)) + if (HDmemcmp(wobj, shared_robj_g, *curr_len_ptr) != 0) TEST_ERROR /* Adjust object & ID pointers */ @@ -12698,7 +12698,7 @@ test_huge_insert_one(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tpar HDmemset(shared_robj_g, 0, obj_size); if (H5HF_read(fh, heap_id, shared_robj_g) < 0) FAIL_STACK_ERROR - if (HDmemcmp(shared_wobj_g, shared_robj_g, obj_size)) + if (HDmemcmp(shared_wobj_g, shared_robj_g, obj_size) != 0) TEST_ERROR /* Delete individual objects, if we won't be deleting the entire heap later */ @@ -12851,7 +12851,7 @@ test_huge_insert_two(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tpar HDmemset(shared_robj_g, 0, obj_size); if (H5HF_read(fh, heap_id, shared_robj_g) < 0) FAIL_STACK_ERROR - if (HDmemcmp(shared_wobj_g, shared_robj_g, obj_size)) + if (HDmemcmp(shared_wobj_g, shared_robj_g, obj_size) != 0) TEST_ERROR /* Insert second object too large for managed heap blocks */ @@ -12881,7 +12881,7 @@ test_huge_insert_two(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tpar HDmemset(shared_robj_g, 0, obj_size); if (H5HF_read(fh, heap_id2, shared_robj_g) < 0) FAIL_STACK_ERROR - if (HDmemcmp(shared_wobj_g, shared_robj_g, obj_size)) + if (HDmemcmp(shared_wobj_g, shared_robj_g, obj_size) != 0) TEST_ERROR /* Delete individual objects, if we won't be deleting the entire heap later */ @@ -13084,7 +13084,7 @@ test_huge_insert_three(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tp HDmemset(shared_robj_g, 0, obj_size); if (H5HF_read(fh, heap_id, shared_robj_g) < 0) FAIL_STACK_ERROR - if (HDmemcmp(shared_wobj_g, shared_robj_g, obj_size)) + if (HDmemcmp(shared_wobj_g, shared_robj_g, obj_size) != 0) TEST_ERROR /* Insert second object too large for managed heap blocks */ @@ -13114,7 +13114,7 @@ test_huge_insert_three(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tp HDmemset(shared_robj_g, 0, obj_size); if (H5HF_read(fh, heap_id2, shared_robj_g) < 0) FAIL_STACK_ERROR - if (HDmemcmp(shared_wobj_g, shared_robj_g, obj_size)) + if (HDmemcmp(shared_wobj_g, shared_robj_g, obj_size) != 0) TEST_ERROR /* Insert third object too large for managed heap blocks */ @@ -13144,7 +13144,7 @@ test_huge_insert_three(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tp HDmemset(shared_robj_g, 0, obj_size); if (H5HF_read(fh, heap_id3, shared_robj_g) < 0) FAIL_STACK_ERROR - if (HDmemcmp(shared_wobj_g, shared_robj_g, obj_size)) + if (HDmemcmp(shared_wobj_g, shared_robj_g, obj_size) != 0) TEST_ERROR /* Delete individual objects, if we won't be deleting the entire heap later */ @@ -13395,7 +13395,7 @@ test_huge_insert_mix(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tpar HDmemset(shared_robj_g, 0, obj_size); if (H5HF_read(fh, heap_id, shared_robj_g) < 0) FAIL_STACK_ERROR - if (HDmemcmp(shared_wobj_g, shared_robj_g, obj_size)) + if (HDmemcmp(shared_wobj_g, shared_robj_g, obj_size) != 0) TEST_ERROR /* Insert second object too large for managed heap blocks */ @@ -13425,7 +13425,7 @@ test_huge_insert_mix(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tpar HDmemset(shared_robj_g, 0, obj_size); if (H5HF_read(fh, heap_id2, shared_robj_g) < 0) FAIL_STACK_ERROR - if (HDmemcmp(shared_wobj_g, shared_robj_g, obj_size)) + if (HDmemcmp(shared_wobj_g, shared_robj_g, obj_size) != 0) TEST_ERROR /* Insert third object too large for managed heap blocks */ @@ -13455,7 +13455,7 @@ test_huge_insert_mix(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tpar HDmemset(shared_robj_g, 0, obj_size); if (H5HF_read(fh, heap_id3, shared_robj_g) < 0) FAIL_STACK_ERROR - if (HDmemcmp(shared_wobj_g, shared_robj_g, obj_size)) + if (HDmemcmp(shared_wobj_g, shared_robj_g, obj_size) != 0) TEST_ERROR /* Insert fourth object small enough to fit into 'normal' heap blocks */ @@ -13492,7 +13492,7 @@ test_huge_insert_mix(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tpar HDmemset(shared_robj_g, 0, obj_size); if (H5HF_read(fh, heap_id4, shared_robj_g) < 0) FAIL_STACK_ERROR - if (HDmemcmp(shared_wobj_g, shared_robj_g, obj_size)) + if (HDmemcmp(shared_wobj_g, shared_robj_g, obj_size) != 0) TEST_ERROR /* Insert fifth object small enough to fit into 'normal' heap blocks */ @@ -13530,7 +13530,7 @@ test_huge_insert_mix(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tpar HDmemset(shared_robj_g, 0, obj_size); if (H5HF_read(fh, heap_id5, shared_robj_g) < 0) FAIL_STACK_ERROR - if (HDmemcmp(shared_wobj_g, shared_robj_g, obj_size)) + if (HDmemcmp(shared_wobj_g, shared_robj_g, obj_size) != 0) TEST_ERROR /* Delete individual objects, if we won't be deleting the entire heap later */ @@ -13868,7 +13868,7 @@ test_filtered_huge(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tparam HDmemset(shared_robj_g, 0, obj_size); if (H5HF_read(fh, heap_id, shared_robj_g) < 0) FAIL_STACK_ERROR - if (HDmemcmp(shared_wobj_g, shared_robj_g, obj_size)) + if (HDmemcmp(shared_wobj_g, shared_robj_g, obj_size) != 0) TEST_ERROR /* Delete individual objects, if we won't be deleting the entire heap later */ @@ -14019,7 +14019,7 @@ test_tiny_insert_one(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tpar HDmemset(shared_robj_g, 0, obj_size); if (H5HF_read(fh, heap_id, shared_robj_g) < 0) FAIL_STACK_ERROR - if (HDmemcmp(shared_wobj_g, shared_robj_g, obj_size)) + if (HDmemcmp(shared_wobj_g, shared_robj_g, obj_size) != 0) TEST_ERROR /* Delete individual objects, if we won't be deleting the entire heap later */ @@ -14172,7 +14172,7 @@ test_tiny_insert_two(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tpar HDmemset(shared_robj_g, 0, obj_size); if (H5HF_read(fh, heap_id, shared_robj_g) < 0) FAIL_STACK_ERROR - if (HDmemcmp(shared_wobj_g, shared_robj_g, obj_size)) + if (HDmemcmp(shared_wobj_g, shared_robj_g, obj_size) != 0) TEST_ERROR /* Insert second object small enough to encode in heap ID */ @@ -14202,7 +14202,7 @@ test_tiny_insert_two(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tpar HDmemset(shared_robj_g, 0, obj_size); if (H5HF_read(fh, heap_id2, shared_robj_g) < 0) FAIL_STACK_ERROR - if (HDmemcmp(shared_wobj_g, shared_robj_g, obj_size)) + if (HDmemcmp(shared_wobj_g, shared_robj_g, obj_size) != 0) TEST_ERROR /* Delete individual objects, if we won't be deleting the entire heap later */ @@ -14418,14 +14418,14 @@ test_tiny_insert_mix(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tpar HDmemset(shared_robj_g, 0, obj_size); if (H5HF_read(fh, heap_id, shared_robj_g) < 0) FAIL_STACK_ERROR - if (HDmemcmp(shared_wobj_g, shared_robj_g, obj_size)) + if (HDmemcmp(shared_wobj_g, shared_robj_g, obj_size) != 0) TEST_ERROR /* Check 'op' functionality on first huge object */ HDmemset(shared_robj_g, 0, obj_size); if (H5HF_op(fh, heap_id, op_memcpy, shared_robj_g) < 0) FAIL_STACK_ERROR - if (HDmemcmp(shared_wobj_g, shared_robj_g, obj_size)) + if (HDmemcmp(shared_wobj_g, shared_robj_g, obj_size) != 0) TEST_ERROR /* Insert second object too large for managed heap blocks */ @@ -14455,14 +14455,14 @@ test_tiny_insert_mix(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tpar HDmemset(shared_robj_g, 0, obj_size); if (H5HF_read(fh, heap_id2, shared_robj_g) < 0) FAIL_STACK_ERROR - if (HDmemcmp(shared_wobj_g, shared_robj_g, obj_size)) + if (HDmemcmp(shared_wobj_g, shared_robj_g, obj_size) != 0) TEST_ERROR /* Check 'op' functionality on second huge object */ HDmemset(shared_robj_g, 0, obj_size); if (H5HF_op(fh, heap_id2, op_memcpy, shared_robj_g) < 0) FAIL_STACK_ERROR - if (HDmemcmp(shared_wobj_g, shared_robj_g, obj_size)) + if (HDmemcmp(shared_wobj_g, shared_robj_g, obj_size) != 0) TEST_ERROR /* Insert third object too large for managed heap blocks */ @@ -14492,14 +14492,14 @@ test_tiny_insert_mix(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tpar HDmemset(shared_robj_g, 0, obj_size); if (H5HF_read(fh, heap_id3, shared_robj_g) < 0) FAIL_STACK_ERROR - if (HDmemcmp(shared_wobj_g, shared_robj_g, obj_size)) + if (HDmemcmp(shared_wobj_g, shared_robj_g, obj_size) != 0) TEST_ERROR /* Check 'op' functionality on third huge object */ HDmemset(shared_robj_g, 0, obj_size); if (H5HF_op(fh, heap_id3, op_memcpy, shared_robj_g) < 0) FAIL_STACK_ERROR - if (HDmemcmp(shared_wobj_g, shared_robj_g, obj_size)) + if (HDmemcmp(shared_wobj_g, shared_robj_g, obj_size) != 0) TEST_ERROR /* Insert fourth object small enough to fit into 'normal' heap blocks */ @@ -14536,14 +14536,14 @@ test_tiny_insert_mix(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tpar HDmemset(shared_robj_g, 0, obj_size); if (H5HF_read(fh, heap_id4, shared_robj_g) < 0) FAIL_STACK_ERROR - if (HDmemcmp(shared_wobj_g, shared_robj_g, obj_size)) + if (HDmemcmp(shared_wobj_g, shared_robj_g, obj_size) != 0) TEST_ERROR /* Check 'op' functionality on fourth ('normal') object */ HDmemset(shared_robj_g, 0, obj_size); if (H5HF_op(fh, heap_id4, op_memcpy, shared_robj_g) < 0) FAIL_STACK_ERROR - if (HDmemcmp(shared_wobj_g, shared_robj_g, obj_size)) + if (HDmemcmp(shared_wobj_g, shared_robj_g, obj_size) != 0) TEST_ERROR /* Insert fifth object small enough to fit into 'normal' heap blocks */ @@ -14581,14 +14581,14 @@ test_tiny_insert_mix(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tpar HDmemset(shared_robj_g, 0, obj_size); if (H5HF_read(fh, heap_id5, shared_robj_g) < 0) FAIL_STACK_ERROR - if (HDmemcmp(shared_wobj_g, shared_robj_g, obj_size)) + if (HDmemcmp(shared_wobj_g, shared_robj_g, obj_size) != 0) TEST_ERROR /* Check 'op' functionality on fifth ('normal') object */ HDmemset(shared_robj_g, 0, obj_size); if (H5HF_op(fh, heap_id5, op_memcpy, shared_robj_g) < 0) FAIL_STACK_ERROR - if (HDmemcmp(shared_wobj_g, shared_robj_g, obj_size)) + if (HDmemcmp(shared_wobj_g, shared_robj_g, obj_size) != 0) TEST_ERROR /* Insert sixth object small enough to encode in heap ID */ @@ -14618,14 +14618,14 @@ test_tiny_insert_mix(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tpar HDmemset(shared_robj_g, 0, obj_size); if (H5HF_read(fh, heap_id6, shared_robj_g) < 0) FAIL_STACK_ERROR - if (HDmemcmp(shared_wobj_g, shared_robj_g, obj_size)) + if (HDmemcmp(shared_wobj_g, shared_robj_g, obj_size) != 0) TEST_ERROR /* Check 'op' functionality on sixth ('tiny') object */ HDmemset(shared_robj_g, 0, obj_size); if (H5HF_op(fh, heap_id6, op_memcpy, shared_robj_g) < 0) FAIL_STACK_ERROR - if (HDmemcmp(shared_wobj_g, shared_robj_g, obj_size)) + if (HDmemcmp(shared_wobj_g, shared_robj_g, obj_size) != 0) TEST_ERROR /* Insert seventh object small enough to encode in heap ID */ @@ -14655,14 +14655,14 @@ test_tiny_insert_mix(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tpar HDmemset(shared_robj_g, 0, obj_size); if (H5HF_read(fh, heap_id7, shared_robj_g) < 0) FAIL_STACK_ERROR - if (HDmemcmp(shared_wobj_g, shared_robj_g, obj_size)) + if (HDmemcmp(shared_wobj_g, shared_robj_g, obj_size) != 0) TEST_ERROR /* Check 'op' functionality on seventh ('tiny') object */ HDmemset(shared_robj_g, 0, obj_size); if (H5HF_op(fh, heap_id7, op_memcpy, shared_robj_g) < 0) FAIL_STACK_ERROR - if (HDmemcmp(shared_wobj_g, shared_robj_g, obj_size)) + if (HDmemcmp(shared_wobj_g, shared_robj_g, obj_size) != 0) TEST_ERROR /* Delete individual objects, if we won't be deleting the entire heap later */ @@ -15032,7 +15032,7 @@ test_filtered_man_root_direct(hid_t fapl, H5HF_create_t *cparam, fheap_test_para HDmemset(shared_robj_g, 0, obj_size); if (H5HF_read(fh, heap_id, shared_robj_g) < 0) FAIL_STACK_ERROR - if (HDmemcmp(shared_wobj_g, shared_robj_g, obj_size)) + if (HDmemcmp(shared_wobj_g, shared_robj_g, obj_size) != 0) TEST_ERROR /* Delete individual objects, if we won't be deleting the entire heap later */ @@ -15215,7 +15215,7 @@ test_filtered_man_root_indirect(hid_t fapl, H5HF_create_t *cparam, fheap_test_pa HDmemset(shared_robj_g, 0, obj_size); if (H5HF_read(fh, heap_id1, shared_robj_g) < 0) FAIL_STACK_ERROR - if (HDmemcmp(shared_wobj_g, shared_robj_g, obj_size)) + if (HDmemcmp(shared_wobj_g, shared_robj_g, obj_size) != 0) TEST_ERROR /* Read in ('normal') object #2 */ @@ -15226,7 +15226,7 @@ test_filtered_man_root_indirect(hid_t fapl, H5HF_create_t *cparam, fheap_test_pa HDmemset(shared_robj_g, 0, obj_size); if (H5HF_read(fh, heap_id2, shared_robj_g) < 0) FAIL_STACK_ERROR - if (HDmemcmp(shared_wobj_g, shared_robj_g, obj_size)) + if (HDmemcmp(shared_wobj_g, shared_robj_g, obj_size) != 0) TEST_ERROR /* Delete individual objects, if we won't be deleting the entire heap later */ @@ -16032,7 +16032,7 @@ test_write(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tparam) FAIL_STACK_ERROR /* Compare data read in */ - if (HDmemcmp(rewrite_obj, shared_robj_g, obj_size)) + if (HDmemcmp(rewrite_obj, shared_robj_g, obj_size) != 0) TEST_ERROR /* Change size of data to write */ @@ -16081,7 +16081,7 @@ test_write(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tparam) FAIL_STACK_ERROR /* Compare data read in */ - if (HDmemcmp(rewrite_obj, shared_robj_g, obj_size)) + if (HDmemcmp(rewrite_obj, shared_robj_g, obj_size) != 0) TEST_ERROR /* Change size of data to write */ @@ -16340,7 +16340,7 @@ main(void) envval = "nomatch"; /* Current VFD that does not support contigous address space */ - contig_addr_vfd = (hbool_t)(HDstrcmp(envval, "split") && HDstrcmp(envval, "multi")); + contig_addr_vfd = (hbool_t)(HDstrcmp(envval, "split") != 0 && HDstrcmp(envval, "multi") != 0); /* Reset library */ h5_reset(); diff --git a/test/filenotclosed.c b/test/filenotclosed.c index 519ccb1890f..b5def9b4f45 100644 --- a/test/filenotclosed.c +++ b/test/filenotclosed.c @@ -77,7 +77,7 @@ main(void) * Further investigation is needed to resolve the test failure with the * split/multi driver. Please see HDFFV-10160. */ - contig_addr_vfd = (hbool_t)(HDstrcmp(env_h5_drvr, "split") && HDstrcmp(env_h5_drvr, "multi")); + contig_addr_vfd = (hbool_t)(HDstrcmp(env_h5_drvr, "split") != 0 && HDstrcmp(env_h5_drvr, "multi") != 0); if (!contig_addr_vfd) { SKIPPED(); HDputs(" Temporary skipped for a spilt/multi driver"); diff --git a/test/fillval.c b/test/fillval.c index 8a9b41f9c19..4c0361ecf5e 100644 --- a/test/fillval.c +++ b/test/fillval.c @@ -318,7 +318,7 @@ test_getset_vl(hid_t fapl) TEST_ERROR /* Verify that the fill value is the original value */ - if (HDstrcmp(f2, orig_fill_value)) + if (HDstrcmp(f2, orig_fill_value) != 0) TEST_ERROR /* Release the fill value retrieved */ @@ -360,7 +360,7 @@ test_getset_vl(hid_t fapl) TEST_ERROR /* Verify that the fill value is the original value */ - if (HDstrcmp(f2, orig_fill_value)) + if (HDstrcmp(f2, orig_fill_value) != 0) TEST_ERROR /* Release the fill value retrieved */ @@ -1529,8 +1529,8 @@ test_extend_verify_cmpd_vl(unsigned lineno, const hsize_t *offset, const void *_ (const comp_vl_datatype *)_compare_val; /* Value to compare against */ /* Verify value */ - if ((test_val->x != compare_val->x) || HDstrcmp(test_val->a, compare_val->a) || - HDstrcmp(test_val->b, compare_val->b) || (test_val->y != compare_val->y)) { + if ((test_val->x != compare_val->x) || HDstrcmp(test_val->a, compare_val->a) != 0 || + HDstrcmp(test_val->b, compare_val->b) != 0 || (test_val->y != compare_val->y)) { HDfprintf(stdout, "%u: Value read was not expected.\n", lineno); HDfprintf(stdout, " Elmt = {%" PRIuHSIZE ", %" PRIuHSIZE ", %" PRIuHSIZE ", %" PRIuHSIZE ", %" PRIuHSIZE diff --git a/test/getname.c b/test/getname.c index d90e1c1e742..b7c0d64f318 100644 --- a/test/getname.c +++ b/test/getname.c @@ -68,11 +68,11 @@ check_name(hid_t id, const char *chk_name, const char *chk_user_path) TEST_ERROR /* Check on name from H5Iget_name() */ - if (HDstrcmp(name, chk_name)) + if (HDstrcmp(name, chk_name) != 0) goto error; /* Check on user path */ - if (HDstrcmp(user_path, chk_user_path)) + if (HDstrcmp(user_path, chk_user_path) != 0) goto error; /* Check that if user path is hidden, the name from H5Iget_name() and the user path should be different */ @@ -1439,7 +1439,7 @@ test_main(hid_t file_id, hid_t fapl) /* Check that name is longer */ if (name_len <= SMALL_NAME_BUF_SIZE) TEST_ERROR - if (HDstrcmp(name2, "/")) + if (HDstrcmp(name2, "/") != 0) TEST_ERROR } @@ -1481,7 +1481,7 @@ test_main(hid_t file_id, hid_t fapl) TEST_ERROR /* Verify */ - if (HDstrcmp(name3, "/g17")) + if (HDstrcmp(name3, "/g17") != 0) TEST_ERROR *name3 = '\0'; @@ -1491,7 +1491,7 @@ test_main(hid_t file_id, hid_t fapl) TEST_ERROR /* Verify */ - if (HDstrcmp(name3, "/g")) + if (HDstrcmp(name3, "/g") != 0) TEST_ERROR HDfree(name3); diff --git a/test/gheap.c b/test/gheap.c index 41a830418c2..536237ccf8c 100644 --- a/test/gheap.c +++ b/test/gheap.c @@ -129,7 +129,7 @@ test_1(hid_t fapl) HDputs(" Unable to read object"); nerrors++; } - else if (HDmemcmp(in, out, size)) { + else if (HDmemcmp(in, out, size) != 0) { H5_FAILED(); HDputs(" Value read doesn't match value written"); nerrors++; @@ -226,7 +226,7 @@ test_2(hid_t fapl) HDputs(" Unable to read object"); nerrors++; } - else if (HDmemcmp(in, out, size)) { + else if (HDmemcmp(in, out, size) != 0) { H5_FAILED(); HDputs(" Value read doesn't match value written"); nerrors++; diff --git a/test/istore.c b/test/istore.c index e63404442be..c75b8bfb17a 100644 --- a/test/istore.c +++ b/test/istore.c @@ -376,7 +376,7 @@ test_extend(hid_t f, const char *prefix, size_t nx, size_t ny, size_t nz) HDfprintf(stderr, " Read failed: ctr=%lu\n", (unsigned long)ctr); goto error; } - if (HDmemcmp(buf, check, (size_t)nelmts)) { + if (HDmemcmp(buf, check, (size_t)nelmts) != 0) { H5_FAILED(); HDfprintf(stderr, " Read check failed: ctr=%lu\n", (unsigned long)ctr); HDfprintf(stderr, " Wrote:\n"); diff --git a/test/lheap.c b/test/lheap.c index 6c04d0cf38d..30d62f9e53f 100644 --- a/test/lheap.c +++ b/test/lheap.c @@ -155,7 +155,7 @@ main(void) goto error; } - if (HDstrcmp(s, buf)) { + if (HDstrcmp(s, buf) != 0) { H5_FAILED(); HDprintf(" i=%d, heap offset=%lu\n", i, (unsigned long)(obj[i])); HDprintf(" got: \"%s\"\n", s); diff --git a/test/links.c b/test/links.c index fecb529f686..c123f8bc9de 100644 --- a/test/links.c +++ b/test/links.c @@ -692,7 +692,7 @@ cklinks(hid_t fapl, hbool_t new_format) } /* end if */ if (H5Lget_val(file, "grp1/soft", linkval, sizeof linkval, H5P_DEFAULT) < 0) FAIL_STACK_ERROR - if (HDstrcmp(linkval, "/d1")) { + if (HDstrcmp(linkval, "/d1") != 0) { H5_FAILED(); HDputs(" Soft link test failed. Wrong link value"); TEST_ERROR @@ -723,7 +723,7 @@ cklinks(hid_t fapl, hbool_t new_format) HDprintf(" %d: Can't retrieve link value\n", __LINE__); TEST_ERROR } /* end if */ - if (HDstrcmp(linkval, "foobar")) { + if (HDstrcmp(linkval, "foobar") != 0) { H5_FAILED(); HDputs(" Dangling link test failed. Wrong link value"); TEST_ERROR @@ -754,7 +754,7 @@ cklinks(hid_t fapl, hbool_t new_format) HDprintf(" %d: Can't retrieve link value\n", __LINE__); TEST_ERROR } /* end if */ - if (HDstrcmp(linkval, "/grp1/recursive")) { + if (HDstrcmp(linkval, "/grp1/recursive") != 0) { H5_FAILED(); HDputs(" Recursive link test failed. Wrong link value"); TEST_ERROR @@ -1053,7 +1053,7 @@ toomany(hid_t fapl, hbool_t new_format) /* Check name */ if (H5Iget_name(gid, objname, (size_t)NAME_BUF_SIZE) < 0) TEST_ERROR - if (HDstrcmp(objname, "/hard21")) + if (HDstrcmp(objname, "/hard21") != 0) TEST_ERROR /* Create object in hard-linked group */ @@ -1084,7 +1084,7 @@ toomany(hid_t fapl, hbool_t new_format) /* Check name */ if (H5Iget_name(gid, objname, (size_t)NAME_BUF_SIZE) < 0) TEST_ERROR - if (HDstrcmp(objname, "/soft16")) + if (HDstrcmp(objname, "/soft16") != 0) TEST_ERROR /* Create object using soft links */ @@ -1950,7 +1950,7 @@ test_deprec(hid_t fapl, hbool_t new_format) FAIL_STACK_ERROR if (H5Gget_comment(file_id, "group1", sizeof(tmpstr), tmpstr) < 0) FAIL_STACK_ERROR - if (HDstrcmp(tmpstr, "comment")) + if (HDstrcmp(tmpstr, "comment") != 0) TEST_ERROR /* Create links using H5Glink and H5Glink2 */ @@ -1966,7 +1966,7 @@ test_deprec(hid_t fapl, hbool_t new_format) /* Test getting the names for objects */ if (H5Gget_objname_by_idx(group1_id, (hsize_t)0, tmpstr, sizeof(tmpstr)) < 0) FAIL_STACK_ERROR - if (HDstrcmp(tmpstr, "link_to_group2")) + if (HDstrcmp(tmpstr, "link_to_group2") != 0) TEST_ERROR H5E_BEGIN_TRY { @@ -2003,7 +2003,7 @@ test_deprec(hid_t fapl, hbool_t new_format) if (H5Gget_objinfo(file_id, "/group1/link_to_group2", TRUE, &sb_hard2) < 0) FAIL_STACK_ERROR - if (HDmemcmp(&sb_hard1.objno, sb_hard2.objno, sizeof(sb_hard1.objno))) { + if (HDmemcmp(&sb_hard1.objno, sb_hard2.objno, sizeof(sb_hard1.objno)) != 0) { H5_FAILED(); HDputs(" Hard link test failed. Link seems not to point to the "); HDputs(" expected file location."); @@ -2016,7 +2016,7 @@ test_deprec(hid_t fapl, hbool_t new_format) if (H5Gget_objinfo(file_id, "/group2/link_to_group1", TRUE, &sb_hard2) < 0) FAIL_STACK_ERROR - if (HDmemcmp(&sb_hard1.objno, sb_hard2.objno, sizeof(sb_hard1.objno))) { + if (HDmemcmp(&sb_hard1.objno, sb_hard2.objno, sizeof(sb_hard1.objno)) != 0) { H5_FAILED(); HDputs(" Hard link test failed. Link seems not to point to the "); HDputs(" expected file location."); @@ -2033,7 +2033,7 @@ test_deprec(hid_t fapl, hbool_t new_format) if (H5Gget_linkval(group2_id, "soft_link_to_group1", sb_soft1.linklen, tmpstr) < 0) FAIL_STACK_ERROR - if (HDstrcmp("link_to_group1", tmpstr)) + if (HDstrcmp("link_to_group1", tmpstr) != 0) TEST_ERROR /* Test non-existing links with H5Gget_objinfo */ @@ -2054,7 +2054,7 @@ test_deprec(hid_t fapl, hbool_t new_format) if (H5Gget_linkval(group2_id, "dangle_soft_link", sb_soft2.linklen, tmpstr) < 0) FAIL_STACK_ERROR - if (HDstrcmp("dangle", tmpstr)) + if (HDstrcmp("dangle", tmpstr) != 0) TEST_ERROR /* Test H5Gmove and H5Gmove2 */ @@ -2195,7 +2195,7 @@ cklinks_deprec(hid_t fapl, hbool_t new_format) } /* end if */ if (H5Lget_val(file, "grp1/soft", linkval, sizeof linkval, H5P_DEFAULT) < 0) FAIL_STACK_ERROR - if (HDstrcmp(linkval, "/d1")) { + if (HDstrcmp(linkval, "/d1") != 0) { H5_FAILED(); HDputs(" Soft link test failed. Wrong link value"); TEST_ERROR @@ -2226,7 +2226,7 @@ cklinks_deprec(hid_t fapl, hbool_t new_format) HDprintf(" %d: Can't retrieve link value\n", __LINE__); TEST_ERROR } /* end if */ - if (HDstrcmp(linkval, "foobar")) { + if (HDstrcmp(linkval, "foobar") != 0) { H5_FAILED(); HDputs(" Dangling link test failed. Wrong link value"); TEST_ERROR @@ -2257,7 +2257,7 @@ cklinks_deprec(hid_t fapl, hbool_t new_format) HDprintf(" %d: Can't retrieve link value\n", __LINE__); TEST_ERROR } /* end if */ - if (HDstrcmp(linkval, "/grp1/recursive")) { + if (HDstrcmp(linkval, "/grp1/recursive") != 0) { H5_FAILED(); HDputs(" Recursive link test failed. Wrong link value"); TEST_ERROR @@ -2794,12 +2794,12 @@ external_link_root_deprec(hid_t fapl, hbool_t new_format) TEST_ERROR if (H5Lunpack_elink_val(objname, linfo.u.val_size, NULL, &file, &path) < 0) TEST_ERROR - if (HDstrcmp(file, filename1)) { + if (HDstrcmp(file, filename1) != 0) { H5_FAILED(); HDputs(" External link file name incorrect"); goto error; } - if (HDstrcmp(path, "/")) { + if (HDstrcmp(path, "/") != 0) { H5_FAILED(); HDputs(" External link path incorrect"); goto error; @@ -2822,12 +2822,12 @@ external_link_root_deprec(hid_t fapl, hbool_t new_format) TEST_ERROR if (H5Lunpack_elink_val(objname, linfo.u.val_size, NULL, &file, &path) < 0) TEST_ERROR - if (HDstrcmp(file, filename1)) { + if (HDstrcmp(file, filename1) != 0) { H5_FAILED(); HDputs(" External link file name incorrect"); goto error; } - if (HDstrcmp(path, "/")) { + if (HDstrcmp(path, "/") != 0) { H5_FAILED(); HDputs(" External link path incorrect"); goto error; @@ -2846,7 +2846,7 @@ external_link_root_deprec(hid_t fapl, hbool_t new_format) /* Check name */ if (H5Iget_name(gid, objname, (size_t)NAME_BUF_SIZE) < 0) TEST_ERROR - if (HDstrcmp(objname, "/")) + if (HDstrcmp(objname, "/") != 0) TEST_ERROR /* Create object in external file */ @@ -2891,11 +2891,11 @@ external_link_root_deprec(hid_t fapl, hbool_t new_format) /* Check names */ if (H5Iget_name(gid, objname, (size_t)NAME_BUF_SIZE) < 0) TEST_ERROR - if (HDstrcmp(objname, "/new_group")) + if (HDstrcmp(objname, "/new_group") != 0) TEST_ERROR if (H5Iget_name(gid2, objname, (size_t)NAME_BUF_SIZE) < 0) TEST_ERROR - if (HDstrcmp(objname, "/newer_group")) + if (HDstrcmp(objname, "/newer_group") != 0) TEST_ERROR /* Close opened objects */ @@ -3040,9 +3040,9 @@ external_link_query_deprec(hid_t fapl, hbool_t new_format) TEST_ERROR /* Compare the file and object names */ - if (HDstrcmp(file_name, filename2)) + if (HDstrcmp(file_name, filename2) != 0) TEST_ERROR - if (HDstrcmp(object_name, "/dst")) + if (HDstrcmp(object_name, "/dst") != 0) TEST_ERROR /* Query information about object that external link points to */ @@ -3236,7 +3236,7 @@ external_link_closing_deprec(hid_t fapl, hbool_t new_format) FAIL_STACK_ERROR if (H5Oget_comment_by_name(fid1, "elink/elink/elink/group1_moved", buf, sizeof(buf), H5P_DEFAULT) < 0) FAIL_STACK_ERROR - if (HDstrcmp(buf, "comment")) + if (HDstrcmp(buf, "comment") != 0) TEST_ERROR /* Test H5*open */ @@ -3653,7 +3653,7 @@ ud_hard_links_deprec(hid_t fapl) /* Check name */ if (H5Iget_name(gid, objname, (size_t)NAME_BUF_SIZE) < 0) TEST_ERROR - if (HDstrcmp(objname, "/group")) + if (HDstrcmp(objname, "/group") != 0) TEST_ERROR /* Create object in group */ @@ -3673,7 +3673,7 @@ ud_hard_links_deprec(hid_t fapl) /* Check name */ if (H5Iget_name(gid, objname, (size_t)NAME_BUF_SIZE) < 0) TEST_ERROR - if (HDstrcmp(objname, "/group/new_group")) + if (HDstrcmp(objname, "/group/new_group") != 0) TEST_ERROR /* Close opened object */ @@ -3836,7 +3836,7 @@ ud_link_reregister_deprec(hid_t fapl) /* Check name */ if (H5Iget_name(gid, objname, (size_t)NAME_BUF_SIZE) < 0) TEST_ERROR - if (HDstrcmp(objname, "/" REREG_TARGET_NAME)) + if (HDstrcmp(objname, "/" REREG_TARGET_NAME) != 0) TEST_ERROR /* Create object in group */ @@ -3856,7 +3856,7 @@ ud_link_reregister_deprec(hid_t fapl) /* Check name */ if (H5Iget_name(gid, objname, (size_t)NAME_BUF_SIZE) < 0) TEST_ERROR - if (HDstrcmp(objname, "/rereg_target/new_group")) + if (HDstrcmp(objname, "/rereg_target/new_group") != 0) TEST_ERROR /* Close opened object */ @@ -4200,7 +4200,7 @@ lapl_nlinks_deprec(hid_t fapl, hbool_t new_format) /* Check name */ if (H5Iget_name(gid, objname, (size_t)NAME_BUF_SIZE) < 0) TEST_ERROR - if (HDstrcmp(objname, "/soft17")) + if (HDstrcmp(objname, "/soft17") != 0) TEST_ERROR /* Create group using soft link */ @@ -4241,7 +4241,7 @@ lapl_nlinks_deprec(hid_t fapl, hbool_t new_format) /* Check name */ if (H5Iget_name(gid, objname, (size_t)NAME_BUF_SIZE) < 0) TEST_ERROR - if (HDstrcmp(objname, "/soft4")) + if (HDstrcmp(objname, "/soft4") != 0) TEST_ERROR /* Test other functions that should use a LAPL */ @@ -4856,7 +4856,7 @@ link_info_by_idx_check_deprec(hid_t group_id, const char *linkname, hsize_t n, h if (H5Lget_val_by_idx(group_id, ".", H5_INDEX_CRT_ORDER, H5_ITER_INC, n, tmpval, (size_t)NAME_BUF_SIZE, H5P_DEFAULT) < 0) TEST_ERROR - if (HDstrcmp(valname, tmpval)) + if (HDstrcmp(valname, tmpval) != 0) TEST_ERROR } /* end if */ @@ -4865,7 +4865,7 @@ link_info_by_idx_check_deprec(hid_t group_id, const char *linkname, hsize_t n, h if (H5Lget_name_by_idx(group_id, ".", H5_INDEX_CRT_ORDER, H5_ITER_INC, n, tmpname, (size_t)NAME_BUF_SIZE, H5P_DEFAULT) < 0) TEST_ERROR - if (HDstrcmp(linkname, tmpname)) + if (HDstrcmp(linkname, tmpname) != 0) TEST_ERROR /* Don't test "native" order if there is no creation order index, since @@ -4895,7 +4895,7 @@ link_info_by_idx_check_deprec(hid_t group_id, const char *linkname, hsize_t n, h if (H5Lget_val_by_idx(group_id, ".", H5_INDEX_CRT_ORDER, H5_ITER_NATIVE, n, tmpval, (size_t)NAME_BUF_SIZE, H5P_DEFAULT) < 0) TEST_ERROR - if (HDstrcmp(valname, tmpval)) + if (HDstrcmp(valname, tmpval) != 0) TEST_ERROR } /* end if */ @@ -4904,7 +4904,7 @@ link_info_by_idx_check_deprec(hid_t group_id, const char *linkname, hsize_t n, h if (H5Lget_name_by_idx(group_id, ".", H5_INDEX_CRT_ORDER, H5_ITER_NATIVE, n, tmpname, (size_t)NAME_BUF_SIZE, H5P_DEFAULT) < 0) TEST_ERROR - if (HDstrcmp(linkname, tmpname)) + if (HDstrcmp(linkname, tmpname) != 0) TEST_ERROR } /* end if */ @@ -4929,7 +4929,7 @@ link_info_by_idx_check_deprec(hid_t group_id, const char *linkname, hsize_t n, h if (H5Lget_val_by_idx(group_id, ".", H5_INDEX_CRT_ORDER, H5_ITER_DEC, (hsize_t)0, tmpval, (size_t)NAME_BUF_SIZE, H5P_DEFAULT) < 0) TEST_ERROR - if (HDstrcmp(valname, tmpval)) + if (HDstrcmp(valname, tmpval) != 0) TEST_ERROR } /* end if */ @@ -4938,7 +4938,7 @@ link_info_by_idx_check_deprec(hid_t group_id, const char *linkname, hsize_t n, h if (H5Lget_name_by_idx(group_id, ".", H5_INDEX_CRT_ORDER, H5_ITER_DEC, (hsize_t)0, tmpname, (size_t)NAME_BUF_SIZE, H5P_DEFAULT) < 0) TEST_ERROR - if (HDstrcmp(linkname, tmpname)) + if (HDstrcmp(linkname, tmpname) != 0) TEST_ERROR /* Verify the link information for first link, in increasing link name order */ @@ -4961,7 +4961,7 @@ link_info_by_idx_check_deprec(hid_t group_id, const char *linkname, hsize_t n, h if (H5Lget_val_by_idx(group_id, ".", H5_INDEX_NAME, H5_ITER_INC, n, tmpval, (size_t)NAME_BUF_SIZE, H5P_DEFAULT) < 0) TEST_ERROR - if (HDstrcmp(valname, tmpval)) + if (HDstrcmp(valname, tmpval) != 0) TEST_ERROR } /* end if */ @@ -4970,7 +4970,7 @@ link_info_by_idx_check_deprec(hid_t group_id, const char *linkname, hsize_t n, h if (H5Lget_name_by_idx(group_id, ".", H5_INDEX_NAME, H5_ITER_INC, n, tmpname, (size_t)NAME_BUF_SIZE, H5P_DEFAULT) < 0) TEST_ERROR - if (HDstrcmp(linkname, tmpname)) + if (HDstrcmp(linkname, tmpname) != 0) TEST_ERROR /* Don't test "native" order queries on link name order, since there's not @@ -4997,7 +4997,7 @@ link_info_by_idx_check_deprec(hid_t group_id, const char *linkname, hsize_t n, h if (H5Lget_val_by_idx(group_id, ".", H5_INDEX_NAME, H5_ITER_DEC, (hsize_t)0, tmpval, (size_t)NAME_BUF_SIZE, H5P_DEFAULT) < 0) TEST_ERROR - if (HDstrcmp(valname, tmpval)) + if (HDstrcmp(valname, tmpval) != 0) TEST_ERROR } /* end if */ @@ -5006,7 +5006,7 @@ link_info_by_idx_check_deprec(hid_t group_id, const char *linkname, hsize_t n, h if (H5Lget_name_by_idx(group_id, ".", H5_INDEX_NAME, H5_ITER_DEC, (hsize_t)0, tmpname, (size_t)NAME_BUF_SIZE, H5P_DEFAULT) < 0) TEST_ERROR - if (HDstrcmp(linkname, tmpname)) + if (HDstrcmp(linkname, tmpname) != 0) TEST_ERROR /* Success */ @@ -5353,7 +5353,7 @@ link_info_by_idx_old_deprec(hid_t fapl) if (H5Lget_val_by_idx(group_id, ".", H5_INDEX_NAME, H5_ITER_INC, (hsize_t)u, tmpval, (size_t)NAME_BUF_SIZE, H5P_DEFAULT) < 0) TEST_ERROR - if (HDstrcmp(valname, tmpval)) + if (HDstrcmp(valname, tmpval) != 0) TEST_ERROR } /* end else */ @@ -5361,7 +5361,7 @@ link_info_by_idx_old_deprec(hid_t fapl) if (H5Lget_name_by_idx(group_id, ".", H5_INDEX_NAME, H5_ITER_INC, (hsize_t)u, tmpname, (size_t)NAME_BUF_SIZE, H5P_DEFAULT) < 0) TEST_ERROR - if (HDstrcmp(objname, tmpname)) + if (HDstrcmp(objname, tmpname) != 0) TEST_ERROR /* Verify link information (in native order - native is increasing) */ @@ -5376,7 +5376,7 @@ link_info_by_idx_old_deprec(hid_t fapl) if (H5Lget_val_by_idx(group_id, ".", H5_INDEX_NAME, H5_ITER_NATIVE, (hsize_t)u, tmpval, (size_t)NAME_BUF_SIZE, H5P_DEFAULT) < 0) TEST_ERROR - if (HDstrcmp(valname, tmpval)) + if (HDstrcmp(valname, tmpval) != 0) TEST_ERROR } /* end else */ @@ -5384,7 +5384,7 @@ link_info_by_idx_old_deprec(hid_t fapl) if (H5Lget_name_by_idx(group_id, ".", H5_INDEX_NAME, H5_ITER_NATIVE, (hsize_t)u, tmpname, (size_t)NAME_BUF_SIZE, H5P_DEFAULT) < 0) TEST_ERROR - if (HDstrcmp(objname, tmpname)) + if (HDstrcmp(objname, tmpname) != 0) TEST_ERROR /* Make link name for decreasing order queries */ @@ -5405,7 +5405,7 @@ link_info_by_idx_old_deprec(hid_t fapl) if (H5Lget_val_by_idx(group_id, ".", H5_INDEX_NAME, H5_ITER_DEC, (hsize_t)u, tmpval, (size_t)NAME_BUF_SIZE, H5P_DEFAULT) < 0) TEST_ERROR - if (HDstrcmp(valname, tmpval)) + if (HDstrcmp(valname, tmpval) != 0) TEST_ERROR } /* end else */ @@ -5413,7 +5413,7 @@ link_info_by_idx_old_deprec(hid_t fapl) if (H5Lget_name_by_idx(group_id, ".", H5_INDEX_NAME, H5_ITER_DEC, (hsize_t)u, tmpname, (size_t)NAME_BUF_SIZE, H5P_DEFAULT) < 0) TEST_ERROR - if (HDstrcmp(objname, tmpname)) + if (HDstrcmp(objname, tmpname) != 0) TEST_ERROR } /* end for */ @@ -5639,7 +5639,7 @@ delete_by_idx_deprec(hid_t fapl) HDsnprintf(objname, sizeof(objname), "filler %02u", (u + 1)); else HDsnprintf(objname, sizeof(objname), "filler %02u", (max_compact - (u + 2))); - if (HDstrcmp(objname, tmpname)) + if (HDstrcmp(objname, tmpname) != 0) TEST_ERROR } /* end for */ @@ -5713,7 +5713,7 @@ delete_by_idx_deprec(hid_t fapl) HDsnprintf(objname, sizeof(objname), "filler %02u", (u + 1)); else HDsnprintf(objname, sizeof(objname), "filler %02u", ((max_compact * 2) - (u + 2))); - if (HDstrcmp(objname, tmpname)) + if (HDstrcmp(objname, tmpname) != 0) TEST_ERROR } /* end for */ @@ -5792,7 +5792,7 @@ delete_by_idx_deprec(hid_t fapl) else HDsnprintf(objname, sizeof(objname), "filler %02u", ((max_compact * 2) - ((u * 2) + 2))); - if (HDstrcmp(objname, tmpname)) + if (HDstrcmp(objname, tmpname) != 0) TEST_ERROR } /* end for */ @@ -5826,7 +5826,7 @@ delete_by_idx_deprec(hid_t fapl) else HDsnprintf(objname, sizeof(objname), "filler %02u", ((max_compact * 2) - ((u * 2) + 4))); - if (HDstrcmp(objname, tmpname)) + if (HDstrcmp(objname, tmpname) != 0) TEST_ERROR } /* end for */ @@ -5993,7 +5993,7 @@ delete_by_idx_old_deprec(hid_t fapl) HDsnprintf(objname, sizeof(objname), "filler %02u", (u + 1)); else HDsnprintf(objname, sizeof(objname), "filler %02u", dec_u); - if (HDstrcmp(objname, tmpname)) + if (HDstrcmp(objname, tmpname) != 0) TEST_ERROR } /* end for */ @@ -6067,7 +6067,7 @@ delete_by_idx_old_deprec(hid_t fapl) HDsnprintf(objname, sizeof(objname), "filler %02u", ((u * 2) + 1)); else HDsnprintf(objname, sizeof(objname), "filler %02u", dec_u); - if (HDstrcmp(objname, tmpname)) + if (HDstrcmp(objname, tmpname) != 0) TEST_ERROR } /* end for */ @@ -6101,7 +6101,7 @@ delete_by_idx_old_deprec(hid_t fapl) HDsnprintf(objname, sizeof(objname), "filler %02u", ((u * 2) + 3)); else HDsnprintf(objname, sizeof(objname), "filler %02u", dec_u); - if (HDstrcmp(objname, tmpname)) + if (HDstrcmp(objname, tmpname) != 0) TEST_ERROR } /* end for */ @@ -6183,7 +6183,7 @@ link_iterate_deprec_cb(hid_t group_id, const char *link_name, const H5L_info1_t /* Verify name of link */ HDsnprintf(objname, sizeof(objname), "filler %02u", (unsigned)my_info.corder); - if (HDstrcmp(link_name, objname)) + if (HDstrcmp(link_name, objname) != 0) return H5_ITER_ERROR; /* Check if we've visited this link before */ @@ -6680,7 +6680,7 @@ link_iterate_old_deprec_cb(hid_t group_id, const char *link_name, const H5L_info /* Verify name of link */ HDsnprintf(objname, sizeof(objname), "filler %02u", (info ? (unsigned)op_data->curr : (unsigned)((op_data->ncalled - 1) + op_data->nskipped))); - if (HDstrcmp(link_name, objname)) + if (HDstrcmp(link_name, objname) != 0) return H5_ITER_ERROR; /* Check if we've visited this link before */ @@ -7100,12 +7100,12 @@ external_link_root(hid_t fapl, hbool_t new_format) TEST_ERROR if (H5Lunpack_elink_val(objname, linfo.u.val_size, NULL, &file, &path) < 0) TEST_ERROR - if (HDstrcmp(file, filename1)) { + if (HDstrcmp(file, filename1) != 0) { H5_FAILED(); HDputs(" External link file name incorrect"); goto error; } - if (HDstrcmp(path, "/")) { + if (HDstrcmp(path, "/") != 0) { H5_FAILED(); HDputs(" External link path incorrect"); goto error; @@ -7128,12 +7128,12 @@ external_link_root(hid_t fapl, hbool_t new_format) TEST_ERROR if (H5Lunpack_elink_val(objname, linfo.u.val_size, NULL, &file, &path) < 0) TEST_ERROR - if (HDstrcmp(file, filename1)) { + if (HDstrcmp(file, filename1) != 0) { H5_FAILED(); HDputs(" External link file name incorrect"); goto error; } - if (HDstrcmp(path, "/")) { + if (HDstrcmp(path, "/") != 0) { H5_FAILED(); HDputs(" External link path incorrect"); goto error; @@ -7152,7 +7152,7 @@ external_link_root(hid_t fapl, hbool_t new_format) /* Check name */ if (H5Iget_name(gid, objname, (size_t)NAME_BUF_SIZE) < 0) TEST_ERROR - if (HDstrcmp(objname, "/")) + if (HDstrcmp(objname, "/") != 0) TEST_ERROR /* Create object in external file */ @@ -7197,11 +7197,11 @@ external_link_root(hid_t fapl, hbool_t new_format) /* Check names */ if (H5Iget_name(gid, objname, (size_t)NAME_BUF_SIZE) < 0) TEST_ERROR - if (HDstrcmp(objname, "/new_group")) + if (HDstrcmp(objname, "/new_group") != 0) TEST_ERROR if (H5Iget_name(gid2, objname, (size_t)NAME_BUF_SIZE) < 0) TEST_ERROR - if (HDstrcmp(objname, "/newer_group")) + if (HDstrcmp(objname, "/newer_group") != 0) TEST_ERROR /* Close opened objects */ @@ -7320,7 +7320,7 @@ external_link_path(hid_t fapl, hbool_t new_format) /* Check name */ if (H5Iget_name(gid, objname, (size_t)NAME_BUF_SIZE) < 0) TEST_ERROR - if (HDstrcmp(objname, "/A/B/C")) + if (HDstrcmp(objname, "/A/B/C") != 0) TEST_ERROR /* Create object in external file */ @@ -7350,7 +7350,7 @@ external_link_path(hid_t fapl, hbool_t new_format) /* Check name */ if (H5Iget_name(gid, objname, (size_t)NAME_BUF_SIZE) < 0) TEST_ERROR - if (HDstrcmp(objname, "/A/B/C/new_group")) + if (HDstrcmp(objname, "/A/B/C/new_group") != 0) TEST_ERROR /* Close opened object */ @@ -7492,7 +7492,7 @@ external_link_mult(hid_t fapl, hbool_t new_format) /* Check name */ if (H5Iget_name(gid, objname, (size_t)NAME_BUF_SIZE) < 0) TEST_ERROR - if (HDstrcmp(objname, "/A/B/C")) + if (HDstrcmp(objname, "/A/B/C") != 0) TEST_ERROR /* Create object in external file */ @@ -7522,7 +7522,7 @@ external_link_mult(hid_t fapl, hbool_t new_format) /* Check name */ if (H5Iget_name(gid, objname, (size_t)NAME_BUF_SIZE) < 0) TEST_ERROR - if (HDstrcmp(objname, "/A/B/C/new_group")) + if (HDstrcmp(objname, "/A/B/C/new_group") != 0) TEST_ERROR /* Close opened object */ @@ -7638,7 +7638,7 @@ external_link_self(hid_t fapl, hbool_t new_format) /* Check name */ if (H5Iget_name(gid, objname, (size_t)NAME_BUF_SIZE) < 0) TEST_ERROR - if (HDstrcmp(objname, "/X")) + if (HDstrcmp(objname, "/X") != 0) TEST_ERROR /* Create object through external link */ @@ -7660,7 +7660,7 @@ external_link_self(hid_t fapl, hbool_t new_format) /* Check name */ if (H5Iget_name(gid, objname, (size_t)NAME_BUF_SIZE) < 0) TEST_ERROR - if (HDstrcmp(objname, "/X/new_group")) + if (HDstrcmp(objname, "/X/new_group") != 0) TEST_ERROR /* Close opened object */ @@ -7845,7 +7845,7 @@ external_link_pingpong(hid_t fapl, hbool_t new_format) /* Check name */ if (H5Iget_name(gid, objname, (size_t)NAME_BUF_SIZE) < 0) TEST_ERROR - if (HDstrcmp(objname, "/final")) + if (HDstrcmp(objname, "/final") != 0) TEST_ERROR /* Create object in external file */ @@ -7875,7 +7875,7 @@ external_link_pingpong(hid_t fapl, hbool_t new_format) /* Check name */ if (H5Iget_name(gid, objname, (size_t)NAME_BUF_SIZE) < 0) TEST_ERROR - if (HDstrcmp(objname, "/final/new_group")) + if (HDstrcmp(objname, "/final/new_group") != 0) TEST_ERROR /* Close opened object */ @@ -8034,7 +8034,7 @@ external_link_toomany(hid_t fapl, hbool_t new_format) /* Check name */ if (H5Iget_name(gid, objname, (size_t)NAME_BUF_SIZE) < 0) TEST_ERROR - if (HDstrcmp(objname, "/final")) + if (HDstrcmp(objname, "/final") != 0) TEST_ERROR /* Create object in external file */ @@ -9748,13 +9748,13 @@ external_set_elink_cb_cb(const char *parent_file, const char *parent_group, cons set_elink_cb_t *op_data = (set_elink_cb_t *)_op_data; /* Verify file and object names are correct */ - if (HDstrcmp(parent_file, op_data->parent_file)) + if (HDstrcmp(parent_file, op_data->parent_file) != 0) return FAIL; - if (HDstrcmp(parent_group, "/group1")) + if (HDstrcmp(parent_group, "/group1") != 0) return FAIL; - if (HDstrcmp(target_file, op_data->target_file)) + if (HDstrcmp(target_file, op_data->target_file) != 0) return FAIL; - if (HDstrcmp(target_obj, "/")) + if (HDstrcmp(target_obj, "/") != 0) return FAIL; /* Set flags to be read-write */ @@ -10978,9 +10978,9 @@ external_link_query(hid_t fapl, hbool_t new_format) TEST_ERROR /* Compare the file and object names */ - if (HDstrcmp(file_name, filename2)) + if (HDstrcmp(file_name, filename2) != 0) TEST_ERROR - if (HDstrcmp(object_name, "/dst")) + if (HDstrcmp(object_name, "/dst") != 0) TEST_ERROR /* Query information about object that external link points to */ @@ -11377,7 +11377,7 @@ external_link_move(hid_t fapl, hbool_t new_format) /* Check name */ if (H5Iget_name(gid, objname, (size_t)NAME_BUF_SIZE) < 0) FAIL_STACK_ERROR - if (HDstrcmp(objname, "/dst")) + if (HDstrcmp(objname, "/dst") != 0) TEST_ERROR /* Create object in external file */ @@ -11437,7 +11437,7 @@ external_link_move(hid_t fapl, hbool_t new_format) /* Check name */ if (H5Iget_name(gid, objname, (size_t)NAME_BUF_SIZE) < 0) FAIL_STACK_ERROR - if (HDstrcmp(objname, "/dst")) + if (HDstrcmp(objname, "/dst") != 0) TEST_ERROR /* Create object in external file */ @@ -11484,7 +11484,7 @@ external_link_move(hid_t fapl, hbool_t new_format) /* Check name */ if (H5Iget_name(gid, objname, (size_t)NAME_BUF_SIZE) < 0) FAIL_STACK_ERROR - if (HDstrcmp(objname, "/dst")) + if (HDstrcmp(objname, "/dst") != 0) TEST_ERROR /* Move external link back to original location */ @@ -11494,7 +11494,7 @@ external_link_move(hid_t fapl, hbool_t new_format) /* Check name */ if (H5Iget_name(gid, objname, (size_t)NAME_BUF_SIZE) < 0) FAIL_STACK_ERROR - if (HDstrcmp(objname, "/dst")) + if (HDstrcmp(objname, "/dst") != 0) TEST_ERROR /* Create object in external file */ @@ -11668,7 +11668,7 @@ external_link_ride(hid_t fapl, hbool_t new_format) /* Check name */ if (H5Iget_name(gid, objname, (size_t)NAME_BUF_SIZE) < 0) TEST_ERROR - if (HDstrcmp(objname, "/dst")) + if (HDstrcmp(objname, "/dst") != 0) TEST_ERROR /* Create object in external file */ @@ -11717,7 +11717,7 @@ external_link_ride(hid_t fapl, hbool_t new_format) /* Check name */ if (H5Iget_name(gid, objname, (size_t)NAME_BUF_SIZE) < 0) TEST_ERROR - if (HDstrcmp(objname, "/dst")) + if (HDstrcmp(objname, "/dst") != 0) TEST_ERROR /* Create object in external file */ @@ -11910,7 +11910,7 @@ external_link_closing(hid_t fapl, hbool_t new_format) FAIL_STACK_ERROR if (H5Oget_comment_by_name(fid1, "elink/elink/elink/group1_moved", buf, sizeof(buf), H5P_DEFAULT) < 0) FAIL_STACK_ERROR - if (HDstrcmp(buf, "comment")) + if (HDstrcmp(buf, "comment") != 0) TEST_ERROR /* Test H5*open */ @@ -12253,7 +12253,7 @@ external_link_strong(hid_t fapl, hbool_t new_format) FAIL_STACK_ERROR if (H5Iget_name(gid2, objname, (size_t)NAME_BUF_SIZE) < 0) TEST_ERROR - if (HDstrcmp(objname, "/A/B/C")) + if (HDstrcmp(objname, "/A/B/C") != 0) TEST_ERROR if (H5Gclose(gid2) < 0) TEST_ERROR @@ -13818,7 +13818,7 @@ ud_hard_links(hid_t fapl) /* Check name */ if (H5Iget_name(gid, objname, (size_t)NAME_BUF_SIZE) < 0) TEST_ERROR - if (HDstrcmp(objname, "/group")) + if (HDstrcmp(objname, "/group") != 0) TEST_ERROR /* Create object in group */ @@ -13838,7 +13838,7 @@ ud_hard_links(hid_t fapl) /* Check name */ if (H5Iget_name(gid, objname, (size_t)NAME_BUF_SIZE) < 0) TEST_ERROR - if (HDstrcmp(objname, "/group/new_group")) + if (HDstrcmp(objname, "/group/new_group") != 0) TEST_ERROR /* Close opened object */ @@ -14029,7 +14029,7 @@ ud_link_reregister(hid_t fapl) /* Check name */ if (H5Iget_name(gid, objname, (size_t)NAME_BUF_SIZE) < 0) TEST_ERROR - if (HDstrcmp(objname, "/" REREG_TARGET_NAME)) + if (HDstrcmp(objname, "/" REREG_TARGET_NAME) != 0) TEST_ERROR /* Create object in group */ @@ -14049,7 +14049,7 @@ ud_link_reregister(hid_t fapl) /* Check name */ if (H5Iget_name(gid, objname, (size_t)NAME_BUF_SIZE) < 0) TEST_ERROR - if (HDstrcmp(objname, "/rereg_target/new_group")) + if (HDstrcmp(objname, "/rereg_target/new_group") != 0) TEST_ERROR /* Close opened object */ @@ -14138,9 +14138,9 @@ UD_cb_create(const char *link_name, hid_t loc_group, const void *udata, size_t u if (lcpl_id < 0) TEST_ERROR - if (HDstrcmp(link_name, UD_CB_LINK_NAME) && HDstrcmp(link_name, NEW_UD_CB_LINK_NAME)) + if (HDstrcmp(link_name, UD_CB_LINK_NAME) != 0 && HDstrcmp(link_name, NEW_UD_CB_LINK_NAME) != 0) TEST_ERROR - if (HDstrcmp((const char *)udata, UD_CB_TARGET)) + if (HDstrcmp((const char *)udata, UD_CB_TARGET) != 0) TEST_ERROR if (udata_size != UD_CB_TARGET_LEN) TEST_ERROR @@ -14165,9 +14165,9 @@ UD_cb_traverse(const char *link_name, hid_t cur_group, const void *udata, size_t if (udata_size > 0 && !udata) TEST_ERROR - if (HDstrcmp(link_name, UD_CB_LINK_NAME) && HDstrcmp(link_name, NEW_UD_CB_LINK_NAME)) + if (HDstrcmp(link_name, UD_CB_LINK_NAME) != 0 && HDstrcmp(link_name, NEW_UD_CB_LINK_NAME) != 0) TEST_ERROR - if (HDstrcmp((const char *)udata, UD_CB_TARGET)) + if (HDstrcmp((const char *)udata, UD_CB_TARGET) != 0) TEST_ERROR if (udata_size != UD_CB_TARGET_LEN) TEST_ERROR @@ -14192,9 +14192,9 @@ UD_cb_move(const char *new_name, hid_t new_loc, const void *udata, size_t udata_ if (udata_size > 0 && !udata) TEST_ERROR - if (HDstrcmp(new_name, NEW_UD_CB_LINK_NAME)) + if (HDstrcmp(new_name, NEW_UD_CB_LINK_NAME) != 0) TEST_ERROR - if (HDstrcmp((const char *)udata, UD_CB_TARGET)) + if (HDstrcmp((const char *)udata, UD_CB_TARGET) != 0) TEST_ERROR if (udata_size != UD_CB_TARGET_LEN) TEST_ERROR @@ -14216,9 +14216,9 @@ UD_cb_delete(const char *link_name, hid_t file, const void *udata, size_t udata_ if (udata_size > 0 && !udata) TEST_ERROR - if (HDstrcmp(link_name, UD_CB_LINK_NAME) && HDstrcmp(link_name, NEW_UD_CB_LINK_NAME)) + if (HDstrcmp(link_name, UD_CB_LINK_NAME) != 0 && HDstrcmp(link_name, NEW_UD_CB_LINK_NAME) != 0) TEST_ERROR - if (HDstrcmp((const char *)udata, UD_CB_TARGET)) + if (HDstrcmp((const char *)udata, UD_CB_TARGET) != 0) TEST_ERROR if (udata_size != UD_CB_TARGET_LEN) TEST_ERROR @@ -14238,9 +14238,9 @@ UD_cb_query(const char *link_name, const void *udata, size_t udata_size, void *b if (udata_size > 0 && !udata) TEST_ERROR - if (HDstrcmp(link_name, UD_CB_LINK_NAME)) + if (HDstrcmp(link_name, UD_CB_LINK_NAME) != 0) TEST_ERROR - if (HDstrcmp((const char *)udata, UD_CB_TARGET)) + if (HDstrcmp((const char *)udata, UD_CB_TARGET) != 0) TEST_ERROR if (udata_size != UD_CB_TARGET_LEN) TEST_ERROR @@ -15072,7 +15072,7 @@ lapl_nlinks(hid_t fapl, hbool_t new_format) /* Check name */ if (H5Iget_name(gid, objname, (size_t)NAME_BUF_SIZE) < 0) TEST_ERROR - if (HDstrcmp(objname, "/soft17")) + if (HDstrcmp(objname, "/soft17") != 0) TEST_ERROR /* Create group using soft link */ @@ -15113,7 +15113,7 @@ lapl_nlinks(hid_t fapl, hbool_t new_format) /* Check name */ if (H5Iget_name(gid, objname, (size_t)NAME_BUF_SIZE) < 0) TEST_ERROR - if (HDstrcmp(objname, "/soft4")) + if (HDstrcmp(objname, "/soft4") != 0) TEST_ERROR /* Test other functions that should use a LAPL */ @@ -15567,7 +15567,7 @@ visit_link_cb(hid_t H5_ATTR_UNUSED group_id, const char *name, const H5L_info2_t lvisit_ud_t *op_data = (lvisit_ud_t *)_op_data; /* Check for correct link information */ - if (HDstrcmp(op_data->info[op_data->idx].path, name)) + if (HDstrcmp(op_data->info[op_data->idx].path, name) != 0) return (H5_ITER_ERROR); if (op_data->info[op_data->idx].type != linfo->type) return (H5_ITER_ERROR); @@ -15758,7 +15758,7 @@ visit_obj_cb(hid_t H5_ATTR_UNUSED group_id, const char *name, const H5O_info2_t ovisit_ud_t *op_data = (ovisit_ud_t *)_op_data; /* Check for correct object information */ - if (HDstrcmp(op_data->info[op_data->idx].path, name)) + if (HDstrcmp(op_data->info[op_data->idx].path, name) != 0) return (H5_ITER_ERROR); if (op_data->info[op_data->idx].type != oinfo->type) return (H5_ITER_ERROR); @@ -16284,13 +16284,13 @@ link_filters(hid_t fapl, hbool_t new_format) if (H5Pget_filter_by_id2(gcpl2, H5Z_FILTER_RESERVED + 42, &flags_out, &cd_nelmts, &cd_value_out, (size_t)24, name_out, &filter_config_out) < 0) TEST_ERROR - if (flags_out != 0 || cd_value_out != cd_value || HDstrcmp(filter_class.name, name_out) || + if (flags_out != 0 || cd_value_out != cd_value || HDstrcmp(filter_class.name, name_out) != 0 || filter_config_out != (H5Z_FILTER_CONFIG_ENCODE_ENABLED | H5Z_FILTER_CONFIG_DECODE_ENABLED)) TEST_ERROR if (H5Pget_filter2(gcpl2, (unsigned)(nfilters - 1), &flags_out, &cd_nelmts, &cd_value_out, (size_t)24, name_out, &filter_config_out) < 0) TEST_ERROR - if (flags_out != 0 || cd_value_out != cd_value || HDstrcmp(filter_class.name, name_out) || + if (flags_out != 0 || cd_value_out != cd_value || HDstrcmp(filter_class.name, name_out) != 0 || filter_config_out != (H5Z_FILTER_CONFIG_ENCODE_ENABLED | H5Z_FILTER_CONFIG_DECODE_ENABLED)) TEST_ERROR @@ -16301,7 +16301,7 @@ link_filters(hid_t fapl, hbool_t new_format) if (H5Pget_filter_by_id2(gcpl2, H5Z_FILTER_RESERVED + 42, &flags_out, &cd_nelmts, &cd_value_out, (size_t)24, name_out, &filter_config_out) < 0) TEST_ERROR - if (flags_out != 0 || cd_value_out != cd_value || HDstrcmp(filter_class.name, name_out) || + if (flags_out != 0 || cd_value_out != cd_value || HDstrcmp(filter_class.name, name_out) != 0 || filter_config_out != (H5Z_FILTER_CONFIG_ENCODE_ENABLED | H5Z_FILTER_CONFIG_DECODE_ENABLED)) TEST_ERROR @@ -17740,7 +17740,7 @@ link_info_by_idx_check(hid_t group_id, const char *linkname, hsize_t n, hbool_t if (H5Lget_val_by_idx(group_id, ".", H5_INDEX_CRT_ORDER, H5_ITER_INC, n, tmpval, (size_t)NAME_BUF_SIZE, H5P_DEFAULT) < 0) TEST_ERROR - if (HDstrcmp(valname, tmpval)) + if (HDstrcmp(valname, tmpval) != 0) TEST_ERROR } /* end if */ @@ -17749,7 +17749,7 @@ link_info_by_idx_check(hid_t group_id, const char *linkname, hsize_t n, hbool_t if (H5Lget_name_by_idx(group_id, ".", H5_INDEX_CRT_ORDER, H5_ITER_INC, n, tmpname, (size_t)NAME_BUF_SIZE, H5P_DEFAULT) < 0) TEST_ERROR - if (HDstrcmp(linkname, tmpname)) + if (HDstrcmp(linkname, tmpname) != 0) TEST_ERROR /* Don't test "native" order if there is no creation order index, since @@ -17779,7 +17779,7 @@ link_info_by_idx_check(hid_t group_id, const char *linkname, hsize_t n, hbool_t if (H5Lget_val_by_idx(group_id, ".", H5_INDEX_CRT_ORDER, H5_ITER_NATIVE, n, tmpval, (size_t)NAME_BUF_SIZE, H5P_DEFAULT) < 0) TEST_ERROR - if (HDstrcmp(valname, tmpval)) + if (HDstrcmp(valname, tmpval) != 0) TEST_ERROR } /* end if */ @@ -17788,7 +17788,7 @@ link_info_by_idx_check(hid_t group_id, const char *linkname, hsize_t n, hbool_t if (H5Lget_name_by_idx(group_id, ".", H5_INDEX_CRT_ORDER, H5_ITER_NATIVE, n, tmpname, (size_t)NAME_BUF_SIZE, H5P_DEFAULT) < 0) TEST_ERROR - if (HDstrcmp(linkname, tmpname)) + if (HDstrcmp(linkname, tmpname) != 0) TEST_ERROR } /* end if */ @@ -17813,7 +17813,7 @@ link_info_by_idx_check(hid_t group_id, const char *linkname, hsize_t n, hbool_t if (H5Lget_val_by_idx(group_id, ".", H5_INDEX_CRT_ORDER, H5_ITER_DEC, (hsize_t)0, tmpval, (size_t)NAME_BUF_SIZE, H5P_DEFAULT) < 0) TEST_ERROR - if (HDstrcmp(valname, tmpval)) + if (HDstrcmp(valname, tmpval) != 0) TEST_ERROR } /* end if */ @@ -17822,7 +17822,7 @@ link_info_by_idx_check(hid_t group_id, const char *linkname, hsize_t n, hbool_t if (H5Lget_name_by_idx(group_id, ".", H5_INDEX_CRT_ORDER, H5_ITER_DEC, (hsize_t)0, tmpname, (size_t)NAME_BUF_SIZE, H5P_DEFAULT) < 0) TEST_ERROR - if (HDstrcmp(linkname, tmpname)) + if (HDstrcmp(linkname, tmpname) != 0) TEST_ERROR /* Verify the link information for first link, in increasing link name order */ @@ -17845,7 +17845,7 @@ link_info_by_idx_check(hid_t group_id, const char *linkname, hsize_t n, hbool_t if (H5Lget_val_by_idx(group_id, ".", H5_INDEX_NAME, H5_ITER_INC, n, tmpval, (size_t)NAME_BUF_SIZE, H5P_DEFAULT) < 0) TEST_ERROR - if (HDstrcmp(valname, tmpval)) + if (HDstrcmp(valname, tmpval) != 0) TEST_ERROR } /* end if */ @@ -17854,7 +17854,7 @@ link_info_by_idx_check(hid_t group_id, const char *linkname, hsize_t n, hbool_t if (H5Lget_name_by_idx(group_id, ".", H5_INDEX_NAME, H5_ITER_INC, n, tmpname, (size_t)NAME_BUF_SIZE, H5P_DEFAULT) < 0) TEST_ERROR - if (HDstrcmp(linkname, tmpname)) + if (HDstrcmp(linkname, tmpname) != 0) TEST_ERROR /* Don't test "native" order queries on link name order, since there's not @@ -17881,7 +17881,7 @@ link_info_by_idx_check(hid_t group_id, const char *linkname, hsize_t n, hbool_t if (H5Lget_val_by_idx(group_id, ".", H5_INDEX_NAME, H5_ITER_DEC, (hsize_t)0, tmpval, (size_t)NAME_BUF_SIZE, H5P_DEFAULT) < 0) TEST_ERROR - if (HDstrcmp(valname, tmpval)) + if (HDstrcmp(valname, tmpval) != 0) TEST_ERROR } /* end if */ @@ -17890,7 +17890,7 @@ link_info_by_idx_check(hid_t group_id, const char *linkname, hsize_t n, hbool_t if (H5Lget_name_by_idx(group_id, ".", H5_INDEX_NAME, H5_ITER_DEC, (hsize_t)0, tmpname, (size_t)NAME_BUF_SIZE, H5P_DEFAULT) < 0) TEST_ERROR - if (HDstrcmp(linkname, tmpname)) + if (HDstrcmp(linkname, tmpname) != 0) TEST_ERROR /* Success */ @@ -18247,7 +18247,7 @@ link_info_by_idx_old(hid_t fapl) if (H5Lget_val_by_idx(group_id, ".", H5_INDEX_NAME, H5_ITER_INC, (hsize_t)u, tmpval, (size_t)NAME_BUF_SIZE, H5P_DEFAULT) < 0) TEST_ERROR - if (HDstrcmp(valname, tmpval)) + if (HDstrcmp(valname, tmpval) != 0) TEST_ERROR } /* end else */ @@ -18255,7 +18255,7 @@ link_info_by_idx_old(hid_t fapl) if (H5Lget_name_by_idx(group_id, ".", H5_INDEX_NAME, H5_ITER_INC, (hsize_t)u, tmpname, (size_t)NAME_BUF_SIZE, H5P_DEFAULT) < 0) TEST_ERROR - if (HDstrcmp(objname, tmpname)) + if (HDstrcmp(objname, tmpname) != 0) TEST_ERROR /* Verify link information (in native order - native is increasing) */ @@ -18272,7 +18272,7 @@ link_info_by_idx_old(hid_t fapl) if (H5Lget_val_by_idx(group_id, ".", H5_INDEX_NAME, H5_ITER_NATIVE, (hsize_t)u, tmpval, (size_t)NAME_BUF_SIZE, H5P_DEFAULT) < 0) TEST_ERROR - if (HDstrcmp(valname, tmpval)) + if (HDstrcmp(valname, tmpval) != 0) TEST_ERROR } /* end else */ @@ -18280,7 +18280,7 @@ link_info_by_idx_old(hid_t fapl) if (H5Lget_name_by_idx(group_id, ".", H5_INDEX_NAME, H5_ITER_NATIVE, (hsize_t)u, tmpname, (size_t)NAME_BUF_SIZE, H5P_DEFAULT) < 0) TEST_ERROR - if (HDstrcmp(objname, tmpname)) + if (HDstrcmp(objname, tmpname) != 0) TEST_ERROR /* Make link name for decreasing order queries */ @@ -18303,7 +18303,7 @@ link_info_by_idx_old(hid_t fapl) if (H5Lget_val_by_idx(group_id, ".", H5_INDEX_NAME, H5_ITER_DEC, (hsize_t)u, tmpval, (size_t)NAME_BUF_SIZE, H5P_DEFAULT) < 0) TEST_ERROR - if (HDstrcmp(valname, tmpval)) + if (HDstrcmp(valname, tmpval) != 0) TEST_ERROR } /* end else */ @@ -18311,7 +18311,7 @@ link_info_by_idx_old(hid_t fapl) if (H5Lget_name_by_idx(group_id, ".", H5_INDEX_NAME, H5_ITER_DEC, (hsize_t)u, tmpname, (size_t)NAME_BUF_SIZE, H5P_DEFAULT) < 0) TEST_ERROR - if (HDstrcmp(objname, tmpname)) + if (HDstrcmp(objname, tmpname) != 0) TEST_ERROR } /* end for */ @@ -18535,7 +18535,7 @@ delete_by_idx(hid_t fapl) HDsnprintf(objname, sizeof(objname), "filler %02u", (u + 1)); else HDsnprintf(objname, sizeof(objname), "filler %02u", (max_compact - (u + 2))); - if (HDstrcmp(objname, tmpname)) + if (HDstrcmp(objname, tmpname) != 0) TEST_ERROR } /* end for */ @@ -18609,7 +18609,7 @@ delete_by_idx(hid_t fapl) HDsnprintf(objname, sizeof(objname), "filler %02u", (u + 1)); else HDsnprintf(objname, sizeof(objname), "filler %02u", ((max_compact * 2) - (u + 2))); - if (HDstrcmp(objname, tmpname)) + if (HDstrcmp(objname, tmpname) != 0) TEST_ERROR } /* end for */ @@ -18688,7 +18688,7 @@ delete_by_idx(hid_t fapl) else HDsnprintf(objname, sizeof(objname), "filler %02u", ((max_compact * 2) - ((u * 2) + 2))); - if (HDstrcmp(objname, tmpname)) + if (HDstrcmp(objname, tmpname) != 0) TEST_ERROR } /* end for */ @@ -18722,7 +18722,7 @@ delete_by_idx(hid_t fapl) else HDsnprintf(objname, sizeof(objname), "filler %02u", ((max_compact * 2) - ((u * 2) + 4))); - if (HDstrcmp(objname, tmpname)) + if (HDstrcmp(objname, tmpname) != 0) TEST_ERROR } /* end for */ @@ -18903,7 +18903,7 @@ delete_by_idx_old(hid_t fapl) HDsnprintf(objname, sizeof(objname), "filler %02u", (u + 1)); else HDsnprintf(objname, sizeof(objname), "filler %02u", dec_u); - if (HDstrcmp(objname, tmpname)) + if (HDstrcmp(objname, tmpname) != 0) TEST_ERROR } /* end for */ @@ -18982,7 +18982,7 @@ delete_by_idx_old(hid_t fapl) HDsnprintf(objname, sizeof(objname), "filler %02u", ((u * 2) + 1)); else HDsnprintf(objname, sizeof(objname), "filler %02u", dec_u); - if (HDstrcmp(objname, tmpname)) + if (HDstrcmp(objname, tmpname) != 0) TEST_ERROR } /* end for */ @@ -19020,7 +19020,7 @@ delete_by_idx_old(hid_t fapl) HDsnprintf(objname, sizeof(objname), "filler %02u", ((u * 2) + 3)); else HDsnprintf(objname, sizeof(objname), "filler %02u", dec_u); - if (HDstrcmp(objname, tmpname)) + if (HDstrcmp(objname, tmpname) != 0) TEST_ERROR } /* end for */ @@ -19106,7 +19106,7 @@ link_iterate_cb(hid_t group_id, const char *link_name, const H5L_info2_t *info, /* Verify name of link */ HDsnprintf(objname, sizeof(objname), "filler %02u", (unsigned)my_info.corder); - if (HDstrcmp(link_name, objname)) + if (HDstrcmp(link_name, objname) != 0) return H5_ITER_ERROR; /* Check if we've visited this link before */ @@ -19612,7 +19612,7 @@ link_iterate_old_cb(hid_t group_id, const char *link_name, const H5L_info2_t *in /* Verify name of link */ HDsnprintf(objname, sizeof(objname), "filler %02u", (info ? (unsigned)op_data->curr : (unsigned)((op_data->ncalled - 1) + op_data->nskipped))); - if (HDstrcmp(link_name, objname)) + if (HDstrcmp(link_name, objname) != 0) return H5_ITER_ERROR; /* Check if we've visited this link before */ diff --git a/test/links_env.c b/test/links_env.c index 1a78ae2eea4..1b4b80b434f 100644 --- a/test/links_env.c +++ b/test/links_env.c @@ -69,7 +69,7 @@ external_link_env(hid_t fapl, hbool_t new_format) if ((envval = HDgetenv("HDF5_EXT_PREFIX")) == NULL) envval = "nomatch"; - if (HDstrcmp(envval, ".:tmp_links_env")) + if (HDstrcmp(envval, ".:tmp_links_env") != 0) TEST_ERROR /* Set up name for main file:"extlinks_env0" */ diff --git a/test/mf.c b/test/mf.c index 347c1bb73bb..7ab353b90ec 100644 --- a/test/mf.c +++ b/test/mf.c @@ -230,7 +230,7 @@ test_mf_eoa(const char *env_h5_drvr, hid_t fapl) /* Skip test when using VFDs that has different address spaces for each * type of metadata allocation. */ - contig_addr_vfd = (hbool_t)(HDstrcmp(env_h5_drvr, "split") && HDstrcmp(env_h5_drvr, "multi")); + contig_addr_vfd = (hbool_t)(HDstrcmp(env_h5_drvr, "split") != 0 && HDstrcmp(env_h5_drvr, "multi") != 0); if (contig_addr_vfd) { /* Set the filename to use for this test */ h5_fixname(FILENAME[0], fapl, filename, sizeof(filename)); @@ -378,7 +378,7 @@ test_mf_eoa_shrink(const char *env_h5_drvr, hid_t fapl) /* Skip test when using VFDs that has different address spaces for each * type of metadata allocation. */ - contig_addr_vfd = (hbool_t)(HDstrcmp(env_h5_drvr, "split") && HDstrcmp(env_h5_drvr, "multi")); + contig_addr_vfd = (hbool_t)(HDstrcmp(env_h5_drvr, "split") != 0 && HDstrcmp(env_h5_drvr, "multi") != 0); if (contig_addr_vfd) { /* Set the filename to use for this test (dependent on fapl) */ h5_fixname(FILENAME[0], fapl, filename, sizeof(filename)); @@ -665,7 +665,7 @@ test_mf_eoa_extend(const char *env_h5_drvr, hid_t fapl) /* Skip test when using VFDs that has different address spaces for each * type of metadata allocation. */ - contig_addr_vfd = (hbool_t)(HDstrcmp(env_h5_drvr, "split") && HDstrcmp(env_h5_drvr, "multi")); + contig_addr_vfd = (hbool_t)(HDstrcmp(env_h5_drvr, "split") != 0 && HDstrcmp(env_h5_drvr, "multi") != 0); if (contig_addr_vfd) { /* Set the filename to use for this test (dependent on fapl) */ h5_fixname(FILENAME[0], fapl, filename, sizeof(filename)); @@ -872,7 +872,8 @@ test_mf_tmp(const char *env_h5_drvr, hid_t fapl, hbool_t new_format) TESTING("'temporary' file space allocation with old library format") /* Can't run this test with multi-file VFDs */ - if (HDstrcmp(env_h5_drvr, "split") && HDstrcmp(env_h5_drvr, "multi") && HDstrcmp(env_h5_drvr, "family")) { + if (HDstrcmp(env_h5_drvr, "split") != 0 && HDstrcmp(env_h5_drvr, "multi") != 0 && + HDstrcmp(env_h5_drvr, "family") != 0) { char filename[FILENAME_LEN]; /* Filename to use */ H5F_t * f = NULL; /* Internal file object pointer */ h5_stat_size_t file_size, new_file_size; /* file size */ @@ -1998,7 +1999,7 @@ test_mf_fs_absorb(const char *env_h5_drvr, hid_t fapl) TESTING("A free-space section absorbs an aggregator: test 1"); /* Skip test when using VFDs that don't use the metadata aggregator */ - contig_addr_vfd = (hbool_t)(HDstrcmp(env_h5_drvr, "split") && HDstrcmp(env_h5_drvr, "multi")); + contig_addr_vfd = (hbool_t)(HDstrcmp(env_h5_drvr, "split") != 0 && HDstrcmp(env_h5_drvr, "multi") != 0); if (contig_addr_vfd) { /* Set the filename to use for this test (dependent on fapl) */ h5_fixname(FILENAME[0], fapl, filename, sizeof(filename)); @@ -2171,7 +2172,7 @@ test_mf_aggr_alloc1(const char *env_h5_drvr, hid_t fapl) TESTING("H5MF_alloc() of meta/sdata aggregator:test 1"); /* Skip test when using VFDs that don't use the metadata aggregator */ - contig_addr_vfd = (hbool_t)(HDstrcmp(env_h5_drvr, "split") && HDstrcmp(env_h5_drvr, "multi")); + contig_addr_vfd = (hbool_t)(HDstrcmp(env_h5_drvr, "split") != 0 && HDstrcmp(env_h5_drvr, "multi") != 0); if (contig_addr_vfd) { /* Set the filename to use for this test (dependent on fapl) */ h5_fixname(FILENAME[0], fapl, filename, sizeof(filename)); @@ -2322,7 +2323,7 @@ test_mf_aggr_alloc2(const char *env_h5_drvr, hid_t fapl) TESTING("H5MF_alloc() of meta/sdata aggregator:test 2"); /* Skip test when using VFDs that don't use the metadata aggregator */ - contig_addr_vfd = (hbool_t)(HDstrcmp(env_h5_drvr, "split") && HDstrcmp(env_h5_drvr, "multi")); + contig_addr_vfd = (hbool_t)(HDstrcmp(env_h5_drvr, "split") != 0 && HDstrcmp(env_h5_drvr, "multi") != 0); if (contig_addr_vfd) { /* Set the filename to use for this test (dependent on fapl) */ h5_fixname(FILENAME[0], fapl, filename, sizeof(filename)); @@ -2477,7 +2478,7 @@ test_mf_aggr_alloc3(const char *env_h5_drvr, hid_t fapl) TESTING("H5MF_alloc() of meta/sdata aggregator: test 3"); /* Skip test when using VFDs that don't use the metadata aggregator */ - contig_addr_vfd = (hbool_t)(HDstrcmp(env_h5_drvr, "split") && HDstrcmp(env_h5_drvr, "multi")); + contig_addr_vfd = (hbool_t)(HDstrcmp(env_h5_drvr, "split") != 0 && HDstrcmp(env_h5_drvr, "multi") != 0); if (contig_addr_vfd) { /* Set the filename to use for this test (dependent on fapl) */ h5_fixname(FILENAME[0], fapl, filename, sizeof(filename)); @@ -2642,7 +2643,7 @@ test_mf_aggr_alloc4(const char *env_h5_drvr, hid_t fapl) TESTING("H5MF_alloc() of meta/sdata aggregator:test 4"); /* Skip test when using VFDs that don't use the metadata aggregator */ - contig_addr_vfd = (hbool_t)(HDstrcmp(env_h5_drvr, "split") && HDstrcmp(env_h5_drvr, "multi")); + contig_addr_vfd = (hbool_t)(HDstrcmp(env_h5_drvr, "split") != 0 && HDstrcmp(env_h5_drvr, "multi") != 0); if (contig_addr_vfd) { /* Set the filename to use for this test (dependent on fapl) */ h5_fixname(FILENAME[0], fapl, filename, sizeof(filename)); @@ -2788,7 +2789,7 @@ test_mf_aggr_alloc5(const char *env_h5_drvr, hid_t fapl) TESTING("H5MF_alloc() of meta/sdata aggregator:test 5"); /* Skip test when using VFDs that don't use the metadata aggregator */ - contig_addr_vfd = (hbool_t)(HDstrcmp(env_h5_drvr, "split") && HDstrcmp(env_h5_drvr, "multi")); + contig_addr_vfd = (hbool_t)(HDstrcmp(env_h5_drvr, "split") != 0 && HDstrcmp(env_h5_drvr, "multi") != 0); if (contig_addr_vfd) { /* Set the filename to use for this test (dependent on fapl) */ h5_fixname(FILENAME[0], fapl, filename, sizeof(filename)); @@ -2923,7 +2924,7 @@ test_mf_aggr_alloc6(const char *env_h5_drvr, hid_t fapl) TESTING("H5MF_alloc() of meta/sdata aggregator:test 6"); /* Skip test when using VFDs that don't use the metadata aggregator */ - contig_addr_vfd = (hbool_t)(HDstrcmp(env_h5_drvr, "split") && HDstrcmp(env_h5_drvr, "multi")); + contig_addr_vfd = (hbool_t)(HDstrcmp(env_h5_drvr, "split") != 0 && HDstrcmp(env_h5_drvr, "multi") != 0); if (contig_addr_vfd) { /* Set the filename to use for this test (dependent on fapl) */ h5_fixname(FILENAME[0], fapl, filename, sizeof(filename)); @@ -3094,7 +3095,7 @@ test_mf_aggr_alloc7(const char *env_h5_drvr, hid_t fapl) TESTING("H5MF_alloc() of meta/sdata aggregator:test 7"); /* Skip test when using VFDs that don't use the metadata aggregator */ - contig_addr_vfd = (hbool_t)(HDstrcmp(env_h5_drvr, "split") && HDstrcmp(env_h5_drvr, "multi")); + contig_addr_vfd = (hbool_t)(HDstrcmp(env_h5_drvr, "split") != 0 && HDstrcmp(env_h5_drvr, "multi") != 0); if (contig_addr_vfd) { /* Set the filename to use for this test (dependent on fapl) */ h5_fixname(FILENAME[0], fapl, filename, sizeof(filename)); @@ -3262,7 +3263,7 @@ test_mf_aggr_extend(const char *env_h5_drvr, hid_t fapl) TESTING("H5MF_try_extend() of meta/sdata aggregator: test 1"); /* Skip test when using VFDs that don't use the metadata aggregator */ - contig_addr_vfd = (hbool_t)(HDstrcmp(env_h5_drvr, "split") && HDstrcmp(env_h5_drvr, "multi")); + contig_addr_vfd = (hbool_t)(HDstrcmp(env_h5_drvr, "split") != 0 && HDstrcmp(env_h5_drvr, "multi") != 0); if (contig_addr_vfd) { /* Set the filename to use for this test (dependent on fapl) */ h5_fixname(FILENAME[0], fapl, filename, sizeof(filename)); @@ -3557,7 +3558,7 @@ test_mf_aggr_absorb(const char *env_h5_drvr, hid_t fapl) TESTING("H5MF_try_shrink() of meta/sdata aggregator: test 1"); /* Skip test when using VFDs that don't use the metadata aggregator */ - contig_addr_vfd = (hbool_t)(HDstrcmp(env_h5_drvr, "split") && HDstrcmp(env_h5_drvr, "multi")); + contig_addr_vfd = (hbool_t)(HDstrcmp(env_h5_drvr, "split") != 0 && HDstrcmp(env_h5_drvr, "multi") != 0); if (contig_addr_vfd) { /* Set the filename to use for this test (dependent on fapl) */ h5_fixname(FILENAME[0], fapl, filename, sizeof(filename)); @@ -3808,8 +3809,8 @@ test_mf_align_eoa(const char *env_h5_drvr, hid_t fapl, hid_t new_fapl) /* Skip test when using VFDs that have their own 'alloc' callback, which * don't push mis-aligned space fragments on the file free space list */ - have_alloc_vfd = (hbool_t)(HDstrcmp(env_h5_drvr, "stdio") && HDstrcmp(env_h5_drvr, "split") && - HDstrcmp(env_h5_drvr, "multi")); + have_alloc_vfd = (hbool_t)(HDstrcmp(env_h5_drvr, "stdio") != 0 && HDstrcmp(env_h5_drvr, "split") != 0 && + HDstrcmp(env_h5_drvr, "multi") != 0); if (have_alloc_vfd) { /* Set the filename to use for this test (dependent on fapl) */ h5_fixname(FILENAME[0], fapl, filename, sizeof(filename)); @@ -4249,8 +4250,8 @@ test_mf_align_fs(const char *env_h5_drvr, hid_t fapl, hid_t new_fapl) /* Skip test when using VFDs that have their own 'alloc' callback, which * don't push mis-aligned space fragments on the file free space list */ - have_alloc_vfd = (hbool_t)(HDstrcmp(env_h5_drvr, "stdio") && HDstrcmp(env_h5_drvr, "split") && - HDstrcmp(env_h5_drvr, "multi")); + have_alloc_vfd = (hbool_t)(HDstrcmp(env_h5_drvr, "stdio") != 0 && HDstrcmp(env_h5_drvr, "split") != 0 && + HDstrcmp(env_h5_drvr, "multi") != 0); if (have_alloc_vfd) { if ((file_size = h5_get_file_size(filename, new_fapl)) < 0) TEST_ERROR @@ -4452,8 +4453,8 @@ test_mf_align_alloc1(const char *env_h5_drvr, hid_t fapl, hid_t new_fapl) /* Skip test when using VFDs that have their own 'alloc' callback, which * don't push mis-aligned space fragments on the file free space list */ - have_alloc_vfd = (hbool_t)(HDstrcmp(env_h5_drvr, "stdio") && HDstrcmp(env_h5_drvr, "split") && - HDstrcmp(env_h5_drvr, "multi")); + have_alloc_vfd = (hbool_t)(HDstrcmp(env_h5_drvr, "stdio") != 0 && HDstrcmp(env_h5_drvr, "split") != 0 && + HDstrcmp(env_h5_drvr, "multi") != 0); if (have_alloc_vfd) { /* Set the filename to use for this test (dependent on fapl) */ h5_fixname(FILENAME[0], fapl, filename, sizeof(filename)); @@ -4711,8 +4712,8 @@ test_mf_align_alloc2(const char *env_h5_drvr, hid_t fapl, hid_t new_fapl) /* Skip test when using VFDs that have their own 'alloc' callback, which * don't push mis-aligned space fragments on the file free space list */ - have_alloc_vfd = (hbool_t)(HDstrcmp(env_h5_drvr, "stdio") && HDstrcmp(env_h5_drvr, "split") && - HDstrcmp(env_h5_drvr, "multi")); + have_alloc_vfd = (hbool_t)(HDstrcmp(env_h5_drvr, "stdio") != 0 && HDstrcmp(env_h5_drvr, "split") != 0 && + HDstrcmp(env_h5_drvr, "multi") != 0); if (have_alloc_vfd) { /* Set the filename to use for this test (dependent on fapl) */ h5_fixname(FILENAME[0], fapl, filename, sizeof(filename)); @@ -5053,8 +5054,8 @@ test_mf_align_alloc3(const char *env_h5_drvr, hid_t fapl, hid_t new_fapl) /* Skip test when using VFDs that have their own 'alloc' callback, which * don't push mis-aligned space fragments on the file free space list */ - have_alloc_vfd = (hbool_t)(HDstrcmp(env_h5_drvr, "stdio") && HDstrcmp(env_h5_drvr, "split") && - HDstrcmp(env_h5_drvr, "multi")); + have_alloc_vfd = (hbool_t)(HDstrcmp(env_h5_drvr, "stdio") != 0 && HDstrcmp(env_h5_drvr, "split") != 0 && + HDstrcmp(env_h5_drvr, "multi") != 0); if (have_alloc_vfd) { /* Set the filename to use for this test (dependent on fapl) */ h5_fixname(FILENAME[0], fapl, filename, sizeof(filename)); @@ -5363,8 +5364,8 @@ test_mf_align_alloc4(const char *env_h5_drvr, hid_t fapl, hid_t new_fapl) /* Skip test when using VFDs that have their own 'alloc' callback, which * don't push mis-aligned space fragments on the file free space list */ - have_alloc_vfd = (hbool_t)(HDstrcmp(env_h5_drvr, "stdio") && HDstrcmp(env_h5_drvr, "split") && - HDstrcmp(env_h5_drvr, "multi")); + have_alloc_vfd = (hbool_t)(HDstrcmp(env_h5_drvr, "stdio") != 0 && HDstrcmp(env_h5_drvr, "split") != 0 && + HDstrcmp(env_h5_drvr, "multi") != 0); if (have_alloc_vfd) { /* Set the filename to use for this test (dependent on fapl) */ h5_fixname(FILENAME[0], fapl, filename, sizeof(filename)); @@ -5578,8 +5579,8 @@ test_mf_align_alloc5(const char *env_h5_drvr, hid_t fapl, hid_t new_fapl) /* Skip test when using VFDs that have their own 'alloc' callback, which * don't push mis-aligned space fragments on the file free space list */ - have_alloc_vfd = (hbool_t)(HDstrcmp(env_h5_drvr, "stdio") && HDstrcmp(env_h5_drvr, "split") && - HDstrcmp(env_h5_drvr, "multi")); + have_alloc_vfd = (hbool_t)(HDstrcmp(env_h5_drvr, "stdio") != 0 && HDstrcmp(env_h5_drvr, "split") != 0 && + HDstrcmp(env_h5_drvr, "multi") != 0); if (have_alloc_vfd) { /* Set the filename to use for this test (dependent on fapl) */ h5_fixname(FILENAME[0], fapl, filename, sizeof(filename)); @@ -5845,8 +5846,8 @@ test_mf_align_alloc6(const char *env_h5_drvr, hid_t fapl, hid_t new_fapl) /* Skip test when using VFDs that have their own 'alloc' callback, which * don't push mis-aligned space fragments on the file free space list */ - have_alloc_vfd = (hbool_t)(HDstrcmp(env_h5_drvr, "stdio") && HDstrcmp(env_h5_drvr, "split") && - HDstrcmp(env_h5_drvr, "multi")); + have_alloc_vfd = (hbool_t)(HDstrcmp(env_h5_drvr, "stdio") != 0 && HDstrcmp(env_h5_drvr, "split") != 0 && + HDstrcmp(env_h5_drvr, "multi") != 0); if (have_alloc_vfd) { /* Set the filename to use for this test (dependent on fapl) */ h5_fixname(FILENAME[0], fapl, filename, sizeof(filename)); @@ -6856,7 +6857,7 @@ test_mf_fs_persist(const char *env_h5_drvr, hid_t fapl, hbool_t new_format) else TESTING("File's free-space is persistent with old library format") - if (HDstrcmp(env_h5_drvr, "split") && HDstrcmp(env_h5_drvr, "multi")) { + if (HDstrcmp(env_h5_drvr, "split") != 0 && HDstrcmp(env_h5_drvr, "multi") != 0) { /* File creation property list template */ if ((fcpl = H5Pcreate(H5P_FILE_CREATE)) < 0) @@ -7033,7 +7034,7 @@ test_mf_fs_gone(const char *env_h5_drvr, hid_t fapl, hbool_t new_format) TESTING("File's free-space is going away with old library format") /* Current VFD that does not support contigous address space */ - contig_addr_vfd = (hbool_t)(HDstrcmp(env_h5_drvr, "split") && HDstrcmp(env_h5_drvr, "multi")); + contig_addr_vfd = (hbool_t)(HDstrcmp(env_h5_drvr, "split") != 0 && HDstrcmp(env_h5_drvr, "multi") != 0); if (contig_addr_vfd) { @@ -7224,7 +7225,7 @@ test_mf_strat_thres_persist(const char *env_h5_drvr, hid_t fapl, hbool_t new_for TESTING("File space strategy/persisting/threshold with old library format") /* Current VFD that does not support contigous address space */ - contig_addr_vfd = (hbool_t)(HDstrcmp(env_h5_drvr, "split") && HDstrcmp(env_h5_drvr, "multi")); + contig_addr_vfd = (hbool_t)(HDstrcmp(env_h5_drvr, "split") != 0 && HDstrcmp(env_h5_drvr, "multi") != 0); /* Set the filename to use for this test (dependent on fapl) */ h5_fixname(FILENAME[0], fapl, filename, sizeof(filename)); @@ -7394,7 +7395,7 @@ test_mf_strat_thres_gone(const char *env_h5_drvr, hid_t fapl, hbool_t new_format TESTING("File space merge/shrink for section size < threshold with old library format") /* Current VFD that does not support contigous address space */ - contig_addr_vfd = (hbool_t)(HDstrcmp(env_h5_drvr, "split") && HDstrcmp(env_h5_drvr, "multi")); + contig_addr_vfd = (hbool_t)(HDstrcmp(env_h5_drvr, "split") != 0 && HDstrcmp(env_h5_drvr, "multi") != 0); /* Set the filename to use for this test (dependent on fapl) */ h5_fixname(FILENAME[0], fapl, filename, sizeof(filename)); @@ -7956,7 +7957,7 @@ test_page_try_shrink(const char *env_h5_drvr, hid_t fapl) TESTING("Paged aggregation for file space: H5MF_try_shrink()"); /* Current VFD that does not support continuous address space */ - contig_addr_vfd = (hbool_t)(HDstrcmp(env_h5_drvr, "split") && HDstrcmp(env_h5_drvr, "multi")); + contig_addr_vfd = (hbool_t)(HDstrcmp(env_h5_drvr, "split") != 0 && HDstrcmp(env_h5_drvr, "multi") != 0); if (contig_addr_vfd) { @@ -8085,8 +8086,8 @@ test_page_small_try_extend(const char *env_h5_drvr, hid_t fapl) TESTING("Paged aggregation for file space: H5MF_try_extend() a small block"); /* Current VFD that does not support continuous address space */ - contig_addr_vfd = (hbool_t)(HDstrcmp(env_h5_drvr, "split") && HDstrcmp(env_h5_drvr, "multi") && - HDstrcmp(env_h5_drvr, "family")); + contig_addr_vfd = (hbool_t)(HDstrcmp(env_h5_drvr, "split") != 0 && HDstrcmp(env_h5_drvr, "multi") != 0 && + HDstrcmp(env_h5_drvr, "family") != 0); if (contig_addr_vfd) { @@ -8264,7 +8265,7 @@ test_page_large_try_extend(const char *env_h5_drvr, hid_t fapl) TESTING("Paged aggregation for file space: H5MF_try_extend() a large block"); /* Current VFD that does not support continuous address space */ - contig_addr_vfd = (hbool_t)(HDstrcmp(env_h5_drvr, "split") && HDstrcmp(env_h5_drvr, "multi")); + contig_addr_vfd = (hbool_t)(HDstrcmp(env_h5_drvr, "split") != 0 && HDstrcmp(env_h5_drvr, "multi") != 0); if (contig_addr_vfd) { @@ -8428,7 +8429,7 @@ test_page_large(const char *env_h5_drvr, hid_t fapl) TESTING("Paged aggregation for file space: large allocations and de-allocations"); /* Current VFD that does not support continuous address space */ - contig_addr_vfd = (hbool_t)(HDstrcmp(env_h5_drvr, "split") && HDstrcmp(env_h5_drvr, "multi")); + contig_addr_vfd = (hbool_t)(HDstrcmp(env_h5_drvr, "split") != 0 && HDstrcmp(env_h5_drvr, "multi") != 0); if (contig_addr_vfd) { diff --git a/test/mount.c b/test/mount.c index 94d372ee4cb..1ed8f58282e 100644 --- a/test/mount.c +++ b/test/mount.c @@ -1547,7 +1547,7 @@ test_mount_after_close(hid_t fapl) *objname = '\0'; if (H5Iget_name(gidABMX, objname, (size_t)NAME_BUF_SIZE) < 0) FAIL_STACK_ERROR - if (HDstrcmp(objname, "/A/B/M/X")) + if (HDstrcmp(objname, "/A/B/M/X") != 0) TEST_ERROR /* Close object in mounted file */ @@ -1562,7 +1562,7 @@ test_mount_after_close(hid_t fapl) *objname = '\0'; if (H5Iget_name(gidABC, objname, (size_t)NAME_BUF_SIZE) < 0) FAIL_STACK_ERROR - if (HDstrcmp(objname, "/A/B/C")) + if (HDstrcmp(objname, "/A/B/C") != 0) TEST_ERROR /* Close object in mounted file */ @@ -1577,7 +1577,7 @@ test_mount_after_close(hid_t fapl) *objname = '\0'; if (H5Iget_name(gidABT, objname, (size_t)NAME_BUF_SIZE) < 0) FAIL_STACK_ERROR - if (HDstrcmp(objname, "/A/B/T")) + if (HDstrcmp(objname, "/A/B/T") != 0) TEST_ERROR /* Close object in original file */ @@ -1592,7 +1592,7 @@ test_mount_after_close(hid_t fapl) *objname = '\0'; if (H5Iget_name(didABMXYD, objname, (size_t)NAME_BUF_SIZE) < 0) FAIL_STACK_ERROR - if (HDstrcmp(objname, "/A/B/M/X/Y/D")) + if (HDstrcmp(objname, "/A/B/M/X/Y/D") != 0) TEST_ERROR /* Close object in mounted file */ @@ -1765,7 +1765,7 @@ test_mount_after_unmount(hid_t fapl) *objname = '\0'; if (H5Iget_name(gidAMXX, objname, (size_t)NAME_BUF_SIZE) < 0) TEST_ERROR - if (HDstrcmp(objname, "/A/M/X/X")) + if (HDstrcmp(objname, "/A/M/X/X") != 0) TEST_ERROR /* Open group in mounted file #2 */ @@ -1785,7 +1785,7 @@ test_mount_after_unmount(hid_t fapl) *objname = '\0'; if (H5Iget_name(gidAMXMY, objname, (size_t)NAME_BUF_SIZE) < 0) TEST_ERROR - if (HDstrcmp(objname, "/A/M/X/M/Y")) + if (HDstrcmp(objname, "/A/M/X/M/Y") != 0) TEST_ERROR /* Unmount second file */ @@ -1796,7 +1796,7 @@ test_mount_after_unmount(hid_t fapl) *objname = '\0'; if (H5Iget_name(gidAMXMY, objname, (size_t)NAME_BUF_SIZE) < 0) TEST_ERROR - if (HDstrcmp(objname, "/X/M/Y")) + if (HDstrcmp(objname, "/X/M/Y") != 0) TEST_ERROR /* Rename object in file #3 that is "disconnected" from name hiearchy */ @@ -1816,7 +1816,7 @@ test_mount_after_unmount(hid_t fapl) *objname = '\0'; if (H5Iget_name(gidAMXMY, objname, (size_t)NAME_BUF_SIZE) < 0) TEST_ERROR - if (HDstrcmp(objname, "/X/M/Z")) + if (HDstrcmp(objname, "/X/M/Z") != 0) TEST_ERROR /* Mount fourth file */ @@ -1832,7 +1832,7 @@ test_mount_after_unmount(hid_t fapl) *objname = '\0'; if (H5Iget_name(gidBMZ, objname, (size_t)NAME_BUF_SIZE) < 0) TEST_ERROR - if (HDstrcmp(objname, "/B/M/Z")) + if (HDstrcmp(objname, "/B/M/Z") != 0) TEST_ERROR /* Unmount third file */ @@ -3080,7 +3080,7 @@ test_mult_mount(hid_t fapl) *name = '\0'; if (H5Iget_name(gidAMT, name, (size_t)NAME_BUF_SIZE) < 0) TEST_ERROR - if (HDstrcmp(name, "/A/M/T")) + if (HDstrcmp(name, "/A/M/T") != 0) TEST_ERROR /* Create object in file #3 */ @@ -3098,7 +3098,7 @@ test_mult_mount(hid_t fapl) *name = '\0'; if (H5Iget_name(gidBS, name, (size_t)NAME_BUF_SIZE) < 0) TEST_ERROR - if (HDstrcmp(name, "/B/S")) + if (HDstrcmp(name, "/B/S") != 0) TEST_ERROR /* Re-open object created in file #3 through file #1 mount path */ @@ -3279,7 +3279,7 @@ test_nested_survive(hid_t fapl) *name = '\0'; if ((name_len = H5Iget_name(gidAM, name, (size_t)NAME_BUF_SIZE)) < 0) TEST_ERROR - if (name_len == 0 || HDstrcmp(name, "/A/M")) + if (name_len == 0 || HDstrcmp(name, "/A/M") != 0) TEST_ERROR /* Unmount file #2 from file #1 */ @@ -3290,7 +3290,7 @@ test_nested_survive(hid_t fapl) *name = '\0'; if ((name_len = H5Iget_name(gidAM, name, (size_t)NAME_BUF_SIZE)) < 0) TEST_ERROR - if (name_len != 0 || HDstrcmp(name, "")) + if (name_len != 0 || HDstrcmp(name, "") != 0) TEST_ERROR /* Open object in file #3 through file #1 mount path (should fail) */ @@ -3307,7 +3307,7 @@ test_nested_survive(hid_t fapl) *name = '\0'; if (H5Iget_name(gidMS, name, (size_t)NAME_BUF_SIZE) < 0) TEST_ERROR - if (HDstrcmp(name, "/M/S")) + if (HDstrcmp(name, "/M/S") != 0) TEST_ERROR /* Close group in file #3 */ @@ -3326,7 +3326,7 @@ test_nested_survive(hid_t fapl) *name = '\0'; if (H5Iget_name(gidAMS, name, (size_t)NAME_BUF_SIZE) < 0) TEST_ERROR - if (HDstrcmp(name, "/A/M/S")) + if (HDstrcmp(name, "/A/M/S") != 0) TEST_ERROR /* Close group in file #3 */ @@ -3475,7 +3475,7 @@ test_close_parent(hid_t fapl) *name = '\0'; if ((name_len = H5Iget_name(gidM, name, (size_t)NAME_BUF_SIZE)) < 0) TEST_ERROR - if (name_len == 0 || HDstrcmp(name, "/A/M")) + if (name_len == 0 || HDstrcmp(name, "/A/M") != 0) TEST_ERROR /* Unmount file #2 from file #1, closing file #1 */ @@ -3486,7 +3486,7 @@ test_close_parent(hid_t fapl) *name = '\0'; if ((name_len = H5Iget_name(gidM, name, (size_t)NAME_BUF_SIZE)) < 0) TEST_ERROR - if (name_len == 0 || HDstrcmp(name, "/M")) + if (name_len == 0 || HDstrcmp(name, "/M") != 0) TEST_ERROR /* Just file #2's underlying shared file should be open still */ @@ -3753,7 +3753,7 @@ test_cut_graph(hid_t fapl) *name = '\0'; if ((name_len = H5Iget_name(gidM, name, (size_t)NAME_BUF_SIZE)) < 0) TEST_ERROR - if (name_len == 0 || HDstrcmp(name, "/A/E/M")) + if (name_len == 0 || HDstrcmp(name, "/A/E/M") != 0) TEST_ERROR /* Open object in file #7 */ @@ -3764,7 +3764,7 @@ test_cut_graph(hid_t fapl) *name = '\0'; if ((name_len = H5Iget_name(gidQ, name, (size_t)NAME_BUF_SIZE)) < 0) TEST_ERROR - if (name_len == 0 || HDstrcmp(name, "/B/I/Q")) + if (name_len == 0 || HDstrcmp(name, "/B/I/Q") != 0) TEST_ERROR /* Close file #1 */ @@ -3821,7 +3821,7 @@ test_cut_graph(hid_t fapl) *name = '\0'; if ((name_len = H5Iget_name(gidK, name, (size_t)NAME_BUF_SIZE)) < 0) TEST_ERROR - if (name_len == 0 || HDstrcmp(name, "/D/K")) + if (name_len == 0 || HDstrcmp(name, "/D/K") != 0) TEST_ERROR if (H5Gclose(gidK) < 0) @@ -3841,7 +3841,7 @@ test_cut_graph(hid_t fapl) *name = '\0'; if ((name_len = H5Iget_name(gidO, name, (size_t)NAME_BUF_SIZE)) < 0) TEST_ERROR - if (name_len == 0 || HDstrcmp(name, "/B/H/O")) + if (name_len == 0 || HDstrcmp(name, "/B/H/O") != 0) TEST_ERROR if (H5Gclose(gidO) < 0) @@ -3851,14 +3851,14 @@ test_cut_graph(hid_t fapl) *name = '\0'; if ((name_len = H5Iget_name(gidM, name, (size_t)NAME_BUF_SIZE)) < 0) TEST_ERROR - if (name_len == 0 || HDstrcmp(name, "/E/M")) + if (name_len == 0 || HDstrcmp(name, "/E/M") != 0) TEST_ERROR /* Check the name of "Q" is still defined */ *name = '\0'; if ((name_len = H5Iget_name(gidQ, name, (size_t)NAME_BUF_SIZE)) < 0) TEST_ERROR - if (name_len == 0 || HDstrcmp(name, "/B/I/Q")) + if (name_len == 0 || HDstrcmp(name, "/B/I/Q") != 0) TEST_ERROR /* Check that all seven underlying files are still opened */ @@ -3883,7 +3883,7 @@ test_cut_graph(hid_t fapl) *name = '\0'; if ((name_len = H5Iget_name(gidQ, name, (size_t)NAME_BUF_SIZE)) < 0) TEST_ERROR - if (name_len == 0 || HDstrcmp(name, "/I/Q")) + if (name_len == 0 || HDstrcmp(name, "/I/Q") != 0) TEST_ERROR /* Open object in file #6 from file #7 */ @@ -3894,7 +3894,7 @@ test_cut_graph(hid_t fapl) *name = '\0'; if ((name_len = H5Iget_name(gidO, name, (size_t)NAME_BUF_SIZE)) < 0) TEST_ERROR - if (name_len == 0 || HDstrcmp(name, "/H/O")) + if (name_len == 0 || HDstrcmp(name, "/H/O") != 0) TEST_ERROR if (H5Gclose(gidO) < 0) @@ -4060,7 +4060,7 @@ test_symlink(hid_t fapl) *name = '\0'; if ((name_len = H5Iget_name(gidL, name, (size_t)NAME_BUF_SIZE)) < 0) TEST_ERROR - if (name_len == 0 || HDstrcmp(name, "/L")) + if (name_len == 0 || HDstrcmp(name, "/L") != 0) TEST_ERROR /* Close file #1 */ diff --git a/test/objcopy.c b/test/objcopy.c index 717427a994c..4b076ba2467 100644 --- a/test/objcopy.c +++ b/test/objcopy.c @@ -1103,7 +1103,7 @@ compare_data(hid_t parent1, hid_t parent2, hid_t pid, hid_t tid, size_t nelmts, /* Iterate over all elements, calling memcmp() for each */ for (elmt = 0; elmt < nelmts; elmt++) { - if (HDmemcmp(memb1, memb2, memb_size)) + if (HDmemcmp(memb1, memb2, memb_size) != 0) TEST_ERROR /* Update member pointers */ @@ -1325,7 +1325,7 @@ compare_data(hid_t parent1, hid_t parent2, hid_t pid, hid_t tid, size_t nelmts, else TEST_ERROR } /* end else */ - else if (HDmemcmp(buf1, buf2, (elmt_size * nelmts))) + else if (HDmemcmp(buf1, buf2, (elmt_size * nelmts)) != 0) TEST_ERROR /* Data should be the same. :-) */ @@ -1596,7 +1596,7 @@ compare_groups(hid_t gid, hid_t gid2, hid_t pid, int depth, unsigned copy_flags) if (H5Lget_name_by_idx(gid2, ".", H5_INDEX_NAME, H5_ITER_INC, idx, objname2, (size_t)NAME_BUF_SIZE, H5P_DEFAULT) < 0) TEST_ERROR - if (HDstrcmp(objname, objname2)) + if (HDstrcmp(objname, objname2) != 0) TEST_ERROR /* Get link info */ @@ -1710,7 +1710,7 @@ compare_groups(hid_t gid, hid_t gid2, hid_t pid, int depth, unsigned copy_flags) TEST_ERROR /* Compare link data */ - if (HDmemcmp(linkval, linkval2, linfo.u.val_size)) + if (HDmemcmp(linkval, linkval2, linfo.u.val_size) != 0) TEST_ERROR } /* end else-if */ else { @@ -7025,7 +7025,7 @@ compare_attribute_compound_vlstr(hid_t loc, hid_t loc2) FAIL_STACK_ERROR if (HDstrlen(rbuf.v) != HDstrlen(rbuf2.v)) FAIL_STACK_ERROR - if (HDmemcmp(rbuf.v, rbuf2.v, HDstrlen(rbuf.v))) + if (HDmemcmp(rbuf.v, rbuf2.v, HDstrlen(rbuf.v)) != 0) FAIL_STACK_ERROR /* Reclaim vlen buffer */ @@ -11695,9 +11695,9 @@ test_copy_null_ref(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, hid_t dst_fap TEST_ERROR /* Verify that the references contain only "0" bytes */ - if (HDmemcmp(obj_buf, zeros, sizeof(obj_buf))) + if (HDmemcmp(obj_buf, zeros, sizeof(obj_buf)) != 0) TEST_ERROR - if (HDmemcmp(reg_buf, zeros, sizeof(reg_buf))) + if (HDmemcmp(reg_buf, zeros, sizeof(reg_buf)) != 0) TEST_ERROR /* Close datasets */ @@ -11740,9 +11740,9 @@ test_copy_null_ref(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, hid_t dst_fap TEST_ERROR /* Verify that the references contain only "0" bytes */ - if (HDmemcmp(obj_buf, zeros, sizeof(obj_buf))) + if (HDmemcmp(obj_buf, zeros, sizeof(obj_buf)) != 0) TEST_ERROR - if (HDmemcmp(reg_buf, zeros, sizeof(reg_buf))) + if (HDmemcmp(reg_buf, zeros, sizeof(reg_buf)) != 0) TEST_ERROR /* Close */ @@ -11902,9 +11902,9 @@ test_copy_null_ref_open(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, hid_t ds TEST_ERROR /* Verify that the references contain only "0" bytes */ - if (HDmemcmp(obj_buf, zeros, sizeof(obj_buf))) + if (HDmemcmp(obj_buf, zeros, sizeof(obj_buf)) != 0) TEST_ERROR - if (HDmemcmp(reg_buf, zeros, sizeof(reg_buf))) + if (HDmemcmp(reg_buf, zeros, sizeof(reg_buf)) != 0) TEST_ERROR /* Create destination file */ @@ -11947,9 +11947,9 @@ test_copy_null_ref_open(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, hid_t ds TEST_ERROR /* Verify that the references contain only "0" bytes */ - if (HDmemcmp(obj_buf, zeros, sizeof(obj_buf))) + if (HDmemcmp(obj_buf, zeros, sizeof(obj_buf)) != 0) TEST_ERROR - if (HDmemcmp(reg_buf, zeros, sizeof(reg_buf))) + if (HDmemcmp(reg_buf, zeros, sizeof(reg_buf)) != 0) TEST_ERROR /* Close */ diff --git a/test/objcopy_ref.c b/test/objcopy_ref.c index 22022f2895e..33f8900139a 100644 --- a/test/objcopy_ref.c +++ b/test/objcopy_ref.c @@ -887,7 +887,7 @@ compare_data(hid_t parent1, hid_t parent2, hid_t pid, hid_t tid, size_t nelmts, /* Iterate over all elements, calling memcmp() for each */ for (elmt = 0; elmt < nelmts; elmt++) { - if (HDmemcmp(memb1, memb2, memb_size)) + if (HDmemcmp(memb1, memb2, memb_size) != 0) TEST_ERROR /* Update member pointers */ @@ -1035,7 +1035,7 @@ compare_data(hid_t parent1, hid_t parent2, hid_t pid, hid_t tid, size_t nelmts, else TEST_ERROR } /* end else */ - else if (HDmemcmp(buf1, buf2, (elmt_size * nelmts))) + else if (HDmemcmp(buf1, buf2, (elmt_size * nelmts)) != 0) TEST_ERROR /* Data should be the same. :-) */ @@ -1306,7 +1306,7 @@ compare_groups(hid_t gid, hid_t gid2, hid_t pid, int depth, unsigned copy_flags) if (H5Lget_name_by_idx(gid2, ".", H5_INDEX_NAME, H5_ITER_INC, idx, objname2, (size_t)NAME_BUF_SIZE, H5P_DEFAULT) < 0) TEST_ERROR - if (HDstrcmp(objname, objname2)) + if (HDstrcmp(objname, objname2) != 0) TEST_ERROR /* Get link info */ @@ -1420,7 +1420,7 @@ compare_groups(hid_t gid, hid_t gid2, hid_t pid, int depth, unsigned copy_flags) TEST_ERROR /* Compare link data */ - if (HDmemcmp(linkval, linkval2, linfo.u.val_size)) + if (HDmemcmp(linkval, linkval2, linfo.u.val_size) != 0) TEST_ERROR } /* end else-if */ else { diff --git a/test/ohdr.c b/test/ohdr.c index 2fb298897e6..71d806b7ae1 100644 --- a/test/ohdr.c +++ b/test/ohdr.c @@ -907,7 +907,7 @@ test_minimized_dset_ohdr_attribute_addition(hid_t fapl_id) /* Read the data back and verify */ if (H5Aread(aid, H5T_NATIVE_CHAR, out_buf) < 0) TEST_ERROR; - if (HDstrcmp(in_buf, out_buf)) + if (HDstrcmp(in_buf, out_buf) != 0) TEST_ERROR; /* modify the string attribute */ @@ -922,7 +922,7 @@ test_minimized_dset_ohdr_attribute_addition(hid_t fapl_id) /* Read the data back and verify */ if (H5Aread(aid, H5T_NATIVE_CHAR, out_buf) < 0) TEST_ERROR; - if (HDstrcmp(in_buf, out_buf)) + if (HDstrcmp(in_buf, out_buf) != 0) TEST_ERROR; /* Close */ @@ -1753,8 +1753,8 @@ main(void) env_h5_drvr = "nomatch"; /* Check for VFD which stores data in multiple files */ - single_file_vfd = (hbool_t)(HDstrcmp(env_h5_drvr, "split") && HDstrcmp(env_h5_drvr, "multi") && - HDstrcmp(env_h5_drvr, "family")); + single_file_vfd = (hbool_t)(HDstrcmp(env_h5_drvr, "split") != 0 && HDstrcmp(env_h5_drvr, "multi") != 0 && + HDstrcmp(env_h5_drvr, "family") != 0); /* Reset library */ h5_reset(); diff --git a/test/set_extent.c b/test/set_extent.c index 6d639ad208a..c69a492611b 100644 --- a/test/set_extent.c +++ b/test/set_extent.c @@ -121,7 +121,7 @@ main(void) if (env_h5_drvr == NULL) env_h5_drvr = "nomatch"; /* Current VFD that does not support contigous address space */ - contig_addr_vfd = (hbool_t)(HDstrcmp(env_h5_drvr, "split") && HDstrcmp(env_h5_drvr, "multi")); + contig_addr_vfd = (hbool_t)(HDstrcmp(env_h5_drvr, "split") != 0 && HDstrcmp(env_h5_drvr, "multi") != 0); /* Initialize random number seed */ HDsrandom((unsigned)HDtime(NULL)); diff --git a/test/stab.c b/test/stab.c index c40b518f102..5f9cad71d91 100644 --- a/test/stab.c +++ b/test/stab.c @@ -134,7 +134,7 @@ test_misc(hid_t fcpl, hid_t fapl, hbool_t new_format) TEST_ERROR if (H5Oget_comment_by_name(g3, "././.", comment, sizeof comment, H5P_DEFAULT) < 0) TEST_ERROR - if (HDstrcmp(comment, "hello world")) { + if (HDstrcmp(comment, "hello world") != 0) { H5_FAILED(); HDputs(" Read the wrong comment string from the group."); HDprintf(" got: \"%s\"\n ans: \"hello world\"\n", comment); @@ -1416,7 +1416,7 @@ main(void) env_h5_drvr = "nomatch"; /* VFD that does not support contigous address space */ - contig_addr_vfd = (hbool_t)(HDstrcmp(env_h5_drvr, "split") && HDstrcmp(env_h5_drvr, "multi")); + contig_addr_vfd = (hbool_t)(HDstrcmp(env_h5_drvr, "split") != 0 && HDstrcmp(env_h5_drvr, "multi") != 0); /* Reset library */ h5_reset(); diff --git a/test/swmr_generator.c b/test/swmr_generator.c index 64056a12930..2bff12c17a8 100644 --- a/test/swmr_generator.c +++ b/test/swmr_generator.c @@ -286,7 +286,7 @@ main(int argc, const char *argv[]) /* Chunk index type */ case 'i': index_type = argv[u + 1]; - if (HDstrcmp(index_type, "ea") && HDstrcmp(index_type, "b2")) + if (HDstrcmp(index_type, "ea") != 0 && HDstrcmp(index_type, "b2") != 0) usage(); u += 2; break; diff --git a/test/swmr_start_write.c b/test/swmr_start_write.c index 3514b28dd5e..2d25801e865 100644 --- a/test/swmr_start_write.c +++ b/test/swmr_start_write.c @@ -385,7 +385,7 @@ main(int argc, const char *argv[]) /* Chunk index type */ case 'i': index_type = argv[u + 1]; - if (HDstrcmp(index_type, "ea") && HDstrcmp(index_type, "b2")) + if (HDstrcmp(index_type, "ea") != 0 && HDstrcmp(index_type, "b2") != 0) usage(); u += 2; break; diff --git a/test/tattr.c b/test/tattr.c index 2b7a03bab54..06856d74ed3 100644 --- a/test/tattr.c +++ b/test/tattr.c @@ -859,8 +859,8 @@ test_attr_compound_read(hid_t fapl) VERIFY(fields, 3, "H5Tget_nmembers"); for (i = 0; i < fields; i++) { fieldname = H5Tget_member_name(type, (unsigned)i); - if (!(HDstrcmp(fieldname, ATTR4_FIELDNAME1) || HDstrcmp(fieldname, ATTR4_FIELDNAME2) || - HDstrcmp(fieldname, ATTR4_FIELDNAME3))) + if (!(HDstrcmp(fieldname, ATTR4_FIELDNAME1) != 0 || HDstrcmp(fieldname, ATTR4_FIELDNAME2) != 0 || + HDstrcmp(fieldname, ATTR4_FIELDNAME3) != 0)) TestErrPrintf("invalid field name for field #%d: %s\n", i, fieldname); H5free_memory(fieldname); } /* end for */ @@ -907,7 +907,7 @@ test_attr_compound_read(hid_t fapl) /* Verify values read in */ for (i = 0; i < ATTR4_DIM1; i++) for (j = 0; j < ATTR4_DIM2; j++) - if (HDmemcmp(&attr_data4[i][j], &read_data4[i][j], sizeof(struct attr4_struct))) { + if (HDmemcmp(&attr_data4[i][j], &read_data4[i][j], sizeof(struct attr4_struct)) != 0) { HDprintf("%d: attribute data different: attr_data4[%d][%d].i=%d, read_data4[%d][%d].i=%d\n", __LINE__, i, j, attr_data4[i][j].i, i, j, read_data4[i][j].i); HDprintf("%d: attribute data different: attr_data4[%d][%d].d=%f, read_data4[%d][%d].d=%f\n", @@ -920,7 +920,7 @@ test_attr_compound_read(hid_t fapl) /* Verify Name */ name_len = H5Aget_name(attr, (size_t)ATTR_NAME_LEN, attr_name); VERIFY(name_len, HDstrlen(ATTR4_NAME), "H5Aget_name"); - if (HDstrcmp(attr_name, ATTR4_NAME)) + if (HDstrcmp(attr_name, ATTR4_NAME) != 0) TestErrPrintf("attribute name different: attr_name=%s, should be %s\n", attr_name, ATTR4_NAME); /* Close attribute datatype */ @@ -1279,7 +1279,7 @@ test_attr_mult_read(hid_t fapl) /* Verify Name */ name_len = H5Aget_name(attr, (size_t)ATTR_NAME_LEN, attr_name); VERIFY(name_len, HDstrlen(ATTR1_NAME), "H5Aget_name"); - if (HDstrcmp(attr_name, ATTR1_NAME)) + if (HDstrcmp(attr_name, ATTR1_NAME) != 0) TestErrPrintf("attribute name different: attr_name=%s, should be %s\n", attr_name, ATTR1_NAME); /* Verify Name with too small of a buffer */ @@ -1287,7 +1287,7 @@ test_attr_mult_read(hid_t fapl) VERIFY(name_len, HDstrlen(ATTR1_NAME), "H5Aget_name"); HDstrcpy(temp_name, ATTR1_NAME); /* make a copy of the name */ temp_name[HDstrlen(ATTR1_NAME) - 1] = '\0'; /* truncate it to match the one retrieved */ - if (HDstrcmp(attr_name, temp_name)) + if (HDstrcmp(attr_name, temp_name) != 0) TestErrPrintf("attribute name different: attr_name=%s, should be %s\n", attr_name, temp_name); /* Close attribute */ @@ -1337,7 +1337,7 @@ test_attr_mult_read(hid_t fapl) /* Verify Name */ name_len = H5Aget_name(attr, (size_t)ATTR_NAME_LEN, attr_name); VERIFY(name_len, HDstrlen(ATTR2_NAME), "H5Aget_name"); - if (HDstrcmp(attr_name, ATTR2_NAME)) + if (HDstrcmp(attr_name, ATTR2_NAME) != 0) TestErrPrintf("attribute name different: attr_name=%s, should be %s\n", attr_name, ATTR2_NAME); /* Verify Name with too small of a buffer */ @@ -1345,7 +1345,7 @@ test_attr_mult_read(hid_t fapl) VERIFY(name_len, HDstrlen(ATTR2_NAME), "H5Aget_name"); HDstrcpy(temp_name, ATTR2_NAME); /* make a copy of the name */ temp_name[HDstrlen(ATTR2_NAME) - 1] = '\0'; /* truncate it to match the one retrieved */ - if (HDstrcmp(attr_name, temp_name)) + if (HDstrcmp(attr_name, temp_name) != 0) TestErrPrintf("attribute name different: attr_name=%s, should be %s\n", attr_name, temp_name); /* Close attribute */ @@ -1399,7 +1399,7 @@ test_attr_mult_read(hid_t fapl) /* Verify Name */ name_len = H5Aget_name(attr, (size_t)ATTR_NAME_LEN, attr_name); VERIFY(name_len, HDstrlen(ATTR3_NAME), "H5Aget_name"); - if (HDstrcmp(attr_name, ATTR3_NAME)) + if (HDstrcmp(attr_name, ATTR3_NAME) != 0) TestErrPrintf("attribute name different: attr_name=%s, should be %s\n", attr_name, ATTR3_NAME); /* Verify Name with too small of a buffer */ @@ -1407,7 +1407,7 @@ test_attr_mult_read(hid_t fapl) VERIFY(name_len, HDstrlen(ATTR3_NAME), "H5Aget_name"); HDstrcpy(temp_name, ATTR3_NAME); /* make a copy of the name */ temp_name[HDstrlen(ATTR3_NAME) - 1] = '\0'; /* truncate it to match the one retrieved */ - if (HDstrcmp(attr_name, temp_name)) + if (HDstrcmp(attr_name, temp_name) != 0) TestErrPrintf("attribute name different: attr_name=%s, should be %s\n", attr_name, temp_name); /* Close attribute */ @@ -1436,19 +1436,19 @@ attr_op1(hid_t H5_ATTR_UNUSED loc_id, const char *name, const H5A_info_t H5_ATTR switch (*count) { case 0: - if (HDstrcmp(name, ATTR1_NAME)) + if (HDstrcmp(name, ATTR1_NAME) != 0) TestErrPrintf("attribute name different: name=%s, should be %s\n", name, ATTR1_NAME); (*count)++; break; case 1: - if (HDstrcmp(name, ATTR2_NAME)) + if (HDstrcmp(name, ATTR2_NAME) != 0) TestErrPrintf("attribute name different: name=%s, should be %s\n", name, ATTR2_NAME); (*count)++; break; case 2: - if (HDstrcmp(name, ATTR3_NAME)) + if (HDstrcmp(name, ATTR3_NAME) != 0) TestErrPrintf("attribute name different: name=%s, should be %s\n", name, ATTR3_NAME); (*count)++; break; @@ -1590,7 +1590,7 @@ test_attr_delete(hid_t fapl) /* Verify Name */ name_len = H5Aget_name(attr, (size_t)ATTR_NAME_LEN, attr_name); VERIFY(name_len, HDstrlen(ATTR1_NAME), "H5Aget_name"); - if (HDstrcmp(attr_name, ATTR1_NAME)) + if (HDstrcmp(attr_name, ATTR1_NAME) != 0) TestErrPrintf("attribute name different: attr_name=%s, should be %s\n", attr_name, ATTR1_NAME); /* Close attribute */ @@ -1605,7 +1605,7 @@ test_attr_delete(hid_t fapl) /* Verify Name */ name_len = H5Aget_name(attr, (size_t)ATTR_NAME_LEN, attr_name); VERIFY(name_len, HDstrlen(ATTR3_NAME), "H5Aget_name"); - if (HDstrcmp(attr_name, ATTR3_NAME)) + if (HDstrcmp(attr_name, ATTR3_NAME) != 0) TestErrPrintf("attribute name different: attr_name=%s, should be %s\n", attr_name, ATTR3_NAME); /* Close attribute */ @@ -1629,7 +1629,7 @@ test_attr_delete(hid_t fapl) /* Verify Name */ name_len = H5Aget_name(attr, (size_t)ATTR_NAME_LEN, attr_name); VERIFY(name_len, HDstrlen(ATTR3_NAME), "H5Aget_name"); - if (HDstrcmp(attr_name, ATTR3_NAME)) + if (HDstrcmp(attr_name, ATTR3_NAME) != 0) TestErrPrintf("attribute name different: attr_name=%s, should be %s\n", attr_name, ATTR3_NAME); /* Close attribute */ @@ -2123,7 +2123,7 @@ test_attr_dense_verify(hid_t loc_id, unsigned max_attr) HDsprintf(attrname, "attr %02u", u); name_len = H5Aget_name(attr, (size_t)ATTR_NAME_LEN, check_name); VERIFY(name_len, HDstrlen(attrname), "H5Aget_name"); - if (HDstrcmp(check_name, attrname)) + if (HDstrcmp(check_name, attrname) != 0) TestErrPrintf("attribute name different: attrname = '%s', should be '%s'\n", check_name, attrname); @@ -5658,7 +5658,7 @@ attr_info_by_idx_check(hid_t obj_id, const char *attrname, hsize_t n, hbool_t us ret = (herr_t)H5Aget_name_by_idx(obj_id, ".", H5_INDEX_CRT_ORDER, H5_ITER_INC, n, tmpname, (size_t)NAME_BUF_SIZE, H5P_DEFAULT); CHECK(ret, FAIL, "H5Aget_name_by_idx"); - if (HDstrcmp(attrname, tmpname)) + if (HDstrcmp(attrname, tmpname) != 0) TestErrPrintf("Line %d: attribute name size wrong!\n", __LINE__); /* Don't test "native" order if there is no creation order index, since @@ -5684,7 +5684,7 @@ attr_info_by_idx_check(hid_t obj_id, const char *attrname, hsize_t n, hbool_t us ret = (herr_t)H5Aget_name_by_idx(obj_id, ".", H5_INDEX_CRT_ORDER, H5_ITER_NATIVE, n, tmpname, (size_t)NAME_BUF_SIZE, H5P_DEFAULT); CHECK(ret, FAIL, "H5Aget_name_by_idx"); - if (HDstrcmp(attrname, tmpname)) + if (HDstrcmp(attrname, tmpname) != 0) TestErrPrintf("Line %d: attribute name size wrong!\n", __LINE__); } /* end if */ @@ -5705,7 +5705,7 @@ attr_info_by_idx_check(hid_t obj_id, const char *attrname, hsize_t n, hbool_t us ret = (herr_t)H5Aget_name_by_idx(obj_id, ".", H5_INDEX_CRT_ORDER, H5_ITER_DEC, (hsize_t)0, tmpname, (size_t)NAME_BUF_SIZE, H5P_DEFAULT); CHECK(ret, FAIL, "H5Aget_name_by_idx"); - if (HDstrcmp(attrname, tmpname)) + if (HDstrcmp(attrname, tmpname) != 0) TestErrPrintf("Line %d: attribute name size wrong!\n", __LINE__); /* Verify the information for first attribute, in increasing name order */ @@ -5725,7 +5725,7 @@ attr_info_by_idx_check(hid_t obj_id, const char *attrname, hsize_t n, hbool_t us ret = (herr_t)H5Aget_name_by_idx(obj_id, ".", H5_INDEX_NAME, H5_ITER_INC, n, tmpname, (size_t)NAME_BUF_SIZE, H5P_DEFAULT); CHECK(ret, FAIL, "H5Aget_name_by_idx"); - if (HDstrcmp(attrname, tmpname)) + if (HDstrcmp(attrname, tmpname) != 0) TestErrPrintf("Line %d: attribute name size wrong!\n", __LINE__); /* Don't test "native" order queries on link name order, since there's not @@ -5749,7 +5749,7 @@ attr_info_by_idx_check(hid_t obj_id, const char *attrname, hsize_t n, hbool_t us ret = (herr_t)H5Aget_name_by_idx(obj_id, ".", H5_INDEX_NAME, H5_ITER_DEC, (hsize_t)0, tmpname, (size_t)NAME_BUF_SIZE, H5P_DEFAULT); CHECK(ret, FAIL, "H5Aget_name_by_idx"); - if (HDstrcmp(attrname, tmpname)) + if (HDstrcmp(attrname, tmpname) != 0) TestErrPrintf("Line %d: attribute name size wrong!\n", __LINE__); /* Retrieve current # of errors */ @@ -6782,7 +6782,7 @@ attr_iterate2_cb(hid_t loc_id, const char *attr_name, const H5A_info_t *info, vo /* Verify name of link */ HDsprintf(attrname, "attr %02u", (unsigned)my_info.corder); - if (HDstrcmp(attr_name, attrname)) + if (HDstrcmp(attr_name, attrname) != 0) return (H5_ITER_ERROR); /* Check if we've visited this link before */ diff --git a/test/tfile.c b/test/tfile.c index 9245991c99a..770c7926647 100644 --- a/test/tfile.c +++ b/test/tfile.c @@ -3834,7 +3834,7 @@ test_filespace_info(const char *env_h5_drvr) MESSAGE(5, ("Testing file creation public routines: H5Pget/set_file_space_strategy & " "H5Pget/set_file_space_page_size\n")); - contig_addr_vfd = (hbool_t)(HDstrcmp(env_h5_drvr, "split") && HDstrcmp(env_h5_drvr, "multi")); + contig_addr_vfd = (hbool_t)(HDstrcmp(env_h5_drvr, "split") != 0 && HDstrcmp(env_h5_drvr, "multi") != 0); fapl = h5_fileaccess(); h5_fixname(FILESPACE_NAME[0], fapl, filename, sizeof filename); diff --git a/test/th5s.c b/test/th5s.c index 901d0e3ff6d..4cfe83bf27a 100644 --- a/test/th5s.c +++ b/test/th5s.c @@ -2398,7 +2398,7 @@ test_h5s_compound_scalar_read(void) ret = H5Dread(dataset, type, H5S_ALL, H5S_ALL, H5P_DEFAULT, &rdata); CHECK(ret, FAIL, "H5Dread"); - if (HDmemcmp(&space4_data, &rdata, sizeof(struct space4_struct))) { + if (HDmemcmp(&space4_data, &rdata, sizeof(struct space4_struct)) != 0) { HDprintf("scalar data different: space4_data.c1=%c, read_data4.c1=%c\n", space4_data.c1, rdata.c1); HDprintf("scalar data different: space4_data.u=%u, read_data4.u=%u\n", space4_data.u, rdata.u); HDprintf("scalar data different: space4_data.f=%f, read_data4.f=%f\n", (double)space4_data.f, diff --git a/test/titerate.c b/test/titerate.c index ca36d42b5e6..a5d9e62115f 100644 --- a/test/titerate.c +++ b/test/titerate.c @@ -565,7 +565,7 @@ liter_cb2(hid_t loc_id, const char *name, const H5L_info2_t H5_ATTR_UNUSED *link H5O_info2_t oinfo; herr_t ret; /* Generic return value */ - if (HDstrcmp(name, test_info->name)) { + if (HDstrcmp(name, test_info->name) != 0) { TestErrPrintf("name = '%s', test_info = '%s'\n", name, test_info->name); return (H5_ITER_ERROR); } /* end if */ diff --git a/test/tmisc.c b/test/tmisc.c index 7b88ca2c5c1..3a70c23fbfe 100644 --- a/test/tmisc.c +++ b/test/tmisc.c @@ -2083,11 +2083,11 @@ test_misc12(void) CHECK(ret, FAIL, "H5Dread"); for (i = 0; i < MISC12_SPACE1_DIM1; i++) - if (HDstrcmp(wdata[i], rdata[i])) + if (HDstrcmp(wdata[i], rdata[i]) != 0) TestErrPrintf("Error on line %d: wdata[%d]=%s, rdata[%d]=%s\n", __LINE__, i, wdata[i], i, rdata[i]); for (; i < (MISC12_SPACE1_DIM1 + MISC12_APPEND_SIZE); i++) - if (HDstrcmp(wdata1[i - MISC12_SPACE1_DIM1], rdata[i])) + if (HDstrcmp(wdata1[i - MISC12_SPACE1_DIM1], rdata[i]) != 0) TestErrPrintf("Error on line %d: wdata1[%d]=%s, rdata[%d]=%s\n", __LINE__, i - MISC12_SPACE1_DIM1, wdata1[i - MISC12_SPACE1_DIM1], i, rdata[i]); diff --git a/test/tselect.c b/test/tselect.c index c5d779f80f3..e3b3f540dee 100644 --- a/test/tselect.c +++ b/test/tselect.c @@ -1515,7 +1515,7 @@ test_select_hyper_contig(hid_t dset_type, hid_t xfer_plist) CHECK(ret, FAIL, "H5Dread"); /* Compare data read with data written out */ - if (HDmemcmp(rbuf, wbuf, sizeof(uint16_t) * 30 * 12)) + if (HDmemcmp(rbuf, wbuf, sizeof(uint16_t) * 30 * 12) != 0) TestErrPrintf("hyperslab values don't match! Line=%d\n", __LINE__); /* Close memory dataspace */ @@ -1658,7 +1658,7 @@ test_select_hyper_contig2(hid_t dset_type, hid_t xfer_plist) CHECK(ret, FAIL, "H5Dread"); /* Compare data read with data written out */ - if (HDmemcmp(rbuf, wbuf, sizeof(uint16_t) * 2 * SPACE8_DIM3 * SPACE8_DIM2 * SPACE8_DIM1)) + if (HDmemcmp(rbuf, wbuf, sizeof(uint16_t) * 2 * SPACE8_DIM3 * SPACE8_DIM2 * SPACE8_DIM1) != 0) TestErrPrintf("Error: hyperslab values don't match!\n"); /* Close memory dataspace */ @@ -3765,7 +3765,7 @@ test_select_hyper_copy(void) CHECK(ret, FAIL, "H5Dread"); /* Compare data read with data written out */ - if (HDmemcmp(rbuf, rbuf2, sizeof(uint16_t) * SPACE3_DIM1 * SPACE3_DIM2)) + if (HDmemcmp(rbuf, rbuf2, sizeof(uint16_t) * SPACE3_DIM1 * SPACE3_DIM2) != 0) TestErrPrintf("hyperslab values don't match! Line=%d\n", __LINE__); /* Close memory dataspace */ @@ -3978,7 +3978,7 @@ test_select_point_copy(void) CHECK(ret, FAIL, "H5Dread"); /* Compare data read with data written out */ - if (HDmemcmp(rbuf, rbuf2, sizeof(uint16_t) * SPACE3_DIM1 * SPACE3_DIM2)) + if (HDmemcmp(rbuf, rbuf2, sizeof(uint16_t) * SPACE3_DIM1 * SPACE3_DIM2) != 0) TestErrPrintf("point values don't match!\n"); /* Close memory dataspace */ @@ -14220,18 +14220,18 @@ test_hyper_unlim_check(hid_t sid, hsize_t *dims, hssize_t enpoints, hssize_t enb /* Verify blocklist */ if (nblocks == (hssize_t)1) { - if (HDmemcmp(blocklist, eblock1, 6 * sizeof(eblock1[0]))) + if (HDmemcmp(blocklist, eblock1, 6 * sizeof(eblock1[0])) != 0) ERROR("H5Sget_select_hyper_blocklist"); } /* end if */ else { HDassert(nblocks == (hssize_t)2); - if (HDmemcmp(blocklist, eblock1, 6 * sizeof(eblock1[0]))) { - if (HDmemcmp(blocklist, eblock2, 6 * sizeof(eblock2[0]))) + if (HDmemcmp(blocklist, eblock1, 6 * sizeof(eblock1[0])) != 0) { + if (HDmemcmp(blocklist, eblock2, 6 * sizeof(eblock2[0])) != 0) ERROR("H5Sget_select_hyper_blocklist"); - if (HDmemcmp(&blocklist[6], eblock1, 6 * sizeof(eblock1[0]))) + if (HDmemcmp(&blocklist[6], eblock1, 6 * sizeof(eblock1[0])) != 0) ERROR("H5Sget_select_hyper_blocklist"); } /* end if */ - else if (HDmemcmp(&blocklist[6], eblock2, 6 * sizeof(eblock2[0]))) + else if (HDmemcmp(&blocklist[6], eblock2, 6 * sizeof(eblock2[0])) != 0) ERROR("H5Sget_select_hyper_blocklist"); } /* end else */ } /* end if */ diff --git a/test/ttst.c b/test/ttst.c index 53aab5e650a..07f118cf28b 100644 --- a/test/ttst.c +++ b/test/ttst.c @@ -204,14 +204,14 @@ test_tst_insert(void) found = H5ST_find(tree, uniq_words[u]); CHECK_PTR(found, "H5ST_find"); - if (HDstrcmp((const char *)found->eqkid, uniq_words[u])) + if (HDstrcmp((const char *)found->eqkid, uniq_words[u]) != 0) TestErrPrintf("%d: TST node values don't match!, found->eqkid=%s, uniq_words[%u]=%s\n", __LINE__, (char *)found->eqkid, (unsigned)u, uniq_words[u]); obj = H5ST_locate(tree, uniq_words[u]); CHECK_PTR(obj, "H5ST_locate"); - if (HDstrcmp((const char *)obj, uniq_words[u])) + if (HDstrcmp((const char *)obj, uniq_words[u]) != 0) TestErrPrintf("%d: TST objects don't match!, obj=%s, uniq_words[%u]=%s\n", __LINE__, (char *)obj, (unsigned)u, uniq_words[u]); } /* end for */ @@ -262,7 +262,7 @@ test_tst_iterate(void) u = 0; do { /* Check that the strings in the TST are in the correct order */ - if (HDstrcmp((const char *)found->eqkid, sort_uniq_words[u])) + if (HDstrcmp((const char *)found->eqkid, sort_uniq_words[u]) != 0) TestErrPrintf("%d: TST node values don't match!, found->eqkid=%s, sort_uniq_words[%u]=%s\n", __LINE__, (char *)found->eqkid, (unsigned)u, sort_uniq_words[u]); @@ -311,7 +311,7 @@ test_tst_remove(void) CHECK_PTR(obj, "H5ST_remove"); /* Check that the correct string was removed from TST */ - if (HDstrcmp((const char *)obj, rand_uniq_words[u])) + if (HDstrcmp((const char *)obj, rand_uniq_words[u]) != 0) TestErrPrintf("%d: TST node values don't match!, obj=%s, rand_uniq_words[%u]=%s\n", __LINE__, (char *)obj, (unsigned)u, rand_uniq_words[u]); @@ -333,7 +333,7 @@ test_tst_remove(void) CHECK_PTR(found, "H5ST_find"); /* Check that the correct object will be removed from TST */ - if (HDstrcmp((const char *)found->eqkid, rand_uniq_words[u])) + if (HDstrcmp((const char *)found->eqkid, rand_uniq_words[u]) != 0) TestErrPrintf("%d: TST node values don't match!, found->eqkid=%s, rand_uniq_words[%u]=%s\n", __LINE__, (char *)found->eqkid, (unsigned)u, rand_uniq_words[u]); diff --git a/test/tvlstr.c b/test/tvlstr.c index 0503e6248c6..7e47c7b6140 100644 --- a/test/tvlstr.c +++ b/test/tvlstr.c @@ -773,7 +773,7 @@ read_scalar_dset(hid_t file, hid_t type, hid_t space, char *name, char *data) ret = H5Dclose(dset); CHECK(ret, FAIL, "H5Dclose"); - if (HDstrcmp(data, data_read)) + if (HDstrcmp(data, data_read) != 0) TestErrPrintf("Expected %s for dataset %s but read %s\n", data, name, data_read); ret = H5Treclaim(type, space, H5P_DEFAULT, &data_read); diff --git a/test/tvltypes.c b/test/tvltypes.c index 8e2ab4a71e4..e31c65feb92 100644 --- a/test/tvltypes.c +++ b/test/tvltypes.c @@ -1370,7 +1370,7 @@ test_vltypes_compound_vlstr(void) for (t1 = (s2 *)(wdata[i].v.p), t2 = (s2 *)(rdata[i].v.p), j = 0; j < rdata[i].v.len; j++, t1++, t2++) { - if (HDstrcmp(t1->string, t2->string)) { + if (HDstrcmp(t1->string, t2->string) != 0) { TestErrPrintf("VL data values don't match!, t1->string=%s, t2->string=%s\n", t1->string, t2->string); continue; @@ -1431,7 +1431,7 @@ test_vltypes_compound_vlstr(void) for (t1 = (s2 *)(wdata2[i].v.p), t2 = (s2 *)(rdata2[i].v.p), j = 0; j < rdata2[i].v.len; j++, t1++, t2++) { - if (HDstrcmp(t1->string, t2->string)) { + if (HDstrcmp(t1->string, t2->string) != 0) { TestErrPrintf("VL data values don't match!, t1->string=%s, t2->string=%s\n", t1->string, t2->string); continue; @@ -2804,10 +2804,10 @@ test_vltypes_fill_value(void) /* Compare data read in */ for (i = 0; i < dset_elmts; i++) { - if (HDstrcmp(rbuf[i].str_id, "foobar") || HDstrcmp(rbuf[i].str_name, "") || - rbuf[i].str_desc || HDstrcmp(rbuf[i].str_orig, "\0") || - HDstrcmp(rbuf[i].str_stat, "dead") || HDstrcmp(rbuf[i].str_form, "liquid") || - HDstrcmp(rbuf[i].str_unit, "meter")) { + if (HDstrcmp(rbuf[i].str_id, "foobar") != 0 || HDstrcmp(rbuf[i].str_name, "") != 0 || + rbuf[i].str_desc || HDstrcmp(rbuf[i].str_orig, "\0") != 0 || + HDstrcmp(rbuf[i].str_stat, "dead") != 0 || HDstrcmp(rbuf[i].str_form, "liquid") != 0 || + HDstrcmp(rbuf[i].str_unit, "meter") != 0) { TestErrPrintf("%d: VL data doesn't match!, index(i) = %d\n", __LINE__, (int)i); continue; } /* end if */ @@ -2827,10 +2827,11 @@ test_vltypes_fill_value(void) /* Compare data read in */ for (i = 0; i < dset_elmts; i++) { if ((i % 2) == select_offset[0]) { - if (HDstrcmp(rbuf[i].str_id, "foobar") || HDstrcmp(rbuf[i].str_name, "") || - rbuf[i].str_desc || HDstrcmp(rbuf[i].str_orig, "\0") || - HDstrcmp(rbuf[i].str_stat, "dead") || HDstrcmp(rbuf[i].str_form, "liquid") || - HDstrcmp(rbuf[i].str_unit, "meter")) { + if (HDstrcmp(rbuf[i].str_id, "foobar") != 0 || HDstrcmp(rbuf[i].str_name, "") != 0 || + rbuf[i].str_desc || HDstrcmp(rbuf[i].str_orig, "\0") != 0 || + HDstrcmp(rbuf[i].str_stat, "dead") != 0 || + HDstrcmp(rbuf[i].str_form, "liquid") != 0 || + HDstrcmp(rbuf[i].str_unit, "meter") != 0) { TestErrPrintf("%d: VL data doesn't match!, index(i) = %d\n", __LINE__, (int)i); continue; } /* end if */ @@ -2861,10 +2862,10 @@ test_vltypes_fill_value(void) /* Compare data read in */ for (i = 0; i < dset_elmts; i++) { - if (HDstrcmp(rbuf[i].str_id, "foobar") || HDstrcmp(rbuf[i].str_name, "") || - rbuf[i].str_desc || HDstrcmp(rbuf[i].str_orig, "\0") || - HDstrcmp(rbuf[i].str_stat, "dead") || HDstrcmp(rbuf[i].str_form, "liquid") || - HDstrcmp(rbuf[i].str_unit, "meter")) { + if (HDstrcmp(rbuf[i].str_id, "foobar") != 0 || HDstrcmp(rbuf[i].str_name, "") != 0 || + rbuf[i].str_desc || HDstrcmp(rbuf[i].str_orig, "\0") != 0 || + HDstrcmp(rbuf[i].str_stat, "dead") != 0 || HDstrcmp(rbuf[i].str_form, "liquid") != 0 || + HDstrcmp(rbuf[i].str_unit, "meter") != 0) { TestErrPrintf("%d: VL data doesn't match!, index(i)=%d\n", __LINE__, (int)i); continue; } /* end if */ @@ -2884,10 +2885,11 @@ test_vltypes_fill_value(void) /* Compare data read in */ for (i = 0; i < dset_elmts; i++) { if ((i % 2) == select_offset[0]) { - if (HDstrcmp(rbuf[i].str_id, "foobar") || HDstrcmp(rbuf[i].str_name, "") || - rbuf[i].str_desc || HDstrcmp(rbuf[i].str_orig, "\0") || - HDstrcmp(rbuf[i].str_stat, "dead") || HDstrcmp(rbuf[i].str_form, "liquid") || - HDstrcmp(rbuf[i].str_unit, "meter")) { + if (HDstrcmp(rbuf[i].str_id, "foobar") != 0 || HDstrcmp(rbuf[i].str_name, "") != 0 || + rbuf[i].str_desc || HDstrcmp(rbuf[i].str_orig, "\0") != 0 || + HDstrcmp(rbuf[i].str_stat, "dead") != 0 || + HDstrcmp(rbuf[i].str_form, "liquid") != 0 || + HDstrcmp(rbuf[i].str_unit, "meter") != 0) { TestErrPrintf("%d: VL data doesn't match!, index(i) = %d\n", __LINE__, (int)i); continue; } /* end if */ @@ -3002,21 +3004,22 @@ test_vltypes_fill_value(void) /* Compare data read in */ for (i = 0; i < dset_elmts; i++) { if (i == single_offset[0]) { - if (HDstrcmp(rbuf[i].str_id, wdata.str_id) || rbuf[i].str_name || - HDstrcmp(rbuf[i].str_desc, wdata.str_desc) || - HDstrcmp(rbuf[i].str_orig, wdata.str_orig) || - HDstrcmp(rbuf[i].str_stat, wdata.str_stat) || - HDstrcmp(rbuf[i].str_form, wdata.str_form) || - HDstrcmp(rbuf[i].str_unit, wdata.str_unit)) { + if (HDstrcmp(rbuf[i].str_id, wdata.str_id) != 0 || rbuf[i].str_name || + HDstrcmp(rbuf[i].str_desc, wdata.str_desc) != 0 || + HDstrcmp(rbuf[i].str_orig, wdata.str_orig) != 0 || + HDstrcmp(rbuf[i].str_stat, wdata.str_stat) != 0 || + HDstrcmp(rbuf[i].str_form, wdata.str_form) != 0 || + HDstrcmp(rbuf[i].str_unit, wdata.str_unit) != 0) { TestErrPrintf("%d: VL data doesn't match!, index(i)=%d\n", __LINE__, (int)i); continue; } /* end if */ } /* end if */ else { - if (HDstrcmp(rbuf[i].str_id, "foobar") || HDstrcmp(rbuf[i].str_name, "") || - rbuf[i].str_desc || HDstrcmp(rbuf[i].str_orig, "\0") || - HDstrcmp(rbuf[i].str_stat, "dead") || HDstrcmp(rbuf[i].str_form, "liquid") || - HDstrcmp(rbuf[i].str_unit, "meter")) { + if (HDstrcmp(rbuf[i].str_id, "foobar") != 0 || HDstrcmp(rbuf[i].str_name, "") != 0 || + rbuf[i].str_desc || HDstrcmp(rbuf[i].str_orig, "\0") != 0 || + HDstrcmp(rbuf[i].str_stat, "dead") != 0 || + HDstrcmp(rbuf[i].str_form, "liquid") != 0 || + HDstrcmp(rbuf[i].str_unit, "meter") != 0) { TestErrPrintf("%d: VL data doesn't match!, index(i)=%d\n", __LINE__, (int)i); continue; } /* end if */ @@ -3037,22 +3040,23 @@ test_vltypes_fill_value(void) /* Compare data read in */ for (i = 0; i < dset_elmts; i++) { if (i == single_offset[0]) { - if (HDstrcmp(rbuf[i].str_id, wdata.str_id) || rbuf[i].str_name || - HDstrcmp(rbuf[i].str_desc, wdata.str_desc) || - HDstrcmp(rbuf[i].str_orig, wdata.str_orig) || - HDstrcmp(rbuf[i].str_stat, wdata.str_stat) || - HDstrcmp(rbuf[i].str_form, wdata.str_form) || - HDstrcmp(rbuf[i].str_unit, wdata.str_unit)) { + if (HDstrcmp(rbuf[i].str_id, wdata.str_id) != 0 || rbuf[i].str_name || + HDstrcmp(rbuf[i].str_desc, wdata.str_desc) != 0 || + HDstrcmp(rbuf[i].str_orig, wdata.str_orig) != 0 || + HDstrcmp(rbuf[i].str_stat, wdata.str_stat) != 0 || + HDstrcmp(rbuf[i].str_form, wdata.str_form) != 0 || + HDstrcmp(rbuf[i].str_unit, wdata.str_unit) != 0) { TestErrPrintf("%d: VL data doesn't match!, index(i)=%d\n", __LINE__, (int)i); continue; } /* end if */ } /* end if */ else { if ((i % 2) == select_offset[0]) { - if (HDstrcmp(rbuf[i].str_id, "foobar") || HDstrcmp(rbuf[i].str_name, "") || - rbuf[i].str_desc || HDstrcmp(rbuf[i].str_orig, "\0") || - HDstrcmp(rbuf[i].str_stat, "dead") || HDstrcmp(rbuf[i].str_form, "liquid") || - HDstrcmp(rbuf[i].str_unit, "meter")) { + if (HDstrcmp(rbuf[i].str_id, "foobar") != 0 || HDstrcmp(rbuf[i].str_name, "") != 0 || + rbuf[i].str_desc || HDstrcmp(rbuf[i].str_orig, "\0") != 0 || + HDstrcmp(rbuf[i].str_stat, "dead") != 0 || + HDstrcmp(rbuf[i].str_form, "liquid") != 0 || + HDstrcmp(rbuf[i].str_unit, "meter") != 0) { TestErrPrintf("%d: VL data doesn't match!, index(i) = %d\n", __LINE__, (int)i); continue; } /* end if */ @@ -3088,21 +3092,22 @@ test_vltypes_fill_value(void) /* Compare data read in */ for (i = 0; i < dset_elmts; i++) { if (i == single_offset[0]) { - if (HDstrcmp(rbuf[i].str_id, wdata.str_id) || rbuf[i].str_name || - HDstrcmp(rbuf[i].str_desc, wdata.str_desc) || - HDstrcmp(rbuf[i].str_orig, wdata.str_orig) || - HDstrcmp(rbuf[i].str_stat, wdata.str_stat) || - HDstrcmp(rbuf[i].str_form, wdata.str_form) || - HDstrcmp(rbuf[i].str_unit, wdata.str_unit)) { + if (HDstrcmp(rbuf[i].str_id, wdata.str_id) != 0 || rbuf[i].str_name || + HDstrcmp(rbuf[i].str_desc, wdata.str_desc) != 0 || + HDstrcmp(rbuf[i].str_orig, wdata.str_orig) != 0 || + HDstrcmp(rbuf[i].str_stat, wdata.str_stat) != 0 || + HDstrcmp(rbuf[i].str_form, wdata.str_form) != 0 || + HDstrcmp(rbuf[i].str_unit, wdata.str_unit) != 0) { TestErrPrintf("%d: VL data doesn't match!, index(i)=%d\n", __LINE__, (int)i); continue; } /* end if */ } /* end if */ else { - if (HDstrcmp(rbuf[i].str_id, "foobar") || HDstrcmp(rbuf[i].str_name, "") || - rbuf[i].str_desc || HDstrcmp(rbuf[i].str_orig, "\0") || - HDstrcmp(rbuf[i].str_stat, "dead") || HDstrcmp(rbuf[i].str_form, "liquid") || - HDstrcmp(rbuf[i].str_unit, "meter")) { + if (HDstrcmp(rbuf[i].str_id, "foobar") != 0 || HDstrcmp(rbuf[i].str_name, "") != 0 || + rbuf[i].str_desc || HDstrcmp(rbuf[i].str_orig, "\0") != 0 || + HDstrcmp(rbuf[i].str_stat, "dead") != 0 || + HDstrcmp(rbuf[i].str_form, "liquid") != 0 || + HDstrcmp(rbuf[i].str_unit, "meter") != 0) { TestErrPrintf("%d: VL data doesn't match!, index(i)=%d\n", __LINE__, (int)i); continue; } /* end if */ @@ -3123,22 +3128,23 @@ test_vltypes_fill_value(void) /* Compare data read in */ for (i = 0; i < dset_elmts; i++) { if (i == single_offset[0]) { - if (HDstrcmp(rbuf[i].str_id, wdata.str_id) || rbuf[i].str_name || - HDstrcmp(rbuf[i].str_desc, wdata.str_desc) || - HDstrcmp(rbuf[i].str_orig, wdata.str_orig) || - HDstrcmp(rbuf[i].str_stat, wdata.str_stat) || - HDstrcmp(rbuf[i].str_form, wdata.str_form) || - HDstrcmp(rbuf[i].str_unit, wdata.str_unit)) { + if (HDstrcmp(rbuf[i].str_id, wdata.str_id) != 0 || rbuf[i].str_name || + HDstrcmp(rbuf[i].str_desc, wdata.str_desc) != 0 || + HDstrcmp(rbuf[i].str_orig, wdata.str_orig) != 0 || + HDstrcmp(rbuf[i].str_stat, wdata.str_stat) != 0 || + HDstrcmp(rbuf[i].str_form, wdata.str_form) != 0 || + HDstrcmp(rbuf[i].str_unit, wdata.str_unit) != 0) { TestErrPrintf("%d: VL data doesn't match!, index(i)=%d\n", __LINE__, (int)i); continue; } /* end if */ } /* end if */ else { if ((i % 2) == select_offset[0]) { - if (HDstrcmp(rbuf[i].str_id, "foobar") || HDstrcmp(rbuf[i].str_name, "") || - rbuf[i].str_desc || HDstrcmp(rbuf[i].str_orig, "\0") || - HDstrcmp(rbuf[i].str_stat, "dead") || HDstrcmp(rbuf[i].str_form, "liquid") || - HDstrcmp(rbuf[i].str_unit, "meter")) { + if (HDstrcmp(rbuf[i].str_id, "foobar") != 0 || HDstrcmp(rbuf[i].str_name, "") != 0 || + rbuf[i].str_desc || HDstrcmp(rbuf[i].str_orig, "\0") != 0 || + HDstrcmp(rbuf[i].str_stat, "dead") != 0 || + HDstrcmp(rbuf[i].str_form, "liquid") != 0 || + HDstrcmp(rbuf[i].str_unit, "meter") != 0) { TestErrPrintf("%d: VL data doesn't match!, index(i) = %d\n", __LINE__, (int)i); continue; } /* end if */ diff --git a/test/unlink.c b/test/unlink.c index 3357e1ccf82..c58e3ec5af3 100644 --- a/test/unlink.c +++ b/test/unlink.c @@ -510,7 +510,7 @@ check_new_move(hid_t fapl) /* Check soft links */ if (H5Lget_val(file, "group2/soft", linkval, sizeof(linkval), H5P_DEFAULT) < 0) FAIL_STACK_ERROR - if (HDstrcmp(linkval, "/group1/group_move")) + if (HDstrcmp(linkval, "/group1/group_move") != 0) FAIL_PUTS_ERROR(" Soft link test failed. Wrong link value") /* Cleanup */ diff --git a/test/vfd.c b/test/vfd.c index 19b119ebf00..710fda4b782 100644 --- a/test/vfd.c +++ b/test/vfd.c @@ -2304,7 +2304,7 @@ compare_splitter_config_info(hid_t fapl_id, H5FD_splitter_vfd_config_t *info) } } if ((HDstrlen(info->wo_path) != HDstrlen(fetched_info->wo_path)) || - HDstrncmp(info->wo_path, fetched_info->wo_path, H5FD_SPLITTER_PATH_MAX)) { + HDstrncmp(info->wo_path, fetched_info->wo_path, H5FD_SPLITTER_PATH_MAX) != 0) { HDfprintf(stderr, "MISMATCH: '%s' :: '%s'\n", info->wo_path, fetched_info->wo_path); HEXPRINT(H5FD_SPLITTER_PATH_MAX, info->wo_path); HEXPRINT(H5FD_SPLITTER_PATH_MAX, fetched_info->wo_path); diff --git a/test/vol.c b/test/vol.c index 5c0fb1fdb36..d3290d7dc70 100644 --- a/test/vol.c +++ b/test/vol.c @@ -398,8 +398,8 @@ test_basic_file_operation(const char *env_h5_drvr) TEST_ERROR; /* Can't compare VFD properties for split / multi / family VFDs */ - if ((hbool_t)(HDstrcmp(env_h5_drvr, "split") && HDstrcmp(env_h5_drvr, "multi") && - HDstrcmp(env_h5_drvr, "family"))) { + if ((hbool_t)(HDstrcmp(env_h5_drvr, "split") != 0 && HDstrcmp(env_h5_drvr, "multi") != 0 && + HDstrcmp(env_h5_drvr, "family") != 0)) { /* H5Fget_access_plist */ if ((fapl_id2 = H5Fget_access_plist(fid)) < 0) TEST_ERROR; @@ -420,8 +420,8 @@ test_basic_file_operation(const char *env_h5_drvr) TEST_ERROR; /* Can't retrieve VFD handle for split / multi / family VFDs */ - if ((hbool_t)(HDstrcmp(env_h5_drvr, "split") && HDstrcmp(env_h5_drvr, "multi") && - HDstrcmp(env_h5_drvr, "family"))) { + if ((hbool_t)(HDstrcmp(env_h5_drvr, "split") != 0 && HDstrcmp(env_h5_drvr, "multi") != 0 && + HDstrcmp(env_h5_drvr, "family") != 0)) { /* H5Fget_vfd_handle */ if (H5Fget_vfd_handle(fid, H5P_DEFAULT, &os_file_handle) < 0) TEST_ERROR; @@ -460,8 +460,8 @@ test_basic_file_operation(const char *env_h5_drvr) TEST_ERROR; /* Can't compare VFD properties for split / multi / family VFDs */ - if ((hbool_t)(HDstrcmp(env_h5_drvr, "split") && HDstrcmp(env_h5_drvr, "multi") && - HDstrcmp(env_h5_drvr, "family"))) { + if ((hbool_t)(HDstrcmp(env_h5_drvr, "split") != 0 && HDstrcmp(env_h5_drvr, "multi") != 0 && + HDstrcmp(env_h5_drvr, "family") != 0)) { /* H5Fget_access_plist */ if ((fapl_id2 = H5Fget_access_plist(fid)) < 0) TEST_ERROR; @@ -475,8 +475,8 @@ test_basic_file_operation(const char *env_h5_drvr) TEST_ERROR; /* Can't compare VFD properties for split / multi / family VFDs */ - if ((hbool_t)(HDstrcmp(env_h5_drvr, "split") && HDstrcmp(env_h5_drvr, "multi") && - HDstrcmp(env_h5_drvr, "family"))) { + if ((hbool_t)(HDstrcmp(env_h5_drvr, "split") != 0 && HDstrcmp(env_h5_drvr, "multi") != 0 && + HDstrcmp(env_h5_drvr, "family") != 0)) { /* H5Fget_access_plist */ if ((fapl_id2 = H5Fget_access_plist(fid_reopen)) < 0) TEST_ERROR; diff --git a/tools/lib/h5diff.c b/tools/lib/h5diff.c index 19a19b09c92..57cfaf2d248 100644 --- a/tools/lib/h5diff.c +++ b/tools/lib/h5diff.c @@ -687,7 +687,7 @@ h5diff(const char *fname1, const char *fname2, const char *objname1, const char /* if any object is specified */ if (objname1) { /* make the given object1 fullpath, start with "/" */ - if (HDstrncmp(objname1, "/", 1)) { + if (HDstrncmp(objname1, "/", 1) != 0) { #ifdef H5_HAVE_ASPRINTF /* Use the asprintf() routine, since it does what we're trying to do below */ if (HDasprintf(&obj1fullname, "/%s", objname1) < 0) @@ -706,7 +706,7 @@ h5diff(const char *fname1, const char *fname2, const char *objname1, const char H5TOOLS_DEBUG("obj1fullname = %s", obj1fullname); /* make the given object2 fullpath, start with "/" */ - if (HDstrncmp(objname2, "/", 1)) { + if (HDstrncmp(objname2, "/", 1) != 0) { #ifdef H5_HAVE_ASPRINTF /* Use the asprintf() routine, since it does what we're trying to do below */ if (HDasprintf(&obj2fullname, "/%s", objname2) < 0) @@ -1013,7 +1013,7 @@ h5diff(const char *fname1, const char *fname2, const char *objname1, const char parallel_print("\n"); /* if given objects is group under root */ - if (HDstrcmp(obj1fullname, "/") || HDstrcmp(obj2fullname, "/")) + if (HDstrcmp(obj1fullname, "/") != 0 || HDstrcmp(obj2fullname, "/") != 0) parallel_print("group1 group2\n"); else parallel_print("file1 file2\n"); @@ -1115,9 +1115,9 @@ diff_match(hid_t file1_id, const char *grp1, trav_info_t *info1, hid_t file2_id, * if not root, prepare object name to be pre-appended to group path to * make full path */ - if (HDstrcmp(grp1, "/")) + if (HDstrcmp(grp1, "/") != 0) grp1_path = grp1; - if (HDstrcmp(grp2, "/")) + if (HDstrcmp(grp2, "/") != 0) grp2_path = grp2; /*------------------------------------------------------------------------- diff --git a/tools/lib/h5tools.c b/tools/lib/h5tools.c index 4d19f1f4b20..ab868db60f3 100644 --- a/tools/lib/h5tools.c +++ b/tools/lib/h5tools.c @@ -2221,12 +2221,12 @@ h5tools_is_obj_same(hid_t loc_id1, const char *name1, hid_t loc_id2, const char H5O_info2_t oinfo1, oinfo2; hbool_t ret_val = FALSE; - if (name1 && HDstrcmp(name1, ".")) + if (name1 && HDstrcmp(name1, ".") != 0) H5Oget_info_by_name3(loc_id1, name1, &oinfo1, H5O_INFO_BASIC, H5P_DEFAULT); else H5Oget_info3(loc_id1, &oinfo1, H5O_INFO_BASIC); - if (name2 && HDstrcmp(name2, ".")) + if (name2 && HDstrcmp(name2, ".") != 0) H5Oget_info_by_name3(loc_id2, name2, &oinfo2, H5O_INFO_BASIC, H5P_DEFAULT); else H5Oget_info3(loc_id2, &oinfo2, H5O_INFO_BASIC); diff --git a/tools/lib/h5tools_ref.c b/tools/lib/h5tools_ref.c index 46434667a3a..50f283dc6eb 100644 --- a/tools/lib/h5tools_ref.c +++ b/tools/lib/h5tools_ref.c @@ -200,7 +200,7 @@ ref_path_table_lookup(const char *thepath, H5O_token_t *token) if ((thepath == NULL) || (HDstrlen(thepath) == 0)) return -1; /* Allow lookups on the root group, even though it doesn't have any link info */ - if (HDstrcmp(thepath, "/")) { + if (HDstrcmp(thepath, "/") != 0) { H5L_info2_t li; /* Check for external link first, so we don't return the OID of an object in another file */ diff --git a/tools/lib/h5tools_str.c b/tools/lib/h5tools_str.c index 762e8708077..6bb1928183f 100644 --- a/tools/lib/h5tools_str.c +++ b/tools/lib/h5tools_str.c @@ -142,7 +142,7 @@ h5tools_str_append(h5tools_str_t *str /*in,out*/, const char *fmt, ...) /* failure, such as bad format */ return NULL; - if ((size_t)nchars >= avail || (0 == nchars && (HDstrcmp(fmt, "%s")))) { + if ((size_t)nchars >= avail || (0 == nchars && (HDstrcmp(fmt, "%s") != 0))) { /* Truncation return value as documented by C99, or zero return value with either of the * following conditions, each of which indicates that the proper C99 return value probably * should have been positive when the format string is diff --git a/tools/lib/h5trav.c b/tools/lib/h5trav.c index 41dcd6b4d74..d0c299f38e8 100644 --- a/tools/lib/h5trav.c +++ b/tools/lib/h5trav.c @@ -357,7 +357,7 @@ trav_fileinfo_add(trav_info_t *info, hid_t loc_id) H5O_info2_t oinfo; size_t idx = info->nused - 1; - if (info->paths[idx].path && HDstrcmp(info->paths[idx].path, ".")) + if (info->paths[idx].path && HDstrcmp(info->paths[idx].path, ".") != 0) H5Oget_info_by_name3(loc_id, info->paths[idx].path, &oinfo, H5O_INFO_BASIC, H5P_DEFAULT); else H5Oget_info3(loc_id, &oinfo, H5O_INFO_BASIC); diff --git a/tools/src/h5dump/h5dump.c b/tools/src/h5dump/h5dump.c index 66d4d2d2498..c9c8185ad7d 100644 --- a/tools/src/h5dump/h5dump.c +++ b/tools/src/h5dump/h5dump.c @@ -1529,7 +1529,7 @@ main(int argc, const char *argv[]) } } else { - if (useschema_g && HDstrcmp(xmlnsprefix, "")) { + if (useschema_g && HDstrcmp(xmlnsprefix, "") != 0) { error_msg( "Cannot set Schema URL for a qualified namespace--use -X or -U option with -D \n"); h5tools_setstatus(EXIT_FAILURE); diff --git a/tools/src/h5import/h5import.c b/tools/src/h5import/h5import.c index 2dc02bca640..2a65591a61d 100644 --- a/tools/src/h5import/h5import.c +++ b/tools/src/h5import/h5import.c @@ -1570,7 +1570,7 @@ processConfigurationFile(char *infile, struct Input *in) #ifdef H5DEBUGIMPORT HDprintf("h5dump DATATYPE STRING STRSIZE %s found\n", temp); #endif - if (HDstrcmp("H5T_VARIABLE;", temp)) { + if (HDstrcmp("H5T_VARIABLE;", temp) != 0) { char *more = temp; ival = (int)HDstrtol(more, &more, 10); if (getInputSize(in, ival) == -1) { @@ -1896,7 +1896,7 @@ processConfigurationFile(char *infile, struct Input *in) HDprintf("h5dump STORAGE_LAYOUT CHUNKED SIZE %d found\n", ival); #endif } - while (HDstrcmp("}", temp)) { + while (HDstrcmp("}", temp) != 0) { if (fscanf(strm, "%254s", temp) != 1) { /* end bracket */ (void)HDfprintf(stderr, "%s", err18); goto error; diff --git a/tools/src/h5ls/h5ls.c b/tools/src/h5ls/h5ls.c index 06c90d0e2cd..456be8a1399 100644 --- a/tools/src/h5ls/h5ls.c +++ b/tools/src/h5ls/h5ls.c @@ -3088,7 +3088,7 @@ main(int argc, const char *argv[]) symlink_list.objs = NULL; /* Check for root group as object name */ - if (HDstrcmp(oname, root_name)) { + if (HDstrcmp(oname, root_name) != 0) { /* Check the type of link given */ if (H5Lget_info2(file_id, oname, &li, H5P_DEFAULT) < 0) { hsize_t curr_pos = 0; /* total data element position */ diff --git a/tools/src/h5repack/h5repack_main.c b/tools/src/h5repack/h5repack_main.c index c753e90dc20..1f1b8213ed0 100644 --- a/tools/src/h5repack/h5repack_main.c +++ b/tools/src/h5repack/h5repack_main.c @@ -367,7 +367,7 @@ read_info(const char *filename, pack_opt_t *options) break; /* Info indicator must be for layout or filter */ - if (HDstrcmp(stype, "-l") && HDstrcmp(stype, "-f")) { + if (HDstrcmp(stype, "-l") != 0 && HDstrcmp(stype, "-f") != 0) { error_msg("bad file format for %s", filename); h5tools_setstatus(EXIT_FAILURE); ret_value = EXIT_FAILURE; diff --git a/tools/src/h5repack/h5repack_opttable.c b/tools/src/h5repack/h5repack_opttable.c index 2fd39fd75b0..167506fa0ab 100644 --- a/tools/src/h5repack/h5repack_opttable.c +++ b/tools/src/h5repack/h5repack_opttable.c @@ -339,7 +339,7 @@ options_get_object(const char *path, pack_opttbl_t *table) for (i = 0; i < table->nelems; i++) { /* make full path (start with "/") to compare correctly */ - if (HDstrncmp(table->objs[i].path, "/", 1)) { + if (HDstrncmp(table->objs[i].path, "/", 1) != 0) { HDstrcpy(tbl_path, "/"); HDstrcat(tbl_path, table->objs[i].path); } From 80d2a1d92649e94afcdf9c6e129f930c3e836b7b Mon Sep 17 00:00:00 2001 From: Larry Knox Date: Thu, 11 Mar 2021 09:16:19 -0600 Subject: [PATCH 16/21] Remove 2 functions incorrectly merged from develop in a cherry-pick merge of PR #451. --- src/H5A.c | 78 ------------------------------------------------------- 1 file changed, 78 deletions(-) diff --git a/src/H5A.c b/src/H5A.c index ef7dbc86208..3d20f83701b 100644 --- a/src/H5A.c +++ b/src/H5A.c @@ -1140,84 +1140,6 @@ H5Aget_info_by_idx(hid_t loc_id, const char *obj_name, H5_index_t idx_type, H5_i FUNC_LEAVE_API(ret_value) } /* end H5Aget_info_by_idx() */ -/*-------------------------------------------------------------------------- - NAME - H5A__rename_common - PURPOSE - Common helper routine for sync/async attribute rename operations - RETURNS - Non-negative on success/Negative on failure ---------------------------------------------------------------------------*/ -static herr_t -H5A__rename_common(H5VL_object_t *vol_obj, H5VL_loc_params_t *loc_params, const char *old_name, - const char *new_name, void **token_ptr) -{ - herr_t ret_value = SUCCEED; /* Return value */ - - FUNC_ENTER_STATIC - - /* Sanity checks */ - HDassert(vol_obj); - HDassert(loc_params); - HDassert(old_name); - HDassert(new_name); - - /* Avoid thrashing things if the names are the same */ - if (HDstrcmp(old_name, new_name) != 0) - /* Rename the attribute */ - if (H5VL_attr_specific(vol_obj, loc_params, H5VL_ATTR_RENAME, H5P_DATASET_XFER_DEFAULT, token_ptr, - old_name, new_name) < 0) - HGOTO_ERROR(H5E_ATTR, H5E_CANTRENAME, FAIL, "can't rename attribute from '%s' to '%s'", old_name, - new_name) - -done: - FUNC_LEAVE_NOAPI(ret_value) -} /* H5A__rename_common() */ - -/*-------------------------------------------------------------------------- - NAME - H5A__rename_api_common - PURPOSE - Common helper routine for sync/async attribute rename operations - RETURNS - Non-negative on success/Negative on failure ---------------------------------------------------------------------------*/ -static herr_t -H5A__rename_api_common(hid_t loc_id, const char *old_name, const char *new_name, void **token_ptr, - H5VL_object_t **_vol_obj_ptr) -{ - H5VL_object_t * tmp_vol_obj = NULL; /* Object for loc_id */ - H5VL_object_t **vol_obj_ptr = - (_vol_obj_ptr ? _vol_obj_ptr : &tmp_vol_obj); /* Ptr to object ptr for loc_id */ - H5VL_loc_params_t loc_params; /* Location parameters for object access */ - herr_t ret_value = SUCCEED; /* Return value */ - - FUNC_ENTER_STATIC - - /* Check arguments */ - if (H5I_ATTR == H5I_get_type(loc_id)) - HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "location is not valid for an attribute") - if (!old_name) - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "old attribute name cannot be NULL") - if (!*old_name) - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "old attribute name cannot be an empty string") - if (!new_name) - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "new attribute name cannot be NULL") - if (!*new_name) - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "new attribute name cannot be an empty string") - - /* Set up object access arguments */ - if (H5VL_setup_loc_args(loc_id, vol_obj_ptr, &loc_params) < 0) - HGOTO_ERROR(H5E_ATTR, H5E_CANTSET, FAIL, "can't set object access arguments") - - /* Rename the attribute */ - if (H5A__rename_common(*vol_obj_ptr, &loc_params, old_name, new_name, token_ptr) < 0) - HGOTO_ERROR(H5E_ATTR, H5E_CANTRENAME, FAIL, "can't rename attribute") - -done: - FUNC_LEAVE_NOAPI(ret_value) -} /* H5A__rename_api_common() */ - /*------------------------------------------------------------------------- * Function: H5Arename * From bfdc7dfb9549b2a69b7a5df28b26d9c998d9eb6c Mon Sep 17 00:00:00 2001 From: David Young Date: Mon, 15 Mar 2021 08:16:22 -0500 Subject: [PATCH 17/21] Simplified hl parsing (#399) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Stop using global variables to share parse context with the lexer. The lexer uses an unconventional strategy for parsing lexical categories NUMBER (decimal numbers) and STRING (double-quoted strings) that involves sharing the parse context with the lexer using global variables. There are a couple of problems with that. First, the lexer is too complicated for the simple tokenization it performs—it's hard to tell if it is correct. Second, as @seanm points out, the shared global variables spill into the namespace shared by other libraries and application programs—e.g., VTK. * Regenerate source files from *.[yl]. * Replace strndup, which isn't available on Windows, with a custom routine, `trim_quotes`, that produces a copy of its `const char *` argument with leading and trailing double quotes ('"') removed. While I am here, remove the unnecessary statement `BEGIN INITIAL;`, which I should have deleted in a previous commit. * Regenerate .c from .l. * You haven't programmed in C until you have programmed in High-Definition (HD) C. * \#include "H5private.h" for HD* definitions. * Regenerate *.[ch] from *.[yl]. --- hl/src/H5LTanalyze.c | 980 +++++++---------- hl/src/H5LTanalyze.l | 90 +- hl/src/H5LTparse.c | 2422 +++++++++++++++++++++++------------------- hl/src/H5LTparse.h | 174 +-- hl/src/H5LTparse.y | 102 +- 5 files changed, 1879 insertions(+), 1889 deletions(-) diff --git a/hl/src/H5LTanalyze.c b/hl/src/H5LTanalyze.c index 6673f5fed9f..1f23d3b5f42 100644 --- a/hl/src/H5LTanalyze.c +++ b/hl/src/H5LTanalyze.c @@ -10,11 +10,11 @@ #pragma GCC diagnostic ignored "-Wsign-conversion" #pragma GCC diagnostic ignored "-Wstrict-overflow" #pragma GCC diagnostic ignored "-Wstrict-prototypes" -#if !defined (__clang__) +#if !defined (__clang__) #pragma GCC diagnostic ignored "-Wlarger-than=" #pragma GCC diagnostic ignored "-Wsuggest-attribute=const" #pragma GCC diagnostic ignored "-Wsuggest-attribute=pure" -#endif +#endif #pragma GCC diagnostic ignored "-Wswitch-default" #pragma GCC diagnostic ignored "-Wunused-function" #pragma GCC diagnostic ignored "-Wunused-macros" @@ -28,9 +28,9 @@ #elif defined _MSC_VER #pragma warning(push, 1) #endif -#line 2 "hl/src/H5LTanalyze.c" +#line 2 "hl/src//H5LTanalyze.c" -#line 4 "hl/src/H5LTanalyze.c" +#line 4 "hl/src//H5LTanalyze.c" #define YY_INT_ALIGNED short int @@ -58,7 +58,7 @@ #define FLEX_SCANNER #define YY_FLEX_MAJOR_VERSION 2 #define YY_FLEX_MINOR_VERSION 5 -#define YY_FLEX_SUBMINOR_VERSION 35 +#define YY_FLEX_SUBMINOR_VERSION 37 #if YY_FLEX_SUBMINOR_VERSION > 0 #define FLEX_BETA #endif @@ -96,7 +96,6 @@ typedef int16_t flex_int16_t; typedef uint16_t flex_uint16_t; typedef int32_t flex_int32_t; typedef uint32_t flex_uint32_t; -typedef uint64_t flex_uint64_t; #else typedef signed char flex_int8_t; typedef short int flex_int16_t; @@ -104,7 +103,6 @@ typedef int flex_int32_t; typedef unsigned char flex_uint8_t; typedef unsigned short int flex_uint16_t; typedef unsigned int flex_uint32_t; -#endif /* ! C99 */ /* Limits of integral types. */ #ifndef INT8_MIN @@ -135,6 +133,8 @@ typedef unsigned int flex_uint32_t; #define UINT32_MAX (4294967295U) #endif +#endif /* ! C99 */ + #endif /* ! FLEXINT_H */ #ifdef __cplusplus @@ -405,13 +405,13 @@ static void yy_fatal_error (yyconst char msg[] ); */ #define YY_DO_BEFORE_ACTION \ (yytext_ptr) = yy_bp; \ - H5LTyyleng = (yy_size_t) (yy_cp - yy_bp); \ + H5LTyyleng = (size_t) (yy_cp - yy_bp); \ (yy_hold_char) = *yy_cp; \ *yy_cp = '\0'; \ (yy_c_buf_p) = yy_cp; -#define YY_NUM_RULES 66 -#define YY_END_OF_BUFFER 67 +#define YY_NUM_RULES 65 +#define YY_END_OF_BUFFER 66 /* This struct is not used in this scanner, but its presence is necessary. */ struct yy_trans_info @@ -419,120 +419,38 @@ struct yy_trans_info flex_int32_t yy_verify; flex_int32_t yy_nxt; }; -static yyconst flex_int16_t yy_acclist[437] = +static yyconst flex_int16_t yy_accept[276] = { 0, - 64, 64, 64, 64, 67, 66, 64, 66, 64, 65, - 66, 56, 66, 55, 66, 62, 66, 63, 66, 66, - 66, 66, 66, 60, 66, 61, 66, 58, 66, 59, - 66, 57, 66, 57, 64, 66, 57, 64, 65, 66, - 55, 57, 66, 57, 62, 66, 57, 63, 66, 57, - 66, 57, 66, 57, 66, 57, 66, 57, 60, 66, - 57, 61, 66, 57, 58, 66, 57, 59, 66, 64, - 55, 57, 57, 64, 55, 57, 57, 57, 57, 57, - 57, 57, 57, 57, 57, 57, 38, 38, 57, 57, - 57, 57, 57, 57, 39, 39, 57, 57, 57, 57, - - 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, - 37, 57, 57, 57, 57, 57, 57, 57, 57, 57, - 57, 57, 57, 57, 57, 37, 57, 57, 54, 36, - 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, - 57, 57, 57, 57, 54, 57, 36, 57, 45, 49, - 51, 53, 57, 57, 57, 45, 57, 49, 57, 57, - 57, 57, 57, 57, 57, 57, 57, 51, 57, 53, - 57, 50, 50, 57, 57, 57, 57, 57, 57, 57, - 57, 57, 57, 57, 57, 57, 52, 35, 57, 57, - 57, 57, 57, 57, 52, 57, 57, 57, 57, 57, - - 57, 57, 57, 57, 35, 57, 57, 57, 57, 57, - 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, - 57, 57, 57, 57, 57, 57, 57, 57, 57, 48, - 1, 2, 9, 10, 47, 48, 57, 57, 57, 57, - 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, - 57, 57, 57, 57, 57, 1, 57, 2, 57, 57, - 57, 57, 57, 57, 57, 9, 57, 10, 57, 57, - 57, 47, 57, 44, 3, 4, 5, 6, 7, 8, - 11, 12, 13, 14, 15, 16, 57, 44, 57, 57, - 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, - - 57, 57, 57, 57, 57, 57, 57, 3, 57, 4, - 57, 5, 57, 6, 57, 7, 57, 8, 57, 11, - 57, 12, 57, 13, 57, 14, 57, 15, 57, 16, - 57, 57, 57, 57, 43, 46, 28, 29, 30, 31, - 22, 43, 57, 46, 57, 28, 57, 29, 57, 30, - 57, 31, 57, 57, 57, 57, 22, 57, 57, 57, - 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, - 57, 17, 24, 23, 41, 17, 57, 57, 57, 57, - 57, 24, 57, 57, 57, 57, 23, 57, 57, 57, - 57, 41, 57, 57, 57, 32, 26, 18, 20, 19, - - 25, 40, 42, 57, 32, 57, 57, 26, 57, 18, - 57, 20, 57, 19, 57, 57, 25, 57, 57, 40, - 57, 42, 57, 33, 27, 21, 33, 57, 57, 27, - 57, 21, 57, 34, 34, 57 - } ; - -static yyconst flex_int16_t yy_accept[546] = - { 0, - 1, 2, 3, 4, 5, 6, 7, 9, 12, 14, - 16, 18, 20, 21, 22, 23, 24, 26, 28, 30, - 32, 34, 37, 41, 44, 47, 50, 52, 54, 56, - 58, 61, 64, 67, 70, 71, 72, 72, 72, 72, - 72, 72, 73, 75, 77, 78, 79, 80, 81, 82, - 82, 82, 82, 82, 82, 83, 84, 85, 86, 87, - 88, 88, 88, 88, 88, 88, 90, 91, 92, 93, - 94, 95, 96, 96, 96, 96, 96, 96, 96, 96, - 96, 96, 96, 96, 96, 96, 98, 99, 100, 101, - 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, - - 111, 111, 111, 111, 111, 111, 111, 111, 111, 111, - 111, 111, 111, 111, 112, 112, 113, 114, 115, 116, - 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, - 128, 129, 129, 129, 129, 129, 129, 129, 129, 129, - 129, 129, 129, 129, 129, 129, 130, 131, 132, 133, - 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, - 144, 145, 147, 149, 149, 149, 149, 150, 151, 151, - 151, 151, 151, 151, 151, 151, 151, 152, 153, 154, - 155, 156, 158, 160, 161, 162, 163, 164, 165, 166, - 167, 168, 170, 172, 173, 173, 173, 173, 173, 173, - - 173, 173, 173, 173, 173, 173, 173, 175, 176, 177, - 178, 179, 180, 181, 182, 183, 184, 185, 186, 187, - 187, 187, 187, 187, 187, 187, 188, 188, 188, 188, - 188, 188, 188, 188, 188, 189, 189, 189, 189, 190, - 191, 192, 193, 194, 195, 197, 198, 199, 200, 201, - 202, 203, 204, 205, 207, 208, 209, 210, 210, 210, - 210, 210, 210, 210, 210, 210, 210, 210, 210, 210, - 210, 210, 210, 210, 210, 210, 210, 210, 211, 212, - 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, - 223, 224, 225, 226, 227, 228, 229, 230, 231, 231, - - 231, 231, 231, 231, 231, 231, 231, 231, 231, 231, - 231, 231, 231, 231, 231, 231, 231, 232, 233, 233, - 233, 233, 233, 233, 233, 234, 235, 235, 235, 236, - 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, - 248, 249, 250, 251, 252, 253, 254, 255, 256, 258, - 260, 261, 262, 263, 264, 265, 266, 268, 270, 271, - 272, 274, 274, 275, 275, 275, 275, 275, 275, 275, - 275, 275, 275, 275, 275, 275, 275, 275, 275, 275, - 275, 275, 276, 277, 278, 279, 280, 281, 282, 283, - 284, 285, 286, 287, 287, 287, 287, 288, 290, 291, - - 292, 293, 294, 295, 296, 297, 298, 299, 300, 301, - 302, 303, 304, 305, 306, 307, 308, 310, 312, 314, - 316, 318, 320, 322, 324, 326, 328, 330, 332, 333, - 334, 335, 336, 337, 338, 339, 340, 341, 341, 341, - 341, 342, 342, 342, 342, 342, 342, 342, 342, 342, - 342, 342, 342, 342, 342, 344, 346, 348, 350, 352, - 354, 355, 356, 357, 359, 360, 361, 362, 363, 364, - 365, 366, 367, 368, 369, 370, 371, 372, 373, 373, - 373, 373, 373, 374, 374, 374, 374, 375, 375, 375, - 375, 376, 376, 376, 378, 379, 380, 381, 382, 384, - - 385, 386, 387, 389, 390, 391, 392, 394, 395, 396, - 396, 397, 397, 398, 399, 400, 401, 401, 402, 402, - 403, 404, 405, 407, 408, 410, 412, 414, 416, 417, - 419, 420, 422, 424, 425, 425, 426, 427, 429, 430, - 432, 434, 435, 437, 437 + 63, 63, 66, 65, 63, 63, 65, 55, 61, 62, + 65, 65, 65, 65, 59, 60, 57, 58, 63, 0, + 55, 0, 0, 0, 0, 0, 56, 0, 0, 0, + 0, 0, 38, 0, 0, 0, 0, 0, 39, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 37, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 54, 36, 0, 0, 0, 45, 49, 0, + 0, 0, 0, 0, 0, 0, 0, 51, 53, 50, + + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 52, 0, + 0, 0, 0, 0, 0, 0, 0, 35, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 48, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 1, 2, 0, 0, 0, 0, 0, 0, 9, 10, + 0, 0, 47, 0, 44, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + + 0, 0, 0, 3, 4, 5, 6, 7, 8, 11, + 12, 13, 14, 15, 16, 0, 0, 0, 43, 46, + 28, 29, 30, 31, 0, 0, 0, 22, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 17, 0, 0, 0, 0, 24, 0, 0, 0, + 23, 0, 0, 0, 41, 0, 0, 0, 32, 0, + 26, 18, 20, 19, 0, 25, 0, 40, 42, 33, + 0, 27, 21, 34, 0 } ; static yyconst flex_int32_t yy_ec[256] = @@ -576,305 +494,173 @@ static yyconst flex_int32_t yy_meta[42] = 1 } ; -static yyconst flex_int16_t yy_base[547] = +static yyconst flex_int16_t yy_base[278] = { 0, - 0, 0, 41, 0, 610, 611, 81, 83, 611, 0, - 611, 611, 56, 599, 580, 575, 611, 611, 611, 611, - 0, 87, 89, 88, 0, 0, 70, 596, 577, 572, - 0, 0, 0, 0, 101, 0, 584, 567, 569, 571, - 569, 0, 103, 0, 579, 562, 564, 566, 564, 561, - 564, 552, 551, 79, 557, 560, 548, 547, 80, 611, - 566, 97, 87, 569, 560, 0, 563, 117, 90, 566, - 557, 611, 549, 99, 552, 550, 557, 560, 546, 541, - 118, 549, 556, 552, 533, 0, 538, 108, 541, 539, - 546, 549, 535, 530, 126, 538, 545, 541, 522, 527, - - 531, 536, 523, 520, 522, 532, 518, 534, 95, 518, - 528, 510, 524, 611, 525, 513, 517, 522, 509, 506, - 508, 518, 504, 520, 97, 504, 514, 496, 510, 0, - 511, 514, 500, 495, 520, 500, 492, 504, 499, 492, - 481, 106, 496, 492, 498, 611, 611, 501, 487, 482, - 507, 487, 479, 491, 486, 479, 468, 123, 483, 479, - 485, 0, 0, 468, 475, 462, 611, 611, 470, 460, - 464, 464, 126, 470, 126, 480, 611, 611, 459, 466, - 453, 0, 0, 461, 451, 455, 455, 130, 461, 129, - 471, 0, 0, 611, 452, 139, 469, 463, 463, 462, - - 158, 165, 459, 446, 450, 461, 0, 443, 141, 460, - 454, 454, 453, 172, 179, 450, 437, 441, 452, 441, - 435, 433, 438, 150, 424, 611, 451, 454, 451, 151, - 448, 451, 448, 165, 611, 432, 440, 430, 427, 421, - 419, 424, 157, 410, 0, 437, 440, 437, 170, 434, - 437, 434, 172, 0, 418, 426, 416, 421, 421, 417, - 397, 428, 425, 180, 177, 183, 186, 414, 413, 190, - 192, 193, 412, 411, 405, 411, 408, 408, 408, 404, - 384, 415, 412, 201, 196, 199, 206, 401, 400, 211, - 212, 213, 399, 398, 392, 398, 395, 611, 390, 400, - - 380, 215, 217, 388, 382, 384, 381, 220, 223, 225, - 387, 386, 385, 384, 383, 382, 611, 611, 381, 380, - 379, 378, 377, 376, 611, 611, 218, 375, 611, 0, - 370, 380, 360, 227, 236, 368, 362, 364, 361, 235, - 241, 244, 367, 366, 365, 364, 363, 362, 0, 0, - 361, 360, 359, 358, 357, 356, 0, 0, 237, 355, - 0, 350, 611, 366, 352, 351, 350, 349, 352, 333, - 338, 332, 336, 335, 335, 338, 332, 336, 331, 155, - 334, 611, 611, 611, 611, 611, 611, 611, 611, 611, - 611, 611, 611, 340, 335, 325, 329, 0, 345, 331, - - 330, 329, 328, 331, 312, 317, 311, 315, 314, 314, - 317, 311, 315, 310, 168, 313, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 319, 314, - 304, 611, 611, 611, 611, 611, 611, 301, 314, 314, - 611, 295, 301, 305, 310, 294, 308, 290, 294, 294, - 292, 300, 287, 301, 0, 0, 0, 0, 0, 0, - 285, 298, 298, 0, 279, 285, 289, 294, 278, 292, - 274, 278, 278, 276, 284, 271, 285, 611, 275, 266, - 281, 275, 611, 265, 262, 263, 611, 266, 270, 260, - 611, 264, 270, 0, 263, 254, 269, 263, 0, 253, - - 250, 251, 0, 254, 258, 247, 0, 249, 255, 253, - 611, 247, 611, 611, 611, 611, 249, 611, 234, 611, - 611, 245, 0, 233, 0, 0, 0, 0, 234, 0, - 222, 0, 0, 611, 207, 611, 611, 0, 186, 0, - 0, 611, 0, 611, 106, 275 + 0, 0, 304, 305, 40, 42, 0, 0, 305, 305, + 15, 293, 274, 269, 305, 305, 305, 305, 46, 296, + 0, 280, 263, 265, 267, 265, 305, 262, 265, 253, + 252, 22, 305, 271, 39, 20, 274, 265, 305, 257, + 30, 260, 258, 265, 268, 254, 249, 40, 257, 264, + 260, 241, 246, 250, 255, 242, 239, 241, 251, 237, + 253, 42, 237, 247, 229, 243, 305, 244, 247, 233, + 228, 253, 233, 225, 237, 232, 225, 214, 40, 229, + 225, 231, 305, 305, 214, 221, 208, 305, 305, 216, + 206, 210, 210, 44, 216, 45, 226, 305, 305, 305, + + 207, 53, 224, 218, 218, 217, 72, 79, 214, 201, + 205, 216, 205, 199, 197, 202, 81, 188, 305, 215, + 218, 215, 58, 212, 215, 212, 72, 305, 196, 204, + 194, 199, 199, 195, 175, 206, 203, 80, 77, 78, + 83, 192, 191, 90, 92, 93, 190, 189, 183, 189, + 186, 305, 181, 191, 171, 94, 96, 179, 173, 175, + 172, 97, 105, 102, 178, 177, 176, 175, 174, 173, + 305, 305, 172, 171, 170, 169, 168, 167, 305, 305, + 100, 166, 305, 161, 305, 177, 163, 162, 161, 160, + 163, 144, 149, 143, 147, 146, 146, 149, 143, 147, + + 142, 107, 145, 305, 305, 305, 305, 305, 305, 305, + 305, 305, 305, 305, 305, 151, 146, 136, 305, 305, + 305, 305, 305, 305, 133, 146, 146, 305, 127, 133, + 137, 142, 126, 140, 122, 126, 126, 124, 132, 119, + 133, 305, 123, 114, 129, 123, 305, 113, 110, 111, + 305, 114, 118, 108, 305, 111, 112, 110, 305, 99, + 305, 305, 305, 305, 84, 305, 63, 305, 305, 305, + 62, 305, 305, 305, 305, 134, 72 } ; -static yyconst flex_int16_t yy_def[547] = +static yyconst flex_int16_t yy_def[278] = { 0, - 544, 1, 544, 3, 544, 544, 544, 544, 544, 545, - 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, - 546, 546, 546, 546, 546, 546, 546, 546, 546, 546, - 546, 546, 546, 546, 544, 545, 544, 544, 544, 544, - 544, 546, 546, 24, 546, 546, 546, 546, 546, 544, - 544, 544, 544, 544, 546, 546, 546, 546, 546, 544, - 544, 544, 544, 544, 544, 546, 546, 546, 546, 546, - 546, 544, 544, 544, 544, 544, 544, 544, 544, 544, - 544, 544, 544, 544, 544, 546, 546, 546, 546, 546, - 546, 546, 546, 546, 546, 546, 546, 546, 546, 544, - - 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, - 544, 544, 544, 544, 544, 546, 546, 546, 546, 546, - 546, 546, 546, 546, 546, 546, 546, 546, 546, 546, - 546, 544, 544, 544, 544, 544, 544, 544, 544, 544, - 544, 544, 544, 544, 544, 544, 544, 546, 546, 546, - 546, 546, 546, 546, 546, 546, 546, 546, 546, 546, - 546, 546, 546, 544, 544, 544, 544, 544, 544, 544, - 544, 544, 544, 544, 544, 544, 544, 544, 546, 546, - 546, 546, 546, 546, 546, 546, 546, 546, 546, 546, - 546, 546, 546, 544, 544, 544, 544, 544, 544, 544, - - 544, 544, 544, 544, 544, 544, 546, 546, 546, 546, - 546, 546, 546, 546, 546, 546, 546, 546, 546, 544, - 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, - 544, 544, 544, 544, 544, 544, 544, 544, 546, 546, - 546, 546, 546, 546, 546, 546, 546, 546, 546, 546, - 546, 546, 546, 546, 546, 546, 546, 544, 544, 544, - 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, - 544, 544, 544, 544, 544, 544, 544, 546, 546, 546, - 546, 546, 546, 546, 546, 546, 546, 546, 546, 546, - 546, 546, 546, 546, 546, 546, 546, 544, 544, 544, - - 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, - 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, - 544, 544, 544, 544, 544, 544, 544, 544, 544, 546, - 546, 546, 546, 546, 546, 546, 546, 546, 546, 546, - 546, 546, 546, 546, 546, 546, 546, 546, 546, 546, - 546, 546, 546, 546, 546, 546, 546, 546, 546, 546, - 546, 544, 544, 544, 544, 544, 544, 544, 544, 544, - 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, - 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, - 544, 544, 544, 544, 544, 544, 546, 546, 546, 546, - - 546, 546, 546, 546, 546, 546, 546, 546, 546, 546, - 546, 546, 546, 546, 546, 546, 546, 546, 546, 546, - 546, 546, 546, 546, 546, 546, 546, 546, 546, 546, - 546, 544, 544, 544, 544, 544, 544, 544, 544, 544, - 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, - 544, 544, 544, 544, 546, 546, 546, 546, 546, 546, - 546, 546, 546, 546, 546, 546, 546, 546, 546, 546, - 546, 546, 546, 546, 546, 546, 546, 544, 544, 544, - 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, - 544, 544, 544, 546, 546, 546, 546, 546, 546, 546, - - 546, 546, 546, 546, 546, 546, 546, 546, 546, 544, - 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, - 544, 546, 546, 546, 546, 546, 546, 546, 546, 546, - 546, 546, 546, 544, 544, 544, 544, 546, 546, 546, - 546, 544, 546, 0, 544, 544 + 275, 1, 275, 275, 275, 275, 276, 277, 275, 275, + 275, 275, 275, 275, 275, 275, 275, 275, 275, 276, + 277, 275, 275, 275, 275, 275, 275, 275, 275, 275, + 275, 275, 275, 275, 275, 275, 275, 275, 275, 275, + 275, 275, 275, 275, 275, 275, 275, 275, 275, 275, + 275, 275, 275, 275, 275, 275, 275, 275, 275, 275, + 275, 275, 275, 275, 275, 275, 275, 275, 275, 275, + 275, 275, 275, 275, 275, 275, 275, 275, 275, 275, + 275, 275, 275, 275, 275, 275, 275, 275, 275, 275, + 275, 275, 275, 275, 275, 275, 275, 275, 275, 275, + + 275, 275, 275, 275, 275, 275, 275, 275, 275, 275, + 275, 275, 275, 275, 275, 275, 275, 275, 275, 275, + 275, 275, 275, 275, 275, 275, 275, 275, 275, 275, + 275, 275, 275, 275, 275, 275, 275, 275, 275, 275, + 275, 275, 275, 275, 275, 275, 275, 275, 275, 275, + 275, 275, 275, 275, 275, 275, 275, 275, 275, 275, + 275, 275, 275, 275, 275, 275, 275, 275, 275, 275, + 275, 275, 275, 275, 275, 275, 275, 275, 275, 275, + 275, 275, 275, 275, 275, 275, 275, 275, 275, 275, + 275, 275, 275, 275, 275, 275, 275, 275, 275, 275, + + 275, 275, 275, 275, 275, 275, 275, 275, 275, 275, + 275, 275, 275, 275, 275, 275, 275, 275, 275, 275, + 275, 275, 275, 275, 275, 275, 275, 275, 275, 275, + 275, 275, 275, 275, 275, 275, 275, 275, 275, 275, + 275, 275, 275, 275, 275, 275, 275, 275, 275, 275, + 275, 275, 275, 275, 275, 275, 275, 275, 275, 275, + 275, 275, 275, 275, 275, 275, 275, 275, 275, 275, + 275, 275, 275, 275, 0, 275, 275 } ; -static yyconst flex_int16_t yy_nxt[653] = +static yyconst flex_int16_t yy_nxt[347] = { 0, - 6, 7, 8, 9, 10, 10, 10, 10, 10, 10, - 10, 10, 11, 12, 6, 6, 13, 6, 6, 6, - 6, 14, 6, 6, 6, 6, 15, 6, 6, 6, - 16, 6, 6, 6, 6, 6, 17, 18, 6, 19, - 20, 21, 22, 23, 9, 24, 24, 24, 24, 24, - 24, 24, 24, 25, 26, 21, 21, 27, 21, 21, - 21, 21, 28, 21, 21, 21, 21, 29, 21, 21, - 21, 30, 21, 21, 21, 21, 21, 31, 32, 21, - 33, 34, 35, 35, 35, 35, 37, 38, 43, 43, - 43, 43, 44, 44, 44, 44, 44, 44, 44, 44, - - 45, 46, 35, 35, 43, 43, 64, 70, 36, 65, - 71, 73, 141, 74, 157, 75, 76, 82, 83, 77, - 96, 97, 78, 79, 142, 101, 158, 80, 174, 102, - 81, 87, 110, 88, 117, 89, 90, 103, 118, 91, - 126, 111, 92, 93, 175, 189, 119, 94, 201, 127, - 95, 204, 214, 221, 217, 240, 205, 262, 202, 218, - 263, 190, 215, 227, 282, 228, 268, 283, 229, 230, - 231, 222, 232, 241, 269, 233, 234, 246, 449, 247, - 273, 450, 248, 249, 250, 288, 251, 293, 274, 252, - 253, 472, 311, 289, 473, 294, 304, 305, 313, 306, - - 312, 315, 307, 308, 543, 319, 314, 321, 323, 316, - 309, 343, 310, 320, 345, 322, 324, 336, 337, 344, - 338, 347, 346, 339, 340, 542, 351, 353, 355, 348, - 365, 341, 367, 342, 352, 354, 356, 373, 366, 376, - 368, 378, 400, 374, 377, 394, 375, 379, 380, 395, - 401, 402, 408, 541, 540, 381, 539, 411, 409, 403, - 413, 410, 412, 538, 429, 537, 414, 415, 430, 536, - 535, 534, 533, 532, 416, 42, 531, 42, 530, 529, - 528, 527, 526, 525, 524, 523, 522, 521, 520, 519, - 518, 517, 516, 515, 514, 513, 512, 511, 510, 509, - - 508, 507, 506, 505, 504, 503, 502, 501, 500, 499, - 498, 497, 496, 495, 494, 493, 492, 491, 490, 489, - 488, 487, 486, 485, 484, 483, 482, 481, 480, 479, - 478, 477, 476, 475, 474, 471, 470, 469, 468, 467, - 466, 465, 464, 463, 462, 461, 460, 459, 458, 457, - 456, 455, 454, 453, 452, 451, 448, 447, 446, 445, - 444, 443, 442, 441, 440, 439, 438, 437, 436, 435, - 434, 433, 432, 431, 428, 427, 426, 425, 424, 423, - 422, 421, 420, 419, 418, 417, 407, 406, 405, 404, - 399, 398, 397, 396, 393, 392, 391, 390, 389, 388, - - 387, 386, 385, 384, 383, 382, 372, 371, 370, 369, - 364, 363, 362, 361, 360, 359, 358, 357, 350, 349, - 335, 334, 333, 332, 331, 330, 329, 328, 327, 326, - 325, 318, 317, 303, 302, 301, 300, 299, 298, 297, - 296, 295, 292, 291, 290, 287, 286, 285, 284, 281, - 280, 279, 278, 277, 276, 275, 272, 271, 270, 267, - 266, 265, 264, 261, 260, 259, 258, 257, 256, 255, - 254, 245, 244, 243, 242, 239, 238, 237, 236, 235, - 226, 225, 224, 223, 220, 219, 216, 213, 212, 211, - 210, 209, 208, 207, 206, 203, 200, 199, 198, 197, - - 196, 195, 194, 193, 192, 191, 188, 187, 186, 185, - 184, 183, 182, 181, 180, 179, 178, 177, 176, 173, - 172, 171, 170, 169, 168, 167, 166, 165, 164, 163, - 162, 161, 160, 159, 156, 155, 154, 153, 152, 151, - 150, 149, 148, 147, 146, 145, 144, 143, 140, 139, - 138, 137, 136, 135, 134, 133, 132, 131, 130, 129, - 128, 125, 124, 123, 122, 121, 120, 116, 115, 114, - 113, 112, 109, 108, 107, 106, 105, 104, 100, 99, - 98, 86, 85, 84, 72, 69, 68, 67, 66, 63, - 62, 61, 60, 59, 58, 57, 56, 55, 54, 53, - - 52, 51, 50, 49, 48, 47, 41, 40, 39, 544, - 5, 544, 544, 544, 544, 544, 544, 544, 544, 544, - 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, - 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, - 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, - 544, 544 + 4, 5, 6, 7, 8, 8, 8, 8, 8, 8, + 8, 8, 9, 10, 4, 4, 11, 4, 4, 4, + 4, 12, 4, 4, 4, 4, 13, 4, 4, 4, + 14, 4, 4, 4, 4, 4, 15, 16, 4, 17, + 18, 19, 19, 19, 19, 22, 23, 19, 19, 37, + 49, 50, 38, 40, 63, 41, 54, 42, 43, 78, + 55, 44, 95, 64, 45, 46, 107, 114, 56, 47, + 110, 79, 48, 142, 21, 111, 108, 120, 96, 121, + 274, 143, 122, 123, 124, 115, 125, 147, 136, 126, + 127, 137, 165, 167, 273, 148, 158, 159, 169, 160, + + 166, 168, 161, 162, 272, 173, 170, 175, 177, 187, + 163, 189, 164, 174, 195, 176, 178, 188, 200, 190, + 196, 198, 271, 197, 201, 202, 199, 216, 270, 269, + 236, 217, 203, 237, 20, 268, 20, 267, 266, 265, + 264, 263, 262, 261, 260, 259, 258, 257, 256, 255, + 254, 253, 252, 251, 250, 249, 248, 247, 246, 245, + 244, 243, 242, 241, 240, 239, 238, 235, 234, 233, + 232, 231, 230, 229, 228, 227, 226, 225, 224, 223, + 222, 221, 220, 219, 218, 215, 214, 213, 212, 211, + 210, 209, 208, 207, 206, 205, 204, 194, 193, 192, + + 191, 186, 185, 184, 183, 182, 181, 180, 179, 172, + 171, 157, 156, 155, 154, 153, 152, 151, 150, 149, + 146, 145, 144, 141, 140, 139, 138, 135, 134, 133, + 132, 131, 130, 129, 128, 119, 118, 117, 116, 113, + 112, 109, 106, 105, 104, 103, 102, 101, 100, 99, + 98, 97, 94, 93, 92, 91, 90, 89, 88, 87, + 86, 85, 84, 83, 82, 81, 80, 77, 76, 75, + 74, 73, 72, 71, 70, 69, 68, 67, 66, 65, + 62, 61, 60, 59, 58, 57, 53, 52, 51, 39, + 36, 35, 34, 33, 32, 31, 30, 29, 28, 27, + + 26, 25, 24, 275, 3, 275, 275, 275, 275, 275, + 275, 275, 275, 275, 275, 275, 275, 275, 275, 275, + 275, 275, 275, 275, 275, 275, 275, 275, 275, 275, + 275, 275, 275, 275, 275, 275, 275, 275, 275, 275, + 275, 275, 275, 275, 275, 275 } ; -static yyconst flex_int16_t yy_chk[653] = +static yyconst flex_int16_t yy_chk[347] = { 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 3, 3, 3, 3, 3, 3, 3, 3, 3, - 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, - 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, - 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, - 3, 3, 7, 7, 8, 8, 13, 13, 22, 22, - 23, 23, 24, 24, 24, 24, 24, 24, 24, 24, - - 27, 27, 35, 35, 43, 43, 54, 59, 545, 54, - 59, 62, 109, 62, 125, 62, 62, 63, 63, 62, - 69, 69, 62, 62, 109, 74, 125, 62, 142, 74, - 62, 68, 81, 68, 88, 68, 68, 74, 88, 68, - 95, 81, 68, 68, 142, 158, 88, 68, 173, 95, - 68, 175, 188, 196, 190, 209, 175, 224, 173, 190, - 224, 158, 188, 201, 243, 201, 230, 243, 201, 201, - 202, 196, 202, 209, 230, 202, 202, 214, 380, 214, - 234, 380, 214, 214, 215, 249, 215, 253, 234, 215, - 215, 415, 265, 249, 415, 253, 264, 264, 266, 264, - - 265, 267, 264, 264, 539, 270, 266, 271, 272, 267, - 264, 285, 264, 270, 286, 271, 272, 284, 284, 285, - 284, 287, 286, 284, 284, 535, 290, 291, 292, 287, - 302, 284, 303, 284, 290, 291, 292, 308, 302, 309, - 303, 310, 334, 308, 309, 327, 308, 310, 310, 327, - 334, 335, 340, 531, 529, 310, 524, 341, 340, 335, - 342, 340, 341, 522, 359, 519, 342, 342, 359, 517, - 512, 510, 509, 508, 342, 546, 506, 546, 505, 504, - 502, 501, 500, 498, 497, 496, 495, 493, 492, 490, - 489, 488, 486, 485, 484, 482, 481, 480, 479, 477, - - 476, 475, 474, 473, 472, 471, 470, 469, 468, 467, - 466, 465, 463, 462, 461, 454, 453, 452, 451, 450, - 449, 448, 447, 446, 445, 444, 443, 442, 440, 439, - 438, 431, 430, 429, 416, 414, 413, 412, 411, 410, - 409, 408, 407, 406, 405, 404, 403, 402, 401, 400, - 399, 397, 396, 395, 394, 381, 379, 378, 377, 376, - 375, 374, 373, 372, 371, 370, 369, 368, 367, 366, - 365, 364, 362, 360, 356, 355, 354, 353, 352, 351, - 348, 347, 346, 345, 344, 343, 339, 338, 337, 336, - 333, 332, 331, 328, 324, 323, 322, 321, 320, 319, - - 316, 315, 314, 313, 312, 311, 307, 306, 305, 304, - 301, 300, 299, 297, 296, 295, 294, 293, 289, 288, - 283, 282, 281, 280, 279, 278, 277, 276, 275, 274, - 273, 269, 268, 263, 262, 261, 260, 259, 258, 257, - 256, 255, 252, 251, 250, 248, 247, 246, 244, 242, - 241, 240, 239, 238, 237, 236, 233, 232, 231, 229, - 228, 227, 225, 223, 222, 221, 220, 219, 218, 217, - 216, 213, 212, 211, 210, 208, 206, 205, 204, 203, - 200, 199, 198, 197, 195, 191, 189, 187, 186, 185, - 184, 181, 180, 179, 176, 174, 172, 171, 170, 169, - - 166, 165, 164, 161, 160, 159, 157, 156, 155, 154, - 153, 152, 151, 150, 149, 148, 145, 144, 143, 141, - 140, 139, 138, 137, 136, 135, 134, 133, 132, 131, - 129, 128, 127, 126, 124, 123, 122, 121, 120, 119, - 118, 117, 116, 115, 113, 112, 111, 110, 108, 107, - 106, 105, 104, 103, 102, 101, 100, 99, 98, 97, - 96, 94, 93, 92, 91, 90, 89, 87, 85, 84, - 83, 82, 80, 79, 78, 77, 76, 75, 73, 71, - 70, 67, 65, 64, 61, 58, 57, 56, 55, 53, - 52, 51, 50, 49, 48, 47, 46, 45, 41, 40, - - 39, 38, 37, 30, 29, 28, 16, 15, 14, 5, - 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, - 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, - 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, - 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, - 544, 544 + 1, 5, 5, 6, 6, 11, 11, 19, 19, 32, + 36, 36, 32, 35, 48, 35, 41, 35, 35, 62, + 41, 35, 79, 48, 35, 35, 94, 102, 41, 35, + 96, 62, 35, 123, 277, 96, 94, 107, 79, 107, + 271, 123, 107, 107, 108, 102, 108, 127, 117, 108, + 108, 117, 139, 140, 267, 127, 138, 138, 141, 138, + + 139, 140, 138, 138, 265, 144, 141, 145, 146, 156, + 138, 157, 138, 144, 162, 145, 146, 156, 164, 157, + 162, 163, 260, 162, 164, 164, 163, 181, 258, 257, + 202, 181, 164, 202, 276, 256, 276, 254, 253, 252, + 250, 249, 248, 246, 245, 244, 243, 241, 240, 239, + 238, 237, 236, 235, 234, 233, 232, 231, 230, 229, + 227, 226, 225, 218, 217, 216, 203, 201, 200, 199, + 198, 197, 196, 195, 194, 193, 192, 191, 190, 189, + 188, 187, 186, 184, 182, 178, 177, 176, 175, 174, + 173, 170, 169, 168, 167, 166, 165, 161, 160, 159, + + 158, 155, 154, 153, 151, 150, 149, 148, 147, 143, + 142, 137, 136, 135, 134, 133, 132, 131, 130, 129, + 126, 125, 124, 122, 121, 120, 118, 116, 115, 114, + 113, 112, 111, 110, 109, 106, 105, 104, 103, 101, + 97, 95, 93, 92, 91, 90, 87, 86, 85, 82, + 81, 80, 78, 77, 76, 75, 74, 73, 72, 71, + 70, 69, 68, 66, 65, 64, 63, 61, 60, 59, + 58, 57, 56, 55, 54, 53, 52, 51, 50, 49, + 47, 46, 45, 44, 43, 42, 40, 38, 37, 34, + 31, 30, 29, 28, 26, 25, 24, 23, 22, 20, + + 14, 13, 12, 3, 275, 275, 275, 275, 275, 275, + 275, 275, 275, 275, 275, 275, 275, 275, 275, 275, + 275, 275, 275, 275, 275, 275, 275, 275, 275, 275, + 275, 275, 275, 275, 275, 275, 275, 275, 275, 275, + 275, 275, 275, 275, 275, 275 } ; +static yy_state_type yy_last_accepting_state; +static char *yy_last_accepting_cpos; + extern int H5LTyy_flex_debug; int H5LTyy_flex_debug = 0; -static yy_state_type *yy_state_buf=0, *yy_state_ptr=0; -static char *yy_full_match; -static int yy_lp; -#define REJECT \ -{ \ -*yy_cp = (yy_hold_char); /* undo effects of setting up H5LTyytext */ \ -yy_cp = (yy_full_match); /* restore poss. backed-over text */ \ -++(yy_lp); \ -goto find_rule; \ -} - +/* The intent behind this definition is that it'll catch + * any uses of REJECT which flex missed. + */ +#define REJECT reject_used_but_not_detected #define yymore() yymore_used_but_not_detected #define YY_MORE_ADJ 0 #define YY_RESTORE_YY_MORE_OFFSET char *H5LTyytext; -#line 1 "hl/src/H5LTanalyze.l" +#line 1 "hl/src//H5LTanalyze.l" /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * Copyright by The HDF Group. * * Copyright by the Board of Trustees of the University of Illinois. * @@ -892,12 +678,16 @@ char *H5LTyytext; * If you make any changes to H5LTanalyze.l, please run bin/genparser to * recreate the output files. */ -#line 21 "hl/src/H5LTanalyze.l" +#line 21 "hl/src//H5LTanalyze.l" +#include #include #include #include + +#include "H5private.h" #include "H5LTparse.h" +static char *trim_quotes(const char *); int my_yyinput(char *, int); #undef YY_INPUT #define YY_INPUT(b, r, ms) (r=my_yyinput(b, ms)) @@ -912,44 +702,9 @@ int my_yyinput(char *, int); extern char *myinput; extern size_t input_len; -#define STACK_SIZE 16 - -/*variables for compound type*/ -struct cmpd_info { - hid_t id; - hbool_t is_field; - hbool_t first_memb; -}; -extern struct cmpd_info cmpd_stack[STACK_SIZE]; -extern int csindex; - -/*variables for array type*/ -struct arr_info { - hsize_t dims[H5S_MAX_RANK]; - int ndim; - hbool_t is_dim; -}; -extern struct arr_info arr_stack[STACK_SIZE]; -extern int asindex; - -/*variables for enumerate type*/ -extern hbool_t is_enum; -extern hbool_t is_enum_memb; - -/*variables for string type*/ -extern hbool_t is_str_size; - -/*variables for opaque type*/ -extern hbool_t is_opq_size; -extern hbool_t is_opq_tag; - -hbool_t first_quote = 1; - - -#line 920 "hl/src/H5LTanalyze.c" +#line 676 "hl/src//H5LTanalyze.c" #define INITIAL 0 -#define TAG_STRING 1 #ifndef YY_EXTRA_TYPE #define YY_EXTRA_TYPE void * @@ -1028,7 +783,7 @@ static int input (void ); /* This used to be an fputs(), but since the string might contain NUL's, * we now use fwrite(). */ -#define ECHO fwrite( H5LTyytext, H5LTyyleng, 1, H5LTyyout ) +#define ECHO do { if (fwrite( H5LTyytext, H5LTyyleng, 1, H5LTyyout )) {} } while (0) #endif /* Gets input and stuffs it into "buf". number of characters read, or YY_NULL, @@ -1039,7 +794,7 @@ static int input (void ); if ( YY_CURRENT_BUFFER_LVALUE->yy_is_interactive ) \ { \ int c = '*'; \ - yy_size_t n; \ + size_t n; \ for ( n = 0; n < max_size && \ (c = getc( H5LTyyin )) != EOF && c != '\n'; ++n ) \ buf[n] = (char) c; \ @@ -1121,10 +876,10 @@ YY_DECL register char *yy_cp, *yy_bp; register int yy_act; -#line 77 "hl/src/H5LTanalyze.l" +#line 46 "hl/src//H5LTanalyze.l" -#line 1098 "hl/src/H5LTanalyze.c" +#line 853 "hl/src//H5LTanalyze.c" if ( !(yy_init) ) { @@ -1134,12 +889,6 @@ YY_DECL YY_USER_INIT; #endif - /* Create the reject buffer large enough to save one state per allowed character. */ - if ( ! (yy_state_buf) ) - (yy_state_buf) = (yy_state_type *)H5LTyyalloc(YY_STATE_BUF_SIZE ); - if ( ! (yy_state_buf) ) - YY_FATAL_ERROR( "out of dynamic memory in H5LTyylex()" ); - if ( ! (yy_start) ) (yy_start) = 1; /* first start state */ @@ -1171,44 +920,33 @@ YY_DECL yy_bp = yy_cp; yy_current_state = (yy_start); - - (yy_state_ptr) = (yy_state_buf); - *(yy_state_ptr)++ = yy_current_state; - yy_match: do { register YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)]; + if ( yy_accept[yy_current_state] ) + { + (yy_last_accepting_state) = yy_current_state; + (yy_last_accepting_cpos) = yy_cp; + } while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) { yy_current_state = (int) yy_def[yy_current_state]; - if ( yy_current_state >= 545 ) + if ( yy_current_state >= 276 ) yy_c = yy_meta[(unsigned int) yy_c]; } yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; - *(yy_state_ptr)++ = yy_current_state; ++yy_cp; } - while ( yy_base[yy_current_state] != 611 ); + while ( yy_base[yy_current_state] != 305 ); yy_find_action: - yy_current_state = *--(yy_state_ptr); - (yy_lp) = yy_accept[yy_current_state]; -goto find_rule; /* Shut up GCC warning -Wall */ -find_rule: /* we branch to this label when backing up */ - for ( ; ; ) /* until we find what rule we matched */ - { - if ( (yy_lp) && (yy_lp) < yy_accept[yy_current_state + 1] ) - { - yy_act = yy_acclist[(yy_lp)]; - { - (yy_full_match) = yy_cp; - break; - } - } - --yy_cp; - yy_current_state = *--(yy_state_ptr); - (yy_lp) = yy_accept[yy_current_state]; + yy_act = yy_accept[yy_current_state]; + if ( yy_act == 0 ) + { /* have to back up */ + yy_cp = (yy_last_accepting_cpos); + yy_current_state = (yy_last_accepting_state); + yy_act = yy_accept[yy_current_state]; } YY_DO_BEFORE_ACTION; @@ -1217,368 +955,350 @@ goto find_rule; /* Shut up GCC warning -Wall */ switch ( yy_act ) { /* beginning of action switch */ + case 0: /* must back up */ + /* undo the effects of YY_DO_BEFORE_ACTION */ + *yy_cp = (yy_hold_char); + yy_cp = (yy_last_accepting_cpos); + yy_current_state = (yy_last_accepting_state); + goto yy_find_action; + case 1: YY_RULE_SETUP -#line 79 "hl/src/H5LTanalyze.l" +#line 48 "hl/src//H5LTanalyze.l" {return hid(H5T_STD_I8BE_TOKEN);} YY_BREAK case 2: YY_RULE_SETUP -#line 80 "hl/src/H5LTanalyze.l" +#line 49 "hl/src//H5LTanalyze.l" {return hid(H5T_STD_I8LE_TOKEN);} YY_BREAK case 3: YY_RULE_SETUP -#line 81 "hl/src/H5LTanalyze.l" +#line 50 "hl/src//H5LTanalyze.l" {return hid(H5T_STD_I16BE_TOKEN);} YY_BREAK case 4: YY_RULE_SETUP -#line 82 "hl/src/H5LTanalyze.l" +#line 51 "hl/src//H5LTanalyze.l" {return hid(H5T_STD_I16LE_TOKEN);} YY_BREAK case 5: YY_RULE_SETUP -#line 83 "hl/src/H5LTanalyze.l" +#line 52 "hl/src//H5LTanalyze.l" {return hid(H5T_STD_I32BE_TOKEN);} YY_BREAK case 6: YY_RULE_SETUP -#line 84 "hl/src/H5LTanalyze.l" +#line 53 "hl/src//H5LTanalyze.l" {return hid(H5T_STD_I32LE_TOKEN);} YY_BREAK case 7: YY_RULE_SETUP -#line 85 "hl/src/H5LTanalyze.l" +#line 54 "hl/src//H5LTanalyze.l" {return hid(H5T_STD_I64BE_TOKEN);} YY_BREAK case 8: YY_RULE_SETUP -#line 86 "hl/src/H5LTanalyze.l" +#line 55 "hl/src//H5LTanalyze.l" {return hid(H5T_STD_I64LE_TOKEN);} YY_BREAK case 9: YY_RULE_SETUP -#line 88 "hl/src/H5LTanalyze.l" +#line 57 "hl/src//H5LTanalyze.l" {return hid(H5T_STD_U8BE_TOKEN);} YY_BREAK case 10: YY_RULE_SETUP -#line 89 "hl/src/H5LTanalyze.l" +#line 58 "hl/src//H5LTanalyze.l" {return hid(H5T_STD_U8LE_TOKEN);} YY_BREAK case 11: YY_RULE_SETUP -#line 90 "hl/src/H5LTanalyze.l" +#line 59 "hl/src//H5LTanalyze.l" {return hid(H5T_STD_U16BE_TOKEN);} YY_BREAK case 12: YY_RULE_SETUP -#line 91 "hl/src/H5LTanalyze.l" +#line 60 "hl/src//H5LTanalyze.l" {return hid(H5T_STD_U16LE_TOKEN);} YY_BREAK case 13: YY_RULE_SETUP -#line 92 "hl/src/H5LTanalyze.l" +#line 61 "hl/src//H5LTanalyze.l" {return hid(H5T_STD_U32BE_TOKEN);} YY_BREAK case 14: YY_RULE_SETUP -#line 93 "hl/src/H5LTanalyze.l" +#line 62 "hl/src//H5LTanalyze.l" {return hid(H5T_STD_U32LE_TOKEN);} YY_BREAK case 15: YY_RULE_SETUP -#line 94 "hl/src/H5LTanalyze.l" +#line 63 "hl/src//H5LTanalyze.l" {return hid(H5T_STD_U64BE_TOKEN);} YY_BREAK case 16: YY_RULE_SETUP -#line 95 "hl/src/H5LTanalyze.l" +#line 64 "hl/src//H5LTanalyze.l" {return hid(H5T_STD_U64LE_TOKEN);} YY_BREAK case 17: YY_RULE_SETUP -#line 97 "hl/src/H5LTanalyze.l" +#line 66 "hl/src//H5LTanalyze.l" {return hid(H5T_NATIVE_CHAR_TOKEN);} YY_BREAK case 18: YY_RULE_SETUP -#line 98 "hl/src/H5LTanalyze.l" +#line 67 "hl/src//H5LTanalyze.l" {return hid(H5T_NATIVE_SCHAR_TOKEN);} YY_BREAK case 19: YY_RULE_SETUP -#line 99 "hl/src/H5LTanalyze.l" +#line 68 "hl/src//H5LTanalyze.l" {return hid(H5T_NATIVE_UCHAR_TOKEN);} YY_BREAK case 20: YY_RULE_SETUP -#line 100 "hl/src/H5LTanalyze.l" +#line 69 "hl/src//H5LTanalyze.l" {return hid(H5T_NATIVE_SHORT_TOKEN);} YY_BREAK case 21: YY_RULE_SETUP -#line 101 "hl/src/H5LTanalyze.l" +#line 70 "hl/src//H5LTanalyze.l" {return hid(H5T_NATIVE_USHORT_TOKEN);} YY_BREAK case 22: YY_RULE_SETUP -#line 102 "hl/src/H5LTanalyze.l" +#line 71 "hl/src//H5LTanalyze.l" {return hid(H5T_NATIVE_INT_TOKEN);} YY_BREAK case 23: YY_RULE_SETUP -#line 103 "hl/src/H5LTanalyze.l" +#line 72 "hl/src//H5LTanalyze.l" {return hid(H5T_NATIVE_UINT_TOKEN);} YY_BREAK case 24: YY_RULE_SETUP -#line 104 "hl/src/H5LTanalyze.l" +#line 73 "hl/src//H5LTanalyze.l" {return hid(H5T_NATIVE_LONG_TOKEN);} YY_BREAK case 25: YY_RULE_SETUP -#line 105 "hl/src/H5LTanalyze.l" +#line 74 "hl/src//H5LTanalyze.l" {return hid(H5T_NATIVE_ULONG_TOKEN);} YY_BREAK case 26: YY_RULE_SETUP -#line 106 "hl/src/H5LTanalyze.l" +#line 75 "hl/src//H5LTanalyze.l" {return hid(H5T_NATIVE_LLONG_TOKEN);} YY_BREAK case 27: YY_RULE_SETUP -#line 107 "hl/src/H5LTanalyze.l" +#line 76 "hl/src//H5LTanalyze.l" {return hid(H5T_NATIVE_ULLONG_TOKEN);} YY_BREAK case 28: YY_RULE_SETUP -#line 109 "hl/src/H5LTanalyze.l" +#line 78 "hl/src//H5LTanalyze.l" {return hid(H5T_IEEE_F32BE_TOKEN);} YY_BREAK case 29: YY_RULE_SETUP -#line 110 "hl/src/H5LTanalyze.l" +#line 79 "hl/src//H5LTanalyze.l" {return hid(H5T_IEEE_F32LE_TOKEN);} YY_BREAK case 30: YY_RULE_SETUP -#line 111 "hl/src/H5LTanalyze.l" +#line 80 "hl/src//H5LTanalyze.l" {return hid(H5T_IEEE_F64BE_TOKEN);} YY_BREAK case 31: YY_RULE_SETUP -#line 112 "hl/src/H5LTanalyze.l" +#line 81 "hl/src//H5LTanalyze.l" {return hid(H5T_IEEE_F64LE_TOKEN);} YY_BREAK case 32: YY_RULE_SETUP -#line 113 "hl/src/H5LTanalyze.l" +#line 82 "hl/src//H5LTanalyze.l" {return hid(H5T_NATIVE_FLOAT_TOKEN);} YY_BREAK case 33: YY_RULE_SETUP -#line 114 "hl/src/H5LTanalyze.l" +#line 83 "hl/src//H5LTanalyze.l" {return hid(H5T_NATIVE_DOUBLE_TOKEN);} YY_BREAK case 34: YY_RULE_SETUP -#line 115 "hl/src/H5LTanalyze.l" +#line 84 "hl/src//H5LTanalyze.l" {return hid(H5T_NATIVE_LDOUBLE_TOKEN);} YY_BREAK case 35: YY_RULE_SETUP -#line 117 "hl/src/H5LTanalyze.l" +#line 86 "hl/src//H5LTanalyze.l" {return token(H5T_STRING_TOKEN);} YY_BREAK case 36: YY_RULE_SETUP -#line 118 "hl/src/H5LTanalyze.l" +#line 87 "hl/src//H5LTanalyze.l" {return token(STRSIZE_TOKEN);} YY_BREAK case 37: YY_RULE_SETUP -#line 119 "hl/src/H5LTanalyze.l" +#line 88 "hl/src//H5LTanalyze.l" {return token(STRPAD_TOKEN);} YY_BREAK case 38: YY_RULE_SETUP -#line 120 "hl/src/H5LTanalyze.l" +#line 89 "hl/src//H5LTanalyze.l" {return token(CSET_TOKEN);} YY_BREAK case 39: YY_RULE_SETUP -#line 121 "hl/src/H5LTanalyze.l" +#line 90 "hl/src//H5LTanalyze.l" {return token(CTYPE_TOKEN);} YY_BREAK case 40: YY_RULE_SETUP -#line 122 "hl/src/H5LTanalyze.l" +#line 91 "hl/src//H5LTanalyze.l" {return token(H5T_STR_NULLTERM_TOKEN);} YY_BREAK case 41: YY_RULE_SETUP -#line 123 "hl/src/H5LTanalyze.l" +#line 92 "hl/src//H5LTanalyze.l" {return token(H5T_STR_NULLPAD_TOKEN);} YY_BREAK case 42: YY_RULE_SETUP -#line 124 "hl/src/H5LTanalyze.l" +#line 93 "hl/src//H5LTanalyze.l" {return token(H5T_STR_SPACEPAD_TOKEN);} YY_BREAK case 43: YY_RULE_SETUP -#line 125 "hl/src/H5LTanalyze.l" +#line 94 "hl/src//H5LTanalyze.l" {return token(H5T_CSET_ASCII_TOKEN);} YY_BREAK case 44: YY_RULE_SETUP -#line 126 "hl/src/H5LTanalyze.l" +#line 95 "hl/src//H5LTanalyze.l" {return token(H5T_CSET_UTF8_TOKEN);} YY_BREAK case 45: YY_RULE_SETUP -#line 127 "hl/src/H5LTanalyze.l" +#line 96 "hl/src//H5LTanalyze.l" {return token(H5T_C_S1_TOKEN);} YY_BREAK case 46: YY_RULE_SETUP -#line 128 "hl/src/H5LTanalyze.l" +#line 97 "hl/src//H5LTanalyze.l" {return token(H5T_FORTRAN_S1_TOKEN);} YY_BREAK case 47: YY_RULE_SETUP -#line 129 "hl/src/H5LTanalyze.l" +#line 98 "hl/src//H5LTanalyze.l" {return token(H5T_VARIABLE_TOKEN);} YY_BREAK case 48: YY_RULE_SETUP -#line 131 "hl/src/H5LTanalyze.l" +#line 100 "hl/src//H5LTanalyze.l" {return token(H5T_COMPOUND_TOKEN);} YY_BREAK case 49: YY_RULE_SETUP -#line 132 "hl/src/H5LTanalyze.l" +#line 101 "hl/src//H5LTanalyze.l" {return token(H5T_ENUM_TOKEN);} YY_BREAK case 50: YY_RULE_SETUP -#line 133 "hl/src/H5LTanalyze.l" +#line 102 "hl/src//H5LTanalyze.l" {return token(H5T_ARRAY_TOKEN);} YY_BREAK case 51: YY_RULE_SETUP -#line 134 "hl/src/H5LTanalyze.l" +#line 103 "hl/src//H5LTanalyze.l" {return token(H5T_VLEN_TOKEN);} YY_BREAK case 52: YY_RULE_SETUP -#line 136 "hl/src/H5LTanalyze.l" +#line 105 "hl/src//H5LTanalyze.l" {return token(H5T_OPAQUE_TOKEN);} YY_BREAK case 53: YY_RULE_SETUP -#line 137 "hl/src/H5LTanalyze.l" +#line 106 "hl/src//H5LTanalyze.l" {return token(OPQ_SIZE_TOKEN);} YY_BREAK case 54: YY_RULE_SETUP -#line 138 "hl/src/H5LTanalyze.l" +#line 107 "hl/src//H5LTanalyze.l" {return token(OPQ_TAG_TOKEN);} YY_BREAK case 55: YY_RULE_SETUP -#line 140 "hl/src/H5LTanalyze.l" +#line 109 "hl/src//H5LTanalyze.l" { - if( is_str_size || (is_enum && is_enum_memb) || - is_opq_size || (asindex>-1 && arr_stack[asindex].is_dim) || - (csindex>-1 && cmpd_stack[csindex].is_field) ) { - H5LTyylval.ival = atoi(H5LTyytext); - return NUMBER; - } else - REJECT; + H5LTyylval.ival = HDatoi(H5LTyytext); + return NUMBER; } YY_BREAK case 56: +/* rule 56 can match eol */ YY_RULE_SETUP -#line 150 "hl/src/H5LTanalyze.l" +#line 114 "hl/src//H5LTanalyze.l" { - /*if it's first quote, and is a compound field name or an enum symbol*/ - if((is_opq_tag || is_enum || (csindex>-1 && cmpd_stack[csindex].is_field)) - && first_quote) { - first_quote = 0; - BEGIN TAG_STRING; - } else /*if it's second quote*/ - first_quote = 1; - return token('"'); + H5LTyylval.sval = trim_quotes(H5LTyytext); + return STRING; } YY_BREAK case 57: -/* rule 57 can match eol */ YY_RULE_SETUP -#line 160 "hl/src/H5LTanalyze.l" -{ -#ifdef H5_HAVE_WIN32_API - H5LTyylval.sval = _strdup(H5LTyytext); -#else /* H5_HAVE_WIN32_API */ - H5LTyylval.sval = strdup(H5LTyytext); -#endif /* H5_HAVE_WIN32_API */ - BEGIN INITIAL; - return STRING; - } +#line 119 "hl/src//H5LTanalyze.l" +{return token('{');} YY_BREAK case 58: YY_RULE_SETUP -#line 170 "hl/src/H5LTanalyze.l" -{return token('{');} +#line 120 "hl/src//H5LTanalyze.l" +{return token('}');} YY_BREAK case 59: YY_RULE_SETUP -#line 171 "hl/src/H5LTanalyze.l" -{return token('}');} +#line 121 "hl/src//H5LTanalyze.l" +{return token('[');} YY_BREAK case 60: YY_RULE_SETUP -#line 172 "hl/src/H5LTanalyze.l" -{return token('[');} +#line 122 "hl/src//H5LTanalyze.l" +{return token(']');} YY_BREAK case 61: YY_RULE_SETUP -#line 173 "hl/src/H5LTanalyze.l" -{return token(']');} +#line 123 "hl/src//H5LTanalyze.l" +{return token(':');} YY_BREAK case 62: YY_RULE_SETUP -#line 174 "hl/src/H5LTanalyze.l" -{return token(':');} +#line 124 "hl/src//H5LTanalyze.l" +{return token(';');} YY_BREAK case 63: +/* rule 63 can match eol */ YY_RULE_SETUP -#line 175 "hl/src/H5LTanalyze.l" -{return token(';');} +#line 125 "hl/src//H5LTanalyze.l" +; YY_BREAK case 64: /* rule 64 can match eol */ YY_RULE_SETUP -#line 176 "hl/src/H5LTanalyze.l" -; - YY_BREAK -case 65: -/* rule 65 can match eol */ -YY_RULE_SETUP -#line 177 "hl/src/H5LTanalyze.l" +#line 126 "hl/src//H5LTanalyze.l" { return 0; } YY_BREAK -case 66: +case 65: YY_RULE_SETUP -#line 179 "hl/src/H5LTanalyze.l" +#line 128 "hl/src//H5LTanalyze.l" ECHO; YY_BREAK -#line 1549 "hl/src/H5LTanalyze.c" - case YY_STATE_EOF(INITIAL): - case YY_STATE_EOF(TAG_STRING): - yyterminate(); +#line 1270 "hl/src//H5LTanalyze.c" +case YY_STATE_EOF(INITIAL): + yyterminate(); case YY_END_OF_BUFFER: { @@ -1768,8 +1488,37 @@ static int yy_get_next_buffer (void) while ( num_to_read <= 0 ) { /* Not enough room in the buffer - grow it. */ - YY_FATAL_ERROR( -"input buffer overflow, can't enlarge buffer because scanner uses REJECT" ); + /* just a shorter name for the current buffer */ + YY_BUFFER_STATE b = YY_CURRENT_BUFFER_LVALUE; + + int yy_c_buf_p_offset = + (int) ((yy_c_buf_p) - b->yy_ch_buf); + + if ( b->yy_is_our_buffer ) + { + yy_size_t new_size = b->yy_buf_size * 2; + + if ( new_size <= 0 ) + b->yy_buf_size += b->yy_buf_size / 8; + else + b->yy_buf_size *= 2; + + b->yy_ch_buf = (char *) + /* Include room in for 2 EOB chars. */ + H5LTyyrealloc((void *) b->yy_ch_buf,b->yy_buf_size + 2 ); + } + else + /* Can't grow it, we don't own it. */ + b->yy_ch_buf = 0; + + if ( ! b->yy_ch_buf ) + YY_FATAL_ERROR( + "fatal error - scanner input buffer overflow" ); + + (yy_c_buf_p) = &b->yy_ch_buf[yy_c_buf_p_offset]; + + num_to_read = YY_CURRENT_BUFFER_LVALUE->yy_buf_size - + number_to_move - 1; } @@ -1828,20 +1577,21 @@ static int yy_get_next_buffer (void) yy_current_state = (yy_start); - (yy_state_ptr) = (yy_state_buf); - *(yy_state_ptr)++ = yy_current_state; - for ( yy_cp = (yytext_ptr) + YY_MORE_ADJ; yy_cp < (yy_c_buf_p); ++yy_cp ) { register YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1); + if ( yy_accept[yy_current_state] ) + { + (yy_last_accepting_state) = yy_current_state; + (yy_last_accepting_cpos) = yy_cp; + } while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) { yy_current_state = (int) yy_def[yy_current_state]; - if ( yy_current_state >= 545 ) + if ( yy_current_state >= 276 ) yy_c = yy_meta[(unsigned int) yy_c]; } yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; - *(yy_state_ptr)++ = yy_current_state; } return yy_current_state; @@ -1855,20 +1605,24 @@ static int yy_get_next_buffer (void) static yy_state_type yy_try_NUL_trans (yy_state_type yy_current_state ) { register int yy_is_jam; - + register char *yy_cp = (yy_c_buf_p); + register YY_CHAR yy_c = 1; + if ( yy_accept[yy_current_state] ) + { + (yy_last_accepting_state) = yy_current_state; + (yy_last_accepting_cpos) = yy_cp; + } while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) { yy_current_state = (int) yy_def[yy_current_state]; - if ( yy_current_state >= 545 ) + if ( yy_current_state >= 276 ) yy_c = yy_meta[(unsigned int) yy_c]; } yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; - yy_is_jam = (yy_current_state == 544); - if ( ! yy_is_jam ) - *(yy_state_ptr)++ = yy_current_state; + yy_is_jam = (yy_current_state == 275); - return yy_is_jam ? 0 : yy_current_state; + return yy_is_jam ? 0 : yy_current_state; } static void yyunput (int c, register char * yy_bp ) @@ -1956,7 +1710,7 @@ static int yy_get_next_buffer (void) case EOB_ACT_END_OF_FILE: { if ( H5LTyywrap( ) ) - return 0; + return EOF; if ( ! (yy_did_buffer_switch_on_eof) ) YY_NEW_FILE; @@ -2092,10 +1846,6 @@ static void H5LTyy_load_buffer_state (void) H5LTyyfree((void *) b ); } -#ifndef __cplusplus -extern int isatty (int ); -#endif /* __cplusplus */ - /* Initializes or reinitializes a buffer. * This function is sometimes called more than once on the same buffer, * such as during a H5LTyyrestart() or at EOF. @@ -2300,8 +2050,8 @@ YY_BUFFER_STATE H5LTyy_scan_string (yyconst char * yystr ) /** Setup the input buffer state to scan the given bytes. The next call to H5LTyylex() will * scan from a @e copy of @a bytes. - * @param bytes the byte buffer to scan - * @param len the number of bytes in the buffer pointed to by @a bytes. + * @param yybytes the byte buffer to scan + * @param _yybytes_len the number of bytes in the buffer pointed to by @a bytes. * * @return the newly allocated buffer state object. */ @@ -2309,7 +2059,8 @@ YY_BUFFER_STATE H5LTyy_scan_bytes (yyconst char * yybytes, yy_size_t _yybytes_ { YY_BUFFER_STATE b; char *buf; - yy_size_t n, i; + yy_size_t n; + int i; /* Get memory for full buffer, including space for trailing EOB's. */ n = _yybytes_len + 2; @@ -2454,11 +2205,6 @@ static int yy_init_globals (void) (yy_init) = 0; (yy_start) = 0; - (yy_state_buf) = 0; - (yy_state_ptr) = 0; - (yy_full_match) = 0; - (yy_lp) = 0; - /* Defined in main.c */ #ifdef YY_STDINIT H5LTyyin = stdin; @@ -2489,9 +2235,6 @@ int H5LTyylex_destroy (void) H5LTyyfree((yy_buffer_stack) ); (yy_buffer_stack) = NULL; - H5LTyyfree ( (yy_state_buf) ); - (yy_state_buf) = NULL; - /* Reset the globals. This is important in a non-reentrant scanner so the next time * H5LTyylex() is called, initialization will occur. */ yy_init_globals( ); @@ -2547,21 +2290,40 @@ void H5LTyyfree (void * ptr ) #define YYTABLES_NAME "yytables" -#line 179 "hl/src/H5LTanalyze.l" +#line 128 "hl/src//H5LTanalyze.l" + +/* Allocate a copy of `quoted` with the double quote character at + * the beginning and the one at the end both removed. The caller is + * responsible for free()ing the copy. + */ +static char * +trim_quotes(const char *quoted) +{ + size_t len = HDstrlen(quoted); + char *trimmed; + + HDassert(quoted[0] == '"' && quoted[len - 1] == '"'); + + trimmed = HDstrdup(quoted + 1); + trimmed[len - 2] = '\0'; + + return trimmed; +} + int my_yyinput(char *buf, int max_size) { int ret; - memcpy(buf, myinput, input_len); + HDmemcpy(buf, myinput, input_len); ret = (int)input_len; return ret; } int H5LTyyerror(const char *msg) { - printf("ERROR: %s before \"%s\".\n", msg, H5LTyytext); + HDprintf("ERROR: %s before \"%s\".\n", msg, H5LTyytext); return 0; } diff --git a/hl/src/H5LTanalyze.l b/hl/src/H5LTanalyze.l index 49fc03917cf..76d5800a5d8 100644 --- a/hl/src/H5LTanalyze.l +++ b/hl/src/H5LTanalyze.l @@ -18,11 +18,15 @@ */ %{ +#include #include #include #include + +#include "H5private.h" #include "H5LTparse.h" +static char *trim_quotes(const char *); int my_yyinput(char *, int); #undef YY_INPUT #define YY_INPUT(b, r, ms) (r=my_yyinput(b, ms)) @@ -37,43 +41,8 @@ int my_yyinput(char *, int); extern char *myinput; extern size_t input_len; -#define STACK_SIZE 16 - -/*variables for compound type*/ -struct cmpd_info { - hid_t id; - hbool_t is_field; - hbool_t first_memb; -}; -extern struct cmpd_info cmpd_stack[STACK_SIZE]; -extern int csindex; - -/*variables for array type*/ -struct arr_info { - hsize_t dims[H5S_MAX_RANK]; - int ndim; - hbool_t is_dim; -}; -extern struct arr_info arr_stack[STACK_SIZE]; -extern int asindex; - -/*variables for enumerate type*/ -extern hbool_t is_enum; -extern hbool_t is_enum_memb; - -/*variables for string type*/ -extern hbool_t is_str_size; - -/*variables for opaque type*/ -extern hbool_t is_opq_size; -extern hbool_t is_opq_tag; - -hbool_t first_quote = 1; - %} -%s TAG_STRING - %% H5T_STD_I8BE {return hid(H5T_STD_I8BE_TOKEN);} @@ -138,32 +107,12 @@ OPQ_SIZE {return token(OPQ_SIZE_TOKEN);} OPQ_TAG {return token(OPQ_TAG_TOKEN);} [0-9]+ { - if( is_str_size || (is_enum && is_enum_memb) || - is_opq_size || (asindex>-1 && arr_stack[asindex].is_dim) || - (csindex>-1 && cmpd_stack[csindex].is_field) ) { - H5LTyylval.ival = atoi(yytext); - return NUMBER; - } else - REJECT; + H5LTyylval.ival = HDatoi(yytext); + return NUMBER; } -"\"" { - /*if it's first quote, and is a compound field name or an enum symbol*/ - if((is_opq_tag || is_enum || (csindex>-1 && cmpd_stack[csindex].is_field)) - && first_quote) { - first_quote = 0; - BEGIN TAG_STRING; - } else /*if it's second quote*/ - first_quote = 1; - return token('"'); - } -[^\"]+ { -#ifdef H5_HAVE_WIN32_API - H5LTyylval.sval = _strdup(yytext); -#else /* H5_HAVE_WIN32_API */ - H5LTyylval.sval = strdup(yytext); -#endif /* H5_HAVE_WIN32_API */ - BEGIN INITIAL; +["][^\"]+["] { + H5LTyylval.sval = trim_quotes(yytext); return STRING; } @@ -177,18 +126,37 @@ OPQ_TAG {return token(OPQ_TAG_TOKEN);} "\n" { return 0; } %% + +/* Allocate a copy of `quoted` with the double quote character at + * the beginning and the one at the end both removed. The caller is + * responsible for free()ing the copy. + */ +static char * +trim_quotes(const char *quoted) +{ + size_t len = HDstrlen(quoted); + char *trimmed; + + HDassert(quoted[0] == '"' && quoted[len - 1] == '"'); + + trimmed = HDstrdup(quoted + 1); + trimmed[len - 2] = '\0'; + + return trimmed; +} + int my_yyinput(char *buf, int max_size) { int ret; - memcpy(buf, myinput, input_len); + HDmemcpy(buf, myinput, input_len); ret = (int)input_len; return ret; } int H5LTyyerror(const char *msg) { - printf("ERROR: %s before \"%s\".\n", msg, yytext); + HDprintf("ERROR: %s before \"%s\".\n", msg, yytext); return 0; } diff --git a/hl/src/H5LTparse.c b/hl/src/H5LTparse.c index 2ef133f5a45..eec7c643b4c 100644 --- a/hl/src/H5LTparse.c +++ b/hl/src/H5LTparse.c @@ -10,11 +10,11 @@ #pragma GCC diagnostic ignored "-Wsign-conversion" #pragma GCC diagnostic ignored "-Wstrict-overflow" #pragma GCC diagnostic ignored "-Wstrict-prototypes" -#if !defined (__clang__) +#if !defined (__clang__) #pragma GCC diagnostic ignored "-Wlarger-than=" #pragma GCC diagnostic ignored "-Wsuggest-attribute=const" #pragma GCC diagnostic ignored "-Wsuggest-attribute=pure" -#endif +#endif #pragma GCC diagnostic ignored "-Wswitch-default" #pragma GCC diagnostic ignored "-Wunused-function" #pragma GCC diagnostic ignored "-Wunused-macros" @@ -28,23 +28,22 @@ #elif defined _MSC_VER #pragma warning(push, 1) #endif -/* A Bison parser, made by GNU Bison 3.7.2. */ +/* A Bison parser, made by GNU Bison 2.7. */ /* Bison implementation for Yacc-like parsers in C - - Copyright (C) 1984, 1989-1990, 2000-2015, 2018-2020 Free Software Foundation, - Inc. - + + Copyright (C) 1984, 1989-1990, 2000-2012 Free Software Foundation, Inc. + This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. - + This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. - + You should have received a copy of the GNU General Public License along with this program. If not, see . */ @@ -57,17 +56,13 @@ special exception, which will cause the skeleton and the resulting Bison output files to be licensed under the GNU General Public License without this special exception. - + This special exception was added by the Free Software Foundation in version 2.2 of Bison. */ /* C LALR(1) parser skeleton written by Richard Stallman, by simplifying the original so-called "semantic" parser. */ -/* DO NOT RELY ON FEATURES THAT ARE NOT DOCUMENTED in the manual, - especially those whose name start with YY_ or yy_. They are - private implementation details that can be changed or removed. */ - /* All symbols defined below should begin with yy or YY, to avoid infringing on user name space. This should be done even for local variables, as they might otherwise be expanded by user macros. @@ -79,7 +74,7 @@ #define YYBISON 1 /* Bison version. */ -#define YYBISON_VERSION "3.7.2" +#define YYBISON_VERSION "2.7" /* Skeleton name. */ #define YYSKELETON_NAME "yacc.c" @@ -98,19 +93,22 @@ #define yyparse H5LTyyparse #define yylex H5LTyylex #define yyerror H5LTyyerror -#define yydebug H5LTyydebug -#define yynerrs H5LTyynerrs #define yylval H5LTyylval #define yychar H5LTyychar +#define yydebug H5LTyydebug +#define yynerrs H5LTyynerrs -/* First part of user prologue. */ -#line 20 "hl/src/H5LTparse.y" +/* Copy the first part of user declarations. */ +/* Line 371 of yacc.c */ +#line 20 "hl/src//H5LTparse.y" #include #include #include -extern int yylex(); +#include "H5private.h" + +extern int yylex(void); extern int yyerror(const char *); #define STACK_SIZE 16 @@ -123,13 +121,13 @@ struct cmpd_info { }; /*stack for nested compound type*/ -struct cmpd_info cmpd_stack[STACK_SIZE] = { +static struct cmpd_info cmpd_stack[STACK_SIZE] = { {0, 0, 1}, {0, 0, 1}, {0, 0, 1}, {0, 0, 1}, {0, 0, 1}, {0, 0, 1}, {0, 0, 1}, {0, 0, 1}, {0, 0, 1}, {0, 0, 1}, {0, 0, 1}, {0, 0, 1}, {0, 0, 1}, {0, 0, 1}, {0, 0, 1}, {0, 0, 1} }; -int csindex = -1; /*pointer to the top of compound stack*/ +static int csindex = -1; /*pointer to the top of compound stack*/ /*structure for array type information*/ struct arr_info { @@ -138,244 +136,188 @@ struct arr_info { hbool_t is_dim; /*flag to lexer for dimension*/ }; /*stack for nested array type*/ -struct arr_info arr_stack[STACK_SIZE]; -int asindex = -1; /*pointer to the top of array stack*/ - -hbool_t is_str_size = 0; /*flag to lexer for string size*/ -hbool_t is_str_pad = 0; /*flag to lexer for string padding*/ -H5T_str_t str_pad; /*variable for string padding*/ -H5T_cset_t str_cset; /*variable for string character set*/ -hbool_t is_variable = 0; /*variable for variable-length string*/ -size_t str_size; /*variable for string size*/ - -hid_t enum_id; /*type ID*/ -hbool_t is_enum = 0; /*flag to lexer for enum type*/ -hbool_t is_enum_memb = 0; /*flag to lexer for enum member*/ -char* enum_memb_symbol; /*enum member symbol string*/ +static struct arr_info arr_stack[STACK_SIZE]; +static int asindex = -1; /*pointer to the top of array stack*/ -hbool_t is_opq_size = 0; /*flag to lexer for opaque type size*/ -hbool_t is_opq_tag = 0; /*flag to lexer for opaque type tag*/ +static H5T_str_t str_pad; /*variable for string padding*/ +static H5T_cset_t str_cset; /*variable for string character set*/ +static hbool_t is_variable = 0; /*variable for variable-length string*/ +static size_t str_size; /*variable for string size*/ + +static hid_t enum_id; /*type ID*/ +static hbool_t is_enum = 0; /*flag to lexer for enum type*/ +static hbool_t is_enum_memb = 0; /*flag to lexer for enum member*/ +static char* enum_memb_symbol; /*enum member symbol string*/ -#line 131 "hl/src/H5LTparse.c" +/* Line 371 of yacc.c */ +#line 125 "hl/src//H5LTparse.c" -# ifndef YY_CAST -# ifdef __cplusplus -# define YY_CAST(Type, Val) static_cast (Val) -# define YY_REINTERPRET_CAST(Type, Val) reinterpret_cast (Val) +# ifndef YY_NULL +# if defined __cplusplus && 201103L <= __cplusplus +# define YY_NULL nullptr # else -# define YY_CAST(Type, Val) ((Type) (Val)) -# define YY_REINTERPRET_CAST(Type, Val) ((Type) (Val)) -# endif -# endif -# ifndef YY_NULLPTR -# if defined __cplusplus -# if 201103L <= __cplusplus -# define YY_NULLPTR nullptr -# else -# define YY_NULLPTR 0 -# endif -# else -# define YY_NULLPTR ((void*)0) +# define YY_NULL 0 # endif # endif -#include "H5LTparse.h" -/* Symbol kind. */ -enum yysymbol_kind_t -{ - YYSYMBOL_YYEMPTY = -2, - YYSYMBOL_YYEOF = 0, /* "end of file" */ - YYSYMBOL_YYerror = 1, /* error */ - YYSYMBOL_YYUNDEF = 2, /* "invalid token" */ - YYSYMBOL_H5T_STD_I8BE_TOKEN = 3, /* H5T_STD_I8BE_TOKEN */ - YYSYMBOL_H5T_STD_I8LE_TOKEN = 4, /* H5T_STD_I8LE_TOKEN */ - YYSYMBOL_H5T_STD_I16BE_TOKEN = 5, /* H5T_STD_I16BE_TOKEN */ - YYSYMBOL_H5T_STD_I16LE_TOKEN = 6, /* H5T_STD_I16LE_TOKEN */ - YYSYMBOL_H5T_STD_I32BE_TOKEN = 7, /* H5T_STD_I32BE_TOKEN */ - YYSYMBOL_H5T_STD_I32LE_TOKEN = 8, /* H5T_STD_I32LE_TOKEN */ - YYSYMBOL_H5T_STD_I64BE_TOKEN = 9, /* H5T_STD_I64BE_TOKEN */ - YYSYMBOL_H5T_STD_I64LE_TOKEN = 10, /* H5T_STD_I64LE_TOKEN */ - YYSYMBOL_H5T_STD_U8BE_TOKEN = 11, /* H5T_STD_U8BE_TOKEN */ - YYSYMBOL_H5T_STD_U8LE_TOKEN = 12, /* H5T_STD_U8LE_TOKEN */ - YYSYMBOL_H5T_STD_U16BE_TOKEN = 13, /* H5T_STD_U16BE_TOKEN */ - YYSYMBOL_H5T_STD_U16LE_TOKEN = 14, /* H5T_STD_U16LE_TOKEN */ - YYSYMBOL_H5T_STD_U32BE_TOKEN = 15, /* H5T_STD_U32BE_TOKEN */ - YYSYMBOL_H5T_STD_U32LE_TOKEN = 16, /* H5T_STD_U32LE_TOKEN */ - YYSYMBOL_H5T_STD_U64BE_TOKEN = 17, /* H5T_STD_U64BE_TOKEN */ - YYSYMBOL_H5T_STD_U64LE_TOKEN = 18, /* H5T_STD_U64LE_TOKEN */ - YYSYMBOL_H5T_NATIVE_CHAR_TOKEN = 19, /* H5T_NATIVE_CHAR_TOKEN */ - YYSYMBOL_H5T_NATIVE_SCHAR_TOKEN = 20, /* H5T_NATIVE_SCHAR_TOKEN */ - YYSYMBOL_H5T_NATIVE_UCHAR_TOKEN = 21, /* H5T_NATIVE_UCHAR_TOKEN */ - YYSYMBOL_H5T_NATIVE_SHORT_TOKEN = 22, /* H5T_NATIVE_SHORT_TOKEN */ - YYSYMBOL_H5T_NATIVE_USHORT_TOKEN = 23, /* H5T_NATIVE_USHORT_TOKEN */ - YYSYMBOL_H5T_NATIVE_INT_TOKEN = 24, /* H5T_NATIVE_INT_TOKEN */ - YYSYMBOL_H5T_NATIVE_UINT_TOKEN = 25, /* H5T_NATIVE_UINT_TOKEN */ - YYSYMBOL_H5T_NATIVE_LONG_TOKEN = 26, /* H5T_NATIVE_LONG_TOKEN */ - YYSYMBOL_H5T_NATIVE_ULONG_TOKEN = 27, /* H5T_NATIVE_ULONG_TOKEN */ - YYSYMBOL_H5T_NATIVE_LLONG_TOKEN = 28, /* H5T_NATIVE_LLONG_TOKEN */ - YYSYMBOL_H5T_NATIVE_ULLONG_TOKEN = 29, /* H5T_NATIVE_ULLONG_TOKEN */ - YYSYMBOL_H5T_IEEE_F32BE_TOKEN = 30, /* H5T_IEEE_F32BE_TOKEN */ - YYSYMBOL_H5T_IEEE_F32LE_TOKEN = 31, /* H5T_IEEE_F32LE_TOKEN */ - YYSYMBOL_H5T_IEEE_F64BE_TOKEN = 32, /* H5T_IEEE_F64BE_TOKEN */ - YYSYMBOL_H5T_IEEE_F64LE_TOKEN = 33, /* H5T_IEEE_F64LE_TOKEN */ - YYSYMBOL_H5T_NATIVE_FLOAT_TOKEN = 34, /* H5T_NATIVE_FLOAT_TOKEN */ - YYSYMBOL_H5T_NATIVE_DOUBLE_TOKEN = 35, /* H5T_NATIVE_DOUBLE_TOKEN */ - YYSYMBOL_H5T_NATIVE_LDOUBLE_TOKEN = 36, /* H5T_NATIVE_LDOUBLE_TOKEN */ - YYSYMBOL_H5T_STRING_TOKEN = 37, /* H5T_STRING_TOKEN */ - YYSYMBOL_STRSIZE_TOKEN = 38, /* STRSIZE_TOKEN */ - YYSYMBOL_STRPAD_TOKEN = 39, /* STRPAD_TOKEN */ - YYSYMBOL_CSET_TOKEN = 40, /* CSET_TOKEN */ - YYSYMBOL_CTYPE_TOKEN = 41, /* CTYPE_TOKEN */ - YYSYMBOL_H5T_VARIABLE_TOKEN = 42, /* H5T_VARIABLE_TOKEN */ - YYSYMBOL_H5T_STR_NULLTERM_TOKEN = 43, /* H5T_STR_NULLTERM_TOKEN */ - YYSYMBOL_H5T_STR_NULLPAD_TOKEN = 44, /* H5T_STR_NULLPAD_TOKEN */ - YYSYMBOL_H5T_STR_SPACEPAD_TOKEN = 45, /* H5T_STR_SPACEPAD_TOKEN */ - YYSYMBOL_H5T_CSET_ASCII_TOKEN = 46, /* H5T_CSET_ASCII_TOKEN */ - YYSYMBOL_H5T_CSET_UTF8_TOKEN = 47, /* H5T_CSET_UTF8_TOKEN */ - YYSYMBOL_H5T_C_S1_TOKEN = 48, /* H5T_C_S1_TOKEN */ - YYSYMBOL_H5T_FORTRAN_S1_TOKEN = 49, /* H5T_FORTRAN_S1_TOKEN */ - YYSYMBOL_H5T_OPAQUE_TOKEN = 50, /* H5T_OPAQUE_TOKEN */ - YYSYMBOL_OPQ_SIZE_TOKEN = 51, /* OPQ_SIZE_TOKEN */ - YYSYMBOL_OPQ_TAG_TOKEN = 52, /* OPQ_TAG_TOKEN */ - YYSYMBOL_H5T_COMPOUND_TOKEN = 53, /* H5T_COMPOUND_TOKEN */ - YYSYMBOL_H5T_ENUM_TOKEN = 54, /* H5T_ENUM_TOKEN */ - YYSYMBOL_H5T_ARRAY_TOKEN = 55, /* H5T_ARRAY_TOKEN */ - YYSYMBOL_H5T_VLEN_TOKEN = 56, /* H5T_VLEN_TOKEN */ - YYSYMBOL_STRING = 57, /* STRING */ - YYSYMBOL_NUMBER = 58, /* NUMBER */ - YYSYMBOL_59_ = 59, /* '{' */ - YYSYMBOL_60_ = 60, /* '}' */ - YYSYMBOL_61_ = 61, /* '[' */ - YYSYMBOL_62_ = 62, /* ']' */ - YYSYMBOL_63_ = 63, /* '"' */ - YYSYMBOL_64_ = 64, /* ':' */ - YYSYMBOL_65_ = 65, /* ';' */ - YYSYMBOL_YYACCEPT = 66, /* $accept */ - YYSYMBOL_start = 67, /* start */ - YYSYMBOL_ddl_type = 68, /* ddl_type */ - YYSYMBOL_atomic_type = 69, /* atomic_type */ - YYSYMBOL_integer_type = 70, /* integer_type */ - YYSYMBOL_fp_type = 71, /* fp_type */ - YYSYMBOL_compound_type = 72, /* compound_type */ - YYSYMBOL_73_1 = 73, /* $@1 */ - YYSYMBOL_memb_list = 74, /* memb_list */ - YYSYMBOL_memb_def = 75, /* memb_def */ - YYSYMBOL_76_2 = 76, /* $@2 */ - YYSYMBOL_field_name = 77, /* field_name */ - YYSYMBOL_field_offset = 78, /* field_offset */ - YYSYMBOL_offset = 79, /* offset */ - YYSYMBOL_array_type = 80, /* array_type */ - YYSYMBOL_81_3 = 81, /* $@3 */ - YYSYMBOL_dim_list = 82, /* dim_list */ - YYSYMBOL_dim = 83, /* dim */ - YYSYMBOL_84_4 = 84, /* $@4 */ - YYSYMBOL_85_5 = 85, /* $@5 */ - YYSYMBOL_dimsize = 86, /* dimsize */ - YYSYMBOL_vlen_type = 87, /* vlen_type */ - YYSYMBOL_opaque_type = 88, /* opaque_type */ - YYSYMBOL_89_6 = 89, /* $@6 */ - YYSYMBOL_90_7 = 90, /* @7 */ - YYSYMBOL_91_8 = 91, /* $@8 */ - YYSYMBOL_92_9 = 92, /* $@9 */ - YYSYMBOL_opaque_size = 93, /* opaque_size */ - YYSYMBOL_opaque_tag = 94, /* opaque_tag */ - YYSYMBOL_string_type = 95, /* string_type */ - YYSYMBOL_96_10 = 96, /* $@10 */ - YYSYMBOL_97_11 = 97, /* $@11 */ - YYSYMBOL_98_12 = 98, /* $@12 */ - YYSYMBOL_99_13 = 99, /* $@13 */ - YYSYMBOL_100_14 = 100, /* @14 */ - YYSYMBOL_strsize = 101, /* strsize */ - YYSYMBOL_strpad = 102, /* strpad */ - YYSYMBOL_cset = 103, /* cset */ - YYSYMBOL_ctype = 104, /* ctype */ - YYSYMBOL_enum_type = 105, /* enum_type */ - YYSYMBOL_106_15 = 106, /* $@15 */ - YYSYMBOL_enum_list = 107, /* enum_list */ - YYSYMBOL_enum_def = 108, /* enum_def */ - YYSYMBOL_109_16 = 109, /* $@16 */ - YYSYMBOL_enum_symbol = 110, /* enum_symbol */ - YYSYMBOL_enum_val = 111 /* enum_val */ -}; -typedef enum yysymbol_kind_t yysymbol_kind_t; +/* Enabling verbose error messages. */ +#ifdef YYERROR_VERBOSE +# undef YYERROR_VERBOSE +# define YYERROR_VERBOSE 1 +#else +# define YYERROR_VERBOSE 0 +#endif + +/* In a future release of Bison, this section will be replaced + by #include "H5LTparse.h". */ +#ifndef YY_H5LTYY_HL_SRC_H5LTPARSE_H_INCLUDED +# define YY_H5LTYY_HL_SRC_H5LTPARSE_H_INCLUDED +/* Enabling traces. */ +#ifndef YYDEBUG +# define YYDEBUG 0 +#endif +#if YYDEBUG +extern int H5LTyydebug; +#endif +/* Tokens. */ +#ifndef YYTOKENTYPE +# define YYTOKENTYPE + /* Put the tokens into the symbol table, so that GDB and other debuggers + know about them. */ + enum yytokentype { + H5T_STD_I8BE_TOKEN = 258, + H5T_STD_I8LE_TOKEN = 259, + H5T_STD_I16BE_TOKEN = 260, + H5T_STD_I16LE_TOKEN = 261, + H5T_STD_I32BE_TOKEN = 262, + H5T_STD_I32LE_TOKEN = 263, + H5T_STD_I64BE_TOKEN = 264, + H5T_STD_I64LE_TOKEN = 265, + H5T_STD_U8BE_TOKEN = 266, + H5T_STD_U8LE_TOKEN = 267, + H5T_STD_U16BE_TOKEN = 268, + H5T_STD_U16LE_TOKEN = 269, + H5T_STD_U32BE_TOKEN = 270, + H5T_STD_U32LE_TOKEN = 271, + H5T_STD_U64BE_TOKEN = 272, + H5T_STD_U64LE_TOKEN = 273, + H5T_NATIVE_CHAR_TOKEN = 274, + H5T_NATIVE_SCHAR_TOKEN = 275, + H5T_NATIVE_UCHAR_TOKEN = 276, + H5T_NATIVE_SHORT_TOKEN = 277, + H5T_NATIVE_USHORT_TOKEN = 278, + H5T_NATIVE_INT_TOKEN = 279, + H5T_NATIVE_UINT_TOKEN = 280, + H5T_NATIVE_LONG_TOKEN = 281, + H5T_NATIVE_ULONG_TOKEN = 282, + H5T_NATIVE_LLONG_TOKEN = 283, + H5T_NATIVE_ULLONG_TOKEN = 284, + H5T_IEEE_F32BE_TOKEN = 285, + H5T_IEEE_F32LE_TOKEN = 286, + H5T_IEEE_F64BE_TOKEN = 287, + H5T_IEEE_F64LE_TOKEN = 288, + H5T_NATIVE_FLOAT_TOKEN = 289, + H5T_NATIVE_DOUBLE_TOKEN = 290, + H5T_NATIVE_LDOUBLE_TOKEN = 291, + H5T_STRING_TOKEN = 292, + STRSIZE_TOKEN = 293, + STRPAD_TOKEN = 294, + CSET_TOKEN = 295, + CTYPE_TOKEN = 296, + H5T_VARIABLE_TOKEN = 297, + H5T_STR_NULLTERM_TOKEN = 298, + H5T_STR_NULLPAD_TOKEN = 299, + H5T_STR_SPACEPAD_TOKEN = 300, + H5T_CSET_ASCII_TOKEN = 301, + H5T_CSET_UTF8_TOKEN = 302, + H5T_C_S1_TOKEN = 303, + H5T_FORTRAN_S1_TOKEN = 304, + H5T_OPAQUE_TOKEN = 305, + OPQ_SIZE_TOKEN = 306, + OPQ_TAG_TOKEN = 307, + H5T_COMPOUND_TOKEN = 308, + H5T_ENUM_TOKEN = 309, + H5T_ARRAY_TOKEN = 310, + H5T_VLEN_TOKEN = 311, + STRING = 312, + NUMBER = 313 + }; +#endif +#if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED +typedef union YYSTYPE +{ +/* Line 387 of yacc.c */ +#line 69 "hl/src//H5LTparse.y" -#ifdef short -# undef short -#endif + int ival; /*for integer token*/ + char *sval; /*for name string*/ + hid_t hid; /*for hid_t token*/ -/* On compilers that do not define __PTRDIFF_MAX__ etc., make sure - and (if available) are included - so that the code can choose integer types of a good width. */ -#ifndef __PTRDIFF_MAX__ -# include /* INFRINGES ON USER NAME SPACE */ -# if defined __STDC_VERSION__ && 199901 <= __STDC_VERSION__ -# include /* INFRINGES ON USER NAME SPACE */ -# define YY_STDINT_H -# endif +/* Line 387 of yacc.c */ +#line 233 "hl/src//H5LTparse.c" +} YYSTYPE; +# define YYSTYPE_IS_TRIVIAL 1 +# define yystype YYSTYPE /* obsolescent; will be withdrawn */ +# define YYSTYPE_IS_DECLARED 1 #endif -/* Narrow types that promote to a signed type and that can represent a - signed or unsigned integer of at least N bits. In tables they can - save space and decrease cache pressure. Promoting to a signed type - helps avoid bugs in integer arithmetic. */ +extern YYSTYPE H5LTyylval; -#ifdef __INT_LEAST8_MAX__ -typedef __INT_LEAST8_TYPE__ yytype_int8; -#elif defined YY_STDINT_H -typedef int_least8_t yytype_int8; +#ifdef YYPARSE_PARAM +#if defined __STDC__ || defined __cplusplus +hid_t H5LTyyparse (void *YYPARSE_PARAM); #else -typedef signed char yytype_int8; +hid_t H5LTyyparse (); #endif - -#ifdef __INT_LEAST16_MAX__ -typedef __INT_LEAST16_TYPE__ yytype_int16; -#elif defined YY_STDINT_H -typedef int_least16_t yytype_int16; +#else /* ! YYPARSE_PARAM */ +#if defined __STDC__ || defined __cplusplus +hid_t H5LTyyparse (void); #else -typedef short yytype_int16; +hid_t H5LTyyparse (); #endif +#endif /* ! YYPARSE_PARAM */ -#if defined __UINT_LEAST8_MAX__ && __UINT_LEAST8_MAX__ <= __INT_MAX__ -typedef __UINT_LEAST8_TYPE__ yytype_uint8; -#elif (!defined __UINT_LEAST8_MAX__ && defined YY_STDINT_H \ - && UINT_LEAST8_MAX <= INT_MAX) -typedef uint_least8_t yytype_uint8; -#elif !defined __UINT_LEAST8_MAX__ && UCHAR_MAX <= INT_MAX +#endif /* !YY_H5LTYY_HL_SRC_H5LTPARSE_H_INCLUDED */ + +/* Copy the second part of user declarations. */ + +/* Line 390 of yacc.c */ +#line 261 "hl/src//H5LTparse.c" + +#ifdef short +# undef short +#endif + +#ifdef YYTYPE_UINT8 +typedef YYTYPE_UINT8 yytype_uint8; +#else typedef unsigned char yytype_uint8; +#endif + +#ifdef YYTYPE_INT8 +typedef YYTYPE_INT8 yytype_int8; +#elif (defined __STDC__ || defined __C99__FUNC__ \ + || defined __cplusplus || defined _MSC_VER) +typedef signed char yytype_int8; #else -typedef short yytype_uint8; +typedef short int yytype_int8; #endif -#if defined __UINT_LEAST16_MAX__ && __UINT_LEAST16_MAX__ <= __INT_MAX__ -typedef __UINT_LEAST16_TYPE__ yytype_uint16; -#elif (!defined __UINT_LEAST16_MAX__ && defined YY_STDINT_H \ - && UINT_LEAST16_MAX <= INT_MAX) -typedef uint_least16_t yytype_uint16; -#elif !defined __UINT_LEAST16_MAX__ && USHRT_MAX <= INT_MAX -typedef unsigned short yytype_uint16; +#ifdef YYTYPE_UINT16 +typedef YYTYPE_UINT16 yytype_uint16; #else -typedef int yytype_uint16; +typedef unsigned short int yytype_uint16; #endif -#ifndef YYPTRDIFF_T -# if defined __PTRDIFF_TYPE__ && defined __PTRDIFF_MAX__ -# define YYPTRDIFF_T __PTRDIFF_TYPE__ -# define YYPTRDIFF_MAXIMUM __PTRDIFF_MAX__ -# elif defined PTRDIFF_MAX -# ifndef ptrdiff_t -# include /* INFRINGES ON USER NAME SPACE */ -# endif -# define YYPTRDIFF_T ptrdiff_t -# define YYPTRDIFF_MAXIMUM PTRDIFF_MAX -# else -# define YYPTRDIFF_T long -# define YYPTRDIFF_MAXIMUM LONG_MAX -# endif +#ifdef YYTYPE_INT16 +typedef YYTYPE_INT16 yytype_int16; +#else +typedef short int yytype_int16; #endif #ifndef YYSIZE_T @@ -383,28 +325,16 @@ typedef int yytype_uint16; # define YYSIZE_T __SIZE_TYPE__ # elif defined size_t # define YYSIZE_T size_t -# elif defined __STDC_VERSION__ && 199901 <= __STDC_VERSION__ +# elif ! defined YYSIZE_T && (defined __STDC__ || defined __C99__FUNC__ \ + || defined __cplusplus || defined _MSC_VER) # include /* INFRINGES ON USER NAME SPACE */ # define YYSIZE_T size_t # else -# define YYSIZE_T unsigned +# define YYSIZE_T unsigned int # endif #endif -#define YYSIZE_MAXIMUM \ - YY_CAST (YYPTRDIFF_T, \ - (YYPTRDIFF_MAXIMUM < YY_CAST (YYSIZE_T, -1) \ - ? YYPTRDIFF_MAXIMUM \ - : YY_CAST (YYSIZE_T, -1))) - -#define YYSIZEOF(X) YY_CAST (YYPTRDIFF_T, sizeof (X)) - - -/* Stored state numbers (used for stacks). */ -typedef yytype_uint8 yy_state_t; - -/* State numbers in computations. */ -typedef int yy_state_fast_t; +#define YYSIZE_MAXIMUM ((YYSIZE_T) -1) #ifndef YY_ # if defined YYENABLE_NLS && YYENABLE_NLS @@ -418,23 +348,6 @@ typedef int yy_state_fast_t; # endif #endif - -#ifndef YY_ATTRIBUTE_PURE -# if defined __GNUC__ && 2 < __GNUC__ + (96 <= __GNUC_MINOR__) -# define YY_ATTRIBUTE_PURE __attribute__ ((__pure__)) -# else -# define YY_ATTRIBUTE_PURE -# endif -#endif - -#ifndef YY_ATTRIBUTE_UNUSED -# if defined __GNUC__ && 2 < __GNUC__ + (7 <= __GNUC_MINOR__) -# define YY_ATTRIBUTE_UNUSED __attribute__ ((__unused__)) -# else -# define YY_ATTRIBUTE_UNUSED -# endif -#endif - /* Suppress unused-variable warnings by "using" E. */ #if ! defined lint || defined __GNUC__ # define YYUSE(E) ((void) (E)) @@ -442,41 +355,25 @@ typedef int yy_state_fast_t; # define YYUSE(E) /* empty */ #endif -#if defined __GNUC__ && ! defined __ICC && 407 <= __GNUC__ * 100 + __GNUC_MINOR__ -/* Suppress an incorrect diagnostic about yylval being uninitialized. */ -# define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN \ - _Pragma ("GCC diagnostic push") \ - _Pragma ("GCC diagnostic ignored \"-Wuninitialized\"") \ - _Pragma ("GCC diagnostic ignored \"-Wmaybe-uninitialized\"") -# define YY_IGNORE_MAYBE_UNINITIALIZED_END \ - _Pragma ("GCC diagnostic pop") +/* Identity function, used to suppress warnings about constant conditions. */ +#ifndef lint +# define YYID(N) (N) #else -# define YY_INITIAL_VALUE(Value) Value -#endif -#ifndef YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN -# define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN -# define YY_IGNORE_MAYBE_UNINITIALIZED_END -#endif -#ifndef YY_INITIAL_VALUE -# define YY_INITIAL_VALUE(Value) /* Nothing. */ -#endif - -#if defined __cplusplus && defined __GNUC__ && ! defined __ICC && 6 <= __GNUC__ -# define YY_IGNORE_USELESS_CAST_BEGIN \ - _Pragma ("GCC diagnostic push") \ - _Pragma ("GCC diagnostic ignored \"-Wuseless-cast\"") -# define YY_IGNORE_USELESS_CAST_END \ - _Pragma ("GCC diagnostic pop") +#if (defined __STDC__ || defined __C99__FUNC__ \ + || defined __cplusplus || defined _MSC_VER) +static int +YYID (int yyi) +#else +static int +YYID (yyi) + int yyi; #endif -#ifndef YY_IGNORE_USELESS_CAST_BEGIN -# define YY_IGNORE_USELESS_CAST_BEGIN -# define YY_IGNORE_USELESS_CAST_END +{ + return yyi; +} #endif - -#define YY_ASSERT(E) ((void) (0 && (E))) - -#if !defined yyoverflow +#if ! defined yyoverflow || YYERROR_VERBOSE /* The parser invokes alloca or malloc; define the necessary symbols. */ @@ -493,7 +390,8 @@ typedef int yy_state_fast_t; # define alloca _alloca # else # define YYSTACK_ALLOC alloca -# if ! defined _ALLOCA_H && ! defined EXIT_SUCCESS +# if ! defined _ALLOCA_H && ! defined EXIT_SUCCESS && (defined __STDC__ || defined __C99__FUNC__ \ + || defined __cplusplus || defined _MSC_VER) # include /* INFRINGES ON USER NAME SPACE */ /* Use EXIT_SUCCESS as a witness for stdlib.h. */ # ifndef EXIT_SUCCESS @@ -505,8 +403,8 @@ typedef int yy_state_fast_t; # endif # ifdef YYSTACK_ALLOC - /* Pacify GCC's 'empty if-body' warning. */ -# define YYSTACK_FREE(Ptr) do { /* empty */; } while (0) + /* Pacify GCC's `empty if-body' warning. */ +# define YYSTACK_FREE(Ptr) do { /* empty */; } while (YYID (0)) # ifndef YYSTACK_ALLOC_MAXIMUM /* The OS might guarantee only one guard page at the bottom of the stack, and a page size can be as small as 4096 bytes. So we cannot safely @@ -522,7 +420,7 @@ typedef int yy_state_fast_t; # endif # if (defined __cplusplus && ! defined EXIT_SUCCESS \ && ! ((defined YYMALLOC || defined malloc) \ - && (defined YYFREE || defined free))) + && (defined YYFREE || defined free))) # include /* INFRINGES ON USER NAME SPACE */ # ifndef EXIT_SUCCESS # define EXIT_SUCCESS 0 @@ -530,37 +428,40 @@ typedef int yy_state_fast_t; # endif # ifndef YYMALLOC # define YYMALLOC malloc -# if ! defined malloc && ! defined EXIT_SUCCESS +# if ! defined malloc && ! defined EXIT_SUCCESS && (defined __STDC__ || defined __C99__FUNC__ \ + || defined __cplusplus || defined _MSC_VER) void *malloc (YYSIZE_T); /* INFRINGES ON USER NAME SPACE */ # endif # endif # ifndef YYFREE # define YYFREE free -# if ! defined free && ! defined EXIT_SUCCESS +# if ! defined free && ! defined EXIT_SUCCESS && (defined __STDC__ || defined __C99__FUNC__ \ + || defined __cplusplus || defined _MSC_VER) void free (void *); /* INFRINGES ON USER NAME SPACE */ # endif # endif # endif -#endif /* !defined yyoverflow */ +#endif /* ! defined yyoverflow || YYERROR_VERBOSE */ + #if (! defined yyoverflow \ && (! defined __cplusplus \ - || (defined YYSTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL))) + || (defined YYSTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL))) /* A type that is properly aligned for any stack member. */ union yyalloc { - yy_state_t yyss_alloc; + yytype_int16 yyss_alloc; YYSTYPE yyvs_alloc; }; /* The size of the maximum gap between one aligned stack and the next. */ -# define YYSTACK_GAP_MAXIMUM (YYSIZEOF (union yyalloc) - 1) +# define YYSTACK_GAP_MAXIMUM (sizeof (union yyalloc) - 1) /* The size of an array large to enough to hold all stacks, each with N elements. */ # define YYSTACK_BYTES(N) \ - ((N) * (YYSIZEOF (yy_state_t) + YYSIZEOF (YYSTYPE)) \ + ((N) * (sizeof (yytype_int16) + sizeof (YYSTYPE)) \ + YYSTACK_GAP_MAXIMUM) # define YYCOPY_NEEDED 1 @@ -570,16 +471,16 @@ union yyalloc elements in the stack, and YYPTR gives the new location of the stack. Advance YYPTR to a properly aligned location for the next stack. */ -# define YYSTACK_RELOCATE(Stack_alloc, Stack) \ - do \ - { \ - YYPTRDIFF_T yynewbytes; \ - YYCOPY (&yyptr->Stack_alloc, Stack, yysize); \ - Stack = &yyptr->Stack_alloc; \ - yynewbytes = yystacksize * YYSIZEOF (*Stack) + YYSTACK_GAP_MAXIMUM; \ - yyptr += yynewbytes / YYSIZEOF (*yyptr); \ - } \ - while (0) +# define YYSTACK_RELOCATE(Stack_alloc, Stack) \ + do \ + { \ + YYSIZE_T yynewbytes; \ + YYCOPY (&yyptr->Stack_alloc, Stack, yysize); \ + Stack = &yyptr->Stack_alloc; \ + yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \ + yyptr += yynewbytes / sizeof (*yyptr); \ + } \ + while (YYID (0)) #endif @@ -589,16 +490,16 @@ union yyalloc # ifndef YYCOPY # if defined __GNUC__ && 1 < __GNUC__ # define YYCOPY(Dst, Src, Count) \ - __builtin_memcpy (Dst, Src, YY_CAST (YYSIZE_T, (Count)) * sizeof (*(Src))) + __builtin_memcpy (Dst, Src, (Count) * sizeof (*(Src))) # else # define YYCOPY(Dst, Src, Count) \ do \ { \ - YYPTRDIFF_T yyi; \ + YYSIZE_T yyi; \ for (yyi = 0; yyi < (Count); yyi++) \ (Dst)[yyi] = (Src)[yyi]; \ } \ - while (0) + while (YYID (0)) # endif # endif #endif /* !YYCOPY_NEEDED */ @@ -606,38 +507,33 @@ union yyalloc /* YYFINAL -- State number of the termination state. */ #define YYFINAL 58 /* YYLAST -- Last index in YYTABLE. */ -#define YYLAST 203 +#define YYLAST 197 /* YYNTOKENS -- Number of terminals. */ -#define YYNTOKENS 66 +#define YYNTOKENS 65 /* YYNNTS -- Number of nonterminals. */ -#define YYNNTS 46 +#define YYNNTS 43 /* YYNRULES -- Number of rules. */ -#define YYNRULES 95 -/* YYNSTATES -- Number of states. */ -#define YYNSTATES 143 +#define YYNRULES 92 +/* YYNRULES -- Number of states. */ +#define YYNSTATES 134 -/* YYMAXUTOK -- Last valid token kind. */ +/* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX. */ +#define YYUNDEFTOK 2 #define YYMAXUTOK 313 +#define YYTRANSLATE(YYX) \ + ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK) -/* YYTRANSLATE(TOKEN-NUM) -- Symbol number corresponding to TOKEN-NUM - as returned by yylex, with out-of-bounds checking. */ -#define YYTRANSLATE(YYX) \ - (0 <= (YYX) && (YYX) <= YYMAXUTOK \ - ? YY_CAST (yysymbol_kind_t, yytranslate[YYX]) \ - : YYSYMBOL_YYUNDEF) - -/* YYTRANSLATE[TOKEN-NUM] -- Symbol number corresponding to TOKEN-NUM - as returned by yylex. */ -static const yytype_int8 yytranslate[] = +/* YYTRANSLATE[YYLEX] -- Bison symbol number corresponding to YYLEX. */ +static const yytype_uint8 yytranslate[] = { 0, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 63, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 64, 65, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 63, 64, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, @@ -667,35 +563,72 @@ static const yytype_int8 yytranslate[] = }; #if YYDEBUG - /* YYRLINE[YYN] -- Source line where rule number YYN was defined. */ -static const yytype_int16 yyrline[] = +/* YYPRHS[YYN] -- Index of the first RHS symbol of rule number YYN in + YYRHS. */ +static const yytype_uint8 yyprhs[] = { - 0, 105, 105, 106, 108, 109, 110, 111, 113, 114, - 115, 116, 117, 120, 121, 122, 123, 124, 125, 126, - 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, - 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, - 149, 150, 151, 152, 153, 154, 155, 159, 158, 167, - 168, 170, 170, 207, 215, 216, 219, 221, 221, 230, - 231, 233, 234, 233, 241, 244, 250, 251, 256, 257, - 248, 265, 267, 271, 272, 280, 289, 296, 269, 320, - 321, 323, 324, 325, 327, 328, 330, 331, 335, 334, - 339, 340, 342, 342, 396, 398 + 0, 0, 3, 4, 6, 8, 10, 12, 14, 16, + 18, 20, 22, 24, 26, 28, 30, 32, 34, 36, + 38, 40, 42, 44, 46, 48, 50, 52, 54, 56, + 58, 60, 62, 64, 66, 68, 70, 72, 74, 76, + 78, 80, 82, 84, 86, 88, 90, 92, 93, 99, + 100, 103, 104, 110, 112, 113, 116, 118, 119, 126, + 127, 130, 131, 132, 138, 140, 145, 146, 147, 159, + 161, 163, 164, 165, 166, 167, 187, 189, 191, 193, + 195, 197, 199, 201, 203, 205, 206, 214, 215, 218, + 219, 224, 226 }; -#endif -/** Accessing symbol of state STATE. */ -#define YY_ACCESSING_SYMBOL(State) YY_CAST (yysymbol_kind_t, yystos[State]) +/* YYRHS -- A `-1'-separated list of the rules' RHS. */ +static const yytype_int8 yyrhs[] = +{ + 66, 0, -1, -1, 67, -1, 68, -1, 71, -1, + 79, -1, 86, -1, 69, -1, 70, -1, 92, -1, + 101, -1, 87, -1, 3, -1, 4, -1, 5, -1, + 6, -1, 7, -1, 8, -1, 9, -1, 10, -1, + 11, -1, 12, -1, 13, -1, 14, -1, 15, -1, + 16, -1, 17, -1, 18, -1, 19, -1, 20, -1, + 21, -1, 22, -1, 23, -1, 24, -1, 25, -1, + 26, -1, 27, -1, 28, -1, 29, -1, 30, -1, + 31, -1, 32, -1, 33, -1, 34, -1, 35, -1, + 36, -1, -1, 53, 72, 59, 73, 60, -1, -1, + 73, 74, -1, -1, 67, 75, 76, 77, 64, -1, + 57, -1, -1, 63, 78, -1, 58, -1, -1, 55, + 80, 59, 81, 67, 60, -1, -1, 81, 82, -1, + -1, -1, 61, 83, 85, 84, 62, -1, 58, -1, + 56, 59, 67, 60, -1, -1, -1, 50, 59, 51, + 90, 64, 88, 52, 91, 64, 89, 60, -1, 58, + -1, 57, -1, -1, -1, -1, -1, 37, 59, 38, + 97, 64, 93, 39, 98, 64, 94, 40, 99, 64, + 95, 41, 100, 64, 96, 60, -1, 42, -1, 58, + -1, 43, -1, 44, -1, 45, -1, 46, -1, 47, + -1, 48, -1, 49, -1, -1, 54, 59, 69, 64, + 102, 103, 60, -1, -1, 103, 104, -1, -1, 106, + 105, 107, 64, -1, 57, -1, 58, -1 +}; -#if YYDEBUG || 0 -/* The user-facing name of the symbol whose (internal) number is - YYSYMBOL. No bounds checking. */ -static const char *yysymbol_name (yysymbol_kind_t yysymbol) YY_ATTRIBUTE_UNUSED; +/* YYRLINE[YYN] -- source line where rule number YYN was defined. */ +static const yytype_uint16 yyrline[] = +{ + 0, 102, 102, 103, 105, 106, 107, 108, 110, 111, + 112, 113, 114, 117, 118, 119, 120, 121, 122, 123, + 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, + 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, + 146, 147, 148, 149, 150, 151, 152, 156, 155, 164, + 165, 167, 167, 204, 212, 213, 216, 218, 218, 227, + 228, 230, 231, 230, 238, 241, 248, 253, 245, 260, + 262, 267, 274, 283, 290, 264, 314, 315, 317, 318, + 319, 321, 322, 324, 325, 329, 328, 333, 334, 336, + 336, 386, 388 +}; +#endif +#if YYDEBUG || YYERROR_VERBOSE || 0 /* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM. First, the terminals, then, starting at YYNTOKENS, nonterminals. */ static const char *const yytname[] = { - "\"end of file\"", "error", "\"invalid token\"", "H5T_STD_I8BE_TOKEN", + "$end", "error", "$undefined", "H5T_STD_I8BE_TOKEN", "H5T_STD_I8LE_TOKEN", "H5T_STD_I16BE_TOKEN", "H5T_STD_I16LE_TOKEN", "H5T_STD_I32BE_TOKEN", "H5T_STD_I32LE_TOKEN", "H5T_STD_I64BE_TOKEN", "H5T_STD_I64LE_TOKEN", "H5T_STD_U8BE_TOKEN", "H5T_STD_U8LE_TOKEN", @@ -716,27 +649,21 @@ static const char *const yytname[] = "H5T_C_S1_TOKEN", "H5T_FORTRAN_S1_TOKEN", "H5T_OPAQUE_TOKEN", "OPQ_SIZE_TOKEN", "OPQ_TAG_TOKEN", "H5T_COMPOUND_TOKEN", "H5T_ENUM_TOKEN", "H5T_ARRAY_TOKEN", "H5T_VLEN_TOKEN", "STRING", - "NUMBER", "'{'", "'}'", "'['", "']'", "'\"'", "':'", "';'", "$accept", - "start", "ddl_type", "atomic_type", "integer_type", "fp_type", - "compound_type", "$@1", "memb_list", "memb_def", "$@2", "field_name", - "field_offset", "offset", "array_type", "$@3", "dim_list", "dim", "$@4", - "$@5", "dimsize", "vlen_type", "opaque_type", "$@6", "@7", "$@8", "$@9", - "opaque_size", "opaque_tag", "string_type", "$@10", "$@11", "$@12", - "$@13", "@14", "strsize", "strpad", "cset", "ctype", "enum_type", "$@15", - "enum_list", "enum_def", "$@16", "enum_symbol", "enum_val", YY_NULLPTR + "NUMBER", "'{'", "'}'", "'['", "']'", "':'", "';'", "$accept", "start", + "ddl_type", "atomic_type", "integer_type", "fp_type", "compound_type", + "$@1", "memb_list", "memb_def", "$@2", "field_name", "field_offset", + "offset", "array_type", "$@3", "dim_list", "dim", "$@4", "$@5", + "dimsize", "vlen_type", "opaque_type", "@6", "$@7", "opaque_size", + "opaque_tag", "string_type", "$@8", "$@9", "$@10", "@11", "strsize", + "strpad", "cset", "ctype", "enum_type", "$@12", "enum_list", "enum_def", + "$@13", "enum_symbol", "enum_val", YY_NULL }; - -static const char * -yysymbol_name (yysymbol_kind_t yysymbol) -{ - return yytname[yysymbol]; -} #endif -#ifdef YYPRINT -/* YYTOKNUM[NUM] -- (External) token number corresponding to the - (internal) symbol number NUM (which must be that of a token). */ -static const yytype_int16 yytoknum[] = +# ifdef YYPRINT +/* YYTOKNUM[YYLEX-NUM] -- Internal token number corresponding to + token YYLEX-NUM. */ +static const yytype_uint16 yytoknum[] = { 0, 256, 257, 258, 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, @@ -744,221 +671,241 @@ static const yytype_int16 yytoknum[] = 285, 286, 287, 288, 289, 290, 291, 292, 293, 294, 295, 296, 297, 298, 299, 300, 301, 302, 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, 123, - 125, 91, 93, 34, 58, 59 + 125, 91, 93, 58, 59 }; -#endif - -#define YYPACT_NINF (-25) - -#define yypact_value_is_default(Yyn) \ - ((Yyn) == YYPACT_NINF) - -#define YYTABLE_NINF (-1) +# endif -#define yytable_value_is_error(Yyn) \ - 0 +/* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */ +static const yytype_uint8 yyr1[] = +{ + 0, 65, 66, 66, 67, 67, 67, 67, 68, 68, + 68, 68, 68, 69, 69, 69, 69, 69, 69, 69, + 69, 69, 69, 69, 69, 69, 69, 69, 69, 69, + 69, 69, 69, 69, 69, 69, 69, 69, 69, 69, + 70, 70, 70, 70, 70, 70, 70, 72, 71, 73, + 73, 75, 74, 76, 77, 77, 78, 80, 79, 81, + 81, 83, 84, 82, 85, 86, 88, 89, 87, 90, + 91, 93, 94, 95, 96, 92, 97, 97, 98, 98, + 98, 99, 99, 100, 100, 102, 101, 103, 103, 105, + 104, 106, 107 +}; - /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing - STATE-NUM. */ -static const yytype_int16 yypact[] = +/* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN. */ +static const yytype_uint8 yyr2[] = { - 114, -25, -25, -25, -25, -25, -25, -25, -25, -25, - -25, -25, -25, -25, -25, -25, -25, -25, -25, -25, - -25, -25, -25, -25, -25, -25, -25, -25, -25, -25, - -25, -25, -25, -25, -25, -24, -20, -25, -15, -25, - -14, 49, -25, -25, -25, -25, -25, -25, -25, -25, - -25, -25, 19, 45, 38, 168, 39, 114, -25, -25, - -25, -25, 34, -25, 40, -4, 43, 56, -25, -3, - -25, -25, -25, 37, -25, 42, -25, -25, -25, -25, - -25, 44, -25, -25, -25, 50, -23, 47, -25, 64, - 62, 51, -25, 58, -25, -25, -25, -2, -25, -25, - 89, -25, 90, 92, -25, -25, -25, 91, 94, 95, - -25, -25, -25, 98, 100, 96, 102, 122, -25, 103, - -25, -25, -25, -25, 133, 9, 134, -25, -25, -25, - 135, -25, -25, 105, 160, -25, 46, -25, -25, 137, - -25, 143, -25 + 0, 2, 0, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 0, 5, 0, + 2, 0, 5, 1, 0, 2, 1, 0, 6, 0, + 2, 0, 0, 5, 1, 4, 0, 0, 11, 1, + 1, 0, 0, 0, 0, 19, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 0, 7, 0, 2, 0, + 4, 1, 1 }; - /* YYDEFACT[STATE-NUM] -- Default reduction number in state STATE-NUM. - Performed when YYTABLE does not specify something else to do. Zero - means the default is an error. */ -static const yytype_int8 yydefact[] = +/* YYDEFACT[STATE-NAME] -- Default reduction number in state STATE-NUM. + Performed when YYTABLE doesn't specify something else to do. Zero + means the default is an error. */ +static const yytype_uint8 yydefact[] = { 2, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 0, 0, 47, 0, 57, 0, 0, 3, 4, 8, 9, 5, 6, 7, 12, - 10, 11, 0, 0, 0, 0, 0, 0, 1, 73, - 66, 49, 0, 59, 0, 0, 0, 0, 88, 0, - 65, 79, 80, 0, 71, 0, 48, 51, 50, 90, - 61, 0, 60, 74, 67, 0, 0, 0, 58, 0, - 0, 0, 89, 0, 91, 64, 62, 0, 68, 53, - 0, 94, 0, 0, 81, 82, 83, 0, 0, 54, - 92, 63, 75, 0, 0, 0, 0, 0, 72, 0, - 56, 55, 52, 95, 0, 0, 0, 93, 84, 85, - 0, 69, 76, 0, 0, 70, 0, 86, 87, 0, - 77, 0, 78 + 10, 11, 0, 0, 0, 0, 0, 0, 1, 0, + 0, 49, 0, 59, 0, 76, 77, 0, 69, 0, + 0, 85, 0, 65, 71, 66, 48, 51, 50, 87, + 61, 0, 60, 0, 0, 0, 0, 0, 58, 0, + 0, 53, 54, 91, 86, 88, 89, 64, 62, 78, + 79, 80, 0, 70, 0, 0, 0, 0, 0, 72, + 67, 56, 55, 52, 92, 0, 63, 0, 0, 90, + 0, 68, 81, 82, 0, 73, 0, 0, 83, 84, + 0, 74, 0, 75 }; - /* YYPGOTO[NTERM-NUM]. */ -static const yytype_int8 yypgoto[] = +/* YYDEFGOTO[NTERM-NUM]. */ +static const yytype_int16 yydefgoto[] = { - -25, -25, -21, -25, 108, -25, -25, -25, -25, -25, - -25, -25, -25, -25, -25, -25, -25, -25, -25, -25, + -1, 41, 42, 43, 44, 45, 46, 54, 70, 78, + 85, 92, 106, 112, 47, 56, 72, 82, 87, 108, + 98, 48, 49, 84, 118, 69, 104, 50, 83, 117, + 126, 132, 67, 102, 124, 130, 51, 79, 86, 95, + 107, 96, 115 +}; + +/* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing + STATE-NUM. */ +#define YYPACT_NINF -25 +static const yytype_int16 yypact[] = +{ + 114, -25, -25, -25, -25, -25, -25, -25, -25, -25, -25, -25, -25, -25, -25, -25, -25, -25, -25, -25, -25, -25, -25, -25, -25, -25, -25, -25, -25, -25, - -25, -25, -25, -25, -25, -25 + -25, -25, -25, -25, -25, -24, -22, -25, -13, -25, + -11, 49, -25, -25, -25, -25, -25, -25, -25, -25, + -25, -25, 18, 45, 38, 168, 39, 114, -25, -4, + 41, -25, 36, -25, 42, -25, -25, 37, -25, 40, + 56, -25, -3, -25, -25, -25, -25, -25, -25, -25, + -25, 43, -25, 66, 55, 51, -21, 57, -25, 0, + 95, -25, 50, -25, -25, -25, -25, -25, -25, -25, + -25, -25, 89, -25, 90, 97, 92, 99, 52, -25, + -25, -25, -25, -25, -25, 94, -25, 119, 100, -25, + -6, -25, -25, -25, 98, -25, 120, 46, -25, -25, + 101, -25, 103, -25 }; - /* YYDEFGOTO[NTERM-NUM]. */ -static const yytype_int16 yydefgoto[] = +/* YYPGOTO[NTERM-NUM]. */ +static const yytype_int8 yypgoto[] = { - -1, 41, 42, 43, 44, 45, 46, 54, 67, 78, - 85, 100, 115, 121, 47, 56, 69, 82, 87, 103, - 96, 48, 49, 66, 90, 108, 133, 75, 119, 50, - 65, 89, 117, 134, 141, 73, 107, 130, 139, 51, - 79, 86, 94, 116, 102, 124 + -25, -25, -15, -25, 111, -25, -25, -25, -25, -25, + -25, -25, -25, -25, -25, -25, -25, -25, -25, -25, + -25, -25, -25, -25, -25, -25, -25, -25, -25, -25, + -25, -25, -25, -25, -25, -25, -25, -25, -25, -25, + -25, -25, -25 }; - /* YYTABLE[YYPACT[STATE-NUM]] -- What to do in state STATE-NUM. If - positive, shift that token. If negative, reduce the rule whose - number is the opposite. If YYTABLE_NINF, syntax error. */ +/* YYTABLE[YYPACT[STATE-NUM]]. What to do in state STATE-NUM. If + positive, shift that token. If negative, reduce the rule which + number is the opposite. If YYTABLE_NINF, syntax error. */ +#define YYTABLE_NINF -1 static const yytype_uint8 yytable[] = { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, - 31, 32, 33, 34, 35, 52, 64, 92, 71, 53, - 93, 104, 105, 106, 55, 57, 77, 36, 81, 58, - 37, 38, 39, 40, 72, 128, 129, 59, 80, 1, + 31, 32, 33, 34, 35, 52, 93, 53, 65, 94, + 122, 123, 64, 99, 100, 101, 55, 36, 57, 58, + 37, 38, 39, 40, 66, 77, 59, 81, 80, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, - 32, 33, 34, 35, 137, 138, 60, 61, 63, 68, - 70, 74, 83, 97, 88, 95, 36, 84, 99, 37, - 38, 39, 40, 91, 98, 101, 76, 1, 2, 3, + 32, 33, 34, 35, 128, 129, 60, 61, 63, 68, + 71, 74, 73, 88, 75, 89, 36, 90, 91, 37, + 38, 39, 40, 105, 116, 97, 76, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, - 34, 35, 109, 110, 111, 118, 112, 113, 120, 114, - 123, 122, 125, 62, 36, 135, 126, 37, 38, 39, + 34, 35, 103, 109, 110, 111, 113, 114, 119, 120, + 121, 127, 125, 133, 36, 131, 62, 37, 38, 39, 40, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, - 20, 21, 22, 23, 24, 25, 26, 27, 127, 131, - 132, 136, 140, 142 + 20, 21, 22, 23, 24, 25, 26, 27 }; -static const yytype_int8 yycheck[] = +#define yypact_value_is_default(Yystate) \ + (!!((Yystate) == (-25))) + +#define yytable_value_is_error(Yytable_value) \ + YYID (0) + +static const yytype_uint8 yycheck[] = { 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, - 33, 34, 35, 36, 37, 59, 57, 60, 42, 59, - 63, 43, 44, 45, 59, 59, 67, 50, 69, 0, - 53, 54, 55, 56, 58, 46, 47, 38, 61, 3, + 33, 34, 35, 36, 37, 59, 57, 59, 42, 60, + 46, 47, 57, 43, 44, 45, 59, 50, 59, 0, + 53, 54, 55, 56, 58, 70, 38, 72, 61, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, - 34, 35, 36, 37, 48, 49, 51, 59, 59, 65, - 60, 58, 65, 39, 60, 58, 50, 65, 57, 53, - 54, 55, 56, 63, 52, 57, 60, 3, 4, 5, + 34, 35, 36, 37, 48, 49, 51, 59, 59, 58, + 64, 64, 60, 60, 64, 39, 50, 52, 57, 53, + 54, 55, 56, 63, 62, 58, 60, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, - 36, 37, 63, 63, 62, 57, 65, 63, 58, 64, - 58, 65, 40, 55, 50, 60, 63, 53, 54, 55, + 36, 37, 57, 64, 64, 58, 64, 58, 64, 40, + 60, 41, 64, 60, 50, 64, 55, 53, 54, 55, 56, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, - 22, 23, 24, 25, 26, 27, 28, 29, 65, 65, - 65, 41, 65, 60 + 22, 23, 24, 25, 26, 27, 28, 29 }; - /* YYSTOS[STATE-NUM] -- The (internal number of the) accessing - symbol of state STATE-NUM. */ -static const yytype_int8 yystos[] = +/* YYSTOS[STATE-NUM] -- The (internal number of the) accessing + symbol of state STATE-NUM. */ +static const yytype_uint8 yystos[] = { 0, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 50, 53, 54, 55, - 56, 67, 68, 69, 70, 71, 72, 80, 87, 88, - 95, 105, 59, 59, 73, 59, 81, 59, 0, 38, - 51, 59, 70, 59, 68, 96, 89, 74, 65, 82, - 60, 42, 58, 101, 58, 93, 60, 68, 75, 106, - 61, 68, 83, 65, 65, 76, 107, 84, 60, 97, - 90, 63, 60, 63, 108, 58, 86, 39, 52, 57, - 77, 57, 110, 85, 43, 44, 45, 102, 91, 63, - 63, 62, 65, 63, 64, 78, 109, 98, 57, 94, - 58, 79, 65, 58, 111, 40, 63, 65, 46, 47, - 103, 65, 65, 92, 99, 60, 41, 48, 49, 104, - 65, 100, 60 -}; - - /* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */ -static const yytype_int8 yyr1[] = -{ - 0, 66, 67, 67, 68, 68, 68, 68, 69, 69, - 69, 69, 69, 70, 70, 70, 70, 70, 70, 70, - 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, - 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, - 71, 71, 71, 71, 71, 71, 71, 73, 72, 74, - 74, 76, 75, 77, 78, 78, 79, 81, 80, 82, - 82, 84, 85, 83, 86, 87, 89, 90, 91, 92, - 88, 93, 94, 96, 97, 98, 99, 100, 95, 101, - 101, 102, 102, 102, 103, 103, 104, 104, 106, 105, - 107, 107, 109, 108, 110, 111 -}; - - /* YYR2[YYN] -- Number of symbols on the right hand side of rule YYN. */ -static const yytype_int8 yyr2[] = -{ - 0, 2, 0, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 0, 5, 0, - 2, 0, 7, 1, 0, 2, 1, 0, 6, 0, - 2, 0, 0, 5, 1, 4, 0, 0, 0, 0, - 15, 1, 1, 0, 0, 0, 0, 0, 20, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 0, 7, - 0, 2, 0, 6, 1, 1 + 56, 66, 67, 68, 69, 70, 71, 79, 86, 87, + 92, 101, 59, 59, 72, 59, 80, 59, 0, 38, + 51, 59, 69, 59, 67, 42, 58, 97, 58, 90, + 73, 64, 81, 60, 64, 64, 60, 67, 74, 102, + 61, 67, 82, 93, 88, 75, 103, 83, 60, 39, + 52, 57, 76, 57, 60, 104, 106, 58, 85, 43, + 44, 45, 98, 57, 91, 63, 77, 105, 84, 64, + 64, 58, 78, 64, 58, 107, 62, 94, 89, 64, + 40, 60, 46, 47, 99, 64, 95, 41, 48, 49, + 100, 64, 96, 60 }; +#define yyerrok (yyerrstatus = 0) +#define yyclearin (yychar = YYEMPTY) +#define YYEMPTY (-2) +#define YYEOF 0 + +#define YYACCEPT goto yyacceptlab +#define YYABORT goto yyabortlab +#define YYERROR goto yyerrorlab + + +/* Like YYERROR except do call yyerror. This remains here temporarily + to ease the transition to the new meaning of YYERROR, for GCC. + Once GCC version 2 has supplanted version 1, this can go. However, + YYFAIL appears to be in use. Nevertheless, it is formally deprecated + in Bison 2.4.2's NEWS entry, where a plan to phase it out is + discussed. */ + +#define YYFAIL goto yyerrlab +#if defined YYFAIL + /* This is here to suppress warnings from the GCC cpp's + -Wunused-macros. Normally we don't worry about that warning, but + some users do, and we want to make it easy for users to remove + YYFAIL uses, which will produce warnings from Bison 2.5. */ +#endif -enum { YYENOMEM = -2 }; - -#define yyerrok (yyerrstatus = 0) -#define yyclearin (yychar = YYEMPTY) +#define YYRECOVERING() (!!yyerrstatus) -#define YYACCEPT goto yyacceptlab -#define YYABORT goto yyabortlab -#define YYERROR goto yyerrorlab +#define YYBACKUP(Token, Value) \ +do \ + if (yychar == YYEMPTY) \ + { \ + yychar = (Token); \ + yylval = (Value); \ + YYPOPSTACK (yylen); \ + yystate = *yyssp; \ + goto yybackup; \ + } \ + else \ + { \ + yyerror (YY_("syntax error: cannot back up")); \ + YYERROR; \ + } \ +while (YYID (0)) + +/* Error token number */ +#define YYTERROR 1 +#define YYERRCODE 256 -#define YYRECOVERING() (!!yyerrstatus) +/* This macro is provided for backward compatibility. */ +#ifndef YY_LOCATION_PRINT +# define YY_LOCATION_PRINT(File, Loc) ((void) 0) +#endif -#define YYBACKUP(Token, Value) \ - do \ - if (yychar == YYEMPTY) \ - { \ - yychar = (Token); \ - yylval = (Value); \ - YYPOPSTACK (yylen); \ - yystate = *yyssp; \ - goto yybackup; \ - } \ - else \ - { \ - yyerror (YY_("syntax error: cannot back up")); \ - YYERROR; \ - } \ - while (0) - -/* Backward compatibility with an undocumented macro. - Use YYerror or YYUNDEF. */ -#define YYERRCODE YYUNDEF +/* YYLEX -- calling `yylex' with the right arguments. */ +#ifdef YYLEX_PARAM +# define YYLEX yylex (YYLEX_PARAM) +#else +# define YYLEX yylex () +#endif /* Enable debugging if requested. */ #if YYDEBUG @@ -968,65 +915,82 @@ enum { YYENOMEM = -2 }; # define YYFPRINTF fprintf # endif -# define YYDPRINTF(Args) \ -do { \ - if (yydebug) \ - YYFPRINTF Args; \ -} while (0) - -/* This macro is provided for backward compatibility. */ -# ifndef YY_LOCATION_PRINT -# define YY_LOCATION_PRINT(File, Loc) ((void) 0) -# endif - - -# define YY_SYMBOL_PRINT(Title, Kind, Value, Location) \ -do { \ - if (yydebug) \ - { \ - YYFPRINTF (stderr, "%s ", Title); \ - yy_symbol_print (stderr, \ - Kind, Value); \ - YYFPRINTF (stderr, "\n"); \ - } \ -} while (0) - - -/*-----------------------------------. -| Print this symbol's value on YYO. | -`-----------------------------------*/ - +# define YYDPRINTF(Args) \ +do { \ + if (yydebug) \ + YYFPRINTF Args; \ +} while (YYID (0)) + +# define YY_SYMBOL_PRINT(Title, Type, Value, Location) \ +do { \ + if (yydebug) \ + { \ + YYFPRINTF (stderr, "%s ", Title); \ + yy_symbol_print (stderr, \ + Type, Value); \ + YYFPRINTF (stderr, "\n"); \ + } \ +} while (YYID (0)) + + +/*--------------------------------. +| Print this symbol on YYOUTPUT. | +`--------------------------------*/ + +/*ARGSUSED*/ +#if (defined __STDC__ || defined __C99__FUNC__ \ + || defined __cplusplus || defined _MSC_VER) static void -yy_symbol_value_print (FILE *yyo, - yysymbol_kind_t yykind, YYSTYPE const * const yyvaluep) +yy_symbol_value_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep) +#else +static void +yy_symbol_value_print (yyoutput, yytype, yyvaluep) + FILE *yyoutput; + int yytype; + YYSTYPE const * const yyvaluep; +#endif { - FILE *yyoutput = yyo; - YYUSE (yyoutput); + FILE *yyo = yyoutput; + YYUSE (yyo); if (!yyvaluep) return; # ifdef YYPRINT - if (yykind < YYNTOKENS) - YYPRINT (yyo, yytoknum[yykind], *yyvaluep); + if (yytype < YYNTOKENS) + YYPRINT (yyoutput, yytoknum[yytype], *yyvaluep); +# else + YYUSE (yyoutput); # endif - YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN - YYUSE (yykind); - YY_IGNORE_MAYBE_UNINITIALIZED_END + switch (yytype) + { + default: + break; + } } -/*---------------------------. -| Print this symbol on YYO. | -`---------------------------*/ +/*--------------------------------. +| Print this symbol on YYOUTPUT. | +`--------------------------------*/ +#if (defined __STDC__ || defined __C99__FUNC__ \ + || defined __cplusplus || defined _MSC_VER) static void -yy_symbol_print (FILE *yyo, - yysymbol_kind_t yykind, YYSTYPE const * const yyvaluep) +yy_symbol_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep) +#else +static void +yy_symbol_print (yyoutput, yytype, yyvaluep) + FILE *yyoutput; + int yytype; + YYSTYPE const * const yyvaluep; +#endif { - YYFPRINTF (yyo, "%s %s (", - yykind < YYNTOKENS ? "token" : "nterm", yysymbol_name (yykind)); + if (yytype < YYNTOKENS) + YYFPRINTF (yyoutput, "token %s (", yytname[yytype]); + else + YYFPRINTF (yyoutput, "nterm %s (", yytname[yytype]); - yy_symbol_value_print (yyo, yykind, yyvaluep); - YYFPRINTF (yyo, ")"); + yy_symbol_value_print (yyoutput, yytype, yyvaluep); + YYFPRINTF (yyoutput, ")"); } /*------------------------------------------------------------------. @@ -1034,8 +998,16 @@ yy_symbol_print (FILE *yyo, | TOP (included). | `------------------------------------------------------------------*/ +#if (defined __STDC__ || defined __C99__FUNC__ \ + || defined __cplusplus || defined _MSC_VER) +static void +yy_stack_print (yytype_int16 *yybottom, yytype_int16 *yytop) +#else static void -yy_stack_print (yy_state_t *yybottom, yy_state_t *yytop) +yy_stack_print (yybottom, yytop) + yytype_int16 *yybottom; + yytype_int16 *yytop; +#endif { YYFPRINTF (stderr, "Stack now"); for (; yybottom <= yytop; yybottom++) @@ -1046,56 +1018,63 @@ yy_stack_print (yy_state_t *yybottom, yy_state_t *yytop) YYFPRINTF (stderr, "\n"); } -# define YY_STACK_PRINT(Bottom, Top) \ -do { \ - if (yydebug) \ - yy_stack_print ((Bottom), (Top)); \ -} while (0) +# define YY_STACK_PRINT(Bottom, Top) \ +do { \ + if (yydebug) \ + yy_stack_print ((Bottom), (Top)); \ +} while (YYID (0)) /*------------------------------------------------. | Report that the YYRULE is going to be reduced. | `------------------------------------------------*/ +#if (defined __STDC__ || defined __C99__FUNC__ \ + || defined __cplusplus || defined _MSC_VER) static void -yy_reduce_print (yy_state_t *yyssp, YYSTYPE *yyvsp, - int yyrule) +yy_reduce_print (YYSTYPE *yyvsp, int yyrule) +#else +static void +yy_reduce_print (yyvsp, yyrule) + YYSTYPE *yyvsp; + int yyrule; +#endif { - int yylno = yyrline[yyrule]; int yynrhs = yyr2[yyrule]; int yyi; - YYFPRINTF (stderr, "Reducing stack by rule %d (line %d):\n", - yyrule - 1, yylno); + unsigned long int yylno = yyrline[yyrule]; + YYFPRINTF (stderr, "Reducing stack by rule %d (line %lu):\n", + yyrule - 1, yylno); /* The symbols being reduced. */ for (yyi = 0; yyi < yynrhs; yyi++) { YYFPRINTF (stderr, " $%d = ", yyi + 1); - yy_symbol_print (stderr, - YY_ACCESSING_SYMBOL (+yyssp[yyi + 1 - yynrhs]), - &yyvsp[(yyi + 1) - (yynrhs)]); + yy_symbol_print (stderr, yyrhs[yyprhs[yyrule] + yyi], + &(yyvsp[(yyi + 1) - (yynrhs)]) + ); YYFPRINTF (stderr, "\n"); } } -# define YY_REDUCE_PRINT(Rule) \ -do { \ - if (yydebug) \ - yy_reduce_print (yyssp, yyvsp, Rule); \ -} while (0) +# define YY_REDUCE_PRINT(Rule) \ +do { \ + if (yydebug) \ + yy_reduce_print (yyvsp, Rule); \ +} while (YYID (0)) /* Nonzero means print parse trace. It is left uninitialized so that multiple parsers can coexist. */ int yydebug; #else /* !YYDEBUG */ -# define YYDPRINTF(Args) ((void) 0) -# define YY_SYMBOL_PRINT(Title, Kind, Value, Location) +# define YYDPRINTF(Args) +# define YY_SYMBOL_PRINT(Title, Type, Value, Location) # define YY_STACK_PRINT(Bottom, Top) # define YY_REDUCE_PRINT(Rule) #endif /* !YYDEBUG */ /* YYINITDEPTH -- initial size of the parser's stacks. */ -#ifndef YYINITDEPTH +#ifndef YYINITDEPTH # define YYINITDEPTH 200 #endif @@ -1111,77 +1090,363 @@ int yydebug; #endif +#if YYERROR_VERBOSE + +# ifndef yystrlen +# if defined __GLIBC__ && defined _STRING_H +# define yystrlen strlen +# else +/* Return the length of YYSTR. */ +#if (defined __STDC__ || defined __C99__FUNC__ \ + || defined __cplusplus || defined _MSC_VER) +static YYSIZE_T +yystrlen (const char *yystr) +#else +static YYSIZE_T +yystrlen (yystr) + const char *yystr; +#endif +{ + YYSIZE_T yylen; + for (yylen = 0; yystr[yylen]; yylen++) + continue; + return yylen; +} +# endif +# endif + +# ifndef yystpcpy +# if defined __GLIBC__ && defined _STRING_H && defined _GNU_SOURCE +# define yystpcpy stpcpy +# else +/* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in + YYDEST. */ +#if (defined __STDC__ || defined __C99__FUNC__ \ + || defined __cplusplus || defined _MSC_VER) +static char * +yystpcpy (char *yydest, const char *yysrc) +#else +static char * +yystpcpy (yydest, yysrc) + char *yydest; + const char *yysrc; +#endif +{ + char *yyd = yydest; + const char *yys = yysrc; + + while ((*yyd++ = *yys++) != '\0') + continue; + + return yyd - 1; +} +# endif +# endif + +# ifndef yytnamerr +/* Copy to YYRES the contents of YYSTR after stripping away unnecessary + quotes and backslashes, so that it's suitable for yyerror. The + heuristic is that double-quoting is unnecessary unless the string + contains an apostrophe, a comma, or backslash (other than + backslash-backslash). YYSTR is taken from yytname. If YYRES is + null, do not copy; instead, return the length of what the result + would have been. */ +static YYSIZE_T +yytnamerr (char *yyres, const char *yystr) +{ + if (*yystr == '"') + { + YYSIZE_T yyn = 0; + char const *yyp = yystr; + + for (;;) + switch (*++yyp) + { + case '\'': + case ',': + goto do_not_strip_quotes; + + case '\\': + if (*++yyp != '\\') + goto do_not_strip_quotes; + /* Fall through. */ + default: + if (yyres) + yyres[yyn] = *yyp; + yyn++; + break; + + case '"': + if (yyres) + yyres[yyn] = '\0'; + return yyn; + } + do_not_strip_quotes: ; + } + + if (! yyres) + return yystrlen (yystr); + + return yystpcpy (yyres, yystr) - yyres; +} +# endif + +/* Copy into *YYMSG, which is of size *YYMSG_ALLOC, an error message + about the unexpected token YYTOKEN for the state stack whose top is + YYSSP. + + Return 0 if *YYMSG was successfully written. Return 1 if *YYMSG is + not large enough to hold the message. In that case, also set + *YYMSG_ALLOC to the required number of bytes. Return 2 if the + required number of bytes is too large to store. */ +static int +yysyntax_error (YYSIZE_T *yymsg_alloc, char **yymsg, + yytype_int16 *yyssp, int yytoken) +{ + YYSIZE_T yysize0 = yytnamerr (YY_NULL, yytname[yytoken]); + YYSIZE_T yysize = yysize0; + enum { YYERROR_VERBOSE_ARGS_MAXIMUM = 5 }; + /* Internationalized format string. */ + const char *yyformat = YY_NULL; + /* Arguments of yyformat. */ + char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM]; + /* Number of reported tokens (one for the "unexpected", one per + "expected"). */ + int yycount = 0; + + /* There are many possibilities here to consider: + - Assume YYFAIL is not used. It's too flawed to consider. See + + for details. YYERROR is fine as it does not invoke this + function. + - If this state is a consistent state with a default action, then + the only way this function was invoked is if the default action + is an error action. In that case, don't check for expected + tokens because there are none. + - The only way there can be no lookahead present (in yychar) is if + this state is a consistent state with a default action. Thus, + detecting the absence of a lookahead is sufficient to determine + that there is no unexpected or expected token to report. In that + case, just report a simple "syntax error". + - Don't assume there isn't a lookahead just because this state is a + consistent state with a default action. There might have been a + previous inconsistent state, consistent state with a non-default + action, or user semantic action that manipulated yychar. + - Of course, the expected token list depends on states to have + correct lookahead information, and it depends on the parser not + to perform extra reductions after fetching a lookahead from the + scanner and before detecting a syntax error. Thus, state merging + (from LALR or IELR) and default reductions corrupt the expected + token list. However, the list is correct for canonical LR with + one exception: it will still contain any token that will not be + accepted due to an error action in a later state. + */ + if (yytoken != YYEMPTY) + { + int yyn = yypact[*yyssp]; + yyarg[yycount++] = yytname[yytoken]; + if (!yypact_value_is_default (yyn)) + { + /* Start YYX at -YYN if negative to avoid negative indexes in + YYCHECK. In other words, skip the first -YYN actions for + this state because they are default actions. */ + int yyxbegin = yyn < 0 ? -yyn : 0; + /* Stay within bounds of both yycheck and yytname. */ + int yychecklim = YYLAST - yyn + 1; + int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS; + int yyx; + + for (yyx = yyxbegin; yyx < yyxend; ++yyx) + if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR + && !yytable_value_is_error (yytable[yyx + yyn])) + { + if (yycount == YYERROR_VERBOSE_ARGS_MAXIMUM) + { + yycount = 1; + yysize = yysize0; + break; + } + yyarg[yycount++] = yytname[yyx]; + { + YYSIZE_T yysize1 = yysize + yytnamerr (YY_NULL, yytname[yyx]); + if (! (yysize <= yysize1 + && yysize1 <= YYSTACK_ALLOC_MAXIMUM)) + return 2; + yysize = yysize1; + } + } + } + } + + switch (yycount) + { +# define YYCASE_(N, S) \ + case N: \ + yyformat = S; \ + break + YYCASE_(0, YY_("syntax error")); + YYCASE_(1, YY_("syntax error, unexpected %s")); + YYCASE_(2, YY_("syntax error, unexpected %s, expecting %s")); + YYCASE_(3, YY_("syntax error, unexpected %s, expecting %s or %s")); + YYCASE_(4, YY_("syntax error, unexpected %s, expecting %s or %s or %s")); + YYCASE_(5, YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s")); +# undef YYCASE_ + } + { + YYSIZE_T yysize1 = yysize + yystrlen (yyformat); + if (! (yysize <= yysize1 && yysize1 <= YYSTACK_ALLOC_MAXIMUM)) + return 2; + yysize = yysize1; + } + if (*yymsg_alloc < yysize) + { + *yymsg_alloc = 2 * yysize; + if (! (yysize <= *yymsg_alloc + && *yymsg_alloc <= YYSTACK_ALLOC_MAXIMUM)) + *yymsg_alloc = YYSTACK_ALLOC_MAXIMUM; + return 1; + } + /* Avoid sprintf, as that infringes on the user's name space. + Don't have undefined behavior even if the translation + produced a string with the wrong number of "%s"s. */ + { + char *yyp = *yymsg; + int yyi = 0; + while ((*yyp = *yyformat) != '\0') + if (*yyp == '%' && yyformat[1] == 's' && yyi < yycount) + { + yyp += yytnamerr (yyp, yyarg[yyi++]); + yyformat += 2; + } + else + { + yyp++; + yyformat++; + } + } + return 0; +} +#endif /* YYERROR_VERBOSE */ /*-----------------------------------------------. | Release the memory associated to this symbol. | `-----------------------------------------------*/ +/*ARGSUSED*/ +#if (defined __STDC__ || defined __C99__FUNC__ \ + || defined __cplusplus || defined _MSC_VER) +static void +yydestruct (const char *yymsg, int yytype, YYSTYPE *yyvaluep) +#else static void -yydestruct (const char *yymsg, - yysymbol_kind_t yykind, YYSTYPE *yyvaluep) +yydestruct (yymsg, yytype, yyvaluep) + const char *yymsg; + int yytype; + YYSTYPE *yyvaluep; +#endif { YYUSE (yyvaluep); + if (!yymsg) yymsg = "Deleting"; - YY_SYMBOL_PRINT (yymsg, yykind, yyvaluep, yylocationp); + YY_SYMBOL_PRINT (yymsg, yytype, yyvaluep, yylocationp); - YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN - YYUSE (yykind); - YY_IGNORE_MAYBE_UNINITIALIZED_END + switch (yytype) + { + + default: + break; + } } -/* Lookahead token kind. */ + + +/* The lookahead symbol. */ int yychar; + +#ifndef YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN +# define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN +# define YY_IGNORE_MAYBE_UNINITIALIZED_END +#endif +#ifndef YY_INITIAL_VALUE +# define YY_INITIAL_VALUE(Value) /* Nothing. */ +#endif + /* The semantic value of the lookahead symbol. */ -YYSTYPE yylval; +YYSTYPE yylval YY_INITIAL_VALUE(yyval_default); + /* Number of syntax errors so far. */ int yynerrs; - - /*----------. | yyparse. | `----------*/ +#ifdef YYPARSE_PARAM +#if (defined __STDC__ || defined __C99__FUNC__ \ + || defined __cplusplus || defined _MSC_VER) +hid_t +yyparse (void *YYPARSE_PARAM) +#else +hid_t +yyparse (YYPARSE_PARAM) + void *YYPARSE_PARAM; +#endif +#else /* ! YYPARSE_PARAM */ +#if (defined __STDC__ || defined __C99__FUNC__ \ + || defined __cplusplus || defined _MSC_VER) hid_t yyparse (void) +#else +hid_t +yyparse () + +#endif +#endif { - yy_state_fast_t yystate = 0; + int yystate; /* Number of tokens to shift before error messages enabled. */ - int yyerrstatus = 0; + int yyerrstatus; - /* Refer to the stacks through separate pointers, to allow yyoverflow - to reallocate them elsewhere. */ + /* The stacks and their tools: + `yyss': related to states. + `yyvs': related to semantic values. - /* Their size. */ - YYPTRDIFF_T yystacksize = YYINITDEPTH; + Refer to the stacks through separate pointers, to allow yyoverflow + to reallocate them elsewhere. */ - /* The state stack: array, bottom, top. */ - yy_state_t yyssa[YYINITDEPTH]; - yy_state_t *yyss = yyssa; - yy_state_t *yyssp = yyss; + /* The state stack. */ + yytype_int16 yyssa[YYINITDEPTH]; + yytype_int16 *yyss; + yytype_int16 *yyssp; - /* The semantic value stack: array, bottom, top. */ + /* The semantic value stack. */ YYSTYPE yyvsa[YYINITDEPTH]; - YYSTYPE *yyvs = yyvsa; - YYSTYPE *yyvsp = yyvs; + YYSTYPE *yyvs; + YYSTYPE *yyvsp; + + YYSIZE_T yystacksize; int yyn; - /* The return value of yyparse. */ int yyresult; - /* Lookahead symbol kind. */ - yysymbol_kind_t yytoken = YYSYMBOL_YYEMPTY; + /* Lookahead token as an internal (translated) token number. */ + int yytoken = 0; /* The variables used to return semantic value and location from the action routines. */ YYSTYPE yyval; - +#if YYERROR_VERBOSE + /* Buffer for error messages, and its allocated size. */ + char yymsgbuf[128]; + char *yymsg = yymsgbuf; + YYSIZE_T yymsg_alloc = sizeof yymsgbuf; +#endif #define YYPOPSTACK(N) (yyvsp -= (N), yyssp -= (N)) @@ -1189,105 +1454,102 @@ yyparse (void) Keep to zero when no symbol should be popped. */ int yylen = 0; + yyssp = yyss = yyssa; + yyvsp = yyvs = yyvsa; + yystacksize = YYINITDEPTH; + YYDPRINTF ((stderr, "Starting parse\n")); + yystate = 0; + yyerrstatus = 0; + yynerrs = 0; yychar = YYEMPTY; /* Cause a token to be read. */ goto yysetstate; - /*------------------------------------------------------------. -| yynewstate -- push a new state, which is found in yystate. | +| yynewstate -- Push a new state, which is found in yystate. | `------------------------------------------------------------*/ -yynewstate: + yynewstate: /* In all cases, when you get here, the value and location stacks have just been pushed. So pushing a state here evens the stacks. */ yyssp++; - -/*--------------------------------------------------------------------. -| yysetstate -- set current state (the top of the stack) to yystate. | -`--------------------------------------------------------------------*/ -yysetstate: - YYDPRINTF ((stderr, "Entering state %d\n", yystate)); - YY_ASSERT (0 <= yystate && yystate < YYNSTATES); - YY_IGNORE_USELESS_CAST_BEGIN - *yyssp = YY_CAST (yy_state_t, yystate); - YY_IGNORE_USELESS_CAST_END - YY_STACK_PRINT (yyss, yyssp); + yysetstate: + *yyssp = yystate; if (yyss + yystacksize - 1 <= yyssp) -#if !defined yyoverflow && !defined YYSTACK_RELOCATE - goto yyexhaustedlab; -#else { /* Get the current used size of the three stacks, in elements. */ - YYPTRDIFF_T yysize = yyssp - yyss + 1; + YYSIZE_T yysize = yyssp - yyss + 1; -# if defined yyoverflow +#ifdef yyoverflow { - /* Give user a chance to reallocate the stack. Use copies of - these so that the &'s don't force the real ones into - memory. */ - yy_state_t *yyss1 = yyss; - YYSTYPE *yyvs1 = yyvs; - - /* Each stack pointer address is followed by the size of the - data in use in that stack, in bytes. This used to be a - conditional around just the two extra args, but that might - be undefined if yyoverflow is a macro. */ - yyoverflow (YY_("memory exhausted"), - &yyss1, yysize * YYSIZEOF (*yyssp), - &yyvs1, yysize * YYSIZEOF (*yyvsp), - &yystacksize); - yyss = yyss1; - yyvs = yyvs1; + /* Give user a chance to reallocate the stack. Use copies of + these so that the &'s don't force the real ones into + memory. */ + YYSTYPE *yyvs1 = yyvs; + yytype_int16 *yyss1 = yyss; + + /* Each stack pointer address is followed by the size of the + data in use in that stack, in bytes. This used to be a + conditional around just the two extra args, but that might + be undefined if yyoverflow is a macro. */ + yyoverflow (YY_("memory exhausted"), + &yyss1, yysize * sizeof (*yyssp), + &yyvs1, yysize * sizeof (*yyvsp), + &yystacksize); + + yyss = yyss1; + yyvs = yyvs1; } -# else /* defined YYSTACK_RELOCATE */ +#else /* no yyoverflow */ +# ifndef YYSTACK_RELOCATE + goto yyexhaustedlab; +# else /* Extend the stack our own way. */ if (YYMAXDEPTH <= yystacksize) - goto yyexhaustedlab; + goto yyexhaustedlab; yystacksize *= 2; if (YYMAXDEPTH < yystacksize) - yystacksize = YYMAXDEPTH; + yystacksize = YYMAXDEPTH; { - yy_state_t *yyss1 = yyss; - union yyalloc *yyptr = - YY_CAST (union yyalloc *, - YYSTACK_ALLOC (YY_CAST (YYSIZE_T, YYSTACK_BYTES (yystacksize)))); - if (! yyptr) - goto yyexhaustedlab; - YYSTACK_RELOCATE (yyss_alloc, yyss); - YYSTACK_RELOCATE (yyvs_alloc, yyvs); + yytype_int16 *yyss1 = yyss; + union yyalloc *yyptr = + (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize)); + if (! yyptr) + goto yyexhaustedlab; + YYSTACK_RELOCATE (yyss_alloc, yyss); + YYSTACK_RELOCATE (yyvs_alloc, yyvs); # undef YYSTACK_RELOCATE - if (yyss1 != yyssa) - YYSTACK_FREE (yyss1); + if (yyss1 != yyssa) + YYSTACK_FREE (yyss1); } # endif +#endif /* no yyoverflow */ yyssp = yyss + yysize - 1; yyvsp = yyvs + yysize - 1; - YY_IGNORE_USELESS_CAST_BEGIN - YYDPRINTF ((stderr, "Stack size increased to %ld\n", - YY_CAST (long, yystacksize))); - YY_IGNORE_USELESS_CAST_END + YYDPRINTF ((stderr, "Stack size increased to %lu\n", + (unsigned long int) yystacksize)); if (yyss + yystacksize - 1 <= yyssp) - YYABORT; + YYABORT; } -#endif /* !defined yyoverflow && !defined YYSTACK_RELOCATE */ + + YYDPRINTF ((stderr, "Entering state %d\n", yystate)); if (yystate == YYFINAL) YYACCEPT; goto yybackup; - /*-----------. | yybackup. | `-----------*/ yybackup: + /* Do appropriate processing given the current state. Read a lookahead token if we need one and don't already have one. */ @@ -1298,29 +1560,18 @@ yyparse (void) /* Not known => get a lookahead token if don't already have one. */ - /* YYCHAR is either empty, or end-of-input, or a valid lookahead. */ + /* YYCHAR is either YYEMPTY or YYEOF or a valid lookahead symbol. */ if (yychar == YYEMPTY) { - YYDPRINTF ((stderr, "Reading a token\n")); - yychar = yylex (); + YYDPRINTF ((stderr, "Reading a token: ")); + yychar = YYLEX; } if (yychar <= YYEOF) { - yychar = YYEOF; - yytoken = YYSYMBOL_YYEOF; + yychar = yytoken = YYEOF; YYDPRINTF ((stderr, "Now at end of input.\n")); } - else if (yychar == YYerror) - { - /* The scanner already issued an error message, process directly - to error recovery. But do not keep the error token as - lookahead, it is too special and may lead us to an endless - loop in error recovery. */ - yychar = YYUNDEF; - yytoken = YYSYMBOL_YYerror; - goto yyerrlab1; - } else { yytoken = YYTRANSLATE (yychar); @@ -1348,13 +1599,15 @@ yyparse (void) /* Shift the lookahead token. */ YY_SYMBOL_PRINT ("Shifting", yytoken, &yylval, &yylloc); + + /* Discard the shifted token. */ + yychar = YYEMPTY; + yystate = yyn; YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN *++yyvsp = yylval; YY_IGNORE_MAYBE_UNINITIALIZED_END - /* Discard the shifted token. */ - yychar = YYEMPTY; goto yynewstate; @@ -1369,14 +1622,14 @@ yyparse (void) /*-----------------------------. -| yyreduce -- do a reduction. | +| yyreduce -- Do a reduction. | `-----------------------------*/ yyreduce: /* yyn is the number of a rule to reduce with. */ yylen = yyr2[yyn]; /* If YYLEN is nonzero, implement the default value of the action: - '$$ = $1'. + `$$ = $1'. Otherwise, the following line sets YYVAL to garbage. This behavior is undocumented and Bison @@ -1389,440 +1642,420 @@ yyparse (void) YY_REDUCE_PRINT (yyn); switch (yyn) { - case 2: /* start: %empty */ -#line 105 "hl/src/H5LTparse.y" - { memset(arr_stack, 0, STACK_SIZE*sizeof(struct arr_info)); /*initialize here?*/ } -#line 1366 "hl/src/H5LTparse.c" + case 2: +/* Line 1792 of yacc.c */ +#line 102 "hl/src//H5LTparse.y" + { memset(arr_stack, 0, STACK_SIZE*sizeof(struct arr_info)); /*initialize here?*/ } break; - case 3: /* start: ddl_type */ -#line 106 "hl/src/H5LTparse.y" - { return (yyval.hid);} -#line 1372 "hl/src/H5LTparse.c" + case 3: +/* Line 1792 of yacc.c */ +#line 103 "hl/src//H5LTparse.y" + { return (yyval.hid);} break; - case 13: /* integer_type: H5T_STD_I8BE_TOKEN */ -#line 120 "hl/src/H5LTparse.y" - { (yyval.hid) = H5Tcopy(H5T_STD_I8BE); } -#line 1378 "hl/src/H5LTparse.c" + case 13: +/* Line 1792 of yacc.c */ +#line 117 "hl/src//H5LTparse.y" + { (yyval.hid) = H5Tcopy(H5T_STD_I8BE); } break; - case 14: /* integer_type: H5T_STD_I8LE_TOKEN */ -#line 121 "hl/src/H5LTparse.y" - { (yyval.hid) = H5Tcopy(H5T_STD_I8LE); } -#line 1384 "hl/src/H5LTparse.c" + case 14: +/* Line 1792 of yacc.c */ +#line 118 "hl/src//H5LTparse.y" + { (yyval.hid) = H5Tcopy(H5T_STD_I8LE); } break; - case 15: /* integer_type: H5T_STD_I16BE_TOKEN */ -#line 122 "hl/src/H5LTparse.y" - { (yyval.hid) = H5Tcopy(H5T_STD_I16BE); } -#line 1390 "hl/src/H5LTparse.c" + case 15: +/* Line 1792 of yacc.c */ +#line 119 "hl/src//H5LTparse.y" + { (yyval.hid) = H5Tcopy(H5T_STD_I16BE); } break; - case 16: /* integer_type: H5T_STD_I16LE_TOKEN */ -#line 123 "hl/src/H5LTparse.y" - { (yyval.hid) = H5Tcopy(H5T_STD_I16LE); } -#line 1396 "hl/src/H5LTparse.c" + case 16: +/* Line 1792 of yacc.c */ +#line 120 "hl/src//H5LTparse.y" + { (yyval.hid) = H5Tcopy(H5T_STD_I16LE); } break; - case 17: /* integer_type: H5T_STD_I32BE_TOKEN */ -#line 124 "hl/src/H5LTparse.y" - { (yyval.hid) = H5Tcopy(H5T_STD_I32BE); } -#line 1402 "hl/src/H5LTparse.c" + case 17: +/* Line 1792 of yacc.c */ +#line 121 "hl/src//H5LTparse.y" + { (yyval.hid) = H5Tcopy(H5T_STD_I32BE); } break; - case 18: /* integer_type: H5T_STD_I32LE_TOKEN */ -#line 125 "hl/src/H5LTparse.y" - { (yyval.hid) = H5Tcopy(H5T_STD_I32LE); } -#line 1408 "hl/src/H5LTparse.c" + case 18: +/* Line 1792 of yacc.c */ +#line 122 "hl/src//H5LTparse.y" + { (yyval.hid) = H5Tcopy(H5T_STD_I32LE); } break; - case 19: /* integer_type: H5T_STD_I64BE_TOKEN */ -#line 126 "hl/src/H5LTparse.y" - { (yyval.hid) = H5Tcopy(H5T_STD_I64BE); } -#line 1414 "hl/src/H5LTparse.c" + case 19: +/* Line 1792 of yacc.c */ +#line 123 "hl/src//H5LTparse.y" + { (yyval.hid) = H5Tcopy(H5T_STD_I64BE); } break; - case 20: /* integer_type: H5T_STD_I64LE_TOKEN */ -#line 127 "hl/src/H5LTparse.y" - { (yyval.hid) = H5Tcopy(H5T_STD_I64LE); } -#line 1420 "hl/src/H5LTparse.c" + case 20: +/* Line 1792 of yacc.c */ +#line 124 "hl/src//H5LTparse.y" + { (yyval.hid) = H5Tcopy(H5T_STD_I64LE); } break; - case 21: /* integer_type: H5T_STD_U8BE_TOKEN */ -#line 128 "hl/src/H5LTparse.y" - { (yyval.hid) = H5Tcopy(H5T_STD_U8BE); } -#line 1426 "hl/src/H5LTparse.c" + case 21: +/* Line 1792 of yacc.c */ +#line 125 "hl/src//H5LTparse.y" + { (yyval.hid) = H5Tcopy(H5T_STD_U8BE); } break; - case 22: /* integer_type: H5T_STD_U8LE_TOKEN */ -#line 129 "hl/src/H5LTparse.y" - { (yyval.hid) = H5Tcopy(H5T_STD_U8LE); } -#line 1432 "hl/src/H5LTparse.c" + case 22: +/* Line 1792 of yacc.c */ +#line 126 "hl/src//H5LTparse.y" + { (yyval.hid) = H5Tcopy(H5T_STD_U8LE); } break; - case 23: /* integer_type: H5T_STD_U16BE_TOKEN */ -#line 130 "hl/src/H5LTparse.y" - { (yyval.hid) = H5Tcopy(H5T_STD_U16BE); } -#line 1438 "hl/src/H5LTparse.c" + case 23: +/* Line 1792 of yacc.c */ +#line 127 "hl/src//H5LTparse.y" + { (yyval.hid) = H5Tcopy(H5T_STD_U16BE); } break; - case 24: /* integer_type: H5T_STD_U16LE_TOKEN */ -#line 131 "hl/src/H5LTparse.y" - { (yyval.hid) = H5Tcopy(H5T_STD_U16LE); } -#line 1444 "hl/src/H5LTparse.c" + case 24: +/* Line 1792 of yacc.c */ +#line 128 "hl/src//H5LTparse.y" + { (yyval.hid) = H5Tcopy(H5T_STD_U16LE); } break; - case 25: /* integer_type: H5T_STD_U32BE_TOKEN */ -#line 132 "hl/src/H5LTparse.y" - { (yyval.hid) = H5Tcopy(H5T_STD_U32BE); } -#line 1450 "hl/src/H5LTparse.c" + case 25: +/* Line 1792 of yacc.c */ +#line 129 "hl/src//H5LTparse.y" + { (yyval.hid) = H5Tcopy(H5T_STD_U32BE); } break; - case 26: /* integer_type: H5T_STD_U32LE_TOKEN */ -#line 133 "hl/src/H5LTparse.y" - { (yyval.hid) = H5Tcopy(H5T_STD_U32LE); } -#line 1456 "hl/src/H5LTparse.c" + case 26: +/* Line 1792 of yacc.c */ +#line 130 "hl/src//H5LTparse.y" + { (yyval.hid) = H5Tcopy(H5T_STD_U32LE); } break; - case 27: /* integer_type: H5T_STD_U64BE_TOKEN */ -#line 134 "hl/src/H5LTparse.y" - { (yyval.hid) = H5Tcopy(H5T_STD_U64BE); } -#line 1462 "hl/src/H5LTparse.c" + case 27: +/* Line 1792 of yacc.c */ +#line 131 "hl/src//H5LTparse.y" + { (yyval.hid) = H5Tcopy(H5T_STD_U64BE); } break; - case 28: /* integer_type: H5T_STD_U64LE_TOKEN */ -#line 135 "hl/src/H5LTparse.y" - { (yyval.hid) = H5Tcopy(H5T_STD_U64LE); } -#line 1468 "hl/src/H5LTparse.c" + case 28: +/* Line 1792 of yacc.c */ +#line 132 "hl/src//H5LTparse.y" + { (yyval.hid) = H5Tcopy(H5T_STD_U64LE); } break; - case 29: /* integer_type: H5T_NATIVE_CHAR_TOKEN */ -#line 136 "hl/src/H5LTparse.y" - { (yyval.hid) = H5Tcopy(H5T_NATIVE_CHAR); } -#line 1474 "hl/src/H5LTparse.c" + case 29: +/* Line 1792 of yacc.c */ +#line 133 "hl/src//H5LTparse.y" + { (yyval.hid) = H5Tcopy(H5T_NATIVE_CHAR); } break; - case 30: /* integer_type: H5T_NATIVE_SCHAR_TOKEN */ -#line 137 "hl/src/H5LTparse.y" - { (yyval.hid) = H5Tcopy(H5T_NATIVE_SCHAR); } -#line 1480 "hl/src/H5LTparse.c" + case 30: +/* Line 1792 of yacc.c */ +#line 134 "hl/src//H5LTparse.y" + { (yyval.hid) = H5Tcopy(H5T_NATIVE_SCHAR); } break; - case 31: /* integer_type: H5T_NATIVE_UCHAR_TOKEN */ -#line 138 "hl/src/H5LTparse.y" - { (yyval.hid) = H5Tcopy(H5T_NATIVE_UCHAR); } -#line 1486 "hl/src/H5LTparse.c" + case 31: +/* Line 1792 of yacc.c */ +#line 135 "hl/src//H5LTparse.y" + { (yyval.hid) = H5Tcopy(H5T_NATIVE_UCHAR); } break; - case 32: /* integer_type: H5T_NATIVE_SHORT_TOKEN */ -#line 139 "hl/src/H5LTparse.y" - { (yyval.hid) = H5Tcopy(H5T_NATIVE_SHORT); } -#line 1492 "hl/src/H5LTparse.c" + case 32: +/* Line 1792 of yacc.c */ +#line 136 "hl/src//H5LTparse.y" + { (yyval.hid) = H5Tcopy(H5T_NATIVE_SHORT); } break; - case 33: /* integer_type: H5T_NATIVE_USHORT_TOKEN */ -#line 140 "hl/src/H5LTparse.y" - { (yyval.hid) = H5Tcopy(H5T_NATIVE_USHORT); } -#line 1498 "hl/src/H5LTparse.c" + case 33: +/* Line 1792 of yacc.c */ +#line 137 "hl/src//H5LTparse.y" + { (yyval.hid) = H5Tcopy(H5T_NATIVE_USHORT); } break; - case 34: /* integer_type: H5T_NATIVE_INT_TOKEN */ -#line 141 "hl/src/H5LTparse.y" - { (yyval.hid) = H5Tcopy(H5T_NATIVE_INT); } -#line 1504 "hl/src/H5LTparse.c" + case 34: +/* Line 1792 of yacc.c */ +#line 138 "hl/src//H5LTparse.y" + { (yyval.hid) = H5Tcopy(H5T_NATIVE_INT); } break; - case 35: /* integer_type: H5T_NATIVE_UINT_TOKEN */ -#line 142 "hl/src/H5LTparse.y" - { (yyval.hid) = H5Tcopy(H5T_NATIVE_UINT); } -#line 1510 "hl/src/H5LTparse.c" + case 35: +/* Line 1792 of yacc.c */ +#line 139 "hl/src//H5LTparse.y" + { (yyval.hid) = H5Tcopy(H5T_NATIVE_UINT); } break; - case 36: /* integer_type: H5T_NATIVE_LONG_TOKEN */ -#line 143 "hl/src/H5LTparse.y" - { (yyval.hid) = H5Tcopy(H5T_NATIVE_LONG); } -#line 1516 "hl/src/H5LTparse.c" + case 36: +/* Line 1792 of yacc.c */ +#line 140 "hl/src//H5LTparse.y" + { (yyval.hid) = H5Tcopy(H5T_NATIVE_LONG); } break; - case 37: /* integer_type: H5T_NATIVE_ULONG_TOKEN */ -#line 144 "hl/src/H5LTparse.y" - { (yyval.hid) = H5Tcopy(H5T_NATIVE_ULONG); } -#line 1522 "hl/src/H5LTparse.c" + case 37: +/* Line 1792 of yacc.c */ +#line 141 "hl/src//H5LTparse.y" + { (yyval.hid) = H5Tcopy(H5T_NATIVE_ULONG); } break; - case 38: /* integer_type: H5T_NATIVE_LLONG_TOKEN */ -#line 145 "hl/src/H5LTparse.y" - { (yyval.hid) = H5Tcopy(H5T_NATIVE_LLONG); } -#line 1528 "hl/src/H5LTparse.c" + case 38: +/* Line 1792 of yacc.c */ +#line 142 "hl/src//H5LTparse.y" + { (yyval.hid) = H5Tcopy(H5T_NATIVE_LLONG); } break; - case 39: /* integer_type: H5T_NATIVE_ULLONG_TOKEN */ -#line 146 "hl/src/H5LTparse.y" - { (yyval.hid) = H5Tcopy(H5T_NATIVE_ULLONG); } -#line 1534 "hl/src/H5LTparse.c" + case 39: +/* Line 1792 of yacc.c */ +#line 143 "hl/src//H5LTparse.y" + { (yyval.hid) = H5Tcopy(H5T_NATIVE_ULLONG); } break; - case 40: /* fp_type: H5T_IEEE_F32BE_TOKEN */ -#line 149 "hl/src/H5LTparse.y" - { (yyval.hid) = H5Tcopy(H5T_IEEE_F32BE); } -#line 1540 "hl/src/H5LTparse.c" + case 40: +/* Line 1792 of yacc.c */ +#line 146 "hl/src//H5LTparse.y" + { (yyval.hid) = H5Tcopy(H5T_IEEE_F32BE); } break; - case 41: /* fp_type: H5T_IEEE_F32LE_TOKEN */ -#line 150 "hl/src/H5LTparse.y" - { (yyval.hid) = H5Tcopy(H5T_IEEE_F32LE); } -#line 1546 "hl/src/H5LTparse.c" + case 41: +/* Line 1792 of yacc.c */ +#line 147 "hl/src//H5LTparse.y" + { (yyval.hid) = H5Tcopy(H5T_IEEE_F32LE); } break; - case 42: /* fp_type: H5T_IEEE_F64BE_TOKEN */ -#line 151 "hl/src/H5LTparse.y" - { (yyval.hid) = H5Tcopy(H5T_IEEE_F64BE); } -#line 1552 "hl/src/H5LTparse.c" + case 42: +/* Line 1792 of yacc.c */ +#line 148 "hl/src//H5LTparse.y" + { (yyval.hid) = H5Tcopy(H5T_IEEE_F64BE); } break; - case 43: /* fp_type: H5T_IEEE_F64LE_TOKEN */ -#line 152 "hl/src/H5LTparse.y" - { (yyval.hid) = H5Tcopy(H5T_IEEE_F64LE); } -#line 1558 "hl/src/H5LTparse.c" + case 43: +/* Line 1792 of yacc.c */ +#line 149 "hl/src//H5LTparse.y" + { (yyval.hid) = H5Tcopy(H5T_IEEE_F64LE); } break; - case 44: /* fp_type: H5T_NATIVE_FLOAT_TOKEN */ -#line 153 "hl/src/H5LTparse.y" - { (yyval.hid) = H5Tcopy(H5T_NATIVE_FLOAT); } -#line 1564 "hl/src/H5LTparse.c" + case 44: +/* Line 1792 of yacc.c */ +#line 150 "hl/src//H5LTparse.y" + { (yyval.hid) = H5Tcopy(H5T_NATIVE_FLOAT); } break; - case 45: /* fp_type: H5T_NATIVE_DOUBLE_TOKEN */ -#line 154 "hl/src/H5LTparse.y" - { (yyval.hid) = H5Tcopy(H5T_NATIVE_DOUBLE); } -#line 1570 "hl/src/H5LTparse.c" + case 45: +/* Line 1792 of yacc.c */ +#line 151 "hl/src//H5LTparse.y" + { (yyval.hid) = H5Tcopy(H5T_NATIVE_DOUBLE); } break; - case 46: /* fp_type: H5T_NATIVE_LDOUBLE_TOKEN */ -#line 155 "hl/src/H5LTparse.y" - { (yyval.hid) = H5Tcopy(H5T_NATIVE_LDOUBLE); } -#line 1576 "hl/src/H5LTparse.c" + case 46: +/* Line 1792 of yacc.c */ +#line 152 "hl/src//H5LTparse.y" + { (yyval.hid) = H5Tcopy(H5T_NATIVE_LDOUBLE); } break; - case 47: /* $@1: %empty */ -#line 159 "hl/src/H5LTparse.y" - { csindex++; cmpd_stack[csindex].id = H5Tcreate(H5T_COMPOUND, 1); /*temporarily set size to 1*/ } -#line 1582 "hl/src/H5LTparse.c" + case 47: +/* Line 1792 of yacc.c */ +#line 156 "hl/src//H5LTparse.y" + { csindex++; cmpd_stack[csindex].id = H5Tcreate(H5T_COMPOUND, 1); /*temporarily set size to 1*/ } break; - case 48: /* compound_type: H5T_COMPOUND_TOKEN $@1 '{' memb_list '}' */ -#line 161 "hl/src/H5LTparse.y" - { (yyval.hid) = cmpd_stack[csindex].id; + case 48: +/* Line 1792 of yacc.c */ +#line 158 "hl/src//H5LTparse.y" + { (yyval.hid) = cmpd_stack[csindex].id; cmpd_stack[csindex].id = 0; cmpd_stack[csindex].first_memb = 1; csindex--; } -#line 1592 "hl/src/H5LTparse.c" break; - case 51: /* $@2: %empty */ -#line 170 "hl/src/H5LTparse.y" - { cmpd_stack[csindex].is_field = 1; /*notify lexer a compound member is parsed*/ } -#line 1598 "hl/src/H5LTparse.c" + case 51: +/* Line 1792 of yacc.c */ +#line 167 "hl/src//H5LTparse.y" + { cmpd_stack[csindex].is_field = 1; /*notify lexer a compound member is parsed*/ } break; - case 52: /* memb_def: ddl_type $@2 '"' field_name '"' field_offset ';' */ -#line 172 "hl/src/H5LTparse.y" - { + case 52: +/* Line 1792 of yacc.c */ +#line 169 "hl/src//H5LTparse.y" + { size_t origin_size, new_size; hid_t dtype_id = cmpd_stack[csindex].id; /*Adjust size and insert member, consider both member size and offset.*/ if(cmpd_stack[csindex].first_memb) { /*reclaim the size 1 temporarily set*/ - new_size = H5Tget_size((yyvsp[-6].hid)) + (yyvsp[-1].ival); + new_size = H5Tget_size((yyvsp[(1) - (5)].hid)) + (yyvsp[(4) - (5)].ival); H5Tset_size(dtype_id, new_size); /*member name is saved in yylval.sval by lexer*/ - H5Tinsert(dtype_id, (yyvsp[-3].sval), (yyvsp[-1].ival), (yyvsp[-6].hid)); + H5Tinsert(dtype_id, (yyvsp[(3) - (5)].sval), (yyvsp[(4) - (5)].ival), (yyvsp[(1) - (5)].hid)); cmpd_stack[csindex].first_memb = 0; } else { origin_size = H5Tget_size(dtype_id); - if((yyvsp[-1].ival) == 0) { - new_size = origin_size + H5Tget_size((yyvsp[-6].hid)); + if((yyvsp[(4) - (5)].ival) == 0) { + new_size = origin_size + H5Tget_size((yyvsp[(1) - (5)].hid)); H5Tset_size(dtype_id, new_size); - H5Tinsert(dtype_id, (yyvsp[-3].sval), origin_size, (yyvsp[-6].hid)); + H5Tinsert(dtype_id, (yyvsp[(3) - (5)].sval), origin_size, (yyvsp[(1) - (5)].hid)); } else { - new_size = (yyvsp[-1].ival) + H5Tget_size((yyvsp[-6].hid)); + new_size = (yyvsp[(4) - (5)].ival) + H5Tget_size((yyvsp[(1) - (5)].hid)); H5Tset_size(dtype_id, new_size); - H5Tinsert(dtype_id, (yyvsp[-3].sval), (yyvsp[-1].ival), (yyvsp[-6].hid)); + H5Tinsert(dtype_id, (yyvsp[(3) - (5)].sval), (yyvsp[(4) - (5)].ival), (yyvsp[(1) - (5)].hid)); } } - if((yyvsp[-3].sval)) { - free((yyvsp[-3].sval)); - (yyvsp[-3].sval) = NULL; + if((yyvsp[(3) - (5)].sval)) { + HDfree((yyvsp[(3) - (5)].sval)); + (yyvsp[(3) - (5)].sval) = NULL; } cmpd_stack[csindex].is_field = 0; - H5Tclose((yyvsp[-6].hid)); + H5Tclose((yyvsp[(1) - (5)].hid)); new_size = H5Tget_size(dtype_id); } -#line 1637 "hl/src/H5LTparse.c" break; - case 53: /* field_name: STRING */ -#line 208 "hl/src/H5LTparse.y" - { - (yyval.sval) = strdup(yylval.sval); - free(yylval.sval); + case 53: +/* Line 1792 of yacc.c */ +#line 205 "hl/src//H5LTparse.y" + { + (yyval.sval) = HDstrdup(yylval.sval); + HDfree(yylval.sval); yylval.sval = NULL; } -#line 1647 "hl/src/H5LTparse.c" break; - case 54: /* field_offset: %empty */ -#line 215 "hl/src/H5LTparse.y" - { (yyval.ival) = 0; } -#line 1653 "hl/src/H5LTparse.c" + case 54: +/* Line 1792 of yacc.c */ +#line 212 "hl/src//H5LTparse.y" + { (yyval.ival) = 0; } break; - case 55: /* field_offset: ':' offset */ -#line 217 "hl/src/H5LTparse.y" - { (yyval.ival) = yylval.ival; } -#line 1659 "hl/src/H5LTparse.c" + case 55: +/* Line 1792 of yacc.c */ +#line 214 "hl/src//H5LTparse.y" + { (yyval.ival) = yylval.ival; } break; - case 57: /* $@3: %empty */ -#line 221 "hl/src/H5LTparse.y" - { asindex++; /*pushd onto the stack*/ } -#line 1665 "hl/src/H5LTparse.c" + case 57: +/* Line 1792 of yacc.c */ +#line 218 "hl/src//H5LTparse.y" + { asindex++; /*pushd onto the stack*/ } break; - case 58: /* array_type: H5T_ARRAY_TOKEN $@3 '{' dim_list ddl_type '}' */ -#line 223 "hl/src/H5LTparse.y" - { - (yyval.hid) = H5Tarray_create2((yyvsp[-1].hid), arr_stack[asindex].ndims, arr_stack[asindex].dims); + case 58: +/* Line 1792 of yacc.c */ +#line 220 "hl/src//H5LTparse.y" + { + (yyval.hid) = H5Tarray_create2((yyvsp[(5) - (6)].hid), arr_stack[asindex].ndims, arr_stack[asindex].dims); arr_stack[asindex].ndims = 0; asindex--; - H5Tclose((yyvsp[-1].hid)); + H5Tclose((yyvsp[(5) - (6)].hid)); } -#line 1676 "hl/src/H5LTparse.c" break; - case 61: /* $@4: %empty */ -#line 233 "hl/src/H5LTparse.y" - { arr_stack[asindex].is_dim = 1; /*notice lexer of dimension size*/ } -#line 1682 "hl/src/H5LTparse.c" + case 61: +/* Line 1792 of yacc.c */ +#line 230 "hl/src//H5LTparse.y" + { arr_stack[asindex].is_dim = 1; /*notice lexer of dimension size*/ } break; - case 62: /* $@5: %empty */ -#line 234 "hl/src/H5LTparse.y" - { unsigned ndims = arr_stack[asindex].ndims; + case 62: +/* Line 1792 of yacc.c */ +#line 231 "hl/src//H5LTparse.y" + { unsigned ndims = arr_stack[asindex].ndims; arr_stack[asindex].dims[ndims] = (hsize_t)yylval.ival; arr_stack[asindex].ndims++; arr_stack[asindex].is_dim = 0; } -#line 1692 "hl/src/H5LTparse.c" - break; - - case 65: /* vlen_type: H5T_VLEN_TOKEN '{' ddl_type '}' */ -#line 245 "hl/src/H5LTparse.y" - { (yyval.hid) = H5Tvlen_create((yyvsp[-1].hid)); H5Tclose((yyvsp[-1].hid)); } -#line 1698 "hl/src/H5LTparse.c" break; - case 66: /* $@6: %empty */ -#line 250 "hl/src/H5LTparse.y" - { is_opq_size = 1; } -#line 1704 "hl/src/H5LTparse.c" + case 65: +/* Line 1792 of yacc.c */ +#line 242 "hl/src//H5LTparse.y" + { (yyval.hid) = H5Tvlen_create((yyvsp[(3) - (4)].hid)); H5Tclose((yyvsp[(3) - (4)].hid)); } break; - case 67: /* @7: %empty */ -#line 251 "hl/src/H5LTparse.y" - { + case 66: +/* Line 1792 of yacc.c */ +#line 248 "hl/src//H5LTparse.y" + { size_t size = (size_t)yylval.ival; (yyval.hid) = H5Tcreate(H5T_OPAQUE, size); - is_opq_size = 0; } -#line 1714 "hl/src/H5LTparse.c" - break; - - case 68: /* $@8: %empty */ -#line 256 "hl/src/H5LTparse.y" - { is_opq_tag = 1; } -#line 1720 "hl/src/H5LTparse.c" break; - case 69: /* $@9: %empty */ -#line 257 "hl/src/H5LTparse.y" - { - H5Tset_tag((yyvsp[-6].hid), yylval.sval); - free(yylval.sval); + case 67: +/* Line 1792 of yacc.c */ +#line 253 "hl/src//H5LTparse.y" + { + H5Tset_tag((yyvsp[(6) - (9)].hid), yylval.sval); + HDfree(yylval.sval); yylval.sval = NULL; - is_opq_tag = 0; } -#line 1731 "hl/src/H5LTparse.c" break; - case 70: /* opaque_type: H5T_OPAQUE_TOKEN '{' OPQ_SIZE_TOKEN $@6 opaque_size ';' @7 OPQ_TAG_TOKEN $@8 '"' opaque_tag '"' ';' $@9 '}' */ -#line 263 "hl/src/H5LTparse.y" - { (yyval.hid) = (yyvsp[-8].hid); } -#line 1737 "hl/src/H5LTparse.c" + case 68: +/* Line 1792 of yacc.c */ +#line 258 "hl/src//H5LTparse.y" + { (yyval.hid) = (yyvsp[(6) - (11)].hid); } break; - case 73: /* $@10: %empty */ -#line 271 "hl/src/H5LTparse.y" - { is_str_size = 1; } -#line 1743 "hl/src/H5LTparse.c" - break; - - case 74: /* $@11: %empty */ -#line 272 "hl/src/H5LTparse.y" - { - if((yyvsp[-1].ival) == H5T_VARIABLE_TOKEN) + case 71: +/* Line 1792 of yacc.c */ +#line 267 "hl/src//H5LTparse.y" + { + if((yyvsp[(4) - (5)].ival) == H5T_VARIABLE_TOKEN) is_variable = 1; else str_size = yylval.ival; - is_str_size = 0; } -#line 1755 "hl/src/H5LTparse.c" break; - case 75: /* $@12: %empty */ -#line 280 "hl/src/H5LTparse.y" - { - if((yyvsp[-1].ival) == H5T_STR_NULLTERM_TOKEN) + case 72: +/* Line 1792 of yacc.c */ +#line 274 "hl/src//H5LTparse.y" + { + if((yyvsp[(8) - (9)].ival) == H5T_STR_NULLTERM_TOKEN) str_pad = H5T_STR_NULLTERM; - else if((yyvsp[-1].ival) == H5T_STR_NULLPAD_TOKEN) + else if((yyvsp[(8) - (9)].ival) == H5T_STR_NULLPAD_TOKEN) str_pad = H5T_STR_NULLPAD; - else if((yyvsp[-1].ival) == H5T_STR_SPACEPAD_TOKEN) + else if((yyvsp[(8) - (9)].ival) == H5T_STR_SPACEPAD_TOKEN) str_pad = H5T_STR_SPACEPAD; } -#line 1768 "hl/src/H5LTparse.c" break; - case 76: /* $@13: %empty */ -#line 289 "hl/src/H5LTparse.y" - { - if((yyvsp[-1].ival) == H5T_CSET_ASCII_TOKEN) + case 73: +/* Line 1792 of yacc.c */ +#line 283 "hl/src//H5LTparse.y" + { + if((yyvsp[(12) - (13)].ival) == H5T_CSET_ASCII_TOKEN) str_cset = H5T_CSET_ASCII; - else if((yyvsp[-1].ival) == H5T_CSET_UTF8_TOKEN) + else if((yyvsp[(12) - (13)].ival) == H5T_CSET_UTF8_TOKEN) str_cset = H5T_CSET_UTF8; } -#line 1779 "hl/src/H5LTparse.c" break; - case 77: /* @14: %empty */ -#line 296 "hl/src/H5LTparse.y" - { - if((yyvsp[-1].hid) == H5T_C_S1_TOKEN) + case 74: +/* Line 1792 of yacc.c */ +#line 290 "hl/src//H5LTparse.y" + { + if((yyvsp[(16) - (17)].hid) == H5T_C_S1_TOKEN) (yyval.hid) = H5Tcopy(H5T_C_S1); - else if((yyvsp[-1].hid) == H5T_FORTRAN_S1_TOKEN) + else if((yyvsp[(16) - (17)].hid) == H5T_FORTRAN_S1_TOKEN) (yyval.hid) = H5Tcopy(H5T_FORTRAN_S1); } -#line 1790 "hl/src/H5LTparse.c" break; - case 78: /* string_type: H5T_STRING_TOKEN '{' STRSIZE_TOKEN $@10 strsize ';' $@11 STRPAD_TOKEN strpad ';' $@12 CSET_TOKEN cset ';' $@13 CTYPE_TOKEN ctype ';' @14 '}' */ -#line 303 "hl/src/H5LTparse.y" - { - hid_t str_id = (yyvsp[-1].hid); + case 75: +/* Line 1792 of yacc.c */ +#line 297 "hl/src//H5LTparse.y" + { + hid_t str_id = (yyvsp[(18) - (19)].hid); /*set string size*/ if(is_variable) { @@ -1837,87 +2070,83 @@ yyparse (void) (yyval.hid) = str_id; } -#line 1811 "hl/src/H5LTparse.c" break; - case 79: /* strsize: H5T_VARIABLE_TOKEN */ -#line 320 "hl/src/H5LTparse.y" - {(yyval.ival) = H5T_VARIABLE_TOKEN;} -#line 1817 "hl/src/H5LTparse.c" + case 76: +/* Line 1792 of yacc.c */ +#line 314 "hl/src//H5LTparse.y" + {(yyval.ival) = H5T_VARIABLE_TOKEN;} break; - case 81: /* strpad: H5T_STR_NULLTERM_TOKEN */ -#line 323 "hl/src/H5LTparse.y" - {(yyval.ival) = H5T_STR_NULLTERM_TOKEN;} -#line 1823 "hl/src/H5LTparse.c" + case 78: +/* Line 1792 of yacc.c */ +#line 317 "hl/src//H5LTparse.y" + {(yyval.ival) = H5T_STR_NULLTERM_TOKEN;} break; - case 82: /* strpad: H5T_STR_NULLPAD_TOKEN */ -#line 324 "hl/src/H5LTparse.y" - {(yyval.ival) = H5T_STR_NULLPAD_TOKEN;} -#line 1829 "hl/src/H5LTparse.c" + case 79: +/* Line 1792 of yacc.c */ +#line 318 "hl/src//H5LTparse.y" + {(yyval.ival) = H5T_STR_NULLPAD_TOKEN;} break; - case 83: /* strpad: H5T_STR_SPACEPAD_TOKEN */ -#line 325 "hl/src/H5LTparse.y" - {(yyval.ival) = H5T_STR_SPACEPAD_TOKEN;} -#line 1835 "hl/src/H5LTparse.c" + case 80: +/* Line 1792 of yacc.c */ +#line 319 "hl/src//H5LTparse.y" + {(yyval.ival) = H5T_STR_SPACEPAD_TOKEN;} break; - case 84: /* cset: H5T_CSET_ASCII_TOKEN */ -#line 327 "hl/src/H5LTparse.y" - {(yyval.ival) = H5T_CSET_ASCII_TOKEN;} -#line 1841 "hl/src/H5LTparse.c" + case 81: +/* Line 1792 of yacc.c */ +#line 321 "hl/src//H5LTparse.y" + {(yyval.ival) = H5T_CSET_ASCII_TOKEN;} break; - case 85: /* cset: H5T_CSET_UTF8_TOKEN */ -#line 328 "hl/src/H5LTparse.y" - {(yyval.ival) = H5T_CSET_UTF8_TOKEN;} -#line 1847 "hl/src/H5LTparse.c" + case 82: +/* Line 1792 of yacc.c */ +#line 322 "hl/src//H5LTparse.y" + {(yyval.ival) = H5T_CSET_UTF8_TOKEN;} break; - case 86: /* ctype: H5T_C_S1_TOKEN */ -#line 330 "hl/src/H5LTparse.y" - {(yyval.hid) = H5T_C_S1_TOKEN;} -#line 1853 "hl/src/H5LTparse.c" + case 83: +/* Line 1792 of yacc.c */ +#line 324 "hl/src//H5LTparse.y" + {(yyval.hid) = H5T_C_S1_TOKEN;} break; - case 87: /* ctype: H5T_FORTRAN_S1_TOKEN */ -#line 331 "hl/src/H5LTparse.y" - {(yyval.hid) = H5T_FORTRAN_S1_TOKEN;} -#line 1859 "hl/src/H5LTparse.c" + case 84: +/* Line 1792 of yacc.c */ +#line 325 "hl/src//H5LTparse.y" + {(yyval.hid) = H5T_FORTRAN_S1_TOKEN;} break; - case 88: /* $@15: %empty */ -#line 335 "hl/src/H5LTparse.y" - { is_enum = 1; enum_id = H5Tenum_create((yyvsp[-1].hid)); H5Tclose((yyvsp[-1].hid)); } -#line 1865 "hl/src/H5LTparse.c" + case 85: +/* Line 1792 of yacc.c */ +#line 329 "hl/src//H5LTparse.y" + { is_enum = 1; enum_id = H5Tenum_create((yyvsp[(3) - (4)].hid)); H5Tclose((yyvsp[(3) - (4)].hid)); } break; - case 89: /* enum_type: H5T_ENUM_TOKEN '{' integer_type ';' $@15 enum_list '}' */ -#line 337 "hl/src/H5LTparse.y" - { is_enum = 0; /*reset*/ (yyval.hid) = enum_id; } -#line 1871 "hl/src/H5LTparse.c" + case 86: +/* Line 1792 of yacc.c */ +#line 331 "hl/src//H5LTparse.y" + { is_enum = 0; /*reset*/ (yyval.hid) = enum_id; } break; - case 92: /* $@16: %empty */ -#line 342 "hl/src/H5LTparse.y" - { + case 89: +/* Line 1792 of yacc.c */ +#line 336 "hl/src//H5LTparse.y" + { is_enum_memb = 1; /*indicate member of enum*/ -#ifdef H5_HAVE_WIN32_API - enum_memb_symbol = _strdup(yylval.sval); -#else /* H5_HAVE_WIN32_API */ enum_memb_symbol = strdup(yylval.sval); -#endif /* H5_HAVE_WIN32_API */ - free(yylval.sval); + HDfree(yylval.sval); yylval.sval = NULL; } -#line 1886 "hl/src/H5LTparse.c" break; - case 93: /* enum_def: '"' enum_symbol '"' $@16 enum_val ';' */ -#line 353 "hl/src/H5LTparse.y" - { + case 90: +/* Line 1792 of yacc.c */ +#line 343 "hl/src//H5LTparse.y" + { char char_val=(char)yylval.ival; short short_val=(short)yylval.ival; int int_val=(int)yylval.ival; @@ -1953,18 +2182,17 @@ yyparse (void) } is_enum_memb = 0; - if(enum_memb_symbol) free(enum_memb_symbol); + if(enum_memb_symbol) HDfree(enum_memb_symbol); } H5Tclose(super); H5Tclose(native); } -#line 1933 "hl/src/H5LTparse.c" break; -#line 1937 "hl/src/H5LTparse.c" - +/* Line 1792 of yacc.c */ +#line 2166 "hl/src//H5LTparse.c" default: break; } /* User semantic actions sometimes alter yychar, and that requires @@ -1978,58 +2206,96 @@ yyparse (void) case of YYERROR or YYBACKUP, subsequent parser actions might lead to an incorrect destructor call or verbose syntax error message before the lookahead is translated. */ - YY_SYMBOL_PRINT ("-> $$ =", YY_CAST (yysymbol_kind_t, yyr1[yyn]), &yyval, &yyloc); + YY_SYMBOL_PRINT ("-> $$ =", yyr1[yyn], &yyval, &yyloc); YYPOPSTACK (yylen); yylen = 0; + YY_STACK_PRINT (yyss, yyssp); *++yyvsp = yyval; - /* Now 'shift' the result of the reduction. Determine what state + /* Now `shift' the result of the reduction. Determine what state that goes to, based on the state we popped back to and the rule number reduced by. */ - { - const int yylhs = yyr1[yyn] - YYNTOKENS; - const int yyi = yypgoto[yylhs] + *yyssp; - yystate = (0 <= yyi && yyi <= YYLAST && yycheck[yyi] == *yyssp - ? yytable[yyi] - : yydefgoto[yylhs]); - } + + yyn = yyr1[yyn]; + + yystate = yypgoto[yyn - YYNTOKENS] + *yyssp; + if (0 <= yystate && yystate <= YYLAST && yycheck[yystate] == *yyssp) + yystate = yytable[yystate]; + else + yystate = yydefgoto[yyn - YYNTOKENS]; goto yynewstate; -/*--------------------------------------. -| yyerrlab -- here on detecting error. | -`--------------------------------------*/ +/*------------------------------------. +| yyerrlab -- here on detecting error | +`------------------------------------*/ yyerrlab: /* Make sure we have latest lookahead translation. See comments at user semantic actions for why this is necessary. */ - yytoken = yychar == YYEMPTY ? YYSYMBOL_YYEMPTY : YYTRANSLATE (yychar); + yytoken = yychar == YYEMPTY ? YYEMPTY : YYTRANSLATE (yychar); + /* If not already recovering from an error, report this error. */ if (!yyerrstatus) { ++yynerrs; +#if ! YYERROR_VERBOSE yyerror (YY_("syntax error")); +#else +# define YYSYNTAX_ERROR yysyntax_error (&yymsg_alloc, &yymsg, \ + yyssp, yytoken) + { + char const *yymsgp = YY_("syntax error"); + int yysyntax_error_status; + yysyntax_error_status = YYSYNTAX_ERROR; + if (yysyntax_error_status == 0) + yymsgp = yymsg; + else if (yysyntax_error_status == 1) + { + if (yymsg != yymsgbuf) + YYSTACK_FREE (yymsg); + yymsg = (char *) YYSTACK_ALLOC (yymsg_alloc); + if (!yymsg) + { + yymsg = yymsgbuf; + yymsg_alloc = sizeof yymsgbuf; + yysyntax_error_status = 2; + } + else + { + yysyntax_error_status = YYSYNTAX_ERROR; + yymsgp = yymsg; + } + } + yyerror (yymsgp); + if (yysyntax_error_status == 2) + goto yyexhaustedlab; + } +# undef YYSYNTAX_ERROR +#endif } + + if (yyerrstatus == 3) { /* If just tried and failed to reuse lookahead token after an - error, discard it. */ + error, discard it. */ if (yychar <= YYEOF) - { - /* Return failure if at end of input. */ - if (yychar == YYEOF) - YYABORT; - } + { + /* Return failure if at end of input. */ + if (yychar == YYEOF) + YYABORT; + } else - { - yydestruct ("Error: discarding", - yytoken, &yylval); - yychar = YYEMPTY; - } + { + yydestruct ("Error: discarding", + yytoken, &yylval); + yychar = YYEMPTY; + } } /* Else will try to reuse lookahead token after shifting the error @@ -2041,12 +2307,14 @@ yyparse (void) | yyerrorlab -- error raised explicitly by YYERROR. | `---------------------------------------------------*/ yyerrorlab: - /* Pacify compilers when the user code never invokes YYERROR and the - label yyerrorlab therefore never appears in user code. */ - if (0) - YYERROR; - /* Do not reclaim the symbols of the rule whose action triggered + /* Pacify compilers like GCC when the user code never invokes + YYERROR and the label yyerrorlab therefore never appears in user + code. */ + if (/*CONSTCOND*/ 0) + goto yyerrorlab; + + /* Do not reclaim the symbols of the rule which action triggered this YYERROR. */ YYPOPSTACK (yylen); yylen = 0; @@ -2059,30 +2327,29 @@ yyparse (void) | yyerrlab1 -- common code for both syntax error and YYERROR. | `-------------------------------------------------------------*/ yyerrlab1: - yyerrstatus = 3; /* Each real token shifted decrements this. */ + yyerrstatus = 3; /* Each real token shifted decrements this. */ - /* Pop stack until we find a state that shifts the error token. */ for (;;) { yyn = yypact[yystate]; if (!yypact_value_is_default (yyn)) - { - yyn += YYSYMBOL_YYerror; - if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYSYMBOL_YYerror) - { - yyn = yytable[yyn]; - if (0 < yyn) - break; - } - } + { + yyn += YYTERROR; + if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR) + { + yyn = yytable[yyn]; + if (0 < yyn) + break; + } + } /* Pop the current state because it cannot handle the error token. */ if (yyssp == yyss) - YYABORT; + YYABORT; yydestruct ("Error: popping", - YY_ACCESSING_SYMBOL (yystate), yyvsp); + yystos[yystate], yyvsp); YYPOPSTACK (1); yystate = *yyssp; YY_STACK_PRINT (yyss, yyssp); @@ -2094,7 +2361,7 @@ yyparse (void) /* Shift the error token. */ - YY_SYMBOL_PRINT ("Shifting", YY_ACCESSING_SYMBOL (yyn), yyvsp, yylsp); + YY_SYMBOL_PRINT ("Shifting", yystos[yyn], yyvsp, yylsp); yystate = yyn; goto yynewstate; @@ -2107,7 +2374,6 @@ yyparse (void) yyresult = 0; goto yyreturn; - /*-----------------------------------. | yyabortlab -- YYABORT comes here. | `-----------------------------------*/ @@ -2115,21 +2381,16 @@ yyparse (void) yyresult = 1; goto yyreturn; - -#if !defined yyoverflow +#if !defined yyoverflow || YYERROR_VERBOSE /*-------------------------------------------------. | yyexhaustedlab -- memory exhaustion comes here. | `-------------------------------------------------*/ yyexhaustedlab: yyerror (YY_("memory exhausted")); yyresult = 2; - goto yyreturn; + /* Fall through. */ #endif - -/*-------------------------------------------------------. -| yyreturn -- parsing is finished, clean up and return. | -`-------------------------------------------------------*/ yyreturn: if (yychar != YYEMPTY) { @@ -2139,21 +2400,26 @@ yyparse (void) yydestruct ("Cleanup: discarding lookahead", yytoken, &yylval); } - /* Do not reclaim the symbols of the rule whose action triggered + /* Do not reclaim the symbols of the rule which action triggered this YYABORT or YYACCEPT. */ YYPOPSTACK (yylen); YY_STACK_PRINT (yyss, yyssp); while (yyssp != yyss) { yydestruct ("Cleanup: popping", - YY_ACCESSING_SYMBOL (+*yyssp), yyvsp); + yystos[*yyssp], yyvsp); YYPOPSTACK (1); } #ifndef yyoverflow if (yyss != yyssa) YYSTACK_FREE (yyss); #endif - - return yyresult; +#if YYERROR_VERBOSE + if (yymsg != yymsgbuf) + YYSTACK_FREE (yymsg); +#endif + /* Make sure YYID is used. */ + return YYID (yyresult); } + diff --git a/hl/src/H5LTparse.h b/hl/src/H5LTparse.h index abff969c2fa..71690175db5 100644 --- a/hl/src/H5LTparse.h +++ b/hl/src/H5LTparse.h @@ -1,20 +1,19 @@ -/* A Bison parser, made by GNU Bison 3.7.2. */ +/* A Bison parser, made by GNU Bison 2.7. */ /* Bison interface for Yacc-like parsers in C - - Copyright (C) 1984, 1989-1990, 2000-2015, 2018-2020 Free Software Foundation, - Inc. - + + Copyright (C) 1984, 1989-1990, 2000-2012 Free Software Foundation, Inc. + This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. - + This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. - + You should have received a copy of the GNU General Public License along with this program. If not, see . */ @@ -27,17 +26,13 @@ special exception, which will cause the skeleton and the resulting Bison output files to be licensed under the GNU General Public License without this special exception. - + This special exception was added by the Free Software Foundation in version 2.2 of Bison. */ -/* DO NOT RELY ON FEATURES THAT ARE NOT DOCUMENTED in the manual, - especially those whose name start with YY_ or yy_. They are - private implementation details that can be changed or removed. */ - #ifndef YY_H5LTYY_HL_SRC_H5LTPARSE_H_INCLUDED # define YY_H5LTYY_HL_SRC_H5LTPARSE_H_INCLUDED -/* Debug traces. */ +/* Enabling traces. */ #ifndef YYDEBUG # define YYDEBUG 0 #endif @@ -45,96 +40,105 @@ extern int H5LTyydebug; #endif -/* Token kinds. */ +/* Tokens. */ #ifndef YYTOKENTYPE # define YYTOKENTYPE - enum yytokentype - { - YYEMPTY = -2, - YYEOF = 0, /* "end of file" */ - YYerror = 256, /* error */ - YYUNDEF = 257, /* "invalid token" */ - H5T_STD_I8BE_TOKEN = 258, /* H5T_STD_I8BE_TOKEN */ - H5T_STD_I8LE_TOKEN = 259, /* H5T_STD_I8LE_TOKEN */ - H5T_STD_I16BE_TOKEN = 260, /* H5T_STD_I16BE_TOKEN */ - H5T_STD_I16LE_TOKEN = 261, /* H5T_STD_I16LE_TOKEN */ - H5T_STD_I32BE_TOKEN = 262, /* H5T_STD_I32BE_TOKEN */ - H5T_STD_I32LE_TOKEN = 263, /* H5T_STD_I32LE_TOKEN */ - H5T_STD_I64BE_TOKEN = 264, /* H5T_STD_I64BE_TOKEN */ - H5T_STD_I64LE_TOKEN = 265, /* H5T_STD_I64LE_TOKEN */ - H5T_STD_U8BE_TOKEN = 266, /* H5T_STD_U8BE_TOKEN */ - H5T_STD_U8LE_TOKEN = 267, /* H5T_STD_U8LE_TOKEN */ - H5T_STD_U16BE_TOKEN = 268, /* H5T_STD_U16BE_TOKEN */ - H5T_STD_U16LE_TOKEN = 269, /* H5T_STD_U16LE_TOKEN */ - H5T_STD_U32BE_TOKEN = 270, /* H5T_STD_U32BE_TOKEN */ - H5T_STD_U32LE_TOKEN = 271, /* H5T_STD_U32LE_TOKEN */ - H5T_STD_U64BE_TOKEN = 272, /* H5T_STD_U64BE_TOKEN */ - H5T_STD_U64LE_TOKEN = 273, /* H5T_STD_U64LE_TOKEN */ - H5T_NATIVE_CHAR_TOKEN = 274, /* H5T_NATIVE_CHAR_TOKEN */ - H5T_NATIVE_SCHAR_TOKEN = 275, /* H5T_NATIVE_SCHAR_TOKEN */ - H5T_NATIVE_UCHAR_TOKEN = 276, /* H5T_NATIVE_UCHAR_TOKEN */ - H5T_NATIVE_SHORT_TOKEN = 277, /* H5T_NATIVE_SHORT_TOKEN */ - H5T_NATIVE_USHORT_TOKEN = 278, /* H5T_NATIVE_USHORT_TOKEN */ - H5T_NATIVE_INT_TOKEN = 279, /* H5T_NATIVE_INT_TOKEN */ - H5T_NATIVE_UINT_TOKEN = 280, /* H5T_NATIVE_UINT_TOKEN */ - H5T_NATIVE_LONG_TOKEN = 281, /* H5T_NATIVE_LONG_TOKEN */ - H5T_NATIVE_ULONG_TOKEN = 282, /* H5T_NATIVE_ULONG_TOKEN */ - H5T_NATIVE_LLONG_TOKEN = 283, /* H5T_NATIVE_LLONG_TOKEN */ - H5T_NATIVE_ULLONG_TOKEN = 284, /* H5T_NATIVE_ULLONG_TOKEN */ - H5T_IEEE_F32BE_TOKEN = 285, /* H5T_IEEE_F32BE_TOKEN */ - H5T_IEEE_F32LE_TOKEN = 286, /* H5T_IEEE_F32LE_TOKEN */ - H5T_IEEE_F64BE_TOKEN = 287, /* H5T_IEEE_F64BE_TOKEN */ - H5T_IEEE_F64LE_TOKEN = 288, /* H5T_IEEE_F64LE_TOKEN */ - H5T_NATIVE_FLOAT_TOKEN = 289, /* H5T_NATIVE_FLOAT_TOKEN */ - H5T_NATIVE_DOUBLE_TOKEN = 290, /* H5T_NATIVE_DOUBLE_TOKEN */ - H5T_NATIVE_LDOUBLE_TOKEN = 291, /* H5T_NATIVE_LDOUBLE_TOKEN */ - H5T_STRING_TOKEN = 292, /* H5T_STRING_TOKEN */ - STRSIZE_TOKEN = 293, /* STRSIZE_TOKEN */ - STRPAD_TOKEN = 294, /* STRPAD_TOKEN */ - CSET_TOKEN = 295, /* CSET_TOKEN */ - CTYPE_TOKEN = 296, /* CTYPE_TOKEN */ - H5T_VARIABLE_TOKEN = 297, /* H5T_VARIABLE_TOKEN */ - H5T_STR_NULLTERM_TOKEN = 298, /* H5T_STR_NULLTERM_TOKEN */ - H5T_STR_NULLPAD_TOKEN = 299, /* H5T_STR_NULLPAD_TOKEN */ - H5T_STR_SPACEPAD_TOKEN = 300, /* H5T_STR_SPACEPAD_TOKEN */ - H5T_CSET_ASCII_TOKEN = 301, /* H5T_CSET_ASCII_TOKEN */ - H5T_CSET_UTF8_TOKEN = 302, /* H5T_CSET_UTF8_TOKEN */ - H5T_C_S1_TOKEN = 303, /* H5T_C_S1_TOKEN */ - H5T_FORTRAN_S1_TOKEN = 304, /* H5T_FORTRAN_S1_TOKEN */ - H5T_OPAQUE_TOKEN = 305, /* H5T_OPAQUE_TOKEN */ - OPQ_SIZE_TOKEN = 306, /* OPQ_SIZE_TOKEN */ - OPQ_TAG_TOKEN = 307, /* OPQ_TAG_TOKEN */ - H5T_COMPOUND_TOKEN = 308, /* H5T_COMPOUND_TOKEN */ - H5T_ENUM_TOKEN = 309, /* H5T_ENUM_TOKEN */ - H5T_ARRAY_TOKEN = 310, /* H5T_ARRAY_TOKEN */ - H5T_VLEN_TOKEN = 311, /* H5T_VLEN_TOKEN */ - STRING = 312, /* STRING */ - NUMBER = 313 /* NUMBER */ - }; - typedef enum yytokentype yytoken_kind_t; + /* Put the tokens into the symbol table, so that GDB and other debuggers + know about them. */ + enum yytokentype { + H5T_STD_I8BE_TOKEN = 258, + H5T_STD_I8LE_TOKEN = 259, + H5T_STD_I16BE_TOKEN = 260, + H5T_STD_I16LE_TOKEN = 261, + H5T_STD_I32BE_TOKEN = 262, + H5T_STD_I32LE_TOKEN = 263, + H5T_STD_I64BE_TOKEN = 264, + H5T_STD_I64LE_TOKEN = 265, + H5T_STD_U8BE_TOKEN = 266, + H5T_STD_U8LE_TOKEN = 267, + H5T_STD_U16BE_TOKEN = 268, + H5T_STD_U16LE_TOKEN = 269, + H5T_STD_U32BE_TOKEN = 270, + H5T_STD_U32LE_TOKEN = 271, + H5T_STD_U64BE_TOKEN = 272, + H5T_STD_U64LE_TOKEN = 273, + H5T_NATIVE_CHAR_TOKEN = 274, + H5T_NATIVE_SCHAR_TOKEN = 275, + H5T_NATIVE_UCHAR_TOKEN = 276, + H5T_NATIVE_SHORT_TOKEN = 277, + H5T_NATIVE_USHORT_TOKEN = 278, + H5T_NATIVE_INT_TOKEN = 279, + H5T_NATIVE_UINT_TOKEN = 280, + H5T_NATIVE_LONG_TOKEN = 281, + H5T_NATIVE_ULONG_TOKEN = 282, + H5T_NATIVE_LLONG_TOKEN = 283, + H5T_NATIVE_ULLONG_TOKEN = 284, + H5T_IEEE_F32BE_TOKEN = 285, + H5T_IEEE_F32LE_TOKEN = 286, + H5T_IEEE_F64BE_TOKEN = 287, + H5T_IEEE_F64LE_TOKEN = 288, + H5T_NATIVE_FLOAT_TOKEN = 289, + H5T_NATIVE_DOUBLE_TOKEN = 290, + H5T_NATIVE_LDOUBLE_TOKEN = 291, + H5T_STRING_TOKEN = 292, + STRSIZE_TOKEN = 293, + STRPAD_TOKEN = 294, + CSET_TOKEN = 295, + CTYPE_TOKEN = 296, + H5T_VARIABLE_TOKEN = 297, + H5T_STR_NULLTERM_TOKEN = 298, + H5T_STR_NULLPAD_TOKEN = 299, + H5T_STR_SPACEPAD_TOKEN = 300, + H5T_CSET_ASCII_TOKEN = 301, + H5T_CSET_UTF8_TOKEN = 302, + H5T_C_S1_TOKEN = 303, + H5T_FORTRAN_S1_TOKEN = 304, + H5T_OPAQUE_TOKEN = 305, + OPQ_SIZE_TOKEN = 306, + OPQ_TAG_TOKEN = 307, + H5T_COMPOUND_TOKEN = 308, + H5T_ENUM_TOKEN = 309, + H5T_ARRAY_TOKEN = 310, + H5T_VLEN_TOKEN = 311, + STRING = 312, + NUMBER = 313 + }; #endif -/* Value type. */ + #if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED -union YYSTYPE +typedef union YYSTYPE { -#line 72 "hl/src/H5LTparse.y" +/* Line 2058 of yacc.c */ +#line 69 "hl/src//H5LTparse.y" int ival; /*for integer token*/ char *sval; /*for name string*/ hid_t hid; /*for hid_t token*/ -#line 128 "hl/src/H5LTparse.h" -}; -typedef union YYSTYPE YYSTYPE; +/* Line 2058 of yacc.c */ +#line 122 "hl/src//H5LTparse.h" +} YYSTYPE; # define YYSTYPE_IS_TRIVIAL 1 +# define yystype YYSTYPE /* obsolescent; will be withdrawn */ # define YYSTYPE_IS_DECLARED 1 #endif - extern YYSTYPE H5LTyylval; +#ifdef YYPARSE_PARAM +#if defined __STDC__ || defined __cplusplus +hid_t H5LTyyparse (void *YYPARSE_PARAM); +#else +hid_t H5LTyyparse (); +#endif +#else /* ! YYPARSE_PARAM */ +#if defined __STDC__ || defined __cplusplus hid_t H5LTyyparse (void); +#else +hid_t H5LTyyparse (); +#endif +#endif /* ! YYPARSE_PARAM */ #endif /* !YY_H5LTYY_HL_SRC_H5LTPARSE_H_INCLUDED */ diff --git a/hl/src/H5LTparse.y b/hl/src/H5LTparse.y index 306d8c9a7ac..7c3277219fa 100644 --- a/hl/src/H5LTparse.y +++ b/hl/src/H5LTparse.y @@ -22,7 +22,9 @@ #include #include -extern int yylex(); +#include "H5private.h" + +extern int yylex(void); extern int yyerror(const char *); #define STACK_SIZE 16 @@ -35,13 +37,13 @@ struct cmpd_info { }; /*stack for nested compound type*/ -struct cmpd_info cmpd_stack[STACK_SIZE] = { +static struct cmpd_info cmpd_stack[STACK_SIZE] = { {0, 0, 1}, {0, 0, 1}, {0, 0, 1}, {0, 0, 1}, {0, 0, 1}, {0, 0, 1}, {0, 0, 1}, {0, 0, 1}, {0, 0, 1}, {0, 0, 1}, {0, 0, 1}, {0, 0, 1}, {0, 0, 1}, {0, 0, 1}, {0, 0, 1}, {0, 0, 1} }; -int csindex = -1; /*pointer to the top of compound stack*/ +static int csindex = -1; /*pointer to the top of compound stack*/ /*structure for array type information*/ struct arr_info { @@ -50,23 +52,18 @@ struct arr_info { hbool_t is_dim; /*flag to lexer for dimension*/ }; /*stack for nested array type*/ -struct arr_info arr_stack[STACK_SIZE]; -int asindex = -1; /*pointer to the top of array stack*/ +static struct arr_info arr_stack[STACK_SIZE]; +static int asindex = -1; /*pointer to the top of array stack*/ -hbool_t is_str_size = 0; /*flag to lexer for string size*/ -hbool_t is_str_pad = 0; /*flag to lexer for string padding*/ -H5T_str_t str_pad; /*variable for string padding*/ -H5T_cset_t str_cset; /*variable for string character set*/ -hbool_t is_variable = 0; /*variable for variable-length string*/ -size_t str_size; /*variable for string size*/ +static H5T_str_t str_pad; /*variable for string padding*/ +static H5T_cset_t str_cset; /*variable for string character set*/ +static hbool_t is_variable = 0; /*variable for variable-length string*/ +static size_t str_size; /*variable for string size*/ -hid_t enum_id; /*type ID*/ -hbool_t is_enum = 0; /*flag to lexer for enum type*/ -hbool_t is_enum_memb = 0; /*flag to lexer for enum member*/ -char* enum_memb_symbol; /*enum member symbol string*/ - -hbool_t is_opq_size = 0; /*flag to lexer for opaque type size*/ -hbool_t is_opq_tag = 0; /*flag to lexer for opaque type tag*/ +static hid_t enum_id; /*type ID*/ +static hbool_t is_enum = 0; /*flag to lexer for enum type*/ +static hbool_t is_enum_memb = 0; /*flag to lexer for enum member*/ +static char* enum_memb_symbol; /*enum member symbol string*/ %} %union { @@ -99,7 +96,7 @@ hbool_t is_opq_tag = 0; /*flag to lexer for opaque type tag*/ %token STRING %token NUMBER -%token '{' '}' '[' ']' '"' ':' ';' +%token '{' '}' '[' ']' ':' ';' %% start : { memset(arr_stack, 0, STACK_SIZE*sizeof(struct arr_info)); /*initialize here?*/ } @@ -168,35 +165,35 @@ memb_list : | memb_list memb_def ; memb_def : ddl_type { cmpd_stack[csindex].is_field = 1; /*notify lexer a compound member is parsed*/ } - '"' field_name '"' field_offset ';' + field_name field_offset ';' { size_t origin_size, new_size; hid_t dtype_id = cmpd_stack[csindex].id; /*Adjust size and insert member, consider both member size and offset.*/ if(cmpd_stack[csindex].first_memb) { /*reclaim the size 1 temporarily set*/ - new_size = H5Tget_size($1) + $6; + new_size = H5Tget_size($1) + $4; H5Tset_size(dtype_id, new_size); /*member name is saved in yylval.sval by lexer*/ - H5Tinsert(dtype_id, $4, $6, $1); + H5Tinsert(dtype_id, $3, $4, $1); cmpd_stack[csindex].first_memb = 0; } else { origin_size = H5Tget_size(dtype_id); - if($6 == 0) { + if($4 == 0) { new_size = origin_size + H5Tget_size($1); H5Tset_size(dtype_id, new_size); - H5Tinsert(dtype_id, $4, origin_size, $1); + H5Tinsert(dtype_id, $3, origin_size, $1); } else { - new_size = $6 + H5Tget_size($1); + new_size = $4 + H5Tget_size($1); H5Tset_size(dtype_id, new_size); - H5Tinsert(dtype_id, $4, $6, $1); + H5Tinsert(dtype_id, $3, $4, $1); } } - if($4) { - free($4); - $4 = NULL; + if($3) { + HDfree($3); + $3 = NULL; } cmpd_stack[csindex].is_field = 0; H5Tclose($1); @@ -206,8 +203,8 @@ memb_def : ddl_type { cmpd_stack[csindex].is_field = 1; /*notify le ; field_name : STRING { - $$ = strdup(yylval.sval); - free(yylval.sval); + $$ = HDstrdup(yylval.sval); + HDfree(yylval.sval); yylval.sval = NULL; } ; @@ -247,20 +244,18 @@ vlen_type : H5T_VLEN_TOKEN '{' ddl_type '}' opaque_type : H5T_OPAQUE_TOKEN '{' - OPQ_SIZE_TOKEN { is_opq_size = 1; } opaque_size ';' + OPQ_SIZE_TOKEN opaque_size ';' { size_t size = (size_t)yylval.ival; $$ = H5Tcreate(H5T_OPAQUE, size); - is_opq_size = 0; } - OPQ_TAG_TOKEN { is_opq_tag = 1; } '"' opaque_tag '"' ';' + OPQ_TAG_TOKEN opaque_tag ';' { - H5Tset_tag($7, yylval.sval); - free(yylval.sval); + H5Tset_tag($6, yylval.sval); + HDfree(yylval.sval); yylval.sval = NULL; - is_opq_tag = 0; } - '}' { $$ = $7; } + '}' { $$ = $6; } ; opaque_size : NUMBER ; @@ -268,40 +263,39 @@ opaque_tag : STRING ; string_type : H5T_STRING_TOKEN '{' - STRSIZE_TOKEN { is_str_size = 1; } strsize ';' + STRSIZE_TOKEN strsize ';' { - if($5 == H5T_VARIABLE_TOKEN) + if($4 == H5T_VARIABLE_TOKEN) is_variable = 1; else str_size = yylval.ival; - is_str_size = 0; } STRPAD_TOKEN strpad ';' { - if($9 == H5T_STR_NULLTERM_TOKEN) + if($8 == H5T_STR_NULLTERM_TOKEN) str_pad = H5T_STR_NULLTERM; - else if($9 == H5T_STR_NULLPAD_TOKEN) + else if($8 == H5T_STR_NULLPAD_TOKEN) str_pad = H5T_STR_NULLPAD; - else if($9 == H5T_STR_SPACEPAD_TOKEN) + else if($8 == H5T_STR_SPACEPAD_TOKEN) str_pad = H5T_STR_SPACEPAD; } CSET_TOKEN cset ';' { - if($13 == H5T_CSET_ASCII_TOKEN) + if($12 == H5T_CSET_ASCII_TOKEN) str_cset = H5T_CSET_ASCII; - else if($13 == H5T_CSET_UTF8_TOKEN) + else if($12 == H5T_CSET_UTF8_TOKEN) str_cset = H5T_CSET_UTF8; } CTYPE_TOKEN ctype ';' { - if($17 == H5T_C_S1_TOKEN) + if($16 == H5T_C_S1_TOKEN) $$ = H5Tcopy(H5T_C_S1); - else if($17 == H5T_FORTRAN_S1_TOKEN) + else if($16 == H5T_FORTRAN_S1_TOKEN) $$ = H5Tcopy(H5T_FORTRAN_S1); } '}' { - hid_t str_id = $19; + hid_t str_id = $18; /*set string size*/ if(is_variable) { @@ -339,14 +333,10 @@ enum_type : H5T_ENUM_TOKEN '{' integer_type ';' enum_list : | enum_list enum_def ; -enum_def : '"' enum_symbol '"' { +enum_def : enum_symbol { is_enum_memb = 1; /*indicate member of enum*/ -#ifdef H5_HAVE_WIN32_API - enum_memb_symbol = _strdup(yylval.sval); -#else /* H5_HAVE_WIN32_API */ enum_memb_symbol = strdup(yylval.sval); -#endif /* H5_HAVE_WIN32_API */ - free(yylval.sval); + HDfree(yylval.sval); yylval.sval = NULL; } enum_val ';' @@ -386,7 +376,7 @@ enum_def : '"' enum_symbol '"' { } is_enum_memb = 0; - if(enum_memb_symbol) free(enum_memb_symbol); + if(enum_memb_symbol) HDfree(enum_memb_symbol); } H5Tclose(super); From a7647a0d02a23f44b098b110cbf6974abc6173a7 Mon Sep 17 00:00:00 2001 From: Sean McBride Date: Fri, 12 Mar 2021 09:56:09 -0500 Subject: [PATCH 18/21] Removed workarounds for pre-standard inline keyword (#423) Fixes -Wreserved-identifier warnings due to multiple underscores in H5_HAVE___INLINE. --- src/H5Oshared.h | 16 ++++++++-------- src/H5VMprivate.h | 24 ++++++++++++------------ src/H5private.h | 17 ----------------- 3 files changed, 20 insertions(+), 37 deletions(-) diff --git a/src/H5Oshared.h b/src/H5Oshared.h index 0e774cfc67a..f164db3ff44 100644 --- a/src/H5Oshared.h +++ b/src/H5Oshared.h @@ -44,7 +44,7 @@ * *------------------------------------------------------------------------- */ -static H5_INLINE void * +static inline void * H5O_SHARED_DECODE(H5F_t *f, H5O_t *open_oh, unsigned mesg_flags, unsigned *ioflags, size_t p_size, const uint8_t *p) { @@ -103,7 +103,7 @@ H5O_SHARED_DECODE(H5F_t *f, H5O_t *open_oh, unsigned mesg_flags, unsigned *iofla * *------------------------------------------------------------------------- */ -static H5_INLINE herr_t +static inline herr_t H5O_SHARED_ENCODE(H5F_t *f, hbool_t disable_shared, uint8_t *p, const void *_mesg) { const H5O_shared_t *sh_mesg = @@ -158,7 +158,7 @@ H5O_SHARED_ENCODE(H5F_t *f, hbool_t disable_shared, uint8_t *p, const void *_mes * *------------------------------------------------------------------------- */ -static H5_INLINE size_t +static inline size_t H5O_SHARED_SIZE(const H5F_t *f, hbool_t disable_shared, const void *_mesg) { const H5O_shared_t *sh_mesg = @@ -211,7 +211,7 @@ H5O_SHARED_SIZE(const H5F_t *f, hbool_t disable_shared, const void *_mesg) * *------------------------------------------------------------------------- */ -static H5_INLINE herr_t +static inline herr_t H5O_SHARED_DELETE(H5F_t *f, H5O_t *open_oh, void *_mesg) { H5O_shared_t *sh_mesg = (H5O_shared_t *)_mesg; /* Pointer to shared message portion of actual message */ @@ -262,7 +262,7 @@ H5O_SHARED_DELETE(H5F_t *f, H5O_t *open_oh, void *_mesg) * *------------------------------------------------------------------------- */ -static H5_INLINE herr_t +static inline herr_t H5O_SHARED_LINK(H5F_t *f, H5O_t *open_oh, void *_mesg) { H5O_shared_t *sh_mesg = (H5O_shared_t *)_mesg; /* Pointer to shared message portion of actual message */ @@ -312,7 +312,7 @@ H5O_SHARED_LINK(H5F_t *f, H5O_t *open_oh, void *_mesg) * *------------------------------------------------------------------------- */ -static H5_INLINE void * +static inline void * H5O_SHARED_COPY_FILE(H5F_t *file_src, void *_native_src, H5F_t *file_dst, hbool_t *recompute_size, unsigned *mesg_flags, H5O_copy_t *cpy_info, void *udata) { @@ -375,7 +375,7 @@ H5O_SHARED_COPY_FILE(H5F_t *file_src, void *_native_src, H5F_t *file_dst, hbool_ * *------------------------------------------------------------------------- */ -static H5_INLINE herr_t +static inline herr_t H5O_SHARED_POST_COPY_FILE(const H5O_loc_t H5_ATTR_NDEBUG_UNUSED *oloc_src, const void *mesg_src, H5O_loc_t *oloc_dst, void *mesg_dst, unsigned *mesg_flags, H5O_copy_t *cpy_info) { @@ -445,7 +445,7 @@ H5O_SHARED_POST_COPY_FILE(const H5O_loc_t H5_ATTR_NDEBUG_UNUSED *oloc_src, const * *------------------------------------------------------------------------- */ -static H5_INLINE herr_t +static inline herr_t H5O_SHARED_DEBUG(H5F_t *f, const void *_mesg, FILE *stream, int indent, int fwidth) { const H5O_shared_t *sh_mesg = diff --git a/src/H5VMprivate.h b/src/H5VMprivate.h index e24ce836588..2fea2fcd7ad 100644 --- a/src/H5VMprivate.h +++ b/src/H5VMprivate.h @@ -143,7 +143,7 @@ H5_DLL ssize_t H5VM_memcpyvv(void *_dst, size_t dst_max_nseq, size_t *dst_curr_s * *------------------------------------------------------------------------- */ -static H5_INLINE hsize_t H5_ATTR_UNUSED +static inline hsize_t H5_ATTR_UNUSED H5VM_vector_reduce_product(unsigned n, const hsize_t *v) { hsize_t ret_value = 1; @@ -179,7 +179,7 @@ H5VM_vector_reduce_product(unsigned n, const hsize_t *v) * *------------------------------------------------------------------------- */ -static H5_INLINE htri_t H5_ATTR_UNUSED +static inline htri_t H5_ATTR_UNUSED H5VM_vector_zerop_u(int n, const hsize_t *v) { htri_t ret_value = TRUE; /* Return value */ @@ -216,7 +216,7 @@ H5VM_vector_zerop_u(int n, const hsize_t *v) * *------------------------------------------------------------------------- */ -static H5_INLINE htri_t H5_ATTR_UNUSED +static inline htri_t H5_ATTR_UNUSED H5VM_vector_zerop_s(int n, const hssize_t *v) { htri_t ret_value = TRUE; /* Return value */ @@ -255,7 +255,7 @@ H5VM_vector_zerop_s(int n, const hssize_t *v) * *------------------------------------------------------------------------- */ -static H5_INLINE int H5_ATTR_UNUSED +static inline int H5_ATTR_UNUSED H5VM_vector_cmp_u(unsigned n, const hsize_t *v1, const hsize_t *v2) { int ret_value = 0; /* Return value */ @@ -303,7 +303,7 @@ H5VM_vector_cmp_u(unsigned n, const hsize_t *v1, const hsize_t *v2) * *------------------------------------------------------------------------- */ -static H5_INLINE int H5_ATTR_UNUSED +static inline int H5_ATTR_UNUSED H5VM_vector_cmp_s(unsigned n, const hssize_t *v1, const hssize_t *v2) { int ret_value = 0; /* Return value */ @@ -346,7 +346,7 @@ H5VM_vector_cmp_s(unsigned n, const hssize_t *v1, const hssize_t *v2) * *------------------------------------------------------------------------- */ -static H5_INLINE void H5_ATTR_UNUSED +static inline void H5_ATTR_UNUSED H5VM_vector_inc(int n, hsize_t *v1, const hsize_t *v2) { while (n--) @@ -390,7 +390,7 @@ static const unsigned char LogTable256[] = { * *------------------------------------------------------------------------- */ -static H5_INLINE unsigned H5_ATTR_UNUSED +static inline unsigned H5_ATTR_UNUSED H5VM_log2_gen(uint64_t n) { unsigned r; /* r will be log2(n) */ @@ -439,7 +439,7 @@ static const unsigned MultiplyDeBruijnBitPosition[32] = {0, 1, 28, 2, 29, 14, * *------------------------------------------------------------------------- */ -static H5_INLINE H5_ATTR_PURE unsigned +static inline H5_ATTR_PURE unsigned H5VM_log2_of2(uint32_t n) { #ifndef NDEBUG @@ -463,7 +463,7 @@ H5VM_log2_of2(uint32_t n) * *------------------------------------------------------------------------- */ -static H5_INLINE H5_ATTR_CONST hsize_t +static inline H5_ATTR_CONST hsize_t H5VM_power2up(hsize_t n) { hsize_t ret_value = 1; /* Return value */ @@ -495,7 +495,7 @@ H5VM_power2up(hsize_t n) * *------------------------------------------------------------------------- */ -static H5_INLINE unsigned H5_ATTR_UNUSED +static inline unsigned H5_ATTR_UNUSED H5VM_limit_enc_size(uint64_t limit) { return (H5VM_log2_gen(limit) / 8) + 1; @@ -527,7 +527,7 @@ static const unsigned char H5VM_bit_clear_g[8] = {0x7F, 0xBF, 0xDF, 0xEF, 0xF7, * *------------------------------------------------------------------------- */ -static H5_INLINE hbool_t H5_ATTR_UNUSED +static inline hbool_t H5_ATTR_UNUSED H5VM_bit_get(const unsigned char *buf, size_t offset) { /* Test the appropriate bit in the buffer */ @@ -557,7 +557,7 @@ H5VM_bit_get(const unsigned char *buf, size_t offset) * *------------------------------------------------------------------------- */ -static H5_INLINE void H5_ATTR_UNUSED +static inline void H5_ATTR_UNUSED H5VM_bit_set(unsigned char *buf, size_t offset, hbool_t val) { /* Set/reset the appropriate bit in the buffer */ diff --git a/src/H5private.h b/src/H5private.h index c640b4280e7..0599745e3b3 100644 --- a/src/H5private.h +++ b/src/H5private.h @@ -190,23 +190,6 @@ #endif /*H5_HAVE_WIN32_API*/ -/* Various ways that inline functions can be declared */ -#if defined(H5_HAVE___INLINE__) -/* GNU (alternative form) */ -#define H5_INLINE __inline__ -#elif defined(H5_HAVE___INLINE) -/* Visual Studio */ -#define H5_INLINE __inline -#elif defined(H5_HAVE_INLINE) -/* GNU, C++ - * Use "inline" as a last resort on the off-chance that there will - * be C++ problems. - */ -#define H5_INLINE inline -#else -#define H5_INLINE -#endif /* inline choices */ - #ifndef F_OK #define F_OK 00 #define W_OK 02 From d286ab46e315b0ed8a4ec264683fb40777bbbb94 Mon Sep 17 00:00:00 2001 From: Dana Robinson <43805+derobins@users.noreply.github.com> Date: Thu, 11 Mar 2021 13:34:55 -0800 Subject: [PATCH 19/21] Replaces checks for fork, etc. with checks for unistd.h (#457) * Replaces checks for fork, etc. with H5_HAVE_UNISTD_H Code previously checked for individual POSIX API calls using H5_HAVE_FORK, etc. The calls we use have been standardized for decades and available via unistd.h. Some test messages that were missing when tests are skipped due to a lack of unistd.h were also added. The configure checks for individual POSIX API calls will be removed in a later commit. * Stupid formatter --- test/accum.c | 6 +-- test/dt_arith.c | 12 +++--- test/swmr.c | 68 ++++++++++++++++++++++------------ test/twriteorder.c | 10 ++--- test/use_append_chunk.c | 10 ++--- test/use_append_chunk_mirror.c | 10 ++--- test/use_append_mchunks.c | 10 ++--- test/use_common.c | 8 ++-- test/use_disable_mdc_flushes.c | 10 ++--- 9 files changed, 77 insertions(+), 67 deletions(-) diff --git a/test/accum.c b/test/accum.c index fd97576e865..483983ba90b 100644 --- a/test/accum.c +++ b/test/accum.c @@ -2092,7 +2092,7 @@ HDfprintf(stderr, "Random # seed was: %u\n", seed); unsigned test_swmr_write_big(hbool_t newest_format) { -#if defined(H5_HAVE_FORK) && defined(H5_HAVE_WAITPID) && defined(H5_HAVE_UNISTD_H) +#ifdef H5_HAVE_UNISTD_H hid_t fid = -1; /* File ID */ hid_t fapl = -1; /* File access property list */ H5F_t * rf = NULL; /* File pointer */ @@ -2287,11 +2287,11 @@ test_swmr_write_big(hbool_t newest_format) return 1; -#else +#else /* H5_HAVE_UNISTD_H */ SKIPPED(); HDputs(" Test skipped due to fork, waitpid, or pid_t not defined."); return 0; -#endif /* defined(H5_HAVE_FORK) && defined(H5_HAVE_WAITPID) && defined(H5_HAVE_UNISTD_H) */ +#endif /* H5_HAVE_UNISTD_H */ } /* end test_swmr_write_big() */ diff --git a/test/dt_arith.c b/test/dt_arith.c index 81b4b4641f6..8658ccbca53 100644 --- a/test/dt_arith.c +++ b/test/dt_arith.c @@ -84,7 +84,7 @@ static int skip_overflow_tests_g = 0; * be allowed to continue (cf. Posix signals) so in order to recover from a * SIGFPE we run tests that might generate one in a child process. */ -#if defined(H5_HAVE_FORK) && defined(H5_HAVE_WAITPID) +#ifdef H5_HAVE_UNISTD_H #define HANDLE_SIGFPE #endif @@ -556,7 +556,7 @@ some_dummy_func(float x) static void generates_sigfpe(void) { -#if defined(H5_HAVE_FORK) && defined(H5_HAVE_WAITPID) +#ifdef H5_HAVE_UNISTD_H pid_t pid; int status; size_t i, j; @@ -592,12 +592,12 @@ generates_sigfpe(void) /* delete the core dump file that SIGFPE may have created */ HDunlink("core"); } -#else - HDputs("Cannot determine if floating-point overflows generate a SIGFPE;"); - HDputs("assuming yes."); +#else /* H5_HAVE_UNISTD_H */ + HDputs("Cannot determine if floating-point overflows generate a SIGFPE"); + HDputs("due to a lack of fork(2) - assuming yes."); HDputs("Overflow cases will not be tested."); skip_overflow_tests_g = TRUE; -#endif +#endif /* H5_HAVE_UNISTD_H */ } /*------------------------------------------------------------------------- diff --git a/test/swmr.c b/test/swmr.c index fd7811798df..2f901141d6e 100644 --- a/test/swmr.c +++ b/test/swmr.c @@ -2341,17 +2341,24 @@ test_err_start_swmr_write(hid_t in_fapl, hbool_t new_format) * (5) Parent: open a file with write access; enable SWMR writing mode * Child: concurrent open of the file with write and SWMR write access (fail) */ -#if !(defined(H5_HAVE_FORK) && defined(H5_HAVE_WAITPID)) +#ifndef H5_HAVE_UNISTD_H static int -test_start_swmr_write_concur(hid_t H5_ATTR_UNUSED in_fapl, hbool_t H5_ATTR_UNUSED new_format) +test_start_swmr_write_concur(hid_t H5_ATTR_UNUSED in_fapl, hbool_t new_format) { + if (new_format) { + TESTING("H5Fstart_swmr_write()--concurrent access for latest format"); + } + else { + TESTING("H5Fstart_swmr_write()--concurrent access for non-latest-format"); + } + SKIPPED(); - HDputs(" Test skipped due to fork or waitpid not defined."); + HDputs(" Test skipped due to a lack of unistd.h functionality."); return 0; } /* test_start_swmr_write_concur() */ -#else /* defined(H5_HAVE_FORK && defined(H5_HAVE_WAITPID) */ +#else /* H5_HAVE_UNISTD_H */ static int test_start_swmr_write_concur(hid_t in_fapl, hbool_t new_format) @@ -2383,7 +2390,7 @@ test_start_swmr_write_concur(hid_t in_fapl, hbool_t new_format) } else { TESTING("H5Fstart_swmr_write()--concurrent access for non-latest-format"); - } /* end if */ + } if ((fapl = H5Pcopy(in_fapl)) < 0) FAIL_STACK_ERROR @@ -2944,7 +2951,7 @@ test_start_swmr_write_concur(hid_t in_fapl, hbool_t new_format) return -1; } /* test_start_swmr_write_concur() */ -#endif /* !(defined(H5_HAVE_FORK) && defined(H5_HAVE_WAITPID)) */ +#endif /* H5_HAVE_UNISTD_H */ /* * test_start_swmr_write_stress_ohdr(): @@ -4675,7 +4682,7 @@ test_file_lock_swmr_same(hid_t in_fapl) ** This is for concurrent access. ** *****************************************************************/ -#if !(defined(H5_HAVE_FORK) && defined(H5_HAVE_WAITPID) && defined(H5_HAVE_FLOCK)) +#ifndef H5_HAVE_UNISTD_H static int test_file_lock_concur(hid_t H5_ATTR_UNUSED in_fapl) @@ -4683,12 +4690,12 @@ test_file_lock_concur(hid_t H5_ATTR_UNUSED in_fapl) /* Output message about test being performed */ TESTING("File open with different combinations of flags--concurrent access"); SKIPPED(); - HDputs(" Test skipped due to fork, waitpid, or flock not defined."); + HDputs(" Test skipped due to a lack of unistd.h functionality."); return 0; } /* end test_file_lock_concur() */ -#else +#else /* H5_HAVE_UNISTD_H */ static int test_file_lock_concur(hid_t in_fapl) @@ -5046,7 +5053,7 @@ test_file_lock_concur(hid_t in_fapl) } /* end test_file_lock_concur() */ -#endif /* !(defined(H5_HAVE_FORK) && defined(H5_HAVE_WAITPID) && defined(H5_HAVE_FLOCK)) */ +#endif /* H5_HAVE_UNISTD_H */ /**************************************************************** ** @@ -5056,7 +5063,7 @@ test_file_lock_concur(hid_t in_fapl) ** This is for concurrent access. ** *****************************************************************/ -#if !(defined(H5_HAVE_FORK) && defined(H5_HAVE_WAITPID)) +#ifndef H5_HAVE_UNISTD_H static int test_file_lock_swmr_concur(hid_t H5_ATTR_UNUSED in_fapl) @@ -5064,12 +5071,12 @@ test_file_lock_swmr_concur(hid_t H5_ATTR_UNUSED in_fapl) /* Output message about test being performed */ TESTING("File open with different combintations of flags + SWMR flags--concurrent access"); SKIPPED(); - HDputs(" Test skipped due to fork or waitpid not defined."); + HDputs(" Test skipped due to a lack of unistd.h functionality."); return 0; } /* end test_file_lock_swmr_concur() */ -#else +#else /* H5_HAVE_UNISTD_H */ static int test_file_lock_swmr_concur(hid_t in_fapl) @@ -6036,7 +6043,7 @@ test_file_lock_swmr_concur(hid_t in_fapl) } /* end test_file_lock_swmr_concur() */ -#endif /* !(defined(H5_HAVE_FORK && defined(H5_HAVE_WAITPID)) */ +#endif /* H5_HAVE_UNISTD_H */ /**************************************************************** ** @@ -6048,11 +6055,19 @@ test_file_lock_swmr_concur(hid_t in_fapl) static int test_file_locking(hid_t in_fapl, hbool_t turn_locking_on, hbool_t env_var_override) { -#if !(defined(H5_HAVE_FORK) && defined(H5_HAVE_WAITPID)) +#ifndef H5_HAVE_UNISTD_H + if (turn_locking_on && env_var_override) + TESTING("File locking: ON w/ env var override") + else if (turn_locking_on && !env_var_override) + TESTING("File locking: ON") + else if (!turn_locking_on && env_var_override) + TESTING("File locking: OFF w/ env var override") + else + TESTING("File locking: OFF") SKIPPED(); - HDputs(" Test skipped due to fork or waitpid not defined."); + HDputs(" Test skipped due to a lack of unistd.h functionality."); return 0; -#else +#else /* H5_HAVE_UNISTD_H */ hid_t fid = -1; /* File ID */ hid_t fapl = -1; /* File access property list */ char filename[NAME_BUF_SIZE]; /* file name */ @@ -6218,7 +6233,7 @@ test_file_locking(hid_t in_fapl, hbool_t turn_locking_on, hbool_t env_var_overri return -1; -#endif /* !(defined(H5_HAVE_FORK && defined(H5_HAVE_WAITPID)) */ +#endif /* H5_HAVE_UNISTD_H */ } /* end test_file_locking() */ @@ -6498,17 +6513,24 @@ test_bug_refresh(hid_t in_fapl) * (7) Refresh the dataset * (8) Verify the dataset's dimension and data are correct */ -#if !(defined(H5_HAVE_FORK) && defined(H5_HAVE_WAITPID)) +#ifndef H5_HAVE_UNISTD_H static int -test_refresh_concur(hid_t H5_ATTR_UNUSED in_fapl, hbool_t H5_ATTR_UNUSED new_format) +test_refresh_concur(hid_t H5_ATTR_UNUSED in_fapl, hbool_t new_format) { + if (new_format) { + TESTING("H5Drefresh()--concurrent access for latest format"); + } + else { + TESTING("H5Drefresh()--concurrent access for non-latest-format"); + } + SKIPPED(); - HDputs(" Test skipped due to fork or waitpid not defined."); + HDputs(" Test skipped due to a lack of unistd.h functionality."); return 0; } /* test_refresh_concur() */ -#else /* defined(H5_HAVE_FORK && defined(H5_HAVE_WAITPID) */ +#else /* H5_HAVE_UNISTD_H */ static int test_refresh_concur(hid_t in_fapl, hbool_t new_format) @@ -6808,7 +6830,7 @@ test_refresh_concur(hid_t in_fapl, hbool_t new_format) return -1; } /* test_refresh_concur() */ -#endif /* !(defined(H5_HAVE_FORK) && defined(H5_HAVE_WAITPID)) */ +#endif /* H5_HAVE_UNISTD_H */ /* * test_multiple_same(): diff --git a/test/twriteorder.c b/test/twriteorder.c index 9f4fee1dbb8..e792487c85b 100644 --- a/test/twriteorder.c +++ b/test/twriteorder.c @@ -61,11 +61,9 @@ #include "h5test.h" /* This test uses many POSIX things that are not available on - * Windows. We're using a check for fork(2) here as a proxy for - * all POSIX/Unix/Linux things until this test can be made - * more platform-independent. + * Windows. */ -#ifdef H5_HAVE_FORK +#ifdef H5_HAVE_UNISTD_H #define DATAFILE "twriteorder.dat" /* #define READERS_MAX 10 */ /* max number of readers */ @@ -468,7 +466,7 @@ main(int argc, char *argv[]) return ret_value; } -#else /* H5_HAVE_FORK */ +#else /* H5_HAVE_UNISTD_H */ int main(void) @@ -477,4 +475,4 @@ main(void) return EXIT_SUCCESS; } /* end main() */ -#endif /* H5_HAVE_FORK */ +#endif /* H5_HAVE_UNISTD_H */ diff --git a/test/use_append_chunk.c b/test/use_append_chunk.c index 3699a56c7e4..107615a22c3 100644 --- a/test/use_append_chunk.c +++ b/test/use_append_chunk.c @@ -61,11 +61,9 @@ #include "h5test.h" /* This test uses many POSIX things that are not available on - * Windows. We're using a check for fork(2) here as a proxy for - * all POSIX/Unix/Linux things until this test can be made - * more platform-independent. + * Windows. */ -#ifdef H5_HAVE_FORK +#ifdef H5_HAVE_UNISTD_H #include "use.h" @@ -272,7 +270,7 @@ main(int argc, char *argv[]) return (ret_value); } -#else /* H5_HAVE_FORK */ +#else /* H5_HAVE_UNISTD_H */ int main(void) @@ -281,4 +279,4 @@ main(void) return EXIT_SUCCESS; } /* end main() */ -#endif /* H5_HAVE_FORK */ +#endif /* H5_HAVE_UNISTD_H */ diff --git a/test/use_append_chunk_mirror.c b/test/use_append_chunk_mirror.c index 59a77328efd..b19c510d3c5 100644 --- a/test/use_append_chunk_mirror.c +++ b/test/use_append_chunk_mirror.c @@ -91,11 +91,9 @@ #include "use.h" /* This test uses many POSIX things that are not available on - * Windows. We're using a check for fork(2) here as a proxy for - * all POSIX/Unix/Linux things until this test can be made - * more platform-independent. + * Windows. */ -#ifdef H5_HAVE_FORK +#ifdef H5_HAVE_UNISTD_H #ifdef H5_HAVE_MIRROR_VFD @@ -391,7 +389,7 @@ main(void) #endif /* H5_HAVE_MIRROR_VFD */ -#else /* H5_HAVE_FORK */ +#else /* H5_HAVE_UNISTD_H */ int main(void) @@ -400,4 +398,4 @@ main(void) return EXIT_SUCCESS; } /* end main() */ -#endif /* H5_HAVE_FORK */ +#endif /* H5_HAVE_UNISTD_H */ diff --git a/test/use_append_mchunks.c b/test/use_append_mchunks.c index 7c1971bbd44..47c9f9262fa 100644 --- a/test/use_append_mchunks.c +++ b/test/use_append_mchunks.c @@ -53,11 +53,9 @@ #include "h5test.h" /* This test uses many POSIX things that are not available on - * Windows. We're using a check for fork(2) here as a proxy for - * all POSIX/Unix/Linux things until this test can be made - * more platform-independent. + * Windows. */ -#ifdef H5_HAVE_FORK +#ifdef H5_HAVE_UNISTD_H #include "use.h" @@ -267,7 +265,7 @@ main(int argc, char *argv[]) return (ret_value); } /* end main() */ -#else /* H5_HAVE_FORK */ +#else /* H5_HAVE_UNISTD_H */ int main(void) @@ -276,4 +274,4 @@ main(void) return EXIT_SUCCESS; } /* end main() */ -#endif /* H5_HAVE_FORK */ +#endif /* H5_HAVE_UNISTD_H */ diff --git a/test/use_common.c b/test/use_common.c index 4a878c7a65e..0ea2c83e2fd 100644 --- a/test/use_common.c +++ b/test/use_common.c @@ -13,11 +13,9 @@ #include "h5test.h" /* This test uses many POSIX things that are not available on - * Windows. We're using a check for fork(2) here as a proxy for - * all POSIX/Unix/Linux things until this test can be made - * more platform-independent. + * Windows. */ -#ifdef H5_HAVE_FORK +#ifdef H5_HAVE_UNISTD_H #include "use.h" @@ -613,4 +611,4 @@ read_uc_file(hbool_t towait, options_t *opts) return 0; } /* end read_uc_file() */ -#endif /* H5_HAVE_FORK */ +#endif /* H5_HAVE_UNISTD_H */ diff --git a/test/use_disable_mdc_flushes.c b/test/use_disable_mdc_flushes.c index 1f2976f5f2f..f28e574aa6c 100644 --- a/test/use_disable_mdc_flushes.c +++ b/test/use_disable_mdc_flushes.c @@ -18,11 +18,9 @@ #include "h5test.h" /* This test uses many POSIX things that are not available on - * Windows. We're using a check for fork(2) here as a proxy for - * all POSIX/Unix/Linux things until this test can be made - * more platform-independent. + * Windows. */ -#ifdef H5_HAVE_FORK +#ifdef H5_HAVE_UNISTD_H #define H5D_FRIEND /*suppress error about including H5Dpkg */ #define H5D_TESTING @@ -539,7 +537,7 @@ main(int argc, char *argv[]) return (ret_value); } -#else /* H5_HAVE_FORK */ +#else /* H5_HAVE_UNISTD_H */ int main(void) @@ -548,4 +546,4 @@ main(void) HDexit(EXIT_SUCCESS); } /* end main() */ -#endif /* H5_HAVE_FORK */ +#endif /* H5_HAVE_UNISTD_H */ From bfc49df2ad7ede179ff510491476f20190e3d328 Mon Sep 17 00:00:00 2001 From: Allen Byrne <50328838+byrnHDF@users.noreply.github.com> Date: Fri, 12 Mar 2021 07:47:47 -0600 Subject: [PATCH 20/21] develop JNI export references and java updates (#467) * OESS-98 convert plugin option to FetchContent, add tests * Fixes for pkcfg files because of plugin option * OESS-98 fix tools test for plugins * Keep doxygen comments under 100 chars long - format hint * Whitespace * HDFFV-11144 - Reclassify CMake messages * HDFFV-11099/11100 added help text * Reworked switch statement to compare string instead * Fix typo * Update CDash mode * Correct name of threadsafe * Correct option name * Undo accidental commit * Note LLVM 10 to 11 format default changes * Update format plugin * Undo clang-format version 11 changes * One more correction * Update supported platforms * Revert whitespace changes * Correct whitespace * Changes from PR#3 * HDFFV-11213 added option to control gcc10 warnings diagnostics * HDFFV-11212 Use the new references correctly in JNI utility and tests * format source * Fix typo * Add new test file * HDFFV-11212 - update test and remove unused arg * Minor non-space formatting changes * Use H5I_INVALID_ID instead of "-1" * source formatting * add missing testfile, update jni function * Undo commit of debug code * remove mislocated file * Fix h5repack test for handling of fapls and id close * Update h5diff test files usage text * HDFFV-11212 add new ref tests for JNI export dataset * src format update * Remove blank line typo * src format typo * long double requires %Lg * Another long double foramt specifer S.B. %Lg * issue with t128bit test * Windows issue with h5dump and type. * Fix review issues * refactor function nesting and fix error checks * format fixes * Remove untested functions and javadoc quiet comments * Restore TRY block. * Change string append errors to memory exception * revert to H5_JNI_FATAL_ERROR - support functions need work * Add assertion error for h5util functions * remove duplicate function * format fix * Revert HD function error handling * Update copyright comments * GH #386 java folder copyright corrections * Whitespace * GH #359 implement and fix tools 1.6 API usage * remove excessive comments * Flip inits to correct ifdef section * rework ifdef to be simpler * format issue * Reformat ifdef inits * remove static attribute * format compliance * Update names * Revert because logic relies on float not being int * Changes noticed from creating merge of #412 * Double underscore change * Correct compiler version variable used * Remove header guard underscores * Whitespace cleanup * Split format source and commit changes on repo push * remove pre-split setting * Change windows TS to use older VS. * correct window os name * HDFFV-11212 JNI export util and Javadoc * Suggested review changes * Another change found * Committing clang-format changes Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com> --- tools/lib/h5diff_array.c | 1 + 1 file changed, 1 insertion(+) diff --git a/tools/lib/h5diff_array.c b/tools/lib/h5diff_array.c index ed4bd8d3eb2..faee63f6df6 100644 --- a/tools/lib/h5diff_array.c +++ b/tools/lib/h5diff_array.c @@ -3388,6 +3388,7 @@ print_pos(diff_opt_t *opts, hsize_t idx, size_t u) H5TOOLS_DEBUG("... sset loop:%d with curr_pos:%ld (curr_idx:%ld) - c:%ld b:%ld s:%ld", j, curr_pos, curr_idx, cnt_idx, blk_idx, str_idx); dim_size = opts->dims[j]; /* Current dimension size */ + /* elmnt_cnt *= dim_size; /* Total number of elements in dimension */ H5TOOLS_DEBUG("... sset loop:%d with elmnt_cnt:%ld - (prev_dim_size:%ld - dim_size:%ld) " "- str_cnt:%ld", j, elmnt_cnt, prev_dim_size, dim_size, str_cnt); From 8bda1d2713634c911618a94658a5aaf9267c58de Mon Sep 17 00:00:00 2001 From: Larry Knox Date: Tue, 23 Mar 2021 21:46:19 -0500 Subject: [PATCH 21/21] Update h5LT files with latest flex and Bison available on jelly (#502) * Modify temporary rpath for testing in java example scripts. * Update URL in source file Copyright headers for web copy of COPYING (license) file. * Add release_docs/code-conventions.md file. * Add script to test h5py. * Fix script error. * Add file h5pytest.yml. * Test declaration of counter variables in for loops. * Committing clang-format changes * Committing clang-format changes * Added [] to line 126 of H5LTanalyze.l. Ran bin/genparser with flex v2.6.4 and Bison v3.0.4 on jelly. * Revert "Added [] to line 126 of H5LTanalyze.l." This reverts commit e4a9cee441efa75b16a8ee030c86189e186dd266. * Revert extra commits to match canonical develop. * Added [] to H5LTanalyze.l line 126 to eliminate warning "rule could not be matched". Ran bin/genparser hl/src with flex v2.6.4 and Bison v3.0.4 on jelly. * Added HD to strdup in H5LTparse.y line 338. Ran bin/genparser hlsrc again. * Removed line 126 from H5LTanalyze.l - previous line matches. Added previously removed line 318 of H5LTparse.y to fix hl_test_lite failure. Ran bin/genparser. Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com> --- hl/src/H5LTanalyze.c | 1374 +++++++++++++++++++++++++----------------- hl/src/H5LTanalyze.l | 1 - hl/src/H5LTparse.c | 1263 +++++++++++++++++--------------------- hl/src/H5LTparse.h | 165 +++-- hl/src/H5LTparse.y | 2 +- 5 files changed, 1436 insertions(+), 1369 deletions(-) diff --git a/hl/src/H5LTanalyze.c b/hl/src/H5LTanalyze.c index 1f23d3b5f42..65da9d03df7 100644 --- a/hl/src/H5LTanalyze.c +++ b/hl/src/H5LTanalyze.c @@ -28,9 +28,9 @@ #elif defined _MSC_VER #pragma warning(push, 1) #endif -#line 2 "hl/src//H5LTanalyze.c" +#line 1 "hl/src/H5LTanalyze.c" -#line 4 "hl/src//H5LTanalyze.c" +#line 3 "hl/src/H5LTanalyze.c" #define YY_INT_ALIGNED short int @@ -38,11 +38,17 @@ #define yy_create_buffer H5LTyy_create_buffer #define yy_delete_buffer H5LTyy_delete_buffer -#define yy_flex_debug H5LTyy_flex_debug +#define yy_scan_buffer H5LTyy_scan_buffer +#define yy_scan_string H5LTyy_scan_string +#define yy_scan_bytes H5LTyy_scan_bytes #define yy_init_buffer H5LTyy_init_buffer #define yy_flush_buffer H5LTyy_flush_buffer #define yy_load_buffer_state H5LTyy_load_buffer_state #define yy_switch_to_buffer H5LTyy_switch_to_buffer +#define yypush_buffer_state H5LTyypush_buffer_state +#define yypop_buffer_state H5LTyypop_buffer_state +#define yyensure_buffer_stack H5LTyyensure_buffer_stack +#define yy_flex_debug H5LTyy_flex_debug #define yyin H5LTyyin #define yyleng H5LTyyleng #define yylex H5LTyylex @@ -57,12 +63,246 @@ #define FLEX_SCANNER #define YY_FLEX_MAJOR_VERSION 2 -#define YY_FLEX_MINOR_VERSION 5 -#define YY_FLEX_SUBMINOR_VERSION 37 +#define YY_FLEX_MINOR_VERSION 6 +#define YY_FLEX_SUBMINOR_VERSION 4 #if YY_FLEX_SUBMINOR_VERSION > 0 #define FLEX_BETA #endif +#ifdef yy_create_buffer +#define H5LTyy_create_buffer_ALREADY_DEFINED +#else +#define yy_create_buffer H5LTyy_create_buffer +#endif + +#ifdef yy_delete_buffer +#define H5LTyy_delete_buffer_ALREADY_DEFINED +#else +#define yy_delete_buffer H5LTyy_delete_buffer +#endif + +#ifdef yy_scan_buffer +#define H5LTyy_scan_buffer_ALREADY_DEFINED +#else +#define yy_scan_buffer H5LTyy_scan_buffer +#endif + +#ifdef yy_scan_string +#define H5LTyy_scan_string_ALREADY_DEFINED +#else +#define yy_scan_string H5LTyy_scan_string +#endif + +#ifdef yy_scan_bytes +#define H5LTyy_scan_bytes_ALREADY_DEFINED +#else +#define yy_scan_bytes H5LTyy_scan_bytes +#endif + +#ifdef yy_init_buffer +#define H5LTyy_init_buffer_ALREADY_DEFINED +#else +#define yy_init_buffer H5LTyy_init_buffer +#endif + +#ifdef yy_flush_buffer +#define H5LTyy_flush_buffer_ALREADY_DEFINED +#else +#define yy_flush_buffer H5LTyy_flush_buffer +#endif + +#ifdef yy_load_buffer_state +#define H5LTyy_load_buffer_state_ALREADY_DEFINED +#else +#define yy_load_buffer_state H5LTyy_load_buffer_state +#endif + +#ifdef yy_switch_to_buffer +#define H5LTyy_switch_to_buffer_ALREADY_DEFINED +#else +#define yy_switch_to_buffer H5LTyy_switch_to_buffer +#endif + +#ifdef yypush_buffer_state +#define H5LTyypush_buffer_state_ALREADY_DEFINED +#else +#define yypush_buffer_state H5LTyypush_buffer_state +#endif + +#ifdef yypop_buffer_state +#define H5LTyypop_buffer_state_ALREADY_DEFINED +#else +#define yypop_buffer_state H5LTyypop_buffer_state +#endif + +#ifdef yyensure_buffer_stack +#define H5LTyyensure_buffer_stack_ALREADY_DEFINED +#else +#define yyensure_buffer_stack H5LTyyensure_buffer_stack +#endif + +#ifdef yylex +#define H5LTyylex_ALREADY_DEFINED +#else +#define yylex H5LTyylex +#endif + +#ifdef yyrestart +#define H5LTyyrestart_ALREADY_DEFINED +#else +#define yyrestart H5LTyyrestart +#endif + +#ifdef yylex_init +#define H5LTyylex_init_ALREADY_DEFINED +#else +#define yylex_init H5LTyylex_init +#endif + +#ifdef yylex_init_extra +#define H5LTyylex_init_extra_ALREADY_DEFINED +#else +#define yylex_init_extra H5LTyylex_init_extra +#endif + +#ifdef yylex_destroy +#define H5LTyylex_destroy_ALREADY_DEFINED +#else +#define yylex_destroy H5LTyylex_destroy +#endif + +#ifdef yyget_debug +#define H5LTyyget_debug_ALREADY_DEFINED +#else +#define yyget_debug H5LTyyget_debug +#endif + +#ifdef yyset_debug +#define H5LTyyset_debug_ALREADY_DEFINED +#else +#define yyset_debug H5LTyyset_debug +#endif + +#ifdef yyget_extra +#define H5LTyyget_extra_ALREADY_DEFINED +#else +#define yyget_extra H5LTyyget_extra +#endif + +#ifdef yyset_extra +#define H5LTyyset_extra_ALREADY_DEFINED +#else +#define yyset_extra H5LTyyset_extra +#endif + +#ifdef yyget_in +#define H5LTyyget_in_ALREADY_DEFINED +#else +#define yyget_in H5LTyyget_in +#endif + +#ifdef yyset_in +#define H5LTyyset_in_ALREADY_DEFINED +#else +#define yyset_in H5LTyyset_in +#endif + +#ifdef yyget_out +#define H5LTyyget_out_ALREADY_DEFINED +#else +#define yyget_out H5LTyyget_out +#endif + +#ifdef yyset_out +#define H5LTyyset_out_ALREADY_DEFINED +#else +#define yyset_out H5LTyyset_out +#endif + +#ifdef yyget_leng +#define H5LTyyget_leng_ALREADY_DEFINED +#else +#define yyget_leng H5LTyyget_leng +#endif + +#ifdef yyget_text +#define H5LTyyget_text_ALREADY_DEFINED +#else +#define yyget_text H5LTyyget_text +#endif + +#ifdef yyget_lineno +#define H5LTyyget_lineno_ALREADY_DEFINED +#else +#define yyget_lineno H5LTyyget_lineno +#endif + +#ifdef yyset_lineno +#define H5LTyyset_lineno_ALREADY_DEFINED +#else +#define yyset_lineno H5LTyyset_lineno +#endif + +#ifdef yywrap +#define H5LTyywrap_ALREADY_DEFINED +#else +#define yywrap H5LTyywrap +#endif + +#ifdef yyalloc +#define H5LTyyalloc_ALREADY_DEFINED +#else +#define yyalloc H5LTyyalloc +#endif + +#ifdef yyrealloc +#define H5LTyyrealloc_ALREADY_DEFINED +#else +#define yyrealloc H5LTyyrealloc +#endif + +#ifdef yyfree +#define H5LTyyfree_ALREADY_DEFINED +#else +#define yyfree H5LTyyfree +#endif + +#ifdef yytext +#define H5LTyytext_ALREADY_DEFINED +#else +#define yytext H5LTyytext +#endif + +#ifdef yyleng +#define H5LTyyleng_ALREADY_DEFINED +#else +#define yyleng H5LTyyleng +#endif + +#ifdef yyin +#define H5LTyyin_ALREADY_DEFINED +#else +#define yyin H5LTyyin +#endif + +#ifdef yyout +#define H5LTyyout_ALREADY_DEFINED +#else +#define yyout H5LTyyout +#endif + +#ifdef yy_flex_debug +#define H5LTyy_flex_debug_ALREADY_DEFINED +#else +#define yy_flex_debug H5LTyy_flex_debug +#endif + +#ifdef yylineno +#define H5LTyylineno_ALREADY_DEFINED +#else +#define yylineno H5LTyylineno +#endif + /* First, we deal with platform-specific or compiler-specific issues. */ /* begin standard C headers. */ @@ -133,65 +373,61 @@ typedef unsigned int flex_uint32_t; #define UINT32_MAX (4294967295U) #endif +#ifndef SIZE_MAX +#define SIZE_MAX (~(size_t)0) +#endif + #endif /* ! C99 */ #endif /* ! FLEXINT_H */ -#ifdef __cplusplus - -/* The "const" storage-class-modifier is valid. */ -#define YY_USE_CONST - -#else /* ! __cplusplus */ - -/* C99 requires __STDC__ to be defined as 1. */ -#if defined (__STDC__) - -#define YY_USE_CONST +/* begin standard C++ headers. */ -#endif /* defined (__STDC__) */ -#endif /* ! __cplusplus */ - -#ifdef YY_USE_CONST +/* TODO: this is always defined, so inline it */ #define yyconst const + +#if defined(__GNUC__) && __GNUC__ >= 3 +#define yynoreturn __attribute__((__noreturn__)) #else -#define yyconst +#define yynoreturn #endif /* Returned upon end-of-file. */ #define YY_NULL 0 -/* Promotes a possibly negative, possibly signed char to an unsigned - * integer for use as an array index. If the signed char is negative, - * we want to instead treat it as an 8-bit unsigned char, hence the - * double cast. +/* Promotes a possibly negative, possibly signed char to an + * integer in range [0..255] for use as an array index. */ -#define YY_SC_TO_UI(c) ((unsigned int) (unsigned char) c) +#define YY_SC_TO_UI(c) ((YY_CHAR) (c)) /* Enter a start condition. This macro really ought to take a parameter, * but we do it the disgusting crufty way forced on us by the ()-less * definition of BEGIN. */ #define BEGIN (yy_start) = 1 + 2 * - /* Translate the current start state into a value that can be later handed * to BEGIN to return to the state. The YYSTATE alias is for lex * compatibility. */ #define YY_START (((yy_start) - 1) / 2) #define YYSTATE YY_START - /* Action number for EOF rule of a given start state. */ #define YY_STATE_EOF(state) (YY_END_OF_BUFFER + state + 1) - /* Special action meaning "start processing a new file". */ -#define YY_NEW_FILE H5LTyyrestart(H5LTyyin ) - +#define YY_NEW_FILE yyrestart( yyin ) #define YY_END_OF_BUFFER_CHAR 0 /* Size of default input buffer. */ #ifndef YY_BUF_SIZE +#ifdef __ia64__ +/* On IA-64, the buffer size is 16k, not 8k. + * Moreover, YY_BUF_SIZE is 2*YY_READ_BUF_SIZE in the general case. + * Ditto for the __ia64__ case accordingly. + */ +#define YY_BUF_SIZE 32768 +#else #define YY_BUF_SIZE 16384 +#endif /* __ia64__ */ #endif /* The state buf must be large enough to hold one state per character in the main buffer. @@ -208,30 +444,30 @@ typedef struct yy_buffer_state *YY_BUFFER_STATE; typedef size_t yy_size_t; #endif -extern yy_size_t H5LTyyleng; +extern int yyleng; -extern FILE *H5LTyyin, *H5LTyyout; +extern FILE *yyin, *yyout; #define EOB_ACT_CONTINUE_SCAN 0 #define EOB_ACT_END_OF_FILE 1 #define EOB_ACT_LAST_MATCH 2 - + #define YY_LESS_LINENO(n) + #define YY_LINENO_REWIND_TO(ptr) /* Return all but the first "n" matched characters back to the input stream. */ #define yyless(n) \ do \ { \ - /* Undo effects of setting up H5LTyytext. */ \ + /* Undo effects of setting up yytext. */ \ int yyless_macro_arg = (n); \ YY_LESS_LINENO(yyless_macro_arg);\ *yy_cp = (yy_hold_char); \ YY_RESTORE_YY_MORE_OFFSET \ (yy_c_buf_p) = yy_cp = yy_bp + yyless_macro_arg - YY_MORE_ADJ; \ - YY_DO_BEFORE_ACTION; /* set up H5LTyytext again */ \ + YY_DO_BEFORE_ACTION; /* set up yytext again */ \ } \ while ( 0 ) - #define unput(c) yyunput( c, (yytext_ptr) ) #ifndef YY_STRUCT_YY_BUFFER_STATE @@ -246,12 +482,12 @@ struct yy_buffer_state /* Size of input buffer in bytes, not including room for EOB * characters. */ - yy_size_t yy_buf_size; + int yy_buf_size; /* Number of characters read into yy_ch_buf, not including EOB * characters. */ - yy_size_t yy_n_chars; + int yy_n_chars; /* Whether we "own" the buffer - i.e., we know we created it, * and can realloc() it to grow it, and should free() it to @@ -274,7 +510,7 @@ struct yy_buffer_state int yy_bs_lineno; /**< The line count. */ int yy_bs_column; /**< The column count. */ - + /* Whether to try to fill the input buffer when we reach the * end of it. */ @@ -291,8 +527,8 @@ struct yy_buffer_state * possible backing-up. * * When we actually see the EOF, we change the status to "new" - * (via H5LTyyrestart()), so that the user can continue scanning by - * just pointing H5LTyyin at a new input file. + * (via yyrestart()), so that the user can continue scanning by + * just pointing yyin at a new input file. */ #define YY_BUFFER_EOF_PENDING 2 @@ -302,7 +538,7 @@ struct yy_buffer_state /* Stack of input buffers. */ static size_t yy_buffer_stack_top = 0; /**< index of top of stack. */ static size_t yy_buffer_stack_max = 0; /**< capacity of stack. */ -static YY_BUFFER_STATE * yy_buffer_stack = 0; /**< Stack as an array. */ +static YY_BUFFER_STATE * yy_buffer_stack = NULL; /**< Stack as an array. */ /* We provide macros for accessing buffer states in case in the * future we want to put the buffer states in a more general @@ -313,105 +549,100 @@ static YY_BUFFER_STATE * yy_buffer_stack = 0; /**< Stack as an array. */ #define YY_CURRENT_BUFFER ( (yy_buffer_stack) \ ? (yy_buffer_stack)[(yy_buffer_stack_top)] \ : NULL) - /* Same as previous macro, but useful when we know that the buffer stack is not * NULL or when we need an lvalue. For internal use only. */ #define YY_CURRENT_BUFFER_LVALUE (yy_buffer_stack)[(yy_buffer_stack_top)] -/* yy_hold_char holds the character lost when H5LTyytext is formed. */ +/* yy_hold_char holds the character lost when yytext is formed. */ static char yy_hold_char; -static yy_size_t yy_n_chars; /* number of characters read into yy_ch_buf */ -yy_size_t H5LTyyleng; +static int yy_n_chars; /* number of characters read into yy_ch_buf */ +int yyleng; /* Points to current character in buffer. */ -static char *yy_c_buf_p = (char *) 0; +static char *yy_c_buf_p = NULL; static int yy_init = 0; /* whether we need to initialize */ static int yy_start = 0; /* start state number */ -/* Flag which is used to allow H5LTyywrap()'s to do buffer switches - * instead of setting up a fresh H5LTyyin. A bit of a hack ... +/* Flag which is used to allow yywrap()'s to do buffer switches + * instead of setting up a fresh yyin. A bit of a hack ... */ static int yy_did_buffer_switch_on_eof; -void H5LTyyrestart (FILE *input_file ); -void H5LTyy_switch_to_buffer (YY_BUFFER_STATE new_buffer ); -YY_BUFFER_STATE H5LTyy_create_buffer (FILE *file,int size ); -void H5LTyy_delete_buffer (YY_BUFFER_STATE b ); -void H5LTyy_flush_buffer (YY_BUFFER_STATE b ); -void H5LTyypush_buffer_state (YY_BUFFER_STATE new_buffer ); -void H5LTyypop_buffer_state (void ); - -static void H5LTyyensure_buffer_stack (void ); -static void H5LTyy_load_buffer_state (void ); -static void H5LTyy_init_buffer (YY_BUFFER_STATE b,FILE *file ); +void yyrestart ( FILE *input_file ); +void yy_switch_to_buffer ( YY_BUFFER_STATE new_buffer ); +YY_BUFFER_STATE yy_create_buffer ( FILE *file, int size ); +void yy_delete_buffer ( YY_BUFFER_STATE b ); +void yy_flush_buffer ( YY_BUFFER_STATE b ); +void yypush_buffer_state ( YY_BUFFER_STATE new_buffer ); +void yypop_buffer_state ( void ); -#define YY_FLUSH_BUFFER H5LTyy_flush_buffer(YY_CURRENT_BUFFER ) +static void yyensure_buffer_stack ( void ); +static void yy_load_buffer_state ( void ); +static void yy_init_buffer ( YY_BUFFER_STATE b, FILE *file ); +#define YY_FLUSH_BUFFER yy_flush_buffer( YY_CURRENT_BUFFER ) -YY_BUFFER_STATE H5LTyy_scan_buffer (char *base,yy_size_t size ); -YY_BUFFER_STATE H5LTyy_scan_string (yyconst char *yy_str ); -YY_BUFFER_STATE H5LTyy_scan_bytes (yyconst char *bytes,yy_size_t len ); +YY_BUFFER_STATE yy_scan_buffer ( char *base, yy_size_t size ); +YY_BUFFER_STATE yy_scan_string ( const char *yy_str ); +YY_BUFFER_STATE yy_scan_bytes ( const char *bytes, int len ); -void *H5LTyyalloc (yy_size_t ); -void *H5LTyyrealloc (void *,yy_size_t ); -void H5LTyyfree (void * ); - -#define yy_new_buffer H5LTyy_create_buffer +void *yyalloc ( yy_size_t ); +void *yyrealloc ( void *, yy_size_t ); +void yyfree ( void * ); +#define yy_new_buffer yy_create_buffer #define yy_set_interactive(is_interactive) \ { \ if ( ! YY_CURRENT_BUFFER ){ \ - H5LTyyensure_buffer_stack (); \ + yyensure_buffer_stack (); \ YY_CURRENT_BUFFER_LVALUE = \ - H5LTyy_create_buffer(H5LTyyin,YY_BUF_SIZE ); \ + yy_create_buffer( yyin, YY_BUF_SIZE ); \ } \ YY_CURRENT_BUFFER_LVALUE->yy_is_interactive = is_interactive; \ } - #define yy_set_bol(at_bol) \ { \ if ( ! YY_CURRENT_BUFFER ){\ - H5LTyyensure_buffer_stack (); \ + yyensure_buffer_stack (); \ YY_CURRENT_BUFFER_LVALUE = \ - H5LTyy_create_buffer(H5LTyyin,YY_BUF_SIZE ); \ + yy_create_buffer( yyin, YY_BUF_SIZE ); \ } \ YY_CURRENT_BUFFER_LVALUE->yy_at_bol = at_bol; \ } - #define YY_AT_BOL() (YY_CURRENT_BUFFER_LVALUE->yy_at_bol) /* Begin user sect3 */ +typedef flex_uint8_t YY_CHAR; -typedef unsigned char YY_CHAR; - -FILE *H5LTyyin = (FILE *) 0, *H5LTyyout = (FILE *) 0; +FILE *yyin = NULL, *yyout = NULL; typedef int yy_state_type; -extern int H5LTyylineno; - -int H5LTyylineno = 1; +extern int yylineno; +int yylineno = 1; -extern char *H5LTyytext; -#define yytext_ptr H5LTyytext +extern char *yytext; +#ifdef yytext_ptr +#undef yytext_ptr +#endif +#define yytext_ptr yytext -static yy_state_type yy_get_previous_state (void ); -static yy_state_type yy_try_NUL_trans (yy_state_type current_state ); -static int yy_get_next_buffer (void ); -static void yy_fatal_error (yyconst char msg[] ); +static yy_state_type yy_get_previous_state ( void ); +static yy_state_type yy_try_NUL_trans ( yy_state_type current_state ); +static int yy_get_next_buffer ( void ); +static void yynoreturn yy_fatal_error ( const char* msg ); /* Done after the current pattern has been matched and before the - * corresponding action - sets up H5LTyytext. + * corresponding action - sets up yytext. */ #define YY_DO_BEFORE_ACTION \ (yytext_ptr) = yy_bp; \ - H5LTyyleng = (size_t) (yy_cp - yy_bp); \ + yyleng = (int) (yy_cp - yy_bp); \ (yy_hold_char) = *yy_cp; \ *yy_cp = '\0'; \ (yy_c_buf_p) = yy_cp; - -#define YY_NUM_RULES 65 -#define YY_END_OF_BUFFER 66 +#define YY_NUM_RULES 64 +#define YY_END_OF_BUFFER 65 /* This struct is not used in this scanner, but its presence is necessary. */ struct yy_trans_info @@ -419,56 +650,56 @@ struct yy_trans_info flex_int32_t yy_verify; flex_int32_t yy_nxt; }; -static yyconst flex_int16_t yy_accept[276] = +static const flex_int16_t yy_accept[275] = { 0, - 63, 63, 66, 65, 63, 63, 65, 55, 61, 62, - 65, 65, 65, 65, 59, 60, 57, 58, 63, 0, - 55, 0, 0, 0, 0, 0, 56, 0, 0, 0, - 0, 0, 38, 0, 0, 0, 0, 0, 39, 0, + 63, 63, 65, 64, 63, 64, 55, 61, 62, 64, + 64, 64, 64, 59, 60, 57, 58, 63, 0, 55, + 0, 0, 0, 0, 0, 56, 0, 0, 0, 0, + 0, 38, 0, 0, 0, 0, 0, 39, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 37, 0, 0, 0, + 0, 0, 0, 0, 0, 37, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 54, 36, 0, 0, 0, 45, 49, 0, - 0, 0, 0, 0, 0, 0, 0, 51, 53, 50, + 0, 54, 36, 0, 0, 0, 45, 49, 0, 0, + 0, 0, 0, 0, 0, 0, 51, 53, 50, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 52, 0, - 0, 0, 0, 0, 0, 0, 0, 35, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 52, 0, 0, + 0, 0, 0, 0, 0, 0, 35, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 48, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 1, 2, 0, 0, 0, 0, 0, 0, 9, 10, - 0, 0, 47, 0, 44, 0, 0, 0, 0, 0, + 48, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, + 2, 0, 0, 0, 0, 0, 0, 9, 10, 0, + 0, 47, 0, 44, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 3, 4, 5, 6, 7, 8, 11, - 12, 13, 14, 15, 16, 0, 0, 0, 43, 46, - 28, 29, 30, 31, 0, 0, 0, 22, 0, 0, + 0, 0, 3, 4, 5, 6, 7, 8, 11, 12, + 13, 14, 15, 16, 0, 0, 0, 43, 46, 28, + 29, 30, 31, 0, 0, 0, 22, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 17, 0, 0, 0, 0, 24, 0, 0, 0, - 23, 0, 0, 0, 41, 0, 0, 0, 32, 0, - 26, 18, 20, 19, 0, 25, 0, 40, 42, 33, - 0, 27, 21, 34, 0 + 17, 0, 0, 0, 0, 24, 0, 0, 0, 23, + 0, 0, 0, 41, 0, 0, 0, 32, 0, 26, + 18, 20, 19, 0, 25, 0, 40, 42, 33, 0, + 27, 21, 34, 0 } ; -static yyconst flex_int32_t yy_ec[256] = +static const YY_CHAR yy_ec[256] = { 0, - 1, 1, 1, 1, 1, 1, 1, 1, 2, 3, + 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 2, 1, 4, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 5, 6, 7, - 8, 9, 10, 11, 5, 12, 5, 13, 14, 1, - 1, 1, 1, 1, 15, 16, 17, 18, 19, 20, - 21, 22, 23, 1, 1, 24, 25, 26, 27, 28, - 29, 30, 31, 32, 33, 34, 1, 1, 35, 36, - 37, 1, 38, 1, 39, 1, 1, 1, 1, 1, + 1, 2, 1, 3, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 4, 5, 6, + 7, 8, 9, 10, 4, 11, 4, 12, 13, 1, + 1, 1, 1, 1, 14, 15, 16, 17, 18, 19, + 20, 21, 22, 1, 1, 23, 24, 25, 26, 27, + 28, 29, 30, 31, 32, 33, 1, 1, 34, 35, + 36, 1, 37, 1, 38, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 40, 1, 41, 1, 1, 1, 1, 1, + 1, 1, 39, 1, 40, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, @@ -485,172 +716,169 @@ static yyconst flex_int32_t yy_ec[256] = 1, 1, 1, 1, 1 } ; -static yyconst flex_int32_t yy_meta[42] = +static const YY_CHAR yy_meta[41] = { 0, - 1, 1, 1, 2, 3, 3, 3, 3, 3, 3, - 3, 3, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 2, 3, 3, 3, 3, 3, 3, 3, + 3, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1 + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 } ; -static yyconst flex_int16_t yy_base[278] = +static const flex_int16_t yy_base[277] = { 0, - 0, 0, 304, 305, 40, 42, 0, 0, 305, 305, - 15, 293, 274, 269, 305, 305, 305, 305, 46, 296, - 0, 280, 263, 265, 267, 265, 305, 262, 265, 253, - 252, 22, 305, 271, 39, 20, 274, 265, 305, 257, - 30, 260, 258, 265, 268, 254, 249, 40, 257, 264, - 260, 241, 246, 250, 255, 242, 239, 241, 251, 237, - 253, 42, 237, 247, 229, 243, 305, 244, 247, 233, - 228, 253, 233, 225, 237, 232, 225, 214, 40, 229, - 225, 231, 305, 305, 214, 221, 208, 305, 305, 216, - 206, 210, 210, 44, 216, 45, 226, 305, 305, 305, - - 207, 53, 224, 218, 218, 217, 72, 79, 214, 201, - 205, 216, 205, 199, 197, 202, 81, 188, 305, 215, - 218, 215, 58, 212, 215, 212, 72, 305, 196, 204, - 194, 199, 199, 195, 175, 206, 203, 80, 77, 78, - 83, 192, 191, 90, 92, 93, 190, 189, 183, 189, - 186, 305, 181, 191, 171, 94, 96, 179, 173, 175, - 172, 97, 105, 102, 178, 177, 176, 175, 174, 173, - 305, 305, 172, 171, 170, 169, 168, 167, 305, 305, - 100, 166, 305, 161, 305, 177, 163, 162, 161, 160, - 163, 144, 149, 143, 147, 146, 146, 149, 143, 147, - - 142, 107, 145, 305, 305, 305, 305, 305, 305, 305, - 305, 305, 305, 305, 305, 151, 146, 136, 305, 305, - 305, 305, 305, 305, 133, 146, 146, 305, 127, 133, - 137, 142, 126, 140, 122, 126, 126, 124, 132, 119, - 133, 305, 123, 114, 129, 123, 305, 113, 110, 111, - 305, 114, 118, 108, 305, 111, 112, 110, 305, 99, - 305, 305, 305, 305, 84, 305, 63, 305, 305, 305, - 62, 305, 305, 305, 305, 134, 72 + 0, 0, 299, 300, 296, 0, 0, 300, 300, 11, + 288, 269, 264, 300, 300, 300, 300, 292, 290, 0, + 274, 257, 259, 261, 259, 300, 256, 259, 247, 246, + 16, 300, 265, 33, 14, 268, 259, 300, 251, 24, + 254, 252, 259, 262, 248, 243, 34, 251, 258, 254, + 235, 240, 244, 249, 236, 233, 235, 245, 231, 247, + 36, 231, 241, 223, 237, 300, 238, 241, 227, 222, + 247, 227, 219, 231, 226, 219, 208, 34, 223, 219, + 225, 300, 300, 208, 215, 202, 300, 300, 210, 200, + 204, 204, 38, 210, 39, 220, 300, 300, 300, 201, + + 47, 218, 212, 212, 211, 66, 73, 208, 195, 199, + 210, 199, 193, 191, 196, 75, 182, 300, 209, 212, + 209, 52, 206, 209, 206, 66, 300, 190, 198, 188, + 193, 193, 189, 169, 200, 197, 74, 71, 72, 77, + 186, 185, 84, 86, 87, 184, 183, 177, 183, 180, + 300, 175, 185, 165, 88, 90, 173, 167, 169, 166, + 91, 99, 96, 172, 171, 170, 169, 168, 167, 300, + 300, 166, 165, 164, 163, 162, 161, 300, 300, 94, + 160, 300, 155, 300, 171, 157, 156, 155, 154, 157, + 138, 143, 137, 141, 140, 140, 143, 137, 141, 136, + + 101, 139, 300, 300, 300, 300, 300, 300, 300, 300, + 300, 300, 300, 300, 145, 140, 130, 300, 300, 300, + 300, 300, 300, 127, 140, 140, 300, 121, 127, 131, + 136, 120, 134, 116, 120, 120, 118, 126, 113, 127, + 300, 117, 108, 123, 117, 300, 107, 104, 105, 300, + 108, 112, 102, 300, 105, 106, 104, 300, 93, 300, + 300, 300, 300, 78, 300, 57, 300, 300, 300, 56, + 300, 300, 300, 300, 127, 65 } ; -static yyconst flex_int16_t yy_def[278] = +static const flex_int16_t yy_def[277] = { 0, - 275, 1, 275, 275, 275, 275, 276, 277, 275, 275, - 275, 275, 275, 275, 275, 275, 275, 275, 275, 276, - 277, 275, 275, 275, 275, 275, 275, 275, 275, 275, - 275, 275, 275, 275, 275, 275, 275, 275, 275, 275, - 275, 275, 275, 275, 275, 275, 275, 275, 275, 275, - 275, 275, 275, 275, 275, 275, 275, 275, 275, 275, - 275, 275, 275, 275, 275, 275, 275, 275, 275, 275, - 275, 275, 275, 275, 275, 275, 275, 275, 275, 275, - 275, 275, 275, 275, 275, 275, 275, 275, 275, 275, - 275, 275, 275, 275, 275, 275, 275, 275, 275, 275, - - 275, 275, 275, 275, 275, 275, 275, 275, 275, 275, - 275, 275, 275, 275, 275, 275, 275, 275, 275, 275, - 275, 275, 275, 275, 275, 275, 275, 275, 275, 275, - 275, 275, 275, 275, 275, 275, 275, 275, 275, 275, - 275, 275, 275, 275, 275, 275, 275, 275, 275, 275, - 275, 275, 275, 275, 275, 275, 275, 275, 275, 275, - 275, 275, 275, 275, 275, 275, 275, 275, 275, 275, - 275, 275, 275, 275, 275, 275, 275, 275, 275, 275, - 275, 275, 275, 275, 275, 275, 275, 275, 275, 275, - 275, 275, 275, 275, 275, 275, 275, 275, 275, 275, - - 275, 275, 275, 275, 275, 275, 275, 275, 275, 275, - 275, 275, 275, 275, 275, 275, 275, 275, 275, 275, - 275, 275, 275, 275, 275, 275, 275, 275, 275, 275, - 275, 275, 275, 275, 275, 275, 275, 275, 275, 275, - 275, 275, 275, 275, 275, 275, 275, 275, 275, 275, - 275, 275, 275, 275, 275, 275, 275, 275, 275, 275, - 275, 275, 275, 275, 275, 275, 275, 275, 275, 275, - 275, 275, 275, 275, 0, 275, 275 + 274, 1, 274, 274, 274, 275, 276, 274, 274, 274, + 274, 274, 274, 274, 274, 274, 274, 274, 275, 276, + 274, 274, 274, 274, 274, 274, 274, 274, 274, 274, + 274, 274, 274, 274, 274, 274, 274, 274, 274, 274, + 274, 274, 274, 274, 274, 274, 274, 274, 274, 274, + 274, 274, 274, 274, 274, 274, 274, 274, 274, 274, + 274, 274, 274, 274, 274, 274, 274, 274, 274, 274, + 274, 274, 274, 274, 274, 274, 274, 274, 274, 274, + 274, 274, 274, 274, 274, 274, 274, 274, 274, 274, + 274, 274, 274, 274, 274, 274, 274, 274, 274, 274, + + 274, 274, 274, 274, 274, 274, 274, 274, 274, 274, + 274, 274, 274, 274, 274, 274, 274, 274, 274, 274, + 274, 274, 274, 274, 274, 274, 274, 274, 274, 274, + 274, 274, 274, 274, 274, 274, 274, 274, 274, 274, + 274, 274, 274, 274, 274, 274, 274, 274, 274, 274, + 274, 274, 274, 274, 274, 274, 274, 274, 274, 274, + 274, 274, 274, 274, 274, 274, 274, 274, 274, 274, + 274, 274, 274, 274, 274, 274, 274, 274, 274, 274, + 274, 274, 274, 274, 274, 274, 274, 274, 274, 274, + 274, 274, 274, 274, 274, 274, 274, 274, 274, 274, + + 274, 274, 274, 274, 274, 274, 274, 274, 274, 274, + 274, 274, 274, 274, 274, 274, 274, 274, 274, 274, + 274, 274, 274, 274, 274, 274, 274, 274, 274, 274, + 274, 274, 274, 274, 274, 274, 274, 274, 274, 274, + 274, 274, 274, 274, 274, 274, 274, 274, 274, 274, + 274, 274, 274, 274, 274, 274, 274, 274, 274, 274, + 274, 274, 274, 274, 274, 274, 274, 274, 274, 274, + 274, 274, 274, 0, 274, 274 } ; -static yyconst flex_int16_t yy_nxt[347] = +static const flex_int16_t yy_nxt[341] = { 0, - 4, 5, 6, 7, 8, 8, 8, 8, 8, 8, - 8, 8, 9, 10, 4, 4, 11, 4, 4, 4, - 4, 12, 4, 4, 4, 4, 13, 4, 4, 4, - 14, 4, 4, 4, 4, 4, 15, 16, 4, 17, - 18, 19, 19, 19, 19, 22, 23, 19, 19, 37, - 49, 50, 38, 40, 63, 41, 54, 42, 43, 78, - 55, 44, 95, 64, 45, 46, 107, 114, 56, 47, - 110, 79, 48, 142, 21, 111, 108, 120, 96, 121, - 274, 143, 122, 123, 124, 115, 125, 147, 136, 126, - 127, 137, 165, 167, 273, 148, 158, 159, 169, 160, - - 166, 168, 161, 162, 272, 173, 170, 175, 177, 187, - 163, 189, 164, 174, 195, 176, 178, 188, 200, 190, - 196, 198, 271, 197, 201, 202, 199, 216, 270, 269, - 236, 217, 203, 237, 20, 268, 20, 267, 266, 265, - 264, 263, 262, 261, 260, 259, 258, 257, 256, 255, - 254, 253, 252, 251, 250, 249, 248, 247, 246, 245, - 244, 243, 242, 241, 240, 239, 238, 235, 234, 233, - 232, 231, 230, 229, 228, 227, 226, 225, 224, 223, - 222, 221, 220, 219, 218, 215, 214, 213, 212, 211, - 210, 209, 208, 207, 206, 205, 204, 194, 193, 192, - - 191, 186, 185, 184, 183, 182, 181, 180, 179, 172, - 171, 157, 156, 155, 154, 153, 152, 151, 150, 149, - 146, 145, 144, 141, 140, 139, 138, 135, 134, 133, - 132, 131, 130, 129, 128, 119, 118, 117, 116, 113, - 112, 109, 106, 105, 104, 103, 102, 101, 100, 99, - 98, 97, 94, 93, 92, 91, 90, 89, 88, 87, - 86, 85, 84, 83, 82, 81, 80, 77, 76, 75, - 74, 73, 72, 71, 70, 69, 68, 67, 66, 65, - 62, 61, 60, 59, 58, 57, 53, 52, 51, 39, - 36, 35, 34, 33, 32, 31, 30, 29, 28, 27, - - 26, 25, 24, 275, 3, 275, 275, 275, 275, 275, - 275, 275, 275, 275, 275, 275, 275, 275, 275, 275, - 275, 275, 275, 275, 275, 275, 275, 275, 275, 275, - 275, 275, 275, 275, 275, 275, 275, 275, 275, 275, - 275, 275, 275, 275, 275, 275 + 4, 5, 6, 7, 7, 7, 7, 7, 7, 7, + 7, 8, 9, 4, 4, 10, 4, 4, 4, 4, + 11, 4, 4, 4, 4, 12, 4, 4, 4, 13, + 4, 4, 4, 4, 4, 14, 15, 4, 16, 17, + 21, 22, 36, 48, 49, 37, 39, 62, 40, 53, + 41, 42, 77, 54, 43, 94, 63, 44, 45, 106, + 113, 55, 46, 109, 78, 47, 141, 20, 110, 107, + 119, 95, 120, 273, 142, 121, 122, 123, 114, 124, + 146, 135, 125, 126, 136, 164, 166, 272, 147, 157, + 158, 168, 159, 165, 167, 160, 161, 271, 172, 169, + + 174, 176, 186, 162, 188, 163, 173, 194, 175, 177, + 187, 199, 189, 195, 197, 270, 196, 200, 201, 198, + 215, 269, 268, 235, 216, 202, 236, 19, 267, 19, + 266, 265, 264, 263, 262, 261, 260, 259, 258, 257, + 256, 255, 254, 253, 252, 251, 250, 249, 248, 247, + 246, 245, 244, 243, 242, 241, 240, 239, 238, 237, + 234, 233, 232, 231, 230, 229, 228, 227, 226, 225, + 224, 223, 222, 221, 220, 219, 218, 217, 214, 213, + 212, 211, 210, 209, 208, 207, 206, 205, 204, 203, + 193, 192, 191, 190, 185, 184, 183, 182, 181, 180, + + 179, 178, 171, 170, 156, 155, 154, 153, 152, 151, + 150, 149, 148, 145, 144, 143, 140, 139, 138, 137, + 134, 133, 132, 131, 130, 129, 128, 127, 118, 117, + 116, 115, 112, 111, 108, 105, 104, 103, 102, 101, + 100, 99, 98, 97, 96, 93, 92, 91, 90, 89, + 88, 87, 86, 85, 84, 83, 82, 81, 80, 79, + 76, 75, 74, 73, 72, 71, 70, 69, 68, 67, + 66, 65, 64, 61, 60, 59, 58, 57, 56, 52, + 51, 50, 38, 35, 34, 33, 32, 31, 30, 29, + 28, 27, 26, 18, 25, 24, 23, 18, 274, 3, + + 274, 274, 274, 274, 274, 274, 274, 274, 274, 274, + 274, 274, 274, 274, 274, 274, 274, 274, 274, 274, + 274, 274, 274, 274, 274, 274, 274, 274, 274, 274, + 274, 274, 274, 274, 274, 274, 274, 274, 274, 274 } ; -static yyconst flex_int16_t yy_chk[347] = +static const flex_int16_t yy_chk[341] = { 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 5, 5, 6, 6, 11, 11, 19, 19, 32, - 36, 36, 32, 35, 48, 35, 41, 35, 35, 62, - 41, 35, 79, 48, 35, 35, 94, 102, 41, 35, - 96, 62, 35, 123, 277, 96, 94, 107, 79, 107, - 271, 123, 107, 107, 108, 102, 108, 127, 117, 108, - 108, 117, 139, 140, 267, 127, 138, 138, 141, 138, - - 139, 140, 138, 138, 265, 144, 141, 145, 146, 156, - 138, 157, 138, 144, 162, 145, 146, 156, 164, 157, - 162, 163, 260, 162, 164, 164, 163, 181, 258, 257, - 202, 181, 164, 202, 276, 256, 276, 254, 253, 252, - 250, 249, 248, 246, 245, 244, 243, 241, 240, 239, - 238, 237, 236, 235, 234, 233, 232, 231, 230, 229, - 227, 226, 225, 218, 217, 216, 203, 201, 200, 199, - 198, 197, 196, 195, 194, 193, 192, 191, 190, 189, - 188, 187, 186, 184, 182, 178, 177, 176, 175, 174, - 173, 170, 169, 168, 167, 166, 165, 161, 160, 159, - - 158, 155, 154, 153, 151, 150, 149, 148, 147, 143, - 142, 137, 136, 135, 134, 133, 132, 131, 130, 129, - 126, 125, 124, 122, 121, 120, 118, 116, 115, 114, - 113, 112, 111, 110, 109, 106, 105, 104, 103, 101, - 97, 95, 93, 92, 91, 90, 87, 86, 85, 82, - 81, 80, 78, 77, 76, 75, 74, 73, 72, 71, - 70, 69, 68, 66, 65, 64, 63, 61, 60, 59, - 58, 57, 56, 55, 54, 53, 52, 51, 50, 49, - 47, 46, 45, 44, 43, 42, 40, 38, 37, 34, - 31, 30, 29, 28, 26, 25, 24, 23, 22, 20, - - 14, 13, 12, 3, 275, 275, 275, 275, 275, 275, - 275, 275, 275, 275, 275, 275, 275, 275, 275, 275, - 275, 275, 275, 275, 275, 275, 275, 275, 275, 275, - 275, 275, 275, 275, 275, 275, 275, 275, 275, 275, - 275, 275, 275, 275, 275, 275 + 10, 10, 31, 35, 35, 31, 34, 47, 34, 40, + 34, 34, 61, 40, 34, 78, 47, 34, 34, 93, + 101, 40, 34, 95, 61, 34, 122, 276, 95, 93, + 106, 78, 106, 270, 122, 106, 106, 107, 101, 107, + 126, 116, 107, 107, 116, 138, 139, 266, 126, 137, + 137, 140, 137, 138, 139, 137, 137, 264, 143, 140, + + 144, 145, 155, 137, 156, 137, 143, 161, 144, 145, + 155, 163, 156, 161, 162, 259, 161, 163, 163, 162, + 180, 257, 256, 201, 180, 163, 201, 275, 255, 275, + 253, 252, 251, 249, 248, 247, 245, 244, 243, 242, + 240, 239, 238, 237, 236, 235, 234, 233, 232, 231, + 230, 229, 228, 226, 225, 224, 217, 216, 215, 202, + 200, 199, 198, 197, 196, 195, 194, 193, 192, 191, + 190, 189, 188, 187, 186, 185, 183, 181, 177, 176, + 175, 174, 173, 172, 169, 168, 167, 166, 165, 164, + 160, 159, 158, 157, 154, 153, 152, 150, 149, 148, + + 147, 146, 142, 141, 136, 135, 134, 133, 132, 131, + 130, 129, 128, 125, 124, 123, 121, 120, 119, 117, + 115, 114, 113, 112, 111, 110, 109, 108, 105, 104, + 103, 102, 100, 96, 94, 92, 91, 90, 89, 86, + 85, 84, 81, 80, 79, 77, 76, 75, 74, 73, + 72, 71, 70, 69, 68, 67, 65, 64, 63, 62, + 60, 59, 58, 57, 56, 55, 54, 53, 52, 51, + 50, 49, 48, 46, 45, 44, 43, 42, 41, 39, + 37, 36, 33, 30, 29, 28, 27, 25, 24, 23, + 22, 21, 19, 18, 13, 12, 11, 5, 3, 274, + + 274, 274, 274, 274, 274, 274, 274, 274, 274, 274, + 274, 274, 274, 274, 274, 274, 274, 274, 274, 274, + 274, 274, 274, 274, 274, 274, 274, 274, 274, 274, + 274, 274, 274, 274, 274, 274, 274, 274, 274, 274 } ; static yy_state_type yy_last_accepting_state; static char *yy_last_accepting_cpos; -extern int H5LTyy_flex_debug; -int H5LTyy_flex_debug = 0; +extern int yy_flex_debug; +int yy_flex_debug = 0; /* The intent behind this definition is that it'll catch * any uses of REJECT which flex missed. @@ -659,8 +887,8 @@ int H5LTyy_flex_debug = 0; #define yymore() yymore_used_but_not_detected #define YY_MORE_ADJ 0 #define YY_RESTORE_YY_MORE_OFFSET -char *H5LTyytext; -#line 1 "hl/src//H5LTanalyze.l" +char *yytext; +#line 1 "hl/src/H5LTanalyze.l" /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * Copyright by The HDF Group. * * Copyright by the Board of Trustees of the University of Illinois. * @@ -678,7 +906,7 @@ char *H5LTyytext; * If you make any changes to H5LTanalyze.l, please run bin/genparser to * recreate the output files. */ -#line 21 "hl/src//H5LTanalyze.l" +#line 21 "hl/src/H5LTanalyze.l" #include #include #include @@ -702,7 +930,8 @@ int my_yyinput(char *, int); extern char *myinput; extern size_t input_len; -#line 676 "hl/src//H5LTanalyze.c" +#line 903 "hl/src/H5LTanalyze.c" +#line 904 "hl/src/H5LTanalyze.c" #define INITIAL 0 @@ -710,36 +939,36 @@ extern size_t input_len; #define YY_EXTRA_TYPE void * #endif -static int yy_init_globals (void ); +static int yy_init_globals ( void ); /* Accessor methods to globals. These are made visible to non-reentrant scanners for convenience. */ -int H5LTyylex_destroy (void ); +int yylex_destroy ( void ); -int H5LTyyget_debug (void ); +int yyget_debug ( void ); -void H5LTyyset_debug (int debug_flag ); +void yyset_debug ( int debug_flag ); -YY_EXTRA_TYPE H5LTyyget_extra (void ); +YY_EXTRA_TYPE yyget_extra ( void ); -void H5LTyyset_extra (YY_EXTRA_TYPE user_defined ); +void yyset_extra ( YY_EXTRA_TYPE user_defined ); -FILE *H5LTyyget_in (void ); +FILE *yyget_in ( void ); -void H5LTyyset_in (FILE * in_str ); +void yyset_in ( FILE * _in_str ); -FILE *H5LTyyget_out (void ); +FILE *yyget_out ( void ); -void H5LTyyset_out (FILE * out_str ); +void yyset_out ( FILE * _out_str ); -yy_size_t H5LTyyget_leng (void ); + int yyget_leng ( void ); -char *H5LTyyget_text (void ); +char *yyget_text ( void ); -int H5LTyyget_lineno (void ); +int yyget_lineno ( void ); -void H5LTyyset_lineno (int line_number ); +void yyset_lineno ( int _line_number ); /* Macros after this point can all be overridden by user definitions in * section 1. @@ -747,35 +976,43 @@ void H5LTyyset_lineno (int line_number ); #ifndef YY_SKIP_YYWRAP #ifdef __cplusplus -extern "C" int H5LTyywrap (void ); +extern "C" int yywrap ( void ); #else -extern int H5LTyywrap (void ); +extern int yywrap ( void ); #endif #endif - static void yyunput (int c,char *buf_ptr ); +#ifndef YY_NO_UNPUT + static void yyunput ( int c, char *buf_ptr ); + +#endif + #ifndef yytext_ptr -static void yy_flex_strncpy (char *,yyconst char *,int ); +static void yy_flex_strncpy ( char *, const char *, int ); #endif #ifdef YY_NEED_STRLEN -static int yy_flex_strlen (yyconst char * ); +static int yy_flex_strlen ( const char * ); #endif #ifndef YY_NO_INPUT - #ifdef __cplusplus -static int yyinput (void ); +static int yyinput ( void ); #else -static int input (void ); +static int input ( void ); #endif #endif /* Amount of stuff to slurp up with each read. */ #ifndef YY_READ_BUF_SIZE +#ifdef __ia64__ +/* On IA-64, the buffer size is 16k, not 8k */ +#define YY_READ_BUF_SIZE 16384 +#else #define YY_READ_BUF_SIZE 8192 +#endif /* __ia64__ */ #endif /* Copy whatever the last rule matched to the standard output. */ @@ -783,7 +1020,7 @@ static int input (void ); /* This used to be an fputs(), but since the string might contain NUL's, * we now use fwrite(). */ -#define ECHO do { if (fwrite( H5LTyytext, H5LTyyleng, 1, H5LTyyout )) {} } while (0) +#define ECHO do { if (fwrite( yytext, (size_t) yyleng, 1, yyout )) {} } while (0) #endif /* Gets input and stuffs it into "buf". number of characters read, or YY_NULL, @@ -794,20 +1031,20 @@ static int input (void ); if ( YY_CURRENT_BUFFER_LVALUE->yy_is_interactive ) \ { \ int c = '*'; \ - size_t n; \ + int n; \ for ( n = 0; n < max_size && \ - (c = getc( H5LTyyin )) != EOF && c != '\n'; ++n ) \ + (c = getc( yyin )) != EOF && c != '\n'; ++n ) \ buf[n] = (char) c; \ if ( c == '\n' ) \ buf[n++] = (char) c; \ - if ( c == EOF && ferror( H5LTyyin ) ) \ + if ( c == EOF && ferror( yyin ) ) \ YY_FATAL_ERROR( "input in flex scanner failed" ); \ result = n; \ } \ else \ { \ errno=0; \ - while ( (result = fread(buf, 1, max_size, H5LTyyin))==0 && ferror(H5LTyyin)) \ + while ( (result = (int) fread(buf, 1, (yy_size_t) max_size, yyin)) == 0 && ferror(yyin)) \ { \ if( errno != EINTR) \ { \ @@ -815,7 +1052,7 @@ static int input (void ); break; \ } \ errno=0; \ - clearerr(H5LTyyin); \ + clearerr(yyin); \ } \ }\ \ @@ -848,12 +1085,12 @@ static int input (void ); #ifndef YY_DECL #define YY_DECL_IS_OURS 1 -extern int H5LTyylex (void); +extern int yylex (void); -#define YY_DECL int H5LTyylex (void) +#define YY_DECL int yylex (void) #endif /* !YY_DECL */ -/* Code executed at the beginning of each rule, after H5LTyytext and H5LTyyleng +/* Code executed at the beginning of each rule, after yytext and yyleng * have been set up. */ #ifndef YY_USER_ACTION @@ -862,7 +1099,7 @@ extern int H5LTyylex (void); /* Code executed at the end of each rule. */ #ifndef YY_BREAK -#define YY_BREAK break; +#define YY_BREAK /*LINTED*/break; #endif #define YY_RULE_SETUP \ @@ -872,15 +1109,10 @@ extern int H5LTyylex (void); */ YY_DECL { - register yy_state_type yy_current_state; - register char *yy_cp, *yy_bp; - register int yy_act; + yy_state_type yy_current_state; + char *yy_cp, *yy_bp; + int yy_act; -#line 46 "hl/src//H5LTanalyze.l" - - -#line 853 "hl/src//H5LTanalyze.c" - if ( !(yy_init) ) { (yy_init) = 1; @@ -892,26 +1124,32 @@ YY_DECL if ( ! (yy_start) ) (yy_start) = 1; /* first start state */ - if ( ! H5LTyyin ) - H5LTyyin = stdin; + if ( ! yyin ) + yyin = stdin; - if ( ! H5LTyyout ) - H5LTyyout = stdout; + if ( ! yyout ) + yyout = stdout; if ( ! YY_CURRENT_BUFFER ) { - H5LTyyensure_buffer_stack (); + yyensure_buffer_stack (); YY_CURRENT_BUFFER_LVALUE = - H5LTyy_create_buffer(H5LTyyin,YY_BUF_SIZE ); + yy_create_buffer( yyin, YY_BUF_SIZE ); } - H5LTyy_load_buffer_state( ); + yy_load_buffer_state( ); } - while ( 1 ) /* loops until end-of-file is reached */ + { +#line 46 "hl/src/H5LTanalyze.l" + + +#line 1116 "hl/src/H5LTanalyze.c" + + while ( /*CONSTCOND*/1 ) /* loops until end-of-file is reached */ { yy_cp = (yy_c_buf_p); - /* Support of H5LTyytext. */ + /* Support of yytext. */ *yy_cp = (yy_hold_char); /* yy_bp points to the position in yy_ch_buf of the start of @@ -923,7 +1161,7 @@ YY_DECL yy_match: do { - register YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)]; + YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)] ; if ( yy_accept[yy_current_state] ) { (yy_last_accepting_state) = yy_current_state; @@ -932,13 +1170,13 @@ YY_DECL while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) { yy_current_state = (int) yy_def[yy_current_state]; - if ( yy_current_state >= 276 ) - yy_c = yy_meta[(unsigned int) yy_c]; + if ( yy_current_state >= 275 ) + yy_c = yy_meta[yy_c]; } - yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; + yy_current_state = yy_nxt[yy_base[yy_current_state] + yy_c]; ++yy_cp; } - while ( yy_base[yy_current_state] != 305 ); + while ( yy_base[yy_current_state] != 300 ); yy_find_action: yy_act = yy_accept[yy_current_state]; @@ -964,339 +1202,333 @@ YY_DECL case 1: YY_RULE_SETUP -#line 48 "hl/src//H5LTanalyze.l" +#line 48 "hl/src/H5LTanalyze.l" {return hid(H5T_STD_I8BE_TOKEN);} YY_BREAK case 2: YY_RULE_SETUP -#line 49 "hl/src//H5LTanalyze.l" +#line 49 "hl/src/H5LTanalyze.l" {return hid(H5T_STD_I8LE_TOKEN);} YY_BREAK case 3: YY_RULE_SETUP -#line 50 "hl/src//H5LTanalyze.l" +#line 50 "hl/src/H5LTanalyze.l" {return hid(H5T_STD_I16BE_TOKEN);} YY_BREAK case 4: YY_RULE_SETUP -#line 51 "hl/src//H5LTanalyze.l" +#line 51 "hl/src/H5LTanalyze.l" {return hid(H5T_STD_I16LE_TOKEN);} YY_BREAK case 5: YY_RULE_SETUP -#line 52 "hl/src//H5LTanalyze.l" +#line 52 "hl/src/H5LTanalyze.l" {return hid(H5T_STD_I32BE_TOKEN);} YY_BREAK case 6: YY_RULE_SETUP -#line 53 "hl/src//H5LTanalyze.l" +#line 53 "hl/src/H5LTanalyze.l" {return hid(H5T_STD_I32LE_TOKEN);} YY_BREAK case 7: YY_RULE_SETUP -#line 54 "hl/src//H5LTanalyze.l" +#line 54 "hl/src/H5LTanalyze.l" {return hid(H5T_STD_I64BE_TOKEN);} YY_BREAK case 8: YY_RULE_SETUP -#line 55 "hl/src//H5LTanalyze.l" +#line 55 "hl/src/H5LTanalyze.l" {return hid(H5T_STD_I64LE_TOKEN);} YY_BREAK case 9: YY_RULE_SETUP -#line 57 "hl/src//H5LTanalyze.l" +#line 57 "hl/src/H5LTanalyze.l" {return hid(H5T_STD_U8BE_TOKEN);} YY_BREAK case 10: YY_RULE_SETUP -#line 58 "hl/src//H5LTanalyze.l" +#line 58 "hl/src/H5LTanalyze.l" {return hid(H5T_STD_U8LE_TOKEN);} YY_BREAK case 11: YY_RULE_SETUP -#line 59 "hl/src//H5LTanalyze.l" +#line 59 "hl/src/H5LTanalyze.l" {return hid(H5T_STD_U16BE_TOKEN);} YY_BREAK case 12: YY_RULE_SETUP -#line 60 "hl/src//H5LTanalyze.l" +#line 60 "hl/src/H5LTanalyze.l" {return hid(H5T_STD_U16LE_TOKEN);} YY_BREAK case 13: YY_RULE_SETUP -#line 61 "hl/src//H5LTanalyze.l" +#line 61 "hl/src/H5LTanalyze.l" {return hid(H5T_STD_U32BE_TOKEN);} YY_BREAK case 14: YY_RULE_SETUP -#line 62 "hl/src//H5LTanalyze.l" +#line 62 "hl/src/H5LTanalyze.l" {return hid(H5T_STD_U32LE_TOKEN);} YY_BREAK case 15: YY_RULE_SETUP -#line 63 "hl/src//H5LTanalyze.l" +#line 63 "hl/src/H5LTanalyze.l" {return hid(H5T_STD_U64BE_TOKEN);} YY_BREAK case 16: YY_RULE_SETUP -#line 64 "hl/src//H5LTanalyze.l" +#line 64 "hl/src/H5LTanalyze.l" {return hid(H5T_STD_U64LE_TOKEN);} YY_BREAK case 17: YY_RULE_SETUP -#line 66 "hl/src//H5LTanalyze.l" +#line 66 "hl/src/H5LTanalyze.l" {return hid(H5T_NATIVE_CHAR_TOKEN);} YY_BREAK case 18: YY_RULE_SETUP -#line 67 "hl/src//H5LTanalyze.l" +#line 67 "hl/src/H5LTanalyze.l" {return hid(H5T_NATIVE_SCHAR_TOKEN);} YY_BREAK case 19: YY_RULE_SETUP -#line 68 "hl/src//H5LTanalyze.l" +#line 68 "hl/src/H5LTanalyze.l" {return hid(H5T_NATIVE_UCHAR_TOKEN);} YY_BREAK case 20: YY_RULE_SETUP -#line 69 "hl/src//H5LTanalyze.l" +#line 69 "hl/src/H5LTanalyze.l" {return hid(H5T_NATIVE_SHORT_TOKEN);} YY_BREAK case 21: YY_RULE_SETUP -#line 70 "hl/src//H5LTanalyze.l" +#line 70 "hl/src/H5LTanalyze.l" {return hid(H5T_NATIVE_USHORT_TOKEN);} YY_BREAK case 22: YY_RULE_SETUP -#line 71 "hl/src//H5LTanalyze.l" +#line 71 "hl/src/H5LTanalyze.l" {return hid(H5T_NATIVE_INT_TOKEN);} YY_BREAK case 23: YY_RULE_SETUP -#line 72 "hl/src//H5LTanalyze.l" +#line 72 "hl/src/H5LTanalyze.l" {return hid(H5T_NATIVE_UINT_TOKEN);} YY_BREAK case 24: YY_RULE_SETUP -#line 73 "hl/src//H5LTanalyze.l" +#line 73 "hl/src/H5LTanalyze.l" {return hid(H5T_NATIVE_LONG_TOKEN);} YY_BREAK case 25: YY_RULE_SETUP -#line 74 "hl/src//H5LTanalyze.l" +#line 74 "hl/src/H5LTanalyze.l" {return hid(H5T_NATIVE_ULONG_TOKEN);} YY_BREAK case 26: YY_RULE_SETUP -#line 75 "hl/src//H5LTanalyze.l" +#line 75 "hl/src/H5LTanalyze.l" {return hid(H5T_NATIVE_LLONG_TOKEN);} YY_BREAK case 27: YY_RULE_SETUP -#line 76 "hl/src//H5LTanalyze.l" +#line 76 "hl/src/H5LTanalyze.l" {return hid(H5T_NATIVE_ULLONG_TOKEN);} YY_BREAK case 28: YY_RULE_SETUP -#line 78 "hl/src//H5LTanalyze.l" +#line 78 "hl/src/H5LTanalyze.l" {return hid(H5T_IEEE_F32BE_TOKEN);} YY_BREAK case 29: YY_RULE_SETUP -#line 79 "hl/src//H5LTanalyze.l" +#line 79 "hl/src/H5LTanalyze.l" {return hid(H5T_IEEE_F32LE_TOKEN);} YY_BREAK case 30: YY_RULE_SETUP -#line 80 "hl/src//H5LTanalyze.l" +#line 80 "hl/src/H5LTanalyze.l" {return hid(H5T_IEEE_F64BE_TOKEN);} YY_BREAK case 31: YY_RULE_SETUP -#line 81 "hl/src//H5LTanalyze.l" +#line 81 "hl/src/H5LTanalyze.l" {return hid(H5T_IEEE_F64LE_TOKEN);} YY_BREAK case 32: YY_RULE_SETUP -#line 82 "hl/src//H5LTanalyze.l" +#line 82 "hl/src/H5LTanalyze.l" {return hid(H5T_NATIVE_FLOAT_TOKEN);} YY_BREAK case 33: YY_RULE_SETUP -#line 83 "hl/src//H5LTanalyze.l" +#line 83 "hl/src/H5LTanalyze.l" {return hid(H5T_NATIVE_DOUBLE_TOKEN);} YY_BREAK case 34: YY_RULE_SETUP -#line 84 "hl/src//H5LTanalyze.l" +#line 84 "hl/src/H5LTanalyze.l" {return hid(H5T_NATIVE_LDOUBLE_TOKEN);} YY_BREAK case 35: YY_RULE_SETUP -#line 86 "hl/src//H5LTanalyze.l" +#line 86 "hl/src/H5LTanalyze.l" {return token(H5T_STRING_TOKEN);} YY_BREAK case 36: YY_RULE_SETUP -#line 87 "hl/src//H5LTanalyze.l" +#line 87 "hl/src/H5LTanalyze.l" {return token(STRSIZE_TOKEN);} YY_BREAK case 37: YY_RULE_SETUP -#line 88 "hl/src//H5LTanalyze.l" +#line 88 "hl/src/H5LTanalyze.l" {return token(STRPAD_TOKEN);} YY_BREAK case 38: YY_RULE_SETUP -#line 89 "hl/src//H5LTanalyze.l" +#line 89 "hl/src/H5LTanalyze.l" {return token(CSET_TOKEN);} YY_BREAK case 39: YY_RULE_SETUP -#line 90 "hl/src//H5LTanalyze.l" +#line 90 "hl/src/H5LTanalyze.l" {return token(CTYPE_TOKEN);} YY_BREAK case 40: YY_RULE_SETUP -#line 91 "hl/src//H5LTanalyze.l" +#line 91 "hl/src/H5LTanalyze.l" {return token(H5T_STR_NULLTERM_TOKEN);} YY_BREAK case 41: YY_RULE_SETUP -#line 92 "hl/src//H5LTanalyze.l" +#line 92 "hl/src/H5LTanalyze.l" {return token(H5T_STR_NULLPAD_TOKEN);} YY_BREAK case 42: YY_RULE_SETUP -#line 93 "hl/src//H5LTanalyze.l" +#line 93 "hl/src/H5LTanalyze.l" {return token(H5T_STR_SPACEPAD_TOKEN);} YY_BREAK case 43: YY_RULE_SETUP -#line 94 "hl/src//H5LTanalyze.l" +#line 94 "hl/src/H5LTanalyze.l" {return token(H5T_CSET_ASCII_TOKEN);} YY_BREAK case 44: YY_RULE_SETUP -#line 95 "hl/src//H5LTanalyze.l" +#line 95 "hl/src/H5LTanalyze.l" {return token(H5T_CSET_UTF8_TOKEN);} YY_BREAK case 45: YY_RULE_SETUP -#line 96 "hl/src//H5LTanalyze.l" +#line 96 "hl/src/H5LTanalyze.l" {return token(H5T_C_S1_TOKEN);} YY_BREAK case 46: YY_RULE_SETUP -#line 97 "hl/src//H5LTanalyze.l" +#line 97 "hl/src/H5LTanalyze.l" {return token(H5T_FORTRAN_S1_TOKEN);} YY_BREAK case 47: YY_RULE_SETUP -#line 98 "hl/src//H5LTanalyze.l" +#line 98 "hl/src/H5LTanalyze.l" {return token(H5T_VARIABLE_TOKEN);} YY_BREAK case 48: YY_RULE_SETUP -#line 100 "hl/src//H5LTanalyze.l" +#line 100 "hl/src/H5LTanalyze.l" {return token(H5T_COMPOUND_TOKEN);} YY_BREAK case 49: YY_RULE_SETUP -#line 101 "hl/src//H5LTanalyze.l" +#line 101 "hl/src/H5LTanalyze.l" {return token(H5T_ENUM_TOKEN);} YY_BREAK case 50: YY_RULE_SETUP -#line 102 "hl/src//H5LTanalyze.l" +#line 102 "hl/src/H5LTanalyze.l" {return token(H5T_ARRAY_TOKEN);} YY_BREAK case 51: YY_RULE_SETUP -#line 103 "hl/src//H5LTanalyze.l" +#line 103 "hl/src/H5LTanalyze.l" {return token(H5T_VLEN_TOKEN);} YY_BREAK case 52: YY_RULE_SETUP -#line 105 "hl/src//H5LTanalyze.l" +#line 105 "hl/src/H5LTanalyze.l" {return token(H5T_OPAQUE_TOKEN);} YY_BREAK case 53: YY_RULE_SETUP -#line 106 "hl/src//H5LTanalyze.l" +#line 106 "hl/src/H5LTanalyze.l" {return token(OPQ_SIZE_TOKEN);} YY_BREAK case 54: YY_RULE_SETUP -#line 107 "hl/src//H5LTanalyze.l" +#line 107 "hl/src/H5LTanalyze.l" {return token(OPQ_TAG_TOKEN);} YY_BREAK case 55: YY_RULE_SETUP -#line 109 "hl/src//H5LTanalyze.l" +#line 109 "hl/src/H5LTanalyze.l" { - H5LTyylval.ival = HDatoi(H5LTyytext); + H5LTyylval.ival = HDatoi(yytext); return NUMBER; } YY_BREAK case 56: /* rule 56 can match eol */ YY_RULE_SETUP -#line 114 "hl/src//H5LTanalyze.l" +#line 114 "hl/src/H5LTanalyze.l" { - H5LTyylval.sval = trim_quotes(H5LTyytext); + H5LTyylval.sval = trim_quotes(yytext); return STRING; } YY_BREAK case 57: YY_RULE_SETUP -#line 119 "hl/src//H5LTanalyze.l" +#line 119 "hl/src/H5LTanalyze.l" {return token('{');} YY_BREAK case 58: YY_RULE_SETUP -#line 120 "hl/src//H5LTanalyze.l" +#line 120 "hl/src/H5LTanalyze.l" {return token('}');} YY_BREAK case 59: YY_RULE_SETUP -#line 121 "hl/src//H5LTanalyze.l" +#line 121 "hl/src/H5LTanalyze.l" {return token('[');} YY_BREAK case 60: YY_RULE_SETUP -#line 122 "hl/src//H5LTanalyze.l" +#line 122 "hl/src/H5LTanalyze.l" {return token(']');} YY_BREAK case 61: YY_RULE_SETUP -#line 123 "hl/src//H5LTanalyze.l" +#line 123 "hl/src/H5LTanalyze.l" {return token(':');} YY_BREAK case 62: YY_RULE_SETUP -#line 124 "hl/src//H5LTanalyze.l" +#line 124 "hl/src/H5LTanalyze.l" {return token(';');} YY_BREAK case 63: /* rule 63 can match eol */ YY_RULE_SETUP -#line 125 "hl/src//H5LTanalyze.l" +#line 125 "hl/src/H5LTanalyze.l" ; YY_BREAK case 64: -/* rule 64 can match eol */ YY_RULE_SETUP -#line 126 "hl/src//H5LTanalyze.l" -{ return 0; } - YY_BREAK -case 65: -YY_RULE_SETUP -#line 128 "hl/src//H5LTanalyze.l" +#line 127 "hl/src/H5LTanalyze.l" ECHO; YY_BREAK -#line 1270 "hl/src//H5LTanalyze.c" +#line 1501 "hl/src/H5LTanalyze.c" case YY_STATE_EOF(INITIAL): yyterminate(); @@ -1313,15 +1545,15 @@ case YY_STATE_EOF(INITIAL): { /* We're scanning a new file or input source. It's * possible that this happened because the user - * just pointed H5LTyyin at a new source and called - * H5LTyylex(). If so, then we have to assure + * just pointed yyin at a new source and called + * yylex(). If so, then we have to assure * consistency between YY_CURRENT_BUFFER and our * globals. Here is the right place to do so, because * this is the first action (other than possibly a * back-up) that will match for the new input source. */ (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_n_chars; - YY_CURRENT_BUFFER_LVALUE->yy_input_file = H5LTyyin; + YY_CURRENT_BUFFER_LVALUE->yy_input_file = yyin; YY_CURRENT_BUFFER_LVALUE->yy_buffer_status = YY_BUFFER_NORMAL; } @@ -1374,11 +1606,11 @@ case YY_STATE_EOF(INITIAL): { (yy_did_buffer_switch_on_eof) = 0; - if ( H5LTyywrap( ) ) + if ( yywrap( ) ) { /* Note: because we've taken care in * yy_get_next_buffer() to have set up - * H5LTyytext, we can now set up + * yytext, we can now set up * yy_c_buf_p so that if some total * hoser (like flex itself) wants to * call the scanner after we return the @@ -1427,7 +1659,8 @@ case YY_STATE_EOF(INITIAL): "fatal flex scanner internal error--no action found" ); } /* end of action switch */ } /* end of scanning one token */ -} /* end of H5LTyylex */ + } /* end of user's declarations */ +} /* end of yylex */ /* yy_get_next_buffer - try to read in a new buffer * @@ -1438,9 +1671,9 @@ case YY_STATE_EOF(INITIAL): */ static int yy_get_next_buffer (void) { - register char *dest = YY_CURRENT_BUFFER_LVALUE->yy_ch_buf; - register char *source = (yytext_ptr); - register int number_to_move, i; + char *dest = YY_CURRENT_BUFFER_LVALUE->yy_ch_buf; + char *source = (yytext_ptr); + int number_to_move, i; int ret_val; if ( (yy_c_buf_p) > &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars) + 1] ) @@ -1469,7 +1702,7 @@ static int yy_get_next_buffer (void) /* Try to read more data. */ /* First move last chars to start of buffer. */ - number_to_move = (int) ((yy_c_buf_p) - (yytext_ptr)) - 1; + number_to_move = (int) ((yy_c_buf_p) - (yytext_ptr) - 1); for ( i = 0; i < number_to_move; ++i ) *(dest++) = *(source++); @@ -1482,7 +1715,7 @@ static int yy_get_next_buffer (void) else { - yy_size_t num_to_read = + int num_to_read = YY_CURRENT_BUFFER_LVALUE->yy_buf_size - number_to_move - 1; while ( num_to_read <= 0 ) @@ -1496,7 +1729,7 @@ static int yy_get_next_buffer (void) if ( b->yy_is_our_buffer ) { - yy_size_t new_size = b->yy_buf_size * 2; + int new_size = b->yy_buf_size * 2; if ( new_size <= 0 ) b->yy_buf_size += b->yy_buf_size / 8; @@ -1505,11 +1738,12 @@ static int yy_get_next_buffer (void) b->yy_ch_buf = (char *) /* Include room in for 2 EOB chars. */ - H5LTyyrealloc((void *) b->yy_ch_buf,b->yy_buf_size + 2 ); + yyrealloc( (void *) b->yy_ch_buf, + (yy_size_t) (b->yy_buf_size + 2) ); } else /* Can't grow it, we don't own it. */ - b->yy_ch_buf = 0; + b->yy_ch_buf = NULL; if ( ! b->yy_ch_buf ) YY_FATAL_ERROR( @@ -1537,7 +1771,7 @@ static int yy_get_next_buffer (void) if ( number_to_move == YY_MORE_ADJ ) { ret_val = EOB_ACT_END_OF_FILE; - H5LTyyrestart(H5LTyyin ); + yyrestart( yyin ); } else @@ -1551,12 +1785,15 @@ static int yy_get_next_buffer (void) else ret_val = EOB_ACT_CONTINUE_SCAN; - if ((yy_size_t) ((yy_n_chars) + number_to_move) > YY_CURRENT_BUFFER_LVALUE->yy_buf_size) { + if (((yy_n_chars) + number_to_move) > YY_CURRENT_BUFFER_LVALUE->yy_buf_size) { /* Extend the array by 50%, plus the number we really need. */ - yy_size_t new_size = (yy_n_chars) + number_to_move + ((yy_n_chars) >> 1); - YY_CURRENT_BUFFER_LVALUE->yy_ch_buf = (char *) H5LTyyrealloc((void *) YY_CURRENT_BUFFER_LVALUE->yy_ch_buf,new_size ); + int new_size = (yy_n_chars) + number_to_move + ((yy_n_chars) >> 1); + YY_CURRENT_BUFFER_LVALUE->yy_ch_buf = (char *) yyrealloc( + (void *) YY_CURRENT_BUFFER_LVALUE->yy_ch_buf, (yy_size_t) new_size ); if ( ! YY_CURRENT_BUFFER_LVALUE->yy_ch_buf ) YY_FATAL_ERROR( "out of dynamic memory in yy_get_next_buffer()" ); + /* "- 2" to take care of EOB's */ + YY_CURRENT_BUFFER_LVALUE->yy_buf_size = (int) (new_size - 2); } (yy_n_chars) += number_to_move; @@ -1572,14 +1809,14 @@ static int yy_get_next_buffer (void) static yy_state_type yy_get_previous_state (void) { - register yy_state_type yy_current_state; - register char *yy_cp; + yy_state_type yy_current_state; + char *yy_cp; yy_current_state = (yy_start); for ( yy_cp = (yytext_ptr) + YY_MORE_ADJ; yy_cp < (yy_c_buf_p); ++yy_cp ) { - register YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1); + YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1); if ( yy_accept[yy_current_state] ) { (yy_last_accepting_state) = yy_current_state; @@ -1588,10 +1825,10 @@ static int yy_get_next_buffer (void) while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) { yy_current_state = (int) yy_def[yy_current_state]; - if ( yy_current_state >= 276 ) - yy_c = yy_meta[(unsigned int) yy_c]; + if ( yy_current_state >= 275 ) + yy_c = yy_meta[yy_c]; } - yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; + yy_current_state = yy_nxt[yy_base[yy_current_state] + yy_c]; } return yy_current_state; @@ -1604,10 +1841,10 @@ static int yy_get_next_buffer (void) */ static yy_state_type yy_try_NUL_trans (yy_state_type yy_current_state ) { - register int yy_is_jam; - register char *yy_cp = (yy_c_buf_p); + int yy_is_jam; + char *yy_cp = (yy_c_buf_p); - register YY_CHAR yy_c = 1; + YY_CHAR yy_c = 1; if ( yy_accept[yy_current_state] ) { (yy_last_accepting_state) = yy_current_state; @@ -1616,31 +1853,33 @@ static int yy_get_next_buffer (void) while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) { yy_current_state = (int) yy_def[yy_current_state]; - if ( yy_current_state >= 276 ) - yy_c = yy_meta[(unsigned int) yy_c]; + if ( yy_current_state >= 275 ) + yy_c = yy_meta[yy_c]; } - yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; - yy_is_jam = (yy_current_state == 275); + yy_current_state = yy_nxt[yy_base[yy_current_state] + yy_c]; + yy_is_jam = (yy_current_state == 274); return yy_is_jam ? 0 : yy_current_state; } - static void yyunput (int c, register char * yy_bp ) +#ifndef YY_NO_UNPUT + + static void yyunput (int c, char * yy_bp ) { - register char *yy_cp; + char *yy_cp; yy_cp = (yy_c_buf_p); - /* undo effects of setting up H5LTyytext */ + /* undo effects of setting up yytext */ *yy_cp = (yy_hold_char); if ( yy_cp < YY_CURRENT_BUFFER_LVALUE->yy_ch_buf + 2 ) { /* need to shift things up to make room */ /* +2 for EOB chars. */ - register yy_size_t number_to_move = (yy_n_chars) + 2; - register char *dest = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[ + int number_to_move = (yy_n_chars) + 2; + char *dest = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[ YY_CURRENT_BUFFER_LVALUE->yy_buf_size + 2]; - register char *source = + char *source = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move]; while ( source > YY_CURRENT_BUFFER_LVALUE->yy_ch_buf ) @@ -1649,7 +1888,7 @@ static int yy_get_next_buffer (void) yy_cp += (int) (dest - source); yy_bp += (int) (dest - source); YY_CURRENT_BUFFER_LVALUE->yy_n_chars = - (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_buf_size; + (yy_n_chars) = (int) YY_CURRENT_BUFFER_LVALUE->yy_buf_size; if ( yy_cp < YY_CURRENT_BUFFER_LVALUE->yy_ch_buf + 2 ) YY_FATAL_ERROR( "flex scanner push-back overflow" ); @@ -1662,6 +1901,8 @@ static int yy_get_next_buffer (void) (yy_c_buf_p) = yy_cp; } +#endif + #ifndef YY_NO_INPUT #ifdef __cplusplus static int yyinput (void) @@ -1686,7 +1927,7 @@ static int yy_get_next_buffer (void) else { /* need more input */ - yy_size_t offset = (yy_c_buf_p) - (yytext_ptr); + int offset = (int) ((yy_c_buf_p) - (yytext_ptr)); ++(yy_c_buf_p); switch ( yy_get_next_buffer( ) ) @@ -1703,14 +1944,14 @@ static int yy_get_next_buffer (void) */ /* Reset buffer status. */ - H5LTyyrestart(H5LTyyin ); + yyrestart( yyin ); /*FALLTHROUGH*/ case EOB_ACT_END_OF_FILE: { - if ( H5LTyywrap( ) ) - return EOF; + if ( yywrap( ) ) + return 0; if ( ! (yy_did_buffer_switch_on_eof) ) YY_NEW_FILE; @@ -1729,7 +1970,7 @@ static int yy_get_next_buffer (void) } c = *(unsigned char *) (yy_c_buf_p); /* cast for 8-bit char's */ - *(yy_c_buf_p) = '\0'; /* preserve H5LTyytext */ + *(yy_c_buf_p) = '\0'; /* preserve yytext */ (yy_hold_char) = *++(yy_c_buf_p); return c; @@ -1741,32 +1982,32 @@ static int yy_get_next_buffer (void) * * @note This function does not reset the start condition to @c INITIAL . */ - void H5LTyyrestart (FILE * input_file ) + void yyrestart (FILE * input_file ) { if ( ! YY_CURRENT_BUFFER ){ - H5LTyyensure_buffer_stack (); + yyensure_buffer_stack (); YY_CURRENT_BUFFER_LVALUE = - H5LTyy_create_buffer(H5LTyyin,YY_BUF_SIZE ); + yy_create_buffer( yyin, YY_BUF_SIZE ); } - H5LTyy_init_buffer(YY_CURRENT_BUFFER,input_file ); - H5LTyy_load_buffer_state( ); + yy_init_buffer( YY_CURRENT_BUFFER, input_file ); + yy_load_buffer_state( ); } /** Switch to a different input buffer. * @param new_buffer The new input buffer. * */ - void H5LTyy_switch_to_buffer (YY_BUFFER_STATE new_buffer ) + void yy_switch_to_buffer (YY_BUFFER_STATE new_buffer ) { /* TODO. We should be able to replace this entire function body * with - * H5LTyypop_buffer_state(); - * H5LTyypush_buffer_state(new_buffer); + * yypop_buffer_state(); + * yypush_buffer_state(new_buffer); */ - H5LTyyensure_buffer_stack (); + yyensure_buffer_stack (); if ( YY_CURRENT_BUFFER == new_buffer ) return; @@ -1779,21 +2020,21 @@ static int yy_get_next_buffer (void) } YY_CURRENT_BUFFER_LVALUE = new_buffer; - H5LTyy_load_buffer_state( ); + yy_load_buffer_state( ); /* We don't actually know whether we did this switch during - * EOF (H5LTyywrap()) processing, but the only time this flag - * is looked at is after H5LTyywrap() is called, so it's safe + * EOF (yywrap()) processing, but the only time this flag + * is looked at is after yywrap() is called, so it's safe * to go ahead and always set it. */ (yy_did_buffer_switch_on_eof) = 1; } -static void H5LTyy_load_buffer_state (void) +static void yy_load_buffer_state (void) { (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_n_chars; (yytext_ptr) = (yy_c_buf_p) = YY_CURRENT_BUFFER_LVALUE->yy_buf_pos; - H5LTyyin = YY_CURRENT_BUFFER_LVALUE->yy_input_file; + yyin = YY_CURRENT_BUFFER_LVALUE->yy_input_file; (yy_hold_char) = *(yy_c_buf_p); } @@ -1803,35 +2044,35 @@ static void H5LTyy_load_buffer_state (void) * * @return the allocated buffer state. */ - YY_BUFFER_STATE H5LTyy_create_buffer (FILE * file, int size ) + YY_BUFFER_STATE yy_create_buffer (FILE * file, int size ) { YY_BUFFER_STATE b; - b = (YY_BUFFER_STATE) H5LTyyalloc(sizeof( struct yy_buffer_state ) ); + b = (YY_BUFFER_STATE) yyalloc( sizeof( struct yy_buffer_state ) ); if ( ! b ) - YY_FATAL_ERROR( "out of dynamic memory in H5LTyy_create_buffer()" ); + YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" ); b->yy_buf_size = size; /* yy_ch_buf has to be 2 characters longer than the size given because * we need to put in 2 end-of-buffer characters. */ - b->yy_ch_buf = (char *) H5LTyyalloc(b->yy_buf_size + 2 ); + b->yy_ch_buf = (char *) yyalloc( (yy_size_t) (b->yy_buf_size + 2) ); if ( ! b->yy_ch_buf ) - YY_FATAL_ERROR( "out of dynamic memory in H5LTyy_create_buffer()" ); + YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" ); b->yy_is_our_buffer = 1; - H5LTyy_init_buffer(b,file ); + yy_init_buffer( b, file ); return b; } /** Destroy the buffer. - * @param b a buffer created with H5LTyy_create_buffer() + * @param b a buffer created with yy_create_buffer() * */ - void H5LTyy_delete_buffer (YY_BUFFER_STATE b ) + void yy_delete_buffer (YY_BUFFER_STATE b ) { if ( ! b ) @@ -1841,27 +2082,27 @@ static void H5LTyy_load_buffer_state (void) YY_CURRENT_BUFFER_LVALUE = (YY_BUFFER_STATE) 0; if ( b->yy_is_our_buffer ) - H5LTyyfree((void *) b->yy_ch_buf ); + yyfree( (void *) b->yy_ch_buf ); - H5LTyyfree((void *) b ); + yyfree( (void *) b ); } /* Initializes or reinitializes a buffer. * This function is sometimes called more than once on the same buffer, - * such as during a H5LTyyrestart() or at EOF. + * such as during a yyrestart() or at EOF. */ - static void H5LTyy_init_buffer (YY_BUFFER_STATE b, FILE * file ) + static void yy_init_buffer (YY_BUFFER_STATE b, FILE * file ) { int oerrno = errno; - H5LTyy_flush_buffer(b ); + yy_flush_buffer( b ); b->yy_input_file = file; b->yy_fill_buffer = 1; - /* If b is the current buffer, then H5LTyy_init_buffer was _probably_ - * called from H5LTyyrestart() or through yy_get_next_buffer. + /* If b is the current buffer, then yy_init_buffer was _probably_ + * called from yyrestart() or through yy_get_next_buffer. * In that case, we don't want to reset the lineno or column. */ if (b != YY_CURRENT_BUFFER){ @@ -1878,7 +2119,7 @@ static void H5LTyy_load_buffer_state (void) * @param b the buffer state to be flushed, usually @c YY_CURRENT_BUFFER. * */ - void H5LTyy_flush_buffer (YY_BUFFER_STATE b ) + void yy_flush_buffer (YY_BUFFER_STATE b ) { if ( ! b ) return; @@ -1898,7 +2139,7 @@ static void H5LTyy_load_buffer_state (void) b->yy_buffer_status = YY_BUFFER_NEW; if ( b == YY_CURRENT_BUFFER ) - H5LTyy_load_buffer_state( ); + yy_load_buffer_state( ); } /** Pushes the new state onto the stack. The new state becomes @@ -1907,14 +2148,14 @@ static void H5LTyy_load_buffer_state (void) * @param new_buffer The new state. * */ -void H5LTyypush_buffer_state (YY_BUFFER_STATE new_buffer ) +void yypush_buffer_state (YY_BUFFER_STATE new_buffer ) { if (new_buffer == NULL) return; - H5LTyyensure_buffer_stack(); + yyensure_buffer_stack(); - /* This block is copied from H5LTyy_switch_to_buffer. */ + /* This block is copied from yy_switch_to_buffer. */ if ( YY_CURRENT_BUFFER ) { /* Flush out information for old buffer. */ @@ -1928,8 +2169,8 @@ void H5LTyypush_buffer_state (YY_BUFFER_STATE new_buffer ) (yy_buffer_stack_top)++; YY_CURRENT_BUFFER_LVALUE = new_buffer; - /* copied from H5LTyy_switch_to_buffer. */ - H5LTyy_load_buffer_state( ); + /* copied from yy_switch_to_buffer. */ + yy_load_buffer_state( ); (yy_did_buffer_switch_on_eof) = 1; } @@ -1937,18 +2178,18 @@ void H5LTyypush_buffer_state (YY_BUFFER_STATE new_buffer ) * The next element becomes the new top. * */ -void H5LTyypop_buffer_state (void) +void yypop_buffer_state (void) { if (!YY_CURRENT_BUFFER) return; - H5LTyy_delete_buffer(YY_CURRENT_BUFFER ); + yy_delete_buffer(YY_CURRENT_BUFFER ); YY_CURRENT_BUFFER_LVALUE = NULL; if ((yy_buffer_stack_top) > 0) --(yy_buffer_stack_top); if (YY_CURRENT_BUFFER) { - H5LTyy_load_buffer_state( ); + yy_load_buffer_state( ); (yy_did_buffer_switch_on_eof) = 1; } } @@ -1956,7 +2197,7 @@ void H5LTyypop_buffer_state (void) /* Allocates the stack if it does not exist. * Guarantees space for at least one push. */ -static void H5LTyyensure_buffer_stack (void) +static void yyensure_buffer_stack (void) { yy_size_t num_to_alloc; @@ -1966,15 +2207,15 @@ static void H5LTyyensure_buffer_stack (void) * scanner will even need a stack. We use 2 instead of 1 to avoid an * immediate realloc on the next call. */ - num_to_alloc = 1; - (yy_buffer_stack) = (struct yy_buffer_state**)H5LTyyalloc + num_to_alloc = 1; /* After all that talk, this was set to 1 anyways... */ + (yy_buffer_stack) = (struct yy_buffer_state**)yyalloc (num_to_alloc * sizeof(struct yy_buffer_state*) ); if ( ! (yy_buffer_stack) ) - YY_FATAL_ERROR( "out of dynamic memory in H5LTyyensure_buffer_stack()" ); - + YY_FATAL_ERROR( "out of dynamic memory in yyensure_buffer_stack()" ); + memset((yy_buffer_stack), 0, num_to_alloc * sizeof(struct yy_buffer_state*)); - + (yy_buffer_stack_max) = num_to_alloc; (yy_buffer_stack_top) = 0; return; @@ -1983,15 +2224,15 @@ static void H5LTyyensure_buffer_stack (void) if ((yy_buffer_stack_top) >= ((yy_buffer_stack_max)) - 1){ /* Increase the buffer to prepare for a possible push. */ - int grow_size = 8 /* arbitrary grow size */; + yy_size_t grow_size = 8 /* arbitrary grow size */; num_to_alloc = (yy_buffer_stack_max) + grow_size; - (yy_buffer_stack) = (struct yy_buffer_state**)H5LTyyrealloc + (yy_buffer_stack) = (struct yy_buffer_state**)yyrealloc ((yy_buffer_stack), num_to_alloc * sizeof(struct yy_buffer_state*) ); if ( ! (yy_buffer_stack) ) - YY_FATAL_ERROR( "out of dynamic memory in H5LTyyensure_buffer_stack()" ); + YY_FATAL_ERROR( "out of dynamic memory in yyensure_buffer_stack()" ); /* zero only the new slots.*/ memset((yy_buffer_stack) + (yy_buffer_stack_max), 0, grow_size * sizeof(struct yy_buffer_state*)); @@ -2003,9 +2244,9 @@ static void H5LTyyensure_buffer_stack (void) * @param base the character buffer * @param size the size in bytes of the character buffer * - * @return the newly allocated buffer state object. + * @return the newly allocated buffer state object. */ -YY_BUFFER_STATE H5LTyy_scan_buffer (char * base, yy_size_t size ) +YY_BUFFER_STATE yy_scan_buffer (char * base, yy_size_t size ) { YY_BUFFER_STATE b; @@ -2013,49 +2254,49 @@ YY_BUFFER_STATE H5LTyy_scan_buffer (char * base, yy_size_t size ) base[size-2] != YY_END_OF_BUFFER_CHAR || base[size-1] != YY_END_OF_BUFFER_CHAR ) /* They forgot to leave room for the EOB's. */ - return 0; + return NULL; - b = (YY_BUFFER_STATE) H5LTyyalloc(sizeof( struct yy_buffer_state ) ); + b = (YY_BUFFER_STATE) yyalloc( sizeof( struct yy_buffer_state ) ); if ( ! b ) - YY_FATAL_ERROR( "out of dynamic memory in H5LTyy_scan_buffer()" ); + YY_FATAL_ERROR( "out of dynamic memory in yy_scan_buffer()" ); - b->yy_buf_size = size - 2; /* "- 2" to take care of EOB's */ + b->yy_buf_size = (int) (size - 2); /* "- 2" to take care of EOB's */ b->yy_buf_pos = b->yy_ch_buf = base; b->yy_is_our_buffer = 0; - b->yy_input_file = 0; + b->yy_input_file = NULL; b->yy_n_chars = b->yy_buf_size; b->yy_is_interactive = 0; b->yy_at_bol = 1; b->yy_fill_buffer = 0; b->yy_buffer_status = YY_BUFFER_NEW; - H5LTyy_switch_to_buffer(b ); + yy_switch_to_buffer( b ); return b; } -/** Setup the input buffer state to scan a string. The next call to H5LTyylex() will +/** Setup the input buffer state to scan a string. The next call to yylex() will * scan from a @e copy of @a str. * @param yystr a NUL-terminated string to scan * * @return the newly allocated buffer state object. * @note If you want to scan bytes that may contain NUL values, then use - * H5LTyy_scan_bytes() instead. + * yy_scan_bytes() instead. */ -YY_BUFFER_STATE H5LTyy_scan_string (yyconst char * yystr ) +YY_BUFFER_STATE yy_scan_string (const char * yystr ) { - return H5LTyy_scan_bytes(yystr,strlen(yystr) ); + return yy_scan_bytes( yystr, (int) strlen(yystr) ); } -/** Setup the input buffer state to scan the given bytes. The next call to H5LTyylex() will +/** Setup the input buffer state to scan the given bytes. The next call to yylex() will * scan from a @e copy of @a bytes. * @param yybytes the byte buffer to scan * @param _yybytes_len the number of bytes in the buffer pointed to by @a bytes. * * @return the newly allocated buffer state object. */ -YY_BUFFER_STATE H5LTyy_scan_bytes (yyconst char * yybytes, yy_size_t _yybytes_len ) +YY_BUFFER_STATE yy_scan_bytes (const char * yybytes, int _yybytes_len ) { YY_BUFFER_STATE b; char *buf; @@ -2063,19 +2304,19 @@ YY_BUFFER_STATE H5LTyy_scan_bytes (yyconst char * yybytes, yy_size_t _yybytes_ int i; /* Get memory for full buffer, including space for trailing EOB's. */ - n = _yybytes_len + 2; - buf = (char *) H5LTyyalloc(n ); + n = (yy_size_t) (_yybytes_len + 2); + buf = (char *) yyalloc( n ); if ( ! buf ) - YY_FATAL_ERROR( "out of dynamic memory in H5LTyy_scan_bytes()" ); + YY_FATAL_ERROR( "out of dynamic memory in yy_scan_bytes()" ); for ( i = 0; i < _yybytes_len; ++i ) buf[i] = yybytes[i]; buf[_yybytes_len] = buf[_yybytes_len+1] = YY_END_OF_BUFFER_CHAR; - b = H5LTyy_scan_buffer(buf,n ); + b = yy_scan_buffer( buf, n ); if ( ! b ) - YY_FATAL_ERROR( "bad buffer in H5LTyy_scan_bytes()" ); + YY_FATAL_ERROR( "bad buffer in yy_scan_bytes()" ); /* It's okay to grow etc. this buffer, and we should throw it * away when we're done. @@ -2089,9 +2330,9 @@ YY_BUFFER_STATE H5LTyy_scan_bytes (yyconst char * yybytes, yy_size_t _yybytes_ #define YY_EXIT_FAILURE 2 #endif -static void yy_fatal_error (yyconst char* msg ) +static void yynoreturn yy_fatal_error (const char* msg ) { - (void) fprintf( stderr, "%s\n", msg ); + fprintf( stderr, "%s\n", msg ); exit( YY_EXIT_FAILURE ); } @@ -2101,14 +2342,14 @@ static void yy_fatal_error (yyconst char* msg ) #define yyless(n) \ do \ { \ - /* Undo effects of setting up H5LTyytext. */ \ + /* Undo effects of setting up yytext. */ \ int yyless_macro_arg = (n); \ YY_LESS_LINENO(yyless_macro_arg);\ - H5LTyytext[H5LTyyleng] = (yy_hold_char); \ - (yy_c_buf_p) = H5LTyytext + yyless_macro_arg; \ + yytext[yyleng] = (yy_hold_char); \ + (yy_c_buf_p) = yytext + yyless_macro_arg; \ (yy_hold_char) = *(yy_c_buf_p); \ *(yy_c_buf_p) = '\0'; \ - H5LTyyleng = yyless_macro_arg; \ + yyleng = yyless_macro_arg; \ } \ while ( 0 ) @@ -2117,126 +2358,126 @@ static void yy_fatal_error (yyconst char* msg ) /** Get the current line number. * */ -int H5LTyyget_lineno (void) +int yyget_lineno (void) { - - return H5LTyylineno; + + return yylineno; } /** Get the input stream. * */ -FILE *H5LTyyget_in (void) +FILE *yyget_in (void) { - return H5LTyyin; + return yyin; } /** Get the output stream. * */ -FILE *H5LTyyget_out (void) +FILE *yyget_out (void) { - return H5LTyyout; + return yyout; } /** Get the length of the current token. * */ -yy_size_t H5LTyyget_leng (void) +int yyget_leng (void) { - return H5LTyyleng; + return yyleng; } /** Get the current token. * */ -char *H5LTyyget_text (void) +char *yyget_text (void) { - return H5LTyytext; + return yytext; } /** Set the current line number. - * @param line_number + * @param _line_number line number * */ -void H5LTyyset_lineno (int line_number ) +void yyset_lineno (int _line_number ) { - H5LTyylineno = line_number; + yylineno = _line_number; } /** Set the input stream. This does not discard the current * input buffer. - * @param in_str A readable stream. + * @param _in_str A readable stream. * - * @see H5LTyy_switch_to_buffer + * @see yy_switch_to_buffer */ -void H5LTyyset_in (FILE * in_str ) +void yyset_in (FILE * _in_str ) { - H5LTyyin = in_str ; + yyin = _in_str ; } -void H5LTyyset_out (FILE * out_str ) +void yyset_out (FILE * _out_str ) { - H5LTyyout = out_str ; + yyout = _out_str ; } -int H5LTyyget_debug (void) +int yyget_debug (void) { - return H5LTyy_flex_debug; + return yy_flex_debug; } -void H5LTyyset_debug (int bdebug ) +void yyset_debug (int _bdebug ) { - H5LTyy_flex_debug = bdebug ; + yy_flex_debug = _bdebug ; } static int yy_init_globals (void) { /* Initialization is the same as for the non-reentrant scanner. - * This function is called from H5LTyylex_destroy(), so don't allocate here. + * This function is called from yylex_destroy(), so don't allocate here. */ - (yy_buffer_stack) = 0; + (yy_buffer_stack) = NULL; (yy_buffer_stack_top) = 0; (yy_buffer_stack_max) = 0; - (yy_c_buf_p) = (char *) 0; + (yy_c_buf_p) = NULL; (yy_init) = 0; (yy_start) = 0; /* Defined in main.c */ #ifdef YY_STDINIT - H5LTyyin = stdin; - H5LTyyout = stdout; + yyin = stdin; + yyout = stdout; #else - H5LTyyin = (FILE *) 0; - H5LTyyout = (FILE *) 0; + yyin = NULL; + yyout = NULL; #endif /* For future reference: Set errno on error, since we are called by - * H5LTyylex_init() + * yylex_init() */ return 0; } -/* H5LTyylex_destroy is for both reentrant and non-reentrant scanners. */ -int H5LTyylex_destroy (void) +/* yylex_destroy is for both reentrant and non-reentrant scanners. */ +int yylex_destroy (void) { /* Pop the buffer stack, destroying each element. */ while(YY_CURRENT_BUFFER){ - H5LTyy_delete_buffer(YY_CURRENT_BUFFER ); + yy_delete_buffer( YY_CURRENT_BUFFER ); YY_CURRENT_BUFFER_LVALUE = NULL; - H5LTyypop_buffer_state(); + yypop_buffer_state(); } /* Destroy the stack itself. */ - H5LTyyfree((yy_buffer_stack) ); + yyfree((yy_buffer_stack) ); (yy_buffer_stack) = NULL; /* Reset the globals. This is important in a non-reentrant scanner so the next time - * H5LTyylex() is called, initialization will occur. */ + * yylex() is called, initialization will occur. */ yy_init_globals( ); return 0; @@ -2247,18 +2488,19 @@ int H5LTyylex_destroy (void) */ #ifndef yytext_ptr -static void yy_flex_strncpy (char* s1, yyconst char * s2, int n ) +static void yy_flex_strncpy (char* s1, const char * s2, int n ) { - register int i; + + int i; for ( i = 0; i < n; ++i ) s1[i] = s2[i]; } #endif #ifdef YY_NEED_STRLEN -static int yy_flex_strlen (yyconst char * s ) +static int yy_flex_strlen (const char * s ) { - register int n; + int n; for ( n = 0; s[n]; ++n ) ; @@ -2266,13 +2508,14 @@ static int yy_flex_strlen (yyconst char * s ) } #endif -void *H5LTyyalloc (yy_size_t size ) +void *yyalloc (yy_size_t size ) { - return (void *) malloc( size ); + return malloc(size); } -void *H5LTyyrealloc (void * ptr, yy_size_t size ) +void *yyrealloc (void * ptr, yy_size_t size ) { + /* The cast to (char *) in the following accommodates both * implementations that use char* generic pointers, and those * that use void* generic pointers. It works with the latter @@ -2280,18 +2523,17 @@ void *H5LTyyrealloc (void * ptr, yy_size_t size ) * any pointer type to void*, and deal with argument conversions * as though doing an assignment. */ - return (void *) realloc( (char *) ptr, size ); + return realloc(ptr, size); } -void H5LTyyfree (void * ptr ) +void yyfree (void * ptr ) { - free( (char *) ptr ); /* see H5LTyyrealloc() for (char *) cast */ + free( (char *) ptr ); /* see yyrealloc() for (char *) cast */ } #define YYTABLES_NAME "yytables" -#line 128 "hl/src//H5LTanalyze.l" - +#line 127 "hl/src/H5LTanalyze.l" /* Allocate a copy of `quoted` with the double quote character at @@ -2323,11 +2565,11 @@ int my_yyinput(char *buf, int max_size) int H5LTyyerror(const char *msg) { - HDprintf("ERROR: %s before \"%s\".\n", msg, H5LTyytext); + HDprintf("ERROR: %s before \"%s\".\n", msg, yytext); return 0; } -int H5LTyywrap() +int yywrap() { return(1); } diff --git a/hl/src/H5LTanalyze.l b/hl/src/H5LTanalyze.l index 76d5800a5d8..fd1cbe59d6b 100644 --- a/hl/src/H5LTanalyze.l +++ b/hl/src/H5LTanalyze.l @@ -123,7 +123,6 @@ OPQ_TAG {return token(OPQ_TAG_TOKEN);} ":" {return token(':');} ";" {return token(';');} [ \t\n]* ; -"\n" { return 0; } %% diff --git a/hl/src/H5LTparse.c b/hl/src/H5LTparse.c index eec7c643b4c..7f552d8cb00 100644 --- a/hl/src/H5LTparse.c +++ b/hl/src/H5LTparse.c @@ -28,22 +28,22 @@ #elif defined _MSC_VER #pragma warning(push, 1) #endif -/* A Bison parser, made by GNU Bison 2.7. */ +/* A Bison parser, made by GNU Bison 3.0.4. */ /* Bison implementation for Yacc-like parsers in C - - Copyright (C) 1984, 1989-1990, 2000-2012 Free Software Foundation, Inc. - + + Copyright (C) 1984, 1989-1990, 2000-2015 Free Software Foundation, Inc. + This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. - + This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. - + You should have received a copy of the GNU General Public License along with this program. If not, see . */ @@ -56,7 +56,7 @@ special exception, which will cause the skeleton and the resulting Bison output files to be licensed under the GNU General Public License without this special exception. - + This special exception was added by the Free Software Foundation in version 2.2 of Bison. */ @@ -74,7 +74,7 @@ #define YYBISON 1 /* Bison version. */ -#define YYBISON_VERSION "2.7" +#define YYBISON_VERSION "3.0.4" /* Skeleton name. */ #define YYSKELETON_NAME "yacc.c" @@ -93,14 +93,14 @@ #define yyparse H5LTyyparse #define yylex H5LTyylex #define yyerror H5LTyyerror -#define yylval H5LTyylval -#define yychar H5LTyychar #define yydebug H5LTyydebug #define yynerrs H5LTyynerrs +#define yylval H5LTyylval +#define yychar H5LTyychar + /* Copy the first part of user declarations. */ -/* Line 371 of yacc.c */ -#line 20 "hl/src//H5LTparse.y" +#line 20 "hl/src/H5LTparse.y" /* yacc.c:339 */ #include #include @@ -150,14 +150,13 @@ static hbool_t is_enum_memb = 0; /*flag to lexer for enum member*/ static char* enum_memb_symbol; /*enum member symbol string*/ -/* Line 371 of yacc.c */ -#line 125 "hl/src//H5LTparse.c" +#line 124 "hl/src/H5LTparse.c" /* yacc.c:339 */ -# ifndef YY_NULL +# ifndef YY_NULLPTR # if defined __cplusplus && 201103L <= __cplusplus -# define YY_NULL nullptr +# define YY_NULLPTR nullptr # else -# define YY_NULL 0 +# define YY_NULLPTR 0 # endif # endif @@ -173,7 +172,7 @@ static char* enum_memb_symbol; /*enum member symbol string*/ by #include "H5LTparse.h". */ #ifndef YY_H5LTYY_HL_SRC_H5LTPARSE_H_INCLUDED # define YY_H5LTYY_HL_SRC_H5LTPARSE_H_INCLUDED -/* Enabling traces. */ +/* Debug traces. */ #ifndef YYDEBUG # define YYDEBUG 0 #endif @@ -181,113 +180,99 @@ static char* enum_memb_symbol; /*enum member symbol string*/ extern int H5LTyydebug; #endif -/* Tokens. */ +/* Token type. */ #ifndef YYTOKENTYPE # define YYTOKENTYPE - /* Put the tokens into the symbol table, so that GDB and other debuggers - know about them. */ - enum yytokentype { - H5T_STD_I8BE_TOKEN = 258, - H5T_STD_I8LE_TOKEN = 259, - H5T_STD_I16BE_TOKEN = 260, - H5T_STD_I16LE_TOKEN = 261, - H5T_STD_I32BE_TOKEN = 262, - H5T_STD_I32LE_TOKEN = 263, - H5T_STD_I64BE_TOKEN = 264, - H5T_STD_I64LE_TOKEN = 265, - H5T_STD_U8BE_TOKEN = 266, - H5T_STD_U8LE_TOKEN = 267, - H5T_STD_U16BE_TOKEN = 268, - H5T_STD_U16LE_TOKEN = 269, - H5T_STD_U32BE_TOKEN = 270, - H5T_STD_U32LE_TOKEN = 271, - H5T_STD_U64BE_TOKEN = 272, - H5T_STD_U64LE_TOKEN = 273, - H5T_NATIVE_CHAR_TOKEN = 274, - H5T_NATIVE_SCHAR_TOKEN = 275, - H5T_NATIVE_UCHAR_TOKEN = 276, - H5T_NATIVE_SHORT_TOKEN = 277, - H5T_NATIVE_USHORT_TOKEN = 278, - H5T_NATIVE_INT_TOKEN = 279, - H5T_NATIVE_UINT_TOKEN = 280, - H5T_NATIVE_LONG_TOKEN = 281, - H5T_NATIVE_ULONG_TOKEN = 282, - H5T_NATIVE_LLONG_TOKEN = 283, - H5T_NATIVE_ULLONG_TOKEN = 284, - H5T_IEEE_F32BE_TOKEN = 285, - H5T_IEEE_F32LE_TOKEN = 286, - H5T_IEEE_F64BE_TOKEN = 287, - H5T_IEEE_F64LE_TOKEN = 288, - H5T_NATIVE_FLOAT_TOKEN = 289, - H5T_NATIVE_DOUBLE_TOKEN = 290, - H5T_NATIVE_LDOUBLE_TOKEN = 291, - H5T_STRING_TOKEN = 292, - STRSIZE_TOKEN = 293, - STRPAD_TOKEN = 294, - CSET_TOKEN = 295, - CTYPE_TOKEN = 296, - H5T_VARIABLE_TOKEN = 297, - H5T_STR_NULLTERM_TOKEN = 298, - H5T_STR_NULLPAD_TOKEN = 299, - H5T_STR_SPACEPAD_TOKEN = 300, - H5T_CSET_ASCII_TOKEN = 301, - H5T_CSET_UTF8_TOKEN = 302, - H5T_C_S1_TOKEN = 303, - H5T_FORTRAN_S1_TOKEN = 304, - H5T_OPAQUE_TOKEN = 305, - OPQ_SIZE_TOKEN = 306, - OPQ_TAG_TOKEN = 307, - H5T_COMPOUND_TOKEN = 308, - H5T_ENUM_TOKEN = 309, - H5T_ARRAY_TOKEN = 310, - H5T_VLEN_TOKEN = 311, - STRING = 312, - NUMBER = 313 - }; + enum yytokentype + { + H5T_STD_I8BE_TOKEN = 258, + H5T_STD_I8LE_TOKEN = 259, + H5T_STD_I16BE_TOKEN = 260, + H5T_STD_I16LE_TOKEN = 261, + H5T_STD_I32BE_TOKEN = 262, + H5T_STD_I32LE_TOKEN = 263, + H5T_STD_I64BE_TOKEN = 264, + H5T_STD_I64LE_TOKEN = 265, + H5T_STD_U8BE_TOKEN = 266, + H5T_STD_U8LE_TOKEN = 267, + H5T_STD_U16BE_TOKEN = 268, + H5T_STD_U16LE_TOKEN = 269, + H5T_STD_U32BE_TOKEN = 270, + H5T_STD_U32LE_TOKEN = 271, + H5T_STD_U64BE_TOKEN = 272, + H5T_STD_U64LE_TOKEN = 273, + H5T_NATIVE_CHAR_TOKEN = 274, + H5T_NATIVE_SCHAR_TOKEN = 275, + H5T_NATIVE_UCHAR_TOKEN = 276, + H5T_NATIVE_SHORT_TOKEN = 277, + H5T_NATIVE_USHORT_TOKEN = 278, + H5T_NATIVE_INT_TOKEN = 279, + H5T_NATIVE_UINT_TOKEN = 280, + H5T_NATIVE_LONG_TOKEN = 281, + H5T_NATIVE_ULONG_TOKEN = 282, + H5T_NATIVE_LLONG_TOKEN = 283, + H5T_NATIVE_ULLONG_TOKEN = 284, + H5T_IEEE_F32BE_TOKEN = 285, + H5T_IEEE_F32LE_TOKEN = 286, + H5T_IEEE_F64BE_TOKEN = 287, + H5T_IEEE_F64LE_TOKEN = 288, + H5T_NATIVE_FLOAT_TOKEN = 289, + H5T_NATIVE_DOUBLE_TOKEN = 290, + H5T_NATIVE_LDOUBLE_TOKEN = 291, + H5T_STRING_TOKEN = 292, + STRSIZE_TOKEN = 293, + STRPAD_TOKEN = 294, + CSET_TOKEN = 295, + CTYPE_TOKEN = 296, + H5T_VARIABLE_TOKEN = 297, + H5T_STR_NULLTERM_TOKEN = 298, + H5T_STR_NULLPAD_TOKEN = 299, + H5T_STR_SPACEPAD_TOKEN = 300, + H5T_CSET_ASCII_TOKEN = 301, + H5T_CSET_UTF8_TOKEN = 302, + H5T_C_S1_TOKEN = 303, + H5T_FORTRAN_S1_TOKEN = 304, + H5T_OPAQUE_TOKEN = 305, + OPQ_SIZE_TOKEN = 306, + OPQ_TAG_TOKEN = 307, + H5T_COMPOUND_TOKEN = 308, + H5T_ENUM_TOKEN = 309, + H5T_ARRAY_TOKEN = 310, + H5T_VLEN_TOKEN = 311, + STRING = 312, + NUMBER = 313 + }; #endif - +/* Value type. */ #if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED -typedef union YYSTYPE + +union YYSTYPE { -/* Line 387 of yacc.c */ -#line 69 "hl/src//H5LTparse.y" +#line 69 "hl/src/H5LTparse.y" /* yacc.c:355 */ int ival; /*for integer token*/ char *sval; /*for name string*/ hid_t hid; /*for hid_t token*/ +#line 229 "hl/src/H5LTparse.c" /* yacc.c:355 */ +}; -/* Line 387 of yacc.c */ -#line 233 "hl/src//H5LTparse.c" -} YYSTYPE; +typedef union YYSTYPE YYSTYPE; # define YYSTYPE_IS_TRIVIAL 1 -# define yystype YYSTYPE /* obsolescent; will be withdrawn */ # define YYSTYPE_IS_DECLARED 1 #endif + extern YYSTYPE H5LTyylval; -#ifdef YYPARSE_PARAM -#if defined __STDC__ || defined __cplusplus -hid_t H5LTyyparse (void *YYPARSE_PARAM); -#else -hid_t H5LTyyparse (); -#endif -#else /* ! YYPARSE_PARAM */ -#if defined __STDC__ || defined __cplusplus hid_t H5LTyyparse (void); -#else -hid_t H5LTyyparse (); -#endif -#endif /* ! YYPARSE_PARAM */ #endif /* !YY_H5LTYY_HL_SRC_H5LTPARSE_H_INCLUDED */ /* Copy the second part of user declarations. */ -/* Line 390 of yacc.c */ -#line 261 "hl/src//H5LTparse.c" +#line 246 "hl/src/H5LTparse.c" /* yacc.c:358 */ #ifdef short # undef short @@ -301,11 +286,8 @@ typedef unsigned char yytype_uint8; #ifdef YYTYPE_INT8 typedef YYTYPE_INT8 yytype_int8; -#elif (defined __STDC__ || defined __C99__FUNC__ \ - || defined __cplusplus || defined _MSC_VER) -typedef signed char yytype_int8; #else -typedef short int yytype_int8; +typedef signed char yytype_int8; #endif #ifdef YYTYPE_UINT16 @@ -325,8 +307,7 @@ typedef short int yytype_int16; # define YYSIZE_T __SIZE_TYPE__ # elif defined size_t # define YYSIZE_T size_t -# elif ! defined YYSIZE_T && (defined __STDC__ || defined __C99__FUNC__ \ - || defined __cplusplus || defined _MSC_VER) +# elif ! defined YYSIZE_T # include /* INFRINGES ON USER NAME SPACE */ # define YYSIZE_T size_t # else @@ -348,6 +329,33 @@ typedef short int yytype_int16; # endif #endif +#ifndef YY_ATTRIBUTE +# if (defined __GNUC__ \ + && (2 < __GNUC__ || (__GNUC__ == 2 && 96 <= __GNUC_MINOR__))) \ + || defined __SUNPRO_C && 0x5110 <= __SUNPRO_C +# define YY_ATTRIBUTE(Spec) __attribute__(Spec) +# else +# define YY_ATTRIBUTE(Spec) /* empty */ +# endif +#endif + +#ifndef YY_ATTRIBUTE_PURE +# define YY_ATTRIBUTE_PURE YY_ATTRIBUTE ((__pure__)) +#endif + +#ifndef YY_ATTRIBUTE_UNUSED +# define YY_ATTRIBUTE_UNUSED YY_ATTRIBUTE ((__unused__)) +#endif + +#if !defined _Noreturn \ + && (!defined __STDC_VERSION__ || __STDC_VERSION__ < 201112) +# if defined _MSC_VER && 1200 <= _MSC_VER +# define _Noreturn __declspec (noreturn) +# else +# define _Noreturn YY_ATTRIBUTE ((__noreturn__)) +# endif +#endif + /* Suppress unused-variable warnings by "using" E. */ #if ! defined lint || defined __GNUC__ # define YYUSE(E) ((void) (E)) @@ -355,23 +363,25 @@ typedef short int yytype_int16; # define YYUSE(E) /* empty */ #endif -/* Identity function, used to suppress warnings about constant conditions. */ -#ifndef lint -# define YYID(N) (N) +#if defined __GNUC__ && 407 <= __GNUC__ * 100 + __GNUC_MINOR__ +/* Suppress an incorrect diagnostic about yylval being uninitialized. */ +# define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN \ + _Pragma ("GCC diagnostic push") \ + _Pragma ("GCC diagnostic ignored \"-Wuninitialized\"")\ + _Pragma ("GCC diagnostic ignored \"-Wmaybe-uninitialized\"") +# define YY_IGNORE_MAYBE_UNINITIALIZED_END \ + _Pragma ("GCC diagnostic pop") #else -#if (defined __STDC__ || defined __C99__FUNC__ \ - || defined __cplusplus || defined _MSC_VER) -static int -YYID (int yyi) -#else -static int -YYID (yyi) - int yyi; +# define YY_INITIAL_VALUE(Value) Value #endif -{ - return yyi; -} +#ifndef YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN +# define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN +# define YY_IGNORE_MAYBE_UNINITIALIZED_END #endif +#ifndef YY_INITIAL_VALUE +# define YY_INITIAL_VALUE(Value) /* Nothing. */ +#endif + #if ! defined yyoverflow || YYERROR_VERBOSE @@ -390,8 +400,7 @@ YYID (yyi) # define alloca _alloca # else # define YYSTACK_ALLOC alloca -# if ! defined _ALLOCA_H && ! defined EXIT_SUCCESS && (defined __STDC__ || defined __C99__FUNC__ \ - || defined __cplusplus || defined _MSC_VER) +# if ! defined _ALLOCA_H && ! defined EXIT_SUCCESS # include /* INFRINGES ON USER NAME SPACE */ /* Use EXIT_SUCCESS as a witness for stdlib.h. */ # ifndef EXIT_SUCCESS @@ -403,8 +412,8 @@ YYID (yyi) # endif # ifdef YYSTACK_ALLOC - /* Pacify GCC's `empty if-body' warning. */ -# define YYSTACK_FREE(Ptr) do { /* empty */; } while (YYID (0)) + /* Pacify GCC's 'empty if-body' warning. */ +# define YYSTACK_FREE(Ptr) do { /* empty */; } while (0) # ifndef YYSTACK_ALLOC_MAXIMUM /* The OS might guarantee only one guard page at the bottom of the stack, and a page size can be as small as 4096 bytes. So we cannot safely @@ -420,7 +429,7 @@ YYID (yyi) # endif # if (defined __cplusplus && ! defined EXIT_SUCCESS \ && ! ((defined YYMALLOC || defined malloc) \ - && (defined YYFREE || defined free))) + && (defined YYFREE || defined free))) # include /* INFRINGES ON USER NAME SPACE */ # ifndef EXIT_SUCCESS # define EXIT_SUCCESS 0 @@ -428,15 +437,13 @@ YYID (yyi) # endif # ifndef YYMALLOC # define YYMALLOC malloc -# if ! defined malloc && ! defined EXIT_SUCCESS && (defined __STDC__ || defined __C99__FUNC__ \ - || defined __cplusplus || defined _MSC_VER) +# if ! defined malloc && ! defined EXIT_SUCCESS void *malloc (YYSIZE_T); /* INFRINGES ON USER NAME SPACE */ # endif # endif # ifndef YYFREE # define YYFREE free -# if ! defined free && ! defined EXIT_SUCCESS && (defined __STDC__ || defined __C99__FUNC__ \ - || defined __cplusplus || defined _MSC_VER) +# if ! defined free && ! defined EXIT_SUCCESS void free (void *); /* INFRINGES ON USER NAME SPACE */ # endif # endif @@ -446,7 +453,7 @@ void free (void *); /* INFRINGES ON USER NAME SPACE */ #if (! defined yyoverflow \ && (! defined __cplusplus \ - || (defined YYSTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL))) + || (defined YYSTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL))) /* A type that is properly aligned for any stack member. */ union yyalloc @@ -471,16 +478,16 @@ union yyalloc elements in the stack, and YYPTR gives the new location of the stack. Advance YYPTR to a properly aligned location for the next stack. */ -# define YYSTACK_RELOCATE(Stack_alloc, Stack) \ - do \ - { \ - YYSIZE_T yynewbytes; \ - YYCOPY (&yyptr->Stack_alloc, Stack, yysize); \ - Stack = &yyptr->Stack_alloc; \ - yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \ - yyptr += yynewbytes / sizeof (*yyptr); \ - } \ - while (YYID (0)) +# define YYSTACK_RELOCATE(Stack_alloc, Stack) \ + do \ + { \ + YYSIZE_T yynewbytes; \ + YYCOPY (&yyptr->Stack_alloc, Stack, yysize); \ + Stack = &yyptr->Stack_alloc; \ + yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \ + yyptr += yynewbytes / sizeof (*yyptr); \ + } \ + while (0) #endif @@ -499,7 +506,7 @@ union yyalloc for (yyi = 0; yyi < (Count); yyi++) \ (Dst)[yyi] = (Src)[yyi]; \ } \ - while (YYID (0)) + while (0) # endif # endif #endif /* !YYCOPY_NEEDED */ @@ -515,17 +522,19 @@ union yyalloc #define YYNNTS 43 /* YYNRULES -- Number of rules. */ #define YYNRULES 92 -/* YYNRULES -- Number of states. */ +/* YYNSTATES -- Number of states. */ #define YYNSTATES 134 -/* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX. */ +/* YYTRANSLATE[YYX] -- Symbol number corresponding to YYX as returned + by yylex, with out-of-bounds checking. */ #define YYUNDEFTOK 2 #define YYMAXUTOK 313 -#define YYTRANSLATE(YYX) \ +#define YYTRANSLATE(YYX) \ ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK) -/* YYTRANSLATE[YYLEX] -- Bison symbol number corresponding to YYLEX. */ +/* YYTRANSLATE[TOKEN-NUM] -- Symbol number corresponding to TOKEN-NUM + as returned by yylex, without out-of-bounds checking. */ static const yytype_uint8 yytranslate[] = { 0, 2, 2, 2, 2, 2, 2, 2, 2, 2, @@ -563,51 +572,7 @@ static const yytype_uint8 yytranslate[] = }; #if YYDEBUG -/* YYPRHS[YYN] -- Index of the first RHS symbol of rule number YYN in - YYRHS. */ -static const yytype_uint8 yyprhs[] = -{ - 0, 0, 3, 4, 6, 8, 10, 12, 14, 16, - 18, 20, 22, 24, 26, 28, 30, 32, 34, 36, - 38, 40, 42, 44, 46, 48, 50, 52, 54, 56, - 58, 60, 62, 64, 66, 68, 70, 72, 74, 76, - 78, 80, 82, 84, 86, 88, 90, 92, 93, 99, - 100, 103, 104, 110, 112, 113, 116, 118, 119, 126, - 127, 130, 131, 132, 138, 140, 145, 146, 147, 159, - 161, 163, 164, 165, 166, 167, 187, 189, 191, 193, - 195, 197, 199, 201, 203, 205, 206, 214, 215, 218, - 219, 224, 226 -}; - -/* YYRHS -- A `-1'-separated list of the rules' RHS. */ -static const yytype_int8 yyrhs[] = -{ - 66, 0, -1, -1, 67, -1, 68, -1, 71, -1, - 79, -1, 86, -1, 69, -1, 70, -1, 92, -1, - 101, -1, 87, -1, 3, -1, 4, -1, 5, -1, - 6, -1, 7, -1, 8, -1, 9, -1, 10, -1, - 11, -1, 12, -1, 13, -1, 14, -1, 15, -1, - 16, -1, 17, -1, 18, -1, 19, -1, 20, -1, - 21, -1, 22, -1, 23, -1, 24, -1, 25, -1, - 26, -1, 27, -1, 28, -1, 29, -1, 30, -1, - 31, -1, 32, -1, 33, -1, 34, -1, 35, -1, - 36, -1, -1, 53, 72, 59, 73, 60, -1, -1, - 73, 74, -1, -1, 67, 75, 76, 77, 64, -1, - 57, -1, -1, 63, 78, -1, 58, -1, -1, 55, - 80, 59, 81, 67, 60, -1, -1, 81, 82, -1, - -1, -1, 61, 83, 85, 84, 62, -1, 58, -1, - 56, 59, 67, 60, -1, -1, -1, 50, 59, 51, - 90, 64, 88, 52, 91, 64, 89, 60, -1, 58, - -1, 57, -1, -1, -1, -1, -1, 37, 59, 38, - 97, 64, 93, 39, 98, 64, 94, 40, 99, 64, - 95, 41, 100, 64, 96, 60, -1, 42, -1, 58, - -1, 43, -1, 44, -1, 45, -1, 46, -1, 47, - -1, 48, -1, 49, -1, -1, 54, 59, 69, 64, - 102, 103, 60, -1, -1, 103, 104, -1, -1, 106, - 105, 107, 64, -1, 57, -1, 58, -1 -}; - -/* YYRLINE[YYN] -- source line where rule number YYN was defined. */ + /* YYRLINE[YYN] -- Source line where rule number YYN was defined. */ static const yytype_uint16 yyrline[] = { 0, 102, 102, 103, 105, 106, 107, 108, 110, 111, @@ -656,13 +621,13 @@ static const char *const yytname[] = "dimsize", "vlen_type", "opaque_type", "@6", "$@7", "opaque_size", "opaque_tag", "string_type", "$@8", "$@9", "$@10", "@11", "strsize", "strpad", "cset", "ctype", "enum_type", "$@12", "enum_list", "enum_def", - "$@13", "enum_symbol", "enum_val", YY_NULL + "$@13", "enum_symbol", "enum_val", YY_NULLPTR }; #endif # ifdef YYPRINT -/* YYTOKNUM[YYLEX-NUM] -- Internal token number corresponding to - token YYLEX-NUM. */ +/* YYTOKNUM[NUM] -- (External) token number corresponding to the + (internal) symbol number NUM (which must be that of a token). */ static const yytype_uint16 yytoknum[] = { 0, 256, 257, 258, 259, 260, 261, 262, 263, 264, @@ -675,70 +640,18 @@ static const yytype_uint16 yytoknum[] = }; # endif -/* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */ -static const yytype_uint8 yyr1[] = -{ - 0, 65, 66, 66, 67, 67, 67, 67, 68, 68, - 68, 68, 68, 69, 69, 69, 69, 69, 69, 69, - 69, 69, 69, 69, 69, 69, 69, 69, 69, 69, - 69, 69, 69, 69, 69, 69, 69, 69, 69, 69, - 70, 70, 70, 70, 70, 70, 70, 72, 71, 73, - 73, 75, 74, 76, 77, 77, 78, 80, 79, 81, - 81, 83, 84, 82, 85, 86, 88, 89, 87, 90, - 91, 93, 94, 95, 96, 92, 97, 97, 98, 98, - 98, 99, 99, 100, 100, 102, 101, 103, 103, 105, - 104, 106, 107 -}; +#define YYPACT_NINF -25 -/* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN. */ -static const yytype_uint8 yyr2[] = -{ - 0, 2, 0, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 0, 5, 0, - 2, 0, 5, 1, 0, 2, 1, 0, 6, 0, - 2, 0, 0, 5, 1, 4, 0, 0, 11, 1, - 1, 0, 0, 0, 0, 19, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 0, 7, 0, 2, 0, - 4, 1, 1 -}; +#define yypact_value_is_default(Yystate) \ + (!!((Yystate) == (-25))) -/* YYDEFACT[STATE-NAME] -- Default reduction number in state STATE-NUM. - Performed when YYTABLE doesn't specify something else to do. Zero - means the default is an error. */ -static const yytype_uint8 yydefact[] = -{ - 2, 13, 14, 15, 16, 17, 18, 19, 20, 21, - 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, - 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, - 42, 43, 44, 45, 46, 0, 0, 47, 0, 57, - 0, 0, 3, 4, 8, 9, 5, 6, 7, 12, - 10, 11, 0, 0, 0, 0, 0, 0, 1, 0, - 0, 49, 0, 59, 0, 76, 77, 0, 69, 0, - 0, 85, 0, 65, 71, 66, 48, 51, 50, 87, - 61, 0, 60, 0, 0, 0, 0, 0, 58, 0, - 0, 53, 54, 91, 86, 88, 89, 64, 62, 78, - 79, 80, 0, 70, 0, 0, 0, 0, 0, 72, - 67, 56, 55, 52, 92, 0, 63, 0, 0, 90, - 0, 68, 81, 82, 0, 73, 0, 0, 83, 84, - 0, 74, 0, 75 -}; +#define YYTABLE_NINF -1 -/* YYDEFGOTO[NTERM-NUM]. */ -static const yytype_int16 yydefgoto[] = -{ - -1, 41, 42, 43, 44, 45, 46, 54, 70, 78, - 85, 92, 106, 112, 47, 56, 72, 82, 87, 108, - 98, 48, 49, 84, 118, 69, 104, 50, 83, 117, - 126, 132, 67, 102, 124, 130, 51, 79, 86, 95, - 107, 96, 115 -}; +#define yytable_value_is_error(Yytable_value) \ + 0 -/* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing - STATE-NUM. */ -#define YYPACT_NINF -25 + /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing + STATE-NUM. */ static const yytype_int16 yypact[] = { 114, -25, -25, -25, -25, -25, -25, -25, -25, -25, @@ -757,7 +670,28 @@ static const yytype_int16 yypact[] = 101, -25, 103, -25 }; -/* YYPGOTO[NTERM-NUM]. */ + /* YYDEFACT[STATE-NUM] -- Default reduction number in state STATE-NUM. + Performed when YYTABLE does not specify something else to do. Zero + means the default is an error. */ +static const yytype_uint8 yydefact[] = +{ + 2, 13, 14, 15, 16, 17, 18, 19, 20, 21, + 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, + 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, + 42, 43, 44, 45, 46, 0, 0, 47, 0, 57, + 0, 0, 3, 4, 8, 9, 5, 6, 7, 12, + 10, 11, 0, 0, 0, 0, 0, 0, 1, 0, + 0, 49, 0, 59, 0, 76, 77, 0, 69, 0, + 0, 85, 0, 65, 71, 66, 48, 51, 50, 87, + 61, 0, 60, 0, 0, 0, 0, 0, 58, 0, + 0, 53, 54, 91, 86, 88, 89, 64, 62, 78, + 79, 80, 0, 70, 0, 0, 0, 0, 0, 72, + 67, 56, 55, 52, 92, 0, 63, 0, 0, 90, + 0, 68, 81, 82, 0, 73, 0, 0, 83, 84, + 0, 74, 0, 75 +}; + + /* YYPGOTO[NTERM-NUM]. */ static const yytype_int8 yypgoto[] = { -25, -25, -15, -25, 111, -25, -25, -25, -25, -25, @@ -767,10 +701,19 @@ static const yytype_int8 yypgoto[] = -25, -25, -25 }; -/* YYTABLE[YYPACT[STATE-NUM]]. What to do in state STATE-NUM. If - positive, shift that token. If negative, reduce the rule which - number is the opposite. If YYTABLE_NINF, syntax error. */ -#define YYTABLE_NINF -1 + /* YYDEFGOTO[NTERM-NUM]. */ +static const yytype_int16 yydefgoto[] = +{ + -1, 41, 42, 43, 44, 45, 46, 54, 70, 78, + 85, 92, 106, 112, 47, 56, 72, 82, 87, 108, + 98, 48, 49, 84, 118, 69, 104, 50, 83, 117, + 126, 132, 67, 102, 124, 130, 51, 79, 86, 95, + 107, 96, 115 +}; + + /* YYTABLE[YYPACT[STATE-NUM]] -- What to do in state STATE-NUM. If + positive, shift that token. If negative, reduce the rule whose + number is the opposite. If YYTABLE_NINF, syntax error. */ static const yytype_uint8 yytable[] = { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, @@ -795,12 +738,6 @@ static const yytype_uint8 yytable[] = 20, 21, 22, 23, 24, 25, 26, 27 }; -#define yypact_value_is_default(Yystate) \ - (!!((Yystate) == (-25))) - -#define yytable_value_is_error(Yytable_value) \ - YYID (0) - static const yytype_uint8 yycheck[] = { 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, @@ -825,8 +762,8 @@ static const yytype_uint8 yycheck[] = 22, 23, 24, 25, 26, 27, 28, 29 }; -/* YYSTOS[STATE-NUM] -- The (internal number of the) accessing - symbol of state STATE-NUM. */ + /* YYSTOS[STATE-NUM] -- The (internal number of the) accessing + symbol of state STATE-NUM. */ static const yytype_uint8 yystos[] = { 0, 3, 4, 5, 6, 7, 8, 9, 10, 11, @@ -845,30 +782,46 @@ static const yytype_uint8 yystos[] = 100, 64, 96, 60 }; -#define yyerrok (yyerrstatus = 0) -#define yyclearin (yychar = YYEMPTY) -#define YYEMPTY (-2) -#define YYEOF 0 - -#define YYACCEPT goto yyacceptlab -#define YYABORT goto yyabortlab -#define YYERROR goto yyerrorlab - - -/* Like YYERROR except do call yyerror. This remains here temporarily - to ease the transition to the new meaning of YYERROR, for GCC. - Once GCC version 2 has supplanted version 1, this can go. However, - YYFAIL appears to be in use. Nevertheless, it is formally deprecated - in Bison 2.4.2's NEWS entry, where a plan to phase it out is - discussed. */ - -#define YYFAIL goto yyerrlab -#if defined YYFAIL - /* This is here to suppress warnings from the GCC cpp's - -Wunused-macros. Normally we don't worry about that warning, but - some users do, and we want to make it easy for users to remove - YYFAIL uses, which will produce warnings from Bison 2.5. */ -#endif + /* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */ +static const yytype_uint8 yyr1[] = +{ + 0, 65, 66, 66, 67, 67, 67, 67, 68, 68, + 68, 68, 68, 69, 69, 69, 69, 69, 69, 69, + 69, 69, 69, 69, 69, 69, 69, 69, 69, 69, + 69, 69, 69, 69, 69, 69, 69, 69, 69, 69, + 70, 70, 70, 70, 70, 70, 70, 72, 71, 73, + 73, 75, 74, 76, 77, 77, 78, 80, 79, 81, + 81, 83, 84, 82, 85, 86, 88, 89, 87, 90, + 91, 93, 94, 95, 96, 92, 97, 97, 98, 98, + 98, 99, 99, 100, 100, 102, 101, 103, 103, 105, + 104, 106, 107 +}; + + /* YYR2[YYN] -- Number of symbols on the right hand side of rule YYN. */ +static const yytype_uint8 yyr2[] = +{ + 0, 2, 0, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 0, 5, 0, + 2, 0, 5, 1, 0, 2, 1, 0, 6, 0, + 2, 0, 0, 5, 1, 4, 0, 0, 11, 1, + 1, 0, 0, 0, 0, 19, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 0, 7, 0, 2, 0, + 4, 1, 1 +}; + + +#define yyerrok (yyerrstatus = 0) +#define yyclearin (yychar = YYEMPTY) +#define YYEMPTY (-2) +#define YYEOF 0 + +#define YYACCEPT goto yyacceptlab +#define YYABORT goto yyabortlab +#define YYERROR goto yyerrorlab + #define YYRECOVERING() (!!yyerrstatus) @@ -885,28 +838,16 @@ do \ else \ { \ yyerror (YY_("syntax error: cannot back up")); \ - YYERROR; \ - } \ -while (YYID (0)) + YYERROR; \ + } \ +while (0) /* Error token number */ -#define YYTERROR 1 -#define YYERRCODE 256 - +#define YYTERROR 1 +#define YYERRCODE 256 -/* This macro is provided for backward compatibility. */ -#ifndef YY_LOCATION_PRINT -# define YY_LOCATION_PRINT(File, Loc) ((void) 0) -#endif -/* YYLEX -- calling `yylex' with the right arguments. */ -#ifdef YYLEX_PARAM -# define YYLEX yylex (YYLEX_PARAM) -#else -# define YYLEX yylex () -#endif - /* Enable debugging if requested. */ #if YYDEBUG @@ -915,40 +856,36 @@ while (YYID (0)) # define YYFPRINTF fprintf # endif -# define YYDPRINTF(Args) \ -do { \ - if (yydebug) \ - YYFPRINTF Args; \ -} while (YYID (0)) +# define YYDPRINTF(Args) \ +do { \ + if (yydebug) \ + YYFPRINTF Args; \ +} while (0) + +/* This macro is provided for backward compatibility. */ +#ifndef YY_LOCATION_PRINT +# define YY_LOCATION_PRINT(File, Loc) ((void) 0) +#endif -# define YY_SYMBOL_PRINT(Title, Type, Value, Location) \ -do { \ - if (yydebug) \ - { \ - YYFPRINTF (stderr, "%s ", Title); \ - yy_symbol_print (stderr, \ - Type, Value); \ - YYFPRINTF (stderr, "\n"); \ - } \ -} while (YYID (0)) +# define YY_SYMBOL_PRINT(Title, Type, Value, Location) \ +do { \ + if (yydebug) \ + { \ + YYFPRINTF (stderr, "%s ", Title); \ + yy_symbol_print (stderr, \ + Type, Value); \ + YYFPRINTF (stderr, "\n"); \ + } \ +} while (0) -/*--------------------------------. -| Print this symbol on YYOUTPUT. | -`--------------------------------*/ -/*ARGSUSED*/ -#if (defined __STDC__ || defined __C99__FUNC__ \ - || defined __cplusplus || defined _MSC_VER) +/*----------------------------------------. +| Print this symbol's value on YYOUTPUT. | +`----------------------------------------*/ + static void yy_symbol_value_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep) -#else -static void -yy_symbol_value_print (yyoutput, yytype, yyvaluep) - FILE *yyoutput; - int yytype; - YYSTYPE const * const yyvaluep; -#endif { FILE *yyo = yyoutput; YYUSE (yyo); @@ -957,14 +894,8 @@ yy_symbol_value_print (yyoutput, yytype, yyvaluep) # ifdef YYPRINT if (yytype < YYNTOKENS) YYPRINT (yyoutput, yytoknum[yytype], *yyvaluep); -# else - YYUSE (yyoutput); # endif - switch (yytype) - { - default: - break; - } + YYUSE (yytype); } @@ -972,22 +903,11 @@ yy_symbol_value_print (yyoutput, yytype, yyvaluep) | Print this symbol on YYOUTPUT. | `--------------------------------*/ -#if (defined __STDC__ || defined __C99__FUNC__ \ - || defined __cplusplus || defined _MSC_VER) static void yy_symbol_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep) -#else -static void -yy_symbol_print (yyoutput, yytype, yyvaluep) - FILE *yyoutput; - int yytype; - YYSTYPE const * const yyvaluep; -#endif { - if (yytype < YYNTOKENS) - YYFPRINTF (yyoutput, "token %s (", yytname[yytype]); - else - YYFPRINTF (yyoutput, "nterm %s (", yytname[yytype]); + YYFPRINTF (yyoutput, "%s %s (", + yytype < YYNTOKENS ? "token" : "nterm", yytname[yytype]); yy_symbol_value_print (yyoutput, yytype, yyvaluep); YYFPRINTF (yyoutput, ")"); @@ -998,16 +918,8 @@ yy_symbol_print (yyoutput, yytype, yyvaluep) | TOP (included). | `------------------------------------------------------------------*/ -#if (defined __STDC__ || defined __C99__FUNC__ \ - || defined __cplusplus || defined _MSC_VER) static void yy_stack_print (yytype_int16 *yybottom, yytype_int16 *yytop) -#else -static void -yy_stack_print (yybottom, yytop) - yytype_int16 *yybottom; - yytype_int16 *yytop; -#endif { YYFPRINTF (stderr, "Stack now"); for (; yybottom <= yytop; yybottom++) @@ -1018,49 +930,42 @@ yy_stack_print (yybottom, yytop) YYFPRINTF (stderr, "\n"); } -# define YY_STACK_PRINT(Bottom, Top) \ -do { \ - if (yydebug) \ - yy_stack_print ((Bottom), (Top)); \ -} while (YYID (0)) +# define YY_STACK_PRINT(Bottom, Top) \ +do { \ + if (yydebug) \ + yy_stack_print ((Bottom), (Top)); \ +} while (0) /*------------------------------------------------. | Report that the YYRULE is going to be reduced. | `------------------------------------------------*/ -#if (defined __STDC__ || defined __C99__FUNC__ \ - || defined __cplusplus || defined _MSC_VER) -static void -yy_reduce_print (YYSTYPE *yyvsp, int yyrule) -#else static void -yy_reduce_print (yyvsp, yyrule) - YYSTYPE *yyvsp; - int yyrule; -#endif +yy_reduce_print (yytype_int16 *yyssp, YYSTYPE *yyvsp, int yyrule) { + unsigned long int yylno = yyrline[yyrule]; int yynrhs = yyr2[yyrule]; int yyi; - unsigned long int yylno = yyrline[yyrule]; YYFPRINTF (stderr, "Reducing stack by rule %d (line %lu):\n", - yyrule - 1, yylno); + yyrule - 1, yylno); /* The symbols being reduced. */ for (yyi = 0; yyi < yynrhs; yyi++) { YYFPRINTF (stderr, " $%d = ", yyi + 1); - yy_symbol_print (stderr, yyrhs[yyprhs[yyrule] + yyi], - &(yyvsp[(yyi + 1) - (yynrhs)]) - ); + yy_symbol_print (stderr, + yystos[yyssp[yyi + 1 - yynrhs]], + &(yyvsp[(yyi + 1) - (yynrhs)]) + ); YYFPRINTF (stderr, "\n"); } } -# define YY_REDUCE_PRINT(Rule) \ -do { \ - if (yydebug) \ - yy_reduce_print (yyvsp, Rule); \ -} while (YYID (0)) +# define YY_REDUCE_PRINT(Rule) \ +do { \ + if (yydebug) \ + yy_reduce_print (yyssp, yyvsp, Rule); \ +} while (0) /* Nonzero means print parse trace. It is left uninitialized so that multiple parsers can coexist. */ @@ -1074,7 +979,7 @@ int yydebug; /* YYINITDEPTH -- initial size of the parser's stacks. */ -#ifndef YYINITDEPTH +#ifndef YYINITDEPTH # define YYINITDEPTH 200 #endif @@ -1097,15 +1002,8 @@ int yydebug; # define yystrlen strlen # else /* Return the length of YYSTR. */ -#if (defined __STDC__ || defined __C99__FUNC__ \ - || defined __cplusplus || defined _MSC_VER) static YYSIZE_T yystrlen (const char *yystr) -#else -static YYSIZE_T -yystrlen (yystr) - const char *yystr; -#endif { YYSIZE_T yylen; for (yylen = 0; yystr[yylen]; yylen++) @@ -1121,16 +1019,8 @@ yystrlen (yystr) # else /* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in YYDEST. */ -#if (defined __STDC__ || defined __C99__FUNC__ \ - || defined __cplusplus || defined _MSC_VER) static char * yystpcpy (char *yydest, const char *yysrc) -#else -static char * -yystpcpy (yydest, yysrc) - char *yydest; - const char *yysrc; -#endif { char *yyd = yydest; const char *yys = yysrc; @@ -1160,27 +1050,27 @@ yytnamerr (char *yyres, const char *yystr) char const *yyp = yystr; for (;;) - switch (*++yyp) - { - case '\'': - case ',': - goto do_not_strip_quotes; - - case '\\': - if (*++yyp != '\\') - goto do_not_strip_quotes; - /* Fall through. */ - default: - if (yyres) - yyres[yyn] = *yyp; - yyn++; - break; - - case '"': - if (yyres) - yyres[yyn] = '\0'; - return yyn; - } + switch (*++yyp) + { + case '\'': + case ',': + goto do_not_strip_quotes; + + case '\\': + if (*++yyp != '\\') + goto do_not_strip_quotes; + /* Fall through. */ + default: + if (yyres) + yyres[yyn] = *yyp; + yyn++; + break; + + case '"': + if (yyres) + yyres[yyn] = '\0'; + return yyn; + } do_not_strip_quotes: ; } @@ -1203,11 +1093,11 @@ static int yysyntax_error (YYSIZE_T *yymsg_alloc, char **yymsg, yytype_int16 *yyssp, int yytoken) { - YYSIZE_T yysize0 = yytnamerr (YY_NULL, yytname[yytoken]); + YYSIZE_T yysize0 = yytnamerr (YY_NULLPTR, yytname[yytoken]); YYSIZE_T yysize = yysize0; enum { YYERROR_VERBOSE_ARGS_MAXIMUM = 5 }; /* Internationalized format string. */ - const char *yyformat = YY_NULL; + const char *yyformat = YY_NULLPTR; /* Arguments of yyformat. */ char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM]; /* Number of reported tokens (one for the "unexpected", one per @@ -1215,10 +1105,6 @@ yysyntax_error (YYSIZE_T *yymsg_alloc, char **yymsg, int yycount = 0; /* There are many possibilities here to consider: - - Assume YYFAIL is not used. It's too flawed to consider. See - - for details. YYERROR is fine as it does not invoke this - function. - If this state is a consistent state with a default action, then the only way this function was invoked is if the default action is an error action. In that case, don't check for expected @@ -1268,7 +1154,7 @@ yysyntax_error (YYSIZE_T *yymsg_alloc, char **yymsg, } yyarg[yycount++] = yytname[yyx]; { - YYSIZE_T yysize1 = yysize + yytnamerr (YY_NULL, yytname[yyx]); + YYSIZE_T yysize1 = yysize + yytnamerr (YY_NULLPTR, yytname[yyx]); if (! (yysize <= yysize1 && yysize1 <= YYSTACK_ALLOC_MAXIMUM)) return 2; @@ -1335,31 +1221,17 @@ yysyntax_error (YYSIZE_T *yymsg_alloc, char **yymsg, | Release the memory associated to this symbol. | `-----------------------------------------------*/ -/*ARGSUSED*/ -#if (defined __STDC__ || defined __C99__FUNC__ \ - || defined __cplusplus || defined _MSC_VER) static void yydestruct (const char *yymsg, int yytype, YYSTYPE *yyvaluep) -#else -static void -yydestruct (yymsg, yytype, yyvaluep) - const char *yymsg; - int yytype; - YYSTYPE *yyvaluep; -#endif { YYUSE (yyvaluep); - if (!yymsg) yymsg = "Deleting"; YY_SYMBOL_PRINT (yymsg, yytype, yyvaluep, yylocationp); - switch (yytype) - { - - default: - break; - } + YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN + YYUSE (yytype); + YY_IGNORE_MAYBE_UNINITIALIZED_END } @@ -1368,18 +1240,8 @@ yydestruct (yymsg, yytype, yyvaluep) /* The lookahead symbol. */ int yychar; - -#ifndef YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN -# define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN -# define YY_IGNORE_MAYBE_UNINITIALIZED_END -#endif -#ifndef YY_INITIAL_VALUE -# define YY_INITIAL_VALUE(Value) /* Nothing. */ -#endif - /* The semantic value of the lookahead symbol. */ -YYSTYPE yylval YY_INITIAL_VALUE(yyval_default); - +YYSTYPE yylval; /* Number of syntax errors so far. */ int yynerrs; @@ -1388,35 +1250,16 @@ int yynerrs; | yyparse. | `----------*/ -#ifdef YYPARSE_PARAM -#if (defined __STDC__ || defined __C99__FUNC__ \ - || defined __cplusplus || defined _MSC_VER) -hid_t -yyparse (void *YYPARSE_PARAM) -#else -hid_t -yyparse (YYPARSE_PARAM) - void *YYPARSE_PARAM; -#endif -#else /* ! YYPARSE_PARAM */ -#if (defined __STDC__ || defined __C99__FUNC__ \ - || defined __cplusplus || defined _MSC_VER) hid_t yyparse (void) -#else -hid_t -yyparse () - -#endif -#endif { int yystate; /* Number of tokens to shift before error messages enabled. */ int yyerrstatus; /* The stacks and their tools: - `yyss': related to states. - `yyvs': related to semantic values. + 'yyss': related to states. + 'yyvs': related to semantic values. Refer to the stacks through separate pointers, to allow yyoverflow to reallocate them elsewhere. */ @@ -1484,23 +1327,23 @@ yyparse () #ifdef yyoverflow { - /* Give user a chance to reallocate the stack. Use copies of - these so that the &'s don't force the real ones into - memory. */ - YYSTYPE *yyvs1 = yyvs; - yytype_int16 *yyss1 = yyss; - - /* Each stack pointer address is followed by the size of the - data in use in that stack, in bytes. This used to be a - conditional around just the two extra args, but that might - be undefined if yyoverflow is a macro. */ - yyoverflow (YY_("memory exhausted"), - &yyss1, yysize * sizeof (*yyssp), - &yyvs1, yysize * sizeof (*yyvsp), - &yystacksize); - - yyss = yyss1; - yyvs = yyvs1; + /* Give user a chance to reallocate the stack. Use copies of + these so that the &'s don't force the real ones into + memory. */ + YYSTYPE *yyvs1 = yyvs; + yytype_int16 *yyss1 = yyss; + + /* Each stack pointer address is followed by the size of the + data in use in that stack, in bytes. This used to be a + conditional around just the two extra args, but that might + be undefined if yyoverflow is a macro. */ + yyoverflow (YY_("memory exhausted"), + &yyss1, yysize * sizeof (*yyssp), + &yyvs1, yysize * sizeof (*yyvsp), + &yystacksize); + + yyss = yyss1; + yyvs = yyvs1; } #else /* no yyoverflow */ # ifndef YYSTACK_RELOCATE @@ -1508,22 +1351,22 @@ yyparse () # else /* Extend the stack our own way. */ if (YYMAXDEPTH <= yystacksize) - goto yyexhaustedlab; + goto yyexhaustedlab; yystacksize *= 2; if (YYMAXDEPTH < yystacksize) - yystacksize = YYMAXDEPTH; + yystacksize = YYMAXDEPTH; { - yytype_int16 *yyss1 = yyss; - union yyalloc *yyptr = - (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize)); - if (! yyptr) - goto yyexhaustedlab; - YYSTACK_RELOCATE (yyss_alloc, yyss); - YYSTACK_RELOCATE (yyvs_alloc, yyvs); + yytype_int16 *yyss1 = yyss; + union yyalloc *yyptr = + (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize)); + if (! yyptr) + goto yyexhaustedlab; + YYSTACK_RELOCATE (yyss_alloc, yyss); + YYSTACK_RELOCATE (yyvs_alloc, yyvs); # undef YYSTACK_RELOCATE - if (yyss1 != yyssa) - YYSTACK_FREE (yyss1); + if (yyss1 != yyssa) + YYSTACK_FREE (yyss1); } # endif #endif /* no yyoverflow */ @@ -1532,10 +1375,10 @@ yyparse () yyvsp = yyvs + yysize - 1; YYDPRINTF ((stderr, "Stack size increased to %lu\n", - (unsigned long int) yystacksize)); + (unsigned long int) yystacksize)); if (yyss + yystacksize - 1 <= yyssp) - YYABORT; + YYABORT; } YYDPRINTF ((stderr, "Entering state %d\n", yystate)); @@ -1564,7 +1407,7 @@ yyparse () if (yychar == YYEMPTY) { YYDPRINTF ((stderr, "Reading a token: ")); - yychar = YYLEX; + yychar = yylex (); } if (yychar <= YYEOF) @@ -1629,7 +1472,7 @@ yyparse () yylen = yyr2[yyn]; /* If YYLEN is nonzero, implement the default value of the action: - `$$ = $1'. + '$$ = $1'. Otherwise, the following line sets YYVAL to garbage. This behavior is undocumented and Bison @@ -1643,419 +1486,418 @@ yyparse () switch (yyn) { case 2: -/* Line 1792 of yacc.c */ -#line 102 "hl/src//H5LTparse.y" +#line 102 "hl/src/H5LTparse.y" /* yacc.c:1646 */ { memset(arr_stack, 0, STACK_SIZE*sizeof(struct arr_info)); /*initialize here?*/ } +#line 1462 "hl/src/H5LTparse.c" /* yacc.c:1646 */ break; case 3: -/* Line 1792 of yacc.c */ -#line 103 "hl/src//H5LTparse.y" +#line 103 "hl/src/H5LTparse.y" /* yacc.c:1646 */ { return (yyval.hid);} +#line 1468 "hl/src/H5LTparse.c" /* yacc.c:1646 */ break; case 13: -/* Line 1792 of yacc.c */ -#line 117 "hl/src//H5LTparse.y" +#line 117 "hl/src/H5LTparse.y" /* yacc.c:1646 */ { (yyval.hid) = H5Tcopy(H5T_STD_I8BE); } +#line 1474 "hl/src/H5LTparse.c" /* yacc.c:1646 */ break; case 14: -/* Line 1792 of yacc.c */ -#line 118 "hl/src//H5LTparse.y" +#line 118 "hl/src/H5LTparse.y" /* yacc.c:1646 */ { (yyval.hid) = H5Tcopy(H5T_STD_I8LE); } +#line 1480 "hl/src/H5LTparse.c" /* yacc.c:1646 */ break; case 15: -/* Line 1792 of yacc.c */ -#line 119 "hl/src//H5LTparse.y" +#line 119 "hl/src/H5LTparse.y" /* yacc.c:1646 */ { (yyval.hid) = H5Tcopy(H5T_STD_I16BE); } +#line 1486 "hl/src/H5LTparse.c" /* yacc.c:1646 */ break; case 16: -/* Line 1792 of yacc.c */ -#line 120 "hl/src//H5LTparse.y" +#line 120 "hl/src/H5LTparse.y" /* yacc.c:1646 */ { (yyval.hid) = H5Tcopy(H5T_STD_I16LE); } +#line 1492 "hl/src/H5LTparse.c" /* yacc.c:1646 */ break; case 17: -/* Line 1792 of yacc.c */ -#line 121 "hl/src//H5LTparse.y" +#line 121 "hl/src/H5LTparse.y" /* yacc.c:1646 */ { (yyval.hid) = H5Tcopy(H5T_STD_I32BE); } +#line 1498 "hl/src/H5LTparse.c" /* yacc.c:1646 */ break; case 18: -/* Line 1792 of yacc.c */ -#line 122 "hl/src//H5LTparse.y" +#line 122 "hl/src/H5LTparse.y" /* yacc.c:1646 */ { (yyval.hid) = H5Tcopy(H5T_STD_I32LE); } +#line 1504 "hl/src/H5LTparse.c" /* yacc.c:1646 */ break; case 19: -/* Line 1792 of yacc.c */ -#line 123 "hl/src//H5LTparse.y" +#line 123 "hl/src/H5LTparse.y" /* yacc.c:1646 */ { (yyval.hid) = H5Tcopy(H5T_STD_I64BE); } +#line 1510 "hl/src/H5LTparse.c" /* yacc.c:1646 */ break; case 20: -/* Line 1792 of yacc.c */ -#line 124 "hl/src//H5LTparse.y" +#line 124 "hl/src/H5LTparse.y" /* yacc.c:1646 */ { (yyval.hid) = H5Tcopy(H5T_STD_I64LE); } +#line 1516 "hl/src/H5LTparse.c" /* yacc.c:1646 */ break; case 21: -/* Line 1792 of yacc.c */ -#line 125 "hl/src//H5LTparse.y" +#line 125 "hl/src/H5LTparse.y" /* yacc.c:1646 */ { (yyval.hid) = H5Tcopy(H5T_STD_U8BE); } +#line 1522 "hl/src/H5LTparse.c" /* yacc.c:1646 */ break; case 22: -/* Line 1792 of yacc.c */ -#line 126 "hl/src//H5LTparse.y" +#line 126 "hl/src/H5LTparse.y" /* yacc.c:1646 */ { (yyval.hid) = H5Tcopy(H5T_STD_U8LE); } +#line 1528 "hl/src/H5LTparse.c" /* yacc.c:1646 */ break; case 23: -/* Line 1792 of yacc.c */ -#line 127 "hl/src//H5LTparse.y" +#line 127 "hl/src/H5LTparse.y" /* yacc.c:1646 */ { (yyval.hid) = H5Tcopy(H5T_STD_U16BE); } +#line 1534 "hl/src/H5LTparse.c" /* yacc.c:1646 */ break; case 24: -/* Line 1792 of yacc.c */ -#line 128 "hl/src//H5LTparse.y" +#line 128 "hl/src/H5LTparse.y" /* yacc.c:1646 */ { (yyval.hid) = H5Tcopy(H5T_STD_U16LE); } +#line 1540 "hl/src/H5LTparse.c" /* yacc.c:1646 */ break; case 25: -/* Line 1792 of yacc.c */ -#line 129 "hl/src//H5LTparse.y" +#line 129 "hl/src/H5LTparse.y" /* yacc.c:1646 */ { (yyval.hid) = H5Tcopy(H5T_STD_U32BE); } +#line 1546 "hl/src/H5LTparse.c" /* yacc.c:1646 */ break; case 26: -/* Line 1792 of yacc.c */ -#line 130 "hl/src//H5LTparse.y" +#line 130 "hl/src/H5LTparse.y" /* yacc.c:1646 */ { (yyval.hid) = H5Tcopy(H5T_STD_U32LE); } +#line 1552 "hl/src/H5LTparse.c" /* yacc.c:1646 */ break; case 27: -/* Line 1792 of yacc.c */ -#line 131 "hl/src//H5LTparse.y" +#line 131 "hl/src/H5LTparse.y" /* yacc.c:1646 */ { (yyval.hid) = H5Tcopy(H5T_STD_U64BE); } +#line 1558 "hl/src/H5LTparse.c" /* yacc.c:1646 */ break; case 28: -/* Line 1792 of yacc.c */ -#line 132 "hl/src//H5LTparse.y" +#line 132 "hl/src/H5LTparse.y" /* yacc.c:1646 */ { (yyval.hid) = H5Tcopy(H5T_STD_U64LE); } +#line 1564 "hl/src/H5LTparse.c" /* yacc.c:1646 */ break; case 29: -/* Line 1792 of yacc.c */ -#line 133 "hl/src//H5LTparse.y" +#line 133 "hl/src/H5LTparse.y" /* yacc.c:1646 */ { (yyval.hid) = H5Tcopy(H5T_NATIVE_CHAR); } +#line 1570 "hl/src/H5LTparse.c" /* yacc.c:1646 */ break; case 30: -/* Line 1792 of yacc.c */ -#line 134 "hl/src//H5LTparse.y" +#line 134 "hl/src/H5LTparse.y" /* yacc.c:1646 */ { (yyval.hid) = H5Tcopy(H5T_NATIVE_SCHAR); } +#line 1576 "hl/src/H5LTparse.c" /* yacc.c:1646 */ break; case 31: -/* Line 1792 of yacc.c */ -#line 135 "hl/src//H5LTparse.y" +#line 135 "hl/src/H5LTparse.y" /* yacc.c:1646 */ { (yyval.hid) = H5Tcopy(H5T_NATIVE_UCHAR); } +#line 1582 "hl/src/H5LTparse.c" /* yacc.c:1646 */ break; case 32: -/* Line 1792 of yacc.c */ -#line 136 "hl/src//H5LTparse.y" +#line 136 "hl/src/H5LTparse.y" /* yacc.c:1646 */ { (yyval.hid) = H5Tcopy(H5T_NATIVE_SHORT); } +#line 1588 "hl/src/H5LTparse.c" /* yacc.c:1646 */ break; case 33: -/* Line 1792 of yacc.c */ -#line 137 "hl/src//H5LTparse.y" +#line 137 "hl/src/H5LTparse.y" /* yacc.c:1646 */ { (yyval.hid) = H5Tcopy(H5T_NATIVE_USHORT); } +#line 1594 "hl/src/H5LTparse.c" /* yacc.c:1646 */ break; case 34: -/* Line 1792 of yacc.c */ -#line 138 "hl/src//H5LTparse.y" +#line 138 "hl/src/H5LTparse.y" /* yacc.c:1646 */ { (yyval.hid) = H5Tcopy(H5T_NATIVE_INT); } +#line 1600 "hl/src/H5LTparse.c" /* yacc.c:1646 */ break; case 35: -/* Line 1792 of yacc.c */ -#line 139 "hl/src//H5LTparse.y" +#line 139 "hl/src/H5LTparse.y" /* yacc.c:1646 */ { (yyval.hid) = H5Tcopy(H5T_NATIVE_UINT); } +#line 1606 "hl/src/H5LTparse.c" /* yacc.c:1646 */ break; case 36: -/* Line 1792 of yacc.c */ -#line 140 "hl/src//H5LTparse.y" +#line 140 "hl/src/H5LTparse.y" /* yacc.c:1646 */ { (yyval.hid) = H5Tcopy(H5T_NATIVE_LONG); } +#line 1612 "hl/src/H5LTparse.c" /* yacc.c:1646 */ break; case 37: -/* Line 1792 of yacc.c */ -#line 141 "hl/src//H5LTparse.y" +#line 141 "hl/src/H5LTparse.y" /* yacc.c:1646 */ { (yyval.hid) = H5Tcopy(H5T_NATIVE_ULONG); } +#line 1618 "hl/src/H5LTparse.c" /* yacc.c:1646 */ break; case 38: -/* Line 1792 of yacc.c */ -#line 142 "hl/src//H5LTparse.y" +#line 142 "hl/src/H5LTparse.y" /* yacc.c:1646 */ { (yyval.hid) = H5Tcopy(H5T_NATIVE_LLONG); } +#line 1624 "hl/src/H5LTparse.c" /* yacc.c:1646 */ break; case 39: -/* Line 1792 of yacc.c */ -#line 143 "hl/src//H5LTparse.y" +#line 143 "hl/src/H5LTparse.y" /* yacc.c:1646 */ { (yyval.hid) = H5Tcopy(H5T_NATIVE_ULLONG); } +#line 1630 "hl/src/H5LTparse.c" /* yacc.c:1646 */ break; case 40: -/* Line 1792 of yacc.c */ -#line 146 "hl/src//H5LTparse.y" +#line 146 "hl/src/H5LTparse.y" /* yacc.c:1646 */ { (yyval.hid) = H5Tcopy(H5T_IEEE_F32BE); } +#line 1636 "hl/src/H5LTparse.c" /* yacc.c:1646 */ break; case 41: -/* Line 1792 of yacc.c */ -#line 147 "hl/src//H5LTparse.y" +#line 147 "hl/src/H5LTparse.y" /* yacc.c:1646 */ { (yyval.hid) = H5Tcopy(H5T_IEEE_F32LE); } +#line 1642 "hl/src/H5LTparse.c" /* yacc.c:1646 */ break; case 42: -/* Line 1792 of yacc.c */ -#line 148 "hl/src//H5LTparse.y" +#line 148 "hl/src/H5LTparse.y" /* yacc.c:1646 */ { (yyval.hid) = H5Tcopy(H5T_IEEE_F64BE); } +#line 1648 "hl/src/H5LTparse.c" /* yacc.c:1646 */ break; case 43: -/* Line 1792 of yacc.c */ -#line 149 "hl/src//H5LTparse.y" +#line 149 "hl/src/H5LTparse.y" /* yacc.c:1646 */ { (yyval.hid) = H5Tcopy(H5T_IEEE_F64LE); } +#line 1654 "hl/src/H5LTparse.c" /* yacc.c:1646 */ break; case 44: -/* Line 1792 of yacc.c */ -#line 150 "hl/src//H5LTparse.y" +#line 150 "hl/src/H5LTparse.y" /* yacc.c:1646 */ { (yyval.hid) = H5Tcopy(H5T_NATIVE_FLOAT); } +#line 1660 "hl/src/H5LTparse.c" /* yacc.c:1646 */ break; case 45: -/* Line 1792 of yacc.c */ -#line 151 "hl/src//H5LTparse.y" +#line 151 "hl/src/H5LTparse.y" /* yacc.c:1646 */ { (yyval.hid) = H5Tcopy(H5T_NATIVE_DOUBLE); } +#line 1666 "hl/src/H5LTparse.c" /* yacc.c:1646 */ break; case 46: -/* Line 1792 of yacc.c */ -#line 152 "hl/src//H5LTparse.y" +#line 152 "hl/src/H5LTparse.y" /* yacc.c:1646 */ { (yyval.hid) = H5Tcopy(H5T_NATIVE_LDOUBLE); } +#line 1672 "hl/src/H5LTparse.c" /* yacc.c:1646 */ break; case 47: -/* Line 1792 of yacc.c */ -#line 156 "hl/src//H5LTparse.y" +#line 156 "hl/src/H5LTparse.y" /* yacc.c:1646 */ { csindex++; cmpd_stack[csindex].id = H5Tcreate(H5T_COMPOUND, 1); /*temporarily set size to 1*/ } +#line 1678 "hl/src/H5LTparse.c" /* yacc.c:1646 */ break; case 48: -/* Line 1792 of yacc.c */ -#line 158 "hl/src//H5LTparse.y" +#line 158 "hl/src/H5LTparse.y" /* yacc.c:1646 */ { (yyval.hid) = cmpd_stack[csindex].id; cmpd_stack[csindex].id = 0; cmpd_stack[csindex].first_memb = 1; csindex--; } +#line 1688 "hl/src/H5LTparse.c" /* yacc.c:1646 */ break; case 51: -/* Line 1792 of yacc.c */ -#line 167 "hl/src//H5LTparse.y" +#line 167 "hl/src/H5LTparse.y" /* yacc.c:1646 */ { cmpd_stack[csindex].is_field = 1; /*notify lexer a compound member is parsed*/ } +#line 1694 "hl/src/H5LTparse.c" /* yacc.c:1646 */ break; case 52: -/* Line 1792 of yacc.c */ -#line 169 "hl/src//H5LTparse.y" +#line 169 "hl/src/H5LTparse.y" /* yacc.c:1646 */ { size_t origin_size, new_size; hid_t dtype_id = cmpd_stack[csindex].id; /*Adjust size and insert member, consider both member size and offset.*/ if(cmpd_stack[csindex].first_memb) { /*reclaim the size 1 temporarily set*/ - new_size = H5Tget_size((yyvsp[(1) - (5)].hid)) + (yyvsp[(4) - (5)].ival); + new_size = H5Tget_size((yyvsp[-4].hid)) + (yyvsp[-1].ival); H5Tset_size(dtype_id, new_size); /*member name is saved in yylval.sval by lexer*/ - H5Tinsert(dtype_id, (yyvsp[(3) - (5)].sval), (yyvsp[(4) - (5)].ival), (yyvsp[(1) - (5)].hid)); + H5Tinsert(dtype_id, (yyvsp[-2].sval), (yyvsp[-1].ival), (yyvsp[-4].hid)); cmpd_stack[csindex].first_memb = 0; } else { origin_size = H5Tget_size(dtype_id); - if((yyvsp[(4) - (5)].ival) == 0) { - new_size = origin_size + H5Tget_size((yyvsp[(1) - (5)].hid)); + if((yyvsp[-1].ival) == 0) { + new_size = origin_size + H5Tget_size((yyvsp[-4].hid)); H5Tset_size(dtype_id, new_size); - H5Tinsert(dtype_id, (yyvsp[(3) - (5)].sval), origin_size, (yyvsp[(1) - (5)].hid)); + H5Tinsert(dtype_id, (yyvsp[-2].sval), origin_size, (yyvsp[-4].hid)); } else { - new_size = (yyvsp[(4) - (5)].ival) + H5Tget_size((yyvsp[(1) - (5)].hid)); + new_size = (yyvsp[-1].ival) + H5Tget_size((yyvsp[-4].hid)); H5Tset_size(dtype_id, new_size); - H5Tinsert(dtype_id, (yyvsp[(3) - (5)].sval), (yyvsp[(4) - (5)].ival), (yyvsp[(1) - (5)].hid)); + H5Tinsert(dtype_id, (yyvsp[-2].sval), (yyvsp[-1].ival), (yyvsp[-4].hid)); } } - if((yyvsp[(3) - (5)].sval)) { - HDfree((yyvsp[(3) - (5)].sval)); - (yyvsp[(3) - (5)].sval) = NULL; + if((yyvsp[-2].sval)) { + HDfree((yyvsp[-2].sval)); + (yyvsp[-2].sval) = NULL; } cmpd_stack[csindex].is_field = 0; - H5Tclose((yyvsp[(1) - (5)].hid)); + H5Tclose((yyvsp[-4].hid)); new_size = H5Tget_size(dtype_id); } +#line 1733 "hl/src/H5LTparse.c" /* yacc.c:1646 */ break; case 53: -/* Line 1792 of yacc.c */ -#line 205 "hl/src//H5LTparse.y" +#line 205 "hl/src/H5LTparse.y" /* yacc.c:1646 */ { (yyval.sval) = HDstrdup(yylval.sval); HDfree(yylval.sval); yylval.sval = NULL; } +#line 1743 "hl/src/H5LTparse.c" /* yacc.c:1646 */ break; case 54: -/* Line 1792 of yacc.c */ -#line 212 "hl/src//H5LTparse.y" +#line 212 "hl/src/H5LTparse.y" /* yacc.c:1646 */ { (yyval.ival) = 0; } +#line 1749 "hl/src/H5LTparse.c" /* yacc.c:1646 */ break; case 55: -/* Line 1792 of yacc.c */ -#line 214 "hl/src//H5LTparse.y" +#line 214 "hl/src/H5LTparse.y" /* yacc.c:1646 */ { (yyval.ival) = yylval.ival; } +#line 1755 "hl/src/H5LTparse.c" /* yacc.c:1646 */ break; case 57: -/* Line 1792 of yacc.c */ -#line 218 "hl/src//H5LTparse.y" +#line 218 "hl/src/H5LTparse.y" /* yacc.c:1646 */ { asindex++; /*pushd onto the stack*/ } +#line 1761 "hl/src/H5LTparse.c" /* yacc.c:1646 */ break; case 58: -/* Line 1792 of yacc.c */ -#line 220 "hl/src//H5LTparse.y" +#line 220 "hl/src/H5LTparse.y" /* yacc.c:1646 */ { - (yyval.hid) = H5Tarray_create2((yyvsp[(5) - (6)].hid), arr_stack[asindex].ndims, arr_stack[asindex].dims); + (yyval.hid) = H5Tarray_create2((yyvsp[-1].hid), arr_stack[asindex].ndims, arr_stack[asindex].dims); arr_stack[asindex].ndims = 0; asindex--; - H5Tclose((yyvsp[(5) - (6)].hid)); + H5Tclose((yyvsp[-1].hid)); } +#line 1772 "hl/src/H5LTparse.c" /* yacc.c:1646 */ break; case 61: -/* Line 1792 of yacc.c */ -#line 230 "hl/src//H5LTparse.y" +#line 230 "hl/src/H5LTparse.y" /* yacc.c:1646 */ { arr_stack[asindex].is_dim = 1; /*notice lexer of dimension size*/ } +#line 1778 "hl/src/H5LTparse.c" /* yacc.c:1646 */ break; case 62: -/* Line 1792 of yacc.c */ -#line 231 "hl/src//H5LTparse.y" +#line 231 "hl/src/H5LTparse.y" /* yacc.c:1646 */ { unsigned ndims = arr_stack[asindex].ndims; arr_stack[asindex].dims[ndims] = (hsize_t)yylval.ival; arr_stack[asindex].ndims++; arr_stack[asindex].is_dim = 0; } +#line 1788 "hl/src/H5LTparse.c" /* yacc.c:1646 */ break; case 65: -/* Line 1792 of yacc.c */ -#line 242 "hl/src//H5LTparse.y" - { (yyval.hid) = H5Tvlen_create((yyvsp[(3) - (4)].hid)); H5Tclose((yyvsp[(3) - (4)].hid)); } +#line 242 "hl/src/H5LTparse.y" /* yacc.c:1646 */ + { (yyval.hid) = H5Tvlen_create((yyvsp[-1].hid)); H5Tclose((yyvsp[-1].hid)); } +#line 1794 "hl/src/H5LTparse.c" /* yacc.c:1646 */ break; case 66: -/* Line 1792 of yacc.c */ -#line 248 "hl/src//H5LTparse.y" +#line 248 "hl/src/H5LTparse.y" /* yacc.c:1646 */ { size_t size = (size_t)yylval.ival; (yyval.hid) = H5Tcreate(H5T_OPAQUE, size); } +#line 1803 "hl/src/H5LTparse.c" /* yacc.c:1646 */ break; case 67: -/* Line 1792 of yacc.c */ -#line 253 "hl/src//H5LTparse.y" +#line 253 "hl/src/H5LTparse.y" /* yacc.c:1646 */ { - H5Tset_tag((yyvsp[(6) - (9)].hid), yylval.sval); + H5Tset_tag((yyvsp[-3].hid), yylval.sval); HDfree(yylval.sval); yylval.sval = NULL; } +#line 1813 "hl/src/H5LTparse.c" /* yacc.c:1646 */ break; case 68: -/* Line 1792 of yacc.c */ -#line 258 "hl/src//H5LTparse.y" - { (yyval.hid) = (yyvsp[(6) - (11)].hid); } +#line 258 "hl/src/H5LTparse.y" /* yacc.c:1646 */ + { (yyval.hid) = (yyvsp[-5].hid); } +#line 1819 "hl/src/H5LTparse.c" /* yacc.c:1646 */ break; case 71: -/* Line 1792 of yacc.c */ -#line 267 "hl/src//H5LTparse.y" +#line 267 "hl/src/H5LTparse.y" /* yacc.c:1646 */ { - if((yyvsp[(4) - (5)].ival) == H5T_VARIABLE_TOKEN) + if((yyvsp[-1].ival) == H5T_VARIABLE_TOKEN) is_variable = 1; else str_size = yylval.ival; } +#line 1830 "hl/src/H5LTparse.c" /* yacc.c:1646 */ break; case 72: -/* Line 1792 of yacc.c */ -#line 274 "hl/src//H5LTparse.y" +#line 274 "hl/src/H5LTparse.y" /* yacc.c:1646 */ { - if((yyvsp[(8) - (9)].ival) == H5T_STR_NULLTERM_TOKEN) + if((yyvsp[-1].ival) == H5T_STR_NULLTERM_TOKEN) str_pad = H5T_STR_NULLTERM; - else if((yyvsp[(8) - (9)].ival) == H5T_STR_NULLPAD_TOKEN) + else if((yyvsp[-1].ival) == H5T_STR_NULLPAD_TOKEN) str_pad = H5T_STR_NULLPAD; - else if((yyvsp[(8) - (9)].ival) == H5T_STR_SPACEPAD_TOKEN) + else if((yyvsp[-1].ival) == H5T_STR_SPACEPAD_TOKEN) str_pad = H5T_STR_SPACEPAD; } +#line 1843 "hl/src/H5LTparse.c" /* yacc.c:1646 */ break; case 73: -/* Line 1792 of yacc.c */ -#line 283 "hl/src//H5LTparse.y" +#line 283 "hl/src/H5LTparse.y" /* yacc.c:1646 */ { - if((yyvsp[(12) - (13)].ival) == H5T_CSET_ASCII_TOKEN) + if((yyvsp[-1].ival) == H5T_CSET_ASCII_TOKEN) str_cset = H5T_CSET_ASCII; - else if((yyvsp[(12) - (13)].ival) == H5T_CSET_UTF8_TOKEN) + else if((yyvsp[-1].ival) == H5T_CSET_UTF8_TOKEN) str_cset = H5T_CSET_UTF8; } +#line 1854 "hl/src/H5LTparse.c" /* yacc.c:1646 */ break; case 74: -/* Line 1792 of yacc.c */ -#line 290 "hl/src//H5LTparse.y" +#line 290 "hl/src/H5LTparse.y" /* yacc.c:1646 */ { - if((yyvsp[(16) - (17)].hid) == H5T_C_S1_TOKEN) + if((yyvsp[-1].hid) == H5T_C_S1_TOKEN) (yyval.hid) = H5Tcopy(H5T_C_S1); - else if((yyvsp[(16) - (17)].hid) == H5T_FORTRAN_S1_TOKEN) + else if((yyvsp[-1].hid) == H5T_FORTRAN_S1_TOKEN) (yyval.hid) = H5Tcopy(H5T_FORTRAN_S1); } +#line 1865 "hl/src/H5LTparse.c" /* yacc.c:1646 */ break; case 75: -/* Line 1792 of yacc.c */ -#line 297 "hl/src//H5LTparse.y" +#line 297 "hl/src/H5LTparse.y" /* yacc.c:1646 */ { - hid_t str_id = (yyvsp[(18) - (19)].hid); + hid_t str_id = (yyvsp[-1].hid); /*set string size*/ if(is_variable) { @@ -2070,82 +1912,82 @@ yyparse () (yyval.hid) = str_id; } +#line 1886 "hl/src/H5LTparse.c" /* yacc.c:1646 */ break; case 76: -/* Line 1792 of yacc.c */ -#line 314 "hl/src//H5LTparse.y" +#line 314 "hl/src/H5LTparse.y" /* yacc.c:1646 */ {(yyval.ival) = H5T_VARIABLE_TOKEN;} +#line 1892 "hl/src/H5LTparse.c" /* yacc.c:1646 */ break; case 78: -/* Line 1792 of yacc.c */ -#line 317 "hl/src//H5LTparse.y" +#line 317 "hl/src/H5LTparse.y" /* yacc.c:1646 */ {(yyval.ival) = H5T_STR_NULLTERM_TOKEN;} +#line 1898 "hl/src/H5LTparse.c" /* yacc.c:1646 */ break; case 79: -/* Line 1792 of yacc.c */ -#line 318 "hl/src//H5LTparse.y" +#line 318 "hl/src/H5LTparse.y" /* yacc.c:1646 */ {(yyval.ival) = H5T_STR_NULLPAD_TOKEN;} +#line 1904 "hl/src/H5LTparse.c" /* yacc.c:1646 */ break; case 80: -/* Line 1792 of yacc.c */ -#line 319 "hl/src//H5LTparse.y" +#line 319 "hl/src/H5LTparse.y" /* yacc.c:1646 */ {(yyval.ival) = H5T_STR_SPACEPAD_TOKEN;} +#line 1910 "hl/src/H5LTparse.c" /* yacc.c:1646 */ break; case 81: -/* Line 1792 of yacc.c */ -#line 321 "hl/src//H5LTparse.y" +#line 321 "hl/src/H5LTparse.y" /* yacc.c:1646 */ {(yyval.ival) = H5T_CSET_ASCII_TOKEN;} +#line 1916 "hl/src/H5LTparse.c" /* yacc.c:1646 */ break; case 82: -/* Line 1792 of yacc.c */ -#line 322 "hl/src//H5LTparse.y" +#line 322 "hl/src/H5LTparse.y" /* yacc.c:1646 */ {(yyval.ival) = H5T_CSET_UTF8_TOKEN;} +#line 1922 "hl/src/H5LTparse.c" /* yacc.c:1646 */ break; case 83: -/* Line 1792 of yacc.c */ -#line 324 "hl/src//H5LTparse.y" +#line 324 "hl/src/H5LTparse.y" /* yacc.c:1646 */ {(yyval.hid) = H5T_C_S1_TOKEN;} +#line 1928 "hl/src/H5LTparse.c" /* yacc.c:1646 */ break; case 84: -/* Line 1792 of yacc.c */ -#line 325 "hl/src//H5LTparse.y" +#line 325 "hl/src/H5LTparse.y" /* yacc.c:1646 */ {(yyval.hid) = H5T_FORTRAN_S1_TOKEN;} +#line 1934 "hl/src/H5LTparse.c" /* yacc.c:1646 */ break; case 85: -/* Line 1792 of yacc.c */ -#line 329 "hl/src//H5LTparse.y" - { is_enum = 1; enum_id = H5Tenum_create((yyvsp[(3) - (4)].hid)); H5Tclose((yyvsp[(3) - (4)].hid)); } +#line 329 "hl/src/H5LTparse.y" /* yacc.c:1646 */ + { is_enum = 1; enum_id = H5Tenum_create((yyvsp[-1].hid)); H5Tclose((yyvsp[-1].hid)); } +#line 1940 "hl/src/H5LTparse.c" /* yacc.c:1646 */ break; case 86: -/* Line 1792 of yacc.c */ -#line 331 "hl/src//H5LTparse.y" +#line 331 "hl/src/H5LTparse.y" /* yacc.c:1646 */ { is_enum = 0; /*reset*/ (yyval.hid) = enum_id; } +#line 1946 "hl/src/H5LTparse.c" /* yacc.c:1646 */ break; case 89: -/* Line 1792 of yacc.c */ -#line 336 "hl/src//H5LTparse.y" +#line 336 "hl/src/H5LTparse.y" /* yacc.c:1646 */ { is_enum_memb = 1; /*indicate member of enum*/ - enum_memb_symbol = strdup(yylval.sval); + enum_memb_symbol = HDstrdup(yylval.sval); HDfree(yylval.sval); yylval.sval = NULL; } +#line 1957 "hl/src/H5LTparse.c" /* yacc.c:1646 */ break; case 90: -/* Line 1792 of yacc.c */ -#line 343 "hl/src//H5LTparse.y" +#line 343 "hl/src/H5LTparse.y" /* yacc.c:1646 */ { char char_val=(char)yylval.ival; short short_val=(short)yylval.ival; @@ -2188,11 +2030,11 @@ yyparse () H5Tclose(super); H5Tclose(native); } +#line 2004 "hl/src/H5LTparse.c" /* yacc.c:1646 */ break; -/* Line 1792 of yacc.c */ -#line 2166 "hl/src//H5LTparse.c" +#line 2008 "hl/src/H5LTparse.c" /* yacc.c:1646 */ default: break; } /* User semantic actions sometimes alter yychar, and that requires @@ -2214,7 +2056,7 @@ yyparse () *++yyvsp = yyval; - /* Now `shift' the result of the reduction. Determine what state + /* Now 'shift' the result of the reduction. Determine what state that goes to, based on the state we popped back to and the rule number reduced by. */ @@ -2229,9 +2071,9 @@ yyparse () goto yynewstate; -/*------------------------------------. -| yyerrlab -- here on detecting error | -`------------------------------------*/ +/*--------------------------------------. +| yyerrlab -- here on detecting error. | +`--------------------------------------*/ yyerrlab: /* Make sure we have latest lookahead translation. See comments at user semantic actions for why this is necessary. */ @@ -2282,20 +2124,20 @@ yyparse () if (yyerrstatus == 3) { /* If just tried and failed to reuse lookahead token after an - error, discard it. */ + error, discard it. */ if (yychar <= YYEOF) - { - /* Return failure if at end of input. */ - if (yychar == YYEOF) - YYABORT; - } + { + /* Return failure if at end of input. */ + if (yychar == YYEOF) + YYABORT; + } else - { - yydestruct ("Error: discarding", - yytoken, &yylval); - yychar = YYEMPTY; - } + { + yydestruct ("Error: discarding", + yytoken, &yylval); + yychar = YYEMPTY; + } } /* Else will try to reuse lookahead token after shifting the error @@ -2314,7 +2156,7 @@ yyparse () if (/*CONSTCOND*/ 0) goto yyerrorlab; - /* Do not reclaim the symbols of the rule which action triggered + /* Do not reclaim the symbols of the rule whose action triggered this YYERROR. */ YYPOPSTACK (yylen); yylen = 0; @@ -2327,29 +2169,29 @@ yyparse () | yyerrlab1 -- common code for both syntax error and YYERROR. | `-------------------------------------------------------------*/ yyerrlab1: - yyerrstatus = 3; /* Each real token shifted decrements this. */ + yyerrstatus = 3; /* Each real token shifted decrements this. */ for (;;) { yyn = yypact[yystate]; if (!yypact_value_is_default (yyn)) - { - yyn += YYTERROR; - if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR) - { - yyn = yytable[yyn]; - if (0 < yyn) - break; - } - } + { + yyn += YYTERROR; + if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR) + { + yyn = yytable[yyn]; + if (0 < yyn) + break; + } + } /* Pop the current state because it cannot handle the error token. */ if (yyssp == yyss) - YYABORT; + YYABORT; yydestruct ("Error: popping", - yystos[yystate], yyvsp); + yystos[yystate], yyvsp); YYPOPSTACK (1); yystate = *yyssp; YY_STACK_PRINT (yyss, yyssp); @@ -2400,14 +2242,14 @@ yyparse () yydestruct ("Cleanup: discarding lookahead", yytoken, &yylval); } - /* Do not reclaim the symbols of the rule which action triggered + /* Do not reclaim the symbols of the rule whose action triggered this YYABORT or YYACCEPT. */ YYPOPSTACK (yylen); YY_STACK_PRINT (yyss, yyssp); while (yyssp != yyss) { yydestruct ("Cleanup: popping", - yystos[*yyssp], yyvsp); + yystos[*yyssp], yyvsp); YYPOPSTACK (1); } #ifndef yyoverflow @@ -2418,8 +2260,5 @@ yyparse () if (yymsg != yymsgbuf) YYSTACK_FREE (yymsg); #endif - /* Make sure YYID is used. */ - return YYID (yyresult); + return yyresult; } - - diff --git a/hl/src/H5LTparse.h b/hl/src/H5LTparse.h index 71690175db5..9dd2fba7b11 100644 --- a/hl/src/H5LTparse.h +++ b/hl/src/H5LTparse.h @@ -1,19 +1,19 @@ -/* A Bison parser, made by GNU Bison 2.7. */ +/* A Bison parser, made by GNU Bison 3.0.4. */ /* Bison interface for Yacc-like parsers in C - - Copyright (C) 1984, 1989-1990, 2000-2012 Free Software Foundation, Inc. - + + Copyright (C) 1984, 1989-1990, 2000-2015 Free Software Foundation, Inc. + This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. - + This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. - + You should have received a copy of the GNU General Public License along with this program. If not, see . */ @@ -26,13 +26,13 @@ special exception, which will cause the skeleton and the resulting Bison output files to be licensed under the GNU General Public License without this special exception. - + This special exception was added by the Free Software Foundation in version 2.2 of Bison. */ #ifndef YY_H5LTYY_HL_SRC_H5LTPARSE_H_INCLUDED # define YY_H5LTYY_HL_SRC_H5LTPARSE_H_INCLUDED -/* Enabling traces. */ +/* Debug traces. */ #ifndef YYDEBUG # define YYDEBUG 0 #endif @@ -40,105 +40,92 @@ extern int H5LTyydebug; #endif -/* Tokens. */ +/* Token type. */ #ifndef YYTOKENTYPE # define YYTOKENTYPE - /* Put the tokens into the symbol table, so that GDB and other debuggers - know about them. */ - enum yytokentype { - H5T_STD_I8BE_TOKEN = 258, - H5T_STD_I8LE_TOKEN = 259, - H5T_STD_I16BE_TOKEN = 260, - H5T_STD_I16LE_TOKEN = 261, - H5T_STD_I32BE_TOKEN = 262, - H5T_STD_I32LE_TOKEN = 263, - H5T_STD_I64BE_TOKEN = 264, - H5T_STD_I64LE_TOKEN = 265, - H5T_STD_U8BE_TOKEN = 266, - H5T_STD_U8LE_TOKEN = 267, - H5T_STD_U16BE_TOKEN = 268, - H5T_STD_U16LE_TOKEN = 269, - H5T_STD_U32BE_TOKEN = 270, - H5T_STD_U32LE_TOKEN = 271, - H5T_STD_U64BE_TOKEN = 272, - H5T_STD_U64LE_TOKEN = 273, - H5T_NATIVE_CHAR_TOKEN = 274, - H5T_NATIVE_SCHAR_TOKEN = 275, - H5T_NATIVE_UCHAR_TOKEN = 276, - H5T_NATIVE_SHORT_TOKEN = 277, - H5T_NATIVE_USHORT_TOKEN = 278, - H5T_NATIVE_INT_TOKEN = 279, - H5T_NATIVE_UINT_TOKEN = 280, - H5T_NATIVE_LONG_TOKEN = 281, - H5T_NATIVE_ULONG_TOKEN = 282, - H5T_NATIVE_LLONG_TOKEN = 283, - H5T_NATIVE_ULLONG_TOKEN = 284, - H5T_IEEE_F32BE_TOKEN = 285, - H5T_IEEE_F32LE_TOKEN = 286, - H5T_IEEE_F64BE_TOKEN = 287, - H5T_IEEE_F64LE_TOKEN = 288, - H5T_NATIVE_FLOAT_TOKEN = 289, - H5T_NATIVE_DOUBLE_TOKEN = 290, - H5T_NATIVE_LDOUBLE_TOKEN = 291, - H5T_STRING_TOKEN = 292, - STRSIZE_TOKEN = 293, - STRPAD_TOKEN = 294, - CSET_TOKEN = 295, - CTYPE_TOKEN = 296, - H5T_VARIABLE_TOKEN = 297, - H5T_STR_NULLTERM_TOKEN = 298, - H5T_STR_NULLPAD_TOKEN = 299, - H5T_STR_SPACEPAD_TOKEN = 300, - H5T_CSET_ASCII_TOKEN = 301, - H5T_CSET_UTF8_TOKEN = 302, - H5T_C_S1_TOKEN = 303, - H5T_FORTRAN_S1_TOKEN = 304, - H5T_OPAQUE_TOKEN = 305, - OPQ_SIZE_TOKEN = 306, - OPQ_TAG_TOKEN = 307, - H5T_COMPOUND_TOKEN = 308, - H5T_ENUM_TOKEN = 309, - H5T_ARRAY_TOKEN = 310, - H5T_VLEN_TOKEN = 311, - STRING = 312, - NUMBER = 313 - }; + enum yytokentype + { + H5T_STD_I8BE_TOKEN = 258, + H5T_STD_I8LE_TOKEN = 259, + H5T_STD_I16BE_TOKEN = 260, + H5T_STD_I16LE_TOKEN = 261, + H5T_STD_I32BE_TOKEN = 262, + H5T_STD_I32LE_TOKEN = 263, + H5T_STD_I64BE_TOKEN = 264, + H5T_STD_I64LE_TOKEN = 265, + H5T_STD_U8BE_TOKEN = 266, + H5T_STD_U8LE_TOKEN = 267, + H5T_STD_U16BE_TOKEN = 268, + H5T_STD_U16LE_TOKEN = 269, + H5T_STD_U32BE_TOKEN = 270, + H5T_STD_U32LE_TOKEN = 271, + H5T_STD_U64BE_TOKEN = 272, + H5T_STD_U64LE_TOKEN = 273, + H5T_NATIVE_CHAR_TOKEN = 274, + H5T_NATIVE_SCHAR_TOKEN = 275, + H5T_NATIVE_UCHAR_TOKEN = 276, + H5T_NATIVE_SHORT_TOKEN = 277, + H5T_NATIVE_USHORT_TOKEN = 278, + H5T_NATIVE_INT_TOKEN = 279, + H5T_NATIVE_UINT_TOKEN = 280, + H5T_NATIVE_LONG_TOKEN = 281, + H5T_NATIVE_ULONG_TOKEN = 282, + H5T_NATIVE_LLONG_TOKEN = 283, + H5T_NATIVE_ULLONG_TOKEN = 284, + H5T_IEEE_F32BE_TOKEN = 285, + H5T_IEEE_F32LE_TOKEN = 286, + H5T_IEEE_F64BE_TOKEN = 287, + H5T_IEEE_F64LE_TOKEN = 288, + H5T_NATIVE_FLOAT_TOKEN = 289, + H5T_NATIVE_DOUBLE_TOKEN = 290, + H5T_NATIVE_LDOUBLE_TOKEN = 291, + H5T_STRING_TOKEN = 292, + STRSIZE_TOKEN = 293, + STRPAD_TOKEN = 294, + CSET_TOKEN = 295, + CTYPE_TOKEN = 296, + H5T_VARIABLE_TOKEN = 297, + H5T_STR_NULLTERM_TOKEN = 298, + H5T_STR_NULLPAD_TOKEN = 299, + H5T_STR_SPACEPAD_TOKEN = 300, + H5T_CSET_ASCII_TOKEN = 301, + H5T_CSET_UTF8_TOKEN = 302, + H5T_C_S1_TOKEN = 303, + H5T_FORTRAN_S1_TOKEN = 304, + H5T_OPAQUE_TOKEN = 305, + OPQ_SIZE_TOKEN = 306, + OPQ_TAG_TOKEN = 307, + H5T_COMPOUND_TOKEN = 308, + H5T_ENUM_TOKEN = 309, + H5T_ARRAY_TOKEN = 310, + H5T_VLEN_TOKEN = 311, + STRING = 312, + NUMBER = 313 + }; #endif - +/* Value type. */ #if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED -typedef union YYSTYPE + +union YYSTYPE { -/* Line 2058 of yacc.c */ -#line 69 "hl/src//H5LTparse.y" +#line 69 "hl/src/H5LTparse.y" /* yacc.c:1909 */ int ival; /*for integer token*/ char *sval; /*for name string*/ hid_t hid; /*for hid_t token*/ +#line 119 "hl/src/H5LTparse.h" /* yacc.c:1909 */ +}; -/* Line 2058 of yacc.c */ -#line 122 "hl/src//H5LTparse.h" -} YYSTYPE; +typedef union YYSTYPE YYSTYPE; # define YYSTYPE_IS_TRIVIAL 1 -# define yystype YYSTYPE /* obsolescent; will be withdrawn */ # define YYSTYPE_IS_DECLARED 1 #endif + extern YYSTYPE H5LTyylval; -#ifdef YYPARSE_PARAM -#if defined __STDC__ || defined __cplusplus -hid_t H5LTyyparse (void *YYPARSE_PARAM); -#else -hid_t H5LTyyparse (); -#endif -#else /* ! YYPARSE_PARAM */ -#if defined __STDC__ || defined __cplusplus hid_t H5LTyyparse (void); -#else -hid_t H5LTyyparse (); -#endif -#endif /* ! YYPARSE_PARAM */ #endif /* !YY_H5LTYY_HL_SRC_H5LTPARSE_H_INCLUDED */ diff --git a/hl/src/H5LTparse.y b/hl/src/H5LTparse.y index 7c3277219fa..01f6ded1f61 100644 --- a/hl/src/H5LTparse.y +++ b/hl/src/H5LTparse.y @@ -335,7 +335,7 @@ enum_list : ; enum_def : enum_symbol { is_enum_memb = 1; /*indicate member of enum*/ - enum_memb_symbol = strdup(yylval.sval); + enum_memb_symbol = HDstrdup(yylval.sval); HDfree(yylval.sval); yylval.sval = NULL; }