From c71b79a13a7960f255e6e1d66ca543daba328771 Mon Sep 17 00:00:00 2001 From: Kaz Kylheku Date: Fri, 8 Dec 2017 18:11:59 -0800 Subject: New feature: structure delegate streams. A new kind of stream object which redirects its operations to the methods of a structure. * Makefile (OBJS): New object file, strudel.o. * lib.c (init): Call new strudel_init function. * lisplib.c (stream_wrap_set_entries, stream_wrap_instantiate): New static functions. (lisplib_init): Arrange for autloading of new stream-wrap.tl. * share/txr/stdlib/stream-wrap.tl: New file. * stream.c (put_string_s, put_char_s, put_byte_s, get_line_s, get_char_s, get_byte_s, unget_char_s, unget_byte_s, put_buf_s, fill_buf_s, flush_s, seek_s, truncate_s, get_prop_s, set_prop_s, get_error_s, get_error_str_s, clear_error_s, get_fd_s): New symbol variables. (stream_init): New symbol variables initialized. Numerous functions registered via these variables now rather than intern(...) expressions. * stream.h (put_string_s, put_char_s, put_byte_s, get_line_s, get_char_s, get_byte_s, unget_char_s, unget_byte_s, put_buf_s, fill_buf_s, flush_s, seek_s, truncate_s, get_prop_s, set_prop_s, get_error_s, get_error_str_s, clear_error_s, get_fd_s): Declared. * strudel.c, strudel.h: New files. --- stream.h | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'stream.h') diff --git a/stream.h b/stream.h index 17b64aa1..961694a3 100644 --- a/stream.h +++ b/stream.h @@ -125,6 +125,11 @@ extern val stdio_stream_s; extern val stdin_s, stdout_s, stddebug_s, stderr_s, stdnull_s; +extern val put_string_s, put_char_s, put_byte_s, get_line_s, get_char_s; +extern val get_byte_s, unget_char_s, unget_byte_s, put_buf_s, fill_buf_s; +extern val close_s, flush_s, seek_s, truncate_s, get_prop_s, set_prop_s; +extern val get_error_s, get_error_str_s, clear_error_s, get_fd_s; + extern val print_flo_precision_s, print_flo_digits_s, print_flo_format_s; extern val pprint_flo_format_s, print_base_s, print_circle_s; -- cgit v1.2.3