From 6acb0e79c810175194d644b2e37bb2bef0e9e972 Mon Sep 17 00:00:00 2001 From: akr Date: Sat, 16 Aug 2008 15:04:39 +0000 Subject: * include/ruby/encoding.h (rb_econv_check_error): declared. * transcode.c (make_econv_exception): new function. (transcode_loop): use make_econv_exception. (rb_econv_check_error): defined. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@18662 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- include/ruby/encoding.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'include/ruby') diff --git a/include/ruby/encoding.h b/include/ruby/encoding.h index 16cfef2539..18d32d87c6 100644 --- a/include/ruby/encoding.h +++ b/include/ruby/encoding.h @@ -254,7 +254,6 @@ rb_econv_result_t rb_econv_convert(rb_econv_t *ec, unsigned char **destination_buffer_ptr, unsigned char *destination_buffer_end, int flags); - /* result: 0:success -1:failure */ int rb_econv_insert_output(rb_econv_t *ec, const unsigned char *str, size_t len, const char *str_encoding); @@ -262,6 +261,9 @@ int rb_econv_insert_output(rb_econv_t *ec, /* encoding that rb_econv_insert_output doesn't need conversion */ const char *rb_econv_encoding_to_insert_output(rb_econv_t *ec); +/* raise an error if the last rb_econv_convert is error */ +void rb_econv_check_error(rb_econv_t *ec); + void rb_econv_close(rb_econv_t *ec); /* flags for rb_econv_open */ -- cgit v1.2.3