diff options
author | Albert Cheng <acheng@hdfgroup.org> | 2005-08-04 05:17:07 (GMT) |
---|---|---|
committer | Albert Cheng <acheng@hdfgroup.org> | 2005-08-04 05:17:07 (GMT) |
commit | e47d1d053efb2ca38a54d5ed21d209b3576961b2 (patch) | |
tree | 18f1f03b7d82114cd941d2c9a5f22668274c1817 /src/H5Eprivate.h | |
parent | 4d65048d2d5468c79ef0b5c26f18f9262584d06d (diff) | |
download | hdf5-e47d1d053efb2ca38a54d5ed21d209b3576961b2.zip hdf5-e47d1d053efb2ca38a54d5ed21d209b3576961b2.tar.gz hdf5-e47d1d053efb2ca38a54d5ed21d209b3576961b2.tar.bz2 |
[svn-r11195] Purpose:
Feature.
Description:
Added HSYS_ERROR macro to retrieve and push system error message to
the error stack.
Added the related H5E_SYSERRSTR error code.
This allows system error messages be shown to users too. Thus
give a better explanation of what the errors are.
Platforms tested:
h5committested.
Diffstat (limited to 'src/H5Eprivate.h')
-rw-r--r-- | src/H5Eprivate.h | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/src/H5Eprivate.h b/src/H5Eprivate.h index 9c5744f..c5c546a 100644 --- a/src/H5Eprivate.h +++ b/src/H5Eprivate.h @@ -118,6 +118,26 @@ H5_DLL herr_t H5E_push_stack(H5E_t *estack, const char *file, const char *func, H5_DLL herr_t H5E_clear_stack(H5E_t *estack); H5_DLL herr_t H5E_dump_api_stack(int is_api); +/* + * Macros handling system error messages as described in C standard. + * These macros assume errnum is a valid system error code. + */ + +/* Retrieve the error code description string and push it onto the error + * stack. + */ +#define HSYS_ERROR(errnum){ \ + HERROR(H5E_INTERNAL, H5E_SYSERRSTR, strerror(errnum)); \ +} +#define HSYS_DONE_ERROR(majorcode, minorcode, retcode, str){ \ + HSYS_ERROR(errno); \ + HDONE_ERROR(majorcode, minorcode, retcode, str); \ +} +#define HSYS_GOTO_ERROR(majorcode, minorcode, retcode, str){ \ + HSYS_ERROR(errno); \ + HGOTO_ERROR(majorcode, minorcode, retcode, str); \ +} + #ifdef H5_HAVE_PARALLEL /* * MPI error handling macros. |