diff --git a/qse/include/qse/utl/sed.h b/qse/include/qse/utl/sed.h index e43f4eb1..d966d9b9 100644 --- a/qse/include/qse/utl/sed.h +++ b/qse/include/qse/utl/sed.h @@ -185,6 +185,10 @@ int qse_sed_compile ( qse_size_t slen ); +int qse_sed_execute ( + qse_sed_t* sed +); + #ifdef __cplusplus } #endif diff --git a/qse/lib/utl/sed.c b/qse/lib/utl/sed.c index 01330900..cf7a70df 100644 --- a/qse/lib/utl/sed.c +++ b/qse/lib/utl/sed.c @@ -1196,3 +1196,16 @@ int qse_sed_compile (qse_sed_t* sed, const qse_char_t* sptr, qse_size_t slen) { return compile_source (sed, sptr, slen); } + +int qse_sed_execute (qse_sed_t* sed) +{ + qse_sed_cmd_t* c = sed->cmd.buf; + + while (c < sed->cmd.cur) + { + qse_printf (QSE_T(">>> %c\n"), c->type); + c++; + } + + return 0; +} diff --git a/qse/test/utl/sed01.c b/qse/test/utl/sed01.c index 71385104..fbd40f94 100644 --- a/qse/test/utl/sed01.c +++ b/qse/test/utl/sed01.c @@ -54,9 +54,10 @@ int sed_main (int argc, qse_char_t* argv[]) goto oops; } - //if (qse_sed_execute (sed, io) == -1) - //{ - //} + if (qse_sed_execute (sed/*, io*/) == -1) + { + } + ret = 0; oops: