summaryrefslogtreecommitdiffstats
path: root/lib.h
diff options
context:
space:
mode:
authorKaz Kylheku <kaz@kylheku.com>2021-09-07 07:14:02 -0700
committerKaz Kylheku <kaz@kylheku.com>2021-09-07 07:14:02 -0700
commit98ed59198be3104e82c00734e01f4a1022440d1b (patch)
tree1d6130cc914977b7897834407f6148cfc54cbec0 /lib.h
parent575851b07a498847b8ddeaf94db8bc177c4f57c1 (diff)
downloadtxr-98ed59198be3104e82c00734e01f4a1022440d1b.tar.gz
txr-98ed59198be3104e82c00734e01f4a1022440d1b.tar.bz2
txr-98ed59198be3104e82c00734e01f4a1022440d1b.zip
string-extend: third optional argument.
A Boolean optional argument to string-extend indicates whether this is likely the last call to string-extend, so memory can be trimmed accordingly. * eval.c (eval_init): Update string-extend registration. * filter.c (trie_filter_string): Pass nil for new argument of string_extend. * lib.c (str_seq, replace_str, lazy_str_force, lazy_str_force_upto): Pass nil for new argument of string_extend. (rem_impl, remove_if, separate): Pass t for new argument of string_extend on last iteration, nil otherwise. (string_extend): Implement new third argument, defaulted to nil. Switch from chk_grow_vec to the more specific chk_wrealloc, which simplifies the code. * lib.h (string_extend): Declaration updated. * parser.y (litchars): Pass t as last argument of string_extend since we know syntactically that these reductions finalize the string. (restlitchar): Pass nil as the last argument of string_extend, since we know syntactically that it isn't the last. * regex.c (scan_until_common): Pass nil for new argument of string_extend. * txr.1: Documented.
Diffstat (limited to 'lib.h')
-rw-r--r--lib.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib.h b/lib.h
index be62cf21..4c6993e6 100644
--- a/lib.h
+++ b/lib.h
@@ -884,7 +884,7 @@ val init_str(val str, const wchar_t *, val self);
val copy_str(val str);
val upcase_str(val str);
val downcase_str(val str);
-val string_extend(val str, val tail);
+val string_extend(val str, val tail, val finish);
val stringp(val str);
val lazy_stringp(val str);
val length_str(val str);