HDF5  1.13.0
H5E

Error Interface. More...

Functions

herr_t H5Eauto_is_v2 (hid_t estack_id, unsigned *is_stack)
 [H5E_auto2_t_snip] More...
 
herr_t H5Eclear2 (hid_t estack_id)
 Clears the specified error stack or the error stack for the current thread. More...
 
herr_t H5Eclose_msg (hid_t err_id)
 Closes an error message identifier. More...
 
herr_t H5Eclose_stack (hid_t estack_id)
 Closes object handle for error stack. More...
 
hid_t H5Ecreate_msg (hid_t cls, H5E_type_t msg_type, const char *msg)
 Adds major error message to an error class. More...
 
hid_t H5Ecreate_stack (void)
 Creates a new empty error stack. More...
 
herr_t H5Eget_auto2 (hid_t estack_id, H5E_auto2_t *func, void **client_data)
 Returns the settings for the automatic error stack traversal function and its data. More...
 
ssize_t H5Eget_class_name (hid_t class_id, char *name, size_t size)
 Retrieves error class name. More...
 
hid_t H5Eget_current_stack (void)
 Returns a copy of the current error stack. More...
 
ssize_t H5Eget_msg (hid_t msg_id, H5E_type_t *type, char *msg, size_t size)
 Retrieves an error message. More...
 
ssize_t H5Eget_num (hid_t estack_id)
 Retrieves the number of error messages in an error stack. More...
 
herr_t H5Epop (hid_t estack_id, size_t count)
 Close an error message identifier. More...
 
herr_t H5Eprint2 (hid_t estack_id, FILE *stream)
 Prints the specified error stack in a default manner. More...
 
herr_t H5Epush2 (hid_t estack_id, const char *file, const char *func, unsigned line, hid_t cls_id, hid_t maj_id, hid_t min_id, const char *msg,...)
 Pushes new error record onto error stack. More...
 
hid_t H5Eregister_class (const char *cls_name, const char *lib_name, const char *version)
 Registers a client library or application program to the HDF5 error API. More...
 
herr_t H5Eset_auto2 (hid_t estack_id, H5E_auto2_t func, void *client_data)
 Turns automatic error printing on or off. More...
 
herr_t H5Eset_current_stack (hid_t estack_id)
 Replaces the current error stack. More...
 
herr_t H5Eunregister_class (hid_t class_id)
 Removes an error class. More...
 
herr_t H5Ewalk2 (hid_t estack_id, H5E_direction_t direction, H5E_walk2_t func, void *client_data)
 Walks the specified error stack, calling the specified function. More...
 
herr_t H5Eclear1 (void)
 [H5E_auto1_t_snip] More...
 
herr_t H5Eget_auto1 (H5E_auto1_t *func, void **client_data)
 Returns the settings for the automatic error stack traversal function and its data. More...
 
herr_t H5Eprint1 (FILE *stream)
 Prints the specified error stack in a default manner. More...
 
herr_t H5Epush1 (const char *file, const char *func, unsigned line, H5E_major_t maj_id, H5E_minor_t min_id, const char *msg)
 Pushes new error record onto error stack. More...
 
herr_t H5Eset_auto1 (H5E_auto1_t func, void *client_data)
 Turns automatic error printing on or off. More...
 
herr_t H5Ewalk1 (H5E_direction_t direction, H5E_walk1_t func, void *client_data)
 Walks the specified error stack, calling the specified function. More...
 

Detailed Description

Error Interface.

Todo:
Describe concisely what the functions in this module are about.
Todo:
Describe concisely what the functions in this module are about.

Function Documentation

◆ H5Eauto_is_v2()

herr_t H5Eauto_is_v2 ( hid_t  estack_id,
unsigned *  is_stack 
)

[H5E_auto2_t_snip]


Determines type of the error stack

Parameters
[in]estack_idError stack identifier
[out]is_stackFlag indicating version the error stack conforms to
Returns
Returns a non-negative value if successful; otherwise returns a negative value.

