From 131e194cec5a36ac18d6c9abcae6aad6ccd5fd1d Mon Sep 17 00:00:00 2001 From: akr Date: Fri, 15 Aug 2008 09:12:56 +0000 Subject: * include/ruby/encoding.h (rb_econv_t): new field: last_error. * transcode.c (rb_trans_conv): new argument: result_position_ptr. (rb_econv_convert): fill last_error. (econv_result_to_symbol): extracted from econv_primitive_convert. (econv_primitive_errinfo): new method. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@18643 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- include/ruby/encoding.h | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'include/ruby') diff --git a/include/ruby/encoding.h b/include/ruby/encoding.h index d7ad0d0237..675bd5d90d 100644 --- a/include/ruby/encoding.h +++ b/include/ruby/encoding.h @@ -224,6 +224,17 @@ typedef struct { int num_finished; struct rb_transcoding *last_tc; + /* last error */ + struct { + rb_econv_result_t result; + const char *source_encoding; + const char *destination_encoding; + const unsigned char *error_bytes_start; + size_t error_bytes_len; + size_t readagain_len; + int partial_input; + } last_error; + /* The following fields are only for Encoding::Converter. * rb_econv_open set them NULL. */ rb_encoding *source_encoding; -- cgit v1.2.3