From 9cae5a61301ff73fcf8aec824d0c75c46be32bb3 Mon Sep 17 00:00:00 2001 From: hyung-hwan Date: Fri, 3 Jan 2020 14:22:20 +0000 Subject: [PATCH] removed hawk_rtx_seterror() --- hawk/lib/err.c | 18 ------------------ hawk/lib/hawk.h | 18 ++++++------------ 2 files changed, 6 insertions(+), 30 deletions(-) diff --git a/hawk/lib/err.c b/hawk/lib/err.c index 3f7a6c18..2acd1715 100644 --- a/hawk/lib/err.c +++ b/hawk/lib/err.c @@ -529,24 +529,6 @@ void hawk_rtx_seterrufmt (hawk_rtx_t* rtx, const hawk_loc_t* errloc, hawk_errnum rtx->_gem.errloc = (errloc? *errloc: _nullloc); } - -void hawk_rtx_seterror (hawk_rtx_t* rtx, hawk_errnum_t errnum, const hawk_oocs_t* errarg, const hawk_loc_t* errloc) -{ - /* TODO: remove awk_rtx_seterror() and substitute hawk_rtx_seterrfmt()/seterrbfmt()/seterrufmt() */ - const hawk_ooch_t* errfmt; - - rtx->_gem.errnum = errnum; - - errfmt = hawk_geterrstr(hawk_rtx_gethawk(rtx))(hawk_rtx_gethawk(rtx), errnum); - HAWK_ASSERT (errfmt != HAWK_NULL); -/* TODO: this change is buggy... copying won't process arguments... - hawk_strxfncpy (rtx->_gem.errmsg, HAWK_COUNTOF(rtx->_gem.errmsg), errfmt, errarg); -*/ - hawk_copy_oocstr(rtx->_gem.errmsg, HAWK_COUNTOF(rtx->_gem.errmsg), errfmt); -/* TODO: remove awk_rtx_seterror() and substitute hawk_rtx_seterrfmt()/seterrbfmt()/seterrufmt() */ - rtx->_gem.errloc = (errloc? *errloc: _nullloc); -} - void hawk_rtx_errortohawk (hawk_rtx_t* rtx, hawk_t* hawk) { /* copy error information in 'rtx' to the 'hawk' object */ diff --git a/hawk/lib/hawk.h b/hawk/lib/hawk.h index d0d94dfb..2cad3e35 100644 --- a/hawk/lib/hawk.h +++ b/hawk/lib/hawk.h @@ -2437,10 +2437,10 @@ HAWK_EXPORT void hawk_rtx_geterrinf ( * \a errmsg; the error line into memory pointed to by \a errlin. */ HAWK_EXPORT void hawk_rtx_geterror ( - hawk_rtx_t* rtx, /**< runtime context */ - hawk_errnum_t* errnum, /**< error number */ - const hawk_ooch_t** errmsg, /**< error message */ - hawk_loc_t* errloc /**< error location */ + hawk_rtx_t* rtx, /**< runtime context */ + hawk_errnum_t* errnum, /**< error number */ + const hawk_ooch_t** errmsg, /**< error message */ + hawk_loc_t* errloc /**< error location */ ); #if defined(HAWK_HAVE_INLINE) @@ -2480,15 +2480,9 @@ HAWK_EXPORT void hawk_rtx_seterrufmt ( #endif /** - * The hawk_rtx_seterror() function sets error information. + * The hawk_rtx_errortohawk() function copies the error information stored + * in the \a rtx object to the \a hawk object. */ -HAWK_EXPORT void hawk_rtx_seterror ( - hawk_rtx_t* rtx, /**< runtime context */ - hawk_errnum_t errnum, /**< error number */ - const hawk_oocs_t* errarg, /**< argument array for formatting an error message */ - const hawk_loc_t* errloc /**< error line */ -); - HAWK_EXPORT void hawk_rtx_errortohawk ( hawk_rtx_t* rtx, hawk_t* hawk