H5Eauto_is_v2() determines whether the error auto reporting function for the error stack estack_id conforms to the H5E_auto2_t version or the H5E_auto1_t version.

is_stack is set to 1 if the error stack conforms to H5E_auto2_t and 0 if it conforms to H5E_auto1_t.

Since
1.8.0

◆ H5Eclear1()

herr_t H5Eclear1 ( void  )

[H5E_auto1_t_snip]


Clears the error stack for the current thread

Returns
Returns a non-negative value if successful; otherwise returns a negative value.
Deprecated:
As of HDF5-1.8, this function has been deprecated in favor of the function H5Eclear2().

H5Eclear1() clears the error stack for the current thread.

     The current error stack is also cleared whenever an API function
     is called, with some exceptions, for instance, H5Eprint1().
Version
1.8.0 Function H5Eclear() renamed to H5Eclear1() and deprecated in this release.
Since
?

Clears the error stack for the current thread

Returns
Returns a non-negative value if successful; otherwise returns a negative value.
Deprecated:
As of HDF5-1.8, this function has been deprecated in favor of the function H5Eclear2().

H5Eclear1() clears the error stack for the current thread.

     The current error stack is also cleared whenever an API function
     is called, with some exceptions, for instance, H5Eprint1().
Version
1.8.0 Function H5Eclear() renamed to H5Eclear1() and deprecated in this release.
Since
?

◆ H5Eclear2()

herr_t H5Eclear2 ( hid_t  estack_id)

Clears the specified error stack or the error stack for the current thread.


Parameters
[in]estack_idError stack identifier
Returns
Returns a non-negative value if successful; otherwise returns a negative value.

H5Eclear2() clears the error stack specified by estack_id, or, the error stack for the current thread if estack_id is set to H5E_DEFAULT.

The current error stack is also cleared whenever an API function is called, with some exceptions, for instance, H5Eprint1() or H5Eprint2().

Since
1.8.0

◆ H5Eclose_msg()

herr_t H5Eclose_msg ( hid_t  err_id)

Closes an error message identifier.


Parameters
[in]err_idError message identifier
Returns
Returns a non-negative value if successful; otherwise returns a negative value.

H5Eclose_msg() closes an error message identifier, which can be either a major or minor message.

Since
1.8.0

◆ H5Eclose_stack()

herr_t H5Eclose_stack ( hid_t  estack_id)

Closes object handle for error stack.


Parameters
[in]estack_idError stack identifier
Returns
Returns a non-negative value if successful; otherwise returns a negative value.

H5Eclose_stack() closes the object handle for an error stack and releases its resources. H5E_DEFAULT cannot be closed.

Since
1.8.0

◆ H5Ecreate_msg()

hid_t H5Ecreate_msg ( hid_t  cls,
H5E_type_t  msg_type,
const char *  msg 
)

Adds major error message to an error class.


Parameters
[in]clsError class identifier
[in]msg_typeType of the error message
[in]msgMajor error message
Returns
Returns a message identifier on success; otherwise returns a negative value.

H5Ecreate_msg() adds an error message to an error class defined by client library or application program. The error message can be either major or minor which is indicated by msg_type.

Use H5Eclose_msg() to close the message identifier returned by this function.

Valid values of msg_type are H5E_MAJOR and H5E_MINOR.

Since
1.8.0

◆ H5Ecreate_stack()

hid_t H5Ecreate_stack ( void  )

Creates a new empty error stack.


Returns
Returns an error stack identifier if successful; otherwise returns a negative value.

H5Ecreate_stack() creates a new empty error stack and returns the new stack’s identifier.

Use H5Eclose_stack() to close the error stack identifier returned by this function.

Since
1.8.0

◆ H5Eget_auto1()

herr_t H5Eget_auto1 ( H5E_auto1_t func,
void **  client_data 
)

Returns the settings for the automatic error stack traversal function and its data.


Parameters
[out]funcThe function currently set to be called upon an error condition
[out]client_dataData currently set to be passed to the error function
Returns
Returns a non-negative value if successful; otherwise returns a negative value.
Deprecated:
As of HDF5-1.8, this function has been deprecated in favor of the function H5Eget_auto2().

H5Eget_auto2() returns the settings for the automatic error stack traversal function, func and its data, client_data. Either or both of the func and client_data arguments may be null, in which case the value is not returned.

The library initializes its default error stack traversal functions to H5Eprint1() and H5Eprint2(). A call to H5Eget_auto2() returns H5Eprint2() or the user-defined function passed in through H5Eset_auto2(). A call to H5Eget_auto1() returns H5Eprint1() or the user-defined function passed in through H5Eset_auto1(). However, if the application passes in a user-defined function through H5Eset_auto1(), it should call H5Eget_auto1() to query the traversal function. If the application passes in a user-defined function through H5Eset_auto2(), it should call H5Eget_auto2() to query the traversal function.

Mixing the new style and the old style functions will cause a failure. For example, if the application sets a user-defined old-style traversal function through H5Eset_auto1(), a call to H5Eget_auto2() will fail and will indicate that the application has mixed H5Eset_auto1() and H5Eget_auto2(). On the other hand, mixing H5Eset_auto2() and H5Eget_auto1() will also cause a failure. But if the traversal functions are the library’s default H5Eprint1() or H5Eprint2(), mixing H5Eset_auto1() and H5Eget_auto2() or mixing H5Eset_auto2() and H5Eget_auto1() does not fail.

Version
1.8.0 Function H5Eget_auto() renamed to H5Eget_auto1() and deprecated in this release.
Since
?

Parameters
[out]funcThe function currently set to be called upon an error condition
[out]client_dataData currently set to be passed to the error function
Returns
Returns a non-negative value if successful; otherwise returns a negative value.
Deprecated:
As of HDF5-1.8, this function has been deprecated in favor of the function H5Eget_auto2().

H5Eget_auto2() returns the settings for the automatic error stack traversal function, func and its data, client_data. Either or both of the func and client_data arguments may be null, in which case the value is not returned.

The library initializes its default error stack traversal functions to H5Eprint1() and H5Eprint2(). A call to H5Eget_auto2() returns H5Eprint2() or the user-defined function passed in through H5Eset_auto2(). A call to H5Eget_auto1() returns H5Eprint1() or the user-defined function passed in through H5Eset_auto1(). However, if the application passes in a user-defined function through H5Eset_auto1(), it should call H5Eget_auto1() to query the traversal function. If the application passes in a user-defined function through H5Eset_auto2(), it should call H5Eget_auto2() to query the traversal function.

Mixing the new style and the old style functions will cause a failure. For example, if the application sets a user-defined old-style traversal function through H5Eset_auto1(), a call to H5Eget_auto2() will fail and will indicate that the application has mixed H5Eset_auto1() and H5Eget_auto2(). On the other hand, mixing H5Eset_auto2() and H5Eget_auto1() will also cause a failure. But if the traversal functions are the library’s default H5Eprint1() or H5Eprint2(), mixing H5Eset_auto1() and H5Eget_auto2() or mixing H5Eset_auto2() and H5Eget_auto1() does not fail.

Version
1.8.0 Function H5Eget_auto() renamed to H5Eget_auto1() and deprecated in this release.
Since
?

◆ H5Eget_auto2()

herr_t H5Eget_auto2 ( hid_t  estack_id,
H5E_auto2_t func,
void **  client_data 
)

Returns the settings for the automatic error stack traversal function and its data.


Parameters
[in]estack_idError stack identifier
[out]funcThe function currently set to be called upon an error condition
[out]client_dataData currently set to be passed to the error function
Returns
Returns a non-negative value if successful; otherwise returns a negative value.

H5Eget_auto2() returns the settings for the automatic error stack traversal function, func and its data, client_data, that are associated with the error stack specified by estack_id.

Either or both of the func and client_data arguments may be null, in which case the value is not returned.

