Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Renamed H5VLstart_lib_state and H5VLfinish_lib_state #5070

Merged
merged 4 commits into from
Nov 5, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions doxygen/aliases
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,8 @@ ALIASES += op_data{1}="\param[in,out] \1 User-defined callback function context"
ALIASES += op_data_in="\param[in] op_data User-defined callback function context"
ALIASES += op_data_in{1}="\param[in] \1 User-defined callback function context"

ALIASES += vol_only_api="This routine is exclusively for authors of HDF5 VOL connectors. It is not part of the public HDF5 APIs for HDF5 application developers."

################################################################################
# Asynchronous
################################################################################
Expand Down
8 changes: 5 additions & 3 deletions release_docs/RELEASE.txt
Original file line number Diff line number Diff line change
Expand Up @@ -345,9 +345,11 @@ New Features
- HDF5Examples/C/H5T/200/h5ex_t_complex_custom.c (Uses H5Tcomplex_create to create
a custom complex number type)

- The H5VLstart_lib_state / H5VLfinish_lib_state API routines for pass-
through connector authors now require a parameter that can be used to
store the library's context.
- FOR VOL DEVELOPERS: Renamed H5VLstart_lib_state and H5VLfinish_lib_state

The APIs H5VLstart_lib_state and H5VLfinish_lib_state have been renamed to
H5VLopen_lib_context and H5VLclose_lib_context, respectively, with the addition
of a "context" argument.

- Removed H5FDperform_init API routine. Virtual File Driver (VFD)
developers who wish to provide an ID for their driver should create
Expand Down
48 changes: 4 additions & 44 deletions src/H5VL.c
Original file line number Diff line number Diff line change
Expand Up @@ -768,27 +768,8 @@ H5VLretrieve_lib_state(void **state /*out*/)
FUNC_LEAVE_API_NOINIT(ret_value)
} /* H5VLretrieve_lib_state() */

/*---------------------------------------------------------------------------
* Function: H5VLstart_lib_state
*
* Purpose: Opens a new internal context for the HDF5 library. The context
* returned (via the OUT parameter) must be passed to
* H5VLfinish_lib_state to conclude the library's context and
* release resources.
*
* Note: This routine is _only_ for HDF5 VOL connector authors! It is
* _not_ part of the public API for HDF5 application developers.
*
* Note: Should probably rename this to 'H5VLopen_lib_context' or
* similar.
*
* Return: Success: Non-negative, *context set
* Failure: Negative, *context unset
*
*---------------------------------------------------------------------------
*/
herr_t
H5VLstart_lib_state(void **context)
H5VLopen_lib_context(void **context)
{
herr_t ret_value = SUCCEED; /* Return value */

Expand All @@ -805,7 +786,7 @@ H5VLstart_lib_state(void **context)

done:
FUNC_LEAVE_API_NOINIT(ret_value)
} /* H5VLstart_lib_state() */
} /* H5VLopen_lib_context() */

/*---------------------------------------------------------------------------
* Function: H5VLrestore_lib_state
Expand Down Expand Up @@ -840,29 +821,8 @@ H5VLrestore_lib_state(const void *state)
FUNC_LEAVE_API_NOINIT(ret_value)
} /* H5VLrestore_lib_state() */

/*---------------------------------------------------------------------------
* Function: H5VLfinish_lib_state
*
* Purpose: Closes the internal state of the HDF5 library, undoing the
* affects of H5VLstart_lib_state.
*
* Note: This routine is _only_ for HDF5 VOL connector authors! It is
* _not_ part of the public API for HDF5 application developers.
*
* Note: This routine must be called as a "pair" with
* H5VLstart_lib_state. It can be called before / after /
* independently of H5VLfree_lib_state.
*
* Note: Should probably rename this to 'H5VLclose_lib_context' or
* similar.
*
* Return: Success: Non-negative
* Failure: Negative
*
*---------------------------------------------------------------------------
*/
herr_t
H5VLfinish_lib_state(void *context)
H5VLclose_lib_context(void *context)
{
herr_t ret_value = SUCCEED; /* Return value */

Expand All @@ -879,7 +839,7 @@ H5VLfinish_lib_state(void *context)

done:
FUNC_LEAVE_API_NOINIT(ret_value)
} /* H5VLfinish_lib_state() */
} /* H5VLclose_lib_context() */

/*---------------------------------------------------------------------------
* Function: H5VLfree_lib_state
Expand Down
43 changes: 41 additions & 2 deletions src/H5VLconnector_passthru.h
Original file line number Diff line number Diff line change
Expand Up @@ -84,9 +84,48 @@ H5_DLL hid_t H5VLwrap_register(void *obj, H5I_type_t type);

/* Library context and state routines */
H5_DLL herr_t H5VLretrieve_lib_state(void **state);
H5_DLL herr_t H5VLstart_lib_state(void **context);
/**
* \ingroup H5VLDEV
*
* \brief Opens a new internal context for the HDF5 library.
*
* \param[out] context library's context
*
* \return Returns a non-negative value if \p *context is set; otherwise returns
* negative value if \p *context is unset.
*
* \details Opens a new internal context for the HDF5 library. The context
* returned (via the OUT parameter) must be passed to
* H5VLfinish_lib_state() to conclude the library's context and
* release resources.
*
* \note \vol_only_api
*
* \since 2.0.0
*
*/
H5_DLL herr_t H5VLopen_lib_context(void **context);
H5_DLL herr_t H5VLrestore_lib_state(const void *state);
H5_DLL herr_t H5VLfinish_lib_state(void *context);
/**
* \ingroup H5VLDEV
*
* \brief Closes the internal state of the HDF5 library.
*
* \param[in] context library's context
*
* \return \herr_t
*
* \details Closes the internal state of the HDF5 library, undoing the effects
* of H5VLstart_lib_state(). This function must be called as a \em pair
* with H5VLstart_lib_state(). It can be invoked before, after, or
* independently of H5VLfree_lib_state().
*
* \note \vol_only_api
*
* \since 2.0.0
*
*/
H5_DLL herr_t H5VLclose_lib_context(void *context);
H5_DLL herr_t H5VLfree_lib_state(void *state);

/* Pass-through callbacks */
Expand Down
Loading