diff options
author | Kaz Kylheku <kaz@kylheku.com> | 2016-04-20 05:13:19 -0700 |
---|---|---|
committer | Kaz Kylheku <kaz@kylheku.com> | 2016-04-20 05:13:19 -0700 |
commit | 03213f2aa15930d7336f582238f8abfacf17584a (patch) | |
tree | b06c13268925e3d9f40a45f041b1f6a3d2bfeb6c /regex.h | |
parent | 04575dff348209315fb24e3c809a93343f39783b (diff) | |
download | txr-03213f2aa15930d7336f582238f8abfacf17584a.tar.gz txr-03213f2aa15930d7336f582238f8abfacf17584a.tar.bz2 txr-03213f2aa15930d7336f582238f8abfacf17584a.zip |
read-until-match can optionally keep matched text.
* regex.c (read_until_match): New argument, include_match.
Three times repeated termination code refactored into block
reached by forward goto.
(regex_init): Registration of read-until-match updated.
* regex.h (read_until_match): Declaration updated.
* stream.c (struct record_adapter_base): New member,
include_match.
(record_adapter_get_line): Pass match to read_until_match
as new argument.
(record_adapater): New argument, include_match.
(stream_init): Update registration of record-adapter.
* stream.h (record_adapter): Declaration updated.
* txr.1: Updated.
Diffstat (limited to 'regex.h')
-rw-r--r-- | regex.h | 2 |
1 files changed, 1 insertions, 1 deletions
@@ -39,6 +39,6 @@ val search_regst(val haystack, val needle_regex, val start_num, val from_end); val match_regst(val str, val regex, val pos); val match_regst_right(val str, val regex, val end); val regsub(val regex, val repl, val str); -val read_until_match(val regex, val stream); +val read_until_match(val regex, val stream, val keep_match); int wide_display_char_p(wchar_t ch); void regex_init(void); |