The library initializes its default error stack traversal functions to H5Eprint1() and H5Eprint2(). A call to H5Eget_auto2() returns H5Eprint2() or the user-defined function passed in through H5Eset_auto2(). A call to H5Eget_auto1() returns H5Eprint1() or the user-defined function passed in through H5Eset_auto1(). However, if the application passes in a user-defined function through H5Eset_auto1(), it should call H5Eget_auto1() to query the traversal function. If the application passes in a user-defined function through H5Eset_auto2(), it should call H5Eget_auto2() to query the traversal function.

Mixing the new style and the old style functions will cause a failure. For example, if the application sets a user-defined old-style traversal function through H5Eset_auto1(), a call to H5Eget_auto2() will fail and will indicate that the application has mixed H5Eset_auto1() and H5Eget_auto2(). On the other hand, mixing H5Eset_auto2() and H5Eget_auto1() will also cause a failure. But if the traversal functions are the library’s default H5Eprint1() or H5Eprint2(), mixing H5Eset_auto1() and H5Eget_auto2() or mixing H5Eset_auto2() and H5Eget_auto1() does not fail.

Since
1.8.0

◆ H5Eget_class_name()

ssize_t H5Eget_class_name ( hid_t  class_id,
char *  name,
size_t  size 
)

Retrieves error class name.


Parameters
[in]class_idError class identifier
[out]nameName of the class to be queried
[in]sizeLength of the class name to be returned
Returns
Returns non-negative value on success; otherwise returns negative value.

H5Eget_class_name() retrieves the name of the error class specified by class_id. If non-NULL pointer is passed in for name and size is greater than zero, the class name of size long is returned. The length of the error class name is also returned. If NULL is passed in as name, only the length of class name is returned. If zero is returned, it means no name. User is responsible for allocated large enough buffer for the name.

Since
1.8.0

◆ H5Eget_current_stack()

hid_t H5Eget_current_stack ( void  )

Returns a copy of the current error stack.


Returns
Returns an error stack identifier if successful; otherwise returns a negative value.

H5Eget_current_stack() copies the current error stack and returns an error stack identifier for the new copy.

Since
1.8.0

◆ H5Eget_msg()

ssize_t H5Eget_msg ( hid_t  msg_id,
H5E_type_t type,
char *  msg,
size_t  size 
)

Retrieves an error message.


Parameters
[in]msg_idIdentifier for error message to be queried
[out]typeType of the error message
[out]msgError message buffer
[in]sizeLength of error message to be returned
Returns
Returns the size of the error message in bytes on success; otherwise returns a negative value.

H5Eget_msg() retrieves the error message including its length and type. The error message is specified by msg_id. User is responsible for passing in large enough buffer for the message. If msg is not NULL and size is greater than zero, the error message of size long is returned. The length of the message is also returned. If NULL is passed in as msg, only the length and type of the message is returned. If the return value is zero, it means no message.

Valid values for type are H5E_MAJOR and H5E_MINOR.

Since
1.8.0

◆ H5Eget_num()

ssize_t H5Eget_num ( hid_t  estack_id)

Retrieves the number of error messages in an error stack.


Parameters
[in]estack_idError stack identifier
Returns
Returns the number of error records in the error stack

H5Eget_num() returns the number of error records in the error stack specified by estack_id (including major, minor messages and description).

Since
1.8.0

◆ H5Epop()

herr_t H5Epop ( hid_t  estack_id,
size_t  count 
)

Close an error message identifier.


Parameters
[in]estack_idError stack identifier
[in]countThe number of error messages to be deleted from the top of error stack
Returns
Returns a non-negative value if successful; otherwise returns a negative value.

H5Epop() deletes count records from the top of the error stack estack_id (including major, minor messages and description).

Since
1.8.0

◆ H5Eprint1()

herr_t H5Eprint1 ( FILE *  stream)

Prints the specified error stack in a default manner.


Parameters
[in]streamFile pointer, or stderr if NULL
Returns
Returns a non-negative value if successful; otherwise returns a negative value.
Deprecated:
As of HDF5-1.8, this function has been deprecated in favor of the function H5Eprint2() or the macro H5Eprint().

