renamed qse_awk_rtx_setcb() to qse_awk_rtx_setrcb()

This commit is contained in:
hyung-hwan 2009-02-13 19:23:56 +00:00
parent 9d6816c51c
commit 527e1a23de
5 changed files with 27 additions and 27 deletions

View File

@ -1172,22 +1172,22 @@ void qse_awk_rtx_stop (
); );
/******/ /******/
/****f* AWK/qse_awk_rtx_getcb /****f* AWK/qse_awk_rtx_getrcb
* NAME * NAME
* qse_awk_rtx_setcb - get callback * qse_awk_rtx_getrcb - get callback
* SYNOPSIS * SYNOPSIS
*/ */
qse_awk_rcb_t* qse_awk_rtx_getcb ( qse_awk_rcb_t* qse_awk_rtx_getrcb (
qse_awk_rtx_t* rtx qse_awk_rtx_t* rtx
); );
/******/ /******/
/****f* AWK/qse_awk_rtx_setcb /****f* AWK/qse_awk_rtx_setrcb
* NAME * NAME
* qse_awk_rtx_setcb - set callback * qse_awk_rtx_setrcb - set callback
* SYNOPSIS * SYNOPSIS
*/ */
void qse_awk_rtx_setcb ( void qse_awk_rtx_setrcb (
qse_awk_rtx_t* rtx, qse_awk_rtx_t* rtx,
qse_awk_rcb_t* rcb qse_awk_rcb_t* rcb
); );

View File

@ -1399,7 +1399,7 @@ int Awk::run (const char_t** args, size_t nargs)
runctx.run = rtx; runctx.run = rtx;
*((Run**)qse_awk_rtx_getxtn(rtx)) = &runctx; *((Run**)qse_awk_rtx_getxtn(rtx)) = &runctx;
if (runCallback) qse_awk_rtx_cbs (rtx, &rcb); if (runCallback) qse_awk_rtx_setrcb (rtx, &rcb);
n = qse_awk_rtx_loop (rtx); n = qse_awk_rtx_loop (rtx);
if (n == -1) retrieveError (); if (n == -1) retrieveError ();
qse_awk_rtx_close (rtx); qse_awk_rtx_close (rtx);

View File

@ -372,7 +372,7 @@ struct qse_awk_rtx_t
qse_char_t errmsg[256]; qse_char_t errmsg[256];
qse_awk_t* awk; qse_awk_t* awk;
qse_awk_rcb_t* cbs; qse_awk_rcb_t* rcb;
}; };

View File

