summaryrefslogtreecommitdiff
path: root/include
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
commit131e194cec5a36ac18d6c9abcae6aad6ccd5fd1d (patch)
tree46cafdd93d913930e75e194e7f43b8b207248243 /include
parentd6d2eed78ef765f321b33ebdd2bdd9901dd5a39f (diff)
* 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
Diffstat (limited to 'include')
-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 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;