H5Eprint2() prints the error stack specified by estack_id on the specified stream, stream. Even if the error stack is empty, a one-line message of the following form will be printed:

HDF5-DIAG: Error detected in HDF5 library version: 1.5.62 thread 0.

A similar line will appear before the error messages of each error class stating the library name, library version number, and thread identifier.

If estack_id is H5E_DEFAULT, the current error stack will be printed.

H5Eprint2() is a convenient function for H5Ewalk2 with a function that prints error messages. Users are encouraged to write their own more specific error handlers.

Version
1.8.0 Function H5Eprint() renamed to H5Eprint1() and deprecated in this release.
Since
?

Parameters
[in]streamFile pointer, or stderr if NULL
Returns
Returns a non-negative value if successful; otherwise returns a negative value.
Deprecated:
As of HDF5-1.8, this function has been deprecated in favor of the function H5Eprint2() or the macro H5Eprint().

H5Eprint2() prints the error stack specified by estack_id on the specified stream, stream. Even if the error stack is empty, a one-line message of the following form will be printed:

HDF5-DIAG: Error detected in HDF5 library version: 1.5.62 thread 0.

A similar line will appear before the error messages of each error class stating the library name, library version number, and thread identifier.

If estack_id is H5E_DEFAULT, the current error stack will be printed.

H5Eprint2() is a convenient function for H5Ewalk2 with a function that prints error messages. Users are encouraged to write their own more specific error handlers.

Version
1.8.0 Function H5Eprint() renamed to H5Eprint1() and deprecated in this release.
Since
?

◆ H5Eprint2()

herr_t H5Eprint2 ( hid_t  estack_id,
FILE *  stream 
)

Prints the specified error stack in a default manner.


Parameters
[in]estack_idError stack identifier
[in]streamFile pointer, or stderr if NULL
Returns
Returns a non-negative value if successful; otherwise returns a negative value.

H5Eprint2() prints the error stack specified by estack_id on the specified stream, stream. Even if the error stack is empty, a one-line message of the following form will be printed:

HDF5-DIAG: Error detected in HDF5 library version: 1.5.62 thread 0.

A similar line will appear before the error messages of each error class stating the library name, library version number, and thread identifier.

If estack_id is H5E_DEFAULT, the current error stack will be printed.

H5Eprint2() is a convenient function for H5Ewalk2 with a function that prints error messages. Users are encouraged to write their own more specific error handlers.

Since
1.8.0

◆ H5Epush1()

herr_t H5Epush1 ( const char *  file,
const char *  func,
unsigned  line,
H5E_major_t  maj_id,
H5E_minor_t  min_id,
const char *  msg 
)

Pushes new error record onto error stack.


Parameters
[in]fileName of the file in which the error was detected
[in]funcName of the function in which the error was detected
[in]lineLine number within the file at which the error was detected
[in]maj_idMajor error identifier
[in]min_idMinor error identifier
[in]msgError description string
Returns
Returns a non-negative value if successful; otherwise returns a negative value.
Deprecated:
As of HDF5-1.8, this function has been deprecated in favor of the function H5Epush2() or the macro H5Epush().

H5Epush1() pushes a new error record onto the error stack for the current thread.

The error has major and minor numbers maj_id and min_id, the function func where the error was detected, the name of the file file where the error was detected, the line line within that file, and an error description string msg.

The function name, filename, and error description strings must be statically allocated.

msg can be a format control string with additional arguments. This design of appending additional arguments is similar to the system and C functions printf and fprintf.

Version
1.8.0 Function H5Epush() renamed to H5Epush1() and deprecated in this release.
Since
1.4.0

Parameters
[in]fileName of the file in which the error was detected
[in]funcName of the function in which the error was detected
[in]lineLine number within the file at which the error was detected
[in]maj_idMajor error identifier
[in]min_idMinor error identifier
[in]msgError description string
Returns
Returns a non-negative value if successful; otherwise returns a negative value.
Deprecated:
As of HDF5-1.8, this function has been deprecated in favor of the function H5Epush2() or the macro H5Epush().

