diff options
author | Quincey Koziol <koziol@hdfgroup.org> | 2018-11-28 23:38:03 (GMT) |
---|---|---|
committer | Quincey Koziol <koziol@hdfgroup.org> | 2018-11-28 23:38:03 (GMT) |
commit | 6eabeabdaa77642fd4db5fd234ccc756a24125be (patch) | |
tree | b7c2fb4bee8782df27f18efbcb1f11d6847e1fde /src | |
parent | 3abf58dce034dd9e5afabbdd7d1d80c1ba4374ad (diff) | |
download | hdf5-6eabeabdaa77642fd4db5fd234ccc756a24125be.zip hdf5-6eabeabdaa77642fd4db5fd234ccc756a24125be.tar.gz hdf5-6eabeabdaa77642fd4db5fd234ccc756a24125be.tar.bz2 |
Refactor infrastructure for setting FAPL information from environment
variables during testing, including connecting native, pass-through, and
dynamically loaded VOL connectors. Also bring native and pass-through
VOL connectors into alignment, removing the "H5VLnative_private.h" header.
Diffstat (limited to 'src')
-rw-r--r-- | src/CMakeLists.txt | 1 | ||||
-rw-r--r-- | src/H5Dvirtual.c | 1 | ||||
-rw-r--r-- | src/H5Fint.c | 1 | ||||
-rw-r--r-- | src/H5Gtraverse.c | 1 | ||||
-rw-r--r-- | src/H5L.c | 1 | ||||
-rw-r--r-- | src/H5Lexternal.c | 1 | ||||
-rw-r--r-- | src/H5Oint.c | 1 | ||||
-rw-r--r-- | src/H5Pfapl.c | 6 | ||||
-rw-r--r-- | src/H5VLnative.c | 44 | ||||
-rw-r--r-- | src/H5VLnative.h | 6 | ||||
-rw-r--r-- | src/H5VLnative_private.h | 37 | ||||
-rw-r--r-- | src/H5VLpassthru.c | 8 |
12 files changed, 19 insertions, 89 deletions
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 80b26ff..cd81ba5 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -870,7 +870,6 @@ set (H5_PRIVATE_HEADERS ${HDF5_SRC_DIR}/H5UCprivate.h ${HDF5_SRC_DIR}/H5VLpkg.h - ${HDF5_SRC_DIR}/H5VLnative_private.h ${HDF5_SRC_DIR}/H5VLprivate.h ${HDF5_SRC_DIR}/H5VMprivate.h diff --git a/src/H5Dvirtual.c b/src/H5Dvirtual.c index feb836d..c0d49d8 100644 --- a/src/H5Dvirtual.c +++ b/src/H5Dvirtual.c @@ -58,7 +58,6 @@ #include "H5Oprivate.h" /* Object headers */ #include "H5Pprivate.h" /* Property Lists */ #include "H5Sprivate.h" /* Dataspaces */ -#include "H5VLnative_private.h" /* Native VOL driver */ #include "H5VLprivate.h" /* Virtual Object Layer */ /****************/ diff --git a/src/H5Fint.c b/src/H5Fint.c index 1ef5013..056a98b 100644 --- a/src/H5Fint.c +++ b/src/H5Fint.c @@ -38,7 +38,6 @@ #include "H5SMprivate.h" /* Shared Object Header Messages */ #include "H5Tprivate.h" /* Datatypes */ #include "H5VLprivate.h" /* Virtual Object Layer */ -#include "H5VLnative_private.h" /* Native VOL connector */ /****************/ diff --git a/src/H5Gtraverse.c b/src/H5Gtraverse.c index 2d8de99..d029bea 100644 --- a/src/H5Gtraverse.c +++ b/src/H5Gtraverse.c @@ -43,7 +43,6 @@ #include "H5MMprivate.h" /* Memory management */ #include "H5Ppublic.h" /* Property Lists */ #include "H5WBprivate.h" /* Wrapped Buffers */ -#include "H5VLnative_private.h" /* Native VOL driver */ /****************/ @@ -34,7 +34,6 @@ #include "H5Oprivate.h" /* File objects */ #include "H5Pprivate.h" /* Property lists */ #include "H5VLprivate.h" /* Virtual Object Layer */ -#include "H5VLnative_private.h" /* Native VOL connector */ /****************/ diff --git a/src/H5Lexternal.c b/src/H5Lexternal.c index 73f7b89..0f3296f 100644 --- a/src/H5Lexternal.c +++ b/src/H5Lexternal.c @@ -34,7 +34,6 @@ #include "H5Opublic.h" /* File objects */ #include "H5Pprivate.h" /* Property lists */ #include "H5VLprivate.h" /* Virtual Object Layer */ -#include "H5VLnative_private.h" /* Native VOL connector */ /****************/ diff --git a/src/H5Oint.c b/src/H5Oint.c index 059a8a8..52290f2 100644 --- a/src/H5Oint.c +++ b/src/H5Oint.c @@ -43,7 +43,6 @@ #endif /* H5O_ENABLE_BOGUS */ #include "H5Opkg.h" /* Object headers */ #include "H5VLprivate.h" /* Virtual Object Layer */ -#include "H5VLnative_private.h" /* Native VOL driver */ /****************/ diff --git a/src/H5Pfapl.c b/src/H5Pfapl.c index e802e3b..923c792 100644 --- a/src/H5Pfapl.c +++ b/src/H5Pfapl.c @@ -41,15 +41,15 @@ #include "H5Ppkg.h" /* Property lists */ #include "H5VLprivate.h" /* Virtual Object Layer */ -/* Includes needed to set as default file driver */ +/* Includes needed to set default file driver */ #include "H5FDsec2.h" /* POSIX unbuffered I/O */ #include "H5FDstdio.h" /* Standard C buffered I/O */ #ifdef H5_HAVE_WINDOWS #include "H5FDwindows.h" /* Win32 I/O */ #endif -/* Includes needed to set the default VOL connector */ -#include "H5VLnative_private.h" /* Native VOL connector */ +/* Includes needed to set default VOL connector */ +#include "H5VLnative.h" /* Native VOL connector */ /****************/ diff --git a/src/H5VLnative.c b/src/H5VLnative.c index 6c51d95..3fc1a7c 100644 --- a/src/H5VLnative.c +++ b/src/H5VLnative.c @@ -41,7 +41,7 @@ #include "H5SMprivate.h" /* Shared Object Header Messages */ #include "H5Tpkg.h" /* Datatypes */ #include "H5VLprivate.h" /* Virtual Object Layer */ -#include "H5VLnative_private.h" /* Native VOL connector */ +#include "H5VLnative.h" /* Native VOL connector */ /* * The VOL connector identification number. @@ -208,10 +208,9 @@ static H5VL_class_t H5VL_native_cls_g = { /*------------------------------------------------------------------------- - * Function: H5VL_native_init + * Function: H5VL_native_register * - * Purpose: Initialize this VOL connector by registering it with the - * library. + * Purpose: Register the native VOL connector and retrieve an ID for it. * * Return: Success: The ID for the native connector * Failure: H5I_INVALID_HID @@ -219,7 +218,7 @@ static H5VL_class_t H5VL_native_cls_g = { *------------------------------------------------------------------------- */ hid_t -H5VL_native_init(hid_t vipl_id) +H5VL_native_register(void) { hid_t ret_value = H5I_INVALID_HID; /* Return value */ @@ -227,7 +226,7 @@ H5VL_native_init(hid_t vipl_id) /* Register the native VOL connector, if it isn't already */ if(NULL == H5I_object_verify(H5VL_NATIVE_ID_g, H5I_VOL)) - if((H5VL_NATIVE_ID_g = H5VL_register_connector((const H5VL_class_t *)&H5VL_native_cls_g, TRUE, vipl_id)) < 0) + if((H5VL_NATIVE_ID_g = H5VL_register_connector((const H5VL_class_t *)&H5VL_native_cls_g, TRUE, H5P_DEFAULT)) < 0) HGOTO_ERROR(H5E_VOL, H5E_CANTINSERT, H5I_INVALID_HID, "can't create ID for native VOL connector") /* Set return value */ @@ -235,7 +234,7 @@ H5VL_native_init(hid_t vipl_id) done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5VL_native_init() */ +} /* end H5VL_native_register() */ /*--------------------------------------------------------------------------- @@ -252,7 +251,7 @@ H5VL__native_term(void) { FUNC_ENTER_STATIC_NOERR - /* Reset VFL ID */ + /* Reset VOL ID */ H5VL_NATIVE_ID_g = H5I_INVALID_HID; FUNC_LEAVE_NOAPI(SUCCEED) @@ -260,35 +259,6 @@ H5VL__native_term(void) /*------------------------------------------------------------------------- - * Function: H5Pset_fapl_native - * - * Purpose: Modify the file access property list to use the H5VL_NATIVE - * connector defined in this source file. - * - * Return: SUCCEED/FAIL - * - *------------------------------------------------------------------------- - */ -herr_t -H5Pset_fapl_native(hid_t fapl_id) -{ - H5P_genplist_t *plist; /* Property list pointer */ - herr_t ret_value; - - FUNC_ENTER_API(FAIL) - H5TRACE1("e", "i", fapl_id); - - if(NULL == (plist = H5P_object_verify(fapl_id, H5P_FILE_ACCESS))) - HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a file access property list") - - ret_value = H5P_set_vol(plist, H5VL_NATIVE_ID_g, NULL); - -done: - FUNC_LEAVE_API(ret_value) -} /* end H5Pset_fapl_native() */ - - -/*------------------------------------------------------------------------- * Function: H5VL__native_attr_create * * Purpose: Creates an attribute on an object. diff --git a/src/H5VLnative.h b/src/H5VLnative.h index af4ea59..8ae3a66 100644 --- a/src/H5VLnative.h +++ b/src/H5VLnative.h @@ -17,6 +17,9 @@ #ifndef _H5VLnative_H #define _H5VLnative_H +/* Identifier for the native VOL connector */ +#define H5VL_NATIVE (H5VL_native_register()) + /* Characteristics of the native VOL connector */ #define H5VL_NATIVE_NAME "native" #define H5VL_NATIVE_VALUE H5_VOL_NATIVE /* enum value */ @@ -27,7 +30,8 @@ extern "C" { #endif -H5_DLL herr_t H5Pset_fapl_native(hid_t fapl_id); +H5_DLL hid_t H5VL_native_register(void); + #ifdef __cplusplus } diff --git a/src/H5VLnative_private.h b/src/H5VLnative_private.h deleted file mode 100644 index 559c8aa..0000000 --- a/src/H5VLnative_private.h +++ /dev/null @@ -1,37 +0,0 @@ -/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * - * Copyright by The HDF Group. * - * All rights reserved. * - * * - * This file is part of HDF5. The full HDF5 copyright notice, including * - * terms governing use, modification, and redistribution, is contained in * - * the COPYING file, which can be found at the root of the source code * - * distribution tree, or in https://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: The private header file for the native VOL connector. - */ - -#ifndef _H5VLnative_private_H -#define _H5VLnative_private_H - -/* Include connector's public header */ -#include "H5VLnative.h" - -/* Initializer function for native VOL connector */ -#define H5VL_NATIVE (H5VL_native_init(H5P_DEFAULT)) - - -#ifdef __cplusplus -extern "C" { -#endif - -H5_DLL hid_t H5VL_native_init(hid_t vipl_id); - -#ifdef __cplusplus -} -#endif - -#endif /* _H5VLnative_private_H */ diff --git a/src/H5VLpassthru.c b/src/H5VLpassthru.c index 3181834..f8568de 100644 --- a/src/H5VLpassthru.c +++ b/src/H5VLpassthru.c @@ -237,7 +237,7 @@ static const H5VL_class_t H5VL_pass_through_g = { }; /* The connector identification number, initialized at runtime */ -static hid_t H5VL_PASSTHRU_g = 0; +static hid_t H5VL_PASSTHRU_g = H5I_INVALID_HID; /*------------------------------------------------------------------------- @@ -315,7 +315,7 @@ H5VL_pass_through_term(void) #endif /* Reset VOL ID */ - H5VL_PASSTHRU_g = 0; + H5VL_PASSTHRU_g = H5I_INVALID_HID; return(0); } /* end H5VL_pass_through_term() */ @@ -462,7 +462,7 @@ H5VL_pass_through_info_to_str(const void *_info, char **str) assert(*str); /* Encode our info */ - snprintf(*str, 32 + under_vol_str_len, "under_val=%u, under_info={%s}", (unsigned)under_value, (under_vol_string ? under_vol_string : "")); + snprintf(*str, 32 + under_vol_str_len, "under_val=%u;under_info={%s}", (unsigned)under_value, (under_vol_string ? under_vol_string : "")); return(0); } /* end H5VL_pass_through_info_to_str() */ @@ -492,7 +492,7 @@ H5VL_pass_through_str_to_info(const char *str, void **_info) #endif /* Retrieve the underlying VOL connector value and info */ - sscanf(str, "under_vol=%u,", &under_vol_value); + sscanf(str, "under_vol=%u;", &under_vol_value); under_vol_id = H5VLregister_connector_by_value((H5VL_class_value_t)under_vol_value, H5P_DEFAULT); under_vol_info_start = strchr(str, '{'); under_vol_info_end = strrchr(str, '}'); |