From 502ec6b0929f31fa60e3c8ecea36338ffcea207c Mon Sep 17 00:00:00 2001 From: Kaz Kylheku Date: Mon, 12 Mar 2012 23:52:40 -0700 Subject: Implementing put_byte for string output stream. This does the Right Thing with a mixture of bytes and characters. Incomplete byte sequences. * stream.c (struct strm_ops): Changing byte argument of put_byte to int, since the put_byte API function can just pass down that value after validating it. (stdio_handle): Use available typedef. (stdio_put_byte): Follow interface change in strm_ops. Do not validate the range of a byte; the put_byte higher level function does that now. (struct string_output): New members: ud, byte_buf, head, tail. (string_out_byte_callback, string_out_byte_flush): New static functions. (string_out_put_string): Flush any UTF-8 bytes in the byte buffer before putting the string. (string_out_put_byte): New static function, implementation for put_byte on string output streams. (string_out_ops): string_out_put_byte wired in. (make_string_output_stream): Initialize new members of of struct string_output. (get_string_from_stream): Flush any UTF-8 bytes in the byte buffer before retrieving the string. (put_byte): Validate that the byte is in range. Pass byte as C int down to the put_byte virtual. --- ChangeLog | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) (limited to 'ChangeLog') diff --git a/ChangeLog b/ChangeLog index f93d98af..17929da5 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,31 @@ +2012-03-12 Kaz Kylheku + + Implementing put_byte for string output stream. + This does the Right Thing with a mixture of bytes and characters. + Incomplete byte sequences. + + * stream.c (struct strm_ops): Changing byte argument of put_byte + to int, since the put_byte API function can just pass down that + value after validating it. + (stdio_handle): Use available typedef. + (stdio_put_byte): Follow interface change in strm_ops. + Do not validate the range of a byte; the put_byte higher + level function does that now. + (struct string_output): New members: ud, byte_buf, head, tail. + (string_out_byte_callback, string_out_byte_flush): New static + functions. + (string_out_put_string): Flush any UTF-8 bytes in the byte buffer + before putting the string. + (string_out_put_byte): New static function, implementation for + put_byte on string output streams. + (string_out_ops): string_out_put_byte wired in. + (make_string_output_stream): Initialize new members of + of struct string_output. + (get_string_from_stream): Flush any UTF-8 bytes in the byte buffer + before retrieving the string. + (put_byte): Validate that the byte is in range. Pass byte + as C int down to the put_byte virtual. + 2012-03-12 Kaz Kylheku Plugging memory leak. -- cgit v1.2.3