summaryrefslogtreecommitdiffstats
path: root/stream.h
diff options
context:
space:
mode:
authorKaz Kylheku <kaz@kylheku.com>2017-12-08 18:11:59 -0800
committerKaz Kylheku <kaz@kylheku.com>2017-12-08 18:11:59 -0800
commitc71b79a13a7960f255e6e1d66ca543daba328771 (patch)
tree30bf8f53afcf65ad0b8500ef879a5a4e99868dd9 /stream.h
parent8834a98cff2d8f80458957fccab5424f4b90cde5 (diff)
downloadtxr-c71b79a13a7960f255e6e1d66ca543daba328771.tar.gz
txr-c71b79a13a7960f255e6e1d66ca543daba328771.tar.bz2
txr-c71b79a13a7960f255e6e1d66ca543daba328771.zip
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.
Diffstat (limited to 'stream.h')
-rw-r--r--stream.h5
1 files changed, 5 insertions, 0 deletions
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;