summaryrefslogtreecommitdiffstats
path: root/include/ruby
diff options
context:
space:
mode:
authorakr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2008-08-15 09:12:56 +0000
committerakr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2008-08-15 09:12:56 +0000
commit6cc0c60ef2d2901e2aac45561ab7e2ab6b9c4c3e (patch)
tree46cafdd93d913930e75e194e7f43b8b207248243 /include/ruby
parent0e775441a2baac4305165a6e6892337996978596 (diff)
downloadruby-6cc0c60ef2d2901e2aac45561ab7e2ab6b9c4c3e.tar.gz
ruby-6cc0c60ef2d2901e2aac45561ab7e2ab6b9c4c3e.tar.xz
ruby-6cc0c60ef2d2901e2aac45561ab7e2ab6b9c4c3e.zip
* 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: http://svn.ruby-lang.org/repos/ruby/trunk@18643 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'include/ruby')
-rw-r--r--include/ruby/encoding.h11
1 files changed, 11 insertions, 0 deletions
diff --git a/include/ruby/encoding.h b/include/ruby/encoding.h
index d7ad0d023..675bd5d90 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;