changed hcl_seterrxxx() functions

This commit is contained in:
hyung-hwan 2018-04-06 14:37:40 +00:00
parent 4ff11f147c
commit 8726768be2
3 changed files with 11 additions and 13 deletions

View File

@ -84,11 +84,11 @@ enum hcl_errnum_t
HCL_EIOERR, /**< I/O error */ HCL_EIOERR, /**< I/O error */
HCL_EECERR, /**< encoding conversion error */ HCL_EECERR, /**< encoding conversion error */
HCL_EBUFFULL, /**< buffer full */ HCL_EBUFFULL, /**< buffer full */
HCL_ESYNERR, /**< syntax error */ HCL_ESYNERR, /**< syntax error */
HCL_ECALL, /**< runtime error - cannot call */ HCL_ECALL, /**< runtime error - cannot call */
HCL_ERECALL, /**< runtime error - cannot call again */ HCL_ERECALL, /**< runtime error - cannot call again */
HCL_ECALLARG /**< runtime error - wrong number of arguments to call */ HCL_ECALLARG /**< runtime error - wrong number of arguments to call */
}; };
typedef enum hcl_errnum_t hcl_errnum_t; typedef enum hcl_errnum_t hcl_errnum_t;

View File

@ -667,8 +667,6 @@ void hcl_seterrbfmt (hcl_t* hcl, hcl_errnum_t errnum, const hcl_bch_t* fmt, ...)
hcl_fmtout_t fo; hcl_fmtout_t fo;
if (hcl->shuterr) return; if (hcl->shuterr) return;
hcl->errnum = errnum;
hcl->errmsg.len = 0; hcl->errmsg.len = 0;
fo.mask = 0; /* not used */ fo.mask = 0; /* not used */
@ -678,6 +676,8 @@ void hcl_seterrbfmt (hcl_t* hcl, hcl_errnum_t errnum, const hcl_bch_t* fmt, ...)
va_start (ap, fmt); va_start (ap, fmt);
_errbfmtv (hcl, fmt, &fo, ap); _errbfmtv (hcl, fmt, &fo, ap);
va_end (ap); va_end (ap);
hcl->errnum = errnum;
} }
void hcl_seterrufmt (hcl_t* hcl, hcl_errnum_t errnum, const hcl_uch_t* fmt, ...) void hcl_seterrufmt (hcl_t* hcl, hcl_errnum_t errnum, const hcl_uch_t* fmt, ...)
@ -686,8 +686,6 @@ void hcl_seterrufmt (hcl_t* hcl, hcl_errnum_t errnum, const hcl_uch_t* fmt, ...)
hcl_fmtout_t fo; hcl_fmtout_t fo;
if (hcl->shuterr) return; if (hcl->shuterr) return;
hcl->errnum = errnum;
hcl->errmsg.len = 0; hcl->errmsg.len = 0;
fo.mask = 0; /* not used */ fo.mask = 0; /* not used */
@ -697,6 +695,8 @@ void hcl_seterrufmt (hcl_t* hcl, hcl_errnum_t errnum, const hcl_uch_t* fmt, ...)
va_start (ap, fmt); va_start (ap, fmt);
_errufmtv (hcl, fmt, &fo, ap); _errufmtv (hcl, fmt, &fo, ap);
va_end (ap); va_end (ap);
hcl->errnum = errnum;
} }
@ -705,8 +705,6 @@ void hcl_seterrbfmtv (hcl_t* hcl, hcl_errnum_t errnum, const hcl_bch_t* fmt, va_
hcl_fmtout_t fo; hcl_fmtout_t fo;
if (hcl->shuterr) return; if (hcl->shuterr) return;
hcl->errnum = errnum;
hcl->errmsg.len = 0; hcl->errmsg.len = 0;
fo.mask = 0; /* not used */ fo.mask = 0; /* not used */
@ -714,6 +712,7 @@ void hcl_seterrbfmtv (hcl_t* hcl, hcl_errnum_t errnum, const hcl_bch_t* fmt, va_
fo.putcs = put_errcs; fo.putcs = put_errcs;
_errbfmtv (hcl, fmt, &fo, ap); _errbfmtv (hcl, fmt, &fo, ap);
hcl->errnum = errnum;
} }
void hcl_seterrufmtv (hcl_t* hcl, hcl_errnum_t errnum, const hcl_uch_t* fmt, va_list ap) void hcl_seterrufmtv (hcl_t* hcl, hcl_errnum_t errnum, const hcl_uch_t* fmt, va_list ap)
@ -721,8 +720,6 @@ void hcl_seterrufmtv (hcl_t* hcl, hcl_errnum_t errnum, const hcl_uch_t* fmt, va_
hcl_fmtout_t fo; hcl_fmtout_t fo;
if (hcl->shuterr) return; if (hcl->shuterr) return;
hcl->errnum = errnum;
hcl->errmsg.len = 0; hcl->errmsg.len = 0;
fo.mask = 0; /* not used */ fo.mask = 0; /* not used */
@ -730,6 +727,7 @@ void hcl_seterrufmtv (hcl_t* hcl, hcl_errnum_t errnum, const hcl_uch_t* fmt, va_
fo.putcs = put_errcs; fo.putcs = put_errcs;
_errufmtv (hcl, fmt, &fo, ap); _errufmtv (hcl, fmt, &fo, ap);
hcl->errnum = errnum;
} }
/* -------------------------------------------------------------------------- /* --------------------------------------------------------------------------

View File

@ -2407,7 +2407,7 @@ int hcl_unreadchar (hcl_t* hcl, const hcl_iolxc_t* c)
{ {
if (hcl->c->nungots >= HCL_COUNTOF(hcl->c->ungot)) if (hcl->c->nungots >= HCL_COUNTOF(hcl->c->ungot))
{ {
hcl_seterrnum (hcl, HCL_EBUFFULL); hcl_seterrbfmt (hcl, HCL_EBUFFULL, "character unread buffer full");
return -1; return -1;
} }