summaryrefslogtreecommitdiffstats
path: root/match.h
diff options
context:
space:
mode:
authorKaz Kylheku <kaz@kylheku.com>2022-08-29 22:48:13 -0700
committerKaz Kylheku <kaz@kylheku.com>2022-08-29 22:48:13 -0700
commitceac568650dfe4234d3da21fa75bedeaf76dfbdd (patch)
tree8c2377634fc1ac254dbc972e3e6c8f491a4d6692 /match.h
parent1a3fe1a084fd68ff4f10ef8cf031f347563b79ca (diff)
downloadtxr-ceac568650dfe4234d3da21fa75bedeaf76dfbdd.tar.gz
txr-ceac568650dfe4234d3da21fa75bedeaf76dfbdd.tar.bz2
txr-ceac568650dfe4234d3da21fa75bedeaf76dfbdd.zip
txr: close streams.
* match.c (noclose_k): New keyword variable. (v_next_keys, v_output_keys): New static variables. (v_next_impl): Use v_next_keys in calculating alist, rather than freshly allocating it each time. Check for the new :noclose keyword; if it is missing, close any locally opened stream when done. (v_output): Refer to v_output_keys precalculated list rather than allocating it every time. (match_files): If a stream is opened in by a call to open_data_source from this function, then the stream is closed when this function returns. (syms_init): Intern the :noclose symbol. (plist_keys_init): New function. (match_init): Call plist_keys_init. * txr.1: Documented new :noclose option of @(next).
Diffstat (limited to 'match.h')
-rw-r--r--match.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/match.h b/match.h
index b697cc0a..47b6070c 100644
--- a/match.h
+++ b/match.h
@@ -29,7 +29,7 @@
extern val text_s, choose_s, gather_s, do_s, mdo_s, require_s, in_package_s;
extern val close_s, load_s, include_s, mod_s, modlast_s, line_s;
extern val else_s, elif_s;
-extern val counter_k, vars_k, lists_k, env_k, var_k, into_k, named_k;
+extern val counter_k, vars_k, lists_k, env_k, var_k, into_k, named_k, noclose_k;
val match_expand_keyword_args(val elem);
val match_expand_elem(val elem);
val match_filter(val name, val arg, val other_args);