H5Epush1() pushes a new error record onto the error stack for the current thread.

The error has major and minor numbers maj_id and min_id, the function func where the error was detected, the name of the file file where the error was detected, the line line within that file, and an error description string msg.

The function name, filename, and error description strings must be statically allocated.

msg can be a format control string with additional arguments. This design of appending additional arguments is similar to the system and C functions printf and fprintf.

Version
1.8.0 Function H5Epush() renamed to H5Epush1() and deprecated in this release.
Since
1.4.0

◆ H5Epush2()

herr_t H5Epush2 ( hid_t  estack_id,
const char *  file,
const char *  func,
unsigned  line,
hid_t  cls_id,
hid_t  maj_id,
hid_t  min_id,
const char *  msg,
  ... 
)

Pushes new error record onto error stack.


Parameters
[in]estack_idError stack identifier
[in]fileName of the file in which the error was detected
[in]funcName of the function in which the error was detected
[in]lineLine number within the file at which the error was detected
[in]cls_idError class identifier
[in]maj_idMajor error identifier
[in]min_idMinor error identifier
[in]msgError description string
Returns
Returns a non-negative value if successful; otherwise returns a negative value.

H5Epush2() pushes a new error record onto the error stack specified by estack_id.

The error record contains the error class identifier class_id, the major and minor message identifiers major_id and minor_id, the function name func where the error was detected, the file name file and line number line within that file where the error was detected, and an error description msg.

The major and minor errors must be in the same error class.

The function name, filename, and error description strings must be statically allocated.

msg can be a format control string with additional arguments. This design of appending additional arguments is similar to the system and C functions printf and fprintf.

Since
1.8.0

◆ H5Eregister_class()

hid_t H5Eregister_class ( const char *  cls_name,
const char *  lib_name,
const char *  version 
)

Registers a client library or application program to the HDF5 error API.


Parameters
[in]cls_nameName of the error class
[in]lib_nameName of the client library or application to which the error class belongs
[in]versionVersion of the client library or application to which the error class belongs
Returns
Returns a class identifier on success; otherwise, a negative value.

H5Eregister_class() registers a client library or application program to the HDF5 error API so that the client library or application program can report errors together with the HDF5 library. It receives an identifier for this error class for further error operations. The library name and version number will be printed out in the error message as a preamble.

A NULL can be passed in for version.

Since
1.8.0

◆ H5Eset_auto1()

herr_t H5Eset_auto1 ( H5E_auto1_t  func,
void *  client_data 
)

Turns automatic error printing on or off.


Parameters
[in]funcFunction to be called upon an error condition
[in]client_dataData passed to the error function
Returns
Returns a non-negative value if successful; otherwise returns a negative value.
Deprecated:
As of HDF5-1.8, this function has been deprecated in favor of the function H5Eset_auto2().

H5Eset_auto2() turns on or off automatic printing of errors. When turned on, by the use of a non-null func pointer, any API function which returns an error indication will first call func, passing it client_data as an argument.

func, a function compliant with the H5E_auto2_t prototype, is defined in the H5Epublic.h source code file as:

typedef herr_t (*H5E_auto2_t)(hid_t estack, void *client_data);

When the library is first initialized, the auto printing function is set to H5Eprint2() (cast appropriately) and client_data is the standard error stream pointer, stderr.

Automatic stack traversal is always in the H5E_WALK_DOWNWARD direction.

Automatic error printing is turned off with a H5Eset_auto2() call with a NULL func pointer.

Version
1.8.0 Function H5Eset_auto() renamed to H5Eset_auto1() and deprecated in this release.
Since
?

Parameters
[in]funcFunction to be called upon an error condition
[in]client_dataData passed to the error function
Returns
Returns a non-negative value if successful; otherwise returns a negative value.
Deprecated:
As of HDF5-1.8, this function has been deprecated in favor of the function H5Eset_auto2().

