[svn-r1783] Added public H5Epush... routines and macros.

This commit is contained in:
Quincey Koziol 1999-10-20 12:46:55 -05:00
parent 4d1a3a2892
commit f1f675be43
2 changed files with 55 additions and 0 deletions

View File

@ -522,6 +522,37 @@ H5E_push(H5E_major_t maj_num, H5E_minor_t min_num, const char *function_name,
return SUCCEED; /*don't use FUNC_LEAVE() here */
}
/*-------------------------------------------------------------------------
* Function: H5Epush
*
* Purpose: Pushes a new error record onto error stack for the current
* thread. The error has major and minor numbers MAJ_NUM and
* MIN_NUM, the name of a function where the error was detected,
* the name of the file where the error was detected, the
* line within that file, and an error description string. The
* function name, file name, and error description strings must
* be statically allocated.
*
* Return: Non-negative on success/Negative on failure
*
* Programmer: Quincey Koziol
* Monday, October 18, 1999
*
* Notes: Basically a public API wrapper around the H5E_push function.
*
* Modifications:
*
*-------------------------------------------------------------------------
*/
__DLL__ herr_t H5Epush(const char *file, const char *func,
unsigned line, H5E_major_t maj, H5E_minor_t min, const char *str)
{
FUNC_ENTER(H5Epush, FAIL);
FUNC_LEAVE(H5E_push(maj,min,func,file,line,str));
} /* end H5Epush() */
/*-------------------------------------------------------------------------
* Function: H5E_clear

View File

@ -46,6 +46,28 @@
H5Eset_auto (H5E_saved_efunc, H5E_saved_edata); \
} while(0)
/*
* Public API Convenience Macros for Error reporting - Documented
*/
/* Use the Standard C __FILE__ & __LINE__ macros instead of typing them in */
#define H5Epush_sim(func,maj,min,str) H5Epush(__FILE__,func,__LINE__,maj,min,str)
/*
* Public API Convenience Macros for Error reporting - Undocumented
*/
/* Use the Standard C __FILE__ & __LINE__ macros instead of typing them in */
/* And return after pushing error onto stack */
#define H5Epush_ret(func,maj,min,str,ret) { \
H5Epush(__FILE__,func,__LINE__,maj,min,str); \
return(ret); \
}
/* Use the Standard C __FILE__ & __LINE__ macros instead of typing them in */
/* And goto a label after pushing error onto stack */
#define H5Epush_goto(func,maj,min,str,label) { \
H5Epush(__FILE__,func,__LINE__,maj,min,str); \
goto (label); \
}
/*
* Declare an enumerated type which holds all the valid major HDF error codes.
@ -187,6 +209,8 @@ __DLL__ herr_t H5Ewalk (H5E_direction_t direction, H5E_walk_t func,
__DLL__ herr_t H5Ewalk_cb (int n, H5E_error_t *err_desc, void *client_data);
__DLL__ const char *H5Eget_major (H5E_major_t major_number);
__DLL__ const char *H5Eget_minor (H5E_minor_t minor_number);
__DLL__ herr_t H5Epush(const char *file, const char *func,
unsigned line, H5E_major_t maj, H5E_minor_t min, const char *str);
#ifdef __cplusplus
}