diff options
author | Quincey Koziol <koziol@hdfgroup.org> | 2007-08-21 21:08:27 (GMT) |
---|---|---|
committer | Quincey Koziol <koziol@hdfgroup.org> | 2007-08-21 21:08:27 (GMT) |
commit | cdd4606430edbb9b322c1abd55b2a4cdff936088 (patch) | |
tree | a1bfe5c7d3027df3b9179958d426ef36143625b9 /src/H5Epkg.h | |
parent | 6262a14f2e6f669f72e0212b4ce3654c9526f1dc (diff) | |
download | hdf5-cdd4606430edbb9b322c1abd55b2a4cdff936088.zip hdf5-cdd4606430edbb9b322c1abd55b2a4cdff936088.tar.gz hdf5-cdd4606430edbb9b322c1abd55b2a4cdff936088.tar.bz2 |
[svn-r14097] Description:
First real use of API versioning code, H5E routines switched to use
new API versioning scheme.
Tested on:
Mac OS X/32 10.4.10 (amazon)
FreeBSD/32 6.2 (duty)
FreeBSD/64 6.2 (liberty)
Linux/32 2.6 (kagiso)
Linux/64 2.6 (smirom)
Solaris/32 5.10 (linew)
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 */ |