diff options
author | Kaz Kylheku <kaz@kylheku.com> | 2016-01-01 12:23:00 -0800 |
---|---|---|
committer | Kaz Kylheku <kaz@kylheku.com> | 2016-01-01 12:23:00 -0800 |
commit | 27e0a161c083222ef78bcf6192b931aa815583b3 (patch) | |
tree | ebb045f0417307f3c7763ce900cbb4b50781e581 /stream.h | |
parent | bccdfcb523d7b0315c20a41dec43a6b0cf302a73 (diff) | |
download | txr-27e0a161c083222ef78bcf6192b931aa815583b3.tar.gz txr-27e0a161c083222ef78bcf6192b931aa815583b3.tar.bz2 txr-27e0a161c083222ef78bcf6192b931aa815583b3.zip |
Record-delimiting stream adapter.
* regex.c (read_until_match): New function.
(regex_init): Registered read-until-match intrinsic.
* regex.h (read_until_match): Declared.
* stream.c (struct delegate_base): New struct type.
(delegate_base_mark, delegate_put_string, delegate_put_char,
delegate_put_byte, delegate_get_char, delegate_get_byte,
delegate_unget_char, delegate_unget_byte, delegate_close,
delegate_flush, delegate_seek, delegate_truncate,
delegate_get_prop, delegate_set_prop, delegate_get_error,
delegate_get_error_str, delegate_clear_error,
make_delegate_stream): New static functions.
(struct record_adapter_base): New struct type.
(record_adapter_base_mark, record_adapter_mark_op,
record_adapter_get_line): New static functions.
(record_adapter_ops): New static structure.
(record_adapter): New function.
(stream_init): Registered record-adapter intrinsic.
* stream.h (record_adapter): Declared.
* txr.1: Documented read-until-match and record-adapter.
Diffstat (limited to 'stream.h')
-rw-r--r-- | stream.h | 1 |
1 files changed, 1 insertions, 0 deletions
@@ -111,6 +111,7 @@ val get_string_from_stream(val); val make_strlist_output_stream(void); val get_list_from_stream(val); val make_dir_stream(DIR *); +val record_adapter(val regex, val stream); val streamp(val obj); val real_time_stream_p(val obj); val stream_set_prop(val stream, val ind, val prop); |