diff options
author | Allen Byrne <byrn@hdfgroup.org> | 2020-10-01 16:47:45 (GMT) |
---|---|---|
committer | Allen Byrne <byrn@hdfgroup.org> | 2020-10-01 16:47:45 (GMT) |
commit | 1ba1f2f3222cbe8df0bf601929a4bffd478d7e02 (patch) | |
tree | ae51dfc33cf40432dad25a5088767115a98f195e /src/H5Epkg.h | |
parent | 8eef7d295cc3dd134aef0a826f1de4287629996d (diff) | |
download | hdf5-1ba1f2f3222cbe8df0bf601929a4bffd478d7e02.zip hdf5-1ba1f2f3222cbe8df0bf601929a4bffd478d7e02.tar.gz hdf5-1ba1f2f3222cbe8df0bf601929a4bffd478d7e02.tar.bz2 |
Source formatted
Diffstat (limited to 'src/H5Epkg.h')
-rw-r--r-- | src/H5Epkg.h | 78 |
1 files changed, 35 insertions, 43 deletions
diff --git a/src/H5Epkg.h b/src/H5Epkg.h index 8c1656b..3014d21 100644 --- a/src/H5Epkg.h +++ b/src/H5Epkg.h @@ -31,16 +31,15 @@ /* Other private headers needed by this file */ - /**************************/ /* Package Private Macros */ /**************************/ /* Amount to indent each error */ -#define H5E_INDENT 2 +#define H5E_INDENT 2 /* Number of slots in an error stack */ -#define H5E_NSLOTS 32 +#define H5E_NSLOTS 32 #ifdef H5_HAVE_THREADSAFE /* @@ -52,7 +51,7 @@ * In order for this macro to work, H5E_get_my_stack() must be preceeded * by "H5E_t *estack =". */ -#define H5E_get_my_stack() H5E_get_stack() +#define H5E_get_my_stack() H5E_get_stack() #else /* H5_HAVE_THREADSAFE */ /* * The current error stack. @@ -60,7 +59,6 @@ #define H5E_get_my_stack() (H5E_stack_g + 0) #endif /* H5_HAVE_THREADSAFE */ - /****************************/ /* Package Private Typedefs */ /****************************/ @@ -68,53 +66,52 @@ /* Some syntactic sugar to make the compiler happy with two different kinds of callbacks */ #ifndef H5_NO_DEPRECATED_SYMBOLS typedef struct { - unsigned vers; /* Which version callback to use */ - hbool_t is_default; /* If the printing function is the library's own. */ - H5E_auto1_t func1; /* Old-style callback, NO error stack param. */ - H5E_auto2_t func2; /* New-style callback, with error stack param. */ - H5E_auto1_t func1_default; /* The saved library's default function - old style. */ - H5E_auto2_t func2_default; /* The saved library's default function - new style. */ + unsigned vers; /* Which version callback to use */ + hbool_t is_default; /* If the printing function is the library's own. */ + H5E_auto1_t func1; /* Old-style callback, NO error stack param. */ + H5E_auto2_t func2; /* New-style callback, with error stack param. */ + H5E_auto1_t func1_default; /* The saved library's default function - old style. */ + H5E_auto2_t func2_default; /* The saved library's default function - new style. */ } H5E_auto_op_t; -#else /* H5_NO_DEPRECATED_SYMBOLS */ +#else /* H5_NO_DEPRECATED_SYMBOLS */ typedef struct { - H5E_auto_t func2; /* Only the new style callback function is available. */ + H5E_auto_t func2; /* Only the new style callback function is available. */ } H5E_auto_op_t; -#endif /* H5_NO_DEPRECATED_SYMBOLS */ +#endif /* H5_NO_DEPRECATED_SYMBOLS */ /* Some syntactic sugar to make the compiler happy with two different kinds of callbacks */ typedef struct { - unsigned vers; /* Which version callback to use */ + 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_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 */ + 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 */ + 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 */ + 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 */ /*****************************/ @@ -123,10 +120,9 @@ struct H5E_t { /* * The current error stack. */ -H5_DLLVAR H5E_t H5E_stack_g[1]; +H5_DLLVAR H5E_t H5E_stack_g[1]; #endif /* H5_HAVE_THREADSAFE */ - /******************************/ /* Package Private Prototypes */ /******************************/ @@ -134,16 +130,12 @@ H5_DLL herr_t H5E__term_deprec_interface(void); #ifdef H5_HAVE_THREADSAFE 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_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_pop(H5E_t *err_stack, size_t count); +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_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_pop(H5E_t *err_stack, size_t count); #endif /* _H5Epkg_H */ - |