added MIO_ERROR macros

This commit is contained in:
hyung-hwan 2021-07-16 14:17:07 +00:00
parent de9c05a9b1
commit 1d2acf489b
3 changed files with 13 additions and 5 deletions

View File

@ -1399,7 +1399,7 @@ static int log_oocs (mio_fmtout_t* fmtout, const mio_ooch_t* ptr, mio_oow_t len)
mio->log.ptr[mio->log.len++] = '\n'; mio->log.ptr[mio->log.len++] = '\n';
} }
prim_write_log (mio, mio->log.last_mask, mio->log.ptr, mio->log.len); MIO_SYS_WRITE_LOG (mio, mio->log.last_mask, mio->log.ptr, mio->log.len);
mio->log.len = 0; mio->log.len = 0;
} }
@ -1443,7 +1443,7 @@ redo:
/* no line ending - append a line terminator */ /* no line ending - append a line terminator */
mio->log.ptr[mio->log.len++] = '\n'; mio->log.ptr[mio->log.len++] = '\n';
} }
prim_write_log (mio, mio->log.last_mask, mio->log.ptr, mio->log.len); MIO_SYS_WRITE_LOG (mio, mio->log.last_mask, mio->log.ptr, mio->log.len);
mio->log.len = 0; mio->log.len = 0;
} }
@ -1557,7 +1557,7 @@ mio_ooi_t mio_logbfmtv (mio_t* mio, mio_bitmask_t mask, const mio_bch_t* fmt, va
if (mio->log.len > 0 && mio->log.ptr[mio->log.len - 1] == '\n') if (mio->log.len > 0 && mio->log.ptr[mio->log.len - 1] == '\n')
{ {
prim_write_log (mio, mio->log.last_mask, mio->log.ptr, mio->log.len); MIO_SYS_WRITE_LOG (mio, mio->log.last_mask, mio->log.ptr, mio->log.len);
mio->log.len = 0; mio->log.len = 0;
} }
@ -1611,7 +1611,7 @@ mio_ooi_t mio_logufmtv (mio_t* mio, mio_bitmask_t mask, const mio_uch_t* fmt, va
if (mio->log.len > 0 && mio->log.ptr[mio->log.len - 1] == '\n') if (mio->log.len > 0 && mio->log.ptr[mio->log.len - 1] == '\n')
{ {
prim_write_log (mio, mio->log.last_mask, mio->log.ptr, mio->log.len); MIO_SYS_WRITE_LOG (mio, mio->log.last_mask, mio->log.ptr, mio->log.len);
mio->log.len = 0; mio->log.len = 0;
} }

View File

@ -101,7 +101,7 @@
/* i don't want an error raised inside the callback to override /* i don't want an error raised inside the callback to override
* the existing error number and message. */ * the existing error number and message. */
#define prim_write_log(mio,mask,ptr,len) do { \ #define MIO_SYS_WRITE_LOG(mio,mask,ptr,len) do { \
int __shuterr = (mio)->_shuterr; \ int __shuterr = (mio)->_shuterr; \
(mio)->_shuterr = 1; \ (mio)->_shuterr = 1; \
mio_sys_writelog (mio, mask, ptr, len); \ mio_sys_writelog (mio, mask, ptr, len); \

View File

@ -588,6 +588,14 @@ typedef enum mio_log_mask_t mio_log_mask_t;
#define MIO_INFO5(mio,fmt,a1,a2,a3,a4,a5) MIO_LOG5(mio, MIO_LOG_INFO | MIO_LOG_UNTYPED, fmt, a1, a2, a3, a4, a5) #define MIO_INFO5(mio,fmt,a1,a2,a3,a4,a5) MIO_LOG5(mio, MIO_LOG_INFO | MIO_LOG_UNTYPED, fmt, a1, a2, a3, a4, a5)
#define MIO_INFO6(mio,fmt,a1,a2,a3,a4,a5,a6) MIO_LOG6(mio, MIO_LOG_INFO | MIO_LOG_UNTYPED, fmt, a1, a2, a3, a4, a5, a6) #define MIO_INFO6(mio,fmt,a1,a2,a3,a4,a5,a6) MIO_LOG6(mio, MIO_LOG_INFO | MIO_LOG_UNTYPED, fmt, a1, a2, a3, a4, a5, a6)
#define MIO_ERROR0(mio,fmt) MIO_LOG0(mio, MIO_LOG_ERROR | MIO_LOG_UNTYPED, fmt)
#define MIO_ERROR1(mio,fmt,a1) MIO_LOG1(mio, MIO_LOG_ERROR | MIO_LOG_UNTYPED, fmt, a1)
#define MIO_ERROR2(mio,fmt,a1,a2) MIO_LOG2(mio, MIO_LOG_ERROR | MIO_LOG_UNTYPED, fmt, a1, a2)
#define MIO_ERROR3(mio,fmt,a1,a2,a3) MIO_LOG3(mio, MIO_LOG_ERROR | MIO_LOG_UNTYPED, fmt, a1, a2, a3)
#define MIO_ERROR4(mio,fmt,a1,a2,a3,a4) MIO_LOG4(mio, MIO_LOG_ERROR | MIO_LOG_UNTYPED, fmt, a1, a2, a3, a4)
#define MIO_ERROR5(mio,fmt,a1,a2,a3,a4,a5) MIO_LOG5(mio, MIO_LOG_ERROR | MIO_LOG_UNTYPED, fmt, a1, a2, a3, a4, a5)
#define MIO_ERROR6(mio,fmt,a1,a2,a3,a4,a5,a6) MIO_LOG6(mio, MIO_LOG_ERROR | MIO_LOG_UNTYPED, fmt, a1, a2, a3, a4, a5, a6)
/* ========================================================================= */ /* ========================================================================= */
enum mio_sys_mux_cmd_t enum mio_sys_mux_cmd_t