H5Eset_auto2() turns on or off automatic printing of errors. When turned on, by the use of a non-null func pointer, any API function which returns an error indication will first call func, passing it client_data as an argument.

func, a function compliant with the H5E_auto2_t prototype, is defined in the H5Epublic.h source code file as:

typedef herr_t (*H5E_auto2_t)(hid_t estack, void *client_data);

When the library is first initialized, the auto printing function is set to H5Eprint2() (cast appropriately) and client_data is the standard error stream pointer, stderr.

Automatic stack traversal is always in the H5E_WALK_DOWNWARD direction.

Automatic error printing is turned off with a H5Eset_auto2() call with a NULL func pointer.

Version
1.8.0 Function H5Eset_auto() renamed to H5Eset_auto1() and deprecated in this release.
Since
?

◆ H5Eset_auto2()

herr_t H5Eset_auto2 ( hid_t  estack_id,
H5E_auto2_t  func,
void *  client_data 
)

Turns automatic error printing on or off.


Parameters
[in]estack_idError stack identifier
[in]funcFunction to be called upon an error condition
[in]client_dataData passed to the error function
Returns
Returns a non-negative value if successful; otherwise returns a negative value.

H5Eset_auto2() turns on or off automatic printing of errors for the error stack specified with estack_id. An estack_id value of H5E_DEFAULT indicates the current stack.

When automatic printing is turned on, by the use of a non-null func pointer, any API function which returns an error indication will first call func, passing it client_data as an argument.

func, a function compliant with the H5E_auto2_t prototype, is defined in the H5Epublic.h source code file as:

typedef herr_t (*H5E_auto2_t)(hid_t estack, void *client_data);

When the library is first initialized, the auto printing function is set to H5Eprint2() (cast appropriately) and client_data is the standard error stream pointer, stderr.

Automatic stack traversal is always in the H5E_WALK_DOWNWARD direction.

Automatic error printing is turned off with a H5Eset_auto2() call with a NULL func pointer.

Since
1.8.0

◆ H5Eset_current_stack()

herr_t H5Eset_current_stack ( hid_t  estack_id)

Replaces the current error stack.


Parameters
[in]estack_idError stack identifier
Returns
Returns a non-negative value if successful; otherwise returns a negative value.

H5Eset_current_stack() replaces the content of the current error stack with a copy of the content of the error stack specified by estack_id, and it closes the error stack specified by estack_id.

Since
1.8.0

◆ H5Eunregister_class()

herr_t H5Eunregister_class ( hid_t  class_id)

Removes an error class.


Parameters
[in]class_idError class identifier
Returns
Returns a non-negative value if successful; otherwise returns a negative value.

H5Eunregister_class() removes the error class specified by class_id. All the major and minor errors in this class will also be closed.

Since
1.8.0

◆ H5Ewalk1()

herr_t H5Ewalk1 ( H5E_direction_t  direction,
H5E_walk1_t  func,
void *  client_data 
)

Walks the specified error stack, calling the specified function.


Parameters
[in]directionDirection in which the error stack is to be walked
[in]funcFunction to be called for each error encountered
[in]client_dataData to be passed with func
Returns
Returns a non-negative value if successful; otherwise returns a negative value.
Deprecated:
As of HDF5-1.8, this function has been deprecated in favor of the function H5Ewalk2() or the macro H5Ewalk().

H5Ewalk1() walks the error stack for the current thread and calls the function specified in func for each error along the way.

direction specifies whether the stack is walked from the inside out or the outside in. A value of H5E_WALK_UPWARD means to 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 innermost 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 n (beginning at zero regardless of stack traversal direction), an error stack entry err_desc, and the client_data pointer passed to H5Eprint(). The H5E_walk1_t prototype is as follows:

typedef herr_t (*H5E_walk1_t)(int n, H5E_error1_t *err_desc, void *client_data);

where the parameters are described in the following table:

n Indexed position of the error in the stack
err_desc 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 definition list of major and minor error codes; that information will eventually be presented as an appendix to this HDF5 Reference Manual.)
client_data Pointer to client data in the format expected by the user-defined function
Attention
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++
     “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.
Version
1.8.0 Function H5Ewalk() renamed to H5Ewalk1() and deprecated in this release.
Since
?

Parameters
[in]directionDirection in which the error stack is to be walked
[in]funcFunction to be called for each error encountered
[in]client_dataData to be passed with func
Returns
Returns a non-negative value if successful; otherwise returns a negative value.
Deprecated:
As of HDF5-1.8, this function has been deprecated in favor of the function H5Ewalk2() or the macro H5Ewalk().

H5Ewalk1() walks the error stack for the current thread and calls the function specified in func for each error along the way.

direction specifies whether the stack is walked from the inside out or the outside in. A value of H5E_WALK_UPWARD means to 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 innermost 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 n (beginning at zero regardless of stack traversal direction), an error stack entry err_desc, and the client_data pointer passed to H5Eprint(). The H5E_walk1_t prototype is as follows:

typedef herr_t (*H5E_walk1_t)(int n, H5E_error1_t *err_desc, void *client_data);

where the parameters are described in the following table:

n Indexed position of the error in the stack
err_desc 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 definition list of major and minor error codes; that information will eventually be presented as an appendix to this HDF5 Reference Manual.)
client_data Pointer to client data in the format expected by the user-defined function
Attention
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++
     “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.
Version
1.8.0 Function H5Ewalk() renamed to H5Ewalk1() and deprecated in this release.
Since
?

◆ H5Ewalk2()

herr_t H5Ewalk2 ( hid_t  estack_id,
H5E_direction_t  direction,
H5E_walk2_t  func,
void *  client_data 
)

Walks the specified error stack, calling the specified function.


Parameters
[in]estack_idError stack identifier
[in]directionDirection in which the error stack is to be walked
[in]funcFunction to be called for each error encountered
[in]client_dataData to be passed with func
Returns
Returns a non-negative value if successful; otherwise returns a negative value.

H5Ewalk2() walks the error stack specified by estack_id for the current thread and calls the function specified in func for each error along the way.

If the value of estack_id is H5E_DEFAULT, then H5Ewalk2() walks the current error stack.

direction specifies whether the stack is walked from the inside out or the outside in. A value of H5E_WALK_UPWARD means to 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 innermost function where the error was first detected.

func, a function compliant with the H5E_walk2_t prototype, will be called for each error in the error stack. Its arguments will include an index number n (beginning at zero regardless of stack traversal direction), an error stack entry err_desc, and the client_data pointer passed to H5Eprint(). The H5E_walk2_t prototype is as follows:

typedef herr_t (*H5E_walk2_t)(unsigned n, const H5E_error2_t *err_desc, void *client_data);

where the parameters are described in the following table:

n Indexed position of the error in the stack
err_desc 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 definition list of major and minor error codes; that information will eventually be presented as an appendix to this HDF5 Reference Manual.)
client_data Pointer to client data in the format expected by the user-defined function
Attention
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++
     “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.
Since
1.8.0
H5E_auto2_t
herr_t(* H5E_auto2_t)(hid_t estack, void *client_data)
[H5E_walk2_t_snip]
Definition: H5Epublic.h:155
hid_t
int64_t hid_t
Definition: H5Ipublic.h:59
H5E_error2_t
Definition: H5Epublic.h:36
H5E_error1_t
Definition: H5Epublic.h:731
H5E_walk2_t
herr_t(* H5E_walk2_t)(unsigned n, const H5E_error2_t *err_desc, void *client_data)
[H5E_walk2_t_snip]
Definition: H5Epublic.h:151
herr_t
int herr_t
Definition: H5public.h:128
H5E_walk1_t
herr_t(* H5E_walk1_t)(int n, H5E_error1_t *err_desc, void *client_data)
[H5E_walk1_t_snip]
Definition: H5Epublic.h:742