changed code to allow an empty label when QSE_SED_STRICT is not set

added qse_sed_stop() and qse_sed_isstop()
This commit is contained in:
2011-09-20 22:40:45 +00:00
parent 7de8b649ef
commit 8f9011bc1d
8 changed files with 250 additions and 65 deletions

View File

@ -1,5 +1,5 @@
/*
* $Id: sed.h 569 2011-09-19 06:51:02Z hyunghwan.chung $
* $Id: sed.h 570 2011-09-20 04:40:45Z hyunghwan.chung $
*
Copyright 2006-2011 Chung, Hyung-Hwan.
This file is part of QSE.
@ -138,7 +138,7 @@ enum qse_sed_option_t
QSE_SED_KEEPTBS = (1 << 1), /**< keep an trailing backslash */
QSE_SED_ENSURENL = (1 << 2), /**< ensure NL at the text end */
QSE_SED_QUIET = (1 << 3), /**< do not print pattern space */
QSE_SED_STRICT = (1 << 4), /**< do strict address check */
QSE_SED_STRICT = (1 << 4), /**< do strict address and label check */
QSE_SED_STARTSTEP = (1 << 5), /**< allow start~step */
QSE_SED_ZEROA1 = (1 << 6), /**< allow 0,/regex/ */
QSE_SED_SAMELINE = (1 << 7), /**< allow text on the same line as c, a, i */
@ -366,6 +366,21 @@ int qse_sed_exec (
qse_sed_io_fun_t outf /**< stream writer */
);
/**
* The qse_sed_stop() function breaks running loop in qse_sed_exec().
* It doesn't affect blocking calls in stream handlers.
*/
void qse_sed_stop (
qse_sed_t* sed /**< stream editor */
);
/**
* The qse_sed_isstop() functions tests if qse_sed_stop() is called.
*/
int qse_sed_isstop (
qse_sed_t* sed /**< stream editor */
);
/**
* The qse_sed_getlformatter() function gets the text formatter for the 'l'
* command.