H5E_WALK1 walks the error stack for the current thread and calls the specified function for each error along the way.
direction determines whether the stack is walked from the inside out or the outside in. A value of
H5E_WALK_UPWARD means begin with the most specific error and end at the API; a value of
H5E_WALK_DOWNWARD means to start at the API and end at the inner-most function where the error was first detected.
func will be called for each error in the error stack. Its arguments will include an index number (beginning at zero regardless of stack traversal direction), an error stack entry, and the
client_data pointer passed to H5E_PRINT. The
H5E_walk1_t prototype is as follows:
n, H5E_error1_t *
err_desc, void *
where the parameters have the following meanings:
|Indexed position of the error in the stack|
Pointer to a data structure describing the error
(This structure is currently described only in the source code file hdf5/src/H5Epublic.h. That file also contains the definitive list of major and minor error codes. That information will eventually be presented as an appendix to this Reference Manual.)
|Pointer to client data in the format expected by the user-defined function|
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 H5P_SET_ELINK_CB and H5P_SET_TYPE_CONV_CB and functions such as H5T_CONVERT and H5E_WALK2.
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++ “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.