summaryrefslogtreecommitdiffstats
path: root/lib.h
diff options
context:
space:
mode:
authorKaz Kylheku <kaz@kylheku.com>2022-05-30 06:44:28 -0700
committerKaz Kylheku <kaz@kylheku.com>2022-05-30 06:44:28 -0700
commitcce3c4bef38888be015b0652d136e34c8ae7e59f (patch)
tree8f1af5da0718bf01b71ca860616ca7b8f3d652a6 /lib.h
parentbc591cb5ee04582dbdf17a0125987ec03e8c064f (diff)
downloadtxr-cce3c4bef38888be015b0652d136e34c8ae7e59f.tar.gz
txr-cce3c4bef38888be015b0652d136e34c8ae7e59f.tar.bz2
txr-cce3c4bef38888be015b0652d136e34c8ae7e59f.zip
New: spln and tokn functions.
Instead of trying to work the new count parameter into the spl and tok functions, it's better to make new ones. * eval.c (eval_init): spln and tokn intrinsics registered. * lib.[ch] (spln, tokn): New functions. * tests/015/split.tl: New test cases. * txr.1: Documented. * stdlib/doc-syms.tl: Updated.
Diffstat (limited to 'lib.h')
-rw-r--r--lib.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/lib.h b/lib.h
index 585a2c05..59b20645 100644
--- a/lib.h
+++ b/lib.h
@@ -927,10 +927,12 @@ val fmt_join(struct args *args);
val split_str(val str, val sep);
val split_str_keep(val str, val sep, val keep_sep_opt, val count_opt);
val spl(val sep, val arg1, val arg2);
+val spln(val count, val sep, val arg1, val arg2);
val split_str_set(val str, val set);
val sspl(val set, val str);
val tok_str(val str, val tok_regex, val keep_sep_opt, val count_opt);
val tok(val tok_regex, val arg1, val arg2);
+val tokn(val count, val tok_regex, val arg1, val arg2);
val tok_where(val str, val tok_regex);
val list_str(val str);
val trim_str(val str);