@ -710,14 +710,14 @@ qse_bool_t qse_awk_rtx_shouldstop (qse_awk_rtx_t* rtx)
return (rtx->exit_level == EXIT_ABORT || rtx->awk->stopall); return (rtx->exit_level == EXIT_ABORT || rtx->awk->stopall);
} }
qse_awk_rcb_t* qse_awk_rtx_getcb (qse_awk_rtx_t* rtx) qse_awk_rcb_t* qse_awk_rtx_getrcb (qse_awk_rtx_t* rtx)
{ {
return rtx->cbs; return rtx->rcb;
} }
void qse_awk_rtx_setcb (qse_awk_rtx_t* rtx, qse_awk_rcb_t* rcb) void qse_awk_rtx_setrcb (qse_awk_rtx_t* rtx, qse_awk_rcb_t* rcb)
{ {
rtx->cbs = rcb; rtx->rcb = rcb;
} }
static void free_namedval (qse_map_t* map, void* dptr, qse_size_t dlen) static void free_namedval (qse_map_t* map, void* dptr, qse_size_t dlen)
@ -738,7 +738,7 @@ static int init_rtx (qse_awk_rtx_t* rtx, qse_awk_t* awk, qse_awk_rio_t* rio)
QSE_MEMSET (rtx, 0, QSE_SIZEOF(qse_awk_rtx_t)); QSE_MEMSET (rtx, 0, QSE_SIZEOF(qse_awk_rtx_t));
rtx->awk = awk; rtx->awk = awk;
rtx->cbs = QSE_NULL; rtx->rcb = QSE_NULL;
rtx->stack = QSE_NULL; rtx->stack = QSE_NULL;
rtx->stack_top = 0; rtx->stack_top = 0;
@ -1336,10 +1336,10 @@ static int run_bpae_loop (qse_awk_rtx_t* rtx)
STACK_NARGS(rtx) = (void*)nargs; STACK_NARGS(rtx) = (void*)nargs;
/* call the callback */ /* call the callback */
if (rtx->cbs != QSE_NULL && rtx->cbs->on_enter != QSE_NULL) if (rtx->rcb != QSE_NULL && rtx->rcb->on_enter != QSE_NULL)
{ {
qse_awk_rtx_seterrnum (rtx, QSE_AWK_ENOERR); qse_awk_rtx_seterrnum (rtx, QSE_AWK_ENOERR);
ret = rtx->cbs->on_enter (rtx, rtx->cbs->data); ret = rtx->rcb->on_enter (rtx, rtx->rcb->data);
if (ret <= -1) if (ret <= -1)
{ {
if (rtx->errnum == QSE_AWK_ENOMEM) if (rtx->errnum == QSE_AWK_ENOMEM)
@ -1438,8 +1438,8 @@ static int run_bpae_loop (qse_awk_rtx_t* rtx)
v = STACK_RETVAL(rtx); v = STACK_RETVAL(rtx);
if (ret == 0) if (ret == 0)
{ {
if (rtx->cbs != QSE_NULL && rtx->cbs->on_exit != QSE_NULL) if (rtx->rcb != QSE_NULL && rtx->rcb->on_exit != QSE_NULL)
rtx->cbs->on_exit (rtx, v, rtx->cbs->data); rtx->rcb->on_exit (rtx, v, rtx->rcb->data);
} }
/* end the life of the gbl return value */ /* end the life of the gbl return value */
qse_awk_rtx_refdownval (rtx, v); qse_awk_rtx_refdownval (rtx, v);
@ -1546,8 +1546,8 @@ int qse_awk_rtx_call (
{ {
if (rtx->errnum == QSE_AWK_ENOERR) if (rtx->errnum == QSE_AWK_ENOERR)
{ {
if (rtx->cbs != QSE_NULL && rtx->cbs->on_exit != QSE_NULL) if (rtx->rcb != QSE_NULL && rtx->rcb->on_exit != QSE_NULL)
rtx->cbs->on_exit (rtx, crdata.val, rtx->cbs->data); rtx->rcb->on_exit (rtx, crdata.val, rtx->rcb->data);
} }
else ret = -1; else ret = -1;
qse_awk_rtx_refdownval(rtx, crdata.val); qse_awk_rtx_refdownval(rtx, crdata.val);
@ -1557,8 +1557,8 @@ int qse_awk_rtx_call (
{ {
qse_awk_rtx_refupval (rtx, v); qse_awk_rtx_refupval (rtx, v);
if (rtx->cbs != QSE_NULL && rtx->cbs->on_exit != QSE_NULL) if (rtx->rcb != QSE_NULL && rtx->rcb->on_exit != QSE_NULL)
rtx->cbs->on_exit (rtx, v, rtx->cbs->data); rtx->rcb->on_exit (rtx, v, rtx->rcb->data);
qse_awk_rtx_refdownval (rtx, v); qse_awk_rtx_refdownval (rtx, v);
} }
@ -1849,11 +1849,11 @@ static int run_block0 (qse_awk_rtx_t* run, qse_awk_nde_blk_t* nde)
#define ON_STATEMENT(rtx,nde) \ #define ON_STATEMENT(rtx,nde) \
if ((rtx)->awk->stopall) (rtx)->exit_level = EXIT_ABORT; \ if ((rtx)->awk->stopall) (rtx)->exit_level = EXIT_ABORT; \
if ((rtx)->cbs != QSE_NULL && \ if ((rtx)->rcb != QSE_NULL && \
(rtx)->cbs->on_statement != QSE_NULL) \ (rtx)->rcb->on_statement != QSE_NULL) \
{ \ { \
(rtx)->cbs->on_statement ( \ (rtx)->rcb->on_statement ( \
rtx, (nde)->line, (rtx)->cbs->data); \ rtx, (nde)->line, (rtx)->rcb->data); \
} }
static int run_statement (qse_awk_rtx_t* run, qse_awk_nde_t* nde) static int run_statement (qse_awk_rtx_t* run, qse_awk_nde_t* nde)

View File

@ -768,7 +768,7 @@ qse_awk_rtx_t* qse_awk_opensimple (qse_awk_t* awk, qse_char_t** icf, qse_awk_rcb
else rxtn->seed = (unsigned int) now; else rxtn->seed = (unsigned int) now;
srand (rxtn->seed); srand (rxtn->seed);
//qse_awk_rtx_setcb (rtx, rcb); //qse_awk_rtx_setrcb (rtx, rcb);
return rtx; return rtx;
} }
@ -804,7 +804,7 @@ int qse_awk_runsimple (qse_awk_t* awk, qse_char_t** icf, qse_awk_rcb_t* rcb)
else rxtn->seed = (unsigned int) now; else rxtn->seed = (unsigned int) now;
srand (rxtn->seed); srand (rxtn->seed);
qse_awk_rtx_setcb (rtx, rcb); qse_awk_rtx_setrcb (rtx, rcb);
/* execute the start callback if it exists */ /* execute the start callback if it exists */
if (rcb != QSE_NULL && rcb->on_start != QSE_NULL) if (rcb != QSE_NULL && rcb->on_start != QSE_NULL)