diff options
author | Scot Breitenfeld <brtnfld@hdfgroup.org> | 2021-11-23 19:15:30 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-11-23 19:15:30 (GMT) |
commit | 2daa28652dc7823eac6a6fd2d7ad02d391585174 (patch) | |
tree | 0ff49369f51131e0232101faa5b9c3ae78755d0e /src/H5FDperform.c | |
parent | 28d0a7b1b93e3918f3c8ee361af3280a2c9ee8a4 (diff) | |
download | hdf5-2daa28652dc7823eac6a6fd2d7ad02d391585174.zip hdf5-2daa28652dc7823eac6a6fd2d7ad02d391585174.tar.gz hdf5-2daa28652dc7823eac6a6fd2d7ad02d391585174.tar.bz2 |
subfiling with selection IO (#1219)
Merged branch 'selection_io' into subfiling branch.
Diffstat (limited to 'src/H5FDperform.c')
-rw-r--r-- | src/H5FDperform.c | 58 |
1 files changed, 58 insertions, 0 deletions
diff --git a/src/H5FDperform.c b/src/H5FDperform.c new file mode 100644 index 0000000..096fdd6 --- /dev/null +++ b/src/H5FDperform.c @@ -0,0 +1,58 @@ +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * + * Copyright by The HDF Group. * + * All rights reserved. * + * * + * This file is part of HDF5. The full HDF5 copyright notice, including * + * terms governing use, modification, and redistribution, is contained in * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://www.hdfgroup.org/licenses. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * + * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ + +/****************/ +/* Module Setup */ +/****************/ + +#include "H5FDmodule.h" /* This source code file is part of the H5FD module */ + +/***********/ +/* Headers */ +/***********/ +#include "H5private.h" /* Generic Functions */ +#include "H5CXprivate.h" /* API Contexts */ +#include "H5Eprivate.h" /* Error handling */ +#include "H5FDpkg.h" /* File Drivers */ +#include "H5Iprivate.h" /* IDs */ + +/*------------------------------------------------------------------------- + * Function: H5FDperform_init + * + * Purpose: Ensure that the library is initialized and then call + * the provided VFD initializer. + * + * Return: Success: identifier for the VFD just initialized + * Failure: H5I_INVALID_HID + *------------------------------------------------------------------------- + */ +hid_t H5FDperform_init(hid_t (*init)(void)) +{ + hid_t ret_value = H5I_INVALID_HID; /* Return value */ + + FUNC_ENTER_API_NOINIT + /*NO TRACE*/ + + /* It is possible that an application will evaluate an + * `H5FD_*` symbol (`H5FD_FAMILY`, `H5FD_MULTI`, `H5FD_SEC2`, et + * cetera) before the library has had an opportunity to initialize. + * Call H5_init_library() to make sure that the library has been + * initialized before `init` is run. + */ + if (H5_init_library() < 0) { + HGOTO_ERROR(H5E_FUNC, H5E_CANTINIT, H5I_INVALID_HID, "library initialization failed") + } + + ret_value = init(); +done: + FUNC_LEAVE_API_NOINIT(ret_value) +} |