summaryrefslogtreecommitdiffstats
path: root/stream.h
diff options
context:
space:
mode:
authorKaz Kylheku <kaz@kylheku.com>2009-11-13 09:33:27 -0800
committerKaz Kylheku <kaz@kylheku.com>2009-11-13 09:33:27 -0800
commit95e59dd555a038fd6eb70bc38e4e921d811b1f49 (patch)
treef3dc2ec7704ff24903618ed4ca5b09e5a1c2e5e8 /stream.h
parent673d5f3b84d276fb29233d6a3f485ccfe330be13 (diff)
downloadtxr-95e59dd555a038fd6eb70bc38e4e921d811b1f49.tar.gz
txr-95e59dd555a038fd6eb70bc38e4e921d811b1f49.tar.bz2
txr-95e59dd555a038fd6eb70bc38e4e921d811b1f49.zip
Previous commit broke UTF-8 lexing, by changing the get_char
semantics on the input stream to wide character input. Also, reading a query the command line (-c) must read bytes from a UTF-8 encoding of the string. We introduce a new get_byte function which can extract bytes from streams which provide it.
Diffstat (limited to 'stream.h')
-rw-r--r--stream.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/stream.h b/stream.h
index 893aabfe..b4354168 100644
--- a/stream.h
+++ b/stream.h
@@ -29,12 +29,14 @@ extern obj_t *std_input, *std_output, *std_error;
obj_t *make_stdio_stream(FILE *, obj_t *descr, obj_t *input, obj_t *output);
obj_t *make_pipe_stream(FILE *, obj_t *descr, obj_t *input, obj_t *output);
obj_t *make_string_input_stream(obj_t *);
+obj_t *make_string_byte_input_stream(obj_t *);
obj_t *make_string_output_stream(void);
obj_t *get_string_from_stream(obj_t *);
obj_t *make_dir_stream(DIR *);
obj_t *close_stream(obj_t *stream, obj_t *throw_on_error);
obj_t *get_line(obj_t *);
obj_t *get_char(obj_t *);
+obj_t *get_byte(obj_t *);
obj_t *vformat(obj_t *stream, const wchar_t *string, va_list);
obj_t *vcformat(obj_t *stream, const wchar_t *string, va_list);
obj_t *format(obj_t *stream, const wchar_t *string, ...);