diff options
Diffstat (limited to 'src/H5Epkg.h')
-rw-r--r-- | src/H5Epkg.h | 60 |
1 files changed, 50 insertions, 10 deletions
diff --git a/src/H5Epkg.h b/src/H5Epkg.h index 5e36b38..a85ddc9 100644 --- a/src/H5Epkg.h +++ b/src/H5Epkg.h @@ -41,6 +41,9 @@ /* Amount to indent each error */ #define H5E_INDENT 2 +/* Number of slots in an error stack */ +#define H5E_NSLOTS 32 + #ifdef H5_HAVE_THREADSAFE /* * The per-thread error stack. pthread_once() initializes a special @@ -65,11 +68,49 @@ /****************************/ /* Some syntactic sugar to make the compiler happy with two different kinds of callbacks */ -typedef union { - H5E_auto_t efunc; /* Old-style callback, NO error stack param. */ - H5E_auto2_t efunc2; /* New-style callback, with error stack param. */ +typedef struct { + unsigned vers; /* Which version callback to use */ + union { +#ifndef H5_NO_DEPRECATED_SYMBOLS + H5E_auto1_t func1; /* Old-style callback, NO error stack param. */ +#endif /* H5_NO_DEPRECATED_SYMBOLS */ + H5E_auto2_t func2; /* New-style callback, with error stack param. */ + }u; } H5E_auto_op_t; +/* Some syntactic sugar to make the compiler happy with two different kinds of callbacks */ +typedef struct { + unsigned vers; /* Which version callback to use */ + union { +#ifndef H5_NO_DEPRECATED_SYMBOLS + H5E_walk1_t func1; /* Old-style callback, NO error stack param. */ +#endif /* H5_NO_DEPRECATED_SYMBOLS */ + H5E_walk2_t func2; /* New-style callback, with error stack param. */ + }u; +} H5E_walk_op_t; + +/* Error class */ +typedef struct H5E_cls_t { + char *cls_name; /* Name of error class */ + char *lib_name; /* Name of library within class */ + char *lib_vers; /* Version of library */ +} H5E_cls_t; + +/* Major or minor message */ +typedef struct H5E_msg_t { + char *msg; /* Message for error */ + H5E_type_t type; /* Type of error (major or minor) */ + H5E_cls_t *cls; /* Which error class this message belongs to */ +} H5E_msg_t; + +/* Error stack */ +struct H5E_t { + size_t nused; /* Num slots currently used in stack */ + H5E_error2_t slot[H5E_NSLOTS]; /* Array of error records */ + H5E_auto_op_t auto_op; /* Operator for 'automatic' error reporting */ + void *auto_data; /* Callback data for 'automatic error reporting */ +}; + /*****************************/ /* Package Private Variables */ @@ -91,14 +132,13 @@ H5_DLL H5E_t *H5E_get_stack(void); #endif /* H5_HAVE_THREADSAFE */ H5_DLL ssize_t H5E_get_msg(const H5E_msg_t *msg_ptr, H5E_type_t *type, char *msg, size_t size); -H5_DLL herr_t H5E_print2(const H5E_t *estack, FILE *stream, hbool_t bk_compat); -H5_DLL herr_t H5E_walk2(const H5E_t *estack, H5E_direction_t direction, - H5E_walk_t func, H5E_walk2_t stack_func, hbool_t bk_compatible, +H5_DLL herr_t H5E_print(const H5E_t *estack, FILE *stream, hbool_t bk_compat); +H5_DLL herr_t H5E_walk(const H5E_t *estack, H5E_direction_t direction, + const H5E_walk_op_t *op, void *client_data); +H5_DLL herr_t H5E_get_auto(const H5E_t *estack, H5E_auto_op_t *op, + void **client_data); +H5_DLL herr_t H5E_set_auto(H5E_t *estack, const H5E_auto_op_t *op, void *client_data); -H5_DLL herr_t H5E_get_auto2(const H5E_t *estack, hbool_t new_api, - H5E_auto_op_t *func, void **client_data); -H5_DLL herr_t H5E_set_auto2(H5E_t *estack, hbool_t new_api, - H5E_auto_op_t *func, void *client_data); H5_DLL herr_t H5E_pop(H5E_t *err_stack, size_t count); #endif /* _H5HFpkg_H */ |