From 6b52dfe97eb885bb584b7faa2de7caafd6af6beb Mon Sep 17 00:00:00 2001 From: hyung-hwan Date: Thu, 2 Apr 2009 19:15:45 +0000 Subject: [PATCH] adding qse_sed_execute() --- qse/include/qse/utl/sed.h | 4 ++++ qse/lib/utl/sed.c | 13 +++++++++++++ qse/test/utl/sed01.c | 7 ++++--- 3 files changed, 21 insertions(+), 3 deletions(-) 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: