From 27e0a161c083222ef78bcf6192b931aa815583b3 Mon Sep 17 00:00:00 2001 From: Kaz Kylheku Date: Fri, 1 Jan 2016 12:23:00 -0800 Subject: 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. --- stream.h | 1 + 1 file changed, 1 insertion(+) (limited to 'stream.h') diff --git a/stream.h b/stream.h index da45ea05..d6abfc21 100644 --- a/stream.h +++ b/stream.h @@ -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); -- cgit